-
Notifications
You must be signed in to change notification settings - Fork 145
/
index.js
75 lines (71 loc) · 1.61 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Internal dependencies
*/
import deprecated from './deprecated';
import edit from './edit';
import icon from './icon';
import metadata from './block.json';
import save from './save';
import transforms from './transforms';
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
/**
* Block constants
*/
const { name, category, attributes } = metadata;
const settings = {
/* translators: block name */
title: __( 'Alert', 'coblocks' ),
/* translators: block description */
description: __( 'Provide contextual feedback messages or notices.', 'coblocks' ),
icon,
keywords: [
'coblocks',
/* translators: block keyword */
__( 'notice', 'coblocks' ),
/* translators: block keyword */
__( 'message', 'coblocks' ),
],
styles: [
{
name: 'info',
/* translators: block style */
label: __( 'Info', 'coblocks' ),
isDefault: true,
},
{
name: 'success',
/* translators: block style */
label: __( 'Success', 'coblocks' ),
},
{
name: 'warning',
/* translators: block style */
label: __( 'Warning', 'coblocks' ),
},
{
name: 'error',
/* translators: block style */
label: __( 'Error', 'coblocks' ),
},
],
supports: {
align: true,
alignWide: false,
alignFull: false,
},
example: {
attributes: {
title: __( 'This is an alert block', 'coblocks' ),
value: __( 'An alert is a message that displays outside the flow of typical content. Alerts provide contextual feedback, typically asking readers to take an action.', 'coblocks' ),
},
},
attributes,
transforms,
edit,
save,
deprecated,
};
export { name, category, metadata, settings, attributes };