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