@gem-sdk/components 2.0.0-dev.393 → 2.0.0-dev.395

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 (43) hide show
  1. package/dist/cjs/builder.js +4 -4
  2. package/dist/cjs/index.js +30 -30
  3. package/dist/cjs/index.liquid.js +4 -4
  4. package/dist/cjs/product/components/ProductBundle/common/styles.js +22 -6
  5. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +2 -1
  6. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
  7. package/dist/cjs/product/components/ProductBundle/setting/ProductBundleDiscount.js +47 -415
  8. package/dist/cjs/product/components/ProductBundle/setting/uiV1.js +404 -0
  9. package/dist/cjs/product/components/ProductBundle/setting/uiV2.js +728 -0
  10. package/dist/cjs/product/components/ProductDiscountTag/common/getClasses.js +38 -0
  11. package/dist/cjs/product/components/ProductDiscountTag/common/getStyle.js +42 -0
  12. package/dist/cjs/product/components/ProductDiscountTag/hooks/useGpDiscountTag.js +108 -0
  13. package/dist/cjs/product/components/ProductDiscountTag/index.js +110 -0
  14. package/dist/cjs/product/components/ProductDiscountTag/index.liquid.js +91 -0
  15. package/dist/cjs/product/index.js +4 -4
  16. package/dist/cjs/product/next.js +1 -1
  17. package/dist/cjs/product/setting/ProductTag.js +7 -299
  18. package/dist/cjs/product/setting/product-discount-tag/configs/settings.js +191 -0
  19. package/dist/cjs/product/setting/product-discount-tag/configs/uiV2.js +190 -0
  20. package/dist/esm/builder.js +1 -1
  21. package/dist/esm/index.js +1 -1
  22. package/dist/esm/index.liquid.js +1 -1
  23. package/dist/esm/product/components/ProductBundle/common/styles.js +23 -7
  24. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +2 -1
  25. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
  26. package/dist/esm/product/components/ProductBundle/setting/ProductBundleDiscount.js +47 -415
  27. package/dist/esm/product/components/ProductBundle/setting/uiV1.js +400 -0
  28. package/dist/esm/product/components/ProductBundle/setting/uiV2.js +724 -0
  29. package/dist/esm/product/components/ProductDiscountTag/common/getClasses.js +33 -0
  30. package/dist/esm/product/components/ProductDiscountTag/common/getStyle.js +38 -0
  31. package/dist/esm/product/components/ProductDiscountTag/hooks/useGpDiscountTag.js +106 -0
  32. package/dist/esm/product/components/ProductDiscountTag/index.js +106 -0
  33. package/dist/esm/product/components/ProductDiscountTag/index.liquid.js +87 -0
  34. package/dist/esm/product/next.js +1 -1
  35. package/dist/esm/product/setting/ProductTag.js +7 -299
  36. package/dist/esm/product/setting/product-discount-tag/configs/settings.js +189 -0
  37. package/dist/esm/product/setting/product-discount-tag/configs/uiV2.js +188 -0
  38. package/dist/types/index.d.ts +2 -0
  39. package/package.json +1 -1
  40. package/dist/cjs/product/components/ProductTag/ProductTag.js +0 -200
  41. package/dist/cjs/product/components/ProductTag/ProductTag.liquid.js +0 -107
  42. package/dist/esm/product/components/ProductTag/ProductTag.js +0 -196
  43. package/dist/esm/product/components/ProductTag/ProductTag.liquid.js +0 -103
package/dist/esm/index.js CHANGED
@@ -178,7 +178,7 @@ export { default as ProductImages } from './product/components/ProductImages.js'
178
178
  export { default as ProductImagesV2 } from './product/components/ProductImagesV2/index.js';
179
179
  export { default as ProductPropertyInput } from './product/components/ProductProperties/ProductProperties.js';
180
180
  export { default as ProductQuickView } from './product/components/ProductQuickView/index.js';
181
- export { default as ProductTag } from './product/components/ProductTag/ProductTag.js';
181
+ export { default as ProductTag } from './product/components/ProductDiscountTag/index.js';
182
182
  export { default as ProductList } from './product/components/ProductList/ProductList.js';
183
183
  export { default as ProductVendor } from './product/components/ProductVendor/Vendor.js';
184
184
  export { default as DynamicCheckout } from './product/components/DynamicCheckout/DynamicCheckout.js';
@@ -68,7 +68,7 @@ export { default as ProductDescription } from './product/components/ProductDescr
68
68
  export { default as ProductImages } from './product/components/ProductImages.liquid.js';
69
69
  export { default as ProductQuantity } from './product/components/ProductQuantity/index.liquid.js';
70
70
  export { default as ProductVariants } from './product/components/ProductVariants/index.liquid.js';
71
- export { default as ProductTag } from './product/components/ProductTag/ProductTag.liquid.js';
71
+ export { default as ProductTag } from './product/components/ProductDiscountTag/index.liquid.js';
72
72
  export { default as ProductImagesV2 } from './product/components/ProductImagesV2/index.liquid.js';
73
73
  export { default as ProductList } from './product/components/ProductList/ProductList.liquid.js';
74
74
  export { ProductPrice } from './product/components/ProductPrice/index.liquid.js';
@@ -1,7 +1,12 @@
1
- import { composeClasses, makeGlobalSize, makeStyle, makeStyleState, composeRadius, getStyleShadowState, getStyleShadow, getBorderStyle, handleConvertBorderWidth, handleConvertBorderStyle, handleConvertBorderColor, getRadiusStyleActiveState, makeStyleResponsive, getGlobalColorStateStyle } from '@gem-sdk/core';
1
+ import { composeClasses, makeGlobalSize, makeStyle, getStyleShadowState, makeStyleState, composeRadius, getStyleShadow, getBorderStyle, handleConvertBorderWidth, handleConvertBorderStyle, handleConvertBorderColor, getRadiusStyleActiveState, makeStyleResponsive, getGlobalColorStateStyle } from '@gem-sdk/core';
2
2
 
3
3
  const getSizeSettings = (styles)=>makeGlobalSize(styles?.size);
4
4
  const getItemWrapStyles = (styles, isSelected)=>{
5
+ console.log('shadown', getStyleShadowState(styles?.boxShadowBundle, 'box-shadow', {
6
+ normal: true,
7
+ active: true,
8
+ hover: true
9
+ }));
5
10
  return {
6
11
  ...getSizeSettings(styles).width,
7
12
  ...getSizeSettings(styles).padding,
@@ -10,16 +15,20 @@ const getItemWrapStyles = (styles, isSelected)=>{
10
15
  bg: isSelected ? styles?.backgroundColor?.active : styles?.backgroundColor?.normal
11
16
  }),
12
17
  ...composeRadius(styles?.roundedBundle),
13
- ...getStyleShadowState(styles?.boxShadowBundle, 'box-shadow', styles?.hasBoxShadowBundle),
18
+ ...getStyleShadowState(styles?.boxShadowBundle, 'box-shadow', {
19
+ normal: true,
20
+ active: true,
21
+ hover: true
22
+ }),
14
23
  ...isSelected ? getStyleShadow({
15
24
  value: styles?.boxShadowBundle?.active,
16
25
  styleAppliedFor: 'box-shadow',
17
- isEnableShadow: styles?.hasBoxShadowBundle?.active
26
+ isEnableShadow: true
18
27
  }) : {
19
28
  ...getStyleShadow({
20
29
  value: styles?.boxShadowBundle?.normal,
21
30
  styleAppliedFor: 'box-shadow',
22
- isEnableShadow: styles?.hasBoxShadowBundle?.normal
31
+ isEnableShadow: true
23
32
  })
24
33
  },
25
34
  ...isSelected ? getBorderStyle(styles?.borderBundle?.active) : {
@@ -55,9 +64,12 @@ const getSvgActiveStyles = (styles)=>{
55
64
  })
56
65
  };
57
66
  };
58
- const getSvgStyles = (styles)=>{
67
+ const getSvgStyles = (settings, styles)=>{
59
68
  return {
60
- ...getGlobalColorStateStyle('c', styles?.iconColor)
69
+ ...getGlobalColorStateStyle('c', {
70
+ ...styles?.iconColor,
71
+ normal: settings?.iconItemColor ? settings?.iconItemColor : styles?.iconColor?.normal
72
+ })
61
73
  };
62
74
  };
63
75
  const getAlignStyle = (styles)=>{
@@ -71,7 +83,11 @@ const getAlignStyle = (styles)=>{
71
83
  const getFlexChildren = composeClasses('gp-flex-1');
72
84
  const getContainerStyles = (composeSizeStyles, styles, style)=>{
73
85
  return {
74
- ...composeSizeStyles,
86
+ ...styles?.itemSpacing ? {
87
+ ...makeStyle({
88
+ gg: styles?.itemSpacing
89
+ })
90
+ } : composeSizeStyles,
75
91
  ...getAlignStyle(styles),
76
92
  ...style
77
93
  };
@@ -10,10 +10,11 @@ const ProductBundleDiscountChildrenItem = (props)=>{
10
10
  const composeLayoutClasses = createClass(getLayoutClasses(setting));
11
11
  const composeIconStyles = createStyle(getIconStyles(setting));
12
12
  const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
13
- const composeSvgStyles = createStyle(getSvgStyles(styles));
13
+ const composeSvgStyles = createStyle(getSvgStyles(setting, styles));
14
14
  const composeIconSectionClasses = createClass(getIconSectionClasses);
15
15
  const composeItemClasses = createClass(getItemClasses);
16
16
  const composeFlexChildren = createClass(getFlexChildren);
17
+ console.log('composeItemWrapStyles', composeItemWrapStyles);
17
18
  return /*#__PURE__*/ jsx("div", {
18
19
  "aria-hidden": true,
19
20
  onClick: ()=>setSelected?.(index),
@@ -9,7 +9,7 @@ const ProductBundleDiscountChildrenItemLiquid = (props)=>{
9
9
  const composeLayoutClasses = createClass(getLayoutClasses(setting));
10
10
  const composeIconStyles = createStyle(getIconStyles(setting));
11
11
  const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
12
- const composeSvgStyles = createStyle(getSvgStyles(styles));
12
+ const composeSvgStyles = createStyle(getSvgStyles(setting, styles));
13
13
  const composeIconSectionClasses = createClass(getIconSectionClasses);
14
14
  const composeItemClasses = createClass(getItemClasses);
15
15
  const composeFlexChildren = createClass(getFlexChildren);
@@ -4,6 +4,8 @@ import { verticalThree } from '../../../setting/constant/bundle-layout/verticalT
4
4
  import { horizontalThree } from '../../../setting/constant/bundle-layout/horizontalThree.js';
5
5
  import { horizontalTwo } from '../../../setting/constant/bundle-layout/horizontalTwo.js';
6
6
  import { horizontalOne } from '../../../setting/constant/bundle-layout/horizontalOne.js';
7
+ import ControlUIV2 from './uiV2.js';
8
+ import ControlUIV1 from './uiV1.js';
7
9
 
8
10
  const config = {
9
11
  tag: 'ProductBundleDiscount',
@@ -168,12 +170,42 @@ const config = {
168
170
  showValue: true
169
171
  }
170
172
  ]
173
+ },
174
+ {
175
+ id: 'iconItemColor',
176
+ type: 'color-picker-v2',
177
+ label: 'Icon',
178
+ default: 'line-2'
171
179
  }
172
180
  ]
173
181
  },
174
182
  {
175
183
  id: 'style',
176
184
  controls: [
185
+ {
186
+ id: 'itemSpacing',
187
+ type: 'dropdown:input',
188
+ hideUnit: false,
189
+ inputType: 'number',
190
+ default: '12px',
191
+ displayOptions: [
192
+ {
193
+ label: 'Small',
194
+ value: '8px',
195
+ showValue: true
196
+ },
197
+ {
198
+ label: 'Medium',
199
+ value: '16px',
200
+ showValue: true
201
+ },
202
+ {
203
+ label: 'Large',
204
+ value: '24px',
205
+ showValue: true
206
+ }
207
+ ]
208
+ },
177
209
  {
178
210
  id: 'size',
179
211
  type: 'size-setting',
@@ -187,7 +219,7 @@ const config = {
187
219
  bottom: '24px',
188
220
  right: '16px'
189
221
  },
190
- gap: '12px',
222
+ // gap: '12px',
191
223
  width: '100%'
192
224
  }
193
225
  }
@@ -199,19 +231,15 @@ const config = {
199
231
  'full'
200
232
  ]
201
233
  },
202
- gap: {
203
- name: 'Item gap',
204
- displayOptions: [
205
- 'small',
206
- 'medium',
207
- 'large'
208
- ],
209
- sizeConfig: {
210
- small: '8px',
211
- medium: '16px',
212
- large: '24px'
213
- }
214
- },
234
+ // gap: {
235
+ // name: 'Item gap',
236
+ // displayOptions: ['small', 'medium', 'large'],
237
+ // sizeConfig: {
238
+ // small: '8px',
239
+ // medium: '16px',
240
+ // large: '24px',
241
+ // },
242
+ // },
215
243
  padding: {
216
244
  name: 'Padding',
217
245
  paddingConfig: {
@@ -275,7 +303,7 @@ const config = {
275
303
  },
276
304
  {
277
305
  id: 'iconColor',
278
- type: 'colorpicker',
306
+ type: 'color-picker-v2',
279
307
  label: 'Icon',
280
308
  default: {
281
309
  normal: '#B4B4B4',
@@ -289,7 +317,7 @@ const config = {
289
317
  },
290
318
  {
291
319
  id: 'backgroundColor',
292
- type: 'background-color-picker',
320
+ type: 'color-picker-v2',
293
321
  label: 'Background',
294
322
  default: {
295
323
  normal: '#FFFFFF',
@@ -318,7 +346,7 @@ const config = {
318
346
  },
319
347
  {
320
348
  id: 'boxShadowBundle',
321
- type: 'boxShadow',
349
+ type: 'shadow-v2',
322
350
  hideOnState: {
323
351
  normal: true,
324
352
  hover: true,
@@ -383,404 +411,8 @@ const config = {
383
411
  ]
384
412
  }
385
413
  ],
386
- ui: [
387
- {
388
- type: 'group',
389
- label: {
390
- en: 'Item management'
391
- },
392
- controls: [
393
- {
394
- type: 'control',
395
- layout: 'vertical',
396
- setting: {
397
- id: 'childItem'
398
- }
399
- }
400
- ]
401
- },
402
- {
403
- type: 'control',
404
- label: {
405
- en: 'Use product compare-at price'
406
- },
407
- setting: {
408
- id: 'useProductCompareAtPrice'
409
- }
410
- },
411
- {
412
- type: 'control',
413
- label: {
414
- en: 'Hide no-discount items'
415
- },
416
- setting: {
417
- id: 'hideNoDiscountItem'
418
- }
419
- },
420
- {
421
- type: 'group',
422
- label: {
423
- en: ''
424
- },
425
- controls: [
426
- {
427
- type: 'control',
428
- label: {
429
- en: 'Pre-selected item'
430
- },
431
- setting: {
432
- id: 'hasPreSelectItem'
433
- },
434
- options: {
435
- label: 'large',
436
- styleControl: {
437
- width: 'auto'
438
- }
439
- }
440
- },
441
- {
442
- type: 'control',
443
- condition: 'hasPreSelectItem == true',
444
- layout: 'vertical',
445
- setting: {
446
- id: 'selectItemDefault'
447
- },
448
- options: {
449
- styleControl: {
450
- 'max-width': '100%'
451
- }
452
- }
453
- }
454
- ]
455
- },
456
- {
457
- type: 'group',
458
- controls: [
459
- {
460
- type: 'control',
461
- label: {
462
- en: 'Icon'
463
- },
464
- options: {
465
- label: 'large'
466
- },
467
- setting: {
468
- id: 'enableIcon'
469
- }
470
- },
471
- {
472
- type: 'control',
473
- condition: 'enableIcon == true && layout == "vertical-layout"',
474
- label: {
475
- en: 'Icon position'
476
- },
477
- setting: {
478
- id: 'iconPosition'
479
- }
480
- },
481
- {
482
- type: 'control',
483
- condition: 'enableIcon == true && layout == "horizontal-layout"',
484
- label: {
485
- en: 'Icon position'
486
- },
487
- setting: {
488
- id: 'iconHorizontalPosition'
489
- }
490
- },
491
- {
492
- type: 'control',
493
- condition: 'enableIcon == true',
494
- label: {
495
- en: 'Icon size'
496
- },
497
- setting: {
498
- id: 'iconSize'
499
- }
500
- },
501
- {
502
- type: 'control',
503
- condition: 'enableIcon == true',
504
- label: {
505
- en: 'Icon spacing'
506
- },
507
- setting: {
508
- id: 'iconSpacing'
509
- }
510
- }
511
- ]
512
- },
513
- {
514
- label: {
515
- en: 'Size'
516
- },
517
- type: 'group',
518
- controls: [
519
- {
520
- type: 'control',
521
- setting: {
522
- id: 'size'
523
- },
524
- options: {
525
- noGap: true
526
- }
527
- }
528
- ]
529
- },
530
- {
531
- type: 'group',
532
- label: {
533
- en: 'Item states'
534
- },
535
- options: {
536
- labelSpacing: 'small'
537
- },
538
- controls: [
539
- {
540
- type: 'tab',
541
- controls: [
542
- {
543
- type: 'group',
544
- label: {
545
- en: 'Default'
546
- },
547
- controls: [
548
- {
549
- type: 'control',
550
- label: {
551
- en: 'Icon'
552
- },
553
- setting: {
554
- id: 'iconColor',
555
- state: 'normal'
556
- }
557
- },
558
- {
559
- type: 'control',
560
- label: {
561
- en: 'Background'
562
- },
563
- setting: {
564
- id: 'backgroundColor',
565
- state: 'normal'
566
- }
567
- },
568
- {
569
- type: 'control',
570
- options: {
571
- labelPosition: 'start'
572
- },
573
- label: {
574
- en: 'Border'
575
- },
576
- setting: {
577
- id: 'borderBundle',
578
- state: 'normal'
579
- }
580
- },
581
- {
582
- type: 'control',
583
- label: {
584
- en: 'Corner'
585
- },
586
- setting: {
587
- id: 'roundedBundle',
588
- state: 'normal'
589
- }
590
- },
591
- {
592
- type: 'control',
593
- label: {
594
- en: 'Shadow'
595
- },
596
- setting: {
597
- id: 'hasBoxShadowBundle',
598
- state: 'normal'
599
- }
600
- },
601
- {
602
- type: 'group',
603
- condition: 'hasBoxShadowBundle.normal == true',
604
- controls: [
605
- {
606
- type: 'control',
607
- layout: 'vertical',
608
- setting: {
609
- id: 'boxShadowBundle',
610
- state: 'normal'
611
- }
612
- }
613
- ]
614
- }
615
- ]
616
- },
617
- {
618
- type: 'group',
619
- label: {
620
- en: 'Hover'
621
- },
622
- controls: [
623
- {
624
- type: 'control',
625
- label: {
626
- en: 'Icon'
627
- },
628
- setting: {
629
- id: 'iconColor',
630
- state: 'hover'
631
- }
632
- },
633
- {
634
- type: 'control',
635
- label: {
636
- en: 'Background'
637
- },
638
- setting: {
639
- id: 'backgroundColor',
640
- state: 'hover'
641
- }
642
- },
643
- {
644
- type: 'control',
645
- options: {
646
- labelPosition: 'start'
647
- },
648
- label: {
649
- en: 'Border'
650
- },
651
- setting: {
652
- id: 'borderBundle',
653
- state: 'hover'
654
- }
655
- },
656
- {
657
- type: 'control',
658
- label: {
659
- en: 'Corner'
660
- },
661
- setting: {
662
- id: 'roundedBundle',
663
- state: 'hover'
664
- }
665
- },
666
- {
667
- type: 'control',
668
- label: {
669
- en: 'Shadow'
670
- },
671
- setting: {
672
- id: 'hasBoxShadowBundle',
673
- state: 'hover'
674
- }
675
- },
676
- {
677
- type: 'group',
678
- condition: 'hasBoxShadowBundle.hover == true',
679
- controls: [
680
- {
681
- type: 'control',
682
- setting: {
683
- id: 'boxShadowBundle',
684
- state: 'hover'
685
- },
686
- layout: 'vertical'
687
- }
688
- ]
689
- }
690
- ]
691
- },
692
- {
693
- type: 'group',
694
- label: {
695
- en: 'Active'
696
- },
697
- controls: [
698
- {
699
- type: 'control',
700
- label: {
701
- en: 'Icon'
702
- },
703
- setting: {
704
- id: 'iconColor',
705
- state: 'active'
706
- }
707
- },
708
- {
709
- type: 'control',
710
- label: {
711
- en: 'Background'
712
- },
713
- setting: {
714
- id: 'backgroundColor',
715
- state: 'active'
716
- }
717
- },
718
- {
719
- type: 'control',
720
- options: {
721
- labelPosition: 'start'
722
- },
723
- label: {
724
- en: 'Border'
725
- },
726
- setting: {
727
- id: 'borderBundle',
728
- state: 'active'
729
- }
730
- },
731
- {
732
- type: 'control',
733
- label: {
734
- en: 'Corner'
735
- },
736
- setting: {
737
- id: 'roundedBundle',
738
- state: 'active'
739
- }
740
- },
741
- {
742
- type: 'control',
743
- label: {
744
- en: 'Shadow'
745
- },
746
- setting: {
747
- id: 'hasBoxShadowBundle',
748
- state: 'active'
749
- }
750
- },
751
- {
752
- type: 'group',
753
- condition: 'hasBoxShadowBundle.active == true',
754
- controls: [
755
- {
756
- type: 'control',
757
- setting: {
758
- id: 'boxShadowBundle',
759
- state: 'active'
760
- },
761
- layout: 'vertical'
762
- }
763
- ]
764
- }
765
- ]
766
- }
767
- ]
768
- }
769
- ]
770
- },
771
- {
772
- type: 'control',
773
- label: {
774
- en: 'Align'
775
- },
776
- options: {
777
- label: 'large'
778
- },
779
- setting: {
780
- id: 'align'
781
- }
782
- }
783
- ],
414
+ ui: ControlUIV1,
415
+ uiV2: ControlUIV2,
784
416
  editorConfigs: {
785
417
  placeholder: {
786
418
  flowTag: [