@wordpress/block-library
Version:
Block library for the WordPress editor.
45 lines (39 loc) • 901 B
JavaScript
import { __ } from '@wordpress/i18n';
import { buttons as icon } from '@wordpress/icons';
import initBlock from '../utils/init-block';
import deprecated from './deprecated';
import transforms from './transforms';
import edit from './edit';
import metadata from './block.json';
import save from './save';
const { name } = metadata;
export { metadata, name };
const TEMPLATE = [ [ 'core/button' ] ];
export const settings = {
icon,
example: {
attributes: {
layout: {
type: 'flex',
justifyContent: 'center',
},
},
innerBlocks: [
{
name: 'core/button',
attributes: { text: __( 'Find out more' ) },
},
{
name: 'core/button',
attributes: { text: __( 'Contact us' ) },
},
],
},
deprecated,
transforms,
template: TEMPLATE,
templateInsertUpdatesSelection: true,
edit,
save,
};
export const init = () => initBlock( { name, metadata, settings } );