-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathww-config.js
164 lines (164 loc) · 6.87 KB
/
ww-config.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
export default {
editor: {
label: { en: 'Container', fr: 'Container' },
icon: 'exclamation',
deprecated: 'Use a Div or a Container from the Elements panel instead of this one.',
},
properties: {
wwObjects: {
bindable: 'repeatable',
type: 'Info',
label: {
en: 'Data to repeat',
fr: 'Données à répéter',
},
options: {
text: 'Select',
},
defaultValue: [],
},
grid: {
hidden: true,
defaultValue: [],
},
gridDisplay: {
hidden: true,
defaultValue: [],
},
direction: {
label: { en: 'Direction', fr: 'Direction' },
type: 'TextSelect',
options: {
options: [
{ value: 'row', label: { en: 'Horizontal', fr: 'Horizontal' } },
{ value: 'column', label: { en: 'Vertical', fr: 'Vertical' } },
],
},
responsive: true,
defaultValue: 'row',
},
reverse: {
label: { en: 'Reverse order', fr: "Inverser l'ordre" },
type: 'TextRadioGroup',
options: {
choices: [
{ title: 'off', value: false, default: true, label: 'Off' },
{ title: 'on', value: true, label: 'On' },
],
},
responsive: true,
defaultValue: false,
},
type: {
label: { en: 'Arrangement', fr: 'Arrangement' },
type: 'TextSelect',
hidden: content => content.direction !== 'row',
options: {
options: [
{ value: 'grid', label: { en: 'Columns', fr: 'Colonnes' } },
{ value: 'flex', label: { en: 'Row (flex)', fr: 'Row (flex)' } },
],
},
responsive: true,
defaultValue: 'grid',
},
behavior: {
hidden: content => content.direction !== 'row' || content.type !== 'grid',
label: { en: 'Line breaks (wrap)', fr: 'Line breaks (wrap)' },
type: 'TextSelect',
options: (content, sidepanelContent, boundProps) => {
const isBound = boundProps && boundProps.wwObjects;
return {
options: [
...(isBound ? [] : [{ value: 'fit', label: { en: 'Fit onto one line', fr: 'Sur une ligne' } }]),
{ value: 'wrap', label: { en: 'Wrap onto multiple lines', fr: 'A la ligne' } },
{ value: 'scroll', label: { en: 'Scroll onto one line', fr: 'Scroll sur une ligne' } },
],
};
},
responsive: true,
defaultValue: 'fit',
},
alignItems: {
label: { en: 'Vertical alignment', fr: 'Alignement vertical' },
type: 'TextRadioGroup',
hidden: content => content.direction !== 'row',
options: {
choices: [
{ value: 'flex-start', title: { en: 'Start', fr: 'Début' }, icon: 'align-y-start' },
{ value: 'center', title: { en: 'Center', fr: 'Milieu' }, icon: 'align-y-center' },
{ value: 'flex-end', title: { en: 'End', fr: 'Fin' }, icon: 'align-y-end' },
{ value: 'stretch', title: { en: 'Stretch', fr: 'Stretch' }, icon: 'align-y-stretch' },
{ value: 'baseline', title: { en: 'Baseline', fr: 'Baseline' }, icon: 'align-y-baseline' },
],
},
responsive: true,
defaultValue: 'start',
},
justifyContent: {
label: { en: 'Alignment', fr: 'Alignement' },
type: 'TextRadioGroup',
options: content => {
return {
choices:
content.direction === 'row'
? [
{ value: 'flex-start', title: { en: 'Start', fr: 'Début' }, icon: 'align-x-start' },
{ value: 'center', title: { en: 'Center', fr: 'Milieu' }, icon: 'align-x-center' },
{ value: 'flex-end', title: { en: 'End', fr: 'Fin' }, icon: 'align-x-end' },
{
value: 'space-around',
title: { en: 'Space around', fr: 'Space around' },
icon: 'align-x-space-around',
},
{
value: 'space-between',
title: { en: 'Space between', fr: 'Space between' },
icon: 'align-x-space-between',
},
]
: [
{ value: 'flex-start', title: { en: 'Start', fr: 'Début' }, icon: 'align-y-start' },
{ value: 'center', title: { en: 'Center', fr: 'Milieu' }, icon: 'align-y-center' },
{ value: 'flex-end', title: { en: 'End', fr: 'Fin' }, icon: 'align-y-end' },
{
value: 'stretch',
title: { en: 'Stretch', fr: 'Stretch' },
icon: 'align-y-stretch',
},
{
value: 'baseline',
title: { en: 'Baseline', fr: 'Baseline' },
icon: 'align-y-baseline',
},
],
};
},
responsive: true,
defaultValue: 'center',
},
pushLast: {
hidden: content => content.direction === 'row' && content.type !== 'flex',
label: { en: 'Push last to the end', fr: 'Push last to the end' },
type: 'TextRadioGroup',
options: {
choices: [
{ title: 'off', value: false, label: 'Off' },
{ title: 'on', value: true, label: 'On' },
],
},
responsive: true,
defaultValue: false,
},
lengthInUnit: {
label: { en: 'Number of units', fr: "Nb d'unité" },
type: 'Number',
options: content => ({
disabled: content.type === 'flex' || content.direction === 'column',
}),
section: 'settings',
responsive: true,
defaultValue: 100,
},
},
};