@gem-sdk/components 2.0.0-dev.539 → 2.0.0-dev.541

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 (42) hide show
  1. package/dist/cjs/article/components/ArticleContent.js +20 -3
  2. package/dist/cjs/article/components/ArticleExcerpt.js +20 -5
  3. package/dist/cjs/article/components/ArticleTag.js +2 -2
  4. package/dist/cjs/article/setting/configs/ArticleList/settings.js +6 -61
  5. package/dist/cjs/article/setting/configs/ArticleList/uiV2.js +2 -2
  6. package/dist/cjs/button/setting/configs/settings.js +14 -0
  7. package/dist/cjs/common/components/NoDataState.js +13 -1
  8. package/dist/cjs/estimate-delivery/components/EstimateDate.js +1 -3
  9. package/dist/cjs/estimate-delivery/setting/configs/settings.js +25 -49
  10. package/dist/cjs/estimate-delivery/setting/configs/uiV2.js +55 -62
  11. package/dist/cjs/image/components/AdaptiveImage.js +2 -2
  12. package/dist/cjs/image/components/common/styles.js +1 -1
  13. package/dist/cjs/image/setting/configs/settings.js +8 -4
  14. package/dist/cjs/image/setting/configs/uiV2.js +42 -43
  15. package/dist/cjs/image-comparison/components/hooks/useCompareImage.js +3 -2
  16. package/dist/cjs/image-comparison/setting/configs/settings.js +11 -5
  17. package/dist/cjs/product/setting/product-view-more/configs/settings.js +14 -0
  18. package/dist/cjs/tab/components/common/getClasses.js +1 -1
  19. package/dist/cjs/tab/setting/Tabs.js +3 -0
  20. package/dist/cjs/tab/setting/configs/settings.js +5 -5
  21. package/dist/esm/article/components/ArticleContent.js +21 -4
  22. package/dist/esm/article/components/ArticleExcerpt.js +21 -6
  23. package/dist/esm/article/components/ArticleTag.js +2 -2
  24. package/dist/esm/article/setting/configs/ArticleList/settings.js +6 -61
  25. package/dist/esm/article/setting/configs/ArticleList/uiV2.js +2 -2
  26. package/dist/esm/button/setting/configs/settings.js +14 -0
  27. package/dist/esm/common/components/NoDataState.js +13 -1
  28. package/dist/esm/estimate-delivery/components/EstimateDate.js +1 -3
  29. package/dist/esm/estimate-delivery/setting/configs/settings.js +25 -49
  30. package/dist/esm/estimate-delivery/setting/configs/uiV2.js +55 -62
  31. package/dist/esm/image/components/AdaptiveImage.js +2 -2
  32. package/dist/esm/image/components/common/styles.js +1 -1
  33. package/dist/esm/image/setting/configs/settings.js +8 -4
  34. package/dist/esm/image/setting/configs/uiV2.js +42 -43
  35. package/dist/esm/image-comparison/components/hooks/useCompareImage.js +3 -2
  36. package/dist/esm/image-comparison/setting/configs/settings.js +11 -5
  37. package/dist/esm/product/setting/product-view-more/configs/settings.js +14 -0
  38. package/dist/esm/tab/components/common/getClasses.js +1 -1
  39. package/dist/esm/tab/setting/Tabs.js +3 -0
  40. package/dist/esm/tab/setting/configs/settings.js +5 -5
  41. package/dist/types/index.d.ts +3 -0
  42. package/package.json +2 -2
@@ -48,37 +48,25 @@ const EstimateDateSettings = [
48
48
  {
49
49
  id: 'minEstimate',
50
50
  label: 'Min estimate',
51
- type: 'input:unit',
51
+ type: 'input:number',
52
52
  default: 2,
53
- units: [
54
- 'days'
55
- ],
56
53
  emptyOnClear: true,
57
- useOnlyUnitInit: true,
58
54
  min: 0
59
55
  },
60
56
  {
61
57
  id: 'maxEstimate',
62
58
  label: 'Max estimate',
63
- type: 'input:unit',
64
- units: [
65
- 'days'
66
- ],
59
+ type: 'input:number',
67
60
  emptyOnClear: true,
68
61
  default: 5,
69
- useOnlyUnitInit: true,
70
62
  min: 0
71
63
  },
72
64
  {
73
65
  id: 'estimateTime',
74
66
  label: 'Estimate',
75
- type: 'input:unit',
67
+ type: 'input:number',
76
68
  emptyOnClear: true,
77
- units: [
78
- 'days'
79
- ],
80
69
  default: 5,
81
- useOnlyUnitInit: true,
82
70
  min: 0
83
71
  }
84
72
  ]
@@ -170,18 +158,6 @@ const EstimateDateSettings = [
170
158
  type: 'size-setting',
171
159
  devices: {
172
160
  desktop: {
173
- default: {
174
- width: 'Auto',
175
- padding: {
176
- type: 'medium',
177
- top: '12px',
178
- bottom: '12px',
179
- left: '24px',
180
- right: '24px'
181
- }
182
- }
183
- },
184
- mobile: {
185
161
  default: {
186
162
  width: '100%'
187
163
  }
@@ -234,7 +210,7 @@ const EstimateDateSettings = [
234
210
  desktop: {
235
211
  default: {
236
212
  type: 'color',
237
- color: '#DDDDDD',
213
+ color: '#FFFFFF',
238
214
  image: {
239
215
  src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
240
216
  width: 1200,
@@ -322,7 +298,7 @@ const EstimateDateSettings = [
322
298
  }
323
299
  },
324
300
  {
325
- id: 'border',
301
+ id: 'shapeBorder',
326
302
  type: 'border-v2',
327
303
  devices: {
328
304
  desktop: {
@@ -332,36 +308,30 @@ const EstimateDateSettings = [
332
308
  compoDefaultValue: {
333
309
  desktop: {
334
310
  default: {
335
- normal: {
336
- border: 'solid',
337
- color: '#121212',
338
- width: '1px',
339
- borderWidth: '1px'
340
- }
311
+ border: 'solid',
312
+ color: '#121212',
313
+ width: '1px',
314
+ borderWidth: '1px'
341
315
  }
342
316
  }
343
317
  }
344
318
  },
345
319
  {
346
- id: 'rounded',
320
+ id: 'shapeRounded',
347
321
  type: 'corner-v2',
348
322
  devices: {
349
323
  desktop: {
350
- default: {
351
- normal: undefined
352
- }
324
+ default: undefined
353
325
  }
354
326
  },
355
327
  compoDefaultValue: {
356
328
  desktop: {
357
329
  default: {
358
- normal: {
359
- btrr: '8px',
360
- bblr: '8px',
361
- bbrr: '8px',
362
- btlr: '8px',
363
- radiusType: 'rounded'
364
- }
330
+ btrr: '8px',
331
+ bblr: '8px',
332
+ bbrr: '8px',
333
+ btlr: '8px',
334
+ radiusType: 'rounded'
365
335
  }
366
336
  }
367
337
  }
@@ -397,19 +367,25 @@ const EstimateDateSettings = [
397
367
  }
398
368
  },
399
369
  {
400
- id: 'boxShadow',
370
+ id: 'shapeBoxShadow',
401
371
  type: 'shadow-v2',
402
372
  devices: {
403
373
  desktop: {
404
374
  default: {
405
- normal: {}
375
+ enable: false
406
376
  }
407
377
  }
408
378
  },
409
379
  compoDefaultValue: {
410
380
  desktop: {
411
381
  default: {
412
- normal: {}
382
+ type: 'shadow-2',
383
+ distance: '12px',
384
+ blur: '12px',
385
+ spread: '0px',
386
+ color: 'rgba(18, 18, 18, 0.2)',
387
+ angle: 45,
388
+ enable: true
413
389
  }
414
390
  }
415
391
  }
@@ -24,7 +24,27 @@ const SettingUIV2 = [
24
24
  setting: {
25
25
  id: 'minEstimate'
26
26
  },
27
- conditionDisplay: `typeEstimate === "${ESTIMATE_DAYS.RANGE}"`
27
+ conditionDisplay: `typeEstimate === "${ESTIMATE_DAYS.RANGE}"`,
28
+ controlChangeTrigger: {
29
+ settings: [
30
+ {
31
+ condition: `parseInt(minEstimate) > parseInt(maxEstimate)`,
32
+ source: [
33
+ 'maxEstimate',
34
+ 'minEstimate'
35
+ ],
36
+ action: {
37
+ controlId: 'maxEstimate',
38
+ groupType: 'setting',
39
+ controlType: 'setting',
40
+ valueFromField: 'minEstimate'
41
+ }
42
+ }
43
+ ],
44
+ options: {
45
+ noRecordHistory: true
46
+ }
47
+ }
28
48
  },
29
49
  {
30
50
  label: {
@@ -33,7 +53,27 @@ const SettingUIV2 = [
33
53
  setting: {
34
54
  id: 'maxEstimate'
35
55
  },
36
- conditionDisplay: `typeEstimate === "${ESTIMATE_DAYS.RANGE}"`
56
+ conditionDisplay: `typeEstimate === "${ESTIMATE_DAYS.RANGE}"`,
57
+ controlChangeTrigger: {
58
+ settings: [
59
+ {
60
+ condition: `parseInt(maxEstimate) < parseInt(minEstimate)`,
61
+ source: [
62
+ 'maxEstimate',
63
+ 'minEstimate'
64
+ ],
65
+ action: {
66
+ controlId: 'minEstimate',
67
+ groupType: 'setting',
68
+ controlType: 'setting',
69
+ valueFromField: 'maxEstimate'
70
+ }
71
+ }
72
+ ],
73
+ options: {
74
+ noRecordHistory: true
75
+ }
76
+ }
37
77
  },
38
78
  {
39
79
  label: {
@@ -58,14 +98,7 @@ const SettingUIV2 = [
58
98
  setting: {
59
99
  id: 'typeFormat'
60
100
  }
61
- }
62
- ]
63
- },
64
- {
65
- label: {
66
- en: 'Date text'
67
- },
68
- controls: [
101
+ },
69
102
  {
70
103
  conditionDisplay: `typeFormat === 'Custom'`,
71
104
  label: {
@@ -74,7 +107,14 @@ const SettingUIV2 = [
74
107
  setting: {
75
108
  id: 'customFormat'
76
109
  }
77
- },
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ label: {
115
+ en: 'Date text'
116
+ },
117
+ controls: [
78
118
  {
79
119
  setting: {
80
120
  id: 'typoDate'
@@ -242,8 +282,7 @@ const SettingUIV2 = [
242
282
  es: 'Borde'
243
283
  },
244
284
  setting: {
245
- id: 'border',
246
- state: 'normal'
285
+ id: 'shapeBorder'
247
286
  }
248
287
  },
249
288
  {
@@ -253,8 +292,7 @@ const SettingUIV2 = [
253
292
  es: 'Esquina'
254
293
  },
255
294
  setting: {
256
- id: 'rounded',
257
- state: 'normal'
295
+ id: 'shapeRounded'
258
296
  }
259
297
  },
260
298
  {
@@ -264,52 +302,7 @@ const SettingUIV2 = [
264
302
  es: 'Sombra'
265
303
  },
266
304
  setting: {
267
- id: 'boxShadow',
268
- state: 'normal'
269
- },
270
- options: {
271
- updateFields: [
272
- {
273
- field: 'normal.enable',
274
- settingId: 'hasBoxShadow',
275
- state: 'normal'
276
- }
277
- ]
278
- },
279
- controlChangeTrigger: {
280
- settings: [
281
- {
282
- condition: `boxShadow.normal.enable === true`,
283
- source: [
284
- 'boxShadow',
285
- 'hasBoxShadow'
286
- ],
287
- action: {
288
- controlId: 'hasBoxShadow',
289
- groupType: 'advanced',
290
- controlType: 'advanced',
291
- state: 'normal',
292
- newValue: true
293
- }
294
- },
295
- {
296
- condition: `boxShadow.normal.enable === false`,
297
- source: [
298
- 'boxShadow',
299
- 'hasBoxShadow'
300
- ],
301
- action: {
302
- controlId: 'hasBoxShadow',
303
- groupType: 'advanced',
304
- controlType: 'advanced',
305
- state: 'normal',
306
- newValue: false
307
- }
308
- }
309
- ],
310
- options: {
311
- noRecordHistory: true
312
- }
305
+ id: 'shapeBoxShadow'
313
306
  }
314
307
  }
315
308
  ]
@@ -327,7 +320,7 @@ const SettingUIV2 = [
327
320
  options: {
328
321
  labelVariant: 'primary',
329
322
  fullWidth: true,
330
- disableMessage: `Align is not supported when width is 100%`
323
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
331
324
  }
332
325
  }
333
326
  ]
@@ -37,11 +37,11 @@ const AdaptiveImage = (props)=>{
37
37
  children: [
38
38
  srcMobile && /*#__PURE__*/ jsx("source", {
39
39
  media: "(max-width: 767px)",
40
- srcSet: srcMobile || IMAGE_PLACEHOLDER
40
+ srcSet: enableLazyloadImage ? IMAGE_PLACEHOLDER : srcMobile
41
41
  }),
42
42
  srcTablet && /*#__PURE__*/ jsx("source", {
43
43
  media: "(max-width: 1024px)",
44
- srcSet: srcTablet || IMAGE_PLACEHOLDER
44
+ srcSet: enableLazyloadImage ? IMAGE_PLACEHOLDER : srcTablet
45
45
  })
46
46
  ]
47
47
  });
@@ -25,7 +25,7 @@ const getImageStyles = (styles, builderProps)=>{
25
25
  ...getStyleShadow({
26
26
  value: styles?.shadow,
27
27
  styleAppliedFor: 'box-shadow',
28
- isEnableShadow: styles?.shadow?.type !== 'none'
28
+ isEnableShadow: styles?.shadow?.enable && styles?.shadow?.type !== 'none'
29
29
  })
30
30
  };
31
31
  };
@@ -93,16 +93,20 @@ const ImageSettings = [
93
93
  id: 'alt',
94
94
  label: 'Alt Text',
95
95
  type: 'textarea',
96
- minHeight: 100,
96
+ minHeight: 56,
97
97
  autoHeight: true,
98
- placeholder: 'E.g: Classic white crewneck t-shirt with minimalist design'
98
+ placeholder: 'E.g: Classic white crewneck t-shirt with minimalist design',
99
+ default: 'Describes the appearance of the image'
99
100
  },
100
101
  {
101
102
  id: 'title',
102
103
  label: 'Image title',
103
104
  info: 'Show title when hover to image',
104
- type: 'input',
105
- placeholder: 'E.g: White t-shirt'
105
+ type: 'textarea',
106
+ minHeight: 56,
107
+ autoHeight: true,
108
+ placeholder: 'E.g: White t-shirt',
109
+ default: 'Title'
106
110
  }
107
111
  ]
108
112
  },
@@ -19,21 +19,9 @@ const SettingUIV2 = [
19
19
  action: {
20
20
  controlId: 'shape',
21
21
  newValue: {
22
- desktop: {
23
- shape: 'square',
24
- shapeValue: '1/1',
25
- shapeLinked: true
26
- },
27
- tablet: {
28
- shape: 'square',
29
- shapeValue: '1/1',
30
- shapeLinked: true
31
- },
32
- mobile: {
33
- shape: 'square',
34
- shapeValue: '1/1',
35
- shapeLinked: true
36
- }
22
+ shape: 'square',
23
+ shapeValue: '1/1',
24
+ shapeLinked: true
37
25
  },
38
26
  groupType: 'style',
39
27
  controlType: 'style'
@@ -47,10 +35,10 @@ const SettingUIV2 = [
47
35
  action: {
48
36
  controlId: 'borderRadius',
49
37
  newValue: {
50
- bblr: '99999px',
51
- btrr: '99999px',
52
- bbrr: '99999px',
53
- btlr: '99999px',
38
+ bblr: '9999px',
39
+ btrr: '9999px',
40
+ bbrr: '9999px',
41
+ btlr: '9999px',
54
42
  radiusType: 'circle'
55
43
  },
56
44
  groupType: 'style',
@@ -65,18 +53,8 @@ const SettingUIV2 = [
65
53
  action: {
66
54
  controlId: 'shape',
67
55
  newValue: {
68
- desktop: {
69
- shape: 'original',
70
- shapeValue: ''
71
- },
72
- tablet: {
73
- shape: 'original',
74
- shapeValue: ''
75
- },
76
- mobile: {
77
- shape: 'original',
78
- shapeValue: ''
79
- }
56
+ shape: 'original',
57
+ shapeValue: ''
80
58
  },
81
59
  groupType: 'style',
82
60
  controlType: 'style'
@@ -167,7 +145,6 @@ const SettingUIV2 = [
167
145
  }
168
146
  },
169
147
  {
170
- conditionDisplay: "shape.shape !== 'original'",
171
148
  label: {
172
149
  en: 'Scale'
173
150
  },
@@ -299,20 +276,46 @@ const SettingUIV2 = [
299
276
  },
300
277
  controls: [
301
278
  {
279
+ type: 'combo',
302
280
  label: {
303
281
  en: 'Alt text'
304
282
  },
305
- setting: {
306
- id: 'alt'
307
- }
283
+ iconName: 'polaris-text-block',
284
+ fixedValue: 'Describes the appearance of the image',
285
+ getValueFromSettingID: 'alt',
286
+ isHideClear: true,
287
+ controls: [
288
+ {
289
+ label: {
290
+ en: 'Content'
291
+ },
292
+ setting: {
293
+ id: 'alt'
294
+ },
295
+ layout: 'vertical'
296
+ }
297
+ ]
308
298
  },
309
299
  {
300
+ type: 'combo',
310
301
  label: {
311
302
  en: 'Image title'
312
303
  },
313
- setting: {
314
- id: 'title'
315
- }
304
+ iconName: 'polaris-text-block',
305
+ fixedValue: 'Title',
306
+ getValueFromSettingID: 'title',
307
+ isHideClear: true,
308
+ controls: [
309
+ {
310
+ label: {
311
+ en: 'Content'
312
+ },
313
+ setting: {
314
+ id: 'title'
315
+ },
316
+ layout: 'vertical'
317
+ }
318
+ ]
316
319
  }
317
320
  ]
318
321
  },
@@ -320,10 +323,6 @@ const SettingUIV2 = [
320
323
  label: {
321
324
  en: 'Optimize LCP'
322
325
  },
323
- messageConfig: {
324
- type: 'info',
325
- message: 'You can optimize image size with our partnered app'
326
- },
327
326
  controls: [
328
327
  {
329
328
  label: {
@@ -366,7 +365,7 @@ const SettingUIV2 = [
366
365
  options: {
367
366
  labelVariant: 'primary',
368
367
  fullWidth: true,
369
- disableMessage: `Align is not supported when width is 100%`
368
+ disableMessage: `This option is disabled because the width is set to 100%`
370
369
  }
371
370
  }
372
371
  ]
@@ -17,8 +17,9 @@ const useCompareImage = ({ props, aspectRatio })=>{
17
17
  const leftImageRef = useRef(null);
18
18
  const { onListener, saveToElementInteractionData } = useInteraction();
19
19
  const ref = useRef(null);
20
- const memoAspectRatio = useMemo(()=>aspectRatio, [
21
- aspectRatio
20
+ const memoAspectRatio = useMemo(()=>aspectRatio || styles?.aspectRatio, [
21
+ aspectRatio,
22
+ styles?.aspectRatio
22
23
  ]);
23
24
  useEffect(()=>{
24
25
  const selector = `[data-id="${props?.componentUid}"]`;
@@ -30,6 +30,9 @@ const ImageComparisonSettings = [
30
30
  src: 'https://ucarecdn.com/f22eb586-02bc-4c17-910f-6435af22301b/-/format/auto/',
31
31
  width: 900,
32
32
  height: 600
33
+ },
34
+ hiddenSetting: {
35
+ seo: true
33
36
  }
34
37
  }
35
38
  ]
@@ -46,6 +49,9 @@ const ImageComparisonSettings = [
46
49
  src: 'https://ucarecdn.com/45dae4ae-3e07-40d9-a22c-4032c1c817d6/-/format/auto/',
47
50
  width: 900,
48
51
  height: 600
52
+ },
53
+ hiddenSetting: {
54
+ seo: true
49
55
  }
50
56
  }
51
57
  ]
@@ -501,21 +507,21 @@ const ImageComparisonSettings = [
501
507
  },
502
508
  {
503
509
  id: 'imageScale',
504
- type: 'layout-segment',
505
- iconViewBox: '0 0 66 48',
506
- enableItemBackground: true,
510
+ type: 'option:illustration',
507
511
  enableTooltip: true,
508
512
  label: 'Image scale',
509
513
  options: [
510
514
  {
511
515
  label: 'Fill image',
512
516
  value: 'cover',
513
- type: 'image'
517
+ type: 'image',
518
+ svgName: 'gp-image-cover'
514
519
  },
515
520
  {
516
521
  label: 'Fit image',
517
522
  value: 'contain',
518
- type: 'image'
523
+ type: 'image',
524
+ svgName: 'gp-image-contain'
519
525
  }
520
526
  ],
521
527
  devices: {
@@ -181,6 +181,13 @@ const ProductViewMoreSettings = [
181
181
  desktop: {
182
182
  default: {
183
183
  normal: {
184
+ size: 'cover',
185
+ position: {
186
+ x: 50,
187
+ y: 50
188
+ },
189
+ repeat: 'no-repeat',
190
+ attachment: 'scroll',
184
191
  image: {
185
192
  src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
186
193
  width: 1200,
@@ -188,6 +195,13 @@ const ProductViewMoreSettings = [
188
195
  }
189
196
  },
190
197
  hover: {
198
+ size: 'cover',
199
+ position: {
200
+ x: 50,
201
+ y: 50
202
+ },
203
+ repeat: 'no-repeat',
204
+ attachment: 'scroll',
191
205
  image: {
192
206
  src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
193
207
  width: 1200,
@@ -73,7 +73,7 @@ const getContainContentClasses = ()=>{
73
73
  };
74
74
  };
75
75
  const getTextClasses = ()=>{
76
- const classList = 'gp-cursor-pointer gp-overflow-hidden gp-whitespace-nowrap';
76
+ const classList = 'gp-cursor-pointer gp-overflow-hidden gp-whitespace-nowrap !gp-text-inherit';
77
77
  return {
78
78
  ...composeClasses(classList)
79
79
  };
@@ -65,6 +65,9 @@ const config = {
65
65
  {
66
66
  tag: 'TabItem'
67
67
  },
68
+ {
69
+ tag: 'TabItem'
70
+ },
68
71
  {
69
72
  tag: 'TabItem'
70
73
  }
@@ -10,8 +10,7 @@ const TabsSettings = [
10
10
  'Tab 1',
11
11
  'Tab 2',
12
12
  'Tab 3'
13
- ],
14
- expandItem: true
13
+ ]
15
14
  },
16
15
  {
17
16
  id: 'activeKey',
@@ -75,8 +74,6 @@ const TabsSettings = [
75
74
  color: 'text-1'
76
75
  }
77
76
  },
78
- hiddenSetting: {
79
- },
80
77
  ignoreReRender: true
81
78
  },
82
79
  {
@@ -152,7 +149,10 @@ const TabsSettings = [
152
149
  },
153
150
  {
154
151
  id: 'padding',
155
- type: 'padding-v2'
152
+ type: 'padding-v2',
153
+ devices: {
154
+ desktop: {}
155
+ }
156
156
  },
157
157
  {
158
158
  id: 'labelAlign',
@@ -1460,6 +1460,9 @@ type EstimateDateProps$1 = BasePropsWrap<{
1460
1460
  border?: ObjectDevices$1<StateProp<Border>>;
1461
1461
  rounded?: ObjectDevices$1<StateProp<CornerRadius>>;
1462
1462
  boxShadow?: ObjectDevices$1<StateProp<ShadowProps$1>>;
1463
+ shapeBorder?: ObjectDevices$1<Border>;
1464
+ shapeRounded?: ObjectDevices$1<CornerRadius>;
1465
+ shapeBoxShadow?: ObjectDevices$1<ShadowProps$1>;
1463
1466
  }> & Omit<React.ComponentPropsWithoutRef<'h1'>, 'children'> & {
1464
1467
  children: React.ReactNode;
1465
1468
  };