@wordpress/block-library
Version:
Block library for the WordPress editor.
20 lines (17 loc) • 386 B
JavaScript
/**
* WordPress dependencies
*/
import { createBlock, cloneBlock } from '@wordpress/blocks';
const transforms = {
to: [
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ( attributes, innerBlocks = [] ) => [
createBlock( 'core/paragraph', attributes ),
...innerBlocks.map( ( block ) => cloneBlock( block ) ),
],
},
],
};
export default transforms;