PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.9.0
GenerateBlocks v1.9.0
2.4.1 2.4.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 / extend / inspector-control / controls / flex-child-panel / attributes.js
generateblocks / src / extend / inspector-control / controls / flex-child-panel Last commit date
components 3 years ago attributes.js 3 years ago index.js 3 years ago
attributes.js
37 lines
1
2 export default function getFlexChildAttributes( defaults ) {
3 const options = [
4 'flexGrow',
5 'flexShrink',
6 'flexBasis',
7 'order',
8 ];
9
10 const numberOptions = [
11 'flexGrow',
12 'flexShrink',
13 'order',
14 ];
15
16 const attributes = {};
17
18 options.forEach( ( option ) => {
19 attributes[ option ] = {
20 type: numberOptions.includes( option ) ? 'number' : 'string',
21 default: defaults[ option ],
22 };
23
24 attributes[ option + 'Tablet' ] = {
25 type: numberOptions.includes( option ) ? 'number' : 'string',
26 default: defaults[ option + 'Tablet' ],
27 };
28
29 attributes[ option + 'Mobile' ] = {
30 type: numberOptions.includes( option ) ? 'number' : 'string',
31 default: defaults[ option + 'Mobile' ],
32 };
33 } );
34
35 return attributes;
36 }
37