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