css
6 years ago
attributes.js
6 years ago
block-controls.js
6 years ago
block.js
6 years ago
edit.js
6 years ago
editor.scss
6 years ago
save.js
6 years ago
section-tag.js
6 years ago
style.scss
6 years ago
block.js
45 lines
| 1 | /** |
| 2 | * Block: Container |
| 3 | */ |
| 4 | |
| 5 | import './style.scss'; |
| 6 | import './editor.scss'; |
| 7 | import './block-controls.js'; |
| 8 | |
| 9 | import editContainer from './edit'; |
| 10 | import saveContainer from './save'; |
| 11 | import blockAttributes from './attributes'; |
| 12 | import getIcon from '../../utils/get-icon'; |
| 13 | |
| 14 | const { __ } = wp.i18n; |
| 15 | const { registerBlockType } = wp.blocks; |
| 16 | |
| 17 | /** |
| 18 | * Register our Container block. |
| 19 | * |
| 20 | * @param {string} name Block name. |
| 21 | * @param {Object} settings Block settings. |
| 22 | * @return {?WPBlock} The block, if it has been successfully |
| 23 | * registered; otherwise `undefined`. |
| 24 | */ |
| 25 | registerBlockType( 'generateblocks/container', { |
| 26 | title: __( 'Container', 'generateblocks' ), |
| 27 | description: __( 'Organize your content into rows and sections.', 'generateblocks' ), |
| 28 | icon: getIcon( 'container' ), |
| 29 | category: 'generateblocks', |
| 30 | keywords: [ |
| 31 | __( 'section' ), |
| 32 | __( 'container' ), |
| 33 | __( 'generate' ), |
| 34 | ], |
| 35 | attributes: blockAttributes, |
| 36 | supports: { |
| 37 | align: false, |
| 38 | anchor: false, |
| 39 | className: false, |
| 40 | customClassName: false, |
| 41 | }, |
| 42 | edit: editContainer, |
| 43 | save: saveContainer, |
| 44 | } ); |
| 45 |