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