@gem-sdk/components 2.0.0-dev.633 → 2.0.0-dev.636
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/button/components/common/classes.js +1 -1
- package/dist/cjs/countdown-timer/setting/configs/settings.js +0 -6
- package/dist/cjs/swiper-carousel/root/common/getStyle.js +2 -0
- package/dist/cjs/third-party/components/Trustoo/TrustooSampleContent.js +6 -3
- package/dist/cjs/third-party/components/Trustoo.liquid.js +26 -9
- package/dist/cjs/third-party/setting/Trustoo/index.js +3 -90
- package/dist/cjs/third-party/setting/Trustoo/uiV1.js +1 -12
- package/dist/cjs/third-party/setting/Trustoo/uiV2.js +0 -14
- package/dist/cjs/video/components/LiteVimeoEmbed.js +3 -3
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +3 -4
- package/dist/cjs/video/components/common/getClasses.js +3 -2
- package/dist/cjs/video/components/common/index.js +1 -1
- package/dist/esm/button/components/common/classes.js +1 -1
- package/dist/esm/countdown-timer/setting/configs/settings.js +0 -6
- package/dist/esm/swiper-carousel/root/common/getStyle.js +2 -0
- package/dist/esm/third-party/components/Trustoo/TrustooSampleContent.js +6 -3
- package/dist/esm/third-party/components/Trustoo.liquid.js +26 -9
- package/dist/esm/third-party/setting/Trustoo/index.js +3 -90
- package/dist/esm/third-party/setting/Trustoo/uiV1.js +1 -12
- package/dist/esm/third-party/setting/Trustoo/uiV2.js +0 -14
- package/dist/esm/video/components/LiteVimeoEmbed.js +4 -4
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +3 -4
- package/dist/esm/video/components/common/getClasses.js +3 -2
- package/dist/esm/video/components/common/index.js +1 -1
- package/dist/types/index.d.ts +1 -2
- package/package.json +2 -2
|
@@ -37,7 +37,7 @@ const getButtonContentWrapperClasses = (setting)=>{
|
|
|
37
37
|
};
|
|
38
38
|
const getButtonLabelClasses = (styles, isEditable)=>{
|
|
39
39
|
return {
|
|
40
|
-
'gp-content-product-button gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
40
|
+
'gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
41
41
|
'[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]': styles?.typo?.attrs?.italic,
|
|
42
42
|
'gp-text button-text': isEditable
|
|
43
43
|
};
|
|
@@ -9,9 +9,12 @@ var Trustoo = require('../../configs/Trustoo.js');
|
|
|
9
9
|
var React = require('react');
|
|
10
10
|
|
|
11
11
|
const mapWidgetLabel = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
'barrage-carousel': 'Testimonials',
|
|
13
|
+
'card-carousel': 'Card Carousel',
|
|
14
|
+
'photo-carousel': 'Photo Carousel',
|
|
15
|
+
'review-widget': 'Review Widget',
|
|
16
|
+
'star-rating-widget': 'Star Rating Widget',
|
|
17
|
+
'text-carousel': 'Text Carousel'
|
|
15
18
|
};
|
|
16
19
|
const TrustooSampleContent = ({ setting })=>{
|
|
17
20
|
const widgetLabel = setting?.widgetType && mapWidgetLabel[setting.widgetType];
|
|
@@ -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>
|
|
@@ -28,15 +32,28 @@ const Trustoo = ({ setting, advanced })=>{
|
|
|
28
32
|
{% assign widget = '${widgetType}' %}
|
|
29
33
|
{% case widget %}
|
|
30
34
|
{% when "starRating" %}
|
|
31
|
-
<div id="seal-star-rating-widget" data-star-size="16" data-font-size="14" class="vstar-star
|
|
35
|
+
<div id="seal-star-rating-widget" data-star-size="16" data-font-size="14" class="vstar-star"></div>
|
|
32
36
|
<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="https://cdn.shopify.com/extensions/da25a851-7e4c-4ab7-9a2d-0b3d699025b5/trustoo-product-ali-reviews-7/assets/star-rating-widget.min.js" defer="defer"></script>
|
|
33
37
|
{% when "reviews" %}
|
|
34
|
-
<div id="seal-review-widget"
|
|
38
|
+
<div id="seal-review-widget"></div>
|
|
35
39
|
<link ${helpers.getSettingPreloadData('class="gps-link" delay', 'href')}="https://cdn.shopify.com/extensions/0519f63f-61ca-467d-975d-a60b2cc82088/7.3.0/assets/star-rating.css" rel="stylesheet" type="text/css" media="all">
|
|
36
40
|
{% endcase %}
|
|
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;
|
|
@@ -67,76 +67,11 @@ const config = {
|
|
|
67
67
|
href: 'https://admin.shopify.com/?redirect=/apps/sealapps-product-review',
|
|
68
68
|
appName: Trustoo.default.label
|
|
69
69
|
},
|
|
70
|
-
{
|
|
71
|
-
id: 'version',
|
|
72
|
-
label: 'Choose version',
|
|
73
|
-
type: 'select',
|
|
74
|
-
default: 'v1',
|
|
75
|
-
options: [
|
|
76
|
-
{
|
|
77
|
-
label: 'V1',
|
|
78
|
-
value: 'v1'
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
label: 'V2',
|
|
82
|
-
value: 'v2'
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
70
|
{
|
|
87
71
|
id: 'widgetType',
|
|
88
72
|
label: 'Choose widget',
|
|
89
73
|
type: 'select',
|
|
90
|
-
default: '
|
|
91
|
-
options: [
|
|
92
|
-
{
|
|
93
|
-
label: 'Star Rating',
|
|
94
|
-
value: 'starRating',
|
|
95
|
-
hideOnPage: [
|
|
96
|
-
'GP_ARTICLE',
|
|
97
|
-
'GP_BLOG',
|
|
98
|
-
'GP_COLLECTION',
|
|
99
|
-
'GP_INDEX',
|
|
100
|
-
'GP_STATIC'
|
|
101
|
-
],
|
|
102
|
-
flowTag: [
|
|
103
|
-
'Product'
|
|
104
|
-
],
|
|
105
|
-
condition: 'or'
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
label: 'Star Rating List',
|
|
109
|
-
value: 'starRatingInList',
|
|
110
|
-
hideOnPage: [
|
|
111
|
-
'GP_ARTICLE',
|
|
112
|
-
'GP_BLOG',
|
|
113
|
-
'GP_COLLECTION',
|
|
114
|
-
'GP_INDEX',
|
|
115
|
-
'GP_STATIC'
|
|
116
|
-
],
|
|
117
|
-
flowTag: [
|
|
118
|
-
'ProductList'
|
|
119
|
-
],
|
|
120
|
-
condition: 'or'
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
label: 'Reviews',
|
|
124
|
-
value: 'reviews',
|
|
125
|
-
hideOnPage: [
|
|
126
|
-
'GP_ARTICLE',
|
|
127
|
-
'GP_BLOG',
|
|
128
|
-
'GP_COLLECTION',
|
|
129
|
-
'GP_INDEX',
|
|
130
|
-
'GP_STATIC'
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 'widgetTypeV2',
|
|
137
|
-
label: 'Choose widget',
|
|
138
|
-
type: 'select',
|
|
139
|
-
default: 'barrage-carousel',
|
|
74
|
+
default: 'star-rating-widget',
|
|
140
75
|
options: [
|
|
141
76
|
{
|
|
142
77
|
label: 'Testimonials',
|
|
@@ -152,33 +87,11 @@ const config = {
|
|
|
152
87
|
},
|
|
153
88
|
{
|
|
154
89
|
label: 'Review Widget',
|
|
155
|
-
value: 'review-widget'
|
|
156
|
-
hideOnPage: [
|
|
157
|
-
'ARTICLE',
|
|
158
|
-
'BLOG',
|
|
159
|
-
'COLLECTION',
|
|
160
|
-
'GP_ARTICLE',
|
|
161
|
-
'GP_BLOG',
|
|
162
|
-
'GP_COLLECTION',
|
|
163
|
-
'GP_INDEX',
|
|
164
|
-
'GP_STATIC',
|
|
165
|
-
'STATIC'
|
|
166
|
-
]
|
|
90
|
+
value: 'review-widget'
|
|
167
91
|
},
|
|
168
92
|
{
|
|
169
93
|
label: 'Star Rating Widget',
|
|
170
|
-
value: 'star-rating-widget'
|
|
171
|
-
hideOnPage: [
|
|
172
|
-
'ARTICLE',
|
|
173
|
-
'BLOG',
|
|
174
|
-
'COLLECTION',
|
|
175
|
-
'GP_ARTICLE',
|
|
176
|
-
'GP_BLOG',
|
|
177
|
-
'GP_COLLECTION',
|
|
178
|
-
'GP_INDEX',
|
|
179
|
-
'GP_STATIC',
|
|
180
|
-
'STATIC'
|
|
181
|
-
]
|
|
94
|
+
value: 'star-rating-widget'
|
|
182
95
|
},
|
|
183
96
|
{
|
|
184
97
|
label: 'Text Carousel',
|
|
@@ -25,18 +25,7 @@ const SettingUIV1 = [
|
|
|
25
25
|
},
|
|
26
26
|
setting: {
|
|
27
27
|
id: 'widgetType'
|
|
28
|
-
}
|
|
29
|
-
condition: 'version === "v1"'
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
type: 'control',
|
|
33
|
-
label: {
|
|
34
|
-
en: 'Choose widget'
|
|
35
|
-
},
|
|
36
|
-
setting: {
|
|
37
|
-
id: 'widgetTypeV2'
|
|
38
|
-
},
|
|
39
|
-
condition: 'version === "v2"'
|
|
28
|
+
}
|
|
40
29
|
},
|
|
41
30
|
{
|
|
42
31
|
type: 'control',
|
|
@@ -26,7 +26,6 @@ const SettingUIV2 = [
|
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
conditionDisplay: 'version === "v1"',
|
|
30
29
|
controls: [
|
|
31
30
|
{
|
|
32
31
|
label: {
|
|
@@ -38,19 +37,6 @@ const SettingUIV2 = [
|
|
|
38
37
|
}
|
|
39
38
|
]
|
|
40
39
|
},
|
|
41
|
-
{
|
|
42
|
-
conditionDisplay: 'version === "v2"',
|
|
43
|
-
controls: [
|
|
44
|
-
{
|
|
45
|
-
label: {
|
|
46
|
-
en: 'Choose widget'
|
|
47
|
-
},
|
|
48
|
-
setting: {
|
|
49
|
-
id: 'widgetTypeV2'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
40
|
{
|
|
55
41
|
controls: [
|
|
56
42
|
{
|
|
@@ -29,7 +29,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
29
29
|
...getClasses.getImageVimeoClasses(iframe)
|
|
30
30
|
});
|
|
31
31
|
const buttonVimeoClasses = system.createClass({
|
|
32
|
-
...getClasses.getButtonVimeoClasses()
|
|
32
|
+
...getClasses.getButtonVimeoClasses(iframe)
|
|
33
33
|
});
|
|
34
34
|
const iframeVimeoClasses = system.createClass({
|
|
35
35
|
...getClasses.getIframeVimeoClasses()
|
|
@@ -48,7 +48,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
48
48
|
className: imageVimeoClasses,
|
|
49
49
|
onClick: addIframe
|
|
50
50
|
}),
|
|
51
|
-
|
|
51
|
+
/*#__PURE__*/ jsxRuntime.jsx("button", {
|
|
52
52
|
type: "button",
|
|
53
53
|
className: buttonVimeoClasses,
|
|
54
54
|
"aria-label": "Play",
|
|
@@ -60,7 +60,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
60
60
|
d: "M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"
|
|
61
61
|
})
|
|
62
62
|
})
|
|
63
|
-
})
|
|
63
|
+
}),
|
|
64
64
|
iframe && /*#__PURE__*/ jsxRuntime.jsx("iframe", {
|
|
65
65
|
style: iframeVimeoStyle,
|
|
66
66
|
title: title,
|
|
@@ -38,7 +38,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
38
38
|
...getClasses.getImageVimeoClasses(iframe)
|
|
39
39
|
});
|
|
40
40
|
const buttonVimeoClasses = system.createClass({
|
|
41
|
-
...getClasses.getButtonVimeoClasses()
|
|
41
|
+
...getClasses.getButtonVimeoClasses(iframe)
|
|
42
42
|
});
|
|
43
43
|
const iframeVimeoClasses = system.createClass({
|
|
44
44
|
...getClasses.getIframeVimeoClasses()
|
|
@@ -51,14 +51,13 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
51
51
|
data-title="${title}"
|
|
52
52
|
style="${articleVimeoStyle}"
|
|
53
53
|
>
|
|
54
|
-
${
|
|
55
|
-
${NextImage_liquid.default({
|
|
54
|
+
${NextImage_liquid.default({
|
|
56
55
|
src: posterUrl,
|
|
57
56
|
alt: title,
|
|
58
57
|
className: imageVimeoClasses,
|
|
59
58
|
enableLazyLoadImage: true,
|
|
60
59
|
priority: preload
|
|
61
|
-
})}
|
|
60
|
+
})}
|
|
62
61
|
${system.If(!iframe, core.template`
|
|
63
62
|
<button type="button" class="${buttonVimeoClasses}" aria-label="Play">
|
|
64
63
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
@@ -78,8 +78,9 @@ const getImageVimeoClasses = (iframe)=>{
|
|
|
78
78
|
...composeClasses(classList)
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
const getButtonVimeoClasses = ()=>{
|
|
82
|
-
|
|
81
|
+
const getButtonVimeoClasses = (iframe)=>{
|
|
82
|
+
let classList = `gp-absolute gp-left-1/2 gp-top-1/2 gp-flex gp-aspect-[56/32] gp-w-14 -gp-translate-x-1/2 -gp-translate-y-1/2 gp-items-center gp-justify-center gp-rounded gp-bg-black/80 gp-transition-colors hover:gp-bg-[#ef0800] gp-z-10 gp-lite-vimeo-embed-button`;
|
|
83
|
+
if (iframe) classList += ` gp-invisible gp-opacity-0`;
|
|
83
84
|
return {
|
|
84
85
|
...composeClasses(classList)
|
|
85
86
|
};
|
|
@@ -52,7 +52,7 @@ const getYoutubeParams = (props)=>{
|
|
|
52
52
|
const getVimeoParams = (props)=>{
|
|
53
53
|
const { id, autoplay, muted, controls, loop, lazy } = props;
|
|
54
54
|
const videoId = encodeURIComponent(id);
|
|
55
|
-
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : 0}` + '&autopause=false';
|
|
55
|
+
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : autoplay ? 1 : 0}` + '&autopause=false';
|
|
56
56
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
57
57
|
return {
|
|
58
58
|
videoId,
|
|
@@ -35,7 +35,7 @@ const getButtonContentWrapperClasses = (setting)=>{
|
|
|
35
35
|
};
|
|
36
36
|
const getButtonLabelClasses = (styles, isEditable)=>{
|
|
37
37
|
return {
|
|
38
|
-
'gp-content-product-button gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
38
|
+
'gp-content-product-button group-active/button:!gp-text-inherit gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line': true,
|
|
39
39
|
'[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]': styles?.typo?.attrs?.italic,
|
|
40
40
|
'gp-text button-text': isEditable
|
|
41
41
|
};
|
|
@@ -5,9 +5,12 @@ import TrustooConfig from '../../configs/Trustoo.js';
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
const mapWidgetLabel = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
'barrage-carousel': 'Testimonials',
|
|
9
|
+
'card-carousel': 'Card Carousel',
|
|
10
|
+
'photo-carousel': 'Photo Carousel',
|
|
11
|
+
'review-widget': 'Review Widget',
|
|
12
|
+
'star-rating-widget': 'Star Rating Widget',
|
|
13
|
+
'text-carousel': 'Text Carousel'
|
|
11
14
|
};
|
|
12
15
|
const TrustooSampleContent = ({ setting })=>{
|
|
13
16
|
const widgetLabel = setting?.widgetType && mapWidgetLabel[setting.widgetType];
|
|
@@ -4,13 +4,17 @@ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
|
|
|
4
4
|
|
|
5
5
|
const Trustoo = ({ setting, advanced })=>{
|
|
6
6
|
const { widgetType, align, version, appBlockId } = setting ?? {};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const widgetTypeMap = {
|
|
8
|
+
'review-widget': '<div class="custom-vstar-review-widget" style="width:100%"></div>',
|
|
9
|
+
'star-rating-widget': '<div class="custom-vstar-rating-widget" data-product-id="{{product.id}}"></div>',
|
|
10
|
+
'text-carousel': '<div id="trustoo-text-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>',
|
|
11
|
+
'barrage-carousel': '<div id="trustoo-barrage-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>',
|
|
12
|
+
'card-carousel': '<div id="trustoo-card-carousel-widget" style="display:block;max-width:1200px;margin:0 auto"></div>',
|
|
13
|
+
'photo-carousel': '<div id="trustoo-photo-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>'
|
|
14
|
+
};
|
|
15
|
+
const renderOldVersionTrustoo = ()=>{
|
|
16
|
+
return version === 'v2' ? getLiquidForAppBlock(appBlockId, align, advanced?.cssClass) : template`
|
|
17
|
+
<div>
|
|
14
18
|
{% if '${widgetType}' == 'starRatingInList' %}
|
|
15
19
|
{% if request.page_type != 'product' %}
|
|
16
20
|
<div class="custom-vstar-rating-widget" product-id="{{ product.id }}"></div>
|
|
@@ -24,15 +28,28 @@ const Trustoo = ({ setting, advanced })=>{
|
|
|
24
28
|
{% assign widget = '${widgetType}' %}
|
|
25
29
|
{% case widget %}
|
|
26
30
|
{% when "starRating" %}
|
|
27
|
-
<div id="seal-star-rating-widget" data-star-size="16" data-font-size="14" class="vstar-star
|
|
31
|
+
<div id="seal-star-rating-widget" data-star-size="16" data-font-size="14" class="vstar-star"></div>
|
|
28
32
|
<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="https://cdn.shopify.com/extensions/da25a851-7e4c-4ab7-9a2d-0b3d699025b5/trustoo-product-ali-reviews-7/assets/star-rating-widget.min.js" defer="defer"></script>
|
|
29
33
|
{% when "reviews" %}
|
|
30
|
-
<div id="seal-review-widget"
|
|
34
|
+
<div id="seal-review-widget"></div>
|
|
31
35
|
<link ${getSettingPreloadData('class="gps-link" delay', 'href')}="https://cdn.shopify.com/extensions/0519f63f-61ca-467d-975d-a60b2cc82088/7.3.0/assets/star-rating.css" rel="stylesheet" type="text/css" media="all">
|
|
32
36
|
{% endcase %}
|
|
33
37
|
{% endif %}
|
|
34
38
|
</div>
|
|
35
39
|
`;
|
|
40
|
+
};
|
|
41
|
+
return version ? renderOldVersionTrustoo() : template`
|
|
42
|
+
<div
|
|
43
|
+
class="${advanced?.cssClass}"
|
|
44
|
+
style="${{
|
|
45
|
+
...makeStyleResponsive('ta', align)
|
|
46
|
+
}}"
|
|
47
|
+
>
|
|
48
|
+
${widgetType && widgetTypeMap?.[widgetType]}
|
|
49
|
+
<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="https://cdn.vstar.app/static/dist/js/swiper-reviews.min.js" defer="defer"></script>
|
|
50
|
+
<link ${getSettingPreloadData('class="gps-link" delay', 'href')}="https://cdn.vstar.app/static/css/swiper-reviews.min.css" rel="stylesheet" type="text/css" media="all">
|
|
51
|
+
</div>
|
|
52
|
+
`;
|
|
36
53
|
};
|
|
37
54
|
|
|
38
55
|
export { Trustoo as default };
|
|
@@ -63,76 +63,11 @@ const config = {
|
|
|
63
63
|
href: 'https://admin.shopify.com/?redirect=/apps/sealapps-product-review',
|
|
64
64
|
appName: TrustooConfig.label
|
|
65
65
|
},
|
|
66
|
-
{
|
|
67
|
-
id: 'version',
|
|
68
|
-
label: 'Choose version',
|
|
69
|
-
type: 'select',
|
|
70
|
-
default: 'v1',
|
|
71
|
-
options: [
|
|
72
|
-
{
|
|
73
|
-
label: 'V1',
|
|
74
|
-
value: 'v1'
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: 'V2',
|
|
78
|
-
value: 'v2'
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
66
|
{
|
|
83
67
|
id: 'widgetType',
|
|
84
68
|
label: 'Choose widget',
|
|
85
69
|
type: 'select',
|
|
86
|
-
default: '
|
|
87
|
-
options: [
|
|
88
|
-
{
|
|
89
|
-
label: 'Star Rating',
|
|
90
|
-
value: 'starRating',
|
|
91
|
-
hideOnPage: [
|
|
92
|
-
'GP_ARTICLE',
|
|
93
|
-
'GP_BLOG',
|
|
94
|
-
'GP_COLLECTION',
|
|
95
|
-
'GP_INDEX',
|
|
96
|
-
'GP_STATIC'
|
|
97
|
-
],
|
|
98
|
-
flowTag: [
|
|
99
|
-
'Product'
|
|
100
|
-
],
|
|
101
|
-
condition: 'or'
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
label: 'Star Rating List',
|
|
105
|
-
value: 'starRatingInList',
|
|
106
|
-
hideOnPage: [
|
|
107
|
-
'GP_ARTICLE',
|
|
108
|
-
'GP_BLOG',
|
|
109
|
-
'GP_COLLECTION',
|
|
110
|
-
'GP_INDEX',
|
|
111
|
-
'GP_STATIC'
|
|
112
|
-
],
|
|
113
|
-
flowTag: [
|
|
114
|
-
'ProductList'
|
|
115
|
-
],
|
|
116
|
-
condition: 'or'
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
label: 'Reviews',
|
|
120
|
-
value: 'reviews',
|
|
121
|
-
hideOnPage: [
|
|
122
|
-
'GP_ARTICLE',
|
|
123
|
-
'GP_BLOG',
|
|
124
|
-
'GP_COLLECTION',
|
|
125
|
-
'GP_INDEX',
|
|
126
|
-
'GP_STATIC'
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: 'widgetTypeV2',
|
|
133
|
-
label: 'Choose widget',
|
|
134
|
-
type: 'select',
|
|
135
|
-
default: 'barrage-carousel',
|
|
70
|
+
default: 'star-rating-widget',
|
|
136
71
|
options: [
|
|
137
72
|
{
|
|
138
73
|
label: 'Testimonials',
|
|
@@ -148,33 +83,11 @@ const config = {
|
|
|
148
83
|
},
|
|
149
84
|
{
|
|
150
85
|
label: 'Review Widget',
|
|
151
|
-
value: 'review-widget'
|
|
152
|
-
hideOnPage: [
|
|
153
|
-
'ARTICLE',
|
|
154
|
-
'BLOG',
|
|
155
|
-
'COLLECTION',
|
|
156
|
-
'GP_ARTICLE',
|
|
157
|
-
'GP_BLOG',
|
|
158
|
-
'GP_COLLECTION',
|
|
159
|
-
'GP_INDEX',
|
|
160
|
-
'GP_STATIC',
|
|
161
|
-
'STATIC'
|
|
162
|
-
]
|
|
86
|
+
value: 'review-widget'
|
|
163
87
|
},
|
|
164
88
|
{
|
|
165
89
|
label: 'Star Rating Widget',
|
|
166
|
-
value: 'star-rating-widget'
|
|
167
|
-
hideOnPage: [
|
|
168
|
-
'ARTICLE',
|
|
169
|
-
'BLOG',
|
|
170
|
-
'COLLECTION',
|
|
171
|
-
'GP_ARTICLE',
|
|
172
|
-
'GP_BLOG',
|
|
173
|
-
'GP_COLLECTION',
|
|
174
|
-
'GP_INDEX',
|
|
175
|
-
'GP_STATIC',
|
|
176
|
-
'STATIC'
|
|
177
|
-
]
|
|
90
|
+
value: 'star-rating-widget'
|
|
178
91
|
},
|
|
179
92
|
{
|
|
180
93
|
label: 'Text Carousel',
|
|
@@ -21,18 +21,7 @@ const SettingUIV1 = [
|
|
|
21
21
|
},
|
|
22
22
|
setting: {
|
|
23
23
|
id: 'widgetType'
|
|
24
|
-
}
|
|
25
|
-
condition: 'version === "v1"'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
type: 'control',
|
|
29
|
-
label: {
|
|
30
|
-
en: 'Choose widget'
|
|
31
|
-
},
|
|
32
|
-
setting: {
|
|
33
|
-
id: 'widgetTypeV2'
|
|
34
|
-
},
|
|
35
|
-
condition: 'version === "v2"'
|
|
24
|
+
}
|
|
36
25
|
},
|
|
37
26
|
{
|
|
38
27
|
type: 'control',
|
|
@@ -22,7 +22,6 @@ const SettingUIV2 = [
|
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
conditionDisplay: 'version === "v1"',
|
|
26
25
|
controls: [
|
|
27
26
|
{
|
|
28
27
|
label: {
|
|
@@ -34,19 +33,6 @@ const SettingUIV2 = [
|
|
|
34
33
|
}
|
|
35
34
|
]
|
|
36
35
|
},
|
|
37
|
-
{
|
|
38
|
-
conditionDisplay: 'version === "v2"',
|
|
39
|
-
controls: [
|
|
40
|
-
{
|
|
41
|
-
label: {
|
|
42
|
-
en: 'Choose widget'
|
|
43
|
-
},
|
|
44
|
-
setting: {
|
|
45
|
-
id: 'widgetTypeV2'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
},
|
|
50
36
|
{
|
|
51
37
|
controls: [
|
|
52
38
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useLiteVimeoEmbed } from '../hooks/useLiteVimeoEmbed.js';
|
|
4
|
-
import { createStyle, createClass
|
|
4
|
+
import { createStyle, createClass } from '@gem-sdk/system';
|
|
5
5
|
import { getArticleVimeoClasses, getImageVimeoClasses, getButtonVimeoClasses, getIframeVimeoClasses } from './common/getClasses.js';
|
|
6
6
|
import { getIframeVimeoStyle, getArticleVimeoStyle } from './common/getStyle.js';
|
|
7
7
|
import { getVimeoParams } from './common/index.js';
|
|
@@ -25,7 +25,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
25
25
|
...getImageVimeoClasses(iframe)
|
|
26
26
|
});
|
|
27
27
|
const buttonVimeoClasses = createClass({
|
|
28
|
-
...getButtonVimeoClasses()
|
|
28
|
+
...getButtonVimeoClasses(iframe)
|
|
29
29
|
});
|
|
30
30
|
const iframeVimeoClasses = createClass({
|
|
31
31
|
...getIframeVimeoClasses()
|
|
@@ -44,7 +44,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
44
44
|
className: imageVimeoClasses,
|
|
45
45
|
onClick: addIframe
|
|
46
46
|
}),
|
|
47
|
-
|
|
47
|
+
/*#__PURE__*/ jsx("button", {
|
|
48
48
|
type: "button",
|
|
49
49
|
className: buttonVimeoClasses,
|
|
50
50
|
"aria-label": "Play",
|
|
@@ -56,7 +56,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
56
56
|
d: "M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"
|
|
57
57
|
})
|
|
58
58
|
})
|
|
59
|
-
})
|
|
59
|
+
}),
|
|
60
60
|
iframe && /*#__PURE__*/ jsx("iframe", {
|
|
61
61
|
style: iframeVimeoStyle,
|
|
62
62
|
title: title,
|
|
@@ -34,7 +34,7 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
34
34
|
...getImageVimeoClasses(iframe)
|
|
35
35
|
});
|
|
36
36
|
const buttonVimeoClasses = createClass({
|
|
37
|
-
...getButtonVimeoClasses()
|
|
37
|
+
...getButtonVimeoClasses(iframe)
|
|
38
38
|
});
|
|
39
39
|
const iframeVimeoClasses = createClass({
|
|
40
40
|
...getIframeVimeoClasses()
|
|
@@ -47,14 +47,13 @@ const LiteVimeoEmbed = (props)=>{
|
|
|
47
47
|
data-title="${title}"
|
|
48
48
|
style="${articleVimeoStyle}"
|
|
49
49
|
>
|
|
50
|
-
${
|
|
51
|
-
${NextImage({
|
|
50
|
+
${NextImage({
|
|
52
51
|
src: posterUrl,
|
|
53
52
|
alt: title,
|
|
54
53
|
className: imageVimeoClasses,
|
|
55
54
|
enableLazyLoadImage: true,
|
|
56
55
|
priority: preload
|
|
57
|
-
})}
|
|
56
|
+
})}
|
|
58
57
|
${If(!iframe, template`
|
|
59
58
|
<button type="button" class="${buttonVimeoClasses}" aria-label="Play">
|
|
60
59
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
@@ -76,8 +76,9 @@ const getImageVimeoClasses = (iframe)=>{
|
|
|
76
76
|
...composeClasses(classList)
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
const getButtonVimeoClasses = ()=>{
|
|
80
|
-
|
|
79
|
+
const getButtonVimeoClasses = (iframe)=>{
|
|
80
|
+
let classList = `gp-absolute gp-left-1/2 gp-top-1/2 gp-flex gp-aspect-[56/32] gp-w-14 -gp-translate-x-1/2 -gp-translate-y-1/2 gp-items-center gp-justify-center gp-rounded gp-bg-black/80 gp-transition-colors hover:gp-bg-[#ef0800] gp-z-10 gp-lite-vimeo-embed-button`;
|
|
81
|
+
if (iframe) classList += ` gp-invisible gp-opacity-0`;
|
|
81
82
|
return {
|
|
82
83
|
...composeClasses(classList)
|
|
83
84
|
};
|
|
@@ -50,7 +50,7 @@ const getYoutubeParams = (props)=>{
|
|
|
50
50
|
const getVimeoParams = (props)=>{
|
|
51
51
|
const { id, autoplay, muted, controls, loop, lazy } = props;
|
|
52
52
|
const videoId = encodeURIComponent(id);
|
|
53
|
-
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : 0}` + '&autopause=false';
|
|
53
|
+
const params = `?&autoplay=${lazy ? 1 : autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + `&background=${lazy ? 1 : autoplay ? 1 : 0}` + '&autopause=false';
|
|
54
54
|
const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
|
|
55
55
|
return {
|
|
56
56
|
videoId,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _gem_sdk_core from '@gem-sdk/core';
|
|
2
|
-
import { BaseProps, TypographySettingV2, ObjectDevices as ObjectDevices$1, Background, SizeSettingGlobal, StateProp, ColorValueType as ColorValueType$1, TypographySetting as TypographySetting$1, Border, SizeSetting, CornerRadius, ShadowProps as ShadowProps$1, BasePropsWrap, BackgroundMedia, AlignProp, TransformProp, ResponsiveStateProp, Ratio, PageContext, BackgroundImageValue, ObjectLayoutValue, NameDevices as NameDevices$1, PaddingType as PaddingType$2, RawChild, PostPurchaseTypo, AlignItemProp, ProductProviderProps, AdvancedType, DotStyle as DotStyle$4, WiserWidgetType, WiserV2WidgetType, AirProductReview, AliReviewsWidgetType, BogosWidgetType, BoldSubscriptionsWidgetType, FastBundleWidgetType, FeraReviewsWidgetType, FeraReviewsV3WidgetType, GrowaveWidgetTypeV2, GrowaveWidgetTypeV1, JudgeMeReviewsWidgetType, LaiProductReviewsWidgetType, LaiProductReviewsAdvancedWidgetType, LooxReviewsWidgetType, LooxReviewsWidgetTypeV2, OmnisendWidgetType, OpinewWidgetType, OpinewDesignWidgetType, PickyStoryWidgetType, PreOrderNowWodWidgetType, ProductReviewsWidgetType, RivyoWidgetType, RyviuWidgetType, StampedWidgetType, StampedWidgetTypeV2, TagShopWidgetType, TrustooWidgetType,
|
|
2
|
+
import { BaseProps, TypographySettingV2, ObjectDevices as ObjectDevices$1, Background, SizeSettingGlobal, StateProp, ColorValueType as ColorValueType$1, TypographySetting as TypographySetting$1, Border, SizeSetting, CornerRadius, ShadowProps as ShadowProps$1, BasePropsWrap, BackgroundMedia, AlignProp, TransformProp, ResponsiveStateProp, Ratio, PageContext, BackgroundImageValue, ObjectLayoutValue, NameDevices as NameDevices$1, PaddingType as PaddingType$2, RawChild, PostPurchaseTypo, AlignItemProp, ProductProviderProps, AdvancedType, DotStyle as DotStyle$4, WiserWidgetType, WiserV2WidgetType, AirProductReview, AliReviewsWidgetType, BogosWidgetType, BoldSubscriptionsWidgetType, FastBundleWidgetType, FeraReviewsWidgetType, FeraReviewsV3WidgetType, GrowaveWidgetTypeV2, GrowaveWidgetTypeV1, JudgeMeReviewsWidgetType, LaiProductReviewsWidgetType, LaiProductReviewsAdvancedWidgetType, LooxReviewsWidgetType, LooxReviewsWidgetTypeV2, OmnisendWidgetType, OpinewWidgetType, OpinewDesignWidgetType, PickyStoryWidgetType, PreOrderNowWodWidgetType, ProductReviewsWidgetType, RivyoWidgetType, RyviuWidgetType, StampedWidgetType, StampedWidgetTypeV2, TagShopWidgetType, TrustooWidgetType, UltimateSalesBoostWidgetType, VitalsWidgetType, YotpoReviewsWidgetType, InstantJudgeMeReviewsWidgetType, InstantLooxReviewsWidgetType, ComponentSetting } from '@gem-sdk/core';
|
|
3
3
|
import * as csstype from 'csstype';
|
|
4
4
|
import { Property } from 'csstype';
|
|
5
5
|
import * as _gem_sdk_keen_slider from '@gem-sdk/keen-slider';
|
|
@@ -5223,7 +5223,6 @@ type TrustMeProps = BaseProps<{
|
|
|
5223
5223
|
}>;
|
|
5224
5224
|
type TrustooProps = BaseProps<{
|
|
5225
5225
|
widgetType?: TrustooWidgetType;
|
|
5226
|
-
widgetTypeV2?: TrustooWidgetTypeV2;
|
|
5227
5226
|
openApp?: any;
|
|
5228
5227
|
install?: any;
|
|
5229
5228
|
align?: ObjectDevices$1<AlignProp>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.636",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "node ./scripts/scan-all-text.js"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
28
|
+
"@gem-sdk/core": "2.0.0-dev.636",
|
|
29
29
|
"@gem-sdk/styles": "2.0.0-dev.571",
|
|
30
30
|
"@gem-sdk/system": "2.0.0-dev.504",
|
|
31
31
|
"@types/react-transition-group": "^4.4.5",
|