diff --git a/packages/block-editor/src/components/block-navigation/block.js b/packages/block-editor/src/components/block-navigation/block.js index 967918a8e58b0e..50b8ad407c6b4a 100644 --- a/packages/block-editor/src/components/block-navigation/block.js +++ b/packages/block-editor/src/components/block-navigation/block.js @@ -49,6 +49,7 @@ export default function BlockNavigationBlock( { ); const { __experimentalWithEllipsisMenu: withEllipsisMenu, + __experimentalWithEllipsisMenuMinLevel: ellipsisMenuMinLevel, } = useBlockNavigationContext(); const ellipsisMenuClassName = classnames( 'block-editor-block-navigation-block__menu-cell', @@ -115,7 +116,7 @@ export default function BlockNavigationBlock( { ) } - { withEllipsisMenu && level > 1 && ( + { withEllipsisMenu && level >= ellipsisMenuMinLevel && ( { ( props ) => ( diff --git a/packages/block-editor/src/components/block-navigation/dropdown.js b/packages/block-editor/src/components/block-navigation/dropdown.js index ba0e824c3667c0..287a0da8cfa78c 100644 --- a/packages/block-editor/src/components/block-navigation/dropdown.js +++ b/packages/block-editor/src/components/block-navigation/dropdown.js @@ -56,6 +56,7 @@ function BlockNavigationDropdownToggle( { isEnabled, onToggle, isOpen } ) { function BlockNavigationDropdown( { isDisabled, __experimentalWithBlockNavigationSlots, + __experimentalWithEllipsisMenu, } ) { const hasBlocks = useSelect( ( select ) => !! select( 'core/block-editor' ).getBlockCount(), @@ -79,6 +80,9 @@ function BlockNavigationDropdown( { __experimentalWithBlockNavigationSlots={ __experimentalWithBlockNavigationSlots } + __experimentalWithEllipsisMenu={ + __experimentalWithEllipsisMenu + } /> ) } /> diff --git a/packages/block-editor/src/components/block-navigation/index.js b/packages/block-editor/src/components/block-navigation/index.js index e37bb3f0824692..1f7a5b20e14c6a 100644 --- a/packages/block-editor/src/components/block-navigation/index.js +++ b/packages/block-editor/src/components/block-navigation/index.js @@ -20,8 +20,9 @@ function BlockNavigation( { rootBlocks, selectedBlockClientId, selectBlock, - __experimentalWithEllipsisMenu, __experimentalWithBlockNavigationSlots, + __experimentalWithEllipsisMenu, + __experimentalWithEllipsisMenuMinLevel, } ) { if ( ! rootBlocks || rootBlocks.length === 0 ) { return null; @@ -45,6 +46,9 @@ function BlockNavigation( { __experimentalWithEllipsisMenu={ __experimentalWithEllipsisMenu } + __experimentalWithEllipsisMenuMinLevel={ + __experimentalWithEllipsisMenuMinLevel + } __experimentalWithBlockNavigationSlots={ __experimentalWithBlockNavigationSlots } @@ -59,6 +63,9 @@ function BlockNavigation( { __experimentalWithEllipsisMenu={ __experimentalWithEllipsisMenu } + __experimentalWithEllipsisMenuMinLevel={ + __experimentalWithEllipsisMenuMinLevel + } __experimentalWithBlockNavigationSlots={ __experimentalWithBlockNavigationSlots } diff --git a/packages/block-editor/src/components/block-navigation/tree.js b/packages/block-editor/src/components/block-navigation/tree.js index 4c69355d73df0e..096231e7159ecf 100644 --- a/packages/block-editor/src/components/block-navigation/tree.js +++ b/packages/block-editor/src/components/block-navigation/tree.js @@ -22,16 +22,22 @@ import { BlockNavigationContext } from './context'; export default function BlockNavigationTree( { __experimentalWithBlockNavigationSlots, __experimentalWithEllipsisMenu, + __experimentalWithEllipsisMenuMinLevel, ...props } ) { const contextValue = useMemo( () => ( { __experimentalWithBlockNavigationSlots, __experimentalWithEllipsisMenu, + __experimentalWithEllipsisMenuMinLevel: + typeof __experimentalWithEllipsisMenuMinLevel === 'number' + ? __experimentalWithEllipsisMenuMinLevel + : 0, } ), [ __experimentalWithBlockNavigationSlots, __experimentalWithEllipsisMenu, + __experimentalWithEllipsisMenuMinLevel, ] ); diff --git a/packages/block-library/src/navigation/edit.js b/packages/block-library/src/navigation/edit.js index 0ee4af72f79ecc..765458880c387d 100644 --- a/packages/block-library/src/navigation/edit.js +++ b/packages/block-library/src/navigation/edit.js @@ -86,6 +86,7 @@ function Navigation( { const { navigatorToolbarButton, navigatorModal } = useBlockNavigator( clientId, + true, true ); diff --git a/packages/edit-navigation/src/components/menu-editor/navigation-structure-panel.js b/packages/edit-navigation/src/components/menu-editor/navigation-structure-panel.js index 0c28dcf4b2916c..028dae9f1bdb47 100644 --- a/packages/edit-navigation/src/components/menu-editor/navigation-structure-panel.js +++ b/packages/edit-navigation/src/components/menu-editor/navigation-structure-panel.js @@ -27,6 +27,7 @@ export default function NavigationStructurePanel( { blocks, initialOpen } ) { selectBlock={ selectBlock } __experimentalWithBlockNavigationSlots={ true } __experimentalWithEllipsisMenu={ true } + __experimentalWithEllipsisMenuMinLevel={ 2 } showNestedBlocks showAppender showBlockMovers diff --git a/packages/edit-post/src/components/header/header-toolbar/index.js b/packages/edit-post/src/components/header/header-toolbar/index.js index 4e386d22cc4f70..e6abef155e7163 100644 --- a/packages/edit-post/src/components/header/header-toolbar/index.js +++ b/packages/edit-post/src/components/header/header-toolbar/index.js @@ -77,7 +77,10 @@ function HeaderToolbar( { onToggleInserter, isInserterOpen } ) { - + { displayBlockToolbar && (