@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
@@ -124,44 +124,36 @@ const ButtonSettings = [
124
124
  {
125
125
  id: 'borderBtnV2',
126
126
  type: 'border-v2',
127
- devices: {
128
- desktop: {
129
- default: {
130
- normal: {
131
- borderType: 'none',
132
- border: 'none',
133
- borderWidth: '1px',
134
- width: '1px 1px 1px 1px',
135
- color: '#121212',
136
- isCustom: true
137
- },
138
- hover: {
139
- borderType: 'none',
140
- border: 'none',
141
- borderWidth: '1px',
142
- width: '1px 1px 1px 1px',
143
- color: '#121212',
144
- isCustom: true
145
- }
146
- }
127
+ default: {
128
+ normal: {
129
+ borderType: 'none',
130
+ border: 'none',
131
+ borderWidth: '1px',
132
+ width: '1px 1px 1px 1px',
133
+ color: '#121212',
134
+ isCustom: true
135
+ },
136
+ hover: {
137
+ borderType: 'none',
138
+ border: 'none',
139
+ borderWidth: '1px',
140
+ width: '1px 1px 1px 1px',
141
+ color: '#121212',
142
+ isCustom: true
147
143
  }
148
144
  },
149
145
  compoDefaultValue: {
150
- desktop: {
151
- default: {
152
- normal: {
153
- border: 'solid',
154
- color: '#121212',
155
- width: '1px',
156
- borderWidth: '1px'
157
- },
158
- hover: {
159
- border: 'solid',
160
- color: '#121212',
161
- width: '1px',
162
- borderWidth: '1px'
163
- }
164
- }
146
+ normal: {
147
+ border: 'solid',
148
+ color: '#121212',
149
+ width: '1px',
150
+ borderWidth: '1px'
151
+ },
152
+ hover: {
153
+ border: 'solid',
154
+ color: '#121212',
155
+ width: '1px',
156
+ borderWidth: '1px'
165
157
  }
166
158
  }
167
159
  },
@@ -186,30 +178,22 @@ const ButtonSettings = [
186
178
  {
187
179
  id: 'roundedBtnV2',
188
180
  type: 'corner-v2',
189
- devices: {
190
- desktop: {
191
- default: {
192
- normal: {
193
- btrr: '0px',
194
- bblr: '0px',
195
- bbrr: '0px',
196
- btlr: '0px',
197
- radiusType: 'none'
198
- }
199
- }
181
+ default: {
182
+ normal: {
183
+ btrr: '0px',
184
+ bblr: '0px',
185
+ bbrr: '0px',
186
+ btlr: '0px',
187
+ radiusType: 'none'
200
188
  }
201
189
  },
202
190
  compoDefaultValue: {
203
- desktop: {
204
- default: {
205
- normal: {
206
- btrr: '8px',
207
- bblr: '8px',
208
- bbrr: '8px',
209
- btlr: '8px',
210
- radiusType: 'rounded'
211
- }
212
- }
191
+ normal: {
192
+ btrr: '8px',
193
+ bblr: '8px',
194
+ bbrr: '8px',
195
+ btlr: '8px',
196
+ radiusType: 'rounded'
213
197
  }
214
198
  }
215
199
  },
@@ -266,46 +250,30 @@ const ButtonSettings = [
266
250
  {
267
251
  id: 'boxShadowBtnV2',
268
252
  type: 'shadow-v2',
269
- devices: {
270
- desktop: {
271
- default: {
272
- normal: {}
273
- }
274
- }
253
+ default: {
254
+ normal: {}
275
255
  },
276
256
  compoDefaultValue: {
277
- desktop: {
278
- default: {
279
- normal: {
280
- type: 'shadow-1',
281
- distance: '4px',
282
- blur: '4px',
283
- spread: '0px',
284
- color: '#121212',
285
- angle: 45
286
- }
287
- }
257
+ normal: {
258
+ type: 'shadow-1',
259
+ distance: '4px',
260
+ blur: '4px',
261
+ spread: '0px',
262
+ color: '#121212',
263
+ angle: 45
288
264
  }
289
265
  }
290
266
  },
291
267
  {
292
268
  id: 'backgroundColorV2',
293
269
  type: 'color-picker-v2',
294
- devices: {
295
- desktop: {
296
- default: {
297
- normal: 'brand',
298
- hover: 'highlight'
299
- }
300
- }
270
+ default: {
271
+ normal: 'brand',
272
+ hover: 'highlight'
301
273
  },
302
274
  compoDefaultValue: {
303
- desktop: {
304
- default: {
305
- normal: 'brand',
306
- hover: 'highlight'
307
- }
308
- }
275
+ normal: 'brand',
276
+ hover: 'highlight'
309
277
  },
310
278
  enableGradient: true
311
279
  },
@@ -325,44 +293,36 @@ const ButtonSettings = [
325
293
  {
326
294
  id: 'backgroundImage',
327
295
  type: 'background-image',
328
- devices: {
329
- desktop: {
330
- default: {
331
- normal: {}
332
- }
333
- }
296
+ default: {
297
+ normal: {}
334
298
  },
335
299
  compoDefaultValue: {
336
- desktop: {
337
- default: {
338
- normal: {
339
- size: 'cover',
340
- position: {
341
- x: 50,
342
- y: 50
343
- },
344
- repeat: 'no-repeat',
345
- attachment: 'scroll',
346
- image: {
347
- src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
348
- width: 1200,
349
- height: 480
350
- }
351
- },
352
- hover: {
353
- size: 'cover',
354
- position: {
355
- x: 50,
356
- y: 50
357
- },
358
- repeat: 'no-repeat',
359
- attachment: 'scroll',
360
- image: {
361
- src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
362
- width: 1200,
363
- height: 480
364
- }
365
- }
300
+ normal: {
301
+ size: 'cover',
302
+ position: {
303
+ x: 50,
304
+ y: 50
305
+ },
306
+ repeat: 'no-repeat',
307
+ attachment: 'scroll',
308
+ image: {
309
+ src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
310
+ width: 1200,
311
+ height: 480
312
+ }
313
+ },
314
+ hover: {
315
+ size: 'cover',
316
+ position: {
317
+ x: 50,
318
+ y: 50
319
+ },
320
+ repeat: 'no-repeat',
321
+ attachment: 'scroll',
322
+ image: {
323
+ src: 'https://ucarecdn.com/06075225-af9e-460c-8e3c-6be63c0b773a/-/format/auto/',
324
+ width: 1200,
325
+ height: 480
366
326
  }
367
327
  }
368
328
  }
@@ -423,19 +383,11 @@ const ButtonSettings = [
423
383
  {
424
384
  id: 'textColorHover',
425
385
  type: 'color-picker-v2',
426
- devices: {
427
- desktop: {
428
- default: {
429
- hover: 'text-3'
430
- }
431
- }
386
+ default: {
387
+ hover: 'text-3'
432
388
  },
433
389
  compoDefaultValue: {
434
- desktop: {
435
- default: {
436
- hover: 'text-3'
437
- }
438
- }
390
+ hover: 'text-3'
439
391
  },
440
392
  enableGradient: true
441
393
  },
@@ -1,19 +1,10 @@
1
1
  import { composeClasses, cls } from '@gem-sdk/core';
2
2
 
3
3
  const getActiveClasses = (backgroundColor, text)=>{
4
- const breakpoints = {
5
- desktop: '',
6
- tablet: 'tablet:',
7
- mobile: 'mobile:'
8
- };
9
- const generateClass = (type, device, value)=>value ? `${breakpoints[device]}[&_button]:data-[active=true]:!gp-${type}-[${value}]` : '';
4
+ const generateClass = (type, value)=>value ? `[&_button]:data-[active=true]:!gp-${type}-[${value}]` : '';
10
5
  const classes = [
11
- generateClass('bg', 'desktop', backgroundColor?.desktop?.active),
12
- generateClass('bg', 'tablet', backgroundColor?.tablet?.active),
13
- generateClass('bg', 'mobile', backgroundColor?.mobile?.active),
14
- generateClass('text', 'desktop', text?.desktop?.active),
15
- generateClass('text', 'tablet', text?.tablet?.active),
16
- generateClass('text', 'mobile', text?.mobile?.active)
6
+ generateClass('bg', backgroundColor?.active),
7
+ generateClass('text', text?.active)
17
8
  ].filter(Boolean).join(' ');
18
9
  return composeClasses(cls('gp-coupon', classes));
19
10
  };
@@ -12,21 +12,11 @@ const getButtonStyle = (style, styles)=>{
12
12
  ...makeStyleResponsive('ta', styles?.align)
13
13
  };
14
14
  };
15
- const getResponsiveSetting = (setting)=>{
16
- const desktop = setting.desktop;
17
- const tablet = setting.tablet ? setting.tablet : desktop;
18
- const mobile = setting.mobile ? setting.mobile : tablet;
19
- return {
20
- desktop,
21
- tablet,
22
- mobile
23
- };
24
- };
25
15
  const getInnerBorderCornerCss = (data)=>{
26
16
  const { uid, styles } = data;
27
- const borderBtnV2 = getResponsiveSetting(styles?.borderBtnV2 || {});
28
- const roundedBtnV2 = getResponsiveSetting(styles?.roundedBtnV2 || {});
29
- const boxShadowBtnV2 = getResponsiveSetting(styles?.boxShadowBtnV2 || {});
17
+ const borderBtnV2 = styles?.borderBtnV2;
18
+ const roundedBtnV2 = styles?.roundedBtnV2;
19
+ const boxShadowBtnV2 = styles?.boxShadowBtnV2;
30
20
  const getShadowValue = (value)=>value ? getStyleShadow({
31
21
  value,
32
22
  state: 'active',
@@ -44,14 +34,14 @@ const getInnerBorderCornerCss = (data)=>{
44
34
  return `
45
35
  ${mediaQuery}
46
36
  .gp-coupon[data-active="true"] .${uid}::before {
47
- ${composeBorderCss(borderBtnV2?.[device]?.active, {
37
+ ${composeBorderCss(borderBtnV2?.active, {
48
38
  important: true
49
39
  })};
50
- ${composeCornerCss(roundedBtnV2?.[device]?.active, true)};
51
- box-shadow: ${getShadowValue(boxShadowBtnV2?.[device]?.active)} !important;
40
+ ${composeCornerCss(roundedBtnV2?.active, true)};
41
+ box-shadow: ${getShadowValue(boxShadowBtnV2?.active ?? {})} !important;
52
42
  }
53
43
  .gp-coupon[data-active="true"] .${uid} {
54
- ${composeCornerCss(roundedBtnV2?.[device]?.active, true)};
44
+ ${composeCornerCss(roundedBtnV2?.active, true)};
55
45
  }
56
46
  ${closeMediaQuery}
57
47
  `;
@@ -183,23 +183,15 @@ const CouponSettings = [
183
183
  {
184
184
  id: 'backgroundColorV2',
185
185
  type: 'color-picker-v2',
186
- devices: {
187
- desktop: {
188
- default: {
189
- normal: 'brand',
190
- hover: 'highlight',
191
- active: '#2C934E'
192
- }
193
- }
186
+ default: {
187
+ normal: 'brand',
188
+ hover: 'highlight',
189
+ active: '#2C934E'
194
190
  },
195
191
  compoDefaultValue: {
196
- desktop: {
197
- default: {
198
- normal: 'brand',
199
- hover: 'highlight',
200
- active: '#2C934E'
201
- }
202
- }
192
+ normal: 'brand',
193
+ hover: 'highlight',
194
+ active: '#2C934E'
203
195
  }
204
196
  },
205
197
  {
@@ -218,18 +210,10 @@ const CouponSettings = [
218
210
  {
219
211
  id: 'textColorHover',
220
212
  type: 'color-picker-v2',
221
- devices: {
222
- desktop: {
223
- default: {}
224
- }
225
- },
213
+ default: {},
226
214
  compoDefaultValue: {
227
- desktop: {
228
- default: {
229
- hover: 'text-3',
230
- active: 'text-3'
231
- }
232
- }
215
+ hover: 'text-3',
216
+ active: 'text-3'
233
217
  }
234
218
  },
235
219
  {
@@ -426,100 +410,76 @@ const CouponSettings = [
426
410
  {
427
411
  id: 'borderBtnV2',
428
412
  type: 'border-v2',
429
- devices: {
430
- desktop: {
431
- default: {
432
- normal: {
433
- borderType: 'none',
434
- border: 'none',
435
- borderWidth: '1px',
436
- width: '1px 1px 1px 1px',
437
- color: '#121212',
438
- isCustom: true
439
- },
440
- hover: {
441
- borderType: 'none',
442
- border: 'none',
443
- borderWidth: '1px',
444
- width: '1px 1px 1px 1px',
445
- color: '#121212',
446
- isCustom: true
447
- }
448
- }
413
+ default: {
414
+ normal: {
415
+ borderType: 'none',
416
+ border: 'none',
417
+ borderWidth: '1px',
418
+ width: '1px 1px 1px 1px',
419
+ color: '#121212',
420
+ isCustom: true
421
+ },
422
+ hover: {
423
+ borderType: 'none',
424
+ border: 'none',
425
+ borderWidth: '1px',
426
+ width: '1px 1px 1px 1px',
427
+ color: '#121212',
428
+ isCustom: true
449
429
  }
450
430
  },
451
431
  compoDefaultValue: {
452
- desktop: {
453
- default: {
454
- normal: {
455
- border: 'solid',
456
- color: '#121212',
457
- width: '1px',
458
- borderWidth: '1px'
459
- },
460
- hover: {
461
- border: 'solid',
462
- color: '#121212',
463
- width: '1px',
464
- borderWidth: '1px'
465
- }
466
- }
432
+ normal: {
433
+ border: 'solid',
434
+ color: '#121212',
435
+ width: '1px',
436
+ borderWidth: '1px'
437
+ },
438
+ hover: {
439
+ border: 'solid',
440
+ color: '#121212',
441
+ width: '1px',
442
+ borderWidth: '1px'
467
443
  }
468
444
  }
469
445
  },
470
446
  {
471
447
  id: 'roundedBtnV2',
472
448
  type: 'corner-v2',
473
- devices: {
474
- desktop: {
475
- default: {
476
- normal: {
477
- btrr: '0px',
478
- bblr: '0px',
479
- bbrr: '0px',
480
- btlr: '0px',
481
- radiusType: 'none'
482
- }
483
- }
449
+ default: {
450
+ normal: {
451
+ btrr: '0px',
452
+ bblr: '0px',
453
+ bbrr: '0px',
454
+ btlr: '0px',
455
+ radiusType: 'none'
484
456
  }
485
457
  },
486
458
  compoDefaultValue: {
487
- desktop: {
488
- default: {
489
- normal: {
490
- btrr: '8px',
491
- bblr: '8px',
492
- bbrr: '8px',
493
- btlr: '8px',
494
- radiusType: 'rounded'
495
- }
496
- }
459
+ normal: {
460
+ btrr: '8px',
461
+ bblr: '8px',
462
+ bbrr: '8px',
463
+ btlr: '8px',
464
+ radiusType: 'rounded'
497
465
  }
498
466
  }
499
467
  },
500
468
  {
501
469
  id: 'boxShadowBtnV2',
502
470
  type: 'shadow-v2',
503
- devices: {
504
- desktop: {
505
- default: {
506
- normal: {}
507
- }
508
- }
471
+ default: {
472
+ normal: {}
509
473
  },
510
474
  compoDefaultValue: {
511
- desktop: {
512
- default: {
513
- normal: {
514
- type: 'shadow-1',
515
- distance: '4px',
516
- blur: '4px',
517
- spread: '0px',
518
- color: 'rgba(18, 18, 18, 0.2)',
519
- angle: 45,
520
- enable: true
521
- }
522
- }
475
+ normal: {
476
+ type: 'shadow-1',
477
+ distance: '4px',
478
+ blur: '4px',
479
+ spread: '0px',
480
+ color: 'rgba(18, 18, 18, 0.2)',
481
+ angle: 45,
482
+ enable: true
523
483
  }
524
484
  }
525
485
  }