-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
88 lines (85 loc) · 2.06 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
76
77
78
79
80
81
82
83
84
85
86
87
88
import {addFilter} from '@wordpress/hooks';
import './index.scss';
const ALL_CSS_CLASSES = [
{
label: `Funky effect`,
value: 'theme-custom-effect-funky',
description: 'Makes the block appear funky.',
},
{
label: `Thick`,
category: `Text`,
value: 'theme-custom-text-thick',
description: 'Makes the block font thick.',
},
{
label: `Thin`,
category: `Text`,
value: 'theme-custom-text-thin',
description: 'Makes the block font thin.',
},
{
label: `Small`,
category: `Spacing`,
value: 'theme-custom-spacing-small',
description: 'Gives the block a small spacing.',
},
{
label: `Medium`,
category: `Spacing`,
value: 'theme-custom-spacing-medium',
description: 'Gives the block a medium spacing.',
},
{
label: `Large`,
category: `Spacing`,
value: 'theme-custom-spacing-large',
description: 'Gives the block a large spacing.',
},
{
label: `Dark`,
category: `Background`,
value: 'theme-custom-background-dark',
description: 'Gives the block a dark background.',
},
{
label: `Bright`,
category: `Background`,
value: 'theme-custom-background-bright',
description: 'Gives the block a bright background.',
},
{
label: `Dark`,
category: `Foreground`,
value: 'theme-custom-foreground-dark',
description: 'Gives the block a dark text color.',
},
{
label: `Bright`,
category: `Foreground`,
value: 'theme-custom-foreground-bright',
description: 'Gives the block a bright text color.',
},
];
addFilter(
'gutenberg-customclassname-tag-input-extension-get-configuration',
'wp-flausen',
function (configuration, blockName) {
const items = (() => {
switch (blockName) {
case 'core/quote':
return ALL_CSS_CLASSES.slice(3);
default:
return ALL_CSS_CLASSES;
}
})();
return {
...configuration,
items,
isEnum: true, // prohibit insertion of unknown class names
//disabled: true,
// readonly: true,
// canReorder: false,
};
}
);