@wordpress/block-editor 12.19.5 → 12.21.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 (443) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-canvas/index.js +2 -0
  3. package/build/components/block-canvas/index.js.map +1 -1
  4. package/build/components/block-heading-level-dropdown/index.js +14 -17
  5. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  6. package/build/components/block-inspector/index.js +0 -3
  7. package/build/components/block-inspector/index.js.map +1 -1
  8. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  9. package/build/components/block-list/block-list-item.native.js +1 -1
  10. package/build/components/block-list/block-list-item.native.js.map +1 -1
  11. package/build/components/block-list/block-outline.native.js +23 -7
  12. package/build/components/block-list/block-outline.native.js.map +1 -1
  13. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  14. package/build/components/block-list/block.native.js +0 -3
  15. package/build/components/block-list/block.native.js.map +1 -1
  16. package/build/components/block-list/index.js +9 -9
  17. package/build/components/block-list/index.js.map +1 -1
  18. package/build/components/block-mover/index.native.js.map +1 -1
  19. package/build/components/block-popover/cover.js +68 -0
  20. package/build/components/block-popover/cover.js.map +1 -0
  21. package/build/components/block-popover/drop-zone.js +2 -3
  22. package/build/components/block-popover/drop-zone.js.map +1 -1
  23. package/build/components/block-popover/index.js +1 -19
  24. package/build/components/block-popover/index.js.map +1 -1
  25. package/build/components/block-preview/index.js +2 -1
  26. package/build/components/block-preview/index.js.map +1 -1
  27. package/build/components/block-removal-warning-modal/index.js +2 -4
  28. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  29. package/build/components/block-rename/modal.js.map +1 -1
  30. package/build/components/block-settings-menu/block-parent-selector-menu-item.js +54 -0
  31. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -0
  32. package/build/components/block-settings-menu/block-settings-dropdown.js +9 -37
  33. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  34. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  35. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  36. package/build/components/block-toolbar/index.js +7 -5
  37. package/build/components/block-toolbar/index.js.map +1 -1
  38. package/build/components/block-toolbar/shuffle.js +89 -0
  39. package/build/components/block-toolbar/shuffle.js.map +1 -0
  40. package/build/components/block-toolbar/use-has-block-toolbar.js +43 -0
  41. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
  42. package/build/components/block-tools/block-selection-button.js +5 -1
  43. package/build/components/block-tools/block-selection-button.js.map +1 -1
  44. package/build/components/block-tools/empty-block-inserter.js +2 -5
  45. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  46. package/build/components/block-tools/index.js +9 -26
  47. package/build/components/block-tools/index.js.map +1 -1
  48. package/build/components/block-tools/use-show-block-tools.js +60 -0
  49. package/build/components/block-tools/use-show-block-tools.js.map +1 -0
  50. package/build/components/caption/index.native.js.map +1 -1
  51. package/build/components/child-layout-control/index.js +37 -5
  52. package/build/components/child-layout-control/index.js.map +1 -1
  53. package/build/components/color-palette/control.js.map +1 -1
  54. package/build/components/colors-gradients/control.js +1 -1
  55. package/build/components/colors-gradients/control.js.map +1 -1
  56. package/build/components/date-format-picker/index.js +0 -1
  57. package/build/components/date-format-picker/index.js.map +1 -1
  58. package/build/components/font-appearance-control/index.js +1 -2
  59. package/build/components/font-appearance-control/index.js.map +1 -1
  60. package/build/components/global-styles/border-panel.js.map +1 -1
  61. package/build/components/global-styles/color-panel.js +1 -1
  62. package/build/components/global-styles/color-panel.js.map +1 -1
  63. package/build/components/global-styles/dimensions-panel.js +30 -19
  64. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  65. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  66. package/build/components/global-styles/typography-utils.js +7 -5
  67. package/build/components/global-styles/typography-utils.js.map +1 -1
  68. package/build/components/global-styles/use-global-styles-output.js +15 -15
  69. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  70. package/build/components/global-styles/utils.js +1 -1
  71. package/build/components/global-styles/utils.js.map +1 -1
  72. package/build/components/grid-visualizer/grid-item-resizer.js +77 -0
  73. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -0
  74. package/build/components/grid-visualizer/grid-visualizer.js +81 -0
  75. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -0
  76. package/build/components/grid-visualizer/index.js +20 -0
  77. package/build/components/grid-visualizer/index.js.map +1 -0
  78. package/build/components/grid-visualizer/utils.js +10 -0
  79. package/build/components/grid-visualizer/utils.js.map +1 -0
  80. package/build/components/iframe/index.js +61 -16
  81. package/build/components/iframe/index.js.map +1 -1
  82. package/build/components/index.native.js +7 -0
  83. package/build/components/index.native.js.map +1 -1
  84. package/build/components/inner-blocks/use-nested-settings-update.js +8 -2
  85. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  86. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  87. package/build/components/inserter/menu.js +9 -3
  88. package/build/components/inserter/menu.js.map +1 -1
  89. package/build/components/inserter/menu.native.js.map +1 -1
  90. package/build/components/inserter/mobile-tab-navigation.js +1 -1
  91. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  92. package/build/components/inserter/search-results.js +3 -2
  93. package/build/components/inserter/search-results.js.map +1 -1
  94. package/build/components/inserter/tabs.js +2 -1
  95. package/build/components/inserter/tabs.js.map +1 -1
  96. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  97. package/build/components/inspector-controls-tabs/index.js +1 -1
  98. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  99. package/build/components/inspector-controls-tabs/styles-tab.js +0 -4
  100. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  101. package/build/components/link-control/search-input.js.map +1 -1
  102. package/build/components/list-view/branch.js.map +1 -1
  103. package/build/components/list-view/drop-indicator.js.map +1 -1
  104. package/build/components/list-view/index.js.map +1 -1
  105. package/build/components/observe-typing/index.js +5 -10
  106. package/build/components/observe-typing/index.js.map +1 -1
  107. package/build/components/panel-color-settings/index.js.map +1 -1
  108. package/build/components/provider/index.js.map +1 -1
  109. package/build/components/resizable-box-popover/index.js +3 -5
  110. package/build/components/resizable-box-popover/index.js.map +1 -1
  111. package/build/components/responsive-block-control/index.js +1 -1
  112. package/build/components/responsive-block-control/index.js.map +1 -1
  113. package/build/components/rich-text/format-toolbar-container.js +1 -31
  114. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  115. package/build/components/rich-text/index.js +1 -2
  116. package/build/components/rich-text/index.js.map +1 -1
  117. package/build/components/skip-to-selected-block/index.js +7 -14
  118. package/build/components/skip-to-selected-block/index.js.map +1 -1
  119. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  120. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  121. package/build/components/url-input/index.js +5 -8
  122. package/build/components/url-input/index.js.map +1 -1
  123. package/build/hooks/background.js.map +1 -1
  124. package/build/hooks/block-hooks.js.map +1 -1
  125. package/build/hooks/dimensions.js +3 -4
  126. package/build/hooks/dimensions.js.map +1 -1
  127. package/build/hooks/font-size.js +6 -7
  128. package/build/hooks/font-size.js.map +1 -1
  129. package/build/hooks/index.js +1 -1
  130. package/build/hooks/index.js.map +1 -1
  131. package/build/hooks/layout-child.js +89 -1
  132. package/build/hooks/layout-child.js.map +1 -1
  133. package/build/hooks/layout.js +11 -4
  134. package/build/hooks/layout.js.map +1 -1
  135. package/build/hooks/line-height.js.map +1 -1
  136. package/build/hooks/position.js +0 -1
  137. package/build/hooks/position.js.map +1 -1
  138. package/build/hooks/spacing-visualizer.js +115 -0
  139. package/build/hooks/spacing-visualizer.js.map +1 -0
  140. package/build/hooks/use-typography-props.js +1 -2
  141. package/build/hooks/use-typography-props.js.map +1 -1
  142. package/build/layouts/grid.js +111 -14
  143. package/build/layouts/grid.js.map +1 -1
  144. package/build/private-apis.js +2 -2
  145. package/build/private-apis.js.map +1 -1
  146. package/build/store/actions.js +4 -36
  147. package/build/store/actions.js.map +1 -1
  148. package/build/store/private-actions.js +29 -45
  149. package/build/store/private-actions.js.map +1 -1
  150. package/build/store/reducer.js +2 -4
  151. package/build/store/reducer.js.map +1 -1
  152. package/build/store/selectors.js +27 -15
  153. package/build/store/selectors.js.map +1 -1
  154. package/build/utils/calculate-scale.js +17 -0
  155. package/build/utils/calculate-scale.js.map +1 -0
  156. package/build-module/components/block-canvas/index.js +2 -0
  157. package/build-module/components/block-canvas/index.js.map +1 -1
  158. package/build-module/components/block-heading-level-dropdown/index.js +14 -17
  159. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  160. package/build-module/components/block-inspector/index.js +1 -4
  161. package/build-module/components/block-inspector/index.js.map +1 -1
  162. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  163. package/build-module/components/block-list/block-list-item.native.js +1 -1
  164. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  165. package/build-module/components/block-list/block-outline.native.js +23 -7
  166. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  167. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  168. package/build-module/components/block-list/block.native.js +0 -3
  169. package/build-module/components/block-list/block.native.js.map +1 -1
  170. package/build-module/components/block-list/index.js +9 -9
  171. package/build-module/components/block-list/index.js.map +1 -1
  172. package/build-module/components/block-mover/index.native.js.map +1 -1
  173. package/build-module/components/block-popover/cover.js +60 -0
  174. package/build-module/components/block-popover/cover.js.map +1 -0
  175. package/build-module/components/block-popover/drop-zone.js +2 -3
  176. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  177. package/build-module/components/block-popover/index.js +1 -19
  178. package/build-module/components/block-popover/index.js.map +1 -1
  179. package/build-module/components/block-preview/index.js +2 -1
  180. package/build-module/components/block-preview/index.js.map +1 -1
  181. package/build-module/components/block-removal-warning-modal/index.js +3 -5
  182. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  183. package/build-module/components/block-rename/modal.js.map +1 -1
  184. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +46 -0
  185. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -0
  186. package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -40
  187. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  188. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  189. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  190. package/build-module/components/block-toolbar/index.js +7 -6
  191. package/build-module/components/block-toolbar/index.js.map +1 -1
  192. package/build-module/components/block-toolbar/shuffle.js +82 -0
  193. package/build-module/components/block-toolbar/shuffle.js.map +1 -0
  194. package/build-module/components/block-toolbar/use-has-block-toolbar.js +36 -0
  195. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
  196. package/build-module/components/block-tools/block-selection-button.js +5 -1
  197. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  198. package/build-module/components/block-tools/empty-block-inserter.js +2 -5
  199. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  200. package/build-module/components/block-tools/index.js +9 -26
  201. package/build-module/components/block-tools/index.js.map +1 -1
  202. package/build-module/components/block-tools/use-show-block-tools.js +54 -0
  203. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -0
  204. package/build-module/components/caption/index.native.js.map +1 -1
  205. package/build-module/components/child-layout-control/index.js +38 -6
  206. package/build-module/components/child-layout-control/index.js.map +1 -1
  207. package/build-module/components/color-palette/control.js.map +1 -1
  208. package/build-module/components/colors-gradients/control.js +1 -1
  209. package/build-module/components/colors-gradients/control.js.map +1 -1
  210. package/build-module/components/date-format-picker/index.js +0 -1
  211. package/build-module/components/date-format-picker/index.js.map +1 -1
  212. package/build-module/components/font-appearance-control/index.js +1 -2
  213. package/build-module/components/font-appearance-control/index.js.map +1 -1
  214. package/build-module/components/global-styles/border-panel.js.map +1 -1
  215. package/build-module/components/global-styles/color-panel.js +1 -1
  216. package/build-module/components/global-styles/color-panel.js.map +1 -1
  217. package/build-module/components/global-styles/dimensions-panel.js +30 -19
  218. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  219. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  220. package/build-module/components/global-styles/typography-utils.js +7 -5
  221. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  222. package/build-module/components/global-styles/use-global-styles-output.js +16 -16
  223. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  224. package/build-module/components/global-styles/utils.js +2 -2
  225. package/build-module/components/global-styles/utils.js.map +1 -1
  226. package/build-module/components/grid-visualizer/grid-item-resizer.js +69 -0
  227. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -0
  228. package/build-module/components/grid-visualizer/grid-visualizer.js +73 -0
  229. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -0
  230. package/build-module/components/grid-visualizer/index.js +3 -0
  231. package/build-module/components/grid-visualizer/index.js.map +1 -0
  232. package/build-module/components/grid-visualizer/utils.js +4 -0
  233. package/build-module/components/grid-visualizer/utils.js.map +1 -0
  234. package/build-module/components/iframe/index.js +61 -16
  235. package/build-module/components/iframe/index.js.map +1 -1
  236. package/build-module/components/index.native.js +1 -1
  237. package/build-module/components/index.native.js.map +1 -1
  238. package/build-module/components/inner-blocks/use-nested-settings-update.js +8 -2
  239. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  240. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  241. package/build-module/components/inserter/menu.js +9 -3
  242. package/build-module/components/inserter/menu.js.map +1 -1
  243. package/build-module/components/inserter/menu.native.js.map +1 -1
  244. package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
  245. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  246. package/build-module/components/inserter/search-results.js +3 -2
  247. package/build-module/components/inserter/search-results.js.map +1 -1
  248. package/build-module/components/inserter/tabs.js +2 -1
  249. package/build-module/components/inserter/tabs.js.map +1 -1
  250. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  251. package/build-module/components/inspector-controls-tabs/index.js +1 -1
  252. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  253. package/build-module/components/inspector-controls-tabs/styles-tab.js +0 -4
  254. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  255. package/build-module/components/link-control/search-input.js.map +1 -1
  256. package/build-module/components/list-view/branch.js.map +1 -1
  257. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  258. package/build-module/components/list-view/index.js.map +1 -1
  259. package/build-module/components/observe-typing/index.js +5 -10
  260. package/build-module/components/observe-typing/index.js.map +1 -1
  261. package/build-module/components/panel-color-settings/index.js.map +1 -1
  262. package/build-module/components/provider/index.js.map +1 -1
  263. package/build-module/components/resizable-box-popover/index.js +3 -5
  264. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  265. package/build-module/components/responsive-block-control/index.js +1 -1
  266. package/build-module/components/responsive-block-control/index.js.map +1 -1
  267. package/build-module/components/rich-text/format-toolbar-container.js +1 -31
  268. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  269. package/build-module/components/rich-text/index.js +1 -2
  270. package/build-module/components/rich-text/index.js.map +1 -1
  271. package/build-module/components/skip-to-selected-block/index.js +8 -14
  272. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  273. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  274. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  275. package/build-module/components/url-input/index.js +5 -8
  276. package/build-module/components/url-input/index.js.map +1 -1
  277. package/build-module/hooks/background.js.map +1 -1
  278. package/build-module/hooks/block-hooks.js.map +1 -1
  279. package/build-module/hooks/dimensions.js +1 -2
  280. package/build-module/hooks/dimensions.js.map +1 -1
  281. package/build-module/hooks/font-size.js +7 -8
  282. package/build-module/hooks/font-size.js.map +1 -1
  283. package/build-module/hooks/index.js +1 -1
  284. package/build-module/hooks/index.js.map +1 -1
  285. package/build-module/hooks/layout-child.js +89 -1
  286. package/build-module/hooks/layout-child.js.map +1 -1
  287. package/build-module/hooks/layout.js +11 -4
  288. package/build-module/hooks/layout.js.map +1 -1
  289. package/build-module/hooks/line-height.js.map +1 -1
  290. package/build-module/hooks/position.js +0 -1
  291. package/build-module/hooks/position.js.map +1 -1
  292. package/build-module/hooks/spacing-visualizer.js +106 -0
  293. package/build-module/hooks/spacing-visualizer.js.map +1 -0
  294. package/build-module/hooks/use-typography-props.js +2 -3
  295. package/build-module/hooks/use-typography-props.js.map +1 -1
  296. package/build-module/layouts/grid.js +113 -16
  297. package/build-module/layouts/grid.js.map +1 -1
  298. package/build-module/private-apis.js +2 -2
  299. package/build-module/private-apis.js.map +1 -1
  300. package/build-module/store/actions.js +4 -36
  301. package/build-module/store/actions.js.map +1 -1
  302. package/build-module/store/private-actions.js +29 -45
  303. package/build-module/store/private-actions.js.map +1 -1
  304. package/build-module/store/reducer.js +2 -4
  305. package/build-module/store/reducer.js.map +1 -1
  306. package/build-module/store/selectors.js +23 -13
  307. package/build-module/store/selectors.js.map +1 -1
  308. package/build-module/utils/calculate-scale.js +11 -0
  309. package/build-module/utils/calculate-scale.js.map +1 -0
  310. package/build-style/content-rtl.css +7 -2
  311. package/build-style/content.css +7 -2
  312. package/build-style/style-rtl.css +55 -25
  313. package/build-style/style.css +55 -25
  314. package/package.json +31 -32
  315. package/src/components/block-canvas/index.js +2 -0
  316. package/src/components/block-draggable/test/index.native.js +2 -2
  317. package/src/components/block-heading-level-dropdown/index.js +17 -25
  318. package/src/components/block-inspector/index.js +0 -11
  319. package/src/components/block-list/block-invalid-warning.native.js +1 -1
  320. package/src/components/block-list/block-list-item.native.js +1 -1
  321. package/src/components/block-list/block-outline.native.js +36 -21
  322. package/src/components/block-list/block-selection-button.native.js +1 -3
  323. package/src/components/block-list/block.native.js +0 -3
  324. package/src/components/block-list/content.scss +5 -1
  325. package/src/components/block-list/index.js +55 -55
  326. package/src/components/block-list/test/block-outline.native.js +255 -0
  327. package/src/components/block-mover/index.native.js +1 -1
  328. package/src/components/block-popover/cover.js +63 -0
  329. package/src/components/block-popover/drop-zone.js +3 -4
  330. package/src/components/block-popover/index.js +1 -28
  331. package/src/components/block-preview/index.js +3 -1
  332. package/src/components/block-removal-warning-modal/index.js +5 -19
  333. package/src/components/block-rename/modal.js +1 -1
  334. package/src/components/block-settings-menu/block-parent-selector-menu-item.js +50 -0
  335. package/src/components/block-settings-menu/block-settings-dropdown.js +9 -50
  336. package/src/components/block-styles/style.scss +0 -4
  337. package/src/components/block-switcher/block-transformations-menu.native.js +1 -1
  338. package/src/components/block-toolbar/block-toolbar-menu.native.js +2 -2
  339. package/src/components/block-toolbar/index.js +5 -11
  340. package/src/components/block-toolbar/shuffle.js +93 -0
  341. package/src/components/block-toolbar/use-has-block-toolbar.js +49 -0
  342. package/src/components/block-tools/block-selection-button.js +4 -0
  343. package/src/components/block-tools/empty-block-inserter.js +3 -6
  344. package/src/components/block-tools/index.js +13 -36
  345. package/src/components/block-tools/use-show-block-tools.js +73 -0
  346. package/src/components/caption/index.native.js +1 -1
  347. package/src/components/child-layout-control/index.js +85 -44
  348. package/src/components/color-palette/control.js +1 -1
  349. package/src/components/colors-gradients/control.js +1 -1
  350. package/src/components/colors-gradients/test/control.js +2 -2
  351. package/src/components/contrast-checker/test/index.js +10 -10
  352. package/src/components/date-format-picker/index.js +0 -1
  353. package/src/components/default-block-appender/content.scss +5 -2
  354. package/src/components/font-appearance-control/index.js +0 -1
  355. package/src/components/global-styles/border-panel.js +2 -2
  356. package/src/components/global-styles/color-panel.js +1 -1
  357. package/src/components/global-styles/dimensions-panel.js +36 -24
  358. package/src/components/global-styles/image-settings-panel.js +1 -1
  359. package/src/components/global-styles/test/typography-utils.js +231 -81
  360. package/src/components/global-styles/test/use-global-styles-output.js +3 -2
  361. package/src/components/global-styles/typography-utils.js +10 -7
  362. package/src/components/global-styles/use-global-styles-output.js +14 -16
  363. package/src/components/global-styles/utils.js +2 -8
  364. package/src/components/grid-visualizer/grid-item-resizer.js +100 -0
  365. package/src/components/grid-visualizer/grid-visualizer.js +81 -0
  366. package/src/components/grid-visualizer/index.js +2 -0
  367. package/src/components/grid-visualizer/style.scss +33 -0
  368. package/src/components/grid-visualizer/utils.js +5 -0
  369. package/src/components/iframe/index.js +78 -31
  370. package/src/components/index.native.js +1 -0
  371. package/src/components/inner-blocks/use-nested-settings-update.js +12 -2
  372. package/src/components/inserter/media-tab/media-preview.js +1 -1
  373. package/src/components/inserter/menu.js +10 -4
  374. package/src/components/inserter/menu.native.js +3 -3
  375. package/src/components/inserter/mobile-tab-navigation.js +1 -1
  376. package/src/components/inserter/search-results.js +2 -1
  377. package/src/components/inserter/style.scss +10 -0
  378. package/src/components/inserter/tabs.js +2 -1
  379. package/src/components/inspector-controls/block-support-tools-panel.js +2 -2
  380. package/src/components/inspector-controls-tabs/index.js +1 -1
  381. package/src/components/inspector-controls-tabs/styles-tab.js +0 -7
  382. package/src/components/line-height-control/test/index.js +1 -1
  383. package/src/components/link-control/search-input.js +1 -1
  384. package/src/components/list-view/branch.js +1 -1
  385. package/src/components/list-view/drop-indicator.js +1 -1
  386. package/src/components/list-view/index.js +1 -1
  387. package/src/components/observe-typing/index.js +7 -10
  388. package/src/components/panel-color-settings/index.js +1 -1
  389. package/src/components/panel-color-settings/test/index.js +3 -3
  390. package/src/components/provider/index.js +1 -4
  391. package/src/components/resizable-box-popover/index.js +4 -6
  392. package/src/components/responsive-block-control/README.md +4 -4
  393. package/src/components/responsive-block-control/index.js +1 -1
  394. package/src/components/responsive-block-control/test/index.js +5 -5
  395. package/src/components/rich-text/format-toolbar-container.js +1 -48
  396. package/src/components/rich-text/index.js +1 -2
  397. package/src/components/skip-to-selected-block/index.js +10 -13
  398. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -5
  399. package/src/components/url-input/index.js +6 -15
  400. package/src/hooks/anchor.scss +1 -1
  401. package/src/hooks/background.js +1 -1
  402. package/src/hooks/block-hooks.js +1 -1
  403. package/src/hooks/dimensions.js +1 -2
  404. package/src/hooks/font-size.js +7 -12
  405. package/src/hooks/index.js +1 -0
  406. package/src/hooks/layout-child.js +91 -1
  407. package/src/hooks/layout.js +12 -1
  408. package/src/hooks/line-height.js +1 -1
  409. package/src/hooks/position.js +0 -1
  410. package/src/hooks/spacing-visualizer.js +126 -0
  411. package/src/hooks/{padding.scss → spacing.scss} +1 -1
  412. package/src/hooks/use-typography-props.js +2 -8
  413. package/src/layouts/grid.js +137 -53
  414. package/src/layouts/test/grid.js +16 -2
  415. package/src/private-apis.js +2 -2
  416. package/src/store/actions.js +4 -42
  417. package/src/store/private-actions.js +34 -69
  418. package/src/store/reducer.js +2 -8
  419. package/src/store/selectors.js +41 -46
  420. package/src/store/test/actions.js +0 -105
  421. package/src/style.scss +2 -2
  422. package/src/utils/calculate-scale.js +20 -0
  423. package/build/components/default-style-picker/index.js +0 -70
  424. package/build/components/default-style-picker/index.js.map +0 -1
  425. package/build/hooks/margin.js +0 -86
  426. package/build/hooks/margin.js.map +0 -1
  427. package/build/hooks/padding.js +0 -78
  428. package/build/hooks/padding.js.map +0 -1
  429. package/build/utils/use-can-block-toolbar-be-focused.js +0 -46
  430. package/build/utils/use-can-block-toolbar-be-focused.js.map +0 -1
  431. package/build-module/components/default-style-picker/index.js +0 -63
  432. package/build-module/components/default-style-picker/index.js.map +0 -1
  433. package/build-module/hooks/margin.js +0 -78
  434. package/build-module/hooks/margin.js.map +0 -1
  435. package/build-module/hooks/padding.js +0 -70
  436. package/build-module/hooks/padding.js.map +0 -1
  437. package/build-module/utils/use-can-block-toolbar-be-focused.js +0 -40
  438. package/build-module/utils/use-can-block-toolbar-be-focused.js.map +0 -1
  439. package/src/components/block-settings-menu/style.scss +0 -3
  440. package/src/components/default-style-picker/index.js +0 -70
  441. package/src/hooks/margin.js +0 -91
  442. package/src/hooks/padding.js +0 -82
  443. package/src/utils/use-can-block-toolbar-be-focused.js +0 -48
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_components","_element","_useBlockRefs","_usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstableRefreshSize","__unstableCoverTarget","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","useBlockElement","lastSelectedElement","mergedRefs","useMergeRefs","usePopoverScroll","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","useReducer","s","useLayoutEffect","observer","window","MutationObserver","observe","attributes","disconnect","style","useMemo","position","width","offsetWidth","height","offsetHeight","popoverAnchor","undefined","getBoundingClientRect","_lastSelectedBCR$left","_lastSelectedBCR$top","_lastSelectedBCR$righ","_lastSelectedBCR$bott","selectedBCR","lastSelectedBCR","left","Math","min","Infinity","top","right","max","bottom","DOMRect","contextElement","_react","createElement","Popover","animate","focusOnMount","anchor","__unstableSlotName","inline","placement","resize","flip","className","classnames","variant","_default","exports","default","forwardRef"],"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { Popover } from '@wordpress/components';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nfunction BlockPopover(\n\t{\n\t\tclientId,\n\t\tbottomClientId,\n\t\tchildren,\n\t\t__unstableRefreshSize,\n\t\t__unstableCoverTarget = false,\n\t\t__unstablePopoverSlot,\n\t\t__unstableContentRef,\n\t\tshift = true,\n\t\t...props\n\t},\n\tref\n) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tusePopoverScroll( __unstableContentRef ),\n\t] );\n\n\tconst [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tforceRecomputePopoverDimensions,\n\t] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\t// When blocks are moved up/down, they are animated to their new position by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new window.MutationObserver(\n\t\t\tforceRecomputePopoverDimensions\n\t\t);\n\t\tobserver.observe( selectedElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ selectedElement ] );\n\n\tconst style = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\tlastSelectedElement !== selectedElement\n\t\t) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\twidth: selectedElement.offsetWidth,\n\t\t\theight: selectedElement.offsetHeight,\n\t\t};\n\t}, [\n\t\tselectedElement,\n\t\tlastSelectedElement,\n\t\t__unstableRefreshSize,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\t( bottomClientId && ! lastSelectedElement )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst selectedBCR = selectedElement.getBoundingClientRect();\n\t\t\t\tconst lastSelectedBCR =\n\t\t\t\t\tlastSelectedElement?.getBoundingClientRect();\n\n\t\t\t\t// Get the biggest rectangle that encompasses completely the currently\n\t\t\t\t// selected element and the last selected element:\n\t\t\t\t// - for top/left coordinates, use the smaller numbers\n\t\t\t\t// - for the bottom/right coordinates, use the largest numbers\n\t\t\t\tconst left = Math.min(\n\t\t\t\t\tselectedBCR.left,\n\t\t\t\t\tlastSelectedBCR?.left ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst top = Math.min(\n\t\t\t\t\tselectedBCR.top,\n\t\t\t\t\tlastSelectedBCR?.top ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst right = Math.max(\n\t\t\t\t\tselectedBCR.right,\n\t\t\t\t\tlastSelectedBCR.right ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst bottom = Math.max(\n\t\t\t\t\tselectedBCR.bottom,\n\t\t\t\t\tlastSelectedBCR.bottom ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst width = right - left;\n\t\t\t\tconst height = bottom - top;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t\tcontextElement: selectedElement,\n\t\t};\n\t}, [\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t\tselectedElement,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ mergedRefs }\n\t\t\tanimate={ false }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\tplacement=\"top-start\"\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ __unstableCoverTarget && <div style={ style }>{ children }</div> }\n\t\t\t{ ! __unstableCoverTarget && children }\n\t\t</Popover>\n\t);\n}\n\nexport default forwardRef( BlockPopover );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAUA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,MAAMM,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,SAASC,YAAYA,CACpB;EACCC,QAAQ;EACRC,cAAc;EACdC,QAAQ;EACRC,qBAAqB;EACrBC,qBAAqB,GAAG,KAAK;EAC7BC,qBAAqB;EACrBC,oBAAoB;EACpBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACJ,CAAC,EACDC,GAAG,EACF;EACD,MAAMC,eAAe,GAAG,IAAAC,uCAAe,EAAEX,QAAS,CAAC;EACnD,MAAMY,mBAAmB,GAAG,IAAAD,uCAAe,EAAEV,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAID,QAAS,CAAC;EACzE,MAAMa,UAAU,GAAG,IAAAC,qBAAY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,mBAAqB,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,OACC,IAAAyC,MAAA,CAAAC,aAAA,EAAC9D,WAAA,CAAA+D,OAAO;IACP9C,GAAG,EAAGI,UAAY;IAClB2C,OAAO,EAAG,KAAO;IACjBC,YAAY,EAAG,KAAO;IACtBC,MAAM,EAAGxB;IACT;IACA;IAAA;IACAyB,kBAAkB,EAAGtD,qBAAuB;IAC5CuD,MAAM,EAAG,CAAEvD,qBAAuB;IAClCwD,SAAS,EAAC,WAAW;IACrBC,MAAM,EAAG,KAAO;IAChBC,IAAI,EAAG,KAAO;IACdxD,KAAK,EAAGA,KAAO;IAAA,GACVC,KAAK;IACVwD,SAAS,EAAG,IAAAC,mBAAU,EACrB,4BAA4B,EAC5BzD,KAAK,CAACwD,SACP,CAAG;IACHE,OAAO,EAAC;EAAU,GAEhB9D,qBAAqB,IAAI,IAAAiD,MAAA,CAAAC,aAAA;IAAK3B,KAAK,EAAGA;EAAO,GAAGzB,QAAe,CAAC,EAChE,CAAEE,qBAAqB,IAAIF,QACrB,CAAC;AAEZ;AAAC,IAAAiE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAEvE,YAAa,CAAC"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_components","_element","_useBlockRefs","_usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","BlockPopover","clientId","bottomClientId","children","__unstablePopoverSlot","__unstableContentRef","shift","props","ref","selectedElement","useBlockElement","lastSelectedElement","mergedRefs","useMergeRefs","usePopoverScroll","popoverDimensionsRecomputeCounter","forceRecomputePopoverDimensions","useReducer","s","useLayoutEffect","observer","window","MutationObserver","observe","attributes","disconnect","popoverAnchor","useMemo","undefined","getBoundingClientRect","_lastSelectedBCR$left","_lastSelectedBCR$top","_lastSelectedBCR$righ","_lastSelectedBCR$bott","selectedBCR","lastSelectedBCR","left","Math","min","Infinity","top","right","max","bottom","width","height","DOMRect","contextElement","_react","createElement","Popover","animate","focusOnMount","anchor","__unstableSlotName","inline","placement","resize","flip","className","classnames","variant","_default","exports","default","forwardRef"],"sources":["@wordpress/block-editor/src/components/block-popover/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { Popover } from '@wordpress/components';\nimport {\n\tforwardRef,\n\tuseMemo,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nfunction BlockPopover(\n\t{\n\t\tclientId,\n\t\tbottomClientId,\n\t\tchildren,\n\t\t__unstablePopoverSlot,\n\t\t__unstableContentRef,\n\t\tshift = true,\n\t\t...props\n\t},\n\tref\n) {\n\tconst selectedElement = useBlockElement( clientId );\n\tconst lastSelectedElement = useBlockElement( bottomClientId ?? clientId );\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tusePopoverScroll( __unstableContentRef ),\n\t] );\n\n\tconst [\n\t\tpopoverDimensionsRecomputeCounter,\n\t\tforceRecomputePopoverDimensions,\n\t] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\t// When blocks are moved up/down, they are animated to their new position by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! selectedElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new window.MutationObserver(\n\t\t\tforceRecomputePopoverDimensions\n\t\t);\n\t\tobserver.observe( selectedElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ selectedElement ] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverDimensionsRecomputeCounter is by definition always equal or greater\n\t\t\t// than 0. This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverDimensionsRecomputeCounter < 0 ||\n\t\t\t! selectedElement ||\n\t\t\t( bottomClientId && ! lastSelectedElement )\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst selectedBCR = selectedElement.getBoundingClientRect();\n\t\t\t\tconst lastSelectedBCR =\n\t\t\t\t\tlastSelectedElement?.getBoundingClientRect();\n\n\t\t\t\t// Get the biggest rectangle that encompasses completely the currently\n\t\t\t\t// selected element and the last selected element:\n\t\t\t\t// - for top/left coordinates, use the smaller numbers\n\t\t\t\t// - for the bottom/right coordinates, use the largest numbers\n\t\t\t\tconst left = Math.min(\n\t\t\t\t\tselectedBCR.left,\n\t\t\t\t\tlastSelectedBCR?.left ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst top = Math.min(\n\t\t\t\t\tselectedBCR.top,\n\t\t\t\t\tlastSelectedBCR?.top ?? Infinity\n\t\t\t\t);\n\t\t\t\tconst right = Math.max(\n\t\t\t\t\tselectedBCR.right,\n\t\t\t\t\tlastSelectedBCR.right ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst bottom = Math.max(\n\t\t\t\t\tselectedBCR.bottom,\n\t\t\t\t\tlastSelectedBCR.bottom ?? -Infinity\n\t\t\t\t);\n\t\t\t\tconst width = right - left;\n\t\t\t\tconst height = bottom - top;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t\tcontextElement: selectedElement,\n\t\t};\n\t}, [\n\t\tbottomClientId,\n\t\tlastSelectedElement,\n\t\tselectedElement,\n\t\tpopoverDimensionsRecomputeCounter,\n\t] );\n\n\tif ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ mergedRefs }\n\t\t\tanimate={ false }\n\t\t\tfocusOnMount={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\tplacement=\"top-start\"\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tshift={ shift }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t{ children }\n\t\t</Popover>\n\t);\n}\n\nexport default forwardRef( BlockPopover );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAUA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,MAAMM,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,SAASC,YAAYA,CACpB;EACCC,QAAQ;EACRC,cAAc;EACdC,QAAQ;EACRC,qBAAqB;EACrBC,oBAAoB;EACpBC,KAAK,GAAG,IAAI;EACZ,GAAGC;AACJ,CAAC,EACDC,GAAG,EACF;EACD,MAAMC,eAAe,GAAG,IAAAC,uCAAe,EAAET,QA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,MAAM,EAAG,CAAEnD,qBAAuB;IAClCoD,SAAS,EAAC,WAAW;IACrBC,MAAM,EAAG,KAAO;IAChBC,IAAI,EAAG,KAAO;IACdpD,KAAK,EAAGA,KAAO;IAAA,GACVC,KAAK;IACVoD,SAAS,EAAG,IAAAC,mBAAU,EACrB,4BAA4B,EAC5BrD,KAAK,CAACoD,SACP,CAAG;IACHE,OAAO,EAAC;EAAU,GAEhB1D,QACM,CAAC;AAEZ;AAAC,IAAA2D,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAEjE,YAAa,CAAC"}
@@ -30,11 +30,12 @@ var _blockList = require("../block-list");
30
30
  * Internal dependencies
31
31
  */
32
32
 
33
+ const EMPTY_ADDITIONAL_STYLES = [];
33
34
  function BlockPreview({
34
35
  blocks,
35
36
  viewportWidth = 1200,
36
37
  minHeight,
37
- additionalStyles = [],
38
+ additionalStyles = EMPTY_ADDITIONAL_STYLES,
38
39
  // Deprecated props:
39
40
  __experimentalMinHeight,
40
41
  __experimentalPadding
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_data","_element","_deprecated","_provider","_auto","_editorStyles","_store","_blockList","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","_react","createElement","ExperimentalBlockEditorProvider","value","default","_default","exports","memo","useBlockPreview","props","layout","styles","undefined","disabledRef","useDisabled","ref","useMergeRefs","children","BlockListItems","renderAppender","className","classnames"],"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useDisabled, useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { ExperimentalBlockEditorProvider } from '../provider';\nimport AutoHeightBlockPreview from './auto';\nimport EditorStyles from '../editor-styles';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockListItems } from '../block-list';\n\nexport function BlockPreview( {\n\tblocks,\n\tviewportWidth = 1200,\n\tminHeight,\n\tadditionalStyles = [],\n\t// Deprecated props:\n\t__experimentalMinHeight,\n\t__experimentalPadding,\n} ) {\n\tif ( __experimentalMinHeight ) {\n\t\tminHeight = __experimentalMinHeight;\n\t\tdeprecated( 'The __experimentalMinHeight prop', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'minHeight',\n\t\t} );\n\t}\n\tif ( __experimentalPadding ) {\n\t\tadditionalStyles = [\n\t\t\t...additionalStyles,\n\t\t\t{ css: `body { padding: ${ __experimentalPadding }px; }` },\n\t\t];\n\t\tdeprecated( 'The __experimentalPadding prop of BlockPreview', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t\talternative: 'additionalStyles',\n\t\t} );\n\t}\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\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: classnames(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-preview__live-content',\n\t\t\t'components-disabled'\n\t\t),\n\t\tchildren: blocks?.length ? children : null,\n\t};\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,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;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAOO,SAASU,YAAYA,CAAE;EAC7BC,MAAM;EACNC,aAAa,GAAG,IAAI;EACpBC,SAAS;EACTC,gBAAgB,GAAG,EAAE;EACrB;EACAC,uBAAuB;EACvBC;AACD,CAAC,EAAG;EACH,IAAKD,uBAAuB,EAAG;IAC9BF,SAAS,GAAGE,uBAAuB;IACnC,IAAAE,mBAAU,EAAE,kCAAkC,EAAE;MAC/CC,KAAK,EAAE,KAAK;MACZC,OAAO,EAAE,KAAK;MACdC,WAAW,EAAE;IACd,CAAE,CAAC;EACJ;EACA,IAAKJ,qBAAqB,EAAG;IAC5BF,gBAAgB,GAAG,CAClB,GAAGA,gBAAgB,EACnB;MAAEO,GAAG,EAAG,mBAAmBL,qBAAuB;IAAO,CAAC,CAC1D;IACD,IAAAC,mBAAU,EAAE,gDAAgD,EAAE;MAC7DC,KAAK,EAAE,KAA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{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_data","_element","_deprecated","_provider","_auto","_editorStyles","_store","_blockList","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","_react","createElement","ExperimentalBlockEditorProvider","value","default","_default","exports","memo","useBlockPreview","props","layout","styles","undefined","disabledRef","useDisabled","ref","useMergeRefs","children","BlockListItems","renderAppender","className","classnames"],"sources":["@wordpress/block-editor/src/components/block-preview/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useDisabled, useMergeRefs } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { ExperimentalBlockEditorProvider } from '../provider';\nimport AutoHeightBlockPreview from './auto';\nimport 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: classnames(\n\t\t\tprops.className,\n\t\t\t'block-editor-block-preview__live-content',\n\t\t\t'components-disabled'\n\t\t),\n\t\tchildren: blocks?.length ? children : null,\n\t};\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,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,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MAAQI,KAAK,CAACC,OAAO,CAAEtB,MAAO,CAAC,GAAGA,MAAM,GAAG,CAAEA,MAAM,CAAI,EACvD,CAAEA,MAAM,CACT,CAAC;EAED,MAAMyC,QAAQ,GACb,IAAAjB,MAAA,CAAAC,aAAA,EAAChC,SAAA,CAAAiC,+BAA+B;IAC/BC,KAAK,EAAGP,cAAgB;IACxBJ,QAAQ,EAAGA;EAAU,GAErB,IAAAQ,MAAA,CAAAC,aAAA,EAAC9B,aAAA,CAAAiC,OAAY,MAAE,CAAC,EAChB,IAAAJ,MAAA,CAAAC,aAAA,EAAC5B,UAAA,CAAA6C,cAAc;IAACC,cAAc,EAAG,KAAO;IAACT,MAAM,EAAGA;EAAQ,CAAE,CAC5B,CACjC;EAED,OAAO;IACN,GAAGD,KAAK;IACRM,GAAG;IACHK,SAAS,EAAE,IAAAC,mBAAU,EACpBZ,KAAK,CAACW,SAAS,EACf,0CAA0C,EAC1C,qBACD,CAAC;IACDH,QAAQ,EAAEzC,MAAM,EAAEuB,MAAM,GAAGkB,QAAQ,GAAG;EACvC,CAAC;AACF"}
@@ -25,8 +25,7 @@ function BlockRemovalWarningModal({
25
25
  const {
26
26
  clientIds,
27
27
  selectPrevious,
28
- blockNamesForPrompt,
29
- messageType
28
+ message
30
29
  } = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getRemovalPromptData());
31
30
  const {
32
31
  clearBlockRemovalPrompt,
@@ -42,10 +41,9 @@ function BlockRemovalWarningModal({
42
41
  setBlockRemovalRules();
43
42
  };
44
43
  }, [rules, setBlockRemovalRules]);
45
- if (!blockNamesForPrompt) {
44
+ if (!message) {
46
45
  return;
47
46
  }
48
- const message = messageType === 'templates' ? (0, _i18n._n)('Deleting this block will stop your post or page content from displaying on this template. It is not recommended.', 'Deleting these blocks will stop your post or page content from displaying on this template. It is not recommended.', blockNamesForPrompt.length) : (0, _i18n._n)('Deleting this block could break patterns on your site that have content linked to it. Are you sure you want to delete it?', 'Deleting these blocks could break patterns on your site that have content linked to them. Are you sure you want to delete them?', blockNamesForPrompt.length);
49
47
  const onConfirmRemoval = () => {
50
48
  privateRemoveBlocks(clientIds, selectPrevious, /* force */true);
51
49
  clearBlockRemovalPrompt();
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_components","_i18n","_store","_lockUnlock","BlockRemovalWarningModal","rules","clientIds","selectPrevious","blockNamesForPrompt","messageType","useSelect","select","unlock","blockEditorStore","getRemovalPromptData","clearBlockRemovalPrompt","setBlockRemovalRules","privateRemoveBlocks","useDispatch","useEffect","message","_n","length","onConfirmRemoval","_react","createElement","Modal","title","__","onRequestClose","size","__experimentalHStack","justify","Button","variant","onClick"],"sources":["@wordpress/block-editor/src/components/block-removal-warning-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { __, _n } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport function BlockRemovalWarningModal( { rules } ) {\n\tconst { clientIds, selectPrevious, blockNamesForPrompt, messageType } =\n\t\tuseSelect( ( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getRemovalPromptData()\n\t\t);\n\n\tconst {\n\t\tclearBlockRemovalPrompt,\n\t\tsetBlockRemovalRules,\n\t\tprivateRemoveBlocks,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\t// Load block removal rules, simultaneously signalling that the block\n\t// removal prompt is in place.\n\tuseEffect( () => {\n\t\tsetBlockRemovalRules( rules );\n\t\treturn () => {\n\t\t\tsetBlockRemovalRules();\n\t\t};\n\t}, [ rules, setBlockRemovalRules ] );\n\n\tif ( ! blockNamesForPrompt ) {\n\t\treturn;\n\t}\n\n\tconst message =\n\t\tmessageType === 'templates'\n\t\t\t? _n(\n\t\t\t\t\t'Deleting this block will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\t'Deleting these blocks will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\tblockNamesForPrompt.length\n\t\t\t )\n\t\t\t: _n(\n\t\t\t\t\t'Deleting this block could break patterns on your site that have content linked to it. Are you sure you want to delete it?',\n\t\t\t\t\t'Deleting these blocks could break patterns on your site that have content linked to them. Are you sure you want to delete them?',\n\t\t\t\t\tblockNamesForPrompt.length\n\t\t\t );\n\n\tconst onConfirmRemoval = () => {\n\t\tprivateRemoveBlocks( clientIds, selectPrevious, /* force */ true );\n\t\tclearBlockRemovalPrompt();\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Be careful!' ) }\n\t\t\tonRequestClose={ clearBlockRemovalPrompt }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<p>{ message }</p>\n\t\t\t<HStack justify=\"right\">\n\t\t\t\t<Button variant=\"tertiary\" onClick={ clearBlockRemovalPrompt }>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"primary\" onClick={ onConfirmRemoval }>\n\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t</Button>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIO,SAASM,wBAAwBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACrD,MAAM;IAAEC,SAAS;IAAEC,cAAc;IAAEC,mBAAmB;IAAEC;EAAY,CAAC,GACpE,IAAAC,eAAS,EAAIC,MAAM,IAClB,IAAAC,kBAAM,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AAE,EAAE,QAAS,CACR,CAAC,EACT,IAAAJ,MAAA,CAAAC,aAAA,EAACzB,WAAA,CAAAiC,MAAM;IAACC,OAAO,EAAC,SAAS;IAACC,OAAO,EAAGZ;EAAkB,GACnD,IAAAK,QAAE,EAAE,QAAS,CACR,CACD,CACF,CAAC;AAEV"}
1
+ {"version":3,"names":["_element","require","_data","_components","_i18n","_store","_lockUnlock","BlockRemovalWarningModal","rules","clientIds","selectPrevious","message","useSelect","select","unlock","blockEditorStore","getRemovalPromptData","clearBlockRemovalPrompt","setBlockRemovalRules","privateRemoveBlocks","useDispatch","useEffect","onConfirmRemoval","_react","createElement","Modal","title","__","onRequestClose","size","__experimentalHStack","justify","Button","variant","onClick"],"sources":["@wordpress/block-editor/src/components/block-removal-warning-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport function BlockRemovalWarningModal( { rules } ) {\n\tconst { clientIds, selectPrevious, message } = useSelect( ( select ) =>\n\t\tunlock( select( blockEditorStore ) ).getRemovalPromptData()\n\t);\n\n\tconst {\n\t\tclearBlockRemovalPrompt,\n\t\tsetBlockRemovalRules,\n\t\tprivateRemoveBlocks,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\t// Load block removal rules, simultaneously signalling that the block\n\t// removal prompt is in place.\n\tuseEffect( () => {\n\t\tsetBlockRemovalRules( rules );\n\t\treturn () => {\n\t\t\tsetBlockRemovalRules();\n\t\t};\n\t}, [ rules, setBlockRemovalRules ] );\n\n\tif ( ! message ) {\n\t\treturn;\n\t}\n\n\tconst onConfirmRemoval = () => {\n\t\tprivateRemoveBlocks( clientIds, selectPrevious, /* force */ true );\n\t\tclearBlockRemovalPrompt();\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Be careful!' ) }\n\t\t\tonRequestClose={ clearBlockRemovalPrompt }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<p>{ message }</p>\n\t\t\t<HStack justify=\"right\">\n\t\t\t\t<Button variant=\"tertiary\" onClick={ clearBlockRemovalPrompt }>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"primary\" onClick={ onConfirmRemoval }>\n\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t</Button>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIO,SAASM,wBAAwBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACrD,MAAM;IAAEC,SAAS;IAAEC,cAAc;IAAEC;EAAQ,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IACjE,IAAAC,kBAAM,EAAED,MAAM,CAAEE,YAAiB,CAAE,CAAC,CAACC,oBAAoB,CAAC,CAC3D,CAAC;EAED,MAAM;IACLC,uBAAuB;IACvBC,oBAAoB;IACpBC;EACD,CAAC,GAAG,IAAAL,kBAAM,EAAE,IAAAM,iBAAW,EAAEL,YAAiB,CAAE,CAAC;;EAE7C;EACA;EACA,IAAAM,kBAAS,EAAE,MAAM;IAChBH,oBAAoB,CAAEV,KAAM,CAAC;IAC7B,OAAO,MAAM;MACZU,oBAAoB,CAAC,CAAC;IACvB,CAAC;EACF,CAAC,EAAE,CAAEV,KAAK,EAAEU,oBAAoB,CAAG,CAAC;EAEpC,IAAK,CAAEP,OAAO,EAAG;IAChB;EACD;EAEA,MAAMW,gBAAgB,GAAGA,CAAA,KAAM;IAC9BH,mBAAmB,CAAEV,SAAS,EAAEC,cAAc,EAAE,WAAY,IAAK,CAAC;IAClEO,uBAAuB,CAAC,CAAC;EAC1B,CAAC;EAED,OACC,IAAAM,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAsB,KAAK;IACLC,KAAK,EAAG,IAAAC,QAAE,EAAE,aAAc,CAAG;IAC7BC,cAAc,EAAGX,uBAAyB;IAC1CY,IAAI,EAAC;EAAQ,GAEb,IAAAN,MAAA,CAAAC,aAAA,aAAKb,OAAY,CAAC,EAClB,IAAAY,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAA2B,oBAAM;IAACC,OAAO,EAAC;EAAO,GACtB,IAAAR,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAA6B,MAAM;IAACC,OAAO,EAAC,UAAU;IAACC,OAAO,EAAGjB;EAAyB,GAC3D,IAAAU,QAAE,EAAE,QAAS,CACR,CAAC,EACT,IAAAJ,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAA6B,MAAM;IAACC,OAAO,EAAC,SAAS;IAACC,OAAO,EAAGZ;EAAkB,GACnD,IAAAK,QAAE,EAAE,QAAS,CACR,CACD,CACF,CAAC;AAEV"}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_compose","_i18n","_element","_a11y","_isEmptyString","_interopRequireDefault","BlockRenameModal","blockName","originalBlockName","onClose","onSave","editedBlockName","setEditedBlockName","useState","nameHasChanged","nameIsOriginal","nameIsEmpty","isEmptyString","isNameValid","autoSelectInputText","event","target","select","dialogDescription","useInstanceId","handleSubmit","message","sprintf","__","speak","_react","createElement","Modal","title","onRequestClose","overlayClassName","aria","describedby","focusOnMount","id","onSubmit","e","preventDefault","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","label","hideLabelFromVision","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 { useInstanceId } from '@wordpress/compose';\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} ) {\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 dialogDescription = useInstanceId(\n\t\tBlockRenameModal,\n\t\t`block-editor-rename-modal__description`\n\t);\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\taria={ {\n\t\t\t\tdescribedby: dialogDescription,\n\t\t\t} }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t>\n\t\t\t<p id={ dialogDescription }>\n\t\t\t\t{ __( 'Enter a custom name for this block.' ) }\n\t\t\t</p>\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={ __( 'Block name' ) }\n\t\t\t\t\t\thideLabelFromVision={ true }\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":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CAAE7B,WAAa;IAC/BuC,OAAO,EAAC,SAAS;IACjBE,IAAI,EAAC;EAAQ,GAEX,IAAA/B,QAAE,EAAE,MAAO,CACN,CACD,CACD,CACH,CACA,CAAC;AAEV"}
1
+ {"version":3,"names":["_components","require","_compose","_i18n","_element","_a11y","_isEmptyString","_interopRequireDefault","BlockRenameModal","blockName","originalBlockName","onClose","onSave","editedBlockName","setEditedBlockName","useState","nameHasChanged","nameIsOriginal","nameIsEmpty","isEmptyString","isNameValid","autoSelectInputText","event","target","select","dialogDescription","useInstanceId","handleSubmit","message","sprintf","__","speak","_react","createElement","Modal","title","onRequestClose","overlayClassName","aria","describedby","focusOnMount","id","onSubmit","e","preventDefault","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","label","hideLabelFromVision","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 { useInstanceId } from '@wordpress/compose';\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} ) {\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 dialogDescription = useInstanceId(\n\t\tBlockRenameModal,\n\t\t`block-editor-rename-modal__description`\n\t);\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\taria={ {\n\t\t\t\tdescribedby: dialogDescription,\n\t\t\t} }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t>\n\t\t\t<p id={ dialogDescription }>\n\t\t\t\t{ __( 'Enter a custom name for this block.' ) }\n\t\t\t</p>\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={ __( 'Block name' ) }\n\t\t\t\t\t\thideLabelFromVision\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,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,cAAA,GAAAC,sBAAA,CAAAN,OAAA;AAlBA;AACA;AACA;;AAaA;AACA;AACA;;AAGe,SAASO,gBAAgBA,CAAE;EACzCC,SAAS;EACTC,iBAAiB;EACjBC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,eAAe,EAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAQ,EAAEN,SAAU,CAAC;EAErE,MAAMO,cAAc,GAAGH,eAAe,KAAKJ,SAAS;EACpD,MAAMQ,cAAc,GAAGJ,eAAe,KAAKH,iBAAiB;EAC5D,MAAMQ,WAAW,GAAG,IAAAC,sBAAa,EAAEN,eAAgB,CAAC;EAEpD,MAAMO,WAAW,GAAGJ,cAAc,IAAIC,cAAc;EAEpD,MAAMI,mBAAmB,GAAKC,KAAK,IAAMA,KAAK,CAACC,MAAM,C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BsC,KAAK,EAAG,IAAArB,QAAE,EAAE,YAAa,CAAG;IAC5BsB,mBAAmB;IACnBC,WAAW,EAAG3C,iBAAmB;IACjC4C,QAAQ,EAAGxC,kBAAoB;IAC/ByC,OAAO,EAAGlC;EAAqB,CAC/B,CAAC,EACF,IAAAW,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAAwD,oBAAM;IAACC,OAAO,EAAC;EAAO,GACtB,IAAAzB,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAA0D,MAAM;IACNT,qBAAqB;IACrBU,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGjD;EAAS,GAEjB,IAAAmB,QAAE,EAAE,QAAS,CACR,CAAC,EAET,IAAAE,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAA0D,MAAM;IACNT,qBAAqB;IACrB,iBAAgB,CAAE7B,WAAa;IAC/BuC,OAAO,EAAC,SAAS;IACjBE,IAAI,EAAC;EAAQ,GAEX,IAAA/B,QAAE,EAAE,MAAO,CACN,CACD,CACD,CACH,CACA,CAAC;AAEV"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = BlockParentSelectorMenuItem;
8
+ var _react = require("react");
9
+ var _element = require("@wordpress/element");
10
+ var _components = require("@wordpress/components");
11
+ var _compose = require("@wordpress/compose");
12
+ var _data = require("@wordpress/data");
13
+ var _i18n = require("@wordpress/i18n");
14
+ var _blockIcon = _interopRequireDefault(require("../block-icon"));
15
+ var _utils = require("../block-toolbar/utils");
16
+ var _store = require("../../store");
17
+ /**
18
+ * WordPress dependencies
19
+ */
20
+
21
+ /**
22
+ * Internal dependencies
23
+ */
24
+
25
+ function BlockParentSelectorMenuItem({
26
+ parentClientId,
27
+ parentBlockType
28
+ }) {
29
+ const isSmallViewport = (0, _compose.useViewportMatch)('medium', '<');
30
+ const {
31
+ selectBlock
32
+ } = (0, _data.useDispatch)(_store.store);
33
+
34
+ // Allows highlighting the parent block outline when focusing or hovering
35
+ // the parent block selector within the child.
36
+ const menuItemRef = (0, _element.useRef)();
37
+ const gesturesProps = (0, _utils.useShowHoveredOrFocusedGestures)({
38
+ ref: menuItemRef,
39
+ highlightParent: true
40
+ });
41
+ if (!isSmallViewport) {
42
+ return null;
43
+ }
44
+ return (0, _react.createElement)(_components.MenuItem, {
45
+ ...gesturesProps,
46
+ ref: menuItemRef,
47
+ icon: (0, _react.createElement)(_blockIcon.default, {
48
+ icon: parentBlockType.icon
49
+ }),
50
+ onClick: () => selectBlock(parentClientId)
51
+ }, (0, _i18n.sprintf)( /* translators: %s: Name of the block's parent. */
52
+ (0, _i18n.__)('Select parent block (%s)'), parentBlockType.title));
53
+ }
54
+ //# sourceMappingURL=block-parent-selector-menu-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_element","require","_components","_compose","_data","_i18n","_blockIcon","_interopRequireDefault","_utils","_store","BlockParentSelectorMenuItem","parentClientId","parentBlockType","isSmallViewport","useViewportMatch","selectBlock","useDispatch","blockEditorStore","menuItemRef","useRef","gesturesProps","useShowHoveredOrFocusedGestures","ref","highlightParent","_react","createElement","MenuItem","icon","default","onClick","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;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKe,SAASS,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,OACC,IAAAW,MAAA,CAAAC,aAAA,EAACvB,WAAA,CAAAwB,QAAQ;IAAA,GACHN,aAAa;IAClBE,GAAG,EAAGJ,WAAa;IACnBS,IAAI,EAAG,IAAAH,MAAA,CAAAC,aAAA,EAACnB,UAAA,CAAAsB,OAAS;MAACD,IAAI,EAAGf,eAAe,CAACe;IAAM,CAAE,CAAG;IACpDE,OAAO,EAAGA,CAAA,KAAMd,WAAW,CAAEJ,cAAe;EAAG,GAE7C,IAAAmB,aAAO,GACR;EACA,IAAAC,QAAE,EAAE,0BAA2B,CAAC,EAChCnB,eAAe,CAACoB,KACjB,CACS,CAAC;AAEb"}
@@ -16,13 +16,12 @@ var _i18n = require("@wordpress/i18n");
16
16
  var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
17
17
  var _compose = require("@wordpress/compose");
18
18
  var _blockActions = _interopRequireDefault(require("../block-actions"));
19
- var _blockIcon = _interopRequireDefault(require("../block-icon"));
20
19
  var _blockHtmlConvertButton = _interopRequireDefault(require("./block-html-convert-button"));
21
20
  var _blockSettingsMenuFirstItem = _interopRequireDefault(require("./block-settings-menu-first-item"));
22
21
  var _blockSettingsMenuControls = _interopRequireDefault(require("../block-settings-menu-controls"));
22
+ var _blockParentSelectorMenuItem = _interopRequireDefault(require("./block-parent-selector-menu-item"));
23
23
  var _store = require("../../store");
24
24
  var _lockUnlock = require("../../lock-unlock");
25
- var _utils = require("../block-toolbar/utils");
26
25
  /**
27
26
  * WordPress dependencies
28
27
  */
@@ -49,35 +48,6 @@ function CopyMenuItem({
49
48
  ref: ref
50
49
  }, copyMenuItemLabel);
51
50
  }
52
- function ParentSelectorMenuItem({
53
- parentClientId,
54
- parentBlockType
55
- }) {
56
- const isSmallViewport = (0, _compose.useViewportMatch)('medium', '<');
57
- const {
58
- selectBlock
59
- } = (0, _data.useDispatch)(_store.store);
60
-
61
- // Allows highlighting the parent block outline when focusing or hovering
62
- // the parent block selector within the child.
63
- const menuItemRef = (0, _element.useRef)();
64
- const gesturesProps = (0, _utils.useShowHoveredOrFocusedGestures)({
65
- ref: menuItemRef,
66
- highlightParent: true
67
- });
68
- if (!isSmallViewport) {
69
- return null;
70
- }
71
- return (0, _react.createElement)(_components.MenuItem, {
72
- ...gesturesProps,
73
- ref: menuItemRef,
74
- icon: (0, _react.createElement)(_blockIcon.default, {
75
- icon: parentBlockType.icon
76
- }),
77
- onClick: () => selectBlock(parentClientId)
78
- }, (0, _i18n.sprintf)( /* translators: %s: Name of the block's parent. */
79
- (0, _i18n.__)('Select parent block (%s)'), parentBlockType.title));
80
- }
81
51
  function BlockSettingsDropdown({
82
52
  block,
83
53
  clientIds,
@@ -96,7 +66,8 @@ function BlockSettingsDropdown({
96
66
  onlyBlock,
97
67
  parentBlockType,
98
68
  previousBlockClientId,
99
- selectedBlockClientIds
69
+ selectedBlockClientIds,
70
+ openedBlockSettingsMenu
100
71
  } = (0, _data.useSelect)(select => {
101
72
  const {
102
73
  getBlockCount,
@@ -104,8 +75,9 @@ function BlockSettingsDropdown({
104
75
  getBlockRootClientId,
105
76
  getPreviousBlockClientId,
106
77
  getSelectedBlockClientIds,
107
- getBlockAttributes
108
- } = select(_store.store);
78
+ getBlockAttributes,
79
+ getOpenedBlockSettingsMenu
80
+ } = (0, _lockUnlock.unlock)(select(_store.store));
109
81
  const {
110
82
  getActiveBlockVariation
111
83
  } = select(_blocks.store);
@@ -116,14 +88,14 @@ function BlockSettingsDropdown({
116
88
  onlyBlock: 1 === getBlockCount(_firstParentClientId),
117
89
  parentBlockType: _firstParentClientId && (getActiveBlockVariation(parentBlockName, getBlockAttributes(_firstParentClientId)) || (0, _blocks.getBlockType)(parentBlockName)),
118
90
  previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
119
- selectedBlockClientIds: getSelectedBlockClientIds()
91
+ selectedBlockClientIds: getSelectedBlockClientIds(),
92
+ openedBlockSettingsMenu: getOpenedBlockSettingsMenu()
120
93
  };
121
94
  }, [firstBlockClientId]);
122
95
  const {
123
96
  getBlockOrder,
124
97
  getSelectedBlockClientIds
125
98
  } = (0, _data.useSelect)(_store.store);
126
- const openedBlockSettingsMenu = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getOpenedBlockSettingsMenu(), []);
127
99
  const {
128
100
  setOpenedBlockSettingsMenu
129
101
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
@@ -236,7 +208,7 @@ function BlockSettingsDropdown({
236
208
  fillProps: {
237
209
  onClose
238
210
  }
239
- }), !parentBlockIsSelected && !!firstParentClientId && (0, _react.createElement)(ParentSelectorMenuItem, {
211
+ }), !parentBlockIsSelected && !!firstParentClientId && (0, _react.createElement)(_blockParentSelectorMenuItem.default, {
240
212
  parentClientId: firstParentClientId,
241
213
  parentBlockType: parentBlockType
242
214
  }), count === 1 && (0, _react.createElement)(_blockHtmlConvertButton.default, {
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_components","_data","_icons","_element","_i18n","_keyboardShortcuts","_compose","_blockActions","_interopRequireDefault","_blockIcon","_blockHtmlConvertButton","_blockSettingsMenuFirstItem","_blockSettingsMenuControls","_store","_lockUnlock","_utils","POPOVER_PROPS","className","placement","CopyMenuItem","clientIds","onCopy","label","getBlocksByClientId","useSelect","blockEditorStore","ref","useCopyToClipboard","serialize","copyMenuItemLabel","__","_react","createElement","MenuItem","ParentSelectorMenuItem","parentClientId","parentBlockType","isSmallViewport","useViewportMatch","selectBlock","useDispatch","menuItemRef","useRef","gesturesProps","useShowHoveredOrFocusedGestures","highlightParent","icon","default","onClick","sprintf","title","BlockSettingsDropdown","block","__experimentalSelectBlock","children","__unstableDisplayLocation","props","currentClientId","clientId","blockClientIds","Array","isArray","count","length","firstBlockClientId","firstParentClientId","onlyBlock","previousBlockClientId","selectedBlockClientIds","select","getBlockCount","getBlockName","getBlockRootClientId","getPreviousBlockClientId","getSelectedBlockClientIds","getBlockAttributes","getActiveBlockVariation","blocksStore","_firstParentClientId","parentBlockName","getBlockType","getBlockOrder","openedBlockSettingsMenu","unlock","getOpenedBlockSettingsMenu","setOpenedBlockSettingsMenu","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","duplicate","remove","insertAfter","insertBefore","isMatch","__unstableUseShortcutEventMatch","hasSelectedBlocks","updateSelectionAfterDuplicate","useCallback","clientIdsPromise","ids","updateSelectionAfterRemove","blockToFocus","shouldUpdateSelection","parentBlockIsSelected","includes","open","undefined","onToggle","localOpen","__experimentalUpdateSelection","canCopyStyles","canDuplicate","canInsertBlock","canMove","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onPasteStyles","onMoveTo","DropdownMenu","moreVertical","popoverProps","noIcons","menuProps","onKeyDown","event","defaultPrevented","preventDefault","onClose","Fragment","MenuGroup","Slot","fillProps","pipe","shortcut","Children","map","child","cloneElement","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tserialize,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tChildren,\n\tcloneElement,\n\tuseCallback,\n\tuseRef,\n} from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tstore as keyboardShortcutsStore,\n\t__unstableUseShortcutEventMatch,\n} from '@wordpress/keyboard-shortcuts';\nimport { pipe, useCopyToClipboard, useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport BlockIcon from '../block-icon';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useShowHoveredOrFocusedGestures } from '../block-toolbar/utils';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\nfunction CopyMenuItem( { clientIds, onCopy, label } ) {\n\tconst { getBlocksByClientId } = useSelect( blockEditorStore );\n\tconst ref = useCopyToClipboard(\n\t\t() => serialize( getBlocksByClientId( clientIds ) ),\n\t\tonCopy\n\t);\n\tconst copyMenuItemLabel = label ? label : __( 'Copy' );\n\treturn <MenuItem ref={ ref }>{ copyMenuItemLabel }</MenuItem>;\n}\n\nfunction ParentSelectorMenuItem( { parentClientId, parentBlockType } ) {\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\nexport function BlockSettingsDropdown( {\n\tblock,\n\tclientIds,\n\t__experimentalSelectBlock,\n\tchildren,\n\t__unstableDisplayLocation,\n\t...props\n} ) {\n\t// Get the client id of the current block for this menu, if one is set.\n\tconst currentClientId = block?.clientId;\n\tconst blockClientIds = Array.isArray( clientIds )\n\t\t? clientIds\n\t\t: [ clientIds ];\n\tconst count = blockClientIds.length;\n\tconst firstBlockClientId = blockClientIds[ 0 ];\n\tconst {\n\t\tfirstParentClientId,\n\t\tonlyBlock,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tselectedBlockClientIds,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlockAttributes,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst { getActiveBlockVariation } = select( blocksStore );\n\n\t\t\tconst _firstParentClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\t\t\tconst parentBlockName =\n\t\t\t\t_firstParentClientId && getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tonlyBlock: 1 === getBlockCount( _firstParentClientId ),\n\t\t\t\tparentBlockType:\n\t\t\t\t\t_firstParentClientId &&\n\t\t\t\t\t( getActiveBlockVariation(\n\t\t\t\t\t\tparentBlockName,\n\t\t\t\t\t\tgetBlockAttributes( _firstParentClientId )\n\t\t\t\t\t) ||\n\t\t\t\t\t\tgetBlockType( parentBlockName ) ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\tconst { getBlockOrder, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst openedBlockSettingsMenu = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getOpenedBlockSettingsMenu(),\n\t\t[]\n\t);\n\n\tconst { setOpenedBlockSettingsMenu } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst shortcuts = useSelect( ( select ) => {\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\treturn {\n\t\t\tduplicate: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/duplicate'\n\t\t\t),\n\t\t\tremove: getShortcutRepresentation( 'core/block-editor/remove' ),\n\t\t\tinsertAfter: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-after'\n\t\t\t),\n\t\t\tinsertBefore: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-before'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isMatch = __unstableUseShortcutEventMatch();\n\tconst hasSelectedBlocks = selectedBlockClientIds.length > 0;\n\n\tconst updateSelectionAfterDuplicate = useCallback(\n\t\tasync ( clientIdsPromise ) => {\n\t\t\tif ( __experimentalSelectBlock ) {\n\t\t\t\tconst ids = await clientIdsPromise;\n\t\t\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t\t\t__experimentalSelectBlock( ids[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ __experimentalSelectBlock ]\n\t);\n\n\tconst updateSelectionAfterRemove = useCallback( () => {\n\t\tif ( __experimentalSelectBlock ) {\n\t\t\tlet blockToFocus = previousBlockClientId || firstParentClientId;\n\n\t\t\t// Focus the first block if there's no previous block nor parent block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\t// Only update the selection if the original selection is removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\thasSelectedBlocks && getSelectedBlockClientIds().length === 0;\n\n\t\t\t__experimentalSelectBlock( blockToFocus, shouldUpdateSelection );\n\t\t}\n\t}, [\n\t\t__experimentalSelectBlock,\n\t\tpreviousBlockClientId,\n\t\tfirstParentClientId,\n\t\tgetBlockOrder,\n\t\thasSelectedBlocks,\n\t\tgetSelectedBlockClientIds,\n\t] );\n\n\t// This can occur when the selected block (the parent)\n\t// displays child blocks within a List View.\n\tconst parentBlockIsSelected =\n\t\tselectedBlockClientIds?.includes( firstParentClientId );\n\n\t// When a currentClientId is in use, treat the menu as a controlled component.\n\t// This ensures that only one block settings menu is open at a time.\n\t// This is a temporary solution to work around an issue with `onFocusOutside`\n\t// where it does not allow a dropdown to be closed if focus was never within\n\t// the dropdown to begin with. Examples include a user either CMD+Clicking or\n\t// right clicking into an inactive window.\n\t// See: https://github.com/WordPress/gutenberg/pull/54083\n\tconst open = ! currentClientId\n\t\t? undefined\n\t\t: openedBlockSettingsMenu === currentClientId || false;\n\n\tconst onToggle = useCallback(\n\t\t( localOpen ) => {\n\t\t\tif ( localOpen && openedBlockSettingsMenu !== currentClientId ) {\n\t\t\t\tsetOpenedBlockSettingsMenu( currentClientId );\n\t\t\t} else if (\n\t\t\t\t! localOpen &&\n\t\t\t\topenedBlockSettingsMenu &&\n\t\t\t\topenedBlockSettingsMenu === currentClientId\n\t\t\t) {\n\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t}\n\t\t},\n\t\t[ currentClientId, openedBlockSettingsMenu, setOpenedBlockSettingsMenu ]\n\t);\n\n\treturn (\n\t\t<BlockActions\n\t\t\tclientIds={ clientIds }\n\t\t\t__experimentalUpdateSelection={ ! __experimentalSelectBlock }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tcanCopyStyles,\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertBlock,\n\t\t\t\tcanMove,\n\t\t\t\tcanRemove,\n\t\t\t\tonDuplicate,\n\t\t\t\tonInsertAfter,\n\t\t\t\tonInsertBefore,\n\t\t\t\tonRemove,\n\t\t\t\tonCopy,\n\t\t\t\tonPasteStyles,\n\t\t\t\tonMoveTo,\n\t\t\t} ) => (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\topen={ open }\n\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\tnoIcons\n\t\t\t\t\tmenuProps={ {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * @param {KeyboardEvent} event\n\t\t\t\t\t\t */\n\t\t\t\t\t\tonKeyDown( event ) {\n\t\t\t\t\t\t\tif ( event.defaultPrevented ) return;\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tisMatch( 'core/block-editor/remove', event ) &&\n\t\t\t\t\t\t\t\tcanRemove\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tupdateSelectionAfterRemove( onRemove() );\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tisMatch(\n\t\t\t\t\t\t\t\t\t'core/block-editor/duplicate',\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\tcanDuplicate\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate( onDuplicate() );\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tisMatch(\n\t\t\t\t\t\t\t\t\t'core/block-editor/insert-after',\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\tcanInsertBlock\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t\t\t\t\t\tonInsertAfter();\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tisMatch(\n\t\t\t\t\t\t\t\t\t'core/block-editor/insert-before',\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\tcanInsertBlock\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t\t\t\t\t\tonInsertBefore();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ ! parentBlockIsSelected &&\n\t\t\t\t\t\t\t\t\t!! firstParentClientId && (\n\t\t\t\t\t\t\t\t\t\t<ParentSelectorMenuItem\n\t\t\t\t\t\t\t\t\t\t\tparentClientId={\n\t\t\t\t\t\t\t\t\t\t\t\tfirstParentClientId\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType={ parentBlockType }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.duplicate }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ canInsertBlock && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertBefore }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add before' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertAfter }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add after' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t{ canCopyStyles && (\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Copy styles' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<MenuItem onClick={ onPasteStyles }>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Paste styles' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\tcanMove,\n\t\t\t\t\t\t\t\t\tonMoveTo,\n\t\t\t\t\t\t\t\t\tonlyBlock,\n\t\t\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\t\t\tfirstBlockClientId,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t__unstableDisplayLocation={\n\t\t\t\t\t\t\t\t\t__unstableDisplayLocation\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.remove }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t) }\n\t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IACZC,SAAS,EAAGA,SAAW;IACvBC,MAAM,EAAGA,MAAQ;IACjBC,KAAK,EAAG,IAAAQ,QAAE,EAAE,aAAc;EAAG,CAC7B,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAiC,QAAQ;IAACe,OAAO,EAAGuE;EAAe,GAChC,IAAAzF,QAAE,EAAE,cAAe,CACZ,CACA,CACX,EACD,IAAAC,MAAA,CAAAC,aAAA,EAACpB,0BAAA,CAAAmC,OAAyB,CAACsF,IAAI;IAC9BC,SAAS,EAAG;MACXJ,OAAO;MACPjB,OAAO;MACPO,QAAQ;MACRtD,SAAS;MACTJ,KAAK;MACLE;IACD,CAAG;IACH5C,SAAS,EAAGA,SAAW;IACvBmC,yBAAyB,EACxBA;EACA,CACD,CAAC,EACA,OAAOD,QAAQ,KAAK,UAAU,GAC7BA,QAAQ,CAAE;IAAE4E;EAAQ,CAAE,CAAC,GACvBO,iBAAQ,CAACC,GAAG,CAAIC,KAAK,IACrB,IAAAC,qBAAY,EAAED,KAAK,EAAE;IAAET;EAAQ,CAAE,CACjC,CAAC,EACFhB,SAAS,IACV,IAAAnF,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAoI,SAAS,QACT,IAAArG,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAiC,QAAQ;IACRe,OAAO,EAAG,IAAAuF,aAAI,EACbL,OAAO,EACPZ,QAAQ,EACRlB,0BACD,CAAG;IACHoC,QAAQ,EAAGlD,SAAS,CAACI;EAAQ,GAE3B,IAAA5D,QAAE,EAAE,QAAS,CACN,CACA,CAEX,CAEU,CAEF,CAAC;AAEjB;AAAC,IAAA+G,QAAA,GAAAC,OAAA,CAAA/F,OAAA,GAEcI,qBAAqB"}
1
+ {"version":3,"names":["_blocks","require","_components","_data","_icons","_element","_i18n","_keyboardShortcuts","_compose","_blockActions","_interopRequireDefault","_blockHtmlConvertButton","_blockSettingsMenuFirstItem","_blockSettingsMenuControls","_blockParentSelectorMenuItem","_store","_lockUnlock","POPOVER_PROPS","className","placement","CopyMenuItem","clientIds","onCopy","label","getBlocksByClientId","useSelect","blockEditorStore","ref","useCopyToClipboard","serialize","copyMenuItemLabel","__","_react","createElement","MenuItem","BlockSettingsDropdown","block","__experimentalSelectBlock","children","__unstableDisplayLocation","props","currentClientId","clientId","blockClientIds","Array","isArray","count","length","firstBlockClientId","firstParentClientId","onlyBlock","parentBlockType","previousBlockClientId","selectedBlockClientIds","openedBlockSettingsMenu","select","getBlockCount","getBlockName","getBlockRootClientId","getPreviousBlockClientId","getSelectedBlockClientIds","getBlockAttributes","getOpenedBlockSettingsMenu","unlock","getActiveBlockVariation","blocksStore","_firstParentClientId","parentBlockName","getBlockType","getBlockOrder","setOpenedBlockSettingsMenu","useDispatch","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","duplicate","remove","insertAfter","insertBefore","isMatch","__unstableUseShortcutEventMatch","hasSelectedBlocks","updateSelectionAfterDuplicate","useCallback","clientIdsPromise","ids","updateSelectionAfterRemove","blockToFocus","shouldUpdateSelection","parentBlockIsSelected","includes","open","undefined","onToggle","localOpen","default","__experimentalUpdateSelection","canCopyStyles","canDuplicate","canInsertBlock","canMove","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onPasteStyles","onMoveTo","DropdownMenu","icon","moreVertical","popoverProps","noIcons","menuProps","onKeyDown","event","defaultPrevented","preventDefault","onClose","Fragment","MenuGroup","Slot","fillProps","parentClientId","onClick","pipe","shortcut","Children","map","child","cloneElement","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tserialize,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport { Children, cloneElement, useCallback } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tstore as keyboardShortcutsStore,\n\t__unstableUseShortcutEventMatch,\n} from '@wordpress/keyboard-shortcuts';\nimport { pipe, useCopyToClipboard } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport BlockParentSelectorMenuItem from './block-parent-selector-menu-item';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\nfunction CopyMenuItem( { clientIds, onCopy, label } ) {\n\tconst { getBlocksByClientId } = useSelect( blockEditorStore );\n\tconst ref = useCopyToClipboard(\n\t\t() => serialize( getBlocksByClientId( clientIds ) ),\n\t\tonCopy\n\t);\n\tconst copyMenuItemLabel = label ? label : __( 'Copy' );\n\treturn <MenuItem ref={ ref }>{ copyMenuItemLabel }</MenuItem>;\n}\n\nexport function BlockSettingsDropdown( {\n\tblock,\n\tclientIds,\n\t__experimentalSelectBlock,\n\tchildren,\n\t__unstableDisplayLocation,\n\t...props\n} ) {\n\t// Get the client id of the current block for this menu, if one is set.\n\tconst currentClientId = block?.clientId;\n\tconst blockClientIds = Array.isArray( clientIds )\n\t\t? clientIds\n\t\t: [ clientIds ];\n\tconst count = blockClientIds.length;\n\tconst firstBlockClientId = blockClientIds[ 0 ];\n\tconst {\n\t\tfirstParentClientId,\n\t\tonlyBlock,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tselectedBlockClientIds,\n\t\topenedBlockSettingsMenu,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetOpenedBlockSettingsMenu,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst { getActiveBlockVariation } = select( blocksStore );\n\n\t\t\tconst _firstParentClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\t\t\tconst parentBlockName =\n\t\t\t\t_firstParentClientId && getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tonlyBlock: 1 === getBlockCount( _firstParentClientId ),\n\t\t\t\tparentBlockType:\n\t\t\t\t\t_firstParentClientId &&\n\t\t\t\t\t( getActiveBlockVariation(\n\t\t\t\t\t\tparentBlockName,\n\t\t\t\t\t\tgetBlockAttributes( _firstParentClientId )\n\t\t\t\t\t) ||\n\t\t\t\t\t\tgetBlockType( parentBlockName ) ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t\topenedBlockSettingsMenu: getOpenedBlockSettingsMenu(),\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\tconst { getBlockOrder, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { setOpenedBlockSettingsMenu } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst shortcuts = useSelect( ( select ) => {\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\treturn {\n\t\t\tduplicate: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/duplicate'\n\t\t\t),\n\t\t\tremove: getShortcutRepresentation( 'core/block-editor/remove' ),\n\t\t\tinsertAfter: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-after'\n\t\t\t),\n\t\t\tinsertBefore: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-before'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isMatch = __unstableUseShortcutEventMatch();\n\tconst hasSelectedBlocks = selectedBlockClientIds.length > 0;\n\n\tconst updateSelectionAfterDuplicate = useCallback(\n\t\tasync ( clientIdsPromise ) => {\n\t\t\tif ( __experimentalSelectBlock ) {\n\t\t\t\tconst ids = await clientIdsPromise;\n\t\t\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t\t\t__experimentalSelectBlock( ids[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ __experimentalSelectBlock ]\n\t);\n\n\tconst updateSelectionAfterRemove = useCallback( () => {\n\t\tif ( __experimentalSelectBlock ) {\n\t\t\tlet blockToFocus = previousBlockClientId || firstParentClientId;\n\n\t\t\t// Focus the first block if there's no previous block nor parent block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\t// Only update the selection if the original selection is removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\thasSelectedBlocks && getSelectedBlockClientIds().length === 0;\n\n\t\t\t__experimentalSelectBlock( blockToFocus, shouldUpdateSelection );\n\t\t}\n\t}, [\n\t\t__experimentalSelectBlock,\n\t\tpreviousBlockClientId,\n\t\tfirstParentClientId,\n\t\tgetBlockOrder,\n\t\thasSelectedBlocks,\n\t\tgetSelectedBlockClientIds,\n\t] );\n\n\t// This can occur when the selected block (the parent)\n\t// displays child blocks within a List View.\n\tconst parentBlockIsSelected =\n\t\tselectedBlockClientIds?.includes( firstParentClientId );\n\n\t// When a currentClientId is in use, treat the menu as a controlled component.\n\t// This ensures that only one block settings menu is open at a time.\n\t// This is a temporary solution to work around an issue with `onFocusOutside`\n\t// where it does not allow a dropdown to be closed if focus was never within\n\t// the dropdown to begin with. Examples include a user either CMD+Clicking or\n\t// right clicking into an inactive window.\n\t// See: https://github.com/WordPress/gutenberg/pull/54083\n\tconst open = ! currentClientId\n\t\t? undefined\n\t\t: openedBlockSettingsMenu === currentClientId || false;\n\n\tconst onToggle = useCallback(\n\t\t( localOpen ) => {\n\t\t\tif ( localOpen && openedBlockSettingsMenu !== currentClientId ) {\n\t\t\t\tsetOpenedBlockSettingsMenu( currentClientId );\n\t\t\t} else if (\n\t\t\t\t! localOpen &&\n\t\t\t\topenedBlockSettingsMenu &&\n\t\t\t\topenedBlockSettingsMenu === currentClientId\n\t\t\t) {\n\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t}\n\t\t},\n\t\t[ currentClientId, openedBlockSettingsMenu, setOpenedBlockSettingsMenu ]\n\t);\n\n\treturn (\n\t\t<BlockActions\n\t\t\tclientIds={ clientIds }\n\t\t\t__experimentalUpdateSelection={ ! __experimentalSelectBlock }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tcanCopyStyles,\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertBlock,\n\t\t\t\tcanMove,\n\t\t\t\tcanRemove,\n\t\t\t\tonDuplicate,\n\t\t\t\tonInsertAfter,\n\t\t\t\tonInsertBefore,\n\t\t\t\tonRemove,\n\t\t\t\tonCopy,\n\t\t\t\tonPasteStyles,\n\t\t\t\tonMoveTo,\n\t\t\t} ) => (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\topen={ open }\n\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\tnoIcons\n\t\t\t\t\tmenuProps={ {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * @param {KeyboardEvent} event\n\t\t\t\t\t\t */\n\t\t\t\t\t\tonKeyDown( event ) {\n\t\t\t\t\t\t\tif ( event.defaultPrevented ) return;\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tisMatch( 'core/block-editor/remove', event ) &&\n\t\t\t\t\t\t\t\tcanRemove\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tupdateSelectionAfterRemove( onRemove() );\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tisMatch(\n\t\t\t\t\t\t\t\t\t'core/block-editor/duplicate',\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\tcanDuplicate\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate( onDuplicate() );\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tisMatch(\n\t\t\t\t\t\t\t\t\t'core/block-editor/insert-after',\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\tcanInsertBlock\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t\t\t\t\t\tonInsertAfter();\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tisMatch(\n\t\t\t\t\t\t\t\t\t'core/block-editor/insert-before',\n\t\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\tcanInsertBlock\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t\t\t\t\t\tonInsertBefore();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ ! parentBlockIsSelected &&\n\t\t\t\t\t\t\t\t\t!! firstParentClientId && (\n\t\t\t\t\t\t\t\t\t\t<BlockParentSelectorMenuItem\n\t\t\t\t\t\t\t\t\t\t\tparentClientId={\n\t\t\t\t\t\t\t\t\t\t\t\tfirstParentClientId\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType={ parentBlockType }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.duplicate }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ canInsertBlock && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertBefore }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add before' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.insertAfter }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add after' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t{ canCopyStyles && (\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Copy styles' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<MenuItem onClick={ onPasteStyles }>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Paste styles' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\tcanMove,\n\t\t\t\t\t\t\t\t\tonMoveTo,\n\t\t\t\t\t\t\t\t\tonlyBlock,\n\t\t\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\t\t\tfirstBlockClientId,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t__unstableDisplayLocation={\n\t\t\t\t\t\t\t\t\t__unstableDisplayLocation\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.remove }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) }\n\t\t</BlockActions>\n\t);\n}\n\nexport default BlockSettingsDropdown;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GA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,CAAAC,aAAA,EAACb,YAAY;IACZC,SAAS,EAAGA,SAAW;IACvBC,MAAM,EAAGA,MAAQ;IACjBC,KAAK,EAAG,IAAAQ,QAAE,EAAE,aAAc;EAAG,CAC7B,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAAgC,QAAQ;IAAC0F,OAAO,EAAGlB;EAAe,GAChC,IAAA3E,QAAE,EAAE,cAAe,CACZ,CACA,CACX,EACD,IAAAC,MAAA,CAAAC,aAAA,EAACpB,0BAAA,CAAAkF,OAAyB,CAAC0B,IAAI;IAC9BC,SAAS,EAAG;MACXJ,OAAO;MACPlB,OAAO;MACPO,QAAQ;MACRzD,SAAS;MACTJ,KAAK;MACLE;IACD,CAAG;IACH3B,SAAS,EAAGA,SAAW;IACvBkB,yBAAyB,EACxBA;EACA,CACD,CAAC,EACA,OAAOD,QAAQ,KAAK,UAAU,GAC7BA,QAAQ,CAAE;IAAEgF;EAAQ,CAAE,CAAC,GACvBS,iBAAQ,CAACC,GAAG,CAAIC,KAAK,IACrB,IAAAC,qBAAY,EAAED,KAAK,EAAE;IAAEX;EAAQ,CAAE,CACjC,CAAC,EACFjB,SAAS,IACV,IAAArE,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAAsH,SAAS,QACT,IAAAxF,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAAgC,QAAQ;IACR0F,OAAO,EAAG,IAAAC,aAAI,EACbP,OAAO,EACPb,QAAQ,EACRnB,0BACD,CAAG;IACHwC,QAAQ,EAAGtD,SAAS,CAACI;EAAQ,GAE3B,IAAA7C,QAAE,EAAE,QAAS,CACN,CACA,CAEX,CAEU,CAEF,CAAC;AAEjB;AAAC,IAAAoG,QAAA,GAAAC,OAAA,CAAArC,OAAA,GAEc5D,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_i18n","_blocks","_components","_data","_notices","_store","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","__","_react","createElement","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={ true }\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;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAMO,wBAAwB,GAAGA,CAAE;EAClCC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,uBAAuB;EACvBC,aAAa;EACbC;AACD,CAAC,KAAM;EACN,MA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,GAC5B;IACA,IAAAC,QAAE,EAAE,0BAA2B,CAAC,EAChChC,UAAU,EACV4B,YAAY,CAACX,KACd,CAAC;IACDT,mBAAmB,CAAEsB,aAAc,CAAC;EACrC;EAEA,OACC,IAAAG,MAAA,CAAAC,aAAA,EAACxC,WAAA,CAAAyC,MAAM;IACNC,MAAM,EAAC,4BAA4B;IACnCC,GAAG,EAAGpC,SAAW;IACjBqC,OAAO,EAAG5B,aAAa,CAAC,CAAG;IAC3B6B,QAAQ,EAAGb,cAAgB;IAC3Bc,gBAAgB,EAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAO;IAC1CC,SAAS,EAAG,IAAM;IAClBpB,SAAS,EAAGA;IACZ;IAAA;IACAF,KAAK,EAAG,IAAAU,aAAO,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC,EAAEhC,UAAW;EAAG,CACxD,CAAC;AAEJ,CAAC;AAAC,IAAA4C,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEahD,wBAAwB"}
1
+ {"version":3,"names":["_reactNative","require","_i18n","_blocks","_components","_data","_notices","_store","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","__","_react","createElement","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;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAMO,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,YAAiB,CAAC;EACzD,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAF,iBAAW,EAAEG,cAAa,CAAC;EAE3D,MAAMC,aAAa,GAAGA,CAAA,KAAM;IAAA,IAAAC,mBAAA;IAC3B,MAAMC,iBAAiB,IAAAD,mBAAA,GAAGR,aAAa,EAAEU,IAAI,cAAAF,mBAAA,cAAAA,mBAAA,GAAI,EAAE;IACnD,MAAMG,8BAA8B,GAAG;MACtC,WAAW,EAAE,CAAE,gBAAgB,EAAE,cAAc,CAAE;MACjD,YAAY,EAAE,CAAE,gBAAgB,CAAE;MAClC,gBAAgB,EAAE,CAAE,gBAAgB;IACrC,CAAC;IAED,OAAOZ,uBAAuB,CAACa,GAAG,CAAIC,IAAI,I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