@gem-sdk/components 2.0.0-dev.470 → 2.0.0-dev.472

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.
@@ -136,15 +136,22 @@ const CarouselSettingsV2 = [
136
136
  {
137
137
  id: 'dotStyle',
138
138
  label: 'Dot style',
139
- type: 'option:value',
139
+ type: 'option:illustration',
140
+ iconViewBox: '0 0 77 48',
141
+ enableItemBackground: true,
142
+ enableTooltip: true,
140
143
  options: [
141
144
  {
142
145
  label: 'Inside',
143
- value: 'inside'
146
+ value: 'inside',
147
+ type: 'carousel-dot',
148
+ svgName: 'gp-carousel-dot-inside'
144
149
  },
145
150
  {
146
151
  label: 'Outside',
147
- value: 'outside'
152
+ value: 'outside',
153
+ type: 'carousel-dot',
154
+ svgName: 'gp-carousel-dot-outside'
148
155
  }
149
156
  ],
150
157
  devices: {
@@ -404,7 +411,9 @@ const CarouselSettingsV2 = [
404
411
  {
405
412
  id: 'arrowGapToEachSide',
406
413
  label: 'Gap to each side',
407
- type: 'input:number',
414
+ type: 'input:slider',
415
+ min: 0,
416
+ max: 120,
408
417
  default: '16'
409
418
  },
410
419
  {
@@ -596,12 +605,16 @@ const CarouselSettingsV2 = [
596
605
  {
597
606
  id: 'playSpeed',
598
607
  label: 'Slide speed',
599
- type: 'input:unit',
608
+ type: 'input:slider',
600
609
  useOnlyUnitInit: true,
601
- min: 1,
610
+ min: 100,
611
+ max: 5000,
612
+ step: 50,
602
613
  units: [
603
614
  'ms'
604
615
  ],
616
+ showDefaultUnit: true,
617
+ isNumber: true,
605
618
  default: 500
606
619
  },
607
620
  {
@@ -73,6 +73,21 @@ const SettingUIV2 = [
73
73
  }
74
74
  ]
75
75
  },
76
+ {
77
+ label: {
78
+ en: 'Item spacing'
79
+ },
80
+ controls: [
81
+ {
82
+ label: {
83
+ en: 'Gap'
84
+ },
85
+ setting: {
86
+ id: 'spacing'
87
+ }
88
+ }
89
+ ]
90
+ },
76
91
  {
77
92
  label: {
78
93
  en: 'Item style'
@@ -109,86 +124,75 @@ const SettingUIV2 = [
109
124
  setting: {
110
125
  id: 'background'
111
126
  }
112
- },
113
- {
114
- label: {
115
- en: 'Border'
116
- },
117
- setting: {
118
- id: 'borderContent'
119
- }
120
- },
121
- {
122
- label: {
123
- en: 'Corner'
124
- },
125
- setting: {
126
- id: 'roundedContent'
127
- }
128
- },
129
- {
130
- label: {
131
- en: 'Shadow'
132
- },
133
- setting: {
134
- id: 'carouselShadow'
127
+ }
128
+ ],
129
+ moreSettings: {
130
+ controls: [
131
+ {
132
+ label: {
133
+ en: 'Border'
134
+ },
135
+ setting: {
136
+ id: 'borderContent'
137
+ }
135
138
  },
136
- options: {
137
- updateFields: [
138
- {
139
- field: 'enable',
140
- settingId: 'hasActiveShadow'
141
- }
142
- ]
139
+ {
140
+ label: {
141
+ en: 'Corner'
142
+ },
143
+ setting: {
144
+ id: 'roundedContent'
145
+ }
143
146
  },
144
- controlChangeTrigger: {
145
- settings: [
146
- {
147
- condition: `carouselShadow.enable === true`,
148
- source: [
149
- 'carouselShadow'
150
- ],
151
- action: {
152
- controlId: 'hasActiveShadow',
153
- groupType: 'style',
154
- controlType: 'style',
155
- newValue: true
147
+ {
148
+ label: {
149
+ en: 'Shadow'
150
+ },
151
+ setting: {
152
+ id: 'carouselShadow'
153
+ },
154
+ options: {
155
+ updateFields: [
156
+ {
157
+ field: 'enable',
158
+ settingId: 'hasActiveShadow'
156
159
  }
157
- },
158
- {
159
- condition: `carouselShadow.enable === false`,
160
- source: [
161
- 'carouselShadow'
162
- ],
163
- action: {
164
- controlId: 'hasActiveShadow',
165
- groupType: 'style',
166
- controlType: 'style',
167
- newValue: false
160
+ ]
161
+ },
162
+ controlChangeTrigger: {
163
+ settings: [
164
+ {
165
+ condition: `carouselShadow.enable === true`,
166
+ source: [
167
+ 'carouselShadow'
168
+ ],
169
+ action: {
170
+ controlId: 'hasActiveShadow',
171
+ groupType: 'style',
172
+ controlType: 'style',
173
+ newValue: true
174
+ }
175
+ },
176
+ {
177
+ condition: `carouselShadow.enable === false`,
178
+ source: [
179
+ 'carouselShadow'
180
+ ],
181
+ action: {
182
+ controlId: 'hasActiveShadow',
183
+ groupType: 'style',
184
+ controlType: 'style',
185
+ newValue: false
186
+ }
168
187
  }
188
+ ],
189
+ options: {
190
+ noRecordHistory: true
169
191
  }
170
- ],
171
- options: {
172
- noRecordHistory: true
173
192
  }
174
193
  }
175
- }
176
- ]
177
- },
178
- {
179
- label: {
180
- en: 'Item spacing'
181
- },
182
- controls: [
183
- {
184
- label: {
185
- en: 'Gap'
186
- },
187
- setting: {
188
- id: 'spacing'
189
- }
190
- }
191
- ]
194
+ ]
195
+ }
192
196
  },
193
197
  {
194
198
  controls: [
@@ -207,7 +211,7 @@ const SettingUIV2 = [
207
211
  {
208
212
  conditionDisplay: `navigationEnable === true`,
209
213
  label: {
210
- en: 'Layout'
214
+ en: 'Position'
211
215
  },
212
216
  setting: {
213
217
  id: 'navigationStyle'
@@ -249,7 +253,8 @@ const SettingUIV2 = [
249
253
  label: {
250
254
  en: 'Size'
251
255
  },
252
- fixedValue: 'Edit...',
256
+ fixedValue: 'Edit',
257
+ iconName: 'polaris-measurement-size',
253
258
  controls: [
254
259
  {
255
260
  setting: {
@@ -322,7 +327,7 @@ const SettingUIV2 = [
322
327
  {
323
328
  conditionDisplay: `navigationEnable === true`,
324
329
  label: {
325
- en: 'Gap to each'
330
+ en: 'Gap to edge'
326
331
  },
327
332
  setting: {
328
333
  id: 'arrowGapToEachSide'
@@ -357,7 +362,16 @@ const SettingUIV2 = [
357
362
  {
358
363
  conditionDisplay: `dot === true`,
359
364
  label: {
360
- en: 'Active color'
365
+ en: 'Position'
366
+ },
367
+ setting: {
368
+ id: 'dotStyle'
369
+ }
370
+ },
371
+ {
372
+ conditionDisplay: `dot === true`,
373
+ label: {
374
+ en: 'Active icon'
361
375
  },
362
376
  setting: {
363
377
  id: 'dotActiveColor'
@@ -366,7 +380,7 @@ const SettingUIV2 = [
366
380
  {
367
381
  conditionDisplay: `dot === true`,
368
382
  label: {
369
- en: 'Inactive color'
383
+ en: 'Inactive icon'
370
384
  },
371
385
  setting: {
372
386
  id: 'dotColor'
@@ -380,26 +394,99 @@ const SettingUIV2 = [
380
394
  setting: {
381
395
  id: 'dotSize'
382
396
  }
397
+ },
398
+ {
399
+ conditionDisplay: `dot === true`,
400
+ label: {
401
+ en: 'Gap to edge'
402
+ },
403
+ setting: {
404
+ id: 'dotGapToCarousel'
405
+ }
406
+ }
407
+ ]
408
+ },
409
+ {
410
+ label: {
411
+ en: 'Slide effect'
412
+ },
413
+ controls: [
414
+ {
415
+ label: {
416
+ en: 'Slide direction'
417
+ },
418
+ setting: {
419
+ id: 'rtl'
420
+ }
421
+ },
422
+ {
423
+ label: {
424
+ en: 'Autoplay'
425
+ },
426
+ setting: {
427
+ id: 'autoplay'
428
+ }
429
+ },
430
+ {
431
+ label: {
432
+ en: 'Time out'
433
+ },
434
+ setting: {
435
+ id: 'autoplayTimeout'
436
+ },
437
+ conditionDisplay: 'autoplay === true'
438
+ },
439
+ {
440
+ label: {
441
+ en: 'Pause On Hover'
442
+ },
443
+ setting: {
444
+ id: 'pauseOnHover'
445
+ },
446
+ conditionDisplay: 'autoplay == true'
447
+ },
448
+ {
449
+ label: {
450
+ en: 'Preview'
451
+ },
452
+ setting: {
453
+ id: 'runPreview'
454
+ },
455
+ conditionDisplay: 'autoplay === true'
456
+ },
457
+ {
458
+ label: {
459
+ en: 'Infinity loop'
460
+ },
461
+ setting: {
462
+ id: 'loop'
463
+ }
383
464
  }
384
465
  ],
385
466
  moreSettings: {
386
467
  controls: [
387
468
  {
388
- conditionDisplay: `dot === true`,
389
469
  label: {
390
- en: 'Gap to bottom'
470
+ en: 'Drag / swipe'
391
471
  },
392
472
  setting: {
393
- id: 'dotGapToCarousel'
473
+ id: 'enableDrag'
394
474
  }
395
475
  },
396
476
  {
397
- conditionDisplay: `dot === true`,
398
477
  label: {
399
- en: 'Position'
478
+ en: 'Slide speed'
479
+ },
480
+ setting: {
481
+ id: 'playSpeed'
482
+ }
483
+ },
484
+ {
485
+ label: {
486
+ en: 'Animation'
400
487
  },
401
488
  setting: {
402
- id: 'dotStyle'
489
+ id: 'animationMode'
403
490
  }
404
491
  }
405
492
  ]
@@ -415,6 +502,43 @@ const SettingUIV2 = [
415
502
  id: 'sizeSetting'
416
503
  },
417
504
  layout: 'vertical'
505
+ },
506
+ {
507
+ label: {
508
+ en: 'Padding'
509
+ },
510
+ conditionDisplay: `pageType != "POST_PURCHASE"`,
511
+ controlConfig: {
512
+ id: 'padding',
513
+ type: 'padding-v2',
514
+ linkWithSetting: {
515
+ name: 'spacing-setting',
516
+ field: 'padding'
517
+ }
518
+ }
519
+ }
520
+ ]
521
+ },
522
+ {
523
+ label: {
524
+ en: 'Background'
525
+ },
526
+ controls: [
527
+ {
528
+ label: {
529
+ en: 'Color'
530
+ },
531
+ setting: {
532
+ id: 'backgroundColor'
533
+ }
534
+ },
535
+ {
536
+ label: {
537
+ en: 'Image'
538
+ },
539
+ setting: {
540
+ id: 'backgroundImage'
541
+ }
418
542
  }
419
543
  ]
420
544
  },
@@ -497,115 +621,6 @@ const SettingUIV2 = [
497
621
  }
498
622
  ]
499
623
  },
500
- {
501
- label: {
502
- en: 'Background'
503
- },
504
- controls: [
505
- {
506
- label: {
507
- en: 'Color'
508
- },
509
- setting: {
510
- id: 'backgroundColor'
511
- }
512
- },
513
- {
514
- label: {
515
- en: 'Image'
516
- },
517
- setting: {
518
- id: 'backgroundImage'
519
- }
520
- }
521
- ]
522
- },
523
- {
524
- label: {
525
- en: 'Slide effect'
526
- },
527
- controls: [
528
- {
529
- label: {
530
- en: 'Slide direction'
531
- },
532
- setting: {
533
- id: 'rtl'
534
- }
535
- },
536
- {
537
- label: {
538
- en: 'Autoplay'
539
- },
540
- setting: {
541
- id: 'autoplay'
542
- }
543
- },
544
- {
545
- label: {
546
- en: 'Time out'
547
- },
548
- setting: {
549
- id: 'autoplayTimeout'
550
- },
551
- conditionDisplay: 'autoplay === true'
552
- },
553
- {
554
- label: {
555
- en: 'Pause On Hover'
556
- },
557
- setting: {
558
- id: 'pauseOnHover'
559
- },
560
- conditionDisplay: 'autoplay == true'
561
- },
562
- {
563
- label: {
564
- en: 'Preview'
565
- },
566
- setting: {
567
- id: 'runPreview'
568
- },
569
- conditionDisplay: 'autoplay === true'
570
- },
571
- {
572
- label: {
573
- en: 'Infinity loop'
574
- },
575
- setting: {
576
- id: 'loop'
577
- }
578
- }
579
- ],
580
- moreSettings: {
581
- controls: [
582
- {
583
- label: {
584
- en: 'Drag / swipe'
585
- },
586
- setting: {
587
- id: 'enableDrag'
588
- }
589
- },
590
- {
591
- label: {
592
- en: 'Slide speed'
593
- },
594
- setting: {
595
- id: 'playSpeed'
596
- }
597
- },
598
- {
599
- label: {
600
- en: 'Animation'
601
- },
602
- setting: {
603
- id: 'animationMode'
604
- }
605
- }
606
- ]
607
- }
608
- },
609
624
  {
610
625
  controls: [
611
626
  {
@@ -12,19 +12,30 @@ var _const = require('../../common/const.js');
12
12
  var useSticky = require('./hooks/useSticky.js');
13
13
  var system = require('@gem-sdk/system');
14
14
  var styles = require('./common/styles.js');
15
+ var classes = require('./common/classes.js');
15
16
 
16
- const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
17
- const { background, preloadBgImage } = setting ?? {};
18
- const { w, positionStyle, displayStyle, getCSSAlign } = useSticky.default(setting);
17
+ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced })=>{
18
+ const { background, preloadBgImage, width, isScrollToTop } = setting ?? {};
19
+ const { w, positionStyle, displayStyle } = useSticky.default(setting);
19
20
  const computedContainerStyles = system.createStyle({
20
21
  margin: '0 auto',
21
22
  ...w,
22
23
  ...displayStyle,
23
24
  ...styles.getStylePadding(style),
24
25
  ...positionStyle,
25
- ...getCSSAlign,
26
26
  zIndex: _const.ELEMENT_Z_INDEX.STICKY
27
27
  });
28
+ const computedContentStyles = system.createStyle(styles.getContentStyles({
29
+ width,
30
+ style,
31
+ background
32
+ }));
33
+ const computedContainerClasses = system.createClass(classes.getContainerClasses({
34
+ uid: builderProps?.uid,
35
+ isScrollToTop,
36
+ cssClass: advanced?.cssClass,
37
+ isLiquid: false
38
+ }));
28
39
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
29
40
  children: [
30
41
  !!preloadBgImage && /*#__PURE__*/ jsxRuntime.jsxs(Head, {
@@ -47,15 +58,14 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
47
58
  ]
48
59
  }),
49
60
  /*#__PURE__*/ jsxRuntime.jsx("div", {
50
- className: core.cls('sticky-wrapper', builderProps?.uid),
61
+ className: computedContainerClasses,
51
62
  id: builderProps?.uid,
52
63
  style: computedContainerStyles,
53
64
  children: /*#__PURE__*/ jsxRuntime.jsx("div", {
54
65
  ...builderAttrs,
55
66
  "data-id": builderProps?.uid,
56
67
  style: {
57
- ...styles.filterStyles(style),
58
- ...core.getStyleBackgroundByDevice(background)
68
+ ...computedContentStyles
59
69
  },
60
70
  children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
61
71
  })
@@ -6,6 +6,7 @@ var core = require('@gem-sdk/core');
6
6
  var helpers = require('../../helpers.js');
7
7
  var system = require('@gem-sdk/system');
8
8
  var styles = require('./common/styles.js');
9
+ var classes = require('./common/classes.js');
9
10
 
10
11
  const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced })=>{
11
12
  const { width, position, display, preloadBgImage, background, isScrollToTop } = setting ?? {};
@@ -16,6 +17,17 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
16
17
  style,
17
18
  display
18
19
  }));
20
+ const computedContentStyles = system.createStyle(styles.getContentStyles({
21
+ width,
22
+ style,
23
+ background
24
+ }));
25
+ const computedContainerClasses = system.createClass(classes.getContainerClasses({
26
+ uid: builderProps?.uid,
27
+ isScrollToTop,
28
+ cssClass: advanced?.cssClass,
29
+ isLiquid: true
30
+ }));
19
31
  const createDataState = system.createStateOrContext({
20
32
  uid: builderProps?.uid,
21
33
  setting: {
@@ -32,14 +44,13 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
32
44
  gp-data='${JSON.stringify(createDataState)}'
33
45
  id="${builderProps?.uid}"
34
46
  data-id="${builderProps?.uid}"
35
- class="${builderProps?.uid} ${helpers.getSettingPreloadData('gps-lazy')} ${advanced?.cssClass} ${isScrollToTop ? '!gp-pointer-events-none [&_gp-button_a]:!gp-pointer-events-auto' : ''}"
47
+ class="${computedContainerClasses} ${helpers.getSettingPreloadData('gps-lazy')}"
36
48
  style="${computedContainerStyles}"
37
49
  >
38
50
  <div ${{
39
51
  ...builderAttrs
40
52
  }} style="${{
41
- ...styles.filterStyles(style),
42
- ...core.getStyleBackgroundByDevice(background)
53
+ ...computedContentStyles
43
54
  }}">
44
55
  ${children}
45
56
  </div>
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+
5
+ const getContainerClasses = (args)=>{
6
+ const { uid, isScrollToTop, cssClass, isLiquid } = args;
7
+ const extraClass = isScrollToTop && isLiquid ? '!gp-pointer-events-none [&_gp-button_a]:!gp-pointer-events-auto' : '';
8
+ return core.composeClasses(`sticky-wrapper gp-w-full ${extraClass} ${uid} ${cssClass}`);
9
+ };
10
+
11
+ exports.getContainerClasses = getContainerClasses;