@wordpress/block-editor 12.18.1 → 12.19.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 (912) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/autocompleters/block.js +1 -2
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js +1 -2
  5. package/build/autocompleters/link.js.map +1 -1
  6. package/build/components/alignment-control/ui.js +1 -2
  7. package/build/components/alignment-control/ui.js.map +1 -1
  8. package/build/components/autocomplete/index.js +1 -2
  9. package/build/components/autocomplete/index.js.map +1 -1
  10. package/build/components/block-alignment-control/constants.js +2 -4
  11. package/build/components/block-alignment-control/constants.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.js +1 -2
  13. package/build/components/block-alignment-control/ui.js.map +1 -1
  14. package/build/components/block-alignment-control/ui.native.js +1 -2
  15. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  16. package/build/components/block-alignment-matrix-control/index.js +1 -2
  17. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  18. package/build/components/block-breadcrumb/index.js +1 -2
  19. package/build/components/block-breadcrumb/index.js.map +1 -1
  20. package/build/components/block-canvas/index.js +1 -2
  21. package/build/components/block-canvas/index.js.map +1 -1
  22. package/build/components/block-caption/index.native.js +1 -2
  23. package/build/components/block-caption/index.native.js.map +1 -1
  24. package/build/components/block-card/index.js +1 -2
  25. package/build/components/block-card/index.js.map +1 -1
  26. package/build/components/block-compare/index.js +1 -2
  27. package/build/components/block-compare/index.js.map +1 -1
  28. package/build/components/block-context/index.js +1 -2
  29. package/build/components/block-context/index.js.map +1 -1
  30. package/build/components/block-controls/groups.js +1 -2
  31. package/build/components/block-controls/groups.js.map +1 -1
  32. package/build/components/block-controls/index.js +1 -2
  33. package/build/components/block-controls/index.js.map +1 -1
  34. package/build/components/block-draggable/dropping-insertion-point.native.js +2 -2
  35. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  36. package/build/components/block-draggable/index.js +1 -2
  37. package/build/components/block-draggable/index.js.map +1 -1
  38. package/build/components/block-draggable/index.native.js +3 -4
  39. package/build/components/block-draggable/index.native.js.map +1 -1
  40. package/build/components/block-edit/context.js +4 -8
  41. package/build/components/block-edit/context.js.map +1 -1
  42. package/build/components/block-edit/edit.js +1 -2
  43. package/build/components/block-edit/edit.js.map +1 -1
  44. package/build/components/block-edit/edit.native.js +1 -2
  45. package/build/components/block-edit/edit.native.js.map +1 -1
  46. package/build/components/block-full-height-alignment-control/index.js +1 -2
  47. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  48. package/build/components/block-icon/index.js +1 -2
  49. package/build/components/block-icon/index.js.map +1 -1
  50. package/build/components/block-icon/index.native.js +1 -2
  51. package/build/components/block-icon/index.native.js.map +1 -1
  52. package/build/components/block-info-slot-fill/index.js +1 -2
  53. package/build/components/block-info-slot-fill/index.js.map +1 -1
  54. package/build/components/block-inspector/index.js +11 -9
  55. package/build/components/block-inspector/index.js.map +1 -1
  56. package/build/components/block-list/block-crash-boundary.js +1 -2
  57. package/build/components/block-list/block-crash-boundary.js.map +1 -1
  58. package/build/components/block-list/block-html.js +1 -2
  59. package/build/components/block-list/block-html.js.map +1 -1
  60. package/build/components/block-list/block-list-context.native.js +1 -2
  61. package/build/components/block-list/block-list-context.native.js.map +1 -1
  62. package/build/components/block-list/block-list-item-cell.native.js +1 -2
  63. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  64. package/build/components/block-list/block-list-item.native.js +1 -2
  65. package/build/components/block-list/block-list-item.native.js.map +1 -1
  66. package/build/components/block-list/block-outline.native.js +1 -2
  67. package/build/components/block-list/block-outline.native.js.map +1 -1
  68. package/build/components/block-list/block-selection-button.native.js +1 -2
  69. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  70. package/build/components/block-list/block.js +32 -21
  71. package/build/components/block-list/block.js.map +1 -1
  72. package/build/components/block-list/block.native.js +7 -6
  73. package/build/components/block-list/block.native.js.map +1 -1
  74. package/build/components/block-list/grid-item.native.js +1 -2
  75. package/build/components/block-list/grid-item.native.js.map +1 -1
  76. package/build/components/block-list/index.js +19 -9
  77. package/build/components/block-list/index.js.map +1 -1
  78. package/build/components/block-list/insertion-point.native.js +1 -2
  79. package/build/components/block-list/insertion-point.native.js.map +1 -1
  80. package/build/components/block-list/layout.js +2 -4
  81. package/build/components/block-list/layout.js.map +1 -1
  82. package/build/components/block-list/private-block-context.js +1 -2
  83. package/build/components/block-list/private-block-context.js.map +1 -1
  84. package/build/components/block-list/subdirectory-icon.js +1 -2
  85. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  86. package/build/components/block-list/use-block-props/index.js +8 -1
  87. package/build/components/block-list/use-block-props/index.js.map +1 -1
  88. package/build/components/block-list/use-scroll-upon-insertion.native.js +1 -2
  89. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -1
  90. package/build/components/block-list-appender/index.js +5 -52
  91. package/build/components/block-list-appender/index.js.map +1 -1
  92. package/build/components/block-media-update-progress/index.native.js +11 -22
  93. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  94. package/build/components/block-mover/button.js +2 -4
  95. package/build/components/block-mover/button.js.map +1 -1
  96. package/build/components/block-mover/index.js +1 -2
  97. package/build/components/block-mover/index.js.map +1 -1
  98. package/build/components/block-mover/index.native.js +3 -6
  99. package/build/components/block-mover/index.native.js.map +1 -1
  100. package/build/components/block-mover/mover-description.native.js +0 -2
  101. package/build/components/block-mover/mover-description.native.js.map +1 -1
  102. package/build/components/block-navigation/dropdown.js +1 -2
  103. package/build/components/block-navigation/dropdown.js.map +1 -1
  104. package/build/components/block-pattern-setup/constants.js +1 -2
  105. package/build/components/block-pattern-setup/constants.js.map +1 -1
  106. package/build/components/block-pattern-setup/index.js +1 -2
  107. package/build/components/block-pattern-setup/index.js.map +1 -1
  108. package/build/components/block-pattern-setup/setup-toolbar.js +1 -2
  109. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  110. package/build/components/block-pattern-setup/use-patterns-setup.js +1 -2
  111. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  112. package/build/components/block-patterns-list/index.js +1 -2
  113. package/build/components/block-patterns-list/index.js.map +1 -1
  114. package/build/components/block-popover/drop-zone.js +1 -2
  115. package/build/components/block-popover/drop-zone.js.map +1 -1
  116. package/build/components/block-popover/inbetween.js +2 -4
  117. package/build/components/block-popover/inbetween.js.map +1 -1
  118. package/build/components/block-popover/index.js +1 -2
  119. package/build/components/block-popover/index.js.map +1 -1
  120. package/build/components/block-popover/use-popover-scroll.js +1 -2
  121. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  122. package/build/components/block-preview/auto.js +2 -1
  123. package/build/components/block-preview/auto.js.map +1 -1
  124. package/build/components/block-preview/index.js +1 -2
  125. package/build/components/block-preview/index.js.map +1 -1
  126. package/build/components/block-removal-warning-modal/index.js +4 -2
  127. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  128. package/build/components/block-settings/button.native.js +1 -2
  129. package/build/components/block-settings/button.native.js.map +1 -1
  130. package/build/components/block-settings/container.native.js +1 -2
  131. package/build/components/block-settings/container.native.js.map +1 -1
  132. package/build/components/block-settings/index.native.js +2 -2
  133. package/build/components/block-settings/index.native.js.map +1 -1
  134. package/build/components/block-settings-menu/block-html-convert-button.js +1 -2
  135. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  136. package/build/components/block-settings-menu/block-mode-toggle.js +1 -2
  137. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  138. package/build/components/block-settings-menu/block-settings-dropdown.js +1 -2
  139. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  140. package/build/components/block-settings-menu/block-settings-menu-first-item.js +1 -2
  141. package/build/components/block-settings-menu/block-settings-menu-first-item.js.map +1 -1
  142. package/build/components/block-settings-menu/index.js +1 -2
  143. package/build/components/block-settings-menu/index.js.map +1 -1
  144. package/build/components/block-settings-menu-controls/index.js +1 -2
  145. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  146. package/build/components/block-styles/index.js +1 -2
  147. package/build/components/block-styles/index.js.map +1 -1
  148. package/build/components/block-styles/index.native.js +1 -2
  149. package/build/components/block-styles/index.native.js.map +1 -1
  150. package/build/components/block-styles/preview.native.js +1 -2
  151. package/build/components/block-styles/preview.native.js.map +1 -1
  152. package/build/components/block-switcher/block-transformations-menu.js +1 -2
  153. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  154. package/build/components/block-switcher/block-transformations-menu.native.js +1 -2
  155. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  156. package/build/components/block-switcher/block-variation-transformations.js +1 -2
  157. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  158. package/build/components/block-switcher/index.js +13 -11
  159. package/build/components/block-switcher/index.js.map +1 -1
  160. package/build/components/block-switcher/pattern-transformations-menu.js +1 -2
  161. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  162. package/build/components/block-switcher/use-transformed-patterns.js +1 -2
  163. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  164. package/build/components/block-title/use-block-display-title.js +21 -28
  165. package/build/components/block-title/use-block-display-title.js.map +1 -1
  166. package/build/components/block-toolbar/block-name-context.js +1 -2
  167. package/build/components/block-toolbar/block-name-context.js.map +1 -1
  168. package/build/components/block-toolbar/block-toolbar-last-item.js +1 -2
  169. package/build/components/block-toolbar/block-toolbar-last-item.js.map +1 -1
  170. package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -2
  171. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  172. package/build/components/block-tools/block-selection-button.js +20 -18
  173. package/build/components/block-tools/block-selection-button.js.map +1 -1
  174. package/build/components/block-tools/index.js +4 -12
  175. package/build/components/block-tools/index.js.map +1 -1
  176. package/build/components/block-tools/insertion-point.js +1 -2
  177. package/build/components/block-tools/insertion-point.js.map +1 -1
  178. package/build/components/block-tools/zoom-out-mode-inserters.js +1 -2
  179. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  180. package/build/components/block-types-list/index.js +1 -2
  181. package/build/components/block-types-list/index.js.map +1 -1
  182. package/build/components/block-variation-picker/index.js +1 -2
  183. package/build/components/block-variation-picker/index.js.map +1 -1
  184. package/build/components/block-variation-picker/index.native.js +1 -2
  185. package/build/components/block-variation-picker/index.native.js.map +1 -1
  186. package/build/components/block-variation-transforms/index.js +1 -2
  187. package/build/components/block-variation-transforms/index.js.map +1 -1
  188. package/build/components/block-vertical-alignment-control/icons.js +5 -10
  189. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  190. package/build/components/block-vertical-alignment-control/ui.js +1 -2
  191. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  192. package/build/components/button-block-appender/index.js +2 -4
  193. package/build/components/button-block-appender/index.js.map +1 -1
  194. package/build/components/button-block-appender/index.native.js +1 -2
  195. package/build/components/button-block-appender/index.native.js.map +1 -1
  196. package/build/components/caption/index.native.js +1 -2
  197. package/build/components/caption/index.native.js.map +1 -1
  198. package/build/components/color-palette/index.js +1 -2
  199. package/build/components/color-palette/index.js.map +1 -1
  200. package/build/components/color-palette/with-color-context.js +1 -2
  201. package/build/components/color-palette/with-color-context.js.map +1 -1
  202. package/build/components/color-style-selector/index.js +1 -2
  203. package/build/components/color-style-selector/index.js.map +1 -1
  204. package/build/components/colors/index.js +2 -2
  205. package/build/components/colors/index.js.map +1 -1
  206. package/build/components/colors-gradients/control.js +1 -3
  207. package/build/components/colors-gradients/control.js.map +1 -1
  208. package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -2
  209. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  210. package/build/components/contrast-checker/index.js +1 -2
  211. package/build/components/contrast-checker/index.js.map +1 -1
  212. package/build/components/contrast-checker/index.native.js +1 -2
  213. package/build/components/contrast-checker/index.native.js.map +1 -1
  214. package/build/components/convert-to-group-buttons/toolbar.js +1 -2
  215. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  216. package/build/components/default-block-appender/index.js +31 -40
  217. package/build/components/default-block-appender/index.js.map +1 -1
  218. package/build/components/default-block-appender/index.native.js +1 -2
  219. package/build/components/default-block-appender/index.native.js.map +1 -1
  220. package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -2
  221. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  222. package/build/components/dimensions-tool/index.js +1 -2
  223. package/build/components/dimensions-tool/index.js.map +1 -1
  224. package/build/components/duotone-control/index.js +1 -2
  225. package/build/components/duotone-control/index.js.map +1 -1
  226. package/build/components/editable-text/index.js +1 -2
  227. package/build/components/editable-text/index.js.map +1 -1
  228. package/build/components/floating-toolbar/index.native.js +1 -2
  229. package/build/components/floating-toolbar/index.native.js.map +1 -1
  230. package/build/components/floating-toolbar/nav-up-icon.js +1 -2
  231. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  232. package/build/components/font-sizes/font-size-picker.js +1 -2
  233. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  234. package/build/components/global-styles/border-panel.js +56 -8
  235. package/build/components/global-styles/border-panel.js.map +1 -1
  236. package/build/components/global-styles/color-panel.native.js +1 -2
  237. package/build/components/global-styles/color-panel.native.js.map +1 -1
  238. package/build/components/global-styles/context.js +2 -4
  239. package/build/components/global-styles/context.js.map +1 -1
  240. package/build/components/global-styles/get-global-styles-changes.js +2 -4
  241. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  242. package/build/components/global-styles/hooks.js +2 -3
  243. package/build/components/global-styles/hooks.js.map +1 -1
  244. package/build/components/global-styles/index.js +2 -15
  245. package/build/components/global-styles/index.js.map +1 -1
  246. package/build/components/global-styles/shadow-panel-components.js +133 -0
  247. package/build/components/global-styles/shadow-panel-components.js.map +1 -0
  248. package/build/components/global-styles/typography-panel.js +18 -36
  249. package/build/components/global-styles/typography-panel.js.map +1 -1
  250. package/build/components/global-styles/use-global-styles-output.js +1 -1
  251. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  252. package/build/components/global-styles/utils.js +38 -14
  253. package/build/components/global-styles/utils.js.map +1 -1
  254. package/build/components/iframe/index.js +1 -2
  255. package/build/components/iframe/index.js.map +1 -1
  256. package/build/components/image-editor/constants.js +3 -6
  257. package/build/components/image-editor/constants.js.map +1 -1
  258. package/build/components/image-link-destinations/index.native.js +1 -2
  259. package/build/components/image-link-destinations/index.native.js.map +1 -1
  260. package/build/components/index.js +2 -2
  261. package/build/components/index.js.map +1 -1
  262. package/build/components/index.native.js +2 -2
  263. package/build/components/index.native.js.map +1 -1
  264. package/build/components/inner-blocks/button-block-appender.js +1 -2
  265. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  266. package/build/components/inner-blocks/constants.native.js +1 -2
  267. package/build/components/inner-blocks/constants.native.js.map +1 -1
  268. package/build/components/inner-blocks/default-block-appender.js +1 -2
  269. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  270. package/build/components/inner-blocks/index.js +33 -30
  271. package/build/components/inner-blocks/index.js.map +1 -1
  272. package/build/components/inner-blocks/index.native.js +2 -6
  273. package/build/components/inner-blocks/index.native.js.map +1 -1
  274. package/build/components/inner-blocks/use-inner-block-template-sync.js +2 -3
  275. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  276. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +1 -2
  277. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  278. package/build/components/inner-blocks/with-client-id.js +1 -2
  279. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  280. package/build/components/inserter/block-patterns-explorer/index.js +1 -2
  281. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  282. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -2
  283. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  284. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -2
  285. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  286. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  287. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  288. package/build/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
  289. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  290. package/build/components/inserter/block-patterns-tab/utils.js +5 -9
  291. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  292. package/build/components/inserter/block-types-tab.js +1 -2
  293. package/build/components/inserter/block-types-tab.js.map +1 -1
  294. package/build/components/inserter/block-types-tab.native.js +1 -2
  295. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  296. package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -2
  297. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  298. package/build/components/inserter/hooks/use-block-types-state.js +1 -2
  299. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  300. package/build/components/inserter/hooks/use-insertion-point.js +1 -2
  301. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  302. package/build/components/inserter/hooks/use-patterns-state.js +1 -2
  303. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  304. package/build/components/inserter/index.js +2 -4
  305. package/build/components/inserter/index.js.map +1 -1
  306. package/build/components/inserter/index.native.js +1 -2
  307. package/build/components/inserter/index.native.js.map +1 -1
  308. package/build/components/inserter/library.js +1 -2
  309. package/build/components/inserter/library.js.map +1 -1
  310. package/build/components/inserter/media-tab/media-list.js +1 -2
  311. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  312. package/build/components/inserter/media-tab/media-tab.js +1 -2
  313. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  314. package/build/components/inserter/menu.js +1 -2
  315. package/build/components/inserter/menu.js.map +1 -1
  316. package/build/components/inserter/menu.native.js +1 -2
  317. package/build/components/inserter/menu.native.js.map +1 -1
  318. package/build/components/inserter/no-results.js +1 -2
  319. package/build/components/inserter/no-results.js.map +1 -1
  320. package/build/components/inserter/no-results.native.js +1 -2
  321. package/build/components/inserter/no-results.native.js.map +1 -1
  322. package/build/components/inserter/panel.js +1 -2
  323. package/build/components/inserter/panel.js.map +1 -1
  324. package/build/components/inserter/preview-panel.js +1 -2
  325. package/build/components/inserter/preview-panel.js.map +1 -1
  326. package/build/components/inserter/quick-inserter.js +3 -2
  327. package/build/components/inserter/quick-inserter.js.map +1 -1
  328. package/build/components/inserter/reusable-blocks-tab.native.js +1 -2
  329. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  330. package/build/components/inserter/search-items.js +0 -1
  331. package/build/components/inserter/search-items.js.map +1 -1
  332. package/build/components/inserter/search-results.js +1 -2
  333. package/build/components/inserter/search-results.js.map +1 -1
  334. package/build/components/inserter/search-results.native.js +1 -2
  335. package/build/components/inserter/search-results.native.js.map +1 -1
  336. package/build/components/inserter/tabs.js +1 -2
  337. package/build/components/inserter/tabs.js.map +1 -1
  338. package/build/components/inserter/tabs.native.js +1 -2
  339. package/build/components/inserter/tabs.native.js.map +1 -1
  340. package/build/components/inserter/tips.js +1 -2
  341. package/build/components/inserter/tips.js.map +1 -1
  342. package/build/components/inserter-button/index.native.js +1 -2
  343. package/build/components/inserter-button/index.native.js.map +1 -1
  344. package/build/components/inserter-button/sparkles.js +1 -2
  345. package/build/components/inserter-button/sparkles.js.map +1 -1
  346. package/build/components/inserter-draggable-blocks/index.js +11 -2
  347. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  348. package/build/components/inserter-list-item/index.js +1 -2
  349. package/build/components/inserter-list-item/index.js.map +1 -1
  350. package/build/components/inserter-listbox/context.js +1 -2
  351. package/build/components/inserter-listbox/context.js.map +1 -1
  352. package/build/components/inserter-listbox/group.js +1 -2
  353. package/build/components/inserter-listbox/group.js.map +1 -1
  354. package/build/components/inserter-listbox/index.js +1 -2
  355. package/build/components/inserter-listbox/index.js.map +1 -1
  356. package/build/components/inserter-listbox/item.js +1 -2
  357. package/build/components/inserter-listbox/item.js.map +1 -1
  358. package/build/components/inserter-listbox/row.js +1 -2
  359. package/build/components/inserter-listbox/row.js.map +1 -1
  360. package/build/components/inserter-menu-extension/index.js +1 -2
  361. package/build/components/inserter-menu-extension/index.js.map +1 -1
  362. package/build/components/inspector-controls/groups.js +1 -2
  363. package/build/components/inspector-controls/groups.js.map +1 -1
  364. package/build/components/inspector-controls/index.js +1 -2
  365. package/build/components/inspector-controls/index.js.map +1 -1
  366. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +3 -4
  367. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  368. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -2
  369. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  370. package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
  371. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  372. package/build/components/inspector-controls-tabs/styles-tab.js +6 -6
  373. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  374. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js +1 -2
  375. package/build/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js.map +1 -1
  376. package/build/components/inspector-controls-tabs/utils.js +3 -6
  377. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  378. package/build/components/justify-content-control/ui.js +1 -2
  379. package/build/components/justify-content-control/ui.js.map +1 -1
  380. package/build/components/keyboard-shortcuts/index.js +1 -2
  381. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  382. package/build/components/line-height-control/index.js +1 -2
  383. package/build/components/line-height-control/index.js.map +1 -1
  384. package/build/components/line-height-control/utils.js +4 -8
  385. package/build/components/line-height-control/utils.js.map +1 -1
  386. package/build/components/link-control/constants.js +7 -14
  387. package/build/components/link-control/constants.js.map +1 -1
  388. package/build/components/link-control/index.js +2 -16
  389. package/build/components/link-control/index.js.map +1 -1
  390. package/build/components/link-control/link-preview.js +13 -15
  391. package/build/components/link-control/link-preview.js.map +1 -1
  392. package/build/components/link-control/search-create-button.js +1 -2
  393. package/build/components/link-control/search-create-button.js.map +1 -1
  394. package/build/components/link-control/search-input.js +1 -2
  395. package/build/components/link-control/search-input.js.map +1 -1
  396. package/build/components/link-control/search-item.js +1 -2
  397. package/build/components/link-control/search-item.js.map +1 -1
  398. package/build/components/link-control/settings-drawer.js +1 -2
  399. package/build/components/link-control/settings-drawer.js.map +1 -1
  400. package/build/components/link-control/settings.js +1 -2
  401. package/build/components/link-control/settings.js.map +1 -1
  402. package/build/components/link-control/use-create-page.js +0 -1
  403. package/build/components/link-control/use-create-page.js.map +1 -1
  404. package/build/components/link-control/use-rich-url-data.js +1 -2
  405. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  406. package/build/components/link-control/viewer-slot.js +1 -2
  407. package/build/components/link-control/viewer-slot.js.map +1 -1
  408. package/build/components/list-view/appender.js +1 -2
  409. package/build/components/list-view/appender.js.map +1 -1
  410. package/build/components/list-view/block-contents.js +1 -2
  411. package/build/components/list-view/block-contents.js.map +1 -1
  412. package/build/components/list-view/block-select-button.js +1 -2
  413. package/build/components/list-view/block-select-button.js.map +1 -1
  414. package/build/components/list-view/block.js +33 -28
  415. package/build/components/list-view/block.js.map +1 -1
  416. package/build/components/list-view/branch.js +1 -2
  417. package/build/components/list-view/branch.js.map +1 -1
  418. package/build/components/list-view/context.js +1 -2
  419. package/build/components/list-view/context.js.map +1 -1
  420. package/build/components/list-view/index.js +20 -17
  421. package/build/components/list-view/index.js.map +1 -1
  422. package/build/components/list-view/leaf.js +1 -2
  423. package/build/components/list-view/leaf.js.map +1 -1
  424. package/build/components/list-view/use-clipboard-handler.js +159 -0
  425. package/build/components/list-view/use-clipboard-handler.js.map +1 -0
  426. package/build/components/list-view/use-list-view-drop-zone.js +1 -2
  427. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  428. package/build/components/list-view/utils.js +4 -4
  429. package/build/components/list-view/utils.js.map +1 -1
  430. package/build/components/media-placeholder/index.js +1 -2
  431. package/build/components/media-placeholder/index.js.map +1 -1
  432. package/build/components/media-placeholder/index.native.js +1 -2
  433. package/build/components/media-placeholder/index.native.js.map +1 -1
  434. package/build/components/media-replace-flow/index.js +1 -2
  435. package/build/components/media-replace-flow/index.js.map +1 -1
  436. package/build/components/media-replace-flow/index.native.js +1 -2
  437. package/build/components/media-replace-flow/index.native.js.map +1 -1
  438. package/build/components/media-upload/check.js +1 -2
  439. package/build/components/media-upload/check.js.map +1 -1
  440. package/build/components/media-upload/constants.native.js +8 -16
  441. package/build/components/media-upload/constants.native.js.map +1 -1
  442. package/build/components/media-upload/index.js +1 -2
  443. package/build/components/media-upload/index.js.map +1 -1
  444. package/build/components/media-upload/index.native.js +1 -2
  445. package/build/components/media-upload/index.native.js.map +1 -1
  446. package/build/components/media-upload-progress/constants.js +6 -12
  447. package/build/components/media-upload-progress/constants.js.map +1 -1
  448. package/build/components/media-upload-progress/index.native.js +1 -2
  449. package/build/components/media-upload-progress/index.native.js.map +1 -1
  450. package/build/components/multi-selection-inspector/index.js +1 -2
  451. package/build/components/multi-selection-inspector/index.js.map +1 -1
  452. package/build/components/navigable-toolbar/index.js +5 -2
  453. package/build/components/navigable-toolbar/index.js.map +1 -1
  454. package/build/components/observe-typing/index.js +1 -2
  455. package/build/components/observe-typing/index.js.map +1 -1
  456. package/build/components/panel-color-settings/index.js +1 -2
  457. package/build/components/panel-color-settings/index.js.map +1 -1
  458. package/build/components/plain-text/index.js +1 -2
  459. package/build/components/plain-text/index.js.map +1 -1
  460. package/build/components/provider/block-refs-provider.js +1 -2
  461. package/build/components/provider/block-refs-provider.js.map +1 -1
  462. package/build/components/provider/index.js +3 -5
  463. package/build/components/provider/index.js.map +1 -1
  464. package/build/components/provider/index.native.js +2 -4
  465. package/build/components/provider/index.native.js.map +1 -1
  466. package/build/components/provider/with-registry-provider.js +1 -2
  467. package/build/components/provider/with-registry-provider.js.map +1 -1
  468. package/build/components/publish-date-time-picker/index.js +1 -2
  469. package/build/components/publish-date-time-picker/index.js.map +1 -1
  470. package/build/components/responsive-block-control/index.js +3 -7
  471. package/build/components/responsive-block-control/index.js.map +1 -1
  472. package/build/components/rich-text/embed-handler-picker.native.js +1 -2
  473. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  474. package/build/components/rich-text/format-edit.js +1 -2
  475. package/build/components/rich-text/format-edit.js.map +1 -1
  476. package/build/components/rich-text/format-toolbar/index.js +1 -2
  477. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  478. package/build/components/rich-text/format-toolbar/index.native.js +1 -2
  479. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  480. package/build/components/rich-text/format-toolbar-container.js +1 -2
  481. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  482. package/build/components/rich-text/format-toolbar-container.native.js +1 -2
  483. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  484. package/build/components/rich-text/index.js +7 -8
  485. package/build/components/rich-text/index.js.map +1 -1
  486. package/build/components/rich-text/index.native.js +1 -2
  487. package/build/components/rich-text/index.native.js.map +1 -1
  488. package/build/components/rich-text/multiline.js +1 -2
  489. package/build/components/rich-text/multiline.js.map +1 -1
  490. package/build/components/rich-text/native/index.native.js +1 -6
  491. package/build/components/rich-text/native/index.native.js.map +1 -1
  492. package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -2
  493. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  494. package/build/components/skip-to-selected-block/index.js +1 -2
  495. package/build/components/skip-to-selected-block/index.js.map +1 -1
  496. package/build/components/spacing-sizes-control/index.js +3 -1
  497. package/build/components/spacing-sizes-control/index.js.map +1 -1
  498. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  499. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  500. package/build/components/spacing-sizes-control/utils.js +5 -10
  501. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  502. package/build/components/tool-selector/index.js +1 -2
  503. package/build/components/tool-selector/index.js.map +1 -1
  504. package/build/components/typewriter/index.js +1 -2
  505. package/build/components/typewriter/index.js.map +1 -1
  506. package/build/components/ungroup-button/index.native.js +1 -2
  507. package/build/components/ungroup-button/index.native.js.map +1 -1
  508. package/build/components/unsupported-block-details/index.native.js +1 -2
  509. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  510. package/build/components/url-input/button.js +1 -2
  511. package/build/components/url-input/button.js.map +1 -1
  512. package/build/components/url-input/index.js +1 -2
  513. package/build/components/url-input/index.js.map +1 -1
  514. package/build/components/url-popover/image-url-input-ui.js +66 -35
  515. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  516. package/build/components/url-popover/index.js +8 -6
  517. package/build/components/url-popover/index.js.map +1 -1
  518. package/build/components/url-popover/link-editor.js +2 -1
  519. package/build/components/url-popover/link-editor.js.map +1 -1
  520. package/build/components/url-popover/link-viewer.js +2 -1
  521. package/build/components/url-popover/link-viewer.js.map +1 -1
  522. package/build/components/use-block-drop-zone/index.js +15 -5
  523. package/build/components/use-block-drop-zone/index.js.map +1 -1
  524. package/build/components/use-flash-editable-blocks/index.js +60 -0
  525. package/build/components/use-flash-editable-blocks/index.js.map +1 -0
  526. package/build/components/use-moving-animation/index.js +1 -2
  527. package/build/components/use-moving-animation/index.js.map +1 -1
  528. package/build/components/use-on-block-drop/index.js +4 -4
  529. package/build/components/use-on-block-drop/index.js.map +1 -1
  530. package/build/components/use-settings/index.js +3 -162
  531. package/build/components/use-settings/index.js.map +1 -1
  532. package/build/components/video-player/gridicon-play.native.js +1 -2
  533. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  534. package/build/components/video-player/index.native.js +2 -4
  535. package/build/components/video-player/index.native.js.map +1 -1
  536. package/build/components/warning/index.js +1 -2
  537. package/build/components/warning/index.js.map +1 -1
  538. package/build/components/warning/index.native.js +1 -2
  539. package/build/components/warning/index.native.js.map +1 -1
  540. package/build/components/writing-flow/index.js +1 -2
  541. package/build/components/writing-flow/index.js.map +1 -1
  542. package/build/components/writing-flow/use-clipboard-handler.js +3 -48
  543. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  544. package/build/components/writing-flow/use-drag-selection.js +13 -2
  545. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  546. package/build/components/writing-flow/utils.js +86 -0
  547. package/build/components/writing-flow/utils.js.map +1 -0
  548. package/build/hooks/align.js +1 -2
  549. package/build/hooks/align.js.map +1 -1
  550. package/build/hooks/align.native.js +2 -2
  551. package/build/hooks/align.native.js.map +1 -1
  552. package/build/hooks/anchor.js +1 -2
  553. package/build/hooks/anchor.js.map +1 -1
  554. package/build/hooks/aria-label.js +1 -2
  555. package/build/hooks/aria-label.js.map +1 -1
  556. package/build/hooks/background.js +52 -14
  557. package/build/hooks/background.js.map +1 -1
  558. package/build/hooks/block-hooks.js +1 -2
  559. package/build/hooks/block-hooks.js.map +1 -1
  560. package/build/hooks/block-renaming.js +1 -2
  561. package/build/hooks/block-renaming.js.map +1 -1
  562. package/build/hooks/border.js +42 -7
  563. package/build/hooks/border.js.map +1 -1
  564. package/build/hooks/color.js +4 -6
  565. package/build/hooks/color.js.map +1 -1
  566. package/build/hooks/content-lock-ui.js +1 -2
  567. package/build/hooks/content-lock-ui.js.map +1 -1
  568. package/build/hooks/custom-class-name.js +1 -2
  569. package/build/hooks/custom-class-name.js.map +1 -1
  570. package/build/hooks/custom-class-name.native.js +1 -2
  571. package/build/hooks/custom-class-name.native.js.map +1 -1
  572. package/build/hooks/dimensions.js +5 -10
  573. package/build/hooks/dimensions.js.map +1 -1
  574. package/build/hooks/duotone.js +1 -3
  575. package/build/hooks/duotone.js.map +1 -1
  576. package/build/hooks/font-family.js +2 -4
  577. package/build/hooks/font-family.js.map +1 -1
  578. package/build/hooks/font-size.js +25 -31
  579. package/build/hooks/font-size.js.map +1 -1
  580. package/build/hooks/index.js +2 -8
  581. package/build/hooks/index.js.map +1 -1
  582. package/build/hooks/index.native.js +0 -6
  583. package/build/hooks/index.native.js.map +1 -1
  584. package/build/hooks/layout-child.js +1 -2
  585. package/build/hooks/layout-child.js.map +1 -1
  586. package/build/hooks/layout.js +2 -4
  587. package/build/hooks/layout.js.map +1 -1
  588. package/build/hooks/line-height.js +1 -2
  589. package/build/hooks/line-height.js.map +1 -1
  590. package/build/hooks/position.js +1 -2
  591. package/build/hooks/position.js.map +1 -1
  592. package/build/hooks/style.js +3 -8
  593. package/build/hooks/style.js.map +1 -1
  594. package/build/hooks/typography.js +4 -6
  595. package/build/hooks/typography.js.map +1 -1
  596. package/build/hooks/typography.native.js +3 -6
  597. package/build/hooks/typography.native.js.map +1 -1
  598. package/build/hooks/use-bindings-attributes.js +12 -11
  599. package/build/hooks/use-bindings-attributes.js.map +1 -1
  600. package/build/hooks/use-shadow-props.js +0 -15
  601. package/build/hooks/use-shadow-props.js.map +1 -1
  602. package/build/hooks/utils.js +3 -6
  603. package/build/hooks/utils.js.map +1 -1
  604. package/build/index.js +0 -7
  605. package/build/index.js.map +1 -1
  606. package/build/layouts/constrained.js +1 -2
  607. package/build/layouts/constrained.js.map +1 -1
  608. package/build/layouts/definitions.js +1 -2
  609. package/build/layouts/definitions.js.map +1 -1
  610. package/build/layouts/flex.js +1 -2
  611. package/build/layouts/flex.js.map +1 -1
  612. package/build/layouts/flow.js +1 -2
  613. package/build/layouts/flow.js.map +1 -1
  614. package/build/layouts/grid.js +1 -2
  615. package/build/layouts/grid.js.map +1 -1
  616. package/build/private-apis.js +8 -5
  617. package/build/private-apis.js.map +1 -1
  618. package/build/private-apis.native.js +3 -4
  619. package/build/private-apis.native.js.map +1 -1
  620. package/build/store/actions.js +2 -4
  621. package/build/store/actions.js.map +1 -1
  622. package/build/store/constants.js +1 -2
  623. package/build/store/constants.js.map +1 -1
  624. package/build/store/defaults.js +2 -4
  625. package/build/store/defaults.js.map +1 -1
  626. package/build/store/defaults.native.js +1 -2
  627. package/build/store/defaults.native.js.map +1 -1
  628. package/build/store/get-block-settings.js +180 -0
  629. package/build/store/get-block-settings.js.map +1 -0
  630. package/build/store/index.js +4 -6
  631. package/build/store/index.js.map +1 -1
  632. package/build/store/private-actions.js +37 -3
  633. package/build/store/private-actions.js.map +1 -1
  634. package/build/store/private-selectors.js +55 -29
  635. package/build/store/private-selectors.js.map +1 -1
  636. package/build/store/reducer.js +27 -6
  637. package/build/store/reducer.js.map +1 -1
  638. package/build/store/selectors.js +98 -102
  639. package/build/store/selectors.js.map +1 -1
  640. package/build/store/undo-ignore.js +1 -2
  641. package/build/store/undo-ignore.js.map +1 -1
  642. package/build/utils/object.js +0 -17
  643. package/build/utils/object.js.map +1 -1
  644. package/build/utils/selection.js +1 -2
  645. package/build/utils/selection.js.map +1 -1
  646. package/build/utils/transform-styles/index.js +3 -4
  647. package/build/utils/transform-styles/index.js.map +1 -1
  648. package/build-module/components/block-breadcrumb/index.js +0 -1
  649. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  650. package/build-module/components/block-inspector/index.js +10 -7
  651. package/build-module/components/block-inspector/index.js.map +1 -1
  652. package/build-module/components/block-list/block.js +32 -20
  653. package/build-module/components/block-list/block.js.map +1 -1
  654. package/build-module/components/block-list/block.native.js +6 -4
  655. package/build-module/components/block-list/block.native.js.map +1 -1
  656. package/build-module/components/block-list/index.js +18 -7
  657. package/build-module/components/block-list/index.js.map +1 -1
  658. package/build-module/components/block-list/use-block-props/index.js +8 -1
  659. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  660. package/build-module/components/block-list-appender/index.js +5 -51
  661. package/build-module/components/block-list-appender/index.js.map +1 -1
  662. package/build-module/components/block-mover/mover-description.native.js +0 -2
  663. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  664. package/build-module/components/block-popover/inbetween.js +0 -1
  665. package/build-module/components/block-popover/inbetween.js.map +1 -1
  666. package/build-module/components/block-preview/auto.js +2 -1
  667. package/build-module/components/block-preview/auto.js.map +1 -1
  668. package/build-module/components/block-removal-warning-modal/index.js +4 -2
  669. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  670. package/build-module/components/block-switcher/index.js +12 -9
  671. package/build-module/components/block-switcher/index.js.map +1 -1
  672. package/build-module/components/block-title/use-block-display-title.js +22 -28
  673. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  674. package/build-module/components/block-tools/block-selection-button.js +20 -17
  675. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  676. package/build-module/components/block-tools/index.js +2 -10
  677. package/build-module/components/block-tools/index.js.map +1 -1
  678. package/build-module/components/colors-gradients/control.js +0 -1
  679. package/build-module/components/colors-gradients/control.js.map +1 -1
  680. package/build-module/components/default-block-appender/index.js +30 -37
  681. package/build-module/components/default-block-appender/index.js.map +1 -1
  682. package/build-module/components/global-styles/border-panel.js +57 -9
  683. package/build-module/components/global-styles/border-panel.js.map +1 -1
  684. package/build-module/components/global-styles/get-global-styles-changes.js +2 -4
  685. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  686. package/build-module/components/global-styles/hooks.js +2 -3
  687. package/build-module/components/global-styles/hooks.js.map +1 -1
  688. package/build-module/components/global-styles/index.js +0 -1
  689. package/build-module/components/global-styles/index.js.map +1 -1
  690. package/build-module/components/global-styles/shadow-panel-components.js +121 -0
  691. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -0
  692. package/build-module/components/global-styles/typography-panel.js +17 -35
  693. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  694. package/build-module/components/global-styles/use-global-styles-output.js +2 -2
  695. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  696. package/build-module/components/global-styles/utils.js +30 -1
  697. package/build-module/components/global-styles/utils.js.map +1 -1
  698. package/build-module/components/inner-blocks/index.js +33 -29
  699. package/build-module/components/inner-blocks/index.js.map +1 -1
  700. package/build-module/components/inner-blocks/index.native.js +1 -4
  701. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  702. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +2 -3
  703. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  704. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +4 -4
  705. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  706. package/build-module/components/inserter/block-patterns-tab/utils.js +2 -2
  707. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  708. package/build-module/components/inserter/quick-inserter.js +3 -2
  709. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  710. package/build-module/components/inserter/search-items.js +0 -1
  711. package/build-module/components/inserter/search-items.js.map +1 -1
  712. package/build-module/components/inserter-draggable-blocks/index.js +12 -1
  713. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  714. package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -4
  715. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  716. package/build-module/components/link-control/index.js +1 -14
  717. package/build-module/components/link-control/index.js.map +1 -1
  718. package/build-module/components/link-control/link-preview.js +16 -18
  719. package/build-module/components/link-control/link-preview.js.map +1 -1
  720. package/build-module/components/link-control/use-create-page.js +0 -1
  721. package/build-module/components/link-control/use-create-page.js.map +1 -1
  722. package/build-module/components/list-view/block.js +32 -26
  723. package/build-module/components/list-view/block.js.map +1 -1
  724. package/build-module/components/list-view/index.js +17 -11
  725. package/build-module/components/list-view/index.js.map +1 -1
  726. package/build-module/components/list-view/use-clipboard-handler.js +153 -0
  727. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -0
  728. package/build-module/components/list-view/utils.js +4 -4
  729. package/build-module/components/list-view/utils.js.map +1 -1
  730. package/build-module/components/navigable-toolbar/index.js +5 -2
  731. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  732. package/build-module/components/provider/index.js +1 -1
  733. package/build-module/components/provider/index.js.map +1 -1
  734. package/build-module/components/responsive-block-control/index.js +3 -6
  735. package/build-module/components/responsive-block-control/index.js.map +1 -1
  736. package/build-module/components/rich-text/index.js +4 -2
  737. package/build-module/components/rich-text/index.js.map +1 -1
  738. package/build-module/components/rich-text/native/index.native.js +0 -4
  739. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  740. package/build-module/components/spacing-sizes-control/index.js +4 -2
  741. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  742. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  743. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  744. package/build-module/components/url-popover/image-url-input-ui.js +69 -38
  745. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  746. package/build-module/components/url-popover/index.js +8 -5
  747. package/build-module/components/url-popover/index.js.map +1 -1
  748. package/build-module/components/url-popover/link-editor.js +2 -1
  749. package/build-module/components/url-popover/link-editor.js.map +1 -1
  750. package/build-module/components/url-popover/link-viewer.js +2 -1
  751. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  752. package/build-module/components/use-block-drop-zone/index.js +15 -5
  753. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  754. package/build-module/components/use-flash-editable-blocks/index.js +53 -0
  755. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -0
  756. package/build-module/components/use-on-block-drop/index.js +4 -4
  757. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  758. package/build-module/components/use-settings/index.js +3 -159
  759. package/build-module/components/use-settings/index.js.map +1 -1
  760. package/build-module/components/writing-flow/use-clipboard-handler.js +4 -49
  761. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  762. package/build-module/components/writing-flow/use-drag-selection.js +13 -2
  763. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  764. package/build-module/components/writing-flow/utils.js +79 -0
  765. package/build-module/components/writing-flow/utils.js.map +1 -0
  766. package/build-module/hooks/background.js +48 -10
  767. package/build-module/hooks/background.js.map +1 -1
  768. package/build-module/hooks/border.js +38 -3
  769. package/build-module/hooks/border.js.map +1 -1
  770. package/build-module/hooks/duotone.js +0 -1
  771. package/build-module/hooks/duotone.js.map +1 -1
  772. package/build-module/hooks/font-size.js +23 -27
  773. package/build-module/hooks/font-size.js.map +1 -1
  774. package/build-module/hooks/index.js +1 -1
  775. package/build-module/hooks/index.js.map +1 -1
  776. package/build-module/hooks/index.native.js +1 -1
  777. package/build-module/hooks/index.native.js.map +1 -1
  778. package/build-module/hooks/style.js +3 -7
  779. package/build-module/hooks/style.js.map +1 -1
  780. package/build-module/hooks/use-bindings-attributes.js +10 -13
  781. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  782. package/build-module/hooks/use-shadow-props.js +0 -14
  783. package/build-module/hooks/use-shadow-props.js.map +1 -1
  784. package/build-module/hooks/utils.js +3 -6
  785. package/build-module/hooks/utils.js.map +1 -1
  786. package/build-module/index.js +1 -1
  787. package/build-module/index.js.map +1 -1
  788. package/build-module/private-apis.js +5 -1
  789. package/build-module/private-apis.js.map +1 -1
  790. package/build-module/store/get-block-settings.js +171 -0
  791. package/build-module/store/get-block-settings.js.map +1 -0
  792. package/build-module/store/private-actions.js +35 -3
  793. package/build-module/store/private-actions.js.map +1 -1
  794. package/build-module/store/private-selectors.js +42 -19
  795. package/build-module/store/private-selectors.js.map +1 -1
  796. package/build-module/store/reducer.js +24 -2
  797. package/build-module/store/reducer.js.map +1 -1
  798. package/build-module/store/selectors.js +65 -34
  799. package/build-module/store/selectors.js.map +1 -1
  800. package/build-module/utils/object.js +0 -16
  801. package/build-module/utils/object.js.map +1 -1
  802. package/build-style/content-rtl.css +23 -15
  803. package/build-style/content.css +23 -15
  804. package/build-style/style-rtl.css +97 -67
  805. package/build-style/style.css +97 -67
  806. package/package.json +31 -31
  807. package/src/components/block-canvas/style.scss +3 -3
  808. package/src/components/block-card/style.scss +3 -1
  809. package/src/components/block-controls/README.md +2 -2
  810. package/src/components/block-inspector/index.js +11 -9
  811. package/src/components/block-list/block.js +45 -20
  812. package/src/components/block-list/block.native.js +7 -4
  813. package/src/components/block-list/content.scss +23 -28
  814. package/src/components/block-list/index.js +49 -25
  815. package/src/components/block-list/use-block-props/index.js +8 -0
  816. package/src/components/block-list-appender/index.js +7 -74
  817. package/src/components/block-mover/style.scss +4 -3
  818. package/src/components/block-preview/auto.js +2 -1
  819. package/src/components/block-removal-warning-modal/index.js +17 -10
  820. package/src/components/block-switcher/index.js +22 -13
  821. package/src/components/block-title/test/index.js +86 -85
  822. package/src/components/block-title/use-block-display-title.js +25 -36
  823. package/src/components/block-toolbar/style.scss +8 -1
  824. package/src/components/block-tools/block-selection-button.js +23 -26
  825. package/src/components/block-tools/index.js +2 -12
  826. package/src/components/colors-gradients/control.js +0 -1
  827. package/src/components/default-block-appender/index.js +26 -38
  828. package/src/components/default-block-appender/test/index.js +24 -16
  829. package/src/components/font-sizes/README.MD +0 -9
  830. package/src/components/global-styles/border-panel.js +72 -1
  831. package/src/components/global-styles/get-global-styles-changes.js +2 -8
  832. package/src/components/global-styles/hooks.js +0 -2
  833. package/src/components/global-styles/index.js +0 -1
  834. package/src/components/global-styles/shadow-panel-components.js +125 -0
  835. package/src/components/global-styles/style.scss +8 -9
  836. package/src/components/global-styles/test/get-global-styles-changes.js +3 -3
  837. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  838. package/src/components/global-styles/test/utils.js +86 -0
  839. package/src/components/global-styles/typography-panel.js +14 -47
  840. package/src/components/global-styles/use-global-styles-output.js +5 -1
  841. package/src/components/global-styles/utils.js +36 -0
  842. package/src/components/inner-blocks/index.js +31 -32
  843. package/src/components/inner-blocks/index.native.js +3 -9
  844. package/src/components/inner-blocks/use-inner-block-template-sync.js +1 -3
  845. package/src/components/inserter/block-patterns-tab/patterns-filter.js +4 -10
  846. package/src/components/inserter/block-patterns-tab/utils.js +2 -2
  847. package/src/components/inserter/quick-inserter.js +4 -2
  848. package/src/components/inserter/style.scss +3 -13
  849. package/src/components/inserter-draggable-blocks/index.js +12 -1
  850. package/src/components/inspector-controls-tabs/styles-tab.js +4 -2
  851. package/src/components/link-control/index.js +1 -20
  852. package/src/components/link-control/link-preview.js +19 -24
  853. package/src/components/link-control/style.scss +5 -11
  854. package/src/components/link-control/test/index.js +11 -90
  855. package/src/components/list-view/block.js +49 -41
  856. package/src/components/list-view/index.js +22 -9
  857. package/src/components/list-view/use-clipboard-handler.js +199 -0
  858. package/src/components/list-view/utils.js +4 -4
  859. package/src/components/media-replace-flow/test/index.js +1 -1
  860. package/src/components/navigable-toolbar/index.js +8 -4
  861. package/src/components/provider/index.js +1 -1
  862. package/src/components/responsive-block-control/index.js +3 -5
  863. package/src/components/rich-text/index.js +4 -3
  864. package/src/components/spacing-sizes-control/index.js +2 -1
  865. package/src/components/url-input/style.scss +4 -2
  866. package/src/components/url-popover/image-url-input-ui.js +98 -37
  867. package/src/components/url-popover/index.js +75 -67
  868. package/src/components/url-popover/link-editor.js +1 -0
  869. package/src/components/url-popover/link-viewer.js +1 -0
  870. package/src/components/url-popover/style.scss +42 -31
  871. package/src/components/use-block-drop-zone/index.js +17 -3
  872. package/src/components/use-flash-editable-blocks/index.js +62 -0
  873. package/src/components/use-on-block-drop/index.js +11 -4
  874. package/src/components/use-settings/index.js +9 -232
  875. package/src/components/writing-flow/use-clipboard-handler.js +6 -78
  876. package/src/components/writing-flow/use-drag-selection.js +12 -3
  877. package/src/components/writing-flow/utils.js +103 -0
  878. package/src/hooks/background.js +53 -8
  879. package/src/hooks/border.js +47 -6
  880. package/src/hooks/font-size.js +33 -33
  881. package/src/hooks/index.js +1 -1
  882. package/src/hooks/index.native.js +1 -1
  883. package/src/hooks/style.js +5 -9
  884. package/src/hooks/test/background.js +50 -0
  885. package/src/hooks/test/font-size.js +164 -0
  886. package/src/hooks/use-bindings-attributes.js +10 -23
  887. package/src/hooks/use-shadow-props.js +0 -14
  888. package/src/hooks/utils.js +4 -16
  889. package/src/index.js +0 -1
  890. package/src/private-apis.js +4 -0
  891. package/src/store/get-block-settings.js +225 -0
  892. package/src/store/private-actions.js +44 -2
  893. package/src/store/private-selectors.js +53 -38
  894. package/src/store/reducer.js +29 -1
  895. package/src/store/selectors.js +74 -48
  896. package/src/store/test/get-block-settings.js +90 -0
  897. package/src/store/test/private-actions.js +18 -0
  898. package/src/store/test/private-selectors.js +19 -0
  899. package/src/store/test/reducer.js +19 -0
  900. package/src/utils/object.js +0 -16
  901. package/build/components/global-styles/effects-panel.js +0 -219
  902. package/build/components/global-styles/effects-panel.js.map +0 -1
  903. package/build/hooks/effects.js +0 -66
  904. package/build/hooks/effects.js.map +0 -1
  905. package/build-module/components/global-styles/effects-panel.js +0 -210
  906. package/build-module/components/global-styles/effects-panel.js.map +0 -1
  907. package/build-module/hooks/effects.js +0 -51
  908. package/build-module/hooks/effects.js.map +0 -1
  909. package/src/components/global-styles/effects-panel.js +0 -244
  910. package/src/components/use-settings/test/index.js +0 -141
  911. package/src/hooks/effects.js +0 -57
  912. package/src/hooks/test/effects.js +0 -39
@@ -25,6 +25,7 @@ import { useEventHandlers } from './use-selected-block-event-handlers';
25
25
  import { useNavModeExit } from './use-nav-mode-exit';
26
26
  import { useBlockRefProvider } from './use-block-refs';
27
27
  import { useIntersectionObserver } from './use-intersection-observer';
28
+ import { useFlashEditableBlocks } from '../../use-flash-editable-blocks';
28
29
 
29
30
  /**
30
31
  * This hook is used to lightly mark an element as a block element. The element
@@ -97,8 +98,10 @@ export function useBlockProps(props = {}, {
97
98
  isBlockMovingMode,
98
99
  canInsertMovingBlock,
99
100
  isEditingDisabled,
101
+ hasEditableOutline,
100
102
  isTemporarilyEditingAsBlocks,
101
- defaultClassName
103
+ defaultClassName,
104
+ templateLock
102
105
  } = useContext(PrivateBlockContext);
103
106
 
104
107
  // translators: %s: Type of block (i.e. Text, Image etc)
@@ -117,6 +120,9 @@ export function useBlockProps(props = {}, {
117
120
  clientId
118
121
  }), useDisabled({
119
122
  isDisabled: !hasOverlay
123
+ }), useFlashEditableBlocks({
124
+ clientId,
125
+ isEnabled: name === 'core/block' || templateLock === 'contentOnly'
120
126
  })]);
121
127
  const blockEditContext = useBlockEditContext();
122
128
  // Ensures it warns only inside the `edit` implementation for the block.
@@ -150,6 +156,7 @@ export function useBlockProps(props = {}, {
150
156
  'is-block-moving-mode': isBlockMovingMode,
151
157
  'can-insert-moving-block': canInsertMovingBlock,
152
158
  'is-editing-disabled': isEditingDisabled,
159
+ 'has-editable-outline': hasEditableOutline,
153
160
  'is-content-locked-temporarily-editing-as-blocks': isTemporarilyEditingAsBlocks
154
161
  }, className, props.className, wrapperProps.className, defaultClassName),
155
162
  style: {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useBlockRefProvider","useIntersectionObserver","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","isOutlineEnabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","removeOutline","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","isTemporarilyEditingAsBlocks","defaultClassName","blockLabel","htmlSuffix","mergedRefs","ref","isEnabled","triggerAnimationOnChange","isDisabled","blockEditContext","SCRIPT_DEBUG","tabIndex","id","role","inert","undefined","style","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport { useBlockEditContext } from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps(\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\tisOutlineEnabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tremoveOutline,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseIsHovered( { isEnabled: isOutlineEnabled } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: classnames(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'remove-outline': removeOutline,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAIC,aAAa,QAAQ,mBAAmB;AAC5E,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,uBAAuB,QAAQ,6BAA6B;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,K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AAK,CAAC2C;IAAM;EAChD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA5C,aAAa,CAAC6C,IAAI,GAAG3D,aAAa"}
1
+ {"version":3,"names":["classnames","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useBlockRefProvider","useIntersectionObserver","useFlashEditableBlocks","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","isOutlineEnabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","removeOutline","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","blockLabel","htmlSuffix","mergedRefs","ref","isEnabled","triggerAnimationOnChange","isDisabled","blockEditContext","SCRIPT_DEBUG","tabIndex","id","role","inert","undefined","style","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport { useBlockEditContext } from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps(\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\tisOutlineEnabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tremoveOutline,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseIsHovered( { isEnabled: isOutlineEnabled } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: classnames(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'remove-outline': removeOutline,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAIC,aAAa,QAAQ,mBAAmB;AAC5E,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,sBAAsB,QAAQ,iCAAiC;;A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C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,gBAAgB,EAAEC,aAAa;MAC/B,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,iDAAiD,EAChDC;IACF,CAAC,EACDzB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtB0B,gBACD,CAAC;IACDgB,KAAK,EAAE;MAAE,GAAGzC,YAAY,CAACyC,KAAK;MAAE,GAAG7C,KAAK,CAAC6C;IAAM;EAChD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA9C,aAAa,CAAC+C,IAAI,GAAG9D,aAAa"}
@@ -34,56 +34,12 @@ function DefaultAppender({
34
34
  className: "block-list-appender__toggle"
35
35
  });
36
36
  }
37
- function useAppender(rootClientId, CustomAppender) {
38
- const isVisible = useSelect(select => {
39
- const {
40
- getTemplateLock,
41
- getSelectedBlockClientId,
42
- __unstableGetEditorMode,
43
- getBlockEditingMode
44
- } = select(blockEditorStore);
45
- if (!CustomAppender) {
46
- const selectedBlockClientId = getSelectedBlockClientId();
47
- const isParentSelected = rootClientId === selectedBlockClientId || !rootClientId && !selectedBlockClientId;
48
- if (!isParentSelected) {
49
- return false;
50
- }
51
- }
52
- if (getTemplateLock(rootClientId) || getBlockEditingMode(rootClientId) === 'disabled' || __unstableGetEditorMode() === 'zoom-out') {
53
- return false;
54
- }
55
- return true;
56
- }, [rootClientId, CustomAppender]);
57
- if (!isVisible) {
58
- return null;
59
- }
60
- return CustomAppender ? createElement(CustomAppender, null) : createElement(DefaultAppender, {
61
- rootClientId: rootClientId
62
- });
63
- }
64
- function BlockListAppender({
37
+ export default function BlockListAppender({
65
38
  rootClientId,
66
- renderAppender,
39
+ CustomAppender,
67
40
  className,
68
41
  tagName: TagName = 'div'
69
42
  }) {
70
- if (renderAppender === false) {
71
- return null;
72
- }
73
- return createElement(BlockListAppenderInner, {
74
- rootClientId: rootClientId,
75
- renderAppender: renderAppender,
76
- className: className,
77
- tagName: TagName
78
- });
79
- }
80
- function BlockListAppenderInner({
81
- rootClientId,
82
- renderAppender,
83
- className,
84
- tagName: TagName
85
- }) {
86
- const appender = useAppender(rootClientId, renderAppender);
87
43
  const isDragOver = useSelect(select => {
88
44
  const {
89
45
  getBlockInsertionPoint,
@@ -96,9 +52,6 @@ function BlockListAppenderInner({
96
52
  // the DnD utility hooks.
97
53
  return isBlockInsertionPointVisible() && rootClientId === insertionPoint?.rootClientId && getBlockCount(rootClientId) === 0;
98
54
  }, [rootClientId]);
99
- if (!appender) {
100
- return null;
101
- }
102
55
  return createElement(TagName
103
56
  // A `tabIndex` is used on the wrapping `div` element in order to
104
57
  // force a focus event to occur when an appender `button` element
@@ -128,7 +81,8 @@ function BlockListAppenderInner({
128
81
  // have commonly targeted that attribute for margins.
129
82
  ,
130
83
  "data-block": true
131
- }, appender);
84
+ }, CustomAppender ? createElement(CustomAppender, null) : createElement(DefaultAppender, {
85
+ rootClientId: rootClientId
86
+ }));
132
87
  }
133
- export default BlockListAppender;
134
88
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useSelect","getDefaultBlockName","DefaultBlockAppender","ButtonBlockAppender","store","blockEditorStore","DefaultAppender","rootClientId","canInsertDefaultBlock","select","canInsertBlockType","createElement","className","useAppender","CustomAppender","isVisible","getTemplateLock","getSelectedBlockClientId","__unstableGetEditorMode","getBlockEditingMode","selectedBlockClientId","isParentSelected","BlockListAppender","renderAppender","tagName","TagName","BlockListAppenderInner","appender","isDragOver","getBlockInsertionPoint","isBlockInsertionPointVisible","getBlockCount","insertionPoint","tabIndex","contentEditable"],"sources":["@wordpress/block-editor/src/components/block-list-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport DefaultBlockAppender from '../default-block-appender';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { store as blockEditorStore } from '../../store';\n\nfunction DefaultAppender( { rootClientId } ) {\n\tconst canInsertDefaultBlock = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t)\n\t);\n\n\tif ( canInsertDefaultBlock ) {\n\t\t// Render the default block appender if the context supports use\n\t\t// of the default appender.\n\t\treturn <DefaultBlockAppender rootClientId={ rootClientId } />;\n\t}\n\n\t// Fallback in case the default block can't be inserted.\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ rootClientId }\n\t\t\tclassName=\"block-list-appender__toggle\"\n\t\t/>\n\t);\n}\n\nfunction useAppender( rootClientId, CustomAppender ) {\n\tconst isVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! CustomAppender ) {\n\t\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\t\tconst isParentSelected =\n\t\t\t\t\trootClientId === selectedBlockClientId ||\n\t\t\t\t\t( ! rootClientId && ! selectedBlockClientId );\n\t\t\t\tif ( ! isParentSelected ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled' ||\n\t\t\t\t__unstableGetEditorMode() === 'zoom-out'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\t\t[ rootClientId, CustomAppender ]\n\t);\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn CustomAppender ? (\n\t\t<CustomAppender />\n\t) : (\n\t\t<DefaultAppender rootClientId={ rootClientId } />\n\t);\n}\n\nfunction BlockListAppender( {\n\trootClientId,\n\trenderAppender,\n\tclassName,\n\ttagName: TagName = 'div',\n} ) {\n\tif ( renderAppender === false ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockListAppenderInner\n\t\t\trootClientId={ rootClientId }\n\t\t\trenderAppender={ renderAppender }\n\t\t\tclassName={ className }\n\t\t\ttagName={ TagName }\n\t\t/>\n\t);\n}\n\nfunction BlockListAppenderInner( {\n\trootClientId,\n\trenderAppender,\n\tclassName,\n\ttagName: TagName,\n} ) {\n\tconst appender = useAppender( rootClientId, renderAppender );\n\tconst isDragOver = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\t// Ideally we should also check for `isDragging` but currently it\n\t\t\t// requires a lot more setup. We can revisit this once we refactor\n\t\t\t// the DnD utility hooks.\n\t\t\treturn (\n\t\t\t\tisBlockInsertionPointVisible() &&\n\t\t\t\trootClientId === insertionPoint?.rootClientId &&\n\t\t\t\tgetBlockCount( rootClientId ) === 0\n\t\t\t);\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\tif ( ! appender ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<TagName\n\t\t\t// A `tabIndex` is used on the wrapping `div` element in order to\n\t\t\t// force a focus event to occur when an appender `button` element\n\t\t\t// is clicked. In some browsers (Firefox, Safari), button clicks do\n\t\t\t// not emit a focus event, which could cause this event to propagate\n\t\t\t// unexpectedly. The `tabIndex` ensures that the interaction is\n\t\t\t// captured as a focus, without also adding an extra tab stop.\n\t\t\t//\n\t\t\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName={ classnames( 'block-list-appender wp-block', className, {\n\t\t\t\t'is-drag-over': isDragOver,\n\t\t\t} ) }\n\t\t\t// Needed in case the whole editor is content editable (for multi\n\t\t\t// selection). It fixes an edge case where ArrowDown and ArrowRight\n\t\t\t// should collapse the selection to the end of that selection and\n\t\t\t// not into the appender.\n\t\t\tcontentEditable={ false }\n\t\t\t// The appender exists to let you add the first Paragraph before\n\t\t\t// any is inserted. To that end, this appender should visually be\n\t\t\t// presented as a block. That means theme CSS should style it as if\n\t\t\t// it were an empty paragraph block. That means a `wp-block` class to\n\t\t\t// ensure the width is correct, and a [data-block] attribute to ensure\n\t\t\t// the correct margin is applied, especially for classic themes which\n\t\t\t// have commonly targeted that attribute for margins.\n\t\t\tdata-block\n\t\t>\n\t\t\t{ appender }\n\t\t</TagName>\n\t);\n}\n\nexport default BlockListAppender;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,QAAQ,mBAAmB;;AAEvD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,SAASC,eAAeA,CAAE;EAAEC;AAAa,CAAC,EAAG;EAC5C,MAAMC,qBAAqB,GAAGR,SAAS,CAAIS,MAAM,IAChDA,MAAM,CAAEJ,gBAAiB,CAAC,CAACK,kBAAkB,CAC5CT,mBAAmB,CAAC,CAAC,EACrBM,YACD,CACD,CAAC;EAED,IAAKC,qBAAqB,EAAG;IAC5B;IACA;IACA,OAAOG,aAAA,CAACT,oBAAoB;MAACK,YAAY,EAAGA;IAAc,CAAE,CAAC;EAC9D;;EAEA;EACA,OACCI,aAAA,CAACR,mBA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,OAAO,EAAGC;EAAS,CACnB,CAAC;AAEJ;AAEA,SAASC,sBAAsBA,CAAE;EAChCnB,YAAY;EACZgB,cAAc;EACdX,SAAS;EACTY,OAAO,EAAEC;AACV,CAAC,EAAG;EACH,MAAME,QAAQ,GAAGd,WAAW,CAAEN,YAAY,EAAEgB,cAAe,CAAC;EAC5D,MAAMK,UAAU,GAAG5B,SAAS,CACzBS,MAAM,IAAM;IACb,MAAM;MACLoB,sBAAsB;MACtBC,4BAA4B;MAC5BC;IACD,CAAC,GAAGtB,MAAM,CAAEJ,gBAAiB,CAAC;IAC9B,MAAM2B,cAAc,GAAGH,sBAAsB,CAAC,CAAC;IAC/C;IACA;IACA;IACA,OACCC,4BAA4B,CAAC,CAAC,IAC9BvB,YAAY,KAAKyB,cAAc,EAAEzB,YAAY,IAC7CwB,aAAa,CAAExB,YAAa,CAAC,KAAK,CAAC;EAErC,CAAC,EACD,CAAEA,YAAY,CACf,CAAC;EAED,IAAK,CAAEoB,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACChB,aAAA,CAACc;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;IACAQ,QAAQ,EAAG,CAAC,CAAG;IACfrB,SAAS,EAAGb,UAAU,CAAE,8BAA8B,EAAEa,SAAS,EAAE;MAClE,cAAc,EAAEgB;IACjB,CAAE;IACF;IACA;IACA;IACA;IAAA;IACAM,eAAe,EAAG;IAClB;IACA;IACA;IACA;IACA;IACA;IACA;IAAA;IACA;EAAU,GAERP,QACM,CAAC;AAEZ;AAEA,eAAeL,iBAAiB"}
1
+ {"version":3,"names":["classnames","useSelect","getDefaultBlockName","DefaultBlockAppender","ButtonBlockAppender","store","blockEditorStore","DefaultAppender","rootClientId","canInsertDefaultBlock","select","canInsertBlockType","createElement","className","BlockListAppender","CustomAppender","tagName","TagName","isDragOver","getBlockInsertionPoint","isBlockInsertionPointVisible","getBlockCount","insertionPoint","tabIndex","contentEditable"],"sources":["@wordpress/block-editor/src/components/block-list-appender/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport DefaultBlockAppender from '../default-block-appender';\nimport ButtonBlockAppender from '../button-block-appender';\nimport { store as blockEditorStore } from '../../store';\n\nfunction DefaultAppender( { rootClientId } ) {\n\tconst canInsertDefaultBlock = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t)\n\t);\n\n\tif ( canInsertDefaultBlock ) {\n\t\t// Render the default block appender if the context supports use\n\t\t// of the default appender.\n\t\treturn <DefaultBlockAppender rootClientId={ rootClientId } />;\n\t}\n\n\t// Fallback in case the default block can't be inserted.\n\treturn (\n\t\t<ButtonBlockAppender\n\t\t\trootClientId={ rootClientId }\n\t\t\tclassName=\"block-list-appender__toggle\"\n\t\t/>\n\t);\n}\n\nexport default function BlockListAppender( {\n\trootClientId,\n\tCustomAppender,\n\tclassName,\n\ttagName: TagName = 'div',\n} ) {\n\tconst isDragOver = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockCount,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\t// Ideally we should also check for `isDragging` but currently it\n\t\t\t// requires a lot more setup. We can revisit this once we refactor\n\t\t\t// the DnD utility hooks.\n\t\t\treturn (\n\t\t\t\tisBlockInsertionPointVisible() &&\n\t\t\t\trootClientId === insertionPoint?.rootClientId &&\n\t\t\t\tgetBlockCount( rootClientId ) === 0\n\t\t\t);\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\treturn (\n\t\t<TagName\n\t\t\t// A `tabIndex` is used on the wrapping `div` element in order to\n\t\t\t// force a focus event to occur when an appender `button` element\n\t\t\t// is clicked. In some browsers (Firefox, Safari), button clicks do\n\t\t\t// not emit a focus event, which could cause this event to propagate\n\t\t\t// unexpectedly. The `tabIndex` ensures that the interaction is\n\t\t\t// captured as a focus, without also adding an extra tab stop.\n\t\t\t//\n\t\t\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\t\t\ttabIndex={ -1 }\n\t\t\tclassName={ classnames( 'block-list-appender wp-block', className, {\n\t\t\t\t'is-drag-over': isDragOver,\n\t\t\t} ) }\n\t\t\t// Needed in case the whole editor is content editable (for multi\n\t\t\t// selection). It fixes an edge case where ArrowDown and ArrowRight\n\t\t\t// should collapse the selection to the end of that selection and\n\t\t\t// not into the appender.\n\t\t\tcontentEditable={ false }\n\t\t\t// The appender exists to let you add the first Paragraph before\n\t\t\t// any is inserted. To that end, this appender should visually be\n\t\t\t// presented as a block. That means theme CSS should style it as if\n\t\t\t// it were an empty paragraph block. That means a `wp-block` class to\n\t\t\t// ensure the width is correct, and a [data-block] attribute to ensure\n\t\t\t// the correct margin is applied, especially for classic themes which\n\t\t\t// have commonly targeted that attribute for margins.\n\t\t\tdata-block\n\t\t>\n\t\t\t{ CustomAppender ? (\n\t\t\t\t<CustomAppender />\n\t\t\t) : (\n\t\t\t\t<DefaultAppender rootClientId={ rootClientId } />\n\t\t\t) }\n\t\t</TagName>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,QAAQ,mBAAmB;;AAEvD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAEvD,SAASC,eAAeA,CAAE;EAAEC;AAAa,CAAC,EAAG;EAC5C,MAAMC,qBAAqB,G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c,CAAE,CAEzC,CAAC;AAEZ"}
@@ -59,10 +59,8 @@ function switchButtonPropIfRTL(isBackwardButton, forwardButtonProp, backwardButt
59
59
  if (isBackwardButton) {
60
60
  return forwardButtonProp; // Set forwardButtonProp for backward button.
61
61
  }
62
-
63
62
  return backwardButtonProp; // Set backwardButtonProp for forward button.
64
63
  }
65
-
66
64
  return isBackwardButton ? backwardButtonProp : forwardButtonProp;
67
65
  }
68
66
  function getSetup() {
@@ -1 +1 @@
1
- {"version":3,"names":["I18nManager","__","sprintf","arrowUp","arrowDown","arrowLeft","arrowRight","horizontalMover","backwardButtonIcon","forwardButtonIcon","backwardButtonHint","forwardButtonHint","firstBlockTitle","lastBlockTitle","backwardButtonTitle","forwardButtonTitle","verticalMover","KEYS","SETUP_GETTER","description","getMoverDescription","icon","getArrowIcon","title","getMoverButtonTitle","actionTitle","getMoverActionTitle","getMoversSetup","isStackedHorizontally","firstIndex","keys","reduce","setup","key","includes","Object","assign","getSetup","switchButtonPropIfRTL","isBackwardButton","forwardButtonProp","backwardButtonProp","isRTL","args","arguments","apply","applyRTLSetup","backward","forward","actionTitlePrev","actionTitleNext","getIndexes","fromIndex","direction","toIndex","buttonTitlePrev","buttonTitleNext"],"sources":["@wordpress/block-editor/src/components/block-mover/mover-description.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { I18nManager } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { arrowUp, arrowDown, arrowLeft, arrowRight } from '@wordpress/icons';\n\nconst horizontalMover = {\n\tbackwardButtonIcon: arrowLeft,\n\tforwardButtonIcon: arrowRight,\n\tbackwardButtonHint: __( 'Double tap to move the block to the left' ),\n\tforwardButtonHint: __( 'Double tap to move the block to the right' ),\n\tfirstBlockTitle: __( 'Move block left' ),\n\tlastBlockTitle: __( 'Move block right' ),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tbackwardButtonTitle: __(\n\t\t'Move block left from position %1$s to position %2$s'\n\t),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tforwardButtonTitle: __(\n\t\t'Move block right from position %1$s to position %2$s'\n\t),\n};\n\nconst verticalMover = {\n\tbackwardButtonIcon: arrowUp,\n\tforwardButtonIcon: arrowDown,\n\tbackwardButtonHint: __( 'Double tap to move the block up' ),\n\tforwardButtonHint: __( 'Double tap to move the block down' ),\n\tfirstBlockTitle: __( 'Move block up' ),\n\tlastBlockTitle: __( 'Move block down' ),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tbackwardButtonTitle: __( 'Move block up from row %1$s to row %2$s' ),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tforwardButtonTitle: __( 'Move block down from row %1$s to row %2$s' ),\n};\n\nconst KEYS = [ 'description', 'icon', 'title', 'actionTitle' ];\n\nconst SETUP_GETTER = {\n\tdescription: getMoverDescription,\n\ticon: getArrowIcon,\n\ttitle: getMoverButtonTitle,\n\tactionTitle: getMoverActionTitle,\n};\n\nexport function getMoversSetup(\n\tisStackedHorizontally,\n\t{ firstIndex, keys = KEYS }\n) {\n\treturn keys.reduce( ( setup, key ) => {\n\t\tif ( KEYS.includes( key ) ) {\n\t\t\tObject.assign( setup, {\n\t\t\t\t[ key ]: getSetup( key, isStackedHorizontally, {\n\t\t\t\t\tfirstIndex,\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\t\treturn setup;\n\t}, {} );\n}\n\nfunction switchButtonPropIfRTL(\n\tisBackwardButton,\n\tforwardButtonProp,\n\tbackwardButtonProp,\n\tisStackedHorizontally\n) {\n\tif ( I18nManager.isRTL && isStackedHorizontally ) {\n\t\t// For RTL and horizontal direction switch prop between forward and backward button.\n\t\tif ( isBackwardButton ) {\n\t\t\treturn forwardButtonProp; // Set forwardButtonProp for backward button.\n\t\t}\n\t\treturn backwardButtonProp; // Set backwardButtonProp for forward button.\n\t}\n\n\treturn isBackwardButton ? backwardButtonProp : forwardButtonProp;\n}\n\nfunction getSetup() {\n\tconst [ key, ...args ] = arguments;\n\treturn SETUP_GETTER[ key ].apply( null, [ ...args ] );\n}\n\nfunction applyRTLSetup( isBackwardButton, args ) {\n\treturn switchButtonPropIfRTL.apply( null, [ isBackwardButton, ...args ] );\n}\n\nfunction getMoverDescription( isStackedHorizontally ) {\n\treturn isStackedHorizontally ? horizontalMover : verticalMover;\n}\n\nfunction getArrowIcon( isStackedHorizontally ) {\n\tconst { forwardButtonIcon, backwardButtonIcon } = getMoverDescription(\n\t\tisStackedHorizontally\n\t);\n\n\tconst args = [\n\t\tforwardButtonIcon,\n\t\tbackwardButtonIcon,\n\t\tisStackedHorizontally,\n\t];\n\n\treturn {\n\t\tbackward: applyRTLSetup( true, args ),\n\t\tforward: applyRTLSetup( false, args ),\n\t};\n}\n\nfunction getMoverActionTitle( isStackedHorizontally ) {\n\tconst { firstBlockTitle, lastBlockTitle } = getMoverDescription(\n\t\tisStackedHorizontally\n\t);\n\n\tconst args = [ lastBlockTitle, firstBlockTitle, isStackedHorizontally ];\n\n\tconst actionTitlePrev = applyRTLSetup( true, args );\n\tconst actionTitleNext = applyRTLSetup( false, args );\n\n\treturn {\n\t\tbackward: sprintf( actionTitlePrev, firstBlockTitle ),\n\t\tforward: sprintf( actionTitleNext, lastBlockTitle ),\n\t};\n}\n\nfunction getMoverButtonTitle( isStackedHorizontally, { firstIndex } ) {\n\tconst getIndexes = ( isBackwardButton ) => {\n\t\tconst fromIndex = firstIndex + 1; // Current position based on index\n\t\t// for backwardButton decrease index (move left/up) for forwardButton increase index (move right/down)\n\t\tconst direction = isBackwardButton ? -1 : 1;\n\t\tconst toIndex = fromIndex + direction; // Position after move.\n\t\treturn [ fromIndex, toIndex ];\n\t};\n\n\tconst { backwardButtonTitle, forwardButtonTitle } = getMoverDescription(\n\t\tisStackedHorizontally\n\t);\n\n\tconst args = [\n\t\tforwardButtonTitle,\n\t\tbackwardButtonTitle,\n\t\tisStackedHorizontally,\n\t];\n\n\tconst buttonTitlePrev = applyRTLSetup( true, args );\n\tconst buttonTitleNext = applyRTLSetup( false, args );\n\n\treturn {\n\t\tbackward: sprintf( buttonTitlePrev, ...getIndexes( true ) ),\n\t\tforward: sprintf( buttonTitleNext, ...getIndexes( false ) ),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,OAAO,EAAEC,SAAS,EAAEC,SAAS,EAAEC,UAAU,QAAQ,kBAAkB;AAE5E,MAAMC,eAAe,GAAG;EACvBC,kBAAkB,EAAEH,SAAS;EAC7BI,iBAAiB,EAAEH,UAAU;EAC7BI,kBAAkB,EAAET,EAAE,CAAE,0CAA2C,CAAC;EACpEU,iBAAiB,EAAEV,EAAE,CAAE,2CAA4C,CAAC;EACpEW,eAAe,EAAEX,EAAE,CAAE,iBAAkB,CAAC;EACxCY,cAAc,EAAEZ,EAAE,CAAE,kBAAmB,CAAC;EACxC;EACAa,mBAAmB,EAAEb,EAAE,CACtB,qDACD,CAAC;EACD;EACAc,kBAAkB,EAAEd,EAAE,CACrB,sDACD;AACD,CAAC;AAED,MAAMe,aAAa,GAAG;EACrBR,kBAAkB,EAAEL,OAAO;EAC3BM,iBAAiB,EAAEL,SAAS;EAC5BM,kBAAkB,EAAET,EAAE,CAAE,iCAAkC,CAAC;EAC3DU,iBAAiB,EAAEV,EAAE,CAAE,mCAAoC,CAAC;EAC5DW,eAAe,EAAEX,EAAE,CAAE,eAAgB,CAAC;EACtCY,cAAc,EAAEZ,EAAE,CAAE,iBAAkB,CAAC;EACvC;EACAa,mBAAmB,EAAEb,EAAE,CAAE,yCAA0C,CAAC;EACpE;EACAc,kBAAkB,EAAEd,EAAE,CAAE,2CAA4C;AACrE,CAAC;AAED,MAAMgB,IAAI,GAAG,CAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAE;AAE9D,MAAMC,Y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AS,CAAC,CAAC;IACvC,OAAO,CAAED,SAAS,EAAEE,OAAO,CAAE;EAC9B,CAAC;EAED,MAAM;IAAExC,mBAAmB;IAAEC;EAAmB,CAAC,GAAGK,mBAAmB,CACtEQ,qBACD,CAAC;EAED,MAAMe,IAAI,GAAG,CACZ5B,kBAAkB,EAClBD,mBAAmB,EACnBc,qBAAqB,CACrB;EAED,MAAM2B,eAAe,GAAGT,aAAa,CAAE,IAAI,EAAEH,IAAK,CAAC;EACnD,MAAMa,eAAe,GAAGV,aAAa,CAAE,KAAK,EAAEH,IAAK,CAAC;EAEpD,OAAO;IACNI,QAAQ,EAAE7C,OAAO,CAAEqD,eAAe,EAAE,GAAGJ,UAAU,CAAE,IAAK,CAAE,CAAC;IAC3DH,OAAO,EAAE9C,OAAO,CAAEsD,eAAe,EAAE,GAAGL,UAAU,CAAE,KAAM,CAAE;EAC3D,CAAC;AACF"}
1
+ {"version":3,"names":["I18nManager","__","sprintf","arrowUp","arrowDown","arrowLeft","arrowRight","horizontalMover","backwardButtonIcon","forwardButtonIcon","backwardButtonHint","forwardButtonHint","firstBlockTitle","lastBlockTitle","backwardButtonTitle","forwardButtonTitle","verticalMover","KEYS","SETUP_GETTER","description","getMoverDescription","icon","getArrowIcon","title","getMoverButtonTitle","actionTitle","getMoverActionTitle","getMoversSetup","isStackedHorizontally","firstIndex","keys","reduce","setup","key","includes","Object","assign","getSetup","switchButtonPropIfRTL","isBackwardButton","forwardButtonProp","backwardButtonProp","isRTL","args","arguments","apply","applyRTLSetup","backward","forward","actionTitlePrev","actionTitleNext","getIndexes","fromIndex","direction","toIndex","buttonTitlePrev","buttonTitleNext"],"sources":["@wordpress/block-editor/src/components/block-mover/mover-description.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { I18nManager } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { arrowUp, arrowDown, arrowLeft, arrowRight } from '@wordpress/icons';\n\nconst horizontalMover = {\n\tbackwardButtonIcon: arrowLeft,\n\tforwardButtonIcon: arrowRight,\n\tbackwardButtonHint: __( 'Double tap to move the block to the left' ),\n\tforwardButtonHint: __( 'Double tap to move the block to the right' ),\n\tfirstBlockTitle: __( 'Move block left' ),\n\tlastBlockTitle: __( 'Move block right' ),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tbackwardButtonTitle: __(\n\t\t'Move block left from position %1$s to position %2$s'\n\t),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tforwardButtonTitle: __(\n\t\t'Move block right from position %1$s to position %2$s'\n\t),\n};\n\nconst verticalMover = {\n\tbackwardButtonIcon: arrowUp,\n\tforwardButtonIcon: arrowDown,\n\tbackwardButtonHint: __( 'Double tap to move the block up' ),\n\tforwardButtonHint: __( 'Double tap to move the block down' ),\n\tfirstBlockTitle: __( 'Move block up' ),\n\tlastBlockTitle: __( 'Move block down' ),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tbackwardButtonTitle: __( 'Move block up from row %1$s to row %2$s' ),\n\t/* translators: accessibility text. %1: current block position (number). %2: next block position (number) */\n\tforwardButtonTitle: __( 'Move block down from row %1$s to row %2$s' ),\n};\n\nconst KEYS = [ 'description', 'icon', 'title', 'actionTitle' ];\n\nconst SETUP_GETTER = {\n\tdescription: getMoverDescription,\n\ticon: getArrowIcon,\n\ttitle: getMoverButtonTitle,\n\tactionTitle: getMoverActionTitle,\n};\n\nexport function getMoversSetup(\n\tisStackedHorizontally,\n\t{ firstIndex, keys = KEYS }\n) {\n\treturn keys.reduce( ( setup, key ) => {\n\t\tif ( KEYS.includes( key ) ) {\n\t\t\tObject.assign( setup, {\n\t\t\t\t[ key ]: getSetup( key, isStackedHorizontally, {\n\t\t\t\t\tfirstIndex,\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\t\treturn setup;\n\t}, {} );\n}\n\nfunction switchButtonPropIfRTL(\n\tisBackwardButton,\n\tforwardButtonProp,\n\tbackwardButtonProp,\n\tisStackedHorizontally\n) {\n\tif ( I18nManager.isRTL && isStackedHorizontally ) {\n\t\t// For RTL and horizontal direction switch prop between forward and backward button.\n\t\tif ( isBackwardButton ) {\n\t\t\treturn forwardButtonProp; // Set forwardButtonProp for backward button.\n\t\t}\n\t\treturn backwardButtonProp; // Set backwardButtonProp for forward button.\n\t}\n\n\treturn isBackwardButton ? backwardButtonProp : forwardButtonProp;\n}\n\nfunction getSetup() {\n\tconst [ key, ...args ] = arguments;\n\treturn SETUP_GETTER[ key ].apply( null, [ ...args ] );\n}\n\nfunction applyRTLSetup( isBackwardButton, args ) {\n\treturn switchButtonPropIfRTL.apply( null, [ isBackwardButton, ...args ] );\n}\n\nfunction getMoverDescription( isStackedHorizontally ) {\n\treturn isStackedHorizontally ? horizontalMover : verticalMover;\n}\n\nfunction getArrowIcon( isStackedHorizontally ) {\n\tconst { forwardButtonIcon, backwardButtonIcon } = getMoverDescription(\n\t\tisStackedHorizontally\n\t);\n\n\tconst args = [\n\t\tforwardButtonIcon,\n\t\tbackwardButtonIcon,\n\t\tisStackedHorizontally,\n\t];\n\n\treturn {\n\t\tbackward: applyRTLSetup( true, args ),\n\t\tforward: applyRTLSetup( false, args ),\n\t};\n}\n\nfunction getMoverActionTitle( isStackedHorizontally ) {\n\tconst { firstBlockTitle, lastBlockTitle } = getMoverDescription(\n\t\tisStackedHorizontally\n\t);\n\n\tconst args = [ lastBlockTitle, firstBlockTitle, isStackedHorizontally ];\n\n\tconst actionTitlePrev = applyRTLSetup( true, args );\n\tconst actionTitleNext = applyRTLSetup( false, args );\n\n\treturn {\n\t\tbackward: sprintf( actionTitlePrev, firstBlockTitle ),\n\t\tforward: sprintf( actionTitleNext, lastBlockTitle ),\n\t};\n}\n\nfunction getMoverButtonTitle( isStackedHorizontally, { firstIndex } ) {\n\tconst getIndexes = ( isBackwardButton ) => {\n\t\tconst fromIndex = firstIndex + 1; // Current position based on index\n\t\t// for backwardButton decrease index (move left/up) for forwardButton increase index (move right/down)\n\t\tconst direction = isBackwardButton ? -1 : 1;\n\t\tconst toIndex = fromIndex + direction; // Position after move.\n\t\treturn [ fromIndex, toIndex ];\n\t};\n\n\tconst { backwardButtonTitle, forwardButtonTitle } = getMoverDescription(\n\t\tisStackedHorizontally\n\t);\n\n\tconst args = [\n\t\tforwardButtonTitle,\n\t\tbackwardButtonTitle,\n\t\tisStackedHorizontally,\n\t];\n\n\tconst buttonTitlePrev = applyRTLSetup( true, args );\n\tconst buttonTitleNext = applyRTLSetup( false, args );\n\n\treturn {\n\t\tbackward: sprintf( buttonTitlePrev, ...getIndexes( true ) ),\n\t\tforward: sprintf( buttonTitleNext, ...getIndexes( false ) ),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,OAAO,EAAEC,SAAS,EAAEC,SAAS,EAAEC,UAAU,QAAQ,kBAAkB;AAE5E,MAAMC,eAAe,GAAG;EACvBC,kBAAkB,EAAEH,SAAS;EAC7BI,iBAAiB,EAAEH,UAAU;EAC7BI,kBAAkB,EAAET,EAAE,CAAE,0CAA2C,CAAC;EACpEU,iBAAiB,EAAEV,EAAE,CAAE,2CAA4C,CAAC;EACpEW,eAAe,EAAEX,EAAE,CAAE,iBAAkB,CAAC;EACxCY,cAAc,EAAEZ,EAAE,CAAE,kBAAmB,CAAC;EACxC;EACAa,mBAAmB,EAAEb,EAAE,CACtB,qDACD,CAAC;EACD;EACAc,kBAAkB,EAAEd,EAAE,CACrB,sDACD;AACD,CAAC;AAED,MAAMe,aAAa,GAAG;EACrBR,kBAAkB,EAAEL,OAAO;EAC3BM,iBAAiB,EAAEL,SAAS;EAC5BM,kBAAkB,EAAET,EAAE,CAAE,iCAAkC,CAAC;EAC3DU,iBAAiB,EAAEV,EAAE,CAAE,mCAAoC,CAAC;EAC5DW,eAAe,EAAEX,EAAE,CAAE,eAAgB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AAEI,qBAAqB,EAAE;EAAEC;AAAW,CAAC,EAAG;EACrE,MAAMsB,UAAU,GAAKZ,gBAAgB,IAAM;IAC1C,MAAMa,SAAS,GAAGvB,UAAU,GAAG,CAAC,CAAC,CAAC;IAClC;IACA,MAAMwB,SAAS,GAAGd,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC;IAC3C,MAAMe,OAAO,GAAGF,SAAS,GAAGC,SAAS,CAAC,CAAC;IACvC,OAAO,CAAED,SAAS,EAAEE,OAAO,CAAE;EAC9B,CAAC;EAED,MAAM;IAAExC,mBAAmB;IAAEC;EAAmB,CAAC,GAAGK,mBAAmB,CACtEQ,qBACD,CAAC;EAED,MAAMe,IAAI,GAAG,CACZ5B,kBAAkB,EAClBD,mBAAmB,EACnBc,qBAAqB,CACrB;EAED,MAAM2B,eAAe,GAAGT,aAAa,CAAE,IAAI,EAAEH,IAAK,CAAC;EACnD,MAAMa,eAAe,GAAGV,aAAa,CAAE,KAAK,EAAEH,IAAK,CAAC;EAEpD,OAAO;IACNI,QAAQ,EAAE7C,OAAO,CAAEqD,eAAe,EAAE,GAAGJ,UAAU,CAAE,IAAK,CAAE,CAAC;IAC3DH,OAAO,EAAE9C,OAAO,CAAEsD,eAAe,EAAE,GAAGL,UAAU,CAAE,KAAM,CAAE;EAC3D,CAAC;AACF"}
@@ -188,6 +188,5 @@ function BlockPopoverInbetween({
188
188
  }, children));
189
189
  /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
190
190
  }
191
-
192
191
  export default BlockPopoverInbetween;
193
192
  //# sourceMappingURL=inbetween.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useSelect","useMemo","createContext","useReducer","useLayoutEffect","Popover","isRTL","store","blockEditorStore","__unstableUseBlockElement","useBlockElement","usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","operation","nearestSide","props","popoverRecomputeCounter","forcePopoverRecompute","s","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","_rootClientId","previousElement","nextElement","isVertical","popoverAnchor","undefined","contextElement","getBoundingClientRect","previousRect","nextRect","left","top","width","height","targetRect","bottom","right","window","DOMRect","popoverScrollRef","observer","MutationObserver","observe","attributes","disconnect","ownerDocument","defaultView","addEventListener","removeEventListener","createElement","ref","animate","anchor","focusOnMount","__unstableSlotName","inline","key","className","resize","flip","placement","variant"],"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseMemo,\n\tcreateContext,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\toperation = 'insert',\n\tnearestSide = 'right',\n\t...props\n} ) {\n\t// This is a temporary hack to get the inbetween inserter to recompute properly.\n\tconst [ popoverRecomputeCounter, forcePopoverRecompute ] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId(\n\t\t\t\tpreviousClientId ?? nextClientId\n\t\t\t);\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId, nextClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverRecomputeCounter is by definition always equal or greater than 0.\n\t\t\t// This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverRecomputeCounter < 0 ||\n\t\t\t( ! previousElement && ! nextElement ) ||\n\t\t\t! isVisible\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst contextElement =\n\t\t\toperation === 'group'\n\t\t\t\t? nextElement || previousElement\n\t\t\t\t: previousElement || nextElement;\n\n\t\treturn {\n\t\t\tcontextElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst previousRect = previousElement\n\t\t\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\t\t\t\tconst nextRect = nextElement\n\t\t\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\n\t\t\t\tlet left = 0;\n\t\t\t\tlet top = 0;\n\t\t\t\tlet width = 0;\n\t\t\t\tlet height = 0;\n\n\t\t\t\tif ( operation === 'group' ) {\n\t\t\t\t\tconst targetRect = nextRect || previousRect;\n\t\t\t\t\ttop = targetRect.top;\n\t\t\t\t\t// No spacing is likely around blocks in this operation.\n\t\t\t\t\t// So width of the inserter containing rect is set to 0.\n\t\t\t\t\twidth = 0;\n\t\t\t\t\theight = targetRect.bottom - targetRect.top;\n\t\t\t\t\t// Popover calculates its distance from mid-block so some\n\t\t\t\t\t// adjustments are needed to make it appear in the right place.\n\t\t\t\t\tleft =\n\t\t\t\t\t\tnearestSide === 'left'\n\t\t\t\t\t\t\t? targetRect.left - 2\n\t\t\t\t\t\t\t: targetRect.right - 2;\n\t\t\t\t} else if ( isVertical ) {\n\t\t\t\t\t// vertical\n\t\t\t\t\ttop = previousRect ? previousRect.bottom : nextRect.top;\n\t\t\t\t\twidth = previousRect ? previousRect.width : nextRect.width;\n\t\t\t\t\theight =\n\t\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tleft = previousRect ? previousRect.left : nextRect.left;\n\t\t\t\t} else {\n\t\t\t\t\ttop = previousRect ? previousRect.top : nextRect.top;\n\t\t\t\t\theight = previousRect\n\t\t\t\t\t\t? previousRect.height\n\t\t\t\t\t\t: nextRect.height;\n\n\t\t\t\t\tif ( isRTL() ) {\n\t\t\t\t\t\t// non vertical, rtl\n\t\t\t\t\t\tleft = nextRect ? nextRect.right : previousRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// non vertical, ltr\n\t\t\t\t\t\tleft = previousRect\n\t\t\t\t\t\t\t? previousRect.right\n\t\t\t\t\t\t\t: nextRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? nextRect.left - previousRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [\n\t\tpreviousElement,\n\t\tnextElement,\n\t\tpopoverRecomputeCounter,\n\t\tisVertical,\n\t\tisVisible,\n\t\toperation,\n\t\tnearestSide,\n\t] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\t// This is only needed for a smooth transition when moving blocks.\n\t// When blocks are moved up/down, their position can be set by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( previousElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ previousElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! nextElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( nextElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ nextElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tpreviousElement.ownerDocument.defaultView.addEventListener(\n\t\t\t'resize',\n\t\t\tforcePopoverRecompute\n\t\t);\n\t\treturn () => {\n\t\t\tpreviousElement.ownerDocument.defaultView?.removeEventListener(\n\t\t\t\t'resize',\n\t\t\t\tforcePopoverRecompute\n\t\t\t);\n\t\t};\n\t}, [ previousElement ] );\n\n\t// If there's either a previous or a next element, show the inbetween popover.\n\t// Note that drag and drop uses the inbetween popover to show the drop indicator\n\t// before the first block and after the last block.\n\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\t'block-editor-block-popover__inbetween',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tplacement=\"overlay\"\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"block-editor-block-popover__inbetween-container\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,OAAO,EACPC,aAAa,EACbC,UAAU,EACVC,eAAe,QACT,oBAAoB;AAC3B,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,KA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X;IACA;IAAA;IACAmD,GAAG,EAAGrD,YAAY,GAAG,IAAI,GAAGW,YAAc;IAAA,GACrCL,KAAK;IACVgD,SAAS,EAAGzE,UAAU,CACrB,4BAA4B,EAC5B,uCAAuC,EACvCyB,KAAK,CAACgD,SACP,CAAG;IACHC,MAAM,EAAG,KAAO;IAChBC,IAAI,EAAG,KAAO;IACdC,SAAS,EAAC,SAAS;IACnBC,OAAO,EAAC;EAAU,GAElBZ,aAAA;IAAKQ,SAAS,EAAC;EAAiD,GAC7DrD,QACE,CACG,CAAC;EAEX;AACD;;AAEA,eAAeH,qBAAqB"}
1
+ {"version":3,"names":["classnames","useSelect","useMemo","createContext","useReducer","useLayoutEffect","Popover","isRTL","store","blockEditorStore","__unstableUseBlockElement","useBlockElement","usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","operation","nearestSide","props","popoverRecomputeCounter","forcePopoverRecompute","s","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","_rootClientId","previousElement","nextElement","isVertical","popoverAnchor","undefined","contextElement","getBoundingClientRect","previousRect","nextRect","left","top","width","height","targetRect","bottom","right","window","DOMRect","popoverScrollRef","observer","MutationObserver","observe","attributes","disconnect","ownerDocument","defaultView","addEventListener","removeEventListener","createElement","ref","animate","anchor","focusOnMount","__unstableSlotName","inline","key","className","resize","flip","placement","variant"],"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseMemo,\n\tcreateContext,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\toperation = 'insert',\n\tnearestSide = 'right',\n\t...props\n} ) {\n\t// This is a temporary hack to get the inbetween inserter to recompute properly.\n\tconst [ popoverRecomputeCounter, forcePopoverRecompute ] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId(\n\t\t\t\tpreviousClientId ?? nextClientId\n\t\t\t);\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId, nextClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverRecomputeCounter is by definition always equal or greater than 0.\n\t\t\t// This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverRecomputeCounter < 0 ||\n\t\t\t( ! previousElement && ! nextElement ) ||\n\t\t\t! isVisible\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst contextElement =\n\t\t\toperation === 'group'\n\t\t\t\t? nextElement || previousElement\n\t\t\t\t: previousElement || nextElement;\n\n\t\treturn {\n\t\t\tcontextElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst previousRect = previousElement\n\t\t\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\t\t\t\tconst nextRect = nextElement\n\t\t\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\n\t\t\t\tlet left = 0;\n\t\t\t\tlet top = 0;\n\t\t\t\tlet width = 0;\n\t\t\t\tlet height = 0;\n\n\t\t\t\tif ( operation === 'group' ) {\n\t\t\t\t\tconst targetRect = nextRect || previousRect;\n\t\t\t\t\ttop = targetRect.top;\n\t\t\t\t\t// No spacing is likely around blocks in this operation.\n\t\t\t\t\t// So width of the inserter containing rect is set to 0.\n\t\t\t\t\twidth = 0;\n\t\t\t\t\theight = targetRect.bottom - targetRect.top;\n\t\t\t\t\t// Popover calculates its distance from mid-block so some\n\t\t\t\t\t// adjustments are needed to make it appear in the right place.\n\t\t\t\t\tleft =\n\t\t\t\t\t\tnearestSide === 'left'\n\t\t\t\t\t\t\t? targetRect.left - 2\n\t\t\t\t\t\t\t: targetRect.right - 2;\n\t\t\t\t} else if ( isVertical ) {\n\t\t\t\t\t// vertical\n\t\t\t\t\ttop = previousRect ? previousRect.bottom : nextRect.top;\n\t\t\t\t\twidth = previousRect ? previousRect.width : nextRect.width;\n\t\t\t\t\theight =\n\t\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tleft = previousRect ? previousRect.left : nextRect.left;\n\t\t\t\t} else {\n\t\t\t\t\ttop = previousRect ? previousRect.top : nextRect.top;\n\t\t\t\t\theight = previousRect\n\t\t\t\t\t\t? previousRect.height\n\t\t\t\t\t\t: nextRect.height;\n\n\t\t\t\t\tif ( isRTL() ) {\n\t\t\t\t\t\t// non vertical, rtl\n\t\t\t\t\t\tleft = nextRect ? nextRect.right : previousRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// non vertical, ltr\n\t\t\t\t\t\tleft = previousRect\n\t\t\t\t\t\t\t? previousRect.right\n\t\t\t\t\t\t\t: nextRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? nextRect.left - previousRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [\n\t\tpreviousElement,\n\t\tnextElement,\n\t\tpopoverRecomputeCounter,\n\t\tisVertical,\n\t\tisVisible,\n\t\toperation,\n\t\tnearestSide,\n\t] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\t// This is only needed for a smooth transition when moving blocks.\n\t// When blocks are moved up/down, their position can be set by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( previousElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ previousElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! nextElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( nextElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ nextElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tpreviousElement.ownerDocument.defaultView.addEventListener(\n\t\t\t'resize',\n\t\t\tforcePopoverRecompute\n\t\t);\n\t\treturn () => {\n\t\t\tpreviousElement.ownerDocument.defaultView?.removeEventListener(\n\t\t\t\t'resize',\n\t\t\t\tforcePopoverRecompute\n\t\t\t);\n\t\t};\n\t}, [ previousElement ] );\n\n\t// If there's either a previous or a next element, show the inbetween popover.\n\t// Note that drag and drop uses the inbetween popover to show the drop indicator\n\t// before the first block and after the last block.\n\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\t'block-editor-block-popover__inbetween',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tplacement=\"overlay\"\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"block-editor-block-popover__inbetween-container\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,OAAO,EACPC,aAAa,EACbC,UAAU,EACVC,eAAe,QACT,oBAAoB;AAC3B,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,OAAOC,gBAAgB,MAAM,sBAAsB;AAEnD,MAAMC,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,OAAO,MAAMC,qBAAqB,GAAGb,aAAa,CAAC,CAAC;AAEpD,SAASc,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,YAAY;EACZC,QAAQ;EACRC,qBAAqB;EACrBC,oBAAoB;EACpBC,SAAS,GAAG,QAAQ;EACpBC,WAAW,GAAG,OAAO;EACrB,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAM,CAAEC,uBAAuB,EAAEC,qBAAqB,CAAE,GAAGvB,UAAU;EACpE;EACEwB,CAAC,IAAM,CAAEA,CAAC,GAAG,CAAC,IAAKf,6BAA6B,EAClD,CACD,CAAC;EAED,MAAM;IAAEgB,WAAW;IAAEC,YAAY;IAAEC;EAAU,CAAC,GAAG9B,SAAS,CACv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A,eAAe,CAACwB,aAAa,CAACC,WAAW,CAACC,gBAAgB,CACzD,QAAQ,EACRpC,qBACD,CAAC;IACD,OAAO,MAAM;MACZU,eAAe,CAACwB,aAAa,CAACC,WAAW,EAAEE,mBAAmB,CAC7D,QAAQ,EACRrC,qBACD,CAAC;IACF,CAAC;EACF,CAAC,EAAE,CAAEU,eAAe,CAAG,CAAC;;EAExB;EACA;EACA;EACA,IAAO,CAAEA,eAAe,IAAI,CAAEC,WAAW,IAAM,CAAEP,SAAS,EAAG;IAC5D,OAAO,IAAI;EACZ;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OACCkC,aAAA,CAAC3D,OAAO;IACP4D,GAAG,EAAGX,gBAAkB;IACxBY,OAAO,EAAG,KAAO;IACjBC,MAAM,EAAG5B,aAAe;IACxB6B,YAAY,EAAG;IACf;IACA;IAAA;IACAC,kBAAkB,EAAGjD,qBAAuB;IAC5CkD,MAAM,EAAG,CAAElD;IACX;IACA;IAAA;IACAmD,GAAG,EAAGrD,YAAY,GAAG,IAAI,GAAGW,YAAc;IAAA,GACrCL,KAAK;IACVgD,SAAS,EAAGzE,UAAU,CACrB,4BAA4B,EAC5B,uCAAuC,EACvCyB,KAAK,CAACgD,SACP,CAAG;IACHC,MAAM,EAAG,KAAO;IAChBC,IAAI,EAAG,KAAO;IACdC,SAAS,EAAC,SAAS;IACnBC,OAAO,EAAC;EAAU,GAElBZ,aAAA;IAAKQ,SAAS,EAAC;EAAiD,GAC7DrD,QACE,CACG,CAAC;EAEX;AACD;AAEA,eAAeH,qBAAqB"}
@@ -18,11 +18,12 @@ import { store } from '../../store';
18
18
  // This is used to avoid rendering the block list if the sizes change.
19
19
  let MemoizedBlockList;
20
20
  const MAX_HEIGHT = 2000;
21
+ const EMPTY_ADDITIONAL_STYLES = [];
21
22
  function ScaledBlockPreview({
22
23
  viewportWidth,
23
24
  containerWidth,
24
25
  minHeight,
25
- additionalStyles = []
26
+ additionalStyles = EMPTY_ADDITIONAL_STYLES
26
27
  }) {
27
28
  if (!viewportWidth) {
28
29
  viewportWidth = containerWidth;
@@ -1 +1 @@
1
- {"version":3,"names":["useResizeObserver","useRefEffect","useSelect","memo","useMemo","Disabled","BlockList","Iframe","EditorStyles","store","MemoizedBlockList","MAX_HEIGHT","ScaledBlockPreview","viewportWidth","containerWidth","minHeight","additionalStyles","contentResizeListener","height","contentHeight","styles","select","settings","getSettings","editorStyles","css","__unstableType","scale","aspectRatio","createElement","className","style","transform","maxHeight","undefined","contentRef","bodyElement","ownerDocument","documentElement","classList","add","position","width","boxSizing","tabIndex","pointerEvents","renderAppender","AutoBlockPreview","props","containerResizeListener","Fragment"],"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useResizeObserver, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport { Disabled } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nconst MAX_HEIGHT = 2000;\n\nfunction ScaledBlockPreview( {\n\tviewportWidth,\n\tcontainerWidth,\n\tminHeight,\n\tadditionalStyles = [],\n} ) {\n\tif ( ! viewportWidth ) {\n\t\tviewportWidth = containerWidth;\n\t}\n\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst { styles } = useSelect( ( select ) => {\n\t\tconst settings = select( store ).getSettings();\n\t\treturn {\n\t\t\tstyles: settings.styles,\n\t\t};\n\t}, [] );\n\n\t// Avoid scrollbars for pattern previews.\n\tconst editorStyles = useMemo( () => {\n\t\tif ( styles ) {\n\t\t\treturn [\n\t\t\t\t...styles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'body{height:auto;overflow:hidden;border:none;padding:0;}',\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t\t},\n\t\t\t\t...additionalStyles,\n\t\t\t];\n\t\t}\n\n\t\treturn styles;\n\t}, [ styles, additionalStyles ] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || memo( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\tconst aspectRatio = contentHeight\n\t\t? containerWidth / ( contentHeight * scale )\n\t\t: 0;\n\treturn (\n\t\t<Disabled\n\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\tstyle={ {\n\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\t// Using width + aspect-ratio instead of height here triggers browsers' native\n\t\t\t\t// handling of scrollbar's visibility. It prevents the flickering issue seen\n\t\t\t\t// in https://github.com/WordPress/gutenberg/issues/52027.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/52921 for more info.\n\t\t\t\taspectRatio,\n\t\t\t\tmaxHeight:\n\t\t\t\t\tcontentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined,\n\t\t\t\tminHeight,\n\t\t\t} }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t} = bodyElement;\n\t\t\t\t\tdocumentElement.classList.add(\n\t\t\t\t\t\t'block-editor-block-preview__content-iframe'\n\t\t\t\t\t);\n\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\tdocumentElement.style.width = '100%';\n\n\t\t\t\t\t// Necessary for contentResizeListener to work.\n\t\t\t\t\tbodyElement.style.boxSizing = 'border-box';\n\t\t\t\t\tbodyElement.style.position = 'absolute';\n\t\t\t\t\tbodyElement.style.width = '100%';\n\t\t\t\t}, [] ) }\n\t\t\t\taria-hidden\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\theight: contentHeight,\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t// This is a catch-all max-height for patterns.\n\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/38175.\n\t\t\t\t\tmaxHeight: MAX_HEIGHT,\n\t\t\t\t\tminHeight:\n\t\t\t\t\t\tscale !== 0 && scale < 1 && minHeight\n\t\t\t\t\t\t\t? minHeight / scale\n\t\t\t\t\t\t\t: minHeight,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t{ contentResizeListener }\n\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t</Iframe>\n\t\t</Disabled>\n\t);\n}\n\nexport default function AutoBlockPreview( props ) {\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative', width: '100%', height: 0 } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t\t{ !! containerWidth && (\n\t\t\t\t\t<ScaledBlockPreview\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tcontainerWidth={ containerWidth }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,YAAY,QAAQ,oBAAoB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,EAAEC,OAAO,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,uBAAuB;;AAEhD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,KAAK,QAAQ,aAAa;;AAEnC;AACA,IAAIC,iBAAiB;AAErB,MAAMC,UAAU,GAAG,I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AE,UAAU;MAAEC,KAAK,EAAE,MAAM;MAAExB,MAAM,EAAE;IAAE;EAAG,GAC9D+B,uBACE,CAAC,EACNpB,aAAA;IAAKC,SAAS,EAAC;EAAuC,GACnD,CAAC,CAAEhB,cAAc,IAClBe,aAAA,CAACjB,kBAAkB;IAAA,GACboC,KAAK;IACVlC,cAAc,EAAGA;EAAgB,CACjC,CAEE,CACJ,CAAC;AAEL"}
1
+ {"version":3,"names":["useResizeObserver","useRefEffect","useSelect","memo","useMemo","Disabled","BlockList","Iframe","EditorStyles","store","MemoizedBlockList","MAX_HEIGHT","EMPTY_ADDITIONAL_STYLES","ScaledBlockPreview","viewportWidth","containerWidth","minHeight","additionalStyles","contentResizeListener","height","contentHeight","styles","select","settings","getSettings","editorStyles","css","__unstableType","scale","aspectRatio","createElement","className","style","transform","maxHeight","undefined","contentRef","bodyElement","ownerDocument","documentElement","classList","add","position","width","boxSizing","tabIndex","pointerEvents","renderAppender","AutoBlockPreview","props","containerResizeListener","Fragment"],"sources":["@wordpress/block-editor/src/components/block-preview/auto.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useResizeObserver, useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { memo, useMemo } from '@wordpress/element';\nimport { Disabled } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../block-list';\nimport Iframe from '../iframe';\nimport EditorStyles from '../editor-styles';\nimport { store } from '../../store';\n\n// This is used to avoid rendering the block list if the sizes change.\nlet MemoizedBlockList;\n\nconst MAX_HEIGHT = 2000;\nconst EMPTY_ADDITIONAL_STYLES = [];\n\nfunction ScaledBlockPreview( {\n\tviewportWidth,\n\tcontainerWidth,\n\tminHeight,\n\tadditionalStyles = EMPTY_ADDITIONAL_STYLES,\n} ) {\n\tif ( ! viewportWidth ) {\n\t\tviewportWidth = containerWidth;\n\t}\n\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst { styles } = useSelect( ( select ) => {\n\t\tconst settings = select( store ).getSettings();\n\t\treturn {\n\t\t\tstyles: settings.styles,\n\t\t};\n\t}, [] );\n\n\t// Avoid scrollbars for pattern previews.\n\tconst editorStyles = useMemo( () => {\n\t\tif ( styles ) {\n\t\t\treturn [\n\t\t\t\t...styles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'body{height:auto;overflow:hidden;border:none;padding:0;}',\n\t\t\t\t\t__unstableType: 'presets',\n\t\t\t\t},\n\t\t\t\t...additionalStyles,\n\t\t\t];\n\t\t}\n\n\t\treturn styles;\n\t}, [ styles, additionalStyles ] );\n\n\t// Initialize on render instead of module top level, to avoid circular dependency issues.\n\tMemoizedBlockList = MemoizedBlockList || memo( BlockList );\n\n\tconst scale = containerWidth / viewportWidth;\n\tconst aspectRatio = contentHeight\n\t\t? containerWidth / ( contentHeight * scale )\n\t\t: 0;\n\treturn (\n\t\t<Disabled\n\t\t\tclassName=\"block-editor-block-preview__content\"\n\t\t\tstyle={ {\n\t\t\t\ttransform: `scale(${ scale })`,\n\t\t\t\t// Using width + aspect-ratio instead of height here triggers browsers' native\n\t\t\t\t// handling of scrollbar's visibility. It prevents the flickering issue seen\n\t\t\t\t// in https://github.com/WordPress/gutenberg/issues/52027.\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/52921 for more info.\n\t\t\t\taspectRatio,\n\t\t\t\tmaxHeight:\n\t\t\t\t\tcontentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined,\n\t\t\t\tminHeight,\n\t\t\t} }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tcontentRef={ useRefEffect( ( bodyElement ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\townerDocument: { documentElement },\n\t\t\t\t\t} = bodyElement;\n\t\t\t\t\tdocumentElement.classList.add(\n\t\t\t\t\t\t'block-editor-block-preview__content-iframe'\n\t\t\t\t\t);\n\t\t\t\t\tdocumentElement.style.position = 'absolute';\n\t\t\t\t\tdocumentElement.style.width = '100%';\n\n\t\t\t\t\t// Necessary for contentResizeListener to work.\n\t\t\t\t\tbodyElement.style.boxSizing = 'border-box';\n\t\t\t\t\tbodyElement.style.position = 'absolute';\n\t\t\t\t\tbodyElement.style.width = '100%';\n\t\t\t\t}, [] ) }\n\t\t\t\taria-hidden\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\twidth: viewportWidth,\n\t\t\t\t\theight: contentHeight,\n\t\t\t\t\tpointerEvents: 'none',\n\t\t\t\t\t// This is a catch-all max-height for patterns.\n\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/pull/38175.\n\t\t\t\t\tmaxHeight: MAX_HEIGHT,\n\t\t\t\t\tminHeight:\n\t\t\t\t\t\tscale !== 0 && scale < 1 && minHeight\n\t\t\t\t\t\t\t? minHeight / scale\n\t\t\t\t\t\t\t: minHeight,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t{ contentResizeListener }\n\t\t\t\t<MemoizedBlockList renderAppender={ false } />\n\t\t\t</Iframe>\n\t\t</Disabled>\n\t);\n}\n\nexport default function AutoBlockPreview( props ) {\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\treturn (\n\t\t<>\n\t\t\t<div style={ { position: 'relative', width: '100%', height: 0 } }>\n\t\t\t\t{ containerResizeListener }\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-block-preview__container\">\n\t\t\t\t{ !! containerWidth && (\n\t\t\t\t\t<ScaledBlockPreview\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tcontainerWidth={ containerWidth }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,YAAY,QAAQ,oBAAoB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI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ACpB,iBAAiB;IAACqC,cAAc,EAAG;EAAO,CAAE,CACtC,CACC,CAAC;AAEb;AAEA,eAAe,SAASC,gBAAgBA,CAAEC,KAAK,EAAG;EACjD,MAAM,CAAEC,uBAAuB,EAAE;IAAEP,KAAK,EAAE5B;EAAe,CAAC,CAAE,GAC3Df,iBAAiB,CAAC,CAAC;EAEpB,OACC8B,aAAA,CAAAqB,QAAA,QACCrB,aAAA;IAAKE,KAAK,EAAG;MAAEU,QAAQ,EAAE,UAAU;MAAEC,KAAK,EAAE,MAAM;MAAExB,MAAM,EAAE;IAAE;EAAG,GAC9D+B,uBACE,CAAC,EACNpB,aAAA;IAAKC,SAAS,EAAC;EAAuC,GACnD,CAAC,CAAEhB,cAAc,IAClBe,aAAA,CAACjB,kBAAkB;IAAA,GACboC,KAAK;IACVlC,cAAc,EAAGA;EAAgB,CACjC,CAEE,CACJ,CAAC;AAEL"}
@@ -18,7 +18,8 @@ export function BlockRemovalWarningModal({
18
18
  const {
19
19
  clientIds,
20
20
  selectPrevious,
21
- blockNamesForPrompt
21
+ blockNamesForPrompt,
22
+ messageType
22
23
  } = useSelect(select => unlock(select(blockEditorStore)).getRemovalPromptData());
23
24
  const {
24
25
  clearBlockRemovalPrompt,
@@ -37,6 +38,7 @@ export function BlockRemovalWarningModal({
37
38
  if (!blockNamesForPrompt) {
38
39
  return;
39
40
  }
41
+ const message = messageType === 'templates' ? _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) : _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);
40
42
  const onConfirmRemoval = () => {
41
43
  privateRemoveBlocks(clientIds, selectPrevious, /* force */true);
42
44
  clearBlockRemovalPrompt();
@@ -45,7 +47,7 @@ export function BlockRemovalWarningModal({
45
47
  title: __('Be careful!'),
46
48
  onRequestClose: clearBlockRemovalPrompt,
47
49
  size: "medium"
48
- }, createElement("p", null, _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)), createElement(HStack, {
50
+ }, createElement("p", null, message), createElement(HStack, {
49
51
  justify: "right"
50
52
  }, createElement(Button, {
51
53
  variant: "tertiary",
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useDispatch","useSelect","Modal","Button","__experimentalHStack","HStack","__","_n","store","blockEditorStore","unlock","BlockRemovalWarningModal","rules","clientIds","selectPrevious","blockNamesForPrompt","select","getRemovalPromptData","clearBlockRemovalPrompt","setBlockRemovalRules","privateRemoveBlocks","onConfirmRemoval","createElement","title","onRequestClose","size","length","justify","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 } = useSelect(\n\t\t( select ) =>\n\t\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 ( ! blockNamesForPrompt ) {\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>\n\t\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\t) }\n\t\t\t</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":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,EACLC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;;AAExC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,OAAO,SAASC,wBAAwBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACrD,MAAM;IAAEC,SAAS;IAAEC,cAAc;IAAEC;EAAoB,CAAC,GAAGd,SAAS,CACjEe,MAAM,IACPN,MAAM,CAAEM,MAAM,CAAEP,gBAAiB,CAAE,CAAC,CAACQ,oBAAoB,CAAC,CAC5D,CAAC;EAED,MAAM;IACLC,uBAAuB;IACvBC,oBAAoB;IACpBC;EACD,CAAC,GAAGV,MAAM,CAAEV,WAAW,CAAES,gBAAiB,CAAE,CAAC;;EAE7C;EACA;EACAV,SAAS,CAAE,MAAM;IAChBoB,oBAAoB,CAAEP,KAAM,CAAC;IAC7B,OAAO,MAAM;MACZO,oBAAoB,CAAC,CAAC;IACvB,CAAC;EACF,CAAC,EAAE,CAAEP,KAAK,EAAEO,oBAAoB,CAAG,CAAC;EAEpC,IAAK,CAAEJ,mBAAmB,EAAG;IAC5B;EACD;EAEA,MAAMM,gBAAgB,GAAGA,CAAA,KAAM;IAC9BD,mBAAmB,CAAEP,SAAS,EAAEC,cAAc,EAAE,WAAY,IAAK,CAAC;IAClEI,uBAAuB,CAAC,CAAC;EAC1B,CAAC;EAED,OACCI,aAAA,CAACpB,KAAK;IACLqB,KAAK,EAAGjB,EAAE,CAAE,aAAc,CAAG;IAC7BkB,cAAc,EAAGN,uBAAyB;IAC1CO,IAAI,EAAC;EAAQ,GAEbH,aAAA,YACGf,EAAE,CACH,kHAAkH,EAClH,oHAAoH,EACpHQ,mBAAmB,CAACW,MACrB,CACE,CAAC,EACJJ,aAAA,CAACjB,MAAM;IAACsB,OAAO,EAAC;EAAO,GACtBL,aAAA,CAACnB,MAAM;IAACyB,OAAO,EAAC,UAAU;IAACC,OAAO,EAAGX;EAAyB,GAC3DZ,EAAE,CAAE,QAAS,CACR,CAAC,EACTgB,aAAA,CAACnB,MAAM;IAACyB,OAAO,EAAC,SAAS;IAACC,OAAO,EAAGR;EAAkB,GACnDf,EAAE,CAAE,QAAS,CACR,CACD,CACF,CAAC;AAEV"}
1
+ {"version":3,"names":["useEffect","useDispatch","useSelect","Modal","Button","__experimentalHStack","HStack","__","_n","store","blockEditorStore","unlock","BlockRemovalWarningModal","rules","clientIds","selectPrevious","blockNamesForPrompt","messageType","select","getRemovalPromptData","clearBlockRemovalPrompt","setBlockRemovalRules","privateRemoveBlocks","message","length","onConfirmRemoval","createElement","title","onRequestClose","size","justify","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":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,EACLC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;;AAExC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,OAAO,SAASC,wBAAwBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACrD,MAAM;IAAEC,SAAS;IAAEC,cAAc;IAAEC,mBAAmB;IAAEC;EAAY,CAAC,GACpEf,SAAS,CAAIgB,MAAM,IAClBP,MAAM,CAAEO,MAAM,CAAER,gBAAiB,CAAE,CAAC,CAACS,oBAAoB,CAAC,CAC3D,CAAC;EAEF,MAAM;IACLC,uBAAuB;IACvBC,oBAAoB;IACpBC;EACD,CAAC,GAAGX,MAAM,CAAEV,WAAW,CAAES,gBAAiB,CAAE,CAAC;;EAE7C;EACA;EACAV,SAAS,CAAE,MAAM;IAChBqB,oBAAoB,CAAER,KAAM,CAAC;IAC7B,OAAO,MAAM;MACZQ,oBAAoB,CAAC,CAAC;IACvB,CAAC;EACF,CAAC,EAAE,CAAER,KAAK,EAAEQ,oBAAoB,CAAG,CAAC;EAEpC,IAAK,CAAEL,mBAAmB,EAAG;IAC5B;EACD;EAEA,MAAMO,OAAO,GACZN,WAAW,KAAK,WAAW,GACxBT,EAAE,CACF,kHAAkH,EAClH,oHAAoH,EACpHQ,mBAAmB,CAACQ,MACpB,CAAC,GACDhB,EAAE,CACF,2HAA2H,EAC3H,iIAAiI,EACjIQ,mBAAmB,CAACQ,MACpB,CAAC;EAEL,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC9BH,mBAAmB,CAAER,SAAS,EAAEC,cAAc,EAAE,WAAY,IAAK,CAAC;IAClEK,uBAAuB,CAAC,CAAC;EAC1B,CAAC;EAED,OACCM,aAAA,CAACvB,KAAK;IACLwB,KAAK,EAAGpB,EAAE,CAAE,aAAc,CAAG;IAC7BqB,cAAc,EAAGR,uBAAyB;IAC1CS,IAAI,EAAC;EAAQ,GAEbH,aAAA,YAAKH,OAAY,CAAC,EAClBG,aAAA,CAACpB,MAAM;IAACwB,OAAO,EAAC;EAAO,GACtBJ,aAAA,CAACtB,MAAM;IAAC2B,OAAO,EAAC,UAAU;IAACC,OAAO,EAAGZ;EAAyB,GAC3Db,EAAE,CAAE,QAAS,CACR,CAAC,EACTmB,aAAA,CAACtB,MAAM;IAAC2B,OAAO,EAAC,SAAS;IAACC,OAAO,EAAGP;EAAkB,GACnDlB,EAAE,CAAE,QAAS,CACR,CACD,CACF,CAAC;AAEV"}
@@ -12,7 +12,6 @@ import { copy } from '@wordpress/icons';
12
12
  * Internal dependencies
13
13
  */
14
14
  import { store as blockEditorStore } from '../../store';
15
- import useBlockDisplayInformation from '../use-block-display-information';
16
15
  import BlockIcon from '../block-icon';
17
16
  import BlockTransformationsMenu from './block-transformations-menu';
18
17
  import { useBlockVariationTransforms } from './block-variation-transformations';
@@ -123,7 +122,6 @@ function BlockSwitcherDropdownMenuContents({
123
122
  export const BlockSwitcher = ({
124
123
  clientIds
125
124
  }) => {
126
- const blockInformation = useBlockDisplayInformation(clientIds?.[0]);
127
125
  const {
128
126
  canRemove,
129
127
  hasBlockStyles,
@@ -135,11 +133,13 @@ export const BlockSwitcher = ({
135
133
  const {
136
134
  getBlockRootClientId,
137
135
  getBlocksByClientId,
136
+ getBlockAttributes,
138
137
  canRemoveBlocks
139
138
  } = select(blockEditorStore);
140
139
  const {
141
140
  getBlockStyles,
142
- getBlockType
141
+ getBlockType,
142
+ getActiveBlockVariation
143
143
  } = select(blocksStore);
144
144
  const _blocks = getBlocksByClientId(clientIds);
145
145
  if (!_blocks.length || _blocks.some(block => !block)) {
@@ -152,16 +152,19 @@ export const BlockSwitcher = ({
152
152
  name: firstBlockName
153
153
  }] = _blocks;
154
154
  const _isSingleBlockSelected = _blocks.length === 1;
155
+ const blockType = getBlockType(firstBlockName);
155
156
  let _icon;
156
157
  if (_isSingleBlockSelected) {
157
- _icon = blockInformation?.icon; // Take into account active block variations.
158
+ const match = getActiveBlockVariation(firstBlockName, getBlockAttributes(clientIds[0]));
159
+ // Take into account active block variations.
160
+ _icon = match?.icon || blockType.icon;
158
161
  } else {
159
162
  const isSelectionOfSameType = new Set(_blocks.map(({
160
163
  name
161
164
  }) => name)).size === 1;
162
165
  // When selection consists of blocks of multiple types, display an
163
166
  // appropriate icon to communicate the non-uniformity.
164
- _icon = isSelectionOfSameType ? getBlockType(firstBlockName)?.icon : copy;
167
+ _icon = isSelectionOfSameType ? blockType.icon : copy;
165
168
  }
166
169
  return {
167
170
  canRemove: canRemoveBlocks(clientIds, rootClientId),
@@ -170,7 +173,7 @@ export const BlockSwitcher = ({
170
173
  isReusable: _isSingleBlockSelected && isReusableBlock(_blocks[0]),
171
174
  isTemplate: _isSingleBlockSelected && isTemplatePart(_blocks[0])
172
175
  };
173
- }, [clientIds, blockInformation?.icon]);
176
+ }, [clientIds]);
174
177
  const blockTitle = useBlockDisplayTitle({
175
178
  clientId: clientIds?.[0],
176
179
  maximumLength: 35
@@ -178,12 +181,14 @@ export const BlockSwitcher = ({
178
181
  if (invalidBlocks) {
179
182
  return null;
180
183
  }
184
+ const isSingleBlock = clientIds.length === 1;
185
+ const blockSwitcherLabel = isSingleBlock ? blockTitle : __('Multiple blocks selected');
181
186
  const hideDropdown = !hasBlockStyles && !canRemove;
182
187
  if (hideDropdown) {
183
188
  return createElement(ToolbarGroup, null, createElement(ToolbarButton, {
184
189
  disabled: true,
185
190
  className: "block-editor-block-switcher__no-switcher-icon",
186
- title: blockTitle,
191
+ title: blockSwitcherLabel,
187
192
  icon: createElement(Fragment, null, createElement(BlockIcon, {
188
193
  icon: icon,
189
194
  showColors: true
@@ -192,8 +197,6 @@ export const BlockSwitcher = ({
192
197
  }, blockTitle))
193
198
  }));
194
199
  }
195
- const isSingleBlock = clientIds.length === 1;
196
- const blockSwitcherLabel = isSingleBlock ? blockTitle : __('Multiple blocks selected');
197
200
  const blockSwitcherDescription = isSingleBlock ? __('Change block type or style') : sprintf( /* translators: %d: number of blocks. */
198
201
  _n('Change type of %d block', 'Change type of %d blocks', clientIds.length), clientIds.length);
199
202
  return createElement(ToolbarGroup, null, createElement(ToolbarItem, null, toggleProps => createElement(DropdownMenu, {