Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function LinkControlTransforms( { clientId } ) {
const { replaceBlock } = useDispatch( blockEditorStore );

const featuredBlocks = [
'core/page-list',
'core/site-logo',
'core/social-links',
'core/search',
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/navigation-link/link-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ function LinkControlTransforms( { clientId } ) {
const { replaceBlock } = useDispatch( blockEditorStore );

const featuredBlocks = [
'core/page-list',
'core/site-logo',
'core/social-links',
'core/search',
];

Comment on lines +77 to +82

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's shared this across all these blocks as a standard piece of config

const transforms = blockTransforms.filter( ( item ) => {
return featuredBlocks.includes( item.name );
} );
Expand Down
14 changes: 14 additions & 0 deletions packages/block-library/src/navigation-link/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ const transforms = {
return createBlock( 'core/navigation-link' );
},
},
{
type: 'block',
blocks: [ 'core/page-list' ],
transform: () => {
return createBlock( 'core/navigation-link' );
},
},
],
to: [
{
Expand Down Expand Up @@ -91,6 +98,13 @@ const transforms = {
} );
},
},
{
type: 'block',
blocks: [ 'core/page-list' ],
transform: () => {
return createBlock( 'core/page-list' );
},
},
],
};

Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/navigation-submenu/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down