Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const PluginMoreMenuGroup = ( { getFills, fillProps } ) => {
// We don't want the plugins menu items group to be rendered if there are no fills.
if ( ! getFills( SLOT_NAME ).length ) {
return null;
}
return (
);
};
export default compose( [
withContext( 'getFills' )(),
] )( PluginMoreMenuGroup );
connect(
( state, ownProps ) => {
const { uids, rootUID } = ownProps;
const block = getBlock( state, first( uids ) );
return ( {
firstIndex: getBlockIndex( state, first( uids ), rootUID ),
blockType: block ? getBlockType( block.name ) : null,
} );
},
( ...args ) => ( {
onMoveDown: createOnMove( 'MOVE_BLOCKS_DOWN', ...args ),
onMoveUp: createOnMove( 'MOVE_BLOCKS_UP', ...args ),
} )
),
withContext( 'editor' )( ( settings ) => {
const { templateLock } = settings;
return {
isLocked: templateLock === 'all',
};
} ),
withInstanceId,
)( BlockMover );
}
BlockEdit.childContextTypes = {
uid: noop,
BlockList: noop,
canUserUseUnfilteredHTML: noop,
};
export default compose( [
withSelect( ( select ) => ( {
postType: select( 'core/editor' ).getEditedPostAttribute( 'type' ),
} ) ),
withAPIData( ( { postType } ) => ( {
user: `/wp/v2/users/me?post_type=${ postType }&context=edit`,
} ) ),
withContext( 'createInnerBlockList' )(),
] )( BlockEdit );
/**
* WordPress dependencies
*/
import { withContext } from '@wordpress/components';
function InnerBlocks( { BlockList, layouts, allowedBlocks, template } ) {
return ;
}
InnerBlocks = withContext( 'BlockList' )()( InnerBlocks );
InnerBlocks.Content = ( { BlockContent } ) => {
return ;
};
InnerBlocks.Content = withContext( 'BlockContent' )()( InnerBlocks.Content );
export default InnerBlocks;
/**
* WordPress dependencies
*/
import { withContext } from '@wordpress/components';
function InnerBlocks( { BlockList, layouts, allowedBlocks, template } ) {
return ;
}
InnerBlocks = withContext( 'BlockList' )()( InnerBlocks );
InnerBlocks.Content = ( { BlockContent } ) => {
return ;
};
InnerBlocks.Content = withContext( 'BlockContent' )()( InnerBlocks.Content );
export default InnerBlocks;