diff --git a/packages/block-editor/src/components/off-canvas-editor/link-ui.js b/packages/block-editor/src/components/off-canvas-editor/link-ui.js index 000ffc54f0ec2..f122d9a1e698f 100644 --- a/packages/block-editor/src/components/off-canvas-editor/link-ui.js +++ b/packages/block-editor/src/components/off-canvas-editor/link-ui.js @@ -75,6 +75,7 @@ function LinkControlTransforms( { clientId } ) { const { replaceBlock } = useDispatch( blockEditorStore ); const featuredBlocks = [ + 'core/page-list', 'core/site-logo', 'core/social-links', 'core/search', diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index 02c96d2e5f61e..7e58527d947f5 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -424,6 +424,7 @@ export default function NavigationLinkEdit( { const ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu', + 'core/page-list', ]; const DEFAULT_BLOCK = { name: 'core/navigation-link', diff --git a/packages/block-library/src/navigation-link/link-ui.js b/packages/block-library/src/navigation-link/link-ui.js index 3c7387740e379..a2df4f2a29405 100644 --- a/packages/block-library/src/navigation-link/link-ui.js +++ b/packages/block-library/src/navigation-link/link-ui.js @@ -74,10 +74,12 @@ function LinkControlTransforms( { clientId } ) { const { replaceBlock } = useDispatch( blockEditorStore ); const featuredBlocks = [ + 'core/page-list', 'core/site-logo', 'core/social-links', 'core/search', ]; + const transforms = blockTransforms.filter( ( item ) => { return featuredBlocks.includes( item.name ); } ); diff --git a/packages/block-library/src/navigation-link/transforms.js b/packages/block-library/src/navigation-link/transforms.js index 7b213a4805106..fb450a13a02dc 100644 --- a/packages/block-library/src/navigation-link/transforms.js +++ b/packages/block-library/src/navigation-link/transforms.js @@ -40,6 +40,13 @@ const transforms = { return createBlock( 'core/navigation-link' ); }, }, + { + type: 'block', + blocks: [ 'core/page-list' ], + transform: () => { + return createBlock( 'core/navigation-link' ); + }, + }, ], to: [ { @@ -91,6 +98,13 @@ const transforms = { } ); }, }, + { + type: 'block', + blocks: [ 'core/page-list' ], + transform: () => { + return createBlock( 'core/page-list' ); + }, + }, ], }; diff --git a/packages/block-library/src/navigation-submenu/edit.js b/packages/block-library/src/navigation-submenu/edit.js index e4568c8d48e2d..47a222bd57bb6 100644 --- a/packages/block-library/src/navigation-submenu/edit.js +++ b/packages/block-library/src/navigation-submenu/edit.js @@ -43,7 +43,11 @@ import { name } from './block.json'; import { LinkUI } from '../navigation-link/link-ui'; import { updateAttributes } from '../navigation-link/update-attributes'; -const ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu' ]; +const ALLOWED_BLOCKS = [ + 'core/navigation-link', + 'core/navigation-submenu', + 'core/page-list', +]; const DEFAULT_BLOCK = { name: 'core/navigation-link',