@wordpress/block-library
Version:
Block library for the WordPress editor.
32 lines • 728 B
JavaScript
/**
* WordPress dependencies
*/
import { createBlock } from '@wordpress/blocks';
const transforms = {
to: [{
type: 'block',
blocks: ['core/columns'],
transform: _ref => {
let {
className,
columns,
content,
width
} = _ref;
return createBlock('core/columns', {
align: 'wide' === width || 'full' === width ? width : undefined,
className,
columns
}, content.map(_ref2 => {
let {
children
} = _ref2;
return createBlock('core/column', {}, [createBlock('core/paragraph', {
content: children
})]);
}));
}
}]
};
export default transforms;
//# sourceMappingURL=transforms.js.map