PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.6.0
GenerateBlocks v1.6.0
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 / headline / block.js
generateblocks / src / blocks / headline Last commit date
components 4 years ago css 4 years ago attributes.js 4 years ago block.js 4 years ago deprecated.js 5 years ago edit.js 4 years ago editor.scss 4 years ago element-icons.js 4 years ago markformat.js 4 years ago save.js 4 years ago transforms.js 3 years ago
block.js
63 lines
1 /**
2 * Block: Headline
3 */
4
5 import './editor.scss';
6
7 import editHeadline from './edit';
8 import saveHeadline from './save';
9 import blockAttributes from './attributes';
10 import transforms from './transforms';
11 import deprecated from './deprecated';
12 import getIcon from '../../utils/get-icon';
13 import dynamicContentAttributes from '../../extend/dynamic-content/attributes';
14 import getContentTypeLabel from '../../extend/dynamic-content/utils/getContentTypeLabel';
15
16 import {
17 __,
18 } from '@wordpress/i18n';
19
20 import {
21 registerBlockType,
22 } from '@wordpress/blocks';
23
24 const attributes = Object.assign(
25 {},
26 blockAttributes,
27 dynamicContentAttributes
28 );
29
30 /**
31 * Register our Headline block.
32 *
33 * @param {string} name Block name.
34 * @param {Object} settings Block settings.
35 * @return {?WPBlock} The block, if it has been successfully
36 * registered; otherwise `undefined`.
37 */
38 registerBlockType( 'generateblocks/headline', {
39 apiVersion: 2,
40 title: __( 'Headline', 'generateblocks' ),
41 description: __( 'Craft text-rich content with advanced typography.', 'generateblocks' ),
42 icon: getIcon( 'headline' ),
43 category: 'generateblocks',
44 keywords: [
45 __( 'heading' ),
46 __( 'headline' ),
47 __( 'title' ),
48 __( 'generate' ),
49 ],
50 attributes,
51 supports: {
52 className: false,
53 },
54 edit: editHeadline,
55 save: saveHeadline,
56 transforms,
57 deprecated,
58 usesContext: [ 'postId', 'postType', 'generateblocks/dynamicImage', 'generateblocks/mediaId' ],
59 __experimentalLabel: ( attrs ) => (
60 getContentTypeLabel( attrs, __( 'Headline', 'generateblocks' ) )
61 ),
62 } );
63