@gem-sdk/components 2.0.0-dev.382 → 2.0.0-dev.384

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.
Files changed (30) hide show
  1. package/dist/cjs/button/setting/Button.js +1 -1
  2. package/dist/cjs/button/setting/configs/settings.js +14 -1
  3. package/dist/cjs/button/setting/configs/uiV2.js +118 -33
  4. package/dist/cjs/grid/row/commons/getStyle.js +8 -3
  5. package/dist/cjs/grid/section/setting/Section.js +4 -4
  6. package/dist/cjs/grid/section/setting/configs/settings.js +3 -3
  7. package/dist/cjs/grid/section/setting/configs/uiV2.js +9 -16
  8. package/dist/cjs/image/setting/configs/uiV2.js +45 -4
  9. package/dist/cjs/image-comparison/setting/configs/uiV2.js +44 -0
  10. package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +1 -1
  11. package/dist/cjs/product/setting/dynamic-checkout/configs/uiV2.js +118 -33
  12. package/dist/cjs/product/setting/product-button/configs/uiV2.js +86 -6
  13. package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +86 -6
  14. package/dist/cjs/sticky/setting/configs/uiV2.js +43 -3
  15. package/dist/esm/button/setting/Button.js +1 -1
  16. package/dist/esm/button/setting/configs/settings.js +14 -1
  17. package/dist/esm/button/setting/configs/uiV2.js +118 -33
  18. package/dist/esm/grid/row/commons/getStyle.js +8 -3
  19. package/dist/esm/grid/section/setting/Section.js +4 -4
  20. package/dist/esm/grid/section/setting/configs/settings.js +3 -3
  21. package/dist/esm/grid/section/setting/configs/uiV2.js +9 -16
  22. package/dist/esm/image/setting/configs/uiV2.js +45 -4
  23. package/dist/esm/image-comparison/setting/configs/uiV2.js +44 -0
  24. package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +1 -1
  25. package/dist/esm/product/setting/dynamic-checkout/configs/uiV2.js +118 -33
  26. package/dist/esm/product/setting/product-button/configs/uiV2.js +86 -6
  27. package/dist/esm/product/setting/product-view-more/configs/uiV2.js +86 -6
  28. package/dist/esm/sticky/setting/configs/uiV2.js +43 -3
  29. package/dist/types/index.d.ts +1 -0
  30. package/package.json +1 -1
@@ -156,9 +156,49 @@ const SettingUIV2 = [
156
156
  id: 'boxShadowBtnV2',
157
157
  state: 'normal'
158
158
  },
159
- controlConfig: {
160
- id: 'boxShadowBtnV2',
161
- type: 'shadow-v2'
159
+ options: {
160
+ updateFields: [
161
+ {
162
+ field: 'enable',
163
+ settingId: 'hasBoxShadowBtn',
164
+ state: 'normal'
165
+ }
166
+ ]
167
+ },
168
+ controlChangeTrigger: {
169
+ settings: [
170
+ {
171
+ condition: `boxShadowBtnV2.normal.enable === true`,
172
+ source: [
173
+ 'boxShadowBtnV2',
174
+ 'hasBoxShadowBtn'
175
+ ],
176
+ action: {
177
+ controlId: 'hasBoxShadowBtn',
178
+ groupType: 'advanced',
179
+ controlType: 'advanced',
180
+ state: 'normal',
181
+ newValue: true
182
+ }
183
+ },
184
+ {
185
+ condition: `boxShadowBtnV2.normal.enable === false`,
186
+ source: [
187
+ 'boxShadowBtnV2',
188
+ 'hasBoxShadowBtn'
189
+ ],
190
+ action: {
191
+ controlId: 'hasBoxShadowBtn',
192
+ groupType: 'advanced',
193
+ controlType: 'advanced',
194
+ state: 'normal',
195
+ newValue: false
196
+ }
197
+ }
198
+ ],
199
+ options: {
200
+ noRecordHistory: true
201
+ }
162
202
  }
163
203
  }
164
204
  ]
@@ -365,9 +405,49 @@ const SettingUIV2 = [
365
405
  id: 'boxShadowBtnV2',
366
406
  state: 'hover'
367
407
  },
368
- controlConfig: {
369
- id: 'boxShadowBtnV2',
370
- type: 'shadow-v2'
408
+ options: {
409
+ updateFields: [
410
+ {
411
+ field: 'enable',
412
+ settingId: 'hasBoxShadowBtn',
413
+ state: 'hover'
414
+ }
415
+ ]
416
+ },
417
+ controlChangeTrigger: {
418
+ settings: [
419
+ {
420
+ condition: `boxShadowBtnV2.hover.enable === true`,
421
+ source: [
422
+ 'boxShadowBtnV2',
423
+ 'hasBoxShadowBtn'
424
+ ],
425
+ action: {
426
+ controlId: 'hasBoxShadowBtn',
427
+ groupType: 'advanced',
428
+ controlType: 'advanced',
429
+ state: 'hover',
430
+ newValue: true
431
+ }
432
+ },
433
+ {
434
+ condition: `boxShadowBtnV2.hover.enable === false`,
435
+ source: [
436
+ 'boxShadowBtnV2',
437
+ 'hasBoxShadowBtn'
438
+ ],
439
+ action: {
440
+ controlId: 'hasBoxShadowBtn',
441
+ groupType: 'advanced',
442
+ controlType: 'advanced',
443
+ state: 'hover',
444
+ newValue: false
445
+ }
446
+ }
447
+ ],
448
+ options: {
449
+ noRecordHistory: true
450
+ }
371
451
  }
372
452
  }
373
453
  ]
@@ -182,9 +182,49 @@ const SettingUIV2 = [
182
182
  id: 'boxShadowBtnV2',
183
183
  state: 'normal'
184
184
  },
185
- controlConfig: {
186
- id: 'boxShadowBtnV2',
187
- type: 'shadow-v2'
185
+ options: {
186
+ updateFields: [
187
+ {
188
+ field: 'enable',
189
+ settingId: 'hasBoxShadowBtn',
190
+ state: 'normal'
191
+ }
192
+ ]
193
+ },
194
+ controlChangeTrigger: {
195
+ settings: [
196
+ {
197
+ condition: `boxShadowBtnV2.normal.enable === true`,
198
+ source: [
199
+ 'boxShadowBtnV2',
200
+ 'hasBoxShadowBtn'
201
+ ],
202
+ action: {
203
+ controlId: 'hasBoxShadowBtn',
204
+ groupType: 'advanced',
205
+ controlType: 'advanced',
206
+ state: 'normal',
207
+ newValue: true
208
+ }
209
+ },
210
+ {
211
+ condition: `boxShadowBtnV2.normal.enable === false`,
212
+ source: [
213
+ 'boxShadowBtnV2',
214
+ 'hasBoxShadowBtn'
215
+ ],
216
+ action: {
217
+ controlId: 'hasBoxShadowBtn',
218
+ groupType: 'advanced',
219
+ controlType: 'advanced',
220
+ state: 'normal',
221
+ newValue: false
222
+ }
223
+ }
224
+ ],
225
+ options: {
226
+ noRecordHistory: true
227
+ }
188
228
  }
189
229
  }
190
230
  ]
@@ -345,9 +385,49 @@ const SettingUIV2 = [
345
385
  id: 'boxShadowBtnV2',
346
386
  state: 'hover'
347
387
  },
348
- controlConfig: {
349
- id: 'boxShadowBtnV2',
350
- type: 'shadow-v2'
388
+ options: {
389
+ updateFields: [
390
+ {
391
+ field: 'enable',
392
+ settingId: 'hasBoxShadowBtn',
393
+ state: 'hover'
394
+ }
395
+ ]
396
+ },
397
+ controlChangeTrigger: {
398
+ settings: [
399
+ {
400
+ condition: `boxShadowBtnV2.hover.enable === true`,
401
+ source: [
402
+ 'boxShadowBtnV2',
403
+ 'hasBoxShadowBtn'
404
+ ],
405
+ action: {
406
+ controlId: 'hasBoxShadowBtn',
407
+ groupType: 'advanced',
408
+ controlType: 'advanced',
409
+ state: 'hover',
410
+ newValue: true
411
+ }
412
+ },
413
+ {
414
+ condition: `boxShadowBtnV2.normal.enable === false`,
415
+ source: [
416
+ 'boxShadowBtnV2',
417
+ 'hasBoxShadowBtn'
418
+ ],
419
+ action: {
420
+ controlId: 'hasBoxShadowBtn',
421
+ groupType: 'advanced',
422
+ controlType: 'advanced',
423
+ state: 'normal',
424
+ newValue: false
425
+ }
426
+ }
427
+ ],
428
+ options: {
429
+ noRecordHistory: true
430
+ }
351
431
  }
352
432
  }
353
433
  ]
@@ -97,9 +97,49 @@ const SettingUIV2 = [
97
97
  id: 'boxShadow',
98
98
  state: 'normal'
99
99
  },
100
- controlConfig: {
101
- id: 'boxShadow',
102
- type: 'shadow-v2'
100
+ options: {
101
+ updateFields: [
102
+ {
103
+ field: 'enable',
104
+ settingId: 'hasBoxShadow',
105
+ state: 'normal'
106
+ }
107
+ ]
108
+ },
109
+ controlChangeTrigger: {
110
+ settings: [
111
+ {
112
+ condition: `boxShadow.normal.enable === true`,
113
+ source: [
114
+ 'boxShadow',
115
+ 'hasBoxShadow'
116
+ ],
117
+ action: {
118
+ controlId: 'hasBoxShadow',
119
+ groupType: 'advanced',
120
+ controlType: 'advanced',
121
+ state: 'normal',
122
+ newValue: true
123
+ }
124
+ },
125
+ {
126
+ condition: `boxShadow.normal.enable === false`,
127
+ source: [
128
+ 'boxShadow',
129
+ 'hasBoxShadow'
130
+ ],
131
+ action: {
132
+ controlId: 'hasBoxShadow',
133
+ groupType: 'advanced',
134
+ controlType: 'advanced',
135
+ state: 'normal',
136
+ newValue: false
137
+ }
138
+ }
139
+ ],
140
+ options: {
141
+ noRecordHistory: true
142
+ }
103
143
  }
104
144
  }
105
145
  ]
@@ -94,7 +94,7 @@ const config = {
94
94
  desktop: 'auto'
95
95
  },
96
96
  align: {
97
- desktop: 'center'
97
+ desktop: 'left'
98
98
  }
99
99
  },
100
100
  advanced: {
@@ -250,6 +250,19 @@ const ButtonSettings = [
250
250
  hover: true
251
251
  }
252
252
  },
253
+ {
254
+ id: 'hasBoxShadowBtn',
255
+ type: 'toggle',
256
+ label: 'Enable Button Shadow',
257
+ default: {
258
+ normal: false,
259
+ hover: false
260
+ },
261
+ state: {
262
+ normal: true,
263
+ hover: true
264
+ }
265
+ },
253
266
  {
254
267
  id: 'boxShadowBtnV2',
255
268
  type: 'shadow-v2',
@@ -386,7 +399,7 @@ const ButtonSettings = [
386
399
  default: {
387
400
  type: 'paragraph-1',
388
401
  attrs: {
389
- color: 'text-1'
402
+ color: 'text-3'
390
403
  }
391
404
  },
392
405
  ignoreReRender: true,
@@ -152,9 +152,49 @@ const SettingUIV2 = [
152
152
  id: 'boxShadowBtnV2',
153
153
  state: 'normal'
154
154
  },
155
- controlConfig: {
156
- id: 'boxShadowBtnV2',
157
- type: 'shadow-v2'
155
+ options: {
156
+ updateFields: [
157
+ {
158
+ field: 'enable',
159
+ settingId: 'hasBoxShadowBtn',
160
+ state: 'normal'
161
+ }
162
+ ]
163
+ },
164
+ controlChangeTrigger: {
165
+ settings: [
166
+ {
167
+ condition: `boxShadowBtnV2.normal.enable === true`,
168
+ source: [
169
+ 'boxShadowBtnV2',
170
+ 'hasBoxShadowBtn'
171
+ ],
172
+ action: {
173
+ controlId: 'hasBoxShadowBtn',
174
+ groupType: 'advanced',
175
+ controlType: 'advanced',
176
+ state: 'normal',
177
+ newValue: true
178
+ }
179
+ },
180
+ {
181
+ condition: `boxShadowBtnV2.normal.enable === false`,
182
+ source: [
183
+ 'boxShadowBtnV2',
184
+ 'hasBoxShadowBtn'
185
+ ],
186
+ action: {
187
+ controlId: 'hasBoxShadowBtn',
188
+ groupType: 'advanced',
189
+ controlType: 'advanced',
190
+ state: 'normal',
191
+ newValue: false
192
+ }
193
+ }
194
+ ],
195
+ options: {
196
+ noRecordHistory: true
197
+ }
158
198
  }
159
199
  }
160
200
  ]
@@ -288,39 +328,84 @@ const SettingUIV2 = [
288
328
  id: 'textColorHover',
289
329
  state: 'hover'
290
330
  }
291
- },
292
- {
293
- label: {
294
- en: 'Border'
295
- },
296
- setting: {
297
- id: 'borderBtnV2',
298
- state: 'hover'
299
- }
300
- },
301
- {
302
- label: {
303
- en: 'Corner'
304
- },
305
- setting: {
306
- id: 'roundedBtnV2',
307
- state: 'hover'
308
- }
309
- },
310
- {
311
- label: {
312
- en: 'Shadow'
331
+ }
332
+ ],
333
+ moreSettings: {
334
+ type: 'collapse',
335
+ controls: [
336
+ {
337
+ label: {
338
+ en: 'Border'
339
+ },
340
+ setting: {
341
+ id: 'borderBtnV2',
342
+ state: 'hover'
343
+ }
313
344
  },
314
- setting: {
315
- id: 'boxShadowBtnV2',
316
- state: 'hover'
345
+ {
346
+ label: {
347
+ en: 'Corner'
348
+ },
349
+ setting: {
350
+ id: 'roundedBtnV2',
351
+ state: 'hover'
352
+ }
317
353
  },
318
- controlConfig: {
319
- id: 'boxShadowBtnV2',
320
- type: 'shadow-v2'
354
+ {
355
+ label: {
356
+ en: 'Shadow'
357
+ },
358
+ setting: {
359
+ id: 'boxShadowBtnV2',
360
+ state: 'hover'
361
+ },
362
+ options: {
363
+ updateFields: [
364
+ {
365
+ field: 'enable',
366
+ settingId: 'hasBoxShadowBtn',
367
+ state: 'hover'
368
+ }
369
+ ]
370
+ },
371
+ controlChangeTrigger: {
372
+ settings: [
373
+ {
374
+ condition: `boxShadowBtnV2.hover.enable === true`,
375
+ source: [
376
+ 'boxShadowBtnV2',
377
+ 'hasBoxShadowBtn'
378
+ ],
379
+ action: {
380
+ controlId: 'hasBoxShadowBtn',
381
+ groupType: 'advanced',
382
+ controlType: 'advanced',
383
+ state: 'hover',
384
+ newValue: true
385
+ }
386
+ },
387
+ {
388
+ condition: `boxShadowBtnV2.hover.enable === false`,
389
+ source: [
390
+ 'boxShadowBtnV2',
391
+ 'hasBoxShadowBtn'
392
+ ],
393
+ action: {
394
+ controlId: 'hasBoxShadowBtn',
395
+ groupType: 'advanced',
396
+ controlType: 'advanced',
397
+ state: 'hover',
398
+ newValue: false
399
+ }
400
+ }
401
+ ],
402
+ options: {
403
+ noRecordHistory: true
404
+ }
405
+ }
321
406
  }
322
- }
323
- ]
407
+ ]
408
+ }
324
409
  },
325
410
  {
326
411
  controls: [
@@ -7,7 +7,7 @@ import { createStyleObject } from './helpers.js';
7
7
  const getRowStyle = (rowProps)=>{
8
8
  const { children, setting, builderProps, styles, style, advanced, isNotFullWidth } = rowProps;
9
9
  const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
10
- const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile } = styles ?? {};
10
+ const { width, columnGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding } = styles ?? {};
11
11
  const innerRadius = getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
12
12
  const overFlowStyle = makeStyleResponsive('of', {
13
13
  desktop: innerRadius.desktop ? 'hidden' : undefined,
@@ -89,11 +89,16 @@ const getRowStyle = (rowProps)=>{
89
89
  transform: 'translateY(-50%)',
90
90
  top: '50%'
91
91
  });
92
+ const sectionPagePaddingStyle = {
93
+ desktop: enablePagePadding?.desktop ? 'var(--g-ct-p, 15px)' : undefined,
94
+ tablet: enablePagePadding?.tablet ? 'var(--g-ct-p, 15px)' : undefined,
95
+ mobile: enablePagePadding?.mobile ? 'var(--g-ct-p, 15px)' : undefined
96
+ };
92
97
  const sectionStyle = createStyle({
93
98
  ...wrapStyle,
94
99
  ...makeStyleResponsive('w', sizeStyles.wrapper),
95
- ...makeStyleResponsive('pl', sizeStyles.padding),
96
- ...makeStyleResponsive('pr', sizeStyles.padding)
100
+ ...makeStyleResponsive('pl', sectionPagePaddingStyle),
101
+ ...makeStyleResponsive('pr', sectionPagePaddingStyle)
97
102
  });
98
103
  return {
99
104
  embedVideoStyle,
@@ -24,10 +24,10 @@ const config = {
24
24
  }
25
25
  },
26
26
  styles: {
27
- fullWidth: {
28
- desktop: true,
29
- tablet: true,
30
- mobile: true
27
+ enablePagePadding: {
28
+ desktop: false,
29
+ tablet: false,
30
+ mobile: false
31
31
  }
32
32
  },
33
33
  advanced: {
@@ -144,8 +144,8 @@ const SectionSettings = [
144
144
  id: 'style',
145
145
  controls: [
146
146
  {
147
- id: 'fullWidth',
148
- label: 'Full Width',
147
+ id: 'enablePagePadding',
148
+ label: 'Page padding',
149
149
  type: 'toggle',
150
150
  devices: {
151
151
  desktop: {
@@ -172,7 +172,7 @@ const SectionSettings = [
172
172
  isRowWith: true,
173
173
  devices: {
174
174
  desktop: {
175
- default: 'default'
175
+ default: '100%'
176
176
  }
177
177
  },
178
178
  displayOptions: [
@@ -5,10 +5,7 @@ const SettingUIV2 = [
5
5
  setting: {
6
6
  id: 'layout'
7
7
  },
8
- layout: 'vertical',
9
- options: {
10
- fullWidth: true
11
- }
8
+ layout: 'vertical'
12
9
  },
13
10
  {
14
11
  label: {
@@ -17,9 +14,6 @@ const SettingUIV2 = [
17
14
  setting: {
18
15
  id: 'columnGap'
19
16
  },
20
- options: {
21
- fullWidth: true
22
- },
23
17
  conditionDisplay: `pageType == "POST_PURCHASE"`,
24
18
  conditionEnable: '!!layout.cols && layout.cols.length > 1'
25
19
  }
@@ -86,17 +80,8 @@ const SettingUIV2 = [
86
80
  en: 'Size'
87
81
  },
88
82
  controls: [
89
- {
90
- setting: {
91
- id: 'fullWidth'
92
- },
93
- label: {
94
- en: 'Full Width'
95
- }
96
- },
97
83
  {
98
84
  id: 'Width',
99
- conditionDisplay: 'fullWidth !== true',
100
85
  setting: {
101
86
  id: 'width'
102
87
  },
@@ -134,6 +119,14 @@ const SettingUIV2 = [
134
119
  }
135
120
  }
136
121
  }
122
+ },
123
+ {
124
+ setting: {
125
+ id: 'enablePagePadding'
126
+ },
127
+ label: {
128
+ en: 'Page padding'
129
+ }
137
130
  }
138
131
  ]
139
132
  },
@@ -223,11 +223,52 @@ const SettingUIV2 = [
223
223
  label: {
224
224
  en: 'Shadow'
225
225
  },
226
- controlConfig: {
226
+ setting: {
227
227
  id: 'shadow',
228
- type: 'shadow-v2',
229
- linkWithSetting: {
230
- name: 'shadow'
228
+ state: 'normal'
229
+ },
230
+ options: {
231
+ updateFields: [
232
+ {
233
+ field: 'enable',
234
+ settingId: 'hasActiveShadow',
235
+ state: 'normal'
236
+ }
237
+ ]
238
+ },
239
+ controlChangeTrigger: {
240
+ settings: [
241
+ {
242
+ condition: `shadow.normal.enable === true`,
243
+ source: [
244
+ 'shadow',
245
+ 'hasActiveShadow'
246
+ ],
247
+ action: {
248
+ controlId: 'hasActiveShadow',
249
+ groupType: 'advanced',
250
+ controlType: 'advanced',
251
+ state: 'normal',
252
+ newValue: true
253
+ }
254
+ },
255
+ {
256
+ condition: `shadow.normal.enable === false`,
257
+ source: [
258
+ 'shadow',
259
+ 'hasActiveShadow'
260
+ ],
261
+ action: {
262
+ controlId: 'hasActiveShadow',
263
+ groupType: 'advanced',
264
+ controlType: 'advanced',
265
+ state: 'normal',
266
+ newValue: false
267
+ }
268
+ }
269
+ ],
270
+ options: {
271
+ noRecordHistory: true
231
272
  }
232
273
  }
233
274
  }