@wordpress/block-editor 12.1.0 → 12.2.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 (391) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/autocompleters/block.js +13 -5
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/components/block-breadcrumb/index.js +6 -3
  5. package/build/components/block-breadcrumb/index.js.map +1 -1
  6. package/build/components/block-editing-mode/index.js +84 -0
  7. package/build/components/block-editing-mode/index.js.map +1 -0
  8. package/build/components/block-list/block-list-block-context.js +15 -0
  9. package/build/components/block-list/block-list-block-context.js.map +1 -0
  10. package/build/components/block-list/block.js +29 -37
  11. package/build/components/block-list/block.js.map +1 -1
  12. package/build/components/block-list/block.native.js +14 -22
  13. package/build/components/block-list/block.native.js.map +1 -1
  14. package/build/components/block-list/index.native.js +107 -108
  15. package/build/components/block-list/index.native.js.map +1 -1
  16. package/build/components/block-list/use-block-props/index.js +2 -2
  17. package/build/components/block-list/use-block-props/index.js.map +1 -1
  18. package/build/components/block-list/use-in-between-inserter.js +7 -5
  19. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  20. package/build/components/block-list-appender/index.js +15 -1
  21. package/build/components/block-list-appender/index.js.map +1 -1
  22. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +19 -4
  23. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  24. package/build/components/block-styles/preview-panel.js +1 -2
  25. package/build/components/block-styles/preview-panel.js.map +1 -1
  26. package/build/components/block-switcher/block-transformations-menu.js +8 -0
  27. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  28. package/build/components/block-switcher/block-variation-transformations.js +125 -0
  29. package/build/components/block-switcher/block-variation-transformations.js.map +1 -0
  30. package/build/components/block-switcher/index.js +34 -12
  31. package/build/components/block-switcher/index.js.map +1 -1
  32. package/build/components/block-switcher/pattern-transformations-menu.js +3 -3
  33. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  34. package/build/components/block-toolbar/index.js +9 -7
  35. package/build/components/block-toolbar/index.js.map +1 -1
  36. package/build/components/block-tools/block-contextual-toolbar.js +5 -3
  37. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  38. package/build/components/block-tools/insertion-point.js +11 -5
  39. package/build/components/block-tools/insertion-point.js.map +1 -1
  40. package/build/components/convert-to-group-buttons/index.js +7 -2
  41. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  42. package/build/components/convert-to-group-buttons/index.native.js +87 -3
  43. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  44. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +23 -37
  45. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +3 -2
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/iframe/index.js +14 -7
  49. package/build/components/iframe/index.js.map +1 -1
  50. package/build/components/inner-blocks/index.js +2 -1
  51. package/build/components/inner-blocks/index.js.map +1 -1
  52. package/build/components/inner-blocks/index.native.js +7 -7
  53. package/build/components/inner-blocks/index.native.js.map +1 -1
  54. package/build/components/inner-blocks/use-nested-settings-update.js +13 -5
  55. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  56. package/build/components/inserter/index.js +3 -7
  57. package/build/components/inserter/index.js.map +1 -1
  58. package/build/components/inserter/quick-inserter.js +2 -4
  59. package/build/components/inserter/quick-inserter.js.map +1 -1
  60. package/build/components/inserter/search-results.js +19 -6
  61. package/build/components/inserter/search-results.js.map +1 -1
  62. package/build/components/list-view/appender.js +6 -1
  63. package/build/components/list-view/appender.js.map +1 -1
  64. package/build/components/list-view/block-contents.js +4 -2
  65. package/build/components/list-view/block-contents.js.map +1 -1
  66. package/build/components/list-view/block.js +21 -25
  67. package/build/components/list-view/block.js.map +1 -1
  68. package/build/components/list-view/branch.js +1 -3
  69. package/build/components/list-view/branch.js.map +1 -1
  70. package/build/components/list-view/index.js +14 -7
  71. package/build/components/list-view/index.js.map +1 -1
  72. package/build/components/list-view/use-list-view-client-ids.js +27 -3
  73. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  74. package/build/components/publish-date-time-picker/index.js +0 -2
  75. package/build/components/publish-date-time-picker/index.js.map +1 -1
  76. package/build/components/url-input/index.js +3 -0
  77. package/build/components/url-input/index.js.map +1 -1
  78. package/build/components/use-block-drop-zone/index.js +25 -15
  79. package/build/components/use-block-drop-zone/index.js.map +1 -1
  80. package/build/components/use-resize-canvas/index.js +8 -1
  81. package/build/components/use-resize-canvas/index.js.map +1 -1
  82. package/build/components/writing-flow/use-arrow-nav.js +13 -7
  83. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  84. package/build/hooks/align.js +3 -7
  85. package/build/hooks/align.js.map +1 -1
  86. package/build/hooks/behaviors.js +115 -0
  87. package/build/hooks/behaviors.js.map +1 -0
  88. package/build/hooks/dimensions.js +0 -30
  89. package/build/hooks/dimensions.js.map +1 -1
  90. package/build/hooks/duotone.js +4 -8
  91. package/build/hooks/duotone.js.map +1 -1
  92. package/build/hooks/index.js +2 -0
  93. package/build/hooks/index.js.map +1 -1
  94. package/build/hooks/layout.js +8 -9
  95. package/build/hooks/layout.js.map +1 -1
  96. package/build/private-apis.js +4 -7
  97. package/build/private-apis.js.map +1 -1
  98. package/build/store/private-actions.js +46 -0
  99. package/build/store/private-actions.js.map +1 -1
  100. package/build/store/private-selectors.js +88 -0
  101. package/build/store/private-selectors.js.map +1 -1
  102. package/build/store/reducer.js +36 -1
  103. package/build/store/reducer.js.map +1 -1
  104. package/build/store/selectors.js +28 -18
  105. package/build/store/selectors.js.map +1 -1
  106. package/build/utils/order-inserter-block-items.js +41 -0
  107. package/build/utils/order-inserter-block-items.js.map +1 -0
  108. package/build-module/autocompleters/block.js +12 -5
  109. package/build-module/autocompleters/block.js.map +1 -1
  110. package/build-module/components/block-breadcrumb/index.js +5 -3
  111. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  112. package/build-module/components/block-editing-mode/index.js +72 -0
  113. package/build-module/components/block-editing-mode/index.js.map +1 -0
  114. package/build-module/components/block-list/block-list-block-context.js +6 -0
  115. package/build-module/components/block-list/block-list-block-context.js.map +1 -0
  116. package/build-module/components/block-list/block.js +26 -34
  117. package/build-module/components/block-list/block.js.map +1 -1
  118. package/build-module/components/block-list/block.native.js +14 -22
  119. package/build-module/components/block-list/block.native.js.map +1 -1
  120. package/build-module/components/block-list/index.native.js +108 -110
  121. package/build-module/components/block-list/index.native.js.map +1 -1
  122. package/build-module/components/block-list/use-block-props/index.js +1 -1
  123. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  124. package/build-module/components/block-list/use-in-between-inserter.js +6 -5
  125. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  126. package/build-module/components/block-list-appender/index.js +15 -1
  127. package/build-module/components/block-list-appender/index.js.map +1 -1
  128. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +18 -4
  129. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  130. package/build-module/components/block-styles/preview-panel.js +1 -2
  131. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  132. package/build-module/components/block-switcher/block-transformations-menu.js +7 -0
  133. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  134. package/build-module/components/block-switcher/block-variation-transformations.js +108 -0
  135. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -0
  136. package/build-module/components/block-switcher/index.js +33 -12
  137. package/build-module/components/block-switcher/index.js.map +1 -1
  138. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -3
  139. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  140. package/build-module/components/block-toolbar/index.js +8 -7
  141. package/build-module/components/block-toolbar/index.js.map +1 -1
  142. package/build-module/components/block-tools/block-contextual-toolbar.js +4 -3
  143. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  144. package/build-module/components/block-tools/insertion-point.js +11 -5
  145. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  146. package/build-module/components/convert-to-group-buttons/index.js +7 -2
  147. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  148. package/build-module/components/convert-to-group-buttons/index.native.js +76 -1
  149. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  150. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +22 -36
  151. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  152. package/build-module/components/global-styles/dimensions-panel.js +3 -2
  153. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  154. package/build-module/components/iframe/index.js +15 -8
  155. package/build-module/components/iframe/index.js.map +1 -1
  156. package/build-module/components/inner-blocks/index.js +2 -1
  157. package/build-module/components/inner-blocks/index.js.map +1 -1
  158. package/build-module/components/inner-blocks/index.native.js +7 -6
  159. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  160. package/build-module/components/inner-blocks/use-nested-settings-update.js +13 -5
  161. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  162. package/build-module/components/inserter/index.js +3 -7
  163. package/build-module/components/inserter/index.js.map +1 -1
  164. package/build-module/components/inserter/quick-inserter.js +2 -4
  165. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  166. package/build-module/components/inserter/search-results.js +16 -6
  167. package/build-module/components/inserter/search-results.js.map +1 -1
  168. package/build-module/components/list-view/appender.js +6 -2
  169. package/build-module/components/list-view/appender.js.map +1 -1
  170. package/build-module/components/list-view/block-contents.js +4 -2
  171. package/build-module/components/list-view/block-contents.js.map +1 -1
  172. package/build-module/components/list-view/block.js +20 -25
  173. package/build-module/components/list-view/block.js.map +1 -1
  174. package/build-module/components/list-view/branch.js +1 -3
  175. package/build-module/components/list-view/branch.js.map +1 -1
  176. package/build-module/components/list-view/index.js +15 -8
  177. package/build-module/components/list-view/index.js.map +1 -1
  178. package/build-module/components/list-view/use-list-view-client-ids.js +26 -3
  179. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  180. package/build-module/components/publish-date-time-picker/index.js +0 -2
  181. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  182. package/build-module/components/url-input/index.js +3 -0
  183. package/build-module/components/url-input/index.js.map +1 -1
  184. package/build-module/components/use-block-drop-zone/index.js +25 -16
  185. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  186. package/build-module/components/use-resize-canvas/index.js +8 -1
  187. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  188. package/build-module/components/writing-flow/use-arrow-nav.js +13 -7
  189. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  190. package/build-module/hooks/align.js +3 -6
  191. package/build-module/hooks/align.js.map +1 -1
  192. package/build-module/hooks/behaviors.js +97 -0
  193. package/build-module/hooks/behaviors.js.map +1 -0
  194. package/build-module/hooks/dimensions.js +0 -28
  195. package/build-module/hooks/dimensions.js.map +1 -1
  196. package/build-module/hooks/duotone.js +3 -6
  197. package/build-module/hooks/duotone.js.map +1 -1
  198. package/build-module/hooks/index.js +1 -0
  199. package/build-module/hooks/index.js.map +1 -1
  200. package/build-module/hooks/layout.js +7 -9
  201. package/build-module/hooks/layout.js.map +1 -1
  202. package/build-module/private-apis.js +3 -5
  203. package/build-module/private-apis.js.map +1 -1
  204. package/build-module/store/private-actions.js +42 -0
  205. package/build-module/store/private-actions.js.map +1 -1
  206. package/build-module/store/private-selectors.js +79 -0
  207. package/build-module/store/private-selectors.js.map +1 -1
  208. package/build-module/store/reducer.js +34 -1
  209. package/build-module/store/reducer.js.map +1 -1
  210. package/build-module/store/selectors.js +26 -17
  211. package/build-module/store/selectors.js.map +1 -1
  212. package/build-module/utils/order-inserter-block-items.js +32 -0
  213. package/build-module/utils/order-inserter-block-items.js.map +1 -0
  214. package/build-style/content-rtl.css +32 -13
  215. package/build-style/content.css +32 -13
  216. package/build-style/default-editor-styles-rtl.css +1 -1
  217. package/build-style/default-editor-styles.css +1 -1
  218. package/build-style/style-rtl.css +19 -64
  219. package/build-style/style.css +20 -64
  220. package/package.json +32 -31
  221. package/src/autocompleters/block.js +15 -7
  222. package/src/components/block-breadcrumb/index.js +11 -3
  223. package/src/components/block-editing-mode/index.js +71 -0
  224. package/src/components/block-list/block-list-block-context.js +6 -0
  225. package/src/components/block-list/block.js +38 -56
  226. package/src/components/block-list/block.native.js +30 -41
  227. package/src/components/block-list/content.scss +5 -5
  228. package/src/components/block-list/index.native.js +164 -153
  229. package/src/components/block-list/test/index.native.js +2 -2
  230. package/src/components/block-list/use-block-props/index.js +1 -1
  231. package/src/components/block-list/use-in-between-inserter.js +7 -3
  232. package/src/components/block-list-appender/index.js +22 -4
  233. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +23 -0
  234. package/src/components/block-mover/style.scss +1 -0
  235. package/src/components/block-styles/preview-panel.js +1 -3
  236. package/src/components/block-switcher/block-transformations-menu.js +12 -0
  237. package/src/components/block-switcher/block-variation-transformations.js +115 -0
  238. package/src/components/block-switcher/index.js +38 -5
  239. package/src/components/block-switcher/pattern-transformations-menu.js +5 -5
  240. package/src/components/block-switcher/style.scss +6 -5
  241. package/src/components/block-toolbar/index.js +10 -11
  242. package/src/components/block-tools/block-contextual-toolbar.js +4 -5
  243. package/src/components/block-tools/insertion-point.js +23 -9
  244. package/src/components/button-block-appender/content.scss +22 -0
  245. package/src/components/convert-to-group-buttons/index.js +9 -2
  246. package/src/components/convert-to-group-buttons/index.native.js +79 -1
  247. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +32 -38
  248. package/src/components/global-styles/dimensions-panel.js +3 -2
  249. package/src/components/global-styles/style.scss +3 -0
  250. package/src/components/iframe/index.js +22 -12
  251. package/src/components/inner-blocks/README.md +5 -0
  252. package/src/components/inner-blocks/index.js +2 -0
  253. package/src/components/inner-blocks/index.native.js +16 -6
  254. package/src/components/inner-blocks/use-nested-settings-update.js +20 -3
  255. package/src/components/inserter/index.js +1 -9
  256. package/src/components/inserter/quick-inserter.js +0 -2
  257. package/src/components/inserter/search-results.js +32 -6
  258. package/src/components/list-view/appender.js +3 -2
  259. package/src/components/list-view/block-contents.js +8 -2
  260. package/src/components/list-view/block.js +29 -35
  261. package/src/components/list-view/branch.js +1 -7
  262. package/src/components/list-view/index.js +17 -4
  263. package/src/components/list-view/style.scss +2 -5
  264. package/src/components/list-view/use-list-view-client-ids.js +21 -4
  265. package/src/components/publish-date-time-picker/index.js +0 -2
  266. package/src/components/url-input/README.md +6 -0
  267. package/src/components/url-input/index.js +1 -0
  268. package/src/components/use-block-drop-zone/index.js +31 -17
  269. package/src/components/use-resize-canvas/index.js +9 -1
  270. package/src/components/writing-flow/test/index.js +15 -0
  271. package/src/components/writing-flow/use-arrow-nav.js +17 -4
  272. package/src/hooks/align.js +3 -11
  273. package/src/hooks/behaviors.js +104 -0
  274. package/src/hooks/dimensions.js +0 -40
  275. package/src/hooks/duotone.js +3 -11
  276. package/src/hooks/index.js +1 -0
  277. package/src/hooks/layout.js +10 -18
  278. package/src/private-apis.js +2 -4
  279. package/src/store/private-actions.js +39 -0
  280. package/src/store/private-selectors.js +95 -0
  281. package/src/store/reducer.js +27 -0
  282. package/src/store/selectors.js +25 -15
  283. package/src/store/test/private-actions.js +32 -1
  284. package/src/store/test/private-selectors.js +158 -0
  285. package/src/store/test/reducer.js +48 -0
  286. package/src/style.scss +0 -3
  287. package/src/utils/order-inserter-block-items.js +26 -0
  288. package/build/components/block-list/block-list-compact.native.js +0 -75
  289. package/build/components/block-list/block-list-compact.native.js.map +0 -1
  290. package/build/components/off-canvas-editor/appender.js +0 -125
  291. package/build/components/off-canvas-editor/appender.js.map +0 -1
  292. package/build/components/off-canvas-editor/block-contents.js +0 -141
  293. package/build/components/off-canvas-editor/block-contents.js.map +0 -1
  294. package/build/components/off-canvas-editor/block-select-button.js +0 -126
  295. package/build/components/off-canvas-editor/block-select-button.js.map +0 -1
  296. package/build/components/off-canvas-editor/block.js +0 -297
  297. package/build/components/off-canvas-editor/block.js.map +0 -1
  298. package/build/components/off-canvas-editor/branch.js +0 -197
  299. package/build/components/off-canvas-editor/branch.js.map +0 -1
  300. package/build/components/off-canvas-editor/context.js +0 -19
  301. package/build/components/off-canvas-editor/context.js.map +0 -1
  302. package/build/components/off-canvas-editor/drop-indicator.js +0 -118
  303. package/build/components/off-canvas-editor/drop-indicator.js.map +0 -1
  304. package/build/components/off-canvas-editor/expander.js +0 -41
  305. package/build/components/off-canvas-editor/expander.js.map +0 -1
  306. package/build/components/off-canvas-editor/index.js +0 -236
  307. package/build/components/off-canvas-editor/index.js.map +0 -1
  308. package/build/components/off-canvas-editor/leaf-more-menu.js +0 -148
  309. package/build/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  310. package/build/components/off-canvas-editor/leaf.js +0 -60
  311. package/build/components/off-canvas-editor/leaf.js.map +0 -1
  312. package/build/components/off-canvas-editor/link-ui.js +0 -186
  313. package/build/components/off-canvas-editor/link-ui.js.map +0 -1
  314. package/build/components/off-canvas-editor/update-attributes.js +0 -108
  315. package/build/components/off-canvas-editor/update-attributes.js.map +0 -1
  316. package/build/components/off-canvas-editor/use-block-selection.js +0 -139
  317. package/build/components/off-canvas-editor/use-block-selection.js.map +0 -1
  318. package/build/components/off-canvas-editor/use-inserted-block.js +0 -58
  319. package/build/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  320. package/build/components/off-canvas-editor/use-list-view-client-ids.js +0 -33
  321. package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  322. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +0 -235
  323. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  324. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -60
  325. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  326. package/build/components/off-canvas-editor/utils.js +0 -60
  327. package/build/components/off-canvas-editor/utils.js.map +0 -1
  328. package/build-module/components/block-list/block-list-compact.native.js +0 -60
  329. package/build-module/components/block-list/block-list-compact.native.js.map +0 -1
  330. package/build-module/components/off-canvas-editor/appender.js +0 -108
  331. package/build-module/components/off-canvas-editor/appender.js.map +0 -1
  332. package/build-module/components/off-canvas-editor/block-contents.js +0 -121
  333. package/build-module/components/off-canvas-editor/block-contents.js.map +0 -1
  334. package/build-module/components/off-canvas-editor/block-select-button.js +0 -107
  335. package/build-module/components/off-canvas-editor/block-select-button.js.map +0 -1
  336. package/build-module/components/off-canvas-editor/block.js +0 -273
  337. package/build-module/components/off-canvas-editor/block.js.map +0 -1
  338. package/build-module/components/off-canvas-editor/branch.js +0 -179
  339. package/build-module/components/off-canvas-editor/branch.js.map +0 -1
  340. package/build-module/components/off-canvas-editor/context.js +0 -7
  341. package/build-module/components/off-canvas-editor/context.js.map +0 -1
  342. package/build-module/components/off-canvas-editor/drop-indicator.js +0 -111
  343. package/build-module/components/off-canvas-editor/drop-indicator.js.map +0 -1
  344. package/build-module/components/off-canvas-editor/expander.js +0 -32
  345. package/build-module/components/off-canvas-editor/expander.js.map +0 -1
  346. package/build-module/components/off-canvas-editor/index.js +0 -213
  347. package/build-module/components/off-canvas-editor/index.js.map +0 -1
  348. package/build-module/components/off-canvas-editor/leaf-more-menu.js +0 -130
  349. package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  350. package/build-module/components/off-canvas-editor/leaf.js +0 -45
  351. package/build-module/components/off-canvas-editor/leaf.js.map +0 -1
  352. package/build-module/components/off-canvas-editor/link-ui.js +0 -166
  353. package/build-module/components/off-canvas-editor/link-ui.js.map +0 -1
  354. package/build-module/components/off-canvas-editor/update-attributes.js +0 -97
  355. package/build-module/components/off-canvas-editor/update-attributes.js.map +0 -1
  356. package/build-module/components/off-canvas-editor/use-block-selection.js +0 -124
  357. package/build-module/components/off-canvas-editor/use-block-selection.js.map +0 -1
  358. package/build-module/components/off-canvas-editor/use-inserted-block.js +0 -47
  359. package/build-module/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  360. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +0 -24
  361. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  362. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +0 -220
  363. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  364. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -50
  365. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  366. package/build-module/components/off-canvas-editor/utils.js +0 -44
  367. package/build-module/components/off-canvas-editor/utils.js.map +0 -1
  368. package/src/components/block-list/block-list-compact.native.js +0 -63
  369. package/src/components/off-canvas-editor/README.md +0 -5
  370. package/src/components/off-canvas-editor/appender.js +0 -124
  371. package/src/components/off-canvas-editor/block-contents.js +0 -156
  372. package/src/components/off-canvas-editor/block-select-button.js +0 -128
  373. package/src/components/off-canvas-editor/block.js +0 -347
  374. package/src/components/off-canvas-editor/branch.js +0 -238
  375. package/src/components/off-canvas-editor/context.js +0 -8
  376. package/src/components/off-canvas-editor/drop-indicator.js +0 -126
  377. package/src/components/off-canvas-editor/expander.js +0 -26
  378. package/src/components/off-canvas-editor/index.js +0 -271
  379. package/src/components/off-canvas-editor/leaf-more-menu.js +0 -158
  380. package/src/components/off-canvas-editor/leaf.js +0 -52
  381. package/src/components/off-canvas-editor/link-ui.js +0 -167
  382. package/src/components/off-canvas-editor/style.scss +0 -34
  383. package/src/components/off-canvas-editor/test/use-inserted-block.js +0 -108
  384. package/src/components/off-canvas-editor/test/utils.js +0 -50
  385. package/src/components/off-canvas-editor/update-attributes.js +0 -99
  386. package/src/components/off-canvas-editor/use-block-selection.js +0 -169
  387. package/src/components/off-canvas-editor/use-inserted-block.js +0 -47
  388. package/src/components/off-canvas-editor/use-list-view-client-ids.js +0 -29
  389. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +0 -260
  390. package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -58
  391. package/src/components/off-canvas-editor/utils.js +0 -58
@@ -11,7 +11,6 @@ import { useSelect, useDispatch } from '@wordpress/data';
11
11
  import { createBlock } from '@wordpress/blocks';
12
12
  import {
13
13
  KeyboardAwareFlatList,
14
- ReadableContentView,
15
14
  WIDE_ALIGNMENTS,
16
15
  alignmentHelpers,
17
16
  } from '@wordpress/components';
@@ -26,23 +25,16 @@ import BlockListItem from './block-list-item';
26
25
  import BlockListItemCell from './block-list-item-cell';
27
26
  import {
28
27
  BlockListProvider,
29
- BlockListConsumer,
30
28
  DEFAULT_BLOCK_LIST_CONTEXT,
31
29
  } from './block-list-context';
32
30
  import { BlockDraggableWrapper } from '../block-draggable';
31
+ import { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';
33
32
  import { store as blockEditorStore } from '../../store';
34
33
 
35
34
  const identity = ( x ) => x;
36
35
 
37
36
  const stylesMemo = {};
38
- const getStyles = (
39
- isRootList,
40
- isStackedHorizontally,
41
- horizontalAlignment
42
- ) => {
43
- if ( isRootList ) {
44
- return;
45
- }
37
+ const getStyles = ( isStackedHorizontally, horizontalAlignment ) => {
46
38
  const styleName = `${ isStackedHorizontally }-${ horizontalAlignment }`;
47
39
  if ( stylesMemo[ styleName ] ) {
48
40
  return stylesMemo[ styleName ];
@@ -74,7 +66,6 @@ export default function BlockList( {
74
66
  renderAppender,
75
67
  renderFooterAppender,
76
68
  rootClientId,
77
- title,
78
69
  withFooter = true,
79
70
  } ) {
80
71
  const {
@@ -190,114 +181,6 @@ export default function BlockList( {
190
181
  }
191
182
  };
192
183
 
193
- const renderList = ( extraProps = {} ) => {
194
- const { parentScrollRef, onScroll } = extraProps;
195
-
196
- const { blockToolbar, headerToolbar, floatingToolbar } = styles;
197
-
198
- const containerStyle = {
199
- flex: isRootList ? 1 : 0,
200
- // We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.
201
- marginVertical: isRootList ? 0 : -marginVertical,
202
- marginHorizontal: isRootList ? 0 : -marginHorizontal,
203
- };
204
-
205
- const isContentStretch = contentResizeMode === 'stretch';
206
- const isMultiBlocks = blockClientIds.length > 1;
207
- const { isWider } = alignmentHelpers;
208
- const extraScrollHeight =
209
- headerToolbar.height +
210
- blockToolbar.height +
211
- ( isFloatingToolbarVisible ? floatingToolbar.height : 0 );
212
-
213
- const scrollViewStyle = [
214
- { flex: isRootList ? 1 : 0 },
215
- ! isRootList && styles.overflowVisible,
216
- ];
217
-
218
- return (
219
- <View
220
- style={ containerStyle }
221
- onAccessibilityEscape={ clearSelectedBlock }
222
- onLayout={ onLayout }
223
- testID="block-list-wrapper"
224
- >
225
- <KeyboardAwareFlatList
226
- { ...( Platform.OS === 'android'
227
- ? { removeClippedSubviews: false }
228
- : {} ) } // Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
229
- accessibilityLabel="block-list"
230
- innerRef={ ( ref ) => {
231
- scrollViewRef.current = parentScrollRef || ref;
232
- } }
233
- extraScrollHeight={ extraScrollHeight }
234
- keyboardShouldPersistTaps="always"
235
- scrollViewStyle={ scrollViewStyle }
236
- extraData={ getExtraData() }
237
- scrollEnabled={ isRootList }
238
- contentContainerStyle={ [
239
- horizontal && styles.horizontalContentContainer,
240
- isWider( blockWidth, 'medium' ) &&
241
- ( isContentStretch && isMultiBlocks
242
- ? styles.horizontalContentContainerStretch
243
- : styles.horizontalContentContainerCenter ),
244
- ] }
245
- style={ getStyles(
246
- isRootList,
247
- isStackedHorizontally,
248
- horizontalAlignment
249
- ) }
250
- data={ blockClientIds }
251
- keyExtractor={ identity }
252
- listKey={
253
- rootClientId ? `list-${ rootClientId }` : 'list-root'
254
- }
255
- renderItem={ renderItem }
256
- CellRendererComponent={ BlockListItemCell }
257
- shouldPreventAutomaticScroll={
258
- shouldFlatListPreventAutomaticScroll
259
- }
260
- title={ title }
261
- ListHeaderComponent={ header }
262
- ListEmptyComponent={
263
- ! isReadOnly && (
264
- <EmptyList
265
- orientation={ orientation }
266
- rootClientId={ rootClientId }
267
- renderAppender={ renderAppender }
268
- renderFooterAppender={ renderFooterAppender }
269
- />
270
- )
271
- }
272
- ListFooterComponent={
273
- <Footer
274
- addBlockToEndOfPost={ addBlockToEndOfPost }
275
- isReadOnly={ isReadOnly }
276
- renderFooterAppender={ renderFooterAppender }
277
- withFooter={ withFooter }
278
- />
279
- }
280
- onScroll={ onScroll }
281
- />
282
- { shouldShowInnerBlockAppender() && (
283
- <View
284
- style={ {
285
- marginHorizontal:
286
- marginHorizontal -
287
- styles.innerAppender.marginLeft,
288
- } }
289
- >
290
- <BlockListAppender
291
- rootClientId={ rootClientId }
292
- renderAppender={ renderAppender }
293
- showSeparator
294
- />
295
- </View>
296
- ) }
297
- </View>
298
- );
299
- };
300
-
301
184
  const renderItem = ( { item: clientId, index } ) => {
302
185
  // Extracting the grid item properties here to avoid
303
186
  // re-renders in the blockListItem component.
@@ -328,29 +211,159 @@ export default function BlockList( {
328
211
  );
329
212
  };
330
213
 
331
- // Use of Context to propagate the main scroll ref to its children e.g InnerBlocks.
332
- const blockList = isRootList ? (
333
- <BlockListProvider
334
- value={ {
335
- ...DEFAULT_BLOCK_LIST_CONTEXT,
336
- scrollRef: scrollViewRef.current,
337
- } }
214
+ const { blockToolbar, headerToolbar, floatingToolbar } = styles;
215
+
216
+ const containerStyle = {
217
+ flex: isRootList ? 1 : 0,
218
+ // We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.
219
+ marginVertical: isRootList ? 0 : -marginVertical,
220
+ marginHorizontal: isRootList ? 0 : -marginHorizontal,
221
+ };
222
+
223
+ const isContentStretch = contentResizeMode === 'stretch';
224
+ const isMultiBlocks = blockClientIds.length > 1;
225
+ const { isWider } = alignmentHelpers;
226
+ const extraScrollHeight =
227
+ headerToolbar.height +
228
+ blockToolbar.height +
229
+ ( isFloatingToolbarVisible ? floatingToolbar.height : 0 );
230
+
231
+ return (
232
+ <View
233
+ style={ containerStyle }
234
+ onAccessibilityEscape={ clearSelectedBlock }
235
+ onLayout={ onLayout }
236
+ testID="block-list-wrapper"
338
237
  >
339
- <BlockDraggableWrapper isRTL={ isRTL }>
340
- { ( { onScroll } ) => renderList( { onScroll } ) }
341
- </BlockDraggableWrapper>
342
- </BlockListProvider>
343
- ) : (
344
- <BlockListConsumer>
345
- { ( { scrollRef } ) =>
346
- renderList( {
347
- parentScrollRef: scrollRef,
348
- } )
349
- }
350
- </BlockListConsumer>
238
+ { isRootList ? (
239
+ <BlockListProvider
240
+ value={ {
241
+ ...DEFAULT_BLOCK_LIST_CONTEXT,
242
+ scrollRef: scrollViewRef.current,
243
+ } }
244
+ >
245
+ <BlockDraggableWrapper isRTL={ isRTL }>
246
+ { ( { onScroll } ) => (
247
+ <KeyboardAwareFlatList
248
+ { ...( Platform.OS === 'android'
249
+ ? { removeClippedSubviews: false }
250
+ : {} ) } // Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
251
+ accessibilityLabel="block-list"
252
+ innerRef={ ( ref ) => {
253
+ scrollViewRef.current = ref;
254
+ } }
255
+ extraScrollHeight={ extraScrollHeight }
256
+ keyboardShouldPersistTaps="always"
257
+ scrollViewStyle={ { flex: 1 } }
258
+ extraData={ getExtraData() }
259
+ scrollEnabled={ isRootList }
260
+ contentContainerStyle={ [
261
+ horizontal &&
262
+ styles.horizontalContentContainer,
263
+ isWider( blockWidth, 'medium' ) &&
264
+ ( isContentStretch && isMultiBlocks
265
+ ? styles.horizontalContentContainerStretch
266
+ : styles.horizontalContentContainerCenter ),
267
+ ] }
268
+ data={ blockClientIds }
269
+ keyExtractor={ identity }
270
+ renderItem={ renderItem }
271
+ CellRendererComponent={ BlockListItemCell }
272
+ shouldPreventAutomaticScroll={
273
+ shouldFlatListPreventAutomaticScroll
274
+ }
275
+ ListHeaderComponent={ header }
276
+ ListEmptyComponent={
277
+ ! isReadOnly && (
278
+ <EmptyList
279
+ orientation={ orientation }
280
+ rootClientId={ rootClientId }
281
+ renderAppender={ renderAppender }
282
+ renderFooterAppender={
283
+ renderFooterAppender
284
+ }
285
+ />
286
+ )
287
+ }
288
+ ListFooterComponent={
289
+ <Footer
290
+ addBlockToEndOfPost={
291
+ addBlockToEndOfPost
292
+ }
293
+ isReadOnly={ isReadOnly }
294
+ renderFooterAppender={
295
+ renderFooterAppender
296
+ }
297
+ withFooter={ withFooter }
298
+ />
299
+ }
300
+ onScroll={ onScroll }
301
+ />
302
+ ) }
303
+ </BlockDraggableWrapper>
304
+ </BlockListProvider>
305
+ ) : (
306
+ <>
307
+ { blockClientIds.length > 0 ? (
308
+ <View style={ [ { flex: 0 }, styles.overflowVisible ] }>
309
+ <View
310
+ style={ [
311
+ ...getStyles(
312
+ isStackedHorizontally,
313
+ horizontalAlignment
314
+ ),
315
+ horizontal &&
316
+ styles.horizontalContentContainer,
317
+ ] }
318
+ >
319
+ { blockClientIds.map(
320
+ ( currentClientId, index ) => {
321
+ return (
322
+ <View key={ currentClientId }>
323
+ { renderItem( {
324
+ item: currentClientId,
325
+ index,
326
+ } ) }
327
+ </View>
328
+ );
329
+ }
330
+ ) }
331
+ <Footer
332
+ addBlockToEndOfPost={ addBlockToEndOfPost }
333
+ isReadOnly={ isReadOnly }
334
+ renderFooterAppender={
335
+ renderFooterAppender
336
+ }
337
+ withFooter={ withFooter }
338
+ />
339
+ </View>
340
+ </View>
341
+ ) : (
342
+ <EmptyList
343
+ orientation={ orientation }
344
+ rootClientId={ rootClientId }
345
+ renderAppender={ renderAppender }
346
+ renderFooterAppender={ renderFooterAppender }
347
+ />
348
+ ) }
349
+ </>
350
+ ) }
351
+ { shouldShowInnerBlockAppender() && (
352
+ <View
353
+ style={ {
354
+ marginHorizontal:
355
+ marginHorizontal - styles.innerAppender.marginLeft,
356
+ } }
357
+ >
358
+ <BlockListAppender
359
+ rootClientId={ rootClientId }
360
+ renderAppender={ renderAppender }
361
+ showSeparator
362
+ />
363
+ </View>
364
+ ) }
365
+ </View>
351
366
  );
352
-
353
- return blockList;
354
367
  }
355
368
 
356
369
  function Footer( {
@@ -375,7 +388,7 @@ function Footer( {
375
388
  </>
376
389
  );
377
390
  } else if ( renderFooterAppender ) {
378
- return renderFooterAppender();
391
+ return <View>{ renderFooterAppender() }</View>;
379
392
  }
380
393
 
381
394
  return null;
@@ -410,24 +423,22 @@ function EmptyList( {
410
423
  ! blockClientIds[ insertionPoint.index ] ),
411
424
  };
412
425
  } );
426
+ const align = renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined;
427
+ const [ wrapperStyles ] = useEditorWrapperStyles( { align } );
413
428
 
414
429
  if ( renderFooterAppender || renderAppender === false ) {
415
430
  return null;
416
431
  }
417
432
 
433
+ const containerStyles = [ styles.defaultAppender, wrapperStyles ];
434
+
418
435
  return (
419
- <View style={ styles.defaultAppender }>
420
- <ReadableContentView
421
- align={
422
- renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined
423
- }
424
- >
425
- <BlockListAppender
426
- rootClientId={ rootClientId }
427
- renderAppender={ renderAppender }
428
- showSeparator={ shouldShowInsertionPoint }
429
- />
430
- </ReadableContentView>
436
+ <View style={ containerStyles }>
437
+ <BlockListAppender
438
+ rootClientId={ rootClientId }
439
+ renderAppender={ renderAppender }
440
+ showSeparator={ shouldShowInsertionPoint }
441
+ />
431
442
  </View>
432
443
  );
433
444
  }
@@ -52,7 +52,7 @@ describe( 'BlockList', () => {
52
52
  await addBlock( screen, 'Social Icons' );
53
53
  const socialLinksBlock = await getBlock( screen, 'Social Icons' );
54
54
  fireEvent.press( socialLinksBlock );
55
- triggerBlockListLayout( socialLinksBlock );
55
+ await triggerBlockListLayout( socialLinksBlock );
56
56
 
57
57
  // Act
58
58
  fireEvent.press(
@@ -82,7 +82,7 @@ describe( 'BlockList', () => {
82
82
  await initializeEditor();
83
83
  await addBlock( screen, 'Group' );
84
84
  const groupBlock = await getBlock( screen, 'Group' );
85
- triggerBlockListLayout( groupBlock );
85
+ await triggerBlockListLayout( groupBlock );
86
86
 
87
87
  // Assert
88
88
  expect(
@@ -21,7 +21,7 @@ import warning from '@wordpress/warning';
21
21
  * Internal dependencies
22
22
  */
23
23
  import useMovingAnimation from '../../use-moving-animation';
24
- import { BlockListBlockContext } from '../block';
24
+ import { BlockListBlockContext } from '../block-list-block-context';
25
25
  import { useFocusFirstElement } from './use-focus-first-element';
26
26
  import { useIsHovered } from './use-is-hovered';
27
27
  import { useBlockEditContext } from '../../block-edit/context';
@@ -11,6 +11,7 @@ import { isRTL } from '@wordpress/i18n';
11
11
  */
12
12
  import { store as blockEditorStore } from '../../store';
13
13
  import { InsertionPointOpenRef } from '../block-tools/insertion-point';
14
+ import { unlock } from '../../lock-unlock';
14
15
 
15
16
  export function useInBetweenInserter() {
16
17
  const openRef = useContext( InsertionPointOpenRef );
@@ -29,7 +30,8 @@ export function useInBetweenInserter() {
29
30
  getSelectedBlockClientIds,
30
31
  getTemplateLock,
31
32
  __unstableIsWithinBlockOverlay,
32
- } = useSelect( blockEditorStore );
33
+ getBlockEditingMode,
34
+ } = unlock( useSelect( blockEditorStore ) );
33
35
  const { showInsertionPoint, hideInsertionPoint } =
34
36
  useDispatch( blockEditorStore );
35
37
 
@@ -74,8 +76,10 @@ export function useInBetweenInserter() {
74
76
  rootClientId = blockElement.getAttribute( 'data-block' );
75
77
  }
76
78
 
77
- // Don't set the insertion point if the template is locked.
78
- if ( getTemplateLock( rootClientId ) ) {
79
+ if (
80
+ getTemplateLock( rootClientId ) ||
81
+ getBlockEditingMode( rootClientId ) === 'disabled'
82
+ ) {
79
83
  return;
80
84
  }
81
85
 
@@ -85,6 +85,25 @@ function BlockListAppender( {
85
85
  tagName: TagName = 'div',
86
86
  } ) {
87
87
  const appender = useAppender( rootClientId, renderAppender );
88
+ const isDragOver = useSelect(
89
+ ( select ) => {
90
+ const {
91
+ getBlockInsertionPoint,
92
+ isBlockInsertionPointVisible,
93
+ getBlockCount,
94
+ } = select( blockEditorStore );
95
+ const insertionPoint = getBlockInsertionPoint();
96
+ // Ideally we should also check for `isDragging` but currently it
97
+ // requires a lot more setup. We can revisit this once we refactor
98
+ // the DnD utility hooks.
99
+ return (
100
+ isBlockInsertionPointVisible() &&
101
+ rootClientId === insertionPoint?.rootClientId &&
102
+ getBlockCount( rootClientId ) === 0
103
+ );
104
+ },
105
+ [ rootClientId ]
106
+ );
88
107
 
89
108
  if ( ! appender ) {
90
109
  return null;
@@ -101,10 +120,9 @@ function BlockListAppender( {
101
120
  //
102
121
  // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
103
122
  tabIndex={ -1 }
104
- className={ classnames(
105
- 'block-list-appender wp-block',
106
- className
107
- ) }
123
+ className={ classnames( 'block-list-appender wp-block', className, {
124
+ 'is-drag-over': isDragOver,
125
+ } ) }
108
126
  // Needed in case the whole editor is content editable (for multi
109
127
  // selection). It fixes an edge case where ArrowDown and ArrowRight
110
128
  // should collapse the selection to the end of that selection and
@@ -39,6 +39,10 @@ import { store as coreStore } from '@wordpress/core-data';
39
39
  import { getMoversSetup } from '../block-mover/mover-description';
40
40
  import { store as blockEditorStore } from '../../store';
41
41
  import BlockTransformationsMenu from '../block-switcher/block-transformations-menu';
42
+ import {
43
+ useConvertToGroupButtons,
44
+ useConvertToGroupButtonProps,
45
+ } from '../convert-to-group-buttons';
42
46
 
43
47
  const BlockActionsMenu = ( {
44
48
  // Select.
@@ -55,6 +59,7 @@ const BlockActionsMenu = ( {
55
59
  rootClientId,
56
60
  selectedBlockClientId,
57
61
  selectedBlockPossibleTransformations,
62
+ canRemove,
58
63
  // Dispatch.
59
64
  createSuccessNotice,
60
65
  convertToRegularBlocks,
@@ -93,6 +98,17 @@ const BlockActionsMenu = ( {
93
98
  },
94
99
  } = getMoversSetup( isStackedHorizontally, moversOptions );
95
100
 
101
+ // Check if selected block is Groupable and/or Ungroupable.
102
+ const convertToGroupButtonProps = useConvertToGroupButtonProps( [
103
+ selectedBlockClientId,
104
+ ] );
105
+ const { isGroupable, isUngroupable } = convertToGroupButtonProps;
106
+ const showConvertToGroupButton =
107
+ ( isGroupable || isUngroupable ) && canRemove;
108
+ const convertToGroupButtons = useConvertToGroupButtons( {
109
+ ...convertToGroupButtonProps,
110
+ } );
111
+
96
112
  const allOptions = {
97
113
  settings: {
98
114
  id: 'settingsOption',
@@ -229,6 +245,10 @@ const BlockActionsMenu = ( {
229
245
  canDuplicate && allOptions.cutButton,
230
246
  canDuplicate && isPasteEnabled && allOptions.pasteButton,
231
247
  canDuplicate && allOptions.duplicateButton,
248
+ showConvertToGroupButton && isGroupable && convertToGroupButtons.group,
249
+ showConvertToGroupButton &&
250
+ isUngroupable &&
251
+ convertToGroupButtons.ungroup,
232
252
  isReusableBlockType &&
233
253
  innerBlockCount > 0 &&
234
254
  allOptions.convertToRegularBlocks,
@@ -327,6 +347,7 @@ export default compose(
327
347
  getSelectedBlockClientIds,
328
348
  canInsertBlockType,
329
349
  getTemplateLock,
350
+ canRemoveBlock,
330
351
  } = select( blockEditorStore );
331
352
  const block = getBlock( clientId );
332
353
  const blockName = getBlockName( clientId );
@@ -363,6 +384,7 @@ export default compose(
363
384
  const selectedBlockPossibleTransformations = selectedBlock
364
385
  ? getBlockTransformItems( selectedBlock, rootClientId )
365
386
  : EMPTY_BLOCK_LIST;
387
+ const canRemove = canRemoveBlock( selectedBlockClientId );
366
388
 
367
389
  const isReusableBlockType = block ? isReusableBlock( block ) : false;
368
390
  const reusableBlock = isReusableBlockType
@@ -388,6 +410,7 @@ export default compose(
388
410
  rootClientId,
389
411
  selectedBlockClientId,
390
412
  selectedBlockPossibleTransformations,
413
+ canRemove,
391
414
  };
392
415
  } ),
393
416
  withDispatch(
@@ -55,6 +55,7 @@
55
55
  }
56
56
 
57
57
  .block-editor-block-mover__drag-handle {
58
+ cursor: grab;
58
59
  @include break-small() {
59
60
  width: $block-toolbar-height * 0.5;
60
61
  min-width: 0 !important; // overrides default button width.
@@ -33,7 +33,5 @@ export default function BlockStylesPreviewPanel( {
33
33
  };
34
34
  }, [ genericPreviewBlock, styleClassName ] );
35
35
 
36
- return (
37
- <InserterPreviewPanel item={ previewBlocks } isStylePreview={ true } />
38
- );
36
+ return <InserterPreviewPanel item={ previewBlocks } />;
39
37
  }
@@ -14,6 +14,7 @@ import { useState, useMemo } from '@wordpress/element';
14
14
  */
15
15
  import BlockIcon from '../block-icon';
16
16
  import PreviewBlockPopover from './preview-block-popover';
17
+ import BlockVariationTransformations from './block-variation-transformations';
17
18
 
18
19
  /**
19
20
  * Helper hook to group transformations to display them in a specific order in the UI.
@@ -65,7 +66,9 @@ function useGroupedTransforms( possibleBlockTransformations ) {
65
66
  const BlockTransformationsMenu = ( {
66
67
  className,
67
68
  possibleBlockTransformations,
69
+ possibleBlockVariationTransformations,
68
70
  onSelect,
71
+ onSelectVariation,
69
72
  blocks,
70
73
  } ) => {
71
74
  const [ hoveredTransformItemName, setHoveredTransformItemName ] =
@@ -95,6 +98,15 @@ const BlockTransformationsMenu = ( {
95
98
  ) }
96
99
  />
97
100
  ) }
101
+ { !! possibleBlockVariationTransformations?.length && (
102
+ <BlockVariationTransformations
103
+ transformations={
104
+ possibleBlockVariationTransformations
105
+ }
106
+ blocks={ blocks }
107
+ onSelect={ onSelectVariation }
108
+ />
109
+ ) }
98
110
  { priorityTextTransformations.map( ( item ) => (
99
111
  <BlockTranformationItem
100
112
  key={ item.name }