@wordpress/block-editor 12.25.0 → 12.26.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 (674) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/README.md +6 -0
  3. package/build/components/block-actions/index.js +4 -2
  4. package/build/components/block-actions/index.js.map +1 -1
  5. package/build/components/block-alignment-control/ui.js +2 -2
  6. package/build/components/block-alignment-control/ui.js.map +1 -1
  7. package/build/components/block-card/index.js +2 -2
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-compare/index.js +2 -2
  10. package/build/components/block-compare/index.js.map +1 -1
  11. package/build/components/block-edit/edit.js +2 -2
  12. package/build/components/block-edit/edit.js.map +1 -1
  13. package/build/components/block-icon/index.js +2 -2
  14. package/build/components/block-icon/index.js.map +1 -1
  15. package/build/components/block-inspector/index.js +1 -1
  16. package/build/components/block-inspector/index.js.map +1 -1
  17. package/build/components/block-list/block.js +4 -4
  18. package/build/components/block-list/block.js.map +1 -1
  19. package/build/components/block-list/block.native.js +2 -2
  20. package/build/components/block-list/block.native.js.map +1 -1
  21. package/build/components/block-list/index.js +2 -2
  22. package/build/components/block-list/index.js.map +1 -1
  23. package/build/components/block-list/use-block-props/index.js +5 -2
  24. package/build/components/block-list/use-block-props/index.js.map +1 -1
  25. package/build/components/block-list/use-block-props/use-scroll-into-view.js +44 -0
  26. package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  27. package/build/components/block-list-appender/index.js +2 -2
  28. package/build/components/block-list-appender/index.js.map +1 -1
  29. package/build/components/block-mover/button.js +2 -2
  30. package/build/components/block-mover/button.js.map +1 -1
  31. package/build/components/block-mover/index.js +2 -2
  32. package/build/components/block-mover/index.js.map +1 -1
  33. package/build/components/block-patterns-list/index.js +26 -5
  34. package/build/components/block-patterns-list/index.js.map +1 -1
  35. package/build/components/block-popover/cover.js +9 -6
  36. package/build/components/block-popover/cover.js.map +1 -1
  37. package/build/components/block-popover/inbetween.js +2 -2
  38. package/build/components/block-popover/inbetween.js.map +1 -1
  39. package/build/components/block-popover/index.js +22 -4
  40. package/build/components/block-popover/index.js.map +1 -1
  41. package/build/components/block-preview/index.js +2 -2
  42. package/build/components/block-preview/index.js.map +1 -1
  43. package/build/components/block-settings-menu/block-settings-dropdown.js +8 -5
  44. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  45. package/build/components/block-settings-menu-controls/index.js +10 -7
  46. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  47. package/build/components/block-styles/index.js +2 -2
  48. package/build/components/block-styles/index.js.map +1 -1
  49. package/build/components/block-toolbar/index.js +3 -3
  50. package/build/components/block-toolbar/index.js.map +1 -1
  51. package/build/components/block-tools/block-selection-button.js +2 -2
  52. package/build/components/block-tools/block-selection-button.js.map +1 -1
  53. package/build/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  54. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  55. package/build/components/block-tools/block-toolbar-popover.js +2 -2
  56. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  57. package/build/components/block-tools/empty-block-inserter.js +2 -2
  58. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  59. package/build/components/block-tools/index.js +20 -1
  60. package/build/components/block-tools/index.js.map +1 -1
  61. package/build/components/block-tools/insertion-point.js +4 -4
  62. package/build/components/block-tools/insertion-point.js.map +1 -1
  63. package/build/components/block-tools/zoom-out-mode-inserters.js +66 -22
  64. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  65. package/build/components/block-variation-picker/index.js +2 -2
  66. package/build/components/block-variation-picker/index.js.map +1 -1
  67. package/build/components/button-block-appender/index.js +2 -2
  68. package/build/components/button-block-appender/index.js.map +1 -1
  69. package/build/components/child-layout-control/index.js +2 -2
  70. package/build/components/child-layout-control/index.js.map +1 -1
  71. package/build/components/colors-gradients/control.js +3 -3
  72. package/build/components/colors-gradients/control.js.map +1 -1
  73. package/build/components/colors-gradients/dropdown.js +2 -2
  74. package/build/components/colors-gradients/dropdown.js.map +1 -1
  75. package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  76. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  77. package/build/components/convert-to-group-buttons/index.js +6 -0
  78. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  79. package/build/components/default-block-appender/index.js +2 -2
  80. package/build/components/default-block-appender/index.js.map +1 -1
  81. package/build/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  82. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  83. package/build/components/global-styles/background-panel.js +3 -3
  84. package/build/components/global-styles/background-panel.js.map +1 -1
  85. package/build/components/global-styles/color-panel.js +3 -3
  86. package/build/components/global-styles/color-panel.js.map +1 -1
  87. package/build/components/global-styles/dimensions-panel.js +4 -4
  88. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  89. package/build/components/global-styles/filters-panel.js +2 -2
  90. package/build/components/global-styles/filters-panel.js.map +1 -1
  91. package/build/components/global-styles/shadow-panel-components.js +4 -4
  92. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  93. package/build/components/global-styles/use-global-styles-output.js +1 -1
  94. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  95. package/build/components/grid-visualizer/grid-item-resizer.js +141 -24
  96. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  97. package/build/components/grid-visualizer/grid-visualizer.js +11 -5
  98. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  99. package/build/components/iframe/index.js +69 -30
  100. package/build/components/iframe/index.js.map +1 -1
  101. package/build/components/image-editor/aspect-ratio-dropdown.js +53 -36
  102. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  103. package/build/components/image-editor/cropper.js +2 -2
  104. package/build/components/image-editor/cropper.js.map +1 -1
  105. package/build/components/image-editor/index.js +1 -1
  106. package/build/components/image-editor/index.js.map +1 -1
  107. package/build/components/index.js +8 -0
  108. package/build/components/index.js.map +1 -1
  109. package/build/components/inner-blocks/button-block-appender.js +2 -2
  110. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  111. package/build/components/inner-blocks/index.js +22 -21
  112. package/build/components/inner-blocks/index.js.map +1 -1
  113. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  114. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  115. package/build/components/inserter/block-patterns-tab/index.js +9 -0
  116. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  117. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  118. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  119. package/build/components/inserter/block-types-tab.js +5 -3
  120. package/build/components/inserter/block-types-tab.js.map +1 -1
  121. package/build/components/inserter/hooks/use-insertion-point.js +11 -2
  122. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  123. package/build/components/inserter/hooks/use-patterns-state.js +12 -5
  124. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  125. package/build/components/inserter/index.js +2 -2
  126. package/build/components/inserter/index.js.map +1 -1
  127. package/build/components/inserter/library.js +8 -2
  128. package/build/components/inserter/library.js.map +1 -1
  129. package/build/components/inserter/media-tab/media-preview.js +2 -2
  130. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  131. package/build/components/inserter/menu.js +72 -56
  132. package/build/components/inserter/menu.js.map +1 -1
  133. package/build/components/inserter/quick-inserter.js +2 -2
  134. package/build/components/inserter/quick-inserter.js.map +1 -1
  135. package/build/components/inserter/tabs.js +17 -5
  136. package/build/components/inserter/tabs.js.map +1 -1
  137. package/build/components/inserter-list-item/index.js +3 -3
  138. package/build/components/inserter-list-item/index.js.map +1 -1
  139. package/build/components/keyboard-shortcuts/index.js +9 -0
  140. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  141. package/build/components/link-control/index.js +2 -2
  142. package/build/components/link-control/index.js.map +1 -1
  143. package/build/components/link-control/link-preview.js +3 -3
  144. package/build/components/link-control/link-preview.js.map +1 -1
  145. package/build/components/link-control/search-results.js +2 -2
  146. package/build/components/link-control/search-results.js.map +1 -1
  147. package/build/components/list-view/block-contents.js +2 -2
  148. package/build/components/list-view/block-contents.js.map +1 -1
  149. package/build/components/list-view/block-select-button.js +11 -3
  150. package/build/components/list-view/block-select-button.js.map +1 -1
  151. package/build/components/list-view/block.js +35 -12
  152. package/build/components/list-view/block.js.map +1 -1
  153. package/build/components/list-view/drop-indicator.js +3 -3
  154. package/build/components/list-view/drop-indicator.js.map +1 -1
  155. package/build/components/list-view/index.js +2 -2
  156. package/build/components/list-view/index.js.map +1 -1
  157. package/build/components/list-view/leaf.js +2 -2
  158. package/build/components/list-view/leaf.js.map +1 -1
  159. package/build/components/media-placeholder/index.js +4 -4
  160. package/build/components/media-placeholder/index.js.map +1 -1
  161. package/build/components/media-replace-flow/index.js +2 -2
  162. package/build/components/media-replace-flow/index.js.map +1 -1
  163. package/build/components/plain-text/index.js +2 -2
  164. package/build/components/plain-text/index.js.map +1 -1
  165. package/build/components/provider/use-block-sync.js +18 -0
  166. package/build/components/provider/use-block-sync.js.map +1 -1
  167. package/build/components/responsive-block-control/index.js +2 -2
  168. package/build/components/responsive-block-control/index.js.map +1 -1
  169. package/build/components/rich-text/event-listeners/enter.js +33 -42
  170. package/build/components/rich-text/event-listeners/enter.js.map +1 -1
  171. package/build/components/rich-text/event-listeners/paste-handler.js +22 -42
  172. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  173. package/build/components/rich-text/format-toolbar/index.js +2 -2
  174. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  175. package/build/components/rich-text/index.js +9 -2
  176. package/build/components/rich-text/index.js.map +1 -1
  177. package/build/components/rich-text/index.native.js +2 -2
  178. package/build/components/rich-text/index.native.js.map +1 -1
  179. package/build/components/rich-text/multiline.js +30 -2
  180. package/build/components/rich-text/multiline.js.map +1 -1
  181. package/build/components/segmented-text-control/index.js +2 -2
  182. package/build/components/segmented-text-control/index.js.map +1 -1
  183. package/build/components/text-alignment-control/index.js +2 -2
  184. package/build/components/text-alignment-control/index.js.map +1 -1
  185. package/build/components/text-decoration-control/index.js +2 -2
  186. package/build/components/text-decoration-control/index.js.map +1 -1
  187. package/build/components/text-transform-control/index.js +2 -2
  188. package/build/components/text-transform-control/index.js.map +1 -1
  189. package/build/components/url-input/index.js +4 -4
  190. package/build/components/url-input/index.js.map +1 -1
  191. package/build/components/url-popover/link-editor.js +2 -2
  192. package/build/components/url-popover/link-editor.js.map +1 -1
  193. package/build/components/url-popover/link-viewer-url.js +2 -2
  194. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  195. package/build/components/url-popover/link-viewer.js +2 -2
  196. package/build/components/url-popover/link-viewer.js.map +1 -1
  197. package/build/components/warning/index.js +2 -2
  198. package/build/components/warning/index.js.map +1 -1
  199. package/build/components/writing-flow/index.js +2 -2
  200. package/build/components/writing-flow/index.js.map +1 -1
  201. package/build/components/writing-flow/use-clipboard-handler.js +77 -30
  202. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  203. package/build/components/writing-flow/use-input.js +44 -2
  204. package/build/components/writing-flow/use-input.js.map +1 -1
  205. package/build/components/writing-flow/use-tab-nav.js +6 -1
  206. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  207. package/build/components/writing-mode-control/index.js +2 -2
  208. package/build/components/writing-mode-control/index.js.map +1 -1
  209. package/build/hooks/align.js +2 -2
  210. package/build/hooks/align.js.map +1 -1
  211. package/build/hooks/background.js +1 -1
  212. package/build/hooks/background.js.map +1 -1
  213. package/build/hooks/border.js +3 -3
  214. package/build/hooks/border.js.map +1 -1
  215. package/build/hooks/color.js +3 -3
  216. package/build/hooks/color.js.map +1 -1
  217. package/build/hooks/content-lock-ui.js +5 -28
  218. package/build/hooks/content-lock-ui.js.map +1 -1
  219. package/build/hooks/custom-class-name.js +2 -2
  220. package/build/hooks/custom-class-name.js.map +1 -1
  221. package/build/hooks/custom-class-name.native.js +2 -2
  222. package/build/hooks/custom-class-name.native.js.map +1 -1
  223. package/build/hooks/dimensions.js +2 -2
  224. package/build/hooks/dimensions.js.map +1 -1
  225. package/build/hooks/layout-child.js +16 -8
  226. package/build/hooks/layout-child.js.map +1 -1
  227. package/build/hooks/layout.js +2 -2
  228. package/build/hooks/layout.js.map +1 -1
  229. package/build/hooks/position.js +2 -2
  230. package/build/hooks/position.js.map +1 -1
  231. package/build/hooks/text-align.js +3 -3
  232. package/build/hooks/text-align.js.map +1 -1
  233. package/build/hooks/use-bindings-attributes.js +39 -13
  234. package/build/hooks/use-bindings-attributes.js.map +1 -1
  235. package/build/hooks/use-color-props.js +2 -2
  236. package/build/hooks/use-color-props.js.map +1 -1
  237. package/build/hooks/use-typography-props.js +2 -2
  238. package/build/hooks/use-typography-props.js.map +1 -1
  239. package/build/hooks/utils.js +2 -2
  240. package/build/hooks/utils.js.map +1 -1
  241. package/build/layouts/grid.js +7 -6
  242. package/build/layouts/grid.js.map +1 -1
  243. package/build/private-apis.js +4 -1
  244. package/build/private-apis.js.map +1 -1
  245. package/build/store/actions.js +134 -40
  246. package/build/store/actions.js.map +1 -1
  247. package/build/store/private-actions.js +26 -1
  248. package/build/store/private-actions.js.map +1 -1
  249. package/build/store/private-keys.js +2 -1
  250. package/build/store/private-keys.js.map +1 -1
  251. package/build/store/private-selectors.js +6 -0
  252. package/build/store/private-selectors.js.map +1 -1
  253. package/build/store/selectors.js +4 -1
  254. package/build/store/selectors.js.map +1 -1
  255. package/build/utils/selection.js +8 -0
  256. package/build/utils/selection.js.map +1 -1
  257. package/build/utils/transform-styles/index.js +12 -7
  258. package/build/utils/transform-styles/index.js.map +1 -1
  259. package/build-module/components/block-actions/index.js +4 -2
  260. package/build-module/components/block-actions/index.js.map +1 -1
  261. package/build-module/components/block-alignment-control/ui.js +2 -2
  262. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  263. package/build-module/components/block-card/index.js +2 -2
  264. package/build-module/components/block-card/index.js.map +1 -1
  265. package/build-module/components/block-compare/index.js +2 -2
  266. package/build-module/components/block-compare/index.js.map +1 -1
  267. package/build-module/components/block-edit/edit.js +2 -2
  268. package/build-module/components/block-edit/edit.js.map +1 -1
  269. package/build-module/components/block-icon/index.js +2 -2
  270. package/build-module/components/block-icon/index.js.map +1 -1
  271. package/build-module/components/block-inspector/index.js +1 -1
  272. package/build-module/components/block-inspector/index.js.map +1 -1
  273. package/build-module/components/block-list/block.js +4 -4
  274. package/build-module/components/block-list/block.js.map +1 -1
  275. package/build-module/components/block-list/block.native.js +2 -2
  276. package/build-module/components/block-list/block.native.js.map +1 -1
  277. package/build-module/components/block-list/index.js +2 -2
  278. package/build-module/components/block-list/index.js.map +1 -1
  279. package/build-module/components/block-list/use-block-props/index.js +5 -2
  280. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  281. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +37 -0
  282. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  283. package/build-module/components/block-list-appender/index.js +2 -2
  284. package/build-module/components/block-list-appender/index.js.map +1 -1
  285. package/build-module/components/block-mover/button.js +2 -2
  286. package/build-module/components/block-mover/button.js.map +1 -1
  287. package/build-module/components/block-mover/index.js +2 -2
  288. package/build-module/components/block-mover/index.js.map +1 -1
  289. package/build-module/components/block-patterns-list/index.js +27 -6
  290. package/build-module/components/block-patterns-list/index.js.map +1 -1
  291. package/build-module/components/block-popover/cover.js +9 -5
  292. package/build-module/components/block-popover/cover.js.map +1 -1
  293. package/build-module/components/block-popover/inbetween.js +2 -2
  294. package/build-module/components/block-popover/inbetween.js.map +1 -1
  295. package/build-module/components/block-popover/index.js +21 -3
  296. package/build-module/components/block-popover/index.js.map +1 -1
  297. package/build-module/components/block-preview/index.js +2 -2
  298. package/build-module/components/block-preview/index.js.map +1 -1
  299. package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -5
  300. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  301. package/build-module/components/block-settings-menu-controls/index.js +10 -7
  302. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  303. package/build-module/components/block-styles/index.js +2 -2
  304. package/build-module/components/block-styles/index.js.map +1 -1
  305. package/build-module/components/block-toolbar/index.js +3 -3
  306. package/build-module/components/block-toolbar/index.js.map +1 -1
  307. package/build-module/components/block-tools/block-selection-button.js +2 -2
  308. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  309. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  310. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  311. package/build-module/components/block-tools/block-toolbar-popover.js +2 -2
  312. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  313. package/build-module/components/block-tools/empty-block-inserter.js +2 -2
  314. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  315. package/build-module/components/block-tools/index.js +20 -1
  316. package/build-module/components/block-tools/index.js.map +1 -1
  317. package/build-module/components/block-tools/insertion-point.js +4 -4
  318. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  319. package/build-module/components/block-tools/zoom-out-mode-inserters.js +67 -23
  320. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  321. package/build-module/components/block-variation-picker/index.js +2 -2
  322. package/build-module/components/block-variation-picker/index.js.map +1 -1
  323. package/build-module/components/button-block-appender/index.js +2 -2
  324. package/build-module/components/button-block-appender/index.js.map +1 -1
  325. package/build-module/components/child-layout-control/index.js +2 -2
  326. package/build-module/components/child-layout-control/index.js.map +1 -1
  327. package/build-module/components/colors-gradients/control.js +3 -3
  328. package/build-module/components/colors-gradients/control.js.map +1 -1
  329. package/build-module/components/colors-gradients/dropdown.js +2 -2
  330. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  331. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  332. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  333. package/build-module/components/convert-to-group-buttons/index.js +7 -1
  334. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  335. package/build-module/components/default-block-appender/index.js +2 -2
  336. package/build-module/components/default-block-appender/index.js.map +1 -1
  337. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  338. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  339. package/build-module/components/global-styles/background-panel.js +3 -3
  340. package/build-module/components/global-styles/background-panel.js.map +1 -1
  341. package/build-module/components/global-styles/color-panel.js +3 -3
  342. package/build-module/components/global-styles/color-panel.js.map +1 -1
  343. package/build-module/components/global-styles/dimensions-panel.js +4 -4
  344. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  345. package/build-module/components/global-styles/filters-panel.js +2 -2
  346. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  347. package/build-module/components/global-styles/shadow-panel-components.js +4 -4
  348. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  349. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  350. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  351. package/build-module/components/grid-visualizer/grid-item-resizer.js +141 -24
  352. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  353. package/build-module/components/grid-visualizer/grid-visualizer.js +12 -6
  354. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  355. package/build-module/components/iframe/index.js +70 -31
  356. package/build-module/components/iframe/index.js.map +1 -1
  357. package/build-module/components/image-editor/aspect-ratio-dropdown.js +52 -36
  358. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  359. package/build-module/components/image-editor/cropper.js +2 -2
  360. package/build-module/components/image-editor/cropper.js.map +1 -1
  361. package/build-module/components/image-editor/index.js +1 -1
  362. package/build-module/components/image-editor/index.js.map +1 -1
  363. package/build-module/components/index.js +1 -0
  364. package/build-module/components/index.js.map +1 -1
  365. package/build-module/components/inner-blocks/button-block-appender.js +2 -2
  366. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  367. package/build-module/components/inner-blocks/index.js +22 -21
  368. package/build-module/components/inner-blocks/index.js.map +1 -1
  369. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  370. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  371. package/build-module/components/inserter/block-patterns-tab/index.js +10 -1
  372. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  373. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  374. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  375. package/build-module/components/inserter/block-types-tab.js +6 -4
  376. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  377. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -2
  378. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  379. package/build-module/components/inserter/hooks/use-patterns-state.js +12 -5
  380. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  381. package/build-module/components/inserter/index.js +2 -2
  382. package/build-module/components/inserter/index.js.map +1 -1
  383. package/build-module/components/inserter/library.js +8 -2
  384. package/build-module/components/inserter/library.js.map +1 -1
  385. package/build-module/components/inserter/media-tab/media-preview.js +2 -2
  386. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  387. package/build-module/components/inserter/menu.js +72 -56
  388. package/build-module/components/inserter/menu.js.map +1 -1
  389. package/build-module/components/inserter/quick-inserter.js +2 -2
  390. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  391. package/build-module/components/inserter/tabs.js +18 -6
  392. package/build-module/components/inserter/tabs.js.map +1 -1
  393. package/build-module/components/inserter-list-item/index.js +3 -3
  394. package/build-module/components/inserter-list-item/index.js.map +1 -1
  395. package/build-module/components/keyboard-shortcuts/index.js +9 -0
  396. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  397. package/build-module/components/link-control/index.js +2 -2
  398. package/build-module/components/link-control/index.js.map +1 -1
  399. package/build-module/components/link-control/link-preview.js +3 -3
  400. package/build-module/components/link-control/link-preview.js.map +1 -1
  401. package/build-module/components/link-control/search-results.js +2 -2
  402. package/build-module/components/link-control/search-results.js.map +1 -1
  403. package/build-module/components/list-view/block-contents.js +2 -2
  404. package/build-module/components/list-view/block-contents.js.map +1 -1
  405. package/build-module/components/list-view/block-select-button.js +11 -3
  406. package/build-module/components/list-view/block-select-button.js.map +1 -1
  407. package/build-module/components/list-view/block.js +36 -13
  408. package/build-module/components/list-view/block.js.map +1 -1
  409. package/build-module/components/list-view/drop-indicator.js +3 -3
  410. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  411. package/build-module/components/list-view/index.js +2 -2
  412. package/build-module/components/list-view/index.js.map +1 -1
  413. package/build-module/components/list-view/leaf.js +2 -2
  414. package/build-module/components/list-view/leaf.js.map +1 -1
  415. package/build-module/components/media-placeholder/index.js +4 -4
  416. package/build-module/components/media-placeholder/index.js.map +1 -1
  417. package/build-module/components/media-replace-flow/index.js +2 -2
  418. package/build-module/components/media-replace-flow/index.js.map +1 -1
  419. package/build-module/components/plain-text/index.js +2 -2
  420. package/build-module/components/plain-text/index.js.map +1 -1
  421. package/build-module/components/provider/use-block-sync.js +19 -1
  422. package/build-module/components/provider/use-block-sync.js.map +1 -1
  423. package/build-module/components/responsive-block-control/index.js +2 -2
  424. package/build-module/components/responsive-block-control/index.js.map +1 -1
  425. package/build-module/components/rich-text/event-listeners/enter.js +33 -43
  426. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  427. package/build-module/components/rich-text/event-listeners/paste-handler.js +23 -43
  428. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  429. package/build-module/components/rich-text/format-toolbar/index.js +2 -2
  430. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  431. package/build-module/components/rich-text/index.js +9 -2
  432. package/build-module/components/rich-text/index.js.map +1 -1
  433. package/build-module/components/rich-text/index.native.js +2 -2
  434. package/build-module/components/rich-text/index.native.js.map +1 -1
  435. package/build-module/components/rich-text/multiline.js +31 -3
  436. package/build-module/components/rich-text/multiline.js.map +1 -1
  437. package/build-module/components/segmented-text-control/index.js +2 -2
  438. package/build-module/components/segmented-text-control/index.js.map +1 -1
  439. package/build-module/components/text-alignment-control/index.js +2 -2
  440. package/build-module/components/text-alignment-control/index.js.map +1 -1
  441. package/build-module/components/text-decoration-control/index.js +2 -2
  442. package/build-module/components/text-decoration-control/index.js.map +1 -1
  443. package/build-module/components/text-transform-control/index.js +2 -2
  444. package/build-module/components/text-transform-control/index.js.map +1 -1
  445. package/build-module/components/url-input/index.js +4 -4
  446. package/build-module/components/url-input/index.js.map +1 -1
  447. package/build-module/components/url-popover/link-editor.js +2 -2
  448. package/build-module/components/url-popover/link-editor.js.map +1 -1
  449. package/build-module/components/url-popover/link-viewer-url.js +2 -2
  450. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  451. package/build-module/components/url-popover/link-viewer.js +2 -2
  452. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  453. package/build-module/components/warning/index.js +2 -2
  454. package/build-module/components/warning/index.js.map +1 -1
  455. package/build-module/components/writing-flow/index.js +2 -2
  456. package/build-module/components/writing-flow/index.js.map +1 -1
  457. package/build-module/components/writing-flow/use-clipboard-handler.js +78 -31
  458. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  459. package/build-module/components/writing-flow/use-input.js +45 -3
  460. package/build-module/components/writing-flow/use-input.js.map +1 -1
  461. package/build-module/components/writing-flow/use-tab-nav.js +6 -1
  462. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  463. package/build-module/components/writing-mode-control/index.js +2 -2
  464. package/build-module/components/writing-mode-control/index.js.map +1 -1
  465. package/build-module/hooks/align.js +2 -2
  466. package/build-module/hooks/align.js.map +1 -1
  467. package/build-module/hooks/background.js +1 -1
  468. package/build-module/hooks/background.js.map +1 -1
  469. package/build-module/hooks/border.js +3 -3
  470. package/build-module/hooks/border.js.map +1 -1
  471. package/build-module/hooks/color.js +3 -3
  472. package/build-module/hooks/color.js.map +1 -1
  473. package/build-module/hooks/content-lock-ui.js +5 -28
  474. package/build-module/hooks/content-lock-ui.js.map +1 -1
  475. package/build-module/hooks/custom-class-name.js +2 -2
  476. package/build-module/hooks/custom-class-name.js.map +1 -1
  477. package/build-module/hooks/custom-class-name.native.js +2 -2
  478. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  479. package/build-module/hooks/dimensions.js +2 -2
  480. package/build-module/hooks/dimensions.js.map +1 -1
  481. package/build-module/hooks/layout-child.js +16 -8
  482. package/build-module/hooks/layout-child.js.map +1 -1
  483. package/build-module/hooks/layout.js +2 -2
  484. package/build-module/hooks/layout.js.map +1 -1
  485. package/build-module/hooks/position.js +2 -2
  486. package/build-module/hooks/position.js.map +1 -1
  487. package/build-module/hooks/text-align.js +3 -3
  488. package/build-module/hooks/text-align.js.map +1 -1
  489. package/build-module/hooks/use-bindings-attributes.js +39 -13
  490. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  491. package/build-module/hooks/use-color-props.js +2 -2
  492. package/build-module/hooks/use-color-props.js.map +1 -1
  493. package/build-module/hooks/use-typography-props.js +2 -2
  494. package/build-module/hooks/use-typography-props.js.map +1 -1
  495. package/build-module/hooks/utils.js +2 -2
  496. package/build-module/hooks/utils.js.map +1 -1
  497. package/build-module/layouts/grid.js +7 -6
  498. package/build-module/layouts/grid.js.map +1 -1
  499. package/build-module/private-apis.js +5 -2
  500. package/build-module/private-apis.js.map +1 -1
  501. package/build-module/store/actions.js +136 -42
  502. package/build-module/store/actions.js.map +1 -1
  503. package/build-module/store/private-actions.js +24 -0
  504. package/build-module/store/private-actions.js.map +1 -1
  505. package/build-module/store/private-keys.js +1 -0
  506. package/build-module/store/private-keys.js.map +1 -1
  507. package/build-module/store/private-selectors.js +5 -0
  508. package/build-module/store/private-selectors.js.map +1 -1
  509. package/build-module/store/selectors.js +4 -1
  510. package/build-module/store/selectors.js.map +1 -1
  511. package/build-module/utils/selection.js +7 -0
  512. package/build-module/utils/selection.js.map +1 -1
  513. package/build-module/utils/transform-styles/index.js +12 -7
  514. package/build-module/utils/transform-styles/index.js.map +1 -1
  515. package/build-style/content-rtl.css +89 -96
  516. package/build-style/content.css +89 -96
  517. package/build-style/style-rtl.css +14 -4
  518. package/build-style/style.css +14 -4
  519. package/build-types/components/block-context/index.d.ts +1 -1
  520. package/build-types/components/block-context/index.d.ts.map +1 -1
  521. package/package.json +32 -32
  522. package/src/components/block-actions/index.js +5 -1
  523. package/src/components/block-alignment-control/ui.js +2 -2
  524. package/src/components/block-card/index.js +2 -2
  525. package/src/components/block-compare/index.js +2 -2
  526. package/src/components/block-content-overlay/content.scss +4 -37
  527. package/src/components/block-draggable/test/helpers.native.js +8 -8
  528. package/src/components/block-edit/edit.js +2 -2
  529. package/src/components/block-icon/index.js +2 -2
  530. package/src/components/block-inspector/index.js +2 -1
  531. package/src/components/block-list/block.js +4 -4
  532. package/src/components/block-list/block.native.js +2 -2
  533. package/src/components/block-list/content.scss +46 -73
  534. package/src/components/block-list/index.js +2 -2
  535. package/src/components/block-list/use-block-props/index.js +4 -2
  536. package/src/components/block-list/use-block-props/use-scroll-into-view.js +38 -0
  537. package/src/components/block-list-appender/index.js +2 -2
  538. package/src/components/block-mover/button.js +2 -2
  539. package/src/components/block-mover/index.js +2 -2
  540. package/src/components/block-patterns-list/index.js +29 -4
  541. package/src/components/block-popover/README.md +1 -1
  542. package/src/components/block-popover/cover.js +22 -7
  543. package/src/components/block-popover/inbetween.js +2 -2
  544. package/src/components/block-popover/index.js +24 -6
  545. package/src/components/block-preview/index.js +2 -2
  546. package/src/components/block-settings-menu/block-settings-dropdown.js +14 -6
  547. package/src/components/block-settings-menu-controls/index.js +25 -16
  548. package/src/components/block-styles/index.js +2 -2
  549. package/src/components/block-toolbar/index.js +3 -3
  550. package/src/components/block-tools/block-selection-button.js +2 -2
  551. package/src/components/block-tools/block-toolbar-breadcrumb.js +5 -5
  552. package/src/components/block-tools/block-toolbar-popover.js +4 -7
  553. package/src/components/block-tools/empty-block-inserter.js +2 -2
  554. package/src/components/block-tools/index.js +24 -3
  555. package/src/components/block-tools/insertion-point.js +4 -4
  556. package/src/components/block-tools/style.scss +8 -0
  557. package/src/components/block-tools/zoom-out-mode-inserters.js +73 -21
  558. package/src/components/block-variation-picker/index.js +2 -2
  559. package/src/components/button-block-appender/index.js +2 -2
  560. package/src/components/child-layout-control/index.js +14 -2
  561. package/src/components/colors-gradients/control.js +3 -3
  562. package/src/components/colors-gradients/dropdown.js +2 -2
  563. package/src/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  564. package/src/components/colors-gradients/test/control.js +3 -3
  565. package/src/components/convert-to-group-buttons/index.js +10 -1
  566. package/src/components/default-block-appender/index.js +2 -2
  567. package/src/components/dimensions-tool/aspect-ratio-tool.js +40 -67
  568. package/src/components/dimensions-tool/test/index.js +10 -0
  569. package/src/components/editable-text/README.md +0 -4
  570. package/src/components/global-styles/background-panel.js +3 -3
  571. package/src/components/global-styles/color-panel.js +3 -3
  572. package/src/components/global-styles/dimensions-panel.js +4 -4
  573. package/src/components/global-styles/filters-panel.js +2 -2
  574. package/src/components/global-styles/shadow-panel-components.js +6 -9
  575. package/src/components/global-styles/test/get-global-styles-changes.js +0 -2
  576. package/src/components/global-styles/test/use-global-styles-output.js +5 -5
  577. package/src/components/global-styles/use-global-styles-output.js +1 -1
  578. package/src/components/grid-visualizer/grid-item-resizer.js +169 -40
  579. package/src/components/grid-visualizer/grid-visualizer.js +19 -6
  580. package/src/components/iframe/content.scss +63 -0
  581. package/src/components/iframe/index.js +119 -39
  582. package/src/components/image-editor/aspect-ratio-dropdown.js +91 -59
  583. package/src/components/image-editor/cropper.js +2 -2
  584. package/src/components/image-editor/index.js +1 -1
  585. package/src/components/image-editor/test/index.js +22 -0
  586. package/src/components/index.js +1 -0
  587. package/src/components/inner-blocks/button-block-appender.js +2 -2
  588. package/src/components/inner-blocks/index.js +19 -17
  589. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -1
  590. package/src/components/inserter/block-patterns-tab/index.js +17 -1
  591. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -1
  592. package/src/components/inserter/block-types-tab.js +7 -9
  593. package/src/components/inserter/hooks/use-insertion-point.js +15 -1
  594. package/src/components/inserter/hooks/use-patterns-state.js +18 -5
  595. package/src/components/inserter/index.js +4 -5
  596. package/src/components/inserter/library.js +6 -0
  597. package/src/components/inserter/media-tab/media-preview.js +2 -2
  598. package/src/components/inserter/menu.js +113 -107
  599. package/src/components/inserter/quick-inserter.js +2 -2
  600. package/src/components/inserter/style.scss +6 -8
  601. package/src/components/inserter/tabs.js +29 -15
  602. package/src/components/inserter-list-item/index.js +3 -3
  603. package/src/components/keyboard-shortcuts/index.js +12 -0
  604. package/src/components/line-height-control/test/index.js +16 -14
  605. package/src/components/link-control/index.js +2 -2
  606. package/src/components/link-control/link-preview.js +3 -3
  607. package/src/components/link-control/search-results.js +2 -2
  608. package/src/components/list-view/block-contents.js +2 -2
  609. package/src/components/list-view/block-select-button.js +14 -3
  610. package/src/components/list-view/block.js +54 -30
  611. package/src/components/list-view/drop-indicator.js +3 -3
  612. package/src/components/list-view/index.js +2 -2
  613. package/src/components/list-view/leaf.js +2 -5
  614. package/src/components/media-placeholder/index.js +4 -4
  615. package/src/components/media-replace-flow/index.js +2 -2
  616. package/src/components/plain-text/index.js +2 -2
  617. package/src/components/provider/use-block-sync.js +27 -1
  618. package/src/components/responsive-block-control/index.js +2 -2
  619. package/src/components/rich-text/README.md +0 -8
  620. package/src/components/rich-text/event-listeners/enter.js +28 -48
  621. package/src/components/rich-text/event-listeners/paste-handler.js +21 -58
  622. package/src/components/rich-text/format-toolbar/index.js +2 -2
  623. package/src/components/rich-text/index.js +10 -3
  624. package/src/components/rich-text/index.native.js +2 -2
  625. package/src/components/rich-text/multiline.js +31 -3
  626. package/src/components/segmented-text-control/index.js +2 -2
  627. package/src/components/text-alignment-control/index.js +2 -2
  628. package/src/components/text-decoration-control/index.js +2 -2
  629. package/src/components/text-transform-control/index.js +2 -2
  630. package/src/components/url-input/index.js +4 -4
  631. package/src/components/url-popover/link-editor.js +2 -2
  632. package/src/components/url-popover/link-viewer-url.js +2 -2
  633. package/src/components/url-popover/link-viewer.js +2 -2
  634. package/src/components/warning/index.js +2 -2
  635. package/src/components/writing-flow/index.js +2 -2
  636. package/src/components/writing-flow/use-clipboard-handler.js +107 -47
  637. package/src/components/writing-flow/use-input.js +75 -1
  638. package/src/components/writing-flow/use-tab-nav.js +10 -1
  639. package/src/components/writing-mode-control/index.js +2 -5
  640. package/src/content.scss +1 -0
  641. package/src/hooks/align.js +2 -2
  642. package/src/hooks/background.js +1 -1
  643. package/src/hooks/border.js +3 -3
  644. package/src/hooks/color.js +12 -19
  645. package/src/hooks/color.scss +1 -0
  646. package/src/hooks/content-lock-ui.js +16 -33
  647. package/src/hooks/custom-class-name.js +2 -2
  648. package/src/hooks/custom-class-name.native.js +2 -2
  649. package/src/hooks/dimensions.js +2 -2
  650. package/src/hooks/layout-child.js +34 -20
  651. package/src/hooks/layout.js +2 -2
  652. package/src/hooks/position.js +2 -2
  653. package/src/hooks/text-align.js +3 -3
  654. package/src/hooks/use-bindings-attributes.js +48 -16
  655. package/src/hooks/use-color-props.js +2 -2
  656. package/src/hooks/use-typography-props.js +2 -2
  657. package/src/hooks/utils.js +2 -2
  658. package/src/layouts/grid.js +3 -7
  659. package/src/private-apis.js +4 -0
  660. package/src/store/actions.js +225 -70
  661. package/src/store/private-actions.js +24 -0
  662. package/src/store/private-keys.js +1 -0
  663. package/src/store/private-selectors.js +15 -0
  664. package/src/store/selectors.js +4 -2
  665. package/src/utils/selection.js +8 -0
  666. package/src/utils/test/__snapshots__/transform-styles.js.snap +6 -0
  667. package/src/utils/test/transform-styles.js +14 -0
  668. package/src/utils/transform-styles/index.js +12 -9
  669. package/tsconfig.tsbuildinfo +1 -1
  670. package/build/components/rich-text/split-value.js +0 -81
  671. package/build/components/rich-text/split-value.js.map +0 -1
  672. package/build-module/components/rich-text/split-value.js +0 -75
  673. package/build-module/components/rich-text/split-value.js.map +0 -1
  674. package/src/components/rich-text/split-value.js +0 -64
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","blockBindingsKey","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useBlockRefProvider","useIntersectionObserver","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","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 classnames from 'classnames';\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 { 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(),\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] );\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: classnames(\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,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAI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,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEe,iBAAiB;MACxC,iDAAiD,EAChDd;IACF,CAAC,EACDvB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtBwB,gBACD,CAAC;IACDc,KAAK,EAAE;MAAE,GAAGrC,YAAY,CAACqC,KAAK;MAAE,GAAGzC,KAAK,CAACyC,KAAK;MAAE,GAAGH;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAvC,aAAa,CAACqD,IAAI,GAAGtE,aAAa","ignoreList":[]}
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","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(),\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,SAASC,YAAY,QAAQ,wCAAwC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AG,EAAED,UAAU;IACfiB,EAAE,EAAG,SAAS9C,QAAU,GAAG4B,UAAY,EAAC;IACxCmB,IAAI,EAAE,UAAU;IAChB,YAAY,EAAEpB,UAAU;IACxB,YAAY,EAAE3B,QAAQ;IACtB,WAAW,EAAEM,IAAI;IACjB,YAAY,EAAEE,UAAU;IACxBwC,KAAK,EAAEtC,iBAAiB,GAAG,MAAM,GAAGuC,SAAS;IAC7ChD,SAAS,EAAE3B,IAAI,CACd,gCAAgC,EAChC;MACC;MACA,UAAU,EAAE,CAAE6B,SAAS;MACvB,mBAAmB,EAAEQ,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,EAAEe,iBAAiB;MACxC,iDAAiD,EAChDd;IACF,CAAC,EACDvB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtBwB,gBACD,CAAC;IACDc,KAAK,EAAE;MAAE,GAAGrC,YAAY,CAACqC,KAAK;MAAE,GAAGzC,KAAK,CAACyC,KAAK;MAAE,GAAGH;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAvC,aAAa,CAACqD,IAAI,GAAGvE,aAAa","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useReducedMotion, useRefEffect } from '@wordpress/compose';
5
+ export function useScrollIntoView({
6
+ isSelected
7
+ }) {
8
+ const prefersReducedMotion = useReducedMotion();
9
+ return useRefEffect(node => {
10
+ if (isSelected) {
11
+ const {
12
+ ownerDocument
13
+ } = node;
14
+ const {
15
+ defaultView
16
+ } = ownerDocument;
17
+ if (!defaultView.IntersectionObserver) {
18
+ return;
19
+ }
20
+ const observer = new defaultView.IntersectionObserver(entries => {
21
+ // Once observing starts, we always get an initial
22
+ // entry with the intersecting state.
23
+ if (!entries[0].isIntersecting) {
24
+ node.scrollIntoView({
25
+ behavior: prefersReducedMotion ? 'instant' : 'smooth'
26
+ });
27
+ }
28
+ observer.disconnect();
29
+ });
30
+ observer.observe(node);
31
+ return () => {
32
+ observer.disconnect();
33
+ };
34
+ }
35
+ }, [isSelected]);
36
+ }
37
+ //# sourceMappingURL=use-scroll-into-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useReducedMotion","useRefEffect","useScrollIntoView","isSelected","prefersReducedMotion","node","ownerDocument","defaultView","IntersectionObserver","observer","entries","isIntersecting","scrollIntoView","behavior","disconnect","observe"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-scroll-into-view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useRefEffect } from '@wordpress/compose';\n\nexport function useScrollIntoView( { isSelected } ) {\n\tconst prefersReducedMotion = useReducedMotion();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isSelected ) {\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\t\t\t\tif ( ! defaultView.IntersectionObserver ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst observer = new defaultView.IntersectionObserver(\n\t\t\t\t\t( entries ) => {\n\t\t\t\t\t\t// Once observing starts, we always get an initial\n\t\t\t\t\t\t// entry with the intersecting state.\n\t\t\t\t\t\tif ( ! entries[ 0 ].isIntersecting ) {\n\t\t\t\t\t\t\tnode.scrollIntoView( {\n\t\t\t\t\t\t\t\tbehavior: prefersReducedMotion\n\t\t\t\t\t\t\t\t\t? 'instant'\n\t\t\t\t\t\t\t\t\t: 'smooth',\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tobserver.observe( node );\n\t\t\t\treturn () => {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t[ isSelected ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,YAAY,QAAQ,oBAAoB;AAEnE,OAAO,SAASC,iBAAiBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EACnD,MAAMC,oBAAoB,GAAGJ,gBAAgB,CAAC,CAAC;EAC/C,OAAOC,YAAY,CAChBI,IAAI,IAAM;IACX,IAAKF,UAAU,EAAG;MACjB,MAAM;QAAEG;MAAc,CAAC,GAAGD,IAAI;MAC9B,MAAM;QAAEE;MAAY,CAAC,GAAGD,aAAa;MACrC,IAAK,CAAEC,WAAW,CAACC,oBAAoB,EAAG;QACzC;MACD;MACA,MAAMC,QAAQ,GAAG,IAAIF,WAAW,CAACC,oBAAoB,CAClDE,OAAO,IAAM;QACd;QACA;QACA,IAAK,CAAEA,OAAO,CAAE,CAAC,CAAE,CAACC,cAAc,EAAG;UACpCN,IAAI,CAACO,cAAc,CAAE;YACpBC,QAAQ,EAAET,oBAAoB,GAC3B,SAAS,GACT;UACJ,CAAE,CAAC;QACJ;QACAK,QAAQ,CAACK,UAAU,CAAC,CAAC;MACtB,CACD,CAAC;MACDL,QAAQ,CAACM,OAAO,CAAEV,IAAK,CAAC;MACxB,OAAO,MAAM;QACZI,QAAQ,CAACK,UAAU,CAAC,CAAC;MACtB,CAAC;IACF;EACD,CAAC,EACD,CAAEX,UAAU,CACb,CAAC;AACF","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -63,7 +63,7 @@ export default function BlockListAppender({
63
63
  // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
64
64
  , {
65
65
  tabIndex: -1,
66
- className: classnames('block-list-appender wp-block', className, {
66
+ className: clsx('block-list-appender wp-block', className, {
67
67
  'is-drag-over': isDragOver
68
68
  })
69
69
  // Needed in case the whole editor is content editable (for multi
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useSelect","getDefaultBlockName","DefaultBlockAppender","ButtonBlockAppender","store","blockEditorStore","DefaultAppender","rootClientId","canInsertDefaultBlock","select","canInsertBlockType","createElement","className","BlockListAppender","CustomAppender","tagName","TagName","isDragOver","getBlockInsertionPoint","isBlockInsertionPointVisible","getBlockCount","insertionPoint","tabIndex","contentEditable"],"sources":["@wordpress/block-editor/src/components/block-list-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport DefaultBlockAppender from '../default-block-appender';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { store as blockEditorStore } from '../../store';\n\nfunction DefaultAppender( { rootClientId } ) {\n\tconst canInsertDefaultBlock = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t)\n\t);\n\n\tif ( canInsertDefaultBlock ) {\n\t\t// Render the default block appender if the context supports use\n\t\t// of the default appender.\n\t\treturn <DefaultBlockAppender rootClientId={ rootClientId } />;\n\t}\n\n\t// Fallback in case the default block can't be inserted.\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ rootClientId }\n\t\t\tclassName=\"block-list-appender__toggle\"\n\t\t/>\n\t);\n}\n\nexport default function BlockListAppender( {\n\trootClientId,\n\tCustomAppender,\n\tclassName,\n\ttagName: TagName = 'div',\n} ) {\n\tconst isDragOver = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\t// Ideally we should also check for `isDragging` but currently it\n\t\t\t// requires a lot more setup. We can revisit this once we refactor\n\t\t\t// the DnD utility hooks.\n\t\t\treturn (\n\t\t\t\tisBlockInsertionPointVisible() &&\n\t\t\t\trootClientId === insertionPoint?.rootClientId &&\n\t\t\t\tgetBlockCount( rootClientId ) === 0\n\t\t\t);\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\treturn (\n\t\t<TagName\n\t\t\t// A `tabIndex` is used on the wrapping `div` element in order to\n\t\t\t// force a focus event to occur when an appender `button` element\n\t\t\t// is clicked. In some browsers (Firefox, Safari), button clicks do\n\t\t\t// not emit a focus event, which could cause this event to propagate\n\t\t\t// unexpectedly. The `tabIndex` ensures that the interaction is\n\t\t\t// captured as a focus, without also adding an extra tab stop.\n\t\t\t//\n\t\t\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName={ classnames( 'block-list-appender wp-block', className, {\n\t\t\t\t'is-drag-over': isDragOver,\n\t\t\t} ) }\n\t\t\t// Needed in case the whole editor is content editable (for multi\n\t\t\t// selection). It fixes an edge case where ArrowDown and ArrowRight\n\t\t\t// should collapse the selection to the end of that selection and\n\t\t\t// not into the appender.\n\t\t\tcontentEditable={ false }\n\t\t\t// The appender exists to let you add the first Paragraph before\n\t\t\t// any is inserted. To that end, this appender should visually be\n\t\t\t// presented as a block. That means theme CSS should style it as if\n\t\t\t// it were an empty paragraph block. That means a `wp-block` class to\n\t\t\t// ensure the width is correct, and a [data-block] attribute to ensure\n\t\t\t// the correct margin is applied, especially for classic themes which\n\t\t\t// have commonly targeted that attribute for margins.\n\t\t\tdata-block\n\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,KAAKc,cAAc,EAAEd,YAAY,IAC7Ca,aAAa,CAAEb,YAAa,CAAC,KAAK,CAAC;EAErC,CAAC,EACD,CAAEA,YAAY,CACf,CAAC;EAED,OACCI,aAAA,CAACK;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;IACAM,QAAQ,EAAG,CAAC,CAAG;IACfV,SAAS,EAAGb,UAAU,CAAE,8BAA8B,EAAEa,SAAS,EAAE;MAClE,cAAc,EAAEK;IACjB,CAAE;IACF;IACA;IACA;IACA;IAAA;IACAM,eAAe,EAAG;IAClB;IACA;IACA;IACA;IACA;IACA;IACA;IAAA;IACA;EAAU,GAERT,cAAc,GACfH,aAAA,CAACG,cAAc,MAAE,CAAC,GAElBH,aAAA,CAACL,eAAe;IAACC,YAAY,EAAGA;EAAc,CAAE,CAEzC,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useSelect","getDefaultBlockName","DefaultBlockAppender","ButtonBlockAppender","store","blockEditorStore","DefaultAppender","rootClientId","canInsertDefaultBlock","select","canInsertBlockType","createElement","className","BlockListAppender","CustomAppender","tagName","TagName","isDragOver","getBlockInsertionPoint","isBlockInsertionPointVisible","getBlockCount","insertionPoint","tabIndex","contentEditable"],"sources":["@wordpress/block-editor/src/components/block-list-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport DefaultBlockAppender from '../default-block-appender';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { store as blockEditorStore } from '../../store';\n\nfunction DefaultAppender( { rootClientId } ) {\n\tconst canInsertDefaultBlock = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t)\n\t);\n\n\tif ( canInsertDefaultBlock ) {\n\t\t// Render the default block appender if the context supports use\n\t\t// of the default appender.\n\t\treturn <DefaultBlockAppender rootClientId={ rootClientId } />;\n\t}\n\n\t// Fallback in case the default block can't be inserted.\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ rootClientId }\n\t\t\tclassName=\"block-list-appender__toggle\"\n\t\t/>\n\t);\n}\n\nexport default function BlockListAppender( {\n\trootClientId,\n\tCustomAppender,\n\tclassName,\n\ttagName: TagName = 'div',\n} ) {\n\tconst isDragOver = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\t// Ideally we should also check for `isDragging` but currently it\n\t\t\t// requires a lot more setup. We can revisit this once we refactor\n\t\t\t// the DnD utility hooks.\n\t\t\treturn (\n\t\t\t\tisBlockInsertionPointVisible() &&\n\t\t\t\trootClientId === insertionPoint?.rootClientId &&\n\t\t\t\tgetBlockCount( rootClientId ) === 0\n\t\t\t);\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\treturn (\n\t\t<TagName\n\t\t\t// A `tabIndex` is used on the wrapping `div` element in order to\n\t\t\t// force a focus event to occur when an appender `button` element\n\t\t\t// is clicked. In some browsers (Firefox, Safari), button clicks do\n\t\t\t// not emit a focus event, which could cause this event to propagate\n\t\t\t// unexpectedly. The `tabIndex` ensures that the interaction is\n\t\t\t// captured as a focus, without also adding an extra tab stop.\n\t\t\t//\n\t\t\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName={ clsx( 'block-list-appender wp-block', className, {\n\t\t\t\t'is-drag-over': isDragOver,\n\t\t\t} ) }\n\t\t\t// Needed in case the whole editor is content editable (for multi\n\t\t\t// selection). It fixes an edge case where ArrowDown and ArrowRight\n\t\t\t// should collapse the selection to the end of that selection and\n\t\t\t// not into the appender.\n\t\t\tcontentEditable={ false }\n\t\t\t// The appender exists to let you add the first Paragraph before\n\t\t\t// any is inserted. To that end, this appender should visually be\n\t\t\t// presented as a block. That means theme CSS should style it as if\n\t\t\t// it were an empty paragraph block. That means a `wp-block` class to\n\t\t\t// ensure the width is correct, and a [data-block] attribute to ensure\n\t\t\t// the correct margin is applied, especially for classic themes which\n\t\t\t// have commonly targeted that attribute for margins.\n\t\t\tdata-block\n\t\t>\n\t\t\t{ CustomAppender ? (\n\t\t\t\t<CustomAppender />\n\t\t\t) : (\n\t\t\t\t<DefaultAppender rootClientId={ rootClientId } />\n\t\t\t) }\n\t\t</TagName>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,QAAQ,mBAAmB;;AAEvD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,SAASC,eAAeA,CAAE;EAAEC;AAAa,CAAC,EAAG;EAC5C,MAAMC,qBAAqB,GAAGR,SAAS,CAAIS,MAAM,IAChDA,MAAM,CAAEJ,gBAAiB,CAAC,CAACK,kBAAkB,CAC5CT,mBAAmB,CAAC,CAAC,EACrBM,YACD,CACD,CAAC;EAED,IAAKC,qBAAqB,EAAG;IAC5B;IACA;IACA,OAAOG,aAAA,CAACT,oBAAoB;MAACK,YAAY,EAAGA;IAAc,CAAE,CAAC;EAC9D;;EAEA;EACA,OACCI,aAAA,CAACR,mBAAmB;IACnBI,YAAY,EAAGA,YAAc;IAC7BK,SAAS,EAAC;EAA6B,CACvC,CAAC;AAEJ;AAEA,eAAe,SAASC,iBAAiBA,CAAE;EAC1CN,YAAY;EACZO,cAAc;EACdF,SAAS;EACTG,OAAO,EAAEC,OAAO,GAAG;AACpB,CAAC,EAAG;EACH,MAAMC,UAAU,GAAGjB,SAAS,CACzBS,MAAM,IAAM;IACb,MAAM;MACLS,sBAAsB;MACtBC,4BAA4B;MAC5BC;IACD,CAAC,GAAGX,MAAM,CAAEJ,gBAAiB,CAAC;IAC9B,MAAMgB,cAAc,GAAGH,sBAAsB,CAAC,CAAC;IAC/C;IACA;IACA;IACA,OACCC,4BAA4B,CAAC,CAAC,IAC9BZ,YAAY,KAAKc,cAAc,EAAEd,YAAY,IAC7Ca,aAAa,CAAEb,YAAa,CAAC,KAAK,CAAC;EAErC,CAAC,EACD,CAAEA,YAAY,CACf,CAAC;EAED,OACCI,aAAA,CAACK;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;IACAM,QAAQ,EAAG,CAAC,CAAG;IACfV,SAAS,EAAGb,IAAI,CAAE,8BAA8B,EAAEa,SAAS,EAAE;MAC5D,cAAc,EAAEK;IACjB,CAAE;IACF;IACA;IACA;IACA;IAAA;IACAM,eAAe,EAAG;IAClB;IACA;IACA;IACA;IACA;IACA;IACA;IAAA;IACA;EAAU,GAERT,cAAc,GACfH,aAAA,CAACG,cAAc,MAAE,CAAC,GAElBH,aAAA,CAACL,eAAe;IAACC,YAAY,EAAGA;EAAc,CAAE,CAEzC,CAAC;AAEZ","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -111,7 +111,7 @@ const BlockMoverButton = forwardRef(({
111
111
  const descriptionId = `block-editor-block-mover-button__description-${instanceId}`;
112
112
  return createElement(Fragment, null, createElement(Button, {
113
113
  ref: ref,
114
- className: classnames('block-editor-block-mover-button', `is-${direction}-button`),
114
+ className: clsx('block-editor-block-mover-button', `is-${direction}-button`),
115
115
  icon: getArrowIcon(direction, orientation),
116
116
  label: getMovementDirectionLabel(direction, orientation),
117
117
  "aria-describedby": descriptionId,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","getBlockType","Button","VisuallyHidden","useInstanceId","useSelect","useDispatch","forwardRef","__","isRTL","chevronLeft","chevronRight","chevronUp","chevronDown","getBlockMoverDescription","store","blockEditorStore","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","createElement","Fragment","className","icon","label","__experimentalIsFocusable","id","title","BlockMoverUpButton","BlockMoverDownButton"],"sources":["@wordpress/block-editor/src/components/block-mover/button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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={ classnames(\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\t__experimentalIsFocusable\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,UAAU,MAAM,YAAY;;AAEnC;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;AAEvD,MAAMC,YAAY,GAAGA,CAAEC,SAAS,EAAEC,WAAW,KAAM;EAClD,IAAKD,SAAS,KAAK,IAAI,EAAG;IACzB,IAAKC,WAAW,KAAK,YAAY,EAAG;MACnC,OAAOV,KAAK,CAAC,CAAC,GAAGE,YAAY,GAAGD,WAAW;IAC5C;IACA,OAAOE,SAAS;EACjB,CAAC,MA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AAC;AAEH,OAAO,MAAM8C,oBAAoB,GAAGhE,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,KAAM;EACjE,OAAOoC,aAAA,CAACxC,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","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","createElement","Fragment","className","icon","label","__experimentalIsFocusable","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\t__experimentalIsFocusable\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;AAEvD,MAAMC,YAAY,GAAGA,CAAEC,SAAS,E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,GAAG/D,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,KAAM;EAC/D,OAAOoC,aAAA,CAACxC,gBAAgB;IAACJ,SAAS,EAAC,IAAI;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACpE,CAAE,CAAC;AAEH,OAAO,MAAM8C,oBAAoB,GAAGhE,UAAU,CAAE,CAAEkB,KAAK,EAAEC,GAAG,KAAM;EACjE,OAAOoC,aAAA,CAACxC,gBAAgB;IAACJ,SAAS,EAAC,MAAM;IAACQ,GAAG,EAAGA,GAAK;IAAA,GAAMD;EAAK,CAAI,CAAC;AACtE,CAAE,CAAC","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -58,7 +58,7 @@ function BlockMover({
58
58
  }
59
59
  const dragHandleLabel = __('Drag');
60
60
  return createElement(ToolbarGroup, {
61
- className: classnames('block-editor-block-mover', {
61
+ className: clsx('block-editor-block-mover', {
62
62
  'is-horizontal': orientation === 'horizontal'
63
63
  })
64
64
  }, !hideDragHandle && createElement(BlockDraggable, {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","dragHandle","ToolbarGroup","ToolbarItem","Button","useSelect","__","BlockDraggable","BlockMoverUpButton","BlockMoverDownButton","store","blockEditorStore","BlockMover","clientIds","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","canMove","rootClientId","isFirst","isLast","orientation","select","getBlockIndex","getBlockListSettings","canMoveBlocks","getBlockOrder","getBlockRootClientId","normalizedClientIds","Array","isArray","firstClientId","_rootClientId","firstIndex","lastIndex","length","blockOrder","dragHandleLabel","createElement","className","fadeWhenDisabled","draggableProps","icon","label","tabIndex","itemProps","disabled"],"sources":["@wordpress/block-editor/src/components/block-mover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { canMove, rootClientId, isFirst, isLast, orientation } = 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} = 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\n\t\t\treturn {\n\t\t\t\tcanMove: canMoveBlocks( clientIds, _rootClientId ),\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};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tif ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {\n\t\treturn null;\n\t}\n\n\tconst dragHandleLabel = __( 'Drag' );\n\n\treturn (\n\t\t<ToolbarGroup\n\t\t\tclassName={ classnames( '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\taria-hidden=\"true\"\n\t\t\t\t\t\t\tlabel={ dragHandleLabel }\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<div className=\"block-editor-block-mover__move-button-container\">\n\t\t\t\t<ToolbarItem>\n\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\tdisabled={ isBlockMoverUpButtonDisabled }\n\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarItem>\n\t\t\t\t<ToolbarItem>\n\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\tdisabled={ isBlockMoverDownButtonDisabled }\n\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarItem>\n\t\t\t</div>\n\t\t</ToolbarGroup>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/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AEA;AACA;AACA;AACA,eAAejC,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["clsx","dragHandle","ToolbarGroup","ToolbarItem","Button","useSelect","__","BlockDraggable","BlockMoverUpButton","BlockMoverDownButton","store","blockEditorStore","BlockMover","clientIds","hideDragHandle","isBlockMoverUpButtonDisabled","isBlockMoverDownButtonDisabled","canMove","rootClientId","isFirst","isLast","orientation","select","getBlockIndex","getBlockListSettings","canMoveBlocks","getBlockOrder","getBlockRootClientId","normalizedClientIds","Array","isArray","firstClientId","_rootClientId","firstIndex","lastIndex","length","blockOrder","dragHandleLabel","createElement","className","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 { canMove, rootClientId, isFirst, isLast, orientation } = 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} = 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\n\t\t\treturn {\n\t\t\t\tcanMove: canMoveBlocks( clientIds, _rootClientId ),\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};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tif ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {\n\t\treturn null;\n\t}\n\n\tconst dragHandleLabel = __( 'Drag' );\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\taria-hidden=\"true\"\n\t\t\t\t\t\t\tlabel={ dragHandleLabel }\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<div className=\"block-editor-block-mover__move-button-container\">\n\t\t\t\t<ToolbarItem>\n\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\tdisabled={ isBlockMoverUpButtonDisabled }\n\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarItem>\n\t\t\t\t<ToolbarItem>\n\t\t\t\t\t{ ( itemProps ) => (\n\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\tdisabled={ isBlockMoverDownButtonDisabled }\n\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t{ ...itemProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarItem>\n\t\t\t</div>\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;AAEvD,SAASC,UAAUA,CAAE;EACpBC,SAAS;EACTC,cAAc;EACdC,4BAA4B;EAC5BC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,OAAO;IAAEC,YAAY;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAY,CAAC,GAAGhB,SAAS,CACtEiB,MAAM,IAAM;IACb,MAAM;MACLC,aAAa;MACbC,oBAAoB;MACpBC,aAAa;MACbC,aAAa;MACbC;IACD,CAAC,GAAGL,MAAM,CAAEX,gBAAiB,CAAC;IAC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AClBI,KAAK,EAAGN;IACR;IACA;IAAA;IACAO,QAAQ,EAAC,IAAI;IAAA,GACRH;EAAc,CACnB,CAEa,CAChB,EACDH,aAAA;IAAKC,SAAS,EAAC;EAAiD,GAC/DD,aAAA,CAACnC,WAAW,QACP0C,SAAS,IACZP,aAAA,CAAC9B,kBAAkB;IAClBsC,QAAQ,EAAG/B,4BAA8B;IACzCF,SAAS,EAAGA,SAAW;IAAA,GAClBgC;EAAS,CACd,CAEU,CAAC,EACdP,aAAA,CAACnC,WAAW,QACP0C,SAAS,IACZP,aAAA,CAAC7B,oBAAoB;IACpBqC,QAAQ,EAAG9B,8BAAgC;IAC3CH,SAAS,EAAGA,SAAW;IAAA,GAClBgC;EAAS,CACd,CAEU,CACT,CACQ,CAAC;AAEjB;;AAEA;AACA;AACA;AACA,eAAejC,UAAU","ignoreList":[]}
@@ -2,12 +2,13 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import { useEffect, useState, forwardRef } from '@wordpress/element';
10
+ import { cloneBlock } from '@wordpress/blocks';
11
+ import { useEffect, useState, forwardRef, useMemo } from '@wordpress/element';
11
12
  import { VisuallyHidden, Tooltip, privateApis as componentsPrivateApis, __experimentalHStack as HStack } from '@wordpress/components';
12
13
  import { useInstanceId } from '@wordpress/compose';
13
14
  import { __ } from '@wordpress/i18n';
@@ -45,7 +46,8 @@ function BlockPattern({
45
46
  onClick,
46
47
  onHover,
47
48
  showTitle = true,
48
- showTooltip
49
+ showTooltip,
50
+ category
49
51
  }) {
50
52
  const [isDragging, setIsDragging] = useState(false);
51
53
  const {
@@ -54,9 +56,26 @@ function BlockPattern({
54
56
  } = pattern;
55
57
  const instanceId = useInstanceId(BlockPattern);
56
58
  const descriptionId = `block-editor-block-patterns-list__item-description-${instanceId}`;
59
+
60
+ // When we have a selected category and the pattern is draggable, we need to update the
61
+ // pattern's categories in metadata to only contain the selected category, and pass this to
62
+ // InserterDraggableBlocks component. We do that because we use this information for pattern
63
+ // shuffling and it makes more sense to show only the ones from the initially selected category during insertion.
64
+ const patternBlocks = useMemo(() => {
65
+ if (!category || !isDraggable) {
66
+ return blocks;
67
+ }
68
+ return (blocks !== null && blocks !== void 0 ? blocks : []).map(block => {
69
+ const clonedBlock = cloneBlock(block);
70
+ if (clonedBlock.attributes.metadata?.categories?.includes(category)) {
71
+ clonedBlock.attributes.metadata.categories = [category];
72
+ }
73
+ return clonedBlock;
74
+ });
75
+ }, [blocks, isDraggable, category]);
57
76
  return createElement(InserterDraggableBlocks, {
58
77
  isEnabled: isDraggable,
59
- blocks: blocks,
78
+ blocks: patternBlocks,
60
79
  pattern: pattern
61
80
  }, ({
62
81
  draggable,
@@ -86,7 +105,7 @@ function BlockPattern({
86
105
  role: "option",
87
106
  "aria-label": pattern.title,
88
107
  "aria-describedby": pattern.description ? descriptionId : undefined,
89
- className: classnames('block-editor-block-patterns-list__item', {
108
+ className: clsx('block-editor-block-patterns-list__item', {
90
109
  'block-editor-block-patterns-list__list-item-synced': pattern.type === INSERTER_PATTERN_TYPES.user && !pattern.syncStatus
91
110
  })
92
111
  }),
@@ -131,6 +150,7 @@ function BlockPatternsList({
131
150
  onClickPattern,
132
151
  orientation,
133
152
  label = __('Block patterns'),
153
+ category,
134
154
  showTitle = true,
135
155
  showTitlesAsTooltip,
136
156
  pagingProps
@@ -163,7 +183,8 @@ function BlockPatternsList({
163
183
  onHover: onHover,
164
184
  isDraggable: isDraggable,
165
185
  showTitle: showTitle,
166
- showTooltip: showTitlesAsTooltip
186
+ showTooltip: showTitlesAsTooltip,
187
+ category: category
167
188
  }) : createElement(BlockPatternPlaceholder, {
168
189
  key: pattern.name
169
190
  });
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useEffect","useState","forwardRef","VisuallyHidden","Tooltip","privateApis","componentsPrivateApis","__experimentalHStack","HStack","useInstanceId","__","Icon","symbol","unlock","BlockPreview","InserterDraggableBlocks","BlockPatternsPaging","INSERTER_PATTERN_TYPES","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","WithToolTip","showTooltip","title","children","createElement","text","Fragment","BlockPattern","id","isDraggable","pattern","onClick","onHover","showTitle","isDragging","setIsDragging","blocks","viewportWidth","instanceId","descriptionId","isEnabled","draggable","onDragStart","onDragEnd","className","event","type","user","render","role","description","undefined","syncStatus","onMouseEnter","onMouseLeave","icon","BlockPatternPlaceholder","BlockPatternsList","blockPatterns","shownPatterns","onClickPattern","orientation","label","showTitlesAsTooltip","pagingProps","ref","compositeStore","setActiveId","store","map","isShown","includes","key","name"],"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useState, forwardRef } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\tTooltip,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, symbol } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\nimport BlockPatternsPaging from '../block-patterns-paging';\nimport { INSERTER_PATTERN_TYPES } from '../inserter/block-patterns-tab/utils';\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n} = unlock( componentsPrivateApis );\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tid,\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tshowTitle = true,\n\tshowTooltip,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ blocks }\n\t\t\tpattern={ pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={\n\t\t\t\t\t\t\tshowTooltip &&\n\t\t\t\t\t\t\t! pattern.type !== INSERTER_PATTERN_TYPES.user\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\tpattern.description\n\t\t\t\t\t\t\t\t\t\t\t? descriptionId\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__list-item-synced':\n\t\t\t\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t\t\t\t! pattern.syncStatus,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t\t\t<HStack className=\"block-editor-patterns__pattern-details\">\n\t\t\t\t\t\t\t\t\t{ pattern.type ===\n\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t\t! pattern.syncStatus && (\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-patterns__pattern-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-patterns__pattern-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( ! showTooltip ||\n\t\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user ) && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternsList(\n\t{\n\t\tisDraggable,\n\t\tblockPatterns,\n\t\tshownPatterns,\n\t\tonHover,\n\t\tonClickPattern,\n\t\torientation,\n\t\tlabel = __( 'Block patterns' ),\n\t\tshowTitle = true,\n\t\tshowTitlesAsTooltip,\n\t\tpagingProps,\n\t},\n\tref\n) {\n\tconst compositeStore = useCompositeStore( { orientation } );\n\tconst { setActiveId } = compositeStore;\n\n\tuseEffect( () => {\n\t\t// We reset the active composite item whenever the\n\t\t// available patterns change, to make sure that\n\t\t// focus is put back to the start.\n\t\tsetActiveId( undefined );\n\t}, [ setActiveId, shownPatterns, blockPatterns ] );\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tid={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tshowTitle={ showTitle }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ pagingProps && <BlockPatternsPaging { ...pagingProps } /> }\n\t\t</Composite>\n\t);\n}\n\nexport default forwardRef( BlockPatternsList );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACpE,SACCC,cAAc,EACdC,OAAO,EACPC,WAAW,IAAIC,qBAAqB,EACpCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,uBAAuB,MAAM,8BAA8B;AACl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AO,IAAM;IACnC,MAAMwC,OAAO,GAAGX,aAAa,CAACY,QAAQ,CAAEzC,OAAQ,CAAC;IACjD,OAAOwC,OAAO,GACb9C,aAAA,CAACG,YAAY;MACZ6C,GAAG,EAAG1C,OAAO,CAAC2C,IAAM;MACpB7C,EAAE,EAAGE,OAAO,CAAC2C,IAAM;MACnB3C,OAAO,EAAGA,OAAS;MACnBC,OAAO,EAAG6B,cAAgB;MAC1B5B,OAAO,EAAGA,OAAS;MACnBH,WAAW,EAAGA,WAAa;MAC3BI,SAAS,EAAGA,SAAW;MACvBZ,WAAW,EAAG0C;IAAqB,CACnC,CAAC,GAEFvC,aAAA,CAACgC,uBAAuB;MAACgB,GAAG,EAAG1C,OAAO,CAAC2C;IAAM,CAAE,CAC/C;EACF,CAAE,CAAC,EACDT,WAAW,IAAIxC,aAAA,CAACZ,mBAAmB;IAAA,GAAMoD;EAAW,CAAI,CAChD,CAAC;AAEd;AAEA,eAAelE,UAAU,CAAE2D,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","cloneBlock","useEffect","useState","forwardRef","useMemo","VisuallyHidden","Tooltip","privateApis","componentsPrivateApis","__experimentalHStack","HStack","useInstanceId","__","Icon","symbol","unlock","BlockPreview","InserterDraggableBlocks","BlockPatternsPaging","INSERTER_PATTERN_TYPES","CompositeV2","Composite","CompositeItemV2","CompositeItem","useCompositeStoreV2","useCompositeStore","WithToolTip","showTooltip","title","children","createElement","text","Fragment","BlockPattern","id","isDraggable","pattern","onClick","onHover","showTitle","category","isDragging","setIsDragging","blocks","viewportWidth","instanceId","descriptionId","patternBlocks","map","block","clonedBlock","attributes","metadata","categories","includes","isEnabled","draggable","onDragStart","onDragEnd","className","event","type","user","render","role","description","undefined","syncStatus","onMouseEnter","onMouseLeave","icon","BlockPatternPlaceholder","BlockPatternsList","blockPatterns","shownPatterns","onClickPattern","orientation","label","showTitlesAsTooltip","pagingProps","ref","compositeStore","setActiveId","store","isShown","key","name"],"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useEffect, useState, forwardRef, useMemo } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\tTooltip,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, symbol } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\nimport BlockPatternsPaging from '../block-patterns-paging';\nimport { INSERTER_PATTERN_TYPES } from '../inserter/block-patterns-tab/utils';\n\nconst {\n\tCompositeV2: Composite,\n\tCompositeItemV2: CompositeItem,\n\tuseCompositeStoreV2: useCompositeStore,\n} = unlock( componentsPrivateApis );\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tid,\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tshowTitle = true,\n\tshowTooltip,\n\tcategory,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\t// When we have a selected category and the pattern is draggable, we need to update the\n\t// pattern's categories in metadata to only contain the selected category, and pass this to\n\t// InserterDraggableBlocks component. We do that because we use this information for pattern\n\t// shuffling and it makes more sense to show only the ones from the initially selected category during insertion.\n\tconst patternBlocks = useMemo( () => {\n\t\tif ( ! category || ! isDraggable ) {\n\t\t\treturn blocks;\n\t\t}\n\t\treturn ( blocks ?? [] ).map( ( block ) => {\n\t\t\tconst clonedBlock = cloneBlock( block );\n\t\t\tif (\n\t\t\t\tclonedBlock.attributes.metadata?.categories?.includes(\n\t\t\t\t\tcategory\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tclonedBlock.attributes.metadata.categories = [ category ];\n\t\t\t}\n\t\t\treturn clonedBlock;\n\t\t} );\n\t}, [ blocks, isDraggable, category ] );\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ patternBlocks }\n\t\t\tpattern={ pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={\n\t\t\t\t\t\t\tshowTooltip &&\n\t\t\t\t\t\t\t! pattern.type !== INSERTER_PATTERN_TYPES.user\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\tpattern.description\n\t\t\t\t\t\t\t\t\t\t\t? descriptionId\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__item',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-block-patterns-list__list-item-synced':\n\t\t\t\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t\t\t\t! pattern.syncStatus,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t\t\t<HStack className=\"block-editor-patterns__pattern-details\">\n\t\t\t\t\t\t\t\t\t{ pattern.type ===\n\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user &&\n\t\t\t\t\t\t\t\t\t\t! pattern.syncStatus && (\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-patterns__pattern-icon-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-patterns__pattern-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( ! showTooltip ||\n\t\t\t\t\t\t\t\t\t\tpattern.type ===\n\t\t\t\t\t\t\t\t\t\t\tINSERTER_PATTERN_TYPES.user ) && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternsList(\n\t{\n\t\tisDraggable,\n\t\tblockPatterns,\n\t\tshownPatterns,\n\t\tonHover,\n\t\tonClickPattern,\n\t\torientation,\n\t\tlabel = __( 'Block patterns' ),\n\t\tcategory,\n\t\tshowTitle = true,\n\t\tshowTitlesAsTooltip,\n\t\tpagingProps,\n\t},\n\tref\n) {\n\tconst compositeStore = useCompositeStore( { orientation } );\n\tconst { setActiveId } = compositeStore;\n\n\tuseEffect( () => {\n\t\t// We reset the active composite item whenever the\n\t\t// available patterns change, to make sure that\n\t\t// focus is put back to the start.\n\t\tsetActiveId( undefined );\n\t}, [ setActiveId, shownPatterns, blockPatterns ] );\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tid={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tshowTitle={ showTitle }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t\tcategory={ category }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ pagingProps && <BlockPatternsPaging { ...pagingProps } /> }\n\t\t</Composite>\n\t);\n}\n\nexport default forwardRef( BlockPatternsList );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,SAAS,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AAC7E,SACCC,cAAc,EACdC,OAAO,EACPC,WAAW,IAAIC,qBAAqB,EACpCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,QAAQ,i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AACyC,uBAAuB;MAACc,GAAG,EAAGjD,OAAO,CAACkD;IAAM,CAAE,CAC/C;EACF,CAAE,CAAC,EACDP,WAAW,IAAIjD,aAAA,CAACZ,mBAAmB;IAAA,GAAM6D;EAAW,CAAI,CAChD,CAAC;AAEd;AAEA,eAAe5E,UAAU,CAAEqE,iBAAkB,CAAC","ignoreList":[]}
@@ -8,29 +8,32 @@ import { useEffect, useState, useMemo, forwardRef } from '@wordpress/element';
8
8
  * Internal dependencies
9
9
  */
10
10
  import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
11
- import BlockPopover from '.';
11
+ import { PrivateBlockPopover } from '.';
12
12
  function BlockPopoverCover({
13
13
  clientId,
14
14
  bottomClientId,
15
15
  children,
16
16
  shift = false,
17
+ additionalStyles,
17
18
  ...props
18
19
  }, ref) {
19
20
  var _bottomClientId;
20
21
  (_bottomClientId = bottomClientId) !== null && _bottomClientId !== void 0 ? _bottomClientId : bottomClientId = clientId;
21
22
  const selectedElement = useBlockElement(clientId);
22
- return createElement(BlockPopover, {
23
+ return createElement(PrivateBlockPopover, {
23
24
  ref: ref,
24
25
  clientId: clientId,
25
26
  bottomClientId: bottomClientId,
26
27
  shift: shift,
27
28
  ...props
28
29
  }, selectedElement && clientId === bottomClientId ? createElement(CoverContainer, {
29
- selectedElement: selectedElement
30
+ selectedElement: selectedElement,
31
+ additionalStyles: additionalStyles
30
32
  }, children) : children);
31
33
  }
32
34
  function CoverContainer({
33
35
  selectedElement,
36
+ additionalStyles = {},
34
37
  children
35
38
  }) {
36
39
  const [width, setWidth] = useState(selectedElement.offsetWidth);
@@ -49,9 +52,10 @@ function CoverContainer({
49
52
  return {
50
53
  position: 'absolute',
51
54
  width,
52
- height
55
+ height,
56
+ ...additionalStyles
53
57
  };
54
- }, [width, height]);
58
+ }, [width, height, additionalStyles]);
55
59
  return createElement("div", {
56
60
  style: style
57
61
  }, children);
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useState","useMemo","forwardRef","__unstableUseBlockElement","useBlockElement","BlockPopover","BlockPopoverCover","clientId","bottomClientId","children","shift","props","ref","_bottomClientId","selectedElement","createElement","CoverContainer","width","setWidth","offsetWidth","height","setHeight","offsetHeight","observer","window","ResizeObserver","observe","box","disconnect","style","position"],"sources":["@wordpress/block-editor/src/components/block-popover/cover.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport BlockPopover from '.';\n\nfunction BlockPopoverCover(\n\t{ clientId, bottomClientId, children, shift = false, ...props },\n\tref\n) {\n\tbottomClientId ??= clientId;\n\n\tconst selectedElement = useBlockElement( clientId );\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tref={ ref }\n\t\t\tclientId={ clientId }\n\t\t\tbottomClientId={ bottomClientId }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ selectedElement && clientId === bottomClientId ? (\n\t\t\t\t<CoverContainer selectedElement={ selectedElement }>\n\t\t\t\t\t{ children }\n\t\t\t\t</CoverContainer>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t) }\n\t\t</BlockPopover>\n\t);\n}\n\nfunction CoverContainer( { selectedElement, children } ) {\n\tconst [ width, setWidth ] = useState( selectedElement.offsetWidth );\n\tconst [ height, setHeight ] = useState( selectedElement.offsetHeight );\n\n\tuseEffect( () => {\n\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\tsetWidth( selectedElement.offsetWidth );\n\t\t\tsetHeight( selectedElement.offsetHeight );\n\t\t} );\n\t\tobserver.observe( selectedElement, { box: 'border-box' } );\n\t\treturn () => observer.disconnect();\n\t}, [ selectedElement ] );\n\n\tconst style = useMemo( () => {\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth,\n\t\t\theight,\n\t\t};\n\t}, [ width, height ] );\n\n\treturn <div style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vCE,SAAS,CAAEP,eAAe,CAACQ,YAAa,CAAC;IAC1C,CAAE,CAAC;IACHC,QAAQ,CAACG,OAAO,CAAEZ,eAAe,EAAE;MAAEa,GAAG,EAAE;IAAa,CAAE,CAAC;IAC1D,OAAO,MAAMJ,QAAQ,CAACK,UAAU,CAAC,CAAC;EACnC,CAAC,EAAE,CAAEd,eAAe,CAAG,CAAC;EAExB,MAAMe,KAAK,GAAG5B,OAAO,CAAE,MAAM;IAC5B,OAAO;MACN6B,QAAQ,EAAE,UAAU;MACpBb,KAAK;MACLG;IACD,CAAC;EACF,CAAC,EAAE,CAAEH,KAAK,EAAEG,MAAM,CAAG,CAAC;EAEtB,OAAOL,aAAA;IAAKc,KAAK,EAAGA;EAAO,GAAGpB,QAAe,CAAC;AAC/C;AAEA,eAAeP,UAAU,CAAEI,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useState","useMemo","forwardRef","__unstableUseBlockElement","useBlockElement","PrivateBlockPopover","BlockPopoverCover","clientId","bottomClientId","children","shift","additionalStyles","props","ref","_bottomClientId","selectedElement","createElement","CoverContainer","width","setWidth","offsetWidth","height","setHeight","offsetHeight","observer","window","ResizeObserver","observe","box","disconnect","style","position"],"sources":["@wordpress/block-editor/src/components/block-popover/cover.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport { PrivateBlockPopover } from '.';\n\nfunction BlockPopoverCover(\n\t{\n\t\tclientId,\n\t\tbottomClientId,\n\t\tchildren,\n\t\tshift = false,\n\t\tadditionalStyles,\n\t\t...props\n\t},\n\tref\n) {\n\tbottomClientId ??= clientId;\n\n\tconst selectedElement = useBlockElement( clientId );\n\n\treturn (\n\t\t<PrivateBlockPopover\n\t\t\tref={ ref }\n\t\t\tclientId={ clientId }\n\t\t\tbottomClientId={ bottomClientId }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ selectedElement && clientId === bottomClientId ? (\n\t\t\t\t<CoverContainer\n\t\t\t\t\tselectedElement={ selectedElement }\n\t\t\t\t\tadditionalStyles={ additionalStyles }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</CoverContainer>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t) }\n\t\t</PrivateBlockPopover>\n\t);\n}\n\nfunction CoverContainer( {\n\tselectedElement,\n\tadditionalStyles = {},\n\tchildren,\n} ) {\n\tconst [ width, setWidth ] = useState( selectedElement.offsetWidth );\n\tconst [ height, setHeight ] = useState( selectedElement.offsetHeight );\n\n\tuseEffect( () => {\n\t\tconst observer = new window.ResizeObserver( () => {\n\t\t\tsetWidth( selectedElement.offsetWidth );\n\t\t\tsetHeight( selectedElement.offsetHeight );\n\t\t} );\n\t\tobserver.observe( selectedElement, { box: 'border-box' } );\n\t\treturn () => observer.disconnect();\n\t}, [ selectedElement ] );\n\n\tconst style = useMemo( () => {\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth,\n\t\t\theight,\n\t\t\t...additionalStyles,\n\t\t};\n\t}, [ width, height, additionalStyles ] );\n\n\treturn <div style={ style }>{ children }</div>;\n}\n\nexport default forwardRef( BlockPopoverCover );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAE7E;AACA;AACA;AACA,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,SAASC,mBAAmB,QAAQ,GAAG;AAEvC,SAASC,iBAAiBA,CACzB;EACCC,QAAQ;EACRC,cAAc;EACdC,QAAQ;EACRC,KAAK,GAAG,KAAK;EACbC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,EACDC,GAAG,EACF;EAAA,IAAAC,eAAA;EACD,CAAAA,eAAA,GAAAN,cAAc,cAA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C;EACF,CAAC,EAAE,CAAEO,KAAK,EAAEG,MAAM,EAAEV,gBAAgB,CAAG,CAAC;EAExC,OAAOK,aAAA;IAAKc,KAAK,EAAGA;EAAO,GAAGrB,QAAe,CAAC;AAC/C;AAEA,eAAeP,UAAU,CAAEI,iBAAkB,CAAC","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -178,7 +178,7 @@ function BlockPopoverInbetween({
178
178
  ,
179
179
  key: nextClientId + '--' + rootClientId,
180
180
  ...props,
181
- className: classnames('block-editor-block-popover', 'block-editor-block-popover__inbetween', props.className),
181
+ className: clsx('block-editor-block-popover', 'block-editor-block-popover__inbetween', props.className),
182
182
  resize: false,
183
183
  flip: false,
184
184
  placement: "overlay",