@wordpress/block-editor 13.1.0 → 13.3.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 (437) hide show
  1. package/CHANGELOG.md +21 -17
  2. package/README.md +1 -2
  3. package/build/components/block-breadcrumb/index.js +12 -1
  4. package/build/components/block-breadcrumb/index.js.map +1 -1
  5. package/build/components/block-lock/modal.js +67 -67
  6. package/build/components/block-lock/modal.js.map +1 -1
  7. package/build/components/block-lock/toolbar.js +0 -1
  8. package/build/components/block-lock/toolbar.js.map +1 -1
  9. package/build/components/block-mover/button.js +1 -1
  10. package/build/components/block-mover/button.js.map +1 -1
  11. package/build/components/block-mover/index.js +12 -6
  12. package/build/components/block-mover/index.js.map +1 -1
  13. package/build/components/block-pattern-setup/setup-toolbar.js +2 -2
  14. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  15. package/build/components/block-patterns-paging/index.js +5 -7
  16. package/build/components/block-patterns-paging/index.js.map +1 -1
  17. package/build/components/block-quick-navigation/index.js +20 -17
  18. package/build/components/block-quick-navigation/index.js.map +1 -1
  19. package/build/components/block-rename/modal.js +4 -12
  20. package/build/components/block-rename/modal.js.map +1 -1
  21. package/build/components/block-toolbar/shuffle.js +4 -1
  22. package/build/components/block-toolbar/shuffle.js.map +1 -1
  23. package/build/components/block-tools/block-selection-button.js +7 -58
  24. package/build/components/block-tools/block-selection-button.js.map +1 -1
  25. package/build/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  26. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  27. package/build/components/block-tools/index.js +14 -1
  28. package/build/components/block-tools/index.js.map +1 -1
  29. package/build/components/block-tools/use-show-block-tools.js +4 -2
  30. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  31. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
  32. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  33. package/build/components/block-tools/zoom-out-popover.js +57 -0
  34. package/build/components/block-tools/zoom-out-popover.js.map +1 -0
  35. package/build/components/block-tools/zoom-out-toolbar.js +138 -0
  36. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -0
  37. package/build/components/button-block-appender/index.js +3 -1
  38. package/build/components/button-block-appender/index.js.map +1 -1
  39. package/build/components/child-layout-control/index.js +193 -127
  40. package/build/components/child-layout-control/index.js.map +1 -1
  41. package/build/components/date-format-picker/index.js +10 -1
  42. package/build/components/date-format-picker/index.js.map +1 -1
  43. package/build/components/dimensions-tool/index.js +6 -4
  44. package/build/components/dimensions-tool/index.js.map +1 -1
  45. package/build/components/font-appearance-control/index.js +26 -61
  46. package/build/components/font-appearance-control/index.js.map +1 -1
  47. package/build/components/global-styles/background-panel.js +178 -116
  48. package/build/components/global-styles/background-panel.js.map +1 -1
  49. package/build/components/global-styles/border-panel.js +2 -1
  50. package/build/components/global-styles/border-panel.js.map +1 -1
  51. package/build/components/global-styles/color-panel.js +2 -1
  52. package/build/components/global-styles/color-panel.js.map +1 -1
  53. package/build/components/global-styles/dimensions-panel.js +2 -1
  54. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  55. package/build/components/global-styles/filters-panel.js +2 -1
  56. package/build/components/global-styles/filters-panel.js.map +1 -1
  57. package/build/components/global-styles/hooks.js +8 -0
  58. package/build/components/global-styles/hooks.js.map +1 -1
  59. package/build/components/global-styles/image-settings-panel.js +2 -1
  60. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  61. package/build/components/global-styles/typography-panel.js +50 -12
  62. package/build/components/global-styles/typography-panel.js.map +1 -1
  63. package/build/components/global-styles/typography-utils.js +50 -0
  64. package/build/components/global-styles/typography-utils.js.map +1 -1
  65. package/build/components/global-styles/use-global-styles-output.js +25 -9
  66. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  67. package/build/components/global-styles/utils.js +17 -7
  68. package/build/components/global-styles/utils.js.map +1 -1
  69. package/build/components/grid/grid-item-movers.js +94 -0
  70. package/build/components/grid/grid-item-movers.js.map +1 -0
  71. package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
  72. package/build/components/grid/grid-item-resizer.js.map +1 -0
  73. package/build/components/grid/grid-visualizer.js +305 -0
  74. package/build/components/grid/grid-visualizer.js.map +1 -0
  75. package/build/components/{grid-visualizer → grid}/index.js +14 -0
  76. package/build/components/grid/index.js.map +1 -0
  77. package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
  78. package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
  79. package/build/components/grid/use-grid-layout-sync.js +169 -0
  80. package/build/components/grid/use-grid-layout-sync.js.map +1 -0
  81. package/build/components/grid/utils.js +145 -0
  82. package/build/components/grid/utils.js.map +1 -0
  83. package/build/components/image-editor/aspect-ratio-dropdown.js +0 -1
  84. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  85. package/build/components/inner-blocks/index.js +1 -1
  86. package/build/components/inner-blocks/index.js.map +1 -1
  87. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  88. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  89. package/build/components/inserter/menu.js +26 -4
  90. package/build/components/inserter/menu.js.map +1 -1
  91. package/build/components/inserter/quick-inserter.js +2 -1
  92. package/build/components/inserter/quick-inserter.js.map +1 -1
  93. package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
  94. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  95. package/build/components/link-control/link-preview.js +1 -1
  96. package/build/components/link-control/link-preview.js.map +1 -1
  97. package/build/components/media-placeholder/index.js +19 -23
  98. package/build/components/media-placeholder/index.js.map +1 -1
  99. package/build/components/navigable-toolbar/index.js +3 -1
  100. package/build/components/navigable-toolbar/index.js.map +1 -1
  101. package/build/components/rich-text/event-listeners/input-rules.js +1 -0
  102. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
  103. package/build/components/rich-text/index.native.js +10 -4
  104. package/build/components/rich-text/index.native.js.map +1 -1
  105. package/build/components/rich-text/native/index.native.js +14 -0
  106. package/build/components/rich-text/native/index.native.js.map +1 -1
  107. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  108. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  109. package/build/components/tabbed-sidebar/index.js +66 -0
  110. package/build/components/tabbed-sidebar/index.js.map +1 -0
  111. package/build/components/url-popover/index.js +3 -0
  112. package/build/components/url-popover/index.js.map +1 -1
  113. package/build/hooks/background.js +26 -4
  114. package/build/hooks/background.js.map +1 -1
  115. package/build/hooks/block-hooks.js +11 -17
  116. package/build/hooks/block-hooks.js.map +1 -1
  117. package/build/hooks/block-style-variation.js +195 -11
  118. package/build/hooks/block-style-variation.js.map +1 -1
  119. package/build/hooks/duotone.js +16 -11
  120. package/build/hooks/duotone.js.map +1 -1
  121. package/build/hooks/grid-visualizer.js +65 -0
  122. package/build/hooks/grid-visualizer.js.map +1 -0
  123. package/build/hooks/index.js +15 -2
  124. package/build/hooks/index.js.map +1 -1
  125. package/build/hooks/layout-child.js +65 -40
  126. package/build/hooks/layout-child.js.map +1 -1
  127. package/build/hooks/position.js +2 -9
  128. package/build/hooks/position.js.map +1 -1
  129. package/build/hooks/use-bindings-attributes.js +16 -6
  130. package/build/hooks/use-bindings-attributes.js.map +1 -1
  131. package/build/hooks/utils.js +5 -2
  132. package/build/hooks/utils.js.map +1 -1
  133. package/build/layouts/constrained.js +44 -2
  134. package/build/layouts/constrained.js.map +1 -1
  135. package/build/layouts/grid.js +92 -76
  136. package/build/layouts/grid.js.map +1 -1
  137. package/build/lock-unlock.js +1 -1
  138. package/build/lock-unlock.js.map +1 -1
  139. package/build/private-apis.js +6 -1
  140. package/build/private-apis.js.map +1 -1
  141. package/build/store/actions.js +17 -1
  142. package/build/store/actions.js.map +1 -1
  143. package/build/store/defaults.js +0 -2
  144. package/build/store/defaults.js.map +1 -1
  145. package/build/store/defaults.native.js +0 -3
  146. package/build/store/defaults.native.js.map +1 -1
  147. package/build/store/private-keys.js +2 -1
  148. package/build/store/private-keys.js.map +1 -1
  149. package/build/utils/format-font-style.js +45 -0
  150. package/build/utils/format-font-style.js.map +1 -0
  151. package/build/utils/format-font-weight.js +68 -0
  152. package/build/utils/format-font-weight.js.map +1 -0
  153. package/build/utils/get-editor-region.js +34 -0
  154. package/build/utils/get-editor-region.js.map +1 -0
  155. package/build/utils/get-font-styles-and-weights.js +167 -0
  156. package/build/utils/get-font-styles-and-weights.js.map +1 -0
  157. package/build/utils/pasting.js +5 -13
  158. package/build/utils/pasting.js.map +1 -1
  159. package/build-module/components/block-breadcrumb/index.js +12 -1
  160. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  161. package/build-module/components/block-lock/modal.js +67 -67
  162. package/build-module/components/block-lock/modal.js.map +1 -1
  163. package/build-module/components/block-lock/toolbar.js +0 -1
  164. package/build-module/components/block-lock/toolbar.js.map +1 -1
  165. package/build-module/components/block-mover/button.js +1 -1
  166. package/build-module/components/block-mover/button.js.map +1 -1
  167. package/build-module/components/block-mover/index.js +12 -6
  168. package/build-module/components/block-mover/index.js.map +1 -1
  169. package/build-module/components/block-pattern-setup/setup-toolbar.js +2 -2
  170. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  171. package/build-module/components/block-patterns-paging/index.js +5 -7
  172. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  173. package/build-module/components/block-quick-navigation/index.js +20 -17
  174. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  175. package/build-module/components/block-rename/modal.js +5 -13
  176. package/build-module/components/block-rename/modal.js.map +1 -1
  177. package/build-module/components/block-toolbar/shuffle.js +4 -1
  178. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  179. package/build-module/components/block-tools/block-selection-button.js +10 -61
  180. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  181. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  182. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  183. package/build-module/components/block-tools/index.js +14 -1
  184. package/build-module/components/block-tools/index.js.map +1 -1
  185. package/build-module/components/block-tools/use-show-block-tools.js +4 -2
  186. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  187. package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -4
  188. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  189. package/build-module/components/block-tools/zoom-out-popover.js +48 -0
  190. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -0
  191. package/build-module/components/block-tools/zoom-out-toolbar.js +131 -0
  192. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -0
  193. package/build-module/components/button-block-appender/index.js +3 -1
  194. package/build-module/components/button-block-appender/index.js.map +1 -1
  195. package/build-module/components/child-layout-control/index.js +194 -128
  196. package/build-module/components/child-layout-control/index.js.map +1 -1
  197. package/build-module/components/date-format-picker/index.js +11 -3
  198. package/build-module/components/date-format-picker/index.js.map +1 -1
  199. package/build-module/components/dimensions-tool/index.js +6 -4
  200. package/build-module/components/dimensions-tool/index.js.map +1 -1
  201. package/build-module/components/font-appearance-control/index.js +28 -63
  202. package/build-module/components/font-appearance-control/index.js.map +1 -1
  203. package/build-module/components/global-styles/background-panel.js +181 -119
  204. package/build-module/components/global-styles/background-panel.js.map +1 -1
  205. package/build-module/components/global-styles/border-panel.js +3 -2
  206. package/build-module/components/global-styles/border-panel.js.map +1 -1
  207. package/build-module/components/global-styles/color-panel.js +3 -2
  208. package/build-module/components/global-styles/color-panel.js.map +1 -1
  209. package/build-module/components/global-styles/dimensions-panel.js +3 -2
  210. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  211. package/build-module/components/global-styles/filters-panel.js +3 -2
  212. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  213. package/build-module/components/global-styles/hooks.js +8 -0
  214. package/build-module/components/global-styles/hooks.js.map +1 -1
  215. package/build-module/components/global-styles/image-settings-panel.js +3 -2
  216. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  217. package/build-module/components/global-styles/typography-panel.js +52 -14
  218. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  219. package/build-module/components/global-styles/typography-utils.js +48 -0
  220. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  221. package/build-module/components/global-styles/use-global-styles-output.js +25 -9
  222. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  223. package/build-module/components/global-styles/utils.js +15 -6
  224. package/build-module/components/global-styles/utils.js.map +1 -1
  225. package/build-module/components/grid/grid-item-movers.js +87 -0
  226. package/build-module/components/grid/grid-item-movers.js.map +1 -0
  227. package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
  228. package/build-module/components/grid/grid-item-resizer.js.map +1 -0
  229. package/build-module/components/grid/grid-visualizer.js +297 -0
  230. package/build-module/components/grid/grid-visualizer.js.map +1 -0
  231. package/build-module/components/grid/index.js +5 -0
  232. package/build-module/components/grid/index.js.map +1 -0
  233. package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
  234. package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
  235. package/build-module/components/grid/use-grid-layout-sync.js +162 -0
  236. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
  237. package/build-module/components/grid/utils.js +131 -0
  238. package/build-module/components/grid/utils.js.map +1 -0
  239. package/build-module/components/image-editor/aspect-ratio-dropdown.js +0 -1
  240. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  241. package/build-module/components/inner-blocks/index.js +1 -1
  242. package/build-module/components/inner-blocks/index.js.map +1 -1
  243. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  244. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  245. package/build-module/components/inserter/menu.js +26 -4
  246. package/build-module/components/inserter/menu.js.map +1 -1
  247. package/build-module/components/inserter/quick-inserter.js +2 -1
  248. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  249. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
  250. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  251. package/build-module/components/link-control/link-preview.js +1 -1
  252. package/build-module/components/link-control/link-preview.js.map +1 -1
  253. package/build-module/components/media-placeholder/index.js +19 -23
  254. package/build-module/components/media-placeholder/index.js.map +1 -1
  255. package/build-module/components/navigable-toolbar/index.js +3 -1
  256. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  257. package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
  258. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  259. package/build-module/components/rich-text/index.native.js +11 -5
  260. package/build-module/components/rich-text/index.native.js.map +1 -1
  261. package/build-module/components/rich-text/native/index.native.js +14 -0
  262. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  263. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  264. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  265. package/build-module/components/tabbed-sidebar/index.js +60 -0
  266. package/build-module/components/tabbed-sidebar/index.js.map +1 -0
  267. package/build-module/components/url-popover/index.js +3 -0
  268. package/build-module/components/url-popover/index.js.map +1 -1
  269. package/build-module/hooks/background.js +26 -4
  270. package/build-module/hooks/background.js.map +1 -1
  271. package/build-module/hooks/block-hooks.js +11 -17
  272. package/build-module/hooks/block-hooks.js.map +1 -1
  273. package/build-module/hooks/block-style-variation.js +193 -11
  274. package/build-module/hooks/block-style-variation.js.map +1 -1
  275. package/build-module/hooks/duotone.js +16 -11
  276. package/build-module/hooks/duotone.js.map +1 -1
  277. package/build-module/hooks/grid-visualizer.js +64 -0
  278. package/build-module/hooks/grid-visualizer.js.map +1 -0
  279. package/build-module/hooks/index.js +3 -0
  280. package/build-module/hooks/index.js.map +1 -1
  281. package/build-module/hooks/layout-child.js +63 -38
  282. package/build-module/hooks/layout-child.js.map +1 -1
  283. package/build-module/hooks/position.js +2 -9
  284. package/build-module/hooks/position.js.map +1 -1
  285. package/build-module/hooks/use-bindings-attributes.js +16 -6
  286. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  287. package/build-module/hooks/utils.js +5 -2
  288. package/build-module/hooks/utils.js.map +1 -1
  289. package/build-module/layouts/constrained.js +44 -2
  290. package/build-module/layouts/constrained.js.map +1 -1
  291. package/build-module/layouts/grid.js +92 -76
  292. package/build-module/layouts/grid.js.map +1 -1
  293. package/build-module/lock-unlock.js +1 -1
  294. package/build-module/lock-unlock.js.map +1 -1
  295. package/build-module/private-apis.js +8 -3
  296. package/build-module/private-apis.js.map +1 -1
  297. package/build-module/store/actions.js +17 -1
  298. package/build-module/store/actions.js.map +1 -1
  299. package/build-module/store/defaults.js +0 -2
  300. package/build-module/store/defaults.js.map +1 -1
  301. package/build-module/store/defaults.native.js +0 -3
  302. package/build-module/store/defaults.native.js.map +1 -1
  303. package/build-module/store/private-keys.js +1 -0
  304. package/build-module/store/private-keys.js.map +1 -1
  305. package/build-module/utils/format-font-style.js +39 -0
  306. package/build-module/utils/format-font-style.js.map +1 -0
  307. package/build-module/utils/format-font-weight.js +62 -0
  308. package/build-module/utils/format-font-weight.js.map +1 -0
  309. package/build-module/utils/get-editor-region.js +28 -0
  310. package/build-module/utils/get-editor-region.js.map +1 -0
  311. package/build-module/utils/get-font-styles-and-weights.js +160 -0
  312. package/build-module/utils/get-font-styles-and-weights.js.map +1 -0
  313. package/build-module/utils/pasting.js +5 -13
  314. package/build-module/utils/pasting.js.map +1 -1
  315. package/build-style/content-rtl.css +1 -0
  316. package/build-style/content.css +1 -0
  317. package/build-style/style-rtl.css +238 -106
  318. package/build-style/style.css +238 -106
  319. package/package.json +32 -32
  320. package/src/components/block-breadcrumb/index.js +16 -1
  321. package/src/components/block-lock/modal.js +95 -82
  322. package/src/components/block-lock/style.scss +11 -1
  323. package/src/components/block-lock/toolbar.js +0 -1
  324. package/src/components/block-mover/button.js +1 -1
  325. package/src/components/block-mover/index.js +37 -24
  326. package/src/components/block-pattern-setup/setup-toolbar.js +2 -2
  327. package/src/components/block-patterns-paging/index.js +8 -11
  328. package/src/components/block-patterns-paging/style.scss +18 -0
  329. package/src/components/block-quick-navigation/index.js +21 -28
  330. package/src/components/block-rename/modal.js +2 -8
  331. package/src/components/block-switcher/test/index.js +6 -6
  332. package/src/components/block-toolbar/shuffle.js +4 -1
  333. package/src/components/block-toolbar/style.scss +1 -11
  334. package/src/components/block-tools/block-selection-button.js +11 -83
  335. package/src/components/block-tools/block-toolbar-breadcrumb.js +9 -4
  336. package/src/components/block-tools/index.js +21 -1
  337. package/src/components/block-tools/style.scss +15 -0
  338. package/src/components/block-tools/use-show-block-tools.js +14 -6
  339. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -4
  340. package/src/components/block-tools/zoom-out-popover.js +49 -0
  341. package/src/components/block-tools/zoom-out-toolbar.js +140 -0
  342. package/src/components/button-block-appender/index.js +2 -1
  343. package/src/components/child-layout-control/index.js +243 -160
  344. package/src/components/date-format-picker/index.js +10 -1
  345. package/src/components/date-format-picker/style.scss +0 -9
  346. package/src/components/dimensions-tool/index.js +97 -89
  347. package/src/components/font-appearance-control/index.js +29 -83
  348. package/src/components/font-appearance-control/style.scss +3 -5
  349. package/src/components/global-styles/background-panel.js +249 -170
  350. package/src/components/global-styles/border-panel.js +3 -2
  351. package/src/components/global-styles/color-panel.js +3 -2
  352. package/src/components/global-styles/dimensions-panel.js +3 -2
  353. package/src/components/global-styles/filters-panel.js +3 -2
  354. package/src/components/global-styles/hooks.js +9 -0
  355. package/src/components/global-styles/image-settings-panel.js +3 -2
  356. package/src/components/global-styles/style.scss +105 -20
  357. package/src/components/global-styles/test/typography-utils.js +269 -0
  358. package/src/components/global-styles/test/use-global-styles-output.js +38 -3
  359. package/src/components/global-styles/typography-panel.js +49 -12
  360. package/src/components/global-styles/typography-utils.js +63 -0
  361. package/src/components/global-styles/use-global-styles-output.js +25 -9
  362. package/src/components/global-styles/utils.js +17 -6
  363. package/src/components/grid/grid-item-movers.js +112 -0
  364. package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +15 -52
  365. package/src/components/grid/grid-visualizer.js +384 -0
  366. package/src/components/grid/index.js +4 -0
  367. package/src/components/grid/style.scss +98 -0
  368. package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
  369. package/src/components/grid/use-grid-layout-sync.js +170 -0
  370. package/src/components/grid/utils.js +178 -0
  371. package/src/components/iframe/content.scss +1 -0
  372. package/src/components/image-editor/aspect-ratio-dropdown.js +0 -1
  373. package/src/components/inner-blocks/index.js +4 -1
  374. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
  375. package/src/components/inserter/menu.js +47 -13
  376. package/src/components/inserter/quick-inserter.js +6 -1
  377. package/src/components/inserter/style.scss +1 -49
  378. package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
  379. package/src/components/link-control/link-preview.js +1 -1
  380. package/src/components/media-placeholder/index.js +22 -32
  381. package/src/components/navigable-toolbar/index.js +3 -1
  382. package/src/components/rich-text/event-listeners/input-rules.js +1 -1
  383. package/src/components/rich-text/index.native.js +10 -8
  384. package/src/components/rich-text/native/index.native.js +17 -0
  385. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -1
  386. package/src/components/tabbed-sidebar/README.md +76 -0
  387. package/src/components/tabbed-sidebar/index.js +70 -0
  388. package/src/components/tabbed-sidebar/style.scss +53 -0
  389. package/src/components/url-popover/index.js +3 -0
  390. package/src/hooks/background.js +25 -10
  391. package/src/hooks/block-hooks.js +9 -16
  392. package/src/hooks/block-style-variation.js +226 -9
  393. package/src/hooks/duotone.js +16 -12
  394. package/src/hooks/grid-visualizer.js +64 -0
  395. package/src/hooks/index.js +3 -0
  396. package/src/hooks/layout-child.js +75 -39
  397. package/src/hooks/position.js +3 -10
  398. package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
  399. package/src/hooks/use-bindings-attributes.js +18 -4
  400. package/src/hooks/utils.js +5 -1
  401. package/src/layouts/constrained.js +43 -2
  402. package/src/layouts/grid.js +175 -88
  403. package/src/lock-unlock.js +1 -1
  404. package/src/private-apis.js +12 -1
  405. package/src/store/actions.js +21 -1
  406. package/src/store/defaults.js +0 -2
  407. package/src/store/defaults.native.js +0 -3
  408. package/src/store/private-keys.js +1 -0
  409. package/src/style.scss +2 -2
  410. package/src/utils/format-font-style.js +40 -0
  411. package/src/utils/format-font-weight.js +63 -0
  412. package/src/utils/get-editor-region.js +31 -0
  413. package/src/utils/get-font-styles-and-weights.js +191 -0
  414. package/src/utils/pasting.js +5 -12
  415. package/src/utils/test/format-font-style.js +34 -0
  416. package/src/utils/test/format-font-weight.js +66 -0
  417. package/src/utils/test/get-font-styles-and-weights.js +513 -0
  418. package/tsconfig.tsbuildinfo +1 -1
  419. package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
  420. package/build/components/grid-visualizer/grid-visualizer.js +0 -92
  421. package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
  422. package/build/components/grid-visualizer/index.js.map +0 -1
  423. package/build/components/grid-visualizer/utils.js +0 -10
  424. package/build/components/grid-visualizer/utils.js.map +0 -1
  425. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
  426. package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
  427. package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
  428. package/build-module/components/grid-visualizer/index.js +0 -3
  429. package/build-module/components/grid-visualizer/index.js.map +0 -1
  430. package/build-module/components/grid-visualizer/utils.js +0 -4
  431. package/build-module/components/grid-visualizer/utils.js.map +0 -1
  432. package/src/components/grid-visualizer/grid-visualizer.js +0 -101
  433. package/src/components/grid-visualizer/index.js +0 -2
  434. package/src/components/grid-visualizer/style.scss +0 -34
  435. package/src/components/grid-visualizer/utils.js +0 -5
  436. package/src/hooks/position.scss +0 -18
  437. /package/src/components/font-sizes/{README.MD → README.md} +0 -0
@@ -0,0 +1,64 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createHigherOrderComponent } from '@wordpress/compose';
5
+ import { addFilter } from '@wordpress/hooks';
6
+ import { useSelect } from '@wordpress/data';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { GridVisualizer, useGridLayoutSync } from '../components/grid';
12
+ import { store as blockEditorStore } from '../store';
13
+
14
+ function GridLayoutSync( props ) {
15
+ useGridLayoutSync( props );
16
+ }
17
+
18
+ function GridTools( { clientId, layout } ) {
19
+ const { isSelected, isDragging } = useSelect( ( select ) => {
20
+ const { isBlockSelected, isDraggingBlocks } =
21
+ select( blockEditorStore );
22
+
23
+ return {
24
+ isSelected: isBlockSelected( clientId ),
25
+ isDragging: isDraggingBlocks(),
26
+ };
27
+ } );
28
+
29
+ if ( ! isSelected && ! isDragging ) {
30
+ return null;
31
+ }
32
+
33
+ return (
34
+ <>
35
+ <GridVisualizer clientId={ clientId } parentLayout={ layout } />
36
+ <GridLayoutSync clientId={ clientId } />
37
+ </>
38
+ );
39
+ }
40
+
41
+ const addGridVisualizerToBlockEdit = createHigherOrderComponent(
42
+ ( BlockEdit ) => ( props ) => {
43
+ if ( props.attributes.layout?.type !== 'grid' ) {
44
+ return <BlockEdit { ...props } />;
45
+ }
46
+
47
+ return (
48
+ <>
49
+ <GridTools
50
+ clientId={ props.clientId }
51
+ layout={ props.attributes.layout }
52
+ />
53
+ <BlockEdit { ...props } />
54
+ </>
55
+ );
56
+ },
57
+ 'addGridVisualizerToBlockEdit'
58
+ );
59
+
60
+ addFilter(
61
+ 'editor.BlockEdit',
62
+ 'core/editor/grid-visualizer',
63
+ addGridVisualizerToBlockEdit
64
+ );
@@ -33,6 +33,7 @@ import blockHooks from './block-hooks';
33
33
  import blockBindingsPanel from './block-bindings';
34
34
  import './block-renaming';
35
35
  import './use-bindings-attributes';
36
+ import './grid-visualizer';
36
37
 
37
38
  createBlockEditFilter(
38
39
  [
@@ -87,4 +88,6 @@ export { getSpacingClassesAndStyles } from './use-spacing-props';
87
88
  export { getTypographyClassesAndStyles } from './use-typography-props';
88
89
  export { getGapCSSValue } from './gap';
89
90
  export { useCachedTruthy } from './use-cached-truthy';
91
+ export { setBackgroundStyleDefaults } from './background';
90
92
  export { useZoomOut } from './use-zoom-out';
93
+ export { __unstableBlockStyleVariationOverridesWithConfig } from './block-style-variation';
@@ -11,7 +11,11 @@ import { useState } from '@wordpress/element';
11
11
  import { store as blockEditorStore } from '../store';
12
12
  import { useStyleOverride } from './utils';
13
13
  import { useLayout } from '../components/block-list/layout';
14
- import { GridVisualizer, GridItemResizer } from '../components/grid-visualizer';
14
+ import {
15
+ GridVisualizer,
16
+ GridItemResizer,
17
+ GridItemMovers,
18
+ } from '../components/grid';
15
19
 
16
20
  function useBlockPropsChildLayoutStyles( { style } ) {
17
21
  const shouldRenderChildLayoutStyles = useSelect( ( select ) => {
@@ -31,6 +35,23 @@ function useBlockPropsChildLayoutStyles( { style } ) {
31
35
  const id = useInstanceId( useBlockPropsChildLayoutStyles );
32
36
  const selector = `.wp-container-content-${ id }`;
33
37
 
38
+ // Check that the grid layout attributes are of the correct type, so that we don't accidentally
39
+ // write code that stores a string attribute instead of a number.
40
+ if ( process.env.NODE_ENV === 'development' ) {
41
+ if ( columnStart && typeof columnStart !== 'number' ) {
42
+ throw new Error( 'columnStart must be a number' );
43
+ }
44
+ if ( rowStart && typeof rowStart !== 'number' ) {
45
+ throw new Error( 'rowStart must be a number' );
46
+ }
47
+ if ( columnSpan && typeof columnSpan !== 'number' ) {
48
+ throw new Error( 'columnSpan must be a number' );
49
+ }
50
+ if ( rowSpan && typeof rowSpan !== 'number' ) {
51
+ throw new Error( 'rowSpan must be a number' );
52
+ }
53
+ }
54
+
34
55
  let css = '';
35
56
  if ( shouldRenderChildLayoutStyles ) {
36
57
  if ( selfStretch === 'fixed' && flexSize ) {
@@ -55,6 +76,19 @@ function useBlockPropsChildLayoutStyles( { style } ) {
55
76
  grid-column: span ${ columnSpan };
56
77
  }`;
57
78
  }
79
+ if ( rowStart && rowSpan ) {
80
+ css += `${ selector } {
81
+ grid-row: ${ rowStart } / span ${ rowSpan };
82
+ }`;
83
+ } else if ( rowStart ) {
84
+ css += `${ selector } {
85
+ grid-row: ${ rowStart };
86
+ }`;
87
+ } else if ( rowSpan ) {
88
+ css += `${ selector } {
89
+ grid-row: span ${ rowSpan };
90
+ }`;
91
+ }
58
92
  /**
59
93
  * If minimumColumnWidth is set on the parent, or if no
60
94
  * columnCount is set, the grid is responsive so a
@@ -64,16 +98,6 @@ function useBlockPropsChildLayoutStyles( { style } ) {
64
98
  ( columnSpan || columnStart ) &&
65
99
  ( minimumColumnWidth || ! columnCount )
66
100
  ) {
67
- // Check if columnSpan and columnStart are numbers so Math.max doesn't break.
68
- const columnSpanNumber = columnSpan ? parseInt( columnSpan ) : null;
69
- const columnStartNumber = columnStart
70
- ? parseInt( columnStart )
71
- : null;
72
- const highestNumber = Math.max(
73
- columnSpanNumber,
74
- columnStartNumber
75
- );
76
-
77
101
  let parentColumnValue = parseFloat( minimumColumnWidth );
78
102
  /**
79
103
  * 12rem is the default minimumColumnWidth value.
@@ -95,32 +119,29 @@ function useBlockPropsChildLayoutStyles( { style } ) {
95
119
  parentColumnUnit = 'rem';
96
120
  }
97
121
 
122
+ const highestNumber = Math.max( columnSpan, columnStart );
98
123
  const defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;
99
124
  const containerQueryValue =
100
125
  highestNumber * parentColumnValue +
101
126
  ( highestNumber - 1 ) * defaultGapValue;
127
+ // For blocks that only span one column, we want to remove any rowStart values as
128
+ // the container reduces in size, so that blocks are still arranged in markup order.
129
+ const minimumContainerQueryValue =
130
+ parentColumnValue * 2 + defaultGapValue - 1;
102
131
  // If a span is set we want to preserve it as long as possible, otherwise we just reset the value.
103
- const gridColumnValue = columnSpan ? '1/-1' : 'auto';
132
+ const gridColumnValue =
133
+ columnSpan && columnSpan > 1 ? '1/-1' : 'auto';
104
134
 
105
- css += `@container (max-width: ${ containerQueryValue }${ parentColumnUnit }) {
135
+ css += `@container (max-width: ${ Math.max(
136
+ containerQueryValue,
137
+ minimumContainerQueryValue
138
+ ) }${ parentColumnUnit }) {
106
139
  ${ selector } {
107
140
  grid-column: ${ gridColumnValue };
141
+ grid-row: auto;
108
142
  }
109
143
  }`;
110
144
  }
111
- if ( rowStart && rowSpan ) {
112
- css += `${ selector } {
113
- grid-row: ${ rowStart } / span ${ rowSpan };
114
- }`;
115
- } else if ( rowStart ) {
116
- css += `${ selector } {
117
- grid-row: ${ rowStart };
118
- }`;
119
- } else if ( rowSpan ) {
120
- css += `${ selector } {
121
- grid-row: span ${ rowSpan };
122
- }`;
123
- }
124
145
  }
125
146
 
126
147
  useStyleOverride( { css } );
@@ -135,10 +156,12 @@ function useBlockPropsChildLayoutStyles( { style } ) {
135
156
  }
136
157
 
137
158
  function ChildLayoutControlsPure( { clientId, style, setAttributes } ) {
159
+ const parentLayout = useLayout() || {};
138
160
  const {
139
161
  type: parentLayoutType = 'default',
140
162
  allowSizingOnChildren = false,
141
- } = useLayout() || {};
163
+ isManualPlacement,
164
+ } = parentLayout;
142
165
 
143
166
  const rootClientId = useSelect(
144
167
  ( select ) => {
@@ -154,31 +177,44 @@ function ChildLayoutControlsPure( { clientId, style, setAttributes } ) {
154
177
  return null;
155
178
  }
156
179
 
180
+ function updateLayout( layout ) {
181
+ setAttributes( {
182
+ style: {
183
+ ...style,
184
+ layout: {
185
+ ...style?.layout,
186
+ ...layout,
187
+ },
188
+ },
189
+ } );
190
+ }
191
+
157
192
  return (
158
193
  <>
159
194
  <GridVisualizer
160
195
  clientId={ rootClientId }
161
196
  contentRef={ setResizerBounds }
197
+ parentLayout={ parentLayout }
162
198
  />
163
199
  { allowSizingOnChildren && (
164
200
  <GridItemResizer
165
201
  clientId={ clientId }
166
202
  // Don't allow resizing beyond the grid visualizer.
167
203
  bounds={ resizerBounds }
168
- onChange={ ( { columnSpan, rowSpan } ) => {
169
- setAttributes( {
170
- style: {
171
- ...style,
172
- layout: {
173
- ...style?.layout,
174
- columnSpan,
175
- rowSpan,
176
- },
177
- },
178
- } );
179
- } }
204
+ onChange={ updateLayout }
205
+ parentLayout={ parentLayout }
180
206
  />
181
207
  ) }
208
+ { isManualPlacement &&
209
+ window.__experimentalEnableGridInteractivity && (
210
+ <GridItemMovers
211
+ layout={ style?.layout }
212
+ parentLayout={ parentLayout }
213
+ onChange={ updateLayout }
214
+ gridClientId={ rootClientId }
215
+ blockClientId={ clientId }
216
+ />
217
+ ) }
182
218
  </>
183
219
  );
184
220
  }
@@ -26,25 +26,22 @@ import { cleanEmptyObject, useStyleOverride } from './utils';
26
26
  import { unlock } from '../lock-unlock';
27
27
  import { store as blockEditorStore } from '../store';
28
28
 
29
- const { CustomSelectControl } = unlock( componentsPrivateApis );
29
+ const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
30
+ componentsPrivateApis
31
+ );
30
32
 
31
33
  const POSITION_SUPPORT_KEY = 'position';
32
34
 
33
- const OPTION_CLASSNAME =
34
- 'block-editor-hooks__position-selection__select-control__option';
35
-
36
35
  const DEFAULT_OPTION = {
37
36
  key: 'default',
38
37
  value: '',
39
38
  name: __( 'Default' ),
40
- className: OPTION_CLASSNAME,
41
39
  };
42
40
 
43
41
  const STICKY_OPTION = {
44
42
  key: 'sticky',
45
43
  value: 'sticky',
46
44
  name: _x( 'Sticky', 'Name for the value of the CSS position property' ),
47
- className: OPTION_CLASSNAME,
48
45
  __experimentalHint: __(
49
46
  'The block will stick to the top of the window instead of scrolling.'
50
47
  ),
@@ -54,7 +51,6 @@ const FIXED_OPTION = {
54
51
  key: 'fixed',
55
52
  value: 'fixed',
56
53
  name: _x( 'Fixed', 'Name for the value of the CSS position property' ),
57
- className: OPTION_CLASSNAME,
58
54
  __experimentalHint: __(
59
55
  'The block will not move when the page is scrolled.'
60
56
  ),
@@ -283,13 +279,11 @@ export function PositionPanelPure( {
283
279
  options.length > 1 ? (
284
280
  <InspectorControls group="position">
285
281
  <BaseControl
286
- className="block-editor-hooks__position-selection"
287
282
  __nextHasNoMarginBottom
288
283
  help={ stickyHelpText }
289
284
  >
290
285
  <CustomSelectControl
291
286
  __next40pxDefaultSize
292
- className="block-editor-hooks__position-selection__select-control"
293
287
  label={ __( 'Position' ) }
294
288
  hideLabelFromVision
295
289
  describedBy={ sprintf(
@@ -299,7 +293,6 @@ export function PositionPanelPure( {
299
293
  ) }
300
294
  options={ options }
301
295
  value={ selectedOption }
302
- __experimentalShowSelectedHint
303
296
  onChange={ ( { selectedItem } ) => {
304
297
  onChangeType( selectedItem.value );
305
298
  } }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { getVariationStylesWithRefValues } from '../block-style-variation';
5
+
6
+ describe( 'getVariationStylesWithRefValues', () => {
7
+ it( 'should resolve ref values correctly', () => {
8
+ const globalStyles = {
9
+ styles: {
10
+ color: { background: 'red' },
11
+ blocks: {
12
+ 'core/heading': {
13
+ color: { text: 'blue' },
14
+ },
15
+ 'core/group': {
16
+ variations: {
17
+ custom: {
18
+ color: {
19
+ text: { ref: 'styles.does-not-exist' },
20
+ background: {
21
+ ref: 'styles.color.background',
22
+ },
23
+ },
24
+ blocks: {
25
+ 'core/heading': {
26
+ color: {
27
+ text: {
28
+ ref: 'styles.blocks.core/heading.color.text',
29
+ },
30
+ background: { ref: '' },
31
+ },
32
+ },
33
+ },
34
+ elements: {
35
+ link: {
36
+ color: {
37
+ text: {
38
+ ref: 'styles.elements.link.color.text',
39
+ },
40
+ background: { ref: undefined },
41
+ },
42
+ ':hover': {
43
+ color: {
44
+ text: {
45
+ ref: 'styles.elements.link.:hover.color.text',
46
+ },
47
+ },
48
+ },
49
+ },
50
+ },
51
+ },
52
+ },
53
+ },
54
+ },
55
+ elements: {
56
+ link: {
57
+ color: { text: 'green' },
58
+ ':hover': {
59
+ color: { text: 'yellow' },
60
+ },
61
+ },
62
+ },
63
+ },
64
+ };
65
+
66
+ expect(
67
+ getVariationStylesWithRefValues(
68
+ globalStyles,
69
+ 'core/group',
70
+ 'custom'
71
+ )
72
+ ).toEqual( {
73
+ color: { background: 'red' },
74
+ blocks: {
75
+ 'core/heading': {
76
+ color: { text: 'blue' },
77
+ },
78
+ },
79
+ elements: {
80
+ link: {
81
+ color: {
82
+ text: 'green',
83
+ },
84
+ ':hover': {
85
+ color: { text: 'yellow' },
86
+ },
87
+ },
88
+ },
89
+ } );
90
+ } );
91
+ } );
@@ -97,6 +97,7 @@ export const withBlockBindingSupport = createHigherOrderComponent(
97
97
  unlock( select( blocksStore ) ).getAllBlockBindingsSources()
98
98
  );
99
99
  const { name, clientId, context } = props;
100
+ const hasParentPattern = !! props.context[ 'pattern/overrides' ];
100
101
  const hasPatternOverridesDefaultBinding =
101
102
  props.attributes.metadata?.bindings?.[ DEFAULT_ATTRIBUTE ]
102
103
  ?.source === 'core/pattern-overrides';
@@ -108,6 +109,11 @@ export const withBlockBindingSupport = createHigherOrderComponent(
108
109
  ),
109
110
  [ props.attributes.metadata?.bindings, name ]
110
111
  );
112
+
113
+ // While this hook doesn't directly call any selectors, `useSelect` is
114
+ // used purposely here to ensure `boundAttributes` is updated whenever
115
+ // there are attribute updates.
116
+ // `source.getValues` may also call a selector via `registry.select`.
111
117
  const boundAttributes = useSelect( () => {
112
118
  if ( ! bindings ) {
113
119
  return;
@@ -216,13 +222,20 @@ export const withBlockBindingSupport = createHigherOrderComponent(
216
222
  }
217
223
  }
218
224
 
219
- // Only apply normal attribute updates to blocks
220
- // that have partial bindings. Currently this is
221
- // only skipped for pattern overrides sources.
222
225
  if (
223
- ! hasPatternOverridesDefaultBinding &&
226
+ // Don't update non-connected attributes if the block is using pattern overrides
227
+ // and the editing is happening while overriding the pattern (not editing the original).
228
+ ! (
229
+ hasPatternOverridesDefaultBinding &&
230
+ hasParentPattern
231
+ ) &&
224
232
  Object.keys( keptAttributes ).length
225
233
  ) {
234
+ // Don't update caption and href until they are supported.
235
+ if ( hasPatternOverridesDefaultBinding ) {
236
+ delete keptAttributes?.caption;
237
+ delete keptAttributes?.href;
238
+ }
226
239
  setAttributes( keptAttributes );
227
240
  }
228
241
  } );
@@ -236,6 +249,7 @@ export const withBlockBindingSupport = createHigherOrderComponent(
236
249
  setAttributes,
237
250
  sources,
238
251
  hasPatternOverridesDefaultBinding,
252
+ hasParentPattern,
239
253
  ]
240
254
  );
241
255
 
@@ -140,6 +140,7 @@ export function useStyleOverride( {
140
140
  css,
141
141
  assets,
142
142
  __unstableType,
143
+ variation,
143
144
  clientId,
144
145
  } = {} ) {
145
146
  const { setStyleOverride, deleteStyleOverride } = unlock(
@@ -159,6 +160,7 @@ export function useStyleOverride( {
159
160
  css,
160
161
  assets,
161
162
  __unstableType,
163
+ variation,
162
164
  clientId,
163
165
  };
164
166
  // Batch updates to style overrides to avoid triggering cascading renders
@@ -582,6 +584,7 @@ export function createBlockListBlockFilter( features ) {
582
584
  hasSupport,
583
585
  attributeKeys = [],
584
586
  useBlockProps,
587
+ isMatch,
585
588
  } = feature;
586
589
 
587
590
  const neededProps = {};
@@ -595,7 +598,8 @@ export function createBlockListBlockFilter( features ) {
595
598
  // Skip rendering if none of the needed attributes are
596
599
  // set.
597
600
  ! Object.keys( neededProps ).length ||
598
- ! hasSupport( props.name )
601
+ ! hasSupport( props.name ) ||
602
+ ( isMatch && ! isMatch( neededProps ) )
599
603
  ) {
600
604
  return null;
601
605
  }
@@ -24,6 +24,7 @@ import { getCSSRules } from '@wordpress/style-engine';
24
24
  import { useSettings } from '../components/use-settings';
25
25
  import { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';
26
26
  import { getGapCSSValue } from '../hooks/gap';
27
+ import { BlockControls, JustifyContentControl } from '../components';
27
28
  import { shouldSkipSerialization } from '../hooks/utils';
28
29
  import { LAYOUT_DEFINITIONS } from './definitions';
29
30
 
@@ -146,8 +147,24 @@ export default {
146
147
  </>
147
148
  );
148
149
  },
149
- toolBarControls: function DefaultLayoutToolbarControls() {
150
- return null;
150
+ toolBarControls: function DefaultLayoutToolbarControls( {
151
+ layout = {},
152
+ onChange,
153
+ layoutBlockSupport,
154
+ } ) {
155
+ const { allowJustification = true } = layoutBlockSupport;
156
+
157
+ if ( ! allowJustification ) {
158
+ return null;
159
+ }
160
+ return (
161
+ <BlockControls group="block" __experimentalShareWithChildBlocks>
162
+ <DefaultLayoutJustifyContentControl
163
+ layout={ layout }
164
+ onChange={ onChange }
165
+ />
166
+ </BlockControls>
167
+ );
151
168
  },
152
169
  getLayoutStyle: function getLayoutStyle( {
153
170
  selector,
@@ -278,3 +295,27 @@ export default {
278
295
  return alignments;
279
296
  },
280
297
  };
298
+
299
+ const POPOVER_PROPS = {
300
+ placement: 'bottom-start',
301
+ };
302
+
303
+ function DefaultLayoutJustifyContentControl( { layout, onChange } ) {
304
+ const { justifyContent = 'center' } = layout;
305
+ const onJustificationChange = ( value ) => {
306
+ onChange( {
307
+ ...layout,
308
+ justifyContent: value,
309
+ } );
310
+ };
311
+ const allowedControls = [ 'left', 'center', 'right' ];
312
+
313
+ return (
314
+ <JustifyContentControl
315
+ allowedControls={ allowedControls }
316
+ value={ justifyContent }
317
+ onChange={ onJustificationChange }
318
+ popoverProps={ POPOVER_PROPS }
319
+ />
320
+ );
321
+ }