@wordpress/block-editor 14.5.0 → 14.6.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 (431) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +0 -8
  3. package/build/autocompleters/block.js +13 -5
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-canvas/index.js +10 -0
  6. package/build/components/block-canvas/index.js.map +1 -1
  7. package/build/components/block-card/index.js +2 -2
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-full-height-alignment-control/index.js +1 -1
  10. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  11. package/build/components/block-list/block.js +1 -1
  12. package/build/components/block-list/block.js.map +1 -1
  13. package/build/components/block-list/block.native.js +1 -7
  14. package/build/components/block-list/block.native.js.map +1 -1
  15. package/build/components/block-list/index.js +5 -5
  16. package/build/components/block-list/index.js.map +1 -1
  17. package/build/components/block-list/use-block-props/index.js +1 -2
  18. package/build/components/block-list/use-block-props/index.js.map +1 -1
  19. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  20. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  22. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  23. package/build/components/block-list/use-in-between-inserter.js +1 -1
  24. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  25. package/build/components/block-patterns-paging/index.js +1 -1
  26. package/build/components/block-patterns-paging/index.js.map +1 -1
  27. package/build/components/block-popover/index.js +2 -45
  28. package/build/components/block-popover/index.js.map +1 -1
  29. package/build/components/block-preview/index.js +2 -2
  30. package/build/components/block-preview/index.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -0
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/block-settings-menu/index.js +4 -3
  34. package/build/components/block-settings-menu/index.js.map +1 -1
  35. package/build/components/block-toolbar/change-design.js +122 -0
  36. package/build/components/block-toolbar/change-design.js.map +1 -0
  37. package/build/components/block-toolbar/index.js +19 -7
  38. package/build/components/block-toolbar/index.js.map +1 -1
  39. package/build/components/block-tools/index.js +4 -10
  40. package/build/components/block-tools/index.js.map +1 -1
  41. package/build/components/block-tools/insertion-point.js +4 -3
  42. package/build/components/block-tools/insertion-point.js.map +1 -1
  43. package/build/components/block-tools/use-show-block-tools.js +3 -9
  44. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  45. package/build/components/block-tools/zoom-out-mode-inserters.js +20 -29
  46. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  47. package/build/components/block-variation-transforms/index.js +2 -2
  48. package/build/components/block-variation-transforms/index.js.map +1 -1
  49. package/build/components/block-vertical-alignment-control/ui.js +6 -10
  50. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  51. package/build/components/border-radius-control/linked-button.js +7 -10
  52. package/build/components/border-radius-control/linked-button.js.map +1 -1
  53. package/build/components/collab/block-comment-icon-slot.js +18 -0
  54. package/build/components/collab/block-comment-icon-slot.js.map +1 -0
  55. package/build/components/collab/block-comment-icon-toolbar-slot.js +18 -0
  56. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  57. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  58. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  59. package/build/components/convert-to-group-buttons/toolbar.js +4 -4
  60. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  61. package/build/components/global-styles/color-panel.js +1 -4
  62. package/build/components/global-styles/color-panel.js.map +1 -1
  63. package/build/components/global-styles/use-global-styles-context.native.js +6 -0
  64. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  65. package/build/components/iframe/index.js +17 -22
  66. package/build/components/iframe/index.js.map +1 -1
  67. package/build/components/image-size-control/index.js +61 -20
  68. package/build/components/image-size-control/index.js.map +1 -1
  69. package/build/components/inner-blocks/index.js +9 -5
  70. package/build/components/inner-blocks/index.js.map +1 -1
  71. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  72. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  73. package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  74. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  75. package/build/components/inserter/category-tabs/index.js +15 -2
  76. package/build/components/inserter/category-tabs/index.js.map +1 -1
  77. package/build/components/inserter/menu.js +4 -2
  78. package/build/components/inserter/menu.js.map +1 -1
  79. package/build/components/inserter-button/index.native.js +1 -1
  80. package/build/components/inserter-button/index.native.js.map +1 -1
  81. package/build/components/inspector-controls-tabs/index.js +0 -2
  82. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  83. package/build/components/inspector-controls-tabs/utils.js +3 -6
  84. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  85. package/build/components/link-control/link-preview.js +12 -9
  86. package/build/components/link-control/link-preview.js.map +1 -1
  87. package/build/components/list-view/appender.js +4 -3
  88. package/build/components/list-view/appender.js.map +1 -1
  89. package/build/components/list-view/branch.js +6 -5
  90. package/build/components/list-view/branch.js.map +1 -1
  91. package/build/components/list-view/index.js +1 -2
  92. package/build/components/list-view/index.js.map +1 -1
  93. package/build/components/provider/index.js +1 -1
  94. package/build/components/provider/index.js.map +1 -1
  95. package/build/components/rich-text/event-listeners/index.js +3 -1
  96. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  97. package/build/components/rich-text/index.native.js +2 -6
  98. package/build/components/rich-text/index.native.js.map +1 -1
  99. package/build/components/spacing-sizes-control/index.js +2 -2
  100. package/build/components/spacing-sizes-control/index.js.map +1 -1
  101. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
  102. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  103. package/build/components/spacing-sizes-control/linked-button.js +1 -5
  104. package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
  105. package/build/components/tool-selector/index.js +1 -4
  106. package/build/components/tool-selector/index.js.map +1 -1
  107. package/build/components/url-input/index.js +1 -1
  108. package/build/components/url-input/index.js.map +1 -1
  109. package/build/components/use-block-commands/index.js +1 -1
  110. package/build/components/use-block-commands/index.js.map +1 -1
  111. package/build/components/use-block-drop-zone/index.js +5 -5
  112. package/build/components/use-block-drop-zone/index.js.map +1 -1
  113. package/build/components/use-block-drop-zone/index.native.js +0 -1
  114. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  115. package/build/components/use-moving-animation/index.js +1 -3
  116. package/build/components/use-moving-animation/index.js.map +1 -1
  117. package/build/components/use-settings/index.js +1 -3
  118. package/build/components/use-settings/index.js.map +1 -1
  119. package/build/components/writing-flow/index.js +5 -3
  120. package/build/components/writing-flow/index.js.map +1 -1
  121. package/build/components/writing-flow/use-tab-nav.js +2 -3
  122. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  123. package/build/hooks/block-bindings.js +19 -8
  124. package/build/hooks/block-bindings.js.map +1 -1
  125. package/build/hooks/contrast-checker.js +0 -1
  126. package/build/hooks/contrast-checker.js.map +1 -1
  127. package/build/hooks/duotone.js +2 -2
  128. package/build/hooks/duotone.js.map +1 -1
  129. package/build/hooks/style.js +4 -1
  130. package/build/hooks/style.js.map +1 -1
  131. package/build/hooks/use-zoom-out.js +13 -22
  132. package/build/hooks/use-zoom-out.js.map +1 -1
  133. package/build/index.js +0 -7
  134. package/build/index.js.map +1 -1
  135. package/build/private-apis.js +6 -3
  136. package/build/private-apis.js.map +1 -1
  137. package/build/store/actions.js +2 -33
  138. package/build/store/actions.js.map +1 -1
  139. package/build/store/defaults.js +1 -1
  140. package/build/store/defaults.js.map +1 -1
  141. package/build/store/private-actions.js +57 -8
  142. package/build/store/private-actions.js.map +1 -1
  143. package/build/store/private-selectors.js +9 -21
  144. package/build/store/private-selectors.js.map +1 -1
  145. package/build/store/reducer.js +16 -6
  146. package/build/store/reducer.js.map +1 -1
  147. package/build/store/selectors.js +44 -7
  148. package/build/store/selectors.js.map +1 -1
  149. package/build/utils/dom.js +16 -1
  150. package/build/utils/dom.js.map +1 -1
  151. package/build/utils/get-font-styles-and-weights.js +1 -1
  152. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  153. package/build/utils/transform-styles/index.js +4 -3
  154. package/build/utils/transform-styles/index.js.map +1 -1
  155. package/build-module/autocompleters/block.js +14 -6
  156. package/build-module/autocompleters/block.js.map +1 -1
  157. package/build-module/components/block-canvas/index.js +11 -1
  158. package/build-module/components/block-canvas/index.js.map +1 -1
  159. package/build-module/components/block-card/index.js +3 -3
  160. package/build-module/components/block-card/index.js.map +1 -1
  161. package/build-module/components/block-full-height-alignment-control/index.js +1 -1
  162. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  163. package/build-module/components/block-list/block.js +1 -1
  164. package/build-module/components/block-list/block.js.map +1 -1
  165. package/build-module/components/block-list/block.native.js +1 -7
  166. package/build-module/components/block-list/block.native.js.map +1 -1
  167. package/build-module/components/block-list/index.js +5 -5
  168. package/build-module/components/block-list/index.js.map +1 -1
  169. package/build-module/components/block-list/use-block-props/index.js +1 -2
  170. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  171. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  172. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  173. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  174. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  175. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  176. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  177. package/build-module/components/block-patterns-paging/index.js +1 -1
  178. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  179. package/build-module/components/block-popover/index.js +2 -45
  180. package/build-module/components/block-popover/index.js.map +1 -1
  181. package/build-module/components/block-preview/index.js +2 -2
  182. package/build-module/components/block-preview/index.js.map +1 -1
  183. package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -0
  184. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  185. package/build-module/components/block-settings-menu/index.js +5 -4
  186. package/build-module/components/block-settings-menu/index.js.map +1 -1
  187. package/build-module/components/block-toolbar/change-design.js +114 -0
  188. package/build-module/components/block-toolbar/change-design.js.map +1 -0
  189. package/build-module/components/block-toolbar/index.js +19 -7
  190. package/build-module/components/block-toolbar/index.js.map +1 -1
  191. package/build-module/components/block-tools/index.js +4 -10
  192. package/build-module/components/block-tools/index.js.map +1 -1
  193. package/build-module/components/block-tools/insertion-point.js +4 -3
  194. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  195. package/build-module/components/block-tools/use-show-block-tools.js +3 -9
  196. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  197. package/build-module/components/block-tools/zoom-out-mode-inserters.js +20 -29
  198. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  199. package/build-module/components/block-variation-transforms/index.js +2 -2
  200. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  201. package/build-module/components/block-vertical-alignment-control/ui.js +6 -10
  202. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  203. package/build-module/components/border-radius-control/linked-button.js +8 -11
  204. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  205. package/build-module/components/collab/block-comment-icon-slot.js +11 -0
  206. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -0
  207. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +11 -0
  208. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  209. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  210. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  211. package/build-module/components/convert-to-group-buttons/toolbar.js +4 -4
  212. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  213. package/build-module/components/global-styles/color-panel.js +2 -5
  214. package/build-module/components/global-styles/color-panel.js.map +1 -1
  215. package/build-module/components/global-styles/use-global-styles-context.native.js +6 -0
  216. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  217. package/build-module/components/iframe/index.js +17 -22
  218. package/build-module/components/iframe/index.js.map +1 -1
  219. package/build-module/components/image-size-control/index.js +62 -21
  220. package/build-module/components/image-size-control/index.js.map +1 -1
  221. package/build-module/components/inner-blocks/index.js +9 -5
  222. package/build-module/components/inner-blocks/index.js.map +1 -1
  223. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  224. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  225. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  226. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  227. package/build-module/components/inserter/category-tabs/index.js +15 -2
  228. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  229. package/build-module/components/inserter/menu.js +5 -3
  230. package/build-module/components/inserter/menu.js.map +1 -1
  231. package/build-module/components/inserter-button/index.native.js +1 -1
  232. package/build-module/components/inserter-button/index.native.js.map +1 -1
  233. package/build-module/components/inspector-controls-tabs/index.js +0 -2
  234. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  235. package/build-module/components/inspector-controls-tabs/utils.js +3 -6
  236. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  237. package/build-module/components/link-control/link-preview.js +13 -10
  238. package/build-module/components/link-control/link-preview.js.map +1 -1
  239. package/build-module/components/list-view/appender.js +4 -3
  240. package/build-module/components/list-view/appender.js.map +1 -1
  241. package/build-module/components/list-view/branch.js +7 -6
  242. package/build-module/components/list-view/branch.js.map +1 -1
  243. package/build-module/components/list-view/index.js +1 -2
  244. package/build-module/components/list-view/index.js.map +1 -1
  245. package/build-module/components/provider/index.js +1 -1
  246. package/build-module/components/provider/index.js.map +1 -1
  247. package/build-module/components/rich-text/event-listeners/index.js +4 -2
  248. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  249. package/build-module/components/rich-text/index.native.js +2 -6
  250. package/build-module/components/rich-text/index.native.js.map +1 -1
  251. package/build-module/components/spacing-sizes-control/index.js +3 -3
  252. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  253. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  254. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  255. package/build-module/components/spacing-sizes-control/linked-button.js +2 -6
  256. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
  257. package/build-module/components/tool-selector/index.js +1 -4
  258. package/build-module/components/tool-selector/index.js.map +1 -1
  259. package/build-module/components/url-input/index.js +1 -1
  260. package/build-module/components/url-input/index.js.map +1 -1
  261. package/build-module/components/use-block-commands/index.js +1 -1
  262. package/build-module/components/use-block-commands/index.js.map +1 -1
  263. package/build-module/components/use-block-drop-zone/index.js +5 -5
  264. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  265. package/build-module/components/use-block-drop-zone/index.native.js +0 -1
  266. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  267. package/build-module/components/use-moving-animation/index.js +1 -3
  268. package/build-module/components/use-moving-animation/index.js.map +1 -1
  269. package/build-module/components/use-settings/index.js +1 -3
  270. package/build-module/components/use-settings/index.js.map +1 -1
  271. package/build-module/components/writing-flow/index.js +5 -3
  272. package/build-module/components/writing-flow/index.js.map +1 -1
  273. package/build-module/components/writing-flow/use-tab-nav.js +2 -3
  274. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  275. package/build-module/hooks/block-bindings.js +20 -9
  276. package/build-module/hooks/block-bindings.js.map +1 -1
  277. package/build-module/hooks/contrast-checker.js +0 -1
  278. package/build-module/hooks/contrast-checker.js.map +1 -1
  279. package/build-module/hooks/duotone.js +2 -2
  280. package/build-module/hooks/duotone.js.map +1 -1
  281. package/build-module/hooks/style.js +4 -1
  282. package/build-module/hooks/style.js.map +1 -1
  283. package/build-module/hooks/use-zoom-out.js +15 -23
  284. package/build-module/hooks/use-zoom-out.js.map +1 -1
  285. package/build-module/index.js +1 -1
  286. package/build-module/index.js.map +1 -1
  287. package/build-module/private-apis.js +7 -5
  288. package/build-module/private-apis.js.map +1 -1
  289. package/build-module/store/actions.js +2 -33
  290. package/build-module/store/actions.js.map +1 -1
  291. package/build-module/store/defaults.js +1 -1
  292. package/build-module/store/defaults.js.map +1 -1
  293. package/build-module/store/private-actions.js +54 -7
  294. package/build-module/store/private-actions.js.map +1 -1
  295. package/build-module/store/private-selectors.js +9 -20
  296. package/build-module/store/private-selectors.js.map +1 -1
  297. package/build-module/store/reducer.js +16 -6
  298. package/build-module/store/reducer.js.map +1 -1
  299. package/build-module/store/selectors.js +45 -8
  300. package/build-module/store/selectors.js.map +1 -1
  301. package/build-module/utils/dom.js +16 -1
  302. package/build-module/utils/dom.js.map +1 -1
  303. package/build-module/utils/get-font-styles-and-weights.js +2 -2
  304. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  305. package/build-module/utils/transform-styles/index.js +3 -2
  306. package/build-module/utils/transform-styles/index.js.map +1 -1
  307. package/build-style/content-rtl.css +9 -4
  308. package/build-style/content.css +9 -4
  309. package/build-style/style-rtl.css +33 -22
  310. package/build-style/style.css +33 -22
  311. package/build-types/utils/dom.d.ts.map +1 -1
  312. package/package.json +33 -32
  313. package/src/autocompleters/block.js +16 -7
  314. package/src/components/block-canvas/index.js +17 -1
  315. package/src/components/block-canvas/style.scss +2 -0
  316. package/src/components/block-card/index.js +3 -3
  317. package/src/components/block-full-height-alignment-control/index.js +1 -1
  318. package/src/components/block-inspector/style.scss +0 -6
  319. package/src/components/block-list/block.js +1 -2
  320. package/src/components/block-list/block.native.js +0 -4
  321. package/src/components/block-list/content.scss +1 -1
  322. package/src/components/block-list/index.js +4 -4
  323. package/src/components/block-list/use-block-props/index.js +0 -2
  324. package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -3
  325. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +7 -20
  326. package/src/components/block-list/use-in-between-inserter.js +1 -1
  327. package/src/components/block-patterns-list/stories/fixtures.js +834 -0
  328. package/src/components/block-patterns-list/stories/index.story.js +81 -0
  329. package/src/components/block-patterns-list/style.scss +2 -0
  330. package/src/components/block-patterns-paging/index.js +1 -1
  331. package/src/components/block-popover/index.js +0 -62
  332. package/src/components/block-preview/index.js +2 -2
  333. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
  334. package/src/components/block-settings-menu/index.js +3 -0
  335. package/src/components/block-toolbar/change-design.js +133 -0
  336. package/src/components/block-toolbar/index.js +25 -8
  337. package/src/components/block-toolbar/style.scss +16 -0
  338. package/src/components/block-tools/index.js +4 -17
  339. package/src/components/block-tools/insertion-point.js +4 -3
  340. package/src/components/block-tools/style.scss +0 -20
  341. package/src/components/block-tools/use-show-block-tools.js +0 -13
  342. package/src/components/block-tools/zoom-out-mode-inserters.js +25 -40
  343. package/src/components/block-variation-transforms/index.js +2 -2
  344. package/src/components/block-vertical-alignment-control/ui.js +11 -15
  345. package/src/components/border-radius-control/linked-button.js +9 -11
  346. package/src/components/collab/block-comment-icon-slot.js +12 -0
  347. package/src/components/collab/block-comment-icon-toolbar-slot.js +12 -0
  348. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  349. package/src/components/convert-to-group-buttons/toolbar.js +4 -4
  350. package/src/components/global-styles/color-panel.js +2 -10
  351. package/src/components/global-styles/test/use-global-styles-context.native.js +1 -0
  352. package/src/components/global-styles/use-global-styles-context.native.js +6 -0
  353. package/src/components/iframe/content.scss +4 -9
  354. package/src/components/iframe/index.js +31 -34
  355. package/src/components/iframe/style.scss +2 -3
  356. package/src/components/image-size-control/index.js +74 -43
  357. package/src/components/image-size-control/test/index.js +5 -63
  358. package/src/components/inner-blocks/index.js +12 -6
  359. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -3
  360. package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  361. package/src/components/inserter/category-tabs/index.js +16 -2
  362. package/src/components/inserter/menu.js +6 -4
  363. package/src/components/inserter/style.scss +13 -0
  364. package/src/components/inserter-button/index.native.js +1 -1
  365. package/src/components/inspector-controls-tabs/index.js +1 -6
  366. package/src/components/inspector-controls-tabs/utils.js +0 -3
  367. package/src/components/link-control/link-preview.js +15 -8
  368. package/src/components/link-control/test/index.js +63 -24
  369. package/src/components/list-view/appender.js +5 -6
  370. package/src/components/list-view/branch.js +8 -6
  371. package/src/components/list-view/index.js +1 -2
  372. package/src/components/provider/index.js +1 -3
  373. package/src/components/provider/test/experimental-provider.js +43 -1
  374. package/src/components/rich-text/event-listeners/index.js +4 -2
  375. package/src/components/rich-text/index.native.js +0 -2
  376. package/src/components/spacing-sizes-control/index.js +3 -3
  377. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  378. package/src/components/spacing-sizes-control/linked-button.js +2 -12
  379. package/src/components/tool-selector/index.js +1 -5
  380. package/src/components/url-input/index.js +1 -1
  381. package/src/components/use-block-commands/index.js +1 -1
  382. package/src/components/use-block-drop-zone/index.js +5 -5
  383. package/src/components/use-block-drop-zone/index.native.js +0 -1
  384. package/src/components/use-moving-animation/index.js +0 -1
  385. package/src/components/use-settings/index.js +0 -1
  386. package/src/components/writing-flow/index.js +5 -3
  387. package/src/components/writing-flow/use-tab-nav.js +1 -2
  388. package/src/hooks/block-bindings.js +48 -31
  389. package/src/hooks/contrast-checker.js +0 -1
  390. package/src/hooks/duotone.js +2 -2
  391. package/src/hooks/style.js +7 -3
  392. package/src/hooks/use-zoom-out.js +14 -34
  393. package/src/index.js +0 -1
  394. package/src/private-apis.js +6 -3
  395. package/src/store/actions.js +3 -52
  396. package/src/store/defaults.js +2 -1
  397. package/src/store/private-actions.js +71 -8
  398. package/src/store/private-selectors.js +9 -19
  399. package/src/store/reducer.js +25 -11
  400. package/src/store/selectors.js +59 -8
  401. package/src/store/test/actions.js +41 -0
  402. package/src/store/test/reducer.js +23 -0
  403. package/src/utils/dom.js +22 -2
  404. package/src/utils/get-font-styles-and-weights.js +2 -2
  405. package/src/utils/transform-styles/index.js +3 -2
  406. package/tsconfig.tsbuildinfo +1 -1
  407. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -57
  408. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  409. package/build/components/block-toolbar/shuffle.js +0 -110
  410. package/build/components/block-toolbar/shuffle.js.map +0 -1
  411. package/build/components/block-tools/zoom-out-popover.js +0 -58
  412. package/build/components/block-tools/zoom-out-popover.js.map +0 -1
  413. package/build/components/block-tools/zoom-out-toolbar.js +0 -132
  414. package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
  415. package/build/components/block-vertical-alignment-control/icons.js +0 -48
  416. package/build/components/block-vertical-alignment-control/icons.js.map +0 -1
  417. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -51
  418. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  419. package/build-module/components/block-toolbar/shuffle.js +0 -103
  420. package/build-module/components/block-toolbar/shuffle.js.map +0 -1
  421. package/build-module/components/block-tools/zoom-out-popover.js +0 -49
  422. package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
  423. package/build-module/components/block-tools/zoom-out-toolbar.js +0 -124
  424. package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
  425. package/build-module/components/block-vertical-alignment-control/icons.js +0 -41
  426. package/build-module/components/block-vertical-alignment-control/icons.js.map +0 -1
  427. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -65
  428. package/src/components/block-toolbar/shuffle.js +0 -111
  429. package/src/components/block-tools/zoom-out-popover.js +0 -47
  430. package/src/components/block-tools/zoom-out-toolbar.js +0 -135
  431. package/src/components/block-vertical-alignment-control/icons.js +0 -34
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_data","_element","_i18n","_store","_insertionPoint","_lockUnlock","useInBetweenInserter","openRef","useContext","InsertionPointOpenRef","isInBetweenInserterDisabled","useSelect","select","blockEditorStore","getSettings","isDistractionFree","__unstableGetEditorMode","getBlockListSettings","getBlockIndex","isMultiSelecting","getSelectedBlockClientIds","getTemplateLock","__unstableIsWithinBlockOverlay","getBlockEditingMode","getBlockName","getBlockAttributes","getParentSectionBlock","unlock","showInsertionPoint","hideInsertionPoint","useDispatch","useRefEffect","node","onMouseMove","event","undefined","current","target","nodeType","TEXT_NODE","classList","contains","rootClientId","blockElement","getAttribute","closest","layout","isManualPlacement","blockListSettings","orientation","captureToolbars","__experimentalCaptureToolbars","offsetTop","clientY","offsetLeft","clientX","children","Array","from","element","find","blockEl","blockElRect","getBoundingClientRect","top","isRTL","right","left","id","firstElementChild","clientId","slice","length","includes","hasFixedToolbar","elementRect","bottom","index","__unstableWithInserter","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-in-between-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { InsertionPointOpenRef } from '../block-tools/insertion-point';\nimport { unlock } from '../../lock-unlock';\n\nexport function useInBetweenInserter() {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isInBetweenInserterDisabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree ||\n\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',\n\t\t[]\n\t);\n\tconst {\n\t\tgetBlockListSettings,\n\t\tgetBlockIndex,\n\t\tisMultiSelecting,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSettings,\n\t\tgetTemplateLock,\n\t\t__unstableIsWithinBlockOverlay,\n\t\tgetBlockEditingMode,\n\t\tgetBlockName,\n\t\tgetBlockAttributes,\n\t\tgetParentSectionBlock,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isInBetweenInserterDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onMouseMove( event ) {\n\t\t\t\t// openRef is the reference to the insertion point between blocks.\n\t\t\t\t// If the reference is not set or the insertion point is already open, return.\n\t\t\t\tif ( openRef === undefined || openRef.current ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ignore text nodes sometimes detected in FireFox.\n\t\t\t\tif ( event.target.nodeType === event.target.TEXT_NODE ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains(\n\t\t\t\t\t\t'block-editor-block-list__layout'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet rootClientId;\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains( 'is-root-container' )\n\t\t\t\t) {\n\t\t\t\t\tconst blockElement = !! event.target.getAttribute(\n\t\t\t\t\t\t'data-block'\n\t\t\t\t\t)\n\t\t\t\t\t\t? event.target\n\t\t\t\t\t\t: event.target.closest( '[data-block]' );\n\t\t\t\t\trootClientId = blockElement.getAttribute( 'data-block' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled' ||\n\t\t\t\t\tgetBlockName( rootClientId ) === 'core/block' ||\n\t\t\t\t\t( rootClientId &&\n\t\t\t\t\t\tgetBlockAttributes( rootClientId ).layout\n\t\t\t\t\t\t\t?.isManualPlacement )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst blockListSettings = getBlockListSettings( rootClientId );\n\t\t\t\tconst orientation =\n\t\t\t\t\tblockListSettings?.orientation || 'vertical';\n\t\t\t\tconst captureToolbars =\n\t\t\t\t\t!! blockListSettings?.__experimentalCaptureToolbars;\n\t\t\t\tconst offsetTop = event.clientY;\n\t\t\t\tconst offsetLeft = event.clientX;\n\n\t\t\t\tconst children = Array.from( event.target.children );\n\t\t\t\tlet element = children.find( ( blockEl ) => {\n\t\t\t\t\tconst blockElRect = blockEl.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t\t\tblockElRect.top > offsetTop ) ||\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'horizontal' &&\n\t\t\t\t\t\t\t( isRTL()\n\t\t\t\t\t\t\t\t? blockElRect.right < offsetLeft\n\t\t\t\t\t\t\t\t: blockElRect.left > offsetLeft ) )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\t\t\tif ( ! element ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The block may be in an alignment wrapper, so check the first direct\n\t\t\t\t// child if the element has no ID.\n\t\t\t\tif ( ! element.id ) {\n\t\t\t\t\telement = element.firstElementChild;\n\n\t\t\t\t\tif ( ! element ) {\n\t\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't show the insertion point if a parent block has an \"overlay\"\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337\n\t\t\t\tconst clientId = element.id.slice( 'block-'.length );\n\t\t\t\tif (\n\t\t\t\t\t! clientId ||\n\t\t\t\t\t__unstableIsWithinBlockOverlay( clientId ) ||\n\t\t\t\t\t!! getParentSectionBlock( clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Don't show the inserter if the following conditions are met,\n\t\t\t\t// as it conflicts with the block toolbar:\n\t\t\t\t// 1. when hovering above or inside selected block(s)\n\t\t\t\t// 2. when the orientation is vertical\n\t\t\t\t// 3. when the __experimentalCaptureToolbars is not enabled\n\t\t\t\t// 4. when the Top Toolbar is not disabled\n\t\t\t\tif (\n\t\t\t\t\tgetSelectedBlockClientIds().includes( clientId ) &&\n\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t! captureToolbars &&\n\t\t\t\t\t! getSettings().hasFixedToolbar\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst elementRect = element.getBoundingClientRect();\n\n\t\t\t\tif (\n\t\t\t\t\t( orientation === 'horizontal' &&\n\t\t\t\t\t\t( event.clientY > elementRect.bottom ||\n\t\t\t\t\t\t\tevent.clientY < elementRect.top ) ) ||\n\t\t\t\t\t( orientation === 'vertical' &&\n\t\t\t\t\t\t( event.clientX > elementRect.right ||\n\t\t\t\t\t\t\tevent.clientX < elementRect.left ) )\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst index = getBlockIndex( clientId );\n\n\t\t\t\t// Don't show the in-between inserter before the first block in\n\t\t\t\t// the list (preserves the original behaviour).\n\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshowInsertionPoint( rootClientId, index, {\n\t\t\t\t\t__unstableWithInserter: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousemove', onMouseMove );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\topenRef,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockIndex,\n\t\t\tisMultiSelecting,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisInBetweenInserterDisabled,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAMA;AACA;AACA;;AAKO,SAASO,oBAAoBA,CAAA,EAAG;EACtC,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAEC,qCAAsB,CAAC;EACnD,MAAMC,2BAA2B,GAAG,IAAAC,eAAS,EAC1CC,MAAM,IACPA,MAAM,CAAEC,YAAiB,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,iBAAiB,IAC1DH,MAAM,CAAEC,YAAiB,CAAC,CAACG,uBAAuB,CAAC,CAAC,KAAK,UAAU,EACpE,EACD,CAAC;EACD,MAAM;IACLC,oBAAoB;IACpBC,aAAa;IACbC,gBAAgB;IAChBC,yBAAyB;IACzBN,WAAW;IACXO,eAAe;IACfC,8BAA8B;IAC9BC,mBAAmB;IACnBC,YAAY;IACZC,kBAAkB;IAClBC;EACD,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAhB,eAAS,EAAEE,YAAiB,CAAE,CAAC;EAC3C,MAAM;IAAEe,kBAAkB;IAAEC;EAAmB,CAAC,GAC/C,IAAAC,iBAAW,EAAEjB,YAAiB,CAAC;EAEhC,OAAO,IAAAkB,qBAAY,EAChBC,IAAI,IAAM;IACX,IAAKtB,2BAA2B,EAAG;MAClC;IACD;IAEA,SAASuB,WAAWA,CAAEC,KAAK,EAAG;MAC7B;MACA;MACA,IAAK3B,OAAO,K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CAACI,qBAAqB,CAAC,CAAC;MAEnD,IACGd,WAAW,KAAK,YAAY,KAC3Bf,KAAK,CAACmB,OAAO,GAAGsB,WAAW,CAACC,MAAM,IACnC1C,KAAK,CAACmB,OAAO,GAAGsB,WAAW,CAACX,GAAG,CAAE,IACjCf,WAAW,KAAK,UAAU,KACzBf,KAAK,CAACqB,OAAO,GAAGoB,WAAW,CAACT,KAAK,IAClChC,KAAK,CAACqB,OAAO,GAAGoB,WAAW,CAACR,IAAI,CAAI,EACrC;QACDtC,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEA,MAAMgD,KAAK,GAAG3D,aAAa,CAAEoD,QAAS,CAAC;;MAEvC;MACA;MACA,IAAKO,KAAK,KAAK,CAAC,EAAG;QAClBhD,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEAD,kBAAkB,CAAEc,YAAY,EAAEmC,KAAK,EAAE;QACxCC,sBAAsB,EAAE;MACzB,CAAE,CAAC;IACJ;IAEA9C,IAAI,CAAC+C,gBAAgB,CAAE,WAAW,EAAE9C,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZD,IAAI,CAACgD,mBAAmB,CAAE,WAAW,EAAE/C,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACC1B,OAAO,EACPU,oBAAoB,EACpBC,aAAa,EACbC,gBAAgB,EAChBS,kBAAkB,EAClBC,kBAAkB,EAClBT,yBAAyB,EACzBV,2BAA2B,CAE7B,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_data","_element","_i18n","_store","_insertionPoint","_lockUnlock","useInBetweenInserter","openRef","useContext","InsertionPointOpenRef","isInBetweenInserterDisabled","useSelect","select","blockEditorStore","getSettings","isDistractionFree","unlock","isZoomOut","getBlockListSettings","getBlockIndex","isMultiSelecting","getSelectedBlockClientIds","getTemplateLock","__unstableIsWithinBlockOverlay","getBlockEditingMode","getBlockName","getBlockAttributes","getParentSectionBlock","showInsertionPoint","hideInsertionPoint","useDispatch","useRefEffect","node","onMouseMove","event","undefined","current","target","nodeType","TEXT_NODE","classList","contains","rootClientId","blockElement","getAttribute","closest","layout","isManualPlacement","blockListSettings","orientation","captureToolbars","__experimentalCaptureToolbars","offsetTop","clientY","offsetLeft","clientX","children","Array","from","element","find","blockEl","blockElRect","getBoundingClientRect","top","isRTL","right","left","id","firstElementChild","clientId","slice","length","includes","hasFixedToolbar","elementRect","bottom","index","__unstableWithInserter","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-in-between-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { InsertionPointOpenRef } from '../block-tools/insertion-point';\nimport { unlock } from '../../lock-unlock';\n\nexport function useInBetweenInserter() {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isInBetweenInserterDisabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree ||\n\t\t\tunlock( select( blockEditorStore ) ).isZoomOut(),\n\t\t[]\n\t);\n\tconst {\n\t\tgetBlockListSettings,\n\t\tgetBlockIndex,\n\t\tisMultiSelecting,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSettings,\n\t\tgetTemplateLock,\n\t\t__unstableIsWithinBlockOverlay,\n\t\tgetBlockEditingMode,\n\t\tgetBlockName,\n\t\tgetBlockAttributes,\n\t\tgetParentSectionBlock,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isInBetweenInserterDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onMouseMove( event ) {\n\t\t\t\t// openRef is the reference to the insertion point between blocks.\n\t\t\t\t// If the reference is not set or the insertion point is already open, return.\n\t\t\t\tif ( openRef === undefined || openRef.current ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ignore text nodes sometimes detected in FireFox.\n\t\t\t\tif ( event.target.nodeType === event.target.TEXT_NODE ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains(\n\t\t\t\t\t\t'block-editor-block-list__layout'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet rootClientId;\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains( 'is-root-container' )\n\t\t\t\t) {\n\t\t\t\t\tconst blockElement = !! event.target.getAttribute(\n\t\t\t\t\t\t'data-block'\n\t\t\t\t\t)\n\t\t\t\t\t\t? event.target\n\t\t\t\t\t\t: event.target.closest( '[data-block]' );\n\t\t\t\t\trootClientId = blockElement.getAttribute( 'data-block' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled' ||\n\t\t\t\t\tgetBlockName( rootClientId ) === 'core/block' ||\n\t\t\t\t\t( rootClientId &&\n\t\t\t\t\t\tgetBlockAttributes( rootClientId ).layout\n\t\t\t\t\t\t\t?.isManualPlacement )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst blockListSettings = getBlockListSettings( rootClientId );\n\t\t\t\tconst orientation =\n\t\t\t\t\tblockListSettings?.orientation || 'vertical';\n\t\t\t\tconst captureToolbars =\n\t\t\t\t\t!! blockListSettings?.__experimentalCaptureToolbars;\n\t\t\t\tconst offsetTop = event.clientY;\n\t\t\t\tconst offsetLeft = event.clientX;\n\n\t\t\t\tconst children = Array.from( event.target.children );\n\t\t\t\tlet element = children.find( ( blockEl ) => {\n\t\t\t\t\tconst blockElRect = blockEl.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t\t\tblockElRect.top > offsetTop ) ||\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'horizontal' &&\n\t\t\t\t\t\t\t( isRTL()\n\t\t\t\t\t\t\t\t? blockElRect.right < offsetLeft\n\t\t\t\t\t\t\t\t: blockElRect.left > offsetLeft ) )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\t\t\tif ( ! element ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The block may be in an alignment wrapper, so check the first direct\n\t\t\t\t// child if the element has no ID.\n\t\t\t\tif ( ! element.id ) {\n\t\t\t\t\telement = element.firstElementChild;\n\n\t\t\t\t\tif ( ! element ) {\n\t\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't show the insertion point if a parent block has an \"overlay\"\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337\n\t\t\t\tconst clientId = element.id.slice( 'block-'.length );\n\t\t\t\tif (\n\t\t\t\t\t! clientId ||\n\t\t\t\t\t__unstableIsWithinBlockOverlay( clientId ) ||\n\t\t\t\t\t!! getParentSectionBlock( clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Don't show the inserter if the following conditions are met,\n\t\t\t\t// as it conflicts with the block toolbar:\n\t\t\t\t// 1. when hovering above or inside selected block(s)\n\t\t\t\t// 2. when the orientation is vertical\n\t\t\t\t// 3. when the __experimentalCaptureToolbars is not enabled\n\t\t\t\t// 4. when the Top Toolbar is not disabled\n\t\t\t\tif (\n\t\t\t\t\tgetSelectedBlockClientIds().includes( clientId ) &&\n\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t! captureToolbars &&\n\t\t\t\t\t! getSettings().hasFixedToolbar\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst elementRect = element.getBoundingClientRect();\n\n\t\t\t\tif (\n\t\t\t\t\t( orientation === 'horizontal' &&\n\t\t\t\t\t\t( event.clientY > elementRect.bottom ||\n\t\t\t\t\t\t\tevent.clientY < elementRect.top ) ) ||\n\t\t\t\t\t( orientation === 'vertical' &&\n\t\t\t\t\t\t( event.clientX > elementRect.right ||\n\t\t\t\t\t\t\tevent.clientX < elementRect.left ) )\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst index = getBlockIndex( clientId );\n\n\t\t\t\t// Don't show the in-between inserter before the first block in\n\t\t\t\t// the list (preserves the original behaviour).\n\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshowInsertionPoint( rootClientId, index, {\n\t\t\t\t\t__unstableWithInserter: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousemove', onMouseMove );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\topenRef,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockIndex,\n\t\t\tisMultiSelecting,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisInBetweenInserterDisabled,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAA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WAAW,CAACT,KAAK,IAClChC,KAAK,CAACqB,OAAO,GAAGoB,WAAW,CAACR,IAAI,CAAI,EACrC;QACDtC,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEA,MAAMgD,KAAK,GAAG1D,aAAa,CAAEmD,QAAS,CAAC;;MAEvC;MACA;MACA,IAAKO,KAAK,KAAK,CAAC,EAAG;QAClBhD,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEAD,kBAAkB,CAAEc,YAAY,EAAEmC,KAAK,EAAE;QACxCC,sBAAsB,EAAE;MACzB,CAAE,CAAC;IACJ;IAEA9C,IAAI,CAAC+C,gBAAgB,CAAE,WAAW,EAAE9C,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZD,IAAI,CAACgD,mBAAmB,CAAE,WAAW,EAAE/C,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACC1B,OAAO,EACPW,oBAAoB,EACpBC,aAAa,EACbC,gBAAgB,EAChBQ,kBAAkB,EAClBC,kBAAkB,EAClBR,yBAAyB,EACzBX,2BAA2B,CAE7B,CAAC;AACF","ignoreList":[]}
@@ -59,7 +59,7 @@ function Pagination({
59
59
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
60
60
  variant: "muted",
61
61
  children: (0, _i18n.sprintf)(
62
- // translators: %1$s: Current page number, %2$s: Total number of pages.
62
+ // translators: 1: Current page number. 2: Total number of pages.
63
63
  (0, _i18n._x)('%1$s of %2$s', 'paging'), currentPage, numPages)
64
64
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
65
65
  expanded: false,
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_jsxRuntime","Pagination","currentPage","numPages","changePage","totalItems","jsxs","__experimentalVStack","className","children","jsx","__experimentalText","variant","sprintf","_n","__experimentalHStack","expanded","spacing","justify","Button","onClick","disabled","__","size","accessibleWhenDisabled","_x"],"sources":["@wordpress/block-editor/src/components/block-patterns-paging/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n} ) {\n\treturn (\n\t\t<VStack className=\"block-editor-patterns__grid-pagination-wrapper\">\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\t_n( '%s item', '%s items', totalItems ),\n\t\t\t\t\ttotalItems\n\t\t\t\t) }\n\t\t\t</Text>\n\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<HStack\n\t\t\t\t\texpanded={ false }\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination\"\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-previous\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\t\taria-label={ __( 'First page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>«</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( currentPage - 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\t\taria-label={ __( 'Previous page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>‹</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %1$s: Current page number, %2$s: Total number of pages.\n\t\t\t\t\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t\t\t\t\tcurrentPage,\n\t\t\t\t\t\t\tnumPages\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-next\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( currentPage + 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\t\taria-label={ __( 'Next page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>›</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( numPages ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\t\taria-label={ __( 'Last page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-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,WAAY,CAAG;UAChCC,IAAI,EAAC,SAAS;UACdC,sBAAsB;UACtBhB,SAAS,EAAC,+CAA+C;UAAAC,QAAA,eAEzD,IAAAT,WAAA,CAAAU,GAAA;YAAAD,QAAA,EAAM;UAAC,CAAM;QAAC,CACP,CAAC,eACT,IAAAT,WAAA,CAAAU,GAAA,EAACb,WAAA,CAAAsB,MAAM;UACNP,OAAO,EAAC,UAAU;UAClBQ,OAAO,EAAGA,CAAA,KAAMhB,UAAU,CAAED,QAAS,CAAG;UACxCkB,QAAQ,EAAGnB,WAAW,KAAKC,QAAU;UACrC,cAAa,IAAAmB,QAAE,EAAE,WAAY,CAAG;UAChCC,IAAI,EAAC,SAAS;UACdC,sBAAsB;UACtBhB,SAAS,EAAC,+CAA+C;UAAAC,QAAA,eAEzD,IAAAT,WAAA,CAAAU,GAAA;YAAAD,QAAA,EAAM;UAAC,CAAM;QAAC,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF,CACR;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_jsxRuntime","Pagination","currentPage","numPages","changePage","totalItems","jsxs","__experimentalVStack","className","children","jsx","__experimentalText","variant","sprintf","_n","__experimentalHStack","expanded","spacing","justify","Button","onClick","disabled","__","size","accessibleWhenDisabled","_x"],"sources":["@wordpress/block-editor/src/components/block-patterns-paging/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n} ) {\n\treturn (\n\t\t<VStack className=\"block-editor-patterns__grid-pagination-wrapper\">\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\t_n( '%s item', '%s items', totalItems ),\n\t\t\t\t\ttotalItems\n\t\t\t\t) }\n\t\t\t</Text>\n\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<HStack\n\t\t\t\t\texpanded={ false }\n\t\t\t\t\tspacing={ 3 }\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination\"\n\t\t\t\t>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-previous\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\t\taria-label={ __( 'First page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>«</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( currentPage - 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\t\t\taria-label={ __( 'Previous page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>‹</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: 1: Current page number. 2: Total number of pages.\n\t\t\t\t\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t\t\t\t\tcurrentPage,\n\t\t\t\t\t\t\tnumPages\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<HStack\n\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-next\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( currentPage + 1 ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\t\taria-label={ __( 'Next page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>›</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => changePage( numPages ) }\n\t\t\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\t\t\taria-label={ __( 'Last page' ) }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"block-editor-patterns__grid-pagination-button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>»</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AAAsD,IAAAE,WAAA,GAAAF,OAAA;AATtD;AACA;AACA;;AASe,SAASG,UAAUA,CAAE;EACnCC,WAAW;EACXC,QAAQ;EACRC,UAAU;EACVC;AACD,CAAC,EAAG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mB,QAAE,EAAE,WAAY,CAAG;UAChCC,IAAI,EAAC,SAAS;UACdC,sBAAsB;UACtBhB,SAAS,EAAC,+CAA+C;UAAAC,QAAA,eAEzD,IAAAT,WAAA,CAAAU,GAAA;YAAAD,QAAA,EAAM;UAAC,CAAM;QAAC,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF,CACR;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
@@ -8,13 +8,10 @@ exports.default = exports.PrivateBlockPopover = void 0;
8
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
9
  var _compose = require("@wordpress/compose");
10
10
  var _components = require("@wordpress/components");
11
- var _data = require("@wordpress/data");
12
11
  var _element = require("@wordpress/element");
13
12
  var _useBlockRefs = require("../block-list/use-block-props/use-block-refs");
14
13
  var _usePopoverScroll = _interopRequireDefault(require("./use-popover-scroll"));
15
14
  var _dom = require("../../utils/dom");
16
- var _store = require("../../store");
17
- var _lockUnlock = require("../../lock-unlock");
18
15
  var _jsxRuntime = require("react/jsx-runtime");
19
16
  /**
20
17
  * External dependencies
@@ -64,61 +61,21 @@ function BlockPopover({
64
61
  observer.disconnect();
65
62
  };
66
63
  }, [selectedElement]);
67
- const {
68
- isZoomOut,
69
- parentSectionBlock,
70
- isSectionSelected
71
- } = (0, _data.useSelect)(select => {
72
- var _getParentSectionBloc;
73
- const {
74
- isZoomOut: isZoomOutSelector,
75
- getSectionRootClientId,
76
- getParentSectionBlock,
77
- getBlockOrder
78
- } = (0, _lockUnlock.unlock)(select(_store.store));
79
- return {
80
- isZoomOut: isZoomOutSelector(),
81
- parentSectionBlock: (_getParentSectionBloc = getParentSectionBlock(clientId)) !== null && _getParentSectionBloc !== void 0 ? _getParentSectionBloc : clientId,
82
- isSectionSelected: getBlockOrder(getSectionRootClientId()).includes(clientId)
83
- };
84
- }, [clientId]);
85
-
86
- // This element is used to position the zoom out view vertical toolbar
87
- // correctly, relative to the selected section.
88
- const parentSectionElement = (0, _useBlockRefs.useBlockElement)(parentSectionBlock);
89
64
  const popoverAnchor = (0, _element.useMemo)(() => {
90
65
  if (
91
66
  // popoverDimensionsRecomputeCounter is by definition always equal or greater
92
67
  // than 0. This check is only there to satisfy the correctness of the
93
68
  // exhaustive-deps rule for the `useMemo` hook.
94
- popoverDimensionsRecomputeCounter < 0 || isZoomOut && !parentSectionElement || !selectedElement || bottomClientId && !lastSelectedElement) {
69
+ popoverDimensionsRecomputeCounter < 0 || !selectedElement || bottomClientId && !lastSelectedElement) {
95
70
  return undefined;
96
71
  }
97
72
  return {
98
73
  getBoundingClientRect() {
99
- // The zoom out view has a vertical block toolbar that should always
100
- // be on the edge of the canvas, aligned to the top of the currently
101
- // selected section. This condition changes the anchor of the toolbar
102
- // to the section instead of the block to handle blocks that are
103
- // not full width and nested blocks to keep section height.
104
- if (isZoomOut && isSectionSelected) {
105
- // Compute the height based on the parent section of the
106
- // selected block, because the selected block may be
107
- // shorter than the section.
108
- const canvasElementRect = (0, _dom.getVisibleElementBounds)(__unstableContentRef.current);
109
- const parentSectionElementRect = (0, _dom.getVisibleElementBounds)(parentSectionElement);
110
- const anchorHeight = parentSectionElementRect.bottom - parentSectionElementRect.top;
111
-
112
- // Always use the width of the section root element to make sure
113
- // the toolbar is always on the edge of the canvas.
114
- const anchorWidth = canvasElementRect.width;
115
- return new window.DOMRectReadOnly(canvasElementRect.left, parentSectionElementRect.top, anchorWidth, anchorHeight);
116
- }
117
74
  return lastSelectedElement ? (0, _dom.rectUnion)((0, _dom.getVisibleElementBounds)(selectedElement), (0, _dom.getVisibleElementBounds)(lastSelectedElement)) : (0, _dom.getVisibleElementBounds)(selectedElement);
118
75
  },
119
76
  contextElement: selectedElement
120
77
  };
121
- }, [popoverDimensionsRecomputeCounter, isZoomOut, parentSectionElement, selectedElement, bottomClientId, lastSelectedElement, isSectionSelected, __unstableContentRef]);
78
+ }, [popoverDimensionsRecomputeCounter, selectedElement, bottomClientId, lastSelectedElement]);
122
79
  if (!selectedElement || bottomClientId && !lastSelectedElement) {
123
80
  return null;
124
81
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_components","_data","_element","_useBlockRefs","_usePopoverScroll","_dom","_store","_lockUnlock","_jsxRuntime","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","useBlockElement","lastSelectedElement","mergedRefs","useMergeRefs","usePopoverScroll","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","useReducer","s","useLayoutEffect","observer","window","MutationObserver","observe","attributes","disconnect","isZoomOut","parentSectionBlock","isSectionSelected","useSelect","select","_getParentSectionBloc","isZoomOutSelector","getSectionRootClientId","getParentSectionBlock","getBlockOrder","unlock","blockEditorStore","includes","parentSectionElement","popoverAnchor","useMemo","undefined","getBoundingClientRect","canvasElementRect","getVisibleElementBounds","current","parentSectionElementRect","anchorHeight","bottom","top","anchorWidth","width","DOMRectReadOnly","left","rectUnion","contextElement","jsx","Popover","animate","focusOnMount","anchor","__unstableSlotName","inline","placement","resize","flip","className","clsx","variant","PrivateBlockPopover","exports","forwardRef","PublicBlockPopover","_default","default"],"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { Popover } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\nimport { rectUnion, getVisibleElementBounds } from '../../utils/dom';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nfunction BlockPopover(\n\t{\n\t\tclientId,\n\t\tbottomClientId,\n\t\tchildren,\n\t\t__unstablePopoverSlot,\n\t\t__unstableContentRef,\n\t\tshift = true,\n\t\t...props\n\t},\n\tref\n) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tusePopoverScroll( __unstableContentRef ),\n\t] );\n\n\tconst [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tforceRecomputePopoverDimensions,\n\t] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\t// When blocks are moved up/down, they are animated to their new position by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new window.MutationObserver(\n\t\t\tforceRecomputePopoverDimensions\n\t\t);\n\t\tobserver.observe( selectedElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ selectedElement ] );\n\n\tconst { isZoomOut, parentSectionBlock, isSectionSelected } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisZoomOut: isZoomOutSelector,\n\t\t\t\tgetSectionRootClientId,\n\t\t\t\tgetParentSectionBlock,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\treturn {\n\t\t\t\tisZoomOut: isZoomOutSelector(),\n\t\t\t\tparentSectionBlock:\n\t\t\t\t\tgetParentSectionBlock( clientId ) ?? clientId,\n\t\t\t\tisSectionSelected: getBlockOrder(\n\t\t\t\t\tgetSectionRootClientId()\n\t\t\t\t).includes( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// This element is used to position the zoom out view vertical toolbar\n\t// correctly, relative to the selected section.\n\tconst parentSectionElement = useBlockElement( parentSectionBlock );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t( isZoomOut && ! parentSectionElement ) ||\n\t\t\t! selectedElement ||\n\t\t\t( bottomClientId && ! lastSelectedElement )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\t// The zoom out view has a vertical block toolbar that should always\n\t\t\t\t// be on the edge of the canvas, aligned to the top of the currently\n\t\t\t\t// selected section. This condition changes the anchor of the toolbar\n\t\t\t\t// to the section instead of the block to handle blocks that are\n\t\t\t\t// not full width and nested blocks to keep section height.\n\t\t\t\tif ( isZoomOut && isSectionSelected ) {\n\t\t\t\t\t// Compute the height based on the parent section of the\n\t\t\t\t\t// selected block, because the selected block may be\n\t\t\t\t\t// shorter than the section.\n\t\t\t\t\tconst canvasElementRect = getVisibleElementBounds(\n\t\t\t\t\t\t__unstableContentRef.current\n\t\t\t\t\t);\n\t\t\t\t\tconst parentSectionElementRect =\n\t\t\t\t\t\tgetVisibleElementBounds( parentSectionElement );\n\t\t\t\t\tconst anchorHeight =\n\t\t\t\t\t\tparentSectionElementRect.bottom -\n\t\t\t\t\t\tparentSectionElementRect.top;\n\n\t\t\t\t\t// Always use the width of the section root element to make sure\n\t\t\t\t\t// the toolbar is always on the edge of the canvas.\n\t\t\t\t\tconst anchorWidth = canvasElementRect.width;\n\t\t\t\t\treturn new window.DOMRectReadOnly(\n\t\t\t\t\t\tcanvasElementRect.left,\n\t\t\t\t\t\tparentSectionElementRect.top,\n\t\t\t\t\t\tanchorWidth,\n\t\t\t\t\t\tanchorHeight\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn lastSelectedElement\n\t\t\t\t\t? rectUnion(\n\t\t\t\t\t\t\tgetVisibleElementBounds( selectedElement ),\n\t\t\t\t\t\t\tgetVisibleElementBounds( lastSelectedElement )\n\t\t\t\t\t )\n\t\t\t\t\t: getVisibleElementBounds( selectedElement );\n\t\t\t},\n\t\t\tcontextElement: selectedElement,\n\t\t};\n\t}, [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tisZoomOut,\n\t\tparentSectionElement,\n\t\tselectedElement,\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t\tisSectionSelected,\n\t\t__unstableContentRef,\n\t] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ mergedRefs }\n\t\t\tanimate={ false }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchor={ popoverAnchor }\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 }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\tplacement=\"top-start\"\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'block-editor-block-popover', props.className ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ children }\n\t\t</Popover>\n\t);\n}\n\nexport const PrivateBlockPopover = forwardRef( BlockPopover );\n\nconst PublicBlockPopover = (\n\t{ clientId, bottomClientId, children, ...props },\n\tref\n) => (\n\t<PrivateBlockPopover\n\t\t{ ...props }\n\t\tbottomClientId={ bottomClientId }\n\t\tclientId={ clientId }\n\t\t__unstableContentRef={ undefined }\n\t\t__unstablePopoverSlot={ undefined }\n\t\tref={ ref }\n\t>\n\t\t{ children }\n\t</PrivateBlockPopover>\n);\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-popover/README.md\n */\nexport default forwardRef( PublicBlockPopover );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAUA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAzB3C;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAOA,MAAMW,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,SAASC,YAAYA,CACpB;EACCC,QAAQ;EACRC,cAAc;EACdC,QAAQ;EACRC,qBAAqB;EACrBC,oBAAoB;EACpBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACJ,CAAC,EACDC,GAAG,EACF;EACD,MAAMC,eAAe,GAAG,IAAAC,6BAAe,EAAET,QAAS,CAAC;EACnD,MAAMU,mBAAmB,GAAG,IAAAD,6BAAe,EAAER,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAID,QAAS,CAAC;EACzE,MAAMW,UAAU,GAAG,IAAAC,qBAAY,EAAE,CAChCL,GAAG,EACH,IAAAM,yBAAgB,EAAET,oBAAqB,CAAC,CACvC,CAAC;EAEH,MAAM,CACLU,iCAAiC,EACjCC,+BAA+B,CAC/B,GAAG,IAAAC,mBAAU;EACb;EACEC,CAAC,IAAM,CAAEA,C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EAAGrB;IACT;IACA;IAAA;IACAsB,kBAAkB,EAAG1D,qBAAuB;IAC5C2D,MAAM,EAAG,CAAE3D,qBAAuB;IAClC4D,SAAS,EAAC,WAAW;IACrBC,MAAM,EAAG,KAAO;IAChBC,IAAI,EAAG,KAAO;IACd5D,KAAK,EAAGA,KAAO;IAAA,GACVC,KAAK;IACV4D,SAAS,EAAG,IAAAC,aAAI,EAAE,4BAA4B,EAAE7D,KAAK,CAAC4D,SAAU,CAAG;IACnEE,OAAO,EAAC,UAAU;IAAAlE,QAAA,EAEhBA;EAAQ,CACF,CAAC;AAEZ;AAEO,MAAMmE,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,mBAAU,EAAExE,YAAa,CAAC;AAE7D,MAAMyE,kBAAkB,GAAGA,CAC1B;EAAExE,QAAQ;EAAEC,cAAc;EAAEC,QAAQ;EAAE,GAAGI;AAAM,CAAC,EAChDC,GAAG,kBAEH,IAAAZ,WAAA,CAAA6D,GAAA,EAACa,mBAAmB;EAAA,GACd/D,KAAK;EACVL,cAAc,EAAGA,cAAgB;EACjCD,QAAQ,EAAGA,QAAU;EACrBI,oBAAoB,EAAGqC,SAAW;EAClCtC,qBAAqB,EAAGsC,SAAW;EACnClC,GAAG,EAAGA,GAAK;EAAAL,QAAA,EAETA;AAAQ,CACU,CACrB;;AAED;AACA;AACA;AAFA,IAAAuE,QAAA,GAAAH,OAAA,CAAAI,OAAA,GAGe,IAAAH,mBAAU,EAAEC,kBAAmB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_components","_element","_useBlockRefs","_usePopoverScroll","_dom","_jsxRuntime","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","useBlockElement","lastSelectedElement","mergedRefs","useMergeRefs","usePopoverScroll","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","useReducer","s","useLayoutEffect","observer","window","MutationObserver","observe","attributes","disconnect","popoverAnchor","useMemo","undefined","getBoundingClientRect","rectUnion","getVisibleElementBounds","contextElement","jsx","Popover","animate","focusOnMount","anchor","__unstableSlotName","inline","placement","resize","flip","className","clsx","variant","PrivateBlockPopover","exports","forwardRef","PublicBlockPopover","_default","default"],"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { Popover } from '@wordpress/components';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\nimport { rectUnion, getVisibleElementBounds } from '../../utils/dom';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nfunction BlockPopover(\n\t{\n\t\tclientId,\n\t\tbottomClientId,\n\t\tchildren,\n\t\t__unstablePopoverSlot,\n\t\t__unstableContentRef,\n\t\tshift = true,\n\t\t...props\n\t},\n\tref\n) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tusePopoverScroll( __unstableContentRef ),\n\t] );\n\n\tconst [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tforceRecomputePopoverDimensions,\n\t] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\t// When blocks are moved up/down, they are animated to their new position by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new window.MutationObserver(\n\t\t\tforceRecomputePopoverDimensions\n\t\t);\n\t\tobserver.observe( selectedElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ selectedElement ] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\t( bottomClientId && ! lastSelectedElement )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn lastSelectedElement\n\t\t\t\t\t? rectUnion(\n\t\t\t\t\t\t\tgetVisibleElementBounds( selectedElement ),\n\t\t\t\t\t\t\tgetVisibleElementBounds( lastSelectedElement )\n\t\t\t\t\t )\n\t\t\t\t\t: getVisibleElementBounds( selectedElement );\n\t\t\t},\n\t\t\tcontextElement: selectedElement,\n\t\t};\n\t}, [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tselectedElement,\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ mergedRefs }\n\t\t\tanimate={ false }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchor={ popoverAnchor }\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 }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\tplacement=\"top-start\"\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'block-editor-block-popover', props.className ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ children }\n\t\t</Popover>\n\t);\n}\n\nexport const PrivateBlockPopover = forwardRef( BlockPopover );\n\nconst PublicBlockPopover = (\n\t{ clientId, bottomClientId, children, ...props },\n\tref\n) => (\n\t<PrivateBlockPopover\n\t\t{ ...props }\n\t\tbottomClientId={ bottomClientId }\n\t\tclientId={ clientId }\n\t\t__unstableContentRef={ undefined }\n\t\t__unstablePopoverSlot={ undefined }\n\t\tref={ ref }\n\t>\n\t\t{ children }\n\t</PrivateBlockPopover>\n);\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-popover/README.md\n */\nexport default forwardRef( PublicBlockPopover );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAUA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAAqE,IAAAO,WAAA,GAAAP,OAAA;AAtBrE;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAKA,MAAMQ,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,SAASC,YAAYA,CACpB;EACCC,QAAQ;EACRC,cAAc;EACdC,QAAQ;EACRC,qBAAqB;EACrBC,oBAAoB;EACpBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACJ,CAAC,EACDC,GAAG,EACF;EACD,MAAMC,eAAe,GAAG,IAAAC,6BAAe,EAAET,QAAS,CAAC;E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reList":[]}
@@ -63,7 +63,7 @@ function BlockPreview({
63
63
  ...originalSettings,
64
64
  focusMode: false,
65
65
  // Disable "Spotlight mode".
66
- __unstableIsPreviewMode: true
66
+ isPreviewMode: true
67
67
  }), [originalSettings]);
68
68
  const renderedBlocks = (0, _element.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]);
69
69
  if (!blocks || blocks.length === 0) {
@@ -119,7 +119,7 @@ function useBlockPreview({
119
119
  // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
120
120
  focusMode: false,
121
121
  // Disable "Spotlight mode".
122
- __unstableIsPreviewMode: true
122
+ isPreviewMode: true
123
123
  }), [originalSettings]);
124
124
  const disabledRef = (0, _compose.useDisabled)();
125
125
  const ref = (0, _compose.useMergeRefs)([props.ref, disabledRef]);
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_element","_deprecated","_provider","_auto","_editorStyles","_store","_blockList","_jsxRuntime","EMPTY_ADDITIONAL_STYLES","BlockPreview","blocks","viewportWidth","minHeight","additionalStyles","__experimentalMinHeight","__experimentalPadding","deprecated","since","version","alternative","css","originalSettings","useSelect","select","blockEditorStore","getSettings","settings","useMemo","focusMode","__unstableIsPreviewMode","renderedBlocks","Array","isArray","length","jsx","ExperimentalBlockEditorProvider","value","children","default","_default","exports","memo","useBlockPreview","props","layout","styles","undefined","disabledRef","useDisabled","ref","useMergeRefs","jsxs","BlockListItems","renderAppender","className","clsx"],"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDisabled, useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { ExperimentalBlockEditorProvider } from '../provider';\nimport AutoHeightBlockPreview from './auto';\nimport EditorStyles from '../editor-styles';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockListItems } from '../block-list';\n\nconst EMPTY_ADDITIONAL_STYLES = [];\n\nexport function BlockPreview( {\n\tblocks,\n\tviewportWidth = 1200,\n\tminHeight,\n\tadditionalStyles = EMPTY_ADDITIONAL_STYLES,\n\t// Deprecated props:\n\t__experimentalMinHeight,\n\t__experimentalPadding,\n} ) {\n\tif ( __experimentalMinHeight ) {\n\t\tminHeight = __experimentalMinHeight;\n\t\tdeprecated( 'The __experimentalMinHeight prop', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'minHeight',\n\t\t} );\n\t}\n\tif ( __experimentalPadding ) {\n\t\tadditionalStyles = [\n\t\t\t...additionalStyles,\n\t\t\t{ css: `body { padding: ${ __experimentalPadding }px; }` },\n\t\t];\n\t\tdeprecated( 'The __experimentalPadding prop of BlockPreview', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'additionalStyles',\n\t\t} );\n\t}\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tif ( ! blocks || blocks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<AutoHeightBlockPreview\n\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tadditionalStyles={ additionalStyles }\n\t\t\t/>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n\n/**\n * BlockPreview renders a preview of a block or array of blocks.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md\n *\n * @param {Object} preview options for how the preview should be shown\n * @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed.\n * @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700.\n *\n * @return {Component} The component to be rendered.\n */\nexport default memo( BlockPreview );\n\n/**\n * This hook is used to lightly mark an element as a block preview wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * a block preview wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} options Preview options.\n * @param {WPBlock[]} options.blocks Block objects.\n * @param {Object} options.props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options.layout Layout settings to be used in the preview.\n */\nexport function useBlockPreview( { blocks, props = {}, layout } ) {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tstyles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst disabledRef = useDisabled();\n\tconst ref = useMergeRefs( [ props.ref, disabledRef ] );\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst children = (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<EditorStyles />\n\t\t\t<BlockListItems renderAppender={ false } layout={ layout } />\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-preview__live-content',\n\t\t\t'components-disabled'\n\t\t),\n\t\tchildren: blocks?.length ? children : null,\n\t};\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,aAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAA+C,IAAAU,WAAA,GAAAV,OAAA;AApB/C;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAOA,MAAMW,uBAAuB,GAAG,EAAE;AAE3B,SAASC,YAAYA,CAAE;EAC7BC,MAAM;EACNC,aAAa,GAAG,IAAI;EACpBC,SAAS;EACTC,gBAAgB,GAAGL,uBAAuB;EAC1C;EACAM,uBAAuB;EACvBC;AACD,CAAC,EAAG;EACH,IAAKD,uBAAuB,EAAG;IAC9BF,SAAS,GAAGE,uBAAuB;IACnC,IAAAE,mBAAU,EAAE,kCAAkC,EAAE;MAC/CC,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd,CAAE,CAAC;EACJ;EACA,IAAKJ,qBAAqB,EAAG;IAC5BF,gBAAgB,GAAG,CAClB,GAAGA,gBAAgB,EACnB;MAAEO,GAAG,EAAE,mBAAoBL,qBAAqB;IAAS,CAAC,CAC1D;IACD,IAAAC,mBAAU,EAAE,gDAAgD,EAAE;MAC7DC,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,MAAM,EAAEuB,MAAM,GAAGI,QAAQ,GAAG;EACvC,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_element","_deprecated","_provider","_auto","_editorStyles","_store","_blockList","_jsxRuntime","EMPTY_ADDITIONAL_STYLES","BlockPreview","blocks","viewportWidth","minHeight","additionalStyles","__experimentalMinHeight","__experimentalPadding","deprecated","since","version","alternative","css","originalSettings","useSelect","select","blockEditorStore","getSettings","settings","useMemo","focusMode","isPreviewMode","renderedBlocks","Array","isArray","length","jsx","ExperimentalBlockEditorProvider","value","children","default","_default","exports","memo","useBlockPreview","props","layout","styles","undefined","disabledRef","useDisabled","ref","useMergeRefs","jsxs","BlockListItems","renderAppender","className","clsx"],"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDisabled, useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { ExperimentalBlockEditorProvider } from '../provider';\nimport AutoHeightBlockPreview from './auto';\nimport EditorStyles from '../editor-styles';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockListItems } from '../block-list';\n\nconst EMPTY_ADDITIONAL_STYLES = [];\n\nexport function BlockPreview( {\n\tblocks,\n\tviewportWidth = 1200,\n\tminHeight,\n\tadditionalStyles = EMPTY_ADDITIONAL_STYLES,\n\t// Deprecated props:\n\t__experimentalMinHeight,\n\t__experimentalPadding,\n} ) {\n\tif ( __experimentalMinHeight ) {\n\t\tminHeight = __experimentalMinHeight;\n\t\tdeprecated( 'The __experimentalMinHeight prop', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'minHeight',\n\t\t} );\n\t}\n\tif ( __experimentalPadding ) {\n\t\tadditionalStyles = [\n\t\t\t...additionalStyles,\n\t\t\t{ css: `body { padding: ${ __experimentalPadding }px; }` },\n\t\t];\n\t\tdeprecated( 'The __experimentalPadding prop of BlockPreview', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'additionalStyles',\n\t\t} );\n\t}\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tif ( ! blocks || blocks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<AutoHeightBlockPreview\n\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tadditionalStyles={ additionalStyles }\n\t\t\t/>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n\n/**\n * BlockPreview renders a preview of a block or array of blocks.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md\n *\n * @param {Object} preview options for how the preview should be shown\n * @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed.\n * @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700.\n *\n * @return {Component} The component to be rendered.\n */\nexport default memo( BlockPreview );\n\n/**\n * This hook is used to lightly mark an element as a block preview wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * a block preview wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} options Preview options.\n * @param {WPBlock[]} options.blocks Block objects.\n * @param {Object} options.props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options.layout Layout settings to be used in the preview.\n */\nexport function useBlockPreview( { blocks, props = {}, layout } ) {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tstyles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst disabledRef = useDisabled();\n\tconst ref = useMergeRefs( [ props.ref, disabledRef ] );\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst children = (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<EditorStyles />\n\t\t\t<BlockListItems renderAppender={ false } layout={ layout } />\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-preview__live-content',\n\t\t\t'components-disabled'\n\t\t),\n\t\tchildren: blocks?.length ? children : null,\n\t};\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAP,s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G,IAAAC,qBAAY,EAAE,CAAEP,KAAK,CAACM,GAAG,EAAEF,WAAW,CAAG,CAAC;EACtD,MAAMjB,cAAc,GAAG,IAAAH,gBAAO,EAC7B,MAAQI,KAAK,CAACC,OAAO,CAAEtB,MAAO,CAAC,GAAGA,MAAM,GAAG,CAAEA,MAAM,CAAI,EACvD,CAAEA,MAAM,CACT,CAAC;EAED,MAAM2B,QAAQ,gBACb,IAAA9B,WAAA,CAAA4C,IAAA,EAACjD,SAAA,CAAAiC,+BAA+B;IAC/BC,KAAK,EAAGN,cAAgB;IACxBJ,QAAQ,EAAGA,QAAU;IAAAW,QAAA,gBAErB,IAAA9B,WAAA,CAAA2B,GAAA,EAAC9B,aAAA,CAAAkC,OAAY,IAAE,CAAC,eAChB,IAAA/B,WAAA,CAAA2B,GAAA,EAAC5B,UAAA,CAAA8C,cAAc;MAACC,cAAc,EAAG,KAAO;MAACT,MAAM,EAAGA;IAAQ,CAAE,CAAC;EAAA,CAC7B,CACjC;EAED,OAAO;IACN,GAAGD,KAAK;IACRM,GAAG;IACHK,SAAS,EAAE,IAAAC,aAAI,EACdZ,KAAK,CAACW,SAAS,EACf,0CAA0C,EAC1C,qBACD,CAAC;IACDjB,QAAQ,EAAE3B,MAAM,EAAEuB,MAAM,GAAGI,QAAQ,GAAG;EACvC,CAAC;AACF","ignoreList":[]}
@@ -16,6 +16,7 @@ var _keycodes = require("@wordpress/keycodes");
16
16
  var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
17
17
  var _compose = require("@wordpress/compose");
18
18
  var _blockActions = _interopRequireDefault(require("../block-actions"));
19
+ var _blockCommentIconSlot = _interopRequireDefault(require("../../components/collab/block-comment-icon-slot"));
19
20
  var _blockHtmlConvertButton = _interopRequireDefault(require("./block-html-convert-button"));
20
21
  var _blockSettingsMenuFirstItem = _interopRequireDefault(require("./block-settings-menu-first-item"));
21
22
  var _blockSettingsMenuControls = _interopRequireDefault(require("../block-settings-menu-controls"));
@@ -221,6 +222,10 @@ function BlockSettingsDropdown({
221
222
  shortcut: shortcuts.insertAfter,
222
223
  children: (0, _i18n.__)('Add after')
223
224
  })]
225
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockCommentIconSlot.default.Slot, {
226
+ fillProps: {
227
+ onClose
228
+ }
224
229
  })]
225
230
  }), canCopyStyles && !isContentOnly && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.MenuGroup, {
226
231
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CopyMenuItem, {
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_components","_data","_icons","_element","_i18n","_keycodes","_keyboardShortcuts","_compose","_blockActions","_interopRequireDefault","_blockHtmlConvertButton","_blockSettingsMenuFirstItem","_blockSettingsMenuControls","_blockParentSelectorMenuItem","_store","_lockUnlock","_jsxRuntime","POPOVER_PROPS","className","placement","CopyMenuItem","clientIds","onCopy","label","shortcut","getBlocksByClientId","useSelect","blockEditorStore","ref","useCopyToClipboard","serialize","copyMenuItemLabel","__","jsx","MenuItem","children","BlockSettingsDropdown","block","__experimentalSelectBlock","props","currentClientId","clientId","count","length","firstBlockClientId","firstParentClientId","parentBlockType","previousBlockClientId","selectedBlockClientIds","openedBlockSettingsMenu","isContentOnly","select","getBlockName","getBlockRootClientId","getPreviousBlockClientId","getSelectedBlockClientIds","getBlockAttributes","getOpenedBlockSettingsMenu","getBlockEditingMode","unlock","getActiveBlockVariation","blocksStore","_firstParentClientId","parentBlockName","getBlockType","getBlockOrder","setOpenedBlockSettingsMenu","useDispatch","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","duplicate","remove","insertAfter","insertBefore","hasSelectedBlocks","updateSelectionAfterDuplicate","clientIdsPromise","ids","updateSelectionAfterRemove","blockToFocus","shouldUpdateSelection","parentBlockIsSelected","includes","open","undefined","onToggle","localOpen","shouldShowBlockParentMenuItem","default","__experimentalUpdateSelection","canCopyStyles","canDuplicate","canInsertBlock","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onPasteStyles","isEmpty","DropdownMenu","icon","moreVertical","popoverProps","noIcons","onClose","jsxs","Fragment","MenuGroup","Slot","fillProps","parentClientId","displayShortcut","primary","onClick","pipe","Children","map","child","cloneElement","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tserialize,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport { Children, cloneElement } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { pipe, useCopyToClipboard } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport BlockParentSelectorMenuItem from './block-parent-selector-menu-item';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\nfunction CopyMenuItem( { clientIds, onCopy, label, shortcut } ) {\n\tconst { getBlocksByClientId } = useSelect( blockEditorStore );\n\tconst ref = useCopyToClipboard(\n\t\t() => serialize( getBlocksByClientId( clientIds ) ),\n\t\tonCopy\n\t);\n\tconst copyMenuItemLabel = label ? label : __( 'Copy' );\n\treturn (\n\t\t<MenuItem ref={ ref } shortcut={ shortcut }>\n\t\t\t{ copyMenuItemLabel }\n\t\t</MenuItem>\n\t);\n}\n\nexport function BlockSettingsDropdown( {\n\tblock,\n\tclientIds,\n\tchildren,\n\t__experimentalSelectBlock,\n\t...props\n} ) {\n\t// Get the client id of the current block for this menu, if one is set.\n\tconst currentClientId = block?.clientId;\n\tconst count = clientIds.length;\n\tconst firstBlockClientId = clientIds[ 0 ];\n\tconst {\n\t\tfirstParentClientId,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tselectedBlockClientIds,\n\t\topenedBlockSettingsMenu,\n\t\tisContentOnly,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetOpenedBlockSettingsMenu,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst { getActiveBlockVariation } = select( blocksStore );\n\n\t\t\tconst _firstParentClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\t\t\tconst parentBlockName =\n\t\t\t\t_firstParentClientId && getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tparentBlockType:\n\t\t\t\t\t_firstParentClientId &&\n\t\t\t\t\t( getActiveBlockVariation(\n\t\t\t\t\t\tparentBlockName,\n\t\t\t\t\t\tgetBlockAttributes( _firstParentClientId )\n\t\t\t\t\t) ||\n\t\t\t\t\t\tgetBlockType( parentBlockName ) ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t\topenedBlockSettingsMenu: getOpenedBlockSettingsMenu(),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( firstBlockClientId ) === 'contentOnly',\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\tconst { getBlockOrder, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { setOpenedBlockSettingsMenu } = unlock(\n\t\tuseDispatch( blockEditorStore )\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\tconst hasSelectedBlocks = selectedBlockClientIds.length > 0;\n\n\tasync function updateSelectionAfterDuplicate( clientIdsPromise ) {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst ids = await clientIdsPromise;\n\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t__experimentalSelectBlock( ids[ 0 ], false );\n\t\t}\n\t}\n\n\tfunction updateSelectionAfterRemove() {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet blockToFocus = previousBlockClientId || firstParentClientId;\n\n\t\t// Focus the first block if there's no previous block nor parent block.\n\t\tif ( ! blockToFocus ) {\n\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t}\n\n\t\t// Only update the selection if the original selection is removed.\n\t\tconst shouldUpdateSelection =\n\t\t\thasSelectedBlocks && getSelectedBlockClientIds().length === 0;\n\n\t\t__experimentalSelectBlock( blockToFocus, shouldUpdateSelection );\n\t}\n\n\t// This can occur when the selected block (the parent)\n\t// displays child blocks within a List View.\n\tconst parentBlockIsSelected =\n\t\tselectedBlockClientIds?.includes( firstParentClientId );\n\n\t// When a currentClientId is in use, treat the menu as a controlled component.\n\t// This ensures that only one block settings menu is open at a time.\n\t// This is a temporary solution to work around an issue with `onFocusOutside`\n\t// where it does not allow a dropdown to be closed if focus was never within\n\t// the dropdown to begin with. Examples include a user either CMD+Clicking or\n\t// right clicking into an inactive window.\n\t// See: https://github.com/WordPress/gutenberg/pull/54083\n\tconst open = ! currentClientId\n\t\t? undefined\n\t\t: openedBlockSettingsMenu === currentClientId || false;\n\n\tfunction onToggle( localOpen ) {\n\t\tif ( localOpen && openedBlockSettingsMenu !== currentClientId ) {\n\t\t\tsetOpenedBlockSettingsMenu( currentClientId );\n\t\t} else if (\n\t\t\t! localOpen &&\n\t\t\topenedBlockSettingsMenu &&\n\t\t\topenedBlockSettingsMenu === currentClientId\n\t\t) {\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t}\n\t}\n\n\tconst shouldShowBlockParentMenuItem =\n\t\t! parentBlockIsSelected && !! firstParentClientId;\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\tcanCopyStyles,\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertBlock,\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\tonPasteStyles,\n\t\t\t} ) => {\n\t\t\t\t// It is possible that some plugins register fills for this menu\n\t\t\t\t// even if Core doesn't render anything in the block settings menu.\n\t\t\t\t// in which case, we may want to render the menu anyway.\n\t\t\t\t// That said for now, we can start more conservative.\n\t\t\t\tconst isEmpty =\n\t\t\t\t\t! canRemove &&\n\t\t\t\t\t! canDuplicate &&\n\t\t\t\t\t! canInsertBlock &&\n\t\t\t\t\tisContentOnly;\n\n\t\t\t\tif ( isEmpty ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\t\topen={ open }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ shouldShowBlockParentMenuItem && (\n\t\t\t\t\t\t\t\t\t\t<BlockParentSelectorMenuItem\n\t\t\t\t\t\t\t\t\t\t\tparentClientId={\n\t\t\t\t\t\t\t\t\t\t\t\tfirstParentClientId\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType={ parentBlockType }\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{ count === 1 && (\n\t\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\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{ ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary(\n\t\t\t\t\t\t\t\t\t\t\t\t'c'\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) }\n\t\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\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\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\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.duplicate }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\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\t{ canInsertBlock && ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add before' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add after' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\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</MenuGroup>\n\t\t\t\t\t\t\t\t{ canCopyStyles && ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Copy styles' ) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<MenuItem onClick={ onPasteStyles }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Paste styles' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\t\t\t\tfirstBlockClientId,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\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\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\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.remove }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t</BlockActions>\n\t);\n}\n\nexport default BlockSettingsDropdown;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,aAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,uBAAA,GAAAD,sBAAA,CAAAV,OAAA;AACA,IAAAY,2BAAA,GAAAF,sBAAA,CAAAV,OAAA;AACA,IAAAa,0BAAA,GAAAH,sBAAA,CAAAV,OAAA;AACA,IAAAc,4BAAA,GAAAJ,sBAAA,CAAAV,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAA2C,IAAAiB,WAAA,GAAAjB,OAAA;AA1B3C;AACA;AACA;;AA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AAjC,OAAA,GAEcrD,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_components","_data","_icons","_element","_i18n","_keycodes","_keyboardShortcuts","_compose","_blockActions","_interopRequireDefault","_blockCommentIconSlot","_blockHtmlConvertButton","_blockSettingsMenuFirstItem","_blockSettingsMenuControls","_blockParentSelectorMenuItem","_store","_lockUnlock","_jsxRuntime","POPOVER_PROPS","className","placement","CopyMenuItem","clientIds","onCopy","label","shortcut","getBlocksByClientId","useSelect","blockEditorStore","ref","useCopyToClipboard","serialize","copyMenuItemLabel","__","jsx","MenuItem","children","BlockSettingsDropdown","block","__experimentalSelectBlock","props","currentClientId","clientId","count","length","firstBlockClientId","firstParentClientId","parentBlockType","previousBlockClientId","selectedBlockClientIds","openedBlockSettingsMenu","isContentOnly","select","getBlockName","getBlockRootClientId","getPreviousBlockClientId","getSelectedBlockClientIds","getBlockAttributes","getOpenedBlockSettingsMenu","getBlockEditingMode","unlock","getActiveBlockVariation","blocksStore","_firstParentClientId","parentBlockName","getBlockType","getBlockOrder","setOpenedBlockSettingsMenu","useDispatch","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","duplicate","remove","insertAfter","insertBefore","hasSelectedBlocks","updateSelectionAfterDuplicate","clientIdsPromise","ids","updateSelectionAfterRemove","blockToFocus","shouldUpdateSelection","parentBlockIsSelected","includes","open","undefined","onToggle","localOpen","shouldShowBlockParentMenuItem","default","__experimentalUpdateSelection","canCopyStyles","canDuplicate","canInsertBlock","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onPasteStyles","isEmpty","DropdownMenu","icon","moreVertical","popoverProps","noIcons","onClose","jsxs","Fragment","MenuGroup","Slot","fillProps","parentClientId","displayShortcut","primary","onClick","pipe","Children","map","child","cloneElement","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tserialize,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport { Children, cloneElement } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { pipe, useCopyToClipboard } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport __unstableCommentIconFill from '../../components/collab/block-comment-icon-slot';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport BlockParentSelectorMenuItem from './block-parent-selector-menu-item';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\nfunction CopyMenuItem( { clientIds, onCopy, label, shortcut } ) {\n\tconst { getBlocksByClientId } = useSelect( blockEditorStore );\n\tconst ref = useCopyToClipboard(\n\t\t() => serialize( getBlocksByClientId( clientIds ) ),\n\t\tonCopy\n\t);\n\tconst copyMenuItemLabel = label ? label : __( 'Copy' );\n\treturn (\n\t\t<MenuItem ref={ ref } shortcut={ shortcut }>\n\t\t\t{ copyMenuItemLabel }\n\t\t</MenuItem>\n\t);\n}\n\nexport function BlockSettingsDropdown( {\n\tblock,\n\tclientIds,\n\tchildren,\n\t__experimentalSelectBlock,\n\t...props\n} ) {\n\t// Get the client id of the current block for this menu, if one is set.\n\tconst currentClientId = block?.clientId;\n\tconst count = clientIds.length;\n\tconst firstBlockClientId = clientIds[ 0 ];\n\tconst {\n\t\tfirstParentClientId,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tselectedBlockClientIds,\n\t\topenedBlockSettingsMenu,\n\t\tisContentOnly,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetOpenedBlockSettingsMenu,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst { getActiveBlockVariation } = select( blocksStore );\n\n\t\t\tconst _firstParentClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\t\t\tconst parentBlockName =\n\t\t\t\t_firstParentClientId && getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tparentBlockType:\n\t\t\t\t\t_firstParentClientId &&\n\t\t\t\t\t( getActiveBlockVariation(\n\t\t\t\t\t\tparentBlockName,\n\t\t\t\t\t\tgetBlockAttributes( _firstParentClientId )\n\t\t\t\t\t) ||\n\t\t\t\t\t\tgetBlockType( parentBlockName ) ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t\topenedBlockSettingsMenu: getOpenedBlockSettingsMenu(),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( firstBlockClientId ) === 'contentOnly',\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\tconst { getBlockOrder, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { setOpenedBlockSettingsMenu } = unlock(\n\t\tuseDispatch( blockEditorStore )\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\tconst hasSelectedBlocks = selectedBlockClientIds.length > 0;\n\n\tasync function updateSelectionAfterDuplicate( clientIdsPromise ) {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst ids = await clientIdsPromise;\n\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t__experimentalSelectBlock( ids[ 0 ], false );\n\t\t}\n\t}\n\n\tfunction updateSelectionAfterRemove() {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet blockToFocus = previousBlockClientId || firstParentClientId;\n\n\t\t// Focus the first block if there's no previous block nor parent block.\n\t\tif ( ! blockToFocus ) {\n\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t}\n\n\t\t// Only update the selection if the original selection is removed.\n\t\tconst shouldUpdateSelection =\n\t\t\thasSelectedBlocks && getSelectedBlockClientIds().length === 0;\n\n\t\t__experimentalSelectBlock( blockToFocus, shouldUpdateSelection );\n\t}\n\n\t// This can occur when the selected block (the parent)\n\t// displays child blocks within a List View.\n\tconst parentBlockIsSelected =\n\t\tselectedBlockClientIds?.includes( firstParentClientId );\n\n\t// When a currentClientId is in use, treat the menu as a controlled component.\n\t// This ensures that only one block settings menu is open at a time.\n\t// This is a temporary solution to work around an issue with `onFocusOutside`\n\t// where it does not allow a dropdown to be closed if focus was never within\n\t// the dropdown to begin with. Examples include a user either CMD+Clicking or\n\t// right clicking into an inactive window.\n\t// See: https://github.com/WordPress/gutenberg/pull/54083\n\tconst open = ! currentClientId\n\t\t? undefined\n\t\t: openedBlockSettingsMenu === currentClientId || false;\n\n\tfunction onToggle( localOpen ) {\n\t\tif ( localOpen && openedBlockSettingsMenu !== currentClientId ) {\n\t\t\tsetOpenedBlockSettingsMenu( currentClientId );\n\t\t} else if (\n\t\t\t! localOpen &&\n\t\t\topenedBlockSettingsMenu &&\n\t\t\topenedBlockSettingsMenu === currentClientId\n\t\t) {\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t}\n\t}\n\n\tconst shouldShowBlockParentMenuItem =\n\t\t! parentBlockIsSelected && !! firstParentClientId;\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\tcanCopyStyles,\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertBlock,\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\tonPasteStyles,\n\t\t\t} ) => {\n\t\t\t\t// It is possible that some plugins register fills for this menu\n\t\t\t\t// even if Core doesn't render anything in the block settings menu.\n\t\t\t\t// in which case, we may want to render the menu anyway.\n\t\t\t\t// That said for now, we can start more conservative.\n\t\t\t\tconst isEmpty =\n\t\t\t\t\t! canRemove &&\n\t\t\t\t\t! canDuplicate &&\n\t\t\t\t\t! canInsertBlock &&\n\t\t\t\t\tisContentOnly;\n\n\t\t\t\tif ( isEmpty ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\t\topen={ open }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ shouldShowBlockParentMenuItem && (\n\t\t\t\t\t\t\t\t\t\t<BlockParentSelectorMenuItem\n\t\t\t\t\t\t\t\t\t\t\tparentClientId={\n\t\t\t\t\t\t\t\t\t\t\t\tfirstParentClientId\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType={ parentBlockType }\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{ count === 1 && (\n\t\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\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{ ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary(\n\t\t\t\t\t\t\t\t\t\t\t\t'c'\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) }\n\t\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\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\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\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.duplicate }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\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\t{ canInsertBlock && ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add before' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add after' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\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<__unstableCommentIconFill.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t{ canCopyStyles && ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Copy styles' ) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<MenuItem onClick={ onPasteStyles }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Paste styles' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\t\t\t\tfirstBlockClientId,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\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\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\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.remove }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t</BlockActions>\n\t);\n}\n\nexport default BlockSettingsDropdown;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,aAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,qBAAA,GAAAD,sBAAA,CAAAV,OAAA;AACA,IAAAY,uBAAA,GAAAF,sBAAA,CAAAV,OAAA;AACA,IAAAa,2BAAA,GAAAH,sBAAA,CAAAV,OAAA;AACA,IAAAc,0BAAA,GAAAJ,sBAAA,CAAAV,OAAA;AACA,IAAAe,4BAAA,GAAAL,sBAAA,CAAAV,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AACA,IAAAiB,WAAA,GAAAjB,OAAA;AAA2C,IAAAkB,WAAA,GAAAlB,OAAA;AA3B3C;AACA;AACA;;AAeA;AACA;AACA;;AAUA,MAAMmB,aAAa,GAAG;EACrBC,SAAS,EAAE,2CAA2C;EACtDC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AAC,CACY,CAAC;AAEjB;AAAC,IAAAyF,QAAA,GAAAC,OAAA,CAAAjC,OAAA,GAEcrD,qBAAqB","ignoreList":[]}
@@ -8,6 +8,7 @@ exports.BlockSettingsMenu = BlockSettingsMenu;
8
8
  exports.default = void 0;
9
9
  var _components = require("@wordpress/components");
10
10
  var _blockSettingsDropdown = _interopRequireDefault(require("./block-settings-dropdown"));
11
+ var _blockCommentIconToolbarSlot = _interopRequireDefault(require("../../components/collab/block-comment-icon-toolbar-slot"));
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  /**
13
14
  * WordPress dependencies
@@ -21,14 +22,14 @@ function BlockSettingsMenu({
21
22
  clientIds,
22
23
  ...props
23
24
  }) {
24
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
25
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarItem, {
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.ToolbarGroup, {
26
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockCommentIconToolbarSlot.default.Slot, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarItem, {
26
27
  children: toggleProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockSettingsDropdown.default, {
27
28
  clientIds: clientIds,
28
29
  toggleProps: toggleProps,
29
30
  ...props
30
31
  })
31
- })
32
+ })]
32
33
  });
33
34
  }
34
35
  var _default = exports.default = BlockSettingsMenu;
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_blockSettingsDropdown","_interopRequireDefault","_jsxRuntime","BlockSettingsMenu","clientIds","props","jsx","ToolbarGroup","children","ToolbarItem","toggleProps","default","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarGroup, ToolbarItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockSettingsDropdown from './block-settings-dropdown';\n\nexport function BlockSettingsMenu( { clientIds, ...props } ) {\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<BlockSettingsDropdown\n\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\ttoggleProps={ toggleProps }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n}\n\nexport default BlockSettingsMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8D,IAAAG,WAAA,GAAAH,OAAA;AAR9D;AACA;AACA;;AAGA;AACA;AACA;;AAGO,SAASI,iBAAiBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC5D,oBACC,IAAAH,WAAA,CAAAI,GAAA,EAACR,WAAA,CAAAS,YAAY;IAAAC,QAAA,eACZ,IAAAN,WAAA,CAAAI,GAAA,EAACR,WAAA,CAAAW,WAAW;MAAAD,QAAA,EACPE,WAAW,iBACd,IAAAR,WAAA,CAAAI,GAAA,EAACN,sBAAA,CAAAW,OAAqB;QACrBP,SAAS,EAAGA,SAAW;QACvBM,WAAW,EAAGA,WAAa;QAAA,GACtBL;MAAK,CACV;IACD,CACW;EAAC,CACD,CAAC;AAEjB;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEcR,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_blockSettingsDropdown","_interopRequireDefault","_blockCommentIconToolbarSlot","_jsxRuntime","BlockSettingsMenu","clientIds","props","jsxs","ToolbarGroup","children","jsx","default","Slot","ToolbarItem","toggleProps","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarGroup, ToolbarItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockSettingsDropdown from './block-settings-dropdown';\nimport __unstableCommentIconToolbarFill from '../../components/collab/block-comment-icon-toolbar-slot';\n\nexport function BlockSettingsMenu( { clientIds, ...props } ) {\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<__unstableCommentIconToolbarFill.Slot />\n\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<BlockSettingsDropdown\n\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\ttoggleProps={ toggleProps }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n}\n\nexport default BlockSettingsMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,4BAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAuG,IAAAI,WAAA,GAAAJ,OAAA;AATvG;AACA;AACA;;AAGA;AACA;AACA;;AAIO,SAASK,iBAAiBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC5D,oBACC,IAAAH,WAAA,CAAAI,IAAA,EAACT,WAAA,CAAAU,YAAY;IAAAC,QAAA,gBACZ,IAAAN,WAAA,CAAAO,GAAA,EAACR,4BAAA,CAAAS,OAAgC,CAACC,IAAI,IAAE,CAAC,eAEzC,IAAAT,WAAA,CAAAO,GAAA,EAACZ,WAAA,CAAAe,WAAW;MAAAJ,QAAA,EACPK,WAAW,iBACd,IAAAX,WAAA,CAAAO,GAAA,EAACV,sBAAA,CAAAW,OAAqB;QACrBN,SAAS,EAAGA,SAAW;QACvBS,WAAW,EAAGA,WAAa;QAAA,GACtBR;MAAK,CACV;IACD,CACW,CAAC;EAAA,CACD,CAAC;AAEjB;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEcP,iBAAiB","ignoreList":[]}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = ChangeDesign;
8
+ var _components = require("@wordpress/components");
9
+ var _i18n = require("@wordpress/i18n");
10
+ var _blocks = require("@wordpress/blocks");
11
+ var _element = require("@wordpress/element");
12
+ var _compose = require("@wordpress/compose");
13
+ var _data = require("@wordpress/data");
14
+ var _store = require("../../store");
15
+ var _blockPatternsList = _interopRequireDefault(require("../block-patterns-list"));
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ /**
18
+ * WordPress dependencies
19
+ */
20
+
21
+ /**
22
+ * Internal dependencies
23
+ */
24
+
25
+ const EMPTY_ARRAY = [];
26
+ const MAX_PATTERNS_TO_SHOW = 6;
27
+ const POPOVER_PROPS = {
28
+ placement: 'bottom-start'
29
+ };
30
+ function ChangeDesign({
31
+ clientId
32
+ }) {
33
+ const {
34
+ categories,
35
+ currentPatternName,
36
+ patterns
37
+ } = (0, _data.useSelect)(select => {
38
+ const {
39
+ getBlockAttributes,
40
+ getBlockRootClientId,
41
+ __experimentalGetAllowedPatterns
42
+ } = select(_store.store);
43
+ const attributes = getBlockAttributes(clientId);
44
+ const _categories = attributes?.metadata?.categories || EMPTY_ARRAY;
45
+ const rootBlock = getBlockRootClientId(clientId);
46
+
47
+ // Calling `__experimentalGetAllowedPatterns` is expensive.
48
+ // Checking if the block can be changed prevents unnecessary selector calls.
49
+ // See: https://github.com/WordPress/gutenberg/pull/64736.
50
+ const _patterns = _categories.length > 0 ? __experimentalGetAllowedPatterns(rootBlock) : EMPTY_ARRAY;
51
+ return {
52
+ categories: _categories,
53
+ currentPatternName: attributes?.metadata?.patternName,
54
+ patterns: _patterns
55
+ };
56
+ }, [clientId]);
57
+ const {
58
+ replaceBlocks
59
+ } = (0, _data.useDispatch)(_store.store);
60
+ const sameCategoryPatternsWithSingleWrapper = (0, _element.useMemo)(() => {
61
+ if (categories.length === 0 || !patterns || patterns.length === 0) {
62
+ return EMPTY_ARRAY;
63
+ }
64
+ return patterns.filter(pattern => {
65
+ const isCorePattern = pattern.source === 'core' || pattern.source?.startsWith('pattern-directory') && pattern.source !== 'pattern-directory/theme';
66
+ return (
67
+ // Check if the pattern has only one top level block,
68
+ // otherwise we may switch to a pattern that doesn't have replacement suggestions.
69
+ pattern.blocks.length === 1 &&
70
+ // We exclude the core patterns and pattern directory patterns that are not theme patterns.
71
+ !isCorePattern &&
72
+ // Exclude current pattern.
73
+ currentPatternName !== pattern.name && pattern.categories?.some(category => {
74
+ return categories.includes(category);
75
+ }) && (
76
+ // Check if the pattern is not a synced pattern.
77
+ pattern.syncStatus === 'unsynced' || !pattern.id)
78
+ );
79
+ }).slice(0, MAX_PATTERNS_TO_SHOW);
80
+ }, [categories, currentPatternName, patterns]);
81
+ const currentShownPatterns = (0, _compose.useAsyncList)(sameCategoryPatternsWithSingleWrapper);
82
+ if (sameCategoryPatternsWithSingleWrapper.length < 2) {
83
+ return null;
84
+ }
85
+ const onClickPattern = pattern => {
86
+ var _pattern$blocks;
87
+ const newBlocks = ((_pattern$blocks = pattern.blocks) !== null && _pattern$blocks !== void 0 ? _pattern$blocks : []).map(block => {
88
+ return (0, _blocks.cloneBlock)(block);
89
+ });
90
+ newBlocks[0].attributes.metadata = {
91
+ ...newBlocks[0].attributes.metadata,
92
+ categories
93
+ };
94
+ replaceBlocks(clientId, newBlocks);
95
+ };
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Dropdown, {
97
+ popoverProps: POPOVER_PROPS,
98
+ renderToggle: ({
99
+ onToggle,
100
+ isOpen
101
+ }) => {
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
103
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
104
+ onClick: () => onToggle(!isOpen),
105
+ "aria-expanded": isOpen,
106
+ children: (0, _i18n.__)('Change design')
107
+ })
108
+ });
109
+ },
110
+ renderContent: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalDropdownContentWrapper, {
111
+ className: "block-editor-block-toolbar-change-design-content-wrapper",
112
+ paddingSize: "none",
113
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockPatternsList.default, {
114
+ shownPatterns: currentShownPatterns,
115
+ blockPatterns: sameCategoryPatternsWithSingleWrapper,
116
+ onClickPattern: onClickPattern,
117
+ showTitle: false
118
+ })
119
+ })
120
+ });
121
+ }
122
+ //# sourceMappingURL=change-design.js.map