2 * Registers a new block provided a unique name and an object defining its behavior.
4 * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block
6 import { registerBlockType
} from '@wordpress/blocks';
7 import { AlignmentToolbar
} from '@wordpress/block-editor';
10 * Retrieves the translation of text.
12 * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
14 import { __
} from '@wordpress/i18n';
17 * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
18 * All files containing `style` keyword are bundled together. The code used
19 * gets applied both to the front of your site and to the editor.
21 * @see https://www.npmjs.com/package/@wordpress/scripts#using-css
23 import './style.scss';
24 import './editor.scss';
27 * Internal dependencies
29 import Edit
from './edit';
30 import save
from './save';
33 * Every block starts by registering a new block type definition.
35 * @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block
37 registerBlockType( 'dnxvatar/danixland-gravatar', {
39 * This is the display title for your block, which can be translated with `i18n` functions.
40 * The block inserter will show this name.
42 title
: __( 'Gravatar', 'dnxvatar' ),
45 * This is a short description for your block, can be translated with `i18n` functions.
46 * It will be shown in the Block Tab in the Settings Sidebar.
48 description
: __( 'Insert a gravatar inside a post or page.', 'dnxvatar' ),
78 email
: 'danix@example.com',
79 alt
: 'my profile photo',
80 caption
: 'this is me',
87 * Blocks are grouped into categories to help users browse and discover them.
88 * The categories provided by core are `common`, `embed`, `formatting`, `layout` and `widgets`.
93 * An icon property should be specified to make it easier to identify a block.
94 * These can be any of WordPress’ Dashicons, or a custom svg element.
99 * Optional block extended support features.
102 // Removes support for an HTML mode.
104 align
: [ 'left', 'right', 'center' ],