@gem-sdk/components 2.0.0-dev.391 → 2.0.0-dev.393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/form/components/form-email/FormEmail.js +29 -20
- package/dist/cjs/form/components/form-email/FormEmail.liquid.js +7 -5
- package/dist/cjs/form/components/form-email/common/composeClasses.js +11 -2
- package/dist/cjs/form/components/form-email/common/composeStyles.js +62 -2
- package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +1 -0
- package/dist/cjs/form/components/newsletter/common/composeAttrs.js +1 -2
- package/dist/cjs/form/setting/contact/ContactInitConfig.js +3 -1
- package/dist/cjs/form/setting/form-email/configs/settings.js +190 -28
- package/dist/cjs/form/setting/form-email/configs/uiV2.js +262 -18
- package/dist/cjs/form/setting/text-input/configs/settings.js +6 -3
- package/dist/cjs/form/setting/text-input/configs/uiV2.js +2 -2
- package/dist/cjs/product/setting/product-badge/configs/settings.js +6 -0
- package/dist/cjs/product/setting/product-badge/configs/uiV2.js +14 -19
- package/dist/cjs/product/setting/product-vendor/configs/settings.js +12 -0
- package/dist/cjs/product/setting/product-vendor/configs/uiV2.js +1 -1
- package/dist/cjs/sticky/components/Sticky.js +4 -4
- package/dist/cjs/sticky/components/hooks/useSticky.js +19 -9
- package/dist/esm/form/components/form-email/FormEmail.js +32 -23
- package/dist/esm/form/components/form-email/FormEmail.liquid.js +8 -6
- package/dist/esm/form/components/form-email/common/composeClasses.js +11 -3
- package/dist/esm/form/components/form-email/common/composeStyles.js +63 -4
- package/dist/esm/form/components/newsletter/Newsletter.liquid.js +1 -0
- package/dist/esm/form/components/newsletter/common/composeAttrs.js +1 -2
- package/dist/esm/form/setting/contact/ContactInitConfig.js +3 -1
- package/dist/esm/form/setting/form-email/configs/settings.js +190 -28
- package/dist/esm/form/setting/form-email/configs/uiV2.js +262 -18
- package/dist/esm/form/setting/text-input/configs/settings.js +6 -3
- package/dist/esm/form/setting/text-input/configs/uiV2.js +2 -2
- package/dist/esm/product/setting/product-badge/configs/settings.js +6 -0
- package/dist/esm/product/setting/product-badge/configs/uiV2.js +14 -19
- package/dist/esm/product/setting/product-vendor/configs/settings.js +12 -0
- package/dist/esm/product/setting/product-vendor/configs/uiV2.js +1 -1
- package/dist/esm/sticky/components/Sticky.js +4 -4
- package/dist/esm/sticky/components/hooks/useSticky.js +20 -10
- package/dist/types/index.d.ts +26 -4
- package/package.json +2 -2
|
@@ -16,10 +16,20 @@ const SettingUIV2 = [
|
|
|
16
16
|
isHideClear: true,
|
|
17
17
|
controls: [
|
|
18
18
|
{
|
|
19
|
-
|
|
19
|
+
label: {
|
|
20
|
+
en: 'Content'
|
|
21
|
+
},
|
|
20
22
|
setting: {
|
|
21
23
|
id: 'placeholder'
|
|
22
24
|
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
setting: {
|
|
28
|
+
id: 'placeholderColor'
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
en: 'Color'
|
|
32
|
+
}
|
|
23
33
|
}
|
|
24
34
|
]
|
|
25
35
|
},
|
|
@@ -40,65 +50,299 @@ const SettingUIV2 = [
|
|
|
40
50
|
label: {
|
|
41
51
|
en: 'Width'
|
|
42
52
|
},
|
|
53
|
+
controlConfig: {
|
|
54
|
+
id: 'width',
|
|
55
|
+
type: 'dropdown:input',
|
|
56
|
+
label: 'Width',
|
|
57
|
+
inputType: 'number',
|
|
58
|
+
units: [
|
|
59
|
+
'px',
|
|
60
|
+
'%'
|
|
61
|
+
],
|
|
62
|
+
hideUnit: false,
|
|
63
|
+
linkWithSetting: {
|
|
64
|
+
name: 'globalSize',
|
|
65
|
+
field: 'width'
|
|
66
|
+
},
|
|
67
|
+
displayOptions: [
|
|
68
|
+
{
|
|
69
|
+
label: 'Default',
|
|
70
|
+
value: '1200px',
|
|
71
|
+
showValue: true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: 'Full',
|
|
75
|
+
value: '100%',
|
|
76
|
+
showValue: true
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
layout: 'horizontal'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: {
|
|
84
|
+
en: 'Height'
|
|
85
|
+
},
|
|
86
|
+
controlConfig: {
|
|
87
|
+
id: 'height',
|
|
88
|
+
type: 'dropdown:input',
|
|
89
|
+
label: 'Height',
|
|
90
|
+
inputType: 'number',
|
|
91
|
+
units: [
|
|
92
|
+
'px',
|
|
93
|
+
'%'
|
|
94
|
+
],
|
|
95
|
+
hideUnit: false,
|
|
96
|
+
linkWithSetting: {
|
|
97
|
+
name: 'globalSize',
|
|
98
|
+
field: 'height'
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
layout: 'horizontal'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: {
|
|
105
|
+
en: 'Padding'
|
|
106
|
+
},
|
|
107
|
+
controlConfig: {
|
|
108
|
+
id: 'padding',
|
|
109
|
+
type: 'padding-v2',
|
|
110
|
+
linkWithSetting: {
|
|
111
|
+
name: 'globalSize',
|
|
112
|
+
field: 'padding'
|
|
113
|
+
},
|
|
114
|
+
compoDefaultValue: {
|
|
115
|
+
desktop: {
|
|
116
|
+
default: {
|
|
117
|
+
type: 'medium',
|
|
118
|
+
top: '12px',
|
|
119
|
+
bottom: '12px',
|
|
120
|
+
left: '24px',
|
|
121
|
+
right: '24px'
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
label: {
|
|
131
|
+
en: 'Background'
|
|
132
|
+
},
|
|
133
|
+
controls: [
|
|
134
|
+
{
|
|
43
135
|
setting: {
|
|
44
|
-
id: '
|
|
136
|
+
id: 'background'
|
|
137
|
+
},
|
|
138
|
+
layout: 'vertical'
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: {
|
|
144
|
+
en: 'Shape'
|
|
145
|
+
},
|
|
146
|
+
controls: [
|
|
147
|
+
{
|
|
148
|
+
label: {
|
|
149
|
+
en: 'Border'
|
|
150
|
+
},
|
|
151
|
+
controlConfig: {
|
|
152
|
+
id: 'border',
|
|
153
|
+
type: 'border-v2',
|
|
154
|
+
linkWithSetting: {
|
|
155
|
+
name: 'wrapperBorder'
|
|
156
|
+
}
|
|
45
157
|
}
|
|
46
158
|
},
|
|
47
159
|
{
|
|
48
160
|
label: {
|
|
49
|
-
en: '
|
|
161
|
+
en: 'Corner'
|
|
50
162
|
},
|
|
51
163
|
setting: {
|
|
52
|
-
id: '
|
|
164
|
+
id: 'rounded',
|
|
165
|
+
state: 'normal'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: {
|
|
170
|
+
en: 'Shadow'
|
|
171
|
+
},
|
|
172
|
+
setting: {
|
|
173
|
+
id: 'boxShadow',
|
|
174
|
+
state: 'normal'
|
|
175
|
+
},
|
|
176
|
+
options: {
|
|
177
|
+
updateFields: [
|
|
178
|
+
{
|
|
179
|
+
field: 'enable',
|
|
180
|
+
settingId: 'hasBoxShadow',
|
|
181
|
+
state: 'normal'
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
controlChangeTrigger: {
|
|
186
|
+
settings: [
|
|
187
|
+
{
|
|
188
|
+
condition: `boxShadow.normal.enable === true`,
|
|
189
|
+
source: [
|
|
190
|
+
'boxShadow',
|
|
191
|
+
'hasBoxShadow'
|
|
192
|
+
],
|
|
193
|
+
action: {
|
|
194
|
+
controlId: 'hasBoxShadow',
|
|
195
|
+
groupType: 'advanced',
|
|
196
|
+
controlType: 'advanced',
|
|
197
|
+
state: 'normal',
|
|
198
|
+
newValue: true
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
condition: `boxShadow.normal.enable === false`,
|
|
203
|
+
source: [
|
|
204
|
+
'boxShadow',
|
|
205
|
+
'hasBoxShadow'
|
|
206
|
+
],
|
|
207
|
+
action: {
|
|
208
|
+
controlId: 'hasBoxShadow',
|
|
209
|
+
groupType: 'advanced',
|
|
210
|
+
controlType: 'advanced',
|
|
211
|
+
state: 'normal',
|
|
212
|
+
newValue: false
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
options: {
|
|
217
|
+
noRecordHistory: true
|
|
218
|
+
}
|
|
53
219
|
}
|
|
54
220
|
}
|
|
55
221
|
]
|
|
56
222
|
},
|
|
57
223
|
{
|
|
58
224
|
label: {
|
|
59
|
-
en: '
|
|
225
|
+
en: 'Hover effect'
|
|
60
226
|
},
|
|
61
227
|
controls: [
|
|
62
228
|
{
|
|
63
229
|
label: {
|
|
64
|
-
en: '
|
|
230
|
+
en: 'Text color'
|
|
65
231
|
},
|
|
66
232
|
setting: {
|
|
67
|
-
id: '
|
|
233
|
+
id: 'textColorHover',
|
|
234
|
+
state: 'hover'
|
|
68
235
|
}
|
|
69
236
|
},
|
|
70
237
|
{
|
|
71
238
|
label: {
|
|
72
|
-
en: '
|
|
239
|
+
en: 'Background'
|
|
73
240
|
},
|
|
74
241
|
setting: {
|
|
75
|
-
id: '
|
|
242
|
+
id: 'backgroundColorV2Hover',
|
|
243
|
+
state: 'hover'
|
|
76
244
|
}
|
|
77
245
|
},
|
|
78
246
|
{
|
|
79
247
|
label: {
|
|
80
|
-
en: '
|
|
248
|
+
en: 'Border'
|
|
81
249
|
},
|
|
82
250
|
setting: {
|
|
83
|
-
id: '
|
|
251
|
+
id: 'borderEmailHover',
|
|
252
|
+
state: 'hover'
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
label: {
|
|
257
|
+
en: 'Corner'
|
|
258
|
+
},
|
|
259
|
+
setting: {
|
|
260
|
+
id: 'roundedEmailHover',
|
|
261
|
+
state: 'hover'
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
label: {
|
|
266
|
+
en: 'Shadow'
|
|
267
|
+
},
|
|
268
|
+
setting: {
|
|
269
|
+
id: 'boxShadowEmailHover',
|
|
270
|
+
state: 'hover'
|
|
84
271
|
}
|
|
85
272
|
}
|
|
86
273
|
]
|
|
87
274
|
},
|
|
88
275
|
{
|
|
276
|
+
label: {
|
|
277
|
+
en: 'Active state'
|
|
278
|
+
},
|
|
89
279
|
controls: [
|
|
90
280
|
{
|
|
91
281
|
label: {
|
|
92
|
-
en: '
|
|
282
|
+
en: 'Text color'
|
|
283
|
+
},
|
|
284
|
+
setting: {
|
|
285
|
+
id: 'textColorActive',
|
|
286
|
+
state: 'active'
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
label: {
|
|
291
|
+
en: 'Background'
|
|
93
292
|
},
|
|
94
|
-
conditionEnable: '!(parseInt(width) >= 100 && width?.includes("%"))',
|
|
95
293
|
setting: {
|
|
96
|
-
id: '
|
|
294
|
+
id: 'backgroundColorV2Active',
|
|
295
|
+
state: 'active'
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
label: {
|
|
300
|
+
en: 'Border'
|
|
97
301
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
302
|
+
setting: {
|
|
303
|
+
id: 'borderEmailActive',
|
|
304
|
+
state: 'active'
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
label: {
|
|
309
|
+
en: 'Corner'
|
|
310
|
+
},
|
|
311
|
+
setting: {
|
|
312
|
+
id: 'roundedEmailActive',
|
|
313
|
+
state: 'active'
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
label: {
|
|
318
|
+
en: 'Shadow'
|
|
319
|
+
},
|
|
320
|
+
setting: {
|
|
321
|
+
id: 'boxShadowEmailActive',
|
|
322
|
+
state: 'active'
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
]
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
label: {
|
|
329
|
+
en: 'Configuration'
|
|
330
|
+
},
|
|
331
|
+
controls: [
|
|
332
|
+
{
|
|
333
|
+
label: {
|
|
334
|
+
en: 'Required'
|
|
335
|
+
},
|
|
336
|
+
setting: {
|
|
337
|
+
id: 'required'
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
label: {
|
|
342
|
+
en: 'Hide on client'
|
|
343
|
+
},
|
|
344
|
+
setting: {
|
|
345
|
+
id: 'hideOnClient'
|
|
102
346
|
}
|
|
103
347
|
}
|
|
104
348
|
]
|
|
@@ -86,7 +86,10 @@ const TextInputSettings = [
|
|
|
86
86
|
label: 'Text styles',
|
|
87
87
|
type: 'typography-v2',
|
|
88
88
|
default: {
|
|
89
|
-
type: 'paragraph-1'
|
|
89
|
+
type: 'paragraph-1',
|
|
90
|
+
attrs: {
|
|
91
|
+
color: 'text-2'
|
|
92
|
+
}
|
|
90
93
|
},
|
|
91
94
|
hiddenSetting: {
|
|
92
95
|
textAlign: true,
|
|
@@ -203,8 +206,8 @@ const TextInputSettings = [
|
|
|
203
206
|
type: 'medium',
|
|
204
207
|
top: '12px',
|
|
205
208
|
bottom: '12px',
|
|
206
|
-
left: '
|
|
207
|
-
right: '
|
|
209
|
+
left: '12px',
|
|
210
|
+
right: '12px'
|
|
208
211
|
}
|
|
209
212
|
}
|
|
210
213
|
}
|
|
@@ -129,6 +129,12 @@ const ProductBadgeSettings = [
|
|
|
129
129
|
}
|
|
130
130
|
]
|
|
131
131
|
},
|
|
132
|
+
{
|
|
133
|
+
id: 'contentBanner',
|
|
134
|
+
type: 'banner',
|
|
135
|
+
message: `{inventory_quantity} Only work with product enable “Track inventory”`,
|
|
136
|
+
closable: true
|
|
137
|
+
},
|
|
132
138
|
{
|
|
133
139
|
id: 'contentType',
|
|
134
140
|
label: 'Shape',
|
|
@@ -95,6 +95,16 @@ const SettingUIV2 = [
|
|
|
95
95
|
setting: {
|
|
96
96
|
id: 'displayContent'
|
|
97
97
|
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: {
|
|
101
|
+
en: ''
|
|
102
|
+
},
|
|
103
|
+
layout: 'vertical',
|
|
104
|
+
setting: {
|
|
105
|
+
id: 'contentBanner'
|
|
106
|
+
},
|
|
107
|
+
conditionDisplay: 'displayContent.includes("{inventory_quantity}")'
|
|
98
108
|
}
|
|
99
109
|
]
|
|
100
110
|
},
|
|
@@ -349,26 +359,10 @@ const SettingUIV2 = [
|
|
|
349
359
|
},
|
|
350
360
|
controls: [
|
|
351
361
|
{
|
|
352
|
-
id: 'badge-position',
|
|
353
|
-
type: 'combo',
|
|
354
|
-
iconName: 'polaris-plus',
|
|
355
|
-
isHideClear: true,
|
|
356
|
-
fixedValue: 'Edit',
|
|
357
|
-
popoverLabel: {
|
|
358
|
-
en: 'Position'
|
|
359
|
-
},
|
|
360
|
-
label: {
|
|
361
|
-
en: 'Choose'
|
|
362
|
-
},
|
|
363
362
|
layout: 'vertical',
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
setting: {
|
|
368
|
-
id: 'position'
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
]
|
|
363
|
+
setting: {
|
|
364
|
+
id: 'position'
|
|
365
|
+
}
|
|
372
366
|
}
|
|
373
367
|
],
|
|
374
368
|
conditionDisplay: 'positionWithImage === "inside"'
|
|
@@ -391,6 +385,7 @@ const SettingUIV2 = [
|
|
|
391
385
|
en: 'Align'
|
|
392
386
|
},
|
|
393
387
|
conditionEnable: '!(parseInt(textSizeV2) >= 100 && textSizeV2?.includes("%"))',
|
|
388
|
+
conditionDisplay: 'positionWithImage === "outside"',
|
|
394
389
|
setting: {
|
|
395
390
|
id: 'align'
|
|
396
391
|
},
|
|
@@ -101,6 +101,18 @@ const ProductVendorSettings = [
|
|
|
101
101
|
},
|
|
102
102
|
ignoreReRender: true,
|
|
103
103
|
hiddenSetting: {
|
|
104
|
+
},
|
|
105
|
+
compoDefaultValue: {
|
|
106
|
+
custom: {
|
|
107
|
+
textShadow: {
|
|
108
|
+
angle: 145,
|
|
109
|
+
distance: '2px',
|
|
110
|
+
blur: '20px',
|
|
111
|
+
color: 'rgba(18, 18, 18, 0.2)',
|
|
112
|
+
type: 'custom',
|
|
113
|
+
enable: true
|
|
114
|
+
}
|
|
115
|
+
}
|
|
104
116
|
}
|
|
105
117
|
},
|
|
106
118
|
{
|
|
@@ -107,7 +107,7 @@ const SettingUIV2 = [
|
|
|
107
107
|
toggleStyle: 'switch'
|
|
108
108
|
},
|
|
109
109
|
help: {
|
|
110
|
-
content: `Click to open a collection page with all products from the same vendor.`
|
|
110
|
+
content: `Click to open a collection page with<br> all products from the same vendor.`
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
{
|
|
@@ -20,9 +20,9 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
|
|
|
20
20
|
...style,
|
|
21
21
|
...w,
|
|
22
22
|
...core.getStyleBackgroundByDevice(background),
|
|
23
|
-
...displayStyle
|
|
24
|
-
...positionStyle
|
|
25
|
-
...getCSSAlign
|
|
23
|
+
...displayStyle,
|
|
24
|
+
...positionStyle,
|
|
25
|
+
...getCSSAlign,
|
|
26
26
|
zIndex: _const.ELEMENT_Z_INDEX.STICKY
|
|
27
27
|
});
|
|
28
28
|
const computedMinimizeClasses = system.createClass(core.composeClasses('sticky-minimize gp-fixed gp-flex gp-h-[32px] gp-w-[76px] gp-cursor-pointer gp-items-center gp-gap-[4px] gp-border gp-border-[#D8E1FF] gp-bg-white hover:gp-bg-[#D8E1FF]'));
|
|
@@ -33,7 +33,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
|
|
|
33
33
|
"data-id": builderProps?.uid,
|
|
34
34
|
...builderAttrs,
|
|
35
35
|
style: {
|
|
36
|
-
...displayStyle
|
|
36
|
+
...displayStyle,
|
|
37
37
|
zIndex: _const.ELEMENT_Z_INDEX.STICKY
|
|
38
38
|
},
|
|
39
39
|
children: [
|
|
@@ -70,13 +70,17 @@ const useSticky = (setting)=>{
|
|
|
70
70
|
[`--t${device}`]: position == 'top' ? 'unset' : 'translateX(-50%)'
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
|
-
const getCSSAlign = ()=>{
|
|
73
|
+
const getCSSAlign = React.useMemo(()=>{
|
|
74
74
|
return {
|
|
75
75
|
...getCSSAlignByDevice(position?.desktop, ''),
|
|
76
76
|
...getCSSAlignByDevice(position?.tablet ?? position?.desktop, '-tablet'),
|
|
77
77
|
...getCSSAlignByDevice(position?.mobile ?? position?.desktop, '-mobile')
|
|
78
78
|
};
|
|
79
|
-
}
|
|
79
|
+
}, [
|
|
80
|
+
position?.desktop,
|
|
81
|
+
position?.mobile,
|
|
82
|
+
position?.tablet
|
|
83
|
+
]);
|
|
80
84
|
const gap = React.useMemo(()=>{
|
|
81
85
|
if (sidebarMode && position?.[currentDevice] === 'top') {
|
|
82
86
|
return '40px';
|
|
@@ -87,26 +91,32 @@ const useSticky = (setting)=>{
|
|
|
87
91
|
sidebarMode,
|
|
88
92
|
position
|
|
89
93
|
]);
|
|
90
|
-
const displayStyle = React.
|
|
94
|
+
const displayStyle = React.useMemo(()=>{
|
|
91
95
|
return {
|
|
92
96
|
[`--top`]: gap ?? 'auto',
|
|
93
97
|
[`--top-tablet`]: gap ?? 'auto',
|
|
94
98
|
[`--top-mobile`]: gap ?? 'auto',
|
|
95
|
-
[`--${position?.desktop}`]: gap ??
|
|
96
|
-
[`--${position?.tablet ?? position?.desktop}-tablet`]: gap ??
|
|
97
|
-
[`--${position?.mobile ?? position?.desktop}-mobile`]: gap ??
|
|
99
|
+
[`--${position?.desktop}`]: gap ?? '0px',
|
|
100
|
+
[`--${position?.tablet ?? position?.desktop}-tablet`]: gap ?? '0px',
|
|
101
|
+
[`--${position?.mobile ?? position?.desktop}-mobile`]: gap ?? '0px'
|
|
98
102
|
};
|
|
99
103
|
}, [
|
|
100
104
|
gap,
|
|
101
|
-
position
|
|
105
|
+
position?.desktop,
|
|
106
|
+
position?.mobile,
|
|
107
|
+
position?.tablet
|
|
102
108
|
]);
|
|
103
|
-
const positionStyle = ()=>{
|
|
109
|
+
const positionStyle = React.useMemo(()=>{
|
|
104
110
|
return {
|
|
105
111
|
[`--pos`]: getCSSPosition(position?.desktop),
|
|
106
112
|
[`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
|
|
107
113
|
[`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop)
|
|
108
114
|
};
|
|
109
|
-
}
|
|
115
|
+
}, [
|
|
116
|
+
position?.desktop,
|
|
117
|
+
position?.mobile,
|
|
118
|
+
position?.tablet
|
|
119
|
+
]);
|
|
110
120
|
return {
|
|
111
121
|
w,
|
|
112
122
|
displayStyle,
|
|
@@ -1,36 +1,45 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { createStyle, createClass } from '@gem-sdk/system';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { createStyle, createClass, If } from '@gem-sdk/system';
|
|
4
4
|
import { composeContainerStyles, composeInnerStyles } from './common/composeStyles.js';
|
|
5
|
-
import { composeContainerClasses, composeInnerClasses } from './common/composeClasses.js';
|
|
5
|
+
import { composeContainerClasses, composeInnerClasses, getClassTitle } from './common/composeClasses.js';
|
|
6
6
|
|
|
7
|
-
const FormEmail = ({ builderProps, builderAttrs, setting, advanced, children })=>{
|
|
8
|
-
const { placeholder, required, defaultEmail, hideOnClient } = setting ?? {};
|
|
7
|
+
const FormEmail = ({ builderProps, builderAttrs, setting, advanced, children, styles })=>{
|
|
8
|
+
const { placeholder, required, defaultEmail, hideOnClient, title, showTitle } = setting ?? {};
|
|
9
9
|
const name = 'contact[email]';
|
|
10
10
|
const containerStyles = createStyle(composeContainerStyles(setting, advanced));
|
|
11
|
-
const innerStyles = createStyle(composeInnerStyles(setting, advanced));
|
|
11
|
+
const innerStyles = createStyle(composeInnerStyles(setting, advanced, styles));
|
|
12
12
|
const containerClasses = createClass(composeContainerClasses(setting, advanced, builderProps));
|
|
13
|
-
const innerClasses = createClass(composeInnerClasses(setting));
|
|
14
|
-
|
|
13
|
+
const innerClasses = createClass(composeInnerClasses(setting, builderProps));
|
|
14
|
+
const classTitle = createClass(getClassTitle());
|
|
15
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
15
16
|
...builderAttrs,
|
|
16
17
|
"data-id": builderProps?.uid,
|
|
17
18
|
className: containerClasses,
|
|
18
19
|
style: containerStyles,
|
|
19
|
-
children:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
children: [
|
|
21
|
+
If(showTitle, /*#__PURE__*/ jsx("span", {
|
|
22
|
+
className: classTitle,
|
|
23
|
+
children: title
|
|
24
|
+
})),
|
|
25
|
+
/*#__PURE__*/ jsxs("div", {
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ jsx("input", {
|
|
28
|
+
type: "email",
|
|
29
|
+
className: innerClasses,
|
|
30
|
+
style: innerStyles,
|
|
31
|
+
placeholder: placeholder,
|
|
32
|
+
name: name,
|
|
33
|
+
required: required,
|
|
34
|
+
autoComplete: "email",
|
|
35
|
+
...hideOnClient && {
|
|
36
|
+
value: defaultEmail
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
children
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
]
|
|
34
43
|
});
|
|
35
44
|
};
|
|
36
45
|
|
|
@@ -2,10 +2,10 @@ import { template } from '@gem-sdk/core';
|
|
|
2
2
|
import { getDynamicSourceLocales } from '../../../helpers.js';
|
|
3
3
|
import { createStyle, createClass, If } from '@gem-sdk/system';
|
|
4
4
|
import { composeContainerStyles, composeInnerStyles } from './common/composeStyles.js';
|
|
5
|
-
import { composeContainerClasses, composeInnerClasses } from './common/composeClasses.js';
|
|
5
|
+
import { composeContainerClasses, composeInnerClasses, getClassTitle } from './common/composeClasses.js';
|
|
6
6
|
|
|
7
|
-
const FormEmail = ({ builderProps, builderAttrs, setting, advanced, pageContext })=>{
|
|
8
|
-
const { placeholder, required, hideOnClient, defaultEmail, translate } = setting ?? {};
|
|
7
|
+
const FormEmail = ({ builderProps, builderAttrs, setting, advanced, pageContext, styles })=>{
|
|
8
|
+
const { placeholder, required, hideOnClient, defaultEmail, translate, showTitle, title } = setting ?? {};
|
|
9
9
|
const name = 'contact[email]';
|
|
10
10
|
const placeholderVal = getDynamicSourceLocales({
|
|
11
11
|
val: placeholder,
|
|
@@ -15,9 +15,10 @@ const FormEmail = ({ builderProps, builderAttrs, setting, advanced, pageContext
|
|
|
15
15
|
translate
|
|
16
16
|
});
|
|
17
17
|
const containerStyles = createStyle(composeContainerStyles(setting, advanced));
|
|
18
|
-
const innerStyles = createStyle(composeInnerStyles(setting, advanced));
|
|
18
|
+
const innerStyles = createStyle(composeInnerStyles(setting, advanced, styles));
|
|
19
19
|
const containerClasses = createClass(composeContainerClasses(setting, advanced, builderProps));
|
|
20
|
-
const innerClasses = createClass(composeInnerClasses(setting));
|
|
20
|
+
const innerClasses = createClass(composeInnerClasses(setting, builderProps));
|
|
21
|
+
const classTitle = createClass(getClassTitle());
|
|
21
22
|
return template`
|
|
22
23
|
<div
|
|
23
24
|
${{
|
|
@@ -27,6 +28,7 @@ const FormEmail = ({ builderProps, builderAttrs, setting, advanced, pageContext
|
|
|
27
28
|
class="${containerClasses}"
|
|
28
29
|
style="${containerStyles}"
|
|
29
30
|
>
|
|
31
|
+
${If(showTitle, `<span className="${classTitle}">${title}</span>`)}
|
|
30
32
|
<input
|
|
31
33
|
type="email"
|
|
32
34
|
class="${innerClasses}"
|
|
@@ -35,7 +37,7 @@ const FormEmail = ({ builderProps, builderAttrs, setting, advanced, pageContext
|
|
|
35
37
|
name="${name}"
|
|
36
38
|
${If(required, 'required')}
|
|
37
39
|
autocomplete="email"
|
|
38
|
-
value="${
|
|
40
|
+
${If(hideOnClient, `value="${defaultEmail}`)}
|
|
39
41
|
></input>
|
|
40
42
|
</div>
|
|
41
43
|
`;
|