UNPKG

@wordpress/block-library

Version:
17 lines (14 loc) 352 B
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;