css
6 years ago
attributes.js
6 years ago
block.js
6 years ago
deprecated.js
6 years ago
edit.js
6 years ago
editor.scss
6 years ago
markformat.js
6 years ago
save.js
6 years ago
transforms.js
6 years ago
block.js
48 lines
| 1 | /** |
| 2 | * Block: Headline |
| 3 | */ |
| 4 | |
| 5 | //import './style.scss'; |
| 6 | import './editor.scss'; |
| 7 | |
| 8 | import editHeadline from './edit'; |
| 9 | import saveHeadline from './save'; |
| 10 | import blockAttributes from './attributes'; |
| 11 | import transforms from './transforms'; |
| 12 | import deprecated from './deprecated'; |
| 13 | import getIcon from '../../utils/get-icon'; |
| 14 | |
| 15 | const { __ } = wp.i18n; |
| 16 | const { registerBlockType } = wp.blocks; |
| 17 | |
| 18 | /** |
| 19 | * Register our Headline block. |
| 20 | * |
| 21 | * @param {string} name Block name. |
| 22 | * @param {Object} settings Block settings. |
| 23 | * @return {?WPBlock} The block, if it has been successfully |
| 24 | * registered; otherwise `undefined`. |
| 25 | */ |
| 26 | registerBlockType( 'generateblocks/headline', { |
| 27 | title: __( 'Headline', 'generateblocks' ), |
| 28 | description: __( 'Craft text-rich content with advanced typography.', 'generateblocks' ), |
| 29 | icon: getIcon( 'headline' ), |
| 30 | category: 'generateblocks', |
| 31 | keywords: [ |
| 32 | __( 'heading' ), |
| 33 | __( 'headline' ), |
| 34 | __( 'title' ), |
| 35 | __( 'generate' ), |
| 36 | ], |
| 37 | attributes: blockAttributes, |
| 38 | supports: { |
| 39 | anchor: false, |
| 40 | className: false, |
| 41 | customClassName: false, |
| 42 | }, |
| 43 | edit: editHeadline, |
| 44 | save: saveHeadline, |
| 45 | transforms: transforms, |
| 46 | deprecated: deprecated, |
| 47 | } ); |
| 48 |