From c67302c228877e938cc6886423bec80a16d15217 Mon Sep 17 00:00:00 2001 From: "M. L. Giannotta" Date: Wed, 22 Mar 2023 16:41:28 +0100 Subject: [PATCH] Add Layout Panel slot Allows the layout panel in the Inspector Controls to be customizable. --- .../block-editor/src/components/inspector-controls/groups.js | 2 ++ packages/block-editor/src/hooks/layout.js | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/block-editor/src/components/inspector-controls/groups.js b/packages/block-editor/src/components/inspector-controls/groups.js index f1adbb66252b5f..c86d2dbb04455c 100644 --- a/packages/block-editor/src/components/inspector-controls/groups.js +++ b/packages/block-editor/src/components/inspector-controls/groups.js @@ -10,6 +10,7 @@ const InspectorControlsColor = createSlotFill( 'InspectorControlsColor' ); const InspectorControlsDimensions = createSlotFill( 'InspectorControlsDimensions' ); +const InspectorControlsLayout = createSlotFill( 'InspectorControlsLayout' ); const InspectorControlsPosition = createSlotFill( 'InspectorControlsPosition' ); const InspectorControlsTypography = createSlotFill( 'InspectorControlsTypography' @@ -23,6 +24,7 @@ const groups = { border: InspectorControlsBorder, color: InspectorControlsColor, dimensions: InspectorControlsDimensions, + layout: InspectorControlsLayout, list: InspectorControlsListView, settings: InspectorControlsDefault, // Alias for default. styles: InspectorControlsStyles, diff --git a/packages/block-editor/src/hooks/layout.js b/packages/block-editor/src/hooks/layout.js index b05068ffbbce5c..f48f4a89d40186 100644 --- a/packages/block-editor/src/hooks/layout.js +++ b/packages/block-editor/src/hooks/layout.js @@ -268,6 +268,7 @@ function LayoutPanel( { layoutBlockSupport={ layoutBlockSupport } /> ) } + { ! inherit && ! isContentLocked && layoutType && (