@wordpress/block-editor 9.4.0 → 9.7.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 (483) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -8
  3. package/build/components/block-list/block-invalid-warning.native.js +54 -6
  4. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  5. package/build/components/block-list/block.js +14 -4
  6. package/build/components/block-list/block.js.map +1 -1
  7. package/build/components/block-list/block.native.js +2 -1
  8. package/build/components/block-list/block.native.js.map +1 -1
  9. package/build/components/block-list/index.native.js +5 -4
  10. package/build/components/block-list/index.native.js.map +1 -1
  11. package/build/components/block-list/layout.js +20 -5
  12. package/build/components/block-list/layout.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-block-class-names.js +5 -2
  14. package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  15. package/build/components/block-lock/modal.js +37 -7
  16. package/build/components/block-lock/modal.js.map +1 -1
  17. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  18. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  19. package/build/components/block-mover/mover-description.js +95 -32
  20. package/build/components/block-mover/mover-description.js.map +1 -1
  21. package/build/components/block-pattern-setup/index.js +5 -17
  22. package/build/components/block-pattern-setup/index.js.map +1 -1
  23. package/build/components/block-popover/inbetween.js +2 -2
  24. package/build/components/block-popover/inbetween.js.map +1 -1
  25. package/build/components/block-popover/index.js +1 -1
  26. package/build/components/block-popover/index.js.map +1 -1
  27. package/build/components/block-settings-menu/block-mode-toggle.js +1 -1
  28. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  29. package/build/components/block-settings-menu/block-settings-dropdown.js +4 -1
  30. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  31. package/build/components/block-settings-menu-controls/index.js +1 -1
  32. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  33. package/build/components/block-styles/index.js +3 -6
  34. package/build/components/block-styles/index.js.map +1 -1
  35. package/build/components/block-styles/preview.native.js.map +1 -1
  36. package/build/components/block-switcher/index.js +7 -1
  37. package/build/components/block-switcher/index.js.map +1 -1
  38. package/build/components/block-title/index.js +8 -2
  39. package/build/components/block-title/index.js.map +1 -1
  40. package/build/components/block-title/use-block-display-title.js +12 -5
  41. package/build/components/block-title/use-block-display-title.js.map +1 -1
  42. package/build/components/block-tools/block-contextual-toolbar.js +1 -1
  43. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  44. package/build/components/block-tools/block-selection-button.js +1 -7
  45. package/build/components/block-tools/block-selection-button.js.map +1 -1
  46. package/build/components/block-tools/index.js +4 -1
  47. package/build/components/block-tools/index.js.map +1 -1
  48. package/build/components/block-types-list/index.js +1 -1
  49. package/build/components/block-types-list/index.js.map +1 -1
  50. package/build/components/block-types-list/index.native.js +65 -23
  51. package/build/components/block-types-list/index.native.js.map +1 -1
  52. package/build/components/border-radius-control/index.js +5 -1
  53. package/build/components/border-radius-control/index.js.map +1 -1
  54. package/build/components/colors/utils.js +6 -2
  55. package/build/components/colors/utils.js.map +1 -1
  56. package/build/components/colors/with-colors.js +1 -1
  57. package/build/components/colors/with-colors.js.map +1 -1
  58. package/build/components/colors-gradients/control.js +49 -39
  59. package/build/components/colors-gradients/control.js.map +1 -1
  60. package/build/components/colors-gradients/dropdown.js +9 -3
  61. package/build/components/colors-gradients/dropdown.js.map +1 -1
  62. package/build/components/date-format-picker/index.js +1 -1
  63. package/build/components/date-format-picker/index.js.map +1 -1
  64. package/build/components/font-appearance-control/index.js +10 -4
  65. package/build/components/font-appearance-control/index.js.map +1 -1
  66. package/build/components/iframe/index.js +19 -6
  67. package/build/components/iframe/index.js.map +1 -1
  68. package/build/components/image-editor/cropper.js +4 -3
  69. package/build/components/image-editor/cropper.js.map +1 -1
  70. package/build/components/image-editor/index.js +3 -1
  71. package/build/components/image-editor/index.js.map +1 -1
  72. package/build/components/image-size-control/index.js +3 -1
  73. package/build/components/image-size-control/index.js.map +1 -1
  74. package/build/components/index.js +13 -6
  75. package/build/components/index.js.map +1 -1
  76. package/build/components/index.native.js +11 -4
  77. package/build/components/index.native.js.map +1 -1
  78. package/build/components/inserter/block-types-tab.native.js +30 -16
  79. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  80. package/build/components/inserter/index.native.js +8 -3
  81. package/build/components/inserter/index.native.js.map +1 -1
  82. package/build/components/inserter/preview-panel.js +8 -8
  83. package/build/components/inserter/preview-panel.js.map +1 -1
  84. package/build/components/inserter/reusable-blocks-tab.native.js +5 -1
  85. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  86. package/build/components/inserter/search-results.native.js +5 -2
  87. package/build/components/inserter/search-results.native.js.map +1 -1
  88. package/build/components/inserter/utils.native.js +21 -0
  89. package/build/components/inserter/utils.native.js.map +1 -1
  90. package/build/components/inserter-list-item/index.js +7 -20
  91. package/build/components/inserter-list-item/index.js.map +1 -1
  92. package/build/components/letter-spacing-control/index.js +6 -3
  93. package/build/components/letter-spacing-control/index.js.map +1 -1
  94. package/build/components/line-height-control/index.js +6 -3
  95. package/build/components/line-height-control/index.js.map +1 -1
  96. package/build/components/link-control/index.js +1 -1
  97. package/build/components/link-control/index.js.map +1 -1
  98. package/build/components/link-control/is-url-like.js +1 -7
  99. package/build/components/link-control/is-url-like.js.map +1 -1
  100. package/build/components/link-control/use-search-handler.js +1 -7
  101. package/build/components/link-control/use-search-handler.js.map +1 -1
  102. package/build/components/list-view/block-select-button.js +15 -7
  103. package/build/components/list-view/block-select-button.js.map +1 -1
  104. package/build/components/list-view/branch.js +1 -7
  105. package/build/components/list-view/branch.js.map +1 -1
  106. package/build/components/list-view/drop-indicator.js +1 -1
  107. package/build/components/list-view/drop-indicator.js.map +1 -1
  108. package/build/components/list-view/expander.js +3 -1
  109. package/build/components/list-view/expander.js.map +1 -1
  110. package/build/components/media-placeholder/index.js +13 -2
  111. package/build/components/media-placeholder/index.js.map +1 -1
  112. package/build/components/media-replace-flow/index.js +3 -6
  113. package/build/components/media-replace-flow/index.js.map +1 -1
  114. package/build/components/media-upload/index.native.js +8 -3
  115. package/build/components/media-upload/index.native.js.map +1 -1
  116. package/build/components/observe-typing/index.js +22 -8
  117. package/build/components/observe-typing/index.js.map +1 -1
  118. package/build/components/preview-options/index.js +2 -2
  119. package/build/components/preview-options/index.js.map +1 -1
  120. package/build/components/{use-no-recursive-renders → recursion-provider}/index.js +40 -18
  121. package/build/components/recursion-provider/index.js.map +1 -0
  122. package/build/components/rich-text/format-toolbar-container.js +61 -12
  123. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  124. package/build/components/rich-text/index.js +8 -2
  125. package/build/components/rich-text/index.js.map +1 -1
  126. package/build/components/rich-text/index.native.js +3 -1
  127. package/build/components/rich-text/index.native.js.map +1 -1
  128. package/build/components/rich-text/use-before-input-rules.js +110 -0
  129. package/build/components/rich-text/use-before-input-rules.js.map +1 -0
  130. package/build/components/rich-text/use-format-types.js +36 -16
  131. package/build/components/rich-text/use-format-types.js.map +1 -1
  132. package/build/components/text-decoration-control/index.js +3 -1
  133. package/build/components/text-decoration-control/index.js.map +1 -1
  134. package/build/components/text-transform-control/index.js +3 -1
  135. package/build/components/text-transform-control/index.js.map +1 -1
  136. package/build/components/url-popover/image-url-input-ui.js +4 -1
  137. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  138. package/build/components/url-popover/index.js +2 -1
  139. package/build/components/url-popover/index.js.map +1 -1
  140. package/build/components/writing-flow/use-arrow-nav.js +38 -27
  141. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  142. package/build/components/writing-flow/use-drag-selection.js +9 -2
  143. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  144. package/build/components/writing-flow/use-multi-selection.js +3 -47
  145. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  146. package/build/components/writing-flow/use-select-all.js +3 -1
  147. package/build/components/writing-flow/use-select-all.js.map +1 -1
  148. package/build/components/writing-flow/use-selection-observer.js +1 -3
  149. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  150. package/build/components/writing-flow/use-tab-nav.js +1 -1
  151. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  152. package/build/hooks/color.js +2 -4
  153. package/build/hooks/color.js.map +1 -1
  154. package/build/hooks/index.js +8 -0
  155. package/build/hooks/index.js.map +1 -1
  156. package/build/hooks/layout.js +61 -15
  157. package/build/hooks/layout.js.map +1 -1
  158. package/build/hooks/style.js +41 -31
  159. package/build/hooks/style.js.map +1 -1
  160. package/build/hooks/utils.js +5 -3
  161. package/build/hooks/utils.js.map +1 -1
  162. package/build/index.js +7 -0
  163. package/build/index.js.map +1 -1
  164. package/build/layouts/flex.js +40 -36
  165. package/build/layouts/flex.js.map +1 -1
  166. package/build/layouts/flow.js +35 -37
  167. package/build/layouts/flow.js.map +1 -1
  168. package/build/layouts/utils.js +35 -3
  169. package/build/layouts/utils.js.map +1 -1
  170. package/build/store/actions.js +15 -18
  171. package/build/store/actions.js.map +1 -1
  172. package/build/store/index.js +0 -4
  173. package/build/store/index.js.map +1 -1
  174. package/build/store/reducer.js +5 -3
  175. package/build/store/reducer.js.map +1 -1
  176. package/build/store/selectors.js +3 -3
  177. package/build/store/selectors.js.map +1 -1
  178. package/build/utils/block-variation-transforms.js +15 -9
  179. package/build/utils/block-variation-transforms.js.map +1 -1
  180. package/build/utils/pasting.js +9 -1
  181. package/build/utils/pasting.js.map +1 -1
  182. package/build-module/components/block-list/block-invalid-warning.native.js +50 -6
  183. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  184. package/build-module/components/block-list/block.js +15 -5
  185. package/build-module/components/block-list/block.js.map +1 -1
  186. package/build-module/components/block-list/block.native.js +2 -1
  187. package/build-module/components/block-list/block.native.js.map +1 -1
  188. package/build-module/components/block-list/index.native.js +4 -2
  189. package/build-module/components/block-list/index.native.js.map +1 -1
  190. package/build-module/components/block-list/layout.js +19 -4
  191. package/build-module/components/block-list/layout.js.map +1 -1
  192. package/build-module/components/block-list/use-block-props/use-block-class-names.js +5 -2
  193. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  194. package/build-module/components/block-lock/modal.js +39 -8
  195. package/build-module/components/block-lock/modal.js.map +1 -1
  196. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
  197. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  198. package/build-module/components/block-mover/mover-description.js +97 -33
  199. package/build-module/components/block-mover/mover-description.js.map +1 -1
  200. package/build-module/components/block-pattern-setup/index.js +6 -18
  201. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  202. package/build-module/components/block-popover/inbetween.js +2 -2
  203. package/build-module/components/block-popover/inbetween.js.map +1 -1
  204. package/build-module/components/block-popover/index.js +1 -1
  205. package/build-module/components/block-popover/index.js.map +1 -1
  206. package/build-module/components/block-settings-menu/block-mode-toggle.js +1 -1
  207. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  208. package/build-module/components/block-settings-menu/block-settings-dropdown.js +4 -1
  209. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  210. package/build-module/components/block-settings-menu-controls/index.js +2 -2
  211. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  212. package/build-module/components/block-styles/index.js +4 -7
  213. package/build-module/components/block-styles/index.js.map +1 -1
  214. package/build-module/components/block-styles/preview.native.js.map +1 -1
  215. package/build-module/components/block-switcher/index.js +7 -1
  216. package/build-module/components/block-switcher/index.js.map +1 -1
  217. package/build-module/components/block-title/index.js +8 -2
  218. package/build-module/components/block-title/index.js.map +1 -1
  219. package/build-module/components/block-title/use-block-display-title.js +12 -5
  220. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  221. package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
  222. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  223. package/build-module/components/block-tools/block-selection-button.js +1 -7
  224. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  225. package/build-module/components/block-tools/index.js +4 -1
  226. package/build-module/components/block-tools/index.js.map +1 -1
  227. package/build-module/components/block-types-list/index.js +1 -1
  228. package/build-module/components/block-types-list/index.js.map +1 -1
  229. package/build-module/components/block-types-list/index.native.js +67 -25
  230. package/build-module/components/block-types-list/index.native.js.map +1 -1
  231. package/build-module/components/border-radius-control/index.js +6 -2
  232. package/build-module/components/border-radius-control/index.js.map +1 -1
  233. package/build-module/components/colors/utils.js +7 -3
  234. package/build-module/components/colors/utils.js.map +1 -1
  235. package/build-module/components/colors/with-colors.js +2 -2
  236. package/build-module/components/colors/with-colors.js.map +1 -1
  237. package/build-module/components/colors-gradients/control.js +50 -40
  238. package/build-module/components/colors-gradients/control.js.map +1 -1
  239. package/build-module/components/colors-gradients/dropdown.js +10 -4
  240. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  241. package/build-module/components/date-format-picker/index.js +1 -1
  242. package/build-module/components/date-format-picker/index.js.map +1 -1
  243. package/build-module/components/font-appearance-control/index.js +7 -4
  244. package/build-module/components/font-appearance-control/index.js.map +1 -1
  245. package/build-module/components/iframe/index.js +19 -6
  246. package/build-module/components/iframe/index.js.map +1 -1
  247. package/build-module/components/image-editor/cropper.js +4 -3
  248. package/build-module/components/image-editor/cropper.js.map +1 -1
  249. package/build-module/components/image-editor/index.js +3 -1
  250. package/build-module/components/image-editor/index.js.map +1 -1
  251. package/build-module/components/image-size-control/index.js +3 -1
  252. package/build-module/components/image-size-control/index.js.map +1 -1
  253. package/build-module/components/index.js +1 -1
  254. package/build-module/components/index.js.map +1 -1
  255. package/build-module/components/index.native.js +1 -1
  256. package/build-module/components/index.native.js.map +1 -1
  257. package/build-module/components/inserter/block-types-tab.native.js +31 -15
  258. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  259. package/build-module/components/inserter/index.native.js +9 -2
  260. package/build-module/components/inserter/index.native.js.map +1 -1
  261. package/build-module/components/inserter/preview-panel.js +9 -9
  262. package/build-module/components/inserter/preview-panel.js.map +1 -1
  263. package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -2
  264. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  265. package/build-module/components/inserter/search-results.native.js +6 -3
  266. package/build-module/components/inserter/search-results.native.js.map +1 -1
  267. package/build-module/components/inserter/utils.native.js +19 -0
  268. package/build-module/components/inserter/utils.native.js.map +1 -1
  269. package/build-module/components/inserter-list-item/index.js +5 -18
  270. package/build-module/components/inserter-list-item/index.js.map +1 -1
  271. package/build-module/components/letter-spacing-control/index.js +5 -3
  272. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  273. package/build-module/components/line-height-control/index.js +5 -3
  274. package/build-module/components/line-height-control/index.js.map +1 -1
  275. package/build-module/components/link-control/index.js +1 -1
  276. package/build-module/components/link-control/index.js.map +1 -1
  277. package/build-module/components/link-control/is-url-like.js +1 -6
  278. package/build-module/components/link-control/is-url-like.js.map +1 -1
  279. package/build-module/components/link-control/use-search-handler.js +1 -6
  280. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  281. package/build-module/components/list-view/block-select-button.js +16 -8
  282. package/build-module/components/list-view/block-select-button.js.map +1 -1
  283. package/build-module/components/list-view/branch.js +1 -6
  284. package/build-module/components/list-view/branch.js.map +1 -1
  285. package/build-module/components/list-view/drop-indicator.js +1 -1
  286. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  287. package/build-module/components/list-view/expander.js +3 -2
  288. package/build-module/components/list-view/expander.js.map +1 -1
  289. package/build-module/components/media-placeholder/index.js +13 -2
  290. package/build-module/components/media-placeholder/index.js.map +1 -1
  291. package/build-module/components/media-replace-flow/index.js +4 -7
  292. package/build-module/components/media-replace-flow/index.js.map +1 -1
  293. package/build-module/components/media-upload/index.native.js +9 -2
  294. package/build-module/components/media-upload/index.native.js.map +1 -1
  295. package/build-module/components/observe-typing/index.js +22 -8
  296. package/build-module/components/observe-typing/index.js.map +1 -1
  297. package/build-module/components/preview-options/index.js +2 -2
  298. package/build-module/components/preview-options/index.js.map +1 -1
  299. package/build-module/components/{use-no-recursive-renders → recursion-provider}/index.js +39 -19
  300. package/build-module/components/recursion-provider/index.js.map +1 -0
  301. package/build-module/components/rich-text/format-toolbar-container.js +58 -12
  302. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  303. package/build-module/components/rich-text/index.js +7 -2
  304. package/build-module/components/rich-text/index.js.map +1 -1
  305. package/build-module/components/rich-text/index.native.js +3 -1
  306. package/build-module/components/rich-text/index.native.js.map +1 -1
  307. package/build-module/components/rich-text/use-before-input-rules.js +96 -0
  308. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -0
  309. package/build-module/components/rich-text/use-format-types.js +37 -18
  310. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  311. package/build-module/components/text-decoration-control/index.js +4 -2
  312. package/build-module/components/text-decoration-control/index.js.map +1 -1
  313. package/build-module/components/text-transform-control/index.js +4 -2
  314. package/build-module/components/text-transform-control/index.js.map +1 -1
  315. package/build-module/components/url-popover/image-url-input-ui.js +4 -1
  316. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  317. package/build-module/components/url-popover/index.js +2 -1
  318. package/build-module/components/url-popover/index.js.map +1 -1
  319. package/build-module/components/writing-flow/use-arrow-nav.js +40 -29
  320. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  321. package/build-module/components/writing-flow/use-drag-selection.js +9 -2
  322. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  323. package/build-module/components/writing-flow/use-multi-selection.js +3 -45
  324. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  325. package/build-module/components/writing-flow/use-select-all.js +3 -1
  326. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  327. package/build-module/components/writing-flow/use-selection-observer.js +1 -3
  328. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  329. package/build-module/components/writing-flow/use-tab-nav.js +1 -1
  330. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  331. package/build-module/hooks/color.js +2 -3
  332. package/build-module/hooks/color.js.map +1 -1
  333. package/build-module/hooks/index.js +1 -0
  334. package/build-module/hooks/index.js.map +1 -1
  335. package/build-module/hooks/layout.js +62 -16
  336. package/build-module/hooks/layout.js.map +1 -1
  337. package/build-module/hooks/style.js +44 -35
  338. package/build-module/hooks/style.js.map +1 -1
  339. package/build-module/hooks/utils.js +5 -2
  340. package/build-module/hooks/utils.js.map +1 -1
  341. package/build-module/index.js +1 -1
  342. package/build-module/index.js.map +1 -1
  343. package/build-module/layouts/flex.js +41 -33
  344. package/build-module/layouts/flex.js.map +1 -1
  345. package/build-module/layouts/flow.js +35 -38
  346. package/build-module/layouts/flow.js.map +1 -1
  347. package/build-module/layouts/utils.js +33 -3
  348. package/build-module/layouts/utils.js.map +1 -1
  349. package/build-module/store/actions.js +9 -10
  350. package/build-module/store/actions.js.map +1 -1
  351. package/build-module/store/index.js +0 -4
  352. package/build-module/store/index.js.map +1 -1
  353. package/build-module/store/reducer.js +5 -2
  354. package/build-module/store/reducer.js.map +1 -1
  355. package/build-module/store/selectors.js +4 -4
  356. package/build-module/store/selectors.js.map +1 -1
  357. package/build-module/utils/block-variation-transforms.js +14 -7
  358. package/build-module/utils/block-variation-transforms.js.map +1 -1
  359. package/build-module/utils/pasting.js +9 -1
  360. package/build-module/utils/pasting.js.map +1 -1
  361. package/build-style/style-rtl.css +72 -14
  362. package/build-style/style.css +72 -14
  363. package/package.json +28 -28
  364. package/src/components/block-list/block-invalid-warning.native.js +42 -7
  365. package/src/components/block-list/block.js +15 -4
  366. package/src/components/block-list/block.native.js +1 -0
  367. package/src/components/block-list/index.native.js +2 -2
  368. package/src/components/block-list/layout.js +15 -3
  369. package/src/components/block-list/style.scss +1 -1
  370. package/src/components/block-list/use-block-props/use-block-class-names.js +5 -1
  371. package/src/components/block-lock/modal.js +47 -9
  372. package/src/components/block-lock/style.scss +10 -0
  373. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  374. package/src/components/block-mover/mover-description.js +131 -48
  375. package/src/components/block-mover/test/mover-description.js +55 -3
  376. package/src/components/block-pattern-setup/index.js +3 -15
  377. package/src/components/block-pattern-setup/style.scss +4 -2
  378. package/src/components/block-popover/inbetween.js +2 -1
  379. package/src/components/block-popover/index.js +1 -1
  380. package/src/components/block-popover/style.scss +25 -2
  381. package/src/components/block-settings-menu/block-mode-toggle.js +1 -0
  382. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
  383. package/src/components/block-settings-menu-controls/index.js +2 -2
  384. package/src/components/block-styles/index.js +4 -7
  385. package/src/components/block-styles/preview.native.js +1 -0
  386. package/src/components/block-styles/style.scss +10 -0
  387. package/src/components/block-switcher/index.js +7 -1
  388. package/src/components/block-title/index.js +3 -2
  389. package/src/components/block-title/use-block-display-title.js +11 -5
  390. package/src/components/block-tools/block-contextual-toolbar.js +3 -1
  391. package/src/components/block-tools/block-selection-button.js +0 -5
  392. package/src/components/block-tools/index.js +4 -1
  393. package/src/components/block-types-list/index.js +1 -1
  394. package/src/components/block-types-list/index.native.js +76 -24
  395. package/src/components/block-types-list/style.native.scss +18 -0
  396. package/src/components/border-radius-control/index.js +6 -1
  397. package/src/components/color-palette/test/__snapshots__/control.js.snap +91 -79
  398. package/src/components/colors/test/__snapshots__/with-colors.js.snap +1 -1
  399. package/src/components/colors/test/with-colors.js +1 -1
  400. package/src/components/colors/utils.js +5 -2
  401. package/src/components/colors/with-colors.js +2 -2
  402. package/src/components/colors-gradients/control.js +82 -65
  403. package/src/components/colors-gradients/dropdown.js +14 -3
  404. package/src/components/colors-gradients/style.scss +34 -9
  405. package/src/components/colors-gradients/test/control.js +16 -23
  406. package/src/components/date-format-picker/index.js +1 -0
  407. package/src/components/font-appearance-control/index.js +3 -0
  408. package/src/components/iframe/index.js +25 -6
  409. package/src/components/image-editor/cropper.js +9 -3
  410. package/src/components/image-editor/index.js +2 -0
  411. package/src/components/image-size-control/README.md +7 -0
  412. package/src/components/image-size-control/index.js +2 -0
  413. package/src/components/index.js +4 -1
  414. package/src/components/index.native.js +4 -1
  415. package/src/components/inserter/block-types-tab.native.js +42 -21
  416. package/src/components/inserter/index.native.js +7 -2
  417. package/src/components/inserter/preview-panel.js +6 -14
  418. package/src/components/inserter/reusable-blocks-tab.native.js +4 -2
  419. package/src/components/inserter/search-results.native.js +4 -2
  420. package/src/components/inserter/style.scss +1 -1
  421. package/src/components/inserter/test/block-types-tab.native.js +2 -0
  422. package/src/components/inserter/test/utils.native.js +37 -0
  423. package/src/components/inserter/utils.native.js +11 -0
  424. package/src/components/inserter-list-item/index.js +5 -18
  425. package/src/components/letter-spacing-control/index.js +2 -0
  426. package/src/components/line-height-control/index.js +2 -0
  427. package/src/components/link-control/index.js +1 -0
  428. package/src/components/link-control/is-url-like.js +1 -6
  429. package/src/components/link-control/test/index.js +6 -4
  430. package/src/components/link-control/use-search-handler.js +1 -6
  431. package/src/components/list-view/block-select-button.js +29 -14
  432. package/src/components/list-view/branch.js +1 -6
  433. package/src/components/list-view/drop-indicator.js +1 -1
  434. package/src/components/list-view/expander.js +4 -2
  435. package/src/components/list-view/style.scss +18 -4
  436. package/src/components/media-placeholder/index.js +19 -0
  437. package/src/components/media-replace-flow/index.js +3 -6
  438. package/src/components/media-replace-flow/test/index.js +14 -4
  439. package/src/components/media-upload/index.native.js +7 -3
  440. package/src/components/observe-typing/index.js +17 -14
  441. package/src/components/preview-options/index.js +2 -2
  442. package/src/components/{use-no-recursive-renders → recursion-provider}/index.js +39 -28
  443. package/src/components/{use-no-recursive-renders/test/use-no-recursive-renders.js → recursion-provider/test/index.js} +5 -6
  444. package/src/components/rich-text/README.md +13 -1
  445. package/src/components/rich-text/format-toolbar-container.js +63 -14
  446. package/src/components/rich-text/index.js +3 -0
  447. package/src/components/rich-text/index.native.js +2 -0
  448. package/src/components/rich-text/use-before-input-rules.js +91 -0
  449. package/src/components/rich-text/use-format-types.js +38 -17
  450. package/src/components/text-decoration-control/index.js +4 -2
  451. package/src/components/text-transform-control/index.js +4 -2
  452. package/src/components/url-popover/image-url-input-ui.js +3 -0
  453. package/src/components/url-popover/index.js +1 -0
  454. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -0
  455. package/src/components/writing-flow/use-arrow-nav.js +36 -34
  456. package/src/components/writing-flow/use-drag-selection.js +7 -1
  457. package/src/components/writing-flow/use-multi-selection.js +1 -48
  458. package/src/components/writing-flow/use-select-all.js +2 -1
  459. package/src/components/writing-flow/use-selection-observer.js +2 -3
  460. package/src/components/writing-flow/use-tab-nav.js +1 -1
  461. package/src/hooks/color.js +10 -3
  462. package/src/hooks/index.js +1 -0
  463. package/src/hooks/layout.js +66 -23
  464. package/src/hooks/style.js +46 -39
  465. package/src/hooks/utils.js +7 -3
  466. package/src/index.js +1 -0
  467. package/src/layouts/flex.js +47 -41
  468. package/src/layouts/flow.js +35 -34
  469. package/src/layouts/test/flex.js +21 -0
  470. package/src/layouts/test/flow.js +21 -0
  471. package/src/layouts/test/utils.js +138 -0
  472. package/src/layouts/utils.js +44 -3
  473. package/src/store/actions.js +10 -11
  474. package/src/store/index.js +0 -4
  475. package/src/store/reducer.js +3 -2
  476. package/src/store/selectors.js +3 -4
  477. package/src/utils/block-variation-transforms.js +13 -6
  478. package/src/utils/pasting.js +10 -1
  479. package/src/utils/test/block-variation-transforms.js +24 -0
  480. package/src/utils/test/pasting.js +10 -0
  481. package/tsconfig.json +2 -1
  482. package/build/components/use-no-recursive-renders/index.js.map +0 -1
  483. package/build-module/components/use-no-recursive-renders/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-mover/mover-description.js"],"names":["getBlockMoverDescription","selectedCount","type","firstIndex","isFirst","isLast","dir","orientation","position","getMovementDirection","moveDirection","getMultiBlockMoverDescription","movementDirection"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAT,CACNC,aADM,EAENC,IAF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ACjC,aAAO,oBACN;AACA,oBACC,qEADD,CAFM,EAKNV,IALM,CAAP;AAOA;;AAED,QAAKU,iBAAiB,KAAK,MAA3B,EAAoC;AACnC,aAAO,oBACN;AACA,oBACC,uEADD,CAFM,EAKNV,IALM,CAAP;AAOA;;AAED,QAAKU,iBAAiB,KAAK,OAA3B,EAAqC;AACpC,aAAO,oBACN;AACA,oBACC,wEADD,CAFM,EAKNV,IALM,CAAP;AAOA;AACD;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASS,6BAAT,CACNV,aADM,EAENE,UAFM,EAGNC,OAHM,EAINC,MAJM,EAKNC,GALM,EAML;AACD,QAAME,QAAQ,GAAGL,UAAU,GAAG,CAA9B;;AAEA,MAAKG,GAAG,GAAG,CAAN,IAAWF,OAAhB,EAA0B;AACzB,WAAO,cAAI,0DAAJ,CAAP;AACA;;AAED,MAAKE,GAAG,GAAG,CAAN,IAAWD,MAAhB,EAAyB;AACxB,WAAO,cACN,+DADM,CAAP;AAGA;;AAED,MAAKC,GAAG,GAAG,CAAN,IAAW,CAAEF,OAAlB,EAA4B;AAC3B,WAAO,oBACN;AACA,kBACC,oDADD,EAEC,qDAFD,EAGCH,aAHD,CAFM,EAONA,aAPM,EAQNO,QARM,CAAP;AAUA;;AAED,MAAKF,GAAG,GAAG,CAAN,IAAW,CAAED,MAAlB,EAA2B;AAC1B,WAAO,oBACN;AACA,kBACC,sDADD,EAEC,uDAFD,EAGCJ,aAHD,CAFM,EAONA,aAPM,EAQNO,QARM,CAAP;AAUA;AACD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, isRTL } from '@wordpress/i18n';\n\n/**\n * Return a label for the block movement controls depending on block position.\n *\n * @param {number} selectedCount Number of blocks selected.\n * @param {string} type Block type - in the case of a single block, should\n * define its 'type'. I.e. 'Text', 'Heading', 'Image' etc.\n * @param {number} firstIndex The index (position - 1) of the first block selected.\n * @param {boolean} isFirst This is the first block.\n * @param {boolean} isLast This is the last block.\n * @param {number} dir Direction of movement (> 0 is considered to be going\n * down, < 0 is up).\n * @param {string} orientation The orientation of the block movers, vertical or\n * horizontal.\n *\n * @return {string} Label for the block movement controls.\n */\nexport function getBlockMoverDescription(\n\tselectedCount,\n\ttype,\n\tfirstIndex,\n\tisFirst,\n\tisLast,\n\tdir,\n\torientation\n) {\n\tconst position = firstIndex + 1;\n\n\tconst getMovementDirection = ( moveDirection ) => {\n\t\tif ( moveDirection === 'up' ) {\n\t\t\tif ( orientation === 'horizontal' ) {\n\t\t\t\treturn isRTL() ? 'right' : 'left';\n\t\t\t}\n\t\t\treturn 'up';\n\t\t} else if ( moveDirection === 'down' ) {\n\t\t\tif ( orientation === 'horizontal' ) {\n\t\t\t\treturn isRTL() ? 'left' : 'right';\n\t\t\t}\n\t\t\treturn 'down';\n\t\t}\n\t\treturn null;\n\t};\n\n\tif ( selectedCount > 1 ) {\n\t\treturn getMultiBlockMoverDescription(\n\t\t\tselectedCount,\n\t\t\tfirstIndex,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tdir\n\t\t);\n\t}\n\n\tif ( isFirst && isLast ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Type of block (i.e. Text, Image etc)\n\t\t\t__( 'Block %s is the only block, and cannot be moved' ),\n\t\t\ttype\n\t\t);\n\t}\n\n\tif ( dir > 0 && ! isLast ) {\n\t\t// Moving down.\n\t\tconst movementDirection = getMovementDirection( 'down' );\n\n\t\tif ( movementDirection === 'down' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d down to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition + 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d left to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition + 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d right to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition + 1\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir > 0 && isLast ) {\n\t\t// Moving down, and is the last item.\n\t\tconst movementDirection = getMovementDirection( 'down' );\n\n\t\tif ( movementDirection === 'down' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the end of the content and can’t be moved down'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the end of the content and can’t be moved left'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the end of the content and can’t be moved right'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir < 0 && ! isFirst ) {\n\t\t// Moving up.\n\t\tconst movementDirection = getMovementDirection( 'up' );\n\n\t\tif ( movementDirection === 'up' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__( 'Move %1$s block from position %2$d up to position %3$d' ),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition - 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d left to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition - 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d right to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition - 1\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir < 0 && isFirst ) {\n\t\t// Moving up, and is the first item.\n\t\tconst movementDirection = getMovementDirection( 'up' );\n\n\t\tif ( movementDirection === 'up' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the beginning of the content and can’t be moved up'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the beginning of the content and can’t be moved left'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the beginning of the content and can’t be moved right'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Return a label for the block movement controls depending on block position.\n *\n * @param {number} selectedCount Number of blocks selected.\n * @param {number} firstIndex The index (position - 1) of the first block selected.\n * @param {boolean} isFirst This is the first block.\n * @param {boolean} isLast This is the last block.\n * @param {number} dir Direction of movement (> 0 is considered to be going\n * down, < 0 is up).\n *\n * @return {string} Label for the block movement controls.\n */\nexport function getMultiBlockMoverDescription(\n\tselectedCount,\n\tfirstIndex,\n\tisFirst,\n\tisLast,\n\tdir\n) {\n\tconst position = firstIndex + 1;\n\n\tif ( dir < 0 && isFirst ) {\n\t\treturn __( 'Blocks cannot be moved up as they are already at the top' );\n\t}\n\n\tif ( dir > 0 && isLast ) {\n\t\treturn __(\n\t\t\t'Blocks cannot be moved down as they are already at the bottom'\n\t\t);\n\t}\n\n\tif ( dir < 0 && ! isFirst ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t_n(\n\t\t\t\t'Move %1$d block from position %2$d up by one place',\n\t\t\t\t'Move %1$d blocks from position %2$d up by one place',\n\t\t\t\tselectedCount\n\t\t\t),\n\t\t\tselectedCount,\n\t\t\tposition\n\t\t);\n\t}\n\n\tif ( dir > 0 && ! isLast ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t_n(\n\t\t\t\t'Move %1$d block from position %2$d down by one place',\n\t\t\t\t'Move %1$d blocks from position %2$d down by one place',\n\t\t\t\tselectedCount\n\t\t\t),\n\t\t\tselectedCount,\n\t\t\tposition\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-mover/mover-description.js"],"names":["getMovementDirection","moveDirection","orientation","getBlockMoverDescription","selectedCount","type","firstIndex","isFirst","isLast","dir","position","getMultiBlockMoverDescription","movementDirection"],"mappings":";;;;;;;;AAGA;;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AO,cACN,8EADM,CAAP;AAGA;;AAED,QAAKA,iBAAiB,KAAK,OAA3B,EAAqC;AACpC,aAAO,cACN,gFADM,CAAP;AAGA;AACD;AACD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\n\nconst getMovementDirection = ( moveDirection, orientation ) => {\n\tif ( moveDirection === 'up' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? 'right' : 'left';\n\t\t}\n\t\treturn 'up';\n\t} else if ( moveDirection === 'down' ) {\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\treturn isRTL() ? 'left' : 'right';\n\t\t}\n\t\treturn 'down';\n\t}\n\treturn null;\n};\n\n/**\n * Return a label for the block movement controls depending on block position.\n *\n * @param {number} selectedCount Number of blocks selected.\n * @param {string} type Block type - in the case of a single block, should\n * define its 'type'. I.e. 'Text', 'Heading', 'Image' etc.\n * @param {number} firstIndex The index (position - 1) of the first block selected.\n * @param {boolean} isFirst This is the first block.\n * @param {boolean} isLast This is the last block.\n * @param {number} dir Direction of movement (> 0 is considered to be going\n * down, < 0 is up).\n * @param {string} orientation The orientation of the block movers, vertical or\n * horizontal.\n *\n * @return {string} Label for the block movement controls.\n */\nexport function getBlockMoverDescription(\n\tselectedCount,\n\ttype,\n\tfirstIndex,\n\tisFirst,\n\tisLast,\n\tdir,\n\torientation\n) {\n\tconst position = firstIndex + 1;\n\n\tif ( selectedCount > 1 ) {\n\t\treturn getMultiBlockMoverDescription(\n\t\t\tselectedCount,\n\t\t\tfirstIndex,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tdir,\n\t\t\torientation\n\t\t);\n\t}\n\n\tif ( isFirst && isLast ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: Type of block (i.e. Text, Image etc)\n\t\t\t__( 'Block %s is the only block, and cannot be moved' ),\n\t\t\ttype\n\t\t);\n\t}\n\n\tif ( dir > 0 && ! isLast ) {\n\t\t// Moving down.\n\t\tconst movementDirection = getMovementDirection( 'down', orientation );\n\n\t\tif ( movementDirection === 'down' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d down to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition + 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d left to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition + 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d right to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition + 1\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir > 0 && isLast ) {\n\t\t// Moving down, and is the last item.\n\t\tconst movementDirection = getMovementDirection( 'down', orientation );\n\n\t\tif ( movementDirection === 'down' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the end of the content and can’t be moved down'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the end of the content and can’t be moved left'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the end of the content and can’t be moved right'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir < 0 && ! isFirst ) {\n\t\t// Moving up.\n\t\tconst movementDirection = getMovementDirection( 'up', orientation );\n\n\t\tif ( movementDirection === 'up' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__( 'Move %1$s block from position %2$d up to position %3$d' ),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition - 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d left to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition - 1\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position\n\t\t\t\t__(\n\t\t\t\t\t'Move %1$s block from position %2$d right to position %3$d'\n\t\t\t\t),\n\t\t\t\ttype,\n\t\t\t\tposition,\n\t\t\t\tposition - 1\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir < 0 && isFirst ) {\n\t\t// Moving up, and is the first item.\n\t\tconst movementDirection = getMovementDirection( 'up', orientation );\n\n\t\tif ( movementDirection === 'up' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the beginning of the content and can’t be moved up'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the beginning of the content and can’t be moved left'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Type of block (i.e. Text, Image etc)\n\t\t\t\t__(\n\t\t\t\t\t'Block %1$s is at the beginning of the content and can’t be moved right'\n\t\t\t\t),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Return a label for the block movement controls depending on block position.\n *\n * @param {number} selectedCount Number of blocks selected.\n * @param {number} firstIndex The index (position - 1) of the first block selected.\n * @param {boolean} isFirst This is the first block.\n * @param {boolean} isLast This is the last block.\n * @param {number} dir Direction of movement (> 0 is considered to be going\n * down, < 0 is up).\n * @param {string} orientation The orientation of the block movers, vertical or\n * horizontal.\n *\n * @return {string} Label for the block movement controls.\n */\nexport function getMultiBlockMoverDescription(\n\tselectedCount,\n\tfirstIndex,\n\tisFirst,\n\tisLast,\n\tdir,\n\torientation\n) {\n\tconst position = firstIndex + 1;\n\n\tif ( isFirst && isLast ) {\n\t\t// All blocks are selected\n\t\treturn __( 'All blocks are selected, and cannot be moved' );\n\t}\n\n\tif ( dir > 0 && ! isLast ) {\n\t\t// moving down\n\t\tconst movementDirection = getMovementDirection( 'down', orientation );\n\n\t\tif ( movementDirection === 'down' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t\t__( 'Move %1$d blocks from position %2$d down by one place' ),\n\t\t\t\tselectedCount,\n\t\t\t\tposition\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t\t__( 'Move %1$d blocks from position %2$d left by one place' ),\n\t\t\t\tselectedCount,\n\t\t\t\tposition\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t\t__( 'Move %1$d blocks from position %2$d right by one place' ),\n\t\t\t\tselectedCount,\n\t\t\t\tposition\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir > 0 && isLast ) {\n\t\t// moving down, and the selected blocks are the last item\n\t\tconst movementDirection = getMovementDirection( 'down', orientation );\n\n\t\tif ( movementDirection === 'down' ) {\n\t\t\treturn __(\n\t\t\t\t'Blocks cannot be moved down as they are already at the bottom'\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn __(\n\t\t\t\t'Blocks cannot be moved left as they are already are at the leftmost position'\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn __(\n\t\t\t\t'Blocks cannot be moved right as they are already are at the rightmost position'\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir < 0 && ! isFirst ) {\n\t\t// moving up\n\t\tconst movementDirection = getMovementDirection( 'up', orientation );\n\n\t\tif ( movementDirection === 'up' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t\t__( 'Move %1$d blocks from position %2$d up by one place' ),\n\t\t\t\tselectedCount,\n\t\t\t\tposition\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t\t__( 'Move %1$d blocks from position %2$d left by one place' ),\n\t\t\t\tselectedCount,\n\t\t\t\tposition\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: 1: Number of selected blocks, 2: Position of selected blocks\n\t\t\t\t__( 'Move %1$d blocks from position %2$d right by one place' ),\n\t\t\t\tselectedCount,\n\t\t\t\tposition\n\t\t\t);\n\t\t}\n\t}\n\n\tif ( dir < 0 && isFirst ) {\n\t\t// moving up, and the selected blocks are the first item\n\t\tconst movementDirection = getMovementDirection( 'up', orientation );\n\n\t\tif ( movementDirection === 'up' ) {\n\t\t\treturn __(\n\t\t\t\t'Blocks cannot be moved up as they are already at the top'\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'left' ) {\n\t\t\treturn __(\n\t\t\t\t'Blocks cannot be moved left as they are already are at the leftmost position'\n\t\t\t);\n\t\t}\n\n\t\tif ( movementDirection === 'right' ) {\n\t\t\treturn __(\n\t\t\t\t'Blocks cannot be moved right as they are already are at the rightmost position'\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
@@ -43,8 +43,7 @@ const SetupContent = _ref => {
43
43
  viewMode,
44
44
  activeSlide,
45
45
  patterns,
46
- onBlockPatternSelect,
47
- height
46
+ onBlockPatternSelect
48
47
  } = _ref;
49
48
  const composite = (0, _components.__unstableUseCompositeState)();
50
49
  const containerClass = 'block-editor-block-pattern-setup__container';
@@ -52,10 +51,7 @@ const SetupContent = _ref => {
52
51
  if (viewMode === _constants.VIEWMODES.carousel) {
53
52
  const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]);
54
53
  return (0, _element.createElement)("div", {
55
- className: "block-editor-block-pattern-setup__carousel",
56
- style: {
57
- height
58
- }
54
+ className: "block-editor-block-pattern-setup__carousel"
59
55
  }, (0, _element.createElement)("div", {
60
56
  className: containerClass
61
57
  }, (0, _element.createElement)("ul", {
@@ -63,15 +59,11 @@ const SetupContent = _ref => {
63
59
  }, patterns.map((pattern, index) => (0, _element.createElement)(BlockPatternSlide, {
64
60
  className: slideClass.get(index) || '',
65
61
  key: pattern.name,
66
- pattern: pattern,
67
- minHeight: height
62
+ pattern: pattern
68
63
  })))));
69
64
  }
70
65
 
71
66
  return (0, _element.createElement)("div", {
72
- style: {
73
- height
74
- },
75
67
  className: "block-editor-block-pattern-setup__grid"
76
68
  }, (0, _element.createElement)(_components.__unstableComposite, (0, _extends2.default)({}, composite, {
77
69
  role: "listbox",
@@ -153,9 +145,6 @@ const BlockPatternSetup = _ref4 => {
153
145
  replaceBlock
154
146
  } = (0, _data.useDispatch)(_store.store);
155
147
  const patterns = (0, _usePatternsSetup.default)(clientId, blockName, filterPatternsFn);
156
- const [contentResizeListener, {
157
- height: contentHeight
158
- }] = (0, _compose.useResizeObserver)();
159
148
 
160
149
  if (!(patterns !== null && patterns !== void 0 && patterns.length)) {
161
150
  return null;
@@ -167,14 +156,13 @@ const BlockPatternSetup = _ref4 => {
167
156
  };
168
157
 
169
158
  const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault;
170
- return (0, _element.createElement)(_element.Fragment, null, contentResizeListener, (0, _element.createElement)("div", {
159
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
171
160
  className: `block-editor-block-pattern-setup view-mode-${viewMode}`
172
161
  }, (0, _element.createElement)(SetupContent, {
173
162
  viewMode: viewMode,
174
163
  activeSlide: activeSlide,
175
164
  patterns: patterns,
176
- onBlockPatternSelect: onPatternSelectCallback,
177
- height: contentHeight - 2 * 60
165
+ onBlockPatternSelect: onPatternSelectCallback
178
166
  }), (0, _element.createElement)(_setupToolbar.default, {
179
167
  viewMode: viewMode,
180
168
  setViewMode: setViewMode,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-pattern-setup/index.js"],"names":["SetupContent","viewMode","activeSlide","patterns","onBlockPatternSelect","height","composite","containerClass","VIEWMODES","carousel","slideClass","Map","map","pattern","index","get","name","BlockPattern","onSelect","baseClassName","blocks","description","viewportWidth","descriptionId","title","undefined","BlockPatternSlide","className","minHeight","BlockPatternSetup","clientId","blockName","filterPatternsFn","setViewMode","setActiveSlide","replaceBlock","blockEditorStore","contentResizeListener","contentHeight","length","onBlockPatternSelectDefault","clonedBlocks","block","onPatternSelectCallback","active"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AACA;;AACA;;AAQA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAcA;AACA;AACA;AAOA,MAAMA,YAAY,GAAG,QAMd;AAAA,MANgB;AACtBC,IAAAA,QADsB;AAEtBC,IAAAA,WAFsB;AAGtBC,IAAAA,QAHsB;AAItBC,IAAAA,oBAJsB;AAKtBC,IAAAA;AALsB,GAMhB;AACN,QAAMC,SAAS,GAAG,8CAAlB;AACA,QAAMC,cAAc,GAAG,6CAAvB;;AACA,MAAKN,QAAQ,KAAKO,qBAAUC,QAA5B,EAAuC;AACtC,UAAMC,UAAU,GAAG,IAAIC,GAAJ,CAAS,CAC3B,CAAET,WAAF,EAAe,cAAf,CAD2B,EAE3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,gBAAnB,CAF2B,EAG3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,YAAnB,CAH2B,CAAT,CAAnB;AAKA,WACC;AACC,MAAA,SAAS,EAAC,4CADX;AAEC,MAAA,KAAK,EAAG;AAAEG,QAAAA;AAAF;AAFT,OAIC;AAAK,MAAA,SAAS,EAAGE;AAAjB,OACC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGJ,QAAQ,CAACS,GAAT,CAAc,CAAEC,OAAF,EAAWC,KAAX,KACf,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAGJ,UAAU,CAACK,GAAX,CAAgBD,KAAhB,KAA2B,EADxC;AAEC,MAAA,GAAG,EAAGD,OAAO,CAACG,IAFf;AAGC,MAAA,OAAO,EAAGH,OAHX;AAIC,MAAA,SAAS,EAAGR;AAJb,MADC,CADH,CADD,CAJD,CADD;AAmBA;;AACD,SACC;AACC,IAAA,KAAK,EAAG;AAAEA,MAAAA;AAAF,KADT;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,4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pB,MAAF,IAAc;AACjD,UAAMqB,YAAY,GAAGrB,MAAM,CAACR,GAAP,CAAc8B,KAAF,IAAa,wBAAYA,KAAZ,CAAzB,CAArB;AACAP,IAAAA,YAAY,CAAEL,QAAF,EAAYW,YAAZ,CAAZ;AACA,GAHD;;AAIA,QAAME,uBAAuB,GAC5BvC,oBAAoB,IAAIoC,2BADzB;AAEA,SACC,qDACGH,qBADH,EAEC;AACC,IAAA,SAAS,EAAI,8CAA8CpC,QAAU;AADtE,KAGC,4BAAC,YAAD;AACC,IAAA,QAAQ,EAAGA,QADZ;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,oBAAoB,EAAGwC,uBAJxB;AAKC,IAAA,MAAM,EAAGL,aAAa,GAAG,IAAI;AAL9B,IAHD,EAUC,4BAAC,qBAAD;AACC,IAAA,QAAQ,EAAGrC,QADZ;AAEC,IAAA,WAAW,EAAGgC,WAFf;AAGC,IAAA,WAAW,EAAG/B,WAHf;AAIC,IAAA,WAAW,EAAGC,QAAQ,CAACoC,MAJxB;AAKC,IAAA,UAAU,EAAG,MAAM;AAClBL,MAAAA,cAAc,CAAIU,MAAF,IAAcA,MAAM,GAAG,CAAzB,CAAd;AACA,KAPF;AAQC,IAAA,cAAc,EAAG,MAAM;AACtBV,MAAAA,cAAc,CAAIU,MAAF,IAAcA,MAAM,GAAG,CAAzB,CAAd;AACA,KAVF;AAWC,IAAA,oBAAoB,EAAG,MAAM;AAC5BD,MAAAA,uBAAuB,CACtBxC,QAAQ,CAAED,WAAF,CAAR,CAAwBkB,MADF,CAAvB;AAGA;AAfF,IAVD,CAFD,CADD;AAiCA,CAxDD;;eA0DeS,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\n\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useResizeObserver } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockPreview from '../block-preview';\nimport SetupToolbar from './setup-toolbar';\nimport usePatternsSetup from './use-patterns-setup';\nimport { VIEWMODES } from './constants';\n\nconst SetupContent = ( {\n\tviewMode,\n\tactiveSlide,\n\tpatterns,\n\tonBlockPatternSelect,\n\theight,\n} ) => {\n\tconst composite = useCompositeState();\n\tconst containerClass = 'block-editor-block-pattern-setup__container';\n\tif ( viewMode === VIEWMODES.carousel ) {\n\t\tconst slideClass = new Map( [\n\t\t\t[ activeSlide, 'active-slide' ],\n\t\t\t[ activeSlide - 1, 'previous-slide' ],\n\t\t\t[ activeSlide + 1, 'next-slide' ],\n\t\t] );\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName=\"block-editor-block-pattern-setup__carousel\"\n\t\t\t\tstyle={ { height } }\n\t\t\t>\n\t\t\t\t<div className={ containerClass }>\n\t\t\t\t\t<ul className=\"carousel-container\">\n\t\t\t\t\t\t{ patterns.map( ( pattern, index ) => (\n\t\t\t\t\t\t\t<BlockPatternSlide\n\t\t\t\t\t\t\t\tclassName={ slideClass.get( index ) || '' }\n\t\t\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\t\t\tminHeight={ height }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<div\n\t\t\tstyle={ { height } }\n\t\t\tclassName=\"block-editor-block-pattern-setup__grid\"\n\t\t>\n\t\t\t<Composite\n\t\t\t\t{ ...composite }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName={ containerClass }\n\t\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t\t>\n\t\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonSelect={ onBlockPatternSelect }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t</div>\n\t);\n};\n\nfunction BlockPattern( { pattern, onSelect, composite } ) {\n\tconst baseClassName = 'block-editor-block-pattern-setup-list';\n\tconst { blocks, description, viewportWidth = 700 } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }__item-description`\n\t);\n\treturn (\n\t\t<div\n\t\t\tclassName={ `${ baseClassName }__list-item` }\n\t\t\taria-label={ pattern.title }\n\t\t\taria-describedby={ pattern.description ? descriptionId : undefined }\n\t\t>\n\t\t\t<CompositeItem\n\t\t\t\trole=\"option\"\n\t\t\t\tas=\"div\"\n\t\t\t\t{ ...composite }\n\t\t\t\tclassName={ `${ baseClassName }__item` }\n\t\t\t\tonClick={ () => onSelect( blocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t/>\n\t\t\t</CompositeItem>\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternSlide( { className, pattern, minHeight } ) {\n\tconst { blocks, title, description } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPatternSlide,\n\t\t'block-editor-block-pattern-setup-list__item-description'\n\t);\n\treturn (\n\t\t<li\n\t\t\tclassName={ `pattern-slide ${ className }` }\n\t\t\taria-label={ title }\n\t\t\taria-describedby={ description ? descriptionId : undefined }\n\t\t>\n\t\t\t<BlockPreview\n\t\t\t\tblocks={ blocks }\n\t\t\t\t__experimentalMinHeight={ minHeight }\n\t\t\t/>\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</li>\n\t);\n}\n\nconst BlockPatternSetup = ( {\n\tclientId,\n\tblockName,\n\tfilterPatternsFn,\n\tonBlockPatternSelect,\n} ) => {\n\tconst [ viewMode, setViewMode ] = useState( VIEWMODES.carousel );\n\tconst [ activeSlide, setActiveSlide ] = useState( 0 );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\n\tif ( ! patterns?.length ) {\n\t\treturn null;\n\t}\n\n\tconst onBlockPatternSelectDefault = ( blocks ) => {\n\t\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\t\treplaceBlock( clientId, clonedBlocks );\n\t};\n\tconst onPatternSelectCallback =\n\t\tonBlockPatternSelect || onBlockPatternSelectDefault;\n\treturn (\n\t\t<>\n\t\t\t{ contentResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ `block-editor-block-pattern-setup view-mode-${ viewMode }` }\n\t\t\t>\n\t\t\t\t<SetupContent\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonBlockPatternSelect={ onPatternSelectCallback }\n\t\t\t\t\theight={ contentHeight - 2 * 60 }\n\t\t\t\t/>\n\t\t\t\t<SetupToolbar\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tsetViewMode={ setViewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\ttotalSlides={ patterns.length }\n\t\t\t\t\thandleNext={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active + 1 );\n\t\t\t\t\t} }\n\t\t\t\t\thandlePrevious={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active - 1 );\n\t\t\t\t\t} }\n\t\t\t\t\tonBlockPatternSelect={ () => {\n\t\t\t\t\t\tonPatternSelectCallback(\n\t\t\t\t\t\t\tpatterns[ activeSlide ].blocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default BlockPatternSetup;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-pattern-setup/index.js"],"names":["SetupContent","viewMode","activeSlide","patterns","onBlockPatternSelect","composite","containerClass","VIEWMODES","carousel","slideClass","Map","map","pattern","index","get","name","BlockPattern","onSelect","baseClassName","blocks","description","viewportWidth","descriptionId","title","undefined","BlockPatternSlide","className","minHeight","BlockPatternSetup","clientId","blockName","filterPatternsFn","setViewMode","setActiveSlide","replaceBlock","blockEditorStore","length","onBlockPatternSelectDefault","clonedBlocks","block","onPatternSelectCallback","active"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AACA;;AACA;;AAQA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAcA;AACA;AACA;AAOA,MAAMA,YAAY,GAAG,QAKd;AAAA,MALgB;AACtBC,IAAAA,QADsB;AAEtBC,IAAAA,WAFsB;AAGtBC,IAAAA,QAHsB;AAItBC,IAAAA;AAJsB,GAKhB;AACN,QAAMC,SAAS,GAAG,8CAAlB;AACA,QAAMC,cAAc,GAAG,6CAAvB;;AACA,MAAKL,QAAQ,KAAKM,qBAAUC,QAA5B,EAAuC;AACtC,UAAMC,UAAU,GAAG,IAAIC,GAAJ,CAAS,CAC3B,CAAER,WAAF,EAAe,cAAf,CAD2B,EAE3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,gBAAnB,CAF2B,EAG3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,YAAnB,CAH2B,CAAT,CAAnB;AAKA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ED,WAAF,CAAR,CAAwBiB,MADF,CAAvB;AAGA;AAfF,IATD,CADD,CADD;AA+BA,CApDD;;eAsDeS,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\n\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockPreview from '../block-preview';\nimport SetupToolbar from './setup-toolbar';\nimport usePatternsSetup from './use-patterns-setup';\nimport { VIEWMODES } from './constants';\n\nconst SetupContent = ( {\n\tviewMode,\n\tactiveSlide,\n\tpatterns,\n\tonBlockPatternSelect,\n} ) => {\n\tconst composite = useCompositeState();\n\tconst containerClass = 'block-editor-block-pattern-setup__container';\n\tif ( viewMode === VIEWMODES.carousel ) {\n\t\tconst slideClass = new Map( [\n\t\t\t[ activeSlide, 'active-slide' ],\n\t\t\t[ activeSlide - 1, 'previous-slide' ],\n\t\t\t[ activeSlide + 1, 'next-slide' ],\n\t\t] );\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-pattern-setup__carousel\">\n\t\t\t\t<div className={ containerClass }>\n\t\t\t\t\t<ul className=\"carousel-container\">\n\t\t\t\t\t\t{ patterns.map( ( pattern, index ) => (\n\t\t\t\t\t\t\t<BlockPatternSlide\n\t\t\t\t\t\t\t\tclassName={ slideClass.get( index ) || '' }\n\t\t\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<div className=\"block-editor-block-pattern-setup__grid\">\n\t\t\t<Composite\n\t\t\t\t{ ...composite }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName={ containerClass }\n\t\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t\t>\n\t\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonSelect={ onBlockPatternSelect }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t</div>\n\t);\n};\n\nfunction BlockPattern( { pattern, onSelect, composite } ) {\n\tconst baseClassName = 'block-editor-block-pattern-setup-list';\n\tconst { blocks, description, viewportWidth = 700 } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }__item-description`\n\t);\n\treturn (\n\t\t<div\n\t\t\tclassName={ `${ baseClassName }__list-item` }\n\t\t\taria-label={ pattern.title }\n\t\t\taria-describedby={ pattern.description ? descriptionId : undefined }\n\t\t>\n\t\t\t<CompositeItem\n\t\t\t\trole=\"option\"\n\t\t\t\tas=\"div\"\n\t\t\t\t{ ...composite }\n\t\t\t\tclassName={ `${ baseClassName }__item` }\n\t\t\t\tonClick={ () => onSelect( blocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t/>\n\t\t\t</CompositeItem>\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternSlide( { className, pattern, minHeight } ) {\n\tconst { blocks, title, description } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPatternSlide,\n\t\t'block-editor-block-pattern-setup-list__item-description'\n\t);\n\treturn (\n\t\t<li\n\t\t\tclassName={ `pattern-slide ${ className }` }\n\t\t\taria-label={ title }\n\t\t\taria-describedby={ description ? descriptionId : undefined }\n\t\t>\n\t\t\t<BlockPreview\n\t\t\t\tblocks={ blocks }\n\t\t\t\t__experimentalMinHeight={ minHeight }\n\t\t\t/>\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</li>\n\t);\n}\n\nconst BlockPatternSetup = ( {\n\tclientId,\n\tblockName,\n\tfilterPatternsFn,\n\tonBlockPatternSelect,\n} ) => {\n\tconst [ viewMode, setViewMode ] = useState( VIEWMODES.carousel );\n\tconst [ activeSlide, setActiveSlide ] = useState( 0 );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );\n\n\tif ( ! patterns?.length ) {\n\t\treturn null;\n\t}\n\n\tconst onBlockPatternSelectDefault = ( blocks ) => {\n\t\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\t\treplaceBlock( clientId, clonedBlocks );\n\t};\n\tconst onPatternSelectCallback =\n\t\tonBlockPatternSelect || onBlockPatternSelectDefault;\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ `block-editor-block-pattern-setup view-mode-${ viewMode }` }\n\t\t\t>\n\t\t\t\t<SetupContent\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonBlockPatternSelect={ onPatternSelectCallback }\n\t\t\t\t/>\n\t\t\t\t<SetupToolbar\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tsetViewMode={ setViewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\ttotalSlides={ patterns.length }\n\t\t\t\t\thandleNext={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active + 1 );\n\t\t\t\t\t} }\n\t\t\t\t\thandlePrevious={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active - 1 );\n\t\t\t\t\t} }\n\t\t\t\t\tonBlockPatternSelect={ () => {\n\t\t\t\t\t\tonPatternSelectCallback(\n\t\t\t\t\t\t\tpatterns[ activeSlide ].blocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default BlockPatternSetup;\n"]}
@@ -174,14 +174,14 @@ function BlockPopoverInbetween(_ref) {
174
174
  animate: false,
175
175
  getAnchorRect: getAnchorRect,
176
176
  focusOnMount: false // Render in the old slot if needed for backward compatibility,
177
- // otherwise render in place (not in the the default popover slot).
177
+ // otherwise render in place (not in the default popover slot).
178
178
  ,
179
179
  __unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes
180
180
  // This makes sure the popover doesn't animate from its previous position.
181
181
  ,
182
182
  key: nextClientId + '--' + rootClientId
183
183
  }, props, {
184
- className: (0, _classnames.default)('block-editor-block-popover', props.className),
184
+ className: (0, _classnames.default)('block-editor-block-popover', 'block-editor-block-popover__inbetween', props.className),
185
185
  __unstableForcePosition: true
186
186
  }), (0, _element.createElement)("div", {
187
187
  style: style
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"names":["InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","props","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","blockEditorStore","_rootClientId","previousElement","nextElement","isVertical","style","previousRect","getBoundingClientRect","nextRect","width","offsetWidth","height","top","bottom","left","right","offsetHeight","getAnchorRect","ownerDocument","popoverScrollRef","className"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA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nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useMemo, createContext } from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId( previousClientId );\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\tconst style = useMemo( () => {\n\t\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst previousRect = previousElement\n\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t: null;\n\t\tconst nextRect = nextElement\n\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t: null;\n\n\t\tif ( isVertical ) {\n\t\t\treturn {\n\t\t\t\twidth: previousElement\n\t\t\t\t\t? previousElement.offsetWidth\n\t\t\t\t\t: nextElement.offsetWidth,\n\t\t\t\theight:\n\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t: 0,\n\t\t\t};\n\t\t}\n\n\t\tlet width = 0;\n\t\tif ( previousRect && nextRect ) {\n\t\t\twidth = isRTL()\n\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t: nextRect.left - previousRect.right;\n\t\t}\n\n\t\treturn {\n\t\t\twidth,\n\t\t\theight: previousElement\n\t\t\t\t? previousElement.offsetHeight\n\t\t\t\t: nextElement.offsetHeight,\n\t\t};\n\t}, [ previousElement, nextElement, isVertical ] );\n\n\tconst getAnchorRect = useCallback( () => {\n\t\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst { ownerDocument } = previousElement || nextElement;\n\n\t\tconst previousRect = previousElement\n\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t: null;\n\t\tconst nextRect = nextElement\n\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t: null;\n\n\t\tif ( isVertical ) {\n\t\t\tif ( isRTL() ) {\n\t\t\t\treturn {\n\t\t\t\t\ttop: previousRect ? previousRect.bottom : nextRect.top,\n\t\t\t\t\tleft: previousRect ? previousRect.right : nextRect.right,\n\t\t\t\t\tright: previousRect ? previousRect.left : nextRect.left,\n\t\t\t\t\tbottom: nextRect ? nextRect.top : previousRect.bottom,\n\t\t\t\t\theight: 0,\n\t\t\t\t\twidth: 0,\n\t\t\t\t\townerDocument,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttop: previousRect ? previousRect.bottom : nextRect.top,\n\t\t\t\tleft: previousRect ? previousRect.left : nextRect.left,\n\t\t\t\tright: previousRect ? previousRect.right : nextRect.right,\n\t\t\t\tbottom: nextRect ? nextRect.top : previousRect.bottom,\n\t\t\t\theight: 0,\n\t\t\t\twidth: 0,\n\t\t\t\townerDocument,\n\t\t\t};\n\t\t}\n\n\t\tif ( isRTL() ) {\n\t\t\treturn {\n\t\t\t\ttop: previousRect ? previousRect.top : nextRect.top,\n\t\t\t\tleft: previousRect ? previousRect.left : nextRect.right,\n\t\t\t\tright: nextRect ? nextRect.right : previousRect.left,\n\t\t\t\tbottom: previousRect ? previousRect.bottom : nextRect.bottom,\n\t\t\t\theight: 0,\n\t\t\t\twidth: 0,\n\t\t\t\townerDocument,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\ttop: previousRect ? previousRect.top : nextRect.top,\n\t\t\tleft: previousRect ? previousRect.right : nextRect.left,\n\t\t\tright: nextRect ? nextRect.left : previousRect.right,\n\t\t\tbottom: previousRect ? previousRect.bottom : nextRect.bottom,\n\t\t\theight: 0,\n\t\t\twidth: 0,\n\t\t\townerDocument,\n\t\t};\n\t}, [ previousElement, nextElement ] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\tif ( ! previousElement || ! nextElement || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tgetAnchorRect={ getAnchorRect }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\t__unstableForcePosition\n\t\t>\n\t\t\t<div style={ style }>{ children }</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"names":["InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","props","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","blockEditorStore","_rootClientId","previousElement","nextElement","isVertical","style","previousRect","getBoundingClientRect","nextRect","width","offsetWidth","height","top","bottom","left","right","offsetHeight","getAnchorRect","ownerDocument","popoverScrollRef","className"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAKO,MAAMA,qBAAqB,GAAG,6BAA9B;;;AAEP,SAASC,qBAAT,OAOI;AAAA,MAP4B;AAC/BC,IAAAA,gBAD+B;AAE/BC,IAAAA,YAF+B;AAG/BC,IAAAA,QAH+B;AAI/BC,IAAAA,qBAJ+B;AAK/BC,IAAAA,oBAL+B;AAM/B,OAAGC;AAN4B,GAO5B;AACH,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,YAAf;AAA6BC,IAAAA;AAA7B,MAA2C,qBAC9CC,MAAF,IAAc;AAAA;;AACb,UAAM;AACLC,MAAAA,oBADK;AAELC,MAAAA,oBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,YAAF,CAJV;;AAMA,UAAMC,aAAa,GAAGH,oBAAoB,CAAEX,gBAAF,CAA1C;;AACA,WAAO;AACNM,MAAAA,WAAW,EACV,0BAAAI,oBAAoB,CAAEI,aAAF,CAApB,gFAAuCR,WAAvC,KACA,UA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AAqB,CAAEC,WAAvB,IAAsC,CAAER,SAA7C,EAAyD;AACxD,WAAO,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SACC,4BAAC,mBAAD;AACC,IAAA,GAAG,EAAGwB,gBADP;AAEC,IAAA,OAAO,EAAG,KAFX;AAGC,IAAA,aAAa,EAAGF,aAHjB;AAIC,IAAA,YAAY,EAAG,KAJhB,CAKC;AACA;AAND;AAOC,IAAA,kBAAkB,EAAG3B,qBAAqB,IAAI,IAP/C,CAQC;AACA;AATD;AAUC,IAAA,GAAG,EAAGF,YAAY,GAAG,IAAf,GAAsBM;AAV7B,KAWMF,KAXN;AAYC,IAAA,SAAS,EAAG,yBACX,4BADW,EAEX,uCAFW,EAGXA,KAAK,CAAC4B,SAHK,CAZb;AAiBC,IAAA,uBAAuB;AAjBxB,MAmBC;AAAK,IAAA,KAAK,EAAGf;AAAb,KAAuBhB,QAAvB,CAnBD,CADD;AAuBA;AACA;;eAEcH,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useMemo, createContext } from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId( previousClientId );\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\tconst style = useMemo( () => {\n\t\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst previousRect = previousElement\n\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t: null;\n\t\tconst nextRect = nextElement\n\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t: null;\n\n\t\tif ( isVertical ) {\n\t\t\treturn {\n\t\t\t\twidth: previousElement\n\t\t\t\t\t? previousElement.offsetWidth\n\t\t\t\t\t: nextElement.offsetWidth,\n\t\t\t\theight:\n\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t: 0,\n\t\t\t};\n\t\t}\n\n\t\tlet width = 0;\n\t\tif ( previousRect && nextRect ) {\n\t\t\twidth = isRTL()\n\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t: nextRect.left - previousRect.right;\n\t\t}\n\n\t\treturn {\n\t\t\twidth,\n\t\t\theight: previousElement\n\t\t\t\t? previousElement.offsetHeight\n\t\t\t\t: nextElement.offsetHeight,\n\t\t};\n\t}, [ previousElement, nextElement, isVertical ] );\n\n\tconst getAnchorRect = useCallback( () => {\n\t\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst { ownerDocument } = previousElement || nextElement;\n\n\t\tconst previousRect = previousElement\n\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t: null;\n\t\tconst nextRect = nextElement\n\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t: null;\n\n\t\tif ( isVertical ) {\n\t\t\tif ( isRTL() ) {\n\t\t\t\treturn {\n\t\t\t\t\ttop: previousRect ? previousRect.bottom : nextRect.top,\n\t\t\t\t\tleft: previousRect ? previousRect.right : nextRect.right,\n\t\t\t\t\tright: previousRect ? previousRect.left : nextRect.left,\n\t\t\t\t\tbottom: nextRect ? nextRect.top : previousRect.bottom,\n\t\t\t\t\theight: 0,\n\t\t\t\t\twidth: 0,\n\t\t\t\t\townerDocument,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttop: previousRect ? previousRect.bottom : nextRect.top,\n\t\t\t\tleft: previousRect ? previousRect.left : nextRect.left,\n\t\t\t\tright: previousRect ? previousRect.right : nextRect.right,\n\t\t\t\tbottom: nextRect ? nextRect.top : previousRect.bottom,\n\t\t\t\theight: 0,\n\t\t\t\twidth: 0,\n\t\t\t\townerDocument,\n\t\t\t};\n\t\t}\n\n\t\tif ( isRTL() ) {\n\t\t\treturn {\n\t\t\t\ttop: previousRect ? previousRect.top : nextRect.top,\n\t\t\t\tleft: previousRect ? previousRect.left : nextRect.right,\n\t\t\t\tright: nextRect ? nextRect.right : previousRect.left,\n\t\t\t\tbottom: previousRect ? previousRect.bottom : nextRect.bottom,\n\t\t\t\theight: 0,\n\t\t\t\twidth: 0,\n\t\t\t\townerDocument,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\ttop: previousRect ? previousRect.top : nextRect.top,\n\t\t\tleft: previousRect ? previousRect.right : nextRect.left,\n\t\t\tright: nextRect ? nextRect.left : previousRect.right,\n\t\t\tbottom: previousRect ? previousRect.bottom : nextRect.bottom,\n\t\t\theight: 0,\n\t\t\twidth: 0,\n\t\t\townerDocument,\n\t\t};\n\t}, [ previousElement, nextElement ] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\tif ( ! previousElement || ! nextElement || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tgetAnchorRect={ getAnchorRect }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\t'block-editor-block-popover__inbetween',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\t__unstableForcePosition\n\t\t>\n\t\t\t<div style={ style }>{ children }</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"]}
@@ -70,7 +70,7 @@ function BlockPopover(_ref) {
70
70
  position: "top right left",
71
71
  focusOnMount: false,
72
72
  anchorRef: anchorRef // Render in the old slot if needed for backward compatibility,
73
- // otherwise render in place (not in the the default popover slot).
73
+ // otherwise render in place (not in the default popover slot).
74
74
  ,
75
75
  __unstableSlotName: __unstablePopoverSlot || null // Observe movement for block animations (especially horizontal).
76
76
  ,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"names":["BlockPopover","clientId","bottomClientId","children","__unstableRefreshSize","__unstableCoverTarget","__unstablePopoverSlot","__unstableContentRef","props","selectedElement","lastSelectedElement","popoverScrollRef","style","position","width","offsetWidth","height","offsetHeight","anchorRef","top","bottom","className"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAMA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIe,SAASA,YAAT,OASX;AAAA,MATkC;AACrCC,IAAAA,QADqC;AAErCC,IAAAA,cAFqC;AAGrCC,IAAAA,QAHqC;AAIrCC,IAAAA,qBAJqC;AAKrCC,IAAAA,qBAAqB,GAAG,KALa;AAMrCC,IAAAA,qBANqC;AAOrCC,IAAAA,oBAPqC;AAQrC,OAAGC;AARkC,GASlC;AACH,QAAMC,eAAe,GAAG,6CAAiBR,QAAjB,CAAxB;AACA,QAAMS,mBAAmB,GAAG,6CAAiBR,cAAjB,aAAiBA,cAAjB,cAAiBA,cAAjB,GAAmCD,QAAnC,CAA5B;AACA,QAAMU,gBAAgB,GAAG,+BAAkBJ,oBAAlB,CAAzB;AACA,QAAMK,KAAK,GAAG,sBAAS,MAAM;AAC5B,QAAK,CAAEH,eAAF,IAAqBC,mBAAmB,KAAKD,eAAlD,EAAoE;AACnE,aAAO,EAAP;AACA;;AAED,WAAO;AACNI,MAAAA,QAAQ,EAAE,UADJ;AAENC,MAAAA,KAAK,EAAEL,eAAe,CAACM,WAFjB;AAGNC,MAAAA,MAAM,EAAEP,eAAe,CAACQ;AAHlB,KAAP;AAKA,GAVa,EAUX,CAAER,eAAF,EAAmBC,mBAAnB,EAAwCN,qBAAxC,CAVW,CAAd;;AAYA,MAAK,CAAEK,eAAF,IAAuBP,cAAc,IAAI,CAAEQ,mBAAhD,EAAwE;AACvE,WAAO,IAAP;AACA;;AAED,QAAMQ,SAAS,GAAG;AACjBC,IAAAA,GAAG,EAAEV,eADY;AAEjBW,IAAAA,MAAM,EAAEV;AAFS,GAAlB;AAKA,SACC,4BAAC,mBAAD;AACC,IAAA,GAAG,EAAGC,gBADP;AAEC,IAAA,OAAO,EAAG,KAFX;AAGC,IAAA,QAAQ,EAAC,gBAHV;AAIC,IAAA,YAAY,EAAG,KAJhB;AAKC,IAAA,SAAS,EAAGO,SALb,CAMC;AACA;AAPD;AAQC,IAAA,kBAAkB,EAAGZ,qBAAqB,IAAI,IAR/C,CASC;AATD;AAUC,IAAA,wBAAwB,EAAGG,eAV5B;AAWC,IAAA,uBAAuB,MAXxB;AAYC,IAAA,eAAe;AAZhB,KAaMD,KAbN;AAcC,IAAA,SAAS,EAAG,yBACX,4BADW,EAEXA,KAAK,CAACa,SAFK;AAdb,MAmBGhB,qBAAqB,IAAI;AAAK,IAAA,KAAK,EAAGO;AAAb,KAAuBT,QAAvB,CAnB5B,EAoBG,CAAEE,qBAAF,IAA2BF,QApB9B,CADD;AAwBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Popover } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nexport default function BlockPopover( {\n\tclientId,\n\tbottomClientId,\n\tchildren,\n\t__unstableRefreshSize,\n\t__unstableCoverTarget = false,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\tconst style = useMemo( () => {\n\t\tif ( ! selectedElement || lastSelectedElement !== selectedElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth: selectedElement.offsetWidth,\n\t\t\theight: selectedElement.offsetHeight,\n\t\t};\n\t}, [ selectedElement, lastSelectedElement, __unstableRefreshSize ] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\tconst anchorRef = {\n\t\ttop: selectedElement,\n\t\tbottom: lastSelectedElement,\n\t};\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tposition=\"top right left\"\n\t\t\tfocusOnMount={ false }\n\t\t\tanchorRef={ anchorRef }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t// Observe movement for block animations (especially horizontal).\n\t\t\t__unstableObserveElement={ selectedElement }\n\t\t\t__unstableForcePosition\n\t\t\t__unstableShift\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t>\n\t\t\t{ __unstableCoverTarget && <div style={ style }>{ children }</div> }\n\t\t\t{ ! __unstableCoverTarget && children }\n\t\t</Popover>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"names":["BlockPopover","clientId","bottomClientId","children","__unstableRefreshSize","__unstableCoverTarget","__unstablePopoverSlot","__unstableContentRef","props","selectedElement","lastSelectedElement","popoverScrollRef","style","position","width","offsetWidth","height","offsetHeight","anchorRef","top","bottom","className"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAMA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAIe,SAASA,YAAT,OASX;AAAA,MATkC;AACrCC,IAAAA,QADqC;AAErCC,IAAAA,cAFqC;AAGrCC,IAAAA,QAHqC;AAIrCC,IAAAA,qBAJqC;AAKrCC,IAAAA,qBAAqB,GAAG,KALa;AAMrCC,IAAAA,qBANqC;AAOrCC,IAAAA,oBAPqC;AAQrC,OAAGC;AARkC,GASlC;AACH,QAAMC,eAAe,GAAG,6CAAiBR,QAAjB,CAAxB;AACA,QAAMS,m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ourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Popover } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nexport default function BlockPopover( {\n\tclientId,\n\tbottomClientId,\n\tchildren,\n\t__unstableRefreshSize,\n\t__unstableCoverTarget = false,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\t...props\n} ) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\tconst style = useMemo( () => {\n\t\tif ( ! selectedElement || lastSelectedElement !== selectedElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth: selectedElement.offsetWidth,\n\t\t\theight: selectedElement.offsetHeight,\n\t\t};\n\t}, [ selectedElement, lastSelectedElement, __unstableRefreshSize ] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\tconst anchorRef = {\n\t\ttop: selectedElement,\n\t\tbottom: lastSelectedElement,\n\t};\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tposition=\"top right left\"\n\t\t\tfocusOnMount={ false }\n\t\t\tanchorRef={ anchorRef }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t// Observe movement for block animations (especially horizontal).\n\t\t\t__unstableObserveElement={ selectedElement }\n\t\t\t__unstableForcePosition\n\t\t\t__unstableShift\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t>\n\t\t\t{ __unstableCoverTarget && <div style={ style }>{ children }</div> }\n\t\t\t{ ! __unstableCoverTarget && children }\n\t\t</Popover>\n\t);\n}\n"]}
@@ -38,7 +38,7 @@ function BlockModeToggle(_ref) {
38
38
  isCodeEditingEnabled = true
39
39
  } = _ref;
40
40
 
41
- if (!(0, _blocks.hasBlockSupport)(blockType, 'html', true) || !isCodeEditingEnabled) {
41
+ if (!blockType || !(0, _blocks.hasBlockSupport)(blockType, 'html', true) || !isCodeEditingEnabled) {
42
42
  return null;
43
43
  }
44
44
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-mode-toggle.js"],"names":["noop","BlockModeToggle","blockType","mode","onToggleMode","small","isCodeEditingEnabled","label","select","clientId","getBlock","getBlockMode","getSettings","blockEditorStore","block","codeEditingEnabled","name","dispatch","onToggle","toggleBlockMode"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,eAAT,OAMH;AAAA,MAN6B;AAChCC,IAAAA,SADgC;AAEhCC,IAAAA,IAFgC;AAGhCC,IAAAA,YAHgC;AAIhCC,IAAAA,KAAK,GAAG,KAJwB;AAKhCC,IAAAA,oBAAoB,GAAG;AALS,GAM7B;;AACH,MACC,CAAE,6BAAiBJ,SAAjB,EAA4B,MAA5B,EAAoC,IAApC,CAAF,IACA,CAAEI,oBAFH,EAGE;AACD,WAAO,IAAP;AACA;;AAED,QAAMC,KAAK,GACVJ,IAAI,KAAK,QAAT,GAAoB,cAAI,cAAJ,CAApB,GAA2C,cAAI,eAAJ,CAD5C;AAGA,SAAO,4BAAC,oBAAD;AAAU,IAAA,OAAO,EAAGC;AAApB,KAAqC,CAAEC,KAAF,IAAWE,KAAhD,CAAP;AACA;;eAEc,sBAAS,CACvB,sBAAY,CAAEC,MAAF,YAA4B;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AACvC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,YAAZ;AAA0BC,IAAAA;AAA1B,MACLJ,MAAM,CAAEK,YAAF,CADP;AAEA,QAAMC,KAAK,GAAGJ,QAAQ,CAAED,QAAF,CAAtB;AACA,QAAMH,oBAAoB,GAAGM,WAAW,GAAGG,kBAA3C;AAEA,SAAO;AACNZ,IAAAA,IAAI,EAAEQ,YAAY,CAAEF,QAAF,CADZ;AAENP,IAAAA,SAAS,EAAEY,KAAK,GAAG,0BAAcA,KAAK,CAACE,IAApB,CAAH,GAAgC,IAF1C;AAGNV,IAAAA;AAHM,GAAP;AAKA,CAXD,CADuB,EAavB,wBAAc,CAAEW,QAAF;AAAA,MAAY;AAAEC,IAAAA,QAAQ,GAAGlB,IAAb;AAAmBS,IAAAA;AAAnB,GAAZ;AAAA,SAAiD;AAC9DL,IAAAA,YAAY,GAAG;AACda,MAAAA,QAAQ,CAAEJ,YAAF,CAAR,CAA6BM,eAA7B,CAA8CV,QAA9C;AACAS,MAAAA,QAAQ;AACR;;AAJ6D,GAAjD;AAAA,CAAd,CAbuB,CAAT,EAmBVjB,eAnBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\n\nexport function BlockModeToggle( {\n\tblockType,\n\tmode,\n\tonToggleMode,\n\tsmall = false,\n\tisCodeEditingEnabled = true,\n} ) {\n\tif (\n\t\t! hasBlockSupport( blockType, 'html', true ) ||\n\t\t! isCodeEditingEnabled\n\t) {\n\t\treturn null;\n\t}\n\n\tconst label =\n\t\tmode === 'visual' ? __( 'Edit as HTML' ) : __( 'Edit visually' );\n\n\treturn <MenuItem onClick={ onToggleMode }>{ ! small && label }</MenuItem>;\n}\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst { getBlock, getBlockMode, getSettings } =\n\t\t\tselect( blockEditorStore );\n\t\tconst block = getBlock( clientId );\n\t\tconst isCodeEditingEnabled = getSettings().codeEditingEnabled;\n\n\t\treturn {\n\t\t\tmode: getBlockMode( clientId ),\n\t\t\tblockType: block ? getBlockType( block.name ) : null,\n\t\t\tisCodeEditingEnabled,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { onToggle = noop, clientId } ) => ( {\n\t\tonToggleMode() {\n\t\t\tdispatch( blockEditorStore ).toggleBlockMode( clientId );\n\t\t\tonToggle();\n\t\t},\n\t} ) ),\n] )( BlockModeToggle );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-mode-toggle.js"],"names":["noop","BlockModeToggle","blockType","mode","onToggleMode","small","isCodeEditingEnabled","label","select","clientId","getBlock","getBlockMode","getSettings","blockEditorStore","block","codeEditingEnabled","name","dispatch","onToggle","toggleBlockMode"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,eAAT,OAMH;AAAA,MAN6B;AAChCC,IAAAA,SADgC;AAEhCC,IAAAA,IAFgC;AAGhCC,IAAAA,YAHgC;AAIhCC,IAAAA,KAAK,GAAG,KAJwB;AAKhCC,IAAAA,oBAAoB,GAAG;AALS,GAM7B;;AACH,MACC,CAAEJ,SAAF,IACA,CAAE,6BAAiBA,SAAjB,EAA4B,MAA5B,EAAoC,IAApC,CADF,IAEA,CAAEI,oBAHH,EAIE;AACD,WAAO,IAAP;AACA;;AAED,QAAMC,KAAK,GACVJ,IAAI,KAAK,QAAT,GAAoB,cAAI,cAAJ,CAApB,GAA2C,cAAI,eAAJ,CAD5C;AAGA,SAAO,4BAAC,oBAAD;AAAU,IAAA,OAAO,EAAGC;AAApB,KAAqC,CAAEC,KAAF,IAAWE,KAAhD,CAAP;AACA;;eAEc,sBAAS,CACvB,sBAAY,CAAEC,MAAF,YAA4B;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AACvC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,YAAZ;AAA0BC,IAAAA;AAA1B,MACLJ,MAAM,CAAEK,YAAF,CADP;AAEA,QAAMC,KAAK,GAAGJ,QAAQ,CAAED,QAAF,CAAtB;AACA,QAAMH,oBAAoB,GAAGM,WAAW,GAAGG,kBAA3C;AAEA,SAAO;AACNZ,IAAAA,IAAI,EAAEQ,YAAY,CAAEF,QAAF,CADZ;AAENP,IAAAA,SAAS,EAAEY,KAAK,GAAG,0BAAcA,KAAK,CAACE,IAApB,CAAH,GAAgC,IAF1C;AAGNV,IAAAA;AAHM,GAAP;AAKA,CAXD,CADuB,EAavB,wBAAc,CAAEW,QAAF;AAAA,MAAY;AAAEC,IAAAA,QAAQ,GAAGlB,IAAb;AAAmBS,IAAAA;AAAnB,GAAZ;AAAA,SAAiD;AAC9DL,IAAAA,YAAY,GAAG;AACda,MAAAA,QAAQ,CAAEJ,YAAF,CAAR,CAA6BM,eAA7B,CAA8CV,QAA9C;AACAS,MAAAA,QAAQ;AACR;;AAJ6D,GAAjD;AAAA,CAAd,CAbuB,CAAT,EAmBVjB,eAnBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\n\nexport function BlockModeToggle( {\n\tblockType,\n\tmode,\n\tonToggleMode,\n\tsmall = false,\n\tisCodeEditingEnabled = true,\n} ) {\n\tif (\n\t\t! blockType ||\n\t\t! hasBlockSupport( blockType, 'html', true ) ||\n\t\t! isCodeEditingEnabled\n\t) {\n\t\treturn null;\n\t}\n\n\tconst label =\n\t\tmode === 'visual' ? __( 'Edit as HTML' ) : __( 'Edit visually' );\n\n\treturn <MenuItem onClick={ onToggleMode }>{ ! small && label }</MenuItem>;\n}\n\nexport default compose( [\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst { getBlock, getBlockMode, getSettings } =\n\t\t\tselect( blockEditorStore );\n\t\tconst block = getBlock( clientId );\n\t\tconst isCodeEditingEnabled = getSettings().codeEditingEnabled;\n\n\t\treturn {\n\t\t\tmode: getBlockMode( clientId ),\n\t\t\tblockType: block ? getBlockType( block.name ) : null,\n\t\t\tisCodeEditingEnabled,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { onToggle = noop, clientId } ) => ( {\n\t\tonToggleMode() {\n\t\t\tdispatch( blockEditorStore ).toggleBlockMode( clientId );\n\t\t\tonToggle();\n\t\t},\n\t} ) ),\n] )( BlockModeToggle );\n"]}
@@ -140,7 +140,10 @@ function BlockSettingsDropdown(_ref2) {
140
140
  __experimentalSelectBlock(ids[0]);
141
141
  }
142
142
  } : noop, [__experimentalSelectBlock]);
143
- const blockTitle = (0, _useBlockDisplayTitle.default)(firstBlockClientId, 25);
143
+ const blockTitle = (0, _useBlockDisplayTitle.default)({
144
+ clientId: firstBlockClientId,
145
+ maximumLength: 25
146
+ });
144
147
  const updateSelectionAfterRemove = (0, _element.useCallback)(__experimentalSelectBlock ? () => {
145
148
  const blockToSelect = previousBlockClientId || nextBlockClientId;
146
149
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"names":["noop","POPOVER_PROPS","className","position","isAlternate","CopyMenuItem","blocks","onCopy","ref","copyMenuItemLabel","length","BlockSettingsDropdown","clientIds","__experimentalSelectBlock","children","props","blockClientIds","count","firstBlockClientId","firstParentClientId","hasReducedUI","onlyBlock","parentBlockType","previousBlockClientId","nextBlockClientId","selectedBlockClientIds","select","getBlockCount","getBlockName","getBlockParents","getPreviousBlockClientId","getNextBlockClientId","getSelectedBlockClientIds","getSettings","blockEditorStore","parents","_firstParentClientId","parentBlockName","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","duplicate","remove","insertAfter","insertBefore","selectBlock","toggleBlockHighlight","updateSelectionAfterDuplicate","clientIdsPromise","ids","blockTitle","updateSelectionAfterRemove","blockToSelect","includes","label","removeBlockLabel","selectParentButtonRef","gestures","showParentOutlineGestures","onChange","isFocused","canDuplicate","canInsertDefaultBlock","canMove","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onMoveTo","moreVertical","onClose","undefined","icon","title","Children","map","child"],"mappings":";;;;;;;;;;AAYA;;;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAjCA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;AAWA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,2CADU;AAErBC,EAAAA,QAAQ,EAAE,cAFW;AAGrBC,EAAAA,WAAW,EAAE;AAHQ,CAAtB;;AAMA,SAASC,YAAT,OAA4C;AAAA,MAArB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAqB;AAC3C,QAAMC,GAAG,GAAG,iCAAoB,MAAM,uBAAWF,MAAX,CAA1B,EAA+CC,MAA/C,CAAZ;AACA,QAAME,iBAAiB,GACtBH,MAAM,CAACI,MAAP,GAAgB,CAAhB,GAAoB,cAAI,aAAJ,CAApB,GAA0C,cAAI,YAAJ,CAD3C;AAEA,SAAO,4BAAC,oBAAD;AAAU,IAAA,GAAG,EAAGF;AAAhB,KAAwBC,iBAAxB,CAAP;AACA;;AAEM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EAAGC,kBADZ;AAEC,QAAA,QAAQ,EAAGqD;AAFZ,QA3EF,CADD,EAkFC,4BAAC,kCAAD,CAA2B,IAA3B;AACC,QAAA,SAAS,EAAG;AAAEA,UAAAA;AAAF,SADb;AAEC,QAAA,SAAS,EAAG3D;AAFb,QAlFD,EAsFG,OAAOE,QAAP,KAAoB,UAApB,GACCA,QAAQ,CAAE;AAAEyD,QAAAA;AAAF,OAAF,CADT,GAECI,kBAASC,GAAT,CAAgBC,KAAF,IACd,2BAAcA,KAAd,EAAqB;AAAEN,QAAAA;AAAF,OAArB,CADA,CAxFJ,EA2FGP,SAAS,IACV,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,QAAA,OAAO,EAAG,kBACTO,OADS,EAETH,QAFS,EAGTjB,0BAHS,CADX;AAMC,QAAA,QAAQ,EAAGb,SAAS,CAACI;AANtB,SAQGa,gBARH,CADD,CA5FF,CADC;AAAA,KARH,CAbC;AAAA,GAJH,CADD;AA0IA;;eAEc5C,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, flow } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockType, serialize } from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tChildren,\n\tcloneElement,\n\tuseCallback,\n\tuseRef,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useCopyToClipboard } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport BlockIcon from '../block-icon';\nimport BlockModeToggle from './block-mode-toggle';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useShowMoversGestures } from '../block-toolbar/utils';\n\nconst noop = () => {};\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tposition: 'bottom right',\n\tisAlternate: true,\n};\n\nfunction CopyMenuItem( { blocks, onCopy } ) {\n\tconst ref = useCopyToClipboard( () => serialize( blocks ), onCopy );\n\tconst copyMenuItemLabel =\n\t\tblocks.length > 1 ? __( 'Copy blocks' ) : __( 'Copy block' );\n\treturn <MenuItem ref={ ref }>{ copyMenuItemLabel }</MenuItem>;\n}\n\nexport function BlockSettingsDropdown( {\n\tclientIds,\n\t__experimentalSelectBlock,\n\tchildren,\n\t...props\n} ) {\n\tconst blockClientIds = castArray( clientIds );\n\tconst count = blockClientIds.length;\n\tconst firstBlockClientId = blockClientIds[ 0 ];\n\tconst {\n\t\tfirstParentClientId,\n\t\thasReducedUI,\n\t\tonlyBlock,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tnextBlockClientId,\n\t\tselectedBlockClientIds,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst parents = getBlockParents( firstBlockClientId );\n\t\t\tconst _firstParentClientId = parents[ parents.length - 1 ];\n\t\t\tconst parentBlockName = getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\thasReducedUI: getSettings().hasReducedUI,\n\t\t\t\tonlyBlock: 1 === getBlockCount(),\n\t\t\t\tparentBlockType: getBlockType( parentBlockName ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tnextBlockClientId: getNextBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\n\tconst shortcuts = useSelect( ( select ) => {\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\treturn {\n\t\t\tduplicate: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/duplicate'\n\t\t\t),\n\t\t\tremove: getShortcutRepresentation( 'core/block-editor/remove' ),\n\t\t\tinsertAfter: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-after'\n\t\t\t),\n\t\t\tinsertBefore: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-before'\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { selectBlock, toggleBlockHighlight } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst updateSelectionAfterDuplicate = useCallback(\n\t\t__experimentalSelectBlock\n\t\t\t? async ( clientIdsPromise ) => {\n\t\t\t\t\tconst ids = await clientIdsPromise;\n\t\t\t\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t\t\t\t__experimentalSelectBlock( ids[ 0 ] );\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: noop,\n\t\t[ __experimentalSelectBlock ]\n\t);\n\n\tconst blockTitle = useBlockDisplayTitle( firstBlockClientId, 25 );\n\n\tconst updateSelectionAfterRemove = useCallback(\n\t\t__experimentalSelectBlock\n\t\t\t? () => {\n\t\t\t\t\tconst blockToSelect =\n\t\t\t\t\t\tpreviousBlockClientId || nextBlockClientId;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblockToSelect &&\n\t\t\t\t\t\t// From the block options dropdown, it's possible to remove a block that is not selected,\n\t\t\t\t\t\t// in this case, it's not necessary to update the selection since the selected block wasn't removed.\n\t\t\t\t\t\tselectedBlockClientIds.includes( firstBlockClientId ) &&\n\t\t\t\t\t\t// Don't update selection when next/prev block also is in the selection ( and gets removed ),\n\t\t\t\t\t\t// In case someone selects all blocks and removes them at once.\n\t\t\t\t\t\t! selectedBlockClientIds.includes( blockToSelect )\n\t\t\t\t\t) {\n\t\t\t\t\t\t__experimentalSelectBlock( blockToSelect );\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: noop,\n\t\t[\n\t\t\t__experimentalSelectBlock,\n\t\t\tpreviousBlockClientId,\n\t\t\tnextBlockClientId,\n\t\t\tselectedBlockClientIds,\n\t\t]\n\t);\n\n\tconst label = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tblockTitle\n\t);\n\tconst removeBlockLabel = count === 1 ? label : __( 'Remove blocks' );\n\n\t// Allows highlighting the parent block outline when focusing or hovering\n\t// the parent block selector within the child.\n\tconst selectParentButtonRef = useRef();\n\tconst { gestures: showParentOutlineGestures } = useShowMoversGestures( {\n\t\tref: selectParentButtonRef,\n\t\tonChange( isFocused ) {\n\t\t\tif ( isFocused && hasReducedUI ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttoggleBlockHighlight( firstParentClientId, isFocused );\n\t\t},\n\t} );\n\n\treturn (\n\t\t<BlockActions\n\t\t\tclientIds={ clientIds }\n\t\t\t__experimentalUpdateSelection={ ! __experimentalSelectBlock }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertDefaultBlock,\n\t\t\t\tcanMove,\n\t\t\t\tcanRemove,\n\t\t\t\tonDuplicate,\n\t\t\t\tonInsertAfter,\n\t\t\t\tonInsertBefore,\n\t\t\t\tonRemove,\n\t\t\t\tonCopy,\n\t\t\t\tonMoveTo,\n\t\t\t\tblocks,\n\t\t\t} ) => (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\tnoIcons\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ firstParentClientId !== undefined && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t{ ...showParentOutlineGestures }\n\t\t\t\t\t\t\t\t\t\tref={ selectParentButtonRef }\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ parentBlockType.icon }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tselectBlock( firstParentClientId )\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\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block's parent. */\n\t\t\t\t\t\t\t\t\t\t\t__( 'Select parent block (%s)' ),\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType.title\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\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\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.duplicate }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ canInsertDefaultBlock && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertBefore }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Insert before' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertAfter }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Insert after' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\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\t{ canMove && ! onlyBlock && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ flow( onClose, onMoveTo ) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Move to' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t<BlockModeToggle\n\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\n\t\t\t\t\t\t\t\t\t\tonToggle={ onClose }\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</MenuGroup>\n\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.remove }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ removeBlockLabel }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</BlockActions>\n\t);\n}\n\nexport default BlockSettingsDropdown;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"names":["noop","POPOVER_PROPS","className","position","isAlternate","CopyMenuItem","blocks","onCopy","ref","copyMenuItemLabel","length","BlockSettingsDropdown","clientIds","__experimentalSelectBlock","children","props","blockClientIds","count","firstBlockClientId","firstParentClientId","hasReducedUI","onlyBlock","parentBlockType","previousBlockClientId","nextBlockClientId","selectedBlockClientIds","select","getBlockCount","getBlockName","getBlockParents","getPreviousBlockClientId","getNextBlockClientId","getSelectedBlockClientIds","getSettings","blockEditorStore","parents","_firstParentClientId","parentBlockName","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","duplicate","remove","insertAfter","insertBefore","selectBlock","toggleBlockHighlight","updateSelectionAfterDuplicate","clientIdsPromise","ids","blockTitle","clientId","maximumLength","updateSelectionAfterRemove","blockToSelect","includes","label","removeBlockLabel","selectParentButtonRef","gestures","showParentOutlineGestures","onChange","isFocused","canDuplicate","canInsertDefaultBlock","canMove","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onMoveTo","moreVertical","onClose","undefined","icon","title","Children","map","child"],"mappings":";;;;;;;;;;AAYA;;;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAOA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAjCA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;AAWA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,2CADU;AAErBC,EAAAA,QAAQ,EAAE,cAFW;AAGrBC,EAAAA,WAAW,EAAE;AAHQ,CAAtB;;AAMA,SAASC,YAAT,OAA4C;AAAA,MAArB;AAAEC,IAAAA,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J,CAPH,CADD,EAUC,4BAAC,oBAAD;AACC,QAAA,OAAO,EAAG,kBACT6B,OADS,EAETL,aAFS,CADX;AAKC,QAAA,QAAQ,EAAG9B,SAAS,CAACK;AALtB,SAOG,cAAI,cAAJ,CAPH,CAVD,CA9CF,EAmEGsB,OAAO,IAAI,CAAE5C,SAAb,IACD,4BAAC,oBAAD;AACC,QAAA,OAAO,EAAG,kBAAMoD,OAAN,EAAeF,QAAf;AADX,SAGG,cAAI,SAAJ,CAHH,CApEF,EA0EGtD,KAAK,KAAK,CAAV,IACD,4BAAC,wBAAD;AACC,QAAA,QAAQ,EAAGC,kBADZ;AAEC,QAAA,QAAQ,EAAGuD;AAFZ,QA3EF,CADD,EAkFC,4BAAC,kCAAD,CAA2B,IAA3B;AACC,QAAA,SAAS,EAAG;AAAEA,UAAAA;AAAF,SADb;AAEC,QAAA,SAAS,EAAG7D;AAFb,QAlFD,EAsFG,OAAOE,QAAP,KAAoB,UAApB,GACCA,QAAQ,CAAE;AAAE2D,QAAAA;AAAF,OAAF,CADT,GAECI,kBAASC,GAAT,CAAgBC,KAAF,IACd,2BAAcA,KAAd,EAAqB;AAAEN,QAAAA;AAAF,OAArB,CADA,CAxFJ,EA2FGP,SAAS,IACV,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,QAAA,OAAO,EAAG,kBACTO,OADS,EAETH,QAFS,EAGTjB,0BAHS,CADX;AAMC,QAAA,QAAQ,EAAGf,SAAS,CAACI;AANtB,SAQGe,gBARH,CADD,CA5FF,CADC;AAAA,KARH,CAbC;AAAA,GAJH,CADD;AA0IA;;eAEc9C,qB","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, flow } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockType, serialize } from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tChildren,\n\tcloneElement,\n\tuseCallback,\n\tuseRef,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useCopyToClipboard } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport BlockIcon from '../block-icon';\nimport BlockModeToggle from './block-mode-toggle';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useShowMoversGestures } from '../block-toolbar/utils';\n\nconst noop = () => {};\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tposition: 'bottom right',\n\tisAlternate: true,\n};\n\nfunction CopyMenuItem( { blocks, onCopy } ) {\n\tconst ref = useCopyToClipboard( () => serialize( blocks ), onCopy );\n\tconst copyMenuItemLabel =\n\t\tblocks.length > 1 ? __( 'Copy blocks' ) : __( 'Copy block' );\n\treturn <MenuItem ref={ ref }>{ copyMenuItemLabel }</MenuItem>;\n}\n\nexport function BlockSettingsDropdown( {\n\tclientIds,\n\t__experimentalSelectBlock,\n\tchildren,\n\t...props\n} ) {\n\tconst blockClientIds = castArray( clientIds );\n\tconst count = blockClientIds.length;\n\tconst firstBlockClientId = blockClientIds[ 0 ];\n\tconst {\n\t\tfirstParentClientId,\n\t\thasReducedUI,\n\t\tonlyBlock,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tnextBlockClientId,\n\t\tselectedBlockClientIds,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst parents = getBlockParents( firstBlockClientId );\n\t\t\tconst _firstParentClientId = parents[ parents.length - 1 ];\n\t\t\tconst parentBlockName = getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\thasReducedUI: getSettings().hasReducedUI,\n\t\t\t\tonlyBlock: 1 === getBlockCount(),\n\t\t\t\tparentBlockType: getBlockType( parentBlockName ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tnextBlockClientId: getNextBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\n\tconst shortcuts = useSelect( ( select ) => {\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\treturn {\n\t\t\tduplicate: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/duplicate'\n\t\t\t),\n\t\t\tremove: getShortcutRepresentation( 'core/block-editor/remove' ),\n\t\t\tinsertAfter: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-after'\n\t\t\t),\n\t\t\tinsertBefore: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-before'\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { selectBlock, toggleBlockHighlight } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst updateSelectionAfterDuplicate = useCallback(\n\t\t__experimentalSelectBlock\n\t\t\t? async ( clientIdsPromise ) => {\n\t\t\t\t\tconst ids = await clientIdsPromise;\n\t\t\t\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t\t\t\t__experimentalSelectBlock( ids[ 0 ] );\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: noop,\n\t\t[ __experimentalSelectBlock ]\n\t);\n\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: firstBlockClientId,\n\t\tmaximumLength: 25,\n\t} );\n\n\tconst updateSelectionAfterRemove = useCallback(\n\t\t__experimentalSelectBlock\n\t\t\t? () => {\n\t\t\t\t\tconst blockToSelect =\n\t\t\t\t\t\tpreviousBlockClientId || nextBlockClientId;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tblockToSelect &&\n\t\t\t\t\t\t// From the block options dropdown, it's possible to remove a block that is not selected,\n\t\t\t\t\t\t// in this case, it's not necessary to update the selection since the selected block wasn't removed.\n\t\t\t\t\t\tselectedBlockClientIds.includes( firstBlockClientId ) &&\n\t\t\t\t\t\t// Don't update selection when next/prev block also is in the selection ( and gets removed ),\n\t\t\t\t\t\t// In case someone selects all blocks and removes them at once.\n\t\t\t\t\t\t! selectedBlockClientIds.includes( blockToSelect )\n\t\t\t\t\t) {\n\t\t\t\t\t\t__experimentalSelectBlock( blockToSelect );\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t: noop,\n\t\t[\n\t\t\t__experimentalSelectBlock,\n\t\t\tpreviousBlockClientId,\n\t\t\tnextBlockClientId,\n\t\t\tselectedBlockClientIds,\n\t\t]\n\t);\n\n\tconst label = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tblockTitle\n\t);\n\tconst removeBlockLabel = count === 1 ? label : __( 'Remove blocks' );\n\n\t// Allows highlighting the parent block outline when focusing or hovering\n\t// the parent block selector within the child.\n\tconst selectParentButtonRef = useRef();\n\tconst { gestures: showParentOutlineGestures } = useShowMoversGestures( {\n\t\tref: selectParentButtonRef,\n\t\tonChange( isFocused ) {\n\t\t\tif ( isFocused && hasReducedUI ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttoggleBlockHighlight( firstParentClientId, isFocused );\n\t\t},\n\t} );\n\n\treturn (\n\t\t<BlockActions\n\t\t\tclientIds={ clientIds }\n\t\t\t__experimentalUpdateSelection={ ! __experimentalSelectBlock }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertDefaultBlock,\n\t\t\t\tcanMove,\n\t\t\t\tcanRemove,\n\t\t\t\tonDuplicate,\n\t\t\t\tonInsertAfter,\n\t\t\t\tonInsertBefore,\n\t\t\t\tonRemove,\n\t\t\t\tonCopy,\n\t\t\t\tonMoveTo,\n\t\t\t\tblocks,\n\t\t\t} ) => (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\tnoIcons\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ firstParentClientId !== undefined && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t{ ...showParentOutlineGestures }\n\t\t\t\t\t\t\t\t\t\tref={ selectParentButtonRef }\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\t\t\t\t\t\ticon={ parentBlockType.icon }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tselectBlock( firstParentClientId )\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\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Name of the block's parent. */\n\t\t\t\t\t\t\t\t\t\t\t__( 'Select parent block (%s)' ),\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType.title\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\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\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.duplicate }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ canInsertDefaultBlock && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertBefore }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Insert before' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertAfter }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Insert after' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\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\t{ canMove && ! onlyBlock && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ flow( onClose, onMoveTo ) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Move to' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t<BlockModeToggle\n\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\n\t\t\t\t\t\t\t\t\t\tonToggle={ onClose }\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</MenuGroup>\n\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ flow(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.remove }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ removeBlockLabel }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</BlockActions>\n\t);\n}\n\nexport default BlockSettingsDropdown;\n"]}
@@ -56,7 +56,7 @@ const BlockSettingsMenuControlsSlot = _ref => {
56
56
  } = select(_store.store);
57
57
  const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds();
58
58
  return {
59
- selectedBlocks: (0, _lodash.map)((0, _lodash.compact)(getBlocksByClientId(ids)), block => block.name),
59
+ selectedBlocks: (0, _lodash.map)(getBlocksByClientId(ids).filter(Boolean), block => block.name),
60
60
  selectedClientIds: ids,
61
61
  canRemove: canRemoveBlocks(ids)
62
62
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-settings-menu-controls/index.js"],"names":["Fill","Slot","BlockSettingsMenuControlsSlot","fillProps","clientIds","selectedBlocks","selectedClientIds","canRemove","select","getBlocksByClientId","getSelectedBlockClientIds","canRemoveBlocks","blockEditorStore","ids","block","name","canLock","showLockButton","length","convertToGroupButtonProps","isGroupable","isUngroupable","showConvertToGroupButton","fills","onClose","BlockSettingsMenuControls","props","document"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAKA;;AAIA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAQ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;AAAhC;AAAlB,KACKiB,KAAF,IAAa;AACd,QACC,EAAEA,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEL,MAAT,IAAkB,CAAlB,IACA,CAAEI,wBADF,IAEA,CAAEL,cAHH,EAIE;AACD,aAAO,IAAP;AACA;;AAED,WACC,4BAAC,qBAAD,QACGA,cAAc,IACf,4BAAC,4BAAD;AACC,MAAA,QAAQ,EAAGX,iBAAiB,CAAE,CAAF;AAD7B,MAFF,EAMGiB,KANH,EAOGD,wBAAwB,IACzB,4BAAC,2CAAD,6BACMH,yBADN;AAEC,MAAA,OAAO,EAAGhB,SAAH,aAAGA,SAAH,uBAAGA,SAAS,CAAEqB;AAFtB,OARF,CADD;AAgBA,GA1BF,CADD;AA8BA,CA9DD;AAgEA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,yBAAT,QAAmD;AAAA,MAAf,EAAE,GAAGC;AAAL,GAAe;AAClD,SACC,4BAAC,uCAAD;AAAe,IAAA,QAAQ,EAAGC;AAA1B,KACC,4BAAC,IAAD,EAAWD,KAAX,CADD,CADD;AAKA;;AAEDD,yBAAyB,CAACxB,IAA1B,GAAiCC,6BAAjC;eAEeuB,yB","sourcesContent":["/**\n * External dependencies\n */\nimport { compact, map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateSlotFill,\n\tMenuGroup,\n\t__experimentalStyleProvider as StyleProvider,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseConvertToGroupButtonProps,\n\tConvertToGroupButton,\n} from '../convert-to-group-buttons';\nimport { BlockLockMenuItem, useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'BlockSettingsMenuControls' );\n\nconst BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {\n\tconst { selectedBlocks, selectedClientIds, canRemove } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst ids =\n\t\t\t\tclientIds !== null ? clientIds : getSelectedBlockClientIds();\n\t\t\treturn {\n\t\t\t\tselectedBlocks: map(\n\t\t\t\t\tcompact( getBlocksByClientId( ids ) ),\n\t\t\t\t\t( block ) => block.name\n\t\t\t\t),\n\t\t\t\tselectedClientIds: ids,\n\t\t\t\tcanRemove: canRemoveBlocks( ids ),\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tconst { canLock } = useBlockLock( selectedClientIds[ 0 ] );\n\tconst showLockButton = selectedClientIds.length === 1 && canLock;\n\n\t// Check if current selection of blocks is Groupable or Ungroupable\n\t// and pass this props down to ConvertToGroupButton.\n\tconst convertToGroupButtonProps = useConvertToGroupButtonProps();\n\tconst { isGroupable, isUngroupable } = convertToGroupButtonProps;\n\tconst showConvertToGroupButton =\n\t\t( isGroupable || isUngroupable ) && canRemove;\n\n\treturn (\n\t\t<Slot fillProps={ { ...fillProps, selectedBlocks, selectedClientIds } }>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif (\n\t\t\t\t\t! fills?.length > 0 &&\n\t\t\t\t\t! showConvertToGroupButton &&\n\t\t\t\t\t! showLockButton\n\t\t\t\t) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ showLockButton && (\n\t\t\t\t\t\t\t<BlockLockMenuItem\n\t\t\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t{ showConvertToGroupButton && (\n\t\t\t\t\t\t\t<ConvertToGroupButton\n\t\t\t\t\t\t\t\t{ ...convertToGroupButtonProps }\n\t\t\t\t\t\t\t\tonClose={ fillProps?.onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Slot>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md\n *\n * @param {Object} props Fill props.\n * @return {WPElement} Element.\n */\nfunction BlockSettingsMenuControls( { ...props } ) {\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill { ...props } />\n\t\t</StyleProvider>\n\t);\n}\n\nBlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot;\n\nexport default BlockSettingsMenuControls;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-settings-menu-controls/index.js"],"names":["Fill","Slot","BlockSettingsMenuControlsSlot","fillProps","clientIds","selectedBlocks","selectedClientIds","canRemove","select","getBlocksByClientId","getSelectedBlockClientIds","canRemoveBlocks","blockEditorStore","ids","filter","Boolean","block","name","canLock","showLockButton","length","convertToGroupButtonProps","isGroupable","isUngroupable","showConvertToGroupButton","fills","onClose","BlockSettingsMenuControls","props","document"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAKA;;AAIA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAQA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,2BAAhB,CAAvB;;AAEA,MAAMC,6BAA6B,GAAG,QAAuC;AAAA,MAArC;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,SAAS,GAAG;AAAzB,GAAqC;AAC5E,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,iBAAlB;AAAqCC,IAAAA;AAArC,MAAmD,qBACtDC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,mBADK;AAELC,MAAAA,yBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,YAAF,CAJV;AAKA,UAAMC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BAAGA,SAAS,CAAEuB;AAFtB,OARF,CADD;AAgBA,GA1BF,CADD;AA8BA,CA9DD;AAgEA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,yBAAT,QAAmD;AAAA,MAAf,EAAE,GAAGC;AAAL,GAAe;AAClD,SACC,4BAAC,uCAAD;AAAe,IAAA,QAAQ,EAAGC;AAA1B,KACC,4BAAC,IAAD,EAAWD,KAAX,CADD,CADD;AAKA;;AAEDD,yBAAyB,CAAC1B,IAA1B,GAAiCC,6BAAjC;eAEeyB,yB","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreateSlotFill,\n\tMenuGroup,\n\t__experimentalStyleProvider as StyleProvider,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseConvertToGroupButtonProps,\n\tConvertToGroupButton,\n} from '../convert-to-group-buttons';\nimport { BlockLockMenuItem, useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'BlockSettingsMenuControls' );\n\nconst BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {\n\tconst { selectedBlocks, selectedClientIds, canRemove } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst ids =\n\t\t\t\tclientIds !== null ? clientIds : getSelectedBlockClientIds();\n\t\t\treturn {\n\t\t\t\tselectedBlocks: map(\n\t\t\t\t\tgetBlocksByClientId( ids ).filter( Boolean ),\n\t\t\t\t\t( block ) => block.name\n\t\t\t\t),\n\t\t\t\tselectedClientIds: ids,\n\t\t\t\tcanRemove: canRemoveBlocks( ids ),\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\n\tconst { canLock } = useBlockLock( selectedClientIds[ 0 ] );\n\tconst showLockButton = selectedClientIds.length === 1 && canLock;\n\n\t// Check if current selection of blocks is Groupable or Ungroupable\n\t// and pass this props down to ConvertToGroupButton.\n\tconst convertToGroupButtonProps = useConvertToGroupButtonProps();\n\tconst { isGroupable, isUngroupable } = convertToGroupButtonProps;\n\tconst showConvertToGroupButton =\n\t\t( isGroupable || isUngroupable ) && canRemove;\n\n\treturn (\n\t\t<Slot fillProps={ { ...fillProps, selectedBlocks, selectedClientIds } }>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif (\n\t\t\t\t\t! fills?.length > 0 &&\n\t\t\t\t\t! showConvertToGroupButton &&\n\t\t\t\t\t! showLockButton\n\t\t\t\t) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ showLockButton && (\n\t\t\t\t\t\t\t<BlockLockMenuItem\n\t\t\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t{ showConvertToGroupButton && (\n\t\t\t\t\t\t\t<ConvertToGroupButton\n\t\t\t\t\t\t\t\t{ ...convertToGroupButtonProps }\n\t\t\t\t\t\t\t\tonClose={ fillProps?.onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Slot>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md\n *\n * @param {Object} props Fill props.\n * @return {WPElement} Element.\n */\nfunction BlockSettingsMenuControls( { ...props } ) {\n\treturn (\n\t\t<StyleProvider document={ document }>\n\t\t\t<Fill { ...props } />\n\t\t</StyleProvider>\n\t);\n}\n\nBlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot;\n\nexport default BlockSettingsMenuControls;\n"]}
@@ -130,12 +130,9 @@ function BlockStyles(_ref3) {
130
130
  onBlur: () => styleItemHandler(null),
131
131
  onClick: () => onSelectStylePreview(style),
132
132
  "aria-current": activeStyle.name === style.name
133
- }, (0, _element.createElement)(_components.__experimentalText, {
134
- as: "span",
135
- limit: 12,
136
- ellipsizeMode: "tail",
137
- className: "block-editor-block-styles__item-text",
138
- truncate: true
133
+ }, (0, _element.createElement)(_components.__experimentalTruncate, {
134
+ numberOfLines: 1,
135
+ className: "block-editor-block-styles__item-text"
139
136
  }, buttonText));
140
137
  })), hoveredStyle && !isMobileViewport && (0, _element.createElement)(BlockStylesPreviewPanelFill, {
141
138
  scope: scope,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/index.js"],"names":["BlockStylesPreviewPanelSlot","scope","BlockStylesPreviewPanelFill","children","props","DEFAULT_POSITION_TOP","noop","BlockStyles","clientId","onSwitch","onHoverClassName","onSelect","stylesToRender","activeStyle","genericPreviewBlock","className","previewClassName","hoveredStyle","setHoveredStyle","containerScrollTop","setContainerScrollTop","isMobileViewport","scrollContainer","document","querySelector","scrollTop","length","debouncedSetHoveredStyle","onSelectStylePreview","style","cancel","styleItemHandler","item","name","map","buttonText","label","top","Slot"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AACA;;AAUA;;AACA;;AAtBA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AAIA,SAASA,2BAAT,OAAkD;AAAA,MAAZ;AAAEC,IAAAA;AAAF,GAAY;AACjD,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,2BAA2BA,KAAO;AAAhD,IAAP;AACA;;AAED,SAASC,2BAAT,QAAsE;AAAA,MAAhC;AAAEC,IAAAA,QAAF;AAAYF,IAAAA,KAAZ;AAAmB,OAAGG;AAAtB,GAAgC;AACrE,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,2BAA2BH,KAAO;AAAhD,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AAC,8BAAD;AACC,MAAA,EAAE,EAAC,MADJ;AAEC,MAAA,KAAK,EAAG,EAFT;AAGC,MAAA,aAAa,EAAC,MAHf;AAIC,MAAA,SAAS,EAAC,sCAJX;AAKC,MAAA,QAAQ;AALT,OAOGE,UAPH,CAlBD,CADD;AA8BA,GAjCC,CADH,CADD,EAqCGlB,YAAY,IAAI,CAAEI,gBAAlB,IACD,4BAAC,2BAAD;AACC,IAAA,KAAK,EAAGpB,KADT;AAEC,IAAA,SAAS,EAAC,0CAFX;AAGC,IAAA,KAAK,EAAG;AAAEoC,MAAAA,GAAG,EAAElB;AAAP,KAHT;AAIC,IAAA,YAAY,EAAG,MAAMY,gBAAgB,CAAE,IAAF;AAJtC,KAMC,4BAAC,qBAAD;AACC,IAAA,WAAW,EAAGlB,WADf;AAEC,IAAA,SAAS,EAAGG,gBAFb;AAGC,IAAA,mBAAmB,EAAGF,mBAHvB;AAIC,IAAA,KAAK,EAAGG;AAJT,IAND,CAtCF,CADD;AAuDA;;AAEDV,WAAW,CAAC+B,IAAZ,GAAmBtC,2BAAnB;eACeO,W","sourcesContent":["/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useLayoutEffect } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\tSlot,\n\tFill,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockStylesPreviewPanel from './preview-panel';\nimport useStylesForBlocks from './use-styles-for-block';\n\nfunction BlockStylesPreviewPanelSlot( { scope } ) {\n\treturn <Slot name={ `BlockStylesPreviewPanel/${ scope }` } />;\n}\n\nfunction BlockStylesPreviewPanelFill( { children, scope, ...props } ) {\n\treturn (\n\t\t<Fill name={ `BlockStylesPreviewPanel/${ scope }` }>\n\t\t\t<div { ...props }>{ children }</div>\n\t\t</Fill>\n\t);\n}\n\n// Top position (in px) of the Block Styles container\n// relative to the editor pane.\n// The value is the equivalent of the container's right position.\nconst DEFAULT_POSITION_TOP = 16;\n\nconst noop = () => {};\n\n// Block Styles component for the Settings Sidebar.\nfunction BlockStyles( {\n\tclientId,\n\tonSwitch = noop,\n\tonHoverClassName = noop,\n\tscope,\n} ) {\n\tconst {\n\t\tonSelect,\n\t\tstylesToRender,\n\t\tactiveStyle,\n\t\tgenericPreviewBlock,\n\t\tclassName: previewClassName,\n\t} = useStylesForBlocks( {\n\t\tclientId,\n\t\tonSwitch,\n\t} );\n\tconst [ hoveredStyle, setHoveredStyle ] = useState( null );\n\tconst [ containerScrollTop, setContainerScrollTop ] = useState( 0 );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tuseLayoutEffect( () => {\n\t\tconst scrollContainer = document.querySelector(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tconst scrollTop = scrollContainer?.scrollTop || 0;\n\t\tsetContainerScrollTop( scrollTop + DEFAULT_POSITION_TOP );\n\t}, [ hoveredStyle ] );\n\n\tif ( ! stylesToRender || stylesToRender.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst debouncedSetHoveredStyle = debounce( setHoveredStyle, 250 );\n\n\tconst onSelectStylePreview = ( style ) => {\n\t\tonSelect( style );\n\t\tonHoverClassName( null );\n\t\tsetHoveredStyle( null );\n\t\tdebouncedSetHoveredStyle.cancel();\n\t};\n\n\tconst styleItemHandler = ( item ) => {\n\t\tif ( hoveredStyle === item ) {\n\t\t\tdebouncedSetHoveredStyle.cancel();\n\t\t\treturn;\n\t\t}\n\t\tdebouncedSetHoveredStyle( item );\n\t\tonHoverClassName( item?.name ?? null );\n\t};\n\n\treturn (\n\t\t<div className=\"block-editor-block-styles\">\n\t\t\t<div className=\"block-editor-block-styles__variants\">\n\t\t\t\t{ stylesToRender.map( ( style ) => {\n\t\t\t\t\tconst buttonText = style.label || style.name;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'block-editor-block-styles__item',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-active':\n\t\t\t\t\t\t\t\t\t\tactiveStyle.name === style.name,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tkey={ style.name }\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tlabel={ buttonText }\n\t\t\t\t\t\t\tonMouseEnter={ () => styleItemHandler( style ) }\n\t\t\t\t\t\t\tonFocus={ () => styleItemHandler( style ) }\n\t\t\t\t\t\t\tonMouseLeave={ () => styleItemHandler( null ) }\n\t\t\t\t\t\t\tonBlur={ () => styleItemHandler( null ) }\n\t\t\t\t\t\t\tonClick={ () => onSelectStylePreview( style ) }\n\t\t\t\t\t\t\taria-current={ activeStyle.name === style.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tas=\"span\"\n\t\t\t\t\t\t\t\tlimit={ 12 }\n\t\t\t\t\t\t\t\tellipsizeMode=\"tail\"\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-styles__item-text\"\n\t\t\t\t\t\t\t\ttruncate\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ buttonText }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t\t{ hoveredStyle && ! isMobileViewport && (\n\t\t\t\t<BlockStylesPreviewPanelFill\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\tclassName=\"block-editor-block-styles__preview-panel\"\n\t\t\t\t\tstyle={ { top: containerScrollTop } }\n\t\t\t\t\tonMouseLeave={ () => styleItemHandler( null ) }\n\t\t\t\t>\n\t\t\t\t\t<BlockStylesPreviewPanel\n\t\t\t\t\t\tactiveStyle={ activeStyle }\n\t\t\t\t\t\tclassName={ previewClassName }\n\t\t\t\t\t\tgenericPreviewBlock={ genericPreviewBlock }\n\t\t\t\t\t\tstyle={ hoveredStyle }\n\t\t\t\t\t/>\n\t\t\t\t</BlockStylesPreviewPanelFill>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nBlockStyles.Slot = BlockStylesPreviewPanelSlot;\nexport default BlockStyles;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/index.js"],"names":["BlockStylesPreviewPanelSlot","scope","BlockStylesPreviewPanelFill","children","props","DEFAULT_POSITION_TOP","noop","BlockStyles","clientId","onSwitch","onHoverClassName","onSelect","stylesToRender","activeStyle","genericPreviewBlock","className","previewClassName","hoveredStyle","setHoveredStyle","containerScrollTop","setContainerScrollTop","isMobileViewport","scrollContainer","document","querySelector","scrollTop","length","debouncedSetHoveredStyle","onSelectStylePreview","style","cancel","styleItemHandler","item","name","map","buttonText","label","top","Slot"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AACA;;AAUA;;AACA;;AAtBA;AACA;AACA;;AAIA;AACA;AACA;;AAUA;AACA;AACA;AAIA,SAASA,2BAAT,OAAkD;AAAA,MAAZ;AAAEC,IAAAA;AAAF,GAAY;AACjD,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,2BAA2BA,KAAO;AAAhD,IAAP;AACA;;AAED,SAASC,2BAAT,QAAsE;AAAA,MAAhC;AAAEC,IAAAA,QAAF;AAAYF,IAAAA,KAAZ;AAAmB,OAAGG;AAAtB,GAAgC;AACrE,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,2BAA2BH,KAAO;AAAhD,KACC,mCAAUG,KAAV,EAAoBD,QAApB,CADD,CADD;AAKA,C,CAED;AACA;AACA;;;AACA,MAAME,oBAAoB,GAAG,EAA7B;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB,C,CAEA;;;AACA,SAASC,WAAT,QAKI;AAAA,MALkB;AACrBC,IAAAA,QADqB;AAErBC,IAAAA,QAAQ,GAAGH,IA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,IAAA,KAAK,EAAG;AAAEoC,MAAAA,GAAG,EAAElB;AAAP,KAHT;AAIC,IAAA,YAAY,EAAG,MAAMY,gBAAgB,CAAE,IAAF;AAJtC,KAMC,4BAAC,qBAAD;AACC,IAAA,WAAW,EAAGlB,WADf;AAEC,IAAA,SAAS,EAAGG,gBAFb;AAGC,IAAA,mBAAmB,EAAGF,mBAHvB;AAIC,IAAA,KAAK,EAAGG;AAJT,IAND,CAnCF,CADD;AAoDA;;AAEDV,WAAW,CAAC+B,IAAZ,GAAmBtC,2BAAnB;eACeO,W","sourcesContent":["/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useLayoutEffect } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\t__experimentalTruncate as Truncate,\n\tSlot,\n\tFill,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockStylesPreviewPanel from './preview-panel';\nimport useStylesForBlocks from './use-styles-for-block';\n\nfunction BlockStylesPreviewPanelSlot( { scope } ) {\n\treturn <Slot name={ `BlockStylesPreviewPanel/${ scope }` } />;\n}\n\nfunction BlockStylesPreviewPanelFill( { children, scope, ...props } ) {\n\treturn (\n\t\t<Fill name={ `BlockStylesPreviewPanel/${ scope }` }>\n\t\t\t<div { ...props }>{ children }</div>\n\t\t</Fill>\n\t);\n}\n\n// Top position (in px) of the Block Styles container\n// relative to the editor pane.\n// The value is the equivalent of the container's right position.\nconst DEFAULT_POSITION_TOP = 16;\n\nconst noop = () => {};\n\n// Block Styles component for the Settings Sidebar.\nfunction BlockStyles( {\n\tclientId,\n\tonSwitch = noop,\n\tonHoverClassName = noop,\n\tscope,\n} ) {\n\tconst {\n\t\tonSelect,\n\t\tstylesToRender,\n\t\tactiveStyle,\n\t\tgenericPreviewBlock,\n\t\tclassName: previewClassName,\n\t} = useStylesForBlocks( {\n\t\tclientId,\n\t\tonSwitch,\n\t} );\n\tconst [ hoveredStyle, setHoveredStyle ] = useState( null );\n\tconst [ containerScrollTop, setContainerScrollTop ] = useState( 0 );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tuseLayoutEffect( () => {\n\t\tconst scrollContainer = document.querySelector(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tconst scrollTop = scrollContainer?.scrollTop || 0;\n\t\tsetContainerScrollTop( scrollTop + DEFAULT_POSITION_TOP );\n\t}, [ hoveredStyle ] );\n\n\tif ( ! stylesToRender || stylesToRender.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst debouncedSetHoveredStyle = debounce( setHoveredStyle, 250 );\n\n\tconst onSelectStylePreview = ( style ) => {\n\t\tonSelect( style );\n\t\tonHoverClassName( null );\n\t\tsetHoveredStyle( null );\n\t\tdebouncedSetHoveredStyle.cancel();\n\t};\n\n\tconst styleItemHandler = ( item ) => {\n\t\tif ( hoveredStyle === item ) {\n\t\t\tdebouncedSetHoveredStyle.cancel();\n\t\t\treturn;\n\t\t}\n\t\tdebouncedSetHoveredStyle( item );\n\t\tonHoverClassName( item?.name ?? null );\n\t};\n\n\treturn (\n\t\t<div className=\"block-editor-block-styles\">\n\t\t\t<div className=\"block-editor-block-styles__variants\">\n\t\t\t\t{ stylesToRender.map( ( style ) => {\n\t\t\t\t\tconst buttonText = style.label || style.name;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'block-editor-block-styles__item',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-active':\n\t\t\t\t\t\t\t\t\t\tactiveStyle.name === style.name,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tkey={ style.name }\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tlabel={ buttonText }\n\t\t\t\t\t\t\tonMouseEnter={ () => styleItemHandler( style ) }\n\t\t\t\t\t\t\tonFocus={ () => styleItemHandler( style ) }\n\t\t\t\t\t\t\tonMouseLeave={ () => styleItemHandler( null ) }\n\t\t\t\t\t\t\tonBlur={ () => styleItemHandler( null ) }\n\t\t\t\t\t\t\tonClick={ () => onSelectStylePreview( style ) }\n\t\t\t\t\t\t\taria-current={ activeStyle.name === style.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-styles__item-text\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ buttonText }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t\t{ hoveredStyle && ! isMobileViewport && (\n\t\t\t\t<BlockStylesPreviewPanelFill\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\tclassName=\"block-editor-block-styles__preview-panel\"\n\t\t\t\t\tstyle={ { top: containerScrollTop } }\n\t\t\t\t\tonMouseLeave={ () => styleItemHandler( null ) }\n\t\t\t\t>\n\t\t\t\t\t<BlockStylesPreviewPanel\n\t\t\t\t\t\tactiveStyle={ activeStyle }\n\t\t\t\t\t\tclassName={ previewClassName }\n\t\t\t\t\t\tgenericPreviewBlock={ genericPreviewBlock }\n\t\t\t\t\t\tstyle={ hoveredStyle }\n\t\t\t\t\t/>\n\t\t\t\t</BlockStylesPreviewPanelFill>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nBlockStyles.Slot = BlockStylesPreviewPanelSlot;\nexport default BlockStyles;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/preview.native.js"],"names":["MAX_ITEM_WIDTH","HALF_COLUMN","StylePreview","onPress","isActive","style","url","itemWidth","setItemWidth","label","name","opacity","Animated","Value","current","onLayout","columnsNum","Math","floor","BottomSheet","getWidth","dimensionsChangeSubscription","Dimensions","addEventListener","remove","labelStyle","styles","labelDark","animateOutline","setValue","timing","toValue","duration","useNativeDriver","easing","Easing","linear","start","innerOutlineStyle","innerOutline","innerOutlineDark","getOutline","outlineStyles","map","outlineStyle","index","container","width","imageWrapper","outline","image","uri","labelSelected"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAYA;;AAEA;;AAKA;;AAtBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,GAAvB;AACA,MAAMC,WAAW,GAAG,GAApB;;AAEA,SAASC,YAAT,OAA2D;AAAA,MAApC;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAX;AAAqBC,IAAAA,KAArB;AAA4BC,IAAAA;AAA5B,GAAoC;AAC1D,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8B,uBAAUR,cAAV,CAApC;AACA,QAAM;AAAES,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAkBL,KAAxB;AACA,QAAMM,OAAO,GAAG,qBAAQ,IAAIC,sBAASC,KAAb,CAAoB,CAApB,CAAR,EAAkCC,OAAlD;;AAEA,WAASC,QAAT,GAAoB;AACnB,UAAMC,UAAU,GACf;AACAC,IAAAA,IAAI,CAACC,KAAL,CAAYC,wBAAYC,QAAZ,KAAyBpB,cAArC,IAAwDC,WAFzD;AAGAO,IAAAA,YAAY,CAAEW,wBAAYC,QAAZ,KAAyBJ,UAA3B,CAAZ;AACA;;AAED,0BAAW,MAAM;AAChBD,IAAAA,QAAQ;;AACR,UAAMM,4BAA4B,GAAGC,wBAAWC,gBAAX,CACpC,QADoC,EAEpCR,QAFoC,CAArC;;AAKA,WAAO,MAAM;AACZM,MAAAA,4BAA4B,CAACG,MAA7B;AACA,KAFD;AAGA,GAVD,EAUG,EAVH;AAYA,QAAMC,UAAU,GAAG,2CAClBC,eAAOjB,KADW,EAElBiB,eAAOC,SAFW,CAAnB;;AAKA,QAAMC,cAAc,GAAG,MAAM;AAC5BjB,IAAAA,O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G,CAAEmB,UAAF,EAAcrB,QAAQ,IAAIsB,eAAO0B,aAAjC;AADT,KAGG3C,KAHH,CATD,CAND,CADD;AAwBA;;eAEcP,Y","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tView,\n\tTouchableWithoutFeedback,\n\tText,\n\tDimensions,\n\tAnimated,\n\tEasing,\n\tImage,\n} from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { BottomSheet } from '@wordpress/components';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst MAX_ITEM_WIDTH = 120;\nconst HALF_COLUMN = 0.5;\n\nfunction StylePreview( { onPress, isActive, style, url } ) {\n\tconst [ itemWidth, setItemWidth ] = useState( MAX_ITEM_WIDTH );\n\tconst { label, name } = style;\n\tconst opacity = useRef( new Animated.Value( 1 ) ).current;\n\n\tfunction onLayout() {\n\t\tconst columnsNum =\n\t\t\t// To indicate scroll availabilty, there is a need to display additional half the column.\n\t\t\tMath.floor( BottomSheet.getWidth() / MAX_ITEM_WIDTH ) + HALF_COLUMN;\n\t\tsetItemWidth( BottomSheet.getWidth() / columnsNum );\n\t}\n\n\tuseEffect( () => {\n\t\tonLayout();\n\t\tconst dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tonLayout\n\t\t);\n\n\t\treturn () => {\n\t\t\tdimensionsChangeSubscription.remove();\n\t\t};\n\t}, [] );\n\n\tconst labelStyle = usePreferredColorSchemeStyle(\n\t\tstyles.label,\n\t\tstyles.labelDark\n\t);\n\n\tconst animateOutline = () => {\n\t\topacity.setValue( 0 );\n\t\tAnimated.timing( opacity, {\n\t\t\ttoValue: 1,\n\t\t\tduration: 100,\n\t\t\tuseNativeDriver: true,\n\t\t\teasing: Easing.linear,\n\t\t} ).start();\n\t};\n\n\tconst innerOutlineStyle = usePreferredColorSchemeStyle(\n\t\tstyles.innerOutline,\n\t\tstyles.innerOutlineDark\n\t);\n\n\tconst getOutline = ( outlineStyles ) =>\n\t\toutlineStyles.map( ( outlineStyle, index ) => {\n\t\t\treturn (\n\t\t\t\t<Animated.View\n\t\t\t\t\tstyle={ [ outlineStyle, { opacity }, styles[ name ] ] }\n\t\t\t\t\tkey={ index }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\tonPress={ () => {\n\t\t\t\tonPress();\n\t\t\t\tanimateOutline();\n\t\t\t} }\n\t\t>\n\t\t\t<View style={ [ styles.container, { width: itemWidth } ] }>\n\t\t\t\t<View style={ styles.imageWrapper }>\n\t\t\t\t\t{ isActive &&\n\t\t\t\t\t\tgetOutline( [ styles.outline, innerOutlineStyle ] ) }\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={ [ styles.image, styles[ name ] ] }\n\t\t\t\t\t\tsource={ { uri: url } }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<Text\n\t\t\t\t\tstyle={ [ labelStyle, isActive && styles.labelSelected ] }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n}\n\nexport default StylePreview;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-styles/preview.native.js"],"names":["MAX_ITEM_WIDTH","HALF_COLUMN","StylePreview","onPress","isActive","style","url","itemWidth","setItemWidth","label","name","opacity","Animated","Value","current","onLayout","columnsNum","Math","floor","BottomSheet","getWidth","dimensionsChangeSubscription","Dimensions","addEventListener","remove","labelStyle","styles","labelDark","animateOutline","setValue","timing","toValue","duration","useNativeDriver","easing","Easing","linear","start","innerOutlineStyle","innerOutline","innerOutlineDark","getOutline","outlineStyles","map","outlineStyle","index","container","width","imageWrapper","outline","image","uri","labelSelected"],"mappings":";;;;;;;;;AAiBA;;AAdA;;AAaA;;AAEA;;AAKA;;AAvBA;AACA;AACA;;AAWA;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MA,GARD;;AAUA,QAAMC,iBAAiB,GAAG,2CACzBZ,eAAOa,YADkB,EAEzBb,eAAOc,gBAFkB,CAA1B;;AAKA,QAAMC,UAAU,GAAKC,aAAF,IAClBA,aAAa,CAACC,GAAd,CAAmB,CAAEC,YAAF,EAAgBC,KAAhB,KAA2B;AAC7C,WACC,4BAAC,qBAAD,CAAU,IAAV;AACC,MAAA,KAAK,EAAG,CAAED,YAAF,EAAgB;AAAEjC,QAAAA;AAAF,OAAhB,EAA6Be,eAAQhB,IAAR,CAA7B,CADT;AAEC,MAAA,GAAG,EAAGmC;AAFP,MADD;AAMA,GAPD,CADD;;AAUA,SACC,4BAAC,qCAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf1C,MAAAA,OAAO;AACPyB,MAAAA,cAAc;AACd;AAJF,KAMC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAG,CAAEF,eAAOoB,SAAT,EAAoB;AAAEC,MAAAA,KAAK,EAAExC;AAAT,KAApB;AAAd,KACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGmB,eAAOsB;AAArB,KACG5C,QAAQ,IACTqC,UAAU,CAAE,CAAEf,eAAOuB,OAAT,EAAkBX,iBAAlB,CAAF,CAFZ,EAGC,4BAAC,kBAAD;AACC,IAAA,KAAK,EAAG,CAAEZ,eAAOwB,KAAT,EAAgBxB,eAAQhB,IAAR,CAAhB,CADT;AAEC,IAAA,MAAM,EAAG;AAAEyC,MAAAA,GAAG,EAAE7C;AAAP;AAFV,IAHD,CADD,EASC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,CAAEmB,UAAF,EAAcrB,QAAQ,IAAIsB,eAAO0B,aAAjC;AADT,KAGG3C,KAHH,CATD,CAND,CADD;AAwBA;;eAEcP,Y","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tView,\n\tTouchableWithoutFeedback,\n\tText,\n\tDimensions,\n\tAnimated,\n\tEasing,\n\tImage,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheet } from '@wordpress/components';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst MAX_ITEM_WIDTH = 120;\nconst HALF_COLUMN = 0.5;\n\nfunction StylePreview( { onPress, isActive, style, url } ) {\n\tconst [ itemWidth, setItemWidth ] = useState( MAX_ITEM_WIDTH );\n\tconst { label, name } = style;\n\tconst opacity = useRef( new Animated.Value( 1 ) ).current;\n\n\tfunction onLayout() {\n\t\tconst columnsNum =\n\t\t\t// To indicate scroll availabilty, there is a need to display additional half the column.\n\t\t\tMath.floor( BottomSheet.getWidth() / MAX_ITEM_WIDTH ) + HALF_COLUMN;\n\t\tsetItemWidth( BottomSheet.getWidth() / columnsNum );\n\t}\n\n\tuseEffect( () => {\n\t\tonLayout();\n\t\tconst dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tonLayout\n\t\t);\n\n\t\treturn () => {\n\t\t\tdimensionsChangeSubscription.remove();\n\t\t};\n\t}, [] );\n\n\tconst labelStyle = usePreferredColorSchemeStyle(\n\t\tstyles.label,\n\t\tstyles.labelDark\n\t);\n\n\tconst animateOutline = () => {\n\t\topacity.setValue( 0 );\n\t\tAnimated.timing( opacity, {\n\t\t\ttoValue: 1,\n\t\t\tduration: 100,\n\t\t\tuseNativeDriver: true,\n\t\t\teasing: Easing.linear,\n\t\t} ).start();\n\t};\n\n\tconst innerOutlineStyle = usePreferredColorSchemeStyle(\n\t\tstyles.innerOutline,\n\t\tstyles.innerOutlineDark\n\t);\n\n\tconst getOutline = ( outlineStyles ) =>\n\t\toutlineStyles.map( ( outlineStyle, index ) => {\n\t\t\treturn (\n\t\t\t\t<Animated.View\n\t\t\t\t\tstyle={ [ outlineStyle, { opacity }, styles[ name ] ] }\n\t\t\t\t\tkey={ index }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\tonPress={ () => {\n\t\t\t\tonPress();\n\t\t\t\tanimateOutline();\n\t\t\t} }\n\t\t>\n\t\t\t<View style={ [ styles.container, { width: itemWidth } ] }>\n\t\t\t\t<View style={ styles.imageWrapper }>\n\t\t\t\t\t{ isActive &&\n\t\t\t\t\t\tgetOutline( [ styles.outline, innerOutlineStyle ] ) }\n\t\t\t\t\t<Image\n\t\t\t\t\t\tstyle={ [ styles.image, styles[ name ] ] }\n\t\t\t\t\t\tsource={ { uri: url } }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<Text\n\t\t\t\t\tstyle={ [ labelStyle, isActive && styles.labelSelected ] }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</Text>\n\t\t\t</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n}\n\nexport default StylePreview;\n"]}
@@ -120,8 +120,14 @@ const BlockSwitcherDropdownMenu = _ref => {
120
120
 
121
121
 
122
122
  const onPatternTransform = transformedBlocks => replaceBlocks(clientIds, transformedBlocks);
123
+ /**
124
+ * The `isTemplate` check is a stopgap solution here.
125
+ * Ideally, the Transforms API should handle this
126
+ * by allowing to exclude blocks from wildcard transformations.
127
+ */
123
128
 
124
- const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove;
129
+
130
+ const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove && !isTemplate;
125
131
  const hasPatternTransformation = !!(patterns !== null && patterns !== void 0 && patterns.length) && canRemove;
126
132
 
127
133
  if (!hasBlockStyles && !hasPossibleBlockTransformations) {