@wordpress/block-editor 12.23.0 → 12.25.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 (1674) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +5 -1
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js.map +1 -1
  5. package/build/components/alignment-control/index.js.map +1 -1
  6. package/build/components/alignment-control/ui.js +3 -1
  7. package/build/components/alignment-control/ui.js.map +1 -1
  8. package/build/components/autocomplete/index.js.map +1 -1
  9. package/build/components/block-actions/index.js.map +1 -1
  10. package/build/components/block-alignment-control/constants.js.map +1 -1
  11. package/build/components/block-alignment-control/index.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.js.map +1 -1
  13. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  14. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  15. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  16. package/build/components/block-bindings-toolbar-indicator/index.js.map +1 -1
  17. package/build/components/block-breadcrumb/index.js.map +1 -1
  18. package/build/components/block-canvas/index.js.map +1 -1
  19. package/build/components/block-caption/index.native.js.map +1 -1
  20. package/build/components/block-card/index.js.map +1 -1
  21. package/build/components/block-compare/block-view.js.map +1 -1
  22. package/build/components/block-compare/index.js.map +1 -1
  23. package/build/components/block-content-overlay/index.js.map +1 -1
  24. package/build/components/block-context/index.js.map +1 -1
  25. package/build/components/block-controls/fill.js.map +1 -1
  26. package/build/components/block-controls/groups.js.map +1 -1
  27. package/build/components/block-controls/hook.js.map +1 -1
  28. package/build/components/block-controls/index.js.map +1 -1
  29. package/build/components/block-controls/slot.js.map +1 -1
  30. package/build/components/block-controls/slot.native.js.map +1 -1
  31. package/build/components/block-controls/use-has-block-controls.js.map +1 -1
  32. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  33. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  34. package/build/components/block-draggable/dropping-insertion-point.native.js +1 -1
  35. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  36. package/build/components/block-draggable/index.js.map +1 -1
  37. package/build/components/block-draggable/index.native.js +1 -1
  38. package/build/components/block-draggable/index.native.js.map +1 -1
  39. package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  40. package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  41. package/build/components/block-edit/context.js +2 -1
  42. package/build/components/block-edit/context.js.map +1 -1
  43. package/build/components/block-edit/edit.js.map +1 -1
  44. package/build/components/block-edit/edit.native.js.map +1 -1
  45. package/build/components/block-edit/index.js +4 -2
  46. package/build/components/block-edit/index.js.map +1 -1
  47. package/build/components/block-edit-visually-button/index.js.map +1 -1
  48. package/build/components/block-editing-mode/index.js.map +1 -1
  49. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  50. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  51. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  52. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  53. package/build/components/block-icon/index.js.map +1 -1
  54. package/build/components/block-icon/index.native.js.map +1 -1
  55. package/build/components/block-info-slot-fill/index.js.map +1 -1
  56. package/build/components/block-inspector/index.js +5 -4
  57. package/build/components/block-inspector/index.js.map +1 -1
  58. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  59. package/build/components/block-list/block-crash-boundary.js.map +1 -1
  60. package/build/components/block-list/block-crash-boundary.native.js.map +1 -1
  61. package/build/components/block-list/block-crash-warning.js.map +1 -1
  62. package/build/components/block-list/block-crash-warning.native.js.map +1 -1
  63. package/build/components/block-list/block-html.js.map +1 -1
  64. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  65. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  66. package/build/components/block-list/block-list-context.native.js.map +1 -1
  67. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  68. package/build/components/block-list/block-list-item.native.js.map +1 -1
  69. package/build/components/block-list/block-outline.native.js.map +1 -1
  70. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  71. package/build/components/block-list/block.js +44 -35
  72. package/build/components/block-list/block.js.map +1 -1
  73. package/build/components/block-list/block.native.js +2 -2
  74. package/build/components/block-list/block.native.js.map +1 -1
  75. package/build/components/block-list/grid-item.native.js.map +1 -1
  76. package/build/components/block-list/index.js +18 -6
  77. package/build/components/block-list/index.js.map +1 -1
  78. package/build/components/block-list/index.native.js +1 -9
  79. package/build/components/block-list/index.native.js.map +1 -1
  80. package/build/components/block-list/insertion-point.native.js.map +1 -1
  81. package/build/components/block-list/layout.js.map +1 -1
  82. package/build/components/block-list/private-block-context.js.map +1 -1
  83. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  84. package/build/components/block-list/use-block-props/index.js +8 -7
  85. package/build/components/block-list/use-block-props/index.js.map +1 -1
  86. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  87. package/build/components/block-list/use-block-props/use-block-refs.js +17 -46
  88. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  89. package/build/components/block-list/use-block-props/use-focus-first-element.js +3 -2
  90. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  91. package/build/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  92. package/build/components/block-list/use-block-props/use-intersection-observer.js.map +1 -1
  93. package/build/components/block-list/use-block-props/use-is-hovered.js +10 -14
  94. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  95. package/build/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
  96. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  97. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  98. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  99. package/build/components/block-list-appender/index.js.map +1 -1
  100. package/build/components/block-list-appender/index.native.js.map +1 -1
  101. package/build/components/block-lock/index.js.map +1 -1
  102. package/build/components/block-lock/menu-item.js.map +1 -1
  103. package/build/components/block-lock/modal.js.map +1 -1
  104. package/build/components/block-lock/toolbar.js.map +1 -1
  105. package/build/components/block-lock/use-block-lock.js.map +1 -1
  106. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  107. package/build/components/block-mover/button.js.map +1 -1
  108. package/build/components/block-mover/index.js.map +1 -1
  109. package/build/components/block-mover/index.native.js +3 -1
  110. package/build/components/block-mover/index.native.js.map +1 -1
  111. package/build/components/block-mover/mover-description.js.map +1 -1
  112. package/build/components/block-mover/mover-description.native.js.map +1 -1
  113. package/build/components/block-navigation/dropdown.js.map +1 -1
  114. package/build/components/block-parent-selector/index.js.map +1 -1
  115. package/build/components/block-pattern-setup/constants.js.map +1 -1
  116. package/build/components/block-pattern-setup/index.js.map +1 -1
  117. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  118. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  119. package/build/components/block-patterns-list/index.js.map +1 -1
  120. package/build/components/block-patterns-paging/index.js +8 -4
  121. package/build/components/block-patterns-paging/index.js.map +1 -1
  122. package/build/components/block-popover/cover.js.map +1 -1
  123. package/build/components/block-popover/drop-zone.js.map +1 -1
  124. package/build/components/block-popover/inbetween.js.map +1 -1
  125. package/build/components/block-popover/index.js.map +1 -1
  126. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  127. package/build/components/block-preview/auto.js.map +1 -1
  128. package/build/components/block-preview/index.js.map +1 -1
  129. package/build/components/block-quick-navigation/index.js.map +1 -1
  130. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  131. package/build/components/block-rename/index.js.map +1 -1
  132. package/build/components/block-rename/is-empty-string.js.map +1 -1
  133. package/build/components/block-rename/modal.js +13 -9
  134. package/build/components/block-rename/modal.js.map +1 -1
  135. package/build/components/block-rename/rename-control.js +3 -1
  136. package/build/components/block-rename/rename-control.js.map +1 -1
  137. package/build/components/block-rename/use-block-rename.js.map +1 -1
  138. package/build/components/block-selection-clearer/index.js.map +1 -1
  139. package/build/components/block-settings/button.native.js.map +1 -1
  140. package/build/components/block-settings/container.native.js.map +1 -1
  141. package/build/components/block-settings/index.native.js +1 -1
  142. package/build/components/block-settings/index.native.js.map +1 -1
  143. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  144. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  145. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  146. package/build/components/block-settings-menu/block-settings-dropdown.js +0 -25
  147. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  148. package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  149. package/build/components/block-settings-menu/index.js.map +1 -1
  150. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  151. package/build/components/block-styles/index.js.map +1 -1
  152. package/build/components/block-styles/index.native.js.map +1 -1
  153. package/build/components/block-styles/menu-items.js.map +1 -1
  154. package/build/components/block-styles/preview-panel.js.map +1 -1
  155. package/build/components/block-styles/preview.native.js.map +1 -1
  156. package/build/components/block-styles/use-styles-for-block.js.map +1 -1
  157. package/build/components/block-styles/utils.js.map +1 -1
  158. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  159. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  160. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  161. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  162. package/build/components/block-switcher/index.js.map +1 -1
  163. package/build/components/block-switcher/pattern-transformations-menu.js +3 -1
  164. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  165. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  166. package/build/components/block-switcher/use-transformed-patterns.js +6 -2
  167. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  168. package/build/components/block-switcher/utils.js +15 -5
  169. package/build/components/block-switcher/utils.js.map +1 -1
  170. package/build/components/block-title/index.js.map +1 -1
  171. package/build/components/block-title/use-block-display-title.js.map +1 -1
  172. package/build/components/block-toolbar/block-name-context.js.map +1 -1
  173. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  174. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  175. package/build/components/block-toolbar/index.js +1 -1
  176. package/build/components/block-toolbar/index.js.map +1 -1
  177. package/build/components/block-toolbar/index.native.js.map +1 -1
  178. package/build/components/block-toolbar/shuffle.js.map +1 -1
  179. package/build/components/block-toolbar/use-has-block-toolbar.js +20 -12
  180. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  181. package/build/components/block-toolbar/utils.js.map +1 -1
  182. package/build/components/block-tools/block-selection-button.js +16 -12
  183. package/build/components/block-tools/block-selection-button.js.map +1 -1
  184. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  185. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  186. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  187. package/build/components/block-tools/index.js +4 -2
  188. package/build/components/block-tools/index.js.map +1 -1
  189. package/build/components/block-tools/insertion-point.js.map +1 -1
  190. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  191. package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  192. package/build/components/block-tools/use-show-block-tools.js +9 -18
  193. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  194. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -1
  195. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  196. package/build/components/block-types-list/index.js.map +1 -1
  197. package/build/components/block-types-list/index.native.js.map +1 -1
  198. package/build/components/block-variation-picker/index.js +3 -2
  199. package/build/components/block-variation-picker/index.js.map +1 -1
  200. package/build/components/block-variation-picker/index.native.js.map +1 -1
  201. package/build/components/block-variation-transforms/index.js +7 -2
  202. package/build/components/block-variation-transforms/index.js.map +1 -1
  203. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  204. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  205. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  206. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  207. package/build/components/border-radius-control/index.js.map +1 -1
  208. package/build/components/border-radius-control/input-controls.js.map +1 -1
  209. package/build/components/border-radius-control/linked-button.js.map +1 -1
  210. package/build/components/border-radius-control/utils.js.map +1 -1
  211. package/build/components/button-block-appender/index.js.map +1 -1
  212. package/build/components/button-block-appender/index.native.js +11 -1
  213. package/build/components/button-block-appender/index.native.js.map +1 -1
  214. package/build/components/caption/index.native.js.map +1 -1
  215. package/build/components/child-layout-control/index.js.map +1 -1
  216. package/build/components/color-palette/control.js.map +1 -1
  217. package/build/components/color-palette/index.js.map +1 -1
  218. package/build/components/color-palette/with-color-context.js.map +1 -1
  219. package/build/components/color-style-selector/index.js.map +1 -1
  220. package/build/components/colors/index.js +1 -1
  221. package/build/components/colors/index.js.map +1 -1
  222. package/build/components/colors/utils.js.map +1 -1
  223. package/build/components/colors/with-colors.js.map +1 -1
  224. package/build/components/colors-gradients/control.js.map +1 -1
  225. package/build/components/colors-gradients/dropdown.js.map +1 -1
  226. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  227. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  228. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  229. package/build/components/contrast-checker/index.js.map +1 -1
  230. package/build/components/contrast-checker/index.native.js.map +1 -1
  231. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  232. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  233. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  234. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  235. package/build/components/copy-handler/index.js.map +1 -1
  236. package/build/components/date-format-picker/index.js.map +1 -1
  237. package/build/components/default-block-appender/index.js.map +1 -1
  238. package/build/components/default-block-appender/index.native.js.map +1 -1
  239. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  240. package/build/components/dimensions-tool/index.js.map +1 -1
  241. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  242. package/build/components/dimensions-tool/width-height-tool.js +6 -2
  243. package/build/components/dimensions-tool/width-height-tool.js.map +1 -1
  244. package/build/components/duotone/utils.js.map +1 -1
  245. package/build/components/duotone-control/index.js.map +1 -1
  246. package/build/components/editable-text/index.js.map +1 -1
  247. package/build/components/editor-styles/index.js +2 -1
  248. package/build/components/editor-styles/index.js.map +1 -1
  249. package/build/components/floating-toolbar/index.native.js +9 -5
  250. package/build/components/floating-toolbar/index.native.js.map +1 -1
  251. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  252. package/build/components/font-appearance-control/index.js.map +1 -1
  253. package/build/components/font-family/index.js.map +1 -1
  254. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  255. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  256. package/build/components/font-sizes/index.js.map +1 -1
  257. package/build/components/font-sizes/index.native.js.map +1 -1
  258. package/build/components/font-sizes/utils.js.map +1 -1
  259. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  260. package/build/components/global-styles/advanced-panel.js.map +1 -1
  261. package/build/components/global-styles/background-panel.js +20 -17
  262. package/build/components/global-styles/background-panel.js.map +1 -1
  263. package/build/components/global-styles/border-panel.js.map +1 -1
  264. package/build/components/global-styles/color-panel.js +3 -1
  265. package/build/components/global-styles/color-panel.js.map +1 -1
  266. package/build/components/global-styles/color-panel.native.js.map +1 -1
  267. package/build/components/global-styles/context.js.map +1 -1
  268. package/build/components/global-styles/dimensions-panel.js +16 -0
  269. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  270. package/build/components/global-styles/filters-panel.js.map +1 -1
  271. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  272. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  273. package/build/components/global-styles/hooks.js +3 -2
  274. package/build/components/global-styles/hooks.js.map +1 -1
  275. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  276. package/build/components/global-styles/index.js +1 -1
  277. package/build/components/global-styles/index.js.map +1 -1
  278. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  279. package/build/components/global-styles/typography-panel.js +23 -23
  280. package/build/components/global-styles/typography-panel.js.map +1 -1
  281. package/build/components/global-styles/typography-utils.js.map +1 -1
  282. package/build/components/global-styles/use-global-styles-output.js +153 -136
  283. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  284. package/build/components/global-styles/utils.js +45 -0
  285. package/build/components/global-styles/utils.js.map +1 -1
  286. package/build/components/gradients/index.js.map +1 -1
  287. package/build/components/gradients/index.native.js.map +1 -1
  288. package/build/components/gradients/use-gradient.js.map +1 -1
  289. package/build/components/gradients/with-gradient.js.map +1 -1
  290. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  291. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  292. package/build/components/grid-visualizer/index.js.map +1 -1
  293. package/build/components/grid-visualizer/utils.js.map +1 -1
  294. package/build/components/height-control/index.js.map +1 -1
  295. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  296. package/build/components/iframe/index.js +12 -13
  297. package/build/components/iframe/index.js.map +1 -1
  298. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  299. package/build/components/image-editor/constants.js.map +1 -1
  300. package/build/components/image-editor/context.js.map +1 -1
  301. package/build/components/image-editor/cropper.js +6 -2
  302. package/build/components/image-editor/cropper.js.map +1 -1
  303. package/build/components/image-editor/form-controls.js.map +1 -1
  304. package/build/components/image-editor/index.js +0 -2
  305. package/build/components/image-editor/index.js.map +1 -1
  306. package/build/components/image-editor/rotation-button.js.map +1 -1
  307. package/build/components/image-editor/use-save-image.js.map +1 -1
  308. package/build/components/image-editor/use-transform-image.js.map +1 -1
  309. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  310. package/build/components/image-link-destinations/index.native.js.map +1 -1
  311. package/build/components/image-size-control/index.js.map +1 -1
  312. package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
  313. package/build/components/index.js +1 -1
  314. package/build/components/index.js.map +1 -1
  315. package/build/components/index.native.js +1 -1
  316. package/build/components/index.native.js.map +1 -1
  317. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  318. package/build/components/inner-blocks/constants.native.js.map +1 -1
  319. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  320. package/build/components/inner-blocks/index.js +16 -2
  321. package/build/components/inner-blocks/index.js.map +1 -1
  322. package/build/components/inner-blocks/index.native.js.map +1 -1
  323. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  324. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  325. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  326. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  327. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  328. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  329. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  330. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  331. package/build/components/inserter/block-patterns-tab/index.js +19 -25
  332. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  333. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +2 -24
  334. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  335. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
  336. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  337. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  338. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  339. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  340. package/build/components/inserter/block-types-tab.js +4 -0
  341. package/build/components/inserter/block-types-tab.js.map +1 -1
  342. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  343. package/build/components/inserter/category-tabs/index.js +56 -0
  344. package/build/components/inserter/category-tabs/index.js.map +1 -0
  345. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  346. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  347. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  348. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  349. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  350. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  351. package/build/components/inserter/index.js.map +1 -1
  352. package/build/components/inserter/index.native.js.map +1 -1
  353. package/build/components/inserter/library.js.map +1 -1
  354. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  355. package/build/components/inserter/media-tab/index.js +2 -2
  356. package/build/components/inserter/media-tab/index.js.map +1 -1
  357. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  358. package/build/components/inserter/media-tab/media-panel.js +0 -25
  359. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  360. package/build/components/inserter/media-tab/media-preview.js +13 -3
  361. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  362. package/build/components/inserter/media-tab/media-tab.js +15 -29
  363. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  364. package/build/components/inserter/media-tab/utils.js.map +1 -1
  365. package/build/components/inserter/menu.js +73 -77
  366. package/build/components/inserter/menu.js.map +1 -1
  367. package/build/components/inserter/menu.native.js.map +1 -1
  368. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  369. package/build/components/inserter/no-results.js.map +1 -1
  370. package/build/components/inserter/no-results.native.js.map +1 -1
  371. package/build/components/inserter/panel.js.map +1 -1
  372. package/build/components/inserter/preview-panel.js.map +1 -1
  373. package/build/components/inserter/quick-inserter.js.map +1 -1
  374. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
  375. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  376. package/build/components/inserter/search-items.js.map +1 -1
  377. package/build/components/inserter/search-results.js.map +1 -1
  378. package/build/components/inserter/search-results.native.js.map +1 -1
  379. package/build/components/inserter/tabs.js +13 -9
  380. package/build/components/inserter/tabs.js.map +1 -1
  381. package/build/components/inserter/tabs.native.js.map +1 -1
  382. package/build/components/inserter/tips.js.map +1 -1
  383. package/build/components/inserter/utils.native.js.map +1 -1
  384. package/build/components/inserter-button/index.native.js.map +1 -1
  385. package/build/components/inserter-button/sparkles.js.map +1 -1
  386. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  387. package/build/components/inserter-list-item/index.js.map +1 -1
  388. package/build/components/inserter-listbox/context.js.map +1 -1
  389. package/build/components/inserter-listbox/group.js.map +1 -1
  390. package/build/components/inserter-listbox/index.js.map +1 -1
  391. package/build/components/inserter-listbox/item.js.map +1 -1
  392. package/build/components/inserter-listbox/row.js.map +1 -1
  393. package/build/components/inserter-menu-extension/index.js.map +1 -1
  394. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  395. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  396. package/build/components/inspector-controls/fill.js.map +1 -1
  397. package/build/components/inspector-controls/fill.native.js.map +1 -1
  398. package/build/components/inspector-controls/groups.js.map +1 -1
  399. package/build/components/inspector-controls/index.js.map +1 -1
  400. package/build/components/inspector-controls/slot.js.map +1 -1
  401. package/build/components/inspector-controls/slot.native.js.map +1 -1
  402. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  403. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  404. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -1
  405. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  406. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  407. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  408. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  409. package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
  410. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  411. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  412. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  413. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  414. package/build/components/inspector-popover-header/index.js.map +1 -1
  415. package/build/components/justify-content-control/index.js.map +1 -1
  416. package/build/components/justify-content-control/ui.js.map +1 -1
  417. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  418. package/build/components/letter-spacing-control/index.js.map +1 -1
  419. package/build/components/line-height-control/index.js +6 -2
  420. package/build/components/line-height-control/index.js.map +1 -1
  421. package/build/components/line-height-control/index.native.js.map +1 -1
  422. package/build/components/line-height-control/utils.js.map +1 -1
  423. package/build/components/link-control/constants.js.map +1 -1
  424. package/build/components/link-control/index.js.map +1 -1
  425. package/build/components/link-control/is-url-like.js.map +1 -1
  426. package/build/components/link-control/link-preview.js.map +1 -1
  427. package/build/components/link-control/search-create-button.js.map +1 -1
  428. package/build/components/link-control/search-input.js.map +1 -1
  429. package/build/components/link-control/search-item.js +9 -3
  430. package/build/components/link-control/search-item.js.map +1 -1
  431. package/build/components/link-control/search-results.js.map +1 -1
  432. package/build/components/link-control/settings-drawer.js.map +1 -1
  433. package/build/components/link-control/settings.js.map +1 -1
  434. package/build/components/link-control/use-create-page.js.map +1 -1
  435. package/build/components/link-control/use-internal-value.js.map +1 -1
  436. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  437. package/build/components/link-control/use-search-handler.js.map +1 -1
  438. package/build/components/link-control/viewer-slot.js.map +1 -1
  439. package/build/components/list-view/appender.js.map +1 -1
  440. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  441. package/build/components/list-view/block-contents.js.map +1 -1
  442. package/build/components/list-view/block-select-button.js +5 -142
  443. package/build/components/list-view/block-select-button.js.map +1 -1
  444. package/build/components/list-view/block.js +166 -14
  445. package/build/components/list-view/block.js.map +1 -1
  446. package/build/components/list-view/branch.js.map +1 -1
  447. package/build/components/list-view/context.js.map +1 -1
  448. package/build/components/list-view/drop-indicator.js.map +1 -1
  449. package/build/components/list-view/expander.js.map +1 -1
  450. package/build/components/list-view/index.js +1 -1
  451. package/build/components/list-view/index.js.map +1 -1
  452. package/build/components/list-view/leaf.js.map +1 -1
  453. package/build/components/list-view/use-block-selection.js.map +1 -1
  454. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  455. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
  456. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  457. package/build/components/list-view/use-list-view-collapse-items.js.map +1 -1
  458. package/build/components/list-view/use-list-view-drop-zone.js +6 -1
  459. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  460. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  461. package/build/components/list-view/use-list-view-images.js.map +1 -1
  462. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  463. package/build/components/list-view/utils.js +3 -1
  464. package/build/components/list-view/utils.js.map +1 -1
  465. package/build/components/media-placeholder/index.js +3 -3
  466. package/build/components/media-placeholder/index.js.map +1 -1
  467. package/build/components/media-placeholder/index.native.js.map +1 -1
  468. package/build/components/media-replace-flow/index.js.map +1 -1
  469. package/build/components/media-replace-flow/index.native.js.map +1 -1
  470. package/build/components/media-upload/check.js.map +1 -1
  471. package/build/components/media-upload/constants.native.js.map +1 -1
  472. package/build/components/media-upload/index.js.map +1 -1
  473. package/build/components/media-upload/index.native.js.map +1 -1
  474. package/build/components/media-upload-progress/constants.js.map +1 -1
  475. package/build/components/media-upload-progress/index.native.js.map +1 -1
  476. package/build/components/multi-selection-inspector/index.js.map +1 -1
  477. package/build/components/navigable-toolbar/index.js +3 -1
  478. package/build/components/navigable-toolbar/index.js.map +1 -1
  479. package/build/components/observe-typing/index.js.map +1 -1
  480. package/build/components/panel-color-settings/index.js.map +1 -1
  481. package/build/components/plain-text/index.js.map +1 -1
  482. package/build/components/plain-text/index.native.js.map +1 -1
  483. package/build/components/preview-options/index.js.map +1 -1
  484. package/build/components/provider/block-refs-provider.js +3 -4
  485. package/build/components/provider/block-refs-provider.js.map +1 -1
  486. package/build/components/provider/index.js.map +1 -1
  487. package/build/components/provider/index.native.js.map +1 -1
  488. package/build/components/provider/use-block-sync.js +3 -12
  489. package/build/components/provider/use-block-sync.js.map +1 -1
  490. package/build/components/provider/with-registry-provider.js.map +1 -1
  491. package/build/components/publish-date-time-picker/index.js.map +1 -1
  492. package/build/components/recursion-provider/index.js +2 -2
  493. package/build/components/recursion-provider/index.js.map +1 -1
  494. package/build/components/resizable-box-popover/index.js.map +1 -1
  495. package/build/components/resolution-tool/index.js.map +1 -1
  496. package/build/components/responsive-block-control/index.js.map +1 -1
  497. package/build/components/responsive-block-control/label.js.map +1 -1
  498. package/build/components/rich-text/content.js +26 -19
  499. package/build/components/rich-text/content.js.map +1 -1
  500. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  501. package/build/components/rich-text/event-listeners/before-input-rules.js +93 -0
  502. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  503. package/build/components/rich-text/event-listeners/delete.js +58 -0
  504. package/build/components/rich-text/event-listeners/delete.js.map +1 -0
  505. package/build/components/rich-text/event-listeners/enter.js +98 -0
  506. package/build/components/rich-text/event-listeners/enter.js.map +1 -0
  507. package/build/components/rich-text/event-listeners/firefox-compat.js +36 -0
  508. package/build/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  509. package/build/components/rich-text/event-listeners/index.js +44 -0
  510. package/build/components/rich-text/event-listeners/index.js.map +1 -0
  511. package/build/components/rich-text/event-listeners/input-events.js +22 -0
  512. package/build/components/rich-text/event-listeners/input-events.js.map +1 -0
  513. package/build/components/rich-text/event-listeners/input-rules.js +135 -0
  514. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -0
  515. package/build/components/rich-text/event-listeners/insert-replacement-text.js +33 -0
  516. package/build/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  517. package/build/components/rich-text/event-listeners/paste-handler.js +146 -0
  518. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  519. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js +27 -0
  520. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  521. package/build/components/rich-text/event-listeners/shortcuts.js +22 -0
  522. package/build/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  523. package/build/components/rich-text/event-listeners/undo-automatic-change.js +51 -0
  524. package/build/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  525. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  526. package/build/components/rich-text/format-edit.js.map +1 -1
  527. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  528. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  529. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  530. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  531. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  532. package/build/components/rich-text/index.js +51 -31
  533. package/build/components/rich-text/index.js.map +1 -1
  534. package/build/components/rich-text/index.native.js +16 -4
  535. package/build/components/rich-text/index.native.js.map +1 -1
  536. package/build/components/rich-text/input-event.js.map +1 -1
  537. package/build/components/rich-text/input-event.native.js.map +1 -1
  538. package/build/components/rich-text/multiline.js +6 -2
  539. package/build/components/rich-text/multiline.js.map +1 -1
  540. package/build/components/rich-text/native/format-edit.js.map +1 -1
  541. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  542. package/build/components/rich-text/native/index.js.map +1 -1
  543. package/build/components/rich-text/native/index.native.js +12 -0
  544. package/build/components/rich-text/native/index.native.js.map +1 -1
  545. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  546. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  547. package/build/components/rich-text/prevent-event-discovery.js.map +1 -1
  548. package/build/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
  549. package/build/components/rich-text/shortcut.js.map +1 -1
  550. package/build/components/rich-text/shortcut.native.js.map +1 -1
  551. package/build/components/rich-text/split-value.js.map +1 -1
  552. package/build/components/rich-text/toolbar-button.js.map +1 -1
  553. package/build/components/rich-text/use-format-types.js +8 -4
  554. package/build/components/rich-text/use-format-types.js.map +1 -1
  555. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  556. package/build/components/rich-text/utils.js.map +1 -1
  557. package/build/components/rich-text/with-deprecations.js.map +1 -1
  558. package/build/components/segmented-text-control/index.js +62 -0
  559. package/build/components/segmented-text-control/index.js.map +1 -0
  560. package/build/components/selection-scroll-into-view/index.js.map +1 -1
  561. package/build/components/skip-to-selected-block/index.js.map +1 -1
  562. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  563. package/build/components/spacing-sizes-control/index.js.map +1 -1
  564. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  565. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  566. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  567. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  568. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  569. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  570. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  571. package/build/components/text-alignment-control/index.js +76 -0
  572. package/build/components/text-alignment-control/index.js.map +1 -0
  573. package/build/components/text-decoration-control/index.js +21 -25
  574. package/build/components/text-decoration-control/index.js.map +1 -1
  575. package/build/components/text-transform-control/index.js +18 -22
  576. package/build/components/text-transform-control/index.js.map +1 -1
  577. package/build/components/tool-selector/index.js.map +1 -1
  578. package/build/components/typewriter/index.js.map +1 -1
  579. package/build/components/ungroup-button/index.native.js.map +1 -1
  580. package/build/components/unit-control/index.js.map +1 -1
  581. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  582. package/build/components/url-input/button.js.map +1 -1
  583. package/build/components/url-input/index.js.map +1 -1
  584. package/build/components/url-input/index.native.js.map +1 -1
  585. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  586. package/build/components/url-popover/index.js.map +1 -1
  587. package/build/components/url-popover/link-editor.js.map +1 -1
  588. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  589. package/build/components/url-popover/link-viewer.js.map +1 -1
  590. package/build/components/use-block-commands/index.js +20 -2
  591. package/build/components/use-block-commands/index.js.map +1 -1
  592. package/build/components/use-block-display-information/index.js +9 -3
  593. package/build/components/use-block-display-information/index.js.map +1 -1
  594. package/build/components/use-block-drop-zone/index.js.map +1 -1
  595. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  596. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  597. package/build/components/use-moving-animation/index.js.map +1 -1
  598. package/build/components/use-on-block-drop/index.js +3 -1
  599. package/build/components/use-on-block-drop/index.js.map +1 -1
  600. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  601. package/build/components/use-on-block-drop/types.js.map +1 -1
  602. package/build/components/use-paste-styles/index.js +1 -0
  603. package/build/components/use-paste-styles/index.js.map +1 -1
  604. package/build/components/use-resize-canvas/index.js.map +1 -1
  605. package/build/components/use-settings/index.js.map +1 -1
  606. package/build/components/use-unsupported-block-editor/index.native.js.map +1 -1
  607. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  608. package/build/components/video-player/index.native.js.map +1 -1
  609. package/build/components/warning/index.js.map +1 -1
  610. package/build/components/warning/index.native.js.map +1 -1
  611. package/build/components/writing-flow/index.js.map +1 -1
  612. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  613. package/build/components/writing-flow/use-click-selection.js.map +1 -1
  614. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  615. package/build/components/writing-flow/use-drag-selection.js +3 -1
  616. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  617. package/build/components/writing-flow/use-input.js.map +1 -1
  618. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  619. package/build/components/writing-flow/use-select-all.js.map +1 -1
  620. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  621. package/build/components/writing-flow/use-tab-nav.js +3 -1
  622. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  623. package/build/components/writing-flow/utils.js.map +1 -1
  624. package/build/components/writing-mode-control/index.js +16 -20
  625. package/build/components/writing-mode-control/index.js.map +1 -1
  626. package/build/elements/index.js.map +1 -1
  627. package/build/hooks/align.js.map +1 -1
  628. package/build/hooks/align.native.js +1 -1
  629. package/build/hooks/align.native.js.map +1 -1
  630. package/build/hooks/anchor.js.map +1 -1
  631. package/build/hooks/aria-label.js.map +1 -1
  632. package/build/hooks/background.js +3 -3
  633. package/build/hooks/background.js.map +1 -1
  634. package/build/hooks/block-hooks.js.map +1 -1
  635. package/build/hooks/block-renaming.js +0 -37
  636. package/build/hooks/block-renaming.js.map +1 -1
  637. package/build/hooks/border.js.map +1 -1
  638. package/build/hooks/color.js +1 -1
  639. package/build/hooks/color.js.map +1 -1
  640. package/build/hooks/compat.js.map +1 -1
  641. package/build/hooks/content-lock-ui.js +5 -5
  642. package/build/hooks/content-lock-ui.js.map +1 -1
  643. package/build/hooks/contrast-checker.js.map +1 -1
  644. package/build/hooks/custom-class-name.js.map +1 -1
  645. package/build/hooks/custom-class-name.native.js.map +1 -1
  646. package/build/hooks/dimensions.js.map +1 -1
  647. package/build/hooks/duotone.js +3 -1
  648. package/build/hooks/duotone.js.map +1 -1
  649. package/build/hooks/font-family.js.map +1 -1
  650. package/build/hooks/font-size.js.map +1 -1
  651. package/build/hooks/gap.js.map +1 -1
  652. package/build/hooks/generated-class-name.js.map +1 -1
  653. package/build/hooks/index.js +6 -5
  654. package/build/hooks/index.js.map +1 -1
  655. package/build/hooks/index.native.js.map +1 -1
  656. package/build/hooks/layout-child.js.map +1 -1
  657. package/build/hooks/layout.js +38 -19
  658. package/build/hooks/layout.js.map +1 -1
  659. package/build/hooks/layout.native.js.map +1 -1
  660. package/build/hooks/line-height.js.map +1 -1
  661. package/build/hooks/lock.js.map +1 -1
  662. package/build/hooks/metadata.js.map +1 -1
  663. package/build/hooks/position.js.map +1 -1
  664. package/build/hooks/settings.js.map +1 -1
  665. package/build/hooks/spacing-visualizer.js.map +1 -1
  666. package/build/hooks/style.js.map +1 -1
  667. package/build/hooks/supports.js +27 -4
  668. package/build/hooks/supports.js.map +1 -1
  669. package/build/hooks/text-align.js +156 -0
  670. package/build/hooks/text-align.js.map +1 -0
  671. package/build/hooks/typography.js +3 -2
  672. package/build/hooks/typography.js.map +1 -1
  673. package/build/hooks/typography.native.js.map +1 -1
  674. package/build/hooks/use-bindings-attributes.js +66 -129
  675. package/build/hooks/use-bindings-attributes.js.map +1 -1
  676. package/build/hooks/use-border-props.js.map +1 -1
  677. package/build/hooks/use-cached-truthy.js.map +1 -1
  678. package/build/hooks/use-color-props.js.map +1 -1
  679. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  680. package/build/hooks/use-shadow-props.js.map +1 -1
  681. package/build/hooks/use-spacing-props.js.map +1 -1
  682. package/build/hooks/use-typography-props.js +2 -1
  683. package/build/hooks/use-typography-props.js.map +1 -1
  684. package/build/hooks/use-zoom-out.js +22 -15
  685. package/build/hooks/use-zoom-out.js.map +1 -1
  686. package/build/hooks/utils.js +37 -8
  687. package/build/hooks/utils.js.map +1 -1
  688. package/build/index.js.map +1 -1
  689. package/build/index.native.js.map +1 -1
  690. package/build/layouts/constrained.js.map +1 -1
  691. package/build/layouts/definitions.js +8 -6
  692. package/build/layouts/definitions.js.map +1 -1
  693. package/build/layouts/flex.js.map +1 -1
  694. package/build/layouts/flow.js.map +1 -1
  695. package/build/layouts/grid.js +52 -9
  696. package/build/layouts/grid.js.map +1 -1
  697. package/build/layouts/index.js.map +1 -1
  698. package/build/layouts/utils.js.map +1 -1
  699. package/build/lock-unlock.js.map +1 -1
  700. package/build/private-apis.js +5 -3
  701. package/build/private-apis.js.map +1 -1
  702. package/build/private-apis.native.js +1 -1
  703. package/build/private-apis.native.js.map +1 -1
  704. package/build/store/actions.js +47 -9
  705. package/build/store/actions.js.map +1 -1
  706. package/build/store/array.js.map +1 -1
  707. package/build/store/constants.js.map +1 -1
  708. package/build/store/defaults.js.map +1 -1
  709. package/build/store/defaults.native.js.map +1 -1
  710. package/build/store/get-block-settings.js.map +1 -1
  711. package/build/store/index.js +1 -1
  712. package/build/store/index.js.map +1 -1
  713. package/build/store/private-actions.js +5 -2
  714. package/build/store/private-actions.js.map +1 -1
  715. package/build/store/private-keys.js.map +1 -1
  716. package/build/store/private-selectors.js +121 -44
  717. package/build/store/private-selectors.js.map +1 -1
  718. package/build/store/reducer.js +11 -8
  719. package/build/store/reducer.js.map +1 -1
  720. package/build/store/selectors.js +143 -88
  721. package/build/store/selectors.js.map +1 -1
  722. package/build/store/undo-ignore.js.map +1 -1
  723. package/build/store/utils.js.map +1 -1
  724. package/build/utils/dom.js.map +1 -1
  725. package/build/utils/get-px-from-css-unit.js.map +1 -1
  726. package/build/utils/index.js.map +1 -1
  727. package/build/utils/math.js.map +1 -1
  728. package/build/utils/object.js +17 -0
  729. package/build/utils/object.js.map +1 -1
  730. package/build/utils/order-inserter-block-items.js +6 -2
  731. package/build/utils/order-inserter-block-items.js.map +1 -1
  732. package/build/utils/pasting.js +6 -2
  733. package/build/utils/pasting.js.map +1 -1
  734. package/build/utils/selection.js.map +1 -1
  735. package/build/utils/sorting.js.map +1 -1
  736. package/build/utils/transform-styles/index.js +1 -1
  737. package/build/utils/transform-styles/index.js.map +1 -1
  738. package/build/utils/use-notify-copy.js.map +1 -1
  739. package/build-module/autocompleters/block.js.map +1 -1
  740. package/build-module/autocompleters/link.js.map +1 -1
  741. package/build-module/components/alignment-control/index.js.map +1 -1
  742. package/build-module/components/alignment-control/ui.js +3 -1
  743. package/build-module/components/alignment-control/ui.js.map +1 -1
  744. package/build-module/components/autocomplete/index.js.map +1 -1
  745. package/build-module/components/block-actions/index.js.map +1 -1
  746. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  747. package/build-module/components/block-alignment-control/index.js.map +1 -1
  748. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  749. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  750. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  751. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  752. package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -1
  753. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  754. package/build-module/components/block-canvas/index.js.map +1 -1
  755. package/build-module/components/block-caption/index.native.js.map +1 -1
  756. package/build-module/components/block-card/index.js.map +1 -1
  757. package/build-module/components/block-compare/block-view.js.map +1 -1
  758. package/build-module/components/block-compare/index.js.map +1 -1
  759. package/build-module/components/block-content-overlay/index.js.map +1 -1
  760. package/build-module/components/block-context/index.js.map +1 -1
  761. package/build-module/components/block-controls/fill.js.map +1 -1
  762. package/build-module/components/block-controls/groups.js.map +1 -1
  763. package/build-module/components/block-controls/hook.js.map +1 -1
  764. package/build-module/components/block-controls/index.js.map +1 -1
  765. package/build-module/components/block-controls/slot.js.map +1 -1
  766. package/build-module/components/block-controls/slot.native.js.map +1 -1
  767. package/build-module/components/block-controls/use-has-block-controls.js.map +1 -1
  768. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  769. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  770. package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  771. package/build-module/components/block-draggable/index.js.map +1 -1
  772. package/build-module/components/block-draggable/index.native.js.map +1 -1
  773. package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  774. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  775. package/build-module/components/block-edit/context.js +1 -0
  776. package/build-module/components/block-edit/context.js.map +1 -1
  777. package/build-module/components/block-edit/edit.js.map +1 -1
  778. package/build-module/components/block-edit/edit.native.js.map +1 -1
  779. package/build-module/components/block-edit/index.js +5 -3
  780. package/build-module/components/block-edit/index.js.map +1 -1
  781. package/build-module/components/block-edit-visually-button/index.js.map +1 -1
  782. package/build-module/components/block-editing-mode/index.js.map +1 -1
  783. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  784. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  785. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  786. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  787. package/build-module/components/block-icon/index.js.map +1 -1
  788. package/build-module/components/block-icon/index.native.js.map +1 -1
  789. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  790. package/build-module/components/block-inspector/index.js +5 -4
  791. package/build-module/components/block-inspector/index.js.map +1 -1
  792. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  793. package/build-module/components/block-list/block-crash-boundary.js.map +1 -1
  794. package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -1
  795. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  796. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  797. package/build-module/components/block-list/block-html.js.map +1 -1
  798. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  799. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  800. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  801. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  802. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  803. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  804. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  805. package/build-module/components/block-list/block.js +44 -35
  806. package/build-module/components/block-list/block.js.map +1 -1
  807. package/build-module/components/block-list/block.native.js +2 -2
  808. package/build-module/components/block-list/block.native.js.map +1 -1
  809. package/build-module/components/block-list/grid-item.native.js.map +1 -1
  810. package/build-module/components/block-list/index.js +18 -6
  811. package/build-module/components/block-list/index.js.map +1 -1
  812. package/build-module/components/block-list/index.native.js +1 -9
  813. package/build-module/components/block-list/index.native.js.map +1 -1
  814. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  815. package/build-module/components/block-list/layout.js.map +1 -1
  816. package/build-module/components/block-list/private-block-context.js.map +1 -1
  817. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  818. package/build-module/components/block-list/use-block-props/index.js +8 -7
  819. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  820. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  821. package/build-module/components/block-list/use-block-props/use-block-refs.js +19 -48
  822. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  823. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +3 -2
  824. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  825. package/build-module/components/block-list/use-block-props/use-focus-handler.js.map +1 -1
  826. package/build-module/components/block-list/use-block-props/use-intersection-observer.js.map +1 -1
  827. package/build-module/components/block-list/use-block-props/use-is-hovered.js +10 -14
  828. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  829. package/build-module/components/block-list/use-block-props/use-nav-mode-exit.js.map +1 -1
  830. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  831. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  832. package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  833. package/build-module/components/block-list-appender/index.js.map +1 -1
  834. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  835. package/build-module/components/block-lock/index.js.map +1 -1
  836. package/build-module/components/block-lock/menu-item.js.map +1 -1
  837. package/build-module/components/block-lock/modal.js.map +1 -1
  838. package/build-module/components/block-lock/toolbar.js.map +1 -1
  839. package/build-module/components/block-lock/use-block-lock.js.map +1 -1
  840. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  841. package/build-module/components/block-mover/button.js.map +1 -1
  842. package/build-module/components/block-mover/index.js.map +1 -1
  843. package/build-module/components/block-mover/index.native.js +3 -1
  844. package/build-module/components/block-mover/index.native.js.map +1 -1
  845. package/build-module/components/block-mover/mover-description.js.map +1 -1
  846. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  847. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  848. package/build-module/components/block-parent-selector/index.js.map +1 -1
  849. package/build-module/components/block-pattern-setup/constants.js.map +1 -1
  850. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  851. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  852. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  853. package/build-module/components/block-patterns-list/index.js.map +1 -1
  854. package/build-module/components/block-patterns-paging/index.js +8 -4
  855. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  856. package/build-module/components/block-popover/cover.js.map +1 -1
  857. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  858. package/build-module/components/block-popover/inbetween.js.map +1 -1
  859. package/build-module/components/block-popover/index.js.map +1 -1
  860. package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
  861. package/build-module/components/block-preview/auto.js.map +1 -1
  862. package/build-module/components/block-preview/index.js.map +1 -1
  863. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  864. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  865. package/build-module/components/block-rename/index.js.map +1 -1
  866. package/build-module/components/block-rename/is-empty-string.js.map +1 -1
  867. package/build-module/components/block-rename/modal.js +14 -10
  868. package/build-module/components/block-rename/modal.js.map +1 -1
  869. package/build-module/components/block-rename/rename-control.js +3 -1
  870. package/build-module/components/block-rename/rename-control.js.map +1 -1
  871. package/build-module/components/block-rename/use-block-rename.js.map +1 -1
  872. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  873. package/build-module/components/block-settings/button.native.js.map +1 -1
  874. package/build-module/components/block-settings/container.native.js.map +1 -1
  875. package/build-module/components/block-settings/index.native.js.map +1 -1
  876. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  877. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  878. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  879. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -26
  880. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  881. package/build-module/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  882. package/build-module/components/block-settings-menu/index.js.map +1 -1
  883. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  884. package/build-module/components/block-styles/index.js.map +1 -1
  885. package/build-module/components/block-styles/index.native.js.map +1 -1
  886. package/build-module/components/block-styles/menu-items.js.map +1 -1
  887. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  888. package/build-module/components/block-styles/preview.native.js.map +1 -1
  889. package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
  890. package/build-module/components/block-styles/utils.js.map +1 -1
  891. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  892. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  893. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  894. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  895. package/build-module/components/block-switcher/index.js.map +1 -1
  896. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -1
  897. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  898. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  899. package/build-module/components/block-switcher/use-transformed-patterns.js +6 -2
  900. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  901. package/build-module/components/block-switcher/utils.js +15 -5
  902. package/build-module/components/block-switcher/utils.js.map +1 -1
  903. package/build-module/components/block-title/index.js.map +1 -1
  904. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  905. package/build-module/components/block-toolbar/block-name-context.js.map +1 -1
  906. package/build-module/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  907. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  908. package/build-module/components/block-toolbar/index.js +1 -1
  909. package/build-module/components/block-toolbar/index.js.map +1 -1
  910. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  911. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  912. package/build-module/components/block-toolbar/use-has-block-toolbar.js +20 -12
  913. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  914. package/build-module/components/block-toolbar/utils.js.map +1 -1
  915. package/build-module/components/block-tools/block-selection-button.js +16 -12
  916. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  917. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  918. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  919. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  920. package/build-module/components/block-tools/index.js +3 -1
  921. package/build-module/components/block-tools/index.js.map +1 -1
  922. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  923. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  924. package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  925. package/build-module/components/block-tools/use-show-block-tools.js +9 -18
  926. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  927. package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -1
  928. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  929. package/build-module/components/block-types-list/index.js.map +1 -1
  930. package/build-module/components/block-types-list/index.native.js.map +1 -1
  931. package/build-module/components/block-variation-picker/index.js +3 -2
  932. package/build-module/components/block-variation-picker/index.js.map +1 -1
  933. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  934. package/build-module/components/block-variation-transforms/index.js +7 -2
  935. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  936. package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
  937. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  938. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  939. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  940. package/build-module/components/border-radius-control/index.js.map +1 -1
  941. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  942. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  943. package/build-module/components/border-radius-control/utils.js.map +1 -1
  944. package/build-module/components/button-block-appender/index.js.map +1 -1
  945. package/build-module/components/button-block-appender/index.native.js +11 -1
  946. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  947. package/build-module/components/caption/index.native.js.map +1 -1
  948. package/build-module/components/child-layout-control/index.js.map +1 -1
  949. package/build-module/components/color-palette/control.js.map +1 -1
  950. package/build-module/components/color-palette/index.js.map +1 -1
  951. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  952. package/build-module/components/color-style-selector/index.js.map +1 -1
  953. package/build-module/components/colors/index.js.map +1 -1
  954. package/build-module/components/colors/utils.js.map +1 -1
  955. package/build-module/components/colors/with-colors.js.map +1 -1
  956. package/build-module/components/colors-gradients/control.js.map +1 -1
  957. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  958. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  959. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  960. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  961. package/build-module/components/contrast-checker/index.js.map +1 -1
  962. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  963. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  964. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  965. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  966. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  967. package/build-module/components/copy-handler/index.js.map +1 -1
  968. package/build-module/components/date-format-picker/index.js.map +1 -1
  969. package/build-module/components/default-block-appender/index.js.map +1 -1
  970. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  971. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  972. package/build-module/components/dimensions-tool/index.js.map +1 -1
  973. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  974. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  975. package/build-module/components/duotone/utils.js.map +1 -1
  976. package/build-module/components/duotone-control/index.js.map +1 -1
  977. package/build-module/components/editable-text/index.js.map +1 -1
  978. package/build-module/components/editor-styles/index.js +3 -2
  979. package/build-module/components/editor-styles/index.js.map +1 -1
  980. package/build-module/components/floating-toolbar/index.native.js +9 -5
  981. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  982. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  983. package/build-module/components/font-appearance-control/index.js.map +1 -1
  984. package/build-module/components/font-family/index.js.map +1 -1
  985. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  986. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  987. package/build-module/components/font-sizes/index.js.map +1 -1
  988. package/build-module/components/font-sizes/index.native.js.map +1 -1
  989. package/build-module/components/font-sizes/utils.js.map +1 -1
  990. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  991. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  992. package/build-module/components/global-styles/background-panel.js +20 -17
  993. package/build-module/components/global-styles/background-panel.js.map +1 -1
  994. package/build-module/components/global-styles/border-panel.js.map +1 -1
  995. package/build-module/components/global-styles/color-panel.js +3 -1
  996. package/build-module/components/global-styles/color-panel.js.map +1 -1
  997. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  998. package/build-module/components/global-styles/context.js.map +1 -1
  999. package/build-module/components/global-styles/dimensions-panel.js +17 -1
  1000. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  1001. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  1002. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  1003. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  1004. package/build-module/components/global-styles/hooks.js +3 -2
  1005. package/build-module/components/global-styles/hooks.js.map +1 -1
  1006. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  1007. package/build-module/components/global-styles/index.js.map +1 -1
  1008. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  1009. package/build-module/components/global-styles/typography-panel.js +24 -24
  1010. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  1011. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  1012. package/build-module/components/global-styles/use-global-styles-output.js +153 -136
  1013. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  1014. package/build-module/components/global-styles/utils.js +44 -0
  1015. package/build-module/components/global-styles/utils.js.map +1 -1
  1016. package/build-module/components/gradients/index.js.map +1 -1
  1017. package/build-module/components/gradients/index.native.js.map +1 -1
  1018. package/build-module/components/gradients/use-gradient.js.map +1 -1
  1019. package/build-module/components/gradients/with-gradient.js.map +1 -1
  1020. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  1021. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  1022. package/build-module/components/grid-visualizer/index.js.map +1 -1
  1023. package/build-module/components/grid-visualizer/utils.js.map +1 -1
  1024. package/build-module/components/height-control/index.js.map +1 -1
  1025. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  1026. package/build-module/components/iframe/index.js +12 -13
  1027. package/build-module/components/iframe/index.js.map +1 -1
  1028. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  1029. package/build-module/components/image-editor/constants.js.map +1 -1
  1030. package/build-module/components/image-editor/context.js.map +1 -1
  1031. package/build-module/components/image-editor/cropper.js +7 -3
  1032. package/build-module/components/image-editor/cropper.js.map +1 -1
  1033. package/build-module/components/image-editor/form-controls.js.map +1 -1
  1034. package/build-module/components/image-editor/index.js +0 -2
  1035. package/build-module/components/image-editor/index.js.map +1 -1
  1036. package/build-module/components/image-editor/rotation-button.js.map +1 -1
  1037. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  1038. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  1039. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  1040. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  1041. package/build-module/components/image-size-control/index.js.map +1 -1
  1042. package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
  1043. package/build-module/components/index.js.map +1 -1
  1044. package/build-module/components/index.native.js.map +1 -1
  1045. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  1046. package/build-module/components/inner-blocks/constants.native.js.map +1 -1
  1047. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  1048. package/build-module/components/inner-blocks/index.js +16 -2
  1049. package/build-module/components/inner-blocks/index.js.map +1 -1
  1050. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  1051. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  1052. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  1053. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  1054. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  1055. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  1056. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  1057. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  1058. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  1059. package/build-module/components/inserter/block-patterns-tab/index.js +20 -26
  1060. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  1061. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +2 -24
  1062. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  1063. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -4
  1064. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  1065. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  1066. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  1067. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  1068. package/build-module/components/inserter/block-types-tab.js +4 -0
  1069. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  1070. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  1071. package/build-module/components/inserter/category-tabs/index.js +49 -0
  1072. package/build-module/components/inserter/category-tabs/index.js.map +1 -0
  1073. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  1074. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  1075. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  1076. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  1077. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  1078. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  1079. package/build-module/components/inserter/index.js.map +1 -1
  1080. package/build-module/components/inserter/index.native.js.map +1 -1
  1081. package/build-module/components/inserter/library.js.map +1 -1
  1082. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  1083. package/build-module/components/inserter/media-tab/index.js +1 -1
  1084. package/build-module/components/inserter/media-tab/index.js.map +1 -1
  1085. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  1086. package/build-module/components/inserter/media-tab/media-panel.js +0 -24
  1087. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  1088. package/build-module/components/inserter/media-tab/media-preview.js +13 -3
  1089. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  1090. package/build-module/components/inserter/media-tab/media-tab.js +17 -31
  1091. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  1092. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  1093. package/build-module/components/inserter/menu.js +75 -79
  1094. package/build-module/components/inserter/menu.js.map +1 -1
  1095. package/build-module/components/inserter/menu.native.js.map +1 -1
  1096. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  1097. package/build-module/components/inserter/no-results.js.map +1 -1
  1098. package/build-module/components/inserter/no-results.native.js.map +1 -1
  1099. package/build-module/components/inserter/panel.js.map +1 -1
  1100. package/build-module/components/inserter/preview-panel.js.map +1 -1
  1101. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  1102. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -1
  1103. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  1104. package/build-module/components/inserter/search-items.js.map +1 -1
  1105. package/build-module/components/inserter/search-results.js.map +1 -1
  1106. package/build-module/components/inserter/search-results.native.js.map +1 -1
  1107. package/build-module/components/inserter/tabs.js +13 -9
  1108. package/build-module/components/inserter/tabs.js.map +1 -1
  1109. package/build-module/components/inserter/tabs.native.js.map +1 -1
  1110. package/build-module/components/inserter/tips.js.map +1 -1
  1111. package/build-module/components/inserter/utils.native.js.map +1 -1
  1112. package/build-module/components/inserter-button/index.native.js.map +1 -1
  1113. package/build-module/components/inserter-button/sparkles.js.map +1 -1
  1114. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  1115. package/build-module/components/inserter-list-item/index.js.map +1 -1
  1116. package/build-module/components/inserter-listbox/context.js.map +1 -1
  1117. package/build-module/components/inserter-listbox/group.js.map +1 -1
  1118. package/build-module/components/inserter-listbox/index.js.map +1 -1
  1119. package/build-module/components/inserter-listbox/item.js.map +1 -1
  1120. package/build-module/components/inserter-listbox/row.js.map +1 -1
  1121. package/build-module/components/inserter-menu-extension/index.js.map +1 -1
  1122. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  1123. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  1124. package/build-module/components/inspector-controls/fill.js.map +1 -1
  1125. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  1126. package/build-module/components/inspector-controls/groups.js.map +1 -1
  1127. package/build-module/components/inspector-controls/index.js.map +1 -1
  1128. package/build-module/components/inspector-controls/slot.js.map +1 -1
  1129. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  1130. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  1131. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -1
  1132. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  1133. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  1134. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  1135. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  1136. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -1
  1137. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  1138. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  1139. package/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  1140. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  1141. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  1142. package/build-module/components/justify-content-control/index.js.map +1 -1
  1143. package/build-module/components/justify-content-control/ui.js.map +1 -1
  1144. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  1145. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1146. package/build-module/components/line-height-control/index.js +6 -2
  1147. package/build-module/components/line-height-control/index.js.map +1 -1
  1148. package/build-module/components/line-height-control/index.native.js.map +1 -1
  1149. package/build-module/components/line-height-control/utils.js.map +1 -1
  1150. package/build-module/components/link-control/constants.js.map +1 -1
  1151. package/build-module/components/link-control/index.js.map +1 -1
  1152. package/build-module/components/link-control/is-url-like.js.map +1 -1
  1153. package/build-module/components/link-control/link-preview.js.map +1 -1
  1154. package/build-module/components/link-control/search-create-button.js.map +1 -1
  1155. package/build-module/components/link-control/search-input.js.map +1 -1
  1156. package/build-module/components/link-control/search-item.js +9 -3
  1157. package/build-module/components/link-control/search-item.js.map +1 -1
  1158. package/build-module/components/link-control/search-results.js.map +1 -1
  1159. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  1160. package/build-module/components/link-control/settings.js.map +1 -1
  1161. package/build-module/components/link-control/use-create-page.js.map +1 -1
  1162. package/build-module/components/link-control/use-internal-value.js.map +1 -1
  1163. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  1164. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  1165. package/build-module/components/link-control/viewer-slot.js.map +1 -1
  1166. package/build-module/components/list-view/appender.js.map +1 -1
  1167. package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
  1168. package/build-module/components/list-view/block-contents.js.map +1 -1
  1169. package/build-module/components/list-view/block-select-button.js +7 -144
  1170. package/build-module/components/list-view/block-select-button.js.map +1 -1
  1171. package/build-module/components/list-view/block.js +167 -15
  1172. package/build-module/components/list-view/block.js.map +1 -1
  1173. package/build-module/components/list-view/branch.js.map +1 -1
  1174. package/build-module/components/list-view/context.js.map +1 -1
  1175. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  1176. package/build-module/components/list-view/expander.js.map +1 -1
  1177. package/build-module/components/list-view/index.js +1 -1
  1178. package/build-module/components/list-view/index.js.map +1 -1
  1179. package/build-module/components/list-view/leaf.js.map +1 -1
  1180. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  1181. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  1182. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
  1183. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  1184. package/build-module/components/list-view/use-list-view-collapse-items.js.map +1 -1
  1185. package/build-module/components/list-view/use-list-view-drop-zone.js +6 -1
  1186. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  1187. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  1188. package/build-module/components/list-view/use-list-view-images.js.map +1 -1
  1189. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  1190. package/build-module/components/list-view/utils.js +3 -1
  1191. package/build-module/components/list-view/utils.js.map +1 -1
  1192. package/build-module/components/media-placeholder/index.js +3 -3
  1193. package/build-module/components/media-placeholder/index.js.map +1 -1
  1194. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  1195. package/build-module/components/media-replace-flow/index.js.map +1 -1
  1196. package/build-module/components/media-replace-flow/index.native.js.map +1 -1
  1197. package/build-module/components/media-upload/check.js.map +1 -1
  1198. package/build-module/components/media-upload/constants.native.js.map +1 -1
  1199. package/build-module/components/media-upload/index.js.map +1 -1
  1200. package/build-module/components/media-upload/index.native.js.map +1 -1
  1201. package/build-module/components/media-upload-progress/constants.js.map +1 -1
  1202. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  1203. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  1204. package/build-module/components/navigable-toolbar/index.js +3 -1
  1205. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  1206. package/build-module/components/observe-typing/index.js.map +1 -1
  1207. package/build-module/components/panel-color-settings/index.js.map +1 -1
  1208. package/build-module/components/plain-text/index.js.map +1 -1
  1209. package/build-module/components/plain-text/index.native.js.map +1 -1
  1210. package/build-module/components/preview-options/index.js.map +1 -1
  1211. package/build-module/components/provider/block-refs-provider.js +3 -4
  1212. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1213. package/build-module/components/provider/index.js.map +1 -1
  1214. package/build-module/components/provider/index.native.js.map +1 -1
  1215. package/build-module/components/provider/use-block-sync.js +4 -13
  1216. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1217. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1218. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  1219. package/build-module/components/recursion-provider/index.js +2 -2
  1220. package/build-module/components/recursion-provider/index.js.map +1 -1
  1221. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  1222. package/build-module/components/resolution-tool/index.js.map +1 -1
  1223. package/build-module/components/responsive-block-control/index.js.map +1 -1
  1224. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1225. package/build-module/components/rich-text/content.js +25 -19
  1226. package/build-module/components/rich-text/content.js.map +1 -1
  1227. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1228. package/build-module/components/rich-text/event-listeners/before-input-rules.js +86 -0
  1229. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
  1230. package/build-module/components/rich-text/event-listeners/delete.js +51 -0
  1231. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -0
  1232. package/build-module/components/rich-text/event-listeners/enter.js +92 -0
  1233. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -0
  1234. package/build-module/components/rich-text/event-listeners/firefox-compat.js +29 -0
  1235. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
  1236. package/build-module/components/rich-text/event-listeners/index.js +36 -0
  1237. package/build-module/components/rich-text/event-listeners/index.js.map +1 -0
  1238. package/build-module/components/rich-text/event-listeners/input-events.js +15 -0
  1239. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -0
  1240. package/build-module/components/rich-text/event-listeners/input-rules.js +127 -0
  1241. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -0
  1242. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +27 -0
  1243. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
  1244. package/build-module/components/rich-text/event-listeners/paste-handler.js +142 -0
  1245. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -0
  1246. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +21 -0
  1247. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
  1248. package/build-module/components/rich-text/event-listeners/shortcuts.js +15 -0
  1249. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -0
  1250. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  1251. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
  1252. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  1253. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1254. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1255. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  1256. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1257. package/build-module/components/rich-text/format-toolbar-container.native.js.map +1 -1
  1258. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  1259. package/build-module/components/rich-text/index.js +54 -34
  1260. package/build-module/components/rich-text/index.js.map +1 -1
  1261. package/build-module/components/rich-text/index.native.js +16 -4
  1262. package/build-module/components/rich-text/index.native.js.map +1 -1
  1263. package/build-module/components/rich-text/input-event.js.map +1 -1
  1264. package/build-module/components/rich-text/input-event.native.js.map +1 -1
  1265. package/build-module/components/rich-text/multiline.js +6 -2
  1266. package/build-module/components/rich-text/multiline.js.map +1 -1
  1267. package/build-module/components/rich-text/native/format-edit.js.map +1 -1
  1268. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  1269. package/build-module/components/rich-text/native/index.js.map +1 -1
  1270. package/build-module/components/rich-text/native/index.native.js +12 -0
  1271. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  1272. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  1273. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  1274. package/build-module/components/rich-text/prevent-event-discovery.js.map +1 -1
  1275. package/build-module/components/rich-text/remove-browser-shortcuts.native.js.map +1 -1
  1276. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1277. package/build-module/components/rich-text/shortcut.native.js.map +1 -1
  1278. package/build-module/components/rich-text/split-value.js.map +1 -1
  1279. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1280. package/build-module/components/rich-text/use-format-types.js +8 -4
  1281. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1282. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1283. package/build-module/components/rich-text/utils.js.map +1 -1
  1284. package/build-module/components/rich-text/with-deprecations.js.map +1 -1
  1285. package/build-module/components/segmented-text-control/index.js +55 -0
  1286. package/build-module/components/segmented-text-control/index.js.map +1 -0
  1287. package/build-module/components/selection-scroll-into-view/index.js.map +1 -1
  1288. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1289. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  1290. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  1291. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  1292. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  1293. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  1294. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
  1295. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  1296. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  1297. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  1298. package/build-module/components/text-alignment-control/index.js +68 -0
  1299. package/build-module/components/text-alignment-control/index.js.map +1 -0
  1300. package/build-module/components/text-decoration-control/index.js +21 -25
  1301. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1302. package/build-module/components/text-transform-control/index.js +18 -22
  1303. package/build-module/components/text-transform-control/index.js.map +1 -1
  1304. package/build-module/components/tool-selector/index.js.map +1 -1
  1305. package/build-module/components/typewriter/index.js.map +1 -1
  1306. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1307. package/build-module/components/unit-control/index.js.map +1 -1
  1308. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  1309. package/build-module/components/url-input/button.js.map +1 -1
  1310. package/build-module/components/url-input/index.js.map +1 -1
  1311. package/build-module/components/url-input/index.native.js.map +1 -1
  1312. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1313. package/build-module/components/url-popover/index.js.map +1 -1
  1314. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1315. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1316. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1317. package/build-module/components/use-block-commands/index.js +20 -2
  1318. package/build-module/components/use-block-commands/index.js.map +1 -1
  1319. package/build-module/components/use-block-display-information/index.js +9 -3
  1320. package/build-module/components/use-block-display-information/index.js.map +1 -1
  1321. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1322. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  1323. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  1324. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1325. package/build-module/components/use-on-block-drop/index.js +3 -1
  1326. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1327. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  1328. package/build-module/components/use-on-block-drop/types.js.map +1 -1
  1329. package/build-module/components/use-paste-styles/index.js +2 -1
  1330. package/build-module/components/use-paste-styles/index.js.map +1 -1
  1331. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  1332. package/build-module/components/use-settings/index.js.map +1 -1
  1333. package/build-module/components/use-unsupported-block-editor/index.native.js.map +1 -1
  1334. package/build-module/components/video-player/gridicon-play.native.js.map +1 -1
  1335. package/build-module/components/video-player/index.native.js.map +1 -1
  1336. package/build-module/components/warning/index.js.map +1 -1
  1337. package/build-module/components/warning/index.native.js.map +1 -1
  1338. package/build-module/components/writing-flow/index.js.map +1 -1
  1339. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  1340. package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
  1341. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  1342. package/build-module/components/writing-flow/use-drag-selection.js +3 -1
  1343. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  1344. package/build-module/components/writing-flow/use-input.js.map +1 -1
  1345. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  1346. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  1347. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  1348. package/build-module/components/writing-flow/use-tab-nav.js +3 -1
  1349. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  1350. package/build-module/components/writing-flow/utils.js.map +1 -1
  1351. package/build-module/components/writing-mode-control/index.js +16 -20
  1352. package/build-module/components/writing-mode-control/index.js.map +1 -1
  1353. package/build-module/elements/index.js.map +1 -1
  1354. package/build-module/hooks/align.js.map +1 -1
  1355. package/build-module/hooks/align.native.js.map +1 -1
  1356. package/build-module/hooks/anchor.js.map +1 -1
  1357. package/build-module/hooks/aria-label.js.map +1 -1
  1358. package/build-module/hooks/background.js +2 -2
  1359. package/build-module/hooks/background.js.map +1 -1
  1360. package/build-module/hooks/block-hooks.js.map +1 -1
  1361. package/build-module/hooks/block-renaming.js +0 -36
  1362. package/build-module/hooks/block-renaming.js.map +1 -1
  1363. package/build-module/hooks/border.js.map +1 -1
  1364. package/build-module/hooks/color.js.map +1 -1
  1365. package/build-module/hooks/compat.js.map +1 -1
  1366. package/build-module/hooks/content-lock-ui.js +5 -5
  1367. package/build-module/hooks/content-lock-ui.js.map +1 -1
  1368. package/build-module/hooks/contrast-checker.js.map +1 -1
  1369. package/build-module/hooks/custom-class-name.js.map +1 -1
  1370. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  1371. package/build-module/hooks/dimensions.js.map +1 -1
  1372. package/build-module/hooks/duotone.js +3 -1
  1373. package/build-module/hooks/duotone.js.map +1 -1
  1374. package/build-module/hooks/font-family.js.map +1 -1
  1375. package/build-module/hooks/font-size.js.map +1 -1
  1376. package/build-module/hooks/gap.js.map +1 -1
  1377. package/build-module/hooks/generated-class-name.js.map +1 -1
  1378. package/build-module/hooks/index.js +5 -4
  1379. package/build-module/hooks/index.js.map +1 -1
  1380. package/build-module/hooks/index.native.js.map +1 -1
  1381. package/build-module/hooks/layout-child.js.map +1 -1
  1382. package/build-module/hooks/layout.js +38 -19
  1383. package/build-module/hooks/layout.js.map +1 -1
  1384. package/build-module/hooks/layout.native.js.map +1 -1
  1385. package/build-module/hooks/line-height.js.map +1 -1
  1386. package/build-module/hooks/lock.js.map +1 -1
  1387. package/build-module/hooks/metadata.js.map +1 -1
  1388. package/build-module/hooks/position.js.map +1 -1
  1389. package/build-module/hooks/settings.js.map +1 -1
  1390. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  1391. package/build-module/hooks/style.js.map +1 -1
  1392. package/build-module/hooks/supports.js +22 -1
  1393. package/build-module/hooks/supports.js.map +1 -1
  1394. package/build-module/hooks/text-align.js +145 -0
  1395. package/build-module/hooks/text-align.js.map +1 -0
  1396. package/build-module/hooks/typography.js +2 -1
  1397. package/build-module/hooks/typography.js.map +1 -1
  1398. package/build-module/hooks/typography.native.js.map +1 -1
  1399. package/build-module/hooks/use-bindings-attributes.js +68 -132
  1400. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  1401. package/build-module/hooks/use-border-props.js.map +1 -1
  1402. package/build-module/hooks/use-cached-truthy.js.map +1 -1
  1403. package/build-module/hooks/use-color-props.js.map +1 -1
  1404. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  1405. package/build-module/hooks/use-shadow-props.js.map +1 -1
  1406. package/build-module/hooks/use-spacing-props.js.map +1 -1
  1407. package/build-module/hooks/use-typography-props.js +2 -1
  1408. package/build-module/hooks/use-typography-props.js.map +1 -1
  1409. package/build-module/hooks/use-zoom-out.js +23 -16
  1410. package/build-module/hooks/use-zoom-out.js.map +1 -1
  1411. package/build-module/hooks/utils.js +38 -9
  1412. package/build-module/hooks/utils.js.map +1 -1
  1413. package/build-module/index.js.map +1 -1
  1414. package/build-module/index.native.js.map +1 -1
  1415. package/build-module/layouts/constrained.js.map +1 -1
  1416. package/build-module/layouts/definitions.js +8 -6
  1417. package/build-module/layouts/definitions.js.map +1 -1
  1418. package/build-module/layouts/flex.js.map +1 -1
  1419. package/build-module/layouts/flow.js.map +1 -1
  1420. package/build-module/layouts/grid.js +52 -9
  1421. package/build-module/layouts/grid.js.map +1 -1
  1422. package/build-module/layouts/index.js.map +1 -1
  1423. package/build-module/layouts/utils.js.map +1 -1
  1424. package/build-module/lock-unlock.js.map +1 -1
  1425. package/build-module/private-apis.js +4 -2
  1426. package/build-module/private-apis.js.map +1 -1
  1427. package/build-module/private-apis.native.js.map +1 -1
  1428. package/build-module/store/actions.js +47 -9
  1429. package/build-module/store/actions.js.map +1 -1
  1430. package/build-module/store/array.js.map +1 -1
  1431. package/build-module/store/constants.js.map +1 -1
  1432. package/build-module/store/defaults.js.map +1 -1
  1433. package/build-module/store/defaults.native.js.map +1 -1
  1434. package/build-module/store/get-block-settings.js.map +1 -1
  1435. package/build-module/store/index.js.map +1 -1
  1436. package/build-module/store/private-actions.js +5 -2
  1437. package/build-module/store/private-actions.js.map +1 -1
  1438. package/build-module/store/private-keys.js.map +1 -1
  1439. package/build-module/store/private-selectors.js +113 -37
  1440. package/build-module/store/private-selectors.js.map +1 -1
  1441. package/build-module/store/reducer.js +11 -8
  1442. package/build-module/store/reducer.js.map +1 -1
  1443. package/build-module/store/selectors.js +116 -62
  1444. package/build-module/store/selectors.js.map +1 -1
  1445. package/build-module/store/undo-ignore.js.map +1 -1
  1446. package/build-module/store/utils.js.map +1 -1
  1447. package/build-module/utils/dom.js.map +1 -1
  1448. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  1449. package/build-module/utils/index.js.map +1 -1
  1450. package/build-module/utils/math.js.map +1 -1
  1451. package/build-module/utils/object.js +16 -0
  1452. package/build-module/utils/object.js.map +1 -1
  1453. package/build-module/utils/order-inserter-block-items.js +6 -2
  1454. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  1455. package/build-module/utils/pasting.js +6 -2
  1456. package/build-module/utils/pasting.js.map +1 -1
  1457. package/build-module/utils/selection.js.map +1 -1
  1458. package/build-module/utils/sorting.js.map +1 -1
  1459. package/build-module/utils/transform-styles/index.js.map +1 -1
  1460. package/build-module/utils/use-notify-copy.js.map +1 -1
  1461. package/build-style/content-rtl.css +77 -86
  1462. package/build-style/content.css +77 -86
  1463. package/build-style/default-editor-styles-rtl.css +1 -1
  1464. package/build-style/default-editor-styles.css +1 -1
  1465. package/build-style/style-rtl.css +158 -242
  1466. package/build-style/style.css +158 -242
  1467. package/package.json +32 -33
  1468. package/src/components/alignment-control/ui.js +3 -1
  1469. package/src/components/block-bindings-toolbar-indicator/style.scss +2 -5
  1470. package/src/components/block-canvas/style.scss +1 -3
  1471. package/src/components/block-draggable/test/helpers.native.js +8 -8
  1472. package/src/components/block-edit/context.js +1 -0
  1473. package/src/components/block-edit/index.js +4 -0
  1474. package/src/components/block-inspector/index.js +7 -6
  1475. package/src/components/block-list/block.js +47 -35
  1476. package/src/components/block-list/block.native.js +3 -2
  1477. package/src/components/block-list/content.scss +46 -20
  1478. package/src/components/block-list/index.js +26 -10
  1479. package/src/components/block-list/index.native.js +1 -6
  1480. package/src/components/block-list/use-block-props/index.js +17 -5
  1481. package/src/components/block-list/use-block-props/use-block-refs.js +17 -57
  1482. package/src/components/block-list/use-block-props/use-focus-first-element.js +7 -3
  1483. package/src/components/block-list/use-block-props/use-is-hovered.js +11 -16
  1484. package/src/components/block-mover/index.native.js +3 -1
  1485. package/src/components/block-patterns-list/style.scss +1 -3
  1486. package/src/components/block-patterns-paging/index.js +4 -0
  1487. package/src/components/block-preview/style.scss +13 -15
  1488. package/src/components/block-rename/modal.js +17 -13
  1489. package/src/components/block-rename/rename-control.js +8 -1
  1490. package/src/components/block-settings-menu/block-settings-dropdown.js +1 -51
  1491. package/src/components/block-switcher/pattern-transformations-menu.js +3 -1
  1492. package/src/components/block-switcher/use-transformed-patterns.js +6 -2
  1493. package/src/components/block-switcher/utils.js +14 -5
  1494. package/src/components/block-toolbar/index.js +26 -22
  1495. package/src/components/block-toolbar/style.scss +8 -11
  1496. package/src/components/block-toolbar/use-has-block-toolbar.js +26 -19
  1497. package/src/components/block-tools/block-selection-button.js +55 -43
  1498. package/src/components/block-tools/index.js +3 -1
  1499. package/src/components/block-tools/use-show-block-tools.js +36 -51
  1500. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -1
  1501. package/src/components/block-variation-picker/content.scss +22 -72
  1502. package/src/components/block-variation-picker/index.js +3 -2
  1503. package/src/components/block-variation-transforms/index.js +6 -2
  1504. package/src/components/button-block-appender/index.native.js +16 -1
  1505. package/src/components/default-block-appender/content.scss +1 -1
  1506. package/src/components/editor-styles/index.js +4 -2
  1507. package/src/components/floating-toolbar/index.native.js +5 -2
  1508. package/src/components/global-styles/background-panel.js +31 -29
  1509. package/src/components/global-styles/color-panel.js +3 -1
  1510. package/src/components/global-styles/dimensions-panel.js +18 -1
  1511. package/src/components/global-styles/hooks.js +2 -0
  1512. package/src/components/global-styles/style.scss +2 -8
  1513. package/src/components/global-styles/test/use-global-styles-output.js +8 -17
  1514. package/src/components/global-styles/test/utils.js +21 -0
  1515. package/src/components/global-styles/typography-panel.js +27 -23
  1516. package/src/components/global-styles/use-global-styles-output.js +216 -192
  1517. package/src/components/global-styles/utils.js +55 -0
  1518. package/src/components/iframe/index.js +20 -27
  1519. package/src/components/image-editor/cropper.js +11 -2
  1520. package/src/components/image-editor/index.js +0 -2
  1521. package/src/components/inner-blocks/index.js +14 -1
  1522. package/src/components/inserter/block-patterns-tab/index.js +32 -68
  1523. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +9 -36
  1524. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  1525. package/src/components/inserter/block-types-tab.js +5 -0
  1526. package/src/components/inserter/category-tabs/index.js +74 -0
  1527. package/src/components/inserter/media-tab/index.js +1 -1
  1528. package/src/components/inserter/media-tab/media-panel.js +0 -22
  1529. package/src/components/inserter/media-tab/media-preview.js +15 -7
  1530. package/src/components/inserter/media-tab/media-tab.js +44 -83
  1531. package/src/components/inserter/menu.js +155 -122
  1532. package/src/components/inserter/style.scss +161 -217
  1533. package/src/components/inserter/tabs.js +12 -15
  1534. package/src/components/inspector-controls-tabs/styles-tab.js +1 -1
  1535. package/src/components/line-height-control/index.js +6 -2
  1536. package/src/components/link-control/search-item.js +9 -3
  1537. package/src/components/link-control/style.scss +10 -2
  1538. package/src/components/link-control/test/index.js +1 -1
  1539. package/src/components/list-view/block-select-button.js +73 -237
  1540. package/src/components/list-view/block.js +218 -28
  1541. package/src/components/list-view/index.js +1 -1
  1542. package/src/components/list-view/style.scss +20 -28
  1543. package/src/components/list-view/use-list-view-drop-zone.js +6 -1
  1544. package/src/components/list-view/utils.js +3 -1
  1545. package/src/components/media-placeholder/content.scss +0 -11
  1546. package/src/components/media-placeholder/index.js +3 -3
  1547. package/src/components/navigable-toolbar/index.js +3 -1
  1548. package/src/components/provider/block-refs-provider.js +3 -8
  1549. package/src/components/provider/test/use-block-sync.js +7 -0
  1550. package/src/components/provider/use-block-sync.js +3 -20
  1551. package/src/components/recursion-provider/index.js +2 -2
  1552. package/src/components/rich-text/README.md +4 -0
  1553. package/src/components/rich-text/content.js +26 -19
  1554. package/src/components/rich-text/event-listeners/before-input-rules.js +92 -0
  1555. package/src/components/rich-text/event-listeners/delete.js +53 -0
  1556. package/src/components/rich-text/event-listeners/enter.js +104 -0
  1557. package/src/components/rich-text/event-listeners/firefox-compat.js +31 -0
  1558. package/src/components/rich-text/event-listeners/index.js +56 -0
  1559. package/src/components/rich-text/event-listeners/input-events.js +13 -0
  1560. package/src/components/rich-text/event-listeners/input-rules.js +146 -0
  1561. package/src/components/rich-text/event-listeners/insert-replacement-text.js +28 -0
  1562. package/src/components/rich-text/event-listeners/paste-handler.js +169 -0
  1563. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +24 -0
  1564. package/src/components/rich-text/event-listeners/shortcuts.js +13 -0
  1565. package/src/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
  1566. package/src/components/rich-text/index.js +53 -36
  1567. package/src/components/rich-text/index.native.js +14 -1
  1568. package/src/components/rich-text/multiline.js +6 -2
  1569. package/src/components/rich-text/native/index.native.js +11 -0
  1570. package/src/components/rich-text/use-format-types.js +6 -2
  1571. package/src/components/segmented-text-control/index.js +63 -0
  1572. package/src/components/{writing-mode-control → segmented-text-control}/style.scss +2 -5
  1573. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -1
  1574. package/src/components/text-alignment-control/index.js +91 -0
  1575. package/src/components/text-alignment-control/stories/index.story.js +39 -0
  1576. package/src/components/text-decoration-control/index.js +20 -33
  1577. package/src/components/text-transform-control/index.js +17 -30
  1578. package/src/components/use-block-commands/index.js +46 -28
  1579. package/src/components/use-block-display-information/index.js +9 -3
  1580. package/src/components/use-on-block-drop/index.js +3 -1
  1581. package/src/components/use-paste-styles/index.js +2 -0
  1582. package/src/components/writing-flow/use-drag-selection.js +3 -1
  1583. package/src/components/writing-flow/use-tab-nav.js +3 -1
  1584. package/src/components/writing-mode-control/index.js +15 -28
  1585. package/src/hooks/background.js +2 -2
  1586. package/src/hooks/block-renaming.js +0 -33
  1587. package/src/hooks/content-lock-ui.js +5 -7
  1588. package/src/hooks/duotone.js +3 -1
  1589. package/src/hooks/index.js +5 -2
  1590. package/src/hooks/layout.js +57 -25
  1591. package/src/hooks/supports.js +24 -0
  1592. package/src/hooks/test/text-align.js +114 -0
  1593. package/src/hooks/test/use-typography-props.js +3 -1
  1594. package/src/hooks/text-align.js +178 -0
  1595. package/src/hooks/typography.js +2 -0
  1596. package/src/hooks/use-bindings-attributes.js +90 -161
  1597. package/src/hooks/use-typography-props.js +4 -1
  1598. package/src/hooks/use-zoom-out.js +25 -15
  1599. package/src/hooks/utils.js +57 -5
  1600. package/src/layouts/definitions.js +6 -6
  1601. package/src/layouts/grid.js +106 -47
  1602. package/src/private-apis.js +4 -2
  1603. package/src/store/actions.js +52 -12
  1604. package/src/store/private-actions.js +6 -3
  1605. package/src/store/private-selectors.js +155 -39
  1606. package/src/store/reducer.js +13 -23
  1607. package/src/store/selectors.js +162 -93
  1608. package/src/style.scss +1 -2
  1609. package/src/utils/object.js +16 -0
  1610. package/src/utils/order-inserter-block-items.js +6 -2
  1611. package/src/utils/pasting.js +6 -2
  1612. package/tsconfig.tsbuildinfo +1 -1
  1613. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -54
  1614. package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  1615. package/build/components/rich-text/use-before-input-rules.js +0 -98
  1616. package/build/components/rich-text/use-before-input-rules.js.map +0 -1
  1617. package/build/components/rich-text/use-delete.js +0 -64
  1618. package/build/components/rich-text/use-delete.js.map +0 -1
  1619. package/build/components/rich-text/use-enter.js +0 -109
  1620. package/build/components/rich-text/use-enter.js.map +0 -1
  1621. package/build/components/rich-text/use-firefox-compat.js +0 -44
  1622. package/build/components/rich-text/use-firefox-compat.js.map +0 -1
  1623. package/build/components/rich-text/use-input-events.js +0 -25
  1624. package/build/components/rich-text/use-input-events.js.map +0 -1
  1625. package/build/components/rich-text/use-input-rules.js +0 -139
  1626. package/build/components/rich-text/use-input-rules.js.map +0 -1
  1627. package/build/components/rich-text/use-insert-replacement-text.js +0 -38
  1628. package/build/components/rich-text/use-insert-replacement-text.js.map +0 -1
  1629. package/build/components/rich-text/use-paste-handler.js +0 -158
  1630. package/build/components/rich-text/use-paste-handler.js.map +0 -1
  1631. package/build/components/rich-text/use-remove-browser-shortcuts.js +0 -32
  1632. package/build/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  1633. package/build/components/rich-text/use-shortcuts.js +0 -25
  1634. package/build/components/rich-text/use-shortcuts.js.map +0 -1
  1635. package/build/components/rich-text/use-undo-automatic-change.js +0 -53
  1636. package/build/components/rich-text/use-undo-automatic-change.js.map +0 -1
  1637. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -47
  1638. package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
  1639. package/build-module/components/rich-text/use-before-input-rules.js +0 -92
  1640. package/build-module/components/rich-text/use-before-input-rules.js.map +0 -1
  1641. package/build-module/components/rich-text/use-delete.js +0 -57
  1642. package/build-module/components/rich-text/use-delete.js.map +0 -1
  1643. package/build-module/components/rich-text/use-enter.js +0 -102
  1644. package/build-module/components/rich-text/use-enter.js.map +0 -1
  1645. package/build-module/components/rich-text/use-firefox-compat.js +0 -37
  1646. package/build-module/components/rich-text/use-firefox-compat.js.map +0 -1
  1647. package/build-module/components/rich-text/use-input-events.js +0 -18
  1648. package/build-module/components/rich-text/use-input-events.js.map +0 -1
  1649. package/build-module/components/rich-text/use-input-rules.js +0 -132
  1650. package/build-module/components/rich-text/use-input-rules.js.map +0 -1
  1651. package/build-module/components/rich-text/use-insert-replacement-text.js +0 -32
  1652. package/build-module/components/rich-text/use-insert-replacement-text.js.map +0 -1
  1653. package/build-module/components/rich-text/use-paste-handler.js +0 -152
  1654. package/build-module/components/rich-text/use-paste-handler.js.map +0 -1
  1655. package/build-module/components/rich-text/use-remove-browser-shortcuts.js +0 -26
  1656. package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
  1657. package/build-module/components/rich-text/use-shortcuts.js +0 -18
  1658. package/build-module/components/rich-text/use-shortcuts.js.map +0 -1
  1659. package/build-module/components/rich-text/use-undo-automatic-change.js +0 -46
  1660. package/build-module/components/rich-text/use-undo-automatic-change.js.map +0 -1
  1661. package/src/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -55
  1662. package/src/components/rich-text/use-before-input-rules.js +0 -99
  1663. package/src/components/rich-text/use-delete.js +0 -59
  1664. package/src/components/rich-text/use-enter.js +0 -110
  1665. package/src/components/rich-text/use-firefox-compat.js +0 -39
  1666. package/src/components/rich-text/use-input-events.js +0 -19
  1667. package/src/components/rich-text/use-input-rules.js +0 -150
  1668. package/src/components/rich-text/use-insert-replacement-text.js +0 -31
  1669. package/src/components/rich-text/use-paste-handler.js +0 -180
  1670. package/src/components/rich-text/use-remove-browser-shortcuts.js +0 -29
  1671. package/src/components/rich-text/use-shortcuts.js +0 -19
  1672. package/src/components/rich-text/use-undo-automatic-change.js +0 -50
  1673. package/src/components/text-decoration-control/style.scss +0 -18
  1674. package/src/components/text-transform-control/style.scss +0 -18
@@ -54,6 +54,7 @@ const STYLE_ATTRIBUTES = {
54
54
  align: _supports.hasAlignSupport,
55
55
  borderColor: nameOrType => (0, _supports.hasBorderSupport)(nameOrType, 'color'),
56
56
  backgroundColor: _supports.hasBackgroundColorSupport,
57
+ textAlign: _supports.hasTextAlignSupport,
57
58
  textColor: _supports.hasTextColorSupport,
58
59
  gradient: _supports.hasGradientSupport,
59
60
  className: _supports.hasCustomClassNameSupport,
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_blocks","_data","_notices","_i18n","_store","_supports","hasSerializedBlocks","text","blocks","parse","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","hasAlignSupport","borderColor","nameOrType","hasBorderSupport","backgroundColor","hasBackgroundColorSupport","textColor","hasTextColorSupport","gradient","hasGradientSupport","className","hasCustomClassNameSupport","fontFamily","hasFontFamilySupport","fontSize","hasFontSizeSupport","layout","hasLayoutSupport","style","hasStyleSupport","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","useRegistry","useDispatch","blockEditorStore","createSuccessNotice","createWarningNotice","createErrorNotice","noticesStore","useCallback","html","window","navigator","clipboard","__","type","readText","error","copiedBlocks","batch","map","title","getBlockType","sprintf"],"sources":["@wordpress/block-editor/src/components/use-paste-styles/index.js"],"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"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASO,mBAAmBA,CAAEC,IAAI,EAAG;EACpC,IAAI;IACH,MAAMC,MAAM,GAAG,IAAAC,aAAK,EAAEF,IAAI,EAAE;MAC3BG,2BAA2B,EAAE,IAAI;MACjCC,mBAAmB,EAAE;IACtB,CAAE,CAAC;IACH,IAAKH,MAAM,CAACI,MAAM,KAAK,CAAC,IAAIJ,MAAM,CAAE,CAAC,CAAE,CAACK,IAAI,KAAK,eAAe,EAAG;MAClE;MACA,OAAO,KAAK;IACb;IACA,OAAO,IAAI;EACZ,CAAC,CAAC,OAAQC,GAAG,EAAG;IACf;IACA;IACA,OAAO,KAAK;EACb;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG;EACxBC,KAAK,EAAEC,yBAAe;EACtBC,WAAW,EAAIC,UAAU,I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C,CAC/BC,YAAY,EACZA,YAAY,CAAC4B,GAAG,CAAE,MAAMF,YAAY,CAAE,CAAC,CAAG,CAAC,EAC3CxB,qBACD,CAAC;MACF,CAAE,CAAC;IACJ,CAAC,MAAM;MACNO,QAAQ,CAACkB,KAAK,CAAE,MAAM;QACrB5B,gCAAgC,CAC/BC,YAAY,EACZ0B,YAAY,EACZxB,qBACD,CAAC;MACF,CAAE,CAAC;IACJ;IAEA,IAAKF,YAAY,CAACnC,MAAM,KAAK,CAAC,EAAG;MAChC,MAAMgE,KAAK,GAAG,IAAAC,oBAAY,EAAE9B,YAAY,CAAE,CAAC,CAAE,CAAClC,IAAK,CAAC,EAAE+D,KAAK;MAC3DhB,mBAAmB,CAClB,IAAAkB,aAAO;MACN;MACA,IAAAT,QAAE,EAAE,sBAAuB,CAAC,EAC5BO,KACD,CAAC,EACD;QAAEN,IAAI,EAAE;MAAW,CACpB,CAAC;IACF,CAAC,MAAM;MACNV,mBAAmB,CAClB,IAAAkB,aAAO;MACN;MACA,IAAAT,QAAE,EAAE,6BAA8B,CAAC,EACnCtB,YAAY,CAACnC,MACd,CAAC,EACD;QAAE0D,IAAI,EAAE;MAAW,CACpB,CAAC;IACF;EACD,CAAC,EACD,CACCd,QAAQ,CAACkB,KAAK,EACdzB,qBAAqB,EACrBW,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,CAEnB,CAAC;AACF"}
1
+ {"version":3,"names":["_element","require","_blocks","_data","_notices","_i18n","_store","_supports","hasSerializedBlocks","text","blocks","parse","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","hasAlignSupport","borderColor","nameOrType","hasBorderSupport","backgroundColor","hasBackgroundColorSupport","textAlign","hasTextAlignSupport","textColor","hasTextColorSupport","gradient","hasGradientSupport","className","hasCustomClassNameSupport","fontFamily","hasFontFamilySupport","fontSize","hasFontSizeSupport","layout","hasLayoutSupport","style","hasStyleSupport","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","useRegistry","useDispatch","blockEditorStore","createSuccessNotice","createWarningNotice","createErrorNotice","noticesStore","useCallback","html","window","navigator","clipboard","__","type","readText","error","copiedBlocks","batch","map","title","getBlockType","sprintf"],"sources":["@wordpress/block-editor/src/components/use-paste-styles/index.js"],"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\thasTextAlignSupport,\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\ttextAlign: hasTextAlignSupport,\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\tcreateError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BAAY,EAAE9B,YAAY,CAAE,CAAC,CAAE,CAACpC,IAAK,CAAC,EAAEiE,KAAK;MAC3DhB,mBAAmB,CAClB,IAAAkB,aAAO;MACN;MACA,IAAAT,QAAE,EAAE,sBAAuB,CAAC,EAC5BO,KACD,CAAC,EACD;QAAEN,IAAI,EAAE;MAAW,CACpB,CAAC;IACF,CAAC,MAAM;MACNV,mBAAmB,CAClB,IAAAkB,aAAO;MACN;MACA,IAAAT,QAAE,EAAE,6BAA8B,CAAC,EACnCtB,YAAY,CAACrC,MACd,CAAC,EACD;QAAE4D,IAAI,EAAE;MAAW,CACpB,CAAC;IACF;EACD,CAAC,EACD,CACCd,QAAQ,CAACkB,KAAK,EACdzB,qBAAqB,EACrBW,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,CAEnB,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","useResizeCanvas","deviceType","actualWidth","updateActualWidth","useState","window","innerWidth","useEffect","resizeListener","addEventListener","removeEventListener","getCanvasWidth","device","deviceWidth","marginValue","innerHeight","contentInlineStyles","height","marginVertical","marginHorizontal","width","marginTop","marginBottom","marginLeft","marginRight","borderRadius","border","overflowY"],"sources":["@wordpress/block-editor/src/components/use-resize-canvas/index.js"],"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 {\n\t\t\t\t\tmarginLeft: marginHorizontal,\n\t\t\t\t\tmarginRight: marginHorizontal,\n\t\t\t\t};\n\t\t}\n\t};\n\n\treturn contentInlineStyles( deviceType );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,eAAeA,CAAEC,UAAU,EAAG;EACrD,MAAM,CAAEC,WAAW,EAAEC,iBAAiB,CAAE,GAAG,IA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EAAE,iBAAiB;UAC/BC,MAAM,EAAE,gBAAgB;UACxBC,SAAS,EAAE;QACZ,CAAC;MACF;QACC,OAAO;UACNJ,UAAU,EAAEJ,gBAAgB;UAC5BK,WAAW,EAAEL;QACd,CAAC;IACH;EACD,CAAC;EAED,OAAOH,mBAAmB,CAAEf,UAAW,CAAC;AACzC"}
1
+ {"version":3,"names":["_element","require","useResizeCanvas","deviceType","actualWidth","updateActualWidth","useState","window","innerWidth","useEffect","resizeListener","addEventListener","removeEventListener","getCanvasWidth","device","deviceWidth","marginValue","innerHeight","contentInlineStyles","height","marginVertical","marginHorizontal","width","marginTop","marginBottom","marginLeft","marginRight","borderRadius","border","overflowY"],"sources":["@wordpress/block-editor/src/components/use-resize-canvas/index.js"],"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 {\n\t\t\t\t\tmarginLeft: marginHorizontal,\n\t\t\t\t\tmarginRight: marginHorizontal,\n\t\t\t\t};\n\t\t}\n\t};\n\n\treturn contentInlineStyles( deviceType );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,eAAeA,CAAEC,UAAU,EAAG;EACrD,MAAM,CAAEC,WAAW,EAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAEC,MAAM,CAACC,UAAW,CAAC;EAExE,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKN,UAAU,KAAK,SAAS,EAAG;MAC/B;IACD;IAEA,MAAMO,cAAc,GAAGA,CAAA,KAAML,iBAAiB,CAAEE,MAAM,CAACC,UAAW,CAAC;IACnED,MAAM,CAACI,gBAAgB,CAAE,QAAQ,EAAED,cAAe,CAAC;IAEnD,OAAO,MAAM;MACZH,MAAM,CAACK,mBAAmB,CAAE,QAAQ,EAAEF,cAAe,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,CAAEP,UAAU,CAAG,CAAC;EAEnB,MAAMU,cAAc,GAAKC,MAAM,IAAM;IACpC,IAAIC,WAAW;IAEf,QAASD,MAAM;MACd,KAAK,QAAQ;QACZC,WAAW,GAAG,GAAG;QACjB;MACD,KAAK,QAAQ;QACZA,WAAW,GAAG,GAAG;QACjB;MACD;QACC,OAAO,IAAI;IACb;IAEA,OAAOA,WAAW,GAAGX,WAAW,GAAGW,WAAW,GAAGX,WAAW;EAC7D,CAAC;EAED,MAAMY,WAAW,GAAGA,CAAA,KAAQT,MAAM,CAACU,WAAW,GAAG,GAAG,GAAG,EAAE,GAAG,EAAI;EAEhE,MAAMC,mBAAmB,GAAKJ,MAAM,IAAM;IACzC,MAAMK,MAAM,GAAGL,MAAM,KAAK,QAAQ,GAAG,OAAO,GAAG,QAAQ;IACvD,MAAMM,cAAc,GAAGJ,WAAW,CAAC,CAAC,GAAG,IAAI;IAC3C,MAAMK,gBAAgB,GAAG,MAAM;IAE/B,QAASP,MAAM;MACd,KAAK,QAAQ;MACb,KAAK,QAAQ;QACZ,OAAO;UACNQ,KAAK,EAAET,cAAc,CAAEC,MAAO,CAAC;UAC/B;UACA;UACAS,SAAS,EAAEH,cAAc;UACzBI,YAAY,EAAEJ,cAAc;UAC5BK,UAAU,EAAEJ,gBAAgB;UAC5BK,WAAW,EAAEL,gBAAgB;UAC7BF,MAAM;UACNQ,YAAY,EAAE,iBAAiB;UAC/BC,MAAM,EAAE,gBAAgB;UACxBC,SAAS,EAAE;QACZ,CAAC;MACF;QACC,OAAO;UACNJ,UAAU,EAAEJ,gBAAgB;UAC5BK,WAAW,EAAEL;QACd,CAAC;IACH;EACD,CAAC;EAED,OAAOH,mBAAmB,CAAEf,UAAW,CAAC;AACzC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_deprecated","_interopRequireDefault","_blockEdit","_store","_lockUnlock","useSettings","paths","clientId","useBlockEditContext","useSelect","select","unlock","blockEditorStore","getBlockSettings","useSetting","path","deprecated","since","alternative","note","value"],"sources":["@wordpress/block-editor/src/components/use-settings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Hook that retrieves the given settings for the block instance in use.\n *\n * It looks up the settings first in the block instance hierarchy.\n * If none are found, it'll look them up in the block editor settings.\n *\n * @param {string[]} paths The paths to the settings.\n * @return {any[]} Returns the values defined for the settings.\n * @example\n * ```js\n * const [ fixed, sticky ] = useSettings( 'position.fixed', 'position.sticky' );\n * ```\n */\nexport function useSettings( ...paths ) {\n\tconst { clientId = null } = useBlockEditContext();\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getBlockSettings(\n\t\t\t\tclientId,\n\t\t\t\t...paths\n\t\t\t),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ clientId, ...paths ]\n\t);\n}\n\n/**\n * Hook that retrieves the given setting for the block instance in use.\n *\n * It looks up the setting first in the block instance hierarchy.\n * If none is found, it'll look it up in the block editor settings.\n *\n * @param {string} path The path to the setting.\n * @return {any} Returns the value defined for the setting.\n * @deprecated 6.5.0 Use useSettings instead.\n * @example\n * ```js\n * const isEnabled = useSetting( 'typography.dropCap' );\n * ```\n */\nexport function useSetting( path ) {\n\tdeprecated( 'wp.blockEditor.useSetting', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useSettings',\n\t\tnote: 'The new useSettings function can retrieve multiple settings at once, with better performance.',\n\t} );\n\n\tconst [ value ] = useSettings( path );\n\treturn value;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAAE,GAAGC,KAAK,EAAG;EACvC,MAAM;IAAEC,QAAQ,GAAG;EAAK,CAAC,GAAG,IAAAC,8BAAmB,EAAC,CAAC;EACjD,OAAO,IAAAC,eAAS,EACbC,MAAM,IACP,IAAAC,kBAAM,EAAED,MAAM,CAAEE,YAAiB,CAAE,CAAC,CAACC,gBAAgB,CACpDN,QAAQ,EACR,GAAGD,KACJ,CAAC;EACF;EACA,CAAEC,QAAQ,EAAE,GAAGD,KAAK,CACrB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,UAAUA,CAAEC,IAAI,EAAG;EAClC,IAAAC,mBAAU,EAAE,2BAA2B,EAAE;IACxCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE,4BAA4B;IACzCC,IAAI,EAAE;EACP,CAAE,CAAC;EAEH,MAAM,CAAEC,KAAK,CAAE,GAAGf,WAAW,CAAEU,IAAK,CAAC;EACrC,OAAOK,KAAK;AACb"}
1
+ {"version":3,"names":["_data","require","_deprecated","_interopRequireDefault","_blockEdit","_store","_lockUnlock","useSettings","paths","clientId","useBlockEditContext","useSelect","select","unlock","blockEditorStore","getBlockSettings","useSetting","path","deprecated","since","alternative","note","value"],"sources":["@wordpress/block-editor/src/components/use-settings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditContext } from '../block-edit';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Hook that retrieves the given settings for the block instance in use.\n *\n * It looks up the settings first in the block instance hierarchy.\n * If none are found, it'll look them up in the block editor settings.\n *\n * @param {string[]} paths The paths to the settings.\n * @return {any[]} Returns the values defined for the settings.\n * @example\n * ```js\n * const [ fixed, sticky ] = useSettings( 'position.fixed', 'position.sticky' );\n * ```\n */\nexport function useSettings( ...paths ) {\n\tconst { clientId = null } = useBlockEditContext();\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getBlockSettings(\n\t\t\t\tclientId,\n\t\t\t\t...paths\n\t\t\t),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ clientId, ...paths ]\n\t);\n}\n\n/**\n * Hook that retrieves the given setting for the block instance in use.\n *\n * It looks up the setting first in the block instance hierarchy.\n * If none is found, it'll look it up in the block editor settings.\n *\n * @param {string} path The path to the setting.\n * @return {any} Returns the value defined for the setting.\n * @deprecated 6.5.0 Use useSettings instead.\n * @example\n * ```js\n * const isEnabled = useSetting( 'typography.dropCap' );\n * ```\n */\nexport function useSetting( path ) {\n\tdeprecated( 'wp.blockEditor.useSetting', {\n\t\tsince: '6.5',\n\t\talternative: 'wp.blockEditor.useSettings',\n\t\tnote: 'The new useSettings function can retrieve multiple settings at once, with better performance.',\n\t} );\n\n\tconst [ value ] = useSettings( path );\n\treturn value;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,WAAWA,CAAE,GAAGC,KAAK,EAAG;EACvC,MAAM;IAAEC,QAAQ,GAAG;EAAK,CAAC,GAAG,IAAAC,8BAAmB,EAAC,CAAC;EACjD,OAAO,IAAAC,eAAS,EACbC,MAAM,IACP,IAAAC,kBAAM,EAAED,MAAM,CAAEE,YAAiB,CAAE,CAAC,CAACC,gBAAgB,CACpDN,QAAQ,EACR,GAAGD,KACJ,CAAC;EACF;EACA,CAAEC,QAAQ,EAAE,GAAGD,KAAK,CACrB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,UAAUA,CAAEC,IAAI,EAAG;EAClC,IAAAC,mBAAU,EAAE,2BAA2B,EAAE;IACxCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE,4BAA4B;IACzCC,IAAI,EAAE;EACP,CAAE,CAAC;EAEH,MAAM,CAAEC,KAAK,CAAE,GAAGf,WAAW,CAAEU,IAAK,CAAC;EACrC,OAAOK,KAAK;AACb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_blocks","_store","UBE_INCOMPATIBLE_BLOCKS","useUnsupportedBlockEditor","clientId","useSelect","select","getBlock","getSettings","blockEditorStore","capabilities","block","blockAttributes","attributes","blockDetails","blockName","name","blockContent","serialize","originalName","content","originalContent","isUnsupportedBlockEditorSupported","unsupportedBlockEditor","canEnableUnsupportedBlockEditor","isEditableInUnsupportedBlockEditor","includes"],"sources":["@wordpress/block-editor/src/components/use-unsupported-block-editor/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n// Blocks that can't be edited through the Unsupported block editor identified by their name.\nconst UBE_INCOMPATIBLE_BLOCKS = [ 'core/block' ];\n\n/**\n * Hook that retrieves the settings to determine if the\n * Unsupported Block Editor can be used in a specific block.\n *\n * @param {string} clientId Client ID of block.\n * @return {Object} Unsupported block editor settings.\n */\nexport default function useUnsupportedBlockEditor( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst { capabilities } = getSettings();\n\n\t\t\tconst block = getBlock( clientId );\n\t\t\tconst blockAttributes = block?.attributes || {};\n\n\t\t\tconst blockDetails = {\n\t\t\t\tblockName: block?.name,\n\t\t\t\tblockContent: serialize( block ? [ block ] : [] ),\n\t\t\t};\n\n\t\t\t// If the block is unsupported, use the `original` attributes to identify the block's name.\n\t\t\tif ( blockDetails.blockName === 'core/missing' ) {\n\t\t\t\tblockDetails.blockName = blockAttributes.originalName;\n\t\t\t\tblockDetails.blockContent =\n\t\t\t\t\tblockDetails.blockName === 'core/freeform'\n\t\t\t\t\t\t? blockAttributes.content\n\t\t\t\t\t\t: block?.originalContent;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisUnsupportedBlockEditorSupported:\n\t\t\t\t\tcapabilities?.unsupportedBlockEditor === true,\n\t\t\t\tcanEnableUnsupportedBlockEditor:\n\t\t\t\t\tcapabilities?.canEnableUnsupportedBlockEditor === true,\n\t\t\t\tisEditableInUnsupportedBlockEditor:\n\t\t\t\t\t! UBE_INCOMPATIBLE_BLOCKS.includes(\n\t\t\t\t\t\tblockDetails.blockName\n\t\t\t\t\t),\n\t\t\t\t...blockDetails,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA,MAAMG,uBAAuB,GAAG,CAAE,YAAY,CAAE;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,yBAAyBA,CAAEC,QAAQ,EAAG;EAC7D,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MAAEC,QAAQ;MAAEC;IAAY,CAAC,GAAGF,MAAM,CAAEG,YAAiB,CAAC;IAC5D,MAAM;MAAEC;IAAa,CAAC,GAAGF,WAAW,CAAC,CAAC;IAEtC,MAAMG,KAAK,GAAGJ,QAAQ,CAAEH,QAAS,CAAC;IAClC,MAAMQ,eAAe,GAAGD,KAAK,EAAEE,UAAU,IAAI,CAAC,CAAC;IAE/C,MAAMC,YAAY,GAAG;MACpBC,SAAS,EAAEJ,KAAK,EAAEK,IAAI;MACtBC,YAAY,EAAE,IAAAC,iBAAS,EAAEP,KAAK,GAAG,CAAEA,KAAK,CAAE,GAAG,EAAG;IACjD,CAAC;;IAED;IACA,IAAKG,YAAY,CAACC,SAAS,KAAK,cAAc,EAAG;MAChDD,YAAY,CAACC,SAAS,GAAGH,eAAe,CAACO,YAAY;MACrDL,YAAY,CAACG,YAAY,GACxBH,YAAY,CAACC,SAAS,KAAK,eAAe,GACvCH,eAAe,CAACQ,OAAO,GACvBT,KAAK,EAAEU,eAAe;IAC3B;IAEA,OAAO;MACNC,iCAAiC,EAChCZ,YAAY,EAAEa,sBAAsB,KAAK,IAAI;MAC9CC,+BAA+B,EAC9Bd,YAAY,EAAEc,+BAA+B,KAAK,IAAI;MACvDC,kCAAkC,EACjC,CAAEvB,uBAAuB,CAACwB,QAAQ,CACjCZ,YAAY,CAACC,SACd,CAAC;MACF,GAAGD;IACJ,CAAC;EACF,CAAC,EACD,CAAEV,QAAQ,CACX,CAAC;AACF"}
1
+ {"version":3,"names":["_data","require","_blocks","_store","UBE_INCOMPATIBLE_BLOCKS","useUnsupportedBlockEditor","clientId","useSelect","select","getBlock","getSettings","blockEditorStore","capabilities","block","blockAttributes","attributes","blockDetails","blockName","name","blockContent","serialize","originalName","content","originalContent","isUnsupportedBlockEditorSupported","unsupportedBlockEditor","canEnableUnsupportedBlockEditor","isEditableInUnsupportedBlockEditor","includes"],"sources":["@wordpress/block-editor/src/components/use-unsupported-block-editor/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n// Blocks that can't be edited through the Unsupported block editor identified by their name.\nconst UBE_INCOMPATIBLE_BLOCKS = [ 'core/block' ];\n\n/**\n * Hook that retrieves the settings to determine if the\n * Unsupported Block Editor can be used in a specific block.\n *\n * @param {string} clientId Client ID of block.\n * @return {Object} Unsupported block editor settings.\n */\nexport default function useUnsupportedBlockEditor( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst { capabilities } = getSettings();\n\n\t\t\tconst block = getBlock( clientId );\n\t\t\tconst blockAttributes = block?.attributes || {};\n\n\t\t\tconst blockDetails = {\n\t\t\t\tblockName: block?.name,\n\t\t\t\tblockContent: serialize( block ? [ block ] : [] ),\n\t\t\t};\n\n\t\t\t// If the block is unsupported, use the `original` attributes to identify the block's name.\n\t\t\tif ( blockDetails.blockName === 'core/missing' ) {\n\t\t\t\tblockDetails.blockName = blockAttributes.originalName;\n\t\t\t\tblockDetails.blockContent =\n\t\t\t\t\tblockDetails.blockName === 'core/freeform'\n\t\t\t\t\t\t? blockAttributes.content\n\t\t\t\t\t\t: block?.originalContent;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisUnsupportedBlockEditorSupported:\n\t\t\t\t\tcapabilities?.unsupportedBlockEditor === true,\n\t\t\t\tcanEnableUnsupportedBlockEditor:\n\t\t\t\t\tcapabilities?.canEnableUnsupportedBlockEditor === true,\n\t\t\t\tisEditableInUnsupportedBlockEditor:\n\t\t\t\t\t! UBE_INCOMPATIBLE_BLOCKS.includes(\n\t\t\t\t\t\tblockDetails.blockName\n\t\t\t\t\t),\n\t\t\t\t...blockDetails,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA,MAAMG,uBAAuB,GAAG,CAAE,YAAY,CAAE;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,yBAAyBA,CAAEC,QAAQ,EAAG;EAC7D,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MAAEC,QAAQ;MAAEC;IAAY,CAAC,GAAGF,MAAM,CAAEG,YAAiB,CAAC;IAC5D,MAAM;MAAEC;IAAa,CAAC,GAAGF,WAAW,CAAC,CAAC;IAEtC,MAAMG,KAAK,GAAGJ,QAAQ,CAAEH,QAAS,CAAC;IAClC,MAAMQ,eAAe,GAAGD,KAAK,EAAEE,UAAU,IAAI,CAAC,CAAC;IAE/C,MAAMC,YAAY,GAAG;MACpBC,SAAS,EAAEJ,KAAK,EAAEK,IAAI;MACtBC,YAAY,EAAE,IAAAC,iBAAS,EAAEP,KAAK,GAAG,CAAEA,KAAK,CAAE,GAAG,EAAG;IACjD,CAAC;;IAED;IACA,IAAKG,YAAY,CAACC,SAAS,KAAK,cAAc,EAAG;MAChDD,YAAY,CAACC,SAAS,GAAGH,eAAe,CAACO,YAAY;MACrDL,YAAY,CAACG,YAAY,GACxBH,YAAY,CAACC,SAAS,KAAK,eAAe,GACvCH,eAAe,CAACQ,OAAO,GACvBT,KAAK,EAAEU,eAAe;IAC3B;IAEA,OAAO;MACNC,iCAAiC,EAChCZ,YAAY,EAAEa,sBAAsB,KAAK,IAAI;MAC9CC,+BAA+B,EAC9Bd,YAAY,EAAEc,+BAA+B,KAAK,IAAI;MACvDC,kCAAkC,EACjC,CAAEvB,uBAAuB,CAACwB,QAAQ,CACjCZ,YAAY,CAACC,SACd,CAAC;MACF,GAAGD;IACJ,CAAC;EACF,CAAC,EACD,CAAEV,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_default","exports","default","_react","createElement","SVG","viewBox","xmlns","Path","d","fill"],"sources":["@wordpress/block-editor/src/components/video-player/gridicon-play.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nexport default (\n\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<Path\n\t\t\td=\"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm-2 14.5v-9l6 4.5z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</SVG>\n);\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMC,IAAAC,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAO,GAAG;EAACC,OAAO,EAAC,WAAW;EAACC,KAAK,EAAC;AAA4B,GAC1D,IAAAJ,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAU,IAAI;EACJC,CAAC,EAAC,6DAA6D;EAC/DC,IAAI,EAAC;AAAO,CACZ,CACG,CAAC"}
1
+ {"version":3,"names":["_components","require","_default","exports","default","_react","createElement","SVG","viewBox","xmlns","Path","d","fill"],"sources":["@wordpress/block-editor/src/components/video-player/gridicon-play.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nexport default (\n\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t<Path\n\t\t\td=\"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm-2 14.5v-9l6 4.5z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</SVG>\n);\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMC,IAAAC,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAO,GAAG;EAACC,OAAO,EAAC,WAAW;EAACC,KAAK,EAAC;AAA4B,GAC1D,IAAAJ,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAU,IAAI;EACJC,CAAC,EAAC,6DAA6D;EAC/DC,IAAI,EAAC;AAAO,CACZ,CACG,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_components","_i18n","_reactNative","_reactNativeVideo","_interopRequireDefault","_styles","_gridiconPlay","VIDEO_ASPECT_RATIO","exports","Video","Component","constructor","arguments","isIOS","Platform","OS","state","isFullScreen","videoContainerHeight","onPressPlay","bind","onVideoLayout","event","height","nativeEvent","layout","setState","player","presentFullscreenPlayer","source","props","uri","openURL","url","Linking","canOpenURL","then","supported","Alert","alert","__","window","console","warn","catch","err","error","render","isSelected","style","showPlayButton","_react","createElement","View","styles","videoContainer","default","ref","controls","ignoreSilentSwitch","paused","onLayout","onFullscreenPlayerWillPresent","onFullscreenPlayerDidDismiss","TouchableOpacity","disabled","onPress","overlayContainer","blackOverlay","Icon","icon","PlayIcon","playIcon","size","_default"],"sources":["@wordpress/block-editor/src/components/video-player/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { View, TouchableOpacity, Platform, Linking, Alert } from 'react-native';\nimport { default as VideoPlayer } from 'react-native-video';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport PlayIcon from './gridicon-play';\n\n// Default Video ratio 16:9\nexport const VIDEO_ASPECT_RATIO = 16 / 9;\n\nclass Video extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.state = {\n\t\t\tisFullScreen: false,\n\t\t\tvideoContainerHeight: 0,\n\t\t};\n\t\tthis.onPressPlay = this.onPressPlay.bind( this );\n\t\tthis.onVideoLayout = this.onVideoLayout.bind( this );\n\t}\n\n\tonVideoLayout( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.videoContainerHeight ) {\n\t\t\tthis.setState( { videoContainerHeight: height } );\n\t\t}\n\t}\n\n\tonPressPlay() {\n\t\tif ( this.isIOS ) {\n\t\t\tif ( this.player ) {\n\t\t\t\tthis.player.presentFullscreenPlayer();\n\t\t\t}\n\t\t} else {\n\t\t\tconst { source } = this.props;\n\t\t\tif ( source && source.uri ) {\n\t\t\t\tthis.openURL( source.uri );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Tries opening the URL outside of the app\n\topenURL( url ) {\n\t\tLinking.canOpenURL( url )\n\t\t\t.then( ( supported ) => {\n\t\t\t\tif ( ! supported ) {\n\t\t\t\t\tAlert.alert(\n\t\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'No application can handle this request. Please install a Web browser.'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\twindow.console.warn(\n\t\t\t\t\t\t'No application found that can open the video with URL: ' +\n\t\t\t\t\t\t\turl\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn Linking.openURL( url );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( err ) => {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t__( 'An unknown error occurred. Please try again.' )\n\t\t\t\t);\n\t\t\t\twindow.console.error(\n\t\t\t\t\t'An error occurred while opening the video URL: ' + url,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\trender() {\n\t\tconst { isSelected, style } = this.props;\n\t\tconst { isFullScreen, videoContainerHeight } = this.state;\n\t\tconst showPlayButton = videoContainerHeight > 0;\n\n\t\treturn (\n\t\t\t<View style={ styles.videoContainer }>\n\t\t\t\t<VideoPlayer\n\t\t\t\t\t{ ...this.props }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis.player = ref;\n\t\t\t\t\t} }\n\t\t\t\t\t// Using built-in player controls is messing up the layout on iOS.\n\t\t\t\t\t// So we are setting controls=false and adding a play button that\n\t\t\t\t\t// will trigger presentFullscreenPlayer()\n\t\t\t\t\tcontrols={ false }\n\t\t\t\t\tignoreSilentSwitch={ 'ignore' }\n\t\t\t\t\tpaused={ ! isFullScreen }\n\t\t\t\t\tonLayout={ this.onVideoLayout }\n\t\t\t\t\tonFullscreenPlayerWillPresent={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: true } );\n\t\t\t\t\t} }\n\t\t\t\t\tonFullscreenPlayerDidDismiss={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: false } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ showPlayButton && (\n\t\t\t\t\t// If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons\n\t\t\t\t\t// even if we set controls={ false }, so we are adding our play button as a sibling overlay view.\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ this.onPressPlay }\n\t\t\t\t\t\tstyle={ [ style, styles.overlayContainer ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.blackOverlay } />\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ PlayIcon }\n\t\t\t\t\t\t\tstyle={ styles.playIcon }\n\t\t\t\t\t\t\tsize={ styles.playIcon.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default Video;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,aAAA,GAAAF,sBAAA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MAC/ByC,6BAA6B,EAAGA,CAAA,KAAM;QACrC,IAAI,CAACpC,QAAQ,CAAE;UAAET,YAAY,EAAE;QAAK,CAAE,CAAC;MACxC,CAAG;MACH8C,4BAA4B,EAAGA,CAAA,KAAM;QACpC,IAAI,CAACrC,QAAQ,CAAE;UAAET,YAAY,EAAE;QAAM,CAAE,CAAC;MACzC;IAAG,CACH,CAAC,EACAiC,cAAc;IACf;IACA;IACA,IAAAC,MAAA,CAAAC,aAAA,EAAClD,YAAA,CAAA8D,gBAAgB;MAChBC,QAAQ,EAAG,CAAEjB,UAAY;MACzBkB,OAAO,EAAG,IAAI,CAAC/C,WAAa;MAC5B8B,KAAK,EAAG,CAAEA,KAAK,EAAEK,eAAM,CAACa,gBAAgB;IAAI,GAE5C,IAAAhB,MAAA,CAAAC,aAAA,EAAClD,YAAA,CAAAmD,IAAI;MAACJ,KAAK,EAAGK,eAAM,CAACc;IAAc,CAAE,CAAC,EACtC,IAAAjB,MAAA,CAAAC,aAAA,EAACpD,WAAA,CAAAqE,IAAI;MACJC,IAAI,EAAGC,qBAAU;MACjBtB,KAAK,EAAGK,eAAM,CAACkB,QAAU;MACzBC,IAAI,EAAGnB,eAAM,CAACkB,QAAQ,CAACC;IAAM,CAC7B,CACgB,CAEd,CAAC;EAET;AACD;AAAC,IAAAC,QAAA,GAAAlE,OAAA,CAAAgD,OAAA,GAEc/C,KAAK"}
1
+ {"version":3,"names":["_element","require","_components","_i18n","_reactNative","_reactNativeVideo","_interopRequireDefault","_styles","_gridiconPlay","VIDEO_ASPECT_RATIO","exports","Video","Component","constructor","arguments","isIOS","Platform","OS","state","isFullScreen","videoContainerHeight","onPressPlay","bind","onVideoLayout","event","height","nativeEvent","layout","setState","player","presentFullscreenPlayer","source","props","uri","openURL","url","Linking","canOpenURL","then","supported","Alert","alert","__","window","console","warn","catch","err","error","render","isSelected","style","showPlayButton","_react","createElement","View","styles","videoContainer","default","ref","controls","ignoreSilentSwitch","paused","onLayout","onFullscreenPlayerWillPresent","onFullscreenPlayerDidDismiss","TouchableOpacity","disabled","onPress","overlayContainer","blackOverlay","Icon","icon","PlayIcon","playIcon","size","_default"],"sources":["@wordpress/block-editor/src/components/video-player/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { View, TouchableOpacity, Platform, Linking, Alert } from 'react-native';\nimport { default as VideoPlayer } from 'react-native-video';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport PlayIcon from './gridicon-play';\n\n// Default Video ratio 16:9\nexport const VIDEO_ASPECT_RATIO = 16 / 9;\n\nclass Video extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.state = {\n\t\t\tisFullScreen: false,\n\t\t\tvideoContainerHeight: 0,\n\t\t};\n\t\tthis.onPressPlay = this.onPressPlay.bind( this );\n\t\tthis.onVideoLayout = this.onVideoLayout.bind( this );\n\t}\n\n\tonVideoLayout( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.videoContainerHeight ) {\n\t\t\tthis.setState( { videoContainerHeight: height } );\n\t\t}\n\t}\n\n\tonPressPlay() {\n\t\tif ( this.isIOS ) {\n\t\t\tif ( this.player ) {\n\t\t\t\tthis.player.presentFullscreenPlayer();\n\t\t\t}\n\t\t} else {\n\t\t\tconst { source } = this.props;\n\t\t\tif ( source && source.uri ) {\n\t\t\t\tthis.openURL( source.uri );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Tries opening the URL outside of the app\n\topenURL( url ) {\n\t\tLinking.canOpenURL( url )\n\t\t\t.then( ( supported ) => {\n\t\t\t\tif ( ! supported ) {\n\t\t\t\t\tAlert.alert(\n\t\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'No application can handle this request. Please install a Web browser.'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\twindow.console.warn(\n\t\t\t\t\t\t'No application found that can open the video with URL: ' +\n\t\t\t\t\t\t\turl\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn Linking.openURL( url );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( err ) => {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t__( 'An unknown error occurred. Please try again.' )\n\t\t\t\t);\n\t\t\t\twindow.console.error(\n\t\t\t\t\t'An error occurred while opening the video URL: ' + url,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\trender() {\n\t\tconst { isSelected, style } = this.props;\n\t\tconst { isFullScreen, videoContainerHeight } = this.state;\n\t\tconst showPlayButton = videoContainerHeight > 0;\n\n\t\treturn (\n\t\t\t<View style={ styles.videoContainer }>\n\t\t\t\t<VideoPlayer\n\t\t\t\t\t{ ...this.props }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis.player = ref;\n\t\t\t\t\t} }\n\t\t\t\t\t// Using built-in player controls is messing up the layout on iOS.\n\t\t\t\t\t// So we are setting controls=false and adding a play button that\n\t\t\t\t\t// will trigger presentFullscreenPlayer()\n\t\t\t\t\tcontrols={ false }\n\t\t\t\t\tignoreSilentSwitch={ 'ignore' }\n\t\t\t\t\tpaused={ ! isFullScreen }\n\t\t\t\t\tonLayout={ this.onVideoLayout }\n\t\t\t\t\tonFullscreenPlayerWillPresent={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: true } );\n\t\t\t\t\t} }\n\t\t\t\t\tonFullscreenPlayerDidDismiss={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: false } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ showPlayButton && (\n\t\t\t\t\t// If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons\n\t\t\t\t\t// even if we set controls={ false }, so we are adding our play button as a sibling overlay view.\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ this.onPressPlay }\n\t\t\t\t\t\tstyle={ [ style, styles.overlayContainer ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.blackOverlay } />\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ PlayIcon }\n\t\t\t\t\t\t\tstyle={ styles.playIcon }\n\t\t\t\t\t\t\tsize={ styles.playIcon.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default Video;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,aAAA,GAAAF,sBAAA,CAAAL,OAAA;AAjBA;AACA;AACA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACO,MAAMQ,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,EAAE,GAAG,CAAC;AAExC,MAAME,KAAK,SAASC,kBAAS,CAAC;EAC7BC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IACrB,IAAI,CAACC,KAAK,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;IAClC,IAAI,CAACC,KAAK,GAAG;MACZC,YAAY,EAAE,KAAK;MACnBC,oBAAoB,EAAE;IACvB,CAAC;IACD,IAAI,CAACC,WAAW,GAAG,IAAI,CAACA,WAAW,CAACC,IAAI,CAAE,IAAK,CAAC;IAChD,IAAI,CAACC,aAAa,GAAG,IAAI,CAAC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YAAA,CAAAmD,IAAI;MAACJ,KAAK,EAAGK,eAAM,CAACc;IAAc,CAAE,CAAC,EACtC,IAAAjB,MAAA,CAAAC,aAAA,EAACpD,WAAA,CAAAqE,IAAI;MACJC,IAAI,EAAGC,qBAAU;MACjBtB,KAAK,EAAGK,eAAM,CAACkB,QAAU;MACzBC,IAAI,EAAGnB,eAAM,CAACkB,QAAQ,CAACC;IAAM,CAC7B,CACgB,CAEd,CAAC;EAET;AACD;AAAC,IAAAC,QAAA,GAAAlE,OAAA,CAAAgD,OAAA,GAEc/C,KAAK","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_components","_i18n","_icons","Warning","className","actions","children","secondaryActions","_react","createElement","style","display","all","classnames","Children","count","map","action","i","key","DropdownMenu","icon","moreVertical","label","__","popoverProps","position","noIcons","MenuGroup","item","pos","MenuItem","onClick","title","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/warning/index.js"],"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 { moreVertical } 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={ moreVertical }\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"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA,SAASK,OAAOA,CAAE;EAAEC,SAAS;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,EAAG;EACtE,OACC,IAAAC,MAAA,CAAAC,aAAA;IAAKC,KAAK,EAAG;MAAEC,OAAO,EAAE,UAAU;MAAEC,GAAG,EAAE;IAAU;EAAG,GACrD,IAAAJ,MAAA,CAAAC,aAAA;IAAKL,SAAS,EAAG,IAAAS,mBAAU,EAAET,SAAS,EAAE,sBAAuB;EAAG,GACjE,IAAAI,MAAA,CAAAC,aAAA;IAAKL,SAAS,EAAC;EAAgC,GAC9C,IAAAI,MAAA,CAAAC,aAAA;IAAGL,SAAS,EAAC;EAA+B,GACzCE,QACA,CAAC,EAEF,CAAEQ,iBAAQ,CAACC,KAAK,CAAEV,OAAQ,CAAC,GAAG,CAAC,IAAIE,gBAAgB,KACpD,IAAAC,MAAA,CAAAC,aAAA;IAAKL,SAAS,EAAC;EAA+B,GAC3CU,iBAAQ,CAACC,KAAK,CAAEV,OAAQ,CAAC,GAAG,CAAC,IAC9BS,iBAAQ,CAACE,GAAG,CAAEX,OAAO,EAAE,CAAEY,MAAM,EAAEC,CAAC,KACjC,IAAAV,MAAA,CAAAC,aAAA;IACCU,GAAG,EAAGD,CAAG;IACTd,SAAS,EAAC;EAA8B,GAEtCa,MACG,CACL,CAAC,EACFV,gBAAgB,IACjB,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAoB,YAAY;IACZhB,SAAS,EAAC,iCAAiC;IAC3CiB,IAAI,EAAGC,mBAAc;IACrBC,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BC,YAAY,EAAG;MACdC,QAAQ,EAAE,aAAa;MACvBtB,SAAS,EACR;IACF,CAAG;IACHuB,OAAO;EAAA,GAEL,MACD,IAAAnB,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAA4B,SAAS,QACPrB,gBAAgB,CAACS,GAAG,CACrB,CAAEa,IAAI,EAAEC,GAAG,KACV,IAAAtB,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAA+B,QAAQ;IACRC,OAAO,EAAGH,IAAI,CAACG,OAAS;IACxBb,GAAG,EAAGW;EAAK,GAETD,IAAI,CAACI,KACE,CAEZ,CACU,CAEC,CAEX,CAEF,CACD,CACD,CAAC;AAER;;AAEA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGejC,OAAO"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_components","_i18n","_icons","Warning","className","actions","children","secondaryActions","_react","createElement","style","display","all","classnames","Children","count","map","action","i","key","DropdownMenu","icon","moreVertical","label","__","popoverProps","position","noIcons","MenuGroup","item","pos","MenuItem","onClick","title","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/warning/index.js"],"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 { moreVertical } 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={ moreVertical }\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"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA,SAASK,OAAOA,CAAE;EAAEC,SAAS;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,EAAG;EACtE,OACC,IAAAC,MAAA,CAAAC,aAAA;IAAKC,KAAK,EAAG;MAAEC,OAAO,EAAE,UAAU;MAAEC,GAAG,EAAE;IAAU;EAAG,GACrD,IAAAJ,MAAA,CAAAC,aAAA;IAAKL,SAAS,EAAG,IAAAS,mBAAU,EAAET,SAAS,EAAE,sBAAuB;EAAG,GACjE,IAAAI,MAAA,CAAAC,aAAA;IAAKL,SAAS,EAAC;EAAgC,GAC9C,IAAAI,MAAA,CAAAC,aAAA;IAAGL,SAAS,EAAC;EAA+B,GACzCE,QACA,CAAC,EAEF,CAAEQ,iBAAQ,CAACC,KAAK,CAAEV,OAAQ,CAAC,GAAG,CAAC,IAAIE,gBAAgB,KACpD,IAAAC,MAAA,CAAAC,aAAA;IAAKL,SAAS,EAAC;EAA+B,GAC3CU,iBAAQ,CAACC,KAAK,CAAEV,OAAQ,CAAC,GAAG,CAAC,IAC9BS,iBAAQ,CAACE,GAAG,CAAEX,OAAO,EAAE,CAAEY,MAAM,EAAEC,CAAC,KACjC,IAAAV,MAAA,CAAAC,aAAA;IACCU,GAAG,EAAGD,CAAG;IACTd,SAAS,EAAC;EAA8B,GAEtCa,MACG,CACL,CAAC,EACFV,gBAAgB,IACjB,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAoB,YAAY;IACZhB,SAAS,EAAC,iCAAiC;IAC3CiB,IAAI,EAAGC,mBAAc;IACrBC,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BC,YAAY,EAAG;MACdC,QAAQ,EAAE,aAAa;MACvBtB,SAAS,EACR;IACF,CAAG;IACHuB,OAAO;EAAA,GAEL,MACD,IAAAnB,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAA4B,SAAS,QACPrB,gBAAgB,CAACS,GAAG,CACrB,CAAEa,IAAI,EAAEC,GAAG,KACV,IAAAtB,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAA+B,QAAQ;IACRC,OAAO,EAAGH,IAAI,CAACG,OAAS;IACxBb,GAAG,EAAGW;EAAK,GAETD,IAAI,CAACI,KACE,CAEZ,CACU,CAEC,CAEX,CAEF,CACD,CACD,CAAC;AAER;;AAEA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGejC,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_components","_compose","_blocks","_style","_interopRequireDefault","Warning","actions","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","containerStyle","extraContainerStyle","titleStyle","extraTitleStyle","messageStyle","extraMessageStyle","viewProps","normalizeIconObject","internalIconClass","styles","container","containerDark","titleDark","messageDark","_react","createElement","View","style","Icon","className","src","Text","_default","exports","default","withPreferredColorScheme"],"sources":["@wordpress/block-editor/src/components/warning/index.native.js"],"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\tactions,\n\ttitle,\n\tmessage,\n\ticon,\n\ticonClass,\n\tpreferredColorScheme,\n\tgetStylesFromColorScheme,\n\tcontainerStyle: extraContainerStyle,\n\ttitleStyle: extraTitleStyle,\n\tmessageStyle: extraMessageStyle,\n\t...viewProps\n} ) {\n\ticon = icon && normalizeIconObject( icon );\n\tconst internalIconClass = 'warning-icon' + '-' + preferredColorScheme;\n\n\tconst containerStyle = [\n\t\tgetStylesFromColorScheme( styles.container, styles.containerDark ),\n\t\textraContainerStyle,\n\t];\n\tconst titleStyle = [\n\t\tgetStylesFromColorScheme( styles.title, styles.titleDark ),\n\t\textraTitleStyle,\n\t];\n\tconst messageStyle = [\n\t\tgetStylesFromColorScheme( styles.message, styles.messageDark ),\n\t\textraMessageStyle,\n\t];\n\n\treturn (\n\t\t<View style={ containerStyle } { ...viewProps }>\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\t{ actions }\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( Warning );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA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oC,IAAI;IAACJ,KAAK,EAAGf;EAAY,GAAGR,KAAa,CAAC,EACpDC,OAAO,IAAI,IAAAmB,MAAA,CAAAC,aAAA,EAAC9B,YAAA,CAAAoC,IAAI;IAACJ,KAAK,EAAGb;EAAc,GAAGT,OAAe,CAAC,EAC1DF,OACG,CAAC;AAET;AAAC,IAAA6B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,iCAAwB,EAAEjC,OAAQ,CAAC"}
1
+ {"version":3,"names":["_reactNative","require","_components","_compose","_blocks","_style","_interopRequireDefault","Warning","actions","title","message","icon","iconClass","preferredColorScheme","getStylesFromColorScheme","containerStyle","extraContainerStyle","titleStyle","extraTitleStyle","messageStyle","extraMessageStyle","viewProps","normalizeIconObject","internalIconClass","styles","container","containerDark","titleDark","messageDark","_react","createElement","View","style","Icon","className","src","Text","_default","exports","default","withPreferredColorScheme"],"sources":["@wordpress/block-editor/src/components/warning/index.native.js"],"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\tactions,\n\ttitle,\n\tmessage,\n\ticon,\n\ticonClass,\n\tpreferredColorScheme,\n\tgetStylesFromColorScheme,\n\tcontainerStyle: extraContainerStyle,\n\ttitleStyle: extraTitleStyle,\n\tmessageStyle: extraMessageStyle,\n\t...viewProps\n} ) {\n\ticon = icon && normalizeIconObject( icon );\n\tconst internalIconClass = 'warning-icon' + '-' + preferredColorScheme;\n\n\tconst containerStyle = [\n\t\tgetStylesFromColorScheme( styles.container, styles.containerDark ),\n\t\textraContainerStyle,\n\t];\n\tconst titleStyle = [\n\t\tgetStylesFromColorScheme( styles.title, styles.titleDark ),\n\t\textraTitleStyle,\n\t];\n\tconst messageStyle = [\n\t\tgetStylesFromColorScheme( styles.message, styles.messageDark ),\n\t\textraMessageStyle,\n\t];\n\n\treturn (\n\t\t<View style={ containerStyle } { ...viewProps }>\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\t{ actions }\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( Warning );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASM,OAAOA,CAAE;EACjBC,OAAO;EACPC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,SAAS;EACTC,oBAAoB;EACpBC,wBAAwB;EACxBC,cAAc,EAAEC,mBAAmB;EACnCC,UAAU,EAAEC,eAAe;EAC3BC,YAAY,EAAEC,iBAAiB;EAC/B,GAAGC;AACJ,CAAC,EAAG;EACHV,IAAI,GAAGA,IAAI,IAAI,IAAAW,2BAAmB,EAAEX,IAAK,CAAC;EAC1C,MAAMY,iBAAiB,GAAG,cAAc,GAAG,GAAG,GAAGV,oBAAoB;EAErE,MAAME,cAAc,GAAG,CACtBD,wBAAwB,CAAEU,cAAM,CAACC,SAAS,EAAED,cAAM,CAACE,aAAc,CAAC,EAClEV,mBAAmB,CACnB;EACD,MAAMC,UAAU,GAAG,CAClBH,wBAAwB,CAAEU,cAAM,CAACf,KAAK,EAAEe,cAAM,CAACG,SAAU,CAAC,EAC1DT,eAAe,CACf;EACD,MAAMC,YAAY,GAAG,CACpBL,wBAAwB,CAAEU,cAAM,CAACd,OAAO,EAAEc,cAAM,CAACI,WAAY,CAAC,EAC9DR,iBAAiB,CACjB;EAED,OACC,IAAAS,MAAA,CAAAC,aAAA,EAAC9B,YAAA,CAAA+B,IAAI;IAACC,KAAK,EAAGjB,cAAgB;IAAA,GAAMM;EAAS,GAC1CV,IAAI,IACL,IAAAkB,MAAA,CAAAC,aAAA,EAAC9B,YAAA,CAAA+B,IAAI;IAACC,KAAK,EAAGR,cAAM,CAACb;EAAM,GAC1B,IAAAkB,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAA+B,IAAI;IACJC,SAAS,EAAGtB,SAAS,IAAIW,iBAAmB;IAC5CZ,IAAI,EAAGA,IAAI,IAAIA,IAAI,CAACwB,GAAG,GAAGxB,IAAI,CAACwB,GAAG,GAAGxB;EAAM,CAC3C,CACI,CACN,EACCF,KAAK,IAAI,IAAAoB,MAAA,CAAAC,aAAA,EAAC9B,YAAA,CAAAoC,IAAI;IAACJ,KAAK,EAAGf;EAAY,GAAGR,KAAa,CAAC,EACpDC,OAAO,IAAI,IAAAmB,MAAA,CAAAC,aAAA,EAAC9B,YAAA,CAAAoC,IAAI;IAACJ,KAAK,EAAGb;EAAc,GAAGT,OAAe,CAAC,EAC1DF,OACG,CAAC;AAET;AAAC,IAAA6B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,iCAAwB,EAAEjC,OAAQ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_i18n","_compose","_element","_useMultiSelection","_useTabNav","_useArrowNav","_useSelectAll","_useDragSelection","_useSelectionObserver","_useClickSelection","_useInput","_useClipboardHandler","_store","useWritingFlow","before","ref","after","useTabNav","hasMultiSelection","useSelect","select","blockEditorStore","useMergeRefs","useClipboardHandler","useInput","useDragSelection","useSelectionObserver","useClickSelection","useMultiSelection","useSelectAll","useArrowNav","useRefEffect","node","tabIndex","classList","add","setAttribute","__","remove","removeAttribute","WritingFlow","children","props","forwardedRef","_react","createElement","Fragment","className","classNames","_default","exports","default","forwardRef"],"sources":["@wordpress/block-editor/src/components/writing-flow/index.js"],"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 useClipboardHandler from './use-clipboard-handler';\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\tuseClipboardHandler(),\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\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 {Element} props.children Children to be rendered.\n */\nexport default forwardRef( WritingFlow );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,aAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,iBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,qBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,kBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,I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AM,CAAC,EAAEC,YAAY,EAAG;EAC5D,MAAM,CAAE7B,MAAM,EAAEC,GAAG,EAAEC,KAAK,CAAE,GAAGH,cAAc,CAAC,CAAC;EAC/C,OACC,IAAA+B,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACGhC,MAAM,EACR,IAAA8B,MAAA,CAAAC,aAAA;IAAA,GACMH,KAAK;IACV3B,GAAG,EAAG,IAAAO,qBAAY,EAAE,CAAEP,GAAG,EAAE4B,YAAY,CAAG,CAAG;IAC7CI,SAAS,EAAG,IAAAC,mBAAU,EACrBN,KAAK,CAACK,SAAS,EACf,2BACD;EAAG,GAEDN,QACE,CAAC,EACJzB,KACD,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAAAiC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAOe,IAAAC,mBAAU,EAAEZ,WAAY,CAAC"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_i18n","_compose","_element","_useMultiSelection","_useTabNav","_useArrowNav","_useSelectAll","_useDragSelection","_useSelectionObserver","_useClickSelection","_useInput","_useClipboardHandler","_store","useWritingFlow","before","ref","after","useTabNav","hasMultiSelection","useSelect","select","blockEditorStore","useMergeRefs","useClipboardHandler","useInput","useDragSelection","useSelectionObserver","useClickSelection","useMultiSelection","useSelectAll","useArrowNav","useRefEffect","node","tabIndex","classList","add","setAttribute","__","remove","removeAttribute","WritingFlow","children","props","forwardedRef","_react","createElement","Fragment","className","classNames","_default","exports","default","forwardRef"],"sources":["@wordpress/block-editor/src/components/writing-flow/index.js"],"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 useClipboardHandler from './use-clipboard-handler';\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\tuseClipboardHandler(),\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\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 {Element} props.children Children to be rendered.\n */\nexport default forwardRef( WritingFlow );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,aAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,iBAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,qBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,kBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,oBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAzBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAYO,SAASe,cAAcA,CAAA,EAAG;EAChC,MAAM,CAAEC,MAAM,EAAEC,GAAG,EAAEC,KAAK,CAAE,GAAG,IAAAC,kBAAS,EAAC,CAAC;EAC1C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACH,iBAAiB,CAAC,CAAC,EAC5D,EACD,CAAC;EAED,OAAO,CACNJ,MAAM,EACN,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QACE,CAAC,EACJzB,KACD,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAAAiC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAOe,IAAAC,mBAAU,EAAEZ,WAAY,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_dom","require","_keycodes","_data","_compose","_dom2","_store","isNavigationCandidate","element","keyCode","hasModifier","isVertical","UP","DOWN","tagName","elementType","getAttribute","verticalInputTypes","includes","simpleInputTypes","getClosestTabbable","target","isReverse","containerElement","onlyVertical","focusableNodes","focus","focusable","find","reverse","slice","indexOf","targetRect","getBoundingClientRect","isTabCandidate","node","closest","children","length","isInSameBlock","firstElementChild","tabbable","isTabbableIndex","isContentEditable","contentEditable","nodeRect","left","right","useArrowNav","getMultiSelectedBlocksStartClientId","getMultiSelectedBlocksEndClientId","getSettings","hasMultiSelection","__unstableIsFullySelected","useSelect","blockEditorStore","selectBlock","useDispatch","useRefEffect","verticalRect","onMouseDown","isClosestTabbableABlock","closestTabbable","getBlockClientId","onKeyDown","event","defaultPrevented","shiftKey","ctrlKey","altKey","metaKey","isUp","isDown","isLeft","LEFT","isRight","RIGHT","isHorizontal","isNav","isNavEdge","isVerticalEdge","isHorizontalEdge","ownerDocument","defaultView","preventDefault","computeCaretRect","isReverseDir","isRTL","keepCaretInsideBlock","placeCaretAtVerticalEdge","undefined","getSelection","isCollapsed","placeCaretAtHorizontalEdge","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-arrow-nav.js"],"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\tif ( node.closest( '[inert]' ) ) {\n\t\t\treturn;\n\t\t}\n\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"],"mappings":";;;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AASA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,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MAAM,IACNf,UAAU,IACV,IAAAqE,mBAAc,EAAE3D,MAAM,EAAEC,SAAU,CAAC;MACnC;MACA;MACE+C,MAAM,GAAG,IAAAY,qBAAgB,EAAE5D,MAAM,EAAEiE,YAAa,CAAC,GAAG,IAAI,CAAE,IAC5D,CAAEE,oBAAoB,EACrB;QACD,MAAM1B,eAAe,GAAG1C,kBAAkB,CACzCC,MAAM,EACNC,SAAS,EACTa,IAAI,EACJ,IACD,CAAC;QAED,IAAK2B,eAAe,EAAG;UACtB,IAAA2B,6BAAwB,EACvB3B,eAAe;UACf;UACA;UACAO,MAAM,GAAG,CAAE/C,SAAS,GAAGA,SAAS,EAChC+C,MAAM,GAAGqB,SAAS,GAAG/B,YACtB,CAAC;UACDM,KAAK,CAACmB,cAAc,CAAC,CAAC;QACvB;MACD,CAAC,MAAM,IACNP,YAAY,IACZM,WAAW,CAACQ,YAAY,CAAC,CAAC,CAACC,WAAW,IACtC,IAAAX,qBAAgB,EAAE5D,MAAM,EAAEiE,YAAa,CAAC,IACxC,CAAEE,oBAAoB,EACrB;QACD,MAAM1B,eAAe,GAAG1C,kBAAkB,CACzCC,MAAM,EACNiE,YAAY,EACZnD,IACD,CAAC;QACD,IAAA0D,+BAA0B,EAAE/B,eAAe,EAAExC,SAAU,CAAC;QACxD2C,KAAK,CAACmB,cAAc,CAAC,CAAC;MACvB;IACD;IAEAjD,IAAI,CAAC2D,gBAAgB,CAAE,WAAW,EAAElC,WAAY,CAAC;IACjDzB,IAAI,CAAC2D,gBAAgB,CAAE,SAAS,EAAE9B,SAAU,CAAC;IAC7C,OAAO,MAAM;MACZ7B,IAAI,CAAC4D,mBAAmB,CAAE,WAAW,EAAEnC,WAAY,CAAC;MACpDzB,IAAI,CAAC4D,mBAAmB,CAAE,SAAS,EAAE/B,SAAU,CAAC;IACjD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR"}
1
+ {"version":3,"names":["_dom","require","_keycodes","_data","_compose","_dom2","_store","isNavigationCandidate","element","keyCode","hasModifier","isVertical","UP","DOWN","tagName","elementType","getAttribute","verticalInputTypes","includes","simpleInputTypes","getClosestTabbable","target","isReverse","containerElement","onlyVertical","focusableNodes","focus","focusable","find","reverse","slice","indexOf","targetRect","getBoundingClientRect","isTabCandidate","node","closest","children","length","isInSameBlock","firstElementChild","tabbable","isTabbableIndex","isContentEditable","contentEditable","nodeRect","left","right","useArrowNav","getMultiSelectedBlocksStartClientId","getMultiSelectedBlocksEndClientId","getSettings","hasMultiSelection","__unstableIsFullySelected","useSelect","blockEditorStore","selectBlock","useDispatch","useRefEffect","verticalRect","onMouseDown","isClosestTabbableABlock","closestTabbable","getBlockClientId","onKeyDown","event","defaultPrevented","shiftKey","ctrlKey","altKey","metaKey","isUp","isDown","isLeft","LEFT","isRight","RIGHT","isHorizontal","isNav","isNavEdge","isVerticalEdge","isHorizontalEdge","ownerDocument","defaultView","preventDefault","computeCaretRect","isReverseDir","isRTL","keepCaretInsideBlock","placeCaretAtVerticalEdge","undefined","getSelection","isCollapsed","placeCaretAtHorizontalEdge","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-arrow-nav.js"],"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\tif ( node.closest( '[inert]' ) ) {\n\t\t\treturn;\n\t\t}\n\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"],"mappings":";;;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AASA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AApBA;AACA;AACA;;AAcA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,qBAAqBA,CAAEC,OAAO,EAAEC,OAAO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AAM,EACNC,SAAS,EACTa,IAAI,EACJ,IACD,CAAC;QAED,IAAK2B,eAAe,EAAG;UACtB,IAAA2B,6BAAwB,EACvB3B,eAAe;UACf;UACA;UACAO,MAAM,GAAG,CAAE/C,SAAS,GAAGA,SAAS,EAChC+C,MAAM,GAAGqB,SAAS,GAAG/B,YACtB,CAAC;UACDM,KAAK,CAACmB,cAAc,CAAC,CAAC;QACvB;MACD,CAAC,MAAM,IACNP,YAAY,IACZM,WAAW,CAACQ,YAAY,CAAC,CAAC,CAACC,WAAW,IACtC,IAAAX,qBAAgB,EAAE5D,MAAM,EAAEiE,YAAa,CAAC,IACxC,CAAEE,oBAAoB,EACrB;QACD,MAAM1B,eAAe,GAAG1C,kBAAkB,CACzCC,MAAM,EACNiE,YAAY,EACZnD,IACD,CAAC;QACD,IAAA0D,+BAA0B,EAAE/B,eAAe,EAAExC,SAAU,CAAC;QACxD2C,KAAK,CAACmB,cAAc,CAAC,CAAC;MACvB;IACD;IAEAjD,IAAI,CAAC2D,gBAAgB,CAAE,WAAW,EAAElC,WAAY,CAAC;IACjDzB,IAAI,CAAC2D,gBAAgB,CAAE,SAAS,EAAE9B,SAAU,CAAC;IAC7C,OAAO,MAAM;MACZ7B,IAAI,CAAC4D,mBAAmB,CAAE,WAAW,EAAEnC,WAAY,CAAC;MACpDzB,IAAI,CAAC4D,mBAAmB,CAAE,SAAS,EAAE/B,SAAU,CAAC;IACjD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_compose","_store","_dom","useClickSelection","selectBlock","useDispatch","blockEditorStore","isSelectionEnabled","getBlockSelectionStart","hasMultiSelection","useSelect","useRefEffect","node","onMouseDown","event","button","startClientId","clickedClientId","getBlockClientId","target","shiftKey","contentEditable","focus","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-click-selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { getBlockClientId } from '../../utils/dom';\n\nexport default function useClickSelection() {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { isSelectionEnabled, getBlockSelectionStart, hasMultiSelection } =\n\t\tuseSelect( blockEditorStore );\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\t// The main button.\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n\t\t\t\tif ( ! isSelectionEnabled() || event.button !== 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst startClientId = getBlockSelectionStart();\n\t\t\t\tconst clickedClientId = getBlockClientId( event.target );\n\n\t\t\t\tif ( event.shiftKey ) {\n\t\t\t\t\tif ( startClientId !== clickedClientId ) {\n\t\t\t\t\t\tnode.contentEditable = true;\n\t\t\t\t\t\t// Firefox doesn't automatically move focus.\n\t\t\t\t\t\tnode.focus();\n\t\t\t\t\t}\n\t\t\t\t} else if ( hasMultiSelection() ) {\n\t\t\t\t\t// Allow user to escape out of a multi-selection to a\n\t\t\t\t\t// singular selection of a block via click. This is handled\n\t\t\t\t\t// here since focus handling excludes blocks when there is\n\t\t\t\t\t// multiselection, as focus can be incurred by starting a\n\t\t\t\t\t// multiselection (focus moved to first block's multi-\n\t\t\t\t\t// controls).\n\t\t\t\t\tselectBlock( clickedClientId );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tselectBlock,\n\t\t\tisSelectionEnabled,\n\t\t\tgetBlockSelectionStart,\n\t\t\thasMultiSelection,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAA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","useClickSelection","selectBlock","useDispatch","blockEditorStore","isSelectionEnabled","getBlockSelectionStart","hasMultiSelection","useSelect","useRefEffect","node","onMouseDown","event","button","startClientId","clickedClientId","getBlockClientId","target","shiftKey","contentEditable","focus","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-click-selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { getBlockClientId } from '../../utils/dom';\n\nexport default function useClickSelection() {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { isSelectionEnabled, getBlockSelectionStart, hasMultiSelection } =\n\t\tuseSelect( blockEditorStore );\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\t// The main button.\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n\t\t\t\tif ( ! isSelectionEnabled() || event.button !== 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst startClientId = getBlockSelectionStart();\n\t\t\t\tconst clickedClientId = getBlockClientId( event.target );\n\n\t\t\t\tif ( event.shiftKey ) {\n\t\t\t\t\tif ( startClientId !== clickedClientId ) {\n\t\t\t\t\t\tnode.contentEditable = true;\n\t\t\t\t\t\t// Firefox doesn't automatically move focus.\n\t\t\t\t\t\tnode.focus();\n\t\t\t\t\t}\n\t\t\t\t} else if ( hasMultiSelection() ) {\n\t\t\t\t\t// Allow user to escape out of a multi-selection to a\n\t\t\t\t\t// singular selection of a block via click. This is handled\n\t\t\t\t\t// here since focus handling excludes blocks when there is\n\t\t\t\t\t// multiselection, as focus can be incurred by starting a\n\t\t\t\t\t// multiselection (focus moved to first block's multi-\n\t\t\t\t\t// controls).\n\t\t\t\t\tselectBlock( clickedClientId );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tselectBlock,\n\t\t\tisSelectionEnabled,\n\t\t\tgetBlockSelectionStart,\n\t\t\thasMultiSelection,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIe,SAASI,iBAAiBA,CAAA,EAAG;EAC3C,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EACvD,MAAM;IAAEC,kBAAkB;IAAEC,sBAAsB;IAAEC;EAAkB,CAAC,GACtE,IAAAC,eAAS,EAAEJ,YAAiB,CAAC;EAC9B,OAAO,IAAAK,qBAAY,EAChBC,IAAI,IAAM;IACX,SAASC,WAAWA,CAAEC,KAAK,EAAG;MAC7B;MACA;MACA,IAAK,CAAEP,kBAAkB,CAAC,CAAC,IAAIO,KAAK,CAACC,MAAM,KAAK,CAAC,EAAG;QACnD;MACD;MAEA,MAAMC,aAAa,GAAGR,sBAAsB,CAAC,CAAC;MAC9C,MAAMS,eAAe,GAAG,IAAAC,qBAAgB,EAAEJ,KAAK,CAACK,MAAO,CAAC;MAExD,IAAKL,KAAK,CAACM,QAAQ,EAAG;QACrB,IAAKJ,aAAa,KAAKC,eAAe,EAAG;UACxCL,IAAI,CAACS,eAAe,GAAG,IAAI;UAC3B;UACAT,IAAI,CAACU,KAAK,CAAC,CAAC;QACb;MACD,CAAC,MAAM,IAAKb,iBAAiB,CAAC,CAAC,EAAG;QACjC;QACA;QACA;QACA;QACA;QACA;QACAL,WAAW,CAAEa,eAAgB,CAAC;MAC/B;IACD;IAEAL,IAAI,CAACW,gBAAgB,CAAE,WAAW,EAAEV,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZD,IAAI,CAACY,mBAAmB,CAAE,WAAW,EAAEX,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACCT,WAAW,EACXG,kBAAkB,EAClBC,sBAAsB,EACtBC,iBAAiB,CAEnB,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_dom","require","_data","_compose","_store","_useNotifyCopy","_utils","useClipboardHandler","registry","useRegistry","getBlocksByClientId","getSelectedBlockClientIds","hasMultiSelection","getSettings","__unstableIsFullySelected","__unstableIsSelectionCollapsed","__unstableIsSelectionMergeable","__unstableGetSelectedBlocksWithPartialSelection","canInsertBlockType","useSelect","blockEditorStore","flashBlock","removeBlocks","replaceBlocks","__unstableDeleteSelection","__unstableExpandSelection","insertBlocks","useDispatch","notifyCopy","useNotifyCopy","useRefEffect","node","handler","event","defaultPrevented","selectedBlockClientIds","length","target","ownerDocument","hasSelection","type","documentHasUncollapsedSelection","documentHasSelection","contains","activeElement","preventDefault","isSelectionMergeable","shouldHandleWholeBlocks","expandSelectionIsNeeded","blocks","head","tail","inBetweenBlocks","slice","setClipboardBlocks","contentEditable","__experimentalCanUserUseUnfilteredHTML","canUserUseUnfilteredHTML","getPasteBlocks","selectedBlockClientId","every","block","name","undefined","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-clipboard-handler.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tdocumentHasSelection,\n\tdocumentHasUncollapsedSelection,\n} from '@wordpress/dom';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { useNotifyCopy } from '../../utils/use-notify-copy';\nimport { getPasteBlocks, setClipboardBlocks } from './utils';\n\nexport default function useClipboardHandler() {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tgetSettings,\n\t\t__unstableIsFullySelected,\n\t\t__unstableIsSelectionCollapsed,\n\t\t__unstableIsSelectionMergeable,\n\t\t__unstableGetSelectedBlocksWithPartialSelection,\n\t\tcanInsertBlockType,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tflashBlock,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\tinsertBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst notifyCopy = useNotifyCopy();\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction handler( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\t// This was likely already handled in rich-text/use-paste-handler.js.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\tif ( selectedBlockClientIds.length === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Always handle multiple selected blocks.\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tconst { target } = event;\n\t\t\t\tconst { ownerDocument } = target;\n\t\t\t\t// If copying, only consider actual text selection as selection.\n\t\t\t\t// Otherwise, any focus on an input field is considered.\n\t\t\t\tconst hasSelection =\n\t\t\t\t\tevent.type === 'copy' || event.type === 'cut'\n\t\t\t\t\t\t? documentHasUncollapsedSelection( ownerDocument )\n\t\t\t\t\t\t: documentHasSelection( ownerDocument );\n\n\t\t\t\t// Let native copy behaviour take over in input fields.\n\t\t\t\tif ( hasSelection ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! node.contains( event.target.ownerDocument.activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconst isSelectionMergeable = __unstableIsSelectionMergeable();\n\t\t\tconst shouldHandleWholeBlocks =\n\t\t\t\t__unstableIsSelectionCollapsed() || __unstableIsFullySelected();\n\t\t\tconst expandSelectionIsNeeded =\n\t\t\t\t! shouldHandleWholeBlocks && ! isSelectionMergeable;\n\t\t\tif ( event.type === 'copy' || event.type === 'cut' ) {\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tflashBlock( selectedBlockClientIds[ 0 ] );\n\t\t\t\t}\n\t\t\t\t// If we have a partial selection that is not mergeable, just\n\t\t\t\t// expand the selection to the whole blocks.\n\t\t\t\tif ( expandSelectionIsNeeded ) {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t} else {\n\t\t\t\t\tnotifyCopy( event.type, selectedBlockClientIds );\n\t\t\t\t\tlet blocks;\n\t\t\t\t\t// Check if we have partial selection.\n\t\t\t\t\tif ( shouldHandleWholeBlocks ) {\n\t\t\t\t\t\tblocks = getBlocksByClientId( selectedBlockClientIds );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [ head, tail ] =\n\t\t\t\t\t\t\t__unstableGetSelectedBlocksWithPartialSelection();\n\t\t\t\t\t\tconst inBetweenBlocks = getBlocksByClientId(\n\t\t\t\t\t\t\tselectedBlockClientIds.slice(\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\tselectedBlockClientIds.length - 1\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tblocks = [ head, ...inBetweenBlocks, tail ];\n\t\t\t\t\t}\n\n\t\t\t\t\tsetClipboardBlocks( event, blocks, registry );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( event.type === 'cut' ) {\n\t\t\t\t// We need to also check if at the start we needed to\n\t\t\t\t// expand the selection, as in this point we might have\n\t\t\t\t// programmatically fully selected the blocks above.\n\t\t\t\tif ( shouldHandleWholeBlocks && ! expandSelectionIsNeeded ) {\n\t\t\t\t\tremoveBlocks( selectedBlockClientIds );\n\t\t\t\t} else {\n\t\t\t\t\tevent.target.ownerDocument.activeElement.contentEditable = false;\n\t\t\t\t\t__unstableDeleteSelection();\n\t\t\t\t}\n\t\t\t} else if ( event.type === 'paste' ) {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalCanUserUseUnfilteredHTML:\n\t\t\t\t\t\tcanUserUseUnfilteredHTML,\n\t\t\t\t} = getSettings();\n\t\t\t\tconst blocks = getPasteBlocks(\n\t\t\t\t\tevent,\n\t\t\t\t\tcanUserUseUnfilteredHTML\n\t\t\t\t);\n\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tconst [ selectedBlockClientId ] = selectedBlockClientIds;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblocks.every( ( block ) =>\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\tblocks,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlockClientIds,\n\t\t\t\t\tblocks,\n\t\t\t\t\tblocks.length - 1,\n\t\t\t\t\t-1\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tnode.ownerDocument.addEventListener( 'copy', handler );\n\t\tnode.ownerDocument.addEventListener( 'cut', handler );\n\t\tnode.ownerDocument.addEventListener( 'paste', handler );\n\n\t\treturn () => {\n\t\t\tnode.ownerDocument.removeEventListener( 'copy', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'cut', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'paste', handler );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,Q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AAEjC,OAAQ,CAAC;MACxDD,IAAI,CAACO,aAAa,CAAC2B,mBAAmB,CAAE,OAAO,EAAEjC,OAAQ,CAAC;IAC3D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR"}
1
+ {"version":3,"names":["_dom","require","_data","_compose","_store","_useNotifyCopy","_utils","useClipboardHandler","registry","useRegistry","getBlocksByClientId","getSelectedBlockClientIds","hasMultiSelection","getSettings","__unstableIsFullySelected","__unstableIsSelectionCollapsed","__unstableIsSelectionMergeable","__unstableGetSelectedBlocksWithPartialSelection","canInsertBlockType","useSelect","blockEditorStore","flashBlock","removeBlocks","replaceBlocks","__unstableDeleteSelection","__unstableExpandSelection","insertBlocks","useDispatch","notifyCopy","useNotifyCopy","useRefEffect","node","handler","event","defaultPrevented","selectedBlockClientIds","length","target","ownerDocument","hasSelection","type","documentHasUncollapsedSelection","documentHasSelection","contains","activeElement","preventDefault","isSelectionMergeable","shouldHandleWholeBlocks","expandSelectionIsNeeded","blocks","head","tail","inBetweenBlocks","slice","setClipboardBlocks","contentEditable","__experimentalCanUserUseUnfilteredHTML","canUserUseUnfilteredHTML","getPasteBlocks","selectedBlockClientId","every","block","name","undefined","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-clipboard-handler.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tdocumentHasSelection,\n\tdocumentHasUncollapsedSelection,\n} from '@wordpress/dom';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { useNotifyCopy } from '../../utils/use-notify-copy';\nimport { getPasteBlocks, setClipboardBlocks } from './utils';\n\nexport default function useClipboardHandler() {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetBlocksByClientId,\n\t\tgetSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tgetSettings,\n\t\t__unstableIsFullySelected,\n\t\t__unstableIsSelectionCollapsed,\n\t\t__unstableIsSelectionMergeable,\n\t\t__unstableGetSelectedBlocksWithPartialSelection,\n\t\tcanInsertBlockType,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tflashBlock,\n\t\tremoveBlocks,\n\t\treplaceBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\tinsertBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst notifyCopy = useNotifyCopy();\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction handler( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\t// This was likely already handled in rich-text/use-paste-handler.js.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\tif ( selectedBlockClientIds.length === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Always handle multiple selected blocks.\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tconst { target } = event;\n\t\t\t\tconst { ownerDocument } = target;\n\t\t\t\t// If copying, only consider actual text selection as selection.\n\t\t\t\t// Otherwise, any focus on an input field is considered.\n\t\t\t\tconst hasSelection =\n\t\t\t\t\tevent.type === 'copy' || event.type === 'cut'\n\t\t\t\t\t\t? documentHasUncollapsedSelection( ownerDocument )\n\t\t\t\t\t\t: documentHasSelection( ownerDocument );\n\n\t\t\t\t// Let native copy behaviour take over in input fields.\n\t\t\t\tif ( hasSelection ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! node.contains( event.target.ownerDocument.activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconst isSelectionMergeable = __unstableIsSelectionMergeable();\n\t\t\tconst shouldHandleWholeBlocks =\n\t\t\t\t__unstableIsSelectionCollapsed() || __unstableIsFullySelected();\n\t\t\tconst expandSelectionIsNeeded =\n\t\t\t\t! shouldHandleWholeBlocks && ! isSelectionMergeable;\n\t\t\tif ( event.type === 'copy' || event.type === 'cut' ) {\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tflashBlock( selectedBlockClientIds[ 0 ] );\n\t\t\t\t}\n\t\t\t\t// If we have a partial selection that is not mergeable, just\n\t\t\t\t// expand the selection to the whole blocks.\n\t\t\t\tif ( expandSelectionIsNeeded ) {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t} else {\n\t\t\t\t\tnotifyCopy( event.type, selectedBlockClientIds );\n\t\t\t\t\tlet blocks;\n\t\t\t\t\t// Check if we have partial selection.\n\t\t\t\t\tif ( shouldHandleWholeBlocks ) {\n\t\t\t\t\t\tblocks = getBlocksByClientId( selectedBlockClientIds );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [ head, tail ] =\n\t\t\t\t\t\t\t__unstableGetSelectedBlocksWithPartialSelection();\n\t\t\t\t\t\tconst inBetweenBlocks = getBlocksByClientId(\n\t\t\t\t\t\t\tselectedBlockClientIds.slice(\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\tselectedBlockClientIds.length - 1\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tblocks = [ head, ...inBetweenBlocks, tail ];\n\t\t\t\t\t}\n\n\t\t\t\t\tsetClipboardBlocks( event, blocks, registry );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( event.type === 'cut' ) {\n\t\t\t\t// We need to also check if at the start we needed to\n\t\t\t\t// expand the selection, as in this point we might have\n\t\t\t\t// programmatically fully selected the blocks above.\n\t\t\t\tif ( shouldHandleWholeBlocks && ! expandSelectionIsNeeded ) {\n\t\t\t\t\tremoveBlocks( selectedBlockClientIds );\n\t\t\t\t} else {\n\t\t\t\t\tevent.target.ownerDocument.activeElement.contentEditable = false;\n\t\t\t\t\t__unstableDeleteSelection();\n\t\t\t\t}\n\t\t\t} else if ( event.type === 'paste' ) {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalCanUserUseUnfilteredHTML:\n\t\t\t\t\t\tcanUserUseUnfilteredHTML,\n\t\t\t\t} = getSettings();\n\t\t\t\tconst blocks = getPasteBlocks(\n\t\t\t\t\tevent,\n\t\t\t\t\tcanUserUseUnfilteredHTML\n\t\t\t\t);\n\n\t\t\t\tif ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\t\tconst [ selectedBlockClientId ] = selectedBlockClientIds;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblocks.every( ( block ) =>\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\tblocks,\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tselectedBlockClientId\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treplaceBlocks(\n\t\t\t\t\tselectedBlockClientIds,\n\t\t\t\t\tblocks,\n\t\t\t\t\tblocks.length - 1,\n\t\t\t\t\t-1\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tnode.ownerDocument.addEventListener( 'copy', handler );\n\t\tnode.ownerDocument.addEventListener( 'cut', handler );\n\t\tnode.ownerDocument.addEventListener( 'paste', handler );\n\n\t\treturn () => {\n\t\t\tnode.ownerDocument.removeEventListener( 'copy', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'cut', handler );\n\t\t\tnode.ownerDocument.removeEventListener( 'paste', handler );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IA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CAAC;IAC3D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -24,7 +24,9 @@ var _store = require("../../store");
24
24
  function setContentEditableWrapper(node, value) {
25
25
  node.contentEditable = value;
26
26
  // Firefox doesn't automatically move focus.
27
- if (value) node.focus();
27
+ if (value) {
28
+ node.focus();
29
+ }
28
30
  }
29
31
 
30
32
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_compose","_store","setContentEditableWrapper","node","value","contentEditable","focus","useDragSelection","startMultiSelect","stopMultiSelect","useDispatch","blockEditorStore","isSelectionEnabled","hasSelectedBlock","isDraggingBlocks","isMultiSelecting","useSelect","useRefEffect","ownerDocument","defaultView","anchorElement","rafId","onMouseUp","removeEventListener","requestAnimationFrame","selection","getSelection","rangeCount","range","getRangeAt","commonAncestorContainer","clonedRange","cloneRange","contains","removeAllRanges","addRange","onMouseLeave","buttons","target","relatedTarget","getAttribute","addEventListener","cancelAnimationFrame"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-drag-selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Sets the `contenteditable` wrapper element to `value`.\n *\n * @param {HTMLElement} node Block element.\n * @param {boolean} value `contentEditable` value (true or false)\n */\nfunction setContentEditableWrapper( node, value ) {\n\tnode.contentEditable = value;\n\t// Firefox doesn't automatically move focus.\n\tif ( value ) node.focus();\n}\n\n/**\n * Sets a multi-selection based on the native selection across blocks.\n */\nexport default function useDragSelection() {\n\tconst { startMultiSelect, stopMultiSelect } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tisSelectionEnabled,\n\t\thasSelectedBlock,\n\t\tisDraggingBlocks,\n\t\tisMultiSelecting,\n\t} = useSelect( blockEditorStore );\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tlet anchorElement;\n\t\t\tlet rafId;\n\n\t\t\tfunction onMouseUp() {\n\t\t\t\tstopMultiSelect();\n\t\t\t\t// Equivalent to attaching the listener once.\n\t\t\t\tdefaultView.removeEventListener( 'mouseup', onMouseUp );\n\t\t\t\t// The browser selection won't have updated yet at this point,\n\t\t\t\t// so wait until the next animation frame to get the browser\n\t\t\t\t// selection.\n\t\t\t\trafId = defaultView.requestAnimationFrame( () => {\n\t\t\t\t\tif ( ! hasSelectedBlock() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the selection is complete (on mouse up), and no\n\t\t\t\t\t// multiple blocks have been selected, set focus back to the\n\t\t\t\t\t// anchor element. if the anchor element contains the\n\t\t\t\t\t// selection. Additionally, the contentEditable wrapper can\n\t\t\t\t\t// now be disabled again.\n\t\t\t\t\tsetContentEditableWrapper( node, false );\n\n\t\t\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t\t\tif ( selection.rangeCount ) {\n\t\t\t\t\t\tconst range = selection.getRangeAt( 0 );\n\t\t\t\t\t\tconst { commonAncestorContainer } = range;\n\t\t\t\t\t\tconst clonedRange = range.cloneRange();\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tanchorElement.contains( commonAncestorContainer )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tanchorElement.focus();\n\t\t\t\t\t\t\tselection.removeAllRanges();\n\t\t\t\t\t\t\tselection.addRange( clonedRange );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction onMouseLeave( { buttons, target, relatedTarget } ) {\n\t\t\t\t// If we're moving into a child element, ignore. We're tracking\n\t\t\t\t// the mouse leaving the element to a parent, no a child.\n\t\t\t\tif ( target.contains( relatedTarget ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Avoid triggering a multi-selection if the user is already\n\t\t\t\t// dragging blocks.\n\t\t\t\tif ( isDraggingBlocks() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The primary button must be pressed to initiate selection.\n\t\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n\t\t\t\tif ( buttons !== 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Abort if we are already multi-selecting.\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Abort if selection is leaving writing flow.\n\t\t\t\tif ( node === target ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check the attribute, not the contentEditable attribute. All\n\t\t\t\t// child elements of the content editable wrapper are editable\n\t\t\t\t// and return true for this property. We only want to start\n\t\t\t\t// multi selecting when the mouse leaves the wrapper.\n\t\t\t\tif ( target.getAttribute( 'contenteditable' ) !== 'true' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! isSelectionEnabled() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Do not rely on the active element because it may change after\n\t\t\t\t// the mouse leaves for the first time. See\n\t\t\t\t// https://github.com/WordPress/gutenberg/issues/48747.\n\t\t\t\tanchorElement = target;\n\n\t\t\t\tstartMultiSelect();\n\n\t\t\t\t// `onSelectionStart` is called after `mousedown` and\n\t\t\t\t// `mouseleave` (from a block). The selection ends when\n\t\t\t\t// `mouseup` happens anywhere in the window.\n\t\t\t\tdefaultView.addEventListener( 'mouseup', onMouseUp );\n\n\t\t\t\t// Allow cross contentEditable selection by temporarily making\n\t\t\t\t// all content editable. We can't rely on using the store and\n\t\t\t\t// React because re-rending happens too slowly. We need to be\n\t\t\t\t// able to select across instances immediately.\n\t\t\t\tsetContentEditableWrapper( node, true );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mouseout', onMouseLeave );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mouseout', onMouseLeave );\n\t\t\t\tdefaultView.removeEventListener( 'mouseup', onMouseUp );\n\t\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tstartMultiSelect,\n\t\t\tstopMultiSelect,\n\t\t\tisSelectionEnabled,\n\t\t\thasSelectedBlock,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,yBAAyBA,CAAEC,IAAI,EAAEC,KAAK,EAAG;EACjDD,IAAI,CAACE,eAAe,GAAGD,KAAK;EAC5B;EACA,IAAKA,KAAK,EAAGD,IAAI,CAACG,KAAK,CAAC,CAAC;AAC1B;;AAEA;AACA;AACA;AACe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,gBAAgB;IAAEC;EAAgB,CAAC,GAC1C,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAChC,MAAM;IACLC,kBAAkB;IAClBC,gBAAgB;IAChBC,gBAAgB;IAChBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAEL,YAAiB,CAAC;EACjC,OAAO,IAAAM,qBAAY,EAChBd,IAAI,IAAM;IACX,MAAM;MAAEe;IAAc,CAAC,GAAGf,IAAI;IAC9B,MAAM;MAAEgB;IAAY,CAAC,GAAGD,aAAa;IAErC,IAAIE,aAAa;IACjB,IAAIC,KAAK;IAET,SAASC,SAASA,CAAA,EAAG;MACpBb,eAAe,CAAC,CAAC;MACjB;MACAU,WAAW,CAACI,mBAAmB,CAAE,SAAS,EAAED,SAAU,CAAC;MACvD;MACA;MACA;MACAD,KAAK,GAAGF,WAAW,CAACK,qBAAqB,CAAE,MAAM;QAChD,IAAK,CAAEX,gBAAgB,CAAC,C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W,CAACsB,gBAAgB,CAAE,SAAS,EAAEnB,SAAU,CAAC;;MAEpD;MACA;MACA;MACA;MACApB,yBAAyB,CAAEC,IAAI,EAAE,IAAK,CAAC;IACxC;IAEAA,IAAI,CAACsC,gBAAgB,CAAE,UAAU,EAAEL,YAAa,CAAC;IAEjD,OAAO,MAAM;MACZjC,IAAI,CAACoB,mBAAmB,CAAE,UAAU,EAAEa,YAAa,CAAC;MACpDjB,WAAW,CAACI,mBAAmB,CAAE,SAAS,EAAED,SAAU,CAAC;MACvDH,WAAW,CAACuB,oBAAoB,CAAErB,KAAM,CAAC;IAC1C,CAAC;EACF,CAAC,EACD,CACCb,gBAAgB,EAChBC,eAAe,EACfG,kBAAkB,EAClBC,gBAAgB,CAElB,CAAC;AACF"}
1
+ {"version":3,"names":["_data","require","_compose","_store","setContentEditableWrapper","node","value","contentEditable","focus","useDragSelection","startMultiSelect","stopMultiSelect","useDispatch","blockEditorStore","isSelectionEnabled","hasSelectedBlock","isDraggingBlocks","isMultiSelecting","useSelect","useRefEffect","ownerDocument","defaultView","anchorElement","rafId","onMouseUp","removeEventListener","requestAnimationFrame","selection","getSelection","rangeCount","range","getRangeAt","commonAncestorContainer","clonedRange","cloneRange","contains","removeAllRanges","addRange","onMouseLeave","buttons","target","relatedTarget","getAttribute","addEventListener","cancelAnimationFrame"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-drag-selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Sets the `contenteditable` wrapper element to `value`.\n *\n * @param {HTMLElement} node Block element.\n * @param {boolean} value `contentEditable` value (true or false)\n */\nfunction setContentEditableWrapper( node, value ) {\n\tnode.contentEditable = value;\n\t// Firefox doesn't automatically move focus.\n\tif ( value ) {\n\t\tnode.focus();\n\t}\n}\n\n/**\n * Sets a multi-selection based on the native selection across blocks.\n */\nexport default function useDragSelection() {\n\tconst { startMultiSelect, stopMultiSelect } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tisSelectionEnabled,\n\t\thasSelectedBlock,\n\t\tisDraggingBlocks,\n\t\tisMultiSelecting,\n\t} = useSelect( blockEditorStore );\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tlet anchorElement;\n\t\t\tlet rafId;\n\n\t\t\tfunction onMouseUp() {\n\t\t\t\tstopMultiSelect();\n\t\t\t\t// Equivalent to attaching the listener once.\n\t\t\t\tdefaultView.removeEventListener( 'mouseup', onMouseUp );\n\t\t\t\t// The browser selection won't have updated yet at this point,\n\t\t\t\t// so wait until the next animation frame to get the browser\n\t\t\t\t// selection.\n\t\t\t\trafId = defaultView.requestAnimationFrame( () => {\n\t\t\t\t\tif ( ! hasSelectedBlock() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the selection is complete (on mouse up), and no\n\t\t\t\t\t// multiple blocks have been selected, set focus back to the\n\t\t\t\t\t// anchor element. if the anchor element contains the\n\t\t\t\t\t// selection. Additionally, the contentEditable wrapper can\n\t\t\t\t\t// now be disabled again.\n\t\t\t\t\tsetContentEditableWrapper( node, false );\n\n\t\t\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t\t\tif ( selection.rangeCount ) {\n\t\t\t\t\t\tconst range = selection.getRangeAt( 0 );\n\t\t\t\t\t\tconst { commonAncestorContainer } = range;\n\t\t\t\t\t\tconst clonedRange = range.cloneRange();\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tanchorElement.contains( commonAncestorContainer )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tanchorElement.focus();\n\t\t\t\t\t\t\tselection.removeAllRanges();\n\t\t\t\t\t\t\tselection.addRange( clonedRange );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction onMouseLeave( { buttons, target, relatedTarget } ) {\n\t\t\t\t// If we're moving into a child element, ignore. We're tracking\n\t\t\t\t// the mouse leaving the element to a parent, no a child.\n\t\t\t\tif ( target.contains( relatedTarget ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Avoid triggering a multi-selection if the user is already\n\t\t\t\t// dragging blocks.\n\t\t\t\tif ( isDraggingBlocks() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The primary button must be pressed to initiate selection.\n\t\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n\t\t\t\tif ( buttons !== 1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Abort if we are already multi-selecting.\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Abort if selection is leaving writing flow.\n\t\t\t\tif ( node === target ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check the attribute, not the contentEditable attribute. All\n\t\t\t\t// child elements of the content editable wrapper are editable\n\t\t\t\t// and return true for this property. We only want to start\n\t\t\t\t// multi selecting when the mouse leaves the wrapper.\n\t\t\t\tif ( target.getAttribute( 'contenteditable' ) !== 'true' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! isSelectionEnabled() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Do not rely on the active element because it may change after\n\t\t\t\t// the mouse leaves for the first time. See\n\t\t\t\t// https://github.com/WordPress/gutenberg/issues/48747.\n\t\t\t\tanchorElement = target;\n\n\t\t\t\tstartMultiSelect();\n\n\t\t\t\t// `onSelectionStart` is called after `mousedown` and\n\t\t\t\t// `mouseleave` (from a block). The selection ends when\n\t\t\t\t// `mouseup` happens anywhere in the window.\n\t\t\t\tdefaultView.addEventListener( 'mouseup', onMouseUp );\n\n\t\t\t\t// Allow cross contentEditable selection by temporarily making\n\t\t\t\t// all content editable. We can't rely on using the store and\n\t\t\t\t// React because re-rending happens too slowly. We need to be\n\t\t\t\t// able to select across instances immediately.\n\t\t\t\tsetContentEditableWrapper( node, true );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mouseout', onMouseLeave );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mouseout', onMouseLeave );\n\t\t\t\tdefaultView.removeEventListener( 'mouseup', onMouseUp );\n\t\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tstartMultiSelect,\n\t\t\tstopMultiSelect,\n\t\t\tisSelectionEnabled,\n\t\t\thasSelectedBlock,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,yBAAyBA,CAAEC,IAAI,EAAEC,KAAK,EAAG;EACjDD,IAAI,CAACE,eAAe,GAAGD,KAAK;EAC5B;EACA,IAAKA,KAAK,EAAG;IACZD,IAAI,CAACG,KAAK,CAAC,CAAC;EACb;AACD;;AAEA;AACA;AACA;AACe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,gBAAgB;IAAEC;EAAgB,CAAC,GAC1C,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAChC,MAAM;IACLC,kBAAkB;IAClBC,gBAAgB;IAChBC,gBAAgB;IAChBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAEL,YAAiB,CAAC;EACjC,OAAO,IAAAM,qBAAY,EAChBd,IAAI,IAAM;IACX,MAAM;MAAEe;IAAc,CAAC,GAAGf,IAAI;IAC9B,MAAM;MAAEgB;IAAY,CAAC,GAAGD,aAAa;IAErC,IAAIE,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ACA;MACA,IAAKA,MAAM,CAACE,YAAY,CAAE,iBAAkB,CAAC,KAAK,MAAM,EAAG;QAC1D;MACD;MAEA,IAAK,CAAE5B,kBAAkB,CAAC,CAAC,EAAG;QAC7B;MACD;;MAEA;MACA;MACA;MACAQ,aAAa,GAAGkB,MAAM;MAEtB9B,gBAAgB,CAAC,CAAC;;MAElB;MACA;MACA;MACAW,WAAW,CAACsB,gBAAgB,CAAE,SAAS,EAAEnB,SAAU,CAAC;;MAEpD;MACA;MACA;MACA;MACApB,yBAAyB,CAAEC,IAAI,EAAE,IAAK,CAAC;IACxC;IAEAA,IAAI,CAACsC,gBAAgB,CAAE,UAAU,EAAEL,YAAa,CAAC;IAEjD,OAAO,MAAM;MACZjC,IAAI,CAACoB,mBAAmB,CAAE,UAAU,EAAEa,YAAa,CAAC;MACpDjB,WAAW,CAACI,mBAAmB,CAAE,SAAS,EAAED,SAAU,CAAC;MACvDH,WAAW,CAACuB,oBAAoB,CAAErB,KAAM,CAAC;IAC1C,CAAC;EACF,CAAC,EACD,CACCb,gBAAgB,EAChBC,eAAe,EACfG,kBAAkB,EAClBC,gBAAgB,CAElB,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_compose","_keycodes","_blocks","_store","useInput","__unstableIsFullySelected","getSelectedBlockClientIds","__unstableIsSelectionMergeable","hasMultiSelection","useSelect","blockEditorStore","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","useDispatch","useRefEffect","node","onBeforeInput","event","contentEditable","preventDefault","onKeyDown","defaultPrevented","keyCode","ENTER","createBlock","getDefaultBlockName","BACKSPACE","DELETE","key","length","metaKey","ctrlKey","ownerDocument","defaultView","getSelection","removeAllRanges","onCompositionStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// If writing flow is editable, NEVER allow the browser to alter the\n\t\t\t// DOM. This will cause React errors (and the DOM should only be\n\t\t\t// altered in a controlled fashion).\n\t\t\tif ( node.contentEditable === 'true' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnode.contentEditable = false;\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACe,SAASK,QAAQA,CAAA,EAAG;EAClC,MAAM;IACLC,yBAAyB;IACzBC,yBAAyB;IACzBC,8BAA8B;IAC9BC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAiB,CAAC;EACjC,MAAM;IACLC,aAAa;IACbC,wBAAwB;IACxBC,YAAY;IACZC,yBAAyB;IACzBC;EACD,CAAC,GAAG,IAAAC,iBAAW,EAAEN,YAAiB,CAAC;EAEnC,OAAO,IAAAO,qBAAY,EAAIC,IAAI,IAAM;IAChC,SAASC,aAAaA,CAAEC,KAAK,EAAG;MAC/B;MACA;MACA;MACA,IAAKF,IAAI,CAACG,eAAe,KAAK,MAAM,EAAG;QACtCD,KAAK,CAACE,cAAc,CAAC,CAAC;MACvB;IACD;IAEA,SAASC,SAASA,CAAEH,KAAK,EAAG;MAC3B,IAAKA,KAAK,CAACI,gBAAgB,EAAG;QAC7B;MACD;MAEA,IAAK,CAAEhB,iBAAiB,CAAC,CAAC,EAAG;QAC5B;MACD;MAEA,IAAKY,KAAK,CAACK,OAAO,KAAKC,eAAK,EAAG;QAC9BR,IAAI,CAACG,eAAe,GAAG,KAAK;QAC5BD,KAAK,CAACE,cAAc,CAAC,CAAC;QACtB,IAAKjB,yBAAyB,CAAC,CAAC,EAAG;UAClCM,aAAa,CACZL,yBAAyB,CAAC,CAAC,EAC3B,IAAAqB,mBAAW,EAAE,IAAAC,2BAAmB,EAAC,CAAE,CACpC,CAAC;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AAI,CAACiB,aAAa,CAACC,WAAW,CAACC,YAAY,CAAC,CAAC,CAACC,eAAe,CAAC,CAAC;MAChE;IACD;IAEApB,IAAI,CAACsB,gBAAgB,CAAE,aAAa,EAAErB,aAAc,CAAC;IACrDD,IAAI,CAACsB,gBAAgB,CAAE,SAAS,EAAEjB,SAAU,CAAC;IAC7CL,IAAI,CAACsB,gBAAgB,CAAE,kBAAkB,EAAED,kBAAmB,CAAC;IAC/D,OAAO,MAAM;MACZrB,IAAI,CAACuB,mBAAmB,CAAE,aAAa,EAAEtB,aAAc,CAAC;MACxDD,IAAI,CAACuB,mBAAmB,CAAE,SAAS,EAAElB,SAAU,CAAC;MAChDL,IAAI,CAACuB,mBAAmB,CAAE,kBAAkB,EAAEF,kBAAmB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR"}
1
+ {"version":3,"names":["_data","require","_compose","_keycodes","_blocks","_store","useInput","__unstableIsFullySelected","getSelectedBlockClientIds","__unstableIsSelectionMergeable","hasMultiSelection","useSelect","blockEditorStore","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","useDispatch","useRefEffect","node","onBeforeInput","event","contentEditable","preventDefault","onKeyDown","defaultPrevented","keyCode","ENTER","createBlock","getDefaultBlockName","BACKSPACE","DELETE","key","length","metaKey","ctrlKey","ownerDocument","defaultView","getSelection","removeAllRanges","onCompositionStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// If writing flow is editable, NEVER allow the browser to alter the\n\t\t\t// DOM. This will cause React errors (and the DOM should only be\n\t\t\t// altered in a controlled fashion).\n\t\t\tif ( node.contentEditable === 'true' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnode.contentEditable = false;\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,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CL,IAAI,CAACsB,gBAAgB,CAAE,kBAAkB,EAAED,kBAAmB,CAAC;IAC/D,OAAO,MAAM;MACZrB,IAAI,CAACuB,mBAAmB,CAAE,aAAa,EAAEtB,aAAc,CAAC;MACxDD,IAAI,CAACuB,mBAAmB,CAAE,SAAS,EAAElB,SAAU,CAAC;MAChDL,IAAI,CAACuB,mBAAmB,CAAE,kBAAkB,EAAEF,kBAAmB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_data","_store","selector","select","isMultiSelecting","getMultiSelectedBlockClientIds","hasMultiSelection","getSelectedBlockClientId","getSelectedBlocksInitialCaretPosition","__unstableIsFullySelected","blockEditorStore","multiSelectedBlockClientIds","selectedBlockClientId","initialPosition","isFullSelection","useMultiSelection","useSelect","useRefEffect","node","ownerDocument","defaultView","undefined","length","contentEditable","focus","getSelection","removeAllRanges"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-multi-selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nfunction selector( select ) {\n\tconst {\n\t\tisMultiSelecting,\n\t\tgetMultiSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t__unstableIsFullySelected,\n\t} = select( blockEditorStore );\n\n\treturn {\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tmultiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),\n\t\thasMultiSelection: hasMultiSelection(),\n\t\tselectedBlockClientId: getSelectedBlockClientId(),\n\t\tinitialPosition: getSelectedBlocksInitialCaretPosition(),\n\t\tisFullSelection: __unstableIsFullySelected(),\n\t};\n}\n\nexport default function useMultiSelection() {\n\tconst {\n\t\tinitialPosition,\n\t\tisMultiSelecting,\n\t\tmultiSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tselectedBlockClientId,\n\t\tisFullSelection,\n\t} = useSelect( selector, [] );\n\n\t/**\n\t * When the component updates, and there is multi selection, we need to\n\t * select the entire block contents.\n\t */\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t// Allow initialPosition to bypass focus behavior. This is useful\n\t\t\t// for the list view or other areas where we don't want to transfer\n\t\t\t// focus to the editor canvas.\n\t\t\tif ( initialPosition === undefined || initialPosition === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection || isMultiSelecting ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { length } = multiSelectedBlockClientIds;\n\n\t\t\tif ( length < 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! isFullSelection ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Allow cross contentEditable selection by temporarily making\n\t\t\t// all content editable. We can't rely on using the store and\n\t\t\t// React because re-rending happens too slowly. We need to be\n\t\t\t// able to select across instances immediately.\n\t\t\tnode.contentEditable = true;\n\n\t\t\t// For some browsers, like Safari, it is important that focus\n\t\t\t// happens BEFORE selection removal.\n\t\t\tnode.focus();\n\n\t\t\tdefaultView.getSelection().removeAllRanges();\n\t\t},\n\t\t[\n\t\t\thasMultiSelection,\n\t\t\tisMultiSelecting,\n\t\t\tmultiSelectedBlockClientIds,\n\t\t\tselectedBlockClientId,\n\t\t\tinitialPosition,\n\t\t\tisFullSelection,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,QAAQA,CAAEC,MAAM,EAAG;EAC3B,MAA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C,EACD,CACCpB,iBAAiB,EACjBF,gBAAgB,EAChBO,2BAA2B,EAC3BC,qBAAqB,EACrBC,eAAe,EACfC,eAAe,CAEjB,CAAC;AACF"}
1
+ {"version":3,"names":["_compose","require","_data","_store","selector","select","isMultiSelecting","getMultiSelectedBlockClientIds","hasMultiSelection","getSelectedBlockClientId","getSelectedBlocksInitialCaretPosition","__unstableIsFullySelected","blockEditorStore","multiSelectedBlockClientIds","selectedBlockClientId","initialPosition","isFullSelection","useMultiSelection","useSelect","useRefEffect","node","ownerDocument","defaultView","undefined","length","contentEditable","focus","getSelection","removeAllRanges"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-multi-selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nfunction selector( select ) {\n\tconst {\n\t\tisMultiSelecting,\n\t\tgetMultiSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t__unstableIsFullySelected,\n\t} = select( blockEditorStore );\n\n\treturn {\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tmultiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),\n\t\thasMultiSelection: hasMultiSelection(),\n\t\tselectedBlockClientId: getSelectedBlockClientId(),\n\t\tinitialPosition: getSelectedBlocksInitialCaretPosition(),\n\t\tisFullSelection: __unstableIsFullySelected(),\n\t};\n}\n\nexport default function useMultiSelection() {\n\tconst {\n\t\tinitialPosition,\n\t\tisMultiSelecting,\n\t\tmultiSelectedBlockClientIds,\n\t\thasMultiSelection,\n\t\tselectedBlockClientId,\n\t\tisFullSelection,\n\t} = useSelect( selector, [] );\n\n\t/**\n\t * When the component updates, and there is multi selection, we need to\n\t * select the entire block contents.\n\t */\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t// Allow initialPosition to bypass focus behavior. This is useful\n\t\t\t// for the list view or other areas where we don't want to transfer\n\t\t\t// focus to the editor canvas.\n\t\t\tif ( initialPosition === undefined || initialPosition === null ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection || isMultiSelecting ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { length } = multiSelectedBlockClientIds;\n\n\t\t\tif ( length < 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! isFullSelection ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Allow cross contentEditable selection by temporarily making\n\t\t\t// all content editable. We can't rely on using the store and\n\t\t\t// React because re-rending happens too slowly. We need to be\n\t\t\t// able to select across instances immediately.\n\t\t\tnode.contentEditable = true;\n\n\t\t\t// For some browsers, like Safari, it is important that focus\n\t\t\t// happens BEFORE selection removal.\n\t\t\tnode.focus();\n\n\t\t\tdefaultView.getSelection().removeAllRanges();\n\t\t},\n\t\t[\n\t\t\thasMultiSelection,\n\t\t\tisMultiSelecting,\n\t\t\tmultiSelectedBlockClientIds,\n\t\t\tselectedBlockClientId,\n\t\t\tinitialPosition,\n\t\t\tisFullSelection,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,QAAQA,CAAEC,MAAM,EAAG;EAC3B,MAAM;IACLC,gBAAgB;IAChBC,8BAA8B;IAC9BC,iBAAiB;IACjBC,wBAAwB;IACxBC,qCAAqC;IACrCC;EACD,CAAC,GAAGN,MAAM,CAAEO,YAAiB,CAAC;EAE9B,OAAO;IACNN,gBAAgB,EAAEA,gBAAgB,CAAC,CAAC;IACpCO,2BAA2B,EAAEN,8BAA8B,C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