@gem-sdk/components 2.0.0-dev.369 → 2.0.0-dev.370

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.
@@ -9,6 +9,194 @@ const uiV2 = [
9
9
  },
10
10
  setting: {
11
11
  id: 'readMoreType'
12
+ },
13
+ layout: 'vertical',
14
+ controlChangeTrigger: {
15
+ settings: [
16
+ {
17
+ condition: `readMoreType === 'outline'`,
18
+ source: [
19
+ 'readMoreType'
20
+ ],
21
+ action: {
22
+ controlId: 'borderBtnV2',
23
+ groupType: 'style',
24
+ controlType: 'style',
25
+ newValue: {
26
+ normal: {
27
+ border: 'solid',
28
+ color: '#121212',
29
+ width: '1px',
30
+ borderWidth: '1px',
31
+ borderType: '1px'
32
+ },
33
+ hover: {
34
+ border: 'solid',
35
+ color: '#121212',
36
+ width: '1px',
37
+ borderWidth: '1px',
38
+ borderType: '1px'
39
+ }
40
+ }
41
+ }
42
+ },
43
+ {
44
+ condition: `readMoreType === 'button'`,
45
+ source: [
46
+ 'readMoreType'
47
+ ],
48
+ action: {
49
+ controlId: 'roundedBtnV2',
50
+ groupType: 'style',
51
+ controlType: 'style',
52
+ newValue: {
53
+ normal: {},
54
+ hover: {}
55
+ }
56
+ }
57
+ },
58
+ {
59
+ condition: `readMoreType === 'outline'`,
60
+ source: [
61
+ 'readMoreType'
62
+ ],
63
+ action: {
64
+ controlId: 'backgroundColorV2',
65
+ groupType: 'style',
66
+ controlType: 'style',
67
+ newValue: {
68
+ normal: '#212121',
69
+ hover: '#303030'
70
+ }
71
+ }
72
+ },
73
+ {
74
+ condition: `readMoreType === 'button' || readMoreType === 'rounded'`,
75
+ source: [
76
+ 'readMoreType'
77
+ ],
78
+ action: {
79
+ controlId: 'backgroundColorV2',
80
+ groupType: 'style',
81
+ controlType: 'style',
82
+ newValue: {
83
+ normal: '#212121',
84
+ hover: '#303030'
85
+ }
86
+ }
87
+ },
88
+ {
89
+ condition: `readMoreType === 'outline'`,
90
+ source: [
91
+ 'readMoreType'
92
+ ],
93
+ action: {
94
+ controlId: 'borderBtnV2',
95
+ groupType: 'style',
96
+ controlType: 'style',
97
+ newValue: {
98
+ normal: {},
99
+ hover: {}
100
+ }
101
+ }
102
+ },
103
+ {
104
+ condition: `readMoreType === 'outline'`,
105
+ source: [
106
+ 'readMoreType'
107
+ ],
108
+ action: {
109
+ controlId: 'backgroundColorV2',
110
+ groupType: 'style',
111
+ controlType: 'style',
112
+ newValue: {
113
+ normal: 'transparent',
114
+ hover: '#ECECEC'
115
+ }
116
+ }
117
+ },
118
+ {
119
+ condition: `readMoreType === 'rounded'`,
120
+ source: [
121
+ 'readMoreType'
122
+ ],
123
+ action: {
124
+ controlId: 'roundedBtnV2',
125
+ groupType: 'style',
126
+ controlType: 'style',
127
+ newValue: {
128
+ normal: {
129
+ btrr: '99999px',
130
+ bblr: '99999px',
131
+ bbrr: '99999px',
132
+ btlr: '99999px',
133
+ radiusType: 'circle'
134
+ },
135
+ hover: {
136
+ btrr: '99999px',
137
+ bblr: '99999px',
138
+ bbrr: '99999px',
139
+ btlr: '99999px',
140
+ radiusType: 'circle'
141
+ }
142
+ }
143
+ }
144
+ },
145
+ {
146
+ condition: `readMoreType === 'rounded'`,
147
+ source: [
148
+ 'readMoreType'
149
+ ],
150
+ action: {
151
+ controlId: 'roundedBtnV2',
152
+ groupType: 'style',
153
+ controlType: 'style',
154
+ newValue: {
155
+ normal: {
156
+ btrr: '99999px',
157
+ bblr: '99999px',
158
+ bbrr: '99999px',
159
+ btlr: '99999px',
160
+ radiusType: 'circle'
161
+ },
162
+ hover: {
163
+ btrr: '99999px',
164
+ bblr: '99999px',
165
+ bbrr: '99999px',
166
+ btlr: '99999px',
167
+ radiusType: 'circle'
168
+ }
169
+ }
170
+ }
171
+ },
172
+ {
173
+ condition: `readMoreType !== 'rounded'`,
174
+ source: [
175
+ 'readMoreType'
176
+ ],
177
+ action: {
178
+ controlId: 'roundedBtnV2',
179
+ groupType: 'style',
180
+ controlType: 'style',
181
+ newValue: {
182
+ normal: {},
183
+ hover: {}
184
+ }
185
+ }
186
+ }
187
+ ],
188
+ options: {
189
+ noRecordHistory: true
190
+ }
191
+ }
192
+ },
193
+ {
194
+ label: {
195
+ en: 'Content'
196
+ },
197
+ conditionDisplay: `readMoreType === 'text'`,
198
+ setting: {
199
+ id: 'label'
12
200
  }
13
201
  }
14
202
  ]
@@ -17,7 +205,7 @@ const uiV2 = [
17
205
  label: {
18
206
  en: 'Size'
19
207
  },
20
- conditionDisplay: `readMoreType == 'button'`,
208
+ conditionDisplay: `readMoreType !== 'text'`,
21
209
  controls: [
22
210
  {
23
211
  id: 'Width',
@@ -106,79 +294,6 @@ const uiV2 = [
106
294
  }
107
295
  ]
108
296
  },
109
- {
110
- label: {
111
- en: 'Background'
112
- },
113
- controls: [
114
- {
115
- setting: {
116
- id: 'backgroundColor'
117
- },
118
- layout: 'vertical'
119
- }
120
- ]
121
- },
122
- {
123
- conditionDisplay: `readMoreType == 'button'`,
124
- controls: [
125
- {
126
- label: {
127
- en: 'Icon'
128
- },
129
- setting: {
130
- id: 'iconVisible'
131
- },
132
- options: {
133
- labelVariant: 'primary',
134
- toggleStyle: 'switch'
135
- }
136
- }
137
- ]
138
- },
139
- {
140
- label: {
141
- en: 'Text style'
142
- },
143
- conditionDisplay: `readMoreType == 'button'`,
144
- controls: [
145
- {
146
- id: 'typo',
147
- label: {
148
- en: 'Basic'
149
- },
150
- setting: {
151
- id: 'typoBtn'
152
- },
153
- options: {
154
- hideLabel: true,
155
- fullWidth: true,
156
- updateFields: [
157
- {
158
- field: 'attrs.textAlign',
159
- settingId: 'textAlign'
160
- }
161
- ]
162
- },
163
- layout: 'vertical',
164
- controlChangeTrigger: {
165
- settings: [
166
- {
167
- action: {
168
- controlId: 'textAlign',
169
- valueFromField: 'attrs.textAlign',
170
- groupType: 'style',
171
- controlType: 'style'
172
- }
173
- }
174
- ],
175
- options: {
176
- noRecordHistory: true
177
- }
178
- }
179
- }
180
- ]
181
- },
182
297
  {
183
298
  label: {
184
299
  en: 'Size'
@@ -287,11 +402,154 @@ const uiV2 = [
287
402
  }
288
403
  ]
289
404
  },
405
+ {
406
+ label: {
407
+ en: 'Background'
408
+ },
409
+ controls: [
410
+ {
411
+ label: {
412
+ en: 'Color'
413
+ },
414
+ setting: {
415
+ id: 'backgroundColorV2',
416
+ state: 'normal'
417
+ }
418
+ },
419
+ {
420
+ label: {
421
+ en: 'Image'
422
+ },
423
+ setting: {
424
+ id: 'backgroundImage',
425
+ state: 'normal'
426
+ }
427
+ }
428
+ ]
429
+ },
430
+ {
431
+ label: {
432
+ en: 'Shape'
433
+ },
434
+ controls: [
435
+ {
436
+ label: {
437
+ en: 'Border'
438
+ },
439
+ setting: {
440
+ id: 'borderBtnV2',
441
+ state: 'normal'
442
+ }
443
+ },
444
+ {
445
+ label: {
446
+ en: 'Corner'
447
+ },
448
+ setting: {
449
+ id: 'roundedBtnV2',
450
+ state: 'normal'
451
+ }
452
+ },
453
+ {
454
+ label: {
455
+ en: 'Shadow'
456
+ },
457
+ setting: {
458
+ id: 'boxShadowBtnV2',
459
+ state: 'normal'
460
+ },
461
+ controlConfig: {
462
+ id: 'boxShadowBtnV2',
463
+ type: 'shadow-v2'
464
+ }
465
+ }
466
+ ]
467
+ },
468
+ {
469
+ controls: [
470
+ {
471
+ label: {
472
+ en: 'Icon'
473
+ },
474
+ setting: {
475
+ id: 'iconVisible'
476
+ },
477
+ options: {
478
+ labelVariant: 'primary',
479
+ toggleStyle: 'switch'
480
+ }
481
+ },
482
+ {
483
+ label: {
484
+ en: 'Icon'
485
+ },
486
+ setting: {
487
+ id: 'iconSvg'
488
+ },
489
+ conditionDisplay: 'iconVisible == true'
490
+ },
491
+ // {
492
+ // label: {
493
+ // en: 'Icon',
494
+ // },
495
+ // controlConfig: {
496
+ // id: 'iconColor',
497
+ // type: 'color-picker-v2',
498
+ // linkWithSetting: {
499
+ // name: 'textColorTextState',
500
+ // field: 'normal',
501
+ // },
502
+ // },
503
+ // conditionDisplay: 'iconVisible == true',
504
+ // },
505
+ // {
506
+ // label: {
507
+ // en: 'Size',
508
+ // },
509
+ // conditionDisplay: 'iconVisible == true',
510
+ // controlConfig: {
511
+ // id: 'iconSize',
512
+ // type: 'input:stepper',
513
+ // includeUnit: 'px',
514
+ // linkWithSetting: {
515
+ // name: 'iconSize',
516
+ // field: 'width',
517
+ // },
518
+ // compoDefaultValue: {
519
+ // default: {
520
+ // value: 16,
521
+ // unit: 'px',
522
+ // },
523
+ // },
524
+ // },
525
+ // },
526
+ {
527
+ type: 'control',
528
+ label: {
529
+ en: 'Position'
530
+ },
531
+ setting: {
532
+ id: 'iconAlign'
533
+ },
534
+ conditionDisplay: 'iconVisible == true'
535
+ },
536
+ {
537
+ type: 'control',
538
+ label: {
539
+ en: 'Gap'
540
+ },
541
+ setting: {
542
+ id: 'spacing'
543
+ },
544
+ conditionDisplay: 'iconVisible == true'
545
+ }
546
+ ]
547
+ },
290
548
  {
291
549
  label: {
292
550
  en: 'Text style'
293
551
  },
294
- conditionDisplay: `readMoreType == 'text'`,
552
+ conditionDisplay: `readMoreType !== 'text'`,
295
553
  controls: [
296
554
  {
297
555
  id: 'typo',
@@ -299,7 +557,7 @@ const uiV2 = [
299
557
  en: 'Basic'
300
558
  },
301
559
  setting: {
302
- id: 'typoText'
560
+ id: 'typoBtn'
303
561
  },
304
562
  options: {
305
563
  hideLabel: true,
@@ -331,32 +589,44 @@ const uiV2 = [
331
589
  ]
332
590
  },
333
591
  {
334
- conditionDisplay: "iconVisible == true && readMoreType == 'button'",
592
+ label: {
593
+ en: 'Text style'
594
+ },
595
+ conditionDisplay: `readMoreType == 'text'`,
335
596
  controls: [
336
597
  {
598
+ id: 'typo',
337
599
  label: {
338
- en: 'Choose icon'
600
+ en: 'Basic'
339
601
  },
340
602
  setting: {
341
- id: 'iconSvg'
342
- }
343
- },
344
- {
345
- type: 'control',
346
- label: {
347
- en: 'Position'
603
+ id: 'typoText'
348
604
  },
349
- setting: {
350
- id: 'iconAlign'
351
- }
352
- },
353
- {
354
- type: 'control',
355
- label: {
356
- en: 'Spacing'
605
+ options: {
606
+ hideLabel: true,
607
+ fullWidth: true,
608
+ updateFields: [
609
+ {
610
+ field: 'attrs.textAlign',
611
+ settingId: 'textAlign'
612
+ }
613
+ ]
357
614
  },
358
- setting: {
359
- id: 'iconSpacing'
615
+ layout: 'vertical',
616
+ controlChangeTrigger: {
617
+ settings: [
618
+ {
619
+ action: {
620
+ controlId: 'textAlign',
621
+ valueFromField: 'attrs.textAlign',
622
+ groupType: 'style',
623
+ controlType: 'style'
624
+ }
625
+ }
626
+ ],
627
+ options: {
628
+ noRecordHistory: true
629
+ }
360
630
  }
361
631
  }
362
632
  ]
@@ -365,7 +635,7 @@ const uiV2 = [
365
635
  label: {
366
636
  en: 'Hover effect'
367
637
  },
368
- conditionDisplay: `readMoreType == 'button'`,
638
+ conditionDisplay: `readMoreType !== 'text'`,
369
639
  controls: [
370
640
  {
371
641
  label: {
@@ -402,6 +672,19 @@ const uiV2 = [
402
672
  id: 'roundedBtnV2',
403
673
  state: 'hover'
404
674
  }
675
+ },
676
+ {
677
+ label: {
678
+ en: 'Shadow'
679
+ },
680
+ setting: {
681
+ id: 'boxShadowBtnV2',
682
+ state: 'hover'
683
+ },
684
+ controlConfig: {
685
+ id: 'boxShadowBtnV2',
686
+ type: 'shadow-v2'
687
+ }
405
688
  }
406
689
  ]
407
690
  },
@@ -431,7 +714,7 @@ const uiV2 = [
431
714
  setting: {
432
715
  id: 'alignBtn'
433
716
  },
434
- conditionDisplay: `readMoreType == 'button'`,
717
+ conditionDisplay: `readMoreType !== 'text'`,
435
718
  conditionEnable: "globalSizeBtn.width !== '100%'",
436
719
  options: {
437
720
  labelVariant: 'primary',
@@ -8,7 +8,6 @@ const ArticleDate = ({ setting, builderProps, styles })=>{
8
8
  const { dateFormat } = setting ?? {};
9
9
  const article = useArticleStore((s)=>s.article);
10
10
  const { timezone } = useTimezone();
11
- console.log(123, dateFormat);
12
11
  const convertTZ = (date, tzString)=>{
13
12
  const tz = tzString?.split(' ')?.[1] ?? '';
14
13
  if (!tz) return date;
@@ -28,7 +28,7 @@ const ArticleReadMore = ({ setting, styles, builderAttrs, builderProps, advanced
28
28
  translate: undefined
29
29
  }
30
30
  }))}
31
- ${RenderIf(readMoreType === 'button', Button({
31
+ ${RenderIf(readMoreType !== 'text', Button({
32
32
  builderAttrs,
33
33
  builderProps,
34
34
  advanced,
@@ -75,7 +75,7 @@ const ArticleContentSettings = [
75
75
  disableDecimal: true,
76
76
  devices: {
77
77
  desktop: {
78
- default: 3
78
+ default: 2
79
79
  }
80
80
  },
81
81
  hide: true
@@ -49,8 +49,18 @@ const uiV2 = [
49
49
  {
50
50
  id: 'hasLineClamp',
51
51
  label: {
52
- en: 'Max line'
52
+ en: 'Max lines'
53
53
  },
54
+ setting: {
55
+ id: 'hasLineClamp'
56
+ }
57
+ },
58
+ {
59
+ id: 'lineClamp',
60
+ label: {
61
+ en: 'Number of lines'
62
+ },
63
+ conditionDisplay: 'hasLineClamp === true',
54
64
  setting: {
55
65
  id: 'lineClamp'
56
66
  }
@@ -109,7 +109,7 @@ const ArticleExcerptSettings = [
109
109
  disableDecimal: true,
110
110
  devices: {
111
111
  desktop: {
112
- default: 3
112
+ default: 2
113
113
  }
114
114
  },
115
115
  hide: true
@@ -13,7 +13,7 @@ const ArticleImageSettings = [
13
13
  type: 'textarea',
14
14
  minHeight: 100,
15
15
  autoHeight: true,
16
- placeholder: 'E.g: Classic white crewneck t-shirt with minimalist logo design, casual and versatile style'
16
+ placeholder: 'E.g: This is a very long value for text area field'
17
17
  },
18
18
  {
19
19
  id: 'title',
@@ -60,11 +60,11 @@ const ArticleImageSettings = [
60
60
  type: 'select',
61
61
  options: [
62
62
  {
63
- label: 'View article',
63
+ label: 'Go to article',
64
64
  value: true
65
65
  },
66
66
  {
67
- label: 'None',
67
+ label: 'Scroll to',
68
68
  value: false
69
69
  }
70
70
  ],
@@ -73,8 +73,9 @@ const ArticleImageSettings = [
73
73
  },
74
74
  {
75
75
  id: 'openNewTab',
76
- type: 'segment',
76
+ type: 'option:value',
77
77
  label: 'Open new tab',
78
+ default: false,
78
79
  options: [
79
80
  {
80
81
  label: 'Yes',