@gem-sdk/components 2.2.0-staging.58 → 2.2.0-staging.63

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.
@@ -220,7 +220,8 @@ const config = {
220
220
  min: 0,
221
221
  max: 1,
222
222
  step: 0.1,
223
- default: 0.6
223
+ default: 0.6,
224
+ ignoreMax: true
224
225
  },
225
226
  {
226
227
  id: 'alignBanner',
@@ -65,7 +65,10 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
65
65
  class="${builderProps?.uid} ${helpers.getSettingPreloadData('gps-lazy')} ${advanced?.cssClass} ${isScrollToTop ? '!gp-pointer-events-none [&_gp-button_a]:!gp-pointer-events-auto' : ''}"
66
66
  style="${{
67
67
  margin: '0 auto',
68
+ ...style,
69
+ ...getCSSAlign(),
68
70
  ...displayStyle(),
71
+ ...core.makeStyleResponsive('w', w),
69
72
  'z-index': _const.ELEMENT_Z_INDEX.STICKY
70
73
  }}"
71
74
  >
@@ -74,9 +77,6 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
74
77
  ...builderAttrs
75
78
  }}
76
79
  style="${{
77
- ...style,
78
- ...getCSSAlign(),
79
- ...core.makeStyleResponsive('w', w),
80
80
  ...core.getStyleBackgroundByDevice(background)
81
81
  }}"
82
82
  >
@@ -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
- return version === 'v2' ? thirdParty.getLiquidForAppBlock(appBlockId, align, advanced?.cssClass) : core.template`
12
- <div
13
- class="${advanced?.cssClass}"
14
- style="${{
15
- ...core.makeStyleResponsive('ta', align)
16
- }}"
17
- >
11
+ const widgetTypeMap = {
12
+ 'review-widget': '<div class="custom-vstar-rating-widget"></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: 'starRating',
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',
@@ -226,15 +161,6 @@ const config = {
226
161
  id: 'install'
227
162
  }
228
163
  },
229
- {
230
- type: 'control',
231
- label: {
232
- en: 'Choose version'
233
- },
234
- setting: {
235
- id: 'version'
236
- }
237
- },
238
164
  {
239
165
  type: 'control',
240
166
  label: {
@@ -242,18 +168,7 @@ const config = {
242
168
  },
243
169
  setting: {
244
170
  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"'
171
+ }
257
172
  },
258
173
  {
259
174
  type: 'control',
@@ -216,7 +216,8 @@ const config = {
216
216
  min: 0,
217
217
  max: 1,
218
218
  step: 0.1,
219
- default: 0.6
219
+ default: 0.6,
220
+ ignoreMax: true
220
221
  },
221
222
  {
222
223
  id: 'alignBanner',
@@ -61,7 +61,10 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
61
61
  class="${builderProps?.uid} ${getSettingPreloadData('gps-lazy')} ${advanced?.cssClass} ${isScrollToTop ? '!gp-pointer-events-none [&_gp-button_a]:!gp-pointer-events-auto' : ''}"
62
62
  style="${{
63
63
  margin: '0 auto',
64
+ ...style,
65
+ ...getCSSAlign(),
64
66
  ...displayStyle(),
67
+ ...makeStyleResponsive('w', w),
65
68
  'z-index': ELEMENT_Z_INDEX.STICKY
66
69
  }}"
67
70
  >
@@ -70,9 +73,6 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
70
73
  ...builderAttrs
71
74
  }}
72
75
  style="${{
73
- ...style,
74
- ...getCSSAlign(),
75
- ...makeStyleResponsive('w', w),
76
76
  ...getStyleBackgroundByDevice(background)
77
77
  }}"
78
78
  >
@@ -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
- return version === 'v2' ? getLiquidForAppBlock(appBlockId, align, advanced?.cssClass) : template`
8
- <div
9
- class="${advanced?.cssClass}"
10
- style="${{
11
- ...makeStyleResponsive('ta', align)
12
- }}"
13
- >
7
+ const widgetTypeMap = {
8
+ 'review-widget': '<div class="custom-vstar-rating-widget"></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>
@@ -33,6 +37,19 @@ const Trustoo = ({ setting, advanced })=>{
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 };
@@ -61,76 +61,11 @@ const config = {
61
61
  href: 'https://admin.shopify.com/?redirect=/apps/sealapps-product-review',
62
62
  appName: TrustooConfig.label
63
63
  },
64
- {
65
- id: 'version',
66
- label: 'Choose version',
67
- type: 'select',
68
- default: 'v1',
69
- options: [
70
- {
71
- label: 'V1',
72
- value: 'v1'
73
- },
74
- {
75
- label: 'V2',
76
- value: 'v2'
77
- }
78
- ]
79
- },
80
64
  {
81
65
  id: 'widgetType',
82
66
  label: 'Choose widget',
83
67
  type: 'select',
84
- default: 'starRating',
85
- options: [
86
- {
87
- label: 'Star Rating',
88
- value: 'starRating',
89
- hideOnPage: [
90
- 'GP_ARTICLE',
91
- 'GP_BLOG',
92
- 'GP_COLLECTION',
93
- 'GP_INDEX',
94
- 'GP_STATIC'
95
- ],
96
- flowTag: [
97
- 'Product'
98
- ],
99
- condition: 'or'
100
- },
101
- {
102
- label: 'Star Rating List',
103
- value: 'starRatingInList',
104
- hideOnPage: [
105
- 'GP_ARTICLE',
106
- 'GP_BLOG',
107
- 'GP_COLLECTION',
108
- 'GP_INDEX',
109
- 'GP_STATIC'
110
- ],
111
- flowTag: [
112
- 'ProductList'
113
- ],
114
- condition: 'or'
115
- },
116
- {
117
- label: 'Reviews',
118
- value: 'reviews',
119
- hideOnPage: [
120
- 'GP_ARTICLE',
121
- 'GP_BLOG',
122
- 'GP_COLLECTION',
123
- 'GP_INDEX',
124
- 'GP_STATIC'
125
- ]
126
- }
127
- ]
128
- },
129
- {
130
- id: 'widgetTypeV2',
131
- label: 'Choose widget',
132
- type: 'select',
133
- default: 'barrage-carousel',
68
+ default: 'star-rating-widget',
134
69
  options: [
135
70
  {
136
71
  label: 'Testimonials',
@@ -222,15 +157,6 @@ const config = {
222
157
  id: 'install'
223
158
  }
224
159
  },
225
- {
226
- type: 'control',
227
- label: {
228
- en: 'Choose version'
229
- },
230
- setting: {
231
- id: 'version'
232
- }
233
- },
234
160
  {
235
161
  type: 'control',
236
162
  label: {
@@ -238,18 +164,7 @@ const config = {
238
164
  },
239
165
  setting: {
240
166
  id: 'widgetType'
241
- },
242
- condition: 'version === "v1"'
243
- },
244
- {
245
- type: 'control',
246
- label: {
247
- en: 'Choose widget'
248
- },
249
- setting: {
250
- id: 'widgetTypeV2'
251
- },
252
- condition: 'version === "v2"'
167
+ }
253
168
  },
254
169
  {
255
170
  type: 'control',
@@ -1,5 +1,5 @@
1
1
  import * as _gem_sdk_core from '@gem-sdk/core';
2
- import { BaseProps, TypographySettingV2, ObjectDevices, Background, SizeSettingGlobal, StateProp, ColorValueType, TypographySetting, Border, SizeSetting, CornerRadius, ShadowProps, BasePropsWrap, AlignProp, NameDevices, ResponsiveStateProp, Ratio, ObjectLayoutValue, TransformProp, PageContext, ProductProviderProps, JudgeMeReviewsWidgetType, LooxReviewsWidgetType, LooxReviewsWidgetTypeV2, ProductReviewsWidgetType, RyviuWidgetType, RivyoWidgetType, VitalsWidgetType, OmnisendWidgetType, TrustooWidgetType, TrustooWidgetTypeV2, FeraReviewsWidgetType, FeraReviewsV3WidgetType, BoldSubscriptionsWidgetType, PickyStoryWidgetType, WiserWidgetType, WiserV2WidgetType, StampedWidgetType, StampedWidgetTypeV2, LaiProductReviewsWidgetType, LaiProductReviewsAdvancedWidgetType, GrowaveWidgetTypeV2, GrowaveWidgetTypeV1, OpinewWidgetType, OpinewDesignWidgetType, UltimateSalesBoostWidgetType, YotpoReviewsWidgetType, AliReviewsWidgetType, BogosWidgetType, FastBundleWidgetType, PreOrderNowWodWidgetType, TagShopWidgetType, AirProductReview, InstantJudgeMeReviewsWidgetType, InstantLooxReviewsWidgetType, PostPurchaseTypo, AdvancedType, RawChild } from '@gem-sdk/core';
2
+ import { BaseProps, TypographySettingV2, ObjectDevices, Background, SizeSettingGlobal, StateProp, ColorValueType, TypographySetting, Border, SizeSetting, CornerRadius, ShadowProps, BasePropsWrap, AlignProp, NameDevices, ResponsiveStateProp, Ratio, ObjectLayoutValue, TransformProp, PageContext, ProductProviderProps, JudgeMeReviewsWidgetType, LooxReviewsWidgetType, LooxReviewsWidgetTypeV2, ProductReviewsWidgetType, RyviuWidgetType, RivyoWidgetType, VitalsWidgetType, OmnisendWidgetType, TrustooWidgetType, FeraReviewsWidgetType, FeraReviewsV3WidgetType, BoldSubscriptionsWidgetType, PickyStoryWidgetType, WiserWidgetType, WiserV2WidgetType, StampedWidgetType, StampedWidgetTypeV2, LaiProductReviewsWidgetType, LaiProductReviewsAdvancedWidgetType, GrowaveWidgetTypeV2, GrowaveWidgetTypeV1, OpinewWidgetType, OpinewDesignWidgetType, UltimateSalesBoostWidgetType, YotpoReviewsWidgetType, AliReviewsWidgetType, BogosWidgetType, FastBundleWidgetType, PreOrderNowWodWidgetType, TagShopWidgetType, AirProductReview, InstantJudgeMeReviewsWidgetType, InstantLooxReviewsWidgetType, PostPurchaseTypo, AdvancedType, RawChild } 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_react from '@gem-sdk/keen-slider/react';
@@ -2549,7 +2549,6 @@ declare const Omnisend$1: React.FC<OmnisendProps>;
2549
2549
 
2550
2550
  type TrustooProps = BaseProps<{
2551
2551
  widgetType?: TrustooWidgetType;
2552
- widgetTypeV2?: TrustooWidgetTypeV2;
2553
2552
  openApp?: any;
2554
2553
  install?: any;
2555
2554
  align?: ObjectDevices<AlignProp>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.2.0-staging.58",
3
+ "version": "2.2.0-staging.63",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -21,7 +21,7 @@
21
21
  "format": "prettier --write \"./src/**/*.{ts,tsx}\""
22
22
  },
23
23
  "devDependencies": {
24
- "@gem-sdk/core": "2.2.0-staging.57",
24
+ "@gem-sdk/core": "2.2.0-staging.62",
25
25
  "@gem-sdk/styles": "2.2.0-staging.52",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },