PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.5.2
GenerateBlocks v1.5.2
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / blocks / container / block.js
generateblocks / src / blocks / container Last commit date
components 4 years ago css 4 years ago attributes.js 4 years ago block-controls.js 4 years ago block.js 4 years ago deprecated.js 5 years ago edit.js 4 years ago editor.scss 4 years ago
block.js
57 lines
1 /**
2 * Block: Container
3 */
4
5 import './editor.scss';
6 import './block-controls.js';
7
8 import containerEdit from './edit';
9 import blockAttributes from './attributes';
10 import deprecated from './deprecated';
11 import getIcon from '../../utils/get-icon';
12 import { __ } from '@wordpress/i18n';
13 import { registerBlockType } from '@wordpress/blocks';
14 import { InnerBlocks } from '@wordpress/block-editor';
15 import dynamicContentAttributes from '../../extend/dynamic-content/attributes';
16
17 const attributes = Object.assign(
18 {},
19 blockAttributes,
20 dynamicContentAttributes
21 );
22
23 /**
24 * Register our Container block.
25 *
26 * @param {string} name Block name.
27 * @param {Object} settings Block settings.
28 * @return {?WPBlock} The block, if it has been successfully
29 * registered; otherwise `undefined`.
30 */
31 registerBlockType( 'generateblocks/container', {
32 apiVersion: 2,
33 title: __( 'Container', 'generateblocks' ),
34 description: __( 'Organize your content into rows and sections.', 'generateblocks' ),
35 icon: getIcon( 'container' ),
36 category: 'generateblocks',
37 keywords: [
38 __( 'section' ),
39 __( 'container' ),
40 __( 'generate' ),
41 ],
42 attributes,
43 supports: {
44 align: false,
45 className: false,
46 html: false,
47 },
48 usesContext: [ 'postId', 'postType', 'generateblocks/queryId' ],
49 edit: containerEdit,
50 save: () => {
51 return (
52 <InnerBlocks.Content />
53 );
54 },
55 deprecated,
56 } );
57