@wordpress/block-editor 14.1.0 → 14.2.1-next.1f6eadc42.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 (705) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -10
  3. package/build/components/block-alignment-matrix-control/index.js +2 -2
  4. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  5. package/build/components/block-breadcrumb/index.js +2 -2
  6. package/build/components/block-breadcrumb/index.js.map +1 -1
  7. package/build/components/block-canvas/index.js +8 -1
  8. package/build/components/block-canvas/index.js.map +1 -1
  9. package/build/components/block-compare/block-view.js +1 -0
  10. package/build/components/block-compare/block-view.js.map +1 -1
  11. package/build/components/block-draggable/index.js +4 -4
  12. package/build/components/block-draggable/index.js.map +1 -1
  13. package/build/components/block-draggable/use-scroll-when-dragging.js +25 -25
  14. package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  15. package/build/components/block-edit/multiple-usage-warning.js +2 -0
  16. package/build/components/block-edit/multiple-usage-warning.js.map +1 -1
  17. package/build/components/block-inspector/index.js +27 -11
  18. package/build/components/block-inspector/index.js.map +1 -1
  19. package/build/components/block-list/block-invalid-warning.js +3 -2
  20. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  21. package/build/components/block-list/block.js +5 -1
  22. package/build/components/block-list/block.js.map +1 -1
  23. package/build/components/block-list/index.js +14 -3
  24. package/build/components/block-list/index.js.map +1 -1
  25. package/build/components/block-list/use-block-props/index.js +5 -1
  26. package/build/components/block-list/use-block-props/index.js.map +1 -1
  27. package/build/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  28. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  29. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +53 -0
  30. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -0
  31. package/build/components/block-list/zoom-out-separator.js +98 -0
  32. package/build/components/block-list/zoom-out-separator.js.map +1 -0
  33. package/build/components/block-lock/toolbar.js +3 -3
  34. package/build/components/block-lock/toolbar.js.map +1 -1
  35. package/build/components/block-mover/button.js +1 -0
  36. package/build/components/block-mover/button.js.map +1 -1
  37. package/build/components/block-mover/index.js +1 -0
  38. package/build/components/block-mover/index.js.map +1 -1
  39. package/build/components/block-navigation/dropdown.js +4 -1
  40. package/build/components/block-navigation/dropdown.js.map +1 -1
  41. package/build/components/block-pattern-setup/index.js +2 -10
  42. package/build/components/block-pattern-setup/index.js.map +1 -1
  43. package/build/components/block-pattern-setup/setup-toolbar.js +22 -7
  44. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  45. package/build/components/block-patterns-list/index.js +12 -20
  46. package/build/components/block-patterns-list/index.js.map +1 -1
  47. package/build/components/block-patterns-paging/index.js +12 -3
  48. package/build/components/block-patterns-paging/index.js.map +1 -1
  49. package/build/components/block-popover/index.js +2 -15
  50. package/build/components/block-popover/index.js.map +1 -1
  51. package/build/components/block-quick-navigation/index.js +4 -1
  52. package/build/components/block-quick-navigation/index.js.map +1 -1
  53. package/build/components/block-settings-menu-controls/index.js +4 -0
  54. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  55. package/build/components/block-switcher/index.js +30 -19
  56. package/build/components/block-switcher/index.js.map +1 -1
  57. package/build/components/block-switcher/pattern-transformations-menu.js +2 -10
  58. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  59. package/build/components/block-toolbar/index.js +19 -12
  60. package/build/components/block-toolbar/index.js.map +1 -1
  61. package/build/components/block-toolbar/shuffle.js +6 -2
  62. package/build/components/block-toolbar/shuffle.js.map +1 -1
  63. package/build/components/block-tools/block-selection-button.js +8 -2
  64. package/build/components/block-tools/block-selection-button.js.map +1 -1
  65. package/build/components/block-tools/block-toolbar-popover.js +10 -6
  66. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  67. package/build/components/block-tools/index.js +1 -1
  68. package/build/components/block-tools/index.js.map +1 -1
  69. package/build/components/block-tools/use-block-toolbar-popover-props.js +2 -1
  70. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  71. package/build/components/block-tools/zoom-out-mode-inserters.js +7 -21
  72. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  73. package/build/components/block-tools/zoom-out-popover.js +3 -4
  74. package/build/components/block-tools/zoom-out-popover.js.map +1 -1
  75. package/build/components/block-tools/zoom-out-toolbar.js +26 -7
  76. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  77. package/build/components/block-variation-picker/index.js +4 -1
  78. package/build/components/block-variation-picker/index.js.map +1 -1
  79. package/build/components/block-variation-transforms/index.js +4 -1
  80. package/build/components/block-variation-transforms/index.js.map +1 -1
  81. package/build/components/button-block-appender/index.js +20 -23
  82. package/build/components/button-block-appender/index.js.map +1 -1
  83. package/build/components/colors-gradients/dropdown.js +4 -1
  84. package/build/components/colors-gradients/dropdown.js.map +1 -1
  85. package/build/components/content-lock/index.js +13 -0
  86. package/build/components/content-lock/index.js.map +1 -0
  87. package/build/components/content-lock/modify-content-lock-menu-item.js +64 -0
  88. package/build/components/content-lock/modify-content-lock-menu-item.js.map +1 -0
  89. package/build/components/editor-styles/index.js +4 -3
  90. package/build/components/editor-styles/index.js.map +1 -1
  91. package/build/components/global-styles/background-panel.js +8 -12
  92. package/build/components/global-styles/background-panel.js.map +1 -1
  93. package/build/components/global-styles/color-panel.js +8 -5
  94. package/build/components/global-styles/color-panel.js.map +1 -1
  95. package/build/components/global-styles/color-panel.native.js +1 -1
  96. package/build/components/global-styles/color-panel.native.js.map +1 -1
  97. package/build/components/global-styles/dimensions-panel.js +34 -37
  98. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  99. package/build/components/global-styles/filters-panel.js +4 -1
  100. package/build/components/global-styles/filters-panel.js.map +1 -1
  101. package/build/components/global-styles/shadow-panel-components.js +14 -17
  102. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  103. package/build/components/global-styles/typography-utils.js +17 -6
  104. package/build/components/global-styles/typography-utils.js.map +1 -1
  105. package/build/components/global-styles/utils.js +4 -6
  106. package/build/components/global-styles/utils.js.map +1 -1
  107. package/build/components/grid/grid-item-movers.js +2 -2
  108. package/build/components/grid/grid-item-movers.js.map +1 -1
  109. package/build/components/grid/grid-item-resizer.js +2 -2
  110. package/build/components/grid/grid-item-resizer.js.map +1 -1
  111. package/build/components/iframe/get-compatibility-styles.js +1 -1
  112. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  113. package/build/components/iframe/index.js +5 -5
  114. package/build/components/iframe/index.js.map +1 -1
  115. package/build/components/inner-blocks/index.js +2 -4
  116. package/build/components/inner-blocks/index.js.map +1 -1
  117. package/build/components/inner-blocks/use-inner-block-template-sync.js +3 -3
  118. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  119. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +4 -1
  120. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  121. package/build/components/inserter/block-patterns-tab/index.js +4 -1
  122. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  123. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +23 -13
  124. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  125. package/build/components/inserter/index.js +4 -11
  126. package/build/components/inserter/index.js.map +1 -1
  127. package/build/components/inserter/library.js +2 -4
  128. package/build/components/inserter/library.js.map +1 -1
  129. package/build/components/inserter/media-tab/hooks.js +3 -3
  130. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  131. package/build/components/inserter/media-tab/media-list.js +1 -8
  132. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  133. package/build/components/inserter/media-tab/media-preview.js +9 -7
  134. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  135. package/build/components/inserter/media-tab/media-tab.js +4 -1
  136. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  137. package/build/components/inserter/menu.js +7 -24
  138. package/build/components/inserter/menu.js.map +1 -1
  139. package/build/components/inserter/quick-inserter.js +4 -5
  140. package/build/components/inserter/quick-inserter.js.map +1 -1
  141. package/build/components/inserter-list-item/index.js +4 -4
  142. package/build/components/inserter-list-item/index.js.map +1 -1
  143. package/build/components/inserter-listbox/index.js +3 -13
  144. package/build/components/inserter-listbox/index.js.map +1 -1
  145. package/build/components/inserter-listbox/item.js +6 -11
  146. package/build/components/inserter-listbox/item.js.map +1 -1
  147. package/build/components/inserter-listbox/row.js +1 -9
  148. package/build/components/inserter-listbox/row.js.map +1 -1
  149. package/build/components/inspector-controls/groups.js +2 -0
  150. package/build/components/inspector-controls/groups.js.map +1 -1
  151. package/build/components/inspector-controls-tabs/index.js +4 -1
  152. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  153. package/build/components/inspector-controls-tabs/settings-tab.js +3 -1
  154. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  155. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -1
  156. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  157. package/build/components/inspector-popover-header/index.js +8 -2
  158. package/build/components/inspector-popover-header/index.js.map +1 -1
  159. package/build/components/letter-spacing-control/index.js +7 -4
  160. package/build/components/letter-spacing-control/index.js.map +1 -1
  161. package/build/components/link-control/index.js +19 -10
  162. package/build/components/link-control/index.js.map +1 -1
  163. package/build/components/link-control/settings-drawer.js +4 -1
  164. package/build/components/link-control/settings-drawer.js.map +1 -1
  165. package/build/components/list-view/block-select-button.js +4 -1
  166. package/build/components/list-view/block-select-button.js.map +1 -1
  167. package/build/components/list-view/index.js +3 -7
  168. package/build/components/list-view/index.js.map +1 -1
  169. package/build/components/media-placeholder/index.js +32 -11
  170. package/build/components/media-placeholder/index.js.map +1 -1
  171. package/build/components/media-replace-flow/index.js +8 -1
  172. package/build/components/media-replace-flow/index.js.map +1 -1
  173. package/build/components/provider/use-block-sync.js +19 -19
  174. package/build/components/provider/use-block-sync.js.map +1 -1
  175. package/build/components/rich-text/event-listeners/paste-handler.js +12 -1
  176. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  177. package/build/components/rich-text/index.js +38 -30
  178. package/build/components/rich-text/index.js.map +1 -1
  179. package/build/components/rich-text/use-mark-persistent.js +5 -5
  180. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  181. package/build/components/skip-to-selected-block/index.js +4 -1
  182. package/build/components/skip-to-selected-block/index.js.map +1 -1
  183. package/build/components/spacing-sizes-control/index.js +8 -9
  184. package/build/components/spacing-sizes-control/index.js.map +1 -1
  185. package/build/components/spacing-sizes-control/linked-button.js +35 -0
  186. package/build/components/spacing-sizes-control/linked-button.js.map +1 -0
  187. package/build/components/spacing-sizes-control/utils.js +4 -15
  188. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  189. package/build/components/tool-selector/index.js +4 -1
  190. package/build/components/tool-selector/index.js.map +1 -1
  191. package/build/components/url-input/button.js +12 -3
  192. package/build/components/url-input/button.js.map +1 -1
  193. package/build/components/url-input/index.js +4 -1
  194. package/build/components/url-input/index.js.map +1 -1
  195. package/build/components/use-block-drop-zone/index.js +31 -7
  196. package/build/components/use-block-drop-zone/index.js.map +1 -1
  197. package/build/components/writing-flow/index.js +2 -1
  198. package/build/components/writing-flow/index.js.map +1 -1
  199. package/build/components/writing-flow/use-arrow-nav.js +4 -1
  200. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  201. package/build/components/writing-flow/use-event-redirect.js +66 -0
  202. package/build/components/writing-flow/use-event-redirect.js.map +1 -0
  203. package/build/components/writing-flow/use-input.js +31 -1
  204. package/build/components/writing-flow/use-input.js.map +1 -1
  205. package/build/components/writing-flow/use-select-all.js +14 -1
  206. package/build/components/writing-flow/use-select-all.js.map +1 -1
  207. package/build/components/writing-flow/use-selection-observer.js +20 -6
  208. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  209. package/build/components/writing-flow/use-tab-nav.js +4 -4
  210. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  211. package/build/components/writing-flow/utils.js +27 -0
  212. package/build/components/writing-flow/utils.js.map +1 -1
  213. package/build/hooks/block-bindings.js +33 -29
  214. package/build/hooks/block-bindings.js.map +1 -1
  215. package/build/hooks/content-lock-ui.js +8 -26
  216. package/build/hooks/content-lock-ui.js.map +1 -1
  217. package/build/hooks/duotone.js +0 -4
  218. package/build/hooks/duotone.js.map +1 -1
  219. package/build/hooks/layout.js +4 -2
  220. package/build/hooks/layout.js.map +1 -1
  221. package/build/hooks/spacing-visualizer.js +3 -3
  222. package/build/hooks/spacing-visualizer.js.map +1 -1
  223. package/build/hooks/style.js +1 -5
  224. package/build/hooks/style.js.map +1 -1
  225. package/build/hooks/use-bindings-attributes.js +19 -20
  226. package/build/hooks/use-bindings-attributes.js.map +1 -1
  227. package/build/hooks/use-zoom-out.js +7 -7
  228. package/build/hooks/use-zoom-out.js.map +1 -1
  229. package/build/layouts/constrained.js +41 -42
  230. package/build/layouts/constrained.js.map +1 -1
  231. package/build/layouts/flex.js +4 -1
  232. package/build/layouts/flex.js.map +1 -1
  233. package/build/layouts/grid.js +19 -16
  234. package/build/layouts/grid.js.map +1 -1
  235. package/build/layouts/utils.js +1 -7
  236. package/build/layouts/utils.js.map +1 -1
  237. package/build/private-apis.js +2 -3
  238. package/build/private-apis.js.map +1 -1
  239. package/build/store/actions.js +2 -7
  240. package/build/store/actions.js.map +1 -1
  241. package/build/store/private-actions.js +1 -0
  242. package/build/store/private-actions.js.map +1 -1
  243. package/build/store/private-keys.js +2 -1
  244. package/build/store/private-keys.js.map +1 -1
  245. package/build/store/private-selectors.js +16 -18
  246. package/build/store/private-selectors.js.map +1 -1
  247. package/build/store/reducer.js +1 -10
  248. package/build/store/reducer.js.map +1 -1
  249. package/build/store/selectors.js +19 -43
  250. package/build/store/selectors.js.map +1 -1
  251. package/build/store/utils.js +48 -0
  252. package/build/store/utils.js.map +1 -1
  253. package/build/utils/block-bindings.js +16 -11
  254. package/build/utils/block-bindings.js.map +1 -1
  255. package/build/utils/dom.js +101 -0
  256. package/build/utils/dom.js.map +1 -1
  257. package/build/utils/get-font-styles-and-weights.js +4 -4
  258. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  259. package/build/utils/transform-styles/index.js +120 -16
  260. package/build/utils/transform-styles/index.js.map +1 -1
  261. package/build-module/components/block-alignment-matrix-control/index.js +1 -1
  262. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  263. package/build-module/components/block-breadcrumb/index.js +2 -2
  264. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  265. package/build-module/components/block-canvas/index.js +9 -1
  266. package/build-module/components/block-canvas/index.js.map +1 -1
  267. package/build-module/components/block-compare/block-view.js +1 -0
  268. package/build-module/components/block-compare/block-view.js.map +1 -1
  269. package/build-module/components/block-draggable/index.js +4 -4
  270. package/build-module/components/block-draggable/index.js.map +1 -1
  271. package/build-module/components/block-draggable/use-scroll-when-dragging.js +25 -25
  272. package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  273. package/build-module/components/block-edit/multiple-usage-warning.js +2 -0
  274. package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
  275. package/build-module/components/block-inspector/index.js +27 -11
  276. package/build-module/components/block-inspector/index.js.map +1 -1
  277. package/build-module/components/block-list/block-invalid-warning.js +3 -2
  278. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  279. package/build-module/components/block-list/block.js +5 -1
  280. package/build-module/components/block-list/block.js.map +1 -1
  281. package/build-module/components/block-list/index.js +14 -3
  282. package/build-module/components/block-list/index.js.map +1 -1
  283. package/build-module/components/block-list/use-block-props/index.js +5 -1
  284. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  285. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  286. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  287. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +47 -0
  288. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -0
  289. package/build-module/components/block-list/zoom-out-separator.js +90 -0
  290. package/build-module/components/block-list/zoom-out-separator.js.map +1 -0
  291. package/build-module/components/block-lock/toolbar.js +3 -3
  292. package/build-module/components/block-lock/toolbar.js.map +1 -1
  293. package/build-module/components/block-mover/button.js +1 -0
  294. package/build-module/components/block-mover/button.js.map +1 -1
  295. package/build-module/components/block-mover/index.js +1 -0
  296. package/build-module/components/block-mover/index.js.map +1 -1
  297. package/build-module/components/block-navigation/dropdown.js +4 -1
  298. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  299. package/build-module/components/block-pattern-setup/index.js +2 -10
  300. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  301. package/build-module/components/block-pattern-setup/setup-toolbar.js +23 -8
  302. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  303. package/build-module/components/block-patterns-list/index.js +12 -20
  304. package/build-module/components/block-patterns-list/index.js.map +1 -1
  305. package/build-module/components/block-patterns-paging/index.js +12 -3
  306. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  307. package/build-module/components/block-popover/index.js +2 -15
  308. package/build-module/components/block-popover/index.js.map +1 -1
  309. package/build-module/components/block-quick-navigation/index.js +4 -1
  310. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  311. package/build-module/components/block-settings-menu-controls/index.js +4 -0
  312. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  313. package/build-module/components/block-switcher/index.js +30 -19
  314. package/build-module/components/block-switcher/index.js.map +1 -1
  315. package/build-module/components/block-switcher/pattern-transformations-menu.js +2 -10
  316. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  317. package/build-module/components/block-toolbar/index.js +19 -12
  318. package/build-module/components/block-toolbar/index.js.map +1 -1
  319. package/build-module/components/block-toolbar/shuffle.js +6 -2
  320. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  321. package/build-module/components/block-tools/block-selection-button.js +8 -2
  322. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  323. package/build-module/components/block-tools/block-toolbar-popover.js +10 -6
  324. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  325. package/build-module/components/block-tools/index.js +1 -1
  326. package/build-module/components/block-tools/index.js.map +1 -1
  327. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -1
  328. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  329. package/build-module/components/block-tools/zoom-out-mode-inserters.js +7 -22
  330. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  331. package/build-module/components/block-tools/zoom-out-popover.js +3 -4
  332. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
  333. package/build-module/components/block-tools/zoom-out-toolbar.js +27 -8
  334. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  335. package/build-module/components/block-variation-picker/index.js +4 -1
  336. package/build-module/components/block-variation-picker/index.js.map +1 -1
  337. package/build-module/components/block-variation-transforms/index.js +4 -1
  338. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  339. package/build-module/components/button-block-appender/index.js +22 -26
  340. package/build-module/components/button-block-appender/index.js.map +1 -1
  341. package/build-module/components/colors-gradients/dropdown.js +4 -1
  342. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  343. package/build-module/components/content-lock/index.js +2 -0
  344. package/build-module/components/content-lock/index.js.map +1 -0
  345. package/build-module/components/content-lock/modify-content-lock-menu-item.js +57 -0
  346. package/build-module/components/content-lock/modify-content-lock-menu-item.js.map +1 -0
  347. package/build-module/components/editor-styles/index.js +4 -3
  348. package/build-module/components/editor-styles/index.js.map +1 -1
  349. package/build-module/components/global-styles/background-panel.js +8 -12
  350. package/build-module/components/global-styles/background-panel.js.map +1 -1
  351. package/build-module/components/global-styles/color-panel.js +7 -4
  352. package/build-module/components/global-styles/color-panel.js.map +1 -1
  353. package/build-module/components/global-styles/color-panel.native.js +2 -2
  354. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  355. package/build-module/components/global-styles/dimensions-panel.js +36 -39
  356. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  357. package/build-module/components/global-styles/filters-panel.js +4 -1
  358. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  359. package/build-module/components/global-styles/shadow-panel-components.js +14 -17
  360. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  361. package/build-module/components/global-styles/typography-utils.js +17 -6
  362. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  363. package/build-module/components/global-styles/utils.js +4 -6
  364. package/build-module/components/global-styles/utils.js.map +1 -1
  365. package/build-module/components/grid/grid-item-movers.js +3 -3
  366. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  367. package/build-module/components/grid/grid-item-resizer.js +2 -2
  368. package/build-module/components/grid/grid-item-resizer.js.map +1 -1
  369. package/build-module/components/iframe/get-compatibility-styles.js +1 -1
  370. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  371. package/build-module/components/iframe/index.js +5 -5
  372. package/build-module/components/iframe/index.js.map +1 -1
  373. package/build-module/components/inner-blocks/index.js +2 -4
  374. package/build-module/components/inner-blocks/index.js.map +1 -1
  375. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +3 -3
  376. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  377. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +4 -1
  378. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  379. package/build-module/components/inserter/block-patterns-tab/index.js +4 -1
  380. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  381. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +23 -13
  382. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  383. package/build-module/components/inserter/index.js +4 -11
  384. package/build-module/components/inserter/index.js.map +1 -1
  385. package/build-module/components/inserter/library.js +2 -4
  386. package/build-module/components/inserter/library.js.map +1 -1
  387. package/build-module/components/inserter/media-tab/hooks.js +3 -3
  388. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  389. package/build-module/components/inserter/media-tab/media-list.js +1 -8
  390. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  391. package/build-module/components/inserter/media-tab/media-preview.js +10 -8
  392. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  393. package/build-module/components/inserter/media-tab/media-tab.js +4 -1
  394. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  395. package/build-module/components/inserter/menu.js +7 -24
  396. package/build-module/components/inserter/menu.js.map +1 -1
  397. package/build-module/components/inserter/quick-inserter.js +5 -6
  398. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  399. package/build-module/components/inserter-list-item/index.js +4 -4
  400. package/build-module/components/inserter-list-item/index.js.map +1 -1
  401. package/build-module/components/inserter-listbox/index.js +3 -11
  402. package/build-module/components/inserter-listbox/index.js.map +1 -1
  403. package/build-module/components/inserter-listbox/item.js +7 -12
  404. package/build-module/components/inserter-listbox/item.js.map +1 -1
  405. package/build-module/components/inserter-listbox/row.js +2 -10
  406. package/build-module/components/inserter-listbox/row.js.map +1 -1
  407. package/build-module/components/inspector-controls/groups.js +2 -0
  408. package/build-module/components/inspector-controls/groups.js.map +1 -1
  409. package/build-module/components/inspector-controls-tabs/index.js +4 -1
  410. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  411. package/build-module/components/inspector-controls-tabs/settings-tab.js +3 -1
  412. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  413. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -1
  414. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  415. package/build-module/components/inspector-popover-header/index.js +8 -2
  416. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  417. package/build-module/components/letter-spacing-control/index.js +7 -4
  418. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  419. package/build-module/components/link-control/index.js +19 -10
  420. package/build-module/components/link-control/index.js.map +1 -1
  421. package/build-module/components/link-control/settings-drawer.js +4 -1
  422. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  423. package/build-module/components/list-view/block-select-button.js +4 -1
  424. package/build-module/components/list-view/block-select-button.js.map +1 -1
  425. package/build-module/components/list-view/index.js +3 -7
  426. package/build-module/components/list-view/index.js.map +1 -1
  427. package/build-module/components/media-placeholder/index.js +32 -11
  428. package/build-module/components/media-placeholder/index.js.map +1 -1
  429. package/build-module/components/media-replace-flow/index.js +8 -1
  430. package/build-module/components/media-replace-flow/index.js.map +1 -1
  431. package/build-module/components/provider/use-block-sync.js +19 -19
  432. package/build-module/components/provider/use-block-sync.js.map +1 -1
  433. package/build-module/components/rich-text/event-listeners/paste-handler.js +12 -1
  434. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  435. package/build-module/components/rich-text/index.js +39 -31
  436. package/build-module/components/rich-text/index.js.map +1 -1
  437. package/build-module/components/rich-text/use-mark-persistent.js +5 -5
  438. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  439. package/build-module/components/skip-to-selected-block/index.js +4 -1
  440. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  441. package/build-module/components/spacing-sizes-control/index.js +9 -10
  442. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  443. package/build-module/components/spacing-sizes-control/linked-button.js +28 -0
  444. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -0
  445. package/build-module/components/spacing-sizes-control/utils.js +4 -15
  446. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  447. package/build-module/components/tool-selector/index.js +4 -1
  448. package/build-module/components/tool-selector/index.js.map +1 -1
  449. package/build-module/components/url-input/button.js +12 -3
  450. package/build-module/components/url-input/button.js.map +1 -1
  451. package/build-module/components/url-input/index.js +4 -1
  452. package/build-module/components/url-input/index.js.map +1 -1
  453. package/build-module/components/use-block-drop-zone/index.js +31 -7
  454. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  455. package/build-module/components/writing-flow/index.js +2 -1
  456. package/build-module/components/writing-flow/index.js.map +1 -1
  457. package/build-module/components/writing-flow/use-arrow-nav.js +4 -1
  458. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  459. package/build-module/components/writing-flow/use-event-redirect.js +60 -0
  460. package/build-module/components/writing-flow/use-event-redirect.js.map +1 -0
  461. package/build-module/components/writing-flow/use-input.js +31 -1
  462. package/build-module/components/writing-flow/use-input.js.map +1 -1
  463. package/build-module/components/writing-flow/use-select-all.js +14 -1
  464. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  465. package/build-module/components/writing-flow/use-selection-observer.js +16 -2
  466. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  467. package/build-module/components/writing-flow/use-tab-nav.js +4 -4
  468. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  469. package/build-module/components/writing-flow/utils.js +26 -0
  470. package/build-module/components/writing-flow/utils.js.map +1 -1
  471. package/build-module/hooks/block-bindings.js +35 -31
  472. package/build-module/hooks/block-bindings.js.map +1 -1
  473. package/build-module/hooks/content-lock-ui.js +10 -30
  474. package/build-module/hooks/content-lock-ui.js.map +1 -1
  475. package/build-module/hooks/duotone.js +0 -4
  476. package/build-module/hooks/duotone.js.map +1 -1
  477. package/build-module/hooks/layout.js +4 -2
  478. package/build-module/hooks/layout.js.map +1 -1
  479. package/build-module/hooks/spacing-visualizer.js +3 -3
  480. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  481. package/build-module/hooks/style.js +1 -5
  482. package/build-module/hooks/style.js.map +1 -1
  483. package/build-module/hooks/use-bindings-attributes.js +19 -20
  484. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  485. package/build-module/hooks/use-zoom-out.js +7 -7
  486. package/build-module/hooks/use-zoom-out.js.map +1 -1
  487. package/build-module/layouts/constrained.js +44 -45
  488. package/build-module/layouts/constrained.js.map +1 -1
  489. package/build-module/layouts/flex.js +4 -1
  490. package/build-module/layouts/flex.js.map +1 -1
  491. package/build-module/layouts/grid.js +21 -18
  492. package/build-module/layouts/grid.js.map +1 -1
  493. package/build-module/layouts/utils.js +1 -7
  494. package/build-module/layouts/utils.js.map +1 -1
  495. package/build-module/private-apis.js +3 -4
  496. package/build-module/private-apis.js.map +1 -1
  497. package/build-module/store/actions.js +2 -7
  498. package/build-module/store/actions.js.map +1 -1
  499. package/build-module/store/private-actions.js +1 -0
  500. package/build-module/store/private-actions.js.map +1 -1
  501. package/build-module/store/private-keys.js +1 -0
  502. package/build-module/store/private-keys.js.map +1 -1
  503. package/build-module/store/private-selectors.js +15 -18
  504. package/build-module/store/private-selectors.js.map +1 -1
  505. package/build-module/store/reducer.js +1 -9
  506. package/build-module/store/reducer.js.map +1 -1
  507. package/build-module/store/selectors.js +22 -46
  508. package/build-module/store/selectors.js.map +1 -1
  509. package/build-module/store/utils.js +46 -0
  510. package/build-module/store/utils.js.map +1 -1
  511. package/build-module/utils/block-bindings.js +17 -12
  512. package/build-module/utils/block-bindings.js.map +1 -1
  513. package/build-module/utils/dom.js +99 -0
  514. package/build-module/utils/dom.js.map +1 -1
  515. package/build-module/utils/get-font-styles-and-weights.js +4 -4
  516. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  517. package/build-module/utils/transform-styles/index.js +120 -16
  518. package/build-module/utils/transform-styles/index.js.map +1 -1
  519. package/build-style/content-rtl.css +19 -11
  520. package/build-style/content.css +19 -11
  521. package/build-style/style-rtl.css +27 -117
  522. package/build-style/style.css +27 -117
  523. package/build-types/utils/dom.d.ts +25 -0
  524. package/build-types/utils/dom.d.ts.map +1 -1
  525. package/package.json +34 -32
  526. package/src/components/block-alignment-matrix-control/index.js +1 -1
  527. package/src/components/block-breadcrumb/index.js +2 -2
  528. package/src/components/block-breadcrumb/style.scss +1 -30
  529. package/src/components/block-canvas/index.js +9 -1
  530. package/src/components/block-compare/block-view.js +6 -1
  531. package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
  532. package/src/components/block-draggable/content.scss +1 -1
  533. package/src/components/block-draggable/index.js +4 -4
  534. package/src/components/block-draggable/style.scss +1 -1
  535. package/src/components/block-draggable/use-scroll-when-dragging.js +25 -25
  536. package/src/components/block-edit/multiple-usage-warning.js +2 -0
  537. package/src/components/block-inspector/index.js +22 -7
  538. package/src/components/block-inspector/style.scss +2 -4
  539. package/src/components/block-list/block-invalid-warning.js +3 -2
  540. package/src/components/block-list/block.js +6 -2
  541. package/src/components/block-list/content.scss +23 -3
  542. package/src/components/block-list/index.js +59 -38
  543. package/src/components/block-list/use-block-props/index.js +3 -0
  544. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  545. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +56 -0
  546. package/src/components/block-list/zoom-out-separator.js +110 -0
  547. package/src/components/block-lock/style.scss +1 -1
  548. package/src/components/block-lock/toolbar.js +3 -3
  549. package/src/components/block-mover/button.js +1 -0
  550. package/src/components/block-mover/index.js +1 -0
  551. package/src/components/block-mover/style.scss +1 -1
  552. package/src/components/block-navigation/dropdown.js +2 -0
  553. package/src/components/block-pattern-setup/index.js +3 -15
  554. package/src/components/block-pattern-setup/setup-toolbar.js +17 -4
  555. package/src/components/block-pattern-setup/style.scss +2 -2
  556. package/src/components/block-patterns-list/index.js +15 -18
  557. package/src/components/block-patterns-list/style.scss +2 -2
  558. package/src/components/block-patterns-paging/index.js +6 -0
  559. package/src/components/block-popover/index.js +7 -28
  560. package/src/components/block-popover/style.scss +1 -1
  561. package/src/components/block-quick-navigation/index.js +2 -0
  562. package/src/components/block-settings-menu-controls/index.js +7 -1
  563. package/src/components/block-switcher/index.js +45 -23
  564. package/src/components/block-switcher/pattern-transformations-menu.js +3 -12
  565. package/src/components/block-switcher/style.scss +5 -30
  566. package/src/components/block-toolbar/index.js +27 -11
  567. package/src/components/block-toolbar/shuffle.js +9 -7
  568. package/src/components/block-toolbar/style.scss +4 -1
  569. package/src/components/block-tools/block-selection-button.js +4 -0
  570. package/src/components/block-tools/block-toolbar-popover.js +10 -6
  571. package/src/components/block-tools/index.js +1 -1
  572. package/src/components/block-tools/style.scss +3 -4
  573. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -1
  574. package/src/components/block-tools/zoom-out-mode-inserters.js +2 -17
  575. package/src/components/block-tools/zoom-out-popover.js +3 -7
  576. package/src/components/block-tools/zoom-out-toolbar.js +31 -6
  577. package/src/components/block-variation-picker/README.md +2 -2
  578. package/src/components/block-variation-picker/index.js +6 -1
  579. package/src/components/block-variation-transforms/index.js +2 -0
  580. package/src/components/block-variation-transforms/style.scss +1 -1
  581. package/src/components/button-block-appender/content.scss +0 -1
  582. package/src/components/button-block-appender/index.js +30 -28
  583. package/src/components/color-palette/test/control.js +15 -2
  584. package/src/components/colors-gradients/dropdown.js +5 -1
  585. package/src/components/colors-gradients/style.scss +4 -4
  586. package/src/components/content-lock/index.js +1 -0
  587. package/src/components/content-lock/modify-content-lock-menu-item.js +58 -0
  588. package/src/components/default-block-appender/content.scss +0 -1
  589. package/src/components/editor-styles/index.js +4 -3
  590. package/src/components/global-styles/background-panel.js +6 -14
  591. package/src/components/global-styles/color-panel.js +8 -4
  592. package/src/components/global-styles/color-panel.native.js +2 -2
  593. package/src/components/global-styles/dimensions-panel.js +40 -40
  594. package/src/components/global-styles/filters-panel.js +5 -1
  595. package/src/components/global-styles/shadow-panel-components.js +11 -15
  596. package/src/components/global-styles/style.scss +3 -4
  597. package/src/components/global-styles/test/typography-utils.js +96 -5
  598. package/src/components/global-styles/test/utils.js +10 -0
  599. package/src/components/global-styles/typography-utils.js +22 -6
  600. package/src/components/global-styles/utils.js +4 -6
  601. package/src/components/grid/grid-item-movers.js +3 -3
  602. package/src/components/grid/grid-item-resizer.js +2 -2
  603. package/src/components/grid/style.scss +1 -1
  604. package/src/components/iframe/get-compatibility-styles.js +6 -1
  605. package/src/components/iframe/index.js +5 -5
  606. package/src/components/inner-blocks/index.js +2 -2
  607. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -3
  608. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -0
  609. package/src/components/inserter/block-patterns-tab/index.js +2 -0
  610. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +32 -15
  611. package/src/components/inserter/index.js +4 -10
  612. package/src/components/inserter/library.js +0 -2
  613. package/src/components/inserter/media-tab/hooks.js +3 -3
  614. package/src/components/inserter/media-tab/media-list.js +1 -7
  615. package/src/components/inserter/media-tab/media-preview.js +15 -8
  616. package/src/components/inserter/media-tab/media-tab.js +2 -0
  617. package/src/components/inserter/menu.js +15 -29
  618. package/src/components/inserter/quick-inserter.js +3 -4
  619. package/src/components/inserter/style.scss +10 -17
  620. package/src/components/inserter-list-item/index.js +4 -4
  621. package/src/components/inserter-list-item/style.scss +1 -3
  622. package/src/components/inserter-listbox/index.js +2 -11
  623. package/src/components/inserter-listbox/item.js +12 -14
  624. package/src/components/inserter-listbox/row.js +2 -9
  625. package/src/components/inspector-controls/groups.js +2 -0
  626. package/src/components/inspector-controls-tabs/index.js +2 -0
  627. package/src/components/inspector-controls-tabs/settings-tab.js +1 -0
  628. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +5 -2
  629. package/src/components/inspector-popover-header/index.js +4 -0
  630. package/src/components/letter-spacing-control/README.md +8 -1
  631. package/src/components/letter-spacing-control/index.js +7 -4
  632. package/src/components/link-control/index.js +17 -8
  633. package/src/components/link-control/settings-drawer.js +2 -0
  634. package/src/components/link-control/style.scss +1 -3
  635. package/src/components/list-view/block-select-button.js +2 -0
  636. package/src/components/list-view/index.js +3 -8
  637. package/src/components/list-view/style.scss +14 -16
  638. package/src/components/media-placeholder/README.md +2 -2
  639. package/src/components/media-placeholder/index.js +21 -4
  640. package/src/components/media-replace-flow/index.js +12 -1
  641. package/src/components/provider/use-block-sync.js +20 -20
  642. package/src/components/responsive-block-control/README.md +3 -27
  643. package/src/components/rich-text/content.scss +1 -1
  644. package/src/components/rich-text/event-listeners/paste-handler.js +6 -1
  645. package/src/components/rich-text/index.js +54 -41
  646. package/src/components/rich-text/style.scss +1 -1
  647. package/src/components/rich-text/use-mark-persistent.js +5 -5
  648. package/src/components/skip-to-selected-block/index.js +2 -0
  649. package/src/components/spacing-sizes-control/index.js +10 -13
  650. package/src/components/spacing-sizes-control/linked-button.js +32 -0
  651. package/src/components/spacing-sizes-control/style.scss +1 -0
  652. package/src/components/spacing-sizes-control/test/utils.js +14 -15
  653. package/src/components/spacing-sizes-control/utils.js +5 -18
  654. package/src/components/tool-selector/index.js +2 -0
  655. package/src/components/url-input/button.js +6 -0
  656. package/src/components/url-input/index.js +2 -0
  657. package/src/components/url-popover/stories/index.story.js +7 -1
  658. package/src/components/use-block-drop-zone/index.js +37 -5
  659. package/src/components/warning/content.scss +3 -10
  660. package/src/components/writing-flow/index.js +2 -0
  661. package/src/components/writing-flow/use-arrow-nav.js +9 -2
  662. package/src/components/writing-flow/use-event-redirect.js +72 -0
  663. package/src/components/writing-flow/use-input.js +36 -1
  664. package/src/components/writing-flow/use-select-all.js +18 -1
  665. package/src/components/writing-flow/use-selection-observer.js +23 -3
  666. package/src/components/writing-flow/use-tab-nav.js +4 -4
  667. package/src/components/writing-flow/utils.js +30 -0
  668. package/src/hooks/block-bindings.js +42 -43
  669. package/src/hooks/block-bindings.scss +1 -9
  670. package/src/hooks/content-lock-ui.js +11 -36
  671. package/src/hooks/duotone.js +0 -4
  672. package/src/hooks/layout.js +2 -1
  673. package/src/hooks/layout.scss +5 -27
  674. package/src/hooks/spacing-visualizer.js +3 -3
  675. package/src/hooks/style.js +1 -4
  676. package/src/hooks/use-bindings-attributes.js +23 -24
  677. package/src/hooks/use-zoom-out.js +7 -7
  678. package/src/layouts/constrained.js +53 -48
  679. package/src/layouts/flex.js +2 -0
  680. package/src/layouts/grid.js +29 -22
  681. package/src/layouts/test/grid.js +2 -2
  682. package/src/layouts/test/utils.js +6 -8
  683. package/src/layouts/utils.js +1 -9
  684. package/src/private-apis.js +2 -2
  685. package/src/store/actions.js +4 -6
  686. package/src/store/private-actions.js +1 -0
  687. package/src/store/private-keys.js +1 -0
  688. package/src/store/private-selectors.js +18 -14
  689. package/src/store/reducer.js +0 -7
  690. package/src/store/selectors.js +32 -51
  691. package/src/store/utils.js +50 -0
  692. package/src/utils/block-bindings.js +15 -16
  693. package/src/utils/dom.js +117 -0
  694. package/src/utils/get-font-styles-and-weights.js +12 -4
  695. package/src/utils/test/get-font-styles-and-weights.js +148 -0
  696. package/src/utils/test/transform-styles.js +259 -50
  697. package/src/utils/transform-styles/index.js +132 -21
  698. package/tsconfig.json +1 -0
  699. package/tsconfig.tsbuildinfo +1 -1
  700. package/build/components/spacing-sizes-control/sides-dropdown/index.js +0 -86
  701. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +0 -1
  702. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +0 -81
  703. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +0 -1
  704. package/src/components/spacing-sizes-control/sides-dropdown/index.js +0 -91
  705. package/src/utils/test/__snapshots__/transform-styles.js.snap +0 -109
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","blockBindingsKey","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useBlockRefProvider","useIntersectionObserver","useScrollIntoView","useFlashEditableBlocks","canBindBlock","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","blockLabel","htmlSuffix","mergedRefs","ref","triggerAnimationOnChange","isDisabled","isEnabled","blockEditContext","hasBlockBindings","bindingsStyle","globalThis","SCRIPT_DEBUG","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","id","role","inert","undefined","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAIC,aAAa,QAAQ,mBAAmB;AAC5E,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,gBAAgB,EAChBC,mBAAmB,QACb,0BAA0B;AACjC,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,sBAAsB,QAAQ,iCAAiC;AACxE,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3,"names":["clsx","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","blockBindingsKey","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useZoomOutModeExit","useBlockRefProvider","useIntersectionObserver","useScrollIntoView","useFlashEditableBlocks","canBindBlock","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","editorMode","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","blockLabel","htmlSuffix","mergedRefs","ref","triggerAnimationOnChange","isDisabled","isEnabled","blockEditContext","hasBlockBindings","bindingsStyle","globalThis","SCRIPT_DEBUG","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","id","role","inert","undefined","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\teditorMode,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseZoomOutModeExit( { editorMode } ),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAA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,MAAM,GAAGwC,SAAS;IAC7ClD,SAAS,EAAE5B,IAAI,CACd,gCAAgC,EAChC;MACC;MACA,UAAU,EAAE,CAAE8B,SAAS;MACvB,mBAAmB,EAAES,UAAU;MAC/B,aAAa,EAAEF,UAAU;MACzB,gBAAgB,EAAEK,aAAa;MAC/B,mBAAmB,EAAEC,eAAe;MACpC,uBAAuB,EAAEC,mBAAmB;MAC5C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEgB,iBAAiB;MACxC,iDAAiD,EAChDf;IACF,CAAC,EACDxB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtByB,gBACD,CAAC;IACDe,KAAK,EAAE;MAAE,GAAGvC,YAAY,CAACuC,KAAK;MAAE,GAAG3C,KAAK,CAAC2C,KAAK;MAAE,GAAGJ;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAxC,aAAa,CAACuD,IAAI,GAAG1E,aAAa","ignoreList":[]}
@@ -59,6 +59,7 @@ export function useFocusFirstElement({
59
59
  const isReverse = -1 === initialPosition;
60
60
  const target = textInputs[isReverse ? textInputs.length - 1 : 0] || ref.current;
61
61
  if (!isInsideRootBlock(ref.current, target)) {
62
+ ownerDocument.defaultView.getSelection().removeAllRanges();
62
63
  ref.current.focus();
63
64
  return;
64
65
  }
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","focus","isFormElement","isTextField","placeCaretAtHorizontalEdge","useSelect","isInsideRootBlock","store","blockEditorStore","useFocusFirstElement","clientId","initialPosition","ref","isBlockSelected","isMultiSelecting","__unstableGetEditorMode","undefined","current","ownerDocument","activeElement","textInputs","tabbable","find","filter","node","isReverse","target","length","getAttribute","focusElement","findNext"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-focus-first-element.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tfocus,\n\tisFormElement,\n\tisTextField,\n\tplaceCaretAtHorizontalEdge,\n} from '@wordpress/dom';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { isInsideRootBlock } from '../../../utils/dom';\nimport { store as blockEditorStore } from '../../../store';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * Transitions focus to the block or inner tabbable when the block becomes\n * selected and an initial position is set.\n *\n * @param {string} clientId Block client ID.\n *\n * @return {RefObject} React ref with the block element.\n */\nexport function useFocusFirstElement( { clientId, initialPosition } ) {\n\tconst ref = useRef();\n\tconst { isBlockSelected, isMultiSelecting, __unstableGetEditorMode } =\n\t\tuseSelect( blockEditorStore );\n\n\tuseEffect( () => {\n\t\t// Check if the block is still selected at the time this effect runs.\n\t\tif (\n\t\t\t! isBlockSelected( clientId ) ||\n\t\t\tisMultiSelecting() ||\n\t\t\t__unstableGetEditorMode() === 'zoom-out'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( initialPosition === undefined || initialPosition === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = ref.current;\n\n\t\t// Do not focus the block if it already contains the active element.\n\t\tif ( isInsideRootBlock( ref.current, ownerDocument.activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find all tabbables within node.\n\t\tconst textInputs = focus.tabbable\n\t\t\t.find( ref.current )\n\t\t\t.filter( ( node ) => isTextField( node ) );\n\n\t\t// If reversed (e.g. merge via backspace), use the last in the set of\n\t\t// tabbables.\n\t\tconst isReverse = -1 === initialPosition;\n\t\tconst target =\n\t\t\ttextInputs[ isReverse ? textInputs.length - 1 : 0 ] || ref.current;\n\n\t\tif ( ! isInsideRootBlock( ref.current, target ) ) {\n\t\t\tref.current.focus();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check to see if element is focussable before a generic caret insert.\n\t\tif ( ! ref.current.getAttribute( 'contenteditable' ) ) {\n\t\t\tconst focusElement = focus.tabbable.findNext( ref.current );\n\t\t\t// Make sure focusElement is valid, contained in the same block, and a form field.\n\t\t\tif (\n\t\t\t\tfocusElement &&\n\t\t\t\tisInsideRootBlock( ref.current, focusElement ) &&\n\t\t\t\tisFormElement( focusElement )\n\t\t\t) {\n\t\t\t\tfocusElement.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tplaceCaretAtHorizontalEdge( target, isReverse );\n\t}, [ initialPosition, clientId ] );\n\n\treturn ref;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SACCC,KAAK,EACLC,aAAa,EACbC,WAAW,EACXC,0BAA0B,QACpB,gBAAgB;AACvB,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAE;EAAEC,QAAQ;EAAEC;AAAgB,CAAC,EAAG;EACrE,MAAMC,GAAG,GAAGZ,MAAM,CAAC,CAAC;EACpB,MAAM;IAAEa,eAAe;IAAEC,gBAAgB;IAAEC;EAAwB,CAAC,GACnEV,SAAS,CAAEG,gBAAiB,CAAC;EAE9BT,SAAS,CAAE,MAAM;IAChB;IACA,IACC,CAAEc,eAAe,CAAEH,QAAS,CAAC,IAC7BI,gBAAgB,CAAC,CAAC,IAClBC,uBAAuB,CAAC,CAAC,KAAK,UAAU,EACvC;MACD;IACD;IAEA,IAAKJ,eAAe,KAAKK,SAAS,IAAIL,eAAe,K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1
+ {"version":3,"names":["useEffect","useRef","focus","isFormElement","isTextField","placeCaretAtHorizontalEdge","useSelect","isInsideRootBlock","store","blockEditorStore","useFocusFirstElement","clientId","initialPosition","ref","isBlockSelected","isMultiSelecting","__unstableGetEditorMode","undefined","current","ownerDocument","activeElement","textInputs","tabbable","find","filter","node","isReverse","target","length","defaultView","getSelection","removeAllRanges","getAttribute","focusElement","findNext"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-focus-first-element.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tfocus,\n\tisFormElement,\n\tisTextField,\n\tplaceCaretAtHorizontalEdge,\n} from '@wordpress/dom';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { isInsideRootBlock } from '../../../utils/dom';\nimport { store as blockEditorStore } from '../../../store';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * Transitions focus to the block or inner tabbable when the block becomes\n * selected and an initial position is set.\n *\n * @param {string} clientId Block client ID.\n *\n * @return {RefObject} React ref with the block element.\n */\nexport function useFocusFirstElement( { clientId, initialPosition } ) {\n\tconst ref = useRef();\n\tconst { isBlockSelected, isMultiSelecting, __unstableGetEditorMode } =\n\t\tuseSelect( blockEditorStore );\n\n\tuseEffect( () => {\n\t\t// Check if the block is still selected at the time this effect runs.\n\t\tif (\n\t\t\t! isBlockSelected( clientId ) ||\n\t\t\tisMultiSelecting() ||\n\t\t\t__unstableGetEditorMode() === 'zoom-out'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( initialPosition === undefined || initialPosition === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { ownerDocument } = ref.current;\n\n\t\t// Do not focus the block if it already contains the active element.\n\t\tif ( isInsideRootBlock( ref.current, ownerDocument.activeElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find all tabbables within node.\n\t\tconst textInputs = focus.tabbable\n\t\t\t.find( ref.current )\n\t\t\t.filter( ( node ) => isTextField( node ) );\n\n\t\t// If reversed (e.g. merge via backspace), use the last in the set of\n\t\t// tabbables.\n\t\tconst isReverse = -1 === initialPosition;\n\t\tconst target =\n\t\t\ttextInputs[ isReverse ? textInputs.length - 1 : 0 ] || ref.current;\n\n\t\tif ( ! isInsideRootBlock( ref.current, target ) ) {\n\t\t\townerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\tref.current.focus();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check to see if element is focussable before a generic caret insert.\n\t\tif ( ! ref.current.getAttribute( 'contenteditable' ) ) {\n\t\t\tconst focusElement = focus.tabbable.findNext( ref.current );\n\t\t\t// Make sure focusElement is valid, contained in the same block, and a form field.\n\t\t\tif (\n\t\t\t\tfocusElement &&\n\t\t\t\tisInsideRootBlock( ref.current, focusElement ) &&\n\t\t\t\tisFormElement( focusElement )\n\t\t\t) {\n\t\t\t\tfocusElement.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tplaceCaretAtHorizontalEdge( target, isReverse );\n\t}, [ initialPosition, clientId ] );\n\n\treturn ref;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SACCC,KAAK,EACLC,aAAa,EACbC,WAAW,EACXC,0BAA0B,QACpB,gBAAgB;AACvB,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAE;EAAEC,QAAQ;EAAEC;AAAgB,CAAC,EAAG;EACrE,MAAMC,GAAG,GAAGZ,MAAM,CAAC,CAAC;EACpB,MAAM;IAAEa,eAAe;IAAEC,gBAAg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CAACK,OAAQ,CAAC;MAC3D;MACA,IACCe,YAAY,IACZ1B,iBAAiB,CAAEM,GAAG,CAACK,OAAO,EAAEe,YAAa,CAAC,IAC9C9B,aAAa,CAAE8B,YAAa,CAAC,EAC5B;QACDA,YAAY,CAAC/B,KAAK,CAAC,CAAC;QACpB;MACD;IACD;IACAG,0BAA0B,CAAEsB,MAAM,EAAED,SAAU,CAAC;EAChD,CAAC,EAAE,CAAEd,eAAe,EAAED,QAAQ,CAAG,CAAC;EAElC,OAAOE,GAAG;AACX","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { useRefEffect } from '@wordpress/compose';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { store as blockEditorStore } from '../../../store';
11
+ import { unlock } from '../../../lock-unlock';
12
+
13
+ /**
14
+ * Allows Zoom Out mode to be exited by double clicking in the selected block.
15
+ *
16
+ * @param {string} clientId Block client ID.
17
+ */
18
+ export function useZoomOutModeExit({
19
+ editorMode
20
+ }) {
21
+ const getSettings = useSelect(select => select(blockEditorStore).getSettings);
22
+ const {
23
+ __unstableSetEditorMode
24
+ } = unlock(useDispatch(blockEditorStore));
25
+ return useRefEffect(node => {
26
+ if (editorMode !== 'zoom-out') {
27
+ return;
28
+ }
29
+ function onDoubleClick(event) {
30
+ if (!event.defaultPrevented) {
31
+ event.preventDefault();
32
+ const {
33
+ __experimentalSetIsInserterOpened
34
+ } = getSettings();
35
+ if (typeof __experimentalSetIsInserterOpened === 'function') {
36
+ __experimentalSetIsInserterOpened(false);
37
+ }
38
+ __unstableSetEditorMode('edit');
39
+ }
40
+ }
41
+ node.addEventListener('dblclick', onDoubleClick);
42
+ return () => {
43
+ node.removeEventListener('dblclick', onDoubleClick);
44
+ };
45
+ }, [editorMode, __unstableSetEditorMode]);
46
+ }
47
+ //# sourceMappingURL=use-zoom-out-mode-exit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","useDispatch","useRefEffect","store","blockEditorStore","unlock","useZoomOutModeExit","editorMode","getSettings","select","__unstableSetEditorMode","node","onDoubleClick","event","defaultPrevented","preventDefault","__experimentalSetIsInserterOpened","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-zoom-out-mode-exit.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 { unlock } from '../../../lock-unlock';\n\n/**\n * Allows Zoom Out mode to be exited by double clicking in the selected block.\n *\n * @param {string} clientId Block client ID.\n */\nexport function useZoomOutModeExit( { editorMode } ) {\n\tconst getSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings\n\t);\n\n\tconst { __unstableSetEditorMode } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( editorMode !== 'zoom-out' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onDoubleClick( event ) {\n\t\t\t\tif ( ! event.defaultPrevented ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tconst { __experimentalSetIsInserterOpened } = getSettings();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof __experimentalSetIsInserterOpened === 'function'\n\t\t\t\t\t) {\n\t\t\t\t\t\t__experimentalSetIsInserterOpened( false );\n\t\t\t\t\t}\n\t\t\t\t\t__unstableSetEditorMode( 'edit' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'dblclick', onDoubleClick );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'dblclick', onDoubleClick );\n\t\t\t};\n\t\t},\n\t\t[ editorMode, __unstableSetEditorMode ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,sBAAsB;;AAE7C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EACpD,MAAMC,WAAW,GAAGR,SAAS,CAC1BS,MAAM,IAAMA,MAAM,CAAEL,gBAAiB,CAAC,CAACI,WAC1C,CAAC;EAED,MAAM;IAAEE;EAAwB,CAAC,GAAGL,MAAM,CACzCJ,WAAW,CAAEG,gBAAiB,CAC/B,CAAC;EAED,OAAOF,YAAY,CAChBS,IAAI,IAAM;IACX,IAAKJ,UAAU,KAAK,UAAU,EAAG;MAChC;IACD;IAEA,SAASK,aAAaA,CAAEC,KAAK,EAAG;MAC/B,IAAK,CAAEA,KAAK,CAACC,gBAAgB,EAAG;QAC/BD,KAAK,CAACE,cAAc,CAAC,CAAC;QAEtB,MAAM;UAAEC;QAAkC,CAAC,GAAGR,WAAW,CAAC,CAAC;QAE3D,IACC,OAAOQ,iCAAiC,KAAK,UAAU,EACtD;UACDA,iCAAiC,CAAE,KAAM,CAAC;QAC3C;QACAN,uBAAuB,CAAE,MAAO,CAAC;MAClC;IACD;IAEAC,IAAI,CAACM,gBAAgB,CAAE,UAAU,EAAEL,aAAc,CAAC;IAElD,OAAO,MAAM;MACZD,IAAI,CAACO,mBAAmB,CAAE,UAAU,EAAEN,aAAc,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAEL,UAAU,EAAEG,uBAAuB,CACtC,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { __unstableMotion as motion, __unstableAnimatePresence as AnimatePresence } from '@wordpress/components';
10
+ import { useReducedMotion } from '@wordpress/compose';
11
+ import { useSelect } from '@wordpress/data';
12
+ import { useState } from '@wordpress/element';
13
+
14
+ /**
15
+ * Internal dependencies
16
+ */
17
+ import { store as blockEditorStore } from '../../store';
18
+ import { unlock } from '../../lock-unlock';
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ export function ZoomOutSeparator({
21
+ clientId,
22
+ rootClientId = '',
23
+ position = 'top'
24
+ }) {
25
+ const [isDraggedOver, setIsDraggedOver] = useState(false);
26
+ const {
27
+ sectionRootClientId,
28
+ sectionClientIds,
29
+ blockInsertionPoint,
30
+ blockInsertionPointVisible
31
+ } = useSelect(select => {
32
+ const {
33
+ getBlockInsertionPoint,
34
+ getBlockOrder,
35
+ isBlockInsertionPointVisible,
36
+ getSectionRootClientId
37
+ } = unlock(select(blockEditorStore));
38
+ const root = getSectionRootClientId();
39
+ const sectionRootClientIds = getBlockOrder(root);
40
+ return {
41
+ sectionRootClientId: root,
42
+ sectionClientIds: sectionRootClientIds,
43
+ blockOrder: getBlockOrder(root),
44
+ blockInsertionPoint: getBlockInsertionPoint(),
45
+ blockInsertionPointVisible: isBlockInsertionPointVisible()
46
+ };
47
+ }, []);
48
+ const isReducedMotion = useReducedMotion();
49
+ if (!clientId) {
50
+ return;
51
+ }
52
+ let isVisible = false;
53
+ const isSectionBlock = rootClientId === sectionRootClientId && sectionClientIds && sectionClientIds.includes(clientId);
54
+ if (!isSectionBlock) {
55
+ return null;
56
+ }
57
+ if (position === 'top') {
58
+ isVisible = blockInsertionPointVisible && blockInsertionPoint.index === 0 && clientId === sectionClientIds[blockInsertionPoint.index];
59
+ }
60
+ if (position === 'bottom') {
61
+ isVisible = blockInsertionPointVisible && clientId === sectionClientIds[blockInsertionPoint.index - 1];
62
+ }
63
+ return /*#__PURE__*/_jsx(AnimatePresence, {
64
+ children: isVisible && /*#__PURE__*/_jsx(motion.div, {
65
+ as: "button",
66
+ layout: !isReducedMotion,
67
+ initial: {
68
+ height: 0
69
+ },
70
+ animate: {
71
+ height: '120px'
72
+ },
73
+ exit: {
74
+ height: 0
75
+ },
76
+ transition: {
77
+ type: 'tween',
78
+ duration: 0.2,
79
+ ease: [0.6, 0, 0.4, 1]
80
+ },
81
+ className: clsx('block-editor-block-list__zoom-out-separator', {
82
+ 'is-dragged-over': isDraggedOver
83
+ }),
84
+ "data-is-insertion-point": "true",
85
+ onDragOver: () => setIsDraggedOver(true),
86
+ onDragLeave: () => setIsDraggedOver(false)
87
+ })
88
+ });
89
+ }
90
+ //# sourceMappingURL=zoom-out-separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["clsx","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","useReducedMotion","useSelect","useState","store","blockEditorStore","unlock","jsx","_jsx","ZoomOutSeparator","clientId","rootClientId","position","isDraggedOver","setIsDraggedOver","sectionRootClientId","sectionClientIds","blockInsertionPoint","blockInsertionPointVisible","select","getBlockInsertionPoint","getBlockOrder","isBlockInsertionPointVisible","getSectionRootClientId","root","sectionRootClientIds","blockOrder","isReducedMotion","isVisible","isSectionBlock","includes","index","children","div","as","layout","initial","height","animate","exit","transition","type","duration","ease","className","onDragOver","onDragLeave"],"sources":["@wordpress/block-editor/src/components/block-list/zoom-out-separator.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport function ZoomOutSeparator( {\n\tclientId,\n\trootClientId = '',\n\tposition = 'top',\n} ) {\n\tconst [ isDraggedOver, setIsDraggedOver ] = useState( false );\n\tconst {\n\t\tsectionRootClientId,\n\t\tsectionClientIds,\n\t\tblockInsertionPoint,\n\t\tblockInsertionPointVisible,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockInsertionPoint,\n\t\t\tgetBlockOrder,\n\t\t\tisBlockInsertionPointVisible,\n\t\t\tgetSectionRootClientId,\n\t\t} = unlock( select( blockEditorStore ) );\n\n\t\tconst root = getSectionRootClientId();\n\t\tconst sectionRootClientIds = getBlockOrder( root );\n\t\treturn {\n\t\t\tsectionRootClientId: root,\n\t\t\tsectionClientIds: sectionRootClientIds,\n\t\t\tblockOrder: getBlockOrder( root ),\n\t\t\tblockInsertionPoint: getBlockInsertionPoint(),\n\t\t\tblockInsertionPointVisible: isBlockInsertionPointVisible(),\n\t\t};\n\t}, [] );\n\n\tconst isReducedMotion = useReducedMotion();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tlet isVisible = false;\n\n\tconst isSectionBlock =\n\t\trootClientId === sectionRootClientId &&\n\t\tsectionClientIds &&\n\t\tsectionClientIds.includes( clientId );\n\n\tif ( ! isSectionBlock ) {\n\t\treturn null;\n\t}\n\n\tif ( position === 'top' ) {\n\t\tisVisible =\n\t\t\tblockInsertionPointVisible &&\n\t\t\tblockInsertionPoint.index === 0 &&\n\t\t\tclientId === sectionClientIds[ blockInsertionPoint.index ];\n\t}\n\n\tif ( position === 'bottom' ) {\n\t\tisVisible =\n\t\t\tblockInsertionPointVisible &&\n\t\t\tclientId === sectionClientIds[ blockInsertionPoint.index - 1 ];\n\t}\n\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{ isVisible && (\n\t\t\t\t<motion.div\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\tlayout={ ! isReducedMotion }\n\t\t\t\t\tinitial={ { height: 0 } }\n\t\t\t\t\tanimate={ { height: '120px' } }\n\t\t\t\t\texit={ { height: 0 } }\n\t\t\t\t\ttransition={ {\n\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\tduration: 0.2,\n\t\t\t\t\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-block-list__zoom-out-separator',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-dragged-over': isDraggedOver,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tdata-is-insertion-point=\"true\"\n\t\t\t\t\tonDragOver={ () => setIsDraggedOver( true ) }\n\t\t\t\t\tonDragLeave={ () => setIsDraggedOver( false ) }\n\t\t\t\t></motion.div>\n\t\t\t) }\n\t\t</AnimatePresence>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,OAAO,SAASC,gBAAgBA,CAAE;EACjCC,QAAQ;EACRC,YAAY,GAAG,EAAE;EACjBC,QAAQ,GAAG;AACZ,CAAC,EAAG;EACH,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAGX,QAAQ,CAAE,KAAM,CAAC;EAC7D,MAAM;IACLY,mBAAmB;IACnBC,gBAAgB;IAChBC,mBAAmB;IACnBC;EACD,CAAC,GAAGhB,SAAS,CAAIiB,MAAM,IAAM;IAC5B,MAAM;MACLC,sBAAsB;MACtBC,aAAa;MACbC,4BAA4B;MAC5BC;IACD,CAAC,GAAGjB,MAAM,CAAEa,MAAM,CAAEd,gBAAiB,CAAE,CAAC;IAExC,MAAMmB,IAAI,GAAGD,sBAAsB,CAAC,CAAC;IACrC,MAAME,oBAAoB,GAAG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ZC,IAAI,EAAE,OAAO;QACbC,QAAQ,EAAE,GAAG;QACbC,IAAI,EAAE,CAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;MACvB,CAAG;MACHC,SAAS,EAAGhD,IAAI,CACf,6CAA6C,EAC7C;QACC,iBAAiB,EAAEiB;MACpB,CACD,CAAG;MACH,2BAAwB,MAAM;MAC9BgC,UAAU,EAAGA,CAAA,KAAM/B,gBAAgB,CAAE,IAAK,CAAG;MAC7CgC,WAAW,EAAGA,CAAA,KAAMhC,gBAAgB,CAAE,KAAM;IAAG,CACnC;EACb,CACe,CAAC;AAEpB","ignoreList":[]}
@@ -22,7 +22,7 @@ export default function BlockLockToolbar({
22
22
  isLocked
23
23
  } = useBlockLock(clientId);
24
24
  const [isModalOpen, toggleModal] = useReducer(isActive => !isActive, false);
25
- const hasLockButtonShown = useRef(false);
25
+ const hasLockButtonShownRef = useRef(false);
26
26
 
27
27
  // If the block lock button has been shown, we don't want to remove it
28
28
  // from the toolbar until the toolbar is rendered again without it.
@@ -31,10 +31,10 @@ export default function BlockLockToolbar({
31
31
  // whence it came, and to do that, we need to leave the button in the toolbar.
32
32
  useEffect(() => {
33
33
  if (isLocked) {
34
- hasLockButtonShown.current = true;
34
+ hasLockButtonShownRef.current = true;
35
35
  }
36
36
  }, [isLocked]);
37
- if (!isLocked && !hasLockButtonShown.current) {
37
+ if (!isLocked && !hasLockButtonShownRef.current) {
38
38
  return null;
39
39
  }
40
40
  let label = isLocked ? __('Unlock') : __('Lock');
@@ -1 +1 @@
1
- {"version":3,"names":["__","ToolbarButton","ToolbarGroup","useReducer","useRef","useEffect","lock","unlock","BlockLockModal","useBlockLock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","BlockLockToolbar","clientId","canLock","isLocked","isModalOpen","toggleModal","isActive","hasLockButtonShown","current","label","children","className","disabled","icon","onClick","onClose"],"sources":["@wordpress/block-editor/src/components/block-lock/toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useReducer, useRef, useEffect } from '@wordpress/element';\nimport { lock, unlock } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockLockModal from './modal';\nimport useBlockLock from './use-block-lock';\n\nexport default function BlockLockToolbar( { clientId } ) {\n\tconst { canLock, isLocked } = useBlockLock( clientId );\n\n\tconst [ isModalOpen, toggleModal ] = useReducer(\n\t\t( isActive ) => ! isActive,\n\t\tfalse\n\t);\n\n\tconst hasLockButtonShown = useRef( false );\n\n\t// If the block lock button has been shown, we don't want to remove it\n\t// from the toolbar until the toolbar is rendered again without it.\n\t// Removing it beforehand can cause focus loss issues, such as when\n\t// unlocking the block from the modal. It needs to return focus from\n\t// whence it came, and to do that, we need to leave the button in the toolbar.\n\tuseEffect( () => {\n\t\tif ( isLocked ) {\n\t\t\thasLockButtonShown.current = true;\n\t\t}\n\t}, [ isLocked ] );\n\n\tif ( ! isLocked && ! hasLockButtonShown.current ) {\n\t\treturn null;\n\t}\n\n\tlet label = isLocked ? __( 'Unlock' ) : __( 'Lock' );\n\n\tif ( ! canLock && isLocked ) {\n\t\tlabel = __( 'Locked' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarGroup className=\"block-editor-block-lock-toolbar\">\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tdisabled={ ! canLock }\n\t\t\t\t\ticon={ isLocked ? lock : unlock }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonClick={ toggleModal }\n\t\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<BlockLockModal clientId={ clientId } onClose={ toggleModal } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,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Q,EAAG,CAAEV,OAAS;QACtBW,IAAI,EAAGV,QAAQ,GAAGb,IAAI,GAAGC,MAAQ;QACjCkB,KAAK,EAAGA,KAAO;QACfK,OAAO,EAAGT,WAAa;QACvB,iBAAgBD,WAAa;QAC7B,iBAAc;MAAQ,CACtB;IAAC,CACW,CAAC,EACbA,WAAW,iBACZT,IAAA,CAACH,cAAc;MAACS,QAAQ,EAAGA,QAAU;MAACc,OAAO,EAAGV;IAAa,CAAE,CAC/D;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","ToolbarButton","ToolbarGroup","useReducer","useRef","useEffect","lock","unlock","BlockLockModal","useBlockLock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","BlockLockToolbar","clientId","canLock","isLocked","isModalOpen","toggleModal","isActive","hasLockButtonShownRef","current","label","children","className","disabled","icon","onClick","onClose"],"sources":["@wordpress/block-editor/src/components/block-lock/toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useReducer, useRef, useEffect } from '@wordpress/element';\nimport { lock, unlock } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockLockModal from './modal';\nimport useBlockLock from './use-block-lock';\n\nexport default function BlockLockToolbar( { clientId } ) {\n\tconst { canLock, isLocked } = useBlockLock( clientId );\n\n\tconst [ isModalOpen, toggleModal ] = useReducer(\n\t\t( isActive ) => ! isActive,\n\t\tfalse\n\t);\n\n\tconst hasLockButtonShownRef = useRef( false );\n\n\t// If the block lock button has been shown, we don't want to remove it\n\t// from the toolbar until the toolbar is rendered again without it.\n\t// Removing it beforehand can cause focus loss issues, such as when\n\t// unlocking the block from the modal. It needs to return focus from\n\t// whence it came, and to do that, we need to leave the button in the toolbar.\n\tuseEffect( () => {\n\t\tif ( isLocked ) {\n\t\t\thasLockButtonShownRef.current = true;\n\t\t}\n\t}, [ isLocked ] );\n\n\tif ( ! isLocked && ! hasLockButtonShownRef.current ) {\n\t\treturn null;\n\t}\n\n\tlet label = isLocked ? __( 'Unlock' ) : __( 'Lock' );\n\n\tif ( ! canLock && isLocked ) {\n\t\tlabel = __( 'Locked' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarGroup className=\"block-editor-block-lock-toolbar\">\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tdisabled={ ! canLock }\n\t\t\t\t\ticon={ isLocked ? lock : unlock }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonClick={ toggleModal }\n\t\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<BlockLockModal clientId={ clientId } onClose={ toggleModal } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,EAAEC,YAAY,QAAQ,uBAAuB;AACnE,SAASC,UAAU,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAClE,SAASC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,SAAS;AACpC,OAAOC,YAAY,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE5C,eAAe,SAASC,gBAAgBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACxD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGV,YAAY,CAAEQ,QAAS,CAAC;EAEtD,MAAM,CAAEG,WAAW,EAAEC,WAAW,CAAE,GAAGlB,UAAU,CAC5CmB,QAAQ,IAAM,CAAEA,QAAQ,EAC1B,KACD,CAAC;EAED,MAAMC,qBAAqB,GAAGnB,MAAM,CAAE,KAAM,CAAC;;EAE7C;EACA;EACA;EACA;EACA;EACAC,SAAS,CAAE,MAAM;IAChB,IAAKc,QAAQ,EAAG;MACfI,qBAAqB,CAACC,OAAO,GAAG,IAAI;IACrC;EACD,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjB,IAAK,CAAEA,QAAQ,IAAI,CAAEI,qBAAqB,CAACC,OAAO,EAAG;IACpD,OAAO,IAAI;EACZ;EAEA,IAAIC,KAAK,GAAGN,QAAQ,GAAGnB,EAAE,CAAE,QAAS,CAAC,GAAGA,EAAE,CAAE,MAAO,CAAC;EAEpD,IAAK,CAAEkB,OAAO,IAAIC,QAAQ,EAAG;IAC5BM,KAAK,GAAGzB,EAAE,CAAE,QAAS,CAAC;EACvB;EAEA,oBACCe,KAAA,CAAAF,SAAA;IAAAa,QAAA,gBACCf,IAAA,CAACT,YAAY;MAACyB,SAAS,EAAC,iCAAiC;MAAAD,QAAA,eACxDf,IAAA,CAACV,aAAa;QACb2B,QAAQ,EAAG,CAAEV,OAAS;QACtBW,IAAI,EAAGV,QAAQ,GAAGb,IAAI,GAAGC,MAAQ;QACjCkB,KAAK,EAAGA,KAAO;QACfK,OAAO,EAAGT,WAAa;QACvB,iBAAgBD,WAAa;QAC7B,iBAAc;MAAQ,CACtB;IAAC,CACW,CAAC,EACbA,WAAW,iBACZT,IAAA,CAACH,cAAc;MAACS,QAAQ,EAAGA,QAAU;MAACc,OAAO,EAAGV;IAAa,CAAE,CAC/D;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -113,6 +113,7 @@ const BlockMoverButton = forwardRef(({
113
113
  const descriptionId = `block-editor-block-mover-button__description-${instanceId}`;
114
114
  return /*#__PURE__*/_jsxs(_Fragment, {
115
115
  children: [/*#__PURE__*/_jsx(Button, {
116
+ __next40pxDefaultSize: true,
116
117
  ref: ref,
117
118
  className: clsx('block-editor-block-mover-button', `is-${direction}-button`),
118
119
  icon: getArrowIcon(direction, orientation),
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","getBlockType","Button","VisuallyHidden","useInstanceId","useSelect","useDispatch","forwardRef","__","isRTL","chevronLeft","chevronRight","chevronUp","chevronDown","getBlockMoverDescription","store","blockEditorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getArrowIcon","direction","orientation","getMovementDirectionLabel","moveDirection","BlockMoverButton","clientIds","moverOrientation","props","ref","instanceId","normalizedClientIds","Array","isArray","blocksCount","length","disabled","blockType","isDisabled","rootClientId","isFirst","isLast","firstIndex","select","getBlockIndex","getBlockRootClientId","getBlockOrder","getBlock","getBlockListSettings","firstClientId","blockRootClientId","firstBlockIndex","lastBlockIndex","blockOrder","block","isFirstBlock","isLastBlock","blockListOrientation","name","moveBlocksDown","moveBlocksUp","moverFunction","onClick","event","descriptionId","children","className","icon","label","accessibleWhenDisabled","id","title","BlockMoverUpButton","BlockMoverDownButton"],"sources":["@wordpress/block-editor/src/components/block-mover/button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tchevronLeft,\n\tchevronRight,\n\tchevronUp,\n\tchevronDown,\n} from '@wordpress/icons';\nimport { getBlockMoverDescription } from './mover-description';\nimport { store as blockEditorStore } from '../../store';\n\nconst getArrowIcon = ( direction, orientation ) => {\n\tif ( direction === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronRight : chevronLeft;\n\t\t}\n\t\treturn chevronUp;\n\t} else if ( direction === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronLeft : chevronRight;\n\t\t}\n\t\treturn chevronDown;\n\t}\n\treturn null;\n};\n\nconst getMovementDirectionLabel = ( moveDirection, orientation ) => {\n\tif ( moveDirection === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move right' ) : __( 'Move left' );\n\t\t}\n\t\treturn __( 'Move up' );\n\t} else if ( moveDirection === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move left' ) : __( 'Move right' );\n\t\t}\n\t\treturn __( 'Move down' );\n\t}\n\treturn null;\n};\n\nconst BlockMoverButton = forwardRef(\n\t(\n\t\t{ clientIds, direction, orientation: moverOrientation, ...props },\n\t\tref\n\t) => {\n\t\tconst instanceId = useInstanceId( BlockMoverButton );\n\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t? clientIds\n\t\t\t: [ clientIds ];\n\t\tconst blocksCount = normalizedClientIds.length;\n\t\tconst { disabled } = props;\n\n\t\tconst {\n\t\t\tblockType,\n\t\t\tisDisabled,\n\t\t\trootClientId,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tfirstIndex,\n\t\t\torientation = 'vertical',\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetBlock,\n\t\t\t\t\tgetBlockListSettings,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\t\t\tconst blockRootClientId = getBlockRootClientId( firstClientId );\n\t\t\t\tconst firstBlockIndex = getBlockIndex( firstClientId );\n\t\t\t\tconst lastBlockIndex = getBlockIndex(\n\t\t\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t\t\t);\n\t\t\t\tconst blockOrder = getBlockOrder( blockRootClientId );\n\t\t\t\tconst block = getBlock( firstClientId );\n\t\t\t\tconst isFirstBlock = firstBlockIndex === 0;\n\t\t\t\tconst isLastBlock = lastBlockIndex === blockOrder.length - 1;\n\t\t\t\tconst { orientation: blockListOrientation } =\n\t\t\t\t\tgetBlockListSettings( blockRootClientId ) || {};\n\n\t\t\t\treturn {\n\t\t\t\t\tblockType: block ? getBlockType( block.name ) : null,\n\t\t\t\t\tisDisabled:\n\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t( direction === 'up' ? isFirstBlock : isLastBlock ),\n\t\t\t\t\trootClientId: blockRootClientId,\n\t\t\t\t\tfirstIndex: firstBlockIndex,\n\t\t\t\t\tisFirst: isFirstBlock,\n\t\t\t\t\tisLast: isLastBlock,\n\t\t\t\t\torientation: moverOrientation || blockListOrientation,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds, direction ]\n\t\t);\n\n\t\tconst { moveBlocksDown, moveBlocksUp } =\n\t\t\tuseDispatch( blockEditorStore );\n\t\tconst moverFunction =\n\t\t\tdirection === 'up' ? moveBlocksUp : moveBlocksDown;\n\n\t\tconst onClick = ( event ) => {\n\t\t\tmoverFunction( clientIds, rootClientId );\n\t\t\tif ( props.onClick ) {\n\t\t\t\tprops.onClick( event );\n\t\t\t}\n\t\t};\n\n\t\tconst descriptionId = `block-editor-block-mover-button__description-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-block-mover-button',\n\t\t\t\t\t\t`is-${ direction }-button`\n\t\t\t\t\t) }\n\t\t\t\t\ticon={ getArrowIcon( direction, orientation ) }\n\t\t\t\t\tlabel={ getMovementDirectionLabel(\n\t\t\t\t\t\tdirection,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tonClick={ isDisabled ? null : onClick }\n\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t/>\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ getBlockMoverDescription(\n\t\t\t\t\t\tblocksCount,\n\t\t\t\t\t\tblockType && blockType.title,\n\t\t\t\t\t\tfirstIndex,\n\t\t\t\t\t\tisFirst,\n\t\t\t\t\t\tisLast,\n\t\t\t\t\t\tdirection === 'up' ? -1 : 1,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t</>\n\t\t);\n\t}\n);\n\nexport const BlockMoverUpButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"up\" ref={ ref } { ...props } />;\n} );\n\nexport const BlockMoverDownButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"down\" ref={ ref } { ...props } />;\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,WAAW,QACL,kBAAkB;AACzB,SAASC,wBAAwB,QAAQ,qBAAqB;AAC9D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExD,MAAMC,YAAY,GAAGA,CAAEC,SAAS,EAAEC,WAAW,KAAM;EAClD,IAAKD,SAAS,KAAK,IAAI,EAAG;IACzB,IAAKC,WAAW,KAAK,YAAY,EAAG;MACnC,OAAOhB,KAAK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EAC/D,oBAAOd,IAAA,CAACU,gBAAgB;IAACJ,SAAS,EAAC,IAAI;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACpE,CAAE,CAAC;AAEH,OAAO,MAAM6C,oBAAoB,GAAGrE,UAAU,CAAE,CAAEwB,KAAK,EAAEC,GAAG,KAAM;EACjE,oBAAOd,IAAA,CAACU,gBAAgB;IAACJ,SAAS,EAAC,MAAM;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACtE,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","getBlockType","Button","VisuallyHidden","useInstanceId","useSelect","useDispatch","forwardRef","__","isRTL","chevronLeft","chevronRight","chevronUp","chevronDown","getBlockMoverDescription","store","blockEditorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getArrowIcon","direction","orientation","getMovementDirectionLabel","moveDirection","BlockMoverButton","clientIds","moverOrientation","props","ref","instanceId","normalizedClientIds","Array","isArray","blocksCount","length","disabled","blockType","isDisabled","rootClientId","isFirst","isLast","firstIndex","select","getBlockIndex","getBlockRootClientId","getBlockOrder","getBlock","getBlockListSettings","firstClientId","blockRootClientId","firstBlockIndex","lastBlockIndex","blockOrder","block","isFirstBlock","isLastBlock","blockListOrientation","name","moveBlocksDown","moveBlocksUp","moverFunction","onClick","event","descriptionId","children","__next40pxDefaultSize","className","icon","label","accessibleWhenDisabled","id","title","BlockMoverUpButton","BlockMoverDownButton"],"sources":["@wordpress/block-editor/src/components/block-mover/button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tchevronLeft,\n\tchevronRight,\n\tchevronUp,\n\tchevronDown,\n} from '@wordpress/icons';\nimport { getBlockMoverDescription } from './mover-description';\nimport { store as blockEditorStore } from '../../store';\n\nconst getArrowIcon = ( direction, orientation ) => {\n\tif ( direction === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronRight : chevronLeft;\n\t\t}\n\t\treturn chevronUp;\n\t} else if ( direction === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? chevronLeft : chevronRight;\n\t\t}\n\t\treturn chevronDown;\n\t}\n\treturn null;\n};\n\nconst getMovementDirectionLabel = ( moveDirection, orientation ) => {\n\tif ( moveDirection === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move right' ) : __( 'Move left' );\n\t\t}\n\t\treturn __( 'Move up' );\n\t} else if ( moveDirection === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? __( 'Move left' ) : __( 'Move right' );\n\t\t}\n\t\treturn __( 'Move down' );\n\t}\n\treturn null;\n};\n\nconst BlockMoverButton = forwardRef(\n\t(\n\t\t{ clientIds, direction, orientation: moverOrientation, ...props },\n\t\tref\n\t) => {\n\t\tconst instanceId = useInstanceId( BlockMoverButton );\n\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t? clientIds\n\t\t\t: [ clientIds ];\n\t\tconst blocksCount = normalizedClientIds.length;\n\t\tconst { disabled } = props;\n\n\t\tconst {\n\t\t\tblockType,\n\t\t\tisDisabled,\n\t\t\trootClientId,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tfirstIndex,\n\t\t\torientation = 'vertical',\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockIndex,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetBlock,\n\t\t\t\t\tgetBlockListSettings,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\t\t\tconst blockRootClientId = getBlockRootClientId( firstClientId );\n\t\t\t\tconst firstBlockIndex = getBlockIndex( firstClientId );\n\t\t\t\tconst lastBlockIndex = getBlockIndex(\n\t\t\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t\t\t);\n\t\t\t\tconst blockOrder = getBlockOrder( blockRootClientId );\n\t\t\t\tconst block = getBlock( firstClientId );\n\t\t\t\tconst isFirstBlock = firstBlockIndex === 0;\n\t\t\t\tconst isLastBlock = lastBlockIndex === blockOrder.length - 1;\n\t\t\t\tconst { orientation: blockListOrientation } =\n\t\t\t\t\tgetBlockListSettings( blockRootClientId ) || {};\n\n\t\t\t\treturn {\n\t\t\t\t\tblockType: block ? getBlockType( block.name ) : null,\n\t\t\t\t\tisDisabled:\n\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t( direction === 'up' ? isFirstBlock : isLastBlock ),\n\t\t\t\t\trootClientId: blockRootClientId,\n\t\t\t\t\tfirstIndex: firstBlockIndex,\n\t\t\t\t\tisFirst: isFirstBlock,\n\t\t\t\t\tisLast: isLastBlock,\n\t\t\t\t\torientation: moverOrientation || blockListOrientation,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds, direction ]\n\t\t);\n\n\t\tconst { moveBlocksDown, moveBlocksUp } =\n\t\t\tuseDispatch( blockEditorStore );\n\t\tconst moverFunction =\n\t\t\tdirection === 'up' ? moveBlocksUp : moveBlocksDown;\n\n\t\tconst onClick = ( event ) => {\n\t\t\tmoverFunction( clientIds, rootClientId );\n\t\t\tif ( props.onClick ) {\n\t\t\t\tprops.onClick( event );\n\t\t\t}\n\t\t};\n\n\t\tconst descriptionId = `block-editor-block-mover-button__description-${ instanceId }`;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-block-mover-button',\n\t\t\t\t\t\t`is-${ direction }-button`\n\t\t\t\t\t) }\n\t\t\t\t\ticon={ getArrowIcon( direction, orientation ) }\n\t\t\t\t\tlabel={ getMovementDirectionLabel(\n\t\t\t\t\t\tdirection,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t\taria-describedby={ descriptionId }\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tonClick={ isDisabled ? null : onClick }\n\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t/>\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ getBlockMoverDescription(\n\t\t\t\t\t\tblocksCount,\n\t\t\t\t\t\tblockType && blockType.title,\n\t\t\t\t\t\tfirstIndex,\n\t\t\t\t\t\tisFirst,\n\t\t\t\t\t\tisLast,\n\t\t\t\t\t\tdirection === 'up' ? -1 : 1,\n\t\t\t\t\t\torientation\n\t\t\t\t\t) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t</>\n\t\t);\n\t}\n);\n\nexport const BlockMoverUpButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"up\" ref={ ref } { ...props } />;\n} );\n\nexport const BlockMoverDownButton = forwardRef( ( props, ref ) => {\n\treturn <BlockMoverButton direction=\"down\" ref={ ref } { ...props } />;\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;;AAE3C;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,EAAGE,UAAY;MACvBgC,sBAAsB;IAAA,CACtB,CAAC,eACFvD,IAAA,CAACf,cAAc;MAACuE,EAAE,EAAGP,aAAe;MAAAC,QAAA,EACjCtD,wBAAwB,CACzBuB,WAAW,EACXG,SAAS,IAAIA,SAAS,CAACmC,KAAK,EAC5B9B,UAAU,EACVF,OAAO,EACPC,MAAM,EACNpB,SAAS,KAAK,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,EAC3BC,WACD;IAAC,CACc,CAAC;EAAA,CAChB,CAAC;AAEL,CACD,CAAC;AAED,OAAO,MAAMmD,kBAAkB,GAAGrE,UAAU,CAAE,CAAEwB,KAAK,EAAEC,GAAG,KAAM;EAC/D,oBAAOd,IAAA,CAACU,gBAAgB;IAACJ,SAAS,EAAC,IAAI;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACpE,CAAE,CAAC;AAEH,OAAO,MAAM8C,oBAAoB,GAAGtE,UAAU,CAAE,CAAEwB,KAAK,EAAEC,GAAG,KAAM;EACjE,oBAAOd,IAAA,CAACU,gBAAgB;IAACJ,SAAS,EAAC,MAAM;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACtE,CAAE,CAAC","ignoreList":[]}
@@ -72,6 +72,7 @@ function BlockMover({
72
72
  clientIds: clientIds,
73
73
  fadeWhenDisabled: true,
74
74
  children: draggableProps => /*#__PURE__*/_jsx(Button, {
75
+ __next40pxDefaultSize: true,
75
76
  icon: dragHandle,
76
77
  className: "block-editor-block-mover__drag-handle",
77
78
  label: __('Drag')
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","dragHandle","ToolbarGroup","ToolbarItem","Button","useSelect","__","BlockDraggable","BlockMoverUpButton","BlockMoverDownButton","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","BlockMover","clientIds","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","canMove","rootClientId","isFirst","isLast","orientation","isManualGrid","select","_getBlockAttributes","getBlockIndex","getBlockListSettings","canMoveBlocks","getBlockOrder","getBlockRootClientId","getBlockAttributes","normalizedClientIds","Array","isArray","firstClientId","_rootClientId","firstIndex","lastIndex","length","blockOrder","layout","type","isManualPlacement","window","__experimentalEnableGridInteractivity","className","children","fadeWhenDisabled","draggableProps","icon","label","tabIndex","itemProps","disabled"],"sources":["@wordpress/block-editor/src/components/block-mover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\n\nimport { dragHandle } from '@wordpress/icons';\nimport { ToolbarGroup, ToolbarItem, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockDraggable from '../block-draggable';\nimport { BlockMoverUpButton, BlockMoverDownButton } from './button';\nimport { store as blockEditorStore } from '../../store';\n\nfunction BlockMover( {\n\tclientIds,\n\thideDragHandle,\n\tisBlockMoverUpButtonDisabled,\n\tisBlockMoverDownButtonDisabled,\n} ) {\n\tconst {\n\t\tcanMove,\n\t\trootClientId,\n\t\tisFirst,\n\t\tisLast,\n\t\torientation,\n\t\tisManualGrid,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tcanMoveBlocks,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockAttributes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t\t? clientIds\n\t\t\t\t: [ clientIds ];\n\t\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\t\tconst _rootClientId = getBlockRootClientId( firstClientId );\n\t\t\tconst firstIndex = getBlockIndex( firstClientId );\n\t\t\tconst lastIndex = getBlockIndex(\n\t\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t\t);\n\t\t\tconst blockOrder = getBlockOrder( _rootClientId );\n\t\t\tconst { layout = {} } = getBlockAttributes( _rootClientId ) ?? {};\n\n\t\t\treturn {\n\t\t\t\tcanMove: canMoveBlocks( clientIds ),\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisFirst: firstIndex === 0,\n\t\t\t\tisLast: lastIndex === blockOrder.length - 1,\n\t\t\t\torientation: getBlockListSettings( _rootClientId )?.orientation,\n\t\t\t\tisManualGrid:\n\t\t\t\t\tlayout.type === 'grid' &&\n\t\t\t\t\tlayout.isManualPlacement &&\n\t\t\t\t\twindow.__experimentalEnableGridInteractivity,\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tif (\n\t\t! canMove ||\n\t\t( isFirst && isLast && ! rootClientId ) ||\n\t\t( hideDragHandle && isManualGrid )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ToolbarGroup\n\t\t\tclassName={ clsx( 'block-editor-block-mover', {\n\t\t\t\t'is-horizontal': orientation === 'horizontal',\n\t\t\t} ) }\n\t\t>\n\t\t\t{ ! hideDragHandle && (\n\t\t\t\t<BlockDraggable clientIds={ clientIds } fadeWhenDisabled>\n\t\t\t\t\t{ ( draggableProps ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ dragHandle }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-mover__drag-handle\"\n\t\t\t\t\t\t\tlabel={ __( 'Drag' ) }\n\t\t\t\t\t\t\t// Should not be able to tab to drag handle as this\n\t\t\t\t\t\t\t// button can only be used with a pointer device.\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t{ ...draggableProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockDraggable>\n\t\t\t) }\n\t\t\t{ ! isManualGrid && (\n\t\t\t\t<div className=\"block-editor-block-mover__move-button-container\">\n\t\t\t\t\t<ToolbarItem>\n\t\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\tdisabled={ isBlockMoverUpButtonDisabled }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolbarItem>\n\t\t\t\t\t<ToolbarItem>\n\t\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\tdisabled={ isBlockMoverDownButtonDisabled }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolbarItem>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</ToolbarGroup>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-mover/README.md\n */\nexport default BlockMover;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,YAAY,EAAEC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AACzE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,UAAU;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExD,SAASC,UAAUA,CAAE;EACpBC,SAAS;EACTC,cAAc;EACdC,4BAA4B;EAC5BC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,OAAO;IACPC,YAAY;IACZC,OAAO;IACPC,MAA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,MAAM,IAAI,CAAEF,YAAc,IACrCJ,cAAc,IAAIQ,YAAc,EACjC;IACD,OAAO,IAAI;EACZ;EAEA,oBACCX,KAAA,CAACb,YAAY;IACZ+C,SAAS,EAAGjD,IAAI,CAAE,0BAA0B,EAAE;MAC7C,eAAe,EAAEyB,WAAW,KAAK;IAClC,CAAE,CAAG;IAAAyB,QAAA,GAEH,CAAEhC,cAAc,iBACjBL,IAAA,CAACN,cAAc;MAACU,SAAS,EAAGA,SAAW;MAACkC,gBAAgB;MAAAD,QAAA,EACnDE,cAAc,iBACjBvC,IAAA,CAACT,MAAM;QACNiD,IAAI,EAAGpD,UAAY;QACnBgD,SAAS,EAAC,uCAAuC;QACjDK,KAAK,EAAGhD,EAAE,CAAE,MAAO;QACnB;QACA;QAAA;QACAiD,QAAQ,EAAC,IAAI;QAAA,GACRH;MAAc,CACnB;IACD,CACc,CAChB,EACC,CAAE1B,YAAY,iBACfX,KAAA;MAAKkC,SAAS,EAAC,iDAAiD;MAAAC,QAAA,gBAC/DrC,IAAA,CAACV,WAAW;QAAA+C,QAAA,EACPM,SAAS,iBACZ3C,IAAA,CAACL,kBAAkB;UAClBiD,QAAQ,EAAGtC,4BAA8B;UACzCF,SAAS,EAAGA,SAAW;UAAA,GAClBuC;QAAS,CACd;MACD,CACW,CAAC,eACd3C,IAAA,CAACV,WAAW;QAAA+C,QAAA,EACPM,SAAS,iBACZ3C,IAAA,CAACJ,oBAAoB;UACpBgD,QAAQ,EAAGrC,8BAAgC;UAC3CH,SAAS,EAAGA,SAAW;UAAA,GAClBuC;QAAS,CACd;MACD,CACW,CAAC;IAAA,CACV,CACL;EAAA,CACY,CAAC;AAEjB;;AAEA;AACA;AACA;AACA,eAAexC,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["clsx","dragHandle","ToolbarGroup","ToolbarItem","Button","useSelect","__","BlockDraggable","BlockMoverUpButton","BlockMoverDownButton","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","BlockMover","clientIds","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","canMove","rootClientId","isFirst","isLast","orientation","isManualGrid","select","_getBlockAttributes","getBlockIndex","getBlockListSettings","canMoveBlocks","getBlockOrder","getBlockRootClientId","getBlockAttributes","normalizedClientIds","Array","isArray","firstClientId","_rootClientId","firstIndex","lastIndex","length","blockOrder","layout","type","isManualPlacement","window","__experimentalEnableGridInteractivity","className","children","fadeWhenDisabled","draggableProps","__next40pxDefaultSize","icon","label","tabIndex","itemProps","disabled"],"sources":["@wordpress/block-editor/src/components/block-mover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\n\nimport { dragHandle } from '@wordpress/icons';\nimport { ToolbarGroup, ToolbarItem, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockDraggable from '../block-draggable';\nimport { BlockMoverUpButton, BlockMoverDownButton } from './button';\nimport { store as blockEditorStore } from '../../store';\n\nfunction BlockMover( {\n\tclientIds,\n\thideDragHandle,\n\tisBlockMoverUpButtonDisabled,\n\tisBlockMoverDownButtonDisabled,\n} ) {\n\tconst {\n\t\tcanMove,\n\t\trootClientId,\n\t\tisFirst,\n\t\tisLast,\n\t\torientation,\n\t\tisManualGrid,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tcanMoveBlocks,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockAttributes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t\t? clientIds\n\t\t\t\t: [ clientIds ];\n\t\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\t\tconst _rootClientId = getBlockRootClientId( firstClientId );\n\t\t\tconst firstIndex = getBlockIndex( firstClientId );\n\t\t\tconst lastIndex = getBlockIndex(\n\t\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t\t);\n\t\t\tconst blockOrder = getBlockOrder( _rootClientId );\n\t\t\tconst { layout = {} } = getBlockAttributes( _rootClientId ) ?? {};\n\n\t\t\treturn {\n\t\t\t\tcanMove: canMoveBlocks( clientIds ),\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisFirst: firstIndex === 0,\n\t\t\t\tisLast: lastIndex === blockOrder.length - 1,\n\t\t\t\torientation: getBlockListSettings( _rootClientId )?.orientation,\n\t\t\t\tisManualGrid:\n\t\t\t\t\tlayout.type === 'grid' &&\n\t\t\t\t\tlayout.isManualPlacement &&\n\t\t\t\t\twindow.__experimentalEnableGridInteractivity,\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tif (\n\t\t! canMove ||\n\t\t( isFirst && isLast && ! rootClientId ) ||\n\t\t( hideDragHandle && isManualGrid )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ToolbarGroup\n\t\t\tclassName={ clsx( 'block-editor-block-mover', {\n\t\t\t\t'is-horizontal': orientation === 'horizontal',\n\t\t\t} ) }\n\t\t>\n\t\t\t{ ! hideDragHandle && (\n\t\t\t\t<BlockDraggable clientIds={ clientIds } fadeWhenDisabled>\n\t\t\t\t\t{ ( draggableProps ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ dragHandle }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-mover__drag-handle\"\n\t\t\t\t\t\t\tlabel={ __( 'Drag' ) }\n\t\t\t\t\t\t\t// Should not be able to tab to drag handle as this\n\t\t\t\t\t\t\t// button can only be used with a pointer device.\n\t\t\t\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t\t\t\t{ ...draggableProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockDraggable>\n\t\t\t) }\n\t\t\t{ ! isManualGrid && (\n\t\t\t\t<div className=\"block-editor-block-mover__move-button-container\">\n\t\t\t\t\t<ToolbarItem>\n\t\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\tdisabled={ isBlockMoverUpButtonDisabled }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolbarItem>\n\t\t\t\t\t<ToolbarItem>\n\t\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\tdisabled={ isBlockMoverDownButtonDisabled }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolbarItem>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</ToolbarGroup>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-mover/README.md\n */\nexport default BlockMover;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,YAAY,EAAEC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AACzE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,UAAU;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExD,SAASC,UAAUA,CAAE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+26,10 @@ function BlockNavigationDropdownToggle({
26
26
  innerRef,
27
27
  ...props
28
28
  }) {
29
- return /*#__PURE__*/_jsx(Button, {
29
+ return /*#__PURE__*/_jsx(Button
30
+ // TODO: Switch to `true` (40px size) if possible
31
+ , {
32
+ __next40pxDefaultSize: false,
30
33
  ...props,
31
34
  ref: innerRef,
32
35
  icon: listView,
@@ -1 +1 @@
1
- {"version":3,"names":["deprecated","Button","Dropdown","__","useSelect","forwardRef","listView","ListView","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","BlockNavigationDropdownToggle","isEnabled","onToggle","isOpen","innerRef","props","ref","icon","onClick","undefined","label","className","BlockNavigationDropdown","isDisabled","since","alternative","hasBlocks","select","getBlockCount","contentClassName","popoverProps","placement","renderToggle","renderContent","children"],"sources":["@wordpress/block-editor/src/components/block-navigation/dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { listView } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ListView from '../list-view';\nimport { store as blockEditorStore } from '../../store';\n\nfunction BlockNavigationDropdownToggle( {\n\tisEnabled,\n\tonToggle,\n\tisOpen,\n\tinnerRef,\n\t...props\n} ) {\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ innerRef }\n\t\t\ticon={ listView }\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-haspopup=\"true\"\n\t\t\tonClick={ isEnabled ? onToggle : undefined }\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\tlabel={ __( 'List view' ) }\n\t\t\tclassName=\"block-editor-block-navigation\"\n\t\t\taria-disabled={ ! isEnabled }\n\t\t/>\n\t);\n}\n\nfunction BlockNavigationDropdown( { isDisabled, ...props }, ref ) {\n\tdeprecated( 'wp.blockEditor.BlockNavigationDropdown', {\n\t\tsince: '6.1',\n\t\talternative: 'wp.components.Dropdown and wp.blockEditor.ListView',\n\t} );\n\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\tconst isEnabled = hasBlocks && ! isDisabled;\n\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"block-editor-block-navigation__popover\"\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<BlockNavigationDropdownToggle\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tinnerRef={ ref }\n\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\tisEnabled={ isEnabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<div className=\"block-editor-block-navigation__container\">\n\t\t\t\t\t<p className=\"block-editor-block-navigation__label\">\n\t\t\t\t\t\t{ __( 'List view' ) }\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<ListView />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( BlockNavigationDropdown );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,QAAQ,QAAQ,uBAAuB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,cAAc;AACnC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExD,SAASC,6BAA6BA,CA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AAC,sCAAsC;QAAAa,QAAA,EAChDnC,EAAE,CAAE,WAAY;MAAC,CACjB,CAAC,eAEJQ,IAAA,CAACJ,QAAQ,IAAE,CAAC;IAAA,CACR;EACH,CACH,CAAC;AAEJ;AAEA,eAAeF,UAAU,CAAEqB,uBAAwB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["deprecated","Button","Dropdown","__","useSelect","forwardRef","listView","ListView","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","BlockNavigationDropdownToggle","isEnabled","onToggle","isOpen","innerRef","props","__next40pxDefaultSize","ref","icon","onClick","undefined","label","className","BlockNavigationDropdown","isDisabled","since","alternative","hasBlocks","select","getBlockCount","contentClassName","popoverProps","placement","renderToggle","renderContent","children"],"sources":["@wordpress/block-editor/src/components/block-navigation/dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { listView } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ListView from '../list-view';\nimport { store as blockEditorStore } from '../../store';\n\nfunction BlockNavigationDropdownToggle( {\n\tisEnabled,\n\tonToggle,\n\tisOpen,\n\tinnerRef,\n\t...props\n} ) {\n\treturn (\n\t\t<Button\n\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t__next40pxDefaultSize={ false }\n\t\t\t{ ...props }\n\t\t\tref={ innerRef }\n\t\t\ticon={ listView }\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-haspopup=\"true\"\n\t\t\tonClick={ isEnabled ? onToggle : undefined }\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\tlabel={ __( 'List view' ) }\n\t\t\tclassName=\"block-editor-block-navigation\"\n\t\t\taria-disabled={ ! isEnabled }\n\t\t/>\n\t);\n}\n\nfunction BlockNavigationDropdown( { isDisabled, ...props }, ref ) {\n\tdeprecated( 'wp.blockEditor.BlockNavigationDropdown', {\n\t\tsince: '6.1',\n\t\talternative: 'wp.components.Dropdown and wp.blockEditor.ListView',\n\t} );\n\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\tconst isEnabled = hasBlocks && ! isDisabled;\n\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"block-editor-block-navigation__popover\"\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<BlockNavigationDropdownToggle\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tinnerRef={ ref }\n\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\tisEnabled={ isEnabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ () => (\n\t\t\t\t<div className=\"block-editor-block-navigation__container\">\n\t\t\t\t\t<p className=\"block-editor-block-navigation__label\">\n\t\t\t\t\t\t{ __( 'List view' ) }\n\t\t\t\t\t</p>\n\n\t\t\t\t\t<ListView />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( BlockNavigationDropdown );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,QAAQ,QAAQ,uBAAuB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,cAAc;AACnC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,I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AA;MAAKa,SAAS,EAAC,0CAA0C;MAAAa,QAAA,gBACxD5B,IAAA;QAAGe,SAAS,EAAC,sCAAsC;QAAAa,QAAA,EAChDpC,EAAE,CAAE,WAAY;MAAC,CACjB,CAAC,eAEJQ,IAAA,CAACJ,QAAQ,IAAE,CAAC;IAAA,CACR;EACH,CACH,CAAC;AAEJ;AAEA,eAAeF,UAAU,CAAEsB,uBAAwB,CAAC","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { useDispatch } from '@wordpress/data';
5
5
  import { cloneBlock } from '@wordpress/blocks';
6
- import { VisuallyHidden, privateApis as componentsPrivateApis } from '@wordpress/components';
6
+ import { Composite, VisuallyHidden } from '@wordpress/components';
7
7
  import { useState } from '@wordpress/element';
8
8
  import { useInstanceId } from '@wordpress/compose';
9
9
  import { __ } from '@wordpress/i18n';
@@ -16,15 +16,9 @@ import BlockPreview from '../block-preview';
16
16
  import SetupToolbar from './setup-toolbar';
17
17
  import usePatternsSetup from './use-patterns-setup';
18
18
  import { VIEWMODES } from './constants';
19
- import { unlock } from '../../lock-unlock';
20
19
  import { jsx as _jsx } from "react/jsx-runtime";
21
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
21
  import { Fragment as _Fragment } from "react/jsx-runtime";
23
- const {
24
- CompositeV2: Composite,
25
- CompositeItemV2: CompositeItem,
26
- useCompositeStoreV2: useCompositeStore
27
- } = unlock(componentsPrivateApis);
28
22
  const SetupContent = ({
29
23
  viewMode,
30
24
  activeSlide,
@@ -32,7 +26,6 @@ const SetupContent = ({
32
26
  onBlockPatternSelect,
33
27
  showTitles
34
28
  }) => {
35
- const compositeStore = useCompositeStore();
36
29
  const containerClass = 'block-editor-block-pattern-setup__container';
37
30
  if (viewMode === VIEWMODES.carousel) {
38
31
  const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]);
@@ -54,7 +47,6 @@ const SetupContent = ({
54
47
  return /*#__PURE__*/_jsx("div", {
55
48
  className: "block-editor-block-pattern-setup__grid",
56
49
  children: /*#__PURE__*/_jsx(Composite, {
57
- store: compositeStore,
58
50
  role: "listbox",
59
51
  className: containerClass,
60
52
  "aria-label": __('Patterns list'),
@@ -80,7 +72,7 @@ function BlockPattern({
80
72
  const descriptionId = useInstanceId(BlockPattern, `${baseClassName}__item-description`);
81
73
  return /*#__PURE__*/_jsx("div", {
82
74
  className: `${baseClassName}__list-item`,
83
- children: /*#__PURE__*/_jsxs(CompositeItem, {
75
+ children: /*#__PURE__*/_jsxs(Composite.Item, {
84
76
  render: /*#__PURE__*/_jsx("div", {
85
77
  "aria-describedby": description ? descriptionId : undefined,
86
78
  "aria-label": pattern.title,
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","cloneBlock","VisuallyHidden","privateApis","componentsPrivateApis","useState","useInstanceId","__","store","blockEditorStore","BlockPreview","SetupToolbar","usePatternsSetup","VIEWMODES","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","SetupContent","viewMode","activeSlide","patterns","onBlockPatternSelect","showTitles","compositeStore","containerClass","carousel","slideClass","Map","className","children","map","pattern","index","BlockPatternSlide","active","get","name","role","BlockPattern","onSelect","baseClassName","blocks","description","viewportWidth","descriptionId","render","undefined","title","id","onClick","minHeight","BlockPatternSetup","clientId","blockName","filterPatternsFn","initialViewMode","setViewMode","setActiveSlide","replaceBlock","length","onBlockPatternSelectDefault","clonedBlocks","block","onPatternSelectCallback","totalSlides","handleNext","Math","min","handlePrevious","max"],"sources":["@wordpress/block-editor/src/components/block-pattern-setup/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\nimport {\n\tVisuallyHidden,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockPreview from '../block-preview';\nimport SetupToolbar from './setup-toolbar';\nimport usePatternsSetup from './use-patterns-setup';\nimport { VIEWMODES } from './constants';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n} = unlock( componentsPrivateApis );\n\nconst SetupContent = ( {\n\tviewMode,\n\tactiveSlide,\n\tpatterns,\n\tonBlockPatternSelect,\n\tshowTitles,\n} ) => {\n\tconst compositeStore = useCompositeStore();\n\tconst containerClass = 'block-editor-block-pattern-setup__container';\n\n\tif ( viewMode === VIEWMODES.carousel ) {\n\t\tconst slideClass = new Map( [\n\t\t\t[ activeSlide, 'active-slide' ],\n\t\t\t[ activeSlide - 1, 'previous-slide' ],\n\t\t\t[ activeSlide + 1, 'next-slide' ],\n\t\t] );\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-pattern-setup__carousel\">\n\t\t\t\t<div className={ containerClass }>\n\t\t\t\t\t<div className=\"carousel-container\">\n\t\t\t\t\t\t{ patterns.map( ( pattern, index ) => (\n\t\t\t\t\t\t\t<BlockPatternSlide\n\t\t\t\t\t\t\t\tactive={ index === activeSlide }\n\t\t\t\t\t\t\t\tclassName={ slideClass.get( index ) || '' }\n\t\t\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"block-editor-block-pattern-setup__grid\">\n\t\t\t<Composite\n\t\t\t\tstore={ compositeStore }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName={ containerClass }\n\t\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t\t>\n\t\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonSelect={ onBlockPatternSelect }\n\t\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t</div>\n\t);\n};\n\nfunction BlockPattern( { pattern, onSelect, showTitles } ) {\n\tconst baseClassName = 'block-editor-block-pattern-setup-list';\n\tconst { blocks, description, viewportWidth = 700 } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }__item-description`\n\t);\n\treturn (\n\t\t<div className={ `${ baseClassName }__list-item` }>\n\t\t\t<CompositeItem\n\t\t\t\trender={\n\t\t\t\t\t<div\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\tdescription ? descriptionId : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\tclassName={ `${ baseClassName }__item` }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tid={ `${ baseClassName }__pattern__${ pattern.name }` }\n\t\t\t\trole=\"option\"\n\t\t\t\tonClick={ () => onSelect( blocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t/>\n\t\t\t\t{ showTitles && (\n\t\t\t\t\t<div className={ `${ baseClassName }__item-title` }>\n\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ !! description && (\n\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</CompositeItem>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternSlide( { active, className, pattern, minHeight } ) {\n\tconst { blocks, title, description } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPatternSlide,\n\t\t'block-editor-block-pattern-setup-list__item-description'\n\t);\n\treturn (\n\t\t<div\n\t\t\taria-hidden={ ! active }\n\t\t\trole=\"img\"\n\t\t\tclassName={ `pattern-slide ${ className }` }\n\t\t\taria-label={ title }\n\t\t\taria-describedby={ description ? descriptionId : undefined }\n\t\t>\n\t\t\t<BlockPreview blocks={ blocks } minHeight={ minHeight } />\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nconst BlockPatternSetup = ( {\n\tclientId,\n\tblockName,\n\tfilterPatternsFn,\n\tonBlockPatternSelect,\n\tinitialViewMode = VIEWMODES.carousel,\n\tshowTitles = false,\n} ) => {\n\tconst [ viewMode, setViewMode ] = useState( initialViewMode );\n\tconst [ activeSlide, setActiveSlide ] = useState( 0 );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );\n\n\tif ( ! patterns?.length ) {\n\t\treturn null;\n\t}\n\n\tconst onBlockPatternSelectDefault = ( blocks ) => {\n\t\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\t\treplaceBlock( clientId, clonedBlocks );\n\t};\n\tconst onPatternSelectCallback =\n\t\tonBlockPatternSelect || onBlockPatternSelectDefault;\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ `block-editor-block-pattern-setup view-mode-${ viewMode }` }\n\t\t\t>\n\t\t\t\t<SetupContent\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonBlockPatternSelect={ onPatternSelectCallback }\n\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t/>\n\t\t\t\t<SetupToolbar\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tsetViewMode={ setViewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\ttotalSlides={ patterns.length }\n\t\t\t\t\thandleNext={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) =>\n\t\t\t\t\t\t\tMath.min( active + 1, patterns.length - 1 )\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\thandlePrevious={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) =>\n\t\t\t\t\t\t\tMath.max( active - 1, 0 )\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tonBlockPatternSelect={ () => {\n\t\t\t\t\t\tonPatternSelectCallback(\n\t\t\t\t\t\t\tpatterns[ activeSlide ].blocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default BlockPatternSetup;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SACCC,cAAc,EACdC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAE9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAE3C,MAAM;EACLC,WAAW,EAAEC,SAAS;EACtBC,eAAe,EAAEC,aAA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AAC;AAED,eAAeU,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","cloneBlock","Composite","VisuallyHidden","useState","useInstanceId","__","store","blockEditorStore","BlockPreview","SetupToolbar","usePatternsSetup","VIEWMODES","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SetupContent","viewMode","activeSlide","patterns","onBlockPatternSelect","showTitles","containerClass","carousel","slideClass","Map","className","children","map","pattern","index","BlockPatternSlide","active","get","name","role","BlockPattern","onSelect","baseClassName","blocks","description","viewportWidth","descriptionId","Item","render","undefined","title","id","onClick","minHeight","BlockPatternSetup","clientId","blockName","filterPatternsFn","initialViewMode","setViewMode","setActiveSlide","replaceBlock","length","onBlockPatternSelectDefault","clonedBlocks","block","onPatternSelectCallback","totalSlides","handleNext","Math","min","handlePrevious","max"],"sources":["@wordpress/block-editor/src/components/block-pattern-setup/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\nimport { Composite, VisuallyHidden } from '@wordpress/components';\n\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockPreview from '../block-preview';\nimport SetupToolbar from './setup-toolbar';\nimport usePatternsSetup from './use-patterns-setup';\nimport { VIEWMODES } from './constants';\n\nconst SetupContent = ( {\n\tviewMode,\n\tactiveSlide,\n\tpatterns,\n\tonBlockPatternSelect,\n\tshowTitles,\n} ) => {\n\tconst containerClass = 'block-editor-block-pattern-setup__container';\n\n\tif ( viewMode === VIEWMODES.carousel ) {\n\t\tconst slideClass = new Map( [\n\t\t\t[ activeSlide, 'active-slide' ],\n\t\t\t[ activeSlide - 1, 'previous-slide' ],\n\t\t\t[ activeSlide + 1, 'next-slide' ],\n\t\t] );\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-pattern-setup__carousel\">\n\t\t\t\t<div className={ containerClass }>\n\t\t\t\t\t<div className=\"carousel-container\">\n\t\t\t\t\t\t{ patterns.map( ( pattern, index ) => (\n\t\t\t\t\t\t\t<BlockPatternSlide\n\t\t\t\t\t\t\t\tactive={ index === activeSlide }\n\t\t\t\t\t\t\t\tclassName={ slideClass.get( index ) || '' }\n\t\t\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"block-editor-block-pattern-setup__grid\">\n\t\t\t<Composite\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName={ containerClass }\n\t\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t\t>\n\t\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonSelect={ onBlockPatternSelect }\n\t\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t</div>\n\t);\n};\n\nfunction BlockPattern( { pattern, onSelect, showTitles } ) {\n\tconst baseClassName = 'block-editor-block-pattern-setup-list';\n\tconst { blocks, description, viewportWidth = 700 } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }__item-description`\n\t);\n\treturn (\n\t\t<div className={ `${ baseClassName }__list-item` }>\n\t\t\t<Composite.Item\n\t\t\t\trender={\n\t\t\t\t\t<div\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\tdescription ? descriptionId : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\tclassName={ `${ baseClassName }__item` }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tid={ `${ baseClassName }__pattern__${ pattern.name }` }\n\t\t\t\trole=\"option\"\n\t\t\t\tonClick={ () => onSelect( blocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t/>\n\t\t\t\t{ showTitles && (\n\t\t\t\t\t<div className={ `${ baseClassName }__item-title` }>\n\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ !! description && (\n\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</Composite.Item>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternSlide( { active, className, pattern, minHeight } ) {\n\tconst { blocks, title, description } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPatternSlide,\n\t\t'block-editor-block-pattern-setup-list__item-description'\n\t);\n\treturn (\n\t\t<div\n\t\t\taria-hidden={ ! active }\n\t\t\trole=\"img\"\n\t\t\tclassName={ `pattern-slide ${ className }` }\n\t\t\taria-label={ title }\n\t\t\taria-describedby={ description ? descriptionId : undefined }\n\t\t>\n\t\t\t<BlockPreview blocks={ blocks } minHeight={ minHeight } />\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nconst BlockPatternSetup = ( {\n\tclientId,\n\tblockName,\n\tfilterPatternsFn,\n\tonBlockPatternSelect,\n\tinitialViewMode = VIEWMODES.carousel,\n\tshowTitles = false,\n} ) => {\n\tconst [ viewMode, setViewMode ] = useState( initialViewMode );\n\tconst [ activeSlide, setActiveSlide ] = useState( 0 );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );\n\n\tif ( ! patterns?.length ) {\n\t\treturn null;\n\t}\n\n\tconst onBlockPatternSelectDefault = ( blocks ) => {\n\t\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\t\treplaceBlock( clientId, clonedBlocks );\n\t};\n\tconst onPatternSelectCallback =\n\t\tonBlockPatternSelect || onBlockPatternSelectDefault;\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ `block-editor-block-pattern-setup view-mode-${ viewMode }` }\n\t\t\t>\n\t\t\t\t<SetupContent\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonBlockPatternSelect={ onPatternSelectCallback }\n\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t/>\n\t\t\t\t<SetupToolbar\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tsetViewMode={ setViewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\ttotalSlides={ patterns.length }\n\t\t\t\t\thandleNext={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) =>\n\t\t\t\t\t\t\tMath.min( active + 1, patterns.length - 1 )\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\thandlePrevious={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) =>\n\t\t\t\t\t\t\tMath.max( active - 1, 0 )\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tonBlockPatternSelect={ () => {\n\t\t\t\t\t\tonPatternSelectCallback(\n\t\t\t\t\t\t\tpatterns[ activeSlide ].blocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default BlockPatternSetup;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,SAAS,EAAEC,cA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