@wordpress/block-editor 12.1.0 → 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1853) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/autocompleters/block.js +11 -5
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/components/alignment-control/ui.js +9 -11
  5. package/build/components/alignment-control/ui.js.map +1 -1
  6. package/build/components/autocomplete/index.js +3 -4
  7. package/build/components/autocomplete/index.js.map +1 -1
  8. package/build/components/block-actions/index.js +8 -12
  9. package/build/components/block-actions/index.js.map +1 -1
  10. package/build/components/block-alignment-control/ui.js +17 -21
  11. package/build/components/block-alignment-control/ui.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.native.js +14 -17
  13. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  14. package/build/components/block-alignment-control/use-available-alignments.js +5 -10
  15. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  16. package/build/components/block-alignment-matrix-control/index.js +4 -6
  17. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  18. package/build/components/block-breadcrumb/index.js +9 -7
  19. package/build/components/block-breadcrumb/index.js.map +1 -1
  20. package/build/components/block-caption/index.native.js +30 -35
  21. package/build/components/block-caption/index.native.js.map +1 -1
  22. package/build/components/block-card/index.js +7 -9
  23. package/build/components/block-card/index.js.map +1 -1
  24. package/build/components/block-compare/block-view.js +8 -9
  25. package/build/components/block-compare/block-view.js.map +1 -1
  26. package/build/components/block-compare/index.js +7 -9
  27. package/build/components/block-compare/index.js.map +1 -1
  28. package/build/components/block-context/index.js +4 -5
  29. package/build/components/block-context/index.js.map +1 -1
  30. package/build/components/block-controls/fill.js +15 -22
  31. package/build/components/block-controls/fill.js.map +1 -1
  32. package/build/components/block-controls/hook.js +1 -3
  33. package/build/components/block-controls/hook.js.map +1 -1
  34. package/build/components/block-controls/slot.js +28 -18
  35. package/build/components/block-controls/slot.js.map +1 -1
  36. package/build/components/block-controls/slot.native.js +7 -17
  37. package/build/components/block-controls/slot.native.js.map +1 -1
  38. package/build/components/block-draggable/draggable-chip.js +5 -6
  39. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  40. package/build/components/block-draggable/draggable-chip.native.js +3 -4
  41. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  42. package/build/components/block-draggable/dropping-insertion-point.native.js +6 -7
  43. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  44. package/build/components/block-draggable/index.js +15 -16
  45. package/build/components/block-draggable/index.js.map +1 -1
  46. package/build/components/block-draggable/index.native.js +43 -58
  47. package/build/components/block-draggable/index.native.js.map +1 -1
  48. package/build/components/block-edit/edit.js +1 -4
  49. package/build/components/block-edit/edit.js.map +1 -1
  50. package/build/components/block-edit/edit.native.js +1 -4
  51. package/build/components/block-edit/edit.native.js.map +1 -1
  52. package/build/components/block-edit-visually-button/index.js +3 -4
  53. package/build/components/block-edit-visually-button/index.js.map +1 -1
  54. package/build/components/block-editing-mode/index.js +84 -0
  55. package/build/components/block-editing-mode/index.js.map +1 -0
  56. package/build/components/block-full-height-alignment-control/index.js +6 -7
  57. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  58. package/build/components/block-icon/index.js +7 -11
  59. package/build/components/block-icon/index.js.map +1 -1
  60. package/build/components/block-icon/index.native.js +9 -13
  61. package/build/components/block-icon/index.native.js.map +1 -1
  62. package/build/components/block-inspector/index.js +36 -46
  63. package/build/components/block-inspector/index.js.map +1 -1
  64. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  65. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  66. package/build/components/block-list/block-html.js +3 -4
  67. package/build/components/block-list/block-html.js.map +1 -1
  68. package/build/components/block-list/block-invalid-warning.js +3 -4
  69. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  70. package/build/components/block-list/block-invalid-warning.native.js +10 -15
  71. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  72. package/build/components/block-list/block-list-block-context.js +15 -0
  73. package/build/components/block-list/block-list-block-context.js.map +1 -0
  74. package/build/components/block-list/block-list-context.native.js +5 -11
  75. package/build/components/block-list/block-list-context.native.js.map +1 -1
  76. package/build/components/block-list/block-list-item-cell.native.js +5 -6
  77. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  78. package/build/components/block-list/block-list-item.native.js +17 -18
  79. package/build/components/block-list/block-list-item.native.js.map +1 -1
  80. package/build/components/block-list/block-outline.native.js +8 -9
  81. package/build/components/block-list/block-outline.native.js.map +1 -1
  82. package/build/components/block-list/block-selection-button.native.js +10 -12
  83. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  84. package/build/components/block-list/block.js +68 -83
  85. package/build/components/block-list/block.js.map +1 -1
  86. package/build/components/block-list/block.native.js +69 -90
  87. package/build/components/block-list/block.native.js.map +1 -1
  88. package/build/components/block-list/index.js +12 -15
  89. package/build/components/block-list/index.js.map +1 -1
  90. package/build/components/block-list/index.native.js +143 -153
  91. package/build/components/block-list/index.native.js.map +1 -1
  92. package/build/components/block-list/insertion-point.native.js +4 -5
  93. package/build/components/block-list/insertion-point.native.js.map +1 -1
  94. package/build/components/block-list/layout.js +6 -9
  95. package/build/components/block-list/layout.js.map +1 -1
  96. package/build/components/block-list/subdirectory-icon.js +10 -13
  97. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  98. package/build/components/block-list/use-block-props/index.js +17 -13
  99. package/build/components/block-list/use-block-props/index.js.map +1 -1
  100. package/build/components/block-list/use-block-props/index.native.js +1 -2
  101. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  102. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  103. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  104. package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  105. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  106. package/build/components/block-list/use-in-between-inserter.js +8 -8
  107. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  108. package/build/components/block-list-appender/index.js +30 -15
  109. package/build/components/block-list-appender/index.js.map +1 -1
  110. package/build/components/block-list-appender/index.native.js +9 -11
  111. package/build/components/block-list-appender/index.native.js.map +1 -1
  112. package/build/components/block-lock/menu-item.js +3 -4
  113. package/build/components/block-lock/menu-item.js.map +1 -1
  114. package/build/components/block-lock/modal.js +6 -9
  115. package/build/components/block-lock/modal.js.map +1 -1
  116. package/build/components/block-lock/toolbar.js +4 -10
  117. package/build/components/block-lock/toolbar.js.map +1 -1
  118. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +67 -70
  119. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  120. package/build/components/block-mobile-toolbar/index.native.js +26 -34
  121. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  122. package/build/components/block-mover/button.js +6 -7
  123. package/build/components/block-mover/button.js.map +1 -1
  124. package/build/components/block-mover/index.js +5 -8
  125. package/build/components/block-mover/index.js.map +1 -1
  126. package/build/components/block-mover/index.native.js +23 -46
  127. package/build/components/block-mover/index.native.js.map +1 -1
  128. package/build/components/block-mover/mover-description.native.js +7 -10
  129. package/build/components/block-mover/mover-description.native.js.map +1 -1
  130. package/build/components/block-navigation/dropdown.js +20 -25
  131. package/build/components/block-navigation/dropdown.js.map +1 -1
  132. package/build/components/block-parent-selector/index.js +2 -2
  133. package/build/components/block-parent-selector/index.js.map +1 -1
  134. package/build/components/block-pattern-setup/index.js +27 -31
  135. package/build/components/block-pattern-setup/index.js.map +1 -1
  136. package/build/components/block-pattern-setup/setup-toolbar.js +35 -42
  137. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  138. package/build/components/block-patterns-list/index.js +74 -81
  139. package/build/components/block-patterns-list/index.js.map +1 -1
  140. package/build/components/block-popover/drop-zone.js +4 -5
  141. package/build/components/block-popover/drop-zone.js.map +1 -1
  142. package/build/components/block-popover/inbetween.js +10 -15
  143. package/build/components/block-popover/inbetween.js.map +1 -1
  144. package/build/components/block-popover/index.js +14 -15
  145. package/build/components/block-popover/index.js.map +1 -1
  146. package/build/components/block-preview/auto.js +6 -8
  147. package/build/components/block-preview/auto.js.map +1 -1
  148. package/build/components/block-preview/index.js +15 -18
  149. package/build/components/block-preview/index.js.map +1 -1
  150. package/build/components/block-settings/button.native.js +7 -10
  151. package/build/components/block-settings/button.native.js.map +1 -1
  152. package/build/components/block-settings-menu/block-convert-button.js +5 -7
  153. package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
  154. package/build/components/block-settings-menu/block-html-convert-button.js +10 -14
  155. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  156. package/build/components/block-settings-menu/block-mode-toggle.js +19 -25
  157. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  158. package/build/components/block-settings-menu/block-settings-dropdown.js +132 -111
  159. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  160. package/build/components/block-settings-menu/index.js +4 -5
  161. package/build/components/block-settings-menu/index.js.map +1 -1
  162. package/build/components/block-settings-menu-controls/index.js +14 -16
  163. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  164. package/build/components/block-styles/index.js +6 -7
  165. package/build/components/block-styles/index.js.map +1 -1
  166. package/build/components/block-styles/index.native.js +5 -7
  167. package/build/components/block-styles/index.native.js.map +1 -1
  168. package/build/components/block-styles/menu-items.js +4 -5
  169. package/build/components/block-styles/menu-items.js.map +1 -1
  170. package/build/components/block-styles/preview-panel.js +8 -12
  171. package/build/components/block-styles/preview-panel.js.map +1 -1
  172. package/build/components/block-styles/preview.native.js +6 -7
  173. package/build/components/block-styles/preview.native.js.map +1 -1
  174. package/build/components/block-styles/use-styles-for-block.js +7 -9
  175. package/build/components/block-styles/use-styles-for-block.js.map +1 -1
  176. package/build/components/block-styles/utils.js +4 -7
  177. package/build/components/block-styles/utils.js.map +1 -1
  178. package/build/components/block-switcher/block-styles-menu.js +4 -5
  179. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  180. package/build/components/block-switcher/block-transformations-menu.js +29 -26
  181. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  182. package/build/components/block-switcher/block-transformations-menu.native.js +9 -10
  183. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  184. package/build/components/block-switcher/block-variation-transformations.js +116 -0
  185. package/build/components/block-switcher/block-variation-transformations.js.map +1 -0
  186. package/build/components/block-switcher/index.js +64 -55
  187. package/build/components/block-switcher/index.js.map +1 -1
  188. package/build/components/block-switcher/pattern-transformations-menu.js +21 -25
  189. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  190. package/build/components/block-switcher/preview-block-popover.js +3 -4
  191. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  192. package/build/components/block-switcher/utils.js +2 -3
  193. package/build/components/block-switcher/utils.js.map +1 -1
  194. package/build/components/block-title/index.js +5 -6
  195. package/build/components/block-title/index.js.map +1 -1
  196. package/build/components/block-title/use-block-display-title.js +5 -6
  197. package/build/components/block-title/use-block-display-title.js.map +1 -1
  198. package/build/components/block-toolbar/index.js +13 -12
  199. package/build/components/block-toolbar/index.js.map +1 -1
  200. package/build/components/block-toolbar/utils.js +14 -16
  201. package/build/components/block-toolbar/utils.js.map +1 -1
  202. package/build/components/block-tools/back-compat.js +3 -4
  203. package/build/components/block-tools/back-compat.js.map +1 -1
  204. package/build/components/block-tools/block-contextual-toolbar.js +10 -9
  205. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  206. package/build/components/block-tools/block-selection-button.js +6 -9
  207. package/build/components/block-tools/block-selection-button.js.map +1 -1
  208. package/build/components/block-tools/index.js +6 -7
  209. package/build/components/block-tools/index.js.map +1 -1
  210. package/build/components/block-tools/insertion-point.js +17 -14
  211. package/build/components/block-tools/insertion-point.js.map +1 -1
  212. package/build/components/block-tools/selected-block-popover.js +19 -20
  213. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  214. package/build/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  215. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  216. package/build/components/block-tools/zoom-out-mode-inserters.js +3 -4
  217. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  218. package/build/components/block-types-list/index.js +8 -9
  219. package/build/components/block-types-list/index.js.map +1 -1
  220. package/build/components/block-types-list/index.native.js +22 -27
  221. package/build/components/block-types-list/index.native.js.map +1 -1
  222. package/build/components/block-variation-picker/index.js +8 -9
  223. package/build/components/block-variation-picker/index.js.map +1 -1
  224. package/build/components/block-variation-picker/index.native.js +7 -9
  225. package/build/components/block-variation-picker/index.native.js.map +1 -1
  226. package/build/components/block-variation-transforms/index.js +30 -41
  227. package/build/components/block-variation-transforms/index.js.map +1 -1
  228. package/build/components/block-vertical-alignment-control/ui.js +7 -9
  229. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  230. package/build/components/border-radius-control/all-input-control.js +7 -8
  231. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  232. package/build/components/border-radius-control/index.js +9 -10
  233. package/build/components/border-radius-control/index.js.map +1 -1
  234. package/build/components/border-radius-control/input-controls.js +8 -11
  235. package/build/components/border-radius-control/input-controls.js.map +1 -1
  236. package/build/components/border-radius-control/linked-button.js +4 -5
  237. package/build/components/border-radius-control/linked-button.js.map +1 -1
  238. package/build/components/border-radius-control/utils.js +3 -7
  239. package/build/components/border-radius-control/utils.js.map +1 -1
  240. package/build/components/button-block-appender/index.js +13 -15
  241. package/build/components/button-block-appender/index.js.map +1 -1
  242. package/build/components/button-block-appender/index.native.js +25 -29
  243. package/build/components/button-block-appender/index.native.js.map +1 -1
  244. package/build/components/caption/index.native.js +40 -43
  245. package/build/components/caption/index.native.js.map +1 -1
  246. package/build/components/child-layout-control/index.js +5 -6
  247. package/build/components/child-layout-control/index.js.map +1 -1
  248. package/build/components/color-palette/control.js +5 -6
  249. package/build/components/color-palette/control.js.map +1 -1
  250. package/build/components/color-palette/with-color-context.js +1 -7
  251. package/build/components/color-palette/with-color-context.js.map +1 -1
  252. package/build/components/color-style-selector/index.js +28 -35
  253. package/build/components/color-style-selector/index.js.map +1 -1
  254. package/build/components/colors/utils.js +5 -8
  255. package/build/components/colors/utils.js.map +1 -1
  256. package/build/components/colors/with-colors.js +9 -24
  257. package/build/components/colors/with-colors.js.map +1 -1
  258. package/build/components/colors-gradients/control.js +19 -22
  259. package/build/components/colors-gradients/control.js.map +1 -1
  260. package/build/components/colors-gradients/dropdown.js +32 -39
  261. package/build/components/colors-gradients/dropdown.js.map +1 -1
  262. package/build/components/colors-gradients/panel-color-gradient-settings.js +20 -25
  263. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  264. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  265. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  266. package/build/components/contrast-checker/index.js +12 -13
  267. package/build/components/contrast-checker/index.js.map +1 -1
  268. package/build/components/contrast-checker/index.native.js +16 -18
  269. package/build/components/contrast-checker/index.native.js.map +1 -1
  270. package/build/components/convert-to-group-buttons/index.js +15 -11
  271. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  272. package/build/components/convert-to-group-buttons/index.native.js +86 -3
  273. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  274. package/build/components/convert-to-group-buttons/toolbar.js +6 -12
  275. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  276. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +22 -38
  277. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  278. package/build/components/copy-handler/index.js +4 -7
  279. package/build/components/copy-handler/index.js.map +1 -1
  280. package/build/components/date-format-picker/index.js +12 -16
  281. package/build/components/date-format-picker/index.js.map +1 -1
  282. package/build/components/default-block-appender/index.js +7 -9
  283. package/build/components/default-block-appender/index.js.map +1 -1
  284. package/build/components/default-block-appender/index.native.js +8 -10
  285. package/build/components/default-block-appender/index.native.js.map +1 -1
  286. package/build/components/default-style-picker/index.js +14 -22
  287. package/build/components/default-style-picker/index.js.map +1 -1
  288. package/build/components/duotone/components.js +14 -18
  289. package/build/components/duotone/components.js.map +1 -1
  290. package/build/components/duotone/utils.js +1 -2
  291. package/build/components/duotone/utils.js.map +1 -1
  292. package/build/components/duotone-control/index.js +12 -15
  293. package/build/components/duotone-control/index.js.map +1 -1
  294. package/build/components/editable-text/index.js +5 -6
  295. package/build/components/editable-text/index.js.map +1 -1
  296. package/build/components/editor-styles/index.js +4 -5
  297. package/build/components/editor-styles/index.js.map +1 -1
  298. package/build/components/floating-toolbar/index.native.js +7 -8
  299. package/build/components/floating-toolbar/index.native.js.map +1 -1
  300. package/build/components/font-appearance-control/index.js +19 -26
  301. package/build/components/font-appearance-control/index.js.map +1 -1
  302. package/build/components/font-family/index.js +10 -12
  303. package/build/components/font-family/index.js.map +1 -1
  304. package/build/components/font-sizes/fluid-utils.js +17 -21
  305. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  306. package/build/components/font-sizes/utils.js +6 -12
  307. package/build/components/font-sizes/utils.js.map +1 -1
  308. package/build/components/font-sizes/with-font-sizes.js +11 -30
  309. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  310. package/build/components/global-styles/advanced-panel.js +7 -10
  311. package/build/components/global-styles/advanced-panel.js.map +1 -1
  312. package/build/components/global-styles/border-panel.js +45 -78
  313. package/build/components/global-styles/border-panel.js.map +1 -1
  314. package/build/components/global-styles/color-panel.js +104 -147
  315. package/build/components/global-styles/color-panel.js.map +1 -1
  316. package/build/components/global-styles/color-panel.native.js +25 -42
  317. package/build/components/global-styles/color-panel.native.js.map +1 -1
  318. package/build/components/global-styles/dimensions-panel.js +81 -111
  319. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  320. package/build/components/global-styles/effects-panel.js +58 -72
  321. package/build/components/global-styles/effects-panel.js.map +1 -1
  322. package/build/components/global-styles/filters-panel.js +53 -71
  323. package/build/components/global-styles/filters-panel.js.map +1 -1
  324. package/build/components/global-styles/get-block-css-selector.js +4 -7
  325. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  326. package/build/components/global-styles/hooks.js +22 -37
  327. package/build/components/global-styles/hooks.js.map +1 -1
  328. package/build/components/global-styles/typography-panel.js +69 -125
  329. package/build/components/global-styles/typography-panel.js.map +1 -1
  330. package/build/components/global-styles/typography-utils.js +49 -26
  331. package/build/components/global-styles/typography-utils.js.map +1 -1
  332. package/build/components/global-styles/use-global-styles-output.js +140 -235
  333. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  334. package/build/components/global-styles/utils.js +11 -27
  335. package/build/components/global-styles/utils.js.map +1 -1
  336. package/build/components/gradients/use-gradient.js +6 -7
  337. package/build/components/gradients/use-gradient.js.map +1 -1
  338. package/build/components/height-control/index.js +9 -10
  339. package/build/components/height-control/index.js.map +1 -1
  340. package/build/components/iframe/index.js +52 -80
  341. package/build/components/iframe/index.js.map +1 -1
  342. package/build/components/iframe/use-compatibility-styles.js +29 -20
  343. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  344. package/build/components/image-editor/aspect-ratio-dropdown.js +83 -91
  345. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  346. package/build/components/image-editor/context.js +9 -10
  347. package/build/components/image-editor/context.js.map +1 -1
  348. package/build/components/image-editor/cropper.js +11 -12
  349. package/build/components/image-editor/cropper.js.map +1 -1
  350. package/build/components/image-editor/index.js +12 -13
  351. package/build/components/image-editor/index.js.map +1 -1
  352. package/build/components/image-editor/use-save-image.js +11 -12
  353. package/build/components/image-editor/use-save-image.js.map +1 -1
  354. package/build/components/image-editor/use-transform-image.js +5 -6
  355. package/build/components/image-editor/use-transform-image.js.map +1 -1
  356. package/build/components/image-editor/zoom-dropdown.js +10 -13
  357. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  358. package/build/components/image-size-control/index.js +12 -13
  359. package/build/components/image-size-control/index.js.map +1 -1
  360. package/build/components/inner-blocks/button-block-appender.js +7 -8
  361. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  362. package/build/components/inner-blocks/default-block-appender.js +6 -8
  363. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  364. package/build/components/inner-blocks/index.js +4 -7
  365. package/build/components/inner-blocks/index.js.map +1 -1
  366. package/build/components/inner-blocks/index.native.js +8 -10
  367. package/build/components/inner-blocks/index.native.js.map +1 -1
  368. package/build/components/inner-blocks/use-block-context.js +1 -4
  369. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  370. package/build/components/inner-blocks/use-nested-settings-update.js +15 -9
  371. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  372. package/build/components/inserter/block-patterns-explorer/explorer.js +9 -11
  373. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  374. package/build/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  375. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  376. package/build/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  377. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  378. package/build/components/inserter/block-patterns-tab.js +29 -40
  379. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  380. package/build/components/inserter/block-types-tab.js +7 -9
  381. package/build/components/inserter/block-types-tab.js.map +1 -1
  382. package/build/components/inserter/block-types-tab.native.js +8 -9
  383. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  384. package/build/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  385. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  386. package/build/components/inserter/hooks/use-block-types-state.js +5 -6
  387. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  388. package/build/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  389. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  390. package/build/components/inserter/hooks/use-debounced-input.js +1 -2
  391. package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
  392. package/build/components/inserter/hooks/use-insertion-point.js +10 -12
  393. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  394. package/build/components/inserter/index.js +40 -58
  395. package/build/components/inserter/index.js.map +1 -1
  396. package/build/components/inserter/index.native.js +24 -31
  397. package/build/components/inserter/index.native.js.map +1 -1
  398. package/build/components/inserter/library.js +11 -12
  399. package/build/components/inserter/library.js.map +1 -1
  400. package/build/components/inserter/media-tab/hooks.js +2 -5
  401. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  402. package/build/components/inserter/media-tab/media-list.js +6 -7
  403. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  404. package/build/components/inserter/media-tab/media-panel.js +12 -14
  405. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  406. package/build/components/inserter/media-tab/media-preview.js +47 -58
  407. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  408. package/build/components/inserter/media-tab/media-tab.js +24 -28
  409. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  410. package/build/components/inserter/media-tab/utils.js +3 -5
  411. package/build/components/inserter/media-tab/utils.js.map +1 -1
  412. package/build/components/inserter/menu.js +15 -19
  413. package/build/components/inserter/menu.js.map +1 -1
  414. package/build/components/inserter/menu.native.js +27 -31
  415. package/build/components/inserter/menu.native.js.map +1 -1
  416. package/build/components/inserter/mobile-tab-navigation.js +7 -9
  417. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  418. package/build/components/inserter/panel.js +5 -6
  419. package/build/components/inserter/panel.js.map +1 -1
  420. package/build/components/inserter/preview-panel.js +4 -5
  421. package/build/components/inserter/preview-panel.js.map +1 -1
  422. package/build/components/inserter/quick-inserter.js +9 -12
  423. package/build/components/inserter/quick-inserter.js.map +1 -1
  424. package/build/components/inserter/reusable-blocks-tab.js +13 -18
  425. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  426. package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
  427. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  428. package/build/components/inserter/search-items.js +12 -40
  429. package/build/components/inserter/search-items.js.map +1 -1
  430. package/build/components/inserter/search-results.js +34 -22
  431. package/build/components/inserter/search-results.js.map +1 -1
  432. package/build/components/inserter/search-results.native.js +11 -12
  433. package/build/components/inserter/search-results.native.js.map +1 -1
  434. package/build/components/inserter/tabs.js +8 -9
  435. package/build/components/inserter/tabs.js.map +1 -1
  436. package/build/components/inserter/tabs.native.js +37 -55
  437. package/build/components/inserter/tabs.native.js.map +1 -1
  438. package/build/components/inserter/utils.native.js +13 -17
  439. package/build/components/inserter/utils.native.js.map +1 -1
  440. package/build/components/inserter-draggable-blocks/index.js +11 -13
  441. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  442. package/build/components/inserter-list-item/index.js +68 -72
  443. package/build/components/inserter-list-item/index.js.map +1 -1
  444. package/build/components/inserter-listbox/index.js +3 -4
  445. package/build/components/inserter-listbox/index.js.map +1 -1
  446. package/build/components/inserter-listbox/item.js +6 -7
  447. package/build/components/inserter-listbox/item.js.map +1 -1
  448. package/build/components/inspector-controls/block-support-slot-container.js +4 -5
  449. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  450. package/build/components/inspector-controls/block-support-tools-panel.js +6 -8
  451. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  452. package/build/components/inspector-controls/fill.js +13 -24
  453. package/build/components/inspector-controls/fill.js.map +1 -1
  454. package/build/components/inspector-controls/fill.native.js +7 -11
  455. package/build/components/inspector-controls/fill.native.js.map +1 -1
  456. package/build/components/inspector-controls/slot.js +9 -13
  457. package/build/components/inspector-controls/slot.js.map +1 -1
  458. package/build/components/inspector-controls/slot.native.js +6 -10
  459. package/build/components/inspector-controls/slot.native.js.map +1 -1
  460. package/build/components/inspector-controls-tabs/index.js +6 -7
  461. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  462. package/build/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  463. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  464. package/build/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  465. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  466. package/build/components/inspector-controls-tabs/settings-tab.js +3 -6
  467. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  468. package/build/components/inspector-controls-tabs/styles-tab.js +5 -6
  469. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  470. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  471. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  472. package/build/components/inspector-popover-header/index.js +18 -22
  473. package/build/components/inspector-popover-header/index.js.map +1 -1
  474. package/build/components/justify-content-control/ui.js +8 -10
  475. package/build/components/justify-content-control/ui.js.map +1 -1
  476. package/build/components/letter-spacing-control/index.js +6 -7
  477. package/build/components/letter-spacing-control/index.js.map +1 -1
  478. package/build/components/line-height-control/index.js +13 -18
  479. package/build/components/line-height-control/index.js.map +1 -1
  480. package/build/components/line-height-control/index.native.js +4 -5
  481. package/build/components/line-height-control/index.native.js.map +1 -1
  482. package/build/components/link-control/index.js +84 -63
  483. package/build/components/link-control/index.js.map +1 -1
  484. package/build/components/link-control/is-url-like.js +32 -2
  485. package/build/components/link-control/is-url-like.js.map +1 -1
  486. package/build/components/link-control/link-preview.js +24 -27
  487. package/build/components/link-control/link-preview.js.map +1 -1
  488. package/build/components/link-control/search-create-button.js +7 -9
  489. package/build/components/link-control/search-create-button.js.map +1 -1
  490. package/build/components/link-control/search-input.js +22 -27
  491. package/build/components/link-control/search-input.js.map +1 -1
  492. package/build/components/link-control/search-item.js +13 -15
  493. package/build/components/link-control/search-item.js.map +1 -1
  494. package/build/components/link-control/search-results.js +22 -28
  495. package/build/components/link-control/search-results.js.map +1 -1
  496. package/build/components/link-control/settings-drawer.js +6 -35
  497. package/build/components/link-control/settings-drawer.js.map +1 -1
  498. package/build/components/link-control/settings.js +6 -8
  499. package/build/components/link-control/settings.js.map +1 -1
  500. package/build/components/link-control/use-internal-value.js +54 -0
  501. package/build/components/link-control/use-internal-value.js.map +1 -0
  502. package/build/components/link-control/use-rich-url-data.js +1 -1
  503. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  504. package/build/components/link-control/use-search-handler.js +10 -23
  505. package/build/components/link-control/use-search-handler.js.map +1 -1
  506. package/build/components/list-view/appender.js +18 -13
  507. package/build/components/list-view/appender.js.map +1 -1
  508. package/build/components/list-view/aria-referenced-text.js +44 -0
  509. package/build/components/list-view/aria-referenced-text.js.map +1 -0
  510. package/build/components/list-view/block-contents.js +40 -38
  511. package/build/components/list-view/block-contents.js.map +1 -1
  512. package/build/components/list-view/block-select-button.js +67 -21
  513. package/build/components/list-view/block-select-button.js.map +1 -1
  514. package/build/components/list-view/block.js +134 -120
  515. package/build/components/list-view/block.js.map +1 -1
  516. package/build/components/list-view/branch.js +6 -8
  517. package/build/components/list-view/branch.js.map +1 -1
  518. package/build/components/list-view/drop-indicator.js +4 -5
  519. package/build/components/list-view/drop-indicator.js.map +1 -1
  520. package/build/components/list-view/expander.js +3 -4
  521. package/build/components/list-view/expander.js.map +1 -1
  522. package/build/components/list-view/index.js +56 -46
  523. package/build/components/list-view/index.js.map +1 -1
  524. package/build/components/list-view/leaf.js +10 -11
  525. package/build/components/list-view/leaf.js.map +1 -1
  526. package/build/components/list-view/use-block-selection.js +4 -6
  527. package/build/components/list-view/use-block-selection.js.map +1 -1
  528. package/build/components/list-view/use-list-view-client-ids.js +29 -8
  529. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  530. package/build/components/list-view/use-list-view-drop-zone.js +25 -13
  531. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  532. package/build/components/list-view/use-list-view-expand-selected-item.js +4 -5
  533. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  534. package/build/components/list-view/use-list-view-scroll-into-view.js +5 -6
  535. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  536. package/build/components/media-placeholder/index.js +71 -92
  537. package/build/components/media-placeholder/index.js.map +1 -1
  538. package/build/components/media-placeholder/index.native.js +5 -6
  539. package/build/components/media-placeholder/index.native.js.map +1 -1
  540. package/build/components/media-replace-flow/index.js +94 -107
  541. package/build/components/media-replace-flow/index.js.map +1 -1
  542. package/build/components/media-upload/check.js +4 -5
  543. package/build/components/media-upload/check.js.map +1 -1
  544. package/build/components/media-upload/index.native.js +1 -1
  545. package/build/components/media-upload/index.native.js.map +1 -1
  546. package/build/components/multi-selection-inspector/index.js +3 -4
  547. package/build/components/multi-selection-inspector/index.js.map +1 -1
  548. package/build/components/navigable-toolbar/index.js +16 -15
  549. package/build/components/navigable-toolbar/index.js.map +1 -1
  550. package/build/components/observe-typing/index.js +3 -4
  551. package/build/components/observe-typing/index.js.map +1 -1
  552. package/build/components/panel-color-settings/index.js +4 -5
  553. package/build/components/panel-color-settings/index.js.map +1 -1
  554. package/build/components/plain-text/index.js +4 -6
  555. package/build/components/plain-text/index.js.map +1 -1
  556. package/build/components/plain-text/index.native.js +8 -14
  557. package/build/components/plain-text/index.native.js.map +1 -1
  558. package/build/components/preview-options/index.js +8 -9
  559. package/build/components/preview-options/index.js.map +1 -1
  560. package/build/components/provider/block-refs-provider.js +3 -4
  561. package/build/components/provider/block-refs-provider.js.map +1 -1
  562. package/build/components/provider/use-block-sync.js +7 -8
  563. package/build/components/provider/use-block-sync.js.map +1 -1
  564. package/build/components/provider/with-registry-provider.js +5 -7
  565. package/build/components/provider/with-registry-provider.js.map +1 -1
  566. package/build/components/publish-date-time-picker/index.js +6 -9
  567. package/build/components/publish-date-time-picker/index.js.map +1 -1
  568. package/build/components/recursion-provider/index.js +7 -11
  569. package/build/components/recursion-provider/index.js.map +1 -1
  570. package/build/components/resizable-box-popover/index.js +5 -6
  571. package/build/components/resizable-box-popover/index.js.map +1 -1
  572. package/build/components/responsive-block-control/label.js +5 -6
  573. package/build/components/responsive-block-control/label.js.map +1 -1
  574. package/build/components/rich-text/embed-handler-picker.native.js +6 -10
  575. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  576. package/build/components/rich-text/format-edit.js +7 -8
  577. package/build/components/rich-text/format-edit.js.map +1 -1
  578. package/build/components/rich-text/format-toolbar/index.js +9 -18
  579. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  580. package/build/components/rich-text/format-toolbar-container.js +13 -16
  581. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  582. package/build/components/rich-text/index.js +43 -47
  583. package/build/components/rich-text/index.js.map +1 -1
  584. package/build/components/rich-text/index.native.js +130 -157
  585. package/build/components/rich-text/index.native.js.map +1 -1
  586. package/build/components/rich-text/input-event.js +4 -5
  587. package/build/components/rich-text/input-event.js.map +1 -1
  588. package/build/components/rich-text/shortcut.js +5 -6
  589. package/build/components/rich-text/shortcut.js.map +1 -1
  590. package/build/components/rich-text/split-value.js +8 -10
  591. package/build/components/rich-text/split-value.js.map +1 -1
  592. package/build/components/rich-text/toolbar-button.js +6 -7
  593. package/build/components/rich-text/toolbar-button.js.map +1 -1
  594. package/build/components/rich-text/use-before-input-rules.js +1 -4
  595. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  596. package/build/components/rich-text/use-enter.js +3 -6
  597. package/build/components/rich-text/use-enter.js.map +1 -1
  598. package/build/components/rich-text/use-firefox-compat.js +32 -1
  599. package/build/components/rich-text/use-firefox-compat.js.map +1 -1
  600. package/build/components/rich-text/use-format-types.js +11 -17
  601. package/build/components/rich-text/use-format-types.js.map +1 -1
  602. package/build/components/rich-text/use-input-rules.js +9 -15
  603. package/build/components/rich-text/use-input-rules.js.map +1 -1
  604. package/build/components/rich-text/use-mark-persistent.js +4 -5
  605. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  606. package/build/components/rich-text/use-paste-handler.js +5 -7
  607. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  608. package/build/components/rich-text/utils.js +5 -7
  609. package/build/components/rich-text/utils.js.map +1 -1
  610. package/build/components/skip-to-selected-block/index.js +3 -4
  611. package/build/components/skip-to-selected-block/index.js.map +1 -1
  612. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +38 -0
  613. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  614. package/build/components/spacing-sizes-control/index.js +60 -62
  615. package/build/components/spacing-sizes-control/index.js.map +1 -1
  616. package/build/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  617. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  618. package/build/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +22 -22
  619. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  620. package/build/components/spacing-sizes-control/input-controls/single.js +51 -0
  621. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  622. package/build/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +51 -69
  623. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  624. package/build/components/spacing-sizes-control/sides-dropdown/index.js +84 -0
  625. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  626. package/build/components/spacing-sizes-control/utils.js +213 -31
  627. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  628. package/build/components/text-decoration-control/index.js +5 -6
  629. package/build/components/text-decoration-control/index.js.map +1 -1
  630. package/build/components/text-transform-control/index.js +5 -6
  631. package/build/components/text-transform-control/index.js.map +1 -1
  632. package/build/components/tool-selector/index.js +13 -16
  633. package/build/components/tool-selector/index.js.map +1 -1
  634. package/build/components/typewriter/index.js +6 -9
  635. package/build/components/typewriter/index.js.map +1 -1
  636. package/build/components/ungroup-button/index.native.js +11 -16
  637. package/build/components/ungroup-button/index.native.js.map +1 -1
  638. package/build/components/unit-control/index.js +4 -5
  639. package/build/components/unit-control/index.js.map +1 -1
  640. package/build/components/url-input/index.js +15 -23
  641. package/build/components/url-input/index.js.map +1 -1
  642. package/build/components/url-input/index.native.js +6 -8
  643. package/build/components/url-input/index.native.js.map +1 -1
  644. package/build/components/url-popover/image-url-input-ui.js +12 -15
  645. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  646. package/build/components/url-popover/index.js +12 -14
  647. package/build/components/url-popover/index.js.map +1 -1
  648. package/build/components/url-popover/link-editor.js +7 -8
  649. package/build/components/url-popover/link-editor.js.map +1 -1
  650. package/build/components/url-popover/link-viewer-url.js +5 -6
  651. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  652. package/build/components/url-popover/link-viewer.js +8 -9
  653. package/build/components/url-popover/link-viewer.js.map +1 -1
  654. package/build/components/use-block-display-information/index.js +2 -2
  655. package/build/components/use-block-display-information/index.js.map +1 -1
  656. package/build/components/use-block-drop-zone/index.js +41 -38
  657. package/build/components/use-block-drop-zone/index.js.map +1 -1
  658. package/build/components/use-block-drop-zone/index.native.js +8 -11
  659. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  660. package/build/components/use-moving-animation/index.js +9 -12
  661. package/build/components/use-moving-animation/index.js.map +1 -1
  662. package/build/components/use-on-block-drop/index.js +2 -6
  663. package/build/components/use-on-block-drop/index.js.map +1 -1
  664. package/build/components/use-on-block-drop/index.native.js +8 -10
  665. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  666. package/build/components/use-paste-styles/index.js +2 -6
  667. package/build/components/use-paste-styles/index.js.map +1 -1
  668. package/build/components/use-resize-canvas/index.js +8 -1
  669. package/build/components/use-resize-canvas/index.js.map +1 -1
  670. package/build/components/warning/index.js +6 -7
  671. package/build/components/warning/index.js.map +1 -1
  672. package/build/components/warning/index.native.js +9 -10
  673. package/build/components/warning/index.native.js.map +1 -1
  674. package/build/components/writing-flow/index.js +4 -5
  675. package/build/components/writing-flow/index.js.map +1 -1
  676. package/build/components/writing-flow/use-arrow-nav.js +13 -7
  677. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  678. package/build/components/writing-flow/use-drag-selection.js +4 -6
  679. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  680. package/build/components/writing-flow/use-tab-nav.js +9 -6
  681. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  682. package/build/hooks/align.js +11 -22
  683. package/build/hooks/align.js.map +1 -1
  684. package/build/hooks/anchor.js +6 -3
  685. package/build/hooks/anchor.js.map +1 -1
  686. package/build/hooks/aria-label.js +1 -3
  687. package/build/hooks/aria-label.js.map +1 -1
  688. package/build/hooks/behaviors.js +148 -0
  689. package/build/hooks/behaviors.js.map +1 -0
  690. package/build/hooks/border.js +25 -38
  691. package/build/hooks/border.js.map +1 -1
  692. package/build/hooks/color.js +22 -37
  693. package/build/hooks/color.js.map +1 -1
  694. package/build/hooks/content-lock-ui.js +26 -30
  695. package/build/hooks/content-lock-ui.js.map +1 -1
  696. package/build/hooks/contrast-checker.js +4 -7
  697. package/build/hooks/contrast-checker.js.map +1 -1
  698. package/build/hooks/custom-class-name.js +5 -4
  699. package/build/hooks/custom-class-name.js.map +1 -1
  700. package/build/hooks/dimensions.js +6 -39
  701. package/build/hooks/dimensions.js.map +1 -1
  702. package/build/hooks/duotone.js +36 -52
  703. package/build/hooks/duotone.js.map +1 -1
  704. package/build/hooks/font-family.js +5 -6
  705. package/build/hooks/font-family.js.map +1 -1
  706. package/build/hooks/font-size.js +14 -21
  707. package/build/hooks/font-size.js.map +1 -1
  708. package/build/hooks/gap.js +5 -6
  709. package/build/hooks/gap.js.map +1 -1
  710. package/build/hooks/index.js +2 -0
  711. package/build/hooks/index.js.map +1 -1
  712. package/build/hooks/layout.js +50 -68
  713. package/build/hooks/layout.js.map +1 -1
  714. package/build/hooks/line-height.js +5 -8
  715. package/build/hooks/line-height.js.map +1 -1
  716. package/build/hooks/lock.js +2 -2
  717. package/build/hooks/lock.js.map +1 -1
  718. package/build/hooks/margin.js +6 -9
  719. package/build/hooks/margin.js.map +1 -1
  720. package/build/hooks/metadata-name.js +4 -5
  721. package/build/hooks/metadata-name.js.map +1 -1
  722. package/build/hooks/metadata.js +3 -7
  723. package/build/hooks/metadata.js.map +1 -1
  724. package/build/hooks/padding.js +6 -9
  725. package/build/hooks/padding.js.map +1 -1
  726. package/build/hooks/position.js +26 -40
  727. package/build/hooks/position.js.map +1 -1
  728. package/build/hooks/settings.js +1 -3
  729. package/build/hooks/settings.js.map +1 -1
  730. package/build/hooks/style.js +12 -19
  731. package/build/hooks/style.js.map +1 -1
  732. package/build/hooks/supports.js +3 -5
  733. package/build/hooks/supports.js.map +1 -1
  734. package/build/hooks/typography.js +18 -27
  735. package/build/hooks/typography.js.map +1 -1
  736. package/build/hooks/typography.native.js +1 -2
  737. package/build/hooks/typography.native.js.map +1 -1
  738. package/build/hooks/use-border-props.js +1 -3
  739. package/build/hooks/use-border-props.js.map +1 -1
  740. package/build/hooks/use-color-props.js +6 -8
  741. package/build/hooks/use-color-props.js.map +1 -1
  742. package/build/hooks/use-editor-wrapper-styles.native.js +34 -39
  743. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  744. package/build/hooks/use-spacing-props.js +1 -1
  745. package/build/hooks/use-spacing-props.js.map +1 -1
  746. package/build/hooks/use-typography-props.js +8 -12
  747. package/build/hooks/use-typography-props.js.map +1 -1
  748. package/build/hooks/utils.js +6 -18
  749. package/build/hooks/utils.js.map +1 -1
  750. package/build/layouts/constrained.js +22 -27
  751. package/build/layouts/constrained.js.map +1 -1
  752. package/build/layouts/flex.js +43 -54
  753. package/build/layouts/flex.js.map +1 -1
  754. package/build/layouts/flow.js +10 -13
  755. package/build/layouts/flow.js.map +1 -1
  756. package/build/layouts/grid.js +45 -25
  757. package/build/layouts/grid.js.map +1 -1
  758. package/build/layouts/index.js +1 -2
  759. package/build/layouts/index.js.map +1 -1
  760. package/build/layouts/utils.js +3 -9
  761. package/build/layouts/utils.js.map +1 -1
  762. package/build/private-apis.js +4 -7
  763. package/build/private-apis.js.map +1 -1
  764. package/build/store/actions.js +251 -334
  765. package/build/store/actions.js.map +1 -1
  766. package/build/store/array.js +1 -2
  767. package/build/store/array.js.map +1 -1
  768. package/build/store/private-actions.js +44 -2
  769. package/build/store/private-actions.js.map +1 -1
  770. package/build/store/private-selectors.js +108 -3
  771. package/build/store/private-selectors.js.map +1 -1
  772. package/build/store/reducer.js +99 -166
  773. package/build/store/reducer.js.map +1 -1
  774. package/build/store/selectors.js +171 -231
  775. package/build/store/selectors.js.map +1 -1
  776. package/build/utils/block-variation-transforms.js +4 -7
  777. package/build/utils/block-variation-transforms.js.map +1 -1
  778. package/build/utils/math.js +1 -2
  779. package/build/utils/math.js.map +1 -1
  780. package/build/utils/object.js +1 -4
  781. package/build/utils/object.js.map +1 -1
  782. package/build/utils/order-inserter-block-items.js +39 -0
  783. package/build/utils/order-inserter-block-items.js.map +1 -0
  784. package/build/utils/parse-css-unit-to-px.js +3 -6
  785. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  786. package/build/utils/pasting.js +5 -8
  787. package/build/utils/pasting.js.map +1 -1
  788. package/build/utils/pre-parse-patterns.js +1 -1
  789. package/build/utils/pre-parse-patterns.js.map +1 -1
  790. package/build/utils/sorting.js +1 -2
  791. package/build/utils/sorting.js.map +1 -1
  792. package/build/utils/transform-styles/index.js +5 -7
  793. package/build/utils/transform-styles/index.js.map +1 -1
  794. package/build/utils/transform-styles/transforms/wrap.js +28 -31
  795. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  796. package/build-module/autocompleters/block.js +10 -5
  797. package/build-module/autocompleters/block.js.map +1 -1
  798. package/build-module/components/alignment-control/ui.js +9 -11
  799. package/build-module/components/alignment-control/ui.js.map +1 -1
  800. package/build-module/components/autocomplete/index.js +3 -4
  801. package/build-module/components/autocomplete/index.js.map +1 -1
  802. package/build-module/components/block-actions/index.js +8 -12
  803. package/build-module/components/block-actions/index.js.map +1 -1
  804. package/build-module/components/block-alignment-control/ui.js +17 -21
  805. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  806. package/build-module/components/block-alignment-control/ui.native.js +14 -17
  807. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  808. package/build-module/components/block-alignment-control/use-available-alignments.js +5 -10
  809. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  810. package/build-module/components/block-alignment-matrix-control/index.js +4 -6
  811. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  812. package/build-module/components/block-breadcrumb/index.js +8 -7
  813. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  814. package/build-module/components/block-caption/index.native.js +29 -34
  815. package/build-module/components/block-caption/index.native.js.map +1 -1
  816. package/build-module/components/block-card/index.js +7 -9
  817. package/build-module/components/block-card/index.js.map +1 -1
  818. package/build-module/components/block-compare/block-view.js +8 -9
  819. package/build-module/components/block-compare/block-view.js.map +1 -1
  820. package/build-module/components/block-compare/index.js +7 -9
  821. package/build-module/components/block-compare/index.js.map +1 -1
  822. package/build-module/components/block-context/index.js +4 -5
  823. package/build-module/components/block-context/index.js.map +1 -1
  824. package/build-module/components/block-controls/fill.js +17 -23
  825. package/build-module/components/block-controls/fill.js.map +1 -1
  826. package/build-module/components/block-controls/hook.js +1 -3
  827. package/build-module/components/block-controls/hook.js.map +1 -1
  828. package/build-module/components/block-controls/slot.js +29 -21
  829. package/build-module/components/block-controls/slot.js.map +1 -1
  830. package/build-module/components/block-controls/slot.native.js +8 -18
  831. package/build-module/components/block-controls/slot.native.js.map +1 -1
  832. package/build-module/components/block-draggable/draggable-chip.js +5 -7
  833. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  834. package/build-module/components/block-draggable/draggable-chip.native.js +3 -4
  835. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  836. package/build-module/components/block-draggable/dropping-insertion-point.native.js +6 -7
  837. package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  838. package/build-module/components/block-draggable/index.js +16 -17
  839. package/build-module/components/block-draggable/index.js.map +1 -1
  840. package/build-module/components/block-draggable/index.native.js +43 -58
  841. package/build-module/components/block-draggable/index.native.js.map +1 -1
  842. package/build-module/components/block-edit/edit.js +1 -4
  843. package/build-module/components/block-edit/edit.js.map +1 -1
  844. package/build-module/components/block-edit/edit.native.js +1 -4
  845. package/build-module/components/block-edit/edit.native.js.map +1 -1
  846. package/build-module/components/block-edit-visually-button/index.js +3 -4
  847. package/build-module/components/block-edit-visually-button/index.js.map +1 -1
  848. package/build-module/components/block-editing-mode/index.js +72 -0
  849. package/build-module/components/block-editing-mode/index.js.map +1 -0
  850. package/build-module/components/block-full-height-alignment-control/index.js +6 -7
  851. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  852. package/build-module/components/block-icon/index.js +7 -11
  853. package/build-module/components/block-icon/index.js.map +1 -1
  854. package/build-module/components/block-icon/index.native.js +9 -13
  855. package/build-module/components/block-icon/index.native.js.map +1 -1
  856. package/build-module/components/block-inspector/index.js +36 -46
  857. package/build-module/components/block-inspector/index.js.map +1 -1
  858. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  859. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  860. package/build-module/components/block-list/block-html.js +3 -4
  861. package/build-module/components/block-list/block-html.js.map +1 -1
  862. package/build-module/components/block-list/block-invalid-warning.js +3 -4
  863. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  864. package/build-module/components/block-list/block-invalid-warning.native.js +10 -15
  865. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  866. package/build-module/components/block-list/block-list-block-context.js +6 -0
  867. package/build-module/components/block-list/block-list-block-context.js.map +1 -0
  868. package/build-module/components/block-list/block-list-context.native.js +5 -11
  869. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  870. package/build-module/components/block-list/block-list-item-cell.native.js +5 -6
  871. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  872. package/build-module/components/block-list/block-list-item.native.js +17 -18
  873. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  874. package/build-module/components/block-list/block-outline.native.js +8 -9
  875. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  876. package/build-module/components/block-list/block-selection-button.native.js +10 -12
  877. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  878. package/build-module/components/block-list/block.js +65 -80
  879. package/build-module/components/block-list/block.js.map +1 -1
  880. package/build-module/components/block-list/block.native.js +69 -90
  881. package/build-module/components/block-list/block.native.js.map +1 -1
  882. package/build-module/components/block-list/index.js +12 -15
  883. package/build-module/components/block-list/index.js.map +1 -1
  884. package/build-module/components/block-list/index.native.js +144 -155
  885. package/build-module/components/block-list/index.native.js.map +1 -1
  886. package/build-module/components/block-list/insertion-point.native.js +4 -5
  887. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  888. package/build-module/components/block-list/layout.js +6 -9
  889. package/build-module/components/block-list/layout.js.map +1 -1
  890. package/build-module/components/block-list/subdirectory-icon.js +10 -13
  891. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  892. package/build-module/components/block-list/use-block-props/index.js +15 -12
  893. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  894. package/build-module/components/block-list/use-block-props/index.native.js +1 -2
  895. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  896. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  897. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  898. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  899. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  900. package/build-module/components/block-list/use-in-between-inserter.js +7 -8
  901. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  902. package/build-module/components/block-list-appender/index.js +29 -15
  903. package/build-module/components/block-list-appender/index.js.map +1 -1
  904. package/build-module/components/block-list-appender/index.native.js +9 -11
  905. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  906. package/build-module/components/block-lock/menu-item.js +3 -4
  907. package/build-module/components/block-lock/menu-item.js.map +1 -1
  908. package/build-module/components/block-lock/modal.js +6 -9
  909. package/build-module/components/block-lock/modal.js.map +1 -1
  910. package/build-module/components/block-lock/toolbar.js +5 -10
  911. package/build-module/components/block-lock/toolbar.js.map +1 -1
  912. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +66 -70
  913. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  914. package/build-module/components/block-mobile-toolbar/index.native.js +26 -34
  915. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  916. package/build-module/components/block-mover/button.js +6 -7
  917. package/build-module/components/block-mover/button.js.map +1 -1
  918. package/build-module/components/block-mover/index.js +5 -8
  919. package/build-module/components/block-mover/index.js.map +1 -1
  920. package/build-module/components/block-mover/index.native.js +23 -46
  921. package/build-module/components/block-mover/index.native.js.map +1 -1
  922. package/build-module/components/block-mover/mover-description.native.js +7 -10
  923. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  924. package/build-module/components/block-navigation/dropdown.js +20 -25
  925. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  926. package/build-module/components/block-parent-selector/index.js +2 -2
  927. package/build-module/components/block-parent-selector/index.js.map +1 -1
  928. package/build-module/components/block-pattern-setup/index.js +27 -31
  929. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  930. package/build-module/components/block-pattern-setup/setup-toolbar.js +35 -42
  931. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  932. package/build-module/components/block-patterns-list/index.js +71 -78
  933. package/build-module/components/block-patterns-list/index.js.map +1 -1
  934. package/build-module/components/block-popover/drop-zone.js +4 -5
  935. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  936. package/build-module/components/block-popover/inbetween.js +10 -15
  937. package/build-module/components/block-popover/inbetween.js.map +1 -1
  938. package/build-module/components/block-popover/index.js +14 -15
  939. package/build-module/components/block-popover/index.js.map +1 -1
  940. package/build-module/components/block-preview/auto.js +6 -8
  941. package/build-module/components/block-preview/auto.js.map +1 -1
  942. package/build-module/components/block-preview/index.js +15 -18
  943. package/build-module/components/block-preview/index.js.map +1 -1
  944. package/build-module/components/block-settings/button.native.js +7 -10
  945. package/build-module/components/block-settings/button.native.js.map +1 -1
  946. package/build-module/components/block-settings-menu/block-convert-button.js +5 -7
  947. package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
  948. package/build-module/components/block-settings-menu/block-html-convert-button.js +10 -14
  949. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  950. package/build-module/components/block-settings-menu/block-mode-toggle.js +19 -25
  951. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  952. package/build-module/components/block-settings-menu/block-settings-dropdown.js +135 -113
  953. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  954. package/build-module/components/block-settings-menu/index.js +4 -5
  955. package/build-module/components/block-settings-menu/index.js.map +1 -1
  956. package/build-module/components/block-settings-menu-controls/index.js +14 -16
  957. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  958. package/build-module/components/block-styles/index.js +6 -7
  959. package/build-module/components/block-styles/index.js.map +1 -1
  960. package/build-module/components/block-styles/index.native.js +5 -7
  961. package/build-module/components/block-styles/index.native.js.map +1 -1
  962. package/build-module/components/block-styles/menu-items.js +4 -5
  963. package/build-module/components/block-styles/menu-items.js.map +1 -1
  964. package/build-module/components/block-styles/preview-panel.js +8 -12
  965. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  966. package/build-module/components/block-styles/preview.native.js +6 -7
  967. package/build-module/components/block-styles/preview.native.js.map +1 -1
  968. package/build-module/components/block-styles/use-styles-for-block.js +7 -9
  969. package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
  970. package/build-module/components/block-styles/utils.js +4 -7
  971. package/build-module/components/block-styles/utils.js.map +1 -1
  972. package/build-module/components/block-switcher/block-styles-menu.js +4 -5
  973. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  974. package/build-module/components/block-switcher/block-transformations-menu.js +28 -26
  975. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  976. package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -10
  977. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  978. package/build-module/components/block-switcher/block-variation-transformations.js +99 -0
  979. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -0
  980. package/build-module/components/block-switcher/index.js +63 -55
  981. package/build-module/components/block-switcher/index.js.map +1 -1
  982. package/build-module/components/block-switcher/pattern-transformations-menu.js +21 -25
  983. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  984. package/build-module/components/block-switcher/preview-block-popover.js +3 -4
  985. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  986. package/build-module/components/block-switcher/utils.js +2 -3
  987. package/build-module/components/block-switcher/utils.js.map +1 -1
  988. package/build-module/components/block-title/index.js +5 -6
  989. package/build-module/components/block-title/index.js.map +1 -1
  990. package/build-module/components/block-title/use-block-display-title.js +5 -6
  991. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  992. package/build-module/components/block-toolbar/index.js +12 -12
  993. package/build-module/components/block-toolbar/index.js.map +1 -1
  994. package/build-module/components/block-toolbar/utils.js +14 -16
  995. package/build-module/components/block-toolbar/utils.js.map +1 -1
  996. package/build-module/components/block-tools/back-compat.js +3 -4
  997. package/build-module/components/block-tools/back-compat.js.map +1 -1
  998. package/build-module/components/block-tools/block-contextual-toolbar.js +9 -9
  999. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  1000. package/build-module/components/block-tools/block-selection-button.js +6 -9
  1001. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  1002. package/build-module/components/block-tools/index.js +6 -7
  1003. package/build-module/components/block-tools/index.js.map +1 -1
  1004. package/build-module/components/block-tools/insertion-point.js +17 -14
  1005. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  1006. package/build-module/components/block-tools/selected-block-popover.js +19 -20
  1007. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  1008. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  1009. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  1010. package/build-module/components/block-tools/zoom-out-mode-inserters.js +3 -4
  1011. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  1012. package/build-module/components/block-types-list/index.js +8 -9
  1013. package/build-module/components/block-types-list/index.js.map +1 -1
  1014. package/build-module/components/block-types-list/index.native.js +22 -27
  1015. package/build-module/components/block-types-list/index.native.js.map +1 -1
  1016. package/build-module/components/block-variation-picker/index.js +8 -9
  1017. package/build-module/components/block-variation-picker/index.js.map +1 -1
  1018. package/build-module/components/block-variation-picker/index.native.js +7 -9
  1019. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  1020. package/build-module/components/block-variation-transforms/index.js +30 -41
  1021. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  1022. package/build-module/components/block-vertical-alignment-control/ui.js +7 -9
  1023. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  1024. package/build-module/components/border-radius-control/all-input-control.js +7 -8
  1025. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  1026. package/build-module/components/border-radius-control/index.js +9 -10
  1027. package/build-module/components/border-radius-control/index.js.map +1 -1
  1028. package/build-module/components/border-radius-control/input-controls.js +8 -11
  1029. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  1030. package/build-module/components/border-radius-control/linked-button.js +4 -5
  1031. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  1032. package/build-module/components/border-radius-control/utils.js +3 -7
  1033. package/build-module/components/border-radius-control/utils.js.map +1 -1
  1034. package/build-module/components/button-block-appender/index.js +13 -15
  1035. package/build-module/components/button-block-appender/index.js.map +1 -1
  1036. package/build-module/components/button-block-appender/index.native.js +25 -29
  1037. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  1038. package/build-module/components/caption/index.native.js +40 -43
  1039. package/build-module/components/caption/index.native.js.map +1 -1
  1040. package/build-module/components/child-layout-control/index.js +5 -6
  1041. package/build-module/components/child-layout-control/index.js.map +1 -1
  1042. package/build-module/components/color-palette/control.js +5 -6
  1043. package/build-module/components/color-palette/control.js.map +1 -1
  1044. package/build-module/components/color-palette/with-color-context.js +1 -6
  1045. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  1046. package/build-module/components/color-style-selector/index.js +28 -35
  1047. package/build-module/components/color-style-selector/index.js.map +1 -1
  1048. package/build-module/components/colors/utils.js +5 -8
  1049. package/build-module/components/colors/utils.js.map +1 -1
  1050. package/build-module/components/colors/with-colors.js +9 -24
  1051. package/build-module/components/colors/with-colors.js.map +1 -1
  1052. package/build-module/components/colors-gradients/control.js +19 -21
  1053. package/build-module/components/colors-gradients/control.js.map +1 -1
  1054. package/build-module/components/colors-gradients/dropdown.js +32 -39
  1055. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  1056. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +20 -24
  1057. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  1058. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  1059. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  1060. package/build-module/components/contrast-checker/index.js +12 -13
  1061. package/build-module/components/contrast-checker/index.js.map +1 -1
  1062. package/build-module/components/contrast-checker/index.native.js +16 -18
  1063. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  1064. package/build-module/components/convert-to-group-buttons/index.js +15 -11
  1065. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  1066. package/build-module/components/convert-to-group-buttons/index.native.js +75 -1
  1067. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  1068. package/build-module/components/convert-to-group-buttons/toolbar.js +6 -12
  1069. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  1070. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +21 -37
  1071. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  1072. package/build-module/components/copy-handler/index.js +4 -7
  1073. package/build-module/components/copy-handler/index.js.map +1 -1
  1074. package/build-module/components/date-format-picker/index.js +12 -16
  1075. package/build-module/components/date-format-picker/index.js.map +1 -1
  1076. package/build-module/components/default-block-appender/index.js +7 -9
  1077. package/build-module/components/default-block-appender/index.js.map +1 -1
  1078. package/build-module/components/default-block-appender/index.native.js +8 -10
  1079. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  1080. package/build-module/components/default-style-picker/index.js +14 -22
  1081. package/build-module/components/default-style-picker/index.js.map +1 -1
  1082. package/build-module/components/duotone/components.js +14 -18
  1083. package/build-module/components/duotone/components.js.map +1 -1
  1084. package/build-module/components/duotone/utils.js +1 -2
  1085. package/build-module/components/duotone/utils.js.map +1 -1
  1086. package/build-module/components/duotone-control/index.js +12 -15
  1087. package/build-module/components/duotone-control/index.js.map +1 -1
  1088. package/build-module/components/editable-text/index.js +5 -6
  1089. package/build-module/components/editable-text/index.js.map +1 -1
  1090. package/build-module/components/editor-styles/index.js +4 -5
  1091. package/build-module/components/editor-styles/index.js.map +1 -1
  1092. package/build-module/components/floating-toolbar/index.native.js +7 -8
  1093. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  1094. package/build-module/components/font-appearance-control/index.js +19 -26
  1095. package/build-module/components/font-appearance-control/index.js.map +1 -1
  1096. package/build-module/components/font-family/index.js +10 -12
  1097. package/build-module/components/font-family/index.js.map +1 -1
  1098. package/build-module/components/font-sizes/fluid-utils.js +17 -21
  1099. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  1100. package/build-module/components/font-sizes/utils.js +6 -12
  1101. package/build-module/components/font-sizes/utils.js.map +1 -1
  1102. package/build-module/components/font-sizes/with-font-sizes.js +11 -30
  1103. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  1104. package/build-module/components/global-styles/advanced-panel.js +7 -10
  1105. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  1106. package/build-module/components/global-styles/border-panel.js +45 -78
  1107. package/build-module/components/global-styles/border-panel.js.map +1 -1
  1108. package/build-module/components/global-styles/color-panel.js +104 -147
  1109. package/build-module/components/global-styles/color-panel.js.map +1 -1
  1110. package/build-module/components/global-styles/color-panel.native.js +25 -42
  1111. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  1112. package/build-module/components/global-styles/dimensions-panel.js +81 -111
  1113. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  1114. package/build-module/components/global-styles/effects-panel.js +58 -72
  1115. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  1116. package/build-module/components/global-styles/filters-panel.js +53 -71
  1117. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  1118. package/build-module/components/global-styles/get-block-css-selector.js +5 -8
  1119. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  1120. package/build-module/components/global-styles/hooks.js +22 -37
  1121. package/build-module/components/global-styles/hooks.js.map +1 -1
  1122. package/build-module/components/global-styles/typography-panel.js +69 -125
  1123. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  1124. package/build-module/components/global-styles/typography-utils.js +48 -26
  1125. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  1126. package/build-module/components/global-styles/use-global-styles-output.js +142 -237
  1127. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  1128. package/build-module/components/global-styles/utils.js +12 -28
  1129. package/build-module/components/global-styles/utils.js.map +1 -1
  1130. package/build-module/components/gradients/use-gradient.js +6 -7
  1131. package/build-module/components/gradients/use-gradient.js.map +1 -1
  1132. package/build-module/components/height-control/index.js +9 -10
  1133. package/build-module/components/height-control/index.js.map +1 -1
  1134. package/build-module/components/iframe/index.js +53 -81
  1135. package/build-module/components/iframe/index.js.map +1 -1
  1136. package/build-module/components/iframe/use-compatibility-styles.js +29 -20
  1137. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  1138. package/build-module/components/image-editor/aspect-ratio-dropdown.js +83 -91
  1139. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  1140. package/build-module/components/image-editor/context.js +9 -10
  1141. package/build-module/components/image-editor/context.js.map +1 -1
  1142. package/build-module/components/image-editor/cropper.js +11 -12
  1143. package/build-module/components/image-editor/cropper.js.map +1 -1
  1144. package/build-module/components/image-editor/index.js +12 -13
  1145. package/build-module/components/image-editor/index.js.map +1 -1
  1146. package/build-module/components/image-editor/use-save-image.js +11 -12
  1147. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  1148. package/build-module/components/image-editor/use-transform-image.js +5 -6
  1149. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  1150. package/build-module/components/image-editor/zoom-dropdown.js +10 -13
  1151. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  1152. package/build-module/components/image-size-control/index.js +12 -13
  1153. package/build-module/components/image-size-control/index.js.map +1 -1
  1154. package/build-module/components/inner-blocks/button-block-appender.js +7 -8
  1155. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  1156. package/build-module/components/inner-blocks/default-block-appender.js +6 -8
  1157. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  1158. package/build-module/components/inner-blocks/index.js +4 -7
  1159. package/build-module/components/inner-blocks/index.js.map +1 -1
  1160. package/build-module/components/inner-blocks/index.native.js +8 -9
  1161. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  1162. package/build-module/components/inner-blocks/use-block-context.js +1 -4
  1163. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  1164. package/build-module/components/inner-blocks/use-nested-settings-update.js +15 -9
  1165. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  1166. package/build-module/components/inserter/block-patterns-explorer/explorer.js +9 -11
  1167. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  1168. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  1169. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  1170. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  1171. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  1172. package/build-module/components/inserter/block-patterns-tab.js +29 -40
  1173. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  1174. package/build-module/components/inserter/block-types-tab.js +7 -9
  1175. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  1176. package/build-module/components/inserter/block-types-tab.native.js +8 -9
  1177. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  1178. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  1179. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  1180. package/build-module/components/inserter/hooks/use-block-types-state.js +5 -6
  1181. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  1182. package/build-module/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  1183. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  1184. package/build-module/components/inserter/hooks/use-debounced-input.js +1 -2
  1185. package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
  1186. package/build-module/components/inserter/hooks/use-insertion-point.js +10 -12
  1187. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  1188. package/build-module/components/inserter/index.js +40 -58
  1189. package/build-module/components/inserter/index.js.map +1 -1
  1190. package/build-module/components/inserter/index.native.js +24 -31
  1191. package/build-module/components/inserter/index.native.js.map +1 -1
  1192. package/build-module/components/inserter/library.js +11 -12
  1193. package/build-module/components/inserter/library.js.map +1 -1
  1194. package/build-module/components/inserter/media-tab/hooks.js +2 -5
  1195. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  1196. package/build-module/components/inserter/media-tab/media-list.js +6 -7
  1197. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  1198. package/build-module/components/inserter/media-tab/media-panel.js +12 -14
  1199. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  1200. package/build-module/components/inserter/media-tab/media-preview.js +47 -58
  1201. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  1202. package/build-module/components/inserter/media-tab/media-tab.js +24 -28
  1203. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  1204. package/build-module/components/inserter/media-tab/utils.js +3 -5
  1205. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  1206. package/build-module/components/inserter/menu.js +15 -19
  1207. package/build-module/components/inserter/menu.js.map +1 -1
  1208. package/build-module/components/inserter/menu.native.js +27 -31
  1209. package/build-module/components/inserter/menu.native.js.map +1 -1
  1210. package/build-module/components/inserter/mobile-tab-navigation.js +7 -9
  1211. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  1212. package/build-module/components/inserter/panel.js +5 -6
  1213. package/build-module/components/inserter/panel.js.map +1 -1
  1214. package/build-module/components/inserter/preview-panel.js +4 -5
  1215. package/build-module/components/inserter/preview-panel.js.map +1 -1
  1216. package/build-module/components/inserter/quick-inserter.js +9 -12
  1217. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  1218. package/build-module/components/inserter/reusable-blocks-tab.js +13 -18
  1219. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  1220. package/build-module/components/inserter/reusable-blocks-tab.native.js +5 -6
  1221. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  1222. package/build-module/components/inserter/search-items.js +12 -40
  1223. package/build-module/components/inserter/search-items.js.map +1 -1
  1224. package/build-module/components/inserter/search-results.js +31 -22
  1225. package/build-module/components/inserter/search-results.js.map +1 -1
  1226. package/build-module/components/inserter/search-results.native.js +11 -12
  1227. package/build-module/components/inserter/search-results.native.js.map +1 -1
  1228. package/build-module/components/inserter/tabs.js +8 -9
  1229. package/build-module/components/inserter/tabs.js.map +1 -1
  1230. package/build-module/components/inserter/tabs.native.js +37 -55
  1231. package/build-module/components/inserter/tabs.native.js.map +1 -1
  1232. package/build-module/components/inserter/utils.native.js +13 -17
  1233. package/build-module/components/inserter/utils.native.js.map +1 -1
  1234. package/build-module/components/inserter-draggable-blocks/index.js +11 -13
  1235. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  1236. package/build-module/components/inserter-list-item/index.js +65 -69
  1237. package/build-module/components/inserter-list-item/index.js.map +1 -1
  1238. package/build-module/components/inserter-listbox/index.js +3 -4
  1239. package/build-module/components/inserter-listbox/index.js.map +1 -1
  1240. package/build-module/components/inserter-listbox/item.js +6 -7
  1241. package/build-module/components/inserter-listbox/item.js.map +1 -1
  1242. package/build-module/components/inspector-controls/block-support-slot-container.js +4 -5
  1243. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  1244. package/build-module/components/inspector-controls/block-support-tools-panel.js +6 -8
  1245. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  1246. package/build-module/components/inspector-controls/fill.js +13 -23
  1247. package/build-module/components/inspector-controls/fill.js.map +1 -1
  1248. package/build-module/components/inspector-controls/fill.native.js +7 -11
  1249. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  1250. package/build-module/components/inspector-controls/slot.js +9 -13
  1251. package/build-module/components/inspector-controls/slot.js.map +1 -1
  1252. package/build-module/components/inspector-controls/slot.native.js +6 -10
  1253. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  1254. package/build-module/components/inspector-controls-tabs/index.js +6 -7
  1255. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  1256. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  1257. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  1258. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  1259. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  1260. package/build-module/components/inspector-controls-tabs/settings-tab.js +3 -6
  1261. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  1262. package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -6
  1263. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  1264. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  1265. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  1266. package/build-module/components/inspector-popover-header/index.js +18 -22
  1267. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  1268. package/build-module/components/justify-content-control/ui.js +8 -10
  1269. package/build-module/components/justify-content-control/ui.js.map +1 -1
  1270. package/build-module/components/letter-spacing-control/index.js +6 -7
  1271. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1272. package/build-module/components/line-height-control/index.js +13 -18
  1273. package/build-module/components/line-height-control/index.js.map +1 -1
  1274. package/build-module/components/line-height-control/index.native.js +4 -5
  1275. package/build-module/components/line-height-control/index.native.js.map +1 -1
  1276. package/build-module/components/link-control/index.js +83 -64
  1277. package/build-module/components/link-control/index.js.map +1 -1
  1278. package/build-module/components/link-control/is-url-like.js +32 -3
  1279. package/build-module/components/link-control/is-url-like.js.map +1 -1
  1280. package/build-module/components/link-control/link-preview.js +24 -27
  1281. package/build-module/components/link-control/link-preview.js.map +1 -1
  1282. package/build-module/components/link-control/search-create-button.js +7 -9
  1283. package/build-module/components/link-control/search-create-button.js.map +1 -1
  1284. package/build-module/components/link-control/search-input.js +22 -27
  1285. package/build-module/components/link-control/search-input.js.map +1 -1
  1286. package/build-module/components/link-control/search-item.js +13 -15
  1287. package/build-module/components/link-control/search-item.js.map +1 -1
  1288. package/build-module/components/link-control/search-results.js +21 -27
  1289. package/build-module/components/link-control/search-results.js.map +1 -1
  1290. package/build-module/components/link-control/settings-drawer.js +7 -33
  1291. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  1292. package/build-module/components/link-control/settings.js +7 -9
  1293. package/build-module/components/link-control/settings.js.map +1 -1
  1294. package/build-module/components/link-control/use-internal-value.js +46 -0
  1295. package/build-module/components/link-control/use-internal-value.js.map +1 -0
  1296. package/build-module/components/link-control/use-rich-url-data.js +1 -1
  1297. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  1298. package/build-module/components/link-control/use-search-handler.js +10 -23
  1299. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  1300. package/build-module/components/list-view/appender.js +17 -14
  1301. package/build-module/components/list-view/appender.js.map +1 -1
  1302. package/build-module/components/list-view/aria-referenced-text.js +35 -0
  1303. package/build-module/components/list-view/aria-referenced-text.js.map +1 -0
  1304. package/build-module/components/list-view/block-contents.js +40 -38
  1305. package/build-module/components/list-view/block-contents.js.map +1 -1
  1306. package/build-module/components/list-view/block-select-button.js +65 -22
  1307. package/build-module/components/list-view/block-select-button.js.map +1 -1
  1308. package/build-module/components/list-view/block.js +131 -120
  1309. package/build-module/components/list-view/block.js.map +1 -1
  1310. package/build-module/components/list-view/branch.js +6 -8
  1311. package/build-module/components/list-view/branch.js.map +1 -1
  1312. package/build-module/components/list-view/drop-indicator.js +4 -5
  1313. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  1314. package/build-module/components/list-view/expander.js +3 -4
  1315. package/build-module/components/list-view/expander.js.map +1 -1
  1316. package/build-module/components/list-view/index.js +57 -47
  1317. package/build-module/components/list-view/index.js.map +1 -1
  1318. package/build-module/components/list-view/leaf.js +10 -11
  1319. package/build-module/components/list-view/leaf.js.map +1 -1
  1320. package/build-module/components/list-view/use-block-selection.js +4 -6
  1321. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  1322. package/build-module/components/list-view/use-list-view-client-ids.js +28 -8
  1323. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  1324. package/build-module/components/list-view/use-list-view-drop-zone.js +25 -13
  1325. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  1326. package/build-module/components/list-view/use-list-view-expand-selected-item.js +4 -5
  1327. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  1328. package/build-module/components/list-view/use-list-view-scroll-into-view.js +5 -6
  1329. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  1330. package/build-module/components/media-placeholder/index.js +71 -92
  1331. package/build-module/components/media-placeholder/index.js.map +1 -1
  1332. package/build-module/components/media-placeholder/index.native.js +5 -6
  1333. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  1334. package/build-module/components/media-replace-flow/index.js +94 -107
  1335. package/build-module/components/media-replace-flow/index.js.map +1 -1
  1336. package/build-module/components/media-upload/check.js +4 -5
  1337. package/build-module/components/media-upload/check.js.map +1 -1
  1338. package/build-module/components/media-upload/index.native.js +1 -1
  1339. package/build-module/components/media-upload/index.native.js.map +1 -1
  1340. package/build-module/components/multi-selection-inspector/index.js +3 -4
  1341. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  1342. package/build-module/components/navigable-toolbar/index.js +16 -15
  1343. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  1344. package/build-module/components/observe-typing/index.js +3 -4
  1345. package/build-module/components/observe-typing/index.js.map +1 -1
  1346. package/build-module/components/panel-color-settings/index.js +4 -5
  1347. package/build-module/components/panel-color-settings/index.js.map +1 -1
  1348. package/build-module/components/plain-text/index.js +4 -6
  1349. package/build-module/components/plain-text/index.js.map +1 -1
  1350. package/build-module/components/plain-text/index.native.js +8 -14
  1351. package/build-module/components/plain-text/index.native.js.map +1 -1
  1352. package/build-module/components/preview-options/index.js +8 -9
  1353. package/build-module/components/preview-options/index.js.map +1 -1
  1354. package/build-module/components/provider/block-refs-provider.js +3 -4
  1355. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1356. package/build-module/components/provider/use-block-sync.js +7 -8
  1357. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1358. package/build-module/components/provider/with-registry-provider.js +5 -7
  1359. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1360. package/build-module/components/publish-date-time-picker/index.js +6 -9
  1361. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  1362. package/build-module/components/recursion-provider/index.js +7 -11
  1363. package/build-module/components/recursion-provider/index.js.map +1 -1
  1364. package/build-module/components/resizable-box-popover/index.js +5 -6
  1365. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  1366. package/build-module/components/responsive-block-control/label.js +5 -6
  1367. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1368. package/build-module/components/rich-text/embed-handler-picker.native.js +6 -10
  1369. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1370. package/build-module/components/rich-text/format-edit.js +7 -8
  1371. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1372. package/build-module/components/rich-text/format-toolbar/index.js +9 -18
  1373. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1374. package/build-module/components/rich-text/format-toolbar-container.js +13 -16
  1375. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1376. package/build-module/components/rich-text/index.js +43 -47
  1377. package/build-module/components/rich-text/index.js.map +1 -1
  1378. package/build-module/components/rich-text/index.native.js +130 -157
  1379. package/build-module/components/rich-text/index.native.js.map +1 -1
  1380. package/build-module/components/rich-text/input-event.js +4 -5
  1381. package/build-module/components/rich-text/input-event.js.map +1 -1
  1382. package/build-module/components/rich-text/shortcut.js +5 -6
  1383. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1384. package/build-module/components/rich-text/split-value.js +8 -10
  1385. package/build-module/components/rich-text/split-value.js.map +1 -1
  1386. package/build-module/components/rich-text/toolbar-button.js +6 -7
  1387. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1388. package/build-module/components/rich-text/use-before-input-rules.js +1 -4
  1389. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  1390. package/build-module/components/rich-text/use-enter.js +3 -6
  1391. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1392. package/build-module/components/rich-text/use-firefox-compat.js +29 -1
  1393. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
  1394. package/build-module/components/rich-text/use-format-types.js +11 -17
  1395. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1396. package/build-module/components/rich-text/use-input-rules.js +9 -15
  1397. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1398. package/build-module/components/rich-text/use-mark-persistent.js +4 -5
  1399. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1400. package/build-module/components/rich-text/use-paste-handler.js +5 -7
  1401. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1402. package/build-module/components/rich-text/utils.js +5 -7
  1403. package/build-module/components/rich-text/utils.js.map +1 -1
  1404. package/build-module/components/skip-to-selected-block/index.js +3 -4
  1405. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1406. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +27 -0
  1407. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  1408. package/build-module/components/spacing-sizes-control/index.js +62 -63
  1409. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  1410. package/build-module/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  1411. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  1412. package/build-module/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +21 -21
  1413. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  1414. package/build-module/components/spacing-sizes-control/input-controls/single.js +40 -0
  1415. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  1416. package/build-module/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +53 -70
  1417. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  1418. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +73 -0
  1419. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  1420. package/build-module/components/spacing-sizes-control/utils.js +196 -25
  1421. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  1422. package/build-module/components/text-decoration-control/index.js +5 -6
  1423. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1424. package/build-module/components/text-transform-control/index.js +5 -6
  1425. package/build-module/components/text-transform-control/index.js.map +1 -1
  1426. package/build-module/components/tool-selector/index.js +13 -16
  1427. package/build-module/components/tool-selector/index.js.map +1 -1
  1428. package/build-module/components/typewriter/index.js +6 -9
  1429. package/build-module/components/typewriter/index.js.map +1 -1
  1430. package/build-module/components/ungroup-button/index.native.js +11 -14
  1431. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1432. package/build-module/components/unit-control/index.js +4 -5
  1433. package/build-module/components/unit-control/index.js.map +1 -1
  1434. package/build-module/components/url-input/index.js +15 -23
  1435. package/build-module/components/url-input/index.js.map +1 -1
  1436. package/build-module/components/url-input/index.native.js +6 -8
  1437. package/build-module/components/url-input/index.native.js.map +1 -1
  1438. package/build-module/components/url-popover/image-url-input-ui.js +12 -15
  1439. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1440. package/build-module/components/url-popover/index.js +12 -14
  1441. package/build-module/components/url-popover/index.js.map +1 -1
  1442. package/build-module/components/url-popover/link-editor.js +7 -8
  1443. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1444. package/build-module/components/url-popover/link-viewer-url.js +5 -6
  1445. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1446. package/build-module/components/url-popover/link-viewer.js +8 -9
  1447. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1448. package/build-module/components/use-block-display-information/index.js +2 -2
  1449. package/build-module/components/use-block-display-information/index.js.map +1 -1
  1450. package/build-module/components/use-block-drop-zone/index.js +41 -39
  1451. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1452. package/build-module/components/use-block-drop-zone/index.native.js +8 -11
  1453. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  1454. package/build-module/components/use-moving-animation/index.js +9 -12
  1455. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1456. package/build-module/components/use-on-block-drop/index.js +2 -6
  1457. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1458. package/build-module/components/use-on-block-drop/index.native.js +8 -10
  1459. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  1460. package/build-module/components/use-paste-styles/index.js +2 -6
  1461. package/build-module/components/use-paste-styles/index.js.map +1 -1
  1462. package/build-module/components/use-resize-canvas/index.js +8 -1
  1463. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  1464. package/build-module/components/warning/index.js +6 -7
  1465. package/build-module/components/warning/index.js.map +1 -1
  1466. package/build-module/components/warning/index.native.js +9 -10
  1467. package/build-module/components/warning/index.native.js.map +1 -1
  1468. package/build-module/components/writing-flow/index.js +4 -5
  1469. package/build-module/components/writing-flow/index.js.map +1 -1
  1470. package/build-module/components/writing-flow/use-arrow-nav.js +13 -7
  1471. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  1472. package/build-module/components/writing-flow/use-drag-selection.js +4 -6
  1473. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  1474. package/build-module/components/writing-flow/use-tab-nav.js +9 -6
  1475. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  1476. package/build-module/hooks/align.js +11 -21
  1477. package/build-module/hooks/align.js.map +1 -1
  1478. package/build-module/hooks/anchor.js +5 -3
  1479. package/build-module/hooks/anchor.js.map +1 -1
  1480. package/build-module/hooks/aria-label.js +1 -3
  1481. package/build-module/hooks/aria-label.js.map +1 -1
  1482. package/build-module/hooks/behaviors.js +129 -0
  1483. package/build-module/hooks/behaviors.js.map +1 -0
  1484. package/build-module/hooks/border.js +25 -38
  1485. package/build-module/hooks/border.js.map +1 -1
  1486. package/build-module/hooks/color.js +22 -37
  1487. package/build-module/hooks/color.js.map +1 -1
  1488. package/build-module/hooks/content-lock-ui.js +23 -27
  1489. package/build-module/hooks/content-lock-ui.js.map +1 -1
  1490. package/build-module/hooks/contrast-checker.js +4 -7
  1491. package/build-module/hooks/contrast-checker.js.map +1 -1
  1492. package/build-module/hooks/custom-class-name.js +4 -4
  1493. package/build-module/hooks/custom-class-name.js.map +1 -1
  1494. package/build-module/hooks/dimensions.js +6 -37
  1495. package/build-module/hooks/dimensions.js.map +1 -1
  1496. package/build-module/hooks/duotone.js +35 -50
  1497. package/build-module/hooks/duotone.js.map +1 -1
  1498. package/build-module/hooks/font-family.js +5 -6
  1499. package/build-module/hooks/font-family.js.map +1 -1
  1500. package/build-module/hooks/font-size.js +14 -21
  1501. package/build-module/hooks/font-size.js.map +1 -1
  1502. package/build-module/hooks/gap.js +5 -6
  1503. package/build-module/hooks/gap.js.map +1 -1
  1504. package/build-module/hooks/index.js +1 -0
  1505. package/build-module/hooks/index.js.map +1 -1
  1506. package/build-module/hooks/layout.js +49 -68
  1507. package/build-module/hooks/layout.js.map +1 -1
  1508. package/build-module/hooks/line-height.js +5 -8
  1509. package/build-module/hooks/line-height.js.map +1 -1
  1510. package/build-module/hooks/lock.js +2 -2
  1511. package/build-module/hooks/lock.js.map +1 -1
  1512. package/build-module/hooks/margin.js +6 -9
  1513. package/build-module/hooks/margin.js.map +1 -1
  1514. package/build-module/hooks/metadata-name.js +4 -5
  1515. package/build-module/hooks/metadata-name.js.map +1 -1
  1516. package/build-module/hooks/metadata.js +3 -7
  1517. package/build-module/hooks/metadata.js.map +1 -1
  1518. package/build-module/hooks/padding.js +6 -9
  1519. package/build-module/hooks/padding.js.map +1 -1
  1520. package/build-module/hooks/position.js +26 -40
  1521. package/build-module/hooks/position.js.map +1 -1
  1522. package/build-module/hooks/settings.js +1 -3
  1523. package/build-module/hooks/settings.js.map +1 -1
  1524. package/build-module/hooks/style.js +11 -19
  1525. package/build-module/hooks/style.js.map +1 -1
  1526. package/build-module/hooks/supports.js +3 -5
  1527. package/build-module/hooks/supports.js.map +1 -1
  1528. package/build-module/hooks/typography.js +18 -27
  1529. package/build-module/hooks/typography.js.map +1 -1
  1530. package/build-module/hooks/typography.native.js +1 -2
  1531. package/build-module/hooks/typography.native.js.map +1 -1
  1532. package/build-module/hooks/use-border-props.js +1 -3
  1533. package/build-module/hooks/use-border-props.js.map +1 -1
  1534. package/build-module/hooks/use-color-props.js +6 -8
  1535. package/build-module/hooks/use-color-props.js.map +1 -1
  1536. package/build-module/hooks/use-editor-wrapper-styles.native.js +34 -39
  1537. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  1538. package/build-module/hooks/use-spacing-props.js +1 -1
  1539. package/build-module/hooks/use-spacing-props.js.map +1 -1
  1540. package/build-module/hooks/use-typography-props.js +8 -12
  1541. package/build-module/hooks/use-typography-props.js.map +1 -1
  1542. package/build-module/hooks/utils.js +7 -19
  1543. package/build-module/hooks/utils.js.map +1 -1
  1544. package/build-module/layouts/constrained.js +22 -27
  1545. package/build-module/layouts/constrained.js.map +1 -1
  1546. package/build-module/layouts/flex.js +43 -54
  1547. package/build-module/layouts/flex.js.map +1 -1
  1548. package/build-module/layouts/flow.js +10 -13
  1549. package/build-module/layouts/flow.js.map +1 -1
  1550. package/build-module/layouts/grid.js +45 -25
  1551. package/build-module/layouts/grid.js.map +1 -1
  1552. package/build-module/layouts/index.js +1 -2
  1553. package/build-module/layouts/index.js.map +1 -1
  1554. package/build-module/layouts/utils.js +3 -9
  1555. package/build-module/layouts/utils.js.map +1 -1
  1556. package/build-module/private-apis.js +3 -5
  1557. package/build-module/private-apis.js.map +1 -1
  1558. package/build-module/store/actions.js +253 -336
  1559. package/build-module/store/actions.js.map +1 -1
  1560. package/build-module/store/array.js +1 -2
  1561. package/build-module/store/array.js.map +1 -1
  1562. package/build-module/store/private-actions.js +40 -2
  1563. package/build-module/store/private-actions.js.map +1 -1
  1564. package/build-module/store/private-selectors.js +97 -3
  1565. package/build-module/store/private-selectors.js.map +1 -1
  1566. package/build-module/store/reducer.js +97 -166
  1567. package/build-module/store/reducer.js.map +1 -1
  1568. package/build-module/store/selectors.js +168 -230
  1569. package/build-module/store/selectors.js.map +1 -1
  1570. package/build-module/utils/block-variation-transforms.js +4 -7
  1571. package/build-module/utils/block-variation-transforms.js.map +1 -1
  1572. package/build-module/utils/math.js +1 -2
  1573. package/build-module/utils/math.js.map +1 -1
  1574. package/build-module/utils/object.js +1 -4
  1575. package/build-module/utils/object.js.map +1 -1
  1576. package/build-module/utils/order-inserter-block-items.js +30 -0
  1577. package/build-module/utils/order-inserter-block-items.js.map +1 -0
  1578. package/build-module/utils/parse-css-unit-to-px.js +3 -6
  1579. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  1580. package/build-module/utils/pasting.js +5 -8
  1581. package/build-module/utils/pasting.js.map +1 -1
  1582. package/build-module/utils/pre-parse-patterns.js +1 -1
  1583. package/build-module/utils/pre-parse-patterns.js.map +1 -1
  1584. package/build-module/utils/sorting.js +1 -2
  1585. package/build-module/utils/sorting.js.map +1 -1
  1586. package/build-module/utils/transform-styles/index.js +5 -7
  1587. package/build-module/utils/transform-styles/index.js.map +1 -1
  1588. package/build-module/utils/transform-styles/transforms/wrap.js +25 -28
  1589. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1590. package/build-style/content-rtl.css +33 -17
  1591. package/build-style/content.css +33 -17
  1592. package/build-style/default-editor-styles-rtl.css +1 -1
  1593. package/build-style/default-editor-styles.css +1 -1
  1594. package/build-style/style-rtl.css +46 -157
  1595. package/build-style/style.css +47 -157
  1596. package/package.json +32 -31
  1597. package/src/autocompleters/block.js +15 -7
  1598. package/src/components/block-breadcrumb/index.js +11 -3
  1599. package/src/components/block-controls/fill.js +15 -17
  1600. package/src/components/block-controls/slot.js +21 -18
  1601. package/src/components/block-controls/slot.native.js +3 -8
  1602. package/src/components/block-draggable/index.js +2 -1
  1603. package/src/components/block-edit/test/edit.js +1 -1
  1604. package/src/components/block-editing-mode/index.js +71 -0
  1605. package/src/components/block-inspector/index.js +1 -0
  1606. package/src/components/block-list/block-list-block-context.js +6 -0
  1607. package/src/components/block-list/block.js +38 -56
  1608. package/src/components/block-list/block.native.js +30 -41
  1609. package/src/components/block-list/content.scss +8 -12
  1610. package/src/components/block-list/index.native.js +164 -153
  1611. package/src/components/block-list/test/index.native.js +2 -2
  1612. package/src/components/block-list/use-block-props/index.js +7 -2
  1613. package/src/components/block-list/use-in-between-inserter.js +7 -3
  1614. package/src/components/block-list-appender/index.js +26 -5
  1615. package/src/components/block-lock/toolbar.js +2 -8
  1616. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +23 -0
  1617. package/src/components/block-mover/style.scss +1 -0
  1618. package/src/components/block-settings-menu/block-settings-dropdown.js +81 -41
  1619. package/src/components/block-styles/preview-panel.js +1 -3
  1620. package/src/components/block-switcher/block-transformations-menu.js +12 -0
  1621. package/src/components/block-switcher/block-variation-transformations.js +115 -0
  1622. package/src/components/block-switcher/index.js +38 -5
  1623. package/src/components/block-switcher/pattern-transformations-menu.js +5 -5
  1624. package/src/components/block-switcher/style.scss +6 -5
  1625. package/src/components/block-toolbar/index.js +10 -11
  1626. package/src/components/block-tools/block-contextual-toolbar.js +4 -5
  1627. package/src/components/block-tools/insertion-point.js +23 -9
  1628. package/src/components/block-tools/selected-block-popover.js +6 -0
  1629. package/src/components/button-block-appender/content.scss +22 -0
  1630. package/src/components/color-palette/test/__snapshots__/control.js.snap +66 -50
  1631. package/src/components/color-palette/with-color-context.js +2 -6
  1632. package/src/components/colors-gradients/control.js +3 -3
  1633. package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -5
  1634. package/src/components/convert-to-group-buttons/index.js +9 -2
  1635. package/src/components/convert-to-group-buttons/index.native.js +79 -1
  1636. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +32 -38
  1637. package/src/components/global-styles/dimensions-panel.js +17 -7
  1638. package/src/components/global-styles/get-block-css-selector.js +2 -2
  1639. package/src/components/global-styles/style.scss +3 -0
  1640. package/src/components/global-styles/test/typography-utils.js +139 -1
  1641. package/src/components/global-styles/typography-utils.js +53 -28
  1642. package/src/components/global-styles/use-global-styles-output.js +18 -8
  1643. package/src/components/global-styles/utils.js +9 -3
  1644. package/src/components/iframe/index.js +61 -73
  1645. package/src/components/iframe/use-compatibility-styles.js +34 -18
  1646. package/src/components/inner-blocks/README.md +5 -0
  1647. package/src/components/inner-blocks/index.js +2 -0
  1648. package/src/components/inner-blocks/index.native.js +16 -6
  1649. package/src/components/inner-blocks/use-nested-settings-update.js +20 -3
  1650. package/src/components/inserter/index.js +1 -9
  1651. package/src/components/inserter/quick-inserter.js +0 -2
  1652. package/src/components/inserter/search-results.js +32 -6
  1653. package/src/components/inspector-controls/README.md +1 -1
  1654. package/src/components/inspector-controls/fill.js +2 -6
  1655. package/src/components/inspector-controls-tabs/index.js +0 -1
  1656. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +0 -1
  1657. package/src/components/link-control/index.js +71 -33
  1658. package/src/components/link-control/is-url-like.js +40 -3
  1659. package/src/components/link-control/search-results.js +4 -14
  1660. package/src/components/link-control/settings-drawer.js +2 -37
  1661. package/src/components/link-control/settings.js +2 -2
  1662. package/src/components/link-control/style.scss +5 -6
  1663. package/src/components/link-control/test/index.js +169 -61
  1664. package/src/components/link-control/test/is-url-like.js +66 -0
  1665. package/src/components/link-control/use-internal-value.js +60 -0
  1666. package/src/components/link-control/use-search-handler.js +10 -27
  1667. package/src/components/list-view/appender.js +6 -7
  1668. package/src/components/list-view/aria-referenced-text.js +30 -0
  1669. package/src/components/list-view/block-contents.js +10 -3
  1670. package/src/components/list-view/block-select-button.js +59 -1
  1671. package/src/components/list-view/block.js +69 -45
  1672. package/src/components/list-view/branch.js +1 -7
  1673. package/src/components/list-view/index.js +45 -22
  1674. package/src/components/list-view/style.scss +2 -10
  1675. package/src/components/list-view/test/use-list-view-drop-zone.js +38 -1
  1676. package/src/components/list-view/use-block-selection.js +2 -2
  1677. package/src/components/list-view/use-list-view-client-ids.js +21 -4
  1678. package/src/components/list-view/use-list-view-drop-zone.js +22 -4
  1679. package/src/components/media-replace-flow/test/index.js +1 -1
  1680. package/src/components/navigable-toolbar/index.js +7 -5
  1681. package/src/components/publish-date-time-picker/index.js +0 -2
  1682. package/src/components/rich-text/index.js +1 -1
  1683. package/src/components/rich-text/use-firefox-compat.js +27 -1
  1684. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +26 -0
  1685. package/src/components/spacing-sizes-control/index.js +85 -71
  1686. package/src/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +14 -13
  1687. package/src/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +15 -14
  1688. package/src/components/spacing-sizes-control/input-controls/single.js +40 -0
  1689. package/src/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +55 -80
  1690. package/src/components/spacing-sizes-control/sides-dropdown/index.js +91 -0
  1691. package/src/components/spacing-sizes-control/style.scss +28 -100
  1692. package/src/components/spacing-sizes-control/test/utils.js +233 -4
  1693. package/src/components/spacing-sizes-control/utils.js +203 -20
  1694. package/src/components/ungroup-button/index.native.js +2 -2
  1695. package/src/components/url-input/README.md +6 -0
  1696. package/src/components/url-input/index.js +1 -0
  1697. package/src/components/use-block-drop-zone/index.js +31 -17
  1698. package/src/components/use-resize-canvas/index.js +9 -1
  1699. package/src/components/writing-flow/test/index.js +15 -0
  1700. package/src/components/writing-flow/use-arrow-nav.js +17 -4
  1701. package/src/components/writing-flow/use-tab-nav.js +14 -3
  1702. package/src/hooks/align.js +3 -11
  1703. package/src/hooks/anchor.js +3 -1
  1704. package/src/hooks/behaviors.js +160 -0
  1705. package/src/hooks/custom-class-name.js +23 -19
  1706. package/src/hooks/dimensions.js +0 -40
  1707. package/src/hooks/duotone.js +3 -11
  1708. package/src/hooks/index.js +1 -0
  1709. package/src/hooks/layout.js +14 -19
  1710. package/src/hooks/style.js +3 -1
  1711. package/src/hooks/utils.js +8 -7
  1712. package/src/layouts/grid.js +29 -3
  1713. package/src/private-apis.js +2 -4
  1714. package/src/store/private-actions.js +39 -0
  1715. package/src/store/private-selectors.js +117 -0
  1716. package/src/store/reducer.js +33 -8
  1717. package/src/store/selectors.js +56 -35
  1718. package/src/store/test/private-actions.js +32 -1
  1719. package/src/store/test/private-selectors.js +333 -0
  1720. package/src/store/test/reducer.js +48 -7
  1721. package/src/store/test/selectors.js +99 -0
  1722. package/src/style.scss +0 -3
  1723. package/src/utils/order-inserter-block-items.js +26 -0
  1724. package/build/components/block-list/block-list-compact.native.js +0 -75
  1725. package/build/components/block-list/block-list-compact.native.js.map +0 -1
  1726. package/build/components/link-control/use-internal-input-value.js +0 -27
  1727. package/build/components/link-control/use-internal-input-value.js.map +0 -1
  1728. package/build/components/off-canvas-editor/appender.js +0 -125
  1729. package/build/components/off-canvas-editor/appender.js.map +0 -1
  1730. package/build/components/off-canvas-editor/block-contents.js +0 -141
  1731. package/build/components/off-canvas-editor/block-contents.js.map +0 -1
  1732. package/build/components/off-canvas-editor/block-select-button.js +0 -126
  1733. package/build/components/off-canvas-editor/block-select-button.js.map +0 -1
  1734. package/build/components/off-canvas-editor/block.js +0 -297
  1735. package/build/components/off-canvas-editor/block.js.map +0 -1
  1736. package/build/components/off-canvas-editor/branch.js +0 -197
  1737. package/build/components/off-canvas-editor/branch.js.map +0 -1
  1738. package/build/components/off-canvas-editor/context.js +0 -19
  1739. package/build/components/off-canvas-editor/context.js.map +0 -1
  1740. package/build/components/off-canvas-editor/drop-indicator.js +0 -118
  1741. package/build/components/off-canvas-editor/drop-indicator.js.map +0 -1
  1742. package/build/components/off-canvas-editor/expander.js +0 -41
  1743. package/build/components/off-canvas-editor/expander.js.map +0 -1
  1744. package/build/components/off-canvas-editor/index.js +0 -236
  1745. package/build/components/off-canvas-editor/index.js.map +0 -1
  1746. package/build/components/off-canvas-editor/leaf-more-menu.js +0 -148
  1747. package/build/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  1748. package/build/components/off-canvas-editor/leaf.js +0 -60
  1749. package/build/components/off-canvas-editor/leaf.js.map +0 -1
  1750. package/build/components/off-canvas-editor/link-ui.js +0 -186
  1751. package/build/components/off-canvas-editor/link-ui.js.map +0 -1
  1752. package/build/components/off-canvas-editor/update-attributes.js +0 -108
  1753. package/build/components/off-canvas-editor/update-attributes.js.map +0 -1
  1754. package/build/components/off-canvas-editor/use-block-selection.js +0 -139
  1755. package/build/components/off-canvas-editor/use-block-selection.js.map +0 -1
  1756. package/build/components/off-canvas-editor/use-inserted-block.js +0 -58
  1757. package/build/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  1758. package/build/components/off-canvas-editor/use-list-view-client-ids.js +0 -33
  1759. package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  1760. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +0 -235
  1761. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  1762. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -60
  1763. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  1764. package/build/components/off-canvas-editor/utils.js +0 -60
  1765. package/build/components/off-canvas-editor/utils.js.map +0 -1
  1766. package/build/components/spacing-sizes-control/all-input-control.js +0 -57
  1767. package/build/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1768. package/build/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1769. package/build/components/spacing-sizes-control/input-controls.js.map +0 -1
  1770. package/build/components/spacing-sizes-control/linked-button.js +0 -37
  1771. package/build/components/spacing-sizes-control/linked-button.js.map +0 -1
  1772. package/build/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1773. package/build/components/ungroup-button/icon.js +0 -31
  1774. package/build/components/ungroup-button/icon.js.map +0 -1
  1775. package/build-module/components/block-list/block-list-compact.native.js +0 -60
  1776. package/build-module/components/block-list/block-list-compact.native.js.map +0 -1
  1777. package/build-module/components/link-control/use-internal-input-value.js +0 -19
  1778. package/build-module/components/link-control/use-internal-input-value.js.map +0 -1
  1779. package/build-module/components/off-canvas-editor/appender.js +0 -108
  1780. package/build-module/components/off-canvas-editor/appender.js.map +0 -1
  1781. package/build-module/components/off-canvas-editor/block-contents.js +0 -121
  1782. package/build-module/components/off-canvas-editor/block-contents.js.map +0 -1
  1783. package/build-module/components/off-canvas-editor/block-select-button.js +0 -107
  1784. package/build-module/components/off-canvas-editor/block-select-button.js.map +0 -1
  1785. package/build-module/components/off-canvas-editor/block.js +0 -273
  1786. package/build-module/components/off-canvas-editor/block.js.map +0 -1
  1787. package/build-module/components/off-canvas-editor/branch.js +0 -179
  1788. package/build-module/components/off-canvas-editor/branch.js.map +0 -1
  1789. package/build-module/components/off-canvas-editor/context.js +0 -7
  1790. package/build-module/components/off-canvas-editor/context.js.map +0 -1
  1791. package/build-module/components/off-canvas-editor/drop-indicator.js +0 -111
  1792. package/build-module/components/off-canvas-editor/drop-indicator.js.map +0 -1
  1793. package/build-module/components/off-canvas-editor/expander.js +0 -32
  1794. package/build-module/components/off-canvas-editor/expander.js.map +0 -1
  1795. package/build-module/components/off-canvas-editor/index.js +0 -213
  1796. package/build-module/components/off-canvas-editor/index.js.map +0 -1
  1797. package/build-module/components/off-canvas-editor/leaf-more-menu.js +0 -130
  1798. package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  1799. package/build-module/components/off-canvas-editor/leaf.js +0 -45
  1800. package/build-module/components/off-canvas-editor/leaf.js.map +0 -1
  1801. package/build-module/components/off-canvas-editor/link-ui.js +0 -166
  1802. package/build-module/components/off-canvas-editor/link-ui.js.map +0 -1
  1803. package/build-module/components/off-canvas-editor/update-attributes.js +0 -97
  1804. package/build-module/components/off-canvas-editor/update-attributes.js.map +0 -1
  1805. package/build-module/components/off-canvas-editor/use-block-selection.js +0 -124
  1806. package/build-module/components/off-canvas-editor/use-block-selection.js.map +0 -1
  1807. package/build-module/components/off-canvas-editor/use-inserted-block.js +0 -47
  1808. package/build-module/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  1809. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +0 -24
  1810. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  1811. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +0 -220
  1812. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  1813. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -50
  1814. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  1815. package/build-module/components/off-canvas-editor/utils.js +0 -44
  1816. package/build-module/components/off-canvas-editor/utils.js.map +0 -1
  1817. package/build-module/components/spacing-sizes-control/all-input-control.js +0 -45
  1818. package/build-module/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1819. package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1820. package/build-module/components/spacing-sizes-control/input-controls.js.map +0 -1
  1821. package/build-module/components/spacing-sizes-control/linked-button.js +0 -27
  1822. package/build-module/components/spacing-sizes-control/linked-button.js.map +0 -1
  1823. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1824. package/build-module/components/ungroup-button/icon.js +0 -22
  1825. package/build-module/components/ungroup-button/icon.js.map +0 -1
  1826. package/src/components/block-list/block-list-compact.native.js +0 -63
  1827. package/src/components/link-control/use-internal-input-value.js +0 -23
  1828. package/src/components/off-canvas-editor/README.md +0 -5
  1829. package/src/components/off-canvas-editor/appender.js +0 -124
  1830. package/src/components/off-canvas-editor/block-contents.js +0 -156
  1831. package/src/components/off-canvas-editor/block-select-button.js +0 -128
  1832. package/src/components/off-canvas-editor/block.js +0 -347
  1833. package/src/components/off-canvas-editor/branch.js +0 -238
  1834. package/src/components/off-canvas-editor/context.js +0 -8
  1835. package/src/components/off-canvas-editor/drop-indicator.js +0 -126
  1836. package/src/components/off-canvas-editor/expander.js +0 -26
  1837. package/src/components/off-canvas-editor/index.js +0 -271
  1838. package/src/components/off-canvas-editor/leaf-more-menu.js +0 -158
  1839. package/src/components/off-canvas-editor/leaf.js +0 -52
  1840. package/src/components/off-canvas-editor/link-ui.js +0 -167
  1841. package/src/components/off-canvas-editor/style.scss +0 -34
  1842. package/src/components/off-canvas-editor/test/use-inserted-block.js +0 -108
  1843. package/src/components/off-canvas-editor/test/utils.js +0 -50
  1844. package/src/components/off-canvas-editor/update-attributes.js +0 -99
  1845. package/src/components/off-canvas-editor/use-block-selection.js +0 -169
  1846. package/src/components/off-canvas-editor/use-inserted-block.js +0 -47
  1847. package/src/components/off-canvas-editor/use-list-view-client-ids.js +0 -29
  1848. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +0 -260
  1849. package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -58
  1850. package/src/components/off-canvas-editor/utils.js +0 -58
  1851. package/src/components/spacing-sizes-control/all-input-control.js +0 -44
  1852. package/src/components/spacing-sizes-control/linked-button.js +0 -24
  1853. package/src/components/ungroup-button/icon.js +0 -26
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-on-block-drop/index.js"],"names":["useCallback","cloneBlock","findTransform","getBlockTransforms","pasteHandler","useDispatch","useSelect","useRegistry","getFilesFromDataTransfer","store","blockEditorStore","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","getSettings","mediaUpload","getBlockOrder","getBlocksByClientId","insertBlocks","moveBlocksToPosition","replaceBlocks","removeBlocks","registry","updateSelection","initialPosition","clientIds","clientId","undefined","sourceBlocks","targetBlockClientIds","targetBlockClientId","batch","_onDrop","_onFilesDrop","_onHTMLDrop","html"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,oBAA5B;AACA,SACCC,UADD,EAECC,aAFD,EAGCC,kBAHD,EAICC,YAJD,QAKO,mBALP;AAMA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,WAAjC,QAAoD,iBAApD;AACA,SAASC,wBAAT,QAAyC,gBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,cAAT,CAAyBC,KAAzB,EAAiC;AACvC,MAAIC,MAAM,GAAG;AACZC,IAAAA,eAAe,EAAE,IADL;AAEZC,IAAAA,YAAY,EAAE,IAFF;AAGZC,IAAAA,QAAQ,EAAE,IAH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D0B,EAE1BC,gBAF0B,EAG1BC,aAH0B,EAI1BC,yBAJ0B,EAK1BC,UAL0B,EAM1BC,qBAN0B,EAO1BC,kBAP0B,CAA3B;;AASA,QAAMkD,YAAY,GAAGnC,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,QAAMoD,WAAW,GAAG3B,UAAU,CAC7B9B,kBAD6B,EAE7BC,gBAF6B,EAG7BI,qBAH6B,CAA9B;;AAMA,SAASpB,KAAF,IAAa;AACnB,UAAMwC,KAAK,GAAG5C,wBAAwB,CAAEI,KAAK,CAACO,YAAR,CAAtC;AACA,UAAMkE,IAAI,GAAGzE,KAAK,CAACO,YAAN,CAAmBK,OAAnB,CAA4B,WAA5B,CAAb;AAEA;AACF;AACA;AACA;;AACE,QAAK6D,IAAL,EAAY;AACXD,MAAAA,WAAW,CAAEC,IAAF,CAAX;AACA,KAFD,MAEO,IAAKjC,KAAK,CAACN,MAAX,EAAoB;AAC1BqC,MAAAA,YAAY,CAAE/B,KAAF,CAAZ;AACA,KAFM,MAEA;AACN8B,MAAAA,OAAO,CAAEtE,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":["useCallback","cloneBlock","findTransform","getBlockTransforms","pasteHandler","useDispatch","useSelect","useRegistry","getFilesFromDataTransfer","store","blockEditorStore","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","getSettings","mediaUpload","getBlockOrder","getBlocksByClientId","insertBlocks","moveBlocksToPosition","replaceBlocks","removeBlocks","registry","updateSelection","initialPosition","clientIds","clientId","undefined","sourceBlocks","targetBlockClientIds","targetBlockClientId","batch","_onDrop","_onFilesDrop","_onHTMLDrop","html"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,oBAA5B;AACA,SACCC,UADD,EAECC,aAFD,EAGCC,kBAHD,EAICC,YAJD,QAKO,mBALP;AAMA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,WAAjC,QAAoD,iBAApD;AACA,SAASC,wBAAT,QAAyC,gBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,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,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+B,EAI/BC,qBAJ+B,EAK/BC,kBAL+B,EAM/BnB,qBAN+B,CAAhC;;AAQA,QAAMoD,WAAW,GAAG3B,UAAU,CAC7B9B,kBAD6B,EAE7BC,gBAF6B,EAG7BI,qBAH6B,CAA9B;;AAMA,SAASpB,KAAF,IAAa;AACnB,UAAMwC,KAAK,GAAG5C,wBAAwB,CAAEI,KAAK,CAACO,YAAR,CAAtC;AACA,UAAMkE,IAAI,GAAGzE,KAAK,CAACO,YAAN,CAAmBK,OAAnB,CAA4B,WAA5B,CAAb;AAEA;AACF;AACA;AACA;;AACE,QAAK6D,IAAL,EAAY;AACXD,MAAAA,WAAW,CAAEC,IAAF,CAAX;AACA,KAFD,MAEO,IAAKjC,KAAK,CAACN,MAAX,EAAoB;AAC1BqC,MAAAA,YAAY,CAAE/B,KAAF,CAAZ;AACA,KAFM,MAEA;AACN8B,MAAAA,OAAO,CAAEtE,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"]}
@@ -20,16 +20,14 @@ import { store as blockEditorStore } from '../../store';
20
20
  */
21
21
 
22
22
  export function onBlockDrop(getBlockIndex, getClientIdsOfDescendants, moveBlocksToPosition, insertBlocks, clearSelectedBlock) {
23
- return _ref => {
24
- let {
25
- blocks,
26
- srcClientIds: sourceClientIds,
27
- srcRootClientId: sourceRootClientId,
28
- targetBlockIndex,
29
- targetRootClientId,
30
- type: dropType
31
- } = _ref;
32
-
23
+ return ({
24
+ blocks,
25
+ srcClientIds: sourceClientIds,
26
+ srcRootClientId: sourceRootClientId,
27
+ targetBlockIndex,
28
+ targetRootClientId,
29
+ type: dropType
30
+ }) => {
33
31
  // If the user is inserting a block.
34
32
  if (dropType === 'inserter') {
35
33
  clearSelectedBlock();
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-on-block-drop/index.native.js"],"names":["cloneBlock","useDispatch","useSelect","store","blockEditorStore","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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,WAAT,CACNC,aADM,EAENC,yBAFM,EAGNC,oBAHM,EAINC,YAJM,EAKNC,kBALM,EAML;AACD,SAAO,QAOA;AAAA,QAPE;AACRC,MAAAA,MADQ;AAERC,MAAAA,YAAY,EAAEC,eAFN;AAGRC,MAAAA,eAAe,EAAEC,kBAHT;AAIRC,MAAAA,gBAJQ;AAKRC,MAAAA,kBALQ;AAMRC,MAAAA,IAAI,EAAEC;AANE,KAOF;;AACN;AACA,QAAKA,QAAQ,KAAK,UAAlB,EAA+B;AAC9BT,MAAAA,kBAAkB;AAClB,YAAMU,cAAc,GAAGT,MAAM,CAACU,GAAP,CAAcC,KAAF,IAClCtB,UAAU,CAAEsB,KAAF,CADY,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;;AACA,eAAe,SAASC,cAAT,GAA0B;AACxC,QAAM;AAAEzB,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MACLL,SAAS,CAAEE,gBAAF,CADV;AAEA,QAAM;AAAEK,IAAAA,YAAF;AAAgBD,IAAAA,oBAAhB;AAAsCE,IAAAA;AAAtC,MACLT,WAAW,CAAEG,gBAAF,CADZ;AAGA,SAAOC,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":["cloneBlock","useDispatch","useSelect","store","blockEditorStore","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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,mBAA3B;AACA,SAASC,WAAT,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A;;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;;AACA,eAAe,SAASC,cAAT,GAA0B;AACxC,QAAM;AAAEzB,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MACLL,SAAS,CAAEE,gBAAF,CADV;AAEA,QAAM;AAAEK,IAAAA,YAAF;AAAgBD,IAAAA,oBAAhB;AAAsCE,IAAAA;AAAtC,MACLT,WAAW,CAAEG,gBAAF,CADZ;AAGA,SAAOC,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"]}
@@ -68,9 +68,7 @@ const STYLE_ATTRIBUTES = {
68
68
  */
69
69
 
70
70
  function getStyleAttributes(sourceBlock, targetBlock) {
71
- return Object.entries(STYLE_ATTRIBUTES).reduce((attributes, _ref) => {
72
- let [attributeKey, hasSupport] = _ref;
73
-
71
+ return Object.entries(STYLE_ATTRIBUTES).reduce((attributes, [attributeKey, hasSupport]) => {
74
72
  // Only apply the attribute if both blocks support it.
75
73
  if (hasSupport(sourceBlock.name) && hasSupport(targetBlock.name)) {
76
74
  // Override attributes that are not present in the block to their defaults.
@@ -156,9 +154,7 @@ export default function usePasteStyles() {
156
154
  }
157
155
 
158
156
  if (targetBlocks.length === 1) {
159
- var _getBlockType;
160
-
161
- const title = (_getBlockType = getBlockType(targetBlocks[0].name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title;
157
+ const title = getBlockType(targetBlocks[0].name)?.title;
162
158
  createSuccessNotice(sprintf( // Translators: Name of the block being pasted, e.g. "Paragraph".
163
159
  __('Pasted styles to %s.'), title), {
164
160
  type: 'snackbar'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-paste-styles/index.js"],"names":["useCallback","getBlockType","parse","useDispatch","useRegistry","store","noticesStore","__","sprintf","blockEditorStore","hasAlignSupport","hasBorderSupport","hasBackgroundColorSupport","hasTextColorSupport","hasGradientSupport","hasCustomClassNameSupport","hasFontFamilySupport","hasFontSizeSupport","hasLayoutSupport","hasStyleSupport","hasSerializedBlocks","text","blocks","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","borderColor","nameOrType","backgroundColor","textColor","gradient","className","fontFamily","fontSize","layout","style","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","createSuccessNotice","createWarningNotice","createErrorNotice","html","window","navigator","clipboard","type","readText","error","copiedBlocks","batch","map","title"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,oBAA5B;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,WAAtB,QAAyC,iBAAzC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,gBAAlB,QAA0C,aAA1C;AACA,SACCC,eADD,EAECC,gBAFD,EAGCC,yBAHD,EAICC,mBAJD,EAKCC,kBALD,EAMCC,yBAND,EAOCC,oBAPD,EAQCC,kBARD,EASCC,gBATD,EAUCC,eAVD,QAWO,sBAXP;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,mBAAT,CAA8BC,IAA9B,EAAqC;AACpC,MAAI;AACH,UAAMC,MAAM,GAAGpB,KAAK,CAAEmB,IAAF,EAAQ;AAC3BE,MAAAA,2BAA2B,EAAE,IADF;AAE3BC,MAAAA,mBAAmB,EAAE;AAFM,KAAR,CAApB;;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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ArFiB,CAAlB;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":["useCallback","getBlockType","parse","useDispatch","useRegistry","store","noticesStore","__","sprintf","blockEditorStore","hasAlignSupport","hasBorderSupport","hasBackgroundColorSupport","hasTextColorSupport","hasGradientSupport","hasCustomClassNameSupport","hasFontFamilySupport","hasFontSizeSupport","hasLayoutSupport","hasStyleSupport","hasSerializedBlocks","text","blocks","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","borderColor","nameOrType","backgroundColor","textColor","gradient","className","fontFamily","fontSize","layout","style","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","createSuccessNotice","createWarningNotice","createErrorNotice","html","window","navigator","clipboard","type","readText","error","copiedBlocks","batch","map","title"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,oBAA5B;AACA,SAASC,YAAT,EAAuBC,KAAvB,QAAoC,mBAApC;AACA,SAASC,WAAT,EAAsBC,WAAtB,QAAyC,iBAAzC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,gBAAlB,QAA0C,aAA1C;AACA,SACCC,eADD,EAECC,gBAFD,EAGCC,yBAHD,EAICC,mBAJD,EAKCC,kBALD,EAMCC,yBAND,EAOCC,oBAPD,EAQCC,kBARD,EASCC,gBATD,EAUCC,eAVD,QAWO,sBAXP;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,mBAAT,CAA8BC,IAA9B,EAAqC;AACpC,MAAI;AACH,UAAMC,MAAM,GAAGpB,KAAK,CAAEmB,IAAF,EAAQ;AAC3BE,MAAAA,2BAA2B,EAAE,IADF;AAE3BC,MAAAA,mBAAmB,EAAE;AAFM,KAAR,CAApB;;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;A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**\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"]}
@@ -48,13 +48,20 @@ export default function useResizeCanvas(deviceType) {
48
48
 
49
49
  const contentInlineStyles = device => {
50
50
  const height = device === 'Mobile' ? '768px' : '1024px';
51
+ const marginVertical = marginValue() + 'px';
52
+ const marginHorizontal = 'auto';
51
53
 
52
54
  switch (device) {
53
55
  case 'Tablet':
54
56
  case 'Mobile':
55
57
  return {
56
58
  width: getCanvasWidth(device),
57
- margin: marginValue() + 'px auto',
59
+ // Keeping margin styles separate to avoid warnings
60
+ // when those props get overridden in the iframe component
61
+ marginTop: marginVertical,
62
+ marginBottom: marginVertical,
63
+ marginLeft: marginHorizontal,
64
+ marginRight: marginHorizontal,
58
65
  height,
59
66
  borderRadius: '2px 2px 2px 2px',
60
67
  border: '1px solid #ddd',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-resize-canvas/index.js"],"names":["useEffect","useState","useResizeCanvas","deviceType","actualWidth","updateActualWidth","window","innerWidth","resizeListener","addEventListener","removeEventListener","getCanvasWidth","device","deviceWidth","marginValue","innerHeight","contentInlineStyles","height","width","margin","borderRadius","border","overflowY"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,eAAT,CAA0BC,UAA1B,EAAuC;AACrD,QAAM,CAAEC,WAAF,EAAeC,iBAAf,IAAqCJ,QAAQ,CAAEK,MAAM,CAACC,UAAT,CAAnD;AAEAP,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKG,UAAU,KAAK,SAApB,EAAgC;AAC/B;AACA;;AAED,UAAMK,cAAc,GAAG,MAAMH,iBAAiB,CAAEC,MAAM,CAACC,UAAT,CAA9C;;AACAD,IAAAA,MAAM,CAACG,gBAAP,CAAyB,QAAzB,EAAmCD,cAAnC;AAEA,WAAO,MAAM;AACZF,MAAAA,MAAM,CAACI,mBAAP,CAA4B,QAA5B,EAAsCF,cAAtC;AACA,KAFD;AAGA,GAXQ,EAWN,CAAEL,UAAF,CAXM,CAAT;;AAaA,QAAMQ,cAAc,GAAKC,MAAF,IAAc;AACpC,QAAIC,WAAJ;;AAEA,YAASD,MAAT;AACC,WAAK,QAAL;AACCC,QAAAA,WAAW,GAAG,GAAd;AACA;;AACD,WAAK,QAAL;AACCA,QAAAA,WAAW,GAAG,GAAd;AACA;;AACD;AACC,eAAO,IAAP;AARF;;AAWA,WAAOA,WAAW,GAAGT,WAAd,GAA4BS,WAA5B,GAA0CT,WAAjD;AACA,GAfD;;AAiBA,QAAMU,WAAW,GAAG,MAAQR,MAAM,CAACS,WAAP,GAAqB,GAArB,GAA2B,EAA3B,GAAgC,EAA5D;;AAEA,QAAMC,mBAAmB,GAAKJ,MAAF,IAAc;AACzC,UAAMK,MAAM,GAAGL,MAAM,KAAK,QAAX,GAAsB,OAAtB,GAAgC,QAA/C;;AACA,YAASA,MAAT;AACC,WAAK,QAAL;AACA,WAAK,QAAL;AACC,eAAO;AACNM,UAAAA,KAAK,EAAEP,cAAc,CAAEC,MAAF,CADf;AAENO,UAAAA,MAAM,EAAEL,WAAW,KAAK,SAFlB;AAGNG,UAAAA,MAHM;AAING,UAAAA,YAAY,EAAE,iBAJR;AAKNC,UAAAA,MAAM,EAAE,gBALF;AAMNC,UAAAA,SAAS,EAAE;AANL,SAAP;;AAQD;AACC,eAAO,IAAP;AAZF;AAcA,GAhBD;;AAkBA,SAAON,mBAAmB,CAAEb,UAAF,CAA1B;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Function to resize the editor window.\n *\n * @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile)\n *\n * @return {Object} Inline styles to be added to resizable container.\n */\nexport default function useResizeCanvas( deviceType ) {\n\tconst [ actualWidth, updateActualWidth ] = useState( window.innerWidth );\n\n\tuseEffect( () => {\n\t\tif ( deviceType === 'Desktop' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeListener = () => updateActualWidth( window.innerWidth );\n\t\twindow.addEventListener( 'resize', resizeListener );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'resize', resizeListener );\n\t\t};\n\t}, [ deviceType ] );\n\n\tconst getCanvasWidth = ( device ) => {\n\t\tlet deviceWidth;\n\n\t\tswitch ( device ) {\n\t\t\tcase 'Tablet':\n\t\t\t\tdeviceWidth = 780;\n\t\t\t\tbreak;\n\t\t\tcase 'Mobile':\n\t\t\t\tdeviceWidth = 360;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\n\t\treturn deviceWidth < actualWidth ? deviceWidth : actualWidth;\n\t};\n\n\tconst marginValue = () => ( window.innerHeight < 800 ? 36 : 72 );\n\n\tconst contentInlineStyles = ( device ) => {\n\t\tconst height = device === 'Mobile' ? '768px' : '1024px';\n\t\tswitch ( device ) {\n\t\t\tcase 'Tablet':\n\t\t\tcase 'Mobile':\n\t\t\t\treturn {\n\t\t\t\t\twidth: getCanvasWidth( device ),\n\t\t\t\t\tmargin: marginValue() + 'px auto',\n\t\t\t\t\theight,\n\t\t\t\t\tborderRadius: '2px 2px 2px 2px',\n\t\t\t\t\tborder: '1px solid #ddd',\n\t\t\t\t\toverflowY: 'auto',\n\t\t\t\t};\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t};\n\n\treturn contentInlineStyles( deviceType );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-resize-canvas/index.js"],"names":["useEffect","useState","useResizeCanvas","deviceType","actualWidth","updateActualWidth","window","innerWidth","resizeListener","addEventListener","removeEventListener","getCanvasWidth","device","deviceWidth","marginValue","innerHeight","contentInlineStyles","height","marginVertical","marginHorizontal","width","marginTop","marginBottom","marginLeft","marginRight","borderRadius","border","overflowY"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,QAAoC,oBAApC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,eAAT,CAA0BC,UAA1B,EAAuC;AACrD,QAAM,CAAEC,WAAF,EAAeC,iBAAf,IAAqCJ,QAAQ,CAAEK,MAAM,CAACC,UAAT,CAAnD;AAEAP,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKG,UAAU,KAAK,SAApB,EAAgC;AAC/B;AACA;;AAED,UAAMK,cAAc,GAAG,MAAMH,iBAAiB,CAAEC,MAAM,CAACC,UAAT,CAA9C;;AACAD,IAA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UAAF,CAA1B;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\n\n/**\n * Function to resize the editor window.\n *\n * @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile)\n *\n * @return {Object} Inline styles to be added to resizable container.\n */\nexport default function useResizeCanvas( deviceType ) {\n\tconst [ actualWidth, updateActualWidth ] = useState( window.innerWidth );\n\n\tuseEffect( () => {\n\t\tif ( deviceType === 'Desktop' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeListener = () => updateActualWidth( window.innerWidth );\n\t\twindow.addEventListener( 'resize', resizeListener );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'resize', resizeListener );\n\t\t};\n\t}, [ deviceType ] );\n\n\tconst getCanvasWidth = ( device ) => {\n\t\tlet deviceWidth;\n\n\t\tswitch ( device ) {\n\t\t\tcase 'Tablet':\n\t\t\t\tdeviceWidth = 780;\n\t\t\t\tbreak;\n\t\t\tcase 'Mobile':\n\t\t\t\tdeviceWidth = 360;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\n\t\treturn deviceWidth < actualWidth ? deviceWidth : actualWidth;\n\t};\n\n\tconst marginValue = () => ( window.innerHeight < 800 ? 36 : 72 );\n\n\tconst contentInlineStyles = ( device ) => {\n\t\tconst height = device === 'Mobile' ? '768px' : '1024px';\n\t\tconst marginVertical = marginValue() + 'px';\n\t\tconst marginHorizontal = 'auto';\n\n\t\tswitch ( device ) {\n\t\t\tcase 'Tablet':\n\t\t\tcase 'Mobile':\n\t\t\t\treturn {\n\t\t\t\t\twidth: getCanvasWidth( device ),\n\t\t\t\t\t// Keeping margin styles separate to avoid warnings\n\t\t\t\t\t// when those props get overridden in the iframe component\n\t\t\t\t\tmarginTop: marginVertical,\n\t\t\t\t\tmarginBottom: marginVertical,\n\t\t\t\t\tmarginLeft: marginHorizontal,\n\t\t\t\t\tmarginRight: marginHorizontal,\n\t\t\t\t\theight,\n\t\t\t\t\tborderRadius: '2px 2px 2px 2px',\n\t\t\t\t\tborder: '1px solid #ddd',\n\t\t\t\t\toverflowY: 'auto',\n\t\t\t\t};\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t};\n\n\treturn contentInlineStyles( deviceType );\n}\n"]}
@@ -13,13 +13,12 @@ import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
13
13
  import { __ } from '@wordpress/i18n';
14
14
  import { moreHorizontal } from '@wordpress/icons';
15
15
 
16
- function Warning(_ref) {
17
- let {
18
- className,
19
- actions,
20
- children,
21
- secondaryActions
22
- } = _ref;
16
+ function Warning({
17
+ className,
18
+ actions,
19
+ children,
20
+ secondaryActions
21
+ }) {
23
22
  return createElement("div", {
24
23
  style: {
25
24
  display: 'contents',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.js"],"names":["classnames","Children","DropdownMenu","MenuGroup","MenuItem","__","moreHorizontal","Warning","className","actions","children","secondaryActions","display","all","count","map","action","i","position","item","pos","onClick","title"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,QAAlC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,kBAA/B;;AAEA,SAASC,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,EAAGb,UAAU,CAAEQ,SAAF,EAAa,sBAAb;AAA3B,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGE,QADH,CADD,EAKG,CAAET,QAAQ,CAACa,KAAT,CAAgBL,OAAhB,IAA4B,CAA5B,IAAiCE,gBAAnC,KACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACGV,QAAQ,CAACa,KAAT,CAAgBL,OAAhB,IAA4B,CAA5B,IACDR,QAAQ,CAACc,GAAT,CAAcN,OAAd,EAAuB,CAAEO,MAAF,EAAUC,CAAV,KACtB;AACC,IAAA,GAAG,EAAGA,CADP;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,MAJH,CADD,CAFF,EAUGL,gBAAgB,IACjB,cAAC,YAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,IAAI,EAAGL,cAFR;AAGC,IAAA,KAAK,EAAGD,EAAE,CAAE,cAAF,CAHX;AAIC,IAAA,YAAY,EAAG;AACda,MAAAA,QAAQ,EAAE,aADI;AAEdV,MAAAA,SAAS,EACR;AAHa,KAJhB;AASC,IAAA,OAAO;AATR,KAWG,MACD,cAAC,SAAD,QACGG,gBAAgB,CAACI,GAAjB,CACD,CAAEI,IAAF,EAAQC,GAAR,KACC,cAAC,QAAD;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;;;AACA,eAAef,OAAf","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":["classnames","Children","DropdownMenu","MenuGroup","MenuItem","__","moreHorizontal","Warning","className","actions","children","secondaryActions","display","all","count","map","action","i","position","item","pos","onClick","title"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,QAAlC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,kBAA/B;;AAEA,SAASC,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,EAAGb,UAAU,CAAEQ,SAAF,EAAa,sBAAb;AAA3B,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGE,QADH,CADD,EAKG,CAAET,QAAQ,CAACa,KAAT,CAAgBL,OAAhB,IAA4B,CAA5B,IAAiCE,gBAAnC,KACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACGV,QAAQ,CAACa,KAAT,CAAgBL,OAAhB,IAA4B,CAA5B,IACDR,QAAQ,CAACc,GAAT,CAAcN,OAAd,EAAuB,CAAEO,MAAF,EAAUC,CAAV,KACtB;AACC,IAAA,GAAG,EAAGA,CADP;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,MAJH,CADD,CAFF,EAUGL,gBAAgB,IACjB,cAAC,YAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,IAAI,EAAGL,cAFR;AAGC,IAAA,KAAK,EAAGD,EAAE,CAAE,cAAF,CAHX;AAIC,IAAA,YAAY,EAAG;AACda,MAAAA,QAAQ,EAAE,aADI;AAEdV,MAAAA,SAAS,EACR;AAHa,KAJhB;AASC,IAAA,OAAO;AATR,KAWG,MACD,cAAC,SAAD,QACGG,gBAAgB,CAACI,GAAjB,CACD,CAAEI,IAAF,EAAQC,GAAR,KACC,cAAC,QAAD;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;;;AACA,eAAef,OAAf","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"]}
@@ -18,16 +18,15 @@ import { normalizeIconObject } from '@wordpress/blocks';
18
18
 
19
19
  import styles from './style.scss';
20
20
 
21
- function Warning(_ref) {
22
- let {
23
- title,
24
- message,
25
- icon,
26
- iconClass,
27
- preferredColorScheme,
28
- getStylesFromColorScheme,
29
- ...viewProps
30
- } = _ref;
21
+ function Warning({
22
+ title,
23
+ message,
24
+ icon,
25
+ iconClass,
26
+ preferredColorScheme,
27
+ getStylesFromColorScheme,
28
+ ...viewProps
29
+ }) {
31
30
  icon = icon && normalizeIconObject(icon);
32
31
  const internalIconClass = 'warning-icon' + '-' + preferredColorScheme;
33
32
  const titleStyle = getStylesFromColorScheme(styles.title, styles.titleDark);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.native.js"],"names":["View","Text","Icon","withPreferredColorScheme","normalizeIconObject","styles","Warning","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","viewProps","internalIconClass","titleStyle","titleDark","messageStyle","messageDark","container","containerDark","src"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AACA,SAASC,mBAAT,QAAoC,mBAApC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;;AAEA,SAASC,OAAT,OAQI;AAAA,MARc;AACjBC,IAAAA,KADiB;AAEjBC,IAAAA,OAFiB;AAGjBC,IAAAA,IAHiB;AAIjBC,IAAAA,SAJiB;AAKjBC,IAAAA,oBALiB;AAMjBC,IAAAA,wBANiB;AAOjB,OAAGC;AAPc,GAQd;AACHJ,EAAAA,IAAI,GAAGA,IAAI,IAAIL,mBAAmB,CAAEK,IAAF,CAAlC;AACA,QAAMK,iBAAiB,GAAG,iBAAiB,GAAjB,GAAuBH,oBAAjD;AACA,QAAMI,UAAU,GAAGH,wBAAwB,CAC1CP,MAAM,CAACE,KADmC,EAE1CF,MAAM,CAACW,SAFmC,CAA3C;AAIA,QAAMC,YAAY,GAAGL,wBAAwB,CAC5CP,MAAM,CAACG,OADqC,EAE5CH,MAAM,CAACa,WAFqC,CAA7C;AAKA,SACC,cAAC,IAAD;AACC,IAAA,KAAK,EAAGN,wBAAwB,CAC/BP,MAAM,CAACc,SADwB,EAE/Bd,MAAM,CAACe,aAFwB;AADjC,KAKMP,SALN,GAOGJ,IAAI,IACL,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGJ,MAAM,CAACI;AAArB,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAGC,SAAS,IAAII,iBAD1B;AAEC,IAAA,IAAI,EAAGL,IAAI,IAAIA,IAAI,CAACY,GAAb,GAAmBZ,IAAI,CAACY,GAAxB,GAA8BZ;AAFtC,IADD,CARF,EAeGF,KAAK,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGQ;AAAd,KAA6BR,KAA7B,CAfZ,EAgBGC,OAAO,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGS;AAAd,KAA+BT,OAA/B,CAhBd,CADD;AAoBA;;AAED,eAAeL,wBAAwB,CAAEG,OAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { normalizeIconObject } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nfunction Warning( {\n\ttitle,\n\tmessage,\n\ticon,\n\ticonClass,\n\tpreferredColorScheme,\n\tgetStylesFromColorScheme,\n\t...viewProps\n} ) {\n\ticon = icon && normalizeIconObject( icon );\n\tconst internalIconClass = 'warning-icon' + '-' + preferredColorScheme;\n\tconst titleStyle = getStylesFromColorScheme(\n\t\tstyles.title,\n\t\tstyles.titleDark\n\t);\n\tconst messageStyle = getStylesFromColorScheme(\n\t\tstyles.message,\n\t\tstyles.messageDark\n\t);\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t\t{ ...viewProps }\n\t\t>\n\t\t\t{ icon && (\n\t\t\t\t<View style={ styles.icon }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={ iconClass || internalIconClass }\n\t\t\t\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ title && <Text style={ titleStyle }>{ title }</Text> }\n\t\t\t{ message && <Text style={ messageStyle }>{ message }</Text> }\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( Warning );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.native.js"],"names":["View","Text","Icon","withPreferredColorScheme","normalizeIconObject","styles","Warning","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","viewProps","internalIconClass","titleStyle","titleDark","messageStyle","messageDark","container","containerDark","src"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AAEA;AACA;AACA;;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,wBAAT,QAAyC,oBAAzC;AACA,SAASC,mBAAT,QAAoC,mBAApC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;;AAEA,SAASC,OAAT,CAAkB;AACjBC,EAAAA,KADiB;AAEjBC,EAAAA,OAFiB;AAGjBC,EAAAA,IAHiB;AAIjBC,EAAAA,SAJiB;AAKjBC,EAAAA,oBALiB;AAMjBC,EAAAA,wBANiB;AAOjB,KAAGC;AAPc,CAAlB,EAQI;AACHJ,EAAAA,IAAI,GAAGA,IAAI,IAAIL,mBAAmB,CAAEK,IAAF,CAAlC;AACA,QAAMK,iBAAiB,GAAG,iBAAiB,GAAjB,GAAuBH,oBAAjD;AACA,QAAMI,UAAU,GAAGH,wBAAwB,CAC1CP,MAAM,CAACE,KADmC,EAE1CF,MAAM,CAACW,SAFmC,CAA3C;AAIA,QAAMC,YAAY,GAAGL,wBAAwB,CAC5CP,MAAM,CAACG,OADqC,EAE5CH,MAAM,CAACa,WAFqC,CAA7C;AAKA,SACC,cAAC,IAAD;AACC,IAAA,KAAK,EAAGN,wBAAwB,CAC/BP,MAAM,CAACc,SADwB,EAE/Bd,MAAM,CAACe,aAFwB;AADjC,KAKMP,SALN,GAOGJ,IAAI,IACL,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGJ,MAAM,CAACI;AAArB,KACC,cAAC,IAAD;AACC,IAAA,SAAS,EAAGC,SAAS,IAAII,iBAD1B;AAEC,IAAA,IAAI,EAAGL,IAAI,IAAIA,IAAI,CAACY,GAAb,GAAmBZ,IAAI,CAACY,GAAxB,GAA8BZ;AAFtC,IADD,CARF,EAeGF,KAAK,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGQ;AAAd,KAA6BR,KAA7B,CAfZ,EAgBGC,OAAO,IAAI,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGS;AAAd,KAA+BT,OAA/B,CAhBd,CADD;AAoBA;;AAED,eAAeL,wBAAwB,CAAEG,OAAF,CAAvC","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { normalizeIconObject } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nfunction Warning( {\n\ttitle,\n\tmessage,\n\ticon,\n\ticonClass,\n\tpreferredColorScheme,\n\tgetStylesFromColorScheme,\n\t...viewProps\n} ) {\n\ticon = icon && normalizeIconObject( icon );\n\tconst internalIconClass = 'warning-icon' + '-' + preferredColorScheme;\n\tconst titleStyle = getStylesFromColorScheme(\n\t\tstyles.title,\n\t\tstyles.titleDark\n\t);\n\tconst messageStyle = getStylesFromColorScheme(\n\t\tstyles.message,\n\t\tstyles.messageDark\n\t);\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.container,\n\t\t\t\tstyles.containerDark\n\t\t\t) }\n\t\t\t{ ...viewProps }\n\t\t>\n\t\t\t{ icon && (\n\t\t\t\t<View style={ styles.icon }>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName={ iconClass || internalIconClass }\n\t\t\t\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t\t{ title && <Text style={ titleStyle }>{ title }</Text> }\n\t\t\t{ message && <Text style={ messageStyle }>{ message }</Text> }\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( Warning );\n"]}
@@ -46,11 +46,10 @@ export function useWritingFlow() {
46
46
  }, [hasMultiSelection])]), after];
47
47
  }
48
48
 
49
- function WritingFlow(_ref, forwardedRef) {
50
- let {
51
- children,
52
- ...props
53
- } = _ref;
49
+ function WritingFlow({
50
+ children,
51
+ ...props
52
+ }, forwardedRef) {
54
53
  const [before, ref, after] = useWritingFlow();
55
54
  return createElement(Fragment, null, before, createElement("div", _extends({}, props, {
56
55
  ref: useMergeRefs([ref, forwardedRef]),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/index.js"],"names":["classNames","useSelect","__","useMergeRefs","useRefEffect","forwardRef","useMultiSelection","useTabNav","useArrowNav","useSelectAll","useDragSelection","useSelectionObserver","useClickSelection","useInput","store","blockEditorStore","useWritingFlow","before","ref","after","hasMultiSelection","select","node","tabIndex","contentEditable","classList","add","setAttribute","remove","removeAttribute","WritingFlow","forwardedRef","children","props","className"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,EAAuBC,YAAvB,QAA2C,oBAA3C;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,OAAO,SAASC,cAAT,GAA0B;AAChC,QAAM,CAAEC,MAAF,EAAUC,GAAV,EAAeC,KAAf,IAAyBZ,SAAS,EAAxC;AACA,QAAMa,iBAAiB,GAAGnB,SAAS,CAChCoB,MAAF,IAAcA,MAAM,CAAEN,gBAAF,CAAN,CAA2BK,iBAA3B,EADoB,EAElC,EAFkC,CAAnC;AAKA,SAAO,CACNH,MADM,EAENd,YAAY,CAAE,CACbe,GADa,EAEbL,QAAQ,EAFK,EAGbH,gBAAgB,EAHH,EAIbC,oBAAoB,EAJP,EAKbC,iBAAiB,EALJ,EAMbN,iBAAiB,EANJ,EAObG,YAAY,EAPC,EAQbD,WAAW,EARE,EASbJ,YAAY,CACTkB,IAAF,IAAY;AACXA,IAAAA,IAAI,CAACC,QAAL,GAAgB,CAAhB;AACAD,IAAAA,IAAI,CAACE,eAAL,GAAuBJ,iBAAvB;;AAEA,QAAK,CAAEA,iBAAP,EAA2B;AAC1B;AACA;;AAEDE,IAAAA,IAAI,CAACG,SAAL,CAAeC,GAAf,CAAoB,qBAApB;AACAJ,IAAAA,IAAI,CAACK,YAAL,CACC,YADD,EAECzB,EAAE,CAAE,0BAAF,CAFH;AAKA,WAAO,MAAM;AACZoB,MAAAA,IAAI,CAACG,SAAL,CAAeG,MAAf,CAAuB,qBAAvB;AACAN,MAAAA,IAAI,CAACO,eAAL,CAAsB,YAAtB;AACA,KAHD;AAIA,GAnBU,EAoBX,CAAET,iBAAF,CApBW,CATC,CAAF,CAFN,EAkCND,KAlCM,CAAP;AAoCA;;AAED,SAASW,WAAT,OAA8CC,YAA9C,EAA6D;AAAA,MAAvC;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAAuC;AAC5D,QAAM,CAAEhB,MAAF,EAAUC,GAAV,EAAeC,KAAf,IAAyBH,cAAc,EAA7C;AACA,SACC,8BACGC,MADH,EAEC,kCACMgB,KADN;AAEC,IAAA,GAAG,EAAG9B,YAAY,CAAE,CAAEe,GAAF,EAAOa,YAAP,CAAF,CAFnB;AAGC,IAAA,SAAS,EAAG/B,UAAU,CACrBiC,KAAK,CAACC,SADe,EAErB,2BAFqB;AAHvB,MAQGF,QARH,CAFD,EAYGb,KAZH,CADD;AAgBA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,eAAed,UAAU,CAAEyB,WAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMultiSelection from './use-multi-selection';\nimport useTabNav from './use-tab-nav';\nimport useArrowNav from './use-arrow-nav';\nimport useSelectAll from './use-select-all';\nimport useDragSelection from './use-drag-selection';\nimport useSelectionObserver from './use-selection-observer';\nimport useClickSelection from './use-click-selection';\nimport useInput from './use-input';\nimport { store as blockEditorStore } from '../../store';\n\nexport function useWritingFlow() {\n\tconst [ before, ref, after ] = useTabNav();\n\tconst hasMultiSelection = useSelect(\n\t\t( select ) => select( blockEditorStore ).hasMultiSelection(),\n\t\t[]\n\t);\n\n\treturn [\n\t\tbefore,\n\t\tuseMergeRefs( [\n\t\t\tref,\n\t\t\tuseInput(),\n\t\t\tuseDragSelection(),\n\t\t\tuseSelectionObserver(),\n\t\t\tuseClickSelection(),\n\t\t\tuseMultiSelection(),\n\t\t\tuseSelectAll(),\n\t\t\tuseArrowNav(),\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tnode.tabIndex = 0;\n\t\t\t\t\tnode.contentEditable = hasMultiSelection;\n\n\t\t\t\t\tif ( ! hasMultiSelection ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.classList.add( 'has-multi-selection' );\n\t\t\t\t\tnode.setAttribute(\n\t\t\t\t\t\t'aria-label',\n\t\t\t\t\t\t__( 'Multiple selected blocks' )\n\t\t\t\t\t);\n\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tnode.classList.remove( 'has-multi-selection' );\n\t\t\t\t\t\tnode.removeAttribute( 'aria-label' );\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ hasMultiSelection ]\n\t\t\t),\n\t\t] ),\n\t\tafter,\n\t];\n}\n\nfunction WritingFlow( { children, ...props }, forwardedRef ) {\n\tconst [ before, ref, after ] = useWritingFlow();\n\treturn (\n\t\t<>\n\t\t\t{ before }\n\t\t\t<div\n\t\t\t\t{ ...props }\n\t\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\t\tclassName={ classNames(\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'block-editor-writing-flow'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t\t{ after }\n\t\t</>\n\t);\n}\n\n/**\n * Handles selection and navigation across blocks. This component should be\n * wrapped around BlockList.\n *\n * @param {Object} props Component properties.\n * @param {WPElement} props.children Children to be rendered.\n */\nexport default forwardRef( WritingFlow );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/index.js"],"names":["classNames","useSelect","__","useMergeRefs","useRefEffect","forwardRef","useMultiSelection","useTabNav","useArrowNav","useSelectAll","useDragSelection","useSelectionObserver","useClickSelection","useInput","store","blockEditorStore","useWritingFlow","before","ref","after","hasMultiSelection","select","node","tabIndex","contentEditable","classList","add","setAttribute","remove","removeAttribute","WritingFlow","children","props","forwardedRef","className"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,EAAuBC,YAAvB,QAA2C,oBAA3C;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA,OAAO,SAASC,cAAT,GAA0B;AAChC,QAAM,CAAEC,MAAF,EAAUC,GAAV,EAAeC,KAAf,IAAyBZ,SAAS,EAAxC;AACA,QAAMa,iBAAiB,GAAGnB,SAAS,CAChCoB,MA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;AACA;AACA;AACA;AACA;;;AACA,eAAed,UAAU,CAAEyB,WAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMultiSelection from './use-multi-selection';\nimport useTabNav from './use-tab-nav';\nimport useArrowNav from './use-arrow-nav';\nimport useSelectAll from './use-select-all';\nimport useDragSelection from './use-drag-selection';\nimport useSelectionObserver from './use-selection-observer';\nimport useClickSelection from './use-click-selection';\nimport useInput from './use-input';\nimport { store as blockEditorStore } from '../../store';\n\nexport function useWritingFlow() {\n\tconst [ before, ref, after ] = useTabNav();\n\tconst hasMultiSelection = useSelect(\n\t\t( select ) => select( blockEditorStore ).hasMultiSelection(),\n\t\t[]\n\t);\n\n\treturn [\n\t\tbefore,\n\t\tuseMergeRefs( [\n\t\t\tref,\n\t\t\tuseInput(),\n\t\t\tuseDragSelection(),\n\t\t\tuseSelectionObserver(),\n\t\t\tuseClickSelection(),\n\t\t\tuseMultiSelection(),\n\t\t\tuseSelectAll(),\n\t\t\tuseArrowNav(),\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tnode.tabIndex = 0;\n\t\t\t\t\tnode.contentEditable = hasMultiSelection;\n\n\t\t\t\t\tif ( ! hasMultiSelection ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.classList.add( 'has-multi-selection' );\n\t\t\t\t\tnode.setAttribute(\n\t\t\t\t\t\t'aria-label',\n\t\t\t\t\t\t__( 'Multiple selected blocks' )\n\t\t\t\t\t);\n\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tnode.classList.remove( 'has-multi-selection' );\n\t\t\t\t\t\tnode.removeAttribute( 'aria-label' );\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ hasMultiSelection ]\n\t\t\t),\n\t\t] ),\n\t\tafter,\n\t];\n}\n\nfunction WritingFlow( { children, ...props }, forwardedRef ) {\n\tconst [ before, ref, after ] = useWritingFlow();\n\treturn (\n\t\t<>\n\t\t\t{ before }\n\t\t\t<div\n\t\t\t\t{ ...props }\n\t\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\t\tclassName={ classNames(\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'block-editor-writing-flow'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t\t{ after }\n\t\t</>\n\t);\n}\n\n/**\n * Handles selection and navigation across blocks. This component should be\n * wrapped around BlockList.\n *\n * @param {Object} props Component properties.\n * @param {WPElement} props.children Children to be rendered.\n */\nexport default forwardRef( WritingFlow );\n"]}
@@ -23,19 +23,25 @@ import { store as blockEditorStore } from '../../store';
23
23
  */
24
24
 
25
25
  export function isNavigationCandidate(element, keyCode, hasModifier) {
26
- const isVertical = keyCode === UP || keyCode === DOWN; // Currently, all elements support unmodified vertical navigation.
26
+ const isVertical = keyCode === UP || keyCode === DOWN;
27
+ const {
28
+ tagName
29
+ } = element;
30
+ const elementType = element.getAttribute('type'); // Native inputs should not navigate vertically, unless they are simple types that don't need up/down arrow keys.
27
31
 
28
32
  if (isVertical && !hasModifier) {
33
+ if (tagName === 'INPUT') {
34
+ const verticalInputTypes = ['date', 'datetime-local', 'month', 'number', 'range', 'time', 'week'];
35
+ return !verticalInputTypes.includes(elementType);
36
+ }
37
+
29
38
  return true;
30
- }
39
+ } // Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.
31
40
 
32
- const {
33
- tagName
34
- } = element; // Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.
35
41
 
36
42
  if (tagName === 'INPUT') {
37
- const simpleInputTypes = ['button', 'checkbox', 'color', 'file', 'image', 'radio', 'reset', 'submit'];
38
- return simpleInputTypes.includes(element.getAttribute('type'));
43
+ const simpleInputTypes = ['button', 'checkbox', 'number', 'color', 'file', 'image', 'radio', 'reset', 'submit'];
44
+ return simpleInputTypes.includes(elementType);
39
45
  } // Native textareas should not navigate horizontally.
40
46
 
41
47
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/use-arrow-nav.js"],"names":["computeCaretRect","focus","isHorizontalEdge","isVerticalEdge","placeCaretAtHorizontalEdge","placeCaretAtVerticalEdge","isRTL","UP","DOWN","LEFT","RIGHT","useDispatch","useSelect","useRefEffect","getBlockClientId","isInSameBlock","store","blockEditorStore","isNavigationCandidate","element","keyCode","hasModifier","isVertical","tagName","simpleInputTypes","includes","getAttribute","getClosestTabbable","target","isReverse","containerElement","onlyVertical","focusableNodes","focusable","find","reverse","slice","indexOf","targetRect","getBoundingClientRect","isTabCandidate","node","children","length","firstElementChild","tabbable","isTabbableIndex","isContentEditable","contentEditable","nodeRect","left","right","useArrowNav","getMultiSelectedBlocksStartClientId","getMultiSelectedBlocksEndClientId","getSettings","hasMultiSelection","__unstableIsFullySelected","selectBlock","verticalRect","onMouseDown","isClosestTabbableABlock","closestTabbable","onKeyDown","event","defaultPrevented","shiftKey","ctrlKey","altKey","metaKey","isUp","isDown","isLeft","isRight","isHorizontal","isNav","isNavEdge","ownerDocument","defaultView","preventDefault","isReverseDir","keepCaretInsideBlock","undefined","getSelection","isCollapsed","addEventListener","removeEventListener"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,gBADD,EAECC,KAFD,EAGCC,gBAHD,EAICC,cAJD,EAKCC,0BALD,EAMCC,wBAND,EAOCC,KAPD,QAQO,gBARP;AASA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,QAAsC,qBAAtC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,YAAT,QAA6B,oBAA7B;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,EAA2BC,aA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oBANI,EAOL;AACD,cAAMnB,eAAe,GAAGnC,kBAAkB,CACzCC,MADyC,EAEzCC,SAFyC,EAGzCY,IAHyC,EAIzC,IAJyC,CAA1C;;AAOA,YAAKqB,eAAL,EAAuB;AACtBzD,UAAAA,wBAAwB,CACvByD,eADuB,EAEvB;AACA;AACAM,UAAAA,MAAM,GAAG,CAAEvC,SAAL,GAAiBA,SAJA,EAKvBuC,MAAM,GAAGc,SAAH,GAAevB,YALE,CAAxB;AAOAK,UAAAA,KAAK,CAACe,cAAN;AACA;AACD,OAzBM,MAyBA,IACNL,YAAY,IACZI,WAAW,CAACK,YAAZ,GAA2BC,WAD3B,IAEAlF,gBAAgB,CAAE0B,MAAF,EAAUoD,YAAV,CAFhB,IAGA,CAAEC,oBAJI,EAKL;AACD,cAAMnB,eAAe,GAAGnC,kBAAkB,CACzCC,MADyC,EAEzCoD,YAFyC,EAGzCvC,IAHyC,CAA1C;AAKArC,QAAAA,0BAA0B,CAAE0D,eAAF,EAAmBjC,SAAnB,CAA1B;AACAmC,QAAAA,KAAK,CAACe,cAAN;AACA;AACD;;AAEDtC,IAAAA,IAAI,CAAC4C,gBAAL,CAAuB,WAAvB,EAAoCzB,WAApC;AACAnB,IAAAA,IAAI,CAAC4C,gBAAL,CAAuB,SAAvB,EAAkCtB,SAAlC;AACA,WAAO,MAAM;AACZtB,MAAAA,IAAI,CAAC6C,mBAAL,CAA0B,WAA1B,EAAuC1B,WAAvC;AACAnB,MAAAA,IAAI,CAAC6C,mBAAL,CAA0B,SAA1B,EAAqCvB,SAArC;AACA,KAHD;AAIA,GArJkB,EAqJhB,EArJgB,CAAnB;AAsJA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcomputeCaretRect,\n\tfocus,\n\tisHorizontalEdge,\n\tisVerticalEdge,\n\tplaceCaretAtHorizontalEdge,\n\tplaceCaretAtVerticalEdge,\n\tisRTL,\n} from '@wordpress/dom';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { getBlockClientId, isInSameBlock } from '../../utils/dom';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Returns true if the element should consider edge navigation upon a keyboard\n * event of the given directional key code, or false otherwise.\n *\n * @param {Element} element HTML element to test.\n * @param {number} keyCode KeyboardEvent keyCode to test.\n * @param {boolean} hasModifier Whether a modifier is pressed.\n *\n * @return {boolean} Whether element should consider edge navigation.\n */\nexport function isNavigationCandidate( element, keyCode, hasModifier ) {\n\tconst isVertical = keyCode === UP || keyCode === DOWN;\n\n\t// Currently, all elements support unmodified vertical navigation.\n\tif ( isVertical && ! hasModifier ) {\n\t\treturn true;\n\t}\n\n\tconst { tagName } = element;\n\n\t// Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.\n\tif ( tagName === 'INPUT' ) {\n\t\tconst simpleInputTypes = [\n\t\t\t'button',\n\t\t\t'checkbox',\n\t\t\t'color',\n\t\t\t'file',\n\t\t\t'image',\n\t\t\t'radio',\n\t\t\t'reset',\n\t\t\t'submit',\n\t\t];\n\t\treturn simpleInputTypes.includes( element.getAttribute( 'type' ) );\n\t}\n\n\t// Native textareas should not navigate horizontally.\n\treturn tagName !== 'TEXTAREA';\n}\n\n/**\n * Returns the optimal tab target from the given focused element in the desired\n * direction. A preference is made toward text fields, falling back to the block\n * focus stop if no other candidates exist for the block.\n *\n * @param {Element} target Currently focused text field.\n * @param {boolean} isReverse True if considering as the first field.\n * @param {Element} containerElement Element containing all blocks.\n * @param {boolean} onlyVertical Whether to only consider tabbable elements\n * that are visually above or under the\n * target.\n *\n * @return {?Element} Optimal tab target, if one exists.\n */\nexport function getClosestTabbable(\n\ttarget,\n\tisReverse,\n\tcontainerElement,\n\tonlyVertical\n) {\n\t// Since the current focus target is not guaranteed to be a text field, find\n\t// all focusables. Tabbability is considered later.\n\tlet focusableNodes = focus.focusable.find( containerElement );\n\n\tif ( isReverse ) {\n\t\tfocusableNodes.reverse();\n\t}\n\n\t// Consider as candidates those focusables after the current target. It's\n\t// assumed this can only be reached if the target is focusable (on its\n\t// keydown event), so no need to verify it exists in the set.\n\tfocusableNodes = focusableNodes.slice(\n\t\tfocusableNodes.indexOf( target ) + 1\n\t);\n\n\tlet targetRect;\n\n\tif ( onlyVertical ) {\n\t\ttargetRect = target.getBoundingClientRect();\n\t}\n\n\tfunction isTabCandidate( node ) {\n\t\t// Skip if there's only one child that is content editable (and thus a\n\t\t// better candidate).\n\t\tif (\n\t\t\tnode.children.length === 1 &&\n\t\t\tisInSameBlock( node, node.firstElementChild ) &&\n\t\t\tnode.firstElementChild.getAttribute( 'contenteditable' ) === 'true'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Not a candidate if the node is not tabbable.\n\t\tif ( ! focus.tabbable.isTabbableIndex( node ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Skip focusable elements such as links within content editable nodes.\n\t\tif ( node.isContentEditable && node.contentEditable !== 'true' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( onlyVertical ) {\n\t\t\tconst nodeRect = node.getBoundingClientRect();\n\n\t\t\tif (\n\t\t\t\tnodeRect.left >= targetRect.right ||\n\t\t\t\tnodeRect.right <= targetRect.left\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn focusableNodes.find( isTabCandidate );\n}\n\nexport default function useArrowNav() {\n\tconst {\n\t\tgetMultiSelectedBlocksStartClientId,\n\t\tgetMultiSelectedBlocksEndClientId,\n\t\tgetSettings,\n\t\thasMultiSelection,\n\t\t__unstableIsFullySelected,\n\t} = useSelect( blockEditorStore );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\treturn useRefEffect( ( node ) => {\n\t\t// Here a DOMRect is stored while moving the caret vertically so\n\t\t// vertical position of the start position can be restored. This is to\n\t\t// recreate browser behaviour across blocks.\n\t\tlet verticalRect;\n\n\t\tfunction onMouseDown() {\n\t\t\tverticalRect = null;\n\t\t}\n\n\t\tfunction isClosestTabbableABlock( target, isReverse ) {\n\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\ttarget,\n\t\t\t\tisReverse,\n\t\t\t\tnode\n\t\t\t);\n\t\t\treturn closestTabbable && getBlockClientId( closestTabbable );\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\t// Abort if navigation has already been handled (e.g. RichText\n\t\t\t// inline boundaries).\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { keyCode, target, shiftKey, ctrlKey, altKey, metaKey } =\n\t\t\t\tevent;\n\t\t\tconst isUp = keyCode === UP;\n\t\t\tconst isDown = keyCode === DOWN;\n\t\t\tconst isLeft = keyCode === LEFT;\n\t\t\tconst isRight = keyCode === RIGHT;\n\t\t\tconst isReverse = isUp || isLeft;\n\t\t\tconst isHorizontal = isLeft || isRight;\n\t\t\tconst isVertical = isUp || isDown;\n\t\t\tconst isNav = isHorizontal || isVertical;\n\t\t\tconst hasModifier = shiftKey || ctrlKey || altKey || metaKey;\n\t\t\tconst isNavEdge = isVertical ? isVerticalEdge : isHorizontalEdge;\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tif ( ! isNav ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If there is a multi-selection, the arrow keys should collapse the\n\t\t\t// selection to the start or end of the selection.\n\t\t\tif ( hasMultiSelection() ) {\n\t\t\t\tif ( shiftKey ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle if we have a full selection (not a native partial\n\t\t\t\t// selection).\n\t\t\t\tif ( ! __unstableIsFullySelected() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif ( isReverse ) {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksStartClientId() );\n\t\t\t\t} else {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksEndClientId(), -1 );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if our current target is not a candidate for navigation\n\t\t\t// (e.g. preserve native input behaviors).\n\t\t\tif ( ! isNavigationCandidate( target, keyCode, hasModifier ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// When presing any key other than up or down, the initial vertical\n\t\t\t// position must ALWAYS be reset. The vertical position is saved so\n\t\t\t// it can be restored as well as possible on sebsequent vertical\n\t\t\t// arrow key presses. It may not always be possible to restore the\n\t\t\t// exact same position (such as at an empty line), so it wouldn't be\n\t\t\t// good to compute the position right before any vertical arrow key\n\t\t\t// press.\n\t\t\tif ( ! isVertical ) {\n\t\t\t\tverticalRect = null;\n\t\t\t} else if ( ! verticalRect ) {\n\t\t\t\tverticalRect = computeCaretRect( defaultView );\n\t\t\t}\n\n\t\t\t// In the case of RTL scripts, right means previous and left means\n\t\t\t// next, which is the exact reverse of LTR.\n\t\t\tconst isReverseDir = isRTL( target ) ? ! isReverse : isReverse;\n\t\t\tconst { keepCaretInsideBlock } = getSettings();\n\n\t\t\tif ( shiftKey ) {\n\t\t\t\tif (\n\t\t\t\t\tisClosestTabbableABlock( target, isReverse ) &&\n\t\t\t\t\tisNavEdge( target, isReverse )\n\t\t\t\t) {\n\t\t\t\t\tnode.contentEditable = true;\n\t\t\t\t\t// Firefox doesn't automatically move focus.\n\t\t\t\t\tnode.focus();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisVertical &&\n\t\t\t\tisVerticalEdge( target, isReverse ) &&\n\t\t\t\t// When Alt is pressed, only intercept if the caret is also at\n\t\t\t\t// the horizontal edge.\n\t\t\t\t( altKey ? isHorizontalEdge( target, isReverseDir ) : true ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverse,\n\t\t\t\t\tnode,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tif ( closestTabbable ) {\n\t\t\t\t\tplaceCaretAtVerticalEdge(\n\t\t\t\t\t\tclosestTabbable,\n\t\t\t\t\t\t// When Alt is pressed, place the caret at the furthest\n\t\t\t\t\t\t// horizontal edge and the furthest vertical edge.\n\t\t\t\t\t\taltKey ? ! isReverse : isReverse,\n\t\t\t\t\t\taltKey ? undefined : verticalRect\n\t\t\t\t\t);\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisHorizontal &&\n\t\t\t\tdefaultView.getSelection().isCollapsed &&\n\t\t\t\tisHorizontalEdge( target, isReverseDir ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverseDir,\n\t\t\t\t\tnode\n\t\t\t\t);\n\t\t\t\tplaceCaretAtHorizontalEdge( closestTabbable, isReverse );\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/writing-flow/use-arrow-nav.js"],"names":["computeCaretRect","focus","isHorizontalEdge","isVerticalEdge","placeCaretAtHorizontalEdge","placeCaretAtVerticalEdge","isRTL","UP","DOWN","LEFT","RIGHT","useDispatch","useSelect","useRefEffect","getBlockClientId","isInSameBlock","store","blockEditorStore","isNavigationCandidate","element","keyCode","hasModifier","isVertical","tagName","elementType","getAttribute","verticalInputTypes","includes","simpleInputTypes","getClosestTabbable","target","isReverse","containerElement","onlyVertical","focusableNodes","focusable","find","reverse","slice","indexOf","targetRect","getBoundingClientRect","isTabCandidate","node","children","length","firstElementChild","tabbable","isTabbableIndex","isContentEditable","contentEditable","nodeRect","left","right","useArrowNav","getMultiSelectedBlocksStartClientId","getMultiSelectedBlocksEndClientId","getSettings","hasMultiSelection","__unstableIsFullySelected","selectBlock","verticalRect","onMouseDown","isClosestTabbableABlock","closestTabbable","onKeyDown","event","defaultPrevented","shiftKey","ctrlKey","altKey","metaKey","isUp","isDown","isLeft","isRight","isHorizontal","isNav","isNavEdge","ownerDocument","defaultView","preventDefault","isReverseDir","keepCaretInsideBlock","undefined","getSelection","isCollapsed","addEventListener","removeEventListener"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,gBADD,EAECC,KAFD,EAGCC,gBAHD,EAICC,cAJD,EAKCC,0BALD,EAMCC,wBAND,EAOCC,KAPD,QAQO,gBARP;AASA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,QAAsC,qBAAtC;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,YAAT,QAA6B,oBAA7B;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,EAA2BC,aAA3B,QAAgD,iBAAhD;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,qBAAT,CAAgCC,OAAhC,EAAyCC,OAAzC,EAAkDC,WAAlD,EAAgE;AACtE,QAAMC,UAAU,GAAGF,OAAO,KAAKb,EAAZ,IAAkBa,OAAO,KAAKZ,IAAjD;AACA,QAAM;AAAEe,IAAAA;AAAF,MAAcJ,OAApB;AACA,QAAMK,WAAW,GAAGL,OAAO,CAACM,YAAR,CAAsB,MAAtB,CAApB,CAHsE,CAKtE;;AACA,MAAKH,UAAU,IAAI,CAAED,WAArB,EAAmC;AAClC,QAAKE,OAAO,KAAK,OAAjB,EAA2B;AAC1B,YAAMG,kBAAkB,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AG,CAAEvC,SAAL,GAAiBA,SAJA,EAKvBuC,MAAM,GAAGc,SAAH,GAAevB,YALE,CAAxB;AAOAK,UAAAA,KAAK,CAACe,cAAN;AACA;AACD,OAzBM,MAyBA,IACNL,YAAY,IACZI,WAAW,CAACK,YAAZ,GAA2BC,WAD3B,IAEApF,gBAAgB,CAAE4B,MAAF,EAAUoD,YAAV,CAFhB,IAGA,CAAEC,oBAJI,EAKL;AACD,cAAMnB,eAAe,GAAGnC,kBAAkB,CACzCC,MADyC,EAEzCoD,YAFyC,EAGzCvC,IAHyC,CAA1C;AAKAvC,QAAAA,0BAA0B,CAAE4D,eAAF,EAAmBjC,SAAnB,CAA1B;AACAmC,QAAAA,KAAK,CAACe,cAAN;AACA;AACD;;AAEDtC,IAAAA,IAAI,CAAC4C,gBAAL,CAAuB,WAAvB,EAAoCzB,WAApC;AACAnB,IAAAA,IAAI,CAAC4C,gBAAL,CAAuB,SAAvB,EAAkCtB,SAAlC;AACA,WAAO,MAAM;AACZtB,MAAAA,IAAI,CAAC6C,mBAAL,CAA0B,WAA1B,EAAuC1B,WAAvC;AACAnB,MAAAA,IAAI,CAAC6C,mBAAL,CAA0B,SAA1B,EAAqCvB,SAArC;AACA,KAHD;AAIA,GArJkB,EAqJhB,EArJgB,CAAnB;AAsJA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcomputeCaretRect,\n\tfocus,\n\tisHorizontalEdge,\n\tisVerticalEdge,\n\tplaceCaretAtHorizontalEdge,\n\tplaceCaretAtVerticalEdge,\n\tisRTL,\n} from '@wordpress/dom';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { getBlockClientId, isInSameBlock } from '../../utils/dom';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Returns true if the element should consider edge navigation upon a keyboard\n * event of the given directional key code, or false otherwise.\n *\n * @param {Element} element HTML element to test.\n * @param {number} keyCode KeyboardEvent keyCode to test.\n * @param {boolean} hasModifier Whether a modifier is pressed.\n *\n * @return {boolean} Whether element should consider edge navigation.\n */\nexport function isNavigationCandidate( element, keyCode, hasModifier ) {\n\tconst isVertical = keyCode === UP || keyCode === DOWN;\n\tconst { tagName } = element;\n\tconst elementType = element.getAttribute( 'type' );\n\n\t// Native inputs should not navigate vertically, unless they are simple types that don't need up/down arrow keys.\n\tif ( isVertical && ! hasModifier ) {\n\t\tif ( tagName === 'INPUT' ) {\n\t\t\tconst verticalInputTypes = [\n\t\t\t\t'date',\n\t\t\t\t'datetime-local',\n\t\t\t\t'month',\n\t\t\t\t'number',\n\t\t\t\t'range',\n\t\t\t\t'time',\n\t\t\t\t'week',\n\t\t\t];\n\t\t\treturn ! verticalInputTypes.includes( elementType );\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.\n\tif ( tagName === 'INPUT' ) {\n\t\tconst simpleInputTypes = [\n\t\t\t'button',\n\t\t\t'checkbox',\n\t\t\t'number',\n\t\t\t'color',\n\t\t\t'file',\n\t\t\t'image',\n\t\t\t'radio',\n\t\t\t'reset',\n\t\t\t'submit',\n\t\t];\n\t\treturn simpleInputTypes.includes( elementType );\n\t}\n\n\t// Native textareas should not navigate horizontally.\n\treturn tagName !== 'TEXTAREA';\n}\n\n/**\n * Returns the optimal tab target from the given focused element in the desired\n * direction. A preference is made toward text fields, falling back to the block\n * focus stop if no other candidates exist for the block.\n *\n * @param {Element} target Currently focused text field.\n * @param {boolean} isReverse True if considering as the first field.\n * @param {Element} containerElement Element containing all blocks.\n * @param {boolean} onlyVertical Whether to only consider tabbable elements\n * that are visually above or under the\n * target.\n *\n * @return {?Element} Optimal tab target, if one exists.\n */\nexport function getClosestTabbable(\n\ttarget,\n\tisReverse,\n\tcontainerElement,\n\tonlyVertical\n) {\n\t// Since the current focus target is not guaranteed to be a text field, find\n\t// all focusables. Tabbability is considered later.\n\tlet focusableNodes = focus.focusable.find( containerElement );\n\n\tif ( isReverse ) {\n\t\tfocusableNodes.reverse();\n\t}\n\n\t// Consider as candidates those focusables after the current target. It's\n\t// assumed this can only be reached if the target is focusable (on its\n\t// keydown event), so no need to verify it exists in the set.\n\tfocusableNodes = focusableNodes.slice(\n\t\tfocusableNodes.indexOf( target ) + 1\n\t);\n\n\tlet targetRect;\n\n\tif ( onlyVertical ) {\n\t\ttargetRect = target.getBoundingClientRect();\n\t}\n\n\tfunction isTabCandidate( node ) {\n\t\t// Skip if there's only one child that is content editable (and thus a\n\t\t// better candidate).\n\t\tif (\n\t\t\tnode.children.length === 1 &&\n\t\t\tisInSameBlock( node, node.firstElementChild ) &&\n\t\t\tnode.firstElementChild.getAttribute( 'contenteditable' ) === 'true'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Not a candidate if the node is not tabbable.\n\t\tif ( ! focus.tabbable.isTabbableIndex( node ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Skip focusable elements such as links within content editable nodes.\n\t\tif ( node.isContentEditable && node.contentEditable !== 'true' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( onlyVertical ) {\n\t\t\tconst nodeRect = node.getBoundingClientRect();\n\n\t\t\tif (\n\t\t\t\tnodeRect.left >= targetRect.right ||\n\t\t\t\tnodeRect.right <= targetRect.left\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\treturn focusableNodes.find( isTabCandidate );\n}\n\nexport default function useArrowNav() {\n\tconst {\n\t\tgetMultiSelectedBlocksStartClientId,\n\t\tgetMultiSelectedBlocksEndClientId,\n\t\tgetSettings,\n\t\thasMultiSelection,\n\t\t__unstableIsFullySelected,\n\t} = useSelect( blockEditorStore );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\treturn useRefEffect( ( node ) => {\n\t\t// Here a DOMRect is stored while moving the caret vertically so\n\t\t// vertical position of the start position can be restored. This is to\n\t\t// recreate browser behaviour across blocks.\n\t\tlet verticalRect;\n\n\t\tfunction onMouseDown() {\n\t\t\tverticalRect = null;\n\t\t}\n\n\t\tfunction isClosestTabbableABlock( target, isReverse ) {\n\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\ttarget,\n\t\t\t\tisReverse,\n\t\t\t\tnode\n\t\t\t);\n\t\t\treturn closestTabbable && getBlockClientId( closestTabbable );\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\t// Abort if navigation has already been handled (e.g. RichText\n\t\t\t// inline boundaries).\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { keyCode, target, shiftKey, ctrlKey, altKey, metaKey } =\n\t\t\t\tevent;\n\t\t\tconst isUp = keyCode === UP;\n\t\t\tconst isDown = keyCode === DOWN;\n\t\t\tconst isLeft = keyCode === LEFT;\n\t\t\tconst isRight = keyCode === RIGHT;\n\t\t\tconst isReverse = isUp || isLeft;\n\t\t\tconst isHorizontal = isLeft || isRight;\n\t\t\tconst isVertical = isUp || isDown;\n\t\t\tconst isNav = isHorizontal || isVertical;\n\t\t\tconst hasModifier = shiftKey || ctrlKey || altKey || metaKey;\n\t\t\tconst isNavEdge = isVertical ? isVerticalEdge : isHorizontalEdge;\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tif ( ! isNav ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If there is a multi-selection, the arrow keys should collapse the\n\t\t\t// selection to the start or end of the selection.\n\t\t\tif ( hasMultiSelection() ) {\n\t\t\t\tif ( shiftKey ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle if we have a full selection (not a native partial\n\t\t\t\t// selection).\n\t\t\t\tif ( ! __unstableIsFullySelected() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif ( isReverse ) {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksStartClientId() );\n\t\t\t\t} else {\n\t\t\t\t\tselectBlock( getMultiSelectedBlocksEndClientId(), -1 );\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if our current target is not a candidate for navigation\n\t\t\t// (e.g. preserve native input behaviors).\n\t\t\tif ( ! isNavigationCandidate( target, keyCode, hasModifier ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// When presing any key other than up or down, the initial vertical\n\t\t\t// position must ALWAYS be reset. The vertical position is saved so\n\t\t\t// it can be restored as well as possible on sebsequent vertical\n\t\t\t// arrow key presses. It may not always be possible to restore the\n\t\t\t// exact same position (such as at an empty line), so it wouldn't be\n\t\t\t// good to compute the position right before any vertical arrow key\n\t\t\t// press.\n\t\t\tif ( ! isVertical ) {\n\t\t\t\tverticalRect = null;\n\t\t\t} else if ( ! verticalRect ) {\n\t\t\t\tverticalRect = computeCaretRect( defaultView );\n\t\t\t}\n\n\t\t\t// In the case of RTL scripts, right means previous and left means\n\t\t\t// next, which is the exact reverse of LTR.\n\t\t\tconst isReverseDir = isRTL( target ) ? ! isReverse : isReverse;\n\t\t\tconst { keepCaretInsideBlock } = getSettings();\n\n\t\t\tif ( shiftKey ) {\n\t\t\t\tif (\n\t\t\t\t\tisClosestTabbableABlock( target, isReverse ) &&\n\t\t\t\t\tisNavEdge( target, isReverse )\n\t\t\t\t) {\n\t\t\t\t\tnode.contentEditable = true;\n\t\t\t\t\t// Firefox doesn't automatically move focus.\n\t\t\t\t\tnode.focus();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisVertical &&\n\t\t\t\tisVerticalEdge( target, isReverse ) &&\n\t\t\t\t// When Alt is pressed, only intercept if the caret is also at\n\t\t\t\t// the horizontal edge.\n\t\t\t\t( altKey ? isHorizontalEdge( target, isReverseDir ) : true ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverse,\n\t\t\t\t\tnode,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tif ( closestTabbable ) {\n\t\t\t\t\tplaceCaretAtVerticalEdge(\n\t\t\t\t\t\tclosestTabbable,\n\t\t\t\t\t\t// When Alt is pressed, place the caret at the furthest\n\t\t\t\t\t\t// horizontal edge and the furthest vertical edge.\n\t\t\t\t\t\taltKey ? ! isReverse : isReverse,\n\t\t\t\t\t\taltKey ? undefined : verticalRect\n\t\t\t\t\t);\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tisHorizontal &&\n\t\t\t\tdefaultView.getSelection().isCollapsed &&\n\t\t\t\tisHorizontalEdge( target, isReverseDir ) &&\n\t\t\t\t! keepCaretInsideBlock\n\t\t\t) {\n\t\t\t\tconst closestTabbable = getClosestTabbable(\n\t\t\t\t\ttarget,\n\t\t\t\t\tisReverseDir,\n\t\t\t\t\tnode\n\t\t\t\t);\n\t\t\t\tplaceCaretAtHorizontalEdge( closestTabbable, isReverse );\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n"]}
@@ -77,12 +77,10 @@ export default function useDragSelection() {
77
77
  });
78
78
  }
79
79
 
80
- function onMouseLeave(_ref) {
81
- let {
82
- buttons,
83
- target
84
- } = _ref;
85
-
80
+ function onMouseLeave({
81
+ buttons,
82
+ target
83
+ }) {
86
84
  // Avoid triggering a multi-selection if the user is already
87
85
  // dragging blocks.
88
86
  if (isDraggingBlocks()) {