diff --git a/packages/block-editor/src/components/block-tools/block-selection-button.js b/packages/block-editor/src/components/block-tools/block-selection-button.js index 29cfdf2170817..f38cc66f8703e 100644 --- a/packages/block-editor/src/components/block-tools/block-selection-button.js +++ b/packages/block-editor/src/components/block-tools/block-selection-button.js @@ -290,6 +290,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) { diff --git a/packages/block-editor/src/components/inserter/index.js b/packages/block-editor/src/components/inserter/index.js index c048ee7b3b138..ceb3e3f0aaaf0 100644 --- a/packages/block-editor/src/components/inserter/index.js +++ b/packages/block-editor/src/components/inserter/index.js @@ -46,7 +46,7 @@ const defaultRenderToggle = ( { blockTitle ); } else if ( ! label && prioritizePatterns ) { - label = __( 'Add pattern' ); + label = __( 'Add section' ); } else if ( ! label ) { label = _x( 'Add block', 'Generic label for block inserter button' ); } diff --git a/packages/block-editor/src/components/list-view/branch.js b/packages/block-editor/src/components/list-view/branch.js index e2e27f5f2cb5a..741d74361b106 100644 --- a/packages/block-editor/src/components/list-view/branch.js +++ b/packages/block-editor/src/components/list-view/branch.js @@ -105,12 +105,17 @@ function ListViewBranch( props ) { const parentBlockInformation = useBlockDisplayInformation( parentId ); const syncedBranch = isSyncedBranch || !! parentBlockInformation?.isSynced; - const canParentExpand = useSelect( + const { canParentExpand, getBlockById } = useSelect( ( select ) => { - if ( ! parentId ) { - return true; - } - return select( blockEditorStore ).canEditBlock( parentId ); + const { canEditBlock, getBlockParents, getBlockName, getBlock } = + select( blockEditorStore ); + + return { + canParentExpand: canEditBlock( parentId ), + getBlocksParents: getBlockParents, + getName: getBlockName, + getBlockById: getBlock, + }; }, [ parentId ] ); @@ -132,6 +137,10 @@ function ListViewBranch( props ) { return ( <> { filteredBlocks.map( ( block, index ) => { + const isContentSection = + getBlockById( block.clientId )?.attributes?.tagName === + 'main'; + const { clientId, innerBlocks } = block; if ( index > 0 ) { @@ -154,7 +163,8 @@ function ListViewBranch( props ) { const hasNestedBlocks = !! innerBlocks?.length; const shouldExpand = - hasNestedBlocks && shouldShowInnerBlocks + hasNestedBlocks && + ( shouldShowInnerBlocks || isContentSection ) ? expandedState[ clientId ] ?? isExpanded : undefined; @@ -221,6 +231,7 @@ function ListViewBranch( props ) { selectedClientIds={ selectedClientIds } isExpanded={ isExpanded } isSyncedBranch={ syncedBranch } + shouldShowInnerBlocks={ shouldShowInnerBlocks } /> ) } diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index c0441cd3b3755..4725212544f36 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -2846,9 +2846,14 @@ export function __unstableHasActiveBlockOverlayActive( state, clientId ) { // In zoom-out mode, the block overlay is always active for top level blocks. if ( - editorMode === 'zoom-out' && - clientId && - ! getBlockRootClientId( state, clientId ) + ( editorMode === 'zoom-out' && + clientId && + ! getBlockRootClientId( state, clientId ) && + ! getBlock( state, clientId )?.attributes?.tagName === 'main' ) || + getBlockParents( state, clientId )?.find( + ( parentId ) => + getBlock( state, parentId )?.attributes?.tagName === 'main' + ) ) { return true; }