@wordpress/block-editor 13.2.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 (367) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +0 -1
  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/toolbar.js +0 -1
  6. package/build/components/block-lock/toolbar.js.map +1 -1
  7. package/build/components/block-mover/button.js +1 -1
  8. package/build/components/block-mover/button.js.map +1 -1
  9. package/build/components/block-mover/index.js +1 -1
  10. package/build/components/block-mover/index.js.map +1 -1
  11. package/build/components/block-pattern-setup/setup-toolbar.js +2 -2
  12. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  13. package/build/components/block-patterns-paging/index.js +5 -7
  14. package/build/components/block-patterns-paging/index.js.map +1 -1
  15. package/build/components/block-quick-navigation/index.js +20 -17
  16. package/build/components/block-quick-navigation/index.js.map +1 -1
  17. package/build/components/block-rename/modal.js +4 -12
  18. package/build/components/block-rename/modal.js.map +1 -1
  19. package/build/components/block-toolbar/shuffle.js +1 -0
  20. package/build/components/block-toolbar/shuffle.js.map +1 -1
  21. package/build/components/block-tools/block-selection-button.js +7 -58
  22. package/build/components/block-tools/block-selection-button.js.map +1 -1
  23. package/build/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  24. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  25. package/build/components/block-tools/index.js +14 -1
  26. package/build/components/block-tools/index.js.map +1 -1
  27. package/build/components/block-tools/use-show-block-tools.js +4 -2
  28. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  29. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
  30. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  31. package/build/components/block-tools/zoom-out-popover.js +57 -0
  32. package/build/components/block-tools/zoom-out-popover.js.map +1 -0
  33. package/build/components/block-tools/zoom-out-toolbar.js +138 -0
  34. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -0
  35. package/build/components/button-block-appender/index.js +3 -1
  36. package/build/components/button-block-appender/index.js.map +1 -1
  37. package/build/components/child-layout-control/index.js +26 -18
  38. package/build/components/child-layout-control/index.js.map +1 -1
  39. package/build/components/date-format-picker/index.js +10 -1
  40. package/build/components/date-format-picker/index.js.map +1 -1
  41. package/build/components/dimensions-tool/index.js +6 -4
  42. package/build/components/dimensions-tool/index.js.map +1 -1
  43. package/build/components/font-appearance-control/index.js +26 -61
  44. package/build/components/font-appearance-control/index.js.map +1 -1
  45. package/build/components/global-styles/background-panel.js +178 -116
  46. package/build/components/global-styles/background-panel.js.map +1 -1
  47. package/build/components/global-styles/border-panel.js +2 -1
  48. package/build/components/global-styles/border-panel.js.map +1 -1
  49. package/build/components/global-styles/color-panel.js +2 -1
  50. package/build/components/global-styles/color-panel.js.map +1 -1
  51. package/build/components/global-styles/dimensions-panel.js +2 -1
  52. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  53. package/build/components/global-styles/filters-panel.js +2 -1
  54. package/build/components/global-styles/filters-panel.js.map +1 -1
  55. package/build/components/global-styles/hooks.js +8 -0
  56. package/build/components/global-styles/hooks.js.map +1 -1
  57. package/build/components/global-styles/image-settings-panel.js +2 -1
  58. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  59. package/build/components/global-styles/typography-panel.js +50 -12
  60. package/build/components/global-styles/typography-panel.js.map +1 -1
  61. package/build/components/global-styles/typography-utils.js +50 -0
  62. package/build/components/global-styles/typography-utils.js.map +1 -1
  63. package/build/components/global-styles/use-global-styles-output.js +23 -8
  64. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  65. package/build/components/global-styles/utils.js +17 -7
  66. package/build/components/global-styles/utils.js.map +1 -1
  67. package/build/components/grid/grid-item-movers.js +11 -14
  68. package/build/components/grid/grid-item-movers.js.map +1 -1
  69. package/build/components/grid/grid-item-resizer.js +2 -2
  70. package/build/components/grid/grid-item-resizer.js.map +1 -1
  71. package/build/components/grid/grid-visualizer.js +116 -36
  72. package/build/components/grid/grid-visualizer.js.map +1 -1
  73. package/build/components/grid/use-grid-layout-sync.js +29 -22
  74. package/build/components/grid/use-grid-layout-sync.js.map +1 -1
  75. package/build/components/inner-blocks/index.js +1 -1
  76. package/build/components/inner-blocks/index.js.map +1 -1
  77. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  78. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  79. package/build/components/inserter/menu.js +26 -4
  80. package/build/components/inserter/menu.js.map +1 -1
  81. package/build/components/inserter/quick-inserter.js +2 -1
  82. package/build/components/inserter/quick-inserter.js.map +1 -1
  83. package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
  84. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  85. package/build/components/link-control/link-preview.js +1 -1
  86. package/build/components/link-control/link-preview.js.map +1 -1
  87. package/build/components/media-placeholder/index.js +19 -23
  88. package/build/components/media-placeholder/index.js.map +1 -1
  89. package/build/components/navigable-toolbar/index.js +3 -1
  90. package/build/components/navigable-toolbar/index.js.map +1 -1
  91. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  92. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  93. package/build/components/tabbed-sidebar/index.js +66 -0
  94. package/build/components/tabbed-sidebar/index.js.map +1 -0
  95. package/build/components/url-popover/index.js +3 -0
  96. package/build/components/url-popover/index.js.map +1 -1
  97. package/build/hooks/background.js +26 -4
  98. package/build/hooks/background.js.map +1 -1
  99. package/build/hooks/block-hooks.js +11 -17
  100. package/build/hooks/block-hooks.js.map +1 -1
  101. package/build/hooks/block-style-variation.js +169 -4
  102. package/build/hooks/block-style-variation.js.map +1 -1
  103. package/build/hooks/duotone.js +16 -11
  104. package/build/hooks/duotone.js.map +1 -1
  105. package/build/hooks/grid-visualizer.js +65 -0
  106. package/build/hooks/grid-visualizer.js.map +1 -0
  107. package/build/hooks/index.js +15 -2
  108. package/build/hooks/index.js.map +1 -1
  109. package/build/hooks/layout-child.js +39 -22
  110. package/build/hooks/layout-child.js.map +1 -1
  111. package/build/hooks/position.js +2 -9
  112. package/build/hooks/position.js.map +1 -1
  113. package/build/hooks/use-bindings-attributes.js +16 -6
  114. package/build/hooks/use-bindings-attributes.js.map +1 -1
  115. package/build/hooks/utils.js +2 -0
  116. package/build/hooks/utils.js.map +1 -1
  117. package/build/layouts/constrained.js +44 -2
  118. package/build/layouts/constrained.js.map +1 -1
  119. package/build/layouts/grid.js +90 -51
  120. package/build/layouts/grid.js.map +1 -1
  121. package/build/private-apis.js +6 -1
  122. package/build/private-apis.js.map +1 -1
  123. package/build/store/defaults.js +0 -2
  124. package/build/store/defaults.js.map +1 -1
  125. package/build/store/defaults.native.js +0 -3
  126. package/build/store/defaults.native.js.map +1 -1
  127. package/build/store/private-keys.js +2 -1
  128. package/build/store/private-keys.js.map +1 -1
  129. package/build/utils/format-font-style.js +45 -0
  130. package/build/utils/format-font-style.js.map +1 -0
  131. package/build/utils/format-font-weight.js +68 -0
  132. package/build/utils/format-font-weight.js.map +1 -0
  133. package/build/utils/get-editor-region.js +34 -0
  134. package/build/utils/get-editor-region.js.map +1 -0
  135. package/build/utils/get-font-styles-and-weights.js +167 -0
  136. package/build/utils/get-font-styles-and-weights.js.map +1 -0
  137. package/build/utils/pasting.js +5 -13
  138. package/build/utils/pasting.js.map +1 -1
  139. package/build-module/components/block-breadcrumb/index.js +12 -1
  140. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  141. package/build-module/components/block-lock/toolbar.js +0 -1
  142. package/build-module/components/block-lock/toolbar.js.map +1 -1
  143. package/build-module/components/block-mover/button.js +1 -1
  144. package/build-module/components/block-mover/button.js.map +1 -1
  145. package/build-module/components/block-mover/index.js +1 -1
  146. package/build-module/components/block-mover/index.js.map +1 -1
  147. package/build-module/components/block-pattern-setup/setup-toolbar.js +2 -2
  148. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  149. package/build-module/components/block-patterns-paging/index.js +5 -7
  150. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  151. package/build-module/components/block-quick-navigation/index.js +20 -17
  152. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  153. package/build-module/components/block-rename/modal.js +5 -13
  154. package/build-module/components/block-rename/modal.js.map +1 -1
  155. package/build-module/components/block-toolbar/shuffle.js +1 -0
  156. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  157. package/build-module/components/block-tools/block-selection-button.js +10 -61
  158. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  159. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +9 -2
  160. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  161. package/build-module/components/block-tools/index.js +14 -1
  162. package/build-module/components/block-tools/index.js.map +1 -1
  163. package/build-module/components/block-tools/use-show-block-tools.js +4 -2
  164. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  165. package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -4
  166. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  167. package/build-module/components/block-tools/zoom-out-popover.js +48 -0
  168. package/build-module/components/block-tools/zoom-out-popover.js.map +1 -0
  169. package/build-module/components/block-tools/zoom-out-toolbar.js +131 -0
  170. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -0
  171. package/build-module/components/button-block-appender/index.js +3 -1
  172. package/build-module/components/button-block-appender/index.js.map +1 -1
  173. package/build-module/components/child-layout-control/index.js +27 -19
  174. package/build-module/components/child-layout-control/index.js.map +1 -1
  175. package/build-module/components/date-format-picker/index.js +11 -3
  176. package/build-module/components/date-format-picker/index.js.map +1 -1
  177. package/build-module/components/dimensions-tool/index.js +6 -4
  178. package/build-module/components/dimensions-tool/index.js.map +1 -1
  179. package/build-module/components/font-appearance-control/index.js +28 -63
  180. package/build-module/components/font-appearance-control/index.js.map +1 -1
  181. package/build-module/components/global-styles/background-panel.js +181 -119
  182. package/build-module/components/global-styles/background-panel.js.map +1 -1
  183. package/build-module/components/global-styles/border-panel.js +3 -2
  184. package/build-module/components/global-styles/border-panel.js.map +1 -1
  185. package/build-module/components/global-styles/color-panel.js +3 -2
  186. package/build-module/components/global-styles/color-panel.js.map +1 -1
  187. package/build-module/components/global-styles/dimensions-panel.js +3 -2
  188. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  189. package/build-module/components/global-styles/filters-panel.js +3 -2
  190. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  191. package/build-module/components/global-styles/hooks.js +8 -0
  192. package/build-module/components/global-styles/hooks.js.map +1 -1
  193. package/build-module/components/global-styles/image-settings-panel.js +3 -2
  194. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  195. package/build-module/components/global-styles/typography-panel.js +52 -14
  196. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  197. package/build-module/components/global-styles/typography-utils.js +48 -0
  198. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  199. package/build-module/components/global-styles/use-global-styles-output.js +23 -8
  200. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  201. package/build-module/components/global-styles/utils.js +15 -6
  202. package/build-module/components/global-styles/utils.js.map +1 -1
  203. package/build-module/components/grid/grid-item-movers.js +11 -14
  204. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  205. package/build-module/components/grid/grid-item-resizer.js +2 -2
  206. package/build-module/components/grid/grid-item-resizer.js.map +1 -1
  207. package/build-module/components/grid/grid-visualizer.js +117 -37
  208. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  209. package/build-module/components/grid/use-grid-layout-sync.js +29 -22
  210. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
  211. package/build-module/components/inner-blocks/index.js +1 -1
  212. package/build-module/components/inner-blocks/index.js.map +1 -1
  213. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
  214. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
  215. package/build-module/components/inserter/menu.js +26 -4
  216. package/build-module/components/inserter/menu.js.map +1 -1
  217. package/build-module/components/inserter/quick-inserter.js +2 -1
  218. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  219. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
  220. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  221. package/build-module/components/link-control/link-preview.js +1 -1
  222. package/build-module/components/link-control/link-preview.js.map +1 -1
  223. package/build-module/components/media-placeholder/index.js +19 -23
  224. package/build-module/components/media-placeholder/index.js.map +1 -1
  225. package/build-module/components/navigable-toolbar/index.js +3 -1
  226. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  227. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
  228. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  229. package/build-module/components/tabbed-sidebar/index.js +60 -0
  230. package/build-module/components/tabbed-sidebar/index.js.map +1 -0
  231. package/build-module/components/url-popover/index.js +3 -0
  232. package/build-module/components/url-popover/index.js.map +1 -1
  233. package/build-module/hooks/background.js +26 -4
  234. package/build-module/hooks/background.js.map +1 -1
  235. package/build-module/hooks/block-hooks.js +11 -17
  236. package/build-module/hooks/block-hooks.js.map +1 -1
  237. package/build-module/hooks/block-style-variation.js +168 -4
  238. package/build-module/hooks/block-style-variation.js.map +1 -1
  239. package/build-module/hooks/duotone.js +16 -11
  240. package/build-module/hooks/duotone.js.map +1 -1
  241. package/build-module/hooks/grid-visualizer.js +64 -0
  242. package/build-module/hooks/grid-visualizer.js.map +1 -0
  243. package/build-module/hooks/index.js +3 -0
  244. package/build-module/hooks/index.js.map +1 -1
  245. package/build-module/hooks/layout-child.js +39 -22
  246. package/build-module/hooks/layout-child.js.map +1 -1
  247. package/build-module/hooks/position.js +2 -9
  248. package/build-module/hooks/position.js.map +1 -1
  249. package/build-module/hooks/use-bindings-attributes.js +16 -6
  250. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  251. package/build-module/hooks/utils.js +2 -0
  252. package/build-module/hooks/utils.js.map +1 -1
  253. package/build-module/layouts/constrained.js +44 -2
  254. package/build-module/layouts/constrained.js.map +1 -1
  255. package/build-module/layouts/grid.js +90 -51
  256. package/build-module/layouts/grid.js.map +1 -1
  257. package/build-module/private-apis.js +8 -3
  258. package/build-module/private-apis.js.map +1 -1
  259. package/build-module/store/defaults.js +0 -2
  260. package/build-module/store/defaults.js.map +1 -1
  261. package/build-module/store/defaults.native.js +0 -3
  262. package/build-module/store/defaults.native.js.map +1 -1
  263. package/build-module/store/private-keys.js +1 -0
  264. package/build-module/store/private-keys.js.map +1 -1
  265. package/build-module/utils/format-font-style.js +39 -0
  266. package/build-module/utils/format-font-style.js.map +1 -0
  267. package/build-module/utils/format-font-weight.js +62 -0
  268. package/build-module/utils/format-font-weight.js.map +1 -0
  269. package/build-module/utils/get-editor-region.js +28 -0
  270. package/build-module/utils/get-editor-region.js.map +1 -0
  271. package/build-module/utils/get-font-styles-and-weights.js +160 -0
  272. package/build-module/utils/get-font-styles-and-weights.js.map +1 -0
  273. package/build-module/utils/pasting.js +5 -13
  274. package/build-module/utils/pasting.js.map +1 -1
  275. package/build-style/content-rtl.css +1 -0
  276. package/build-style/content.css +1 -0
  277. package/build-style/style-rtl.css +207 -96
  278. package/build-style/style.css +207 -96
  279. package/package.json +32 -32
  280. package/src/components/block-breadcrumb/index.js +16 -1
  281. package/src/components/block-lock/toolbar.js +0 -1
  282. package/src/components/block-mover/button.js +1 -1
  283. package/src/components/block-mover/index.js +1 -1
  284. package/src/components/block-pattern-setup/setup-toolbar.js +2 -2
  285. package/src/components/block-patterns-paging/index.js +8 -11
  286. package/src/components/block-patterns-paging/style.scss +18 -0
  287. package/src/components/block-quick-navigation/index.js +21 -28
  288. package/src/components/block-rename/modal.js +2 -8
  289. package/src/components/block-switcher/test/index.js +6 -6
  290. package/src/components/block-toolbar/shuffle.js +1 -0
  291. package/src/components/block-toolbar/style.scss +1 -11
  292. package/src/components/block-tools/block-selection-button.js +11 -83
  293. package/src/components/block-tools/block-toolbar-breadcrumb.js +9 -4
  294. package/src/components/block-tools/index.js +21 -1
  295. package/src/components/block-tools/style.scss +15 -0
  296. package/src/components/block-tools/use-show-block-tools.js +14 -6
  297. package/src/components/block-tools/zoom-out-mode-inserters.js +5 -4
  298. package/src/components/block-tools/zoom-out-popover.js +49 -0
  299. package/src/components/block-tools/zoom-out-toolbar.js +140 -0
  300. package/src/components/button-block-appender/index.js +2 -1
  301. package/src/components/child-layout-control/index.js +41 -23
  302. package/src/components/date-format-picker/index.js +10 -1
  303. package/src/components/date-format-picker/style.scss +0 -9
  304. package/src/components/dimensions-tool/index.js +97 -89
  305. package/src/components/font-appearance-control/index.js +29 -83
  306. package/src/components/font-appearance-control/style.scss +3 -5
  307. package/src/components/global-styles/background-panel.js +249 -170
  308. package/src/components/global-styles/border-panel.js +3 -2
  309. package/src/components/global-styles/color-panel.js +3 -2
  310. package/src/components/global-styles/dimensions-panel.js +3 -2
  311. package/src/components/global-styles/filters-panel.js +3 -2
  312. package/src/components/global-styles/hooks.js +9 -0
  313. package/src/components/global-styles/image-settings-panel.js +3 -2
  314. package/src/components/global-styles/style.scss +105 -20
  315. package/src/components/global-styles/test/typography-utils.js +269 -0
  316. package/src/components/global-styles/typography-panel.js +49 -12
  317. package/src/components/global-styles/typography-utils.js +63 -0
  318. package/src/components/global-styles/use-global-styles-output.js +23 -8
  319. package/src/components/global-styles/utils.js +17 -6
  320. package/src/components/grid/grid-item-movers.js +11 -27
  321. package/src/components/grid/grid-item-resizer.js +3 -2
  322. package/src/components/grid/grid-visualizer.js +171 -54
  323. package/src/components/grid/style.scss +43 -8
  324. package/src/components/grid/use-grid-layout-sync.js +31 -28
  325. package/src/components/iframe/content.scss +1 -0
  326. package/src/components/inner-blocks/index.js +2 -1
  327. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
  328. package/src/components/inserter/menu.js +47 -13
  329. package/src/components/inserter/quick-inserter.js +6 -1
  330. package/src/components/inserter/style.scss +1 -49
  331. package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
  332. package/src/components/link-control/link-preview.js +1 -1
  333. package/src/components/media-placeholder/index.js +22 -32
  334. package/src/components/navigable-toolbar/index.js +3 -1
  335. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -1
  336. package/src/components/tabbed-sidebar/README.md +76 -0
  337. package/src/components/tabbed-sidebar/index.js +70 -0
  338. package/src/components/tabbed-sidebar/style.scss +53 -0
  339. package/src/components/url-popover/index.js +3 -0
  340. package/src/hooks/background.js +25 -10
  341. package/src/hooks/block-hooks.js +9 -16
  342. package/src/hooks/block-style-variation.js +202 -3
  343. package/src/hooks/duotone.js +16 -12
  344. package/src/hooks/grid-visualizer.js +64 -0
  345. package/src/hooks/index.js +3 -0
  346. package/src/hooks/layout-child.js +53 -37
  347. package/src/hooks/position.js +3 -10
  348. package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
  349. package/src/hooks/use-bindings-attributes.js +18 -4
  350. package/src/hooks/utils.js +2 -0
  351. package/src/layouts/constrained.js +43 -2
  352. package/src/layouts/grid.js +146 -51
  353. package/src/private-apis.js +12 -1
  354. package/src/store/defaults.js +0 -2
  355. package/src/store/defaults.native.js +0 -3
  356. package/src/store/private-keys.js +1 -0
  357. package/src/style.scss +1 -1
  358. package/src/utils/format-font-style.js +40 -0
  359. package/src/utils/format-font-weight.js +63 -0
  360. package/src/utils/get-editor-region.js +31 -0
  361. package/src/utils/get-font-styles-and-weights.js +191 -0
  362. package/src/utils/pasting.js +5 -12
  363. package/src/utils/test/format-font-style.js +34 -0
  364. package/src/utils/test/format-font-weight.js +66 -0
  365. package/src/utils/test/get-font-styles-and-weights.js +513 -0
  366. package/tsconfig.tsbuildinfo +1 -1
  367. package/src/hooks/position.scss +0 -18
@@ -0,0 +1,53 @@
1
+ .block-editor-tabbed-sidebar {
2
+ height: 100%;
3
+ display: flex;
4
+ flex-direction: column;
5
+ flex-grow: 1;
6
+ overflow: hidden;
7
+
8
+ @include break-medium() {
9
+ width: 350px;
10
+ }
11
+ }
12
+
13
+ .block-editor-tabbed-sidebar__tablist-and-close-button {
14
+ border-bottom: $border-width solid $gray-300;
15
+ display: flex;
16
+ justify-content: space-between;
17
+ padding-right: $grid-unit-15;
18
+ }
19
+
20
+
21
+ .block-editor-tabbed-sidebar__close-button {
22
+ background: $white;
23
+ /* stylelint-disable-next-line property-disallowed-list -- This should be removed when https://github.com/WordPress/gutenberg/issues/59013 is fixed. */
24
+ order: 1;
25
+ align-self: center;
26
+ }
27
+
28
+ .block-editor-tabbed-sidebar__tablist {
29
+ box-sizing: border-box;
30
+ flex-grow: 1;
31
+ margin-bottom: -$border-width;
32
+ width: 100%;
33
+ }
34
+
35
+ .block-editor-tabbed-sidebar__tab {
36
+ flex-grow: 1;
37
+ margin-bottom: -$border-width;
38
+
39
+ &[id$="reusable"] {
40
+ flex-grow: inherit;
41
+ // These are to align the `reusable` icon with the search icon.
42
+ padding-left: $grid-unit-20;
43
+ padding-right: $grid-unit-20;
44
+ }
45
+ }
46
+
47
+ .block-editor-tabbed-sidebar__tabpanel {
48
+ display: flex;
49
+ flex-grow: 1;
50
+ flex-direction: column;
51
+ overflow-y: auto;
52
+ scrollbar-gutter: auto;
53
+ }
@@ -71,6 +71,9 @@ const URLPopover = forwardRef(
71
71
  return (
72
72
  <Popover
73
73
  ref={ ref }
74
+ role="dialog"
75
+ aria-modal="true"
76
+ aria-label={ __( 'Edit URL' ) }
74
77
  className="block-editor-url-popover"
75
78
  focusOnMount={ focusOnMount }
76
79
  placement={ computedPlacement }
@@ -16,6 +16,10 @@ import {
16
16
  useHasBackgroundPanel,
17
17
  hasBackgroundImageValue,
18
18
  } from '../components/global-styles/background-panel';
19
+ import {
20
+ globalStylesDataKey,
21
+ globalStylesLinksDataKey,
22
+ } from '../store/private-keys';
19
23
 
20
24
  export const BACKGROUND_SUPPORT_KEY = 'background';
21
25
 
@@ -134,10 +138,25 @@ export function BackgroundImagePanel( {
134
138
  setAttributes,
135
139
  settings,
136
140
  } ) {
137
- const style = useSelect(
138
- ( select ) =>
139
- select( blockEditorStore ).getBlockAttributes( clientId )?.style,
140
- [ clientId ]
141
+ const { style, inheritedValue, _links } = useSelect(
142
+ ( select ) => {
143
+ const { getBlockAttributes, getSettings } =
144
+ select( blockEditorStore );
145
+ const _settings = getSettings();
146
+ return {
147
+ style: getBlockAttributes( clientId )?.style,
148
+ _links: _settings[ globalStylesLinksDataKey ],
149
+ /*
150
+ * @TODO 1. Pass inherited value down to all block style controls,
151
+ * See: packages/block-editor/src/hooks/style.js
152
+ * @TODO 2. Add support for block style variations,
153
+ * See implementation: packages/block-editor/src/hooks/block-style-variation.js
154
+ */
155
+ inheritedValue:
156
+ _settings[ globalStylesDataKey ]?.blocks?.[ name ],
157
+ };
158
+ },
159
+ [ clientId, name ]
141
160
  );
142
161
 
143
162
  if (
@@ -147,11 +166,6 @@ export function BackgroundImagePanel( {
147
166
  return null;
148
167
  }
149
168
 
150
- const defaultControls = getBlockSupport( name, [
151
- BACKGROUND_SUPPORT_KEY,
152
- '__experimentalDefaultControls',
153
- ] );
154
-
155
169
  const onChange = ( newStyle ) => {
156
170
  setAttributes( {
157
171
  style: cleanEmptyObject( newStyle ),
@@ -170,13 +184,14 @@ export function BackgroundImagePanel( {
170
184
 
171
185
  return (
172
186
  <StylesBackgroundPanel
187
+ inheritedValue={ inheritedValue }
173
188
  as={ BackgroundInspectorControl }
174
189
  panelId={ clientId }
175
- defaultControls={ defaultControls }
176
190
  defaultValues={ BACKGROUND_DEFAULT_VALUES }
177
191
  settings={ updatedSettings }
178
192
  onChange={ onChange }
179
193
  value={ style }
194
+ themeFileURIs={ _links?.[ 'wp:theme-file' ] }
180
195
  />
181
196
  );
182
197
  }
@@ -43,25 +43,12 @@ function BlockHooksControlPure( {
43
43
  [ blockTypes, name, ignoredHookedBlocks ]
44
44
  );
45
45
 
46
- const { blockIndex, rootClientId, innerBlocksLength } = useSelect(
47
- ( select ) => {
48
- const { getBlocks, getBlockIndex, getBlockRootClientId } =
49
- select( blockEditorStore );
50
-
51
- return {
52
- blockIndex: getBlockIndex( clientId ),
53
- innerBlocksLength: getBlocks( clientId )?.length,
54
- rootClientId: getBlockRootClientId( clientId ),
55
- };
56
- },
57
- [ clientId ]
58
- );
59
-
60
46
  const hookedBlockClientIds = useSelect(
61
47
  ( select ) => {
62
- const { getBlocks, getGlobalBlockCount } =
48
+ const { getBlocks, getBlockRootClientId, getGlobalBlockCount } =
63
49
  select( blockEditorStore );
64
50
 
51
+ const rootClientId = getBlockRootClientId( clientId );
65
52
  const _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce(
66
53
  ( clientIds, block ) => {
67
54
  // If the block doesn't exist anywhere in the block tree,
@@ -127,9 +114,11 @@ function BlockHooksControlPure( {
127
114
 
128
115
  return EMPTY_OBJECT;
129
116
  },
130
- [ hookedBlocksForCurrentBlock, name, clientId, rootClientId ]
117
+ [ hookedBlocksForCurrentBlock, name, clientId ]
131
118
  );
132
119
 
120
+ const { getBlockIndex, getBlockCount, getBlockRootClientId } =
121
+ useSelect( blockEditorStore );
133
122
  const { insertBlock, removeBlock } = useDispatch( blockEditorStore );
134
123
 
135
124
  if ( ! hookedBlocksForCurrentBlock.length ) {
@@ -150,6 +139,10 @@ function BlockHooksControlPure( {
150
139
  );
151
140
 
152
141
  const insertBlockIntoDesignatedLocation = ( block, relativePosition ) => {
142
+ const blockIndex = getBlockIndex( clientId );
143
+ const innerBlocksLength = getBlockCount( clientId );
144
+ const rootClientId = getBlockRootClientId( clientId );
145
+
153
146
  switch ( relativePosition ) {
154
147
  case 'before':
155
148
  case 'after':
@@ -14,8 +14,10 @@ import {
14
14
  getBlockSelectors,
15
15
  } from '../components/global-styles';
16
16
  import { useStyleOverride } from './utils';
17
+ import { getValueFromObjectPath } from '../utils/object';
17
18
  import { store as blockEditorStore } from '../store';
18
19
  import { globalStylesDataKey } from '../store/private-keys';
20
+ import { unlock } from '../lock-unlock';
19
21
 
20
22
  const VARIATION_PREFIX = 'is-style-';
21
23
 
@@ -59,6 +61,197 @@ function getVariationNameFromClass( className, registeredStyles = [] ) {
59
61
  return null;
60
62
  }
61
63
 
64
+ // A helper component to apply a style override using the useStyleOverride hook.
65
+ function OverrideStyles( { override } ) {
66
+ useStyleOverride( override );
67
+ }
68
+
69
+ /**
70
+ * This component is used to generate new block style variation overrides
71
+ * based on an incoming theme config. If a matching style is found in the config,
72
+ * a new override is created and returned. The overrides can be used in conjunction with
73
+ * useStyleOverride to apply the new styles to the editor. Its use is
74
+ * subject to change.
75
+ *
76
+ * @param {Object} props Props.
77
+ * @param {Object} props.config A global styles object, containing settings and styles.
78
+ * @return {JSX.Element|undefined} An array of new block variation overrides.
79
+ */
80
+ export function __unstableBlockStyleVariationOverridesWithConfig( { config } ) {
81
+ const { getBlockStyles, overrides } = useSelect(
82
+ ( select ) => ( {
83
+ getBlockStyles: select( blocksStore ).getBlockStyles,
84
+ overrides: unlock( select( blockEditorStore ) ).getStyleOverrides(),
85
+ } ),
86
+ []
87
+ );
88
+ const { getBlockName } = useSelect( blockEditorStore );
89
+
90
+ const overridesWithConfig = useMemo( () => {
91
+ if ( ! overrides?.length ) {
92
+ return;
93
+ }
94
+ const newOverrides = [];
95
+ const overriddenClientIds = [];
96
+ for ( const [ , override ] of overrides ) {
97
+ if (
98
+ override?.variation &&
99
+ override?.clientId &&
100
+ /*
101
+ * Because this component overwrites existing style overrides,
102
+ * filter out any overrides that are already present in the store.
103
+ */
104
+ ! overriddenClientIds.includes( override.clientId )
105
+ ) {
106
+ const blockName = getBlockName( override.clientId );
107
+ const configStyles =
108
+ config?.styles?.blocks?.[ blockName ]?.variations?.[
109
+ override.variation
110
+ ];
111
+ if ( configStyles ) {
112
+ const variationConfig = {
113
+ settings: config?.settings,
114
+ // The variation style data is all that is needed to generate
115
+ // the styles for the current application to a block. The variation
116
+ // name is updated to match the instance specific class name.
117
+ styles: {
118
+ blocks: {
119
+ [ blockName ]: {
120
+ variations: {
121
+ [ `${ override.variation }-${ override.clientId }` ]:
122
+ configStyles,
123
+ },
124
+ },
125
+ },
126
+ },
127
+ };
128
+ const blockSelectors = getBlockSelectors(
129
+ getBlockTypes(),
130
+ getBlockStyles,
131
+ override.clientId
132
+ );
133
+ const hasBlockGapSupport = false;
134
+ const hasFallbackGapSupport = true;
135
+ const disableLayoutStyles = true;
136
+ const disableRootPadding = true;
137
+ const variationStyles = toStyles(
138
+ variationConfig,
139
+ blockSelectors,
140
+ hasBlockGapSupport,
141
+ hasFallbackGapSupport,
142
+ disableLayoutStyles,
143
+ disableRootPadding,
144
+ {
145
+ blockGap: false,
146
+ blockStyles: true,
147
+ layoutStyles: false,
148
+ marginReset: false,
149
+ presets: false,
150
+ rootPadding: false,
151
+ variationStyles: true,
152
+ }
153
+ );
154
+ newOverrides.push( {
155
+ id: `${ override.variation }-${ override.clientId }`,
156
+ css: variationStyles,
157
+ __unstableType: 'variation',
158
+ variation: override.variation,
159
+ // The clientId will be stored with the override and used to ensure
160
+ // the order of overrides matches the order of blocks so that the
161
+ // correct CSS cascade is maintained.
162
+ clientId: override.clientId,
163
+ } );
164
+ overriddenClientIds.push( override.clientId );
165
+ }
166
+ }
167
+ }
168
+ return newOverrides;
169
+ }, [ config, overrides, getBlockStyles, getBlockName ] );
170
+
171
+ if ( ! overridesWithConfig || ! overridesWithConfig.length ) {
172
+ return;
173
+ }
174
+
175
+ return (
176
+ <>
177
+ { overridesWithConfig.map( ( override ) => (
178
+ <OverrideStyles key={ override.id } override={ override } />
179
+ ) ) }
180
+ </>
181
+ );
182
+ }
183
+
184
+ /**
185
+ * Retrieves any variation styles data and resolves any referenced values.
186
+ *
187
+ * @param {Object} globalStyles A complete global styles object, containing settings and styles.
188
+ * @param {string} name The name of the desired block type.
189
+ * @param {variation} variation The of the block style variation to retrieve data for.
190
+ *
191
+ * @return {Object|undefined} The global styles data for the specified variation.
192
+ */
193
+ export function getVariationStylesWithRefValues(
194
+ globalStyles,
195
+ name,
196
+ variation
197
+ ) {
198
+ if ( ! globalStyles?.styles?.blocks?.[ name ]?.variations?.[ variation ] ) {
199
+ return;
200
+ }
201
+
202
+ // Helper to recursively look for `ref` values to resolve.
203
+ const replaceRefs = ( variationStyles ) => {
204
+ Object.keys( variationStyles ).forEach( ( key ) => {
205
+ const value = variationStyles[ key ];
206
+
207
+ // Only process objects.
208
+ if ( typeof value === 'object' && value !== null ) {
209
+ // Process `ref` value if present.
210
+ if ( value.ref !== undefined ) {
211
+ if (
212
+ typeof value.ref !== 'string' ||
213
+ value.ref.trim() === ''
214
+ ) {
215
+ // Remove invalid ref.
216
+ delete variationStyles[ key ];
217
+ } else {
218
+ // Resolve `ref` value.
219
+ const refValue = getValueFromObjectPath(
220
+ globalStyles,
221
+ value.ref
222
+ );
223
+
224
+ if ( refValue ) {
225
+ variationStyles[ key ] = refValue;
226
+ } else {
227
+ delete variationStyles[ key ];
228
+ }
229
+ }
230
+ } else {
231
+ // Recursively resolve `ref` values in nested objects.
232
+ replaceRefs( value );
233
+
234
+ // After recursion, if value is empty due to explicitly
235
+ // `undefined` ref value, remove it.
236
+ if ( Object.keys( value ).length === 0 ) {
237
+ delete variationStyles[ key ];
238
+ }
239
+ }
240
+ }
241
+ } );
242
+ };
243
+
244
+ // Deep clone variation node to avoid mutating it within global styles and losing refs.
245
+ const styles = JSON.parse(
246
+ JSON.stringify(
247
+ globalStyles.styles.blocks[ name ].variations[ variation ]
248
+ )
249
+ );
250
+ replaceRefs( styles );
251
+
252
+ return styles;
253
+ }
254
+
62
255
  function useBlockStyleVariation( name, variation, clientId ) {
63
256
  // Prefer global styles data in GlobalStylesContext, which are available
64
257
  // if in the site editor. Otherwise fall back to whatever is in the
@@ -73,9 +266,14 @@ function useBlockStyleVariation( name, variation, clientId ) {
73
266
  }, [] );
74
267
 
75
268
  return useMemo( () => {
76
- const styles = mergedConfig?.styles ?? globalStyles;
77
- const variationStyles =
78
- styles?.blocks?.[ name ]?.variations?.[ variation ];
269
+ const variationStyles = getVariationStylesWithRefValues(
270
+ {
271
+ settings: mergedConfig?.settings ?? globalSettings,
272
+ styles: mergedConfig?.styles ?? globalStyles,
273
+ },
274
+ name,
275
+ variation
276
+ );
79
277
 
80
278
  return {
81
279
  settings: mergedConfig?.settings ?? globalSettings,
@@ -157,6 +355,7 @@ function useBlockProps( { name, className, clientId } ) {
157
355
  id: `variation-${ clientId }`,
158
356
  css: variationStyles,
159
357
  __unstableType: 'variation',
358
+ variation,
160
359
  // The clientId will be stored with the override and used to ensure
161
360
  // the order of overrides matches the order of blocks so that the
162
361
  // correct CSS cascade is maintained.
@@ -295,26 +295,30 @@ function useDuotoneStyles( {
295
295
  return;
296
296
  }
297
297
 
298
- // Safari does not always update the duotone filter when the duotone colors
299
- // are changed. When using Safari, force the block element to be repainted by
300
- // the browser to ensure any changes are reflected visually. This logic matches
301
- // that used on the site frontend in `block-supports/duotone.php`.
298
+ // Safari does not always update the duotone filter when the duotone
299
+ // colors are changed. When using Safari, force the block element to be
300
+ // repainted by the browser to ensure any changes are reflected
301
+ // visually. This logic matches that used on the site frontend in
302
+ // `block-supports/duotone.php`.
302
303
  if ( blockElement && isSafari ) {
303
304
  const display = blockElement.style.display;
304
- // Switch to `inline-block` to force a repaint. In the editor, `inline-block`
305
- // is used instead of `none` to ensure that scroll position is not affected,
306
- // as `none` results in the editor scrolling to the top of the block.
305
+ // Switch to `inline-block` to force a repaint. In the editor,
306
+ // `inline-block` is used instead of `none` to ensure that scroll
307
+ // position is not affected, as `none` results in the editor
308
+ // scrolling to the top of the block.
307
309
  blockElement.style.display = 'inline-block';
308
- // Simply accessing el.offsetHeight flushes layout and style
309
- // changes in WebKit without having to wait for setTimeout.
310
+ // Simply accessing el.offsetHeight flushes layout and style changes
311
+ // in WebKit without having to wait for setTimeout.
310
312
  // eslint-disable-next-line no-unused-expressions
311
313
  blockElement.offsetHeight;
312
314
  blockElement.style.display = display;
313
315
  }
314
- }, [ isValidFilter, blockElement ] );
316
+ // `colors` must be a dependency so this effect runs when the colors
317
+ // change in Safari.
318
+ }, [ isValidFilter, blockElement, colors ] );
315
319
  }
316
320
 
317
- function useBlockProps( { name, style } ) {
321
+ function useBlockProps( { clientId, name, style } ) {
318
322
  const id = useInstanceId( useBlockProps );
319
323
  const selector = useMemo( () => {
320
324
  const blockType = getBlockType( name );
@@ -362,7 +366,7 @@ function useBlockProps( { name, style } ) {
362
366
  const shouldRender = selector && attribute;
363
367
 
364
368
  useDuotoneStyles( {
365
- clientId: id,
369
+ clientId,
366
370
  id: filterClass,
367
371
  selector,
368
372
  attribute,
@@ -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';
@@ -35,6 +35,23 @@ function useBlockPropsChildLayoutStyles( { style } ) {
35
35
  const id = useInstanceId( useBlockPropsChildLayoutStyles );
36
36
  const selector = `.wp-container-content-${ id }`;
37
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
+
38
55
  let css = '';
39
56
  if ( shouldRenderChildLayoutStyles ) {
40
57
  if ( selfStretch === 'fixed' && flexSize ) {
@@ -59,6 +76,19 @@ function useBlockPropsChildLayoutStyles( { style } ) {
59
76
  grid-column: span ${ columnSpan };
60
77
  }`;
61
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
+ }
62
92
  /**
63
93
  * If minimumColumnWidth is set on the parent, or if no
64
94
  * columnCount is set, the grid is responsive so a
@@ -68,16 +98,6 @@ function useBlockPropsChildLayoutStyles( { style } ) {
68
98
  ( columnSpan || columnStart ) &&
69
99
  ( minimumColumnWidth || ! columnCount )
70
100
  ) {
71
- // Check if columnSpan and columnStart are numbers so Math.max doesn't break.
72
- const columnSpanNumber = columnSpan ? parseInt( columnSpan ) : null;
73
- const columnStartNumber = columnStart
74
- ? parseInt( columnStart )
75
- : null;
76
- const highestNumber = Math.max(
77
- columnSpanNumber,
78
- columnStartNumber
79
- );
80
-
81
101
  let parentColumnValue = parseFloat( minimumColumnWidth );
82
102
  /**
83
103
  * 12rem is the default minimumColumnWidth value.
@@ -99,32 +119,29 @@ function useBlockPropsChildLayoutStyles( { style } ) {
99
119
  parentColumnUnit = 'rem';
100
120
  }
101
121
 
122
+ const highestNumber = Math.max( columnSpan, columnStart );
102
123
  const defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;
103
124
  const containerQueryValue =
104
125
  highestNumber * parentColumnValue +
105
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;
106
131
  // If a span is set we want to preserve it as long as possible, otherwise we just reset the value.
107
- const gridColumnValue = columnSpan ? '1/-1' : 'auto';
132
+ const gridColumnValue =
133
+ columnSpan && columnSpan > 1 ? '1/-1' : 'auto';
108
134
 
109
- css += `@container (max-width: ${ containerQueryValue }${ parentColumnUnit }) {
135
+ css += `@container (max-width: ${ Math.max(
136
+ containerQueryValue,
137
+ minimumContainerQueryValue
138
+ ) }${ parentColumnUnit }) {
110
139
  ${ selector } {
111
140
  grid-column: ${ gridColumnValue };
141
+ grid-row: auto;
112
142
  }
113
143
  }`;
114
144
  }
115
- if ( rowStart && rowSpan ) {
116
- css += `${ selector } {
117
- grid-row: ${ rowStart } / span ${ rowSpan };
118
- }`;
119
- } else if ( rowStart ) {
120
- css += `${ selector } {
121
- grid-row: ${ rowStart };
122
- }`;
123
- } else if ( rowSpan ) {
124
- css += `${ selector } {
125
- grid-row: span ${ rowSpan };
126
- }`;
127
- }
128
145
  }
129
146
 
130
147
  useStyleOverride( { css } );
@@ -143,7 +160,7 @@ function ChildLayoutControlsPure( { clientId, style, setAttributes } ) {
143
160
  const {
144
161
  type: parentLayoutType = 'default',
145
162
  allowSizingOnChildren = false,
146
- columnCount,
163
+ isManualPlacement,
147
164
  } = parentLayout;
148
165
 
149
166
  const rootClientId = useSelect(
@@ -160,8 +177,6 @@ function ChildLayoutControlsPure( { clientId, style, setAttributes } ) {
160
177
  return null;
161
178
  }
162
179
 
163
- const isManualGrid = !! columnCount;
164
-
165
180
  function updateLayout( layout ) {
166
181
  setAttributes( {
167
182
  style: {
@@ -190,15 +205,16 @@ function ChildLayoutControlsPure( { clientId, style, setAttributes } ) {
190
205
  parentLayout={ parentLayout }
191
206
  />
192
207
  ) }
193
- { isManualGrid && window.__experimentalEnableGridInteractivity && (
194
- <GridItemMovers
195
- layout={ style?.layout }
196
- parentLayout={ parentLayout }
197
- onChange={ updateLayout }
198
- gridClientId={ rootClientId }
199
- blockClientId={ clientId }
200
- />
201
- ) }
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
+ ) }
202
218
  </>
203
219
  );
204
220
  }