@gem-sdk/components 2.5.6 → 2.6.0-staging.13
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.
- package/dist/cjs/banner/components/hero-banner/index.liquid.js +13 -2
- package/dist/cjs/banner/setting/HeroBanner.js +50 -6
- package/dist/cjs/banner/setting/presets/heroBanner1ColPreSalesPage.js +134 -0
- package/dist/cjs/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +154 -0
- package/dist/cjs/banner/setting/presets/heroBannerContentRightPreSalesPage.js +162 -0
- package/dist/cjs/banner/setting/presets/heroBannerParallaxPreSalesPage.js +134 -0
- package/dist/cjs/banner/setting/presets/heroBannerVideoPreSalesPage.js +130 -0
- package/dist/cjs/button/components/Button.liquid.js +11 -2
- package/dist/cjs/button/setting/Button.js +112 -5
- package/dist/cjs/carousel/components/CarouselItem.js +1 -1
- package/dist/cjs/carousel/components/CarouselItem.liquid.js +1 -1
- package/dist/cjs/constants.js +5 -0
- package/dist/cjs/grid/components/Row.js +4 -3
- package/dist/cjs/grid/components/Row.liquid.js +2 -1
- package/dist/cjs/grid/setting/Row.js +31 -0
- package/dist/cjs/icon/components/Icon.liquid.js +10 -2
- package/dist/cjs/icon/setting/Icon.js +69 -5
- package/dist/cjs/image/components/Image.js +4 -1
- package/dist/cjs/image/components/Image.liquid.js +12 -3
- package/dist/cjs/image/helpers/getSrcSet.js +2 -2
- package/dist/cjs/image/setting/Image.js +216 -16
- package/dist/cjs/post-purchase/button/Button.js +1 -1
- package/dist/cjs/text/setting/Text.js +2 -1
- package/dist/cjs/third-party/components/Trustoo.liquid.js +24 -7
- package/dist/cjs/third-party/setting/Trustoo.js +4 -111
- package/dist/esm/banner/components/hero-banner/index.liquid.js +13 -2
- package/dist/esm/banner/setting/HeroBanner.js +50 -6
- package/dist/esm/banner/setting/presets/heroBanner1ColPreSalesPage.js +132 -0
- package/dist/esm/banner/setting/presets/heroBannerContentLeftPreSalesPage.js +152 -0
- package/dist/esm/banner/setting/presets/heroBannerContentRightPreSalesPage.js +160 -0
- package/dist/esm/banner/setting/presets/heroBannerParallaxPreSalesPage.js +132 -0
- package/dist/esm/banner/setting/presets/heroBannerVideoPreSalesPage.js +128 -0
- package/dist/esm/button/components/Button.liquid.js +11 -2
- package/dist/esm/button/setting/Button.js +112 -5
- package/dist/esm/carousel/components/CarouselItem.js +1 -1
- package/dist/esm/carousel/components/CarouselItem.liquid.js +1 -1
- package/dist/esm/constants.js +3 -0
- package/dist/esm/grid/components/Row.js +4 -3
- package/dist/esm/grid/components/Row.liquid.js +2 -1
- package/dist/esm/grid/setting/Row.js +31 -0
- package/dist/esm/icon/components/Icon.liquid.js +10 -2
- package/dist/esm/icon/setting/Icon.js +69 -5
- package/dist/esm/image/components/Image.js +5 -2
- package/dist/esm/image/components/Image.liquid.js +12 -3
- package/dist/esm/image/helpers/getSrcSet.js +2 -2
- package/dist/esm/image/setting/Image.js +216 -16
- package/dist/esm/post-purchase/button/Button.js +1 -1
- package/dist/esm/text/setting/Text.js +2 -1
- package/dist/esm/third-party/components/Trustoo.liquid.js +24 -7
- package/dist/esm/third-party/setting/Trustoo.js +4 -111
- package/dist/types/index.d.ts +31 -2
- package/package.json +3 -3
|
@@ -21,6 +21,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
21
21
|
};
|
|
22
22
|
const imageWidth = shape ? core.makeStyleResponsive('w', core.getWidthByShapeGlobalSize(shape)) : core.makeStyleResponsive('w', core.makeWidth(styles?.width, styles?.fullWidth));
|
|
23
23
|
const imageHeight = core.makeStyleResponsive('h', core.getHeightByShapeGlobalSize(shape));
|
|
24
|
+
const imageFlexGrowClass = core.getFlexGrowClassByShapeGlobalSize(shape);
|
|
24
25
|
const overwriteDefaultRadius = (cornerRadius)=>{
|
|
25
26
|
const radius = {
|
|
26
27
|
...cornerRadius
|
|
@@ -61,7 +62,9 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
61
62
|
"data-id": builderProps?.uid,
|
|
62
63
|
onClick: onClick,
|
|
63
64
|
role: "presentation",
|
|
64
|
-
className: core.cls('gp-group/image gp-relative', builderProps?.uid
|
|
65
|
+
className: core.cls('gp-group/image gp-relative', builderProps?.uid, {
|
|
66
|
+
...imageFlexGrowClass
|
|
67
|
+
}),
|
|
65
68
|
style: {
|
|
66
69
|
...style,
|
|
67
70
|
...core.makeStyleResponsive('ta', styles?.align)
|
|
@@ -6,11 +6,20 @@ var core = require('@gem-sdk/core');
|
|
|
6
6
|
var AdaptiveImage_liquid = require('./AdaptiveImage.liquid.js');
|
|
7
7
|
var NextImage_liquid = require('./NextImage.liquid.js');
|
|
8
8
|
var helpers = require('../../helpers.js');
|
|
9
|
+
var constants = require('../../constants.js');
|
|
9
10
|
|
|
10
11
|
const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyloadImage = true })=>{
|
|
11
|
-
const { imageLink, isNotLazyload } = setting ?? {};
|
|
12
|
+
const { imageLink, isNotLazyload, isGoToSalesPage } = setting ?? {};
|
|
13
|
+
let { Wrap: WrapLink, urlData, shouldRenderLink } = helpers.getInsertLinkData('div', imageLink);
|
|
14
|
+
if (isGoToSalesPage) {
|
|
15
|
+
WrapLink = 'a';
|
|
16
|
+
urlData = {
|
|
17
|
+
href: constants.HREF_TO_SALES_PAGE,
|
|
18
|
+
target: '_self'
|
|
19
|
+
};
|
|
20
|
+
shouldRenderLink = true;
|
|
21
|
+
}
|
|
12
22
|
const { shape } = styles ?? {};
|
|
13
|
-
const { Wrap: WrapLink, urlData } = helpers.getInsertLinkData('div', imageLink);
|
|
14
23
|
const overwriteDefaultRadius = (cornerRadius)=>{
|
|
15
24
|
const radius = {
|
|
16
25
|
...cornerRadius
|
|
@@ -42,7 +51,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
|
|
|
42
51
|
>
|
|
43
52
|
<${WrapLink}
|
|
44
53
|
class="pointer-events-auto h-full gp-flex"
|
|
45
|
-
${
|
|
54
|
+
${shouldRenderLink ? {
|
|
46
55
|
...urlData,
|
|
47
56
|
title: setting?.title
|
|
48
57
|
} : {}}
|
|
@@ -34,7 +34,7 @@ const getSrcSetLink = (link)=>{
|
|
|
34
34
|
// return `${link} 768w,${link} 1024w,${link} 1440w`;
|
|
35
35
|
};
|
|
36
36
|
const getImageSrc = (image, currentDevice)=>{
|
|
37
|
-
let src = image?.backupFilePath;
|
|
37
|
+
let src = image?.backupFilePath ?? image?.src;
|
|
38
38
|
if (image?.backupFileKey) {
|
|
39
39
|
const newBackupFileKey = getNewBackupFileKey(image.backupFileKey, image?.src ?? '');
|
|
40
40
|
if (image.storage === 'THEME' || !image.storage) {
|
|
@@ -53,7 +53,7 @@ const getImageSrc = (image, currentDevice)=>{
|
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
return src
|
|
56
|
+
return src;
|
|
57
57
|
};
|
|
58
58
|
const regexReplaceEndDot = /\.(?=[^.]*$)/;
|
|
59
59
|
const replaceBackupFileKeyFileContent = (backupFileKey)=>{
|
|
@@ -64,6 +64,17 @@ const config = {
|
|
|
64
64
|
target: '_self'
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
id: 'isGoToSalesPage',
|
|
69
|
+
type: 'toggle',
|
|
70
|
+
label: 'Go to Sales page',
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'linkedToPreSalesPageBanner',
|
|
75
|
+
type: 'banner-pre-sales-page',
|
|
76
|
+
default: false
|
|
77
|
+
},
|
|
67
78
|
{
|
|
68
79
|
id: 'seo',
|
|
69
80
|
type: 'group',
|
|
@@ -137,6 +148,15 @@ const config = {
|
|
|
137
148
|
displayOptions: [
|
|
138
149
|
'full'
|
|
139
150
|
]
|
|
151
|
+
},
|
|
152
|
+
height: {
|
|
153
|
+
displayOptions: [
|
|
154
|
+
'full'
|
|
155
|
+
],
|
|
156
|
+
units: [
|
|
157
|
+
'px',
|
|
158
|
+
'%'
|
|
159
|
+
]
|
|
140
160
|
}
|
|
141
161
|
},
|
|
142
162
|
hiddenSettings: [
|
|
@@ -394,14 +414,37 @@ const config = {
|
|
|
394
414
|
]
|
|
395
415
|
},
|
|
396
416
|
{
|
|
397
|
-
type: '
|
|
417
|
+
type: 'group',
|
|
398
418
|
label: {
|
|
399
419
|
en: 'Insert link'
|
|
400
420
|
},
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
421
|
+
controls: [
|
|
422
|
+
{
|
|
423
|
+
type: 'control',
|
|
424
|
+
condition: 'pageType == "GP_PRE_SALE_PAGE"',
|
|
425
|
+
setting: {
|
|
426
|
+
id: 'linkedToPreSalesPageBanner'
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
type: 'control',
|
|
431
|
+
condition: 'pageType == "GP_PRE_SALE_PAGE"',
|
|
432
|
+
setting: {
|
|
433
|
+
id: 'isGoToSalesPage'
|
|
434
|
+
},
|
|
435
|
+
label: {
|
|
436
|
+
en: 'Go to Sales page'
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
type: 'control',
|
|
441
|
+
condition: 'isGoToSalesPage === false || pageType != "GP_PRE_SALE_PAGE"',
|
|
442
|
+
layout: 'vertical',
|
|
443
|
+
setting: {
|
|
444
|
+
id: 'imageLink'
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
]
|
|
405
448
|
},
|
|
406
449
|
{
|
|
407
450
|
type: 'group',
|
|
@@ -607,19 +650,19 @@ const config = {
|
|
|
607
650
|
}
|
|
608
651
|
},
|
|
609
652
|
borderRadius: {
|
|
610
|
-
btrr:
|
|
611
|
-
bblr:
|
|
612
|
-
bbrr:
|
|
613
|
-
btlr:
|
|
614
|
-
radiusType:
|
|
653
|
+
btrr: '999999px',
|
|
654
|
+
bblr: '999999px',
|
|
655
|
+
bbrr: '999999px',
|
|
656
|
+
btlr: '999999px',
|
|
657
|
+
radiusType: 'custom'
|
|
615
658
|
},
|
|
616
659
|
wrapperBorder: {
|
|
617
|
-
borderType:
|
|
618
|
-
border:
|
|
619
|
-
width:
|
|
620
|
-
position:
|
|
621
|
-
borderWidth:
|
|
622
|
-
color:
|
|
660
|
+
borderType: 'none',
|
|
661
|
+
border: 'none',
|
|
662
|
+
width: '1px 1px 1px 1px',
|
|
663
|
+
position: 'all',
|
|
664
|
+
borderWidth: '1px',
|
|
665
|
+
color: '#000000',
|
|
623
666
|
isCustom: true
|
|
624
667
|
}
|
|
625
668
|
},
|
|
@@ -637,6 +680,163 @@ const config = {
|
|
|
637
680
|
}
|
|
638
681
|
}
|
|
639
682
|
]
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
id: 'image-pre-sales-page',
|
|
686
|
+
name: {
|
|
687
|
+
en: 'Image'
|
|
688
|
+
},
|
|
689
|
+
icon: {
|
|
690
|
+
desktop: `
|
|
691
|
+
<svg width="96" height="48" viewBox="0 0 96 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
692
|
+
<rect width="96" height="48" rx="3" fill="#424242"/>
|
|
693
|
+
<circle cx="37" cy="17" r="3" fill="#D6D6D6"/>
|
|
694
|
+
<path d="M32.42 30.9518L37.1407 25.1338C37.3005 24.9364 37.498 24.7768 37.7203 24.6653C37.9427 24.5538 38.1848 24.4929 38.431 24.4866C38.6772 24.4803 38.9218 24.5287 39.149 24.6287C39.3762 24.7288 39.5809 24.8781 39.7496 25.0671L41.957 27.5361L50.5857 16.6629C50.7546 16.4499 50.967 16.2797 51.2069 16.165C51.4469 16.0503 51.7083 15.9941 51.9718 16.0005C52.2352 16.0069 52.4939 16.0758 52.7285 16.202C52.9632 16.3283 53.1679 16.5086 53.3273 16.7297L63.6435 31.0236C63.8408 31.2976 63.9615 31.6242 63.9922 31.9666C64.0229 32.3089 63.9623 32.6535 63.8173 32.9616C63.6723 33.2697 63.4485 33.529 63.1712 33.7105C62.8939 33.8919 62.5741 33.9883 62.2476 33.9887L33.7537 34C33.4185 33.9999 33.0904 33.8986 32.8082 33.7082C32.526 33.5177 32.3014 33.2461 32.1611 32.9255C32.0208 32.6048 31.9706 32.2485 32.0165 31.8988C32.0624 31.549 32.2024 31.2204 32.42 30.9518Z" fill="#D6D6D6"/>
|
|
695
|
+
</svg>
|
|
696
|
+
`
|
|
697
|
+
},
|
|
698
|
+
components: [
|
|
699
|
+
{
|
|
700
|
+
tag: 'Image',
|
|
701
|
+
advanced: {
|
|
702
|
+
'spacing-setting': {
|
|
703
|
+
desktop: {
|
|
704
|
+
margin: {
|
|
705
|
+
bottom: 'var(--g-s-l)'
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
editorData: {
|
|
710
|
+
cssPlaceholder: '.{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}'
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
settings: {
|
|
714
|
+
isGoToSalesPage: true
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
],
|
|
718
|
+
flowTagComponents: {
|
|
719
|
+
Marquee: [
|
|
720
|
+
{
|
|
721
|
+
tag: 'Image',
|
|
722
|
+
styles: {
|
|
723
|
+
shape: {
|
|
724
|
+
desktop: {
|
|
725
|
+
width: 'auto',
|
|
726
|
+
height: 'auto'
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
enableBorder: 'none'
|
|
730
|
+
},
|
|
731
|
+
advanced: {
|
|
732
|
+
'spacing-setting': {
|
|
733
|
+
desktop: {
|
|
734
|
+
margin: {
|
|
735
|
+
bottom: 'var(--g-s-l)'
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
editorData: {
|
|
740
|
+
rootClassName: '{{rootClassName}}',
|
|
741
|
+
css: '.{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}'
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
settings: {
|
|
745
|
+
isNotLazyload: true
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
]
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
id: 'image-circle-pre-sales-page',
|
|
753
|
+
name: {
|
|
754
|
+
en: 'Image'
|
|
755
|
+
},
|
|
756
|
+
icon: {
|
|
757
|
+
desktop: `
|
|
758
|
+
<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
759
|
+
<rect x="2" y="2" width="52" height="52" rx="26" fill="#424242"/>
|
|
760
|
+
<ellipse cx="20.4375" cy="22.9688" rx="2.0625" ry="1.96875" fill="#F9F9F9"/>
|
|
761
|
+
<path d="M17.2887 32.9997L20.5342 29.1816C20.6441 29.052 20.7799 28.9473 20.9327 28.8741C21.0856 28.8009 21.2521 28.761 21.4213 28.7568C21.5905 28.7527 21.7587 28.7845 21.915 28.8501C22.0712 28.9158 22.2118 29.0138 22.3278 29.1378L23.8454 30.758L29.7777 23.6225C29.8938 23.4827 30.0398 23.371 30.2048 23.2958C30.3697 23.2205 30.5495 23.1836 30.7306 23.1878C30.9117 23.192 31.0895 23.2372 31.2509 23.3201C31.4122 23.4029 31.5529 23.5213 31.6625 23.6663L38.7549 33.0467C38.8905 33.2266 38.9735 33.4409 38.9947 33.6656C39.0158 33.8902 38.9741 34.1164 38.8744 34.3186C38.7747 34.5207 38.6209 34.6909 38.4302 34.81C38.2396 34.9291 38.0197 34.9923 37.7952 34.9926L18.2057 35C17.9753 34.9999 17.7497 34.9334 17.5557 34.8085C17.3616 34.6835 17.2072 34.5053 17.1108 34.2948C17.0143 34.0844 16.9798 33.8506 17.0113 33.6211C17.0429 33.3915 17.1391 33.1759 17.2887 32.9997Z" fill="#F9F9F9"/>
|
|
762
|
+
</svg>
|
|
763
|
+
`
|
|
764
|
+
},
|
|
765
|
+
components: [
|
|
766
|
+
{
|
|
767
|
+
tag: 'Image',
|
|
768
|
+
settings: {
|
|
769
|
+
imageStyle: 'circle',
|
|
770
|
+
isGoToSalesPage: true
|
|
771
|
+
},
|
|
772
|
+
styles: {
|
|
773
|
+
shape: {
|
|
774
|
+
desktop: {
|
|
775
|
+
shape: 'square',
|
|
776
|
+
shapeValue: '1/1',
|
|
777
|
+
width: '80px',
|
|
778
|
+
shapeLinked: true
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
borderRadius: {
|
|
782
|
+
btrr: '999999px',
|
|
783
|
+
bblr: '999999px',
|
|
784
|
+
bbrr: '999999px',
|
|
785
|
+
btlr: '999999px',
|
|
786
|
+
radiusType: 'custom'
|
|
787
|
+
},
|
|
788
|
+
wrapperBorder: {
|
|
789
|
+
borderType: 'none',
|
|
790
|
+
border: 'none',
|
|
791
|
+
width: '1px 1px 1px 1px',
|
|
792
|
+
position: 'all',
|
|
793
|
+
borderWidth: '1px',
|
|
794
|
+
color: '#000000',
|
|
795
|
+
isCustom: true
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
advanced: {
|
|
799
|
+
'spacing-setting': {
|
|
800
|
+
desktop: {
|
|
801
|
+
margin: {
|
|
802
|
+
bottom: 'var(--g-s-l)'
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
editorData: {
|
|
807
|
+
cssplaceholder: '.{{rootClassName}} {\n\n}\n.{{rootClassName}} > figure > img {\n\n}'
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
],
|
|
812
|
+
rootOverride: {
|
|
813
|
+
styles: {
|
|
814
|
+
shape: {
|
|
815
|
+
desktop: {
|
|
816
|
+
shape: 'square',
|
|
817
|
+
shapeValue: '1/1',
|
|
818
|
+
width: '80px',
|
|
819
|
+
shapeLinked: true
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
borderRadius: {
|
|
823
|
+
btrr: '999999px',
|
|
824
|
+
bblr: '999999px',
|
|
825
|
+
bbrr: '999999px',
|
|
826
|
+
btlr: '999999px',
|
|
827
|
+
radiusType: 'custom'
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
advanced: {
|
|
831
|
+
'spacing-setting': {
|
|
832
|
+
desktop: {
|
|
833
|
+
margin: {
|
|
834
|
+
bottom: 0
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
640
840
|
}
|
|
641
841
|
],
|
|
642
842
|
rootOverride: {
|
|
@@ -69,7 +69,7 @@ const Button = ({ styles, builderAttrs, style, setting, advanced, builderProps,
|
|
|
69
69
|
text
|
|
70
70
|
},
|
|
71
71
|
textClassWrapper: "gp-leading-[15px] gp-w-fit",
|
|
72
|
-
textClass: `!gp-inline-flex gp-py-[8px]
|
|
72
|
+
textClass: `!gp-inline-flex gp-py-[8px] ${mode === 'edit' ? 'button-text' : ''}`,
|
|
73
73
|
styles: {
|
|
74
74
|
typo: {
|
|
75
75
|
...typo,
|
|
@@ -8,13 +8,17 @@ var thirdParty = require('../helpers/thirdParty.js');
|
|
|
8
8
|
|
|
9
9
|
const Trustoo = ({ setting, advanced })=>{
|
|
10
10
|
const { widgetType, align, version, appBlockId } = setting ?? {};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const widgetTypeMap = {
|
|
12
|
+
'review-widget': '<div class="custom-vstar-review-widget" style="width:100%"></div>',
|
|
13
|
+
'star-rating-widget': '<div class="custom-vstar-rating-widget" data-product-id="{{product.id}}"></div>',
|
|
14
|
+
'text-carousel': '<div id="trustoo-text-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>',
|
|
15
|
+
'barrage-carousel': '<div id="trustoo-barrage-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>',
|
|
16
|
+
'card-carousel': '<div id="trustoo-card-carousel-widget" style="display:block;max-width:1200px;margin:0 auto"></div>',
|
|
17
|
+
'photo-carousel': '<div id="trustoo-photo-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>'
|
|
18
|
+
};
|
|
19
|
+
const renderOldVersionTrustoo = ()=>{
|
|
20
|
+
return version === 'v2' ? thirdParty.getLiquidForAppBlock(appBlockId, align, advanced?.cssClass) : core.template`
|
|
21
|
+
<div>
|
|
18
22
|
{% if '${widgetType}' == 'starRatingInList' %}
|
|
19
23
|
{% if request.page_type != 'product' %}
|
|
20
24
|
<div class="custom-vstar-rating-widget" product-id="{{ product.id }}"></div>
|
|
@@ -37,6 +41,19 @@ const Trustoo = ({ setting, advanced })=>{
|
|
|
37
41
|
{% endif %}
|
|
38
42
|
</div>
|
|
39
43
|
`;
|
|
44
|
+
};
|
|
45
|
+
return !!version ? renderOldVersionTrustoo() : core.template`
|
|
46
|
+
<div
|
|
47
|
+
class="${advanced?.cssClass}"
|
|
48
|
+
style="${{
|
|
49
|
+
...core.makeStyleResponsive('ta', align)
|
|
50
|
+
}}"
|
|
51
|
+
>
|
|
52
|
+
${widgetType && widgetTypeMap?.[widgetType]}
|
|
53
|
+
<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="https://cdn.vstar.app/static/dist/js/swiper-reviews.min.js" defer="defer"></script>
|
|
54
|
+
<link ${helpers.getSettingPreloadData('class="gps-link" delay', 'href')}="https://cdn.vstar.app/static/css/swiper-reviews.min.css" rel="stylesheet" type="text/css" media="all">
|
|
55
|
+
</div>
|
|
56
|
+
`;
|
|
40
57
|
};
|
|
41
58
|
|
|
42
59
|
exports.default = Trustoo;
|
|
@@ -65,76 +65,11 @@ const config = {
|
|
|
65
65
|
href: 'https://admin.shopify.com/?redirect=/apps/sealapps-product-review',
|
|
66
66
|
appName: Trustoo.default.label
|
|
67
67
|
},
|
|
68
|
-
{
|
|
69
|
-
id: 'version',
|
|
70
|
-
label: 'Choose version',
|
|
71
|
-
type: 'select',
|
|
72
|
-
default: 'v1',
|
|
73
|
-
options: [
|
|
74
|
-
{
|
|
75
|
-
label: 'V1',
|
|
76
|
-
value: 'v1'
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
label: 'V2',
|
|
80
|
-
value: 'v2'
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
68
|
{
|
|
85
69
|
id: 'widgetType',
|
|
86
70
|
label: 'Choose widget',
|
|
87
71
|
type: 'select',
|
|
88
|
-
default: '
|
|
89
|
-
options: [
|
|
90
|
-
{
|
|
91
|
-
label: 'Star Rating',
|
|
92
|
-
value: 'starRating',
|
|
93
|
-
hideOnPage: [
|
|
94
|
-
'GP_ARTICLE',
|
|
95
|
-
'GP_BLOG',
|
|
96
|
-
'GP_COLLECTION',
|
|
97
|
-
'GP_INDEX',
|
|
98
|
-
'GP_STATIC'
|
|
99
|
-
],
|
|
100
|
-
flowTag: [
|
|
101
|
-
'Product'
|
|
102
|
-
],
|
|
103
|
-
condition: 'or'
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
label: 'Star Rating List',
|
|
107
|
-
value: 'starRatingInList',
|
|
108
|
-
hideOnPage: [
|
|
109
|
-
'GP_ARTICLE',
|
|
110
|
-
'GP_BLOG',
|
|
111
|
-
'GP_COLLECTION',
|
|
112
|
-
'GP_INDEX',
|
|
113
|
-
'GP_STATIC'
|
|
114
|
-
],
|
|
115
|
-
flowTag: [
|
|
116
|
-
'ProductList'
|
|
117
|
-
],
|
|
118
|
-
condition: 'or'
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
label: 'Reviews',
|
|
122
|
-
value: 'reviews',
|
|
123
|
-
hideOnPage: [
|
|
124
|
-
'GP_ARTICLE',
|
|
125
|
-
'GP_BLOG',
|
|
126
|
-
'GP_COLLECTION',
|
|
127
|
-
'GP_INDEX',
|
|
128
|
-
'GP_STATIC'
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
id: 'widgetTypeV2',
|
|
135
|
-
label: 'Choose widget',
|
|
136
|
-
type: 'select',
|
|
137
|
-
default: 'barrage-carousel',
|
|
72
|
+
default: 'star-rating-widget',
|
|
138
73
|
options: [
|
|
139
74
|
{
|
|
140
75
|
label: 'Testimonials',
|
|
@@ -150,33 +85,11 @@ const config = {
|
|
|
150
85
|
},
|
|
151
86
|
{
|
|
152
87
|
label: 'Review Widget',
|
|
153
|
-
value: 'review-widget'
|
|
154
|
-
hideOnPage: [
|
|
155
|
-
'ARTICLE',
|
|
156
|
-
'BLOG',
|
|
157
|
-
'COLLECTION',
|
|
158
|
-
'GP_ARTICLE',
|
|
159
|
-
'GP_BLOG',
|
|
160
|
-
'GP_COLLECTION',
|
|
161
|
-
'GP_INDEX',
|
|
162
|
-
'GP_STATIC',
|
|
163
|
-
'STATIC'
|
|
164
|
-
]
|
|
88
|
+
value: 'review-widget'
|
|
165
89
|
},
|
|
166
90
|
{
|
|
167
91
|
label: 'Star Rating Widget',
|
|
168
|
-
value: 'star-rating-widget'
|
|
169
|
-
hideOnPage: [
|
|
170
|
-
'ARTICLE',
|
|
171
|
-
'BLOG',
|
|
172
|
-
'COLLECTION',
|
|
173
|
-
'GP_ARTICLE',
|
|
174
|
-
'GP_BLOG',
|
|
175
|
-
'GP_COLLECTION',
|
|
176
|
-
'GP_INDEX',
|
|
177
|
-
'GP_STATIC',
|
|
178
|
-
'STATIC'
|
|
179
|
-
]
|
|
92
|
+
value: 'star-rating-widget'
|
|
180
93
|
},
|
|
181
94
|
{
|
|
182
95
|
label: 'Text Carousel',
|
|
@@ -226,15 +139,6 @@ const config = {
|
|
|
226
139
|
id: 'install'
|
|
227
140
|
}
|
|
228
141
|
},
|
|
229
|
-
{
|
|
230
|
-
type: 'control',
|
|
231
|
-
label: {
|
|
232
|
-
en: 'Choose version'
|
|
233
|
-
},
|
|
234
|
-
setting: {
|
|
235
|
-
id: 'version'
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
142
|
{
|
|
239
143
|
type: 'control',
|
|
240
144
|
label: {
|
|
@@ -242,18 +146,7 @@ const config = {
|
|
|
242
146
|
},
|
|
243
147
|
setting: {
|
|
244
148
|
id: 'widgetType'
|
|
245
|
-
}
|
|
246
|
-
condition: 'version === "v1"'
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
type: 'control',
|
|
250
|
-
label: {
|
|
251
|
-
en: 'Choose widget'
|
|
252
|
-
},
|
|
253
|
-
setting: {
|
|
254
|
-
id: 'widgetTypeV2'
|
|
255
|
-
},
|
|
256
|
-
condition: 'version === "v2"'
|
|
149
|
+
}
|
|
257
150
|
},
|
|
258
151
|
{
|
|
259
152
|
type: 'control',
|
|
@@ -9,9 +9,21 @@ import useAspectRatioSettings from './hooks/useAspectRatioSettings.js';
|
|
|
9
9
|
import NextImage from '../../../image/components/NextImage.liquid.js';
|
|
10
10
|
import { getImageSrc, DEVICES } from '../../../image/helpers/getSrcSet.js';
|
|
11
11
|
import { createBlurDataURL } from '../../../image/components/helpers.js';
|
|
12
|
+
import { HREF_TO_SALES_PAGE } from '../../../constants.js';
|
|
12
13
|
|
|
13
14
|
const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyloadImage = true })=>{
|
|
14
|
-
const { link, layout, verticalAlign, order, alignBanner, alt, title } = setting ?? {};
|
|
15
|
+
const { link: rawLink, layout, verticalAlign, order, alignBanner, alt, title, isGoToSalesPage } = setting ?? {};
|
|
16
|
+
const link = isGoToSalesPage ? {
|
|
17
|
+
link: HREF_TO_SALES_PAGE,
|
|
18
|
+
target: '_self'
|
|
19
|
+
} : rawLink;
|
|
20
|
+
let { urlData } = getInsertLinkData('', link);
|
|
21
|
+
if (isGoToSalesPage) {
|
|
22
|
+
urlData = {
|
|
23
|
+
href: HREF_TO_SALES_PAGE,
|
|
24
|
+
target: '_self'
|
|
25
|
+
};
|
|
26
|
+
}
|
|
15
27
|
const { background, overlayEnable, overlayColor, overlayOpacity, verticalGutter, contentWidth, hoverEffect, hoverEffectDuration, hoverEffectScale, cornerBg, borderBg, hasActiveShadow, shadowBg, sizeSetting, contentPadding } = styles ?? {};
|
|
16
28
|
const enableParallax = setting?.enableParallax || false;
|
|
17
29
|
const speedParallax = Number(setting?.speedParallax) || 0;
|
|
@@ -124,7 +136,6 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
|
|
|
124
136
|
}
|
|
125
137
|
return;
|
|
126
138
|
};
|
|
127
|
-
const { urlData } = getInsertLinkData('', link);
|
|
128
139
|
const imagePlaceholder = {
|
|
129
140
|
desktop: createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0),
|
|
130
141
|
tablet: createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
|