-
Notifications
You must be signed in to change notification settings - Fork 1
/
blocks.js
70 lines (59 loc) · 1.61 KB
/
blocks.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
/**
* WordPress dependencies
*/
const { registerBlockType } = wp.blocks;
// Category slug and title
const category = {
slug: 'coblocks',
title: 'CoBlocks',
};
// Custom foreground icon color based on the CoBlocks branding
const iconColor = '#1e35b9';
// Register block category
import icons from './utils/block-category';
// Editor and Frontend Styles
import './styles/editor.scss';
import './styles/style.scss';
// Extensions
// import './extensions/colors/inspector';
import './extensions/attributes';
// import './extensions/advanced-controls';
// import './extensions/list-styles';
// import './extensions/button-styles';
// import './extensions/button-controls';
// Formats
import './formats/';
// Block Gallery
import './components/block-gallery';
// Register Blocks
import * as buttons from './blocks/buttons';
import * as clickToTweet from './blocks/click-to-tweet';
import * as dynamicSeparator from './blocks/dynamic-separator';
import * as pricingTable from './blocks/pricing-table';
import * as pricingTableItem from './blocks/pricing-table/pricing-table-item';
import * as hero from './blocks/hero';
import * as stacked from './blocks/gallery-stacked';
import * as masonry from './blocks/gallery-masonry';
export function registerBlocks() {
[
buttons,
clickToTweet,
dynamicSeparator,
hero,
masonry,
pricingTable,
pricingTableItem,
stacked,
].forEach(block => {
if (!block) {
return;
}
const { name, icon, settings } = block;
registerBlockType(`coblocks/${name}`, {
category: category.slug,
icon: { src: icon, foreground: iconColor },
...settings,
});
});
}
registerBlocks();