@gem-sdk/components 2.0.0-dev.702 → 2.0.0-dev.704

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 (72) hide show
  1. package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +86 -134
  2. package/dist/cjs/button/components/common/helpers.js +2 -9
  3. package/dist/cjs/button/components/common/styles.js +14 -81
  4. package/dist/cjs/button/setting/configs/settings.js +85 -133
  5. package/dist/cjs/coupon/common/classes.js +3 -12
  6. package/dist/cjs/coupon/common/styles.js +7 -17
  7. package/dist/cjs/coupon/setting/config/settings.js +60 -100
  8. package/dist/cjs/form/setting/submit-button/configs/settings.js +103 -250
  9. package/dist/cjs/helpers.js +4 -1
  10. package/dist/cjs/image/components/NextImage.liquid.js +2 -2
  11. package/dist/cjs/index.js +4 -0
  12. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +2 -2
  13. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +72 -2
  14. package/dist/cjs/product/components/DynamicCheckout/common/styles.js +12 -12
  15. package/dist/cjs/product/components/ProductBadge/index.liquid.js +12 -3
  16. package/dist/cjs/product/components/ProductBadge/utils/generateLiquidContent.js +2 -2
  17. package/dist/cjs/product/components/ProductButton/common/styles.js +4 -14
  18. package/dist/cjs/product/components/ProductDescription/index.liquid.js +21 -4
  19. package/dist/cjs/product/components/ProductImagesV2/common/common.js +1 -1
  20. package/dist/cjs/product/setting/constant/bundle-layout/horizontalThree.js +1 -0
  21. package/dist/cjs/product/setting/constant/bundle-layout/horizontalTwo.js +1 -0
  22. package/dist/cjs/product/setting/constant/bundle-layout/verticalThree.js +1 -0
  23. package/dist/cjs/product/setting/constant/bundle-layout/verticalTwo.js +1 -0
  24. package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +86 -134
  25. package/dist/cjs/product/setting/product-badge/configs/settings.js +5 -0
  26. package/dist/cjs/product/setting/product-button/configs/settings.js +142 -222
  27. package/dist/cjs/product/setting/product-description/configs/settings.js +5 -0
  28. package/dist/cjs/product/setting/product-view-more/configs/settings.js +100 -148
  29. package/dist/cjs/stock-counter/components/StockCounter.js +0 -2
  30. package/dist/cjs/stock-counter/components/StockCounter.liquid.js +44 -3
  31. package/dist/cjs/stock-counter/components/common/getContent.js +19 -10
  32. package/dist/cjs/stock-counter/helpers.js +20 -3
  33. package/dist/cjs/stock-counter/index.js +0 -1
  34. package/dist/cjs/stock-counter/setting/configs/settingsV2.js +5 -0
  35. package/dist/cjs/third-party/setting/Selleasy/index.js +5 -5
  36. package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +86 -134
  37. package/dist/esm/button/components/common/helpers.js +2 -9
  38. package/dist/esm/button/components/common/styles.js +16 -81
  39. package/dist/esm/button/setting/configs/settings.js +85 -133
  40. package/dist/esm/coupon/common/classes.js +3 -12
  41. package/dist/esm/coupon/common/styles.js +7 -17
  42. package/dist/esm/coupon/setting/config/settings.js +60 -100
  43. package/dist/esm/form/setting/submit-button/configs/settings.js +103 -250
  44. package/dist/esm/helpers.js +4 -1
  45. package/dist/esm/image/components/NextImage.liquid.js +2 -2
  46. package/dist/esm/index.js +1 -0
  47. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +2 -2
  48. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +72 -2
  49. package/dist/esm/product/components/DynamicCheckout/common/styles.js +12 -12
  50. package/dist/esm/product/components/ProductBadge/index.liquid.js +13 -4
  51. package/dist/esm/product/components/ProductBadge/utils/generateLiquidContent.js +2 -2
  52. package/dist/esm/product/components/ProductButton/common/styles.js +4 -14
  53. package/dist/esm/product/components/ProductDescription/index.liquid.js +22 -5
  54. package/dist/esm/product/components/ProductImagesV2/common/common.js +1 -1
  55. package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +1 -0
  56. package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +1 -0
  57. package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +1 -0
  58. package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +1 -0
  59. package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +86 -134
  60. package/dist/esm/product/setting/product-badge/configs/settings.js +5 -0
  61. package/dist/esm/product/setting/product-button/configs/settings.js +142 -222
  62. package/dist/esm/product/setting/product-description/configs/settings.js +5 -0
  63. package/dist/esm/product/setting/product-view-more/configs/settings.js +100 -148
  64. package/dist/esm/stock-counter/components/StockCounter.js +0 -2
  65. package/dist/esm/stock-counter/components/StockCounter.liquid.js +46 -5
  66. package/dist/esm/stock-counter/components/common/getContent.js +19 -11
  67. package/dist/esm/stock-counter/helpers.js +20 -4
  68. package/dist/esm/stock-counter/index.js +0 -1
  69. package/dist/esm/stock-counter/setting/configs/settingsV2.js +5 -0
  70. package/dist/esm/third-party/setting/Selleasy/index.js +5 -5
  71. package/dist/types/index.d.ts +40 -28
  72. package/package.json +3 -3
@@ -267,65 +267,49 @@ const ArticleReadMoreSettings = [
267
267
  {
268
268
  id: 'borderBtnV2',
269
269
  type: 'border-v2',
270
- devices: {
271
- desktop: {
272
- default: {
273
- normal: {
274
- borderType: 'none',
275
- border: 'none',
276
- borderWidth: '1px',
277
- width: '1px 1px 1px 1px',
278
- color: '#121212',
279
- isCustom: true
280
- },
281
- hover: {
282
- borderType: 'none',
283
- border: 'none',
284
- borderWidth: '1px',
285
- width: '1px 1px 1px 1px',
286
- color: '#121212',
287
- isCustom: true
288
- }
289
- }
270
+ default: {
271
+ normal: {
272
+ borderType: 'none',
273
+ border: 'none',
274
+ borderWidth: '1px',
275
+ width: '1px 1px 1px 1px',
276
+ color: '#121212',
277
+ isCustom: true
278
+ },
279
+ hover: {
280
+ borderType: 'none',
281
+ border: 'none',
282
+ borderWidth: '1px',
283
+ width: '1px 1px 1px 1px',
284
+ color: '#121212',
285
+ isCustom: true
290
286
  }
291
287
  },
292
288
  compoDefaultValue: {
293
- desktop: {
294
- default: {
295
- normal: {
296
- border: 'solid',
297
- color: '#121212',
298
- width: '1px',
299
- borderWidth: '1px'
300
- },
301
- hover: {
302
- border: 'solid',
303
- color: '#121212',
304
- width: '1px',
305
- borderWidth: '1px'
306
- }
307
- }
289
+ normal: {
290
+ border: 'solid',
291
+ color: '#121212',
292
+ width: '1px',
293
+ borderWidth: '1px'
294
+ },
295
+ hover: {
296
+ border: 'solid',
297
+ color: '#121212',
298
+ width: '1px',
299
+ borderWidth: '1px'
308
300
  }
309
301
  }
310
302
  },
311
303
  {
312
304
  id: 'backgroundColorV2',
313
305
  type: 'color-picker-v2',
314
- devices: {
315
- desktop: {
316
- default: {
317
- normal: 'brand',
318
- hover: 'highlight'
319
- }
320
- }
306
+ default: {
307
+ normal: 'brand',
308
+ hover: 'highlight'
321
309
  },
322
310
  compoDefaultValue: {
323
- desktop: {
324
- default: {
325
- normal: 'brand',
326
- hover: 'highlight'
327
- }
328
- }
311
+ normal: 'brand',
312
+ hover: 'highlight'
329
313
  }
330
314
  },
331
315
  {
@@ -344,31 +328,23 @@ const ArticleReadMoreSettings = [
344
328
  {
345
329
  id: 'backgroundImage',
346
330
  type: 'background-image',
347
- devices: {
348
- desktop: {
349
- default: {
350
- normal: {},
351
- hover: {}
352
- }
353
- }
331
+ default: {
332
+ normal: {},
333
+ hover: {}
354
334
  },
355
335
  compoDefaultValue: {
356
- desktop: {
357
- default: {
358
- normal: {
359
- image: {
360
- src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
361
- width: 1200,
362
- height: 480
363
- }
364
- },
365
- hover: {
366
- image: {
367
- src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
368
- width: 1200,
369
- height: 480
370
- }
371
- }
336
+ normal: {
337
+ image: {
338
+ src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
339
+ width: 1200,
340
+ height: 480
341
+ }
342
+ },
343
+ hover: {
344
+ image: {
345
+ src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
346
+ width: 1200,
347
+ height: 480
372
348
  }
373
349
  }
374
350
  }
@@ -389,19 +365,11 @@ const ArticleReadMoreSettings = [
389
365
  {
390
366
  id: 'textColorHover',
391
367
  type: 'color-picker-v2',
392
- devices: {
393
- desktop: {
394
- default: {
395
- hover: 'text-3'
396
- }
397
- }
368
+ default: {
369
+ hover: 'text-3'
398
370
  },
399
371
  compoDefaultValue: {
400
- desktop: {
401
- default: {
402
- hover: 'text-3'
403
- }
404
- }
372
+ hover: 'text-3'
405
373
  },
406
374
  enableGradient: true
407
375
  },
@@ -422,69 +390,53 @@ const ArticleReadMoreSettings = [
422
390
  {
423
391
  id: 'roundedBtnV2',
424
392
  type: 'corner-v2',
425
- devices: {
426
- desktop: {
427
- default: {
428
- normal: {
429
- btrr: '0px',
430
- bblr: '0px',
431
- bbrr: '0px',
432
- btlr: '0px',
433
- radiusType: 'none'
434
- },
435
- hover: {
436
- btrr: '0px',
437
- bblr: '0px',
438
- bbrr: '0px',
439
- btlr: '0px',
440
- radiusType: 'none'
441
- }
442
- }
393
+ default: {
394
+ normal: {
395
+ btrr: '0px',
396
+ bblr: '0px',
397
+ bbrr: '0px',
398
+ btlr: '0px',
399
+ radiusType: 'none'
400
+ },
401
+ hover: {
402
+ btrr: '0px',
403
+ bblr: '0px',
404
+ bbrr: '0px',
405
+ btlr: '0px',
406
+ radiusType: 'none'
443
407
  }
444
408
  },
445
409
  compoDefaultValue: {
446
- desktop: {
447
- default: {
448
- normal: {
449
- btrr: '8px',
450
- bblr: '8px',
451
- bbrr: '8px',
452
- btlr: '8px',
453
- radiusType: 'rounded'
454
- },
455
- hover: {
456
- btrr: '8px',
457
- bblr: '8px',
458
- bbrr: '8px',
459
- btlr: '8px',
460
- radiusType: 'rounded'
461
- }
462
- }
410
+ normal: {
411
+ btrr: '8px',
412
+ bblr: '8px',
413
+ bbrr: '8px',
414
+ btlr: '8px',
415
+ radiusType: 'rounded'
416
+ },
417
+ hover: {
418
+ btrr: '8px',
419
+ bblr: '8px',
420
+ bbrr: '8px',
421
+ btlr: '8px',
422
+ radiusType: 'rounded'
463
423
  }
464
424
  }
465
425
  },
466
426
  {
467
427
  id: 'boxShadowBtnV2',
468
428
  type: 'shadow-v2',
469
- devices: {
470
- desktop: {
471
- default: {
472
- normal: {}
473
- }
474
- }
429
+ default: {
430
+ normal: {}
475
431
  },
476
432
  compoDefaultValue: {
477
- desktop: {
478
- default: {
479
- normal: {
480
- type: 'shadow-2',
481
- distance: '12px',
482
- blur: '12px',
483
- spread: '0px',
484
- color: 'rgba(18, 18, 18, 0.2)',
485
- angle: 45
486
- }
487
- }
433
+ normal: {
434
+ type: 'shadow-2',
435
+ distance: '12px',
436
+ blur: '12px',
437
+ spread: '0px',
438
+ color: 'rgba(18, 18, 18, 0.2)',
439
+ angle: 45
488
440
  }
489
441
  }
490
442
  }
@@ -14,15 +14,8 @@ const getCleanedStyles = (styles, disabled)=>{
14
14
  'hover',
15
15
  'focus'
16
16
  ];
17
- const devices = [
18
- 'tablet',
19
- 'mobile',
20
- 'desktop'
21
- ];
22
- devices.forEach((device)=>{
23
- states.forEach((state)=>{
24
- delete cleanedStyles?.backgroundColorV2?.[device]?.[state];
25
- });
17
+ states.forEach((state)=>{
18
+ delete cleanedStyles?.backgroundColorV2?.[state];
26
19
  });
27
20
  return cleanedStyles;
28
21
  };
@@ -2,10 +2,6 @@
2
2
 
3
3
  var core = require('@gem-sdk/core');
4
4
 
5
- const MEDIA_QUERIES = {
6
- TABLET: '@media only screen and (max-width: 1024px) and (min-width: 768px)',
7
- MOBILE: '@media only screen and (max-width: 767px)'
8
- };
9
5
  const getButtonWrapperStyles = (style, styles)=>({
10
6
  ...style,
11
7
  ...core.makeStyleResponsive('ta', styles?.align)
@@ -32,9 +28,7 @@ const isEnableShadowStateForDevice = (deviceStyles)=>({
32
28
  const getShadowStyles = (styles)=>{
33
29
  const { boxShadowBtnV2 } = styles || {};
34
30
  return {
35
- ...core.getStyleShadowState(boxShadowBtnV2?.desktop, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.desktop)),
36
- ...core.getStyleShadowState(boxShadowBtnV2?.tablet, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.tablet), 'tablet'),
37
- ...core.getStyleShadowState(boxShadowBtnV2?.mobile, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2?.mobile), 'mobile')
31
+ ...core.getStyleShadowState(boxShadowBtnV2, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV2))
38
32
  };
39
33
  };
40
34
  const getRadiusStyles = (styles)=>core.composeRadius(styles?.roundedBtnV2);
@@ -63,7 +57,7 @@ const getTypographyStyles = (styles)=>{
63
57
  delete otherProps['--c'];
64
58
  return {
65
59
  textColorStyle: {
66
- ...core.makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover)),
60
+ ...core.makeStyleState('c', styles?.textColorHover),
67
61
  ...colorObj
68
62
  },
69
63
  withoutTextColorStyles: otherProps
@@ -79,90 +73,31 @@ const getTypoStyles = (styles)=>{
79
73
  })
80
74
  };
81
75
  };
82
- /**
83
- * Process hover color for a single device
84
- */ const processDeviceHoverColor = (deviceStyle)=>{
85
- if (!deviceStyle?.hover) return deviceStyle;
86
- return {
87
- ...deviceStyle,
88
- hover: core.getSingleColorVariable(deviceStyle.hover)
89
- };
90
- };
91
- /**
92
- * Process hover colors for all responsive devices
93
- */ const processResponsiveHoverColors = (responsiveStyle)=>{
94
- if (!responsiveStyle) return {};
95
- const devices = [
96
- 'desktop',
97
- 'tablet',
98
- 'mobile'
99
- ];
100
- return devices.reduce((acc, device)=>{
101
- const processedStyle = processDeviceHoverColor(responsiveStyle[device]);
102
- if (processedStyle) {
103
- acc[device] = processedStyle;
104
- }
105
- return acc;
106
- }, {});
107
- };
108
76
  const getBackgroundStyles = (styles)=>{
109
77
  return {
110
- ...core.getStyleBackgroundImageByDevice(styles?.backgroundImage),
111
- ...core.getGlobalColorStateResponsiveStyle('bg', styles?.backgroundColorV2)
78
+ ...core.getStyleBackgroundImage(styles?.backgroundImage),
79
+ ...core.getGlobalColorStateStyle('bg', styles?.backgroundColorV2)
112
80
  };
113
81
  };
114
82
  const getCustomCssStyles = ({ styles, uid, builderAttrs })=>{
115
83
  if (!uid) return '';
116
84
  const { borderBtnV2, roundedBtnV2 } = styles ?? {};
117
- const borderCornerStyles = {
118
- desktop: generateBorderCornerStyles({
119
- uid,
120
- device: 'desktop',
121
- borderBtn: borderBtnV2,
122
- roundedBtn: roundedBtnV2,
123
- builderAttrs
124
- }),
125
- tablet: generateBorderCornerStyles({
126
- uid,
127
- device: 'tablet',
128
- borderBtn: borderBtnV2,
129
- roundedBtn: roundedBtnV2,
130
- builderAttrs
131
- }),
132
- mobile: generateBorderCornerStyles({
133
- uid,
134
- device: 'mobile',
135
- borderBtn: borderBtnV2,
136
- roundedBtn: roundedBtnV2,
137
- builderAttrs
138
- })
139
- };
85
+ const borderCornerStyles = generateBorderCornerStyles({
86
+ uid,
87
+ borderBtn: borderBtnV2,
88
+ roundedBtn: roundedBtnV2,
89
+ builderAttrs
90
+ });
140
91
  return `
141
- ${borderCornerStyles.desktop.normalStyles}
142
- ${borderCornerStyles.desktop.hoverStyles}
143
-
144
- ${MEDIA_QUERIES.TABLET} {
145
- ${borderCornerStyles.tablet.normalStyles}
146
- ${borderCornerStyles.tablet.hoverStyles}
147
- }
148
-
149
- ${MEDIA_QUERIES.MOBILE} {
150
- ${borderCornerStyles.mobile.normalStyles}
151
- ${borderCornerStyles.mobile.hoverStyles}
152
- }
92
+ ${borderCornerStyles.normalStyles}
93
+ ${borderCornerStyles.hoverStyles}
153
94
  `.trim();
154
95
  };
155
- const generateBorderCornerStyles = ({ uid, device, borderBtn, roundedBtn, builderAttrs })=>{
96
+ const generateBorderCornerStyles = ({ uid, borderBtn, roundedBtn, builderAttrs })=>{
156
97
  const tag = builderAttrs?.['data-component-tag'];
157
98
  const getResponsiveStyles = ({ styleObj, state })=>{
158
99
  if (!styleObj) return undefined;
159
- if (device === 'mobile') {
160
- return styleObj.mobile?.[state] || styleObj.tablet?.[state] || styleObj.desktop?.[state];
161
- }
162
- if (device === 'tablet') {
163
- return styleObj.tablet?.[state] || styleObj.desktop?.[state];
164
- }
165
- return styleObj.desktop?.[state];
100
+ return styleObj?.[state];
166
101
  };
167
102
  const normalBorder = getResponsiveStyles({
168
103
  styleObj: borderBtn,
@@ -223,5 +158,3 @@ exports.getCustomCssStyles = getCustomCssStyles;
223
158
  exports.getRadiusStyles = getRadiusStyles;
224
159
  exports.getShadowStyles = getShadowStyles;
225
160
  exports.getTypoStyles = getTypoStyles;
226
- exports.processDeviceHoverColor = processDeviceHoverColor;
227
- exports.processResponsiveHoverColors = processResponsiveHoverColors;