@gem-sdk/components 2.5.3-staging.1 → 2.5.3-staging.10

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 (28) hide show
  1. package/dist/cjs/carousel/components/CarouselItem.js +1 -1
  2. package/dist/cjs/carousel/components/CarouselItem.liquid.js +1 -1
  3. package/dist/cjs/grid/components/Row.js +13 -5
  4. package/dist/cjs/grid/components/Row.liquid.js +2 -1
  5. package/dist/cjs/grid/setting/Row.js +31 -0
  6. package/dist/cjs/image/components/Image.js +4 -1
  7. package/dist/cjs/image/helpers/getSrcSet.js +2 -2
  8. package/dist/cjs/image/setting/Image.js +9 -0
  9. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +6 -1
  10. package/dist/cjs/text/setting/Text.js +2 -1
  11. package/dist/cjs/third-party/components/SproutPlantTreesGrowSales.liquid.js +1 -1
  12. package/dist/cjs/third-party/components/Trustoo.liquid.js +24 -7
  13. package/dist/cjs/third-party/setting/Trustoo.js +4 -111
  14. package/dist/esm/carousel/components/CarouselItem.js +1 -1
  15. package/dist/esm/carousel/components/CarouselItem.liquid.js +1 -1
  16. package/dist/esm/grid/components/Row.js +14 -6
  17. package/dist/esm/grid/components/Row.liquid.js +2 -1
  18. package/dist/esm/grid/setting/Row.js +31 -0
  19. package/dist/esm/image/components/Image.js +5 -2
  20. package/dist/esm/image/helpers/getSrcSet.js +2 -2
  21. package/dist/esm/image/setting/Image.js +9 -0
  22. package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +6 -1
  23. package/dist/esm/text/setting/Text.js +2 -1
  24. package/dist/esm/third-party/components/SproutPlantTreesGrowSales.liquid.js +1 -1
  25. package/dist/esm/third-party/components/Trustoo.liquid.js +24 -7
  26. package/dist/esm/third-party/setting/Trustoo.js +4 -111
  27. package/dist/types/index.d.ts +6 -2
  28. package/package.json +2 -2
@@ -71,7 +71,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
71
71
  onClick: onClickItem,
72
72
  "aria-hidden": true,
73
73
  children: /*#__PURE__*/ jsxRuntime.jsx("div", {
74
- className: "gp-w-full",
74
+ className: "gp-w-full gp-h-full",
75
75
  style: {
76
76
  ...itemShadowStyle
77
77
  },
@@ -82,7 +82,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
82
82
  data-index="${index}"
83
83
  >
84
84
  <div
85
- class="gp-w-full",
85
+ class="gp-w-full gp-h-full",
86
86
  style="${{
87
87
  ...itemShadowStyle
88
88
  }}"
@@ -13,6 +13,7 @@ var ChildrenDroppable = require('./ChildrenDroppable.js');
13
13
  const Row = ({ className, children, setting, builderAttrs, builderProps, styles, style, advanced, maxWidthWithEmptyChildren, isNotFullWidth, ...props })=>{
14
14
  const { isSection, as: Element = 'div', lazy, layout, horizontalAlign, verticalAlign, responsive, inlineAlignment, blockAlignment } = setting ?? {};
15
15
  const mode = core.useEditorMode();
16
+ const pageType = core.usePageType();
16
17
  //=== START lazyload section ====
17
18
  const [cacheHeightOutViewport, setCacheHeightOutViewport] = React.useState(500);
18
19
  const [ref, inView] = useInView.useInView({
@@ -29,6 +30,13 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
29
30
  }
30
31
  }
31
32
  });
33
+ const isDisplaySection = React.useMemo(()=>{
34
+ return inView || mode !== 'edit' || pageType === 'POST_PURCHASE';
35
+ }, [
36
+ inView,
37
+ mode,
38
+ pageType
39
+ ]);
32
40
  //=== END lazyload section ====
33
41
  const childHasChildren = React.useMemo(()=>{
34
42
  return builderProps?.builderData?.childrens?.length;
@@ -42,8 +50,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
42
50
  childHasChildren,
43
51
  children
44
52
  ]);
45
- const { fullWidth, width, verticalGutter, background, columnGap } = styles ?? {};
46
- const pageType = core.usePageType();
53
+ const { fullWidth, width, verticalGutter, background, columnGap, height } = styles ?? {};
47
54
  const styleObject = helpers.createStyleObject(width, pageType === 'POST_PURCHASE' && isSection ? {
48
55
  desktop: false,
49
56
  tablet: false,
@@ -62,7 +69,8 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
62
69
  ...isSection ? restStyle : style,
63
70
  ...core.makeStyleResponsive('cg', verticalGutter),
64
71
  ...layout ? core.composeGridLayout(layout) : core.makeStyleResponsive('gtc', responsive),
65
- ...core.makeStyleResponsive('w', styleObject.content)
72
+ ...core.makeStyleResponsive('w', styleObject.content),
73
+ ...core.makeStyleResponsive('h', height)
66
74
  };
67
75
  if (pageType === 'POST_PURCHASE') {
68
76
  result = {
@@ -116,10 +124,10 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
116
124
  "data-id": builderProps?.uidInteraction ?? builderProps?.uid,
117
125
  ref: ref,
118
126
  style: getStyles(),
119
- className: core.cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out ', {
127
+ className: core.cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out gp-grid-rows-[1fr]', {
120
128
  'gp-content-visibility-hidden': mode !== 'edit' && isSection && lazy && !inView
121
129
  }),
122
- children: inView || mode !== 'edit' ? /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
130
+ children: isDisplaySection ? /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
123
131
  children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : React.Children.map(children, (el)=>{
124
132
  if (/*#__PURE__*/ React.isValidElement(el)) return /*#__PURE__*/ React.createElement(el.type, {
125
133
  ...el.props,
@@ -8,7 +8,7 @@ var helpers = require('../../helpers.js');
8
8
 
9
9
  const Row = ({ className, children, setting, builderAttrs, builderProps, styles, style, rawChildren, advanced, ...props })=>{
10
10
  const { isSection, horizontalAlign, verticalAlign, order, layout, responsive } = setting ?? {};
11
- const { fullWidth, width, verticalGutter, background } = styles ?? {};
11
+ const { fullWidth, width, verticalGutter, background, height } = styles ?? {};
12
12
  const styleObject = helpers$1.createStyleObject(width, fullWidth);
13
13
  const [wrapStyle, restStyle] = core.splitStyle([
14
14
  'pos',
@@ -31,6 +31,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
31
31
  ...core.makeStyleResponsive('pc', horizontalAlign),
32
32
  ...layout ? core.composeGridLayout(layout) : core.makeStyleResponsive('gtc', responsive),
33
33
  ...core.makeStyleResponsive('w', styleObject.content),
34
+ ...core.makeStyleResponsive('h', height),
34
35
  ...core.getStyleBackgroundByDevice(background, {
35
36
  liquid: true
36
37
  }),
@@ -254,6 +254,27 @@ const config = {
254
254
  }
255
255
  }
256
256
  },
257
+ {
258
+ id: 'height',
259
+ type: 'segment',
260
+ devices: {
261
+ desktop: {
262
+ default: 'auto'
263
+ }
264
+ },
265
+ options: [
266
+ {
267
+ label: 'Full',
268
+ value: '100%',
269
+ tooltip: 'Stretch to fill <br> vertical space around'
270
+ },
271
+ {
272
+ label: 'Fit',
273
+ value: 'auto',
274
+ tooltip: 'Auto-resize <br> based on content'
275
+ }
276
+ ]
277
+ },
257
278
  {
258
279
  id: 'verticalGutter',
259
280
  type: 'input:unit-spacing',
@@ -408,6 +429,16 @@ const config = {
408
429
  },
409
430
  layout: 'horizontal'
410
431
  },
432
+ {
433
+ type: 'control',
434
+ setting: {
435
+ id: 'height'
436
+ },
437
+ label: {
438
+ en: 'Height'
439
+ },
440
+ layout: 'horizontal'
441
+ },
411
442
  {
412
443
  type: 'control',
413
444
  label: {
@@ -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)
@@ -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 ?? image?.src;
56
+ return src;
57
57
  };
58
58
  const regexReplaceEndDot = /\.(?=[^.]*$)/;
59
59
  const replaceBackupFileKeyFileContent = (backupFileKey)=>{
@@ -148,6 +148,15 @@ const config = {
148
148
  displayOptions: [
149
149
  'full'
150
150
  ]
151
+ },
152
+ height: {
153
+ displayOptions: [
154
+ 'full'
155
+ ],
156
+ units: [
157
+ 'px',
158
+ '%'
159
+ ]
151
160
  }
152
161
  },
153
162
  hiddenSettings: [
@@ -123,7 +123,12 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
123
123
  return core.template`
124
124
  {% assign src = featureMedia.src %}
125
125
  ${hasHoverEffect && setting.hoverEffect == 'other' ? `
126
- {% assign otherImage = product.media[${setting.otherImage}] %}
126
+ {% assign media_length = product.media | size %}
127
+ {% assign other_image_index = ${setting.otherImage} | plus: 0 %}
128
+ {% if other_image_index >= media_length %}
129
+ {% assign other_image_index = media_length | minus: 1 %}
130
+ {% endif %}
131
+ {% assign otherImage = product.media[other_image_index] %}
127
132
  {% assign src = otherImage.src %}
128
133
  {% if otherImage.media_type != 'image' %}
129
134
  {% assign src = otherImage.preview_image.src %}
@@ -150,7 +150,8 @@ const config = {
150
150
  default: {
151
151
  type: 'paragraph-1',
152
152
  attrs: {
153
- color: 'text-1'
153
+ color: 'text-1',
154
+ isAlwaysLoadBold: false
154
155
  }
155
156
  },
156
157
  ignoreReRender: true
@@ -6,7 +6,7 @@ var thirdParty = require('../helpers/thirdParty.js');
6
6
 
7
7
  const SproutPlantTreesGrowSales = ({ setting, advanced })=>{
8
8
  const { align, appBlockId } = setting ?? {};
9
- return thirdParty.getLiquidForAppBlock(appBlockId, align, advanced?.cssClass);
9
+ return thirdParty.getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''}!gp-block`);
10
10
  };
11
11
 
12
12
  exports.default = SproutPlantTreesGrowSales;
@@ -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>
@@ -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',
@@ -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',
@@ -67,7 +67,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
67
67
  onClick: onClickItem,
68
68
  "aria-hidden": true,
69
69
  children: /*#__PURE__*/ jsx("div", {
70
- className: "gp-w-full",
70
+ className: "gp-w-full gp-h-full",
71
71
  style: {
72
72
  ...itemShadowStyle
73
73
  },
@@ -78,7 +78,7 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
78
78
  data-index="${index}"
79
79
  >
80
80
  <div
81
- class="gp-w-full",
81
+ class="gp-w-full gp-h-full",
82
82
  style="${{
83
83
  ...itemShadowStyle
84
84
  }}"
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { useState, useMemo, Children, isValidElement, createElement } from 'react';
3
- import { useEditorMode, useCurrentDevice, isEmptyChildren, usePageType, splitStyle, cls, makeStyleResponsive, composeGridLayout, makeStyle, getStyleBackgroundByDevice, getGradientBgrStyleByDevice, getResponsiveValue } from '@gem-sdk/core';
3
+ import { useEditorMode, usePageType, useCurrentDevice, isEmptyChildren, splitStyle, cls, makeStyleResponsive, composeGridLayout, makeStyle, getStyleBackgroundByDevice, getGradientBgrStyleByDevice, getResponsiveValue } from '@gem-sdk/core';
4
4
  import Head from 'next/head';
5
5
  import { useInView } from '../../intersection-observer/useInView.js';
6
6
  import { createStyleObject } from './helpers.js';
@@ -9,6 +9,7 @@ import ChildrenDroppable from './ChildrenDroppable.js';
9
9
  const Row = ({ className, children, setting, builderAttrs, builderProps, styles, style, advanced, maxWidthWithEmptyChildren, isNotFullWidth, ...props })=>{
10
10
  const { isSection, as: Element = 'div', lazy, layout, horizontalAlign, verticalAlign, responsive, inlineAlignment, blockAlignment } = setting ?? {};
11
11
  const mode = useEditorMode();
12
+ const pageType = usePageType();
12
13
  //=== START lazyload section ====
13
14
  const [cacheHeightOutViewport, setCacheHeightOutViewport] = useState(500);
14
15
  const [ref, inView] = useInView({
@@ -25,6 +26,13 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
25
26
  }
26
27
  }
27
28
  });
29
+ const isDisplaySection = useMemo(()=>{
30
+ return inView || mode !== 'edit' || pageType === 'POST_PURCHASE';
31
+ }, [
32
+ inView,
33
+ mode,
34
+ pageType
35
+ ]);
28
36
  //=== END lazyload section ====
29
37
  const childHasChildren = useMemo(()=>{
30
38
  return builderProps?.builderData?.childrens?.length;
@@ -38,8 +46,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
38
46
  childHasChildren,
39
47
  children
40
48
  ]);
41
- const { fullWidth, width, verticalGutter, background, columnGap } = styles ?? {};
42
- const pageType = usePageType();
49
+ const { fullWidth, width, verticalGutter, background, columnGap, height } = styles ?? {};
43
50
  const styleObject = createStyleObject(width, pageType === 'POST_PURCHASE' && isSection ? {
44
51
  desktop: false,
45
52
  tablet: false,
@@ -58,7 +65,8 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
58
65
  ...isSection ? restStyle : style,
59
66
  ...makeStyleResponsive('cg', verticalGutter),
60
67
  ...layout ? composeGridLayout(layout) : makeStyleResponsive('gtc', responsive),
61
- ...makeStyleResponsive('w', styleObject.content)
68
+ ...makeStyleResponsive('w', styleObject.content),
69
+ ...makeStyleResponsive('h', height)
62
70
  };
63
71
  if (pageType === 'POST_PURCHASE') {
64
72
  result = {
@@ -112,10 +120,10 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
112
120
  "data-id": builderProps?.uidInteraction ?? builderProps?.uid,
113
121
  ref: ref,
114
122
  style: getStyles(),
115
- className: cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out ', {
123
+ className: cls(className, builderProps?.uid, 'gp-mb-0 gp-grid gp-mx-auto gp-max-w-full gp-gap-y-0 gp-transition-colors gp-duration-200 gp-ease-in-out gp-grid-rows-[1fr]', {
116
124
  'gp-content-visibility-hidden': mode !== 'edit' && isSection && lazy && !inView
117
125
  }),
118
- children: inView || mode !== 'edit' ? /*#__PURE__*/ jsx(Fragment, {
126
+ children: isDisplaySection ? /*#__PURE__*/ jsx(Fragment, {
119
127
  children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : Children.map(children, (el)=>{
120
128
  if (/*#__PURE__*/ isValidElement(el)) return /*#__PURE__*/ createElement(el.type, {
121
129
  ...el.props,
@@ -4,7 +4,7 @@ import { getSettingPreloadData } from '../../helpers.js';
4
4
 
5
5
  const Row = ({ className, children, setting, builderAttrs, builderProps, styles, style, rawChildren, advanced, ...props })=>{
6
6
  const { isSection, horizontalAlign, verticalAlign, order, layout, responsive } = setting ?? {};
7
- const { fullWidth, width, verticalGutter, background } = styles ?? {};
7
+ const { fullWidth, width, verticalGutter, background, height } = styles ?? {};
8
8
  const styleObject = createStyleObject(width, fullWidth);
9
9
  const [wrapStyle, restStyle] = splitStyle([
10
10
  'pos',
@@ -27,6 +27,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
27
27
  ...makeStyleResponsive('pc', horizontalAlign),
28
28
  ...layout ? composeGridLayout(layout) : makeStyleResponsive('gtc', responsive),
29
29
  ...makeStyleResponsive('w', styleObject.content),
30
+ ...makeStyleResponsive('h', height),
30
31
  ...getStyleBackgroundByDevice(background, {
31
32
  liquid: true
32
33
  }),
@@ -250,6 +250,27 @@ const config = {
250
250
  }
251
251
  }
252
252
  },
253
+ {
254
+ id: 'height',
255
+ type: 'segment',
256
+ devices: {
257
+ desktop: {
258
+ default: 'auto'
259
+ }
260
+ },
261
+ options: [
262
+ {
263
+ label: 'Full',
264
+ value: '100%',
265
+ tooltip: 'Stretch to fill <br> vertical space around'
266
+ },
267
+ {
268
+ label: 'Fit',
269
+ value: 'auto',
270
+ tooltip: 'Auto-resize <br> based on content'
271
+ }
272
+ ]
273
+ },
253
274
  {
254
275
  id: 'verticalGutter',
255
276
  type: 'input:unit-spacing',
@@ -404,6 +425,16 @@ const config = {
404
425
  },
405
426
  layout: 'horizontal'
406
427
  },
428
+ {
429
+ type: 'control',
430
+ setting: {
431
+ id: 'height'
432
+ },
433
+ label: {
434
+ en: 'Height'
435
+ },
436
+ layout: 'horizontal'
437
+ },
407
438
  {
408
439
  type: 'control',
409
440
  label: {
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
2
+ import { makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, getFlexGrowClassByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
3
3
  import Link from '../../link/components/Link.js';
4
4
  import AdaptiveImage from './AdaptiveImage.js';
5
5
  import NextImage from './NextImage.js';
@@ -17,6 +17,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
17
17
  };
18
18
  const imageWidth = shape ? makeStyleResponsive('w', getWidthByShapeGlobalSize(shape)) : makeStyleResponsive('w', makeWidth(styles?.width, styles?.fullWidth));
19
19
  const imageHeight = makeStyleResponsive('h', getHeightByShapeGlobalSize(shape));
20
+ const imageFlexGrowClass = getFlexGrowClassByShapeGlobalSize(shape);
20
21
  const overwriteDefaultRadius = (cornerRadius)=>{
21
22
  const radius = {
22
23
  ...cornerRadius
@@ -57,7 +58,9 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
57
58
  "data-id": builderProps?.uid,
58
59
  onClick: onClick,
59
60
  role: "presentation",
60
- className: cls('gp-group/image gp-relative', builderProps?.uid),
61
+ className: cls('gp-group/image gp-relative', builderProps?.uid, {
62
+ ...imageFlexGrowClass
63
+ }),
61
64
  style: {
62
65
  ...style,
63
66
  ...makeStyleResponsive('ta', styles?.align)
@@ -32,7 +32,7 @@ const getSrcSetLink = (link)=>{
32
32
  // return `${link} 768w,${link} 1024w,${link} 1440w`;
33
33
  };
34
34
  const getImageSrc = (image, currentDevice)=>{
35
- let src = image?.backupFilePath;
35
+ let src = image?.backupFilePath ?? image?.src;
36
36
  if (image?.backupFileKey) {
37
37
  const newBackupFileKey = getNewBackupFileKey(image.backupFileKey, image?.src ?? '');
38
38
  if (image.storage === 'THEME' || !image.storage) {
@@ -51,7 +51,7 @@ const getImageSrc = (image, currentDevice)=>{
51
51
  break;
52
52
  }
53
53
  }
54
- return src ?? image?.src;
54
+ return src;
55
55
  };
56
56
  const regexReplaceEndDot = /\.(?=[^.]*$)/;
57
57
  const replaceBackupFileKeyFileContent = (backupFileKey)=>{
@@ -144,6 +144,15 @@ const config = {
144
144
  displayOptions: [
145
145
  'full'
146
146
  ]
147
+ },
148
+ height: {
149
+ displayOptions: [
150
+ 'full'
151
+ ],
152
+ units: [
153
+ 'px',
154
+ '%'
155
+ ]
147
156
  }
148
157
  },
149
158
  hiddenSettings: [
@@ -119,7 +119,12 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
119
119
  return template`
120
120
  {% assign src = featureMedia.src %}
121
121
  ${hasHoverEffect && setting.hoverEffect == 'other' ? `
122
- {% assign otherImage = product.media[${setting.otherImage}] %}
122
+ {% assign media_length = product.media | size %}
123
+ {% assign other_image_index = ${setting.otherImage} | plus: 0 %}
124
+ {% if other_image_index >= media_length %}
125
+ {% assign other_image_index = media_length | minus: 1 %}
126
+ {% endif %}
127
+ {% assign otherImage = product.media[other_image_index] %}
123
128
  {% assign src = otherImage.src %}
124
129
  {% if otherImage.media_type != 'image' %}
125
130
  {% assign src = otherImage.preview_image.src %}
@@ -146,7 +146,8 @@ const config = {
146
146
  default: {
147
147
  type: 'paragraph-1',
148
148
  attrs: {
149
- color: 'text-1'
149
+ color: 'text-1',
150
+ isAlwaysLoadBold: false
150
151
  }
151
152
  },
152
153
  ignoreReRender: true
@@ -2,7 +2,7 @@ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
2
2
 
3
3
  const SproutPlantTreesGrowSales = ({ setting, advanced })=>{
4
4
  const { align, appBlockId } = setting ?? {};
5
- return getLiquidForAppBlock(appBlockId, align, advanced?.cssClass);
5
+ return getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''}!gp-block`);
6
6
  };
7
7
 
8
8
  export { SproutPlantTreesGrowSales as default };
@@ -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>
@@ -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',
@@ -146,33 +81,11 @@ const config = {
146
81
  },
147
82
  {
148
83
  label: 'Review Widget',
149
- value: 'review-widget',
150
- hideOnPage: [
151
- 'ARTICLE',
152
- 'BLOG',
153
- 'COLLECTION',
154
- 'GP_ARTICLE',
155
- 'GP_BLOG',
156
- 'GP_COLLECTION',
157
- 'GP_INDEX',
158
- 'GP_STATIC',
159
- 'STATIC'
160
- ]
84
+ value: 'review-widget'
161
85
  },
162
86
  {
163
87
  label: 'Star Rating Widget',
164
- value: 'star-rating-widget',
165
- hideOnPage: [
166
- 'ARTICLE',
167
- 'BLOG',
168
- 'COLLECTION',
169
- 'GP_ARTICLE',
170
- 'GP_BLOG',
171
- 'GP_COLLECTION',
172
- 'GP_INDEX',
173
- 'GP_STATIC',
174
- 'STATIC'
175
- ]
88
+ value: 'star-rating-widget'
176
89
  },
177
90
  {
178
91
  label: 'Text Carousel',
@@ -222,15 +135,6 @@ const config = {
222
135
  id: 'install'
223
136
  }
224
137
  },
225
- {
226
- type: 'control',
227
- label: {
228
- en: 'Choose version'
229
- },
230
- setting: {
231
- id: 'version'
232
- }
233
- },
234
138
  {
235
139
  type: 'control',
236
140
  label: {
@@ -238,18 +142,7 @@ const config = {
238
142
  },
239
143
  setting: {
240
144
  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"'
145
+ }
253
146
  },
254
147
  {
255
148
  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';
@@ -548,6 +548,7 @@ type RowProps$1 = BaseProps<{
548
548
  }, {
549
549
  fullWidth?: ObjectDevices<boolean>;
550
550
  width?: ObjectDevices<string>;
551
+ height?: ObjectDevices<'auto' | '100%'>;
551
552
  verticalGutter?: ObjectDevices<string>;
552
553
  background?: ObjectDevices<Background>;
553
554
  preloadBgImage?: boolean;
@@ -2555,7 +2556,6 @@ declare const Omnisend$1: React.FC<OmnisendProps>;
2555
2556
 
2556
2557
  type TrustooProps = BaseProps<{
2557
2558
  widgetType?: TrustooWidgetType;
2558
- widgetTypeV2?: TrustooWidgetTypeV2;
2559
2559
  openApp?: any;
2560
2560
  install?: any;
2561
2561
  align?: ObjectDevices<AlignProp>;
@@ -5537,6 +5537,7 @@ type RowProps = BaseProps<{
5537
5537
  }, {
5538
5538
  fullWidth?: ObjectDevices<boolean>;
5539
5539
  width?: ObjectDevices<string>;
5540
+ height?: ObjectDevices<'auto' | '100%'>;
5540
5541
  verticalGutter?: ObjectDevices<string>;
5541
5542
  background?: ObjectDevices<Background>;
5542
5543
  preloadBgImage?: boolean;
@@ -5682,6 +5683,7 @@ declare const Product: ({ children, setting, styles, style, builderProps, rawChi
5682
5683
  }, {
5683
5684
  fullWidth?: Partial<Record<_gem_sdk_core.NameDevices, boolean>> | undefined;
5684
5685
  width?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
5686
+ height?: Partial<Record<_gem_sdk_core.NameDevices, "auto" | "100%">> | undefined;
5685
5687
  verticalGutter?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
5686
5688
  background?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.Background>> | undefined;
5687
5689
  preloadBgImage?: boolean | undefined;
@@ -6481,6 +6483,7 @@ declare const HeroBanner: ({ builderAttrs, builderProps, setting, styles, style,
6481
6483
  } & Pick<{
6482
6484
  fullWidth?: Partial<Record<NameDevices, boolean>> | undefined;
6483
6485
  width?: Partial<Record<NameDevices, string>> | undefined;
6486
+ height?: Partial<Record<NameDevices, "auto" | "100%">> | undefined;
6484
6487
  verticalGutter?: Partial<Record<NameDevices, string>> | undefined;
6485
6488
  background?: Partial<Record<NameDevices, Background>> | undefined;
6486
6489
  preloadBgImage?: boolean | undefined;
@@ -6724,6 +6727,7 @@ declare const CollectionBanner: ({ builderAttrs, builderProps, setting, style, c
6724
6727
  }, "layout" | "verticalAlign" | "horizontalAlign"> & Pick<{
6725
6728
  fullWidth?: Partial<Record<_gem_sdk_core.NameDevices, boolean>> | undefined;
6726
6729
  width?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
6730
+ height?: Partial<Record<_gem_sdk_core.NameDevices, "auto" | "100%">> | undefined;
6727
6731
  verticalGutter?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
6728
6732
  background?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.Background>> | undefined;
6729
6733
  preloadBgImage?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.5.3-staging.1",
3
+ "version": "2.5.3-staging.10",
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.5.3-staging.1",
24
+ "@gem-sdk/core": "2.5.3-staging.10",
25
25
  "@gem-sdk/styles": "2.4.8",
26
26
  "@types/react-transition-group": "^4.4.5"
27
27
  },