@wordpress/block-editor 12.3.0 → 12.3.2

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 (971) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +13 -0
  3. package/build/autocompleters/block.js +5 -3
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/alignment-control/index.js +4 -6
  6. package/build/components/alignment-control/index.js.map +1 -1
  7. package/build/components/alignment-control/ui.js +5 -9
  8. package/build/components/alignment-control/ui.js.map +1 -1
  9. package/build/components/autocomplete/index.js +2 -4
  10. package/build/components/autocomplete/index.js.map +1 -1
  11. package/build/components/block-actions/index.js +4 -0
  12. package/build/components/block-actions/index.js.map +1 -1
  13. package/build/components/block-alignment-control/constants.js +1 -5
  14. package/build/components/block-alignment-control/constants.js.map +1 -1
  15. package/build/components/block-alignment-control/index.js +4 -6
  16. package/build/components/block-alignment-control/index.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.js +3 -4
  18. package/build/components/block-alignment-control/ui.js.map +1 -1
  19. package/build/components/block-alignment-control/ui.native.js +3 -3
  20. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  21. package/build/components/block-alignment-matrix-control/index.js +0 -1
  22. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  23. package/build/components/block-breadcrumb/index.js +2 -3
  24. package/build/components/block-breadcrumb/index.js.map +1 -1
  25. package/build/components/block-controls/fill.js +2 -1
  26. package/build/components/block-controls/fill.js.map +1 -1
  27. package/build/components/block-controls/index.js +8 -8
  28. package/build/components/block-controls/index.js.map +1 -1
  29. package/build/components/block-controls/slot.js +2 -4
  30. package/build/components/block-controls/slot.js.map +1 -1
  31. package/build/components/block-controls/slot.native.js +4 -2
  32. package/build/components/block-controls/slot.native.js.map +1 -1
  33. package/build/components/block-edit/edit.js +4 -6
  34. package/build/components/block-edit/edit.js.map +1 -1
  35. package/build/components/block-edit/edit.native.js +2 -4
  36. package/build/components/block-edit/edit.native.js.map +1 -1
  37. package/build/components/block-edit/index.js +3 -2
  38. package/build/components/block-edit/index.js.map +1 -1
  39. package/build/components/block-heading-level-dropdown/heading-level-icon.js +47 -0
  40. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  41. package/build/components/block-heading-level-dropdown/index.js +83 -0
  42. package/build/components/block-heading-level-dropdown/index.js.map +1 -0
  43. package/build/components/block-heading-level-dropdown/index.native.js +72 -0
  44. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -0
  45. package/build/components/block-icon/index.native.js +6 -7
  46. package/build/components/block-icon/index.native.js.map +1 -1
  47. package/build/components/block-info-slot-fill/index.js +4 -2
  48. package/build/components/block-info-slot-fill/index.js.map +1 -1
  49. package/build/components/block-inspector/index.js +20 -87
  50. package/build/components/block-inspector/index.js.map +1 -1
  51. package/build/components/block-list/block-list-item.native.js +4 -2
  52. package/build/components/block-list/block-list-item.native.js.map +1 -1
  53. package/build/components/block-list/block.js +6 -4
  54. package/build/components/block-list/block.js.map +1 -1
  55. package/build/components/block-list/block.native.js +1 -0
  56. package/build/components/block-list/block.native.js.map +1 -1
  57. package/build/components/block-list/index.js +7 -4
  58. package/build/components/block-list/index.js.map +1 -1
  59. package/build/components/block-list/index.native.js +8 -9
  60. package/build/components/block-list/index.native.js.map +1 -1
  61. package/build/components/block-list/subdirectory-icon.js +4 -7
  62. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  63. package/build/components/block-list/use-in-between-inserter.js +1 -3
  64. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  65. package/build/components/block-list-appender/index.js +21 -19
  66. package/build/components/block-list-appender/index.js.map +1 -1
  67. package/build/components/block-lock/toolbar.js +25 -6
  68. package/build/components/block-lock/toolbar.js.map +1 -1
  69. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  70. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  71. package/build/components/block-mover/button.js +12 -12
  72. package/build/components/block-mover/button.js.map +1 -1
  73. package/build/components/block-mover/index.js +11 -10
  74. package/build/components/block-mover/index.js.map +1 -1
  75. package/build/components/block-navigation/dropdown.js +4 -6
  76. package/build/components/block-navigation/dropdown.js.map +1 -1
  77. package/build/components/block-parent-selector/index.js +4 -5
  78. package/build/components/block-parent-selector/index.js.map +1 -1
  79. package/build/components/block-pattern-setup/index.js +6 -8
  80. package/build/components/block-pattern-setup/index.js.map +1 -1
  81. package/build/components/block-patterns-list/index.js +6 -8
  82. package/build/components/block-patterns-list/index.js.map +1 -1
  83. package/build/components/block-popover/inbetween.js +4 -6
  84. package/build/components/block-popover/inbetween.js.map +1 -1
  85. package/build/components/block-popover/index.js +4 -6
  86. package/build/components/block-popover/index.js.map +1 -1
  87. package/build/components/block-preview/auto.js +2 -4
  88. package/build/components/block-preview/auto.js.map +1 -1
  89. package/build/components/block-preview/index.js +7 -7
  90. package/build/components/block-preview/index.js.map +1 -1
  91. package/build/components/block-quick-navigation/index.js +83 -0
  92. package/build/components/block-quick-navigation/index.js.map +1 -0
  93. package/build/components/block-removal-warning-modal/index.js +90 -0
  94. package/build/components/block-removal-warning-modal/index.js.map +1 -0
  95. package/build/components/block-selection-clearer/index.js +4 -7
  96. package/build/components/block-selection-clearer/index.js.map +1 -1
  97. package/build/components/block-settings/button.native.js +2 -1
  98. package/build/components/block-settings/button.native.js.map +1 -1
  99. package/build/components/block-settings/container.native.js +6 -6
  100. package/build/components/block-settings/container.native.js.map +1 -1
  101. package/build/components/block-settings-menu/block-settings-dropdown.js +10 -11
  102. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  103. package/build/components/block-settings-menu/index.js +4 -5
  104. package/build/components/block-settings-menu/index.js.map +1 -1
  105. package/build/components/block-settings-menu-controls/index.js +4 -5
  106. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  107. package/build/components/block-switcher/index.js +1 -2
  108. package/build/components/block-switcher/index.js.map +1 -1
  109. package/build/components/block-switcher/pattern-transformations-menu.js +6 -8
  110. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  111. package/build/components/block-toolbar/index.js +10 -8
  112. package/build/components/block-toolbar/index.js.map +1 -1
  113. package/build/components/block-tools/block-contextual-toolbar.js +4 -5
  114. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  115. package/build/components/block-tools/block-selection-button.js +4 -5
  116. package/build/components/block-tools/block-selection-button.js.map +1 -1
  117. package/build/components/block-tools/index.js +13 -6
  118. package/build/components/block-tools/index.js.map +1 -1
  119. package/build/components/block-tools/insertion-point.js +5 -5
  120. package/build/components/block-tools/insertion-point.js.map +1 -1
  121. package/build/components/block-tools/selected-block-popover.js +8 -8
  122. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  123. package/build/components/block-types-list/index.native.js +4 -6
  124. package/build/components/block-types-list/index.native.js.map +1 -1
  125. package/build/components/block-vertical-alignment-control/index.js +4 -6
  126. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  127. package/build/components/block-vertical-alignment-control/ui.js +5 -12
  128. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  129. package/build/components/border-radius-control/all-input-control.js +2 -6
  130. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  131. package/build/components/border-radius-control/input-controls.js +2 -6
  132. package/build/components/border-radius-control/input-controls.js.map +1 -1
  133. package/build/components/border-radius-control/linked-button.js +2 -6
  134. package/build/components/border-radius-control/linked-button.js.map +1 -1
  135. package/build/components/color-palette/control.js +2 -4
  136. package/build/components/color-palette/control.js.map +1 -1
  137. package/build/components/color-palette/with-color-context.js +2 -4
  138. package/build/components/color-palette/with-color-context.js.map +1 -1
  139. package/build/components/colors/utils.js +7 -3
  140. package/build/components/colors/utils.js.map +1 -1
  141. package/build/components/colors/with-colors.js +11 -16
  142. package/build/components/colors/with-colors.js.map +1 -1
  143. package/build/components/colors-gradients/control.js +7 -5
  144. package/build/components/colors-gradients/control.js.map +1 -1
  145. package/build/components/colors-gradients/dropdown.js +12 -11
  146. package/build/components/colors-gradients/dropdown.js.map +1 -1
  147. package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -5
  148. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  149. package/build/components/copy-handler/index.js +5 -6
  150. package/build/components/copy-handler/index.js.map +1 -1
  151. package/build/components/dimensions-tool/aspect-ratio-tool.js +99 -0
  152. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  153. package/build/components/dimensions-tool/index.js +207 -0
  154. package/build/components/dimensions-tool/index.js.map +1 -0
  155. package/build/components/dimensions-tool/scale-tool.js +111 -0
  156. package/build/components/dimensions-tool/scale-tool.js.map +1 -0
  157. package/build/components/dimensions-tool/width-height-tool.js +125 -0
  158. package/build/components/dimensions-tool/width-height-tool.js.map +1 -0
  159. package/build/components/duotone-control/index.js +1 -2
  160. package/build/components/duotone-control/index.js.map +1 -1
  161. package/build/components/editable-text/index.js +6 -7
  162. package/build/components/editable-text/index.js.map +1 -1
  163. package/build/components/font-appearance-control/index.js +2 -6
  164. package/build/components/font-appearance-control/index.js.map +1 -1
  165. package/build/components/font-family/index.js +4 -5
  166. package/build/components/font-family/index.js.map +1 -1
  167. package/build/components/font-sizes/font-size-picker.js +2 -4
  168. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  169. package/build/components/font-sizes/utils.js +3 -3
  170. package/build/components/font-sizes/utils.js.map +1 -1
  171. package/build/components/font-sizes/with-font-sizes.js +7 -7
  172. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  173. package/build/components/global-styles/color-panel.js +15 -16
  174. package/build/components/global-styles/color-panel.js.map +1 -1
  175. package/build/components/global-styles/effects-panel.js +2 -1
  176. package/build/components/global-styles/effects-panel.js.map +1 -1
  177. package/build/components/global-styles/filters-panel.js +2 -1
  178. package/build/components/global-styles/filters-panel.js.map +1 -1
  179. package/build/components/global-styles/index.js +6 -0
  180. package/build/components/global-styles/index.js.map +1 -1
  181. package/build/components/global-styles/typography-panel.js +7 -7
  182. package/build/components/global-styles/typography-panel.js.map +1 -1
  183. package/build/components/global-styles/use-global-styles-output.js +19 -16
  184. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  185. package/build/components/gradients/with-gradient.js +2 -6
  186. package/build/components/gradients/with-gradient.js.map +1 -1
  187. package/build/components/iframe/index.js +5 -7
  188. package/build/components/iframe/index.js.map +1 -1
  189. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -1
  190. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  191. package/build/components/image-editor/constants.js +1 -2
  192. package/build/components/image-editor/constants.js.map +1 -1
  193. package/build/components/image-editor/use-save-image.js +1 -2
  194. package/build/components/image-editor/use-save-image.js.map +1 -1
  195. package/build/components/image-size-control/index.js +6 -0
  196. package/build/components/image-size-control/index.js.map +1 -1
  197. package/build/components/index.js +9 -9
  198. package/build/components/index.js.map +1 -1
  199. package/build/components/index.native.js +9 -0
  200. package/build/components/index.native.js.map +1 -1
  201. package/build/components/inner-blocks/index.js +9 -8
  202. package/build/components/inner-blocks/index.js.map +1 -1
  203. package/build/components/inner-blocks/index.native.js +8 -7
  204. package/build/components/inner-blocks/index.native.js.map +1 -1
  205. package/build/components/inner-blocks/use-nested-settings-update.js +24 -30
  206. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  207. package/build/components/inner-blocks/with-client-id.js +2 -6
  208. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  209. package/build/components/inserter/block-patterns-explorer/explorer.js +2 -1
  210. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  211. package/build/components/inserter/block-patterns-tab.js +33 -5
  212. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  213. package/build/components/inserter/hooks/use-block-types-state.js +4 -3
  214. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  215. package/build/components/inserter/hooks/use-insertion-point.js +1 -1
  216. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  217. package/build/components/inserter/index.js +8 -8
  218. package/build/components/inserter/index.js.map +1 -1
  219. package/build/components/inserter/index.native.js +4 -5
  220. package/build/components/inserter/index.native.js.map +1 -1
  221. package/build/components/inserter/library.js +1 -1
  222. package/build/components/inserter/library.js.map +1 -1
  223. package/build/components/inserter/media-tab/media-list.js +2 -6
  224. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  225. package/build/components/inserter/media-tab/media-preview.js +4 -6
  226. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  227. package/build/components/inserter/media-tab/media-tab.js +1 -1
  228. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  229. package/build/components/inserter/reusable-blocks-tab.js +3 -3
  230. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  231. package/build/components/inserter/tabs.js +3 -3
  232. package/build/components/inserter/tabs.js.map +1 -1
  233. package/build/components/inserter-list-item/index.js +4 -5
  234. package/build/components/inserter-list-item/index.js.map +1 -1
  235. package/build/components/inserter-listbox/group.js +4 -7
  236. package/build/components/inserter-listbox/group.js.map +1 -1
  237. package/build/components/inserter-listbox/item.js +8 -7
  238. package/build/components/inserter-listbox/item.js.map +1 -1
  239. package/build/components/inserter-listbox/row.js +4 -5
  240. package/build/components/inserter-listbox/row.js.map +1 -1
  241. package/build/components/inspector-controls/block-support-slot-container.js +2 -6
  242. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  243. package/build/components/inspector-controls/fill.native.js +2 -1
  244. package/build/components/inspector-controls/fill.native.js.map +1 -1
  245. package/build/components/inspector-controls/index.js +4 -6
  246. package/build/components/inspector-controls/index.js.map +1 -1
  247. package/build/components/inspector-controls/slot.js +4 -6
  248. package/build/components/inspector-controls/slot.js.map +1 -1
  249. package/build/components/inspector-controls/slot.native.js +2 -1
  250. package/build/components/inspector-controls/slot.native.js.map +1 -1
  251. package/build/components/justify-content-control/index.js +4 -6
  252. package/build/components/justify-content-control/index.js.map +1 -1
  253. package/build/components/justify-content-control/ui.js +4 -7
  254. package/build/components/justify-content-control/ui.js.map +1 -1
  255. package/build/components/letter-spacing-control/index.js +2 -4
  256. package/build/components/letter-spacing-control/index.js.map +1 -1
  257. package/build/components/line-height-control/index.js +2 -4
  258. package/build/components/line-height-control/index.js.map +1 -1
  259. package/build/components/link-control/index.js +20 -24
  260. package/build/components/link-control/index.js.map +1 -1
  261. package/build/components/link-control/search-create-button.js +2 -4
  262. package/build/components/link-control/search-create-button.js.map +1 -1
  263. package/build/components/link-control/search-input.js +7 -5
  264. package/build/components/link-control/search-input.js.map +1 -1
  265. package/build/components/link-control/search-item.js +2 -4
  266. package/build/components/link-control/search-item.js.map +1 -1
  267. package/build/components/link-control/search-results.js +2 -4
  268. package/build/components/link-control/search-results.js.map +1 -1
  269. package/build/components/link-control/settings-drawer.js +2 -3
  270. package/build/components/link-control/settings-drawer.js.map +1 -1
  271. package/build/components/list-view/appender.js +4 -6
  272. package/build/components/list-view/appender.js.map +1 -1
  273. package/build/components/list-view/aria-referenced-text.js +4 -8
  274. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  275. package/build/components/list-view/block-contents.js +4 -5
  276. package/build/components/list-view/block-contents.js.map +1 -1
  277. package/build/components/list-view/block-select-button.js +13 -2
  278. package/build/components/list-view/block-select-button.js.map +1 -1
  279. package/build/components/list-view/branch.js +9 -8
  280. package/build/components/list-view/branch.js.map +1 -1
  281. package/build/components/list-view/drop-indicator.js +62 -11
  282. package/build/components/list-view/drop-indicator.js.map +1 -1
  283. package/build/components/list-view/index.js +4 -6
  284. package/build/components/list-view/index.js.map +1 -1
  285. package/build/components/list-view/leaf.js +4 -5
  286. package/build/components/list-view/leaf.js.map +1 -1
  287. package/build/components/list-view/use-list-view-client-ids.js +2 -22
  288. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  289. package/build/components/list-view/use-list-view-drop-zone.js +46 -34
  290. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  291. package/build/components/media-placeholder/index.js +38 -13
  292. package/build/components/media-placeholder/index.js.map +1 -1
  293. package/build/components/media-replace-flow/index.js +1 -3
  294. package/build/components/media-replace-flow/index.js.map +1 -1
  295. package/build/components/navigable-toolbar/index.js +8 -8
  296. package/build/components/navigable-toolbar/index.js.map +1 -1
  297. package/build/components/panel-color-settings/index.js +4 -5
  298. package/build/components/panel-color-settings/index.js.map +1 -1
  299. package/build/components/plain-text/index.js +8 -8
  300. package/build/components/plain-text/index.js.map +1 -1
  301. package/build/components/plain-text/index.native.js +7 -6
  302. package/build/components/plain-text/index.native.js.map +1 -1
  303. package/build/components/preview-options/index.js +5 -4
  304. package/build/components/preview-options/index.js.map +1 -1
  305. package/build/components/provider/index.js +2 -4
  306. package/build/components/provider/index.js.map +1 -1
  307. package/build/components/provider/use-block-sync.js +21 -0
  308. package/build/components/provider/use-block-sync.js.map +1 -1
  309. package/build/components/provider/with-registry-provider.js +8 -10
  310. package/build/components/provider/with-registry-provider.js.map +1 -1
  311. package/build/components/publish-date-time-picker/index.js +4 -5
  312. package/build/components/publish-date-time-picker/index.js.map +1 -1
  313. package/build/components/resizable-box-popover/index.js +5 -5
  314. package/build/components/resizable-box-popover/index.js.map +1 -1
  315. package/build/components/resolution-tool/index.js +55 -0
  316. package/build/components/resolution-tool/index.js.map +1 -0
  317. package/build/components/rich-text/content.js +99 -0
  318. package/build/components/rich-text/content.js.map +1 -0
  319. package/build/components/rich-text/format-toolbar/index.js +1 -2
  320. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  321. package/build/components/rich-text/index.js +8 -42
  322. package/build/components/rich-text/index.js.map +1 -1
  323. package/build/components/rich-text/index.native.js +6 -34
  324. package/build/components/rich-text/index.native.js.map +1 -1
  325. package/build/components/rich-text/toolbar-button.js +2 -6
  326. package/build/components/rich-text/toolbar-button.js.map +1 -1
  327. package/build/components/spacing-sizes-control/index.js +8 -8
  328. package/build/components/spacing-sizes-control/index.js.map +1 -1
  329. package/build/components/tool-selector/index.js +2 -6
  330. package/build/components/tool-selector/index.js.map +1 -1
  331. package/build/components/unit-control/index.js +4 -5
  332. package/build/components/unit-control/index.js.map +1 -1
  333. package/build/components/url-input/index.js +12 -10
  334. package/build/components/url-input/index.js.map +1 -1
  335. package/build/components/url-input/index.native.js +4 -7
  336. package/build/components/url-input/index.native.js.map +1 -1
  337. package/build/components/url-popover/image-url-input-ui.js +21 -14
  338. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  339. package/build/components/url-popover/index.js +4 -5
  340. package/build/components/url-popover/index.js.map +1 -1
  341. package/build/components/url-popover/link-editor.js +4 -5
  342. package/build/components/url-popover/link-editor.js.map +1 -1
  343. package/build/components/url-popover/link-viewer.js +4 -5
  344. package/build/components/url-popover/link-viewer.js.map +1 -1
  345. package/build/components/use-block-display-information/index.js +30 -2
  346. package/build/components/use-block-display-information/index.js.map +1 -1
  347. package/build/components/video-player/index.native.js +2 -4
  348. package/build/components/video-player/index.native.js.map +1 -1
  349. package/build/components/warning/index.native.js +4 -5
  350. package/build/components/warning/index.native.js.map +1 -1
  351. package/build/components/writing-flow/index.js +2 -4
  352. package/build/components/writing-flow/index.js.map +1 -1
  353. package/build/components/writing-flow/use-drag-selection.js +1 -1
  354. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  355. package/build/components/writing-flow/use-tab-nav.js +32 -4
  356. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  357. package/build/hooks/align.js +8 -8
  358. package/build/hooks/align.js.map +1 -1
  359. package/build/hooks/anchor.js +4 -2
  360. package/build/hooks/anchor.js.map +1 -1
  361. package/build/hooks/behaviors.js +75 -37
  362. package/build/hooks/behaviors.js.map +1 -1
  363. package/build/hooks/border.js +4 -5
  364. package/build/hooks/border.js.map +1 -1
  365. package/build/hooks/color.js +4 -5
  366. package/build/hooks/color.js.map +1 -1
  367. package/build/hooks/content-lock-ui.js +8 -10
  368. package/build/hooks/content-lock-ui.js.map +1 -1
  369. package/build/hooks/custom-class-name.js +4 -2
  370. package/build/hooks/custom-class-name.js.map +1 -1
  371. package/build/hooks/dimensions.js +7 -7
  372. package/build/hooks/dimensions.js.map +1 -1
  373. package/build/hooks/duotone.js +5 -5
  374. package/build/hooks/duotone.js.map +1 -1
  375. package/build/hooks/font-family.js +2 -6
  376. package/build/hooks/font-family.js.map +1 -1
  377. package/build/hooks/font-size.js +10 -8
  378. package/build/hooks/font-size.js.map +1 -1
  379. package/build/hooks/layout.js +30 -28
  380. package/build/hooks/layout.js.map +1 -1
  381. package/build/hooks/position.js +24 -16
  382. package/build/hooks/position.js.map +1 -1
  383. package/build/hooks/style.js +8 -5
  384. package/build/hooks/style.js.map +1 -1
  385. package/build/hooks/supports.js +1 -1
  386. package/build/hooks/supports.js.map +1 -1
  387. package/build/hooks/typography.native.js +3 -1
  388. package/build/hooks/typography.native.js.map +1 -1
  389. package/build/hooks/use-typography-props.js +10 -17
  390. package/build/hooks/use-typography-props.js.map +1 -1
  391. package/build/index.js +0 -14
  392. package/build/index.js.map +1 -1
  393. package/build/layouts/constrained.js +3 -1
  394. package/build/layouts/constrained.js.map +1 -1
  395. package/build/layouts/definitions.js +154 -0
  396. package/build/layouts/definitions.js.map +1 -0
  397. package/build/layouts/flex.js +8 -5
  398. package/build/layouts/flex.js.map +1 -1
  399. package/build/layouts/flow.js +3 -1
  400. package/build/layouts/flow.js.map +1 -1
  401. package/build/layouts/grid.js +3 -1
  402. package/build/layouts/grid.js.map +1 -1
  403. package/build/layouts/utils.js +8 -2
  404. package/build/layouts/utils.js.map +1 -1
  405. package/build/private-apis.js +23 -1
  406. package/build/private-apis.js.map +1 -1
  407. package/build/store/actions.js +2 -62
  408. package/build/store/actions.js.map +1 -1
  409. package/build/store/defaults.js +1 -0
  410. package/build/store/defaults.js.map +1 -1
  411. package/build/store/private-actions.js +200 -0
  412. package/build/store/private-actions.js.map +1 -1
  413. package/build/store/private-selectors.js +72 -4
  414. package/build/store/private-selectors.js.map +1 -1
  415. package/build/store/reducer.js +52 -1
  416. package/build/store/reducer.js.map +1 -1
  417. package/build/store/selectors.js +42 -42
  418. package/build/store/selectors.js.map +1 -1
  419. package/build/utils/object.js +39 -0
  420. package/build/utils/object.js.map +1 -1
  421. package/build-module/autocompleters/block.js +5 -3
  422. package/build-module/autocompleters/block.js.map +1 -1
  423. package/build-module/components/alignment-control/index.js +4 -5
  424. package/build-module/components/alignment-control/index.js.map +1 -1
  425. package/build-module/components/alignment-control/ui.js +5 -6
  426. package/build-module/components/alignment-control/ui.js.map +1 -1
  427. package/build-module/components/autocomplete/index.js +2 -3
  428. package/build-module/components/autocomplete/index.js.map +1 -1
  429. package/build-module/components/block-actions/index.js +4 -0
  430. package/build-module/components/block-actions/index.js.map +1 -1
  431. package/build-module/components/block-alignment-control/constants.js +0 -3
  432. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  433. package/build-module/components/block-alignment-control/index.js +4 -5
  434. package/build-module/components/block-alignment-control/index.js.map +1 -1
  435. package/build-module/components/block-alignment-control/ui.js +4 -4
  436. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  437. package/build-module/components/block-alignment-control/ui.native.js +3 -2
  438. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  439. package/build-module/components/block-alignment-matrix-control/index.js +0 -1
  440. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  441. package/build-module/components/block-breadcrumb/index.js +2 -3
  442. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  443. package/build-module/components/block-controls/fill.js +2 -1
  444. package/build-module/components/block-controls/fill.js.map +1 -1
  445. package/build-module/components/block-controls/index.js +8 -7
  446. package/build-module/components/block-controls/index.js.map +1 -1
  447. package/build-module/components/block-controls/slot.js +2 -3
  448. package/build-module/components/block-controls/slot.js.map +1 -1
  449. package/build-module/components/block-controls/slot.native.js +4 -2
  450. package/build-module/components/block-controls/slot.native.js.map +1 -1
  451. package/build-module/components/block-edit/edit.js +4 -5
  452. package/build-module/components/block-edit/edit.js.map +1 -1
  453. package/build-module/components/block-edit/edit.native.js +2 -3
  454. package/build-module/components/block-edit/edit.native.js.map +1 -1
  455. package/build-module/components/block-edit/index.js +3 -2
  456. package/build-module/components/block-edit/index.js.map +1 -1
  457. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +39 -0
  458. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  459. package/build-module/components/block-heading-level-dropdown/index.js +71 -0
  460. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -0
  461. package/build-module/components/block-heading-level-dropdown/index.native.js +60 -0
  462. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -0
  463. package/build-module/components/block-icon/index.native.js +6 -6
  464. package/build-module/components/block-icon/index.native.js.map +1 -1
  465. package/build-module/components/block-info-slot-fill/index.js +4 -2
  466. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  467. package/build-module/components/block-inspector/index.js +20 -88
  468. package/build-module/components/block-inspector/index.js.map +1 -1
  469. package/build-module/components/block-list/block-list-item.native.js +4 -2
  470. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  471. package/build-module/components/block-list/block.js +6 -4
  472. package/build-module/components/block-list/block.js.map +1 -1
  473. package/build-module/components/block-list/block.native.js +1 -0
  474. package/build-module/components/block-list/block.native.js.map +1 -1
  475. package/build-module/components/block-list/index.js +7 -4
  476. package/build-module/components/block-list/index.js.map +1 -1
  477. package/build-module/components/block-list/index.native.js +8 -8
  478. package/build-module/components/block-list/index.native.js.map +1 -1
  479. package/build-module/components/block-list/subdirectory-icon.js +4 -4
  480. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  481. package/build-module/components/block-list/use-in-between-inserter.js +1 -3
  482. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  483. package/build-module/components/block-list-appender/index.js +21 -19
  484. package/build-module/components/block-list-appender/index.js.map +1 -1
  485. package/build-module/components/block-lock/toolbar.js +25 -7
  486. package/build-module/components/block-lock/toolbar.js.map +1 -1
  487. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  488. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  489. package/build-module/components/block-mover/button.js +12 -11
  490. package/build-module/components/block-mover/button.js.map +1 -1
  491. package/build-module/components/block-mover/index.js +11 -9
  492. package/build-module/components/block-mover/index.js.map +1 -1
  493. package/build-module/components/block-navigation/dropdown.js +4 -5
  494. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  495. package/build-module/components/block-parent-selector/index.js +4 -4
  496. package/build-module/components/block-parent-selector/index.js.map +1 -1
  497. package/build-module/components/block-pattern-setup/index.js +6 -7
  498. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  499. package/build-module/components/block-patterns-list/index.js +6 -7
  500. package/build-module/components/block-patterns-list/index.js.map +1 -1
  501. package/build-module/components/block-popover/inbetween.js +4 -5
  502. package/build-module/components/block-popover/inbetween.js.map +1 -1
  503. package/build-module/components/block-popover/index.js +4 -5
  504. package/build-module/components/block-popover/index.js.map +1 -1
  505. package/build-module/components/block-preview/auto.js +2 -3
  506. package/build-module/components/block-preview/auto.js.map +1 -1
  507. package/build-module/components/block-preview/index.js +7 -7
  508. package/build-module/components/block-preview/index.js.map +1 -1
  509. package/build-module/components/block-quick-navigation/index.js +69 -0
  510. package/build-module/components/block-quick-navigation/index.js.map +1 -0
  511. package/build-module/components/block-removal-warning-modal/index.js +76 -0
  512. package/build-module/components/block-removal-warning-modal/index.js.map +1 -0
  513. package/build-module/components/block-selection-clearer/index.js +4 -4
  514. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  515. package/build-module/components/block-settings/button.native.js +2 -1
  516. package/build-module/components/block-settings/button.native.js.map +1 -1
  517. package/build-module/components/block-settings/container.native.js +6 -5
  518. package/build-module/components/block-settings/container.native.js.map +1 -1
  519. package/build-module/components/block-settings-menu/block-settings-dropdown.js +10 -10
  520. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  521. package/build-module/components/block-settings-menu/index.js +4 -4
  522. package/build-module/components/block-settings-menu/index.js.map +1 -1
  523. package/build-module/components/block-settings-menu-controls/index.js +4 -4
  524. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  525. package/build-module/components/block-switcher/index.js +1 -2
  526. package/build-module/components/block-switcher/index.js.map +1 -1
  527. package/build-module/components/block-switcher/pattern-transformations-menu.js +6 -7
  528. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  529. package/build-module/components/block-toolbar/index.js +10 -7
  530. package/build-module/components/block-toolbar/index.js.map +1 -1
  531. package/build-module/components/block-tools/block-contextual-toolbar.js +4 -4
  532. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  533. package/build-module/components/block-tools/block-selection-button.js +4 -4
  534. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  535. package/build-module/components/block-tools/index.js +13 -5
  536. package/build-module/components/block-tools/index.js.map +1 -1
  537. package/build-module/components/block-tools/insertion-point.js +5 -4
  538. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  539. package/build-module/components/block-tools/selected-block-popover.js +8 -7
  540. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  541. package/build-module/components/block-types-list/index.native.js +4 -5
  542. package/build-module/components/block-types-list/index.native.js.map +1 -1
  543. package/build-module/components/block-vertical-alignment-control/index.js +4 -5
  544. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  545. package/build-module/components/block-vertical-alignment-control/ui.js +5 -9
  546. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  547. package/build-module/components/border-radius-control/all-input-control.js +2 -3
  548. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  549. package/build-module/components/border-radius-control/input-controls.js +2 -3
  550. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  551. package/build-module/components/border-radius-control/linked-button.js +2 -3
  552. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  553. package/build-module/components/color-palette/control.js +2 -3
  554. package/build-module/components/color-palette/control.js.map +1 -1
  555. package/build-module/components/color-palette/with-color-context.js +2 -3
  556. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  557. package/build-module/components/colors/utils.js +5 -1
  558. package/build-module/components/colors/utils.js.map +1 -1
  559. package/build-module/components/colors/with-colors.js +10 -14
  560. package/build-module/components/colors/with-colors.js.map +1 -1
  561. package/build-module/components/colors-gradients/control.js +7 -4
  562. package/build-module/components/colors-gradients/control.js.map +1 -1
  563. package/build-module/components/colors-gradients/dropdown.js +12 -10
  564. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  565. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +7 -4
  566. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  567. package/build-module/components/copy-handler/index.js +5 -6
  568. package/build-module/components/copy-handler/index.js.map +1 -1
  569. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +87 -0
  570. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  571. package/build-module/components/dimensions-tool/index.js +195 -0
  572. package/build-module/components/dimensions-tool/index.js.map +1 -0
  573. package/build-module/components/dimensions-tool/scale-tool.js +103 -0
  574. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -0
  575. package/build-module/components/dimensions-tool/width-height-tool.js +122 -0
  576. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -0
  577. package/build-module/components/duotone-control/index.js +1 -2
  578. package/build-module/components/duotone-control/index.js.map +1 -1
  579. package/build-module/components/editable-text/index.js +6 -6
  580. package/build-module/components/editable-text/index.js.map +1 -1
  581. package/build-module/components/font-appearance-control/index.js +2 -3
  582. package/build-module/components/font-appearance-control/index.js.map +1 -1
  583. package/build-module/components/font-family/index.js +4 -4
  584. package/build-module/components/font-family/index.js.map +1 -1
  585. package/build-module/components/font-sizes/font-size-picker.js +2 -3
  586. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  587. package/build-module/components/font-sizes/utils.js +2 -2
  588. package/build-module/components/font-sizes/utils.js.map +1 -1
  589. package/build-module/components/font-sizes/with-font-sizes.js +7 -6
  590. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  591. package/build-module/components/global-styles/color-panel.js +15 -15
  592. package/build-module/components/global-styles/color-panel.js.map +1 -1
  593. package/build-module/components/global-styles/effects-panel.js +2 -1
  594. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  595. package/build-module/components/global-styles/filters-panel.js +2 -1
  596. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  597. package/build-module/components/global-styles/index.js +1 -1
  598. package/build-module/components/global-styles/index.js.map +1 -1
  599. package/build-module/components/global-styles/typography-panel.js +7 -7
  600. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  601. package/build-module/components/global-styles/use-global-styles-output.js +11 -10
  602. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  603. package/build-module/components/gradients/with-gradient.js +2 -3
  604. package/build-module/components/gradients/with-gradient.js.map +1 -1
  605. package/build-module/components/iframe/index.js +5 -6
  606. package/build-module/components/iframe/index.js.map +1 -1
  607. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
  608. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  609. package/build-module/components/image-editor/constants.js +1 -2
  610. package/build-module/components/image-editor/constants.js.map +1 -1
  611. package/build-module/components/image-editor/use-save-image.js +1 -2
  612. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  613. package/build-module/components/image-size-control/index.js +5 -0
  614. package/build-module/components/image-size-control/index.js.map +1 -1
  615. package/build-module/components/index.js +1 -1
  616. package/build-module/components/index.js.map +1 -1
  617. package/build-module/components/index.native.js +1 -0
  618. package/build-module/components/index.native.js.map +1 -1
  619. package/build-module/components/inner-blocks/index.js +9 -7
  620. package/build-module/components/inner-blocks/index.js.map +1 -1
  621. package/build-module/components/inner-blocks/index.native.js +8 -6
  622. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  623. package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -27
  624. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  625. package/build-module/components/inner-blocks/with-client-id.js +2 -3
  626. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  627. package/build-module/components/inserter/block-patterns-explorer/explorer.js +2 -1
  628. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  629. package/build-module/components/inserter/block-patterns-tab.js +33 -7
  630. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  631. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -3
  632. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  633. package/build-module/components/inserter/hooks/use-insertion-point.js +1 -1
  634. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  635. package/build-module/components/inserter/index.js +8 -7
  636. package/build-module/components/inserter/index.js.map +1 -1
  637. package/build-module/components/inserter/index.native.js +4 -4
  638. package/build-module/components/inserter/index.native.js.map +1 -1
  639. package/build-module/components/inserter/library.js +1 -1
  640. package/build-module/components/inserter/library.js.map +1 -1
  641. package/build-module/components/inserter/media-tab/media-list.js +2 -3
  642. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  643. package/build-module/components/inserter/media-tab/media-preview.js +4 -5
  644. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  645. package/build-module/components/inserter/media-tab/media-tab.js +3 -3
  646. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  647. package/build-module/components/inserter/reusable-blocks-tab.js +3 -3
  648. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  649. package/build-module/components/inserter/tabs.js +3 -3
  650. package/build-module/components/inserter/tabs.js.map +1 -1
  651. package/build-module/components/inserter-list-item/index.js +4 -4
  652. package/build-module/components/inserter-list-item/index.js.map +1 -1
  653. package/build-module/components/inserter-listbox/group.js +4 -4
  654. package/build-module/components/inserter-listbox/group.js.map +1 -1
  655. package/build-module/components/inserter-listbox/item.js +8 -6
  656. package/build-module/components/inserter-listbox/item.js.map +1 -1
  657. package/build-module/components/inserter-listbox/row.js +4 -4
  658. package/build-module/components/inserter-listbox/row.js.map +1 -1
  659. package/build-module/components/inspector-controls/block-support-slot-container.js +2 -3
  660. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  661. package/build-module/components/inspector-controls/fill.native.js +2 -1
  662. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  663. package/build-module/components/inspector-controls/index.js +4 -5
  664. package/build-module/components/inspector-controls/index.js.map +1 -1
  665. package/build-module/components/inspector-controls/slot.js +4 -5
  666. package/build-module/components/inspector-controls/slot.js.map +1 -1
  667. package/build-module/components/inspector-controls/slot.native.js +2 -1
  668. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  669. package/build-module/components/justify-content-control/index.js +4 -5
  670. package/build-module/components/justify-content-control/index.js.map +1 -1
  671. package/build-module/components/justify-content-control/ui.js +4 -4
  672. package/build-module/components/justify-content-control/ui.js.map +1 -1
  673. package/build-module/components/letter-spacing-control/index.js +2 -3
  674. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  675. package/build-module/components/line-height-control/index.js +2 -3
  676. package/build-module/components/line-height-control/index.js.map +1 -1
  677. package/build-module/components/link-control/index.js +20 -24
  678. package/build-module/components/link-control/index.js.map +1 -1
  679. package/build-module/components/link-control/search-create-button.js +2 -3
  680. package/build-module/components/link-control/search-create-button.js.map +1 -1
  681. package/build-module/components/link-control/search-input.js +7 -5
  682. package/build-module/components/link-control/search-input.js.map +1 -1
  683. package/build-module/components/link-control/search-item.js +2 -3
  684. package/build-module/components/link-control/search-item.js.map +1 -1
  685. package/build-module/components/link-control/search-results.js +2 -3
  686. package/build-module/components/link-control/search-results.js.map +1 -1
  687. package/build-module/components/link-control/settings-drawer.js +4 -5
  688. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  689. package/build-module/components/list-view/appender.js +4 -5
  690. package/build-module/components/list-view/appender.js.map +1 -1
  691. package/build-module/components/list-view/aria-referenced-text.js +4 -5
  692. package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
  693. package/build-module/components/list-view/block-contents.js +4 -4
  694. package/build-module/components/list-view/block-contents.js.map +1 -1
  695. package/build-module/components/list-view/block-select-button.js +14 -4
  696. package/build-module/components/list-view/block-select-button.js.map +1 -1
  697. package/build-module/components/list-view/branch.js +9 -7
  698. package/build-module/components/list-view/branch.js.map +1 -1
  699. package/build-module/components/list-view/drop-indicator.js +61 -11
  700. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  701. package/build-module/components/list-view/index.js +4 -5
  702. package/build-module/components/list-view/index.js.map +1 -1
  703. package/build-module/components/list-view/leaf.js +4 -4
  704. package/build-module/components/list-view/leaf.js.map +1 -1
  705. package/build-module/components/list-view/use-list-view-client-ids.js +2 -22
  706. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  707. package/build-module/components/list-view/use-list-view-drop-zone.js +45 -34
  708. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  709. package/build-module/components/media-placeholder/index.js +38 -13
  710. package/build-module/components/media-placeholder/index.js.map +1 -1
  711. package/build-module/components/media-replace-flow/index.js +1 -3
  712. package/build-module/components/media-replace-flow/index.js.map +1 -1
  713. package/build-module/components/navigable-toolbar/index.js +8 -7
  714. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  715. package/build-module/components/panel-color-settings/index.js +4 -4
  716. package/build-module/components/panel-color-settings/index.js.map +1 -1
  717. package/build-module/components/plain-text/index.js +8 -7
  718. package/build-module/components/plain-text/index.js.map +1 -1
  719. package/build-module/components/plain-text/index.native.js +7 -5
  720. package/build-module/components/plain-text/index.native.js.map +1 -1
  721. package/build-module/components/preview-options/index.js +5 -4
  722. package/build-module/components/preview-options/index.js.map +1 -1
  723. package/build-module/components/provider/index.js +2 -3
  724. package/build-module/components/provider/index.js.map +1 -1
  725. package/build-module/components/provider/use-block-sync.js +21 -0
  726. package/build-module/components/provider/use-block-sync.js.map +1 -1
  727. package/build-module/components/provider/with-registry-provider.js +8 -7
  728. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  729. package/build-module/components/publish-date-time-picker/index.js +4 -4
  730. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  731. package/build-module/components/resizable-box-popover/index.js +5 -4
  732. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  733. package/build-module/components/resolution-tool/index.js +45 -0
  734. package/build-module/components/resolution-tool/index.js.map +1 -0
  735. package/build-module/components/rich-text/content.js +85 -0
  736. package/build-module/components/rich-text/content.js.map +1 -0
  737. package/build-module/components/rich-text/format-toolbar/index.js +1 -2
  738. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  739. package/build-module/components/rich-text/index.js +8 -42
  740. package/build-module/components/rich-text/index.js.map +1 -1
  741. package/build-module/components/rich-text/index.native.js +6 -34
  742. package/build-module/components/rich-text/index.native.js.map +1 -1
  743. package/build-module/components/rich-text/toolbar-button.js +2 -3
  744. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  745. package/build-module/components/spacing-sizes-control/index.js +8 -7
  746. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  747. package/build-module/components/tool-selector/index.js +2 -3
  748. package/build-module/components/tool-selector/index.js.map +1 -1
  749. package/build-module/components/unit-control/index.js +4 -4
  750. package/build-module/components/unit-control/index.js.map +1 -1
  751. package/build-module/components/url-input/index.js +12 -9
  752. package/build-module/components/url-input/index.js.map +1 -1
  753. package/build-module/components/url-input/index.native.js +4 -4
  754. package/build-module/components/url-input/index.native.js.map +1 -1
  755. package/build-module/components/url-popover/image-url-input-ui.js +22 -15
  756. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  757. package/build-module/components/url-popover/index.js +4 -4
  758. package/build-module/components/url-popover/index.js.map +1 -1
  759. package/build-module/components/url-popover/link-editor.js +4 -4
  760. package/build-module/components/url-popover/link-editor.js.map +1 -1
  761. package/build-module/components/url-popover/link-viewer.js +4 -4
  762. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  763. package/build-module/components/use-block-display-information/index.js +29 -2
  764. package/build-module/components/use-block-display-information/index.js.map +1 -1
  765. package/build-module/components/video-player/index.native.js +2 -3
  766. package/build-module/components/video-player/index.native.js.map +1 -1
  767. package/build-module/components/warning/index.native.js +4 -4
  768. package/build-module/components/warning/index.native.js.map +1 -1
  769. package/build-module/components/writing-flow/index.js +2 -3
  770. package/build-module/components/writing-flow/index.js.map +1 -1
  771. package/build-module/components/writing-flow/use-drag-selection.js +1 -1
  772. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  773. package/build-module/components/writing-flow/use-tab-nav.js +32 -5
  774. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  775. package/build-module/hooks/align.js +8 -7
  776. package/build-module/hooks/align.js.map +1 -1
  777. package/build-module/hooks/anchor.js +4 -2
  778. package/build-module/hooks/anchor.js.map +1 -1
  779. package/build-module/hooks/behaviors.js +76 -34
  780. package/build-module/hooks/behaviors.js.map +1 -1
  781. package/build-module/hooks/border.js +4 -4
  782. package/build-module/hooks/border.js.map +1 -1
  783. package/build-module/hooks/color.js +4 -4
  784. package/build-module/hooks/color.js.map +1 -1
  785. package/build-module/hooks/content-lock-ui.js +8 -7
  786. package/build-module/hooks/content-lock-ui.js.map +1 -1
  787. package/build-module/hooks/custom-class-name.js +4 -2
  788. package/build-module/hooks/custom-class-name.js.map +1 -1
  789. package/build-module/hooks/dimensions.js +7 -6
  790. package/build-module/hooks/dimensions.js.map +1 -1
  791. package/build-module/hooks/duotone.js +5 -4
  792. package/build-module/hooks/duotone.js.map +1 -1
  793. package/build-module/hooks/font-family.js +1 -5
  794. package/build-module/hooks/font-family.js.map +1 -1
  795. package/build-module/hooks/font-size.js +10 -9
  796. package/build-module/hooks/font-size.js.map +1 -1
  797. package/build-module/hooks/layout.js +26 -24
  798. package/build-module/hooks/layout.js.map +1 -1
  799. package/build-module/hooks/position.js +23 -15
  800. package/build-module/hooks/position.js.map +1 -1
  801. package/build-module/hooks/style.js +8 -4
  802. package/build-module/hooks/style.js.map +1 -1
  803. package/build-module/hooks/supports.js +1 -1
  804. package/build-module/hooks/supports.js.map +1 -1
  805. package/build-module/hooks/typography.native.js +3 -1
  806. package/build-module/hooks/typography.native.js.map +1 -1
  807. package/build-module/hooks/use-typography-props.js +8 -15
  808. package/build-module/hooks/use-typography-props.js.map +1 -1
  809. package/build-module/index.js +1 -1
  810. package/build-module/index.js.map +1 -1
  811. package/build-module/layouts/constrained.js +2 -1
  812. package/build-module/layouts/constrained.js.map +1 -1
  813. package/build-module/layouts/definitions.js +147 -0
  814. package/build-module/layouts/definitions.js.map +1 -0
  815. package/build-module/layouts/flex.js +8 -6
  816. package/build-module/layouts/flex.js.map +1 -1
  817. package/build-module/layouts/flow.js +2 -1
  818. package/build-module/layouts/flow.js.map +1 -1
  819. package/build-module/layouts/grid.js +2 -1
  820. package/build-module/layouts/grid.js.map +1 -1
  821. package/build-module/layouts/utils.js +7 -2
  822. package/build-module/layouts/utils.js.map +1 -1
  823. package/build-module/private-apis.js +16 -1
  824. package/build-module/private-apis.js.map +1 -1
  825. package/build-module/store/actions.js +2 -62
  826. package/build-module/store/actions.js.map +1 -1
  827. package/build-module/store/defaults.js +1 -0
  828. package/build-module/store/defaults.js.map +1 -1
  829. package/build-module/store/private-actions.js +186 -0
  830. package/build-module/store/private-actions.js.map +1 -1
  831. package/build-module/store/private-selectors.js +63 -3
  832. package/build-module/store/private-selectors.js.map +1 -1
  833. package/build-module/store/reducer.js +52 -1
  834. package/build-module/store/reducer.js.map +1 -1
  835. package/build-module/store/selectors.js +42 -42
  836. package/build-module/store/selectors.js.map +1 -1
  837. package/build-module/utils/object.js +37 -1
  838. package/build-module/utils/object.js.map +1 -1
  839. package/build-style/style-rtl.css +58 -67
  840. package/build-style/style.css +58 -67
  841. package/package.json +32 -31
  842. package/src/autocompleters/block.js +4 -2
  843. package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -6
  844. package/src/components/alignment-control/ui.js +1 -2
  845. package/src/components/block-actions/index.js +10 -0
  846. package/src/components/block-alignment-control/constants.js +0 -4
  847. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -5
  848. package/src/components/block-alignment-control/ui.js +1 -6
  849. package/src/components/block-alignment-matrix-control/index.js +1 -1
  850. package/src/components/block-breadcrumb/index.js +2 -6
  851. package/src/components/block-edit/index.js +3 -5
  852. package/src/components/block-heading-level-dropdown/README.md +52 -0
  853. package/src/components/block-heading-level-dropdown/heading-level-icon.js +43 -0
  854. package/src/components/block-heading-level-dropdown/index.js +77 -0
  855. package/src/components/block-heading-level-dropdown/index.native.js +63 -0
  856. package/src/components/block-inspector/index.js +18 -92
  857. package/src/components/block-inspector/style.scss +0 -5
  858. package/src/components/block-list/block.native.js +1 -0
  859. package/src/components/block-list/index.js +1 -1
  860. package/src/components/block-list/use-in-between-inserter.js +0 -4
  861. package/src/components/block-list-appender/index.js +29 -22
  862. package/src/components/block-lock/style.scss +11 -4
  863. package/src/components/block-lock/toolbar.js +34 -6
  864. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  865. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +2 -2
  866. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +3 -3
  867. package/src/components/block-mover/test/index.native.js +1 -20
  868. package/src/components/block-preview/index.js +7 -14
  869. package/src/components/block-quick-navigation/index.js +81 -0
  870. package/src/components/block-removal-warning-modal/index.js +94 -0
  871. package/src/components/block-settings-menu/block-settings-dropdown.js +15 -13
  872. package/src/components/block-switcher/index.js +1 -2
  873. package/src/components/block-toolbar/index.js +9 -6
  874. package/src/components/block-toolbar/style.scss +0 -4
  875. package/src/components/block-tools/index.js +10 -1
  876. package/src/components/block-tools/style.scss +4 -0
  877. package/src/components/block-vertical-alignment-control/ui.js +1 -3
  878. package/src/components/colors/utils.js +5 -1
  879. package/src/components/colors/with-colors.js +1 -5
  880. package/src/components/copy-handler/index.js +5 -5
  881. package/src/components/dimensions-tool/aspect-ratio-tool.js +124 -0
  882. package/src/components/dimensions-tool/index.js +212 -0
  883. package/src/components/dimensions-tool/scale-tool.js +124 -0
  884. package/src/components/dimensions-tool/stories/aspect-ratio-tool.js +52 -0
  885. package/src/components/dimensions-tool/stories/index.js +54 -0
  886. package/src/components/dimensions-tool/stories/scale-tool.js +48 -0
  887. package/src/components/dimensions-tool/stories/width-height-tool.js +54 -0
  888. package/src/components/dimensions-tool/test/index.js +641 -0
  889. package/src/components/dimensions-tool/width-height-tool.js +113 -0
  890. package/src/components/duotone-control/index.js +0 -1
  891. package/src/components/font-sizes/test/fluid-utils.js +97 -76
  892. package/src/components/font-sizes/utils.js +2 -2
  893. package/src/components/global-styles/color-panel.js +3 -3
  894. package/src/components/global-styles/index.js +1 -0
  895. package/src/components/global-styles/test/use-global-styles-output.js +14 -9
  896. package/src/components/global-styles/typography-panel.js +19 -16
  897. package/src/components/global-styles/use-global-styles-output.js +12 -12
  898. package/src/components/iframe/index.js +1 -1
  899. package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
  900. package/src/components/image-editor/constants.js +0 -1
  901. package/src/components/image-editor/use-save-image.js +0 -1
  902. package/src/components/image-size-control/index.js +6 -0
  903. package/src/components/index.js +1 -1
  904. package/src/components/index.native.js +1 -0
  905. package/src/components/inner-blocks/index.js +4 -2
  906. package/src/components/inner-blocks/index.native.js +1 -1
  907. package/src/components/inner-blocks/use-nested-settings-update.js +31 -36
  908. package/src/components/inserter/block-patterns-tab.js +63 -8
  909. package/src/components/inserter/hooks/use-block-types-state.js +4 -3
  910. package/src/components/inserter/hooks/use-insertion-point.js +1 -0
  911. package/src/components/inserter/library.js +2 -1
  912. package/src/components/inserter/media-tab/media-tab.js +9 -3
  913. package/src/components/inserter/reusable-blocks-tab.js +3 -3
  914. package/src/components/inserter/tabs.js +3 -3
  915. package/src/components/link-control/index.js +34 -37
  916. package/src/components/link-control/search-input.js +5 -3
  917. package/src/components/link-control/settings-drawer.js +6 -5
  918. package/src/components/link-control/style.scss +33 -55
  919. package/src/components/link-control/test/index.js +161 -159
  920. package/src/components/list-view/block-select-button.js +19 -1
  921. package/src/components/list-view/branch.js +6 -3
  922. package/src/components/list-view/drop-indicator.js +94 -9
  923. package/src/components/list-view/style.scss +13 -12
  924. package/src/components/list-view/test/use-list-view-drop-zone.js +188 -93
  925. package/src/components/list-view/use-list-view-client-ids.js +3 -20
  926. package/src/components/list-view/use-list-view-drop-zone.js +97 -54
  927. package/src/components/media-placeholder/index.js +54 -20
  928. package/src/components/media-replace-flow/index.js +1 -3
  929. package/src/components/media-replace-flow/test/index.js +1 -1
  930. package/src/components/preview-options/index.js +3 -2
  931. package/src/components/provider/test/experimental-provider.js +9 -6
  932. package/src/components/provider/test/use-block-sync.js +21 -6
  933. package/src/components/provider/use-block-sync.js +19 -0
  934. package/src/components/resolution-tool/index.js +56 -0
  935. package/src/components/resolution-tool/stories/index.js +48 -0
  936. package/src/components/rich-text/content.js +85 -0
  937. package/src/components/rich-text/format-toolbar/index.js +1 -2
  938. package/src/components/rich-text/index.js +2 -35
  939. package/src/components/rich-text/index.native.js +3 -33
  940. package/src/components/url-input/index.js +2 -0
  941. package/src/components/url-popover/image-url-input-ui.js +15 -15
  942. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  943. package/src/components/use-block-display-information/index.js +26 -0
  944. package/src/components/writing-flow/use-drag-selection.js +1 -1
  945. package/src/components/writing-flow/use-tab-nav.js +42 -6
  946. package/src/hooks/behaviors.js +82 -39
  947. package/src/hooks/font-family.js +1 -5
  948. package/src/hooks/font-size.js +12 -17
  949. package/src/hooks/layout.js +17 -25
  950. package/src/hooks/position.js +24 -12
  951. package/src/hooks/supports.js +1 -1
  952. package/src/hooks/use-typography-props.js +14 -19
  953. package/src/index.js +0 -2
  954. package/src/layouts/constrained.js +2 -1
  955. package/src/layouts/definitions.js +174 -0
  956. package/src/layouts/flex.js +7 -5
  957. package/src/layouts/flow.js +2 -1
  958. package/src/layouts/grid.js +2 -1
  959. package/src/layouts/test/utils.js +2 -7
  960. package/src/layouts/utils.js +7 -2
  961. package/src/private-apis.js +15 -0
  962. package/src/store/actions.js +7 -56
  963. package/src/store/defaults.js +1 -0
  964. package/src/store/private-actions.js +193 -0
  965. package/src/store/private-selectors.js +108 -35
  966. package/src/store/reducer.js +44 -0
  967. package/src/store/selectors.js +61 -39
  968. package/src/store/test/private-selectors.js +269 -1
  969. package/src/store/test/selectors.js +18 -17
  970. package/src/utils/object.js +35 -0
  971. package/src/utils/test/object.js +96 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-parent-selector/index.js"],"names":["BlockParentSelector","selectBlock","toggleBlockHighlight","blockEditorStore","firstParentClientId","shouldHide","isDistractionFree","select","getBlockName","getBlockParents","getSelectedBlockClientId","getSettings","hasBlockSupport","blocksStore","selectedBlockClientId","parents","_firstParentClientId","length","parentBlockName","_parentBlockType","settings","blockInformation","nodeRef","gestures","showMoversGestures","ref","onChange","isFocused","undefined","title","icon"],"mappings":";;;;;;;;;AAOA;;;;AAJA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAOA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,mBAAT,GAA+B;AAC7C,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MACL,uBAAaC,YAAb,CADD;AAEA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,UAAvB;AAAmCC,IAAAA;AAAnC,MAAyD,qBAC5DC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,YADK;AAELC,MAAAA,eAFK;AAGLC,MAAAA,wBAHK;AAILC,MAAAA;AAJK,QAKFJ,MAAM,CAAEJ,YAAF,CALV;AAMA,UAAM;AAAES,MAAAA;AAAF,QAAsBL,MAAM,CAAEM,aAAF,CAAlC;AACA,UAAMC,qBAAqB,GAAGJ,wBAAwB,EAAtD;AACA,UAAMK,OAAO,GAAGN,eAAe,CAAEK,qBAAF,CAA/B;AACA,UAAME,oBAAoB,GAAGD,OAAO,CAAEA,OAAO,CAACE,MAAR,GAAiB,CAAnB,CAApC;AACA,UAAMC,eAAe,GAAGV,YAAY,CAAEQ,oBAAF,CAApC;;AACA,UAAMG,gBAAgB,GAAG,0BAAcD,eAAd,CAAzB;;AACA,UAAME,QAAQ,GAAGT,WAAW,EAA5B;AACA,WAAO;AACNP,MAAAA,mBAAmB,EAAEY,oBADf;AAENX,MAAAA,UAAU,EAAE,CAAEO,eAAe,CAC5BO,gBAD4B,EAE5B,8BAF4B,EAG5B,IAH4B,CAFvB;AAONb,MAAAA,iBAAiB,EAAEc,QAAQ,CAACd;AAPtB,KAAP;AASA,GAxB6D,EAyB9D,EAzB8D,CAA/D;AA2BA,QAAMe,gBAAgB,GAAG,yCAA4BjB,mBAA5B,CAAzB,CA9B6C,CAgC7C;AACA;;AACA,QAAMkB,OAAO,GAAG,sBAAhB;AACA,QAAM;AAAEC,IAAAA,QAAQ,EAAEC;AAAZ,MAAmC,kCAAuB;AAC/DC,IAAAA,GAAG,EAAEH,OAD0D;;AAE/DI,IAAAA,QAAQ,CAAEC,SAAF,EAAc;AACrB,UAAKA,SAAS,IAAIrB,iBAAlB,EAAsC;AACrC;AACA;;AACDJ,MAAAA,oBAAoB,CAAEE,mBAAF,EAAuBuB,SAAvB,CAApB;AACA;;AAP8D,GAAvB,CAAzC;;AAUA,MAAKtB,UAAU,IAAID,mBAAmB,KAAKwB,SAA3C,EAAuD;AACtD,WAAO,IAAP;AACA;;AAED,SACC;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,GAAG,EAAGxB,mBAFP;AAGC,IAAA,GAAG,EAAGkB;AAHP,KAIME,kBAJN,GAMC,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,OAAO,EAAG,MAAMvB,WAAW,CAAEG,mBAAF,CAF5B;AAGC,IAAA,KAAK,EAAG;AACP;AACA,kBAAI,WAAJ,CAFO,EAGPiB,gBAAgB,EAAEQ,KAHX,CAHT;AAQC,IAAA,WAAW,MARZ;AASC,IAAA,IAAI,EAAG,4BAAC,kBAAD;AAAW,MAAA,IAAI,EAAGR,gBAAgB,EAAES;AAApC;AATR,IAND,CADD;AAoBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { ToolbarButton } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport BlockIcon from '../block-icon';\nimport { useShowMoversGestures } from '../block-toolbar/utils';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Block parent selector component, displaying the hierarchy of the\n * current block selection as a single icon to \"go up\" a level.\n *\n * @return {WPComponent} Parent block selector.\n */\nexport default function BlockParentSelector() {\n\tconst { selectBlock, toggleBlockHighlight } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { firstParentClientId, shouldHide, isDistractionFree } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { hasBlockSupport } = select( blocksStore );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst parents = getBlockParents( selectedBlockClientId );\n\t\t\tconst _firstParentClientId = parents[ parents.length - 1 ];\n\t\t\tconst parentBlockName = getBlockName( _firstParentClientId );\n\t\t\tconst _parentBlockType = getBlockType( parentBlockName );\n\t\t\tconst settings = getSettings();\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tshouldHide: ! hasBlockSupport(\n\t\t\t\t\t_parentBlockType,\n\t\t\t\t\t'__experimentalParentSelector',\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockInformation = useBlockDisplayInformation( firstParentClientId );\n\n\t// Allows highlighting the parent block outline when focusing or hovering\n\t// the parent block selector within the child.\n\tconst nodeRef = useRef();\n\tconst { gestures: showMoversGestures } = useShowMoversGestures( {\n\t\tref: nodeRef,\n\t\tonChange( isFocused ) {\n\t\t\tif ( isFocused && isDistractionFree ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttoggleBlockHighlight( firstParentClientId, isFocused );\n\t\t},\n\t} );\n\n\tif ( shouldHide || firstParentClientId === undefined ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-block-parent-selector\"\n\t\t\tkey={ firstParentClientId }\n\t\t\tref={ nodeRef }\n\t\t\t{ ...showMoversGestures }\n\t\t>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName=\"block-editor-block-parent-selector__button\"\n\t\t\t\tonClick={ () => selectBlock( firstParentClientId ) }\n\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t/* translators: %s: Name of the block's parent. */\n\t\t\t\t\t__( 'Select %s' ),\n\t\t\t\t\tblockInformation?.title\n\t\t\t\t) }\n\t\t\t\tshowTooltip\n\t\t\t\ticon={ <BlockIcon icon={ blockInformation?.icon } /> }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-parent-selector/index.js"],"names":["BlockParentSelector","selectBlock","toggleBlockHighlight","blockEditorStore","firstParentClientId","shouldHide","isDistractionFree","select","getBlockName","getBlockParents","getSelectedBlockClientId","getSettings","hasBlockSupport","blocksStore","selectedBlockClientId","parents","_firstParentClientId","length","parentBlockName","_parentBlockType","settings","blockInformation","nodeRef","gestures","showMoversGestures","ref","onChange","isFocused","undefined","title","icon"],"mappings":";;;;;;;;;AAOA;;AAJA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAOA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,mBAAT,GAA+B;AAC7C,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MACL,uBAAaC,YAAb,CADD;AAEA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,UAAvB;AAAmCC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AAuD;AACtD,WAAO,IAAP;AACA;;AAED,SACC;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,GAAG,EAAGxB,mBAFP;AAGC,IAAA,GAAG,EAAGkB,OAHP;AAAA,OAIME;AAJN,KAMC,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAC,4CADX;AAEC,IAAA,OAAO,EAAG,MAAMvB,WAAW,CAAEG,mBAAF,CAF5B;AAGC,IAAA,KAAK,EAAG;AACP;AACA,kBAAI,WAAJ,CAFO,EAGPiB,gBAAgB,EAAEQ,KAHX,CAHT;AAQC,IAAA,WAAW,MARZ;AASC,IAAA,IAAI,EAAG,4BAAC,kBAAD;AAAW,MAAA,IAAI,EAAGR,gBAAgB,EAAES;AAApC;AATR,IAND,CADD;AAoBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { ToolbarButton } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport BlockIcon from '../block-icon';\nimport { useShowMoversGestures } from '../block-toolbar/utils';\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Block parent selector component, displaying the hierarchy of the\n * current block selection as a single icon to \"go up\" a level.\n *\n * @return {WPComponent} Parent block selector.\n */\nexport default function BlockParentSelector() {\n\tconst { selectBlock, toggleBlockHighlight } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { firstParentClientId, shouldHide, isDistractionFree } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { hasBlockSupport } = select( blocksStore );\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst parents = getBlockParents( selectedBlockClientId );\n\t\t\tconst _firstParentClientId = parents[ parents.length - 1 ];\n\t\t\tconst parentBlockName = getBlockName( _firstParentClientId );\n\t\t\tconst _parentBlockType = getBlockType( parentBlockName );\n\t\t\tconst settings = getSettings();\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tshouldHide: ! hasBlockSupport(\n\t\t\t\t\t_parentBlockType,\n\t\t\t\t\t'__experimentalParentSelector',\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisDistractionFree: settings.isDistractionFree,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockInformation = useBlockDisplayInformation( firstParentClientId );\n\n\t// Allows highlighting the parent block outline when focusing or hovering\n\t// the parent block selector within the child.\n\tconst nodeRef = useRef();\n\tconst { gestures: showMoversGestures } = useShowMoversGestures( {\n\t\tref: nodeRef,\n\t\tonChange( isFocused ) {\n\t\t\tif ( isFocused && isDistractionFree ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttoggleBlockHighlight( firstParentClientId, isFocused );\n\t\t},\n\t} );\n\n\tif ( shouldHide || firstParentClientId === undefined ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-block-parent-selector\"\n\t\t\tkey={ firstParentClientId }\n\t\t\tref={ nodeRef }\n\t\t\t{ ...showMoversGestures }\n\t\t>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName=\"block-editor-block-parent-selector__button\"\n\t\t\t\tonClick={ () => selectBlock( firstParentClientId ) }\n\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t/* translators: %s: Name of the block's parent. */\n\t\t\t\t\t__( 'Select %s' ),\n\t\t\t\t\tblockInformation?.title\n\t\t\t\t) }\n\t\t\t\tshowTooltip\n\t\t\t\ticon={ <BlockIcon icon={ blockInformation?.icon } /> }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _data = require("@wordpress/data");
15
13
 
16
14
  var _blocks = require("@wordpress/blocks");
@@ -65,11 +63,11 @@ const SetupContent = ({
65
63
 
66
64
  return (0, _element.createElement)("div", {
67
65
  className: "block-editor-block-pattern-setup__grid"
68
- }, (0, _element.createElement)(_components.__unstableComposite, (0, _extends2.default)({}, composite, {
66
+ }, (0, _element.createElement)(_components.__unstableComposite, { ...composite,
69
67
  role: "listbox",
70
68
  className: containerClass,
71
69
  "aria-label": (0, _i18n.__)('Patterns list')
72
- }), patterns.map(pattern => (0, _element.createElement)(BlockPattern, {
70
+ }, patterns.map(pattern => (0, _element.createElement)(BlockPattern, {
73
71
  key: pattern.name,
74
72
  pattern: pattern,
75
73
  onSelect: onBlockPatternSelect,
@@ -95,13 +93,13 @@ function BlockPattern({
95
93
  className: `${baseClassName}__list-item`,
96
94
  "aria-label": pattern.title,
97
95
  "aria-describedby": pattern.description ? descriptionId : undefined
98
- }, (0, _element.createElement)(_components.__unstableCompositeItem, (0, _extends2.default)({
96
+ }, (0, _element.createElement)(_components.__unstableCompositeItem, {
99
97
  role: "option",
100
- as: "div"
101
- }, composite, {
98
+ as: "div",
99
+ ...composite,
102
100
  className: `${baseClassName}__item`,
103
101
  onClick: () => onSelect(blocks)
104
- }), (0, _element.createElement)(_blockPreview.default, {
102
+ }, (0, _element.createElement)(_blockPreview.default, {
105
103
  blocks: blocks,
106
104
  viewportWidth: viewportWidth
107
105
  }), showTitles && (0, _element.createElement)("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-pattern-setup/index.js"],"names":["SetupContent","viewMode","activeSlide","patterns","onBlockPatternSelect","showTitles","composite","containerClass","VIEWMODES","carousel","slideClass","Map","map","pattern","index","get","name","BlockPattern","onSelect","baseClassName","blocks","description","viewportWidth","descriptionId","title","undefined","BlockPatternSlide","className","minHeight","BlockPatternSetup","clientId","blockName","filterPatternsFn","initialViewMode","setViewMode","setActiveSlide","replaceBlock","blockEditorStore","length","onBlockPatternSelectDefault","clonedBlocks","block","onPatternSelectCallback","active"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AACA;;AACA;;AAQA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAcA;AACA;AACA;AAOA,MAAMA,YAAY,GAAG,CAAE;AACtBC,EAAAA,QADsB;AAEtBC,EAAAA,WAFsB;AAGtBC,EAAAA,QAHsB;AAItBC,EAAAA,oBAJsB;AAKtBC,EAAAA;AALsB,CAAF,KAMd;AACN,QAAMC,SAAS,GAAG,8CAAlB;AACA,QAAMC,cAAc,GAAG,6CAAvB;;AACA,MAAKN,QAAQ,KAAKO,qBAAUC,QAA5B,EAAuC;AACtC,UAAMC,UAAU,GAAG,IAAIC,GAAJ,CAAS,CAC3B,CAAET,WAAF,EAAe,cAAf,CAD2B,EAE3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,gBAAnB,CAF2B,EAG3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,YAAnB,CAH2B,CAAT,CAAnB;AAKA,WACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC;AAAK,MAAA,SAAS,EAAGK;AAAjB,OACC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGJ,QAAQ,CAACS,GAAT,CAAc,CAAEC,OAAF,EAAWC,KAAX,KACf,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAGJ,UAAU,CAACK,GAAX,CAAgBD,KAAhB,KAA2B,EADxC;AAEC,MAAA,GAAG,EAAGD,OAAO,CAACG,IAFf;AAGC,MAAA,OAAO,EAAGH;AAHX,MADC,CADH,CADD,CADD,CADD;AAeA;;AACD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,+BAAD,6BACMP,SADN;AAEC,IAAA,IAAI,EAAC,SAFN;AAGC,IAAA,SAAS,EAAGC,cA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nB,MAAF,IAAc;AACjD,UAAMoB,YAAY,GAAGpB,MAAM,CAACR,GAAP,CAAc6B,KAAF,IAAa,wBAAYA,KAAZ,CAAzB,CAArB;AACAL,IAAAA,YAAY,CAAEN,QAAF,EAAYU,YAAZ,CAAZ;AACA,GAHD;;AAIA,QAAME,uBAAuB,GAC5BtC,oBAAoB,IAAImC,2BADzB;AAEA,SACC,qDACC;AACC,IAAA,SAAS,EAAI,8CAA8CtC,QAAU;AADtE,KAGC,4BAAC,YAAD;AACC,IAAA,QAAQ,EAAGA,QADZ;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,oBAAoB,EAAGuC,uBAJxB;AAKC,IAAA,UAAU,EAAGrC;AALd,IAHD,EAUC,4BAAC,qBAAD;AACC,IAAA,QAAQ,EAAGJ,QADZ;AAEC,IAAA,WAAW,EAAGiC,WAFf;AAGC,IAAA,WAAW,EAAGhC,WAHf;AAIC,IAAA,WAAW,EAAGC,QAAQ,CAACmC,MAJxB;AAKC,IAAA,UAAU,EAAG,MAAM;AAClBH,MAAAA,cAAc,CAAIQ,MAAF,IAAcA,MAAM,GAAG,CAAzB,CAAd;AACA,KAPF;AAQC,IAAA,cAAc,EAAG,MAAM;AACtBR,MAAAA,cAAc,CAAIQ,MAAF,IAAcA,MAAM,GAAG,CAAzB,CAAd;AACA,KAVF;AAWC,IAAA,oBAAoB,EAAG,MAAM;AAC5BD,MAAAA,uBAAuB,CACtBvC,QAAQ,CAAED,WAAF,CAAR,CAAwBkB,MADF,CAAvB;AAGA;AAfF,IAVD,CADD,CADD;AAgCA,CAvDD;;eAyDeS,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\n\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockPreview from '../block-preview';\nimport SetupToolbar from './setup-toolbar';\nimport usePatternsSetup from './use-patterns-setup';\nimport { VIEWMODES } from './constants';\n\nconst SetupContent = ( {\n\tviewMode,\n\tactiveSlide,\n\tpatterns,\n\tonBlockPatternSelect,\n\tshowTitles,\n} ) => {\n\tconst composite = useCompositeState();\n\tconst containerClass = 'block-editor-block-pattern-setup__container';\n\tif ( viewMode === VIEWMODES.carousel ) {\n\t\tconst slideClass = new Map( [\n\t\t\t[ activeSlide, 'active-slide' ],\n\t\t\t[ activeSlide - 1, 'previous-slide' ],\n\t\t\t[ activeSlide + 1, 'next-slide' ],\n\t\t] );\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-pattern-setup__carousel\">\n\t\t\t\t<div className={ containerClass }>\n\t\t\t\t\t<ul className=\"carousel-container\">\n\t\t\t\t\t\t{ patterns.map( ( pattern, index ) => (\n\t\t\t\t\t\t\t<BlockPatternSlide\n\t\t\t\t\t\t\t\tclassName={ slideClass.get( index ) || '' }\n\t\t\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<div className=\"block-editor-block-pattern-setup__grid\">\n\t\t\t<Composite\n\t\t\t\t{ ...composite }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName={ containerClass }\n\t\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t\t>\n\t\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonSelect={ onBlockPatternSelect }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t</div>\n\t);\n};\n\nfunction BlockPattern( { pattern, onSelect, composite, showTitles } ) {\n\tconst baseClassName = 'block-editor-block-pattern-setup-list';\n\tconst { blocks, description, viewportWidth = 700 } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }__item-description`\n\t);\n\treturn (\n\t\t<div\n\t\t\tclassName={ `${ baseClassName }__list-item` }\n\t\t\taria-label={ pattern.title }\n\t\t\taria-describedby={ pattern.description ? descriptionId : undefined }\n\t\t>\n\t\t\t<CompositeItem\n\t\t\t\trole=\"option\"\n\t\t\t\tas=\"div\"\n\t\t\t\t{ ...composite }\n\t\t\t\tclassName={ `${ baseClassName }__item` }\n\t\t\t\tonClick={ () => onSelect( blocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t/>\n\t\t\t\t{ showTitles && (\n\t\t\t\t\t<div className={ `${ baseClassName }__item-title` }>\n\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ !! description && (\n\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</CompositeItem>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternSlide( { className, pattern, minHeight } ) {\n\tconst { blocks, title, description } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPatternSlide,\n\t\t'block-editor-block-pattern-setup-list__item-description'\n\t);\n\treturn (\n\t\t<li\n\t\t\tclassName={ `pattern-slide ${ className }` }\n\t\t\taria-label={ title }\n\t\t\taria-describedby={ description ? descriptionId : undefined }\n\t\t>\n\t\t\t<BlockPreview blocks={ blocks } minHeight={ minHeight } />\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</li>\n\t);\n}\n\nconst BlockPatternSetup = ( {\n\tclientId,\n\tblockName,\n\tfilterPatternsFn,\n\tonBlockPatternSelect,\n\tinitialViewMode = VIEWMODES.carousel,\n\tshowTitles = false,\n} ) => {\n\tconst [ viewMode, setViewMode ] = useState( initialViewMode );\n\tconst [ activeSlide, setActiveSlide ] = useState( 0 );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );\n\n\tif ( ! patterns?.length ) {\n\t\treturn null;\n\t}\n\n\tconst onBlockPatternSelectDefault = ( blocks ) => {\n\t\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\t\treplaceBlock( clientId, clonedBlocks );\n\t};\n\tconst onPatternSelectCallback =\n\t\tonBlockPatternSelect || onBlockPatternSelectDefault;\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ `block-editor-block-pattern-setup view-mode-${ viewMode }` }\n\t\t\t>\n\t\t\t\t<SetupContent\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonBlockPatternSelect={ onPatternSelectCallback }\n\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t/>\n\t\t\t\t<SetupToolbar\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tsetViewMode={ setViewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\ttotalSlides={ patterns.length }\n\t\t\t\t\thandleNext={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active + 1 );\n\t\t\t\t\t} }\n\t\t\t\t\thandlePrevious={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active - 1 );\n\t\t\t\t\t} }\n\t\t\t\t\tonBlockPatternSelect={ () => {\n\t\t\t\t\t\tonPatternSelectCallback(\n\t\t\t\t\t\t\tpatterns[ activeSlide ].blocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default BlockPatternSetup;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-pattern-setup/index.js"],"names":["SetupContent","viewMode","activeSlide","patterns","onBlockPatternSelect","showTitles","composite","containerClass","VIEWMODES","carousel","slideClass","Map","map","pattern","index","get","name","BlockPattern","onSelect","baseClassName","blocks","description","viewportWidth","descriptionId","title","undefined","BlockPatternSlide","className","minHeight","BlockPatternSetup","clientId","blockName","filterPatternsFn","initialViewMode","setViewMode","setActiveSlide","replaceBlock","blockEditorStore","length","onBlockPatternSelectDefault","clonedBlocks","block","onPatternSelectCallback","active"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAQA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAcA;AACA;AACA;AAOA,MAAMA,YAAY,GAAG,CAAE;AACtBC,EAAAA,QADsB;AAEtBC,EAAAA,WAFsB;AAGtBC,EAAAA,QAHsB;AAItBC,EAAAA,oBAJsB;AAKtBC,EAAAA;AALsB,CAAF,KAMd;AACN,QAAMC,SAAS,GAAG,8CAAlB;AACA,QAAMC,cAAc,GAAG,6CAAvB;;AACA,MAAKN,QAAQ,KAAKO,qBAAUC,QAA5B,EAAuC;AACtC,UAAMC,UAAU,GAAG,IAAIC,GAAJ,CAAS,CAC3B,CAAET,WAAF,EAAe,cAAf,CAD2B,EAE3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,gBAAnB,CAF2B,EAG3B,CAAEA,WAAW,GAAG,CAAhB,EAAmB,YAAnB,CAH2B,CAAT,CAAnB;AAKA,WACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC;AAA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G,MAAM;AACtBR,MAAAA,cAAc,CAAIQ,MAAF,IAAcA,MAAM,GAAG,CAAzB,CAAd;AACA,KAVF;AAWC,IAAA,oBAAoB,EAAG,MAAM;AAC5BD,MAAAA,uBAAuB,CACtBvC,QAAQ,CAAED,WAAF,CAAR,CAAwBkB,MADF,CAAvB;AAGA;AAfF,IAVD,CADD,CADD;AAgCA,CAvDD;;eAyDeS,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { cloneBlock } from '@wordpress/blocks';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\n\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockPreview from '../block-preview';\nimport SetupToolbar from './setup-toolbar';\nimport usePatternsSetup from './use-patterns-setup';\nimport { VIEWMODES } from './constants';\n\nconst SetupContent = ( {\n\tviewMode,\n\tactiveSlide,\n\tpatterns,\n\tonBlockPatternSelect,\n\tshowTitles,\n} ) => {\n\tconst composite = useCompositeState();\n\tconst containerClass = 'block-editor-block-pattern-setup__container';\n\tif ( viewMode === VIEWMODES.carousel ) {\n\t\tconst slideClass = new Map( [\n\t\t\t[ activeSlide, 'active-slide' ],\n\t\t\t[ activeSlide - 1, 'previous-slide' ],\n\t\t\t[ activeSlide + 1, 'next-slide' ],\n\t\t] );\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-pattern-setup__carousel\">\n\t\t\t\t<div className={ containerClass }>\n\t\t\t\t\t<ul className=\"carousel-container\">\n\t\t\t\t\t\t{ patterns.map( ( pattern, index ) => (\n\t\t\t\t\t\t\t<BlockPatternSlide\n\t\t\t\t\t\t\t\tclassName={ slideClass.get( index ) || '' }\n\t\t\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<div className=\"block-editor-block-pattern-setup__grid\">\n\t\t\t<Composite\n\t\t\t\t{ ...composite }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName={ containerClass }\n\t\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t\t>\n\t\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonSelect={ onBlockPatternSelect }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t</div>\n\t);\n};\n\nfunction BlockPattern( { pattern, onSelect, composite, showTitles } ) {\n\tconst baseClassName = 'block-editor-block-pattern-setup-list';\n\tconst { blocks, description, viewportWidth = 700 } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }__item-description`\n\t);\n\treturn (\n\t\t<div\n\t\t\tclassName={ `${ baseClassName }__list-item` }\n\t\t\taria-label={ pattern.title }\n\t\t\taria-describedby={ pattern.description ? descriptionId : undefined }\n\t\t>\n\t\t\t<CompositeItem\n\t\t\t\trole=\"option\"\n\t\t\t\tas=\"div\"\n\t\t\t\t{ ...composite }\n\t\t\t\tclassName={ `${ baseClassName }__item` }\n\t\t\t\tonClick={ () => onSelect( blocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t/>\n\t\t\t\t{ showTitles && (\n\t\t\t\t\t<div className={ `${ baseClassName }__item-title` }>\n\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ !! description && (\n\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</CompositeItem>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternSlide( { className, pattern, minHeight } ) {\n\tconst { blocks, title, description } = pattern;\n\tconst descriptionId = useInstanceId(\n\t\tBlockPatternSlide,\n\t\t'block-editor-block-pattern-setup-list__item-description'\n\t);\n\treturn (\n\t\t<li\n\t\t\tclassName={ `pattern-slide ${ className }` }\n\t\t\taria-label={ title }\n\t\t\taria-describedby={ description ? descriptionId : undefined }\n\t\t>\n\t\t\t<BlockPreview blocks={ blocks } minHeight={ minHeight } />\n\t\t\t{ !! description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</li>\n\t);\n}\n\nconst BlockPatternSetup = ( {\n\tclientId,\n\tblockName,\n\tfilterPatternsFn,\n\tonBlockPatternSelect,\n\tinitialViewMode = VIEWMODES.carousel,\n\tshowTitles = false,\n} ) => {\n\tconst [ viewMode, setViewMode ] = useState( initialViewMode );\n\tconst [ activeSlide, setActiveSlide ] = useState( 0 );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst patterns = usePatternsSetup( clientId, blockName, filterPatternsFn );\n\n\tif ( ! patterns?.length ) {\n\t\treturn null;\n\t}\n\n\tconst onBlockPatternSelectDefault = ( blocks ) => {\n\t\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\t\treplaceBlock( clientId, clonedBlocks );\n\t};\n\tconst onPatternSelectCallback =\n\t\tonBlockPatternSelect || onBlockPatternSelectDefault;\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ `block-editor-block-pattern-setup view-mode-${ viewMode }` }\n\t\t\t>\n\t\t\t\t<SetupContent\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonBlockPatternSelect={ onPatternSelectCallback }\n\t\t\t\t\tshowTitles={ showTitles }\n\t\t\t\t/>\n\t\t\t\t<SetupToolbar\n\t\t\t\t\tviewMode={ viewMode }\n\t\t\t\t\tsetViewMode={ setViewMode }\n\t\t\t\t\tactiveSlide={ activeSlide }\n\t\t\t\t\ttotalSlides={ patterns.length }\n\t\t\t\t\thandleNext={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active + 1 );\n\t\t\t\t\t} }\n\t\t\t\t\thandlePrevious={ () => {\n\t\t\t\t\t\tsetActiveSlide( ( active ) => active - 1 );\n\t\t\t\t\t} }\n\t\t\t\t\tonBlockPatternSelect={ () => {\n\t\t\t\t\t\tonPatternSelectCallback(\n\t\t\t\t\t\t\tpatterns[ activeSlide ].blocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default BlockPatternSetup;\n"]}
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _components = require("@wordpress/components");
15
13
 
16
14
  var _compose = require("@wordpress/compose");
@@ -86,10 +84,10 @@ function BlockPattern({
86
84
  }, (0, _element.createElement)(WithToolTip, {
87
85
  showTooltip: showTooltip,
88
86
  title: pattern.title
89
- }, (0, _element.createElement)(_components.__unstableCompositeItem, (0, _extends2.default)({
87
+ }, (0, _element.createElement)(_components.__unstableCompositeItem, {
90
88
  role: "option",
91
- as: "div"
92
- }, composite, {
89
+ as: "div",
90
+ ...composite,
93
91
  className: "block-editor-block-patterns-list__item",
94
92
  onClick: () => {
95
93
  onClick(pattern, blocks);
@@ -105,7 +103,7 @@ function BlockPattern({
105
103
  onMouseLeave: () => onHover?.(null),
106
104
  "aria-label": pattern.title,
107
105
  "aria-describedby": pattern.description ? descriptionId : undefined
108
- }), (0, _element.createElement)(_blockPreview.default, {
106
+ }, (0, _element.createElement)(_blockPreview.default, {
109
107
  blocks: blocks,
110
108
  viewportWidth: viewportWidth
111
109
  }), !showTooltip && (0, _element.createElement)("div", {
@@ -134,11 +132,11 @@ function BlockPatternList({
134
132
  const composite = (0, _components.__unstableUseCompositeState)({
135
133
  orientation
136
134
  });
137
- return (0, _element.createElement)(_components.__unstableComposite, (0, _extends2.default)({}, composite, {
135
+ return (0, _element.createElement)(_components.__unstableComposite, { ...composite,
138
136
  role: "listbox",
139
137
  className: "block-editor-block-patterns-list",
140
138
  "aria-label": label
141
- }), blockPatterns.map(pattern => {
139
+ }, blockPatterns.map(pattern => {
142
140
  const isShown = shownPatterns.includes(pattern);
143
141
  return isShown ? (0, _element.createElement)(BlockPattern, {
144
142
  key: pattern.name,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"names":["WithToolTip","showTooltip","title","children","BlockPattern","isDraggable","pattern","onClick","onHover","composite","isDragging","setIsDragging","blocks","viewportWidth","instanceId","descriptionId","draggable","onDragStart","onDragEnd","event","description","undefined","BlockPatternPlaceholder","BlockPatternList","blockPatterns","shownPatterns","onClickPattern","orientation","label","showTitlesAsTooltip","map","isShown","includes","name"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAYA;AACA;AACA;AAIA,MAAMA,WAAW,GAAG,CAAE;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,KAAf;AAAsBC,EAAAA;AAAtB,CAAF,KAAwC;AAC3D,MAAKF,WAAL,EAAmB;AAClB,WAAO,4BAAC,mBAAD;AAAS,MAAA,IAAI,EAAGC;AAAhB,OAA0BC,QAA1B,CAAP;AACA;;AACD,SAAO,qDAAIA,QAAJ,CAAP;AACA,CALD;;AAOA,SAAS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kCAHX;AAIC,kBAAamB;AAJd,MAMGJ,aAAa,CAACM,GAAd,CAAqBxB,OAAF,IAAe;AACnC,UAAMyB,OAAO,GAAGN,aAAa,CAACO,QAAd,CAAwB1B,OAAxB,CAAhB;AACA,WAAOyB,OAAO,GACb,4BAAC,YAAD;AACC,MAAA,GAAG,EAAGzB,OAAO,CAAC2B,IADf;AAEC,MAAA,OAAO,EAAG3B,OAFX;AAGC,MAAA,OAAO,EAAGoB,cAHX;AAIC,MAAA,OAAO,EAAGlB,OAJX;AAKC,MAAA,WAAW,EAAGH,WALf;AAMC,MAAA,SAAS,EAAGI,SANb;AAOC,MAAA,WAAW,EAAGoB;AAPf,MADa,GAWb,4BAAC,uBAAD;AAAyB,MAAA,GAAG,EAAGvB,OAAO,CAAC2B;AAAvC,MAXD;AAaA,GAfC,CANH,CADD;AAyBA;;eAEcV,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n\tTooltip,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tcomposite,\n\tshowTooltip,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ blocks }\n\t\t\tisPattern={ !! pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\tas=\"div\"\n\t\t\t\t\t\t\t{ ...composite }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-patterns-list__item\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\tpattern.description ? descriptionId : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ ! showTooltip && (\n\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternList( {\n\tisDraggable,\n\tblockPatterns,\n\tshownPatterns,\n\tonHover,\n\tonClickPattern,\n\torientation,\n\tlabel = __( 'Block Patterns' ),\n\tshowTitlesAsTooltip,\n} ) {\n\tconst composite = useCompositeState( { orientation } );\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default BlockPatternList;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-patterns-list/index.js"],"names":["WithToolTip","showTooltip","title","children","BlockPattern","isDraggable","pattern","onClick","onHover","composite","isDragging","setIsDragging","blocks","viewportWidth","instanceId","descriptionId","draggable","onDragStart","onDragEnd","event","description","undefined","BlockPatternPlaceholder","BlockPatternList","blockPatterns","shownPatterns","onClickPattern","orientation","label","showTitlesAsTooltip","map","isShown","includes","name"],"mappings":";;;;;;;;;AAGA;;AACA;;AAOA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAYA;AACA;AACA;AAIA,MAAMA,WAAW,GAAG,CAAE;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,KAAf;AAAsBC,EAAAA;AAAtB,CAAF,KAAwC;AAC3D,MAAKF,WAAL,EAAmB;AAClB,WAAO,4BAAC,mBAAD;AAAS,MAAA,IAAI,EAAGC;AAAhB,OAA0BC,QAA1B,CAAP;AACA;;AACD,SAAO,qDAAIA,QAAJ,CAAP;AACA,CALD;;AAOA,SAASC,YAAT,CAAuB;AACtBC,EAAAA,WADsB;AAEtBC,EAAAA,OAFsB;AAGtBC,EAAAA,OAHsB;AAItBC,EAAAA,OAJsB;AAKtBC,EAAAA,SALsB;AAMtBR,EAAAA;AANsB,CAAvB,EAOI;AACH,QAAM,CAAES,UAAF,EAAcC,aAAd,IAAgC,uBAAU,KAAV,CAAtC;AACA,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAA4BP,OAAlC;AACA,QAAMQ,UAAU,GAAG,4BAAeV,YAAf,CAAnB;AACA,QAAMW,aAAa,GAAI,sDAA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AAA,SAAS,EAAGI,SANb;AAOC,MAAA,WAAW,EAAGoB;AAPf,MADa,GAWb,4BAAC,uBAAD;AAAyB,MAAA,GAAG,EAAGvB,OAAO,CAAC2B;AAAvC,MAXD;AAaA,GAfC,CANH,CADD;AAyBA;;eAEcV,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n\t__unstableCompositeItem as CompositeItem,\n\tTooltip,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\nimport InserterDraggableBlocks from '../inserter-draggable-blocks';\n\nconst WithToolTip = ( { showTooltip, title, children } ) => {\n\tif ( showTooltip ) {\n\t\treturn <Tooltip text={ title }>{ children }</Tooltip>;\n\t}\n\treturn <>{ children }</>;\n};\n\nfunction BlockPattern( {\n\tisDraggable,\n\tpattern,\n\tonClick,\n\tonHover,\n\tcomposite,\n\tshowTooltip,\n} ) {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\tconst { blocks, viewportWidth } = pattern;\n\tconst instanceId = useInstanceId( BlockPattern );\n\tconst descriptionId = `block-editor-block-patterns-list__item-description-${ instanceId }`;\n\n\treturn (\n\t\t<InserterDraggableBlocks\n\t\t\tisEnabled={ isDraggable }\n\t\t\tblocks={ blocks }\n\t\t\tisPattern={ !! pattern }\n\t\t>\n\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-block-patterns-list__list-item\"\n\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\tonDragStart={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( true );\n\t\t\t\t\t\tif ( onDragStart ) {\n\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\tonDragStart( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonDragEnd={ ( event ) => {\n\t\t\t\t\t\tsetIsDragging( false );\n\t\t\t\t\t\tif ( onDragEnd ) {\n\t\t\t\t\t\t\tonDragEnd( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<WithToolTip\n\t\t\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t\t\t\ttitle={ pattern.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CompositeItem\n\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\tas=\"div\"\n\t\t\t\t\t\t\t{ ...composite }\n\t\t\t\t\t\t\tclassName=\"block-editor-block-patterns-list__item\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonClick( pattern, blocks );\n\t\t\t\t\t\t\t\tonHover?.( null );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseEnter={ () => {\n\t\t\t\t\t\t\t\tif ( isDragging ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonHover?.( pattern );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonMouseLeave={ () => onHover?.( null ) }\n\t\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\tpattern.description ? descriptionId : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ ! showTooltip && (\n\t\t\t\t\t\t\t\t<div className=\"block-editor-block-patterns-list__item-title\">\n\t\t\t\t\t\t\t\t\t{ pattern.title }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ !! pattern.description && (\n\t\t\t\t\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t\t\t\t\t{ pattern.description }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</CompositeItem>\n\t\t\t\t\t</WithToolTip>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</InserterDraggableBlocks>\n\t);\n}\n\nfunction BlockPatternPlaceholder() {\n\treturn (\n\t\t<div className=\"block-editor-block-patterns-list__item is-placeholder\" />\n\t);\n}\n\nfunction BlockPatternList( {\n\tisDraggable,\n\tblockPatterns,\n\tshownPatterns,\n\tonHover,\n\tonClickPattern,\n\torientation,\n\tlabel = __( 'Block Patterns' ),\n\tshowTitlesAsTooltip,\n} ) {\n\tconst composite = useCompositeState( { orientation } );\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-patterns-list\"\n\t\t\taria-label={ label }\n\t\t>\n\t\t\t{ blockPatterns.map( ( pattern ) => {\n\t\t\t\tconst isShown = shownPatterns.includes( pattern );\n\t\t\t\treturn isShown ? (\n\t\t\t\t\t<BlockPattern\n\t\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\t\tonClick={ onClickPattern }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tisDraggable={ isDraggable }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tshowTooltip={ showTitlesAsTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockPatternPlaceholder key={ pattern.name } />\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default BlockPatternList;\n"]}
@@ -9,8 +9,6 @@ exports.default = exports.InsertionPointOpenRef = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
16
14
  var _data = require("@wordpress/data");
@@ -181,7 +179,7 @@ function BlockPopoverInbetween({
181
179
  // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
182
180
 
183
181
 
184
- return (0, _element.createElement)(_components.Popover, (0, _extends2.default)({
182
+ return (0, _element.createElement)(_components.Popover, {
185
183
  ref: popoverScrollRef,
186
184
  animate: false,
187
185
  anchor: popoverAnchor,
@@ -191,14 +189,14 @@ function BlockPopoverInbetween({
191
189
  __unstableSlotName: __unstablePopoverSlot || null // Forces a remount of the popover when its position changes
192
190
  // This makes sure the popover doesn't animate from its previous position.
193
191
  ,
194
- key: nextClientId + '--' + rootClientId
195
- }, props, {
192
+ key: nextClientId + '--' + rootClientId,
193
+ ...props,
196
194
  className: (0, _classnames.default)('block-editor-block-popover', 'block-editor-block-popover__inbetween', props.className),
197
195
  resize: false,
198
196
  flip: false,
199
197
  placement: "overlay",
200
198
  variant: "unstyled"
201
- }), (0, _element.createElement)("div", {
199
+ }, (0, _element.createElement)("div", {
202
200
  className: "block-editor-block-popover__inbetween-container"
203
201
  }, children));
204
202
  /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"names":["MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","props","popoverRecomputeCounter","forcePopoverRecompute","s","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","blockEditorStore","_rootClientId","previousElement","nextElement","isVertical","popoverAnchor","undefined","ownerDocument","getBoundingClientRect","previousRect","nextRect","left","top","width","height","bottom","right","window","DOMRect","popoverScrollRef","observer","MutationObserver","observe","attributes","disconnect","defaultView","addEventListener","remove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sBC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG1C,QADH,CAtBD,CADD;AA4BA;AACA;;eAEcH,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseMemo,\n\tcreateContext,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\t...props\n} ) {\n\t// This is a temporary hack to get the inbetween inserter to recompute properly.\n\tconst [ popoverRecomputeCounter, forcePopoverRecompute ] = 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\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId(\n\t\t\t\tpreviousClientId ?? nextClientId\n\t\t\t);\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId, nextClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverRecomputeCounter is by definition always equal or greater than 0.\n\t\t\t// 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\tpopoverRecomputeCounter < 0 ||\n\t\t\t( ! previousElement && ! nextElement ) ||\n\t\t\t! isVisible\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { ownerDocument } = previousElement || nextElement;\n\n\t\treturn {\n\t\t\townerDocument,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst previousRect = previousElement\n\t\t\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\t\t\t\tconst nextRect = nextElement\n\t\t\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\n\t\t\t\tlet left = 0;\n\t\t\t\tlet top = 0;\n\t\t\t\tlet width = 0;\n\t\t\t\tlet height = 0;\n\n\t\t\t\tif ( isVertical ) {\n\t\t\t\t\t// vertical\n\t\t\t\t\ttop = previousRect ? previousRect.bottom : nextRect.top;\n\t\t\t\t\twidth = previousRect ? previousRect.width : nextRect.width;\n\t\t\t\t\theight =\n\t\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tleft = previousRect ? previousRect.left : nextRect.left;\n\t\t\t\t} else {\n\t\t\t\t\ttop = previousRect ? previousRect.top : nextRect.top;\n\t\t\t\t\theight = previousRect\n\t\t\t\t\t\t? previousRect.height\n\t\t\t\t\t\t: nextRect.height;\n\n\t\t\t\t\tif ( isRTL() ) {\n\t\t\t\t\t\t// non vertical, rtl\n\t\t\t\t\t\tleft = nextRect ? nextRect.right : previousRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// non vertical, ltr\n\t\t\t\t\t\tleft = previousRect\n\t\t\t\t\t\t\t? previousRect.right\n\t\t\t\t\t\t\t: nextRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? nextRect.left - previousRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [\n\t\tpreviousElement,\n\t\tnextElement,\n\t\tpopoverRecomputeCounter,\n\t\tisVertical,\n\t\tisVisible,\n\t] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\t// This is only needed for a smooth transition when moving blocks.\n\t// When blocks are moved up/down, their position can be set 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 ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( previousElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ previousElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! nextElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( nextElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ nextElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tpreviousElement.ownerDocument.defaultView.addEventListener(\n\t\t\t'resize',\n\t\t\tforcePopoverRecompute\n\t\t);\n\t\treturn () => {\n\t\t\tpreviousElement.ownerDocument.defaultView?.removeEventListener(\n\t\t\t\t'resize',\n\t\t\t\tforcePopoverRecompute\n\t\t\t);\n\t\t};\n\t}, [ previousElement ] );\n\n\t// If there's either a previous or a next element, show the inbetween popover.\n\t// Note that drag and drop uses the inbetween popover to show the drop indicator\n\t// before the first block and after the last block.\n\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\t'block-editor-block-popover__inbetween',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tplacement=\"overlay\"\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"block-editor-block-popover__inbetween-container\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"names":["MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","props","popoverRecomputeCounter","forcePopoverRecompute","s","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","blockEditorStore","_rootClientId","previousElement","nextElement","isVertical","popoverAnchor","undefined","ownerDocument","getBoundingClientRect","previousRect","nextRect","left","top","width","height","bottom","right","window","DOMRect","popoverScrollRef","observer","MutationObserver","observe","attributes","disconnect","defaultView","addEventListener","removeEventListener","className"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAOA;;AACA;;AAKA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAKA,MAAMA,6BAA6B,GAAGC,MAAM,CAACC,gBAA7C;AAEO,MAAMC,qBAAqB,GAAG,6BAA9B;;;AAEP,SAASC,qBAAT,CAAgC;AAC/BC,EAAAA,gBAD+B;AAE/BC,EAAAA,YAF+B;AAG/BC,EAAAA,QAH+B;AAI/BC,EAAAA,qBAJ+B;AAK/BC,EAAAA,oBAL+B;AAM/B,KAAGC;AAN4B,CAAhC,EAOI;AACH;AACA,QAAM,CAAEC,uBAAF,EAA2BC,qBAA3B,IAAqD,0BAC1D;AACEC,EAAAA,CAAF,IAAS,CAAEA,CAAC,GAAG,CAAN,IAAYb,6BAFqC,EAG1D,CAH0D,CAA3D;AAMA,QAAM;AAAEc,IAAAA,WAAF;AAAeC,IAAAA,YAAf;AAA6BC,IAAAA;AAA7B,MAA2C,qBAC9CC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,oBADK;A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;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SACC,4BAAC,mBAAD;AACC,IAAA,GAAG,EAAGwB,gBADP;AAEC,IAAA,OAAO,EAAG,KAFX;AAGC,IAAA,MAAM,EAAGd,aAHV;AAIC,IAAA,YAAY,EAAG,KAJhB,CAKC;AACA;AAND;AAOC,IAAA,kBAAkB,EAAGlB,qBAAqB,IAAI,IAP/C,CAQC;AACA;AATD;AAUC,IAAA,GAAG,EAAGF,YAAY,GAAG,IAAf,GAAsBS,YAV7B;AAAA,OAWML,KAXN;AAYC,IAAA,SAAS,EAAG,yBACX,4BADW,EAEX,uCAFW,EAGXA,KAAK,CAACuC,SAHK,CAZb;AAiBC,IAAA,MAAM,EAAG,KAjBV;AAkBC,IAAA,IAAI,EAAG,KAlBR;AAmBC,IAAA,SAAS,EAAC,SAnBX;AAoBC,IAAA,OAAO,EAAC;AApBT,KAsBC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG1C,QADH,CAtBD,CADD;AA4BA;AACA;;eAEcH,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseMemo,\n\tcreateContext,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\t...props\n} ) {\n\t// This is a temporary hack to get the inbetween inserter to recompute properly.\n\tconst [ popoverRecomputeCounter, forcePopoverRecompute ] = 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\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId(\n\t\t\t\tpreviousClientId ?? nextClientId\n\t\t\t);\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId, nextClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverRecomputeCounter is by definition always equal or greater than 0.\n\t\t\t// 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\tpopoverRecomputeCounter < 0 ||\n\t\t\t( ! previousElement && ! nextElement ) ||\n\t\t\t! isVisible\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { ownerDocument } = previousElement || nextElement;\n\n\t\treturn {\n\t\t\townerDocument,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst previousRect = previousElement\n\t\t\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\t\t\t\tconst nextRect = nextElement\n\t\t\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\n\t\t\t\tlet left = 0;\n\t\t\t\tlet top = 0;\n\t\t\t\tlet width = 0;\n\t\t\t\tlet height = 0;\n\n\t\t\t\tif ( isVertical ) {\n\t\t\t\t\t// vertical\n\t\t\t\t\ttop = previousRect ? previousRect.bottom : nextRect.top;\n\t\t\t\t\twidth = previousRect ? previousRect.width : nextRect.width;\n\t\t\t\t\theight =\n\t\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tleft = previousRect ? previousRect.left : nextRect.left;\n\t\t\t\t} else {\n\t\t\t\t\ttop = previousRect ? previousRect.top : nextRect.top;\n\t\t\t\t\theight = previousRect\n\t\t\t\t\t\t? previousRect.height\n\t\t\t\t\t\t: nextRect.height;\n\n\t\t\t\t\tif ( isRTL() ) {\n\t\t\t\t\t\t// non vertical, rtl\n\t\t\t\t\t\tleft = nextRect ? nextRect.right : previousRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// non vertical, ltr\n\t\t\t\t\t\tleft = previousRect\n\t\t\t\t\t\t\t? previousRect.right\n\t\t\t\t\t\t\t: nextRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? nextRect.left - previousRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [\n\t\tpreviousElement,\n\t\tnextElement,\n\t\tpopoverRecomputeCounter,\n\t\tisVertical,\n\t\tisVisible,\n\t] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\t// This is only needed for a smooth transition when moving blocks.\n\t// When blocks are moved up/down, their position can be set 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 ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( previousElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ previousElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! nextElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( nextElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ nextElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tpreviousElement.ownerDocument.defaultView.addEventListener(\n\t\t\t'resize',\n\t\t\tforcePopoverRecompute\n\t\t);\n\t\treturn () => {\n\t\t\tpreviousElement.ownerDocument.defaultView?.removeEventListener(\n\t\t\t\t'resize',\n\t\t\t\tforcePopoverRecompute\n\t\t\t);\n\t\t};\n\t}, [ previousElement ] );\n\n\t// If there's either a previous or a next element, show the inbetween popover.\n\t// Note that drag and drop uses the inbetween popover to show the drop indicator\n\t// before the first block and after the last block.\n\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot || null }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\t'block-editor-block-popover__inbetween',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tplacement=\"overlay\"\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"block-editor-block-popover__inbetween-container\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"]}
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
16
14
  var _compose = require("@wordpress/compose");
@@ -119,7 +117,7 @@ function BlockPopover({
119
117
  return null;
120
118
  }
121
119
 
122
- return (0, _element.createElement)(_components.Popover, (0, _extends2.default)({
120
+ return (0, _element.createElement)(_components.Popover, {
123
121
  ref: mergedRefs,
124
122
  animate: false,
125
123
  focusOnMount: false,
@@ -130,11 +128,11 @@ function BlockPopover({
130
128
  placement: "top-start",
131
129
  resize: false,
132
130
  flip: false,
133
- shift: shift
134
- }, props, {
131
+ shift: shift,
132
+ ...props,
135
133
  className: (0, _classnames.default)('block-editor-block-popover', props.className),
136
134
  variant: "unstyled"
137
- }), __unstableCoverTarget && (0, _element.createElement)("div", {
135
+ }, __unstableCoverTarget && (0, _element.createElement)("div", {
138
136
  style: style
139
137
  }, children), !__unstableCoverTarget && children);
140
138
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"names":["MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstableRefreshSize","__unstableCoverTarget","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","lastSelectedElement","mergedRefs","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","s","observer","window","MutationObserver","observe","attributes","disconnect","style","position","width","offsetWidth","height","offsetHeight","popoverAnchor","undefined","getBoundingClientRect","selectedBCR","lastSelectedBCR","left","Math","min","Infinity","top","right","max","bottom","DOMRect","ownerDocument","className"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAKA;;AACA;;AAWA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAMA,6BAA6B,GAAGC,MAAM,CAACC,gBAA7C;;AAEA,SAASC,YAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,cAFD;AAGCC,EAAAA,QAHD;AAICC,EAAAA,qBAJD;AAKCC,EAAAA,qBAAqB,GAAG,KALzB;AAMCC,EAAAA,qBAND;AAOCC,EAAAA,oBAPD;AAQCC,EAAAA,KAAK,GAAG,IART;AASC,KAAGC;AATJ,CADD,EAYCC,GAZD,EAaE;AACD,QAAMC,eAAe,GAAG,6CAAiBV,QAAjB,CAAxB;AACA,QAAMW,mBAAmB,GAAG,6CAAiBV,cAAjB,aAAiBA,cAAjB,cAAiBA,cAAjB,GAAmCD,QAAnC,CAA5B;AACA,QAAMY,UAAU,GAAG,2BAAc,CAChCH,GADgC,EAEhC,+BAAkBH,oBAAlB,CAFgC,CAAd,CAAnB;AAKA,QAAM,CACLO,iCADK,EAELC,+BAFK,IAGF,0BACH;AACEC,E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A,KAAK,EAAGE;AAXT,KAYMC,KAZN;AAaC,IAAA,SAAS,EAAG,yBACX,4BADW,EAEXA,KAAK,CAACmC,SAFK,CAbb;AAiBC,IAAA,OAAO,EAAC;AAjBT,MAmBGvC,qBAAqB,IAAI;AAAK,IAAA,KAAK,EAAGkB;AAAb,KAAuBpB,QAAvB,CAnB5B,EAoBG,CAAEE,qBAAF,IAA2BF,QApB9B,CADD;AAwBA;;eAEc,yBAAYH,YAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\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__unstableRefreshSize,\n\t\t__unstableCoverTarget = false,\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 style = 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\tlastSelectedElement !== selectedElement\n\t\t) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth: selectedElement.offsetWidth,\n\t\t\theight: selectedElement.offsetHeight,\n\t\t};\n\t}, [\n\t\tselectedElement,\n\t\tlastSelectedElement,\n\t\t__unstableRefreshSize,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\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\tconst selectedBCR = selectedElement.getBoundingClientRect();\n\t\t\t\tconst lastSelectedBCR =\n\t\t\t\t\tlastSelectedElement?.getBoundingClientRect();\n\n\t\t\t\t// Get the biggest rectangle that encompasses completely the currently\n\t\t\t\t// selected element and the last selected element:\n\t\t\t\t// - for top/left coordinates, use the smaller numbers\n\t\t\t\t// - for the bottom/right coordinates, use the largest numbers\n\t\t\t\tconst left = Math.min(\n\t\t\t\t\tselectedBCR.left,\n\t\t\t\t\tlastSelectedBCR?.left ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst top = Math.min(\n\t\t\t\t\tselectedBCR.top,\n\t\t\t\t\tlastSelectedBCR?.top ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst right = Math.max(\n\t\t\t\t\tselectedBCR.right,\n\t\t\t\t\tlastSelectedBCR.right ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst bottom = Math.max(\n\t\t\t\t\tselectedBCR.bottom,\n\t\t\t\t\tlastSelectedBCR.bottom ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst width = right - left;\n\t\t\t\tconst height = bottom - top;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t\townerDocument: selectedElement.ownerDocument,\n\t\t};\n\t}, [\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t\tselectedElement,\n\t\tpopoverDimensionsRecomputeCounter,\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 || null }\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={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ __unstableCoverTarget && <div style={ style }>{ children }</div> }\n\t\t\t{ ! __unstableCoverTarget && children }\n\t\t</Popover>\n\t);\n}\n\nexport default forwardRef( BlockPopover );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"names":["MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstableRefreshSize","__unstableCoverTarget","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","lastSelectedElement","mergedRefs","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","s","observer","window","MutationObserver","observe","attributes","disconnect","style","position","width","offsetWidth","height","offsetHeight","popoverAnchor","undefined","getBoundingClientRect","selectedBCR","lastSelectedBCR","left","Math","min","Infinity","top","right","max","bottom","DOMRect","ownerDocument","className"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAWA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAMA,6BAA6B,GAAGC,MAAM,CAACC,gBAA7C;;AAEA,SAASC,YAAT,CACC;AACCC,EAAAA,QADD;AAECC,EAAAA,cAFD;AAGCC,EAAAA,QAHD;AAICC,EAAAA,qBAJD;AAKCC,EAAAA,qBAAqB,GAAG,KALzB;AAMCC,EAAAA,qBAND;AAOCC,EAAAA,oBAPD;AAQCC,EAAAA,KAAK,GAAG,IART;AASC,KAAGC;AATJ,CADD,EAYCC,GAZD,EAaE;AACD,QAAMC,eAAe,GAAG,6CAAiBV,QAAjB,CAAxB;AACA,QAAMW,mBAAmB,GAAG,6CAAiBV,cAAjB,aAAiBA,cAAjB,cAAiBA,cAAjB,GAAmCD,QAAnC,CAA5B;AACA,QAAMY,UAAU,GAAG,2BAAc,CAChCH,GADgC,EAEhC,+BAAkBH,oBAAlB,CAFgC,CAAd,CAAnB;AAKA,QAAM,CACLO,iCADK,EAELC,+B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I,EAAG,KAVR;AAWC,IAAA,KAAK,EAAGE,KAXT;AAAA,OAYMC,KAZN;AAaC,IAAA,SAAS,EAAG,yBACX,4BADW,EAEXA,KAAK,CAACmC,SAFK,CAbb;AAiBC,IAAA,OAAO,EAAC;AAjBT,KAmBGvC,qBAAqB,IAAI;AAAK,IAAA,KAAK,EAAGkB;AAAb,KAAuBpB,QAAvB,CAnB5B,EAoBG,CAAEE,qBAAF,IAA2BF,QApB9B,CADD;AAwBA;;eAEc,yBAAYH,YAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\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__unstableRefreshSize,\n\t\t__unstableCoverTarget = false,\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 style = 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\tlastSelectedElement !== selectedElement\n\t\t) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth: selectedElement.offsetWidth,\n\t\t\theight: selectedElement.offsetHeight,\n\t\t};\n\t}, [\n\t\tselectedElement,\n\t\tlastSelectedElement,\n\t\t__unstableRefreshSize,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\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\tconst selectedBCR = selectedElement.getBoundingClientRect();\n\t\t\t\tconst lastSelectedBCR =\n\t\t\t\t\tlastSelectedElement?.getBoundingClientRect();\n\n\t\t\t\t// Get the biggest rectangle that encompasses completely the currently\n\t\t\t\t// selected element and the last selected element:\n\t\t\t\t// - for top/left coordinates, use the smaller numbers\n\t\t\t\t// - for the bottom/right coordinates, use the largest numbers\n\t\t\t\tconst left = Math.min(\n\t\t\t\t\tselectedBCR.left,\n\t\t\t\t\tlastSelectedBCR?.left ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst top = Math.min(\n\t\t\t\t\tselectedBCR.top,\n\t\t\t\t\tlastSelectedBCR?.top ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst right = Math.max(\n\t\t\t\t\tselectedBCR.right,\n\t\t\t\t\tlastSelectedBCR.right ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst bottom = Math.max(\n\t\t\t\t\tselectedBCR.bottom,\n\t\t\t\t\tlastSelectedBCR.bottom ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst width = right - left;\n\t\t\t\tconst height = bottom - top;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t\townerDocument: selectedElement.ownerDocument,\n\t\t};\n\t}, [\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t\tselectedElement,\n\t\tpopoverDimensionsRecomputeCounter,\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 || null }\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={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ __unstableCoverTarget && <div style={ style }>{ children }</div> }\n\t\t\t{ ! __unstableCoverTarget && children }\n\t\t</Popover>\n\t);\n}\n\nexport default forwardRef( BlockPopover );\n"]}
@@ -9,8 +9,6 @@ exports.default = AutoBlockPreview;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _compose = require("@wordpress/compose");
15
13
 
16
14
  var _data = require("@wordpress/data");
@@ -125,8 +123,8 @@ function AutoBlockPreview(props) {
125
123
  }
126
124
  }, containerResizeListener), (0, _element.createElement)("div", {
127
125
  className: "block-editor-block-preview__container"
128
- }, !!containerWidth && (0, _element.createElement)(ScaledBlockPreview, (0, _extends2.default)({}, props, {
126
+ }, !!containerWidth && (0, _element.createElement)(ScaledBlockPreview, { ...props,
129
127
  containerWidth: containerWidth
130
- }))));
128
+ })));
131
129
  }
132
130
  //# sourceMappingURL=auto.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"names":["MemoizedBlockList","MAX_HEIGHT","ScaledBlockPreview","viewportWidth","containerWidth","minHeight","additionalStyles","contentResizeListener","height","contentHeight","styles","select","settings","store","getSettings","editorStyles","css","__unstableType","BlockList","scale","transform","maxHeight","undefined","bodyElement","ownerDocument","documentElement","classList","add","style","position","width","boxSizing","pointerEvents","AutoBlockPreview","props","containerResizeListener"],"mappings":";;;;;;;;;AAKA;;;;AAFA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAMA;AACA;AACA;AAMA;AACA,IAAIA,iBAAJ;AAEA,MAAMC,UAAU,GAAG,IAAnB;;AAEA,SAASC,kBAAT,CAA6B;AAC5BC,EAAAA,aAD4B;AAE5BC,EAAAA,cAF4B;AAG5BC,EAAAA,SAH4B;AAI5BC,EAAAA,gBAA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AK,EAAE,MAA/B;AAAuCtB,MAAAA,MAAM,EAAE;AAA/C;AAAb,KACG2B,uBADH,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,CAAC,CAAE/B,cAAH,IACD,4BAAC,kBAAD,6BACM8B,KADN;AAEC,IAAA,cAAc,EAAG9B;AAFlB,KAFF,CAJD,CADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useResizeObserver, pure, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { Disabled } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nconst MAX_HEIGHT = 2000;\n\nfunction ScaledBlockPreview( {\n\tviewportWidth,\n\tcontainerWidth,\n\tminHeight,\n\tadditionalStyles = [],\n} ) {\n\tif ( ! viewportWidth ) {\n\t\tviewportWidth = containerWidth;\n\t}\n\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst { styles } = useSelect( ( select ) => {\n\t\tconst settings = select( store ).getSettings();\n\t\treturn {\n\t\t\tstyles: settings.styles,\n\t\t};\n\t}, [] );\n\n\t// Avoid scrollbars for pattern previews.\n\tconst editorStyles = useMemo( () => {\n\t\tif ( styles ) {\n\t\t\treturn [\n\t\t\t\t...styles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'body{height:auto;overflow:hidden;border:none;padding:0;}',\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t\t},\n\t\t\t\t...additionalStyles,\n\t\t\t];\n\t\t}\n\n\t\treturn styles;\n\t}, [ styles, additionalStyles ] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || pure( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\treturn (\n\t\t<Disabled\n\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\tstyle={ {\n\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\theight: contentHeight * scale,\n\t\t\t\tmaxHeight:\n\t\t\t\t\tcontentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined,\n\t\t\t\tminHeight,\n\t\t\t} }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t} = bodyElement;\n\t\t\t\t\tdocumentElement.classList.add(\n\t\t\t\t\t\t'block-editor-block-preview__content-iframe'\n\t\t\t\t\t);\n\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\tdocumentElement.style.width = '100%';\n\n\t\t\t\t\t// Necessary for contentResizeListener to work.\n\t\t\t\t\tbodyElement.style.boxSizing = 'border-box';\n\t\t\t\t\tbodyElement.style.position = 'absolute';\n\t\t\t\t\tbodyElement.style.width = '100%';\n\t\t\t\t}, [] ) }\n\t\t\t\taria-hidden\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\theight: contentHeight,\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t// This is a catch-all max-height for patterns.\n\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/38175.\n\t\t\t\t\tmaxHeight: MAX_HEIGHT,\n\t\t\t\t\tminHeight:\n\t\t\t\t\t\tscale !== 0 && scale < 1 && minHeight\n\t\t\t\t\t\t\t? minHeight / scale\n\t\t\t\t\t\t\t: minHeight,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t{ contentResizeListener }\n\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t</Iframe>\n\t\t</Disabled>\n\t);\n}\n\nexport default function AutoBlockPreview( props ) {\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative', width: '100%', height: 0 } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t\t{ !! containerWidth && (\n\t\t\t\t\t<ScaledBlockPreview\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tcontainerWidth={ containerWidth }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"names":["MemoizedBlockList","MAX_HEIGHT","ScaledBlockPreview","viewportWidth","containerWidth","minHeight","additionalStyles","contentResizeListener","height","contentHeight","styles","select","settings","store","getSettings","editorStyles","css","__unstableType","BlockList","scale","transform","maxHeight","undefined","bodyElement","ownerDocument","documentElement","classList","add","style","position","width","boxSizing","pointerEvents","AutoBlockPreview","props","containerResizeListener"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAMA;AACA;AACA;AAMA;AACA,IAAIA,iBAAJ;AAEA,MAAMC,UAAU,GAAG,IAAnB;;AAEA,SAASC,kBAAT,CAA6B;AAC5BC,EAAAA,aAD4B;AAE5BC,EAAAA,cAF4B;AAG5BC,EAAAA,SAH4B;AAI5BC,EAAAA,gBAAgB,GAAG;AAJS,CAA7B,EAKI;AACH,MAAK,CAAEH,aAAP,EAAuB;AACtBA,IAAAA,aAAa,GAAGC,cAAhB;AACA;;AAED,QAAM,CAAEG,qBAAF,EAAyB;AAAEC,IAAAA,MAAM,EAAEC;AAAV,GAAzB,IACL,iCADD;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAa,qBAAaC,MAAF,IAAc;AAC3C,UAAMC,QAAQ,GAAGD,MAAM,CA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} from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { Disabled } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nconst MAX_HEIGHT = 2000;\n\nfunction ScaledBlockPreview( {\n\tviewportWidth,\n\tcontainerWidth,\n\tminHeight,\n\tadditionalStyles = [],\n} ) {\n\tif ( ! viewportWidth ) {\n\t\tviewportWidth = containerWidth;\n\t}\n\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst { styles } = useSelect( ( select ) => {\n\t\tconst settings = select( store ).getSettings();\n\t\treturn {\n\t\t\tstyles: settings.styles,\n\t\t};\n\t}, [] );\n\n\t// Avoid scrollbars for pattern previews.\n\tconst editorStyles = useMemo( () => {\n\t\tif ( styles ) {\n\t\t\treturn [\n\t\t\t\t...styles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'body{height:auto;overflow:hidden;border:none;padding:0;}',\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t\t},\n\t\t\t\t...additionalStyles,\n\t\t\t];\n\t\t}\n\n\t\treturn styles;\n\t}, [ styles, additionalStyles ] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || pure( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\treturn (\n\t\t<Disabled\n\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\tstyle={ {\n\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\theight: contentHeight * scale,\n\t\t\t\tmaxHeight:\n\t\t\t\t\tcontentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined,\n\t\t\t\tminHeight,\n\t\t\t} }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t} = bodyElement;\n\t\t\t\t\tdocumentElement.classList.add(\n\t\t\t\t\t\t'block-editor-block-preview__content-iframe'\n\t\t\t\t\t);\n\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\tdocumentElement.style.width = '100%';\n\n\t\t\t\t\t// Necessary for contentResizeListener to work.\n\t\t\t\t\tbodyElement.style.boxSizing = 'border-box';\n\t\t\t\t\tbodyElement.style.position = 'absolute';\n\t\t\t\t\tbodyElement.style.width = '100%';\n\t\t\t\t}, [] ) }\n\t\t\t\taria-hidden\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\theight: contentHeight,\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t// This is a catch-all max-height for patterns.\n\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/38175.\n\t\t\t\t\tmaxHeight: MAX_HEIGHT,\n\t\t\t\t\tminHeight:\n\t\t\t\t\t\tscale !== 0 && scale < 1 && minHeight\n\t\t\t\t\t\t\t? minHeight / scale\n\t\t\t\t\t\t\t: minHeight,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t{ contentResizeListener }\n\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t</Iframe>\n\t\t</Disabled>\n\t);\n}\n\nexport default function AutoBlockPreview( props ) {\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative', width: '100%', height: 0 } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t\t{ !! containerWidth && (\n\t\t\t\t\t<ScaledBlockPreview\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tcontainerWidth={ containerWidth }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
@@ -109,11 +109,11 @@ var _default = (0, _element.memo)(BlockPreview);
109
109
  * returns. Optionally, you can also pass any other props through this hook, and
110
110
  * they will be merged and returned.
111
111
  *
112
- * @param {Object} options Preview options.
113
- * @param {WPBlock[]} options.blocks Block objects.
114
- * @param {Object} options.props Optional. Props to pass to the element. Must contain
115
- * the ref if one is defined.
116
- * @param {Object} options.__experimentalLayout Layout settings to be used in the preview.
112
+ * @param {Object} options Preview options.
113
+ * @param {WPBlock[]} options.blocks Block objects.
114
+ * @param {Object} options.props Optional. Props to pass to the element. Must contain
115
+ * the ref if one is defined.
116
+ * @param {Object} options.layout Layout settings to be used in the preview.
117
117
  *
118
118
  */
119
119
 
@@ -123,7 +123,7 @@ exports.default = _default;
123
123
  function useBlockPreview({
124
124
  blocks,
125
125
  props = {},
126
- __experimentalLayout
126
+ layout
127
127
  }) {
128
128
  const originalSettings = (0, _data.useSelect)(select => select(_store.store).getSettings(), []);
129
129
  const settings = (0, _element.useMemo)(() => ({ ...originalSettings,
@@ -137,7 +137,7 @@ function useBlockPreview({
137
137
  settings: settings
138
138
  }, (0, _element.createElement)(_blockList.BlockListItems, {
139
139
  renderAppender: false,
140
- __experimentalLayout: __experimentalLayout
140
+ layout: layout
141
141
  }));
142
142
  return { ...props,
143
143
  ref,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"names":["BlockPreview","blocks","viewportWidth","minHeight","additionalStyles","__experimentalMinHeight","__experimentalPadding","since","version","alternative","css","originalSettings","select","blockEditorStore","getSettings","settings","__unstableIsPreviewMode","renderedBlocks","Array","isArray","length","useBlockPreview","props","__experimentalLayout","disabledRef","ref","children","className"],"mappings":";;;;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AA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,EAAGQ;AAFxB,IAJD,CADD;AAYA,SAAO,EACN,GAAGD,KADG;AAENG,IAAAA,GAFM;AAGNE,IAAAA,SAAS,EAAE,yBACVL,KAAK,CAACK,SADI,EAEV,0CAFU,EAGV,qBAHU,CAHL;AAQND,IAAAA,QAAQ,EAAEzB,MAAM,EAAEmB,MAAR,GAAiBM,QAAjB,GAA4B;AARhC,GAAP;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { store as blockEditorStore } from '../../store';\nimport { BlockListItems } from '../block-list';\n\nexport function BlockPreview( {\n\tblocks,\n\tviewportWidth = 1200,\n\tminHeight,\n\tadditionalStyles = [],\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() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\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 {WPComponent} 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.__experimentalLayout Layout settings to be used in the preview.\n *\n */\nexport function useBlockPreview( {\n\tblocks,\n\tprops = {},\n\t__experimentalLayout,\n} ) {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\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<BlockListItems\n\t\t\t\trenderAppender={ false }\n\t\t\t\t__experimentalLayout={ __experimentalLayout }\n\t\t\t/>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: classnames(\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"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"names":["BlockPreview","blocks","viewportWidth","minHeight","additionalStyles","__experimentalMinHeight","__experimentalPadding","since","version","alternative","css","originalSettings","select","blockEditorStore","getSettings","settings","__unstableIsPreviewMode","renderedBlocks","Array","isArray","length","useBlockPreview","props","layout","disabledRef","ref","children","className"],"mappings":";;;;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAMO,SAASA,YAAT,CAAuB;AAC7BC,EAAAA,MAD6B;AAE7BC,EAAAA,aAAa,GAAG,IAFa;AAG7BC,EAAAA,SAH6B;AAI7BC,EAAAA,gBAAgB,GAAG,EAJU;AAK7B;AACAC,EAAAA,uBAN6B;AAO7BC,EAAAA;AAP6B,CAAvB,EAQH;AACH,MAAKD,uBAAL,EAA+B;AAC9BF,IAAAA,SAAS,GAAGE,uBAAZ;AACA,6BAAY,kCAAZ,EAAgD;AAC/CE,MAAAA,KAAK,EAAE,KADwC;AAE/CC,MAAAA,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;AACA;AACA;AACA;;;;;AACO,SAASqB,eAAT,CAA0B;AAAEpB,EAAAA,MAAF;AAAUqB,EAAAA,KAAK,GAAG,EAAlB;AAAsBC,EAAAA;AAAtB,CAA1B,EAA2D;AACjE,QAAMZ,gBAAgB,GAAG,qBACtBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAA2BC,WAA3B,EADU,EAExB,EAFwB,CAAzB;AAIA,QAAMC,QAAQ,GAAG,sBAChB,OAAQ,EAAE,GAAGJ,gBAAL;AAAuBK,IAAAA,uBAAuB,EAAE;AAAhD,GAAR,CADgB,EAEhB,CAAEL,gBAAF,CAFgB,CAAjB;AAIA,QAAMa,WAAW,GAAG,2BAApB;AACA,QAAMC,GAAG,GAAG,2BAAc,CAAEH,KAAK,CAACG,GAAR,EAAaD,WAAb,CAAd,CAAZ;AACA,QAAMP,cAAc,GAAG,sBACtB,MAAQC,KAAK,CAACC,OAAN,CAAelB,MAAf,IAA0BA,MAA1B,GAAmC,CAAEA,MAAF,CADrB,EAEtB,CAAEA,MAAF,CAFsB,CAAvB;AAKA,QAAMyB,QAAQ,GACb,4BAAC,yCAAD;AACC,IAAA,KAAK,EAAGT,cADT;AAEC,IAAA,QAAQ,EAAGF;AAFZ,KAIC,4BAAC,yBAAD;AAAgB,IAAA,cAAc,EAAG,KAAjC;AAAyC,IAAA,MAAM,EAAGQ;AAAlD,IAJD,CADD;AASA,SAAO,EACN,GAAGD,KADG;AAENG,IAAAA,GAFM;AAGNE,IAAAA,SAAS,EAAE,yBACVL,KAAK,CAACK,SADI,EAEV,0CAFU,EAGV,qBAHU,CAHL;AAQND,IAAAA,QAAQ,EAAEzB,MAAM,EAAEmB,MAAR,GAAiBM,QAAjB,GAA4B;AARhC,GAAP;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\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 { store as blockEditorStore } from '../../store';\nimport { BlockListItems } from '../block-list';\n\nexport function BlockPreview( {\n\tblocks,\n\tviewportWidth = 1200,\n\tminHeight,\n\tadditionalStyles = [],\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() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\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 {WPComponent} 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 *\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() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\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<BlockListItems renderAppender={ false } layout={ layout } />\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: classnames(\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"]}