@gem-sdk/components 2.0.0-dev.635 → 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.
@@ -9,9 +9,12 @@ var Trustoo = require('../../configs/Trustoo.js');
9
9
  var React = require('react');
10
10
 
11
11
  const mapWidgetLabel = {
12
- starRating: 'Star Rating',
13
- starRatingInList: 'Star Rating List',
14
- reviews: 'Reviews'
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
- 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-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 gp-block"></div>
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" class="gp-block"></div>
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: 'starRating',
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
  {
@@ -5,9 +5,12 @@ import TrustooConfig from '../../configs/Trustoo.js';
5
5
  import { useMemo } from 'react';
6
6
 
7
7
  const mapWidgetLabel = {
8
- starRating: 'Star Rating',
9
- starRatingInList: 'Star Rating List',
10
- reviews: 'Reviews'
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
- 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-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 gp-block"></div>
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" class="gp-block"></div>
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: 'starRating',
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,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, TrustooWidgetTypeV2, UltimateSalesBoostWidgetType, VitalsWidgetType, YotpoReviewsWidgetType, InstantJudgeMeReviewsWidgetType, InstantLooxReviewsWidgetType, ComponentSetting } 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, 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.635",
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.625",
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",