@wordpress/block-editor 14.4.0 → 14.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (817) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +6 -2
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/components/background-image-control/index.js +1 -1
  5. package/build/components/background-image-control/index.js.map +1 -1
  6. package/build/components/block-controls/slot.js.map +1 -1
  7. package/build/components/block-controls/slot.native.js.map +1 -1
  8. package/build/components/block-draggable/draggable-chip.js +1 -1
  9. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  10. package/build/components/block-list/block-invalid-warning.native.js +1 -1
  11. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  12. package/build/components/block-list/block-list-item.native.js.map +1 -1
  13. package/build/components/block-list/block.js.map +1 -1
  14. package/build/components/block-list/index.js +1 -0
  15. package/build/components/block-list/index.js.map +1 -1
  16. package/build/components/block-list/index.native.js.map +1 -1
  17. package/build/components/block-list/use-block-props/index.js.map +1 -1
  18. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  19. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  20. package/build/components/block-list/zoom-out-separator.js +10 -7
  21. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  22. package/build/components/block-lock/modal.js +1 -1
  23. package/build/components/block-lock/modal.js.map +1 -1
  24. package/build/components/block-mover/button.js.map +1 -1
  25. package/build/components/block-parent-selector/index.js +1 -1
  26. package/build/components/block-parent-selector/index.js.map +1 -1
  27. package/build/components/block-pattern-setup/index.js.map +1 -1
  28. package/build/components/block-patterns-list/index.js.map +1 -1
  29. package/build/components/block-popover/index.js +45 -2
  30. package/build/components/block-popover/index.js.map +1 -1
  31. package/build/components/block-preview/auto.js +1 -4
  32. package/build/components/block-preview/auto.js.map +1 -1
  33. package/build/components/block-preview/index.js.map +1 -1
  34. package/build/components/block-rename/modal.js +2 -2
  35. package/build/components/block-rename/modal.js.map +1 -1
  36. package/build/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  37. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  38. package/build/components/block-switcher/block-transformations-menu.native.js +1 -1
  39. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  40. package/build/components/block-switcher/index.js +2 -1
  41. package/build/components/block-switcher/index.js.map +1 -1
  42. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  43. package/build/components/block-switcher/use-transformed-patterns.js +1 -0
  44. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  45. package/build/components/block-switcher/utils.js +1 -0
  46. package/build/components/block-switcher/utils.js.map +1 -1
  47. package/build/components/block-toolbar/index.js.map +1 -1
  48. package/build/components/block-tools/index.js +0 -7
  49. package/build/components/block-tools/index.js.map +1 -1
  50. package/build/components/block-tools/insertion-point.js.map +1 -1
  51. package/build/components/block-tools/use-show-block-tools.js +7 -3
  52. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  53. package/build/components/block-tools/zoom-out-popover.js +3 -2
  54. package/build/components/block-tools/zoom-out-popover.js.map +1 -1
  55. package/build/components/block-tools/zoom-out-toolbar.js +3 -20
  56. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  57. package/build/components/block-types-list/index.js.map +1 -1
  58. package/build/components/block-types-list/index.native.js.map +1 -1
  59. package/build/components/block-variation-transforms/index.js +3 -2
  60. package/build/components/block-variation-transforms/index.js.map +1 -1
  61. package/build/components/border-radius-control/index.js.map +1 -1
  62. package/build/components/border-radius-control/utils.js.map +1 -1
  63. package/build/components/button-block-appender/index.js.map +1 -1
  64. package/build/components/color-style-selector/index.js.map +1 -1
  65. package/build/components/colors/utils.js.map +1 -1
  66. package/build/components/colors/with-colors.js.map +1 -1
  67. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  68. package/build/components/date-format-picker/index.js +1 -0
  69. package/build/components/date-format-picker/index.js.map +1 -1
  70. package/build/components/duotone/utils.js.map +1 -1
  71. package/build/components/duotone-control/index.js.map +1 -1
  72. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  73. package/build/components/font-sizes/utils.js.map +1 -1
  74. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  75. package/build/components/global-styles/border-panel.js.map +1 -1
  76. package/build/components/global-styles/color-panel.js +1 -1
  77. package/build/components/global-styles/color-panel.js.map +1 -1
  78. package/build/components/global-styles/filters-panel.js.map +1 -1
  79. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  80. package/build/components/global-styles/get-global-styles-changes.js +2 -1
  81. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  82. package/build/components/global-styles/hooks.js.map +1 -1
  83. package/build/components/global-styles/typography-panel.js.map +1 -1
  84. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  85. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  86. package/build/components/global-styles/utils.js.map +1 -1
  87. package/build/components/gradients/use-gradient.js.map +1 -1
  88. package/build/components/grid/grid-item-movers.js.map +1 -1
  89. package/build/components/grid/grid-visualizer.js.map +1 -1
  90. package/build/components/iframe/index.js +49 -9
  91. package/build/components/iframe/index.js.map +1 -1
  92. package/build/components/image-editor/use-save-image.js +1 -1
  93. package/build/components/image-editor/use-save-image.js.map +1 -1
  94. package/build/components/inner-blocks/use-nested-settings-update.js +15 -8
  95. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  96. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  97. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  98. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  99. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  100. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  101. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  102. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  103. package/build/components/inserter/category-tabs/index.js +1 -10
  104. package/build/components/inserter/category-tabs/index.js.map +1 -1
  105. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  106. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  107. package/build/components/inserter/hooks/use-patterns-state.js +1 -1
  108. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  109. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  110. package/build/components/inserter/media-tab/media-preview.js +1 -1
  111. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  112. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  113. package/build/components/inserter/media-tab/utils.js.map +1 -1
  114. package/build/components/inserter/menu.js +5 -2
  115. package/build/components/inserter/menu.js.map +1 -1
  116. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  117. package/build/components/inserter/preview-panel.js.map +1 -1
  118. package/build/components/inserter/quick-inserter.js +1 -1
  119. package/build/components/inserter/quick-inserter.js.map +1 -1
  120. package/build/components/inserter/search-results.js +1 -1
  121. package/build/components/inserter/search-results.js.map +1 -1
  122. package/build/components/inserter/tabs.native.js.map +1 -1
  123. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  124. package/build/components/inspector-controls/fill.js.map +1 -1
  125. package/build/components/inspector-controls/fill.native.js.map +1 -1
  126. package/build/components/inspector-controls/slot.js.map +1 -1
  127. package/build/components/inspector-controls/slot.native.js.map +1 -1
  128. package/build/components/line-height-control/index.js.map +1 -1
  129. package/build/components/link-control/is-url-like.js.map +1 -1
  130. package/build/components/link-control/search-create-button.js +1 -1
  131. package/build/components/link-control/search-create-button.js.map +1 -1
  132. package/build/components/link-control/search-input.js +3 -5
  133. package/build/components/link-control/search-input.js.map +1 -1
  134. package/build/components/link-control/search-results.js +5 -15
  135. package/build/components/link-control/search-results.js.map +1 -1
  136. package/build/components/link-control/settings-drawer.js.map +1 -1
  137. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  138. package/build/components/list-view/appender.js +1 -1
  139. package/build/components/list-view/appender.js.map +1 -1
  140. package/build/components/list-view/block-select-button.js.map +1 -1
  141. package/build/components/list-view/block.js.map +1 -1
  142. package/build/components/list-view/branch.js.map +1 -1
  143. package/build/components/list-view/drop-indicator.js.map +1 -1
  144. package/build/components/list-view/index.js.map +1 -1
  145. package/build/components/list-view/use-block-selection.js +2 -2
  146. package/build/components/list-view/use-block-selection.js.map +1 -1
  147. package/build/components/list-view/utils.js +1 -1
  148. package/build/components/list-view/utils.js.map +1 -1
  149. package/build/components/media-placeholder/index.native.js +1 -1
  150. package/build/components/media-placeholder/index.native.js.map +1 -1
  151. package/build/components/media-replace-flow/index.js.map +1 -1
  152. package/build/components/multi-selection-inspector/index.js +2 -2
  153. package/build/components/multi-selection-inspector/index.js.map +1 -1
  154. package/build/components/observe-typing/index.js +1 -0
  155. package/build/components/observe-typing/index.js.map +1 -1
  156. package/build/components/recursion-provider/index.js +1 -0
  157. package/build/components/recursion-provider/index.js.map +1 -1
  158. package/build/components/responsive-block-control/index.js +3 -3
  159. package/build/components/responsive-block-control/index.js.map +1 -1
  160. package/build/components/responsive-block-control/label.js +1 -1
  161. package/build/components/responsive-block-control/label.js.map +1 -1
  162. package/build/components/rich-text/content.js.map +1 -1
  163. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  164. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  165. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  166. package/build/components/rich-text/index.js +3 -2
  167. package/build/components/rich-text/index.js.map +1 -1
  168. package/build/components/rich-text/multiline.js.map +1 -1
  169. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  170. package/build/components/rich-text/native/index.native.js.map +1 -1
  171. package/build/components/rich-text/native/use-format-types.js +1 -0
  172. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  173. package/build/components/rich-text/toolbar-button.js.map +1 -1
  174. package/build/components/rich-text/use-format-types.js +1 -0
  175. package/build/components/rich-text/use-format-types.js.map +1 -1
  176. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  177. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  178. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  179. package/build/components/spacing-sizes-control/utils.js +1 -0
  180. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  181. package/build/components/tool-selector/index.js +9 -3
  182. package/build/components/tool-selector/index.js.map +1 -1
  183. package/build/components/typewriter/index.js +1 -0
  184. package/build/components/typewriter/index.js.map +1 -1
  185. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  186. package/build/components/url-input/index.js +1 -1
  187. package/build/components/url-input/index.js.map +1 -1
  188. package/build/components/use-block-drop-zone/index.js.map +1 -1
  189. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  190. package/build/components/use-moving-animation/index.js.map +1 -1
  191. package/build/components/use-resize-canvas/index.js +1 -2
  192. package/build/components/use-resize-canvas/index.js.map +1 -1
  193. package/build/components/writing-flow/use-tab-nav.js +21 -5
  194. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  195. package/build/hooks/align.js.map +1 -1
  196. package/build/hooks/block-hooks.js +1 -1
  197. package/build/hooks/block-hooks.js.map +1 -1
  198. package/build/hooks/block-style-variation.js.map +1 -1
  199. package/build/hooks/duotone.js.map +1 -1
  200. package/build/hooks/font-family.js.map +1 -1
  201. package/build/hooks/gap.js.map +1 -1
  202. package/build/hooks/generated-class-name.js +1 -0
  203. package/build/hooks/generated-class-name.js.map +1 -1
  204. package/build/hooks/grid-visualizer.js +13 -11
  205. package/build/hooks/grid-visualizer.js.map +1 -1
  206. package/build/hooks/layout-child.js +41 -3
  207. package/build/hooks/layout-child.js.map +1 -1
  208. package/build/hooks/layout.js.map +1 -1
  209. package/build/hooks/position.js +1 -1
  210. package/build/hooks/position.js.map +1 -1
  211. package/build/hooks/spacing-visualizer.js.map +1 -1
  212. package/build/hooks/style.js.map +1 -1
  213. package/build/hooks/text-align.js.map +1 -1
  214. package/build/hooks/use-typography-props.js.map +1 -1
  215. package/build/hooks/use-zoom-out.js +24 -16
  216. package/build/hooks/use-zoom-out.js.map +1 -1
  217. package/build/layouts/constrained.js.map +1 -1
  218. package/build/layouts/flex.js.map +1 -1
  219. package/build/layouts/grid.js.map +1 -1
  220. package/build/layouts/utils.js.map +1 -1
  221. package/build/private-apis.js +2 -0
  222. package/build/private-apis.js.map +1 -1
  223. package/build/store/actions.js +5 -6
  224. package/build/store/actions.js.map +1 -1
  225. package/build/store/private-selectors.js.map +1 -1
  226. package/build/store/reducer.js +2 -18
  227. package/build/store/reducer.js.map +1 -1
  228. package/build/store/selectors.js +22 -15
  229. package/build/store/selectors.js.map +1 -1
  230. package/build/utils/block-bindings.js +9 -6
  231. package/build/utils/block-bindings.js.map +1 -1
  232. package/build/utils/get-font-styles-and-weights.js +1 -1
  233. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  234. package/build/utils/object.js +1 -0
  235. package/build/utils/object.js.map +1 -1
  236. package/build/utils/pasting.js.map +1 -1
  237. package/build-module/autocompleters/block.js +1 -3
  238. package/build-module/autocompleters/block.js.map +1 -1
  239. package/build-module/autocompleters/link.js +1 -3
  240. package/build-module/autocompleters/link.js.map +1 -1
  241. package/build-module/components/audio-player/index.native.js +1 -2
  242. package/build-module/components/audio-player/index.native.js.map +1 -1
  243. package/build-module/components/background-image-control/index.js +2 -3
  244. package/build-module/components/background-image-control/index.js.map +1 -1
  245. package/build-module/components/block-alignment-control/ui.js +1 -2
  246. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  247. package/build-module/components/block-breadcrumb/index.js +1 -2
  248. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  249. package/build-module/components/block-canvas/index.js +1 -2
  250. package/build-module/components/block-canvas/index.js.map +1 -1
  251. package/build-module/components/block-card/index.js +1 -2
  252. package/build-module/components/block-card/index.js.map +1 -1
  253. package/build-module/components/block-compare/block-view.js +1 -2
  254. package/build-module/components/block-compare/block-view.js.map +1 -1
  255. package/build-module/components/block-compare/index.js +1 -2
  256. package/build-module/components/block-compare/index.js.map +1 -1
  257. package/build-module/components/block-controls/fill.js +1 -3
  258. package/build-module/components/block-controls/fill.js.map +1 -1
  259. package/build-module/components/block-controls/slot.js.map +1 -1
  260. package/build-module/components/block-controls/slot.native.js.map +1 -1
  261. package/build-module/components/block-draggable/draggable-chip.js +2 -3
  262. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  263. package/build-module/components/block-draggable/draggable-chip.native.js +1 -2
  264. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  265. package/build-module/components/block-draggable/index.native.js +1 -3
  266. package/build-module/components/block-draggable/index.native.js.map +1 -1
  267. package/build-module/components/block-edit/index.js +1 -2
  268. package/build-module/components/block-edit/index.js.map +1 -1
  269. package/build-module/components/block-edit/multiple-usage-warning.js +1 -2
  270. package/build-module/components/block-edit/multiple-usage-warning.js.map +1 -1
  271. package/build-module/components/block-inspector/index.js +1 -3
  272. package/build-module/components/block-inspector/index.js.map +1 -1
  273. package/build-module/components/block-list/block-crash-warning.js +1 -1
  274. package/build-module/components/block-list/block-crash-warning.js.map +1 -1
  275. package/build-module/components/block-list/block-crash-warning.native.js +1 -1
  276. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -1
  277. package/build-module/components/block-list/block-invalid-warning.js +1 -3
  278. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  279. package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
  280. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  281. package/build-module/components/block-list/block-list-item.native.js +1 -2
  282. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  283. package/build-module/components/block-list/block-selection-button.native.js +1 -2
  284. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  285. package/build-module/components/block-list/block.js +1 -3
  286. package/build-module/components/block-list/block.js.map +1 -1
  287. package/build-module/components/block-list/block.native.js +1 -2
  288. package/build-module/components/block-list/block.native.js.map +1 -1
  289. package/build-module/components/block-list/index.js +2 -2
  290. package/build-module/components/block-list/index.js.map +1 -1
  291. package/build-module/components/block-list/index.native.js +1 -3
  292. package/build-module/components/block-list/index.native.js.map +1 -1
  293. package/build-module/components/block-list/insertion-point.native.js +1 -2
  294. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  295. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  296. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  297. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  298. package/build-module/components/block-list/zoom-out-separator.js +10 -7
  299. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  300. package/build-module/components/block-lock/menu-item.js +1 -3
  301. package/build-module/components/block-lock/menu-item.js.map +1 -1
  302. package/build-module/components/block-lock/modal.js +2 -3
  303. package/build-module/components/block-lock/modal.js.map +1 -1
  304. package/build-module/components/block-lock/toolbar.js +1 -3
  305. package/build-module/components/block-lock/toolbar.js.map +1 -1
  306. package/build-module/components/block-media-update-progress/index.native.js +1 -2
  307. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  308. package/build-module/components/block-mover/button.js +1 -3
  309. package/build-module/components/block-mover/button.js.map +1 -1
  310. package/build-module/components/block-mover/index.js +1 -2
  311. package/build-module/components/block-mover/index.js.map +1 -1
  312. package/build-module/components/block-mover/index.native.js +1 -2
  313. package/build-module/components/block-mover/index.native.js.map +1 -1
  314. package/build-module/components/block-navigation/dropdown.js +1 -2
  315. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  316. package/build-module/components/block-parent-selector/index.js +1 -1
  317. package/build-module/components/block-parent-selector/index.js.map +1 -1
  318. package/build-module/components/block-pattern-setup/index.js +1 -3
  319. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  320. package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -2
  321. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  322. package/build-module/components/block-patterns-list/index.js +1 -3
  323. package/build-module/components/block-patterns-list/index.js.map +1 -1
  324. package/build-module/components/block-patterns-paging/index.js +1 -2
  325. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  326. package/build-module/components/block-popover/index.js +45 -2
  327. package/build-module/components/block-popover/index.js.map +1 -1
  328. package/build-module/components/block-preview/auto.js +2 -7
  329. package/build-module/components/block-preview/auto.js.map +1 -1
  330. package/build-module/components/block-preview/index.js +1 -2
  331. package/build-module/components/block-preview/index.js.map +1 -1
  332. package/build-module/components/block-quick-navigation/index.js +1 -2
  333. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  334. package/build-module/components/block-removal-warning-modal/index.js +1 -2
  335. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  336. package/build-module/components/block-rename/modal.js +3 -4
  337. package/build-module/components/block-rename/modal.js.map +1 -1
  338. package/build-module/components/block-rename/rename-control.js +1 -3
  339. package/build-module/components/block-rename/rename-control.js.map +1 -1
  340. package/build-module/components/block-settings/container.native.js +1 -3
  341. package/build-module/components/block-settings/container.native.js.map +1 -1
  342. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +1 -1
  343. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -1
  344. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -3
  345. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  346. package/build-module/components/block-settings-menu-controls/index.js +1 -2
  347. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  348. package/build-module/components/block-styles/index.js +1 -2
  349. package/build-module/components/block-styles/index.js.map +1 -1
  350. package/build-module/components/block-styles/menu-items.js +1 -2
  351. package/build-module/components/block-styles/menu-items.js.map +1 -1
  352. package/build-module/components/block-styles/preview.native.js +1 -2
  353. package/build-module/components/block-styles/preview.native.js.map +1 -1
  354. package/build-module/components/block-switcher/block-transformations-menu.js +1 -3
  355. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  356. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
  357. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  358. package/build-module/components/block-switcher/block-variation-transformations.js +1 -3
  359. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  360. package/build-module/components/block-switcher/index.js +3 -4
  361. package/build-module/components/block-switcher/index.js.map +1 -1
  362. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -2
  363. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  364. package/build-module/components/block-switcher/preview-block-popover.js +1 -2
  365. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  366. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
  367. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  368. package/build-module/components/block-switcher/utils.js +1 -0
  369. package/build-module/components/block-switcher/utils.js.map +1 -1
  370. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  371. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  372. package/build-module/components/block-toolbar/index.js +1 -3
  373. package/build-module/components/block-toolbar/index.js.map +1 -1
  374. package/build-module/components/block-toolbar/index.native.js +1 -3
  375. package/build-module/components/block-toolbar/index.native.js.map +1 -1
  376. package/build-module/components/block-tools/index.js +1 -9
  377. package/build-module/components/block-tools/index.js.map +1 -1
  378. package/build-module/components/block-tools/insertion-point.js +1 -2
  379. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  380. package/build-module/components/block-tools/use-show-block-tools.js +7 -3
  381. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  382. package/build-module/components/block-tools/zoom-out-popover.js +2 -1
  383. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
  384. package/build-module/components/block-tools/zoom-out-toolbar.js +5 -23
  385. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  386. package/build-module/components/block-types-list/index.js +1 -2
  387. package/build-module/components/block-types-list/index.js.map +1 -1
  388. package/build-module/components/block-types-list/index.native.js +1 -2
  389. package/build-module/components/block-types-list/index.native.js.map +1 -1
  390. package/build-module/components/block-variation-picker/index.js +1 -2
  391. package/build-module/components/block-variation-picker/index.js.map +1 -1
  392. package/build-module/components/block-variation-picker/index.native.js +1 -2
  393. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  394. package/build-module/components/block-variation-transforms/index.js +4 -4
  395. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  396. package/build-module/components/border-radius-control/index.js +1 -3
  397. package/build-module/components/border-radius-control/index.js.map +1 -1
  398. package/build-module/components/border-radius-control/utils.js.map +1 -1
  399. package/build-module/components/button-block-appender/index.js.map +1 -1
  400. package/build-module/components/button-block-appender/index.native.js +1 -2
  401. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  402. package/build-module/components/child-layout-control/index.js +1 -3
  403. package/build-module/components/child-layout-control/index.js.map +1 -1
  404. package/build-module/components/color-style-selector/index.js.map +1 -1
  405. package/build-module/components/colors/utils.js.map +1 -1
  406. package/build-module/components/colors/with-colors.js.map +1 -1
  407. package/build-module/components/colors-gradients/control.js +1 -2
  408. package/build-module/components/colors-gradients/control.js.map +1 -1
  409. package/build-module/components/colors-gradients/dropdown.js +1 -3
  410. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  411. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -3
  412. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  413. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -3
  414. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  415. package/build-module/components/contrast-checker/index.native.js +1 -2
  416. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  417. package/build-module/components/convert-to-group-buttons/index.js +1 -3
  418. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  419. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -2
  420. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  421. package/build-module/components/date-format-picker/index.js +2 -2
  422. package/build-module/components/date-format-picker/index.js.map +1 -1
  423. package/build-module/components/default-block-appender/index.js +1 -2
  424. package/build-module/components/default-block-appender/index.js.map +1 -1
  425. package/build-module/components/dimensions-tool/index.js +1 -3
  426. package/build-module/components/dimensions-tool/index.js.map +1 -1
  427. package/build-module/components/dimensions-tool/width-height-tool.js +1 -3
  428. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  429. package/build-module/components/duotone/utils.js.map +1 -1
  430. package/build-module/components/duotone-control/index.js +1 -2
  431. package/build-module/components/duotone-control/index.js.map +1 -1
  432. package/build-module/components/editor-styles/index.js +1 -3
  433. package/build-module/components/editor-styles/index.js.map +1 -1
  434. package/build-module/components/floating-toolbar/index.native.js +1 -2
  435. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  436. package/build-module/components/floating-toolbar/nav-up-icon.js +1 -2
  437. package/build-module/components/floating-toolbar/nav-up-icon.js.map +1 -1
  438. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  439. package/build-module/components/font-sizes/utils.js.map +1 -1
  440. package/build-module/components/font-sizes/with-font-sizes.js +2 -2
  441. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  442. package/build-module/components/global-styles/advanced-panel.js +1 -2
  443. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  444. package/build-module/components/global-styles/border-panel.js +1 -2
  445. package/build-module/components/global-styles/border-panel.js.map +1 -1
  446. package/build-module/components/global-styles/color-panel.js +2 -3
  447. package/build-module/components/global-styles/color-panel.js.map +1 -1
  448. package/build-module/components/global-styles/dimensions-panel.js +1 -2
  449. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  450. package/build-module/components/global-styles/filters-panel.js +1 -2
  451. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  452. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  453. package/build-module/components/global-styles/get-global-styles-changes.js +2 -1
  454. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  455. package/build-module/components/global-styles/hooks.js.map +1 -1
  456. package/build-module/components/global-styles/image-settings-panel.js +1 -2
  457. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  458. package/build-module/components/global-styles/shadow-panel-components.js +1 -2
  459. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  460. package/build-module/components/global-styles/typography-panel.js +1 -2
  461. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  462. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  463. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  464. package/build-module/components/global-styles/utils.js.map +1 -1
  465. package/build-module/components/gradients/use-gradient.js.map +1 -1
  466. package/build-module/components/grid/grid-item-movers.js +1 -3
  467. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  468. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  469. package/build-module/components/height-control/index.js +1 -2
  470. package/build-module/components/height-control/index.js.map +1 -1
  471. package/build-module/components/iframe/index.js +50 -12
  472. package/build-module/components/iframe/index.js.map +1 -1
  473. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -3
  474. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  475. package/build-module/components/image-editor/cropper.js +1 -3
  476. package/build-module/components/image-editor/cropper.js.map +1 -1
  477. package/build-module/components/image-editor/form-controls.js +1 -3
  478. package/build-module/components/image-editor/form-controls.js.map +1 -1
  479. package/build-module/components/image-editor/index.js +1 -2
  480. package/build-module/components/image-editor/index.js.map +1 -1
  481. package/build-module/components/image-editor/use-save-image.js +1 -1
  482. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  483. package/build-module/components/image-link-destinations/index.native.js +1 -3
  484. package/build-module/components/image-link-destinations/index.native.js.map +1 -1
  485. package/build-module/components/image-size-control/index.js +1 -3
  486. package/build-module/components/image-size-control/index.js.map +1 -1
  487. package/build-module/components/inner-blocks/use-nested-settings-update.js +16 -9
  488. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  489. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  490. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  491. package/build-module/components/inserter/block-patterns-explorer/index.js +1 -2
  492. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  493. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +2 -3
  494. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  495. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -5
  496. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  497. package/build-module/components/inserter/block-patterns-tab/index.js +1 -3
  498. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  499. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -3
  500. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  501. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -3
  502. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  503. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  504. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  505. package/build-module/components/inserter/block-types-tab.js +1 -3
  506. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  507. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  508. package/build-module/components/inserter/category-tabs/index.js +3 -13
  509. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  510. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  511. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  512. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -1
  513. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  514. package/build-module/components/inserter/index.native.js +1 -3
  515. package/build-module/components/inserter/index.native.js.map +1 -1
  516. package/build-module/components/inserter/media-tab/media-panel.js +1 -2
  517. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  518. package/build-module/components/inserter/media-tab/media-preview.js +2 -4
  519. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  520. package/build-module/components/inserter/media-tab/media-tab.js +1 -3
  521. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  522. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  523. package/build-module/components/inserter/menu.js +6 -5
  524. package/build-module/components/inserter/menu.js.map +1 -1
  525. package/build-module/components/inserter/menu.native.js +1 -3
  526. package/build-module/components/inserter/menu.native.js.map +1 -1
  527. package/build-module/components/inserter/mobile-tab-navigation.js +1 -2
  528. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  529. package/build-module/components/inserter/no-results.js +1 -2
  530. package/build-module/components/inserter/no-results.js.map +1 -1
  531. package/build-module/components/inserter/no-results.native.js +1 -2
  532. package/build-module/components/inserter/no-results.native.js.map +1 -1
  533. package/build-module/components/inserter/panel.js +1 -3
  534. package/build-module/components/inserter/panel.js.map +1 -1
  535. package/build-module/components/inserter/preview-panel.js +1 -2
  536. package/build-module/components/inserter/preview-panel.js.map +1 -1
  537. package/build-module/components/inserter/quick-inserter.js +2 -3
  538. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  539. package/build-module/components/inserter/search-results.js +2 -3
  540. package/build-module/components/inserter/search-results.js.map +1 -1
  541. package/build-module/components/inserter/tabs.native.js.map +1 -1
  542. package/build-module/components/inserter-button/index.native.js +1 -2
  543. package/build-module/components/inserter-button/index.native.js.map +1 -1
  544. package/build-module/components/inserter-list-item/index.js +1 -2
  545. package/build-module/components/inserter-list-item/index.js.map +1 -1
  546. package/build-module/components/inserter-listbox/index.js +1 -2
  547. package/build-module/components/inserter-listbox/index.js.map +1 -1
  548. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  549. package/build-module/components/inspector-controls/fill.js.map +1 -1
  550. package/build-module/components/inspector-controls/fill.native.js +1 -3
  551. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  552. package/build-module/components/inspector-controls/slot.js.map +1 -1
  553. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  554. package/build-module/components/inspector-controls-tabs/index.js +1 -2
  555. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  556. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -3
  557. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  558. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -3
  559. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  560. package/build-module/components/inspector-popover-header/index.js +1 -2
  561. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  562. package/build-module/components/line-height-control/index.js.map +1 -1
  563. package/build-module/components/link-control/index.js +1 -3
  564. package/build-module/components/link-control/index.js.map +1 -1
  565. package/build-module/components/link-control/is-url-like.js.map +1 -1
  566. package/build-module/components/link-control/link-preview.js +1 -3
  567. package/build-module/components/link-control/link-preview.js.map +1 -1
  568. package/build-module/components/link-control/search-create-button.js +1 -1
  569. package/build-module/components/link-control/search-create-button.js.map +1 -1
  570. package/build-module/components/link-control/search-input.js +4 -7
  571. package/build-module/components/link-control/search-input.js.map +1 -1
  572. package/build-module/components/link-control/search-results.js +6 -17
  573. package/build-module/components/link-control/search-results.js.map +1 -1
  574. package/build-module/components/link-control/settings-drawer.js +1 -3
  575. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  576. package/build-module/components/link-control/settings.js +1 -2
  577. package/build-module/components/link-control/settings.js.map +1 -1
  578. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  579. package/build-module/components/list-view/appender.js +2 -3
  580. package/build-module/components/list-view/appender.js.map +1 -1
  581. package/build-module/components/list-view/block-contents.js +1 -3
  582. package/build-module/components/list-view/block-contents.js.map +1 -1
  583. package/build-module/components/list-view/block-select-button.js +1 -2
  584. package/build-module/components/list-view/block-select-button.js.map +1 -1
  585. package/build-module/components/list-view/block.js +1 -3
  586. package/build-module/components/list-view/block.js.map +1 -1
  587. package/build-module/components/list-view/branch.js +1 -3
  588. package/build-module/components/list-view/branch.js.map +1 -1
  589. package/build-module/components/list-view/drop-indicator.js +1 -2
  590. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  591. package/build-module/components/list-view/index.js +1 -2
  592. package/build-module/components/list-view/index.js.map +1 -1
  593. package/build-module/components/list-view/use-block-selection.js +2 -2
  594. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  595. package/build-module/components/list-view/utils.js +1 -1
  596. package/build-module/components/list-view/utils.js.map +1 -1
  597. package/build-module/components/media-placeholder/index.js +1 -3
  598. package/build-module/components/media-placeholder/index.js.map +1 -1
  599. package/build-module/components/media-placeholder/index.native.js +2 -4
  600. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  601. package/build-module/components/media-replace-flow/index.js +1 -3
  602. package/build-module/components/media-replace-flow/index.js.map +1 -1
  603. package/build-module/components/media-upload/index.native.js +1 -3
  604. package/build-module/components/media-upload/index.native.js.map +1 -1
  605. package/build-module/components/media-upload-progress/index.native.js +1 -2
  606. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  607. package/build-module/components/multi-selection-inspector/index.js +3 -4
  608. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  609. package/build-module/components/observe-typing/index.js +1 -0
  610. package/build-module/components/observe-typing/index.js.map +1 -1
  611. package/build-module/components/provider/index.js +1 -2
  612. package/build-module/components/provider/index.js.map +1 -1
  613. package/build-module/components/publish-date-time-picker/index.js +1 -2
  614. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  615. package/build-module/components/recursion-provider/index.js +1 -0
  616. package/build-module/components/recursion-provider/index.js.map +1 -1
  617. package/build-module/components/responsive-block-control/index.js +4 -5
  618. package/build-module/components/responsive-block-control/index.js.map +1 -1
  619. package/build-module/components/responsive-block-control/label.js +2 -4
  620. package/build-module/components/responsive-block-control/label.js.map +1 -1
  621. package/build-module/components/rich-text/content.js.map +1 -1
  622. package/build-module/components/rich-text/event-listeners/before-input-rules.js +2 -2
  623. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  624. package/build-module/components/rich-text/event-listeners/delete.js +2 -2
  625. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  626. package/build-module/components/rich-text/event-listeners/enter.js +2 -2
  627. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  628. package/build-module/components/rich-text/event-listeners/firefox-compat.js +2 -2
  629. package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -1
  630. package/build-module/components/rich-text/event-listeners/input-events.js +2 -2
  631. package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -1
  632. package/build-module/components/rich-text/event-listeners/input-rules.js +2 -2
  633. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  634. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +2 -2
  635. package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -1
  636. package/build-module/components/rich-text/event-listeners/paste-handler.js +2 -2
  637. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  638. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +2 -2
  639. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -1
  640. package/build-module/components/rich-text/event-listeners/shortcuts.js +2 -2
  641. package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -1
  642. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +2 -2
  643. package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -1
  644. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  645. package/build-module/components/rich-text/format-toolbar/index.js +1 -3
  646. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  647. package/build-module/components/rich-text/format-toolbar/index.native.js +1 -3
  648. package/build-module/components/rich-text/format-toolbar/index.native.js.map +1 -1
  649. package/build-module/components/rich-text/index.js +4 -5
  650. package/build-module/components/rich-text/index.js.map +1 -1
  651. package/build-module/components/rich-text/index.native.js +1 -3
  652. package/build-module/components/rich-text/index.native.js.map +1 -1
  653. package/build-module/components/rich-text/multiline.js.map +1 -1
  654. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  655. package/build-module/components/rich-text/native/index.js +1 -1
  656. package/build-module/components/rich-text/native/index.js.map +1 -1
  657. package/build-module/components/rich-text/native/index.native.js +1 -3
  658. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  659. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -3
  660. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  661. package/build-module/components/rich-text/native/use-format-types.js +1 -0
  662. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  663. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  664. package/build-module/components/rich-text/use-format-types.js +1 -0
  665. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  666. package/build-module/components/spacing-sizes-control/index.js +1 -2
  667. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  668. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -2
  669. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  670. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -2
  671. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  672. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -3
  673. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  674. package/build-module/components/spacing-sizes-control/utils.js +1 -0
  675. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  676. package/build-module/components/tabbed-sidebar/index.js +1 -2
  677. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  678. package/build-module/components/tool-selector/index.js +10 -6
  679. package/build-module/components/tool-selector/index.js.map +1 -1
  680. package/build-module/components/typewriter/index.js +1 -0
  681. package/build-module/components/typewriter/index.js.map +1 -1
  682. package/build-module/components/unsupported-block-details/index.native.js +1 -2
  683. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  684. package/build-module/components/url-input/button.js +1 -2
  685. package/build-module/components/url-input/button.js.map +1 -1
  686. package/build-module/components/url-input/index.js +2 -4
  687. package/build-module/components/url-input/index.js.map +1 -1
  688. package/build-module/components/url-popover/image-url-input-ui.js +1 -3
  689. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  690. package/build-module/components/url-popover/index.js +1 -2
  691. package/build-module/components/url-popover/index.js.map +1 -1
  692. package/build-module/components/url-popover/link-editor.js +1 -2
  693. package/build-module/components/url-popover/link-editor.js.map +1 -1
  694. package/build-module/components/url-popover/link-viewer.js +1 -2
  695. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  696. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  697. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  698. package/build-module/components/use-moving-animation/index.js.map +1 -1
  699. package/build-module/components/use-resize-canvas/index.js +1 -2
  700. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  701. package/build-module/components/video-player/index.native.js +1 -2
  702. package/build-module/components/video-player/index.native.js.map +1 -1
  703. package/build-module/components/warning/index.js +1 -2
  704. package/build-module/components/warning/index.js.map +1 -1
  705. package/build-module/components/warning/index.native.js +1 -2
  706. package/build-module/components/warning/index.native.js.map +1 -1
  707. package/build-module/components/writing-flow/index.js +1 -3
  708. package/build-module/components/writing-flow/index.js.map +1 -1
  709. package/build-module/components/writing-flow/use-tab-nav.js +21 -5
  710. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  711. package/build-module/hooks/align.js.map +1 -1
  712. package/build-module/hooks/anchor.js +1 -3
  713. package/build-module/hooks/anchor.js.map +1 -1
  714. package/build-module/hooks/block-bindings.js +1 -3
  715. package/build-module/hooks/block-bindings.js.map +1 -1
  716. package/build-module/hooks/block-hooks.js +2 -3
  717. package/build-module/hooks/block-hooks.js.map +1 -1
  718. package/build-module/hooks/block-style-variation.js +1 -2
  719. package/build-module/hooks/block-style-variation.js.map +1 -1
  720. package/build-module/hooks/dimensions.js +1 -3
  721. package/build-module/hooks/dimensions.js.map +1 -1
  722. package/build-module/hooks/duotone.js +1 -3
  723. package/build-module/hooks/duotone.js.map +1 -1
  724. package/build-module/hooks/font-family.js.map +1 -1
  725. package/build-module/hooks/gap.js.map +1 -1
  726. package/build-module/hooks/generated-class-name.js +1 -0
  727. package/build-module/hooks/generated-class-name.js.map +1 -1
  728. package/build-module/hooks/grid-visualizer.js +14 -14
  729. package/build-module/hooks/grid-visualizer.js.map +1 -1
  730. package/build-module/hooks/layout-child.js +42 -6
  731. package/build-module/hooks/layout-child.js.map +1 -1
  732. package/build-module/hooks/layout.js +1 -3
  733. package/build-module/hooks/layout.js.map +1 -1
  734. package/build-module/hooks/position.js +1 -1
  735. package/build-module/hooks/position.js.map +1 -1
  736. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  737. package/build-module/hooks/style.js +1 -3
  738. package/build-module/hooks/style.js.map +1 -1
  739. package/build-module/hooks/text-align.js.map +1 -1
  740. package/build-module/hooks/typography.native.js +1 -2
  741. package/build-module/hooks/typography.native.js.map +1 -1
  742. package/build-module/hooks/use-bindings-attributes.js +1 -2
  743. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  744. package/build-module/hooks/use-typography-props.js.map +1 -1
  745. package/build-module/hooks/use-zoom-out.js +24 -17
  746. package/build-module/hooks/use-zoom-out.js.map +1 -1
  747. package/build-module/layouts/constrained.js +1 -3
  748. package/build-module/layouts/constrained.js.map +1 -1
  749. package/build-module/layouts/flex.js +1 -3
  750. package/build-module/layouts/flex.js.map +1 -1
  751. package/build-module/layouts/grid.js +1 -3
  752. package/build-module/layouts/grid.js.map +1 -1
  753. package/build-module/layouts/utils.js.map +1 -1
  754. package/build-module/private-apis.js +2 -0
  755. package/build-module/private-apis.js.map +1 -1
  756. package/build-module/store/actions.js +5 -6
  757. package/build-module/store/actions.js.map +1 -1
  758. package/build-module/store/private-selectors.js.map +1 -1
  759. package/build-module/store/reducer.js +1 -16
  760. package/build-module/store/reducer.js.map +1 -1
  761. package/build-module/store/selectors.js +21 -12
  762. package/build-module/store/selectors.js.map +1 -1
  763. package/build-module/utils/block-bindings.js +9 -6
  764. package/build-module/utils/block-bindings.js.map +1 -1
  765. package/build-module/utils/get-font-styles-and-weights.js +1 -1
  766. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  767. package/build-module/utils/get-px-from-css-unit.js +1 -1
  768. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  769. package/build-module/utils/object.js +1 -0
  770. package/build-module/utils/object.js.map +1 -1
  771. package/build-module/utils/pasting.js.map +1 -1
  772. package/build-style/content-rtl.css +13 -26
  773. package/build-style/content.css +13 -26
  774. package/build-style/style-rtl.css +23 -41
  775. package/build-style/style.css +23 -41
  776. package/package.json +33 -33
  777. package/src/components/block-canvas/style.scss +0 -1
  778. package/src/components/block-list/content.scss +3 -2
  779. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
  780. package/src/components/block-list/zoom-out-separator.js +8 -6
  781. package/src/components/block-popover/index.js +64 -2
  782. package/src/components/block-preview/auto.js +1 -4
  783. package/src/components/block-tools/index.js +0 -11
  784. package/src/components/block-tools/style.scss +1 -1
  785. package/src/components/block-tools/use-show-block-tools.js +10 -3
  786. package/src/components/block-tools/zoom-out-popover.js +2 -1
  787. package/src/components/block-tools/zoom-out-toolbar.js +2 -23
  788. package/src/components/iframe/content.scss +27 -32
  789. package/src/components/iframe/index.js +63 -13
  790. package/src/components/iframe/style.scss +18 -0
  791. package/src/components/inner-blocks/use-nested-settings-update.js +16 -10
  792. package/src/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -1
  793. package/src/components/inserter/category-tabs/index.js +1 -11
  794. package/src/components/inserter/menu.js +7 -2
  795. package/src/components/inserter/quick-inserter.js +1 -1
  796. package/src/components/inserter/style.scss +1 -41
  797. package/src/components/link-control/search-input.js +4 -5
  798. package/src/components/link-control/search-results.js +2 -13
  799. package/src/components/link-control/test/index.js +84 -46
  800. package/src/components/media-replace-flow/test/index.js +1 -1
  801. package/src/components/responsive-block-control/style.scss +0 -1
  802. package/src/components/rich-text/style.scss +5 -0
  803. package/src/components/tool-selector/index.js +7 -2
  804. package/src/components/use-resize-canvas/index.js +1 -3
  805. package/src/components/writing-flow/use-tab-nav.js +28 -4
  806. package/src/hooks/grid-visualizer.js +23 -9
  807. package/src/hooks/layout-child.js +48 -3
  808. package/src/hooks/use-zoom-out.js +36 -20
  809. package/src/private-apis.js +2 -0
  810. package/src/store/actions.js +3 -2
  811. package/src/store/reducer.js +0 -17
  812. package/src/store/selectors.js +23 -12
  813. package/src/store/test/private-selectors.js +7 -1
  814. package/src/store/test/selectors.js +13 -2
  815. package/src/style.scss +1 -0
  816. package/src/utils/block-bindings.js +9 -6
  817. package/src/utils/test/use-block-bindings-utils.js +174 -0
@@ -23,7 +23,7 @@ var _jsxRuntime = require("react/jsx-runtime");
23
23
  */
24
24
 
25
25
  // This is used to avoid rendering the block list if the sizes change.
26
- let MemoizedBlockList;
26
+ const MemoizedBlockList = (0, _element.memo)(_blockList.default);
27
27
  const MAX_HEIGHT = 2000;
28
28
  const EMPTY_ADDITIONAL_STYLES = [];
29
29
  function ScaledBlockPreview({
@@ -57,9 +57,6 @@ function ScaledBlockPreview({
57
57
  }
58
58
  return styles;
59
59
  }, [styles, additionalStyles]);
60
-
61
- // Initialize on render instead of module top level, to avoid circular dependency issues.
62
- MemoizedBlockList = MemoizedBlockList || (0, _element.memo)(_blockList.default);
63
60
  const scale = containerWidth / viewportWidth;
64
61
  const aspectRatio = contentHeight ? containerWidth / (contentHeight * scale) : 0;
65
62
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Disabled, {
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_data","_element","_components","_blockList","_interopRequireDefault","_iframe","_editorStyles","_store","_jsxRuntime","MemoizedBlockList","MAX_HEIGHT","EMPTY_ADDITIONAL_STYLES","ScaledBlockPreview","viewportWidth","containerWidth","minHeight","additionalStyles","contentResizeListener","height","contentHeight","useResizeObserver","styles","useSelect","select","settings","store","getSettings","editorStyles","useMemo","css","__unstableType","memo","BlockList","scale","aspectRatio","jsx","Disabled","className","style","transform","maxHeight","undefined","children","jsxs","default","contentRef","useRefEffect","bodyElement","ownerDocument","documentElement","classList","add","position","width","boxSizing","tabIndex","pointerEvents","renderAppender","AutoBlockPreview","props","containerResizeListener","Fragment"],"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useResizeObserver, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, 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;\nconst EMPTY_ADDITIONAL_STYLES = [];\n\nfunction ScaledBlockPreview( {\n\tviewportWidth,\n\tcontainerWidth,\n\tminHeight,\n\tadditionalStyles = EMPTY_ADDITIONAL_STYLES,\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 || memo( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\tconst aspectRatio = contentHeight\n\t\t? containerWidth / ( contentHeight * scale )\n\t\t: 0;\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\t// Using width + aspect-ratio instead of height here triggers browsers' native\n\t\t\t\t// handling of scrollbar's visibility. It prevents the flickering issue seen\n\t\t\t\t// in https://github.com/WordPress/gutenberg/issues/52027.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/52921 for more info.\n\t\t\t\taspectRatio,\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"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,OAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,aAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAoC,IAAAS,WAAA,GAAAT,OAAA;AAdpC;AACA;AACA;;AAMA;AACA;AACA;;AAMA;AACA,IAAIU,iBAAiB;AAErB,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,uBAAuB,GAAG,EAAE;AAElC,SAASC,kBAAkBA,CAAE;EAC5BC,aAAa;EACbC,cAAc;EACdC,SAAS;EACTC,gB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CAAC,CAAE,GAC3D,IAAAM,0BAAiB,EAAC,CAAC;EAEpB,oBACC,IAAAZ,WAAA,CAAAmC,IAAA,EAAAnC,WAAA,CAAAqD,QAAA;IAAAnB,QAAA,gBACC,IAAAlC,WAAA,CAAA2B,GAAA;MAAKG,KAAK,EAAG;QAAEc,QAAQ,EAAE,UAAU;QAAEC,KAAK,EAAE,MAAM;QAAEnC,MAAM,EAAE;MAAE,CAAG;MAAAwB,QAAA,EAC9DkB;IAAuB,CACrB,CAAC,eACN,IAAApD,WAAA,CAAA2B,GAAA;MAAKE,SAAS,EAAC,uCAAuC;MAAAK,QAAA,EACnD,CAAC,CAAE5B,cAAc,iBAClB,IAAAN,WAAA,CAAA2B,GAAA,EAACvB,kBAAkB;QAAA,GACb+C,KAAK;QACV7C,cAAc,EAAGA;MAAgB,CACjC;IACD,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_data","_element","_components","_blockList","_interopRequireDefault","_iframe","_editorStyles","_store","_jsxRuntime","MemoizedBlockList","memo","BlockList","MAX_HEIGHT","EMPTY_ADDITIONAL_STYLES","ScaledBlockPreview","viewportWidth","containerWidth","minHeight","additionalStyles","contentResizeListener","height","contentHeight","useResizeObserver","styles","useSelect","select","settings","store","getSettings","editorStyles","useMemo","css","__unstableType","scale","aspectRatio","jsx","Disabled","className","style","transform","maxHeight","undefined","children","jsxs","default","contentRef","useRefEffect","bodyElement","ownerDocument","documentElement","classList","add","position","width","boxSizing","tabIndex","pointerEvents","renderAppender","AutoBlockPreview","props","containerResizeListener","Fragment"],"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useResizeObserver, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, 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.\nconst MemoizedBlockList = memo( BlockList );\n\nconst MAX_HEIGHT = 2000;\nconst EMPTY_ADDITIONAL_STYLES = [];\n\nfunction ScaledBlockPreview( {\n\tviewportWidth,\n\tcontainerWidth,\n\tminHeight,\n\tadditionalStyles = EMPTY_ADDITIONAL_STYLES,\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\tconst scale = containerWidth / viewportWidth;\n\tconst aspectRatio = contentHeight\n\t\t? containerWidth / ( contentHeight * scale )\n\t\t: 0;\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\t// Using width + aspect-ratio instead of height here triggers browsers' native\n\t\t\t\t// handling of scrollbar's visibility. It prevents the flickering issue seen\n\t\t\t\t// in https://github.com/WordPress/gutenberg/issues/52027.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/52921 for more info.\n\t\t\t\taspectRatio,\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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AC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_element","_deprecated","_provider","_auto","_editorStyles","_store","_blockList","_jsxRuntime","EMPTY_ADDITIONAL_STYLES","BlockPreview","blocks","viewportWidth","minHeight","additionalStyles","__experimentalMinHeight","__experimentalPadding","deprecated","since","version","alternative","css","originalSettings","useSelect","select","blockEditorStore","getSettings","settings","useMemo","focusMode","__unstableIsPreviewMode","renderedBlocks","Array","isArray","length","jsx","ExperimentalBlockEditorProvider","value","children","default","_default","exports","memo","useBlockPreview","props","layout","styles","undefined","disabledRef","useDisabled","ref","useMergeRefs","jsxs","BlockListItems","renderAppender","className","clsx"],"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDisabled, useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { ExperimentalBlockEditorProvider } from '../provider';\nimport AutoHeightBlockPreview from './auto';\nimport EditorStyles from '../editor-styles';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockListItems } from '../block-list';\n\nconst EMPTY_ADDITIONAL_STYLES = [];\n\nexport function BlockPreview( {\n\tblocks,\n\tviewportWidth = 1200,\n\tminHeight,\n\tadditionalStyles = EMPTY_ADDITIONAL_STYLES,\n\t// Deprecated props:\n\t__experimentalMinHeight,\n\t__experimentalPadding,\n} ) {\n\tif ( __experimentalMinHeight ) {\n\t\tminHeight = __experimentalMinHeight;\n\t\tdeprecated( 'The __experimentalMinHeight prop', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'minHeight',\n\t\t} );\n\t}\n\tif ( __experimentalPadding ) {\n\t\tadditionalStyles = [\n\t\t\t...additionalStyles,\n\t\t\t{ css: `body { padding: ${ __experimentalPadding }px; }` },\n\t\t];\n\t\tdeprecated( 'The __experimentalPadding prop of BlockPreview', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'additionalStyles',\n\t\t} );\n\t}\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tif ( ! blocks || blocks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<AutoHeightBlockPreview\n\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tadditionalStyles={ additionalStyles }\n\t\t\t/>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n\n/**\n * BlockPreview renders a preview of a block or array of blocks.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md\n *\n * @param {Object} preview options for how the preview should be shown\n * @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed.\n * @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700.\n *\n * @return {Component} The component to be rendered.\n */\nexport default memo( BlockPreview );\n\n/**\n * This hook is used to lightly mark an element as a block preview wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * a block preview wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} options Preview options.\n * @param {WPBlock[]} options.blocks Block objects.\n * @param {Object} options.props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options.layout Layout settings to be used in the preview.\n */\nexport function useBlockPreview( { blocks, props = {}, layout } ) {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tstyles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst disabledRef = useDisabled();\n\tconst ref = useMergeRefs( [ props.ref, disabledRef ] );\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst children = (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<EditorStyles />\n\t\t\t<BlockListItems renderAppender={ false } layout={ layout } />\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-preview__live-content',\n\t\t\t'components-disabled'\n\t\t),\n\t\tchildren: blocks?.length ? children : null,\n\t};\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA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BAAY,EAAE,CAAEP,KAAK,CAACM,GAAG,EAAEF,WAAW,CAAG,CAAC;EACtD,MAAMjB,cAAc,GAAG,IAAAH,gBAAO,EAC7B,MAAQI,KAAK,CAACC,OAAO,CAAEtB,MAAO,CAAC,GAAGA,MAAM,GAAG,CAAEA,MAAM,CAAI,EACvD,CAAEA,MAAM,CACT,CAAC;EAED,MAAM2B,QAAQ,gBACb,IAAA9B,WAAA,CAAA4C,IAAA,EAACjD,SAAA,CAAAiC,+BAA+B;IAC/BC,KAAK,EAAGN,cAAgB;IACxBJ,QAAQ,EAAGA,QAAU;IAAAW,QAAA,gBAErB,IAAA9B,WAAA,CAAA2B,GAAA,EAAC9B,aAAA,CAAAkC,OAAY,IAAE,CAAC,eAChB,IAAA/B,WAAA,CAAA2B,GAAA,EAAC5B,UAAA,CAAA8C,cAAc;MAACC,cAAc,EAAG,KAAO;MAACT,MAAM,EAAGA;IAAQ,CAAE,CAAC;EAAA,CAC7B,CACjC;EAED,OAAO;IACN,GAAGD,KAAK;IACRM,GAAG;IACHK,SAAS,EAAE,IAAAC,aAAI,EACdZ,KAAK,CAACW,SAAS,EACf,0CAA0C,EAC1C,qBACD,CAAC;IACDjB,QAAQ,EAAE3B,MAAM,EAAEuB,MAAM,GAAGI,QAAQ,GAAG;EACvC,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_element","_deprecated","_provider","_auto","_editorStyles","_store","_blockList","_jsxRuntime","EMPTY_ADDITIONAL_STYLES","BlockPreview","blocks","viewportWidth","minHeight","additionalStyles","__experimentalMinHeight","__experimentalPadding","deprecated","since","version","alternative","css","originalSettings","useSelect","select","blockEditorStore","getSettings","settings","useMemo","focusMode","__unstableIsPreviewMode","renderedBlocks","Array","isArray","length","jsx","ExperimentalBlockEditorProvider","value","children","default","_default","exports","memo","useBlockPreview","props","layout","styles","undefined","disabledRef","useDisabled","ref","useMergeRefs","jsxs","BlockListItems","renderAppender","className","clsx"],"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDisabled, useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { ExperimentalBlockEditorProvider } from '../provider';\nimport AutoHeightBlockPreview from './auto';\nimport EditorStyles from '../editor-styles';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockListItems } from '../block-list';\n\nconst EMPTY_ADDITIONAL_STYLES = [];\n\nexport function BlockPreview( {\n\tblocks,\n\tviewportWidth = 1200,\n\tminHeight,\n\tadditionalStyles = EMPTY_ADDITIONAL_STYLES,\n\t// Deprecated props:\n\t__experimentalMinHeight,\n\t__experimentalPadding,\n} ) {\n\tif ( __experimentalMinHeight ) {\n\t\tminHeight = __experimentalMinHeight;\n\t\tdeprecated( 'The __experimentalMinHeight prop', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'minHeight',\n\t\t} );\n\t}\n\tif ( __experimentalPadding ) {\n\t\tadditionalStyles = [\n\t\t\t...additionalStyles,\n\t\t\t{ css: `body { padding: ${ __experimentalPadding }px; }` },\n\t\t];\n\t\tdeprecated( 'The __experimentalPadding prop of BlockPreview', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'additionalStyles',\n\t\t} );\n\t}\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tif ( ! blocks || blocks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<AutoHeightBlockPreview\n\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tadditionalStyles={ additionalStyles }\n\t\t\t/>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n\n/**\n * BlockPreview renders a preview of a block or array of blocks.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md\n *\n * @param {Object} preview options for how the preview should be shown\n * @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed.\n * @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700.\n *\n * @return {Component} The component to be rendered.\n */\nexport default memo( BlockPreview );\n\n/**\n * This hook is used to lightly mark an element as a block preview wrapper\n * element. Call this hook and pass the returned props to the element to mark as\n * a block preview wrapper, automatically rendering inner blocks as children. If\n * you define a ref for the element, it is important to pass the ref to this\n * hook, which the hook in turn will pass to the component through the props it\n * returns. Optionally, you can also pass any other props through this hook, and\n * they will be merged and returned.\n *\n * @param {Object} options Preview options.\n * @param {WPBlock[]} options.blocks Block objects.\n * @param {Object} options.props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options.layout Layout settings to be used in the preview.\n */\nexport function useBlockPreview( { blocks, props = {}, layout } ) {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tstyles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\t__unstableIsPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\tconst disabledRef = useDisabled();\n\tconst ref = useMergeRefs( [ props.ref, disabledRef ] );\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst children = (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ renderedBlocks }\n\t\t\tsettings={ settings }\n\t\t>\n\t\t\t<EditorStyles />\n\t\t\t<BlockListItems renderAppender={ false } layout={ layout } />\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n\n\treturn {\n\t\t...props,\n\t\tref,\n\t\tclassName: clsx(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-preview__live-content',\n\t\t\t'components-disabled'\n\t\t),\n\t\tchildren: blocks?.length ? children : null,\n\t};\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,aAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAA+C,IAAAU,WAAA,GAAAV,OAAA;AApB/C;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAOA,MAAMW,uBAAuB,GAAG,EAAE;AAE3B,SAASC,YAAYA,CAAE;EAC7BC,MAAM;EACNC,aAAa,GAAG,IAAI;EACpBC,SAAS;EACTC,gBAAgB,GAAGL,uBAAuB;EAC1C;EACAM,uBAAuB;EACvBC;AACD,CAAC,EAAG;EACH,IAAKD,uBAAuB,EAAG;IAC9BF,SAAS,GAAGE,uBAAuB;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OAAY,IAAE,CAAC,eAChB,IAAA/B,WAAA,CAAA2B,GAAA,EAAC5B,UAAA,CAAA8C,cAAc;MAACC,cAAc,EAAG,KAAO;MAACT,MAAM,EAAGA;IAAQ,CAAE,CAAC;EAAA,CAC7B,CACjC;EAED,OAAO;IACN,GAAGD,KAAK;IACRM,GAAG;IACHK,SAAS,EAAE,IAAAC,aAAI,EACdZ,KAAK,CAACW,SAAS,EACf,0CAA0C,EAC1C,qBACD,CAAC;IACDjB,QAAQ,EAAE3B,MAAM,EAAEuB,MAAM,GAAGI,QAAQ,GAAG;EACvC,CAAC;AACF","ignoreList":[]}
@@ -35,8 +35,8 @@ function BlockRenameModal({
35
35
  const isNameValid = nameHasChanged || nameIsOriginal;
36
36
  const autoSelectInputText = event => event.target.select();
37
37
  const handleSubmit = () => {
38
- const message = nameIsOriginal || nameIsEmpty ? (0, _i18n.sprintf)( /* translators: %s: new name/label for the block */
39
- (0, _i18n.__)('Block name reset to: "%s".'), editedBlockName) : (0, _i18n.sprintf)( /* translators: %s: new name/label for the block */
38
+ const message = nameIsOriginal || nameIsEmpty ? (0, _i18n.sprintf)(/* translators: %s: new name/label for the block */
39
+ (0, _i18n.__)('Block name reset to: "%s".'), editedBlockName) : (0, _i18n.sprintf)(/* translators: %s: new name/label for the block */
40
40
  (0, _i18n.__)('Block name changed to: "%s".'), editedBlockName);
41
41
 
42
42
  // Must be assertive to immediately announce change.
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_element","_a11y","_isEmptyString","_interopRequireDefault","_jsxRuntime","BlockRenameModal","blockName","originalBlockName","onClose","onSave","hasOverridesWarning","editedBlockName","setEditedBlockName","useState","nameHasChanged","nameIsOriginal","nameIsEmpty","isEmptyString","isNameValid","autoSelectInputText","event","target","select","handleSubmit","message","sprintf","__","speak","jsx","Modal","title","onRequestClose","overlayClassName","focusOnMount","size","children","onSubmit","e","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","label","help","undefined","placeholder","onChange","onFocus","__experimentalHStack","justify","Button","variant","onClick","type"],"sources":["@wordpress/block-editor/src/components/block-rename/modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport isEmptyString from './is-empty-string';\n\nexport default function BlockRenameModal( {\n\tblockName,\n\toriginalBlockName,\n\tonClose,\n\tonSave,\n\t// Pattern Overrides is a WordPress-only feature but it also uses the Block Binding API.\n\t// Ideally this should not be inside the block editor package, but we keep it here for simplicity.\n\thasOverridesWarning,\n} ) {\n\tconst [ editedBlockName, setEditedBlockName ] = useState( blockName );\n\n\tconst nameHasChanged = editedBlockName !== blockName;\n\tconst nameIsOriginal = editedBlockName === originalBlockName;\n\tconst nameIsEmpty = isEmptyString( editedBlockName );\n\n\tconst isNameValid = nameHasChanged || nameIsOriginal;\n\n\tconst autoSelectInputText = ( event ) => event.target.select();\n\n\tconst handleSubmit = () => {\n\t\tconst message =\n\t\t\tnameIsOriginal || nameIsEmpty\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t\t\t__( 'Block name reset to: \"%s\".' ),\n\t\t\t\t\t\teditedBlockName\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t\t\t__( 'Block name changed to: \"%s\".' ),\n\t\t\t\t\t\teditedBlockName\n\t\t\t\t );\n\n\t\t// Must be assertive to immediately announce change.\n\t\tspeak( message, 'assertive' );\n\t\tonSave( editedBlockName );\n\n\t\t// Immediate close avoids ability to hit save multiple times.\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\toverlayClassName=\"block-editor-block-rename-modal\"\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif ( ! isNameValid ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\thandleSubmit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedBlockName }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\thasOverridesWarning\n\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t'This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern.'\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ originalBlockName }\n\t\t\t\t\t\tonChange={ setEditedBlockName }\n\t\t\t\t\t\tonFocus={ autoSelectInputText }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taria-disabled={ ! isNameValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' 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AAAwB,GAAA,EAAC/B,WAAA,CAAAyD,MAAM;YACNV,qBAAqB;YACrB,iBAAgB,CAAE1B,WAAa;YAC/BqC,OAAO,EAAC,SAAS;YACjBE,IAAI,EAAC,QAAQ;YAAAtB,QAAA,EAEX,IAAAT,QAAE,EAAE,MAAO;UAAC,CACP,CAAC;QAAA,CACF,CAAC;MAAA,CACF;IAAC,CACJ;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_element","_a11y","_isEmptyString","_interopRequireDefault","_jsxRuntime","BlockRenameModal","blockName","originalBlockName","onClose","onSave","hasOverridesWarning","editedBlockName","setEditedBlockName","useState","nameHasChanged","nameIsOriginal","nameIsEmpty","isEmptyString","isNameValid","autoSelectInputText","event","target","select","handleSubmit","message","sprintf","__","speak","jsx","Modal","title","onRequestClose","overlayClassName","focusOnMount","size","children","onSubmit","e","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","label","help","undefined","placeholder","onChange","onFocus","__experimentalHStack","justify","Button","variant","onClick","type"],"sources":["@wordpress/block-editor/src/components/block-rename/modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport isEmptyString from './is-empty-string';\n\nexport default function BlockRenameModal( {\n\tblockName,\n\toriginalBlockName,\n\tonClose,\n\tonSave,\n\t// Pattern Overrides is a WordPress-only feature but it also uses the Block Binding API.\n\t// Ideally this should not be inside the block editor package, but we keep it here for simplicity.\n\thasOverridesWarning,\n} ) {\n\tconst [ editedBlockName, setEditedBlockName ] = useState( blockName );\n\n\tconst nameHasChanged = editedBlockName !== blockName;\n\tconst nameIsOriginal = editedBlockName === originalBlockName;\n\tconst nameIsEmpty = isEmptyString( editedBlockName );\n\n\tconst isNameValid = nameHasChanged || nameIsOriginal;\n\n\tconst autoSelectInputText = ( event ) => event.target.select();\n\n\tconst handleSubmit = () => {\n\t\tconst message =\n\t\t\tnameIsOriginal || nameIsEmpty\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t\t\t__( 'Block name reset to: \"%s\".' ),\n\t\t\t\t\t\teditedBlockName\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: new name/label for the block */\n\t\t\t\t\t\t__( 'Block name changed to: \"%s\".' ),\n\t\t\t\t\t\teditedBlockName\n\t\t\t\t );\n\n\t\t// Must be assertive to immediately announce change.\n\t\tspeak( message, 'assertive' );\n\t\tonSave( editedBlockName );\n\n\t\t// Immediate close avoids ability to hit save multiple times.\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\toverlayClassName=\"block-editor-block-rename-modal\"\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif ( ! isNameValid ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\thandleSubmit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedBlockName }\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\thasOverridesWarning\n\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t'This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern.'\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tplaceholder={ originalBlockName }\n\t\t\t\t\t\tonChange={ setEditedBlockName }\n\t\t\t\t\t\tonFocus={ autoSelectInputText }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\taria-disabled={ ! isNameValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AAA8C,IAAAM,WAAA,GAAAN,OAAA;AAjB9C;AACA;AACA;;AAYA;AACA;AACA;;AAGe,SAASO,gBAAgBA,CAAE;EACzCC,SAAS;EACTC,iBAAiB;EACjBC,OAAO;EACPC,MAAM;EACN;EACA;EACAC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,eAAe,EAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAQ,EAAEP,SAAU,CAAC;EAErE,MAAMQ,cAAc,GAAGH,eAAe,KAAKL,SAAS;EACpD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AAW;UACXC,uBAAuB;UACvBC,qBAAqB;UACrBC,KAAK,EAAGlC,eAAiB;UACzBmC,KAAK,EAAG,IAAApB,QAAE,EAAE,MAAO,CAAG;UACtBqB,IAAI,EACHrC,mBAAmB,GAChB,IAAAgB,QAAE,EACF,wHACA,CAAC,GACDsB,SACH;UACDC,WAAW,EAAG1C,iBAAmB;UACjC2C,QAAQ,EAAGtC,kBAAoB;UAC/BuC,OAAO,EAAGhC;QAAqB,CAC/B,CAAC,eACF,IAAAf,WAAA,CAAAmC,IAAA,EAAC1C,WAAA,CAAAuD,oBAAM;UAACC,OAAO,EAAC,OAAO;UAAAlB,QAAA,gBACtB,IAAA/B,WAAA,CAAAwB,GAAA,EAAC/B,WAAA,CAAAyD,MAAM;YACNV,qBAAqB;YACrBW,OAAO,EAAC,UAAU;YAClBC,OAAO,EAAGhD,OAAS;YAAA2B,QAAA,EAEjB,IAAAT,QAAE,EAAE,QAAS;UAAC,CACT,CAAC,eAET,IAAAtB,WAAA,CAAAwB,GAAA,EAAC/B,WAAA,CAAAyD,MAAM;YACNV,qBAAqB;YACrB,iBAAgB,CAAE1B,WAAa;YAC/BqC,OAAO,EAAC,SAAS;YACjBE,IAAI,EAAC,QAAQ;YAAAtB,QAAA,EAEX,IAAAT,QAAE,EAAE,MAAO;UAAC,CACP,CAAC;QAAA,CACF,CAAC;MAAA,CACF;IAAC,CACJ;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
@@ -48,7 +48,7 @@ function BlockParentSelectorMenuItem({
48
48
  icon: parentBlockType.icon
49
49
  }),
50
50
  onClick: () => selectBlock(parentClientId),
51
- children: (0, _i18n.sprintf)( /* translators: %s: Name of the block's parent. */
51
+ children: (0, _i18n.sprintf)(/* translators: %s: Name of the block's parent. */
52
52
  (0, _i18n.__)('Select parent block (%s)'), parentBlockType.title)
53
53
  });
54
54
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_components","_compose","_data","_i18n","_blockIcon","_interopRequireDefault","_utils","_store","_jsxRuntime","BlockParentSelectorMenuItem","parentClientId","parentBlockType","isSmallViewport","useViewportMatch","selectBlock","useDispatch","blockEditorStore","menuItemRef","useRef","gesturesProps","useShowHoveredOrFocusedGestures","ref","highlightParent","jsx","MenuItem","icon","default","onClick","children","sprintf","__","title"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-parent-selector-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { MenuItem } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { useShowHoveredOrFocusedGestures } from '../block-toolbar/utils';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function BlockParentSelectorMenuItem( {\n\tparentClientId,\n\tparentBlockType,\n} ) {\n\tconst isSmallViewport = useViewportMatch( 'medium', '<' );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\t// Allows highlighting the parent block outline when focusing or hovering\n\t// the parent block selector within the child.\n\tconst menuItemRef = useRef();\n\tconst gesturesProps = useShowHoveredOrFocusedGestures( {\n\t\tref: menuItemRef,\n\t\thighlightParent: true,\n\t} );\n\n\tif ( ! isSmallViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\t{ ...gesturesProps }\n\t\t\tref={ menuItemRef }\n\t\t\ticon={ <BlockIcon icon={ parentBlockType.icon } /> }\n\t\t\tonClick={ () => selectBlock( parentClientId ) }\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: Name of the block's parent. */\n\t\t\t\t__( 'Select parent block (%s)' ),\n\t\t\t\tparentBlockType.title\n\t\t\t) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAwD,IAAAS,WAAA,GAAAT,OAAA;AAdxD;AACA;AACA;;AAOA;AACA;AACA;;AAKe,SAASU,2BAA2BA,CAAE;EACpDC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EACzD,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;;EAEvD;EACA;EACA,MAAMC,WAAW,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC5B,MAAMC,aAAa,GAAG,IAAAC,sCAA+B,EAAE;IACtDC,GAAG,EAAEJ,WAAW;IAChBK,eAAe,EAAE;EAClB,CAAE,CAAC;EAEH,IAAK,CAAEV,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAJ,WAAA,CAAAe,GAAA,EAACvB,WAAA,CAAAwB,QAAQ;IAAA,GACHL,aAAa;IAClBE,GAAG,EAAGJ,WAAa;IACnBQ,IAAI,eAAG,IAAAjB,WAAA,CAAAe,GAAA,EAACnB,UAAA,CAAAsB,OAAS;MAACD,IAAI,EAAGd,eAAe,CAACc;IAAM,CAAE,CAAG;IACpDE,OAAO,EAAGA,CAAA,KAAMb,WAAW,CAAEJ,cAAe,CAAG;IAAAkB,QAAA,EAE7C,IAAAC,aAAO,GACR;IACA,IAAAC,QAAE,EAAE,0BAA2B,CAAC,EAChCnB,eAAe,CAACoB,KACjB;EAAC,CACQ,CAAC;AAEb","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_components","_compose","_data","_i18n","_blockIcon","_interopRequireDefault","_utils","_store","_jsxRuntime","BlockParentSelectorMenuItem","parentClientId","parentBlockType","isSmallViewport","useViewportMatch","selectBlock","useDispatch","blockEditorStore","menuItemRef","useRef","gesturesProps","useShowHoveredOrFocusedGestures","ref","highlightParent","jsx","MenuItem","icon","default","onClick","children","sprintf","__","title"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-parent-selector-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { MenuItem } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { useShowHoveredOrFocusedGestures } from '../block-toolbar/utils';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function BlockParentSelectorMenuItem( {\n\tparentClientId,\n\tparentBlockType,\n} ) {\n\tconst isSmallViewport = useViewportMatch( 'medium', '<' );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\t// Allows highlighting the parent block outline when focusing or hovering\n\t// the parent block selector within the child.\n\tconst menuItemRef = useRef();\n\tconst gesturesProps = useShowHoveredOrFocusedGestures( {\n\t\tref: menuItemRef,\n\t\thighlightParent: true,\n\t} );\n\n\tif ( ! isSmallViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\t{ ...gesturesProps }\n\t\t\tref={ menuItemRef }\n\t\t\ticon={ <BlockIcon icon={ parentBlockType.icon } /> }\n\t\t\tonClick={ () => selectBlock( parentClientId ) }\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: Name of the block's parent. */\n\t\t\t\t__( 'Select parent block (%s)' ),\n\t\t\t\tparentBlockType.title\n\t\t\t) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAwD,IAAAS,WAAA,GAAAT,OAAA;AAdxD;AACA;AACA;;AAOA;AACA;AACA;;AAKe,SAASU,2BAA2BA,CAAE;EACpDC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EACzD,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;;EAEvD;EACA;EACA,MAAMC,WAAW,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC5B,MAAMC,aAAa,GAAG,IAAAC,sCAA+B,EAAE;IACtDC,GAAG,EAAEJ,WAAW;IAChBK,eAAe,EAAE;EAClB,CAAE,CAAC;EAEH,IAAK,CAAEV,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAJ,WAAA,CAAAe,GAAA,EAACvB,WAAA,CAAAwB,QAAQ;IAAA,GACHL,aAAa;IAClBE,GAAG,EAAGJ,WAAa;IACnBQ,IAAI,eAAG,IAAAjB,WAAA,CAAAe,GAAA,EAACnB,UAAA,CAAAsB,OAAS;MAACD,IAAI,EAAGd,eAAe,CAACc;IAAM,CAAE,CAAG;IACpDE,OAAO,EAAGA,CAAA,KAAMb,WAAW,CAAEJ,cAAe,CAAG;IAAAkB,QAAA,EAE7C,IAAAC,aAAO,EACR;IACA,IAAAC,QAAE,EAAE,0BAA2B,CAAC,EAChCnB,eAAe,CAACoB,KACjB;EAAC,CACQ,CAAC;AAEb","ignoreList":[]}
@@ -58,7 +58,7 @@ const BlockTransformationsMenu = ({
58
58
  function onPickerSelect(value) {
59
59
  replaceBlocks(selectedBlockClientId, (0, _blocks.switchToBlockType)(selectedBlock, value));
60
60
  const selectedItem = pickerOptions().find(item => item.value === value);
61
- const successNotice = (0, _i18n.sprintf)( /* translators: 1: From block title, e.g. Paragraph. 2: To block title, e.g. Header. */
61
+ const successNotice = (0, _i18n.sprintf)(/* translators: 1: From block title, e.g. Paragraph. 2: To block title, e.g. Header. */
62
62
  (0, _i18n.__)('%1$s transformed to %2$s'), blockTitle, selectedItem.label);
63
63
  createSuccessNotice(successNotice);
64
64
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_i18n","_blocks","_components","_data","_notices","_store","_jsxRuntime","BlockTransformationsMenu","anchorNodeRef","blockTitle","pickerRef","possibleTransformations","selectedBlock","selectedBlockClientId","replaceBlocks","useDispatch","blockEditorStore","createSuccessNotice","noticesStore","pickerOptions","_selectedBlock$name","selectedBlockName","name","blocksThatSplitWhenTransformed","map","item","label","length","includes","id","title","value","getAnchor","findNodeHandle","undefined","onPickerSelect","switchToBlockType","selectedItem","find","successNotice","sprintf","__","jsx","Picker","testID","ref","options","onChange","hideCancelButton","Platform","OS","leftAlign","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-switcher/block-transformations-menu.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { findNodeHandle, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { switchToBlockType } from '@wordpress/blocks';\nimport { Picker } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst BlockTransformationsMenu = ( {\n\tanchorNodeRef,\n\tblockTitle,\n\tpickerRef,\n\tpossibleTransformations,\n\tselectedBlock,\n\tselectedBlockClientId,\n} ) => {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pickerOptions = () => {\n\t\tconst selectedBlockName = selectedBlock?.name ?? '';\n\t\tconst blocksThatSplitWhenTransformed = {\n\t\t\t'core/list': [ 'core/paragraph', 'core/heading' ],\n\t\t\t'core/quote': [ 'core/paragraph' ],\n\t\t\t'core/pullquote': [ 'core/paragraph' ],\n\t\t};\n\n\t\treturn possibleTransformations.map( ( item ) => {\n\t\t\tconst label =\n\t\t\t\tselectedBlockName.length &&\n\t\t\t\tblocksThatSplitWhenTransformed[ selectedBlockName ] &&\n\t\t\t\tblocksThatSplitWhenTransformed[ selectedBlockName ].includes(\n\t\t\t\t\titem.id\n\t\t\t\t)\n\t\t\t\t\t? `${ item.title } blocks`\n\t\t\t\t\t: item.title;\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tvalue: item.id,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst getAnchor = () =>\n\t\tanchorNodeRef ? findNodeHandle( anchorNodeRef ) : undefined;\n\n\tfunction onPickerSelect( value ) {\n\t\treplaceBlocks(\n\t\t\tselectedBlockClientId,\n\t\t\tswitchToBlockType( selectedBlock, value )\n\t\t);\n\n\t\tconst selectedItem = pickerOptions().find(\n\t\t\t( item ) => item.value === value\n\t\t);\n\t\tconst successNotice = sprintf(\n\t\t\t/* translators: 1: From block title, e.g. Paragraph. 2: To block title, e.g. Header. */\n\t\t\t__( '%1$s transformed to %2$s' ),\n\t\t\tblockTitle,\n\t\t\tselectedItem.label\n\t\t);\n\t\tcreateSuccessNotice( successNotice );\n\t}\n\n\treturn (\n\t\t<Picker\n\t\t\ttestID=\"block-transformations-menu\"\n\t\t\tref={ pickerRef }\n\t\t\toptions={ pickerOptions() }\n\t\t\tonChange={ onPickerSelect }\n\t\t\thideCancelButton={ Platform.OS !== 'ios' }\n\t\t\tleftAlign\n\t\t\tgetAnchor={ getAnchor }\n\t\t\t// translators: %s: block title e.g: \"Paragraph\".\n\t\t\ttitle={ sprintf( __( 'Transform %s to' ), blockTitle ) }\n\t\t/>\n\t);\n};\n\nexport default BlockTransformationsMenu;\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAA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;IACF,CAAE,CAAC;EACJ,CAAC;EAED,MAAMG,SAAS,GAAGA,CAAA,KACjBxB,aAAa,GAAG,IAAAyB,2BAAc,EAAEzB,aAAc,CAAC,GAAG0B,SAAS;EAE5D,SAASC,cAAcA,CAAEJ,KAAK,EAAG;IAChCjB,aAAa,CACZD,qBAAqB,EACrB,IAAAuB,yBAAiB,EAAExB,aAAa,EAAEmB,KAAM,CACzC,CAAC;IAED,MAAMM,YAAY,GAAGlB,aAAa,CAAC,CAAC,CAACmB,IAAI,CACtCb,IAAI,IAAMA,IAAI,CAACM,KAAK,KAAKA,KAC5B,CAAC;IACD,MAAMQ,aAAa,GAAG,IAAAC,aAAO,GAC5B;IACA,IAAAC,QAAE,EAAE,0BAA2B,CAAC,EAChChC,UAAU,EACV4B,YAAY,CAACX,KACd,CAAC;IACDT,mBAAmB,CAAEsB,aAAc,CAAC;EACrC;EAEA,oBACC,IAAAjC,WAAA,CAAAoC,GAAA,EAACxC,WAAA,CAAAyC,MAAM;IACNC,MAAM,EAAC,4BAA4B;IACnCC,GAAG,EAAGnC,SAAW;IACjBoC,OAAO,EAAG3B,aAAa,CAAC,CAAG;IAC3B4B,QAAQ,EAAGZ,cAAgB;IAC3Ba,gBAAgB,EAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAO;IAC1CC,SAAS;IACTnB,SAAS,EAAGA;IACZ;IAAA;IACAF,KAAK,EAAG,IAAAU,aAAO,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC,EAAEhC,UAAW;EAAG,CACxD,CAAC;AAEJ,CAAC;AAAC,IAAA2C,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa/C,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_i18n","_blocks","_components","_data","_notices","_store","_jsxRuntime","BlockTransformationsMenu","anchorNodeRef","blockTitle","pickerRef","possibleTransformations","selectedBlock","selectedBlockClientId","replaceBlocks","useDispatch","blockEditorStore","createSuccessNotice","noticesStore","pickerOptions","_selectedBlock$name","selectedBlockName","name","blocksThatSplitWhenTransformed","map","item","label","length","includes","id","title","value","getAnchor","findNodeHandle","undefined","onPickerSelect","switchToBlockType","selectedItem","find","successNotice","sprintf","__","jsx","Picker","testID","ref","options","onChange","hideCancelButton","Platform","OS","leftAlign","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/block-switcher/block-transformations-menu.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { findNodeHandle, Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { switchToBlockType } from '@wordpress/blocks';\nimport { Picker } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst BlockTransformationsMenu = ( {\n\tanchorNodeRef,\n\tblockTitle,\n\tpickerRef,\n\tpossibleTransformations,\n\tselectedBlock,\n\tselectedBlockClientId,\n} ) => {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pickerOptions = () => {\n\t\tconst selectedBlockName = selectedBlock?.name ?? '';\n\t\tconst blocksThatSplitWhenTransformed = {\n\t\t\t'core/list': [ 'core/paragraph', 'core/heading' ],\n\t\t\t'core/quote': [ 'core/paragraph' ],\n\t\t\t'core/pullquote': [ 'core/paragraph' ],\n\t\t};\n\n\t\treturn possibleTransformations.map( ( item ) => {\n\t\t\tconst label =\n\t\t\t\tselectedBlockName.length &&\n\t\t\t\tblocksThatSplitWhenTransformed[ selectedBlockName ] &&\n\t\t\t\tblocksThatSplitWhenTransformed[ selectedBlockName ].includes(\n\t\t\t\t\titem.id\n\t\t\t\t)\n\t\t\t\t\t? `${ item.title } blocks`\n\t\t\t\t\t: item.title;\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tvalue: item.id,\n\t\t\t};\n\t\t} );\n\t};\n\n\tconst getAnchor = () =>\n\t\tanchorNodeRef ? findNodeHandle( anchorNodeRef ) : undefined;\n\n\tfunction onPickerSelect( value ) {\n\t\treplaceBlocks(\n\t\t\tselectedBlockClientId,\n\t\t\tswitchToBlockType( selectedBlock, value )\n\t\t);\n\n\t\tconst selectedItem = pickerOptions().find(\n\t\t\t( item ) => item.value === value\n\t\t);\n\t\tconst successNotice = sprintf(\n\t\t\t/* translators: 1: From block title, e.g. Paragraph. 2: To block title, e.g. Header. */\n\t\t\t__( '%1$s transformed to %2$s' ),\n\t\t\tblockTitle,\n\t\t\tselectedItem.label\n\t\t);\n\t\tcreateSuccessNotice( successNotice );\n\t}\n\n\treturn (\n\t\t<Picker\n\t\t\ttestID=\"block-transformations-menu\"\n\t\t\tref={ pickerRef }\n\t\t\toptions={ pickerOptions() }\n\t\t\tonChange={ onPickerSelect }\n\t\t\thideCancelButton={ Platform.OS !== 'ios' }\n\t\t\tleftAlign\n\t\t\tgetAnchor={ getAnchor }\n\t\t\t// translators: %s: block title e.g: \"Paragraph\".\n\t\t\ttitle={ sprintf( __( 'Transform %s to' ), blockTitle ) }\n\t\t/>\n\t);\n};\n\nexport default BlockTransformationsMenu;\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAwD,IAAAO,WAAA,GAAAP,OAAA;AAjBxD;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAMQ,wBAAwB,GAAGA,CAAE;EAClCC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,uBAAuB;EACvBC,aAAa;EACbC;AACD,CAAC,KAAM;EACN,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEC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ChC,UAAU,EACV4B,YAAY,CAACX,KACd,CAAC;IACDT,mBAAmB,CAAEsB,aAAc,CAAC;EACrC;EAEA,oBACC,IAAAjC,WAAA,CAAAoC,GAAA,EAACxC,WAAA,CAAAyC,MAAM;IACNC,MAAM,EAAC,4BAA4B;IACnCC,GAAG,EAAGnC,SAAW;IACjBoC,OAAO,EAAG3B,aAAa,CAAC,CAAG;IAC3B4B,QAAQ,EAAGZ,cAAgB;IAC3Ba,gBAAgB,EAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAO;IAC1CC,SAAS;IACTnB,SAAS,EAAGA;IACZ;IAAA;IACAF,KAAK,EAAG,IAAAU,aAAO,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC,EAAEhC,UAAW;EAAG,CACxD,CAAC;AAEJ,CAAC;AAAC,IAAA2C,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa/C,wBAAwB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -239,7 +240,7 @@ const BlockSwitcher = ({
239
240
  })
240
241
  });
241
242
  }
242
- const blockSwitcherDescription = isSingleBlock ? (0, _i18n.__)('Change block type or style') : (0, _i18n.sprintf)( /* translators: %d: number of blocks. */
243
+ const blockSwitcherDescription = isSingleBlock ? (0, _i18n.__)('Change block type or style') : (0, _i18n.sprintf)(/* translators: %d: number of blocks. */
243
244
  (0, _i18n._n)('Change type of %d block', 'Change type of %d blocks', clientIds.length), clientIds.length);
244
245
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
245
246
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarItem, {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_blocks2","_data","_icons","_store","_blockIcon","_interopRequireDefault","_blockTransformationsMenu","_blockVariationTransformations","_blockStylesMenu","_patternTransformationsMenu","_useBlockDisplayTitle","_jsxRuntime","BlockSwitcherDropdownMenuContents","onClose","clientIds","hasBlockStyles","canRemove","replaceBlocks","multiSelect","updateBlockAttributes","useDispatch","blockEditorStore","possibleBlockTransformations","patterns","blocks","isUsingBindings","useSelect","select","getBlockAttributes","getBlocksByClientId","getBlockRootClientId","getBlockTransformItems","__experimentalGetPatternTransformItems","rootClientId","_blocks","every","clientId","metadata","bindings","blockVariationTransformations","useBlockVariationTransforms","selectForMultipleBlocks","insertedBlocks","length","onBlockTransform","name","newBlocks","switchToBlockType","onBlockVariationTransform","find","variationName","attributes","onPatternTransform","transformedBlocks","isSingleBlock","isTemplate","isTemplatePart","hasPossibleBlockTransformations","hasPossibleBlockVariationTransformations","hasPatternTransformation","hasBlockOrBlockVariationTransforms","hasContents","jsx","className","children","__","connectedBlockDescription","_x","jsxs","default","onSelect","possibleBlockVariationTransformations","onSelectVariation","hoveredBlock","onSwitch","MenuGroup","__experimentalText","BlockIndicator","icon","showTitle","blockTitle","Fragment","showColors","BlockSwitcher","hasContentOnlyLocking","invalidBlocks","isReusable","isDisabled","getTemplateLock","canRemoveBlocks","getBlockEditingMode","getBlockStyles","getBlockType","getActiveBlockVariation","blocksStore","some","block","firstBlockName","_isSingleBlockSelected","blockType","editingMode","_icon","_hasTemplateLock","match","isSelectionOfSameType","Set","map","size","id","copy","isReusableBlock","useBlockDisplayTitle","maximumLength","blockSwitcherLabel","hideDropdown","ToolbarGroup","ToolbarButton","disabled","title","blockSwitcherDescription","sprintf","_n","ToolbarItem","toggleProps","DropdownMenu","label","popoverProps","placement","description","menuProps","orientation","exports","_default"],"sources":["@wordpress/block-editor/src/components/block-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, _x } from '@wordpress/i18n';\nimport {\n\tDropdownMenu,\n\tToolbarButton,\n\tToolbarGroup,\n\tToolbarItem,\n\t__experimentalText as Text,\n\tMenuGroup,\n} from '@wordpress/components';\nimport {\n\tswitchToBlockType,\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { copy } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\nimport BlockTransformationsMenu from './block-transformations-menu';\nimport { useBlockVariationTransforms } from './block-variation-transformations';\nimport BlockStylesMenu from './block-styles-menu';\nimport PatternTransformationsMenu from './pattern-transformations-menu';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\n\nfunction BlockSwitcherDropdownMenuContents( {\n\tonClose,\n\tclientIds,\n\thasBlockStyles,\n\tcanRemove,\n} ) {\n\tconst { replaceBlocks, multiSelect, updateBlockAttributes } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { possibleBlockTransformations, patterns, blocks, isUsingBindings } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockAttributes,\n\t\t\t\t\tgetBlocksByClientId,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockTransformItems,\n\t\t\t\t\t__experimentalGetPatternTransformItems,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\t\treturn {\n\t\t\t\t\tblocks: _blocks,\n\t\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tpatterns: __experimentalGetPatternTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tisUsingBindings: clientIds.every(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\t!! getBlockAttributes( clientId )?.metadata\n\t\t\t\t\t\t\t\t?.bindings\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds ]\n\t\t);\n\tconst blockVariationTransformations = useBlockVariationTransforms( {\n\t\tclientIds,\n\t\tblocks,\n\t} );\n\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\tmultiSelect(\n\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\t}\n\t// Simple block tranformation based on the `Block Transforms` API.\n\tfunction onBlockTransform( name ) {\n\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\treplaceBlocks( clientIds, newBlocks );\n\t\tselectForMultipleBlocks( newBlocks );\n\t}\n\tfunction onBlockVariationTransform( name ) {\n\t\tupdateBlockAttributes( blocks[ 0 ].clientId, {\n\t\t\t...blockVariationTransformations.find(\n\t\t\t\t( { name: variationName } ) => variationName === name\n\t\t\t).attributes,\n\t\t} );\n\t}\n\t// Pattern transformation through the `Patterns` API.\n\tfunction onPatternTransform( transformedBlocks ) {\n\t\treplaceBlocks( clientIds, transformedBlocks );\n\t\tselectForMultipleBlocks( transformedBlocks );\n\t}\n\t/**\n\t * The `isTemplate` check is a stopgap solution here.\n\t * Ideally, the Transforms API should handle this\n\t * by allowing to exclude blocks from wildcard transformations.\n\t */\n\tconst isSingleBlock = blocks.length === 1;\n\tconst isTemplate = isSingleBlock && isTemplatePart( blocks[ 0 ] );\n\tconst hasPossibleBlockTransformations =\n\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\tconst hasPossibleBlockVariationTransformations =\n\t\t!! blockVariationTransformations?.length;\n\tconst hasPatternTransformation = !! patterns?.length && canRemove;\n\tconst hasBlockOrBlockVariationTransforms =\n\t\thasPossibleBlockTransformations ||\n\t\thasPossibleBlockVariationTransformations;\n\tconst hasContents =\n\t\thasBlockStyles ||\n\t\thasBlockOrBlockVariationTransforms ||\n\t\thasPatternTransformation;\n\tif ( ! hasContents ) {\n\t\treturn (\n\t\t\t<p className=\"block-editor-block-switcher__no-transforms\">\n\t\t\t\t{ __( 'No transforms.' ) }\n\t\t\t</p>\n\t\t);\n\t}\n\n\tconst connectedBlockDescription = isSingleBlock\n\t\t? _x(\n\t\t\t\t'This block is connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t )\n\t\t: _x(\n\t\t\t\t'These blocks are connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t );\n\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__container\">\n\t\t\t{ hasPatternTransformation && (\n\t\t\t\t<PatternTransformationsMenu\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonSelect={ ( transformedBlocks ) => {\n\t\t\t\t\t\tonPatternTransform( transformedBlocks );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockOrBlockVariationTransforms && (\n\t\t\t\t<BlockTransformationsMenu\n\t\t\t\t\tclassName=\"block-editor-block-switcher__transforms__menugroup\"\n\t\t\t\t\tpossibleBlockTransformations={\n\t\t\t\t\t\tpossibleBlockTransformations\n\t\t\t\t\t}\n\t\t\t\t\tpossibleBlockVariationTransformations={\n\t\t\t\t\t\tblockVariationTransformations\n\t\t\t\t\t}\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tonSelect={ ( name ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\tonSelectVariation={ ( name ) => {\n\t\t\t\t\t\tonBlockVariationTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockStyles && (\n\t\t\t\t<BlockStylesMenu\n\t\t\t\t\thoveredBlock={ blocks[ 0 ] }\n\t\t\t\t\tonSwitch={ onClose }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isUsingBindings && (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t<Text className=\"block-editor-block-switcher__binding-indicator\">\n\t\t\t\t\t\t{ connectedBlockDescription }\n\t\t\t\t\t</Text>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nconst BlockIndicator = ( { icon, showTitle, blockTitle } ) => (\n\t<>\n\t\t<BlockIcon\n\t\t\tclassName=\"block-editor-block-switcher__toggle\"\n\t\t\ticon={ icon }\n\t\t\tshowColors\n\t\t/>\n\t\t{ showTitle && blockTitle && (\n\t\t\t<span className=\"block-editor-block-switcher__toggle-text\">\n\t\t\t\t{ blockTitle }\n\t\t\t</span>\n\t\t) }\n\t</>\n);\n\nexport const BlockSwitcher = ( { clientIds } ) => {\n\tconst {\n\t\thasContentOnlyLocking,\n\t\tcanRemove,\n\t\thasBlockStyles,\n\t\ticon,\n\t\tinvalidBlocks,\n\t\tisReusable,\n\t\tisTemplate,\n\t\tisDisabled,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockStyles, getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\tif ( ! _blocks.length || _blocks.some( ( block ) => ! block ) ) {\n\t\t\t\treturn { invalidBlocks: true };\n\t\t\t}\n\t\t\tconst [ { name: firstBlockName } ] = _blocks;\n\t\t\tconst _isSingleBlockSelected = _blocks.length === 1;\n\t\t\tconst blockType = getBlockType( firstBlockName );\n\t\t\tconst editingMode = getBlockEditingMode( clientIds[ 0 ] );\n\n\t\t\tlet _icon;\n\t\t\tlet _hasTemplateLock;\n\t\t\tif ( _isSingleBlockSelected ) {\n\t\t\t\tconst match = getActiveBlockVariation(\n\t\t\t\t\tfirstBlockName,\n\t\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t\t);\n\t\t\t\t// Take into account active block variations.\n\t\t\t\t_icon = match?.icon || blockType.icon;\n\t\t\t\t_hasTemplateLock =\n\t\t\t\t\tgetTemplateLock( clientIds[ 0 ] ) === 'contentOnly';\n\t\t\t} else {\n\t\t\t\tconst isSelectionOfSameType =\n\t\t\t\t\tnew Set( _blocks.map( ( { name } ) => name ) ).size === 1;\n\t\t\t\t_hasTemplateLock = clientIds.some(\n\t\t\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t\t// When selection consists of blocks of multiple types, display an\n\t\t\t\t// appropriate icon to communicate the non-uniformity.\n\t\t\t\t_icon = isSelectionOfSameType ? blockType.icon : copy;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcanRemove: canRemoveBlocks( clientIds ),\n\t\t\t\thasBlockStyles:\n\t\t\t\t\t_isSingleBlockSelected &&\n\t\t\t\t\t!! getBlockStyles( firstBlockName )?.length,\n\t\t\t\ticon: _icon,\n\t\t\t\tisReusable:\n\t\t\t\t\t_isSingleBlockSelected && isReusableBlock( _blocks[ 0 ] ),\n\t\t\t\tisTemplate:\n\t\t\t\t\t_isSingleBlockSelected && isTemplatePart( _blocks[ 0 ] ),\n\t\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t\t\tisDisabled: editingMode !== 'default',\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: clientIds?.[ 0 ],\n\t\tmaximumLength: 35,\n\t} );\n\n\tif ( invalidBlocks ) {\n\t\treturn null;\n\t}\n\n\tconst isSingleBlock = clientIds.length === 1;\n\tconst blockSwitcherLabel = isSingleBlock\n\t\t? blockTitle\n\t\t: __( 'Multiple blocks selected' );\n\n\tconst hideDropdown =\n\t\tisDisabled ||\n\t\t( ! hasBlockStyles && ! canRemove ) ||\n\t\thasContentOnlyLocking;\n\n\tif ( hideDropdown ) {\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tdisabled\n\t\t\t\t\tclassName=\"block-editor-block-switcher__no-switcher-icon\"\n\t\t\t\t\ttitle={ blockSwitcherLabel }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BlockIndicator\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tshowTitle={ isReusable || isTemplate }\n\t\t\t\t\t\t\tblockTitle={ blockTitle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t}\n\n\tconst blockSwitcherDescription = isSingleBlock\n\t\t? __( 'Change block type or style' )\n\t\t: sprintf(\n\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'Change type of %d block',\n\t\t\t\t\t'Change type of %d blocks',\n\t\t\t\t\tclientIds.length\n\t\t\t\t),\n\t\t\t\tclientIds.length\n\t\t );\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\tclassName=\"block-editor-block-switcher\"\n\t\t\t\t\t\tlabel={ blockSwitcherLabel }\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\t\tclassName: 'block-editor-block-switcher__popover',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIndicator\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tshowTitle={ isReusable || isTemplate }\n\t\t\t\t\t\t\t\tblockTitle={ blockTitle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tdescription: blockSwitcherDescription,\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmenuProps={ { orientation: 'both' } }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<BlockSwitcherDropdownMenuContents\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\t\t\tcanRemove={ canRemove }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n};\n\nexport default BlockSwitcher;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,yBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,8BAAA,GAAAT,OAAA;AACA,IAAAU,gBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,2BAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,qBAAA,GAAAL,sBAAA,CAAAP,OAAA;AAA0E,IAAAa,WAAA,GAAAb,OAAA;AA9B1E;AACA;AACA;;AAmBA;AACA;AACA;;AASA,SAASc,iCAAiCA,CAAE;EAC3CC,OAAO;EACPC,SAAS;EACTC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,aAAa;IAAEC,WAAW;IAAEC;EAAsB,CAAC,GAC1D,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAChC,MAAM;IAAEC,4BAA4B;IA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,WAAW;MAAA1D,QAAA,EACP2D,WAAW,iBACd,IAAAhH,WAAA,CAAAmD,GAAA,EAAC/D,WAAA,CAAA6H,YAAY;QACZ7D,SAAS,EAAC,6BAA6B;QACvC8D,KAAK,EAAGZ,kBAAoB;QAC5Ba,YAAY,EAAG;UACdC,SAAS,EAAE,cAAc;UACzBhE,SAAS,EAAE;QACZ,CAAG;QACHe,IAAI,eACH,IAAAnE,WAAA,CAAAmD,GAAA,EAACe,cAAc;UACdC,IAAI,EAAGA,IAAM;UACbC,SAAS,EAAGO,UAAU,IAAI/B,UAAY;UACtCyB,UAAU,EAAGA;QAAY,CACzB,CACD;QACD2C,WAAW,EAAG;UACbK,WAAW,EAAET,wBAAwB;UACrC,GAAGI;QACJ,CAAG;QACHM,SAAS,EAAG;UAAEC,WAAW,EAAE;QAAO,CAAG;QAAAlE,QAAA,EAEnCA,CAAE;UAAEnD;QAAQ,CAAC,kBACd,IAAAF,WAAA,CAAAmD,GAAA,EAAClD,iCAAiC;UACjCC,OAAO,EAAGA,OAAS;UACnBC,SAAS,EAAGA,SAAW;UACvBC,cAAc,EAAGA,cAAgB;UACjCC,SAAS,EAAGA;QAAW,CACvB;MACD,CACY;IACd,CACW;EAAC,CACD,CAAC;AAEjB,CAAC;AAACmH,OAAA,CAAAhD,aAAA,GAAAA,aAAA;AAAA,IAAAiD,QAAA,GAAAD,OAAA,CAAA9D,OAAA,GAEac,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_blocks2","_data","_icons","_store","_blockIcon","_interopRequireDefault","_blockTransformationsMenu","_blockVariationTransformations","_blockStylesMenu","_patternTransformationsMenu","_useBlockDisplayTitle","_jsxRuntime","BlockSwitcherDropdownMenuContents","onClose","clientIds","hasBlockStyles","canRemove","replaceBlocks","multiSelect","updateBlockAttributes","useDispatch","blockEditorStore","possibleBlockTransformations","patterns","blocks","isUsingBindings","useSelect","select","getBlockAttributes","getBlocksByClientId","getBlockRootClientId","getBlockTransformItems","__experimentalGetPatternTransformItems","rootClientId","_blocks","every","clientId","metadata","bindings","blockVariationTransformations","useBlockVariationTransforms","selectForMultipleBlocks","insertedBlocks","length","onBlockTransform","name","newBlocks","switchToBlockType","onBlockVariationTransform","find","variationName","attributes","onPatternTransform","transformedBlocks","isSingleBlock","isTemplate","isTemplatePart","hasPossibleBlockTransformations","hasPossibleBlockVariationTransformations","hasPatternTransformation","hasBlockOrBlockVariationTransforms","hasContents","jsx","className","children","__","connectedBlockDescription","_x","jsxs","default","onSelect","possibleBlockVariationTransformations","onSelectVariation","hoveredBlock","onSwitch","MenuGroup","__experimentalText","BlockIndicator","icon","showTitle","blockTitle","Fragment","showColors","BlockSwitcher","hasContentOnlyLocking","invalidBlocks","isReusable","isDisabled","getTemplateLock","canRemoveBlocks","getBlockEditingMode","getBlockStyles","getBlockType","getActiveBlockVariation","blocksStore","some","block","firstBlockName","_isSingleBlockSelected","blockType","editingMode","_icon","_hasTemplateLock","match","isSelectionOfSameType","Set","map","size","id","copy","isReusableBlock","useBlockDisplayTitle","maximumLength","blockSwitcherLabel","hideDropdown","ToolbarGroup","ToolbarButton","disabled","title","blockSwitcherDescription","sprintf","_n","ToolbarItem","toggleProps","DropdownMenu","label","popoverProps","placement","description","menuProps","orientation","exports","_default"],"sources":["@wordpress/block-editor/src/components/block-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf, _x } from '@wordpress/i18n';\nimport {\n\tDropdownMenu,\n\tToolbarButton,\n\tToolbarGroup,\n\tToolbarItem,\n\t__experimentalText as Text,\n\tMenuGroup,\n} from '@wordpress/components';\nimport {\n\tswitchToBlockType,\n\tstore as blocksStore,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { copy } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport BlockIcon from '../block-icon';\nimport BlockTransformationsMenu from './block-transformations-menu';\nimport { useBlockVariationTransforms } from './block-variation-transformations';\nimport BlockStylesMenu from './block-styles-menu';\nimport PatternTransformationsMenu from './pattern-transformations-menu';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\n\nfunction BlockSwitcherDropdownMenuContents( {\n\tonClose,\n\tclientIds,\n\thasBlockStyles,\n\tcanRemove,\n} ) {\n\tconst { replaceBlocks, multiSelect, updateBlockAttributes } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { possibleBlockTransformations, patterns, blocks, isUsingBindings } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockAttributes,\n\t\t\t\t\tgetBlocksByClientId,\n\t\t\t\t\tgetBlockRootClientId,\n\t\t\t\t\tgetBlockTransformItems,\n\t\t\t\t\t__experimentalGetPatternTransformItems,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\t\treturn {\n\t\t\t\t\tblocks: _blocks,\n\t\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tpatterns: __experimentalGetPatternTransformItems(\n\t\t\t\t\t\t_blocks,\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\t\tisUsingBindings: clientIds.every(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\t!! getBlockAttributes( clientId )?.metadata\n\t\t\t\t\t\t\t\t?.bindings\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientIds ]\n\t\t);\n\tconst blockVariationTransformations = useBlockVariationTransforms( {\n\t\tclientIds,\n\t\tblocks,\n\t} );\n\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\tmultiSelect(\n\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\t}\n\t// Simple block tranformation based on the `Block Transforms` API.\n\tfunction onBlockTransform( name ) {\n\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\treplaceBlocks( clientIds, newBlocks );\n\t\tselectForMultipleBlocks( newBlocks );\n\t}\n\tfunction onBlockVariationTransform( name ) {\n\t\tupdateBlockAttributes( blocks[ 0 ].clientId, {\n\t\t\t...blockVariationTransformations.find(\n\t\t\t\t( { name: variationName } ) => variationName === name\n\t\t\t).attributes,\n\t\t} );\n\t}\n\t// Pattern transformation through the `Patterns` API.\n\tfunction onPatternTransform( transformedBlocks ) {\n\t\treplaceBlocks( clientIds, transformedBlocks );\n\t\tselectForMultipleBlocks( transformedBlocks );\n\t}\n\t/**\n\t * The `isTemplate` check is a stopgap solution here.\n\t * Ideally, the Transforms API should handle this\n\t * by allowing to exclude blocks from wildcard transformations.\n\t */\n\tconst isSingleBlock = blocks.length === 1;\n\tconst isTemplate = isSingleBlock && isTemplatePart( blocks[ 0 ] );\n\tconst hasPossibleBlockTransformations =\n\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\tconst hasPossibleBlockVariationTransformations =\n\t\t!! blockVariationTransformations?.length;\n\tconst hasPatternTransformation = !! patterns?.length && canRemove;\n\tconst hasBlockOrBlockVariationTransforms =\n\t\thasPossibleBlockTransformations ||\n\t\thasPossibleBlockVariationTransformations;\n\tconst hasContents =\n\t\thasBlockStyles ||\n\t\thasBlockOrBlockVariationTransforms ||\n\t\thasPatternTransformation;\n\tif ( ! hasContents ) {\n\t\treturn (\n\t\t\t<p className=\"block-editor-block-switcher__no-transforms\">\n\t\t\t\t{ __( 'No transforms.' ) }\n\t\t\t</p>\n\t\t);\n\t}\n\n\tconst connectedBlockDescription = isSingleBlock\n\t\t? _x(\n\t\t\t\t'This block is connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t )\n\t\t: _x(\n\t\t\t\t'These blocks are connected.',\n\t\t\t\t'block toolbar button label and description'\n\t\t );\n\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__container\">\n\t\t\t{ hasPatternTransformation && (\n\t\t\t\t<PatternTransformationsMenu\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonSelect={ ( transformedBlocks ) => {\n\t\t\t\t\t\tonPatternTransform( transformedBlocks );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockOrBlockVariationTransforms && (\n\t\t\t\t<BlockTransformationsMenu\n\t\t\t\t\tclassName=\"block-editor-block-switcher__transforms__menugroup\"\n\t\t\t\t\tpossibleBlockTransformations={\n\t\t\t\t\t\tpossibleBlockTransformations\n\t\t\t\t\t}\n\t\t\t\t\tpossibleBlockVariationTransformations={\n\t\t\t\t\t\tblockVariationTransformations\n\t\t\t\t\t}\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tonSelect={ ( name ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t\tonSelectVariation={ ( name ) => {\n\t\t\t\t\t\tonBlockVariationTransform( name );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasBlockStyles && (\n\t\t\t\t<BlockStylesMenu\n\t\t\t\t\thoveredBlock={ blocks[ 0 ] }\n\t\t\t\t\tonSwitch={ onClose }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isUsingBindings && (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t<Text className=\"block-editor-block-switcher__binding-indicator\">\n\t\t\t\t\t\t{ connectedBlockDescription }\n\t\t\t\t\t</Text>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nconst BlockIndicator = ( { icon, showTitle, blockTitle } ) => (\n\t<>\n\t\t<BlockIcon\n\t\t\tclassName=\"block-editor-block-switcher__toggle\"\n\t\t\ticon={ icon }\n\t\t\tshowColors\n\t\t/>\n\t\t{ showTitle && blockTitle && (\n\t\t\t<span className=\"block-editor-block-switcher__toggle-text\">\n\t\t\t\t{ blockTitle }\n\t\t\t</span>\n\t\t) }\n\t</>\n);\n\nexport const BlockSwitcher = ( { clientIds } ) => {\n\tconst {\n\t\thasContentOnlyLocking,\n\t\tcanRemove,\n\t\thasBlockStyles,\n\t\ticon,\n\t\tinvalidBlocks,\n\t\tisReusable,\n\t\tisTemplate,\n\t\tisDisabled,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getBlockStyles, getBlockType, getActiveBlockVariation } =\n\t\t\t\tselect( blocksStore );\n\t\t\tconst _blocks = getBlocksByClientId( clientIds );\n\t\t\tif ( ! _blocks.length || _blocks.some( ( block ) => ! block ) ) {\n\t\t\t\treturn { invalidBlocks: true };\n\t\t\t}\n\t\t\tconst [ { name: firstBlockName } ] = _blocks;\n\t\t\tconst _isSingleBlockSelected = _blocks.length === 1;\n\t\t\tconst blockType = getBlockType( firstBlockName );\n\t\t\tconst editingMode = getBlockEditingMode( clientIds[ 0 ] );\n\n\t\t\tlet _icon;\n\t\t\tlet _hasTemplateLock;\n\t\t\tif ( _isSingleBlockSelected ) {\n\t\t\t\tconst match = getActiveBlockVariation(\n\t\t\t\t\tfirstBlockName,\n\t\t\t\t\tgetBlockAttributes( clientIds[ 0 ] )\n\t\t\t\t);\n\t\t\t\t// Take into account active block variations.\n\t\t\t\t_icon = match?.icon || blockType.icon;\n\t\t\t\t_hasTemplateLock =\n\t\t\t\t\tgetTemplateLock( clientIds[ 0 ] ) === 'contentOnly';\n\t\t\t} else {\n\t\t\t\tconst isSelectionOfSameType =\n\t\t\t\t\tnew Set( _blocks.map( ( { name } ) => name ) ).size === 1;\n\t\t\t\t_hasTemplateLock = clientIds.some(\n\t\t\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t\t// When selection consists of blocks of multiple types, display an\n\t\t\t\t// appropriate icon to communicate the non-uniformity.\n\t\t\t\t_icon = isSelectionOfSameType ? blockType.icon : copy;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcanRemove: canRemoveBlocks( clientIds ),\n\t\t\t\thasBlockStyles:\n\t\t\t\t\t_isSingleBlockSelected &&\n\t\t\t\t\t!! getBlockStyles( firstBlockName )?.length,\n\t\t\t\ticon: _icon,\n\t\t\t\tisReusable:\n\t\t\t\t\t_isSingleBlockSelected && isReusableBlock( _blocks[ 0 ] ),\n\t\t\t\tisTemplate:\n\t\t\t\t\t_isSingleBlockSelected && isTemplatePart( _blocks[ 0 ] ),\n\t\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t\t\tisDisabled: editingMode !== 'default',\n\t\t\t};\n\t\t},\n\t\t[ clientIds ]\n\t);\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: clientIds?.[ 0 ],\n\t\tmaximumLength: 35,\n\t} );\n\n\tif ( invalidBlocks ) {\n\t\treturn null;\n\t}\n\n\tconst isSingleBlock = clientIds.length === 1;\n\tconst blockSwitcherLabel = isSingleBlock\n\t\t? blockTitle\n\t\t: __( 'Multiple blocks selected' );\n\n\tconst hideDropdown =\n\t\tisDisabled ||\n\t\t( ! hasBlockStyles && ! canRemove ) ||\n\t\thasContentOnlyLocking;\n\n\tif ( hideDropdown ) {\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tdisabled\n\t\t\t\t\tclassName=\"block-editor-block-switcher__no-switcher-icon\"\n\t\t\t\t\ttitle={ blockSwitcherLabel }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BlockIndicator\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tshowTitle={ isReusable || isTemplate }\n\t\t\t\t\t\t\tblockTitle={ blockTitle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t}\n\n\tconst blockSwitcherDescription = isSingleBlock\n\t\t? __( 'Change block type or style' )\n\t\t: sprintf(\n\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'Change type of %d block',\n\t\t\t\t\t'Change type of %d blocks',\n\t\t\t\t\tclientIds.length\n\t\t\t\t),\n\t\t\t\tclientIds.length\n\t\t );\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarItem>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\tclassName=\"block-editor-block-switcher\"\n\t\t\t\t\t\tlabel={ blockSwitcherLabel }\n\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\t\tclassName: 'block-editor-block-switcher__popover',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t<BlockIndicator\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tshowTitle={ isReusable || isTemplate }\n\t\t\t\t\t\t\t\tblockTitle={ blockTitle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tdescription: blockSwitcherDescription,\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tmenuProps={ { orientation: 'both' } }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<BlockSwitcherDropdownMenuContents\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\t\t\tcanRemove={ canRemove }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t</ToolbarGroup>\n\t);\n};\n\nexport default BlockSwitcher;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,yBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,8BAAA,GAAAT,OAAA;AACA,IAAAU,gBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,2BAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,qBAAA,GAAAL,sBAAA,CAAAP,OAAA;AAA0E,IAAAa,WAAA,GAAAb,OAAA;AA9B1E;AACA;AACA;;AAmBA;AACA;AACA;;AASA,SAASc,iCAAiCA,CAAE;EAC3CC,OAAO;EACPC,SAAS;EACTC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,aAAa;IAAEC,WAAW;IAAEC;EAAsB,CAAC,GAC1D,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAChC,MAAM;IAAEC,4BAA4B;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAAgB,CAAC,GACxE,IAAAC,eAAS,EACNC,MAAM,IAAM;IACb,MAAM;MACLC,kBAAkB;MAClBC,mBAAmB;MACnBC,oBAAoB;MACpBC,sBAAsB;MACtBC;IACD,CAAC,GAAGL,MAAM,CAAEN,YAAiB,CAAC;IA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hE,SAAS,EAAE;QACZ,CAAG;QACHe,IAAI,eACH,IAAAnE,WAAA,CAAAmD,GAAA,EAACe,cAAc;UACdC,IAAI,EAAGA,IAAM;UACbC,SAAS,EAAGO,UAAU,IAAI/B,UAAY;UACtCyB,UAAU,EAAGA;QAAY,CACzB,CACD;QACD2C,WAAW,EAAG;UACbK,WAAW,EAAET,wBAAwB;UACrC,GAAGI;QACJ,CAAG;QACHM,SAAS,EAAG;UAAEC,WAAW,EAAE;QAAO,CAAG;QAAAlE,QAAA,EAEnCA,CAAE;UAAEnD;QAAQ,CAAC,kBACd,IAAAF,WAAA,CAAAmD,GAAA,EAAClD,iCAAiC;UACjCC,OAAO,EAAGA,OAAS;UACnBC,SAAS,EAAGA,SAAW;UACvBC,cAAc,EAAGA,cAAgB;UACjCC,SAAS,EAAGA;QAAW,CACvB;MACD,CACY;IACd,CACW;EAAC,CACD,CAAC;AAEjB,CAAC;AAACmH,OAAA,CAAAhD,aAAA,GAAAA,aAAA;AAAA,IAAAiD,QAAA,GAAAD,OAAA,CAAA9D,OAAA,GAEac,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_compose","_icons","_components","_blockPreview","_interopRequireDefault","_useTransformedPatterns","_jsxRuntime","PatternTransformationsMenu","blocks","patterns","statePatterns","onSelect","showTransforms","setShowTransforms","useState","useTransformedPatterns","length","jsxs","MenuGroup","className","children","jsx","PreviewPatternsPopover","MenuItem","onClick","event","preventDefault","icon","chevronRight","__","isMobile","useViewportMatch","Popover","placement","offset","BlockPatternsList","Composite","role","map","pattern","BlockPattern","name","baseClassName","descriptionId","useInstanceId","Item","render","title","description","undefined","transformedBlocks","default","viewportWidth","VisuallyHidden","id","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-switcher/pattern-transformations-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { chevronRight } from '@wordpress/icons';\n\nimport {\n\tComposite,\n\tMenuGroup,\n\tMenuItem,\n\tPopover,\n\tVisuallyHidden,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\nimport useTransformedPatterns from './use-transformed-patterns';\n\nfunction PatternTransformationsMenu( {\n\tblocks,\n\tpatterns: statePatterns,\n\tonSelect,\n} ) {\n\tconst [ showTransforms, setShowTransforms ] = useState( false );\n\tconst patterns = useTransformedPatterns( statePatterns, blocks );\n\n\tif ( ! patterns.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup className=\"block-editor-block-switcher__pattern__transforms__menugroup\">\n\t\t\t{ showTransforms && (\n\t\t\t\t<PreviewPatternsPopover\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<MenuItem\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetShowTransforms( ! showTransforms );\n\t\t\t\t} }\n\t\t\t\ticon={ chevronRight }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</MenuItem>\n\t\t</MenuGroup>\n\t);\n}\n\nfunction PreviewPatternsPopover( { patterns, onSelect } ) {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__popover-preview-container\">\n\t\t\t<Popover\n\t\t\t\tclassName=\"block-editor-block-switcher__popover-preview\"\n\t\t\t\tplacement={ isMobile ? 'bottom' : 'right-start' }\n\t\t\t\toffset={ 16 }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-block-switcher__preview is-pattern-list-preview\">\n\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternsList( { patterns, onSelect } ) {\n\treturn (\n\t\t<Composite\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-switcher__preview-patterns-container\"\n\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t>\n\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t<BlockPattern\n\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nfunction BlockPattern( { pattern, onSelect } ) {\n\t// TODO check pattern/preview width...\n\tconst baseClassName =\n\t\t'block-editor-block-switcher__preview-patterns-container';\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }-list__item-description`\n\t);\n\treturn (\n\t\t<div className={ `${ baseClassName }-list__list-item` }>\n\t\t\t<Composite.Item\n\t\t\t\trender={\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\tpattern.description ? descriptionId : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName={ `${ baseClassName }-list__item` }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonClick={ () => onSelect( pattern.transformedBlocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ pattern.transformedBlocks }\n\t\t\t\t\tviewportWidth={ pattern.viewportWidth || 500 }\n\t\t\t\t/>\n\t\t\t\t<div className={ `${ baseClassName }-list__item-title` }>\n\t\t\t\t\t{ pattern.title }\n\t\t\t\t</div>\n\t\t\t</Composite.Item>\n\t\t\t{ !! pattern.description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ pattern.description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default Pattern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EACD,oBACC,IAAApC,WAAA,CAAAW,IAAA;IAAKE,SAAS,EAAI,GAAGuB,aAAe,kBAAmB;IAAAtB,QAAA,gBACtD,IAAAd,WAAA,CAAAW,IAAA,EAACf,WAAA,CAAAkC,SAAS,CAACS,IAAI;MACdC,MAAM,eACL,IAAAxC,WAAA,CAAAe,GAAA;QACCgB,IAAI,EAAC,QAAQ;QACb,cAAaE,OAAO,CAACQ,KAAO;QAC5B,oBACCR,OAAO,CAACS,WAAW,GAAGL,aAAa,GAAGM,SACtC;QACD9B,SAAS,EAAI,GAAGuB,aAAe;MAAc,CAC7C,CACD;MACDlB,OAAO,EAAGA,CAAA,KAAMb,QAAQ,CAAE4B,OAAO,CAACW,iBAAkB,CAAG;MAAA9B,QAAA,gBAEvD,IAAAd,WAAA,CAAAe,GAAA,EAAClB,aAAA,CAAAgD,OAAY;QACZ3C,MAAM,EAAG+B,OAAO,CAACW,iBAAmB;QACpCE,aAAa,EAAGb,OAAO,CAACa,aAAa,IAAI;MAAK,CAC9C,CAAC,eACF,IAAA9C,WAAA,CAAAe,GAAA;QAAKF,SAAS,EAAI,GAAGuB,aAAe,mBAAoB;QAAAtB,QAAA,EACrDmB,OAAO,CAACQ;MAAK,CACX,CAAC;IAAA,CACS,CAAC,EACf,CAAC,CAAER,OAAO,CAACS,WAAW,iBACvB,IAAA1C,WAAA,CAAAe,GAAA,EAACnB,WAAA,CAAAmD,cAAc;MAACC,EAAE,EAAGX,aAAe;MAAAvB,QAAA,EACjCmB,OAAO,CAACS;IAAW,CACN,CAChB;EAAA,CACG,CAAC;AAER;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEc5C,0BAA0B","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_compose","_icons","_components","_blockPreview","_interopRequireDefault","_useTransformedPatterns","_jsxRuntime","PatternTransformationsMenu","blocks","patterns","statePatterns","onSelect","showTransforms","setShowTransforms","useState","useTransformedPatterns","length","jsxs","MenuGroup","className","children","jsx","PreviewPatternsPopover","MenuItem","onClick","event","preventDefault","icon","chevronRight","__","isMobile","useViewportMatch","Popover","placement","offset","BlockPatternsList","Composite","role","map","pattern","BlockPattern","name","baseClassName","descriptionId","useInstanceId","Item","render","title","description","undefined","transformedBlocks","default","viewportWidth","VisuallyHidden","id","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-switcher/pattern-transformations-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { chevronRight } from '@wordpress/icons';\n\nimport {\n\tComposite,\n\tMenuGroup,\n\tMenuItem,\n\tPopover,\n\tVisuallyHidden,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockPreview from '../block-preview';\nimport useTransformedPatterns from './use-transformed-patterns';\n\nfunction PatternTransformationsMenu( {\n\tblocks,\n\tpatterns: statePatterns,\n\tonSelect,\n} ) {\n\tconst [ showTransforms, setShowTransforms ] = useState( false );\n\tconst patterns = useTransformedPatterns( statePatterns, blocks );\n\n\tif ( ! patterns.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup className=\"block-editor-block-switcher__pattern__transforms__menugroup\">\n\t\t\t{ showTransforms && (\n\t\t\t\t<PreviewPatternsPopover\n\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<MenuItem\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tsetShowTransforms( ! showTransforms );\n\t\t\t\t} }\n\t\t\t\ticon={ chevronRight }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</MenuItem>\n\t\t</MenuGroup>\n\t);\n}\n\nfunction PreviewPatternsPopover( { patterns, onSelect } ) {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\n\treturn (\n\t\t<div className=\"block-editor-block-switcher__popover-preview-container\">\n\t\t\t<Popover\n\t\t\t\tclassName=\"block-editor-block-switcher__popover-preview\"\n\t\t\t\tplacement={ isMobile ? 'bottom' : 'right-start' }\n\t\t\t\toffset={ 16 }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-block-switcher__preview is-pattern-list-preview\">\n\t\t\t\t\t<BlockPatternsList\n\t\t\t\t\t\tpatterns={ patterns }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t</div>\n\t);\n}\n\nfunction BlockPatternsList( { patterns, onSelect } ) {\n\treturn (\n\t\t<Composite\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-block-switcher__preview-patterns-container\"\n\t\t\taria-label={ __( 'Patterns list' ) }\n\t\t>\n\t\t\t{ patterns.map( ( pattern ) => (\n\t\t\t\t<BlockPattern\n\t\t\t\t\tkey={ pattern.name }\n\t\t\t\t\tpattern={ pattern }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nfunction BlockPattern( { pattern, onSelect } ) {\n\t// TODO check pattern/preview width...\n\tconst baseClassName =\n\t\t'block-editor-block-switcher__preview-patterns-container';\n\tconst descriptionId = useInstanceId(\n\t\tBlockPattern,\n\t\t`${ baseClassName }-list__item-description`\n\t);\n\treturn (\n\t\t<div className={ `${ baseClassName }-list__list-item` }>\n\t\t\t<Composite.Item\n\t\t\t\trender={\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-label={ pattern.title }\n\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\tpattern.description ? descriptionId : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName={ `${ baseClassName }-list__item` }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonClick={ () => onSelect( pattern.transformedBlocks ) }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ pattern.transformedBlocks }\n\t\t\t\t\tviewportWidth={ pattern.viewportWidth || 500 }\n\t\t\t\t/>\n\t\t\t\t<div className={ `${ baseClassName }-list__item-title` }>\n\t\t\t\t\t{ pattern.title }\n\t\t\t\t</div>\n\t\t\t</Composite.Item>\n\t\t\t{ !! pattern.description && (\n\t\t\t\t<VisuallyHidden id={ descriptionId }>\n\t\t\t\t\t{ pattern.description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default PatternTransformationsMenu;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AAWA,IAAAK,aAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,uBAAA,GAAAD,sBAAA,CAAAN,OAAA;AAAgE,IAAAQ,WAAA,GAAAR,OAAA;AApBhE;AACA;AACA;;AAcA;AACA;AACA;;AAIA,SAASS,0BAA0BA,CAAE;EACpCC,MAAM;EACNC,QAAQ,EAAEC,aAAa;EACvBC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAC/D,MAAML,QAAQ,GAAG,IAAAM,+BAAsB,EAAEL,aAAa,EAAEF,MAAO,CAAC;EAEhE,IAAK,CAAEC,QAAQ,CAACO,MAAM,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAV,WAAA,CAAAW,IAAA,EAACf,WAAA,CAAAgB,SAAS;IAACC,SAAS,EAAC,6DAA6D;IAAAC,QAAA,GAC/ER,cAAc,iBACf,IAAAN,WAAA,CAAAe,GAAA,EAACC,sBAAsB;MACtBb,QAAQ,EAAGA,QAAU;MACrBE,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,cAAc;MAACC,EAAE,EAAGX,aAAe;MAAAvB,QAAA,EACjCmB,OAAO,CAACS;IAAW,CACN,CAChB;EAAA,CACG,CAAC;AAER;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAL,OAAA,GAEc5C,0BAA0B","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_blocks","_utils","transformMatchingBlock","match","selectedBlock","retainedBlockAttributes","getRetainedBlockAttributes","name","attributes","exports","getPatternTransformedBlocks","selectedBlocks","patternBlocks","_patternBlocks","map","block","cloneBlock","consumedBlocks","Set","isMatch","patternBlock","getMatchingBlockByName","add","clientId","useTransformedPatterns","patterns","useMemo","reduce","accumulator","_pattern","transformedBlocks","blocks","push","_default","default"],"sources":["@wordpress/block-editor/src/components/block-switcher/use-transformed-patterns.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { cloneBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getMatchingBlockByName, getRetainedBlockAttributes } from './utils';\n\n/**\n * Mutate the matched block's attributes by getting\n * which block type's attributes to retain and prioritize\n * them in the merging of the attributes.\n *\n * @param {WPBlock} match The matched block.\n * @param {WPBlock} selectedBlock The selected block.\n * @return {void}\n */\nexport const transformMatchingBlock = ( match, selectedBlock ) => {\n\t// Get the block attributes to retain through the transformation.\n\tconst retainedBlockAttributes = getRetainedBlockAttributes(\n\t\tselectedBlock.name,\n\t\tselectedBlock.attributes\n\t);\n\tmatch.attributes = {\n\t\t...match.attributes,\n\t\t...retainedBlockAttributes,\n\t};\n};\n\n/**\n * By providing the selected blocks and pattern's blocks\n * find the matching blocks, transform them and return them.\n * If not all selected blocks are matched, return nothing.\n *\n * @param {WPBlock[]} selectedBlocks The selected blocks.\n * @param {WPBlock[]} patternBlocks The pattern's blocks.\n * @return {WPBlock[]|void} The transformed pattern's blocks or undefined if not all selected blocks have been matched.\n */\nexport const getPatternTransformedBlocks = (\n\tselectedBlocks,\n\tpatternBlocks\n) => {\n\t// Clone Pattern's blocks to produce new clientIds and be able to mutate the matches.\n\tconst _patternBlocks = patternBlocks.map( ( block ) =>\n\t\tcloneBlock( block )\n\t);\n\t/**\n\t * Keep track of the consumed pattern blocks.\n\t * This is needed because we loop the selected blocks\n\t * and for example we may have selected two paragraphs and\n\t * the pattern's blocks could have more `paragraphs`.\n\t */\n\tconst consumedBlocks = new Set();\n\tfor ( const selectedBlock of selectedBlocks ) {\n\t\tlet isMatch = false;\n\t\tfor ( const patternBlock of _patternBlocks ) {\n\t\t\tconst match = getMatchingBlockByName(\n\t\t\t\tpatternBlock,\n\t\t\t\tselectedBlock.name,\n\t\t\t\tconsumedBlocks\n\t\t\t);\n\t\t\tif ( ! match ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tisMatch = true;\n\t\t\tconsumedBlocks.add( match.clientId );\n\t\t\t// We update (mutate) the matching pattern block.\n\t\t\ttransformMatchingBlock( match, selectedBlock );\n\t\t\t// No need to loop through other pattern's blocks.\n\t\t\tbreak;\n\t\t}\n\t\t// Bail eary if a selected block has not been matched.\n\t\tif ( ! isMatch ) {\n\t\t\treturn;\n\t\t}\n\t}\n\treturn _patternBlocks;\n};\n\n/**\n * @typedef {WPBlockPattern & {transformedBlocks: WPBlock[]}} TransformedBlockPattern\n */\n\n/**\n * Custom hook that accepts patterns from state and the selected\n * blocks and tries to match these with the pattern's blocks.\n * If all selected blocks are matched with a Pattern's block,\n * we transform them by retaining block's attributes with `role:content`.\n * The transformed pattern's blocks are set to a new pattern\n * property `transformedBlocks`.\n *\n * @param {WPBlockPattern[]} patterns Patterns from state.\n * @param {WPBlock[]} selectedBlocks The currently selected blocks.\n * @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks.\n */\nconst useTransformedPatterns = ( patterns, selectedBlocks ) => {\n\treturn useMemo(\n\t\t() =>\n\t\t\tpatterns.reduce( ( accumulator, _pattern ) => {\n\t\t\t\tconst transformedBlocks = getPatternTransformedBlocks(\n\t\t\t\t\tselectedBlocks,\n\t\t\t\t\t_pattern.blocks\n\t\t\t\t);\n\t\t\t\tif ( transformedBlocks ) {\n\t\t\t\t\taccumulator.push( {\n\t\t\t\t\t\t..._pattern,\n\t\t\t\t\t\ttransformedBlocks,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] ),\n\t\t[ patterns, selectedBlocks ]\n\t);\n};\n\nexport default useTransformedPatterns;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,sBAAsB,GAAGA,CAAEC,KAAK,EAAEC,aAAa,KAAM;EACjE;EACA,MAAMC,uBAAuB,GAAG,IAAAC,iCAA0B,EACzDF,aAAa,CAACG,IAAI,EAClBH,aAAa,CAACI,UACf,CAAC;EACDL,KAAK,CAACK,UAAU,GAAG;IAClB,GAAGL,KAAK,CAACK,UAAU;IACnB,GAAGH;EACJ,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAI,OAAA,CAAAP,sBAAA,GAAAA,sBAAA;AASO,MAAMQ,2BAA2B,GAAGA,CAC1CC,cAAc,EACdC,aAAa,KACT;EACJ;EACA,MAAMC,cAAc,GAAGD,aAAa,CAACE,GAAG,CAAIC,KAAK,IAChD,IAAAC,kBAAU,EAAED,KAAM,CACnB,CAAC;EACD;AACD;AACA;AACA;AACA;AACA;EACC,MAAME,cAAc,GAAG,IAAIC,GAAG,CAAC,CAAC;EAChC,KAAM,MAAMd,aAAa,IAAIO,cAAc,EAAG;IAC7C,IAAIQ,OAAO,GAAG,KAAK;IACnB,KAAM,MAAMC,YAAY,IAAIP,cAAc,EAAG;MAC5C,MAAMV,KAAK,GAAG,IAAAkB,6BAAsB,EACnCD,YAAY,EACZhB,aAAa,CAACG,IAAI,EAClBU,cACD,CAAC;MACD,IAAK,CAAEd,KAAK,EAAG;QACd;MACD;MACAgB,OAAO,GAAG,IAAI;MACdF,cAAc,CAACK,GAAG,CAAEnB,KAAK,CAACoB,QAAS,CAAC;MACpC;MACArB,sBAAsB,CAAEC,KAAK,EAAEC,aAAc,CAAC;MAC9C;MACA;IACD;IACA;IACA,IAAK,CAAEe,OAAO,EAAG;MAChB;IACD;EACD;EACA,OAAON,cAAc;AACtB,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXAJ,OAAA,CAAAC,2BAAA,GAAAA,2BAAA;AAYA,MAAMc,sBAAsB,GAAGA,CAAEC,QAAQ,EAAEd,cAAc,KAAM;EAC9D,OAAO,IAAAe,gBAAO,EACb,MACCD,QAAQ,CAACE,MAAM,CAAE,CAAEC,WAAW,EAAEC,QAAQ,KAAM;IAC7C,MAAMC,iBAAiB,GAAGpB,2BAA2B,CACpDC,cAAc,EACdkB,QAAQ,CAACE,MACV,CAAC;IACD,IAAKD,iBAAiB,EAAG;MACxBF,WAAW,CAACI,IAAI,CAAE;QACjB,GAAGH,QAAQ;QACXC;MACD,CAAE,CAAC;IACJ;IACA,OAAOF,WAAW;EACnB,CAAC,EAAE,EAAG,CAAC,EACR,CAAEH,QAAQ,EAAEd,cAAc,CAC3B,CAAC;AACF,CAAC;AAAC,IAAAsB,QAAA,GAAAxB,OAAA,CAAAyB,OAAA,GAEaV,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_blocks","_utils","transformMatchingBlock","match","selectedBlock","retainedBlockAttributes","getRetainedBlockAttributes","name","attributes","exports","getPatternTransformedBlocks","selectedBlocks","patternBlocks","_patternBlocks","map","block","cloneBlock","consumedBlocks","Set","isMatch","patternBlock","getMatchingBlockByName","add","clientId","useTransformedPatterns","patterns","useMemo","reduce","accumulator","_pattern","transformedBlocks","blocks","push","_default","default"],"sources":["@wordpress/block-editor/src/components/block-switcher/use-transformed-patterns.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { cloneBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getMatchingBlockByName, getRetainedBlockAttributes } from './utils';\n\n/**\n * Mutate the matched block's attributes by getting\n * which block type's attributes to retain and prioritize\n * them in the merging of the attributes.\n *\n * @param {WPBlock} match The matched block.\n * @param {WPBlock} selectedBlock The selected block.\n * @return {void}\n */\nexport const transformMatchingBlock = ( match, selectedBlock ) => {\n\t// Get the block attributes to retain through the transformation.\n\tconst retainedBlockAttributes = getRetainedBlockAttributes(\n\t\tselectedBlock.name,\n\t\tselectedBlock.attributes\n\t);\n\tmatch.attributes = {\n\t\t...match.attributes,\n\t\t...retainedBlockAttributes,\n\t};\n};\n\n/**\n * By providing the selected blocks and pattern's blocks\n * find the matching blocks, transform them and return them.\n * If not all selected blocks are matched, return nothing.\n *\n * @param {WPBlock[]} selectedBlocks The selected blocks.\n * @param {WPBlock[]} patternBlocks The pattern's blocks.\n * @return {WPBlock[]|void} The transformed pattern's blocks or undefined if not all selected blocks have been matched.\n */\nexport const getPatternTransformedBlocks = (\n\tselectedBlocks,\n\tpatternBlocks\n) => {\n\t// Clone Pattern's blocks to produce new clientIds and be able to mutate the matches.\n\tconst _patternBlocks = patternBlocks.map( ( block ) =>\n\t\tcloneBlock( block )\n\t);\n\t/**\n\t * Keep track of the consumed pattern blocks.\n\t * This is needed because we loop the selected blocks\n\t * and for example we may have selected two paragraphs and\n\t * the pattern's blocks could have more `paragraphs`.\n\t */\n\tconst consumedBlocks = new Set();\n\tfor ( const selectedBlock of selectedBlocks ) {\n\t\tlet isMatch = false;\n\t\tfor ( const patternBlock of _patternBlocks ) {\n\t\t\tconst match = getMatchingBlockByName(\n\t\t\t\tpatternBlock,\n\t\t\t\tselectedBlock.name,\n\t\t\t\tconsumedBlocks\n\t\t\t);\n\t\t\tif ( ! match ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tisMatch = true;\n\t\t\tconsumedBlocks.add( match.clientId );\n\t\t\t// We update (mutate) the matching pattern block.\n\t\t\ttransformMatchingBlock( match, selectedBlock );\n\t\t\t// No need to loop through other pattern's blocks.\n\t\t\tbreak;\n\t\t}\n\t\t// Bail eary if a selected block has not been matched.\n\t\tif ( ! isMatch ) {\n\t\t\treturn;\n\t\t}\n\t}\n\treturn _patternBlocks;\n};\n\n/**\n * @typedef {WPBlockPattern & {transformedBlocks: WPBlock[]}} TransformedBlockPattern\n */\n\n/**\n * Custom hook that accepts patterns from state and the selected\n * blocks and tries to match these with the pattern's blocks.\n * If all selected blocks are matched with a Pattern's block,\n * we transform them by retaining block's attributes with `role:content`.\n * The transformed pattern's blocks are set to a new pattern\n * property `transformedBlocks`.\n *\n * @param {WPBlockPattern[]} patterns Patterns from state.\n * @param {WPBlock[]} selectedBlocks The currently selected blocks.\n * @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks.\n */\nconst useTransformedPatterns = ( patterns, selectedBlocks ) => {\n\treturn useMemo(\n\t\t() =>\n\t\t\tpatterns.reduce( ( accumulator, _pattern ) => {\n\t\t\t\tconst transformedBlocks = getPatternTransformedBlocks(\n\t\t\t\t\tselectedBlocks,\n\t\t\t\t\t_pattern.blocks\n\t\t\t\t);\n\t\t\t\tif ( transformedBlocks ) {\n\t\t\t\t\taccumulator.push( {\n\t\t\t\t\t\t..._pattern,\n\t\t\t\t\t\ttransformedBlocks,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] ),\n\t\t[ patterns, selectedBlocks ]\n\t);\n};\n\nexport default useTransformedPatterns;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAA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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXAJ,OAAA,CAAAC,2BAAA,GAAAA,2BAAA;AAYA,MAAMc,sBAAsB,GAAGA,CAAEC,QAAQ,EAAEd,cAAc,KAAM;EAC9D,OAAO,IAAAe,gBAAO,EACb,MACCD,QAAQ,CAACE,MAAM,CAAE,CAAEC,WAAW,EAAEC,QAAQ,KAAM;IAC7C,MAAMC,iBAAiB,GAAGpB,2BAA2B,CACpDC,cAAc,EACdkB,QAAQ,CAACE,MACV,CAAC;IACD,IAAKD,iBAAiB,EAAG;MACxBF,WAAW,CAACI,IAAI,CAAE;QACjB,GAAGH,QAAQ;QACXC;MACD,CAAE,CAAC;IACJ;IACA,OAAOF,WAAW;EACnB,CAAC,EAAE,EAAG,CAAC,EACR,CAAEH,QAAQ,EAAEd,cAAc,CAC3B,CAAC;AACF,CAAC;AAAC,IAAAsB,QAAA,GAAAxB,OAAA,CAAAyB,OAAA,GAEaV,sBAAsB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","getMatchingBlockByName","block","selectedBlockName","consumedBlocks","Set","clientId","name","innerBlocks","has","innerBlock","match","exports","getRetainedBlockAttributes","attributes","contentAttributes","getBlockAttributesNamesByRole","length","reduce","_accumulator","attribute"],"sources":["@wordpress/block-editor/src/components/block-switcher/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockAttributesNamesByRole } from '@wordpress/blocks';\n\n/**\n * Try to find a matching block by a block's name in a provided\n * block. We recurse through InnerBlocks and return the reference\n * of the matched block (it could be an InnerBlock).\n * If no match is found return nothing.\n *\n * @param {WPBlock} block The block to try to find a match.\n * @param {string} selectedBlockName The block's name to use for matching condition.\n * @param {Set} consumedBlocks A set holding the previously matched/consumed blocks.\n *\n * @return {WPBlock | undefined} The matched block if found or nothing(`undefined`).\n */\nexport const getMatchingBlockByName = (\n\tblock,\n\tselectedBlockName,\n\tconsumedBlocks = new Set()\n) => {\n\tconst { clientId, name, innerBlocks = [] } = block;\n\t// Check if block has been consumed already.\n\tif ( consumedBlocks.has( clientId ) ) {\n\t\treturn;\n\t}\n\tif ( name === selectedBlockName ) {\n\t\treturn block;\n\t}\n\t// Try to find a matching block from InnerBlocks recursively.\n\tfor ( const innerBlock of innerBlocks ) {\n\t\tconst match = getMatchingBlockByName(\n\t\t\tinnerBlock,\n\t\t\tselectedBlockName,\n\t\t\tconsumedBlocks\n\t\t);\n\t\tif ( match ) {\n\t\t\treturn match;\n\t\t}\n\t}\n};\n\n/**\n * Find and return the block attributes to retain through\n * the transformation, based on Block Type's `role:content`\n * attributes. If no `role:content` attributes exist,\n * return selected block's attributes.\n *\n * @param {string} name Block type's namespaced name.\n * @param {Object} attributes Selected block's attributes.\n * @return {Object} The block's attributes to retain.\n */\nexport const getRetainedBlockAttributes = ( name, attributes ) => {\n\tconst contentAttributes = getBlockAttributesNamesByRole( name, 'content' );\n\tif ( ! contentAttributes?.length ) {\n\t\treturn attributes;\n\t}\n\n\treturn contentAttributes.reduce( ( _accumulator, attribute ) => {\n\t\tif ( attributes[ attribute ] ) {\n\t\t\t_accumulator[ attribute ] = attributes[ attribute ];\n\t\t}\n\t\treturn _accumulator;\n\t}, {} );\n};\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAGA,CACrCC,KAAK,EACLC,iBAAiB,EACjBC,cAAc,GAAG,IAAIC,GAAG,CAAC,CAAC,KACtB;EACJ,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,WAAW,GAAG;EAAG,CAAC,GAAGN,KAAK;EAClD;EACA,IAAKE,cAAc,CAACK,GAAG,CAAEH,QAAS,CAAC,EAAG;IACrC;EACD;EACA,IAAKC,IAAI,KAAKJ,iBAAiB,EAAG;IACjC,OAAOD,KAAK;EACb;EACA;EACA,KAAM,MAAMQ,UAAU,IAAIF,WAAW,EAAG;IACvC,MAAMG,KAAK,GAAGV,sBAAsB,CACnCS,UAAU,EACVP,iBAAiB,EACjBC,cACD,CAAC;IACD,IAAKO,KAAK,EAAG;MACZ,OAAOA,KAAK;IACb;EACD;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATAC,OAAA,CAAAX,sBAAA,GAAAA,sBAAA;AAUO,MAAMY,0BAA0B,GAAGA,CAAEN,IAAI,EAAEO,UAAU,KAAM;EACjE,MAAMC,iBAAiB,GAAG,IAAAC,qCAA6B,EAAET,IAAI,EAAE,SAAU,CAAC;EAC1E,IAAK,CAAEQ,iBAAiB,EAAEE,MAAM,EAAG;IAClC,OAAOH,UAAU;EAClB;EAEA,OAAOC,iBAAiB,CAACG,MAAM,CAAE,CAAEC,YAAY,EAAEC,SAAS,KAAM;IAC/D,IAAKN,UAAU,CAAEM,SAAS,CAAE,EAAG;MAC9BD,YAAY,CAAEC,SAAS,CAAE,GAAGN,UAAU,CAAEM,SAAS,CAAE;IACpD;IACA,OAAOD,YAAY;EACpB,CAAC,EAAE,CAAC,CAAE,CAAC;AACR,CAAC;AAACP,OAAA,CAAAC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","getMatchingBlockByName","block","selectedBlockName","consumedBlocks","Set","clientId","name","innerBlocks","has","innerBlock","match","exports","getRetainedBlockAttributes","attributes","contentAttributes","getBlockAttributesNamesByRole","length","reduce","_accumulator","attribute"],"sources":["@wordpress/block-editor/src/components/block-switcher/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockAttributesNamesByRole } from '@wordpress/blocks';\n\n/**\n * Try to find a matching block by a block's name in a provided\n * block. We recurse through InnerBlocks and return the reference\n * of the matched block (it could be an InnerBlock).\n * If no match is found return nothing.\n *\n * @param {WPBlock} block The block to try to find a match.\n * @param {string} selectedBlockName The block's name to use for matching condition.\n * @param {Set} consumedBlocks A set holding the previously matched/consumed blocks.\n *\n * @return {WPBlock | undefined} The matched block if found or nothing(`undefined`).\n */\nexport const getMatchingBlockByName = (\n\tblock,\n\tselectedBlockName,\n\tconsumedBlocks = new Set()\n) => {\n\tconst { clientId, name, innerBlocks = [] } = block;\n\t// Check if block has been consumed already.\n\tif ( consumedBlocks.has( clientId ) ) {\n\t\treturn;\n\t}\n\tif ( name === selectedBlockName ) {\n\t\treturn block;\n\t}\n\t// Try to find a matching block from InnerBlocks recursively.\n\tfor ( const innerBlock of innerBlocks ) {\n\t\tconst match = getMatchingBlockByName(\n\t\t\tinnerBlock,\n\t\t\tselectedBlockName,\n\t\t\tconsumedBlocks\n\t\t);\n\t\tif ( match ) {\n\t\t\treturn match;\n\t\t}\n\t}\n};\n\n/**\n * Find and return the block attributes to retain through\n * the transformation, based on Block Type's `role:content`\n * attributes. If no `role:content` attributes exist,\n * return selected block's attributes.\n *\n * @param {string} name Block type's namespaced name.\n * @param {Object} attributes Selected block's attributes.\n * @return {Object} The block's attributes to retain.\n */\nexport const getRetainedBlockAttributes = ( name, attributes ) => {\n\tconst contentAttributes = getBlockAttributesNamesByRole( name, 'content' );\n\tif ( ! contentAttributes?.length ) {\n\t\treturn attributes;\n\t}\n\n\treturn contentAttributes.reduce( ( _accumulator, attribute ) => {\n\t\tif ( attributes[ attribute ] ) {\n\t\t\t_accumulator[ attribute ] = attributes[ attribute ];\n\t\t}\n\t\treturn _accumulator;\n\t}, {} );\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,GAAGA,CACrCC,KAAK,EACLC,iBAAiB,EACjBC,cAAc,GAAG,IAAIC,GAAG,CAAC,CAAC,KACtB;EACJ,MAAM;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,WAAW,GAAG;EAAG,CAAC,GAAGN,KAAK;EAClD;EACA,IAAKE,cAAc,CAACK,GAAG,CAAEH,QAAS,CAAC,EAAG;IACrC;EACD;EACA,IAAKC,IAAI,KAAKJ,iBAAiB,EAAG;IACjC,OAAOD,KAAK;EACb;EACA;EACA,KAAM,MAAMQ,UAAU,IAAIF,WAAW,EAAG;IACvC,MAAMG,KAAK,GAAGV,sBAAsB,CACnCS,UAAU,EACVP,iBAAiB,EACjBC,cACD,CAAC;IACD,IAAKO,KAAK,EAAG;MACZ,OAAOA,KAAK;IACb;EACD;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATAC,OAAA,CAAAX,sBAAA,GAAAA,sBAAA;AAUO,MAAMY,0BAA0B,GAAGA,CAAEN,IAAI,EAAEO,UAAU,KAAM;EACjE,MAAMC,iBAAiB,GAAG,IAAAC,qCAA6B,EAAET,IAAI,EAAE,SAAU,CAAC;EAC1E,IAAK,CAAEQ,iBAAiB,EAAEE,MAAM,EAAG;IAClC,OAAOH,UAAU;EAClB;EAEA,OAAOC,iBAAiB,CAACG,MAAM,CAAE,CAAEC,YAAY,EAAEC,SAAS,KAAM;IAC/D,IAAKN,UAAU,CAAEM,SAAS,CAAE,EAAG;MAC9BD,YAAY,CAAEC,SAAS,CAAE,GAAGN,UAAU,CAAEM,SAAS,CAAE;IACpD;IACA,OAAOD,YAAY;EACpB,CAAC,EAAE,CAAC,CAAE,CAAC;AACR,CAAC;AAACP,OAAA,CAAAC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_element","_compose","_blocks","_components","_blockMover","_blockParentSelector","_blockSwitcher","_blockControls","_blockToolbarLastItem","_blockSettingsMenu","_blockLock","_convertToGroupButtons","_blockEditVisuallyButton","_utils","_store","_blockNameContext","_navigableToolbar","_useHasBlockToolbar","_lockUnlock","_jsxRuntime","PrivateBlockToolbar","hideDragHandle","focusOnMount","__experimentalInitialIndex","__experimentalOnIndexChange","variant","blockClientId","blockClientIds","isDefaultEditingMode","blockType","toolbarKey","shouldShowVisualToolbar","showParentSelector","isUsingBindings","hasParentPattern","hasContentOnlyLocking","useSelect","select","getBlockName","getBlockMode","getBlockParents","getSelectedBlockClientIds","isBlockValid","getBlockEditingMode","getBlockAttributes","getBlockParentsByBlockName","getTemplateLock","getParentSectionBlock","unlock","blockEditorStore","selectedBlockClientIds","selectedBlockClientId","parents","parentSection","parentClientId","length","parentBlockName","parentBlockType","getBlockType","editingMode","_isDefaultEditingMode","_blockName","isValid","every","id","isVisual","_isUsingBindings","clientId","metadata","bindings","_hasParentPattern","_hasTemplateLock","some","hasBlockSupport","toolbarWrapperRef","useRef","nodeRef","showHoveredOrFocusedGestures","useShowHoveredOrFocusedGestures","ref","isLargeViewport","useViewportMatch","hasBlockToolbar","useHasBlockToolbar","isMultiToolbar","isSynced","isReusableBlock","isTemplatePart","classes","clsx","innerClasses","jsx","default","focusEditorOnEscape","className","__","undefined","children","jsxs","ToolbarGroup","clientIds","BlockLockToolbar","BlockGroupToolbar","Fragment","Slot","group","Provider","value","name","BlockToolbar"],"sources":["@wordpress/block-editor/src/components/block-toolbar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tgetBlockType,\n\thasBlockSupport,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { ToolbarGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockMover from '../block-mover';\nimport BlockParentSelector from '../block-parent-selector';\nimport BlockSwitcher from '../block-switcher';\nimport BlockControls from '../block-controls';\nimport __unstableBlockToolbarLastItem from './block-toolbar-last-item';\nimport BlockSettingsMenu from '../block-settings-menu';\nimport { BlockLockToolbar } from '../block-lock';\nimport { BlockGroupToolbar } from '../convert-to-group-buttons';\nimport BlockEditVisuallyButton from '../block-edit-visually-button';\nimport { useShowHoveredOrFocusedGestures } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport __unstableBlockNameContext from './block-name-context';\nimport NavigableToolbar from '../navigable-toolbar';\nimport { useHasBlockToolbar } from './use-has-block-toolbar';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {boolean} props.focusOnMount Focus the toolbar when mounted.\n * @param {number} props.__experimentalInitialIndex The initial index of the toolbar item to focus.\n * @param {Function} props.__experimentalOnIndexChange Callback function to be called when the index of the focused toolbar item changes.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport function PrivateBlockToolbar( {\n\thideDragHandle,\n\tfocusOnMount,\n\t__experimentalInitialIndex,\n\t__experimentalOnIndexChange,\n\tvariant = 'unstyled',\n} ) {\n\tconst {\n\t\tblockClientId,\n\t\tblockClientIds,\n\t\tisDefaultEditingMode,\n\t\tblockType,\n\t\ttoolbarKey,\n\t\tshouldShowVisualToolbar,\n\t\tshowParentSelector,\n\t\tisUsingBindings,\n\t\thasParentPattern,\n\t\thasContentOnlyLocking,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockName,\n\t\t\tgetBlockMode,\n\t\t\tgetBlockParents,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisBlockValid,\n\t\t\tgetBlockEditingMode,\n\t\t\tgetBlockAttributes,\n\t\t\tgetBlockParentsByBlockName,\n\t\t\tgetTemplateLock,\n\t\t\tgetParentSectionBlock,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlockClientId = selectedBlockClientIds[ 0 ];\n\t\tconst parents = getBlockParents( selectedBlockClientId );\n\t\tconst parentSection = getParentSectionBlock( selectedBlockClientId );\n\t\tconst parentClientId = parentSection ?? parents[ parents.length - 1 ];\n\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\tconst parentBlockType = getBlockType( parentBlockName );\n\t\tconst editingMode = getBlockEditingMode( selectedBlockClientId );\n\t\tconst _isDefaultEditingMode = editingMode === 'default';\n\t\tconst _blockName = getBlockName( selectedBlockClientId );\n\t\tconst isValid = selectedBlockClientIds.every( ( id ) =>\n\t\t\tisBlockValid( id )\n\t\t);\n\t\tconst isVisual = selectedBlockClientIds.every(\n\t\t\t( id ) => getBlockMode( id ) === 'visual'\n\t\t);\n\t\tconst _isUsingBindings = selectedBlockClientIds.every(\n\t\t\t( clientId ) =>\n\t\t\t\t!! getBlockAttributes( clientId )?.metadata?.bindings\n\t\t);\n\n\t\tconst _hasParentPattern = selectedBlockClientIds.every(\n\t\t\t( clientId ) =>\n\t\t\t\tgetBlockParentsByBlockName( clientId, 'core/block', true )\n\t\t\t\t\t.length > 0\n\t\t);\n\n\t\t// If one or more selected blocks are locked, do not show the BlockGroupToolbar.\n\t\tconst _hasTemplateLock = selectedBlockClientIds.some(\n\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t);\n\t\treturn {\n\t\t\tblockClientId: selectedBlockClientId,\n\t\t\tblockClientIds: selectedBlockClientIds,\n\t\t\tisDefaultEditingMode: _isDefaultEditingMode,\n\t\t\tblockType: selectedBlockClientId && getBlockType( _blockName ),\n\t\t\tshouldShowVisualToolbar: isValid && isVisual,\n\t\t\ttoolbarKey: `${ selectedBlockClientId }${ parentClientId }`,\n\t\t\tshowParentSelector:\n\t\t\t\tparentBlockType &&\n\t\t\t\tgetBlockEditingMode( parentClientId ) !== 'disabled' &&\n\t\t\t\thasBlockSupport(\n\t\t\t\t\tparentBlockType,\n\t\t\t\t\t'__experimentalParentSelector',\n\t\t\t\t\ttrue\n\t\t\t\t) &&\n\t\t\t\tselectedBlockClientIds.length === 1,\n\t\t\tisUsingBindings: _isUsingBindings,\n\t\t\thasParentPattern: _hasParentPattern,\n\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t};\n\t}, [] );\n\n\tconst toolbarWrapperRef = useRef( null );\n\n\t// Handles highlighting the current block outline on hover or focus of the\n\t// block type toolbar area.\n\tconst nodeRef = useRef();\n\tconst showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures( {\n\t\tref: nodeRef,\n\t} );\n\n\tconst isLargeViewport = ! useViewportMatch( 'medium', '<' );\n\n\tconst hasBlockToolbar = useHasBlockToolbar();\n\tif ( ! hasBlockToolbar ) {\n\t\treturn null;\n\t}\n\n\tconst isMultiToolbar = blockClientIds.length > 1;\n\tconst isSynced =\n\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\n\t// Shifts the toolbar to make room for the parent block selector.\n\tconst classes = clsx( 'block-editor-block-contextual-toolbar', {\n\t\t'has-parent': showParentSelector,\n\t} );\n\n\tconst innerClasses = clsx( 'block-editor-block-toolbar', {\n\t\t'is-synced': isSynced,\n\t\t'is-connected': isUsingBindings,\n\t} );\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tfocusEditorOnEscape\n\t\t\tclassName={ classes }\n\t\t\t/* translators: accessibility text for the block toolbar */\n\t\t\taria-label={ __( 'Block tools' ) }\n\t\t\t// The variant is applied as \"toolbar\" when undefined, which is the black border style of the dropdown from the toolbar popover.\n\t\t\tvariant={ variant === 'toolbar' ? undefined : variant }\n\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t__experimentalInitialIndex={ __experimentalInitialIndex }\n\t\t\t__experimentalOnIndexChange={ __experimentalOnIndexChange }\n\t\t\t// Resets the index whenever the active block changes so\n\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\tkey={ toolbarKey }\n\t\t>\n\t\t\t<div ref={ toolbarWrapperRef } className={ innerClasses }>\n\t\t\t\t{ ! isMultiToolbar && isLargeViewport && (\n\t\t\t\t\t<BlockParentSelector />\n\t\t\t\t) }\n\t\t\t\t{ ( shouldShowVisualToolbar || isMultiToolbar ) &&\n\t\t\t\t\t! hasParentPattern && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ nodeRef }\n\t\t\t\t\t\t\t{ ...showHoveredOrFocusedGestures }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToolbarGroup className=\"block-editor-block-toolbar__block-controls\">\n\t\t\t\t\t\t\t\t<BlockSwitcher clientIds={ blockClientIds } />\n\t\t\t\t\t\t\t\t{ ! isMultiToolbar && isDefaultEditingMode && (\n\t\t\t\t\t\t\t\t\t<BlockLockToolbar\n\t\t\t\t\t\t\t\t\t\tclientId={ blockClientId }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<BlockMover\n\t\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\t\thideDragHandle={ hideDragHandle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t{ ! hasContentOnlyLocking &&\n\t\t\t\t\tshouldShowVisualToolbar &&\n\t\t\t\t\tisMultiToolbar && <BlockGroupToolbar /> }\n\t\t\t\t{ shouldShowVisualToolbar && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"parent\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockControls.Slot className=\"block-editor-block-toolbar__slot\" />\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"inline\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"other\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<__unstableBlockNameContext.Provider\n\t\t\t\t\t\t\tvalue={ blockType?.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<__unstableBlockToolbarLastItem.Slot />\n\t\t\t\t\t\t</__unstableBlockNameContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEditVisuallyButton clientIds={ blockClientIds } />\n\t\t\t\t<BlockSettingsMenu clientIds={ blockClientIds } />\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport default function BlockToolbar( { hideDragHandle, variant } ) {\n\treturn (\n\t\t<PrivateBlockToolbar\n\t\t\thideDragHandle={ hideDragHandle }\n\t\t\tvariant={ variant }\n\t\t\tfocusOnMount={ undefined }\n\t\t\t__experimentalInitialIndex={ undefined }\n\t\t\t__experimentalOnIndexChange={ undefined }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAA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3E,WAAA,CAAAwE,GAAA,EAAC5E,iBAAA,CAAA6E,OAA0B,CAACc,QAAQ;UACnCC,KAAK,EAAG9E,SAAS,EAAE+E,IAAM;UAAAX,QAAA,eAEzB,IAAA9E,WAAA,CAAAwE,GAAA,EAACnF,qBAAA,CAAAoF,OAA8B,CAACY,IAAI,IAAE;QAAC,CACH,CAAC;MAAA,CACrC,CACF,eACD,IAAArF,WAAA,CAAAwE,GAAA,EAAC/E,wBAAA,CAAAgF,OAAuB;QAACQ,SAAS,EAAGzE;MAAgB,CAAE,CAAC,eACxD,IAAAR,WAAA,CAAAwE,GAAA,EAAClF,kBAAA,CAAAmF,OAAiB;QAACQ,SAAS,EAAGzE;MAAgB,CAAE,CAAC;IAAA,CAC9C;EAAC,GAzDAG,UA0DW,CAAC;AAErB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS+E,YAAYA,CAAE;EAAExF,cAAc;EAAEI;AAAQ,CAAC,EAAG;EACnE,oBACC,IAAAN,WAAA,CAAAwE,GAAA,EAACvE,mBAAmB;IACnBC,cAAc,EAAGA,cAAgB;IACjCI,OAAO,EAAGA,OAAS;IACnBH,YAAY,EAAG0E,SAAW;IAC1BzE,0BAA0B,EAAGyE,SAAW;IACxCxE,2BAA2B,EAAGwE;EAAW,CACzC,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_element","_compose","_blocks","_components","_blockMover","_blockParentSelector","_blockSwitcher","_blockControls","_blockToolbarLastItem","_blockSettingsMenu","_blockLock","_convertToGroupButtons","_blockEditVisuallyButton","_utils","_store","_blockNameContext","_navigableToolbar","_useHasBlockToolbar","_lockUnlock","_jsxRuntime","PrivateBlockToolbar","hideDragHandle","focusOnMount","__experimentalInitialIndex","__experimentalOnIndexChange","variant","blockClientId","blockClientIds","isDefaultEditingMode","blockType","toolbarKey","shouldShowVisualToolbar","showParentSelector","isUsingBindings","hasParentPattern","hasContentOnlyLocking","useSelect","select","getBlockName","getBlockMode","getBlockParents","getSelectedBlockClientIds","isBlockValid","getBlockEditingMode","getBlockAttributes","getBlockParentsByBlockName","getTemplateLock","getParentSectionBlock","unlock","blockEditorStore","selectedBlockClientIds","selectedBlockClientId","parents","parentSection","parentClientId","length","parentBlockName","parentBlockType","getBlockType","editingMode","_isDefaultEditingMode","_blockName","isValid","every","id","isVisual","_isUsingBindings","clientId","metadata","bindings","_hasParentPattern","_hasTemplateLock","some","hasBlockSupport","toolbarWrapperRef","useRef","nodeRef","showHoveredOrFocusedGestures","useShowHoveredOrFocusedGestures","ref","isLargeViewport","useViewportMatch","hasBlockToolbar","useHasBlockToolbar","isMultiToolbar","isSynced","isReusableBlock","isTemplatePart","classes","clsx","innerClasses","jsx","default","focusEditorOnEscape","className","__","undefined","children","jsxs","ToolbarGroup","clientIds","BlockLockToolbar","BlockGroupToolbar","Fragment","Slot","group","Provider","value","name","BlockToolbar"],"sources":["@wordpress/block-editor/src/components/block-toolbar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tgetBlockType,\n\thasBlockSupport,\n\tisReusableBlock,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { ToolbarGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockMover from '../block-mover';\nimport BlockParentSelector from '../block-parent-selector';\nimport BlockSwitcher from '../block-switcher';\nimport BlockControls from '../block-controls';\nimport __unstableBlockToolbarLastItem from './block-toolbar-last-item';\nimport BlockSettingsMenu from '../block-settings-menu';\nimport { BlockLockToolbar } from '../block-lock';\nimport { BlockGroupToolbar } from '../convert-to-group-buttons';\nimport BlockEditVisuallyButton from '../block-edit-visually-button';\nimport { useShowHoveredOrFocusedGestures } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport __unstableBlockNameContext from './block-name-context';\nimport NavigableToolbar from '../navigable-toolbar';\nimport { useHasBlockToolbar } from './use-has-block-toolbar';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {boolean} props.focusOnMount Focus the toolbar when mounted.\n * @param {number} props.__experimentalInitialIndex The initial index of the toolbar item to focus.\n * @param {Function} props.__experimentalOnIndexChange Callback function to be called when the index of the focused toolbar item changes.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport function PrivateBlockToolbar( {\n\thideDragHandle,\n\tfocusOnMount,\n\t__experimentalInitialIndex,\n\t__experimentalOnIndexChange,\n\tvariant = 'unstyled',\n} ) {\n\tconst {\n\t\tblockClientId,\n\t\tblockClientIds,\n\t\tisDefaultEditingMode,\n\t\tblockType,\n\t\ttoolbarKey,\n\t\tshouldShowVisualToolbar,\n\t\tshowParentSelector,\n\t\tisUsingBindings,\n\t\thasParentPattern,\n\t\thasContentOnlyLocking,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockName,\n\t\t\tgetBlockMode,\n\t\t\tgetBlockParents,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisBlockValid,\n\t\t\tgetBlockEditingMode,\n\t\t\tgetBlockAttributes,\n\t\t\tgetBlockParentsByBlockName,\n\t\t\tgetTemplateLock,\n\t\t\tgetParentSectionBlock,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst selectedBlockClientId = selectedBlockClientIds[ 0 ];\n\t\tconst parents = getBlockParents( selectedBlockClientId );\n\t\tconst parentSection = getParentSectionBlock( selectedBlockClientId );\n\t\tconst parentClientId = parentSection ?? parents[ parents.length - 1 ];\n\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\tconst parentBlockType = getBlockType( parentBlockName );\n\t\tconst editingMode = getBlockEditingMode( selectedBlockClientId );\n\t\tconst _isDefaultEditingMode = editingMode === 'default';\n\t\tconst _blockName = getBlockName( selectedBlockClientId );\n\t\tconst isValid = selectedBlockClientIds.every( ( id ) =>\n\t\t\tisBlockValid( id )\n\t\t);\n\t\tconst isVisual = selectedBlockClientIds.every(\n\t\t\t( id ) => getBlockMode( id ) === 'visual'\n\t\t);\n\t\tconst _isUsingBindings = selectedBlockClientIds.every(\n\t\t\t( clientId ) =>\n\t\t\t\t!! getBlockAttributes( clientId )?.metadata?.bindings\n\t\t);\n\n\t\tconst _hasParentPattern = selectedBlockClientIds.every(\n\t\t\t( clientId ) =>\n\t\t\t\tgetBlockParentsByBlockName( clientId, 'core/block', true )\n\t\t\t\t\t.length > 0\n\t\t);\n\n\t\t// If one or more selected blocks are locked, do not show the BlockGroupToolbar.\n\t\tconst _hasTemplateLock = selectedBlockClientIds.some(\n\t\t\t( id ) => getTemplateLock( id ) === 'contentOnly'\n\t\t);\n\t\treturn {\n\t\t\tblockClientId: selectedBlockClientId,\n\t\t\tblockClientIds: selectedBlockClientIds,\n\t\t\tisDefaultEditingMode: _isDefaultEditingMode,\n\t\t\tblockType: selectedBlockClientId && getBlockType( _blockName ),\n\t\t\tshouldShowVisualToolbar: isValid && isVisual,\n\t\t\ttoolbarKey: `${ selectedBlockClientId }${ parentClientId }`,\n\t\t\tshowParentSelector:\n\t\t\t\tparentBlockType &&\n\t\t\t\tgetBlockEditingMode( parentClientId ) !== 'disabled' &&\n\t\t\t\thasBlockSupport(\n\t\t\t\t\tparentBlockType,\n\t\t\t\t\t'__experimentalParentSelector',\n\t\t\t\t\ttrue\n\t\t\t\t) &&\n\t\t\t\tselectedBlockClientIds.length === 1,\n\t\t\tisUsingBindings: _isUsingBindings,\n\t\t\thasParentPattern: _hasParentPattern,\n\t\t\thasContentOnlyLocking: _hasTemplateLock,\n\t\t};\n\t}, [] );\n\n\tconst toolbarWrapperRef = useRef( null );\n\n\t// Handles highlighting the current block outline on hover or focus of the\n\t// block type toolbar area.\n\tconst nodeRef = useRef();\n\tconst showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures( {\n\t\tref: nodeRef,\n\t} );\n\n\tconst isLargeViewport = ! useViewportMatch( 'medium', '<' );\n\n\tconst hasBlockToolbar = useHasBlockToolbar();\n\tif ( ! hasBlockToolbar ) {\n\t\treturn null;\n\t}\n\n\tconst isMultiToolbar = blockClientIds.length > 1;\n\tconst isSynced =\n\t\tisReusableBlock( blockType ) || isTemplatePart( blockType );\n\n\t// Shifts the toolbar to make room for the parent block selector.\n\tconst classes = clsx( 'block-editor-block-contextual-toolbar', {\n\t\t'has-parent': showParentSelector,\n\t} );\n\n\tconst innerClasses = clsx( 'block-editor-block-toolbar', {\n\t\t'is-synced': isSynced,\n\t\t'is-connected': isUsingBindings,\n\t} );\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tfocusEditorOnEscape\n\t\t\tclassName={ classes }\n\t\t\t/* translators: accessibility text for the block toolbar */\n\t\t\taria-label={ __( 'Block tools' ) }\n\t\t\t// The variant is applied as \"toolbar\" when undefined, which is the black border style of the dropdown from the toolbar popover.\n\t\t\tvariant={ variant === 'toolbar' ? undefined : variant }\n\t\t\tfocusOnMount={ focusOnMount }\n\t\t\t__experimentalInitialIndex={ __experimentalInitialIndex }\n\t\t\t__experimentalOnIndexChange={ __experimentalOnIndexChange }\n\t\t\t// Resets the index whenever the active block changes so\n\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\tkey={ toolbarKey }\n\t\t>\n\t\t\t<div ref={ toolbarWrapperRef } className={ innerClasses }>\n\t\t\t\t{ ! isMultiToolbar && isLargeViewport && (\n\t\t\t\t\t<BlockParentSelector />\n\t\t\t\t) }\n\t\t\t\t{ ( shouldShowVisualToolbar || isMultiToolbar ) &&\n\t\t\t\t\t! hasParentPattern && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ nodeRef }\n\t\t\t\t\t\t\t{ ...showHoveredOrFocusedGestures }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToolbarGroup className=\"block-editor-block-toolbar__block-controls\">\n\t\t\t\t\t\t\t\t<BlockSwitcher clientIds={ blockClientIds } />\n\t\t\t\t\t\t\t\t{ ! isMultiToolbar && isDefaultEditingMode && (\n\t\t\t\t\t\t\t\t\t<BlockLockToolbar\n\t\t\t\t\t\t\t\t\t\tclientId={ blockClientId }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<BlockMover\n\t\t\t\t\t\t\t\t\tclientIds={ blockClientIds }\n\t\t\t\t\t\t\t\t\thideDragHandle={ hideDragHandle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t{ ! hasContentOnlyLocking &&\n\t\t\t\t\tshouldShowVisualToolbar &&\n\t\t\t\t\tisMultiToolbar && <BlockGroupToolbar /> }\n\t\t\t\t{ shouldShowVisualToolbar && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"parent\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"block\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockControls.Slot className=\"block-editor-block-toolbar__slot\" />\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"inline\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BlockControls.Slot\n\t\t\t\t\t\t\tgroup=\"other\"\n\t\t\t\t\t\t\tclassName=\"block-editor-block-toolbar__slot\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<__unstableBlockNameContext.Provider\n\t\t\t\t\t\t\tvalue={ blockType?.name }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<__unstableBlockToolbarLastItem.Slot />\n\t\t\t\t\t\t</__unstableBlockNameContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEditVisuallyButton clientIds={ blockClientIds } />\n\t\t\t\t<BlockSettingsMenu clientIds={ blockClientIds } />\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\n/**\n * Renders the block toolbar.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md\n *\n * @param {Object} props Components props.\n * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.\n * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.\n */\nexport default function BlockToolbar( { hideDragHandle, variant } ) {\n\treturn (\n\t\t<PrivateBlockToolbar\n\t\t\thideDragHandle={ hideDragHandle }\n\t\t\tvariant={ variant }\n\t\t\tfocusOnMount={ undefined }\n\t\t\t__experimentalInitialIndex={ undefined }\n\t\t\t__experimentalOnIndexChange={ undefined }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,oBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA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