From a78de107e45fddffc534927bb0d55370f2657b56 Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Tue, 7 May 2024 17:00:58 +1000 Subject: [PATCH] Grid interactivity: Show grid visualizer when block inspector is closed --- packages/block-editor/src/layouts/grid.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/block-editor/src/layouts/grid.js b/packages/block-editor/src/layouts/grid.js index e71e1739447aac..a6f4d595779043 100644 --- a/packages/block-editor/src/layouts/grid.js +++ b/packages/block-editor/src/layouts/grid.js @@ -68,7 +68,6 @@ export default { inspectorControls: function GridLayoutInspectorControls( { layout = {}, onChange, - clientId, layoutBlockSupport = {}, } ) { const { allowSizingOnChildren = false } = layoutBlockSupport; @@ -90,14 +89,14 @@ export default { onChange={ onChange } /> ) } - { window.__experimentalEnableGridInteractivity && ( - - ) } ); }, - toolBarControls: function GridLayoutToolbarControls() { - return null; + toolBarControls: function GridLayoutToolbarControls( { clientId } ) { + if ( ! window.__experimentalEnableGridInteractivity ) { + return null; + } + return ; }, getLayoutStyle: function getLayoutStyle( { selector, @@ -136,7 +135,7 @@ export default { } else if ( minimumColumnWidth ) { rules.push( `grid-template-columns: repeat(auto-fill, minmax(min(${ minimumColumnWidth }, 100%), 1fr))`, - `container-type: inline-size` + 'container-type: inline-size' ); }