@gem-sdk/components 2.0.0-dev.700 → 2.0.0-dev.702

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 (110) hide show
  1. package/dist/cjs/banner/components/common/common.js +16 -5
  2. package/dist/cjs/banner/components/common/getStyle.js +1 -1
  3. package/dist/cjs/banner/components/hooks/useHeroBanner.js +1 -1
  4. package/dist/cjs/banner/setting/uiV2.js +37 -0
  5. package/dist/cjs/button/components/Button.js +4 -1
  6. package/dist/cjs/carousel/carousel-item/common/getClass.js +1 -1
  7. package/dist/cjs/grid/row/commons/getClass.js +1 -1
  8. package/dist/cjs/grid/row/commons/getStyle.js +2 -1
  9. package/dist/cjs/grid/row/setting/configs/settings.js +21 -0
  10. package/dist/cjs/grid/row/setting/configs/uiV2.js +10 -4
  11. package/dist/cjs/helpers.js +31 -1
  12. package/dist/cjs/icon-list-v2/components/IconList.liquid.js +1 -0
  13. package/dist/cjs/image/components/Image.js +1 -1
  14. package/dist/cjs/image/components/Image.liquid.js +1 -1
  15. package/dist/cjs/image/components/common/classes.js +3 -1
  16. package/dist/cjs/image/helpers/getSrcSet.js +2 -1
  17. package/dist/cjs/image/setting/configs/settings.js +9 -0
  18. package/dist/cjs/index.js +2 -0
  19. package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +5 -1
  20. package/dist/cjs/product/components/ProductBundle/common/styles.js +2 -2
  21. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +1 -1
  22. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
  23. package/dist/cjs/product/components/ProductBundle/setting/ProductBundleDiscount.js +2 -8
  24. package/dist/cjs/product/components/ProductImagesV2/common/common.js +1 -1
  25. package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +6 -2
  26. package/dist/cjs/product/components/ProductList/ProductList.liquid.js +4 -8
  27. package/dist/cjs/product/components/ProductVariants/index.liquid.js +8 -3
  28. package/dist/cjs/product/setting/constant/bundle-layout/horizontalThree.js +4 -6
  29. package/dist/cjs/product/setting/constant/bundle-layout/horizontalTwo.js +3 -5
  30. package/dist/cjs/product/setting/constant/bundle-layout/verticalThree.js +2 -1
  31. package/dist/cjs/product/setting/constant/bundle-layout/verticalTwo.js +2 -1
  32. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +13 -11
  33. package/dist/cjs/stock-counter/components/common/getContent.js +1 -1
  34. package/dist/cjs/text/components/Text.liquid.js +1 -0
  35. package/dist/cjs/text/components/common/getDisplayText.js +11 -20
  36. package/dist/cjs/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
  37. package/dist/cjs/third-party/components/ProductOptionsVariantOption.js +2 -2
  38. package/dist/cjs/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
  39. package/dist/cjs/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
  40. package/dist/cjs/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  41. package/dist/cjs/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
  42. package/dist/cjs/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
  43. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
  44. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
  45. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
  46. package/dist/cjs/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
  47. package/dist/cjs/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
  48. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
  49. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
  50. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
  51. package/dist/cjs/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
  52. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
  53. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
  54. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
  55. package/dist/esm/banner/components/common/common.js +17 -6
  56. package/dist/esm/banner/components/common/getStyle.js +1 -1
  57. package/dist/esm/banner/components/hooks/useHeroBanner.js +1 -1
  58. package/dist/esm/banner/setting/uiV2.js +37 -0
  59. package/dist/esm/button/components/Button.js +4 -1
  60. package/dist/esm/carousel/carousel-item/common/getClass.js +1 -1
  61. package/dist/esm/grid/row/commons/getClass.js +1 -1
  62. package/dist/esm/grid/row/commons/getStyle.js +2 -1
  63. package/dist/esm/grid/row/setting/configs/settings.js +21 -0
  64. package/dist/esm/grid/row/setting/configs/uiV2.js +10 -4
  65. package/dist/esm/helpers.js +30 -2
  66. package/dist/esm/icon-list-v2/components/IconList.liquid.js +1 -0
  67. package/dist/esm/image/components/Image.js +1 -1
  68. package/dist/esm/image/components/Image.liquid.js +1 -1
  69. package/dist/esm/image/components/common/classes.js +4 -2
  70. package/dist/esm/image/helpers/getSrcSet.js +2 -1
  71. package/dist/esm/image/setting/configs/settings.js +9 -0
  72. package/dist/esm/index.js +1 -1
  73. package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +5 -1
  74. package/dist/esm/product/components/ProductBundle/common/styles.js +2 -2
  75. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +1 -1
  76. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
  77. package/dist/esm/product/components/ProductBundle/setting/ProductBundleDiscount.js +2 -8
  78. package/dist/esm/product/components/ProductImagesV2/common/common.js +1 -1
  79. package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +6 -2
  80. package/dist/esm/product/components/ProductList/ProductList.liquid.js +4 -8
  81. package/dist/esm/product/components/ProductVariants/index.liquid.js +8 -3
  82. package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +4 -6
  83. package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +3 -5
  84. package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +2 -1
  85. package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +2 -1
  86. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +13 -11
  87. package/dist/esm/stock-counter/components/common/getContent.js +1 -1
  88. package/dist/esm/text/components/Text.liquid.js +1 -0
  89. package/dist/esm/text/components/common/getDisplayText.js +12 -21
  90. package/dist/esm/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
  91. package/dist/esm/third-party/components/ProductOptionsVariantOption.js +2 -2
  92. package/dist/esm/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
  93. package/dist/esm/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
  94. package/dist/esm/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  95. package/dist/esm/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
  96. package/dist/esm/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
  97. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
  98. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
  99. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
  100. package/dist/esm/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
  101. package/dist/esm/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
  102. package/dist/esm/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
  103. package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
  104. package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
  105. package/dist/esm/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
  106. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
  107. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
  108. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
  109. package/dist/types/index.d.ts +5 -1
  110. package/package.json +2 -2
@@ -3,8 +3,8 @@
3
3
  var core = require('@gem-sdk/core');
4
4
  var getSrcSet = require('../../../image/helpers/getSrcSet.js');
5
5
  var constant = require('../../../constant.js');
6
+ var helpers = require('../../../image/components/common/helpers.js');
6
7
 
7
- const imagePlaceholder = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
8
8
  const getContentPosition = (layout, contentPosition1Col, contentPosition2Col)=>{
9
9
  let result = {};
10
10
  const devices = [
@@ -60,13 +60,24 @@ const getBgImage = (background)=>{
60
60
  };
61
61
  return bgImage;
62
62
  };
63
+ const imagePlaceholder = (background)=>{
64
+ const srcSet = getBgImage(background);
65
+ return {
66
+ desktop: helpers.createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0),
67
+ tablet: helpers.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
68
+ mobile: helpers.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
69
+ };
70
+ };
63
71
  const getBackgroundImageHeroBanner = (background, enableLazyImage = false, isNotLiquid = false)=>{
64
72
  const srcSet = getBgImage(background);
65
- return core.makeStyleResponsive('bgi', {
66
- desktop: `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'desktop'), 'desktop', isNotLiquid) : imagePlaceholder}')`,
67
- tablet: `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'tablet'), 'tablet', isNotLiquid) : imagePlaceholder}')`,
68
- mobile: `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, 'mobile'), 'mobile', isNotLiquid) : imagePlaceholder}')`
73
+ let result = {};
74
+ core.DEVICES.forEach((device)=>{
75
+ result = {
76
+ ...result,
77
+ [device]: `url('${!enableLazyImage ? getSrcSet.getImageSrc(core.getResponsiveValueByScreen(srcSet, device), device, isNotLiquid) : imagePlaceholder(background)}')`
78
+ };
69
79
  });
80
+ return core.makeStyleResponsive('bgi', result);
70
81
  };
71
82
  const getAttachmentDevice = (background)=>{
72
83
  let result = {};
@@ -100,7 +100,7 @@ const getBackgroundStyle = (styles, enableParallax, transform)=>{
100
100
  }),
101
101
  ...core.getGradientBgrStyleByDevice(background, common.bgiEnableByDevice(background)),
102
102
  '--duration': `${hoverEffectDuration ?? 0}s`,
103
- '--scale': hoverEffectScale ?? 1,
103
+ '--scale': `${hoverEffectScale || 100}%`,
104
104
  ...core.makeStyleResponsive('pos', common.getAttachmentDevice(background)),
105
105
  transform,
106
106
  transition: 'transform 300ms cubic-bezier(0,0,0,1)'
@@ -29,7 +29,7 @@ const useHeroBanner = (styles, setting, currentDevice)=>{
29
29
  const enableParallax = Number(setting?.speedParallax || 0) > 0 && backgroundResponsive[currentDevice]?.type === 'image' || false;
30
30
  const onMouseEnterParallax = ()=>{
31
31
  if (hoverEffect && enableParallax) {
32
- setTransform(`${transform} scale(${hoverEffectScale})`);
32
+ setTransform(`${transform} scale(${hoverEffectScale || 100}%)`);
33
33
  }
34
34
  };
35
35
  const onMouseLeaveParallax = ()=>{
@@ -120,6 +120,43 @@ const SettingUIV2 = [
120
120
  controlType: 'setting',
121
121
  removeDevice: true
122
122
  }
123
+ },
124
+ {
125
+ condition: '!background.image.src',
126
+ source: [
127
+ 'background'
128
+ ],
129
+ action: {
130
+ controlId: 'sizeSetting',
131
+ newValue: {
132
+ shapeLinked: false,
133
+ hiddenShape: true
134
+ },
135
+ valueIfNull: {
136
+ width: '100%',
137
+ height: 'fit-content',
138
+ hiddenShape: true
139
+ },
140
+ groupType: 'style',
141
+ controlType: 'size-setting'
142
+ }
143
+ },
144
+ {
145
+ condition: '!!background.image.src',
146
+ source: [
147
+ 'background'
148
+ ],
149
+ action: {
150
+ controlId: 'sizeSetting',
151
+ newValue: {
152
+ hiddenShape: false
153
+ },
154
+ valueIfNull: {
155
+ hiddenShape: false
156
+ },
157
+ groupType: 'style',
158
+ controlType: 'size-setting'
159
+ }
123
160
  }
124
161
  ],
125
162
  options: {
@@ -86,7 +86,10 @@ const Button = (props)=>{
86
86
  className: buttonWrapperClasses,
87
87
  children: [
88
88
  /*#__PURE__*/ jsxRuntime.jsx("style", {
89
- children: customCss
89
+ type: "text/css",
90
+ dangerouslySetInnerHTML: {
91
+ __html: customCss
92
+ }
90
93
  }),
91
94
  system.If(isScrollToElement, // eslint-disable-next-line jsx-a11y/anchor-has-content
92
95
  /*#__PURE__*/ jsxRuntime.jsx("a", {
@@ -18,7 +18,7 @@ const getClass = (props)=>{
18
18
  }
19
19
  });
20
20
  const carouselItemInnerClass = system.createClass({
21
- 'gp-w-full': true
21
+ 'gp-w-full gp-h-full': true
22
22
  });
23
23
  return {
24
24
  carouselItemClass,
@@ -17,7 +17,7 @@ const getClass = (props)=>{
17
17
  ...builderProps?.uid && {
18
18
  [builderProps.uid]: true
19
19
  },
20
- 'gp-relative gp-mx-auto gp-mb-0 gp-grid gp-max-w-full gp-transition-colors gp-duration-200 gp-ease-in-out [&_*]:gp-max-w-full': true,
20
+ 'gp-relative gp-mx-auto gp-mb-0 gp-grid gp-max-w-full gp-transition-colors gp-duration-200 gp-ease-in-out [&_*]:gp-max-w-full gp-grid-rows-[1fr]': true,
21
21
  ...advanced?.cssClass && {
22
22
  [advanced?.cssClass]: true
23
23
  }
@@ -10,7 +10,7 @@ var helper = require('../../../post-purchase/utils/helper.js');
10
10
  const getRowStyle = (rowProps)=>{
11
11
  const { children, setting, builderProps, styles, style, advanced, isNotFullWidth, parentStyle } = rowProps;
12
12
  const { isSection, layout, horizontalAlign, responsive, inlineAlignment } = setting ?? {};
13
- const { width, columnGap, rowGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding } = styles ?? {};
13
+ const { width, columnGap, rowGap, fullWidth, background, verticalGutter, verticalGutterMobile, enablePagePadding, height } = styles ?? {};
14
14
  const innerRadius = getInnerRadius.getInnerRadiusExcludeBorder(advanced?.border, advanced?.rounded);
15
15
  const checkHasRadius = (corner)=>{
16
16
  const cornerNormal = corner?.normal;
@@ -51,6 +51,7 @@ const getRowStyle = (rowProps)=>{
51
51
  ...core.makeStyleResponsive('rg', verticalGutterMobile),
52
52
  ...layout ? core.composeGridLayout(layout) : core.makeStyleResponsive('gtc', responsive),
53
53
  ...core.makeStyleResponsive('w', sizeStyles.content),
54
+ ...core.makeStyleResponsive('h', height),
54
55
  ...isSection ? {} : overFlowStyle
55
56
  };
56
57
  };
@@ -187,6 +187,27 @@ const RowSettings = [
187
187
  }
188
188
  ]
189
189
  },
190
+ {
191
+ id: 'height',
192
+ type: 'option:value',
193
+ devices: {
194
+ desktop: {
195
+ default: 'auto'
196
+ }
197
+ },
198
+ options: [
199
+ {
200
+ label: 'Full',
201
+ value: '100%',
202
+ tooltip: 'Stretch to fill <br> vertical space'
203
+ },
204
+ {
205
+ label: 'Fit',
206
+ value: 'auto',
207
+ tooltip: 'Adjust size <br> based on content'
208
+ }
209
+ ]
210
+ },
190
211
  {
191
212
  id: 'verticalGutter',
192
213
  type: 'input:slider',
@@ -108,8 +108,15 @@ const SettingUIV2 = [
108
108
  en: 'Width',
109
109
  es: 'Ancho',
110
110
  cn: '宽度'
111
+ }
112
+ },
113
+ {
114
+ setting: {
115
+ id: 'height'
111
116
  },
112
- layout: 'horizontal'
117
+ label: {
118
+ en: 'Height'
119
+ }
113
120
  },
114
121
  {
115
122
  label: {
@@ -260,7 +267,6 @@ const SettingUIV2 = [
260
267
  label: {
261
268
  en: 'Align column'
262
269
  },
263
- conditionDisplay: `pageType != "POST_PURCHASE" && (layout.display !== 'fill' || (!!layout.cols && layout.cols.length > 1))`,
264
270
  controls: [
265
271
  {
266
272
  id: 'verticalAlign',
@@ -270,7 +276,7 @@ const SettingUIV2 = [
270
276
  setting: {
271
277
  id: 'verticalAlign'
272
278
  },
273
- conditionDisplay: '!!layout.cols && layout.cols.length > 1'
279
+ conditionDisplay: `((!!layout.cols && layout.cols.length > 1) || (!!layout.cols && layout.cols.length == 1 && height == '100%')) && pageType != "POST_PURCHASE"`
274
280
  },
275
281
  {
276
282
  id: 'horizontalAlign',
@@ -280,7 +286,7 @@ const SettingUIV2 = [
280
286
  setting: {
281
287
  id: 'horizontalAlign'
282
288
  },
283
- conditionDisplay: `layout.display !== 'fill'`,
289
+ conditionDisplay: `layout.display !== 'fill' && pageType != "POST_PURCHASE"`,
284
290
  options: {
285
291
  disableMessage: `Horizontal Align is available when layout is "Fit to content"`
286
292
  }
@@ -66,6 +66,10 @@ const getStaticLocale = (tag, key)=>{
66
66
  const getSettingPreloadData = (disabledValue, enabledValue)=>{
67
67
  return `{% if section.settings.section_preload == "false" %}${disabledValue} ${enabledValue ? `{% else %}${enabledValue}` : ''}{% endif %}`;
68
68
  };
69
+ const getHttpUrl = (link)=>{
70
+ if (!link) return '';
71
+ return link.match(/^https?:\/\//i) ? link : `http://${link}`;
72
+ };
69
73
  const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
70
74
  const URL_START_WITH = [
71
75
  '#',
@@ -78,7 +82,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
78
82
  const isHyperlink = setting?.link !== undefined && setting.link !== '';
79
83
  let urlHref = setting?.link ?? '';
80
84
  const isHomePageHref = urlHref === '/';
81
- const regexHttp = new RegExp(/^https?:\/\//i);
85
+ const regexHttp = new RegExp(/^(?:https?:\/\/)?[\w.-]+\.[a-z]{2,}/i);
82
86
  const regexPageType = new RegExp(/^\/?(?:collections|pages|products|blogs|checkout|cart)\/?/i);
83
87
  const isShopifyDomain = isHyperlink && !regexHttp.test(urlHref) && regexPageType.test(urlHref);
84
88
  const isDomain = isHyperlink && regexHttp.test(urlHref);
@@ -89,6 +93,7 @@ const getInsertLinkData = (defaultWrap, setting, htmlType)=>{
89
93
  urlHref = "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
90
94
  }
91
95
  }
96
+ if (isDomain) urlHref = getHttpUrl(urlHref);
92
97
  const isLink = ()=>{
93
98
  if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
94
99
  if (URL_INCLUDES.find((el)=>urlHref.includes(el))) return true;
@@ -214,10 +219,34 @@ const convertUnitToNumber = (value, defaultValue)=>{
214
219
  const data = typeof value === 'string' ? value.replaceAll('px', '').replaceAll('%', '').replaceAll('rem', '').replaceAll('em', '') : defaultValue;
215
220
  return !isNaN(Number(data)) ? Number(data) : defaultValue;
216
221
  };
222
+ const getAllHrefFromString = (htmlString)=>{
223
+ if (!htmlString) return [];
224
+ const regex = /href="([^"]*)"/g;
225
+ const hrefs = [];
226
+ let match;
227
+ while((match = regex.exec(htmlString)) !== null){
228
+ match[1] && hrefs.push(match[1]);
229
+ }
230
+ return hrefs;
231
+ };
232
+ const replaceAllHrefFromString = (htmlString, hrefs)=>{
233
+ if (!htmlString) return '';
234
+ const regex = /href="([^"]*)"/g;
235
+ let match;
236
+ let i = 0;
237
+ while((match = regex.exec(htmlString)) !== null){
238
+ if (match[1]) {
239
+ htmlString = htmlString.replace(match[1], hrefs[i] ?? '');
240
+ i++;
241
+ }
242
+ }
243
+ return htmlString;
244
+ };
217
245
 
218
246
  exports.convertUnitToNumber = convertUnitToNumber;
219
247
  exports.filterTruthyObject = filterTruthyObject;
220
248
  exports.filterTruthyStyles = filterTruthyStyles;
249
+ exports.getAllHrefFromString = getAllHrefFromString;
221
250
  exports.getDisplayStyle = getDisplayStyle;
222
251
  exports.getDynamicSourceLocales = getDynamicSourceLocales;
223
252
  exports.getInsertLinkData = getInsertLinkData;
@@ -229,5 +258,6 @@ exports.isHexTransparent = isHexTransparent;
229
258
  exports.isLinkedToSalesPage = isLinkedToSalesPage;
230
259
  exports.isTransparentColor = isTransparentColor;
231
260
  exports.isTransparentRGBA = isTransparentRGBA;
261
+ exports.replaceAllHrefFromString = replaceAllHrefFromString;
232
262
  exports.replaceLinkData = replaceLinkData;
233
263
  exports.youtubeShortsRegex = youtubeShortsRegex;
@@ -58,6 +58,7 @@ const IconListV2 = (props)=>{
58
58
  setting
59
59
  });
60
60
  return core.template`
61
+ {% assign locationOrigin = request.origin | append: routes.root_url | split: '/' | join: '/' %}
61
62
  <gp-icon-list
62
63
  ${{
63
64
  ...attr
@@ -28,7 +28,7 @@ const Image = ({ style, styles: styles$1, setting, children, advanced, className
28
28
  const containerStyles = system.createStyle(styles.getContainerStyles(style, styles$1));
29
29
  const wrapperClasses = system.createClass(classes.getWrapperClasses());
30
30
  const imageClasses = system.createClass(classes.getImageClasses(className, styles$1));
31
- const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass));
31
+ const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass, styles$1?.shape));
32
32
  const containerAttrs = system.createAttr(attributes.getContainerAttrs(builderAttrs, builderProps?.uid));
33
33
  const linkWrapperAttrs = attributes.getLinkWrapperAttrs({
34
34
  urlData,
@@ -25,7 +25,7 @@ const Image = ({ style, styles: styles$1, setting, advanced, className, pageCont
25
25
  const containerStyles = system.createStyle(styles.getContainerStyles(style, styles$1));
26
26
  const wrapperClasses = system.createClass(classes.getWrapperClasses());
27
27
  const imageClasses = system.createClass(classes.getImageClasses(className, styles$1));
28
- const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass));
28
+ const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass, styles$1?.shape));
29
29
  const containerAttrs = system.createAttr(attributes.getContainerAttrs(builderAttrs, builderProps?.uid));
30
30
  const linkWrapperAttrs = attributes.getLinkWrapperAttrs({
31
31
  urlData,
@@ -2,10 +2,12 @@
2
2
 
3
3
  var core = require('@gem-sdk/core');
4
4
 
5
- const getContainerClasses = (uid, cssClass)=>{
5
+ const getContainerClasses = (uid, cssClass, shape)=>{
6
+ const imageFlexGrowClass = core.getFlexGrowClassByShapeGlobalSize(shape);
6
7
  return {
7
8
  'gp-group/image gp-relative': true,
8
9
  [`force-publish-${new Date().getTime()}`]: true,
10
+ ...imageFlexGrowClass,
9
11
  ...uid && {
10
12
  [uid]: true
11
13
  },
@@ -30,7 +30,8 @@ const getSrcSetLiquid = (liquid, storage)=>{
30
30
  return `{{ '${liquid}' | asset_img_url: '768x' }} 768w, {{ '${liquid}' | asset_img_url: '1024x' }} 1024w, {{ '${liquid}' | asset_img_url: 'master' }} 1440w`;
31
31
  };
32
32
  const getSrcSetLink = (link)=>{
33
- return `${link} 768w,${link} 1024w,${link} 1440w`;
33
+ return link;
34
+ // return `${link} 768w,${link} 1024w,${link} 1440w`; // Since image src didn't change in size so this line of code is pointless
34
35
  };
35
36
  const getImageSrc = (image, currentDevice, isNotLiquid)=>{
36
37
  if (image?.metafieldDefinitionKey) {
@@ -200,6 +200,15 @@ const ImageSettings = [
200
200
  displayOptions: [
201
201
  'full'
202
202
  ]
203
+ },
204
+ height: {
205
+ displayOptions: [
206
+ 'full'
207
+ ],
208
+ units: [
209
+ 'px',
210
+ '%'
211
+ ]
203
212
  }
204
213
  },
205
214
  hiddenSettings: [
package/dist/cjs/index.js CHANGED
@@ -390,6 +390,7 @@ exports.ELEMENT_Z_INDEX = _const.ELEMENT_Z_INDEX;
390
390
  exports.convertUnitToNumber = helpers.convertUnitToNumber;
391
391
  exports.filterTruthyObject = helpers.filterTruthyObject;
392
392
  exports.filterTruthyStyles = helpers.filterTruthyStyles;
393
+ exports.getAllHrefFromString = helpers.getAllHrefFromString;
393
394
  exports.getDisplayStyle = helpers.getDisplayStyle;
394
395
  exports.getDynamicSourceLocales = helpers.getDynamicSourceLocales;
395
396
  exports.getInsertLinkData = helpers.getInsertLinkData;
@@ -401,6 +402,7 @@ exports.isHexTransparent = helpers.isHexTransparent;
401
402
  exports.isLinkedToSalesPage = helpers.isLinkedToSalesPage;
402
403
  exports.isTransparentColor = helpers.isTransparentColor;
403
404
  exports.isTransparentRGBA = helpers.isTransparentRGBA;
405
+ exports.replaceAllHrefFromString = helpers.replaceAllHrefFromString;
404
406
  exports.replaceLinkData = helpers.replaceLinkData;
405
407
  exports.youtubeShortsRegex = helpers.youtubeShortsRegex;
406
408
  exports.Accordion = Accordion.default;
@@ -15,8 +15,12 @@ const getProductOfferWrapperClasses = ()=>{
15
15
  const getProductOfferItemClasses = (index, setting, totalProduct)=>{
16
16
  const { productOfferLayout } = setting ?? {};
17
17
  let className = '';
18
- constants.DEVICES.map((device)=>{
18
+ constants.DEVICES.forEach((device)=>{
19
19
  const key = device === 'desktop' ? '' : `${device}:`;
20
+ if (device === 'mobile') {
21
+ className += ` mobile:gp-col-span-2`;
22
+ return;
23
+ }
20
24
  if (productOfferLayout?.[device] === '1col' && index % 3 === 0 || (totalProduct || 0) <= 1) {
21
25
  className += ` ${key}gp-col-span-2`;
22
26
  }
@@ -61,11 +61,11 @@ const getSvgActiveStyles = (styles)=>{
61
61
  })
62
62
  };
63
63
  };
64
- const getSvgStyles = (settings, styles)=>{
64
+ const getSvgStyles = (styles)=>{
65
65
  return {
66
66
  ...core.getGlobalColorStateStyle('c', {
67
67
  ...styles?.iconColor,
68
- normal: settings?.iconItemColor ? settings?.iconItemColor : styles?.iconColor?.normal
68
+ normal: styles?.iconColor?.normal
69
69
  })
70
70
  };
71
71
  };
@@ -15,7 +15,7 @@ const ProductBundleDiscountChildrenItem = (props)=>{
15
15
  const composeLayoutClasses = system.createClass(classes.getLayoutClasses(setting));
16
16
  const composeIconStyles = system.createStyle(styles.getIconStyles(setting));
17
17
  const composeSvgActiveStyles = system.createStyle(styles.getSvgActiveStyles(styles$1));
18
- const composeSvgStyles = system.createStyle(styles.getSvgStyles(setting, styles$1));
18
+ const composeSvgStyles = system.createStyle(styles.getSvgStyles(styles$1));
19
19
  const composeIconSectionClasses = system.createClass(classes.getIconSectionClasses);
20
20
  const composeItemClasses = system.createClass(classes.getItemClasses);
21
21
  const composeFlexChildren = system.createClass(styles.getFlexChildren);
@@ -13,7 +13,7 @@ const ProductBundleDiscountChildrenItemLiquid = (props)=>{
13
13
  const composeLayoutClasses = system.createClass(classes.getLayoutClasses(setting));
14
14
  const composeIconStyles = system.createStyle(styles.getIconStyles(setting));
15
15
  const composeSvgActiveStyles = system.createStyle(styles.getSvgActiveStyles(styles$1));
16
- const composeSvgStyles = system.createStyle(styles.getSvgStyles(setting, styles$1));
16
+ const composeSvgStyles = system.createStyle(styles.getSvgStyles(styles$1));
17
17
  const composeIconSectionClasses = system.createClass(classes.getIconSectionClasses);
18
18
  const composeItemClasses = system.createClass(classes.getItemClasses);
19
19
  const composeFlexChildren = system.createClass(styles.getFlexChildren);
@@ -434,10 +434,7 @@ const config = {
434
434
  childItem: [],
435
435
  layout: 'vertical-layout'
436
436
  },
437
- childrens: [],
438
- advanced: {
439
- of: 'hidden'
440
- }
437
+ childrens: []
441
438
  }
442
439
  ]
443
440
  },
@@ -467,10 +464,7 @@ const config = {
467
464
  layout: 'horizontal-layout',
468
465
  enableIcon: false
469
466
  },
470
- childrens: [],
471
- advanced: {
472
- of: 'hidden'
473
- }
467
+ childrens: []
474
468
  }
475
469
  ]
476
470
  }
@@ -335,7 +335,7 @@ const getPaddingBottomByShapeSetting = (shapeSetting)=>{
335
335
  };
336
336
  return;
337
337
  }
338
- const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
338
+ const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device]?.split('/').reverse().join('') : '{%if media.height%} {{media.height}} / {{media.width}} {%else%} 100 / 100 {%endif%}';
339
339
  result = {
340
340
  ...result,
341
341
  [device]: `calc((${value})*100%)`
@@ -93,8 +93,12 @@ const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage
93
93
  const renderFeaturedImageOnly = (className, hasHoverEffect)=>{
94
94
  return core.template`
95
95
  {% assign src = featureMedia.src %}
96
- ${system.If(hasHoverEffect && setting.hoverEffect == 'other', `{% assign otherImage = product.media[${setting.otherImage}] %}
97
- {% assign src = otherImage.src %}
96
+ ${system.If(hasHoverEffect && setting.hoverEffect == 'other', `{% assign media_length = product.media | size %}
97
+ {% assign other_image_index = ${setting.otherImage} | plus: 0 %}
98
+ {% if other_image_index >= media_length %}
99
+ {% assign other_image_index = media_length | minus: 1 %}
100
+ {% endif %}
101
+ {% assign otherImage = product.media[other_image_index] %}
98
102
  ${system.LiquidIf(`otherImage.media_type != 'image'`, `{% assign src = otherImage.preview_image.src %}`)}
99
103
  `)}
100
104
  ${NextImage_liquid.default({
@@ -36,6 +36,7 @@ const ProductList = (props)=>{
36
36
  endif
37
37
  assign arrayRelatedExclude = relatedExclude | split: ","
38
38
  assign idSelectedList = ''
39
+ assign relatedListProduct = null
39
40
  for collection in collections
40
41
  assign collectionId = collection.id
41
42
  assign isInCollection = false
@@ -50,20 +51,15 @@ const ProductList = (props)=>{
50
51
  break
51
52
  else
52
53
  assign idSelectedList = idSelectedList | append: "," | append: product.id
54
+ assign productSelected = product | sort
55
+ assign relatedListProduct = relatedListProduct | concat: productSelected
53
56
  endif
54
57
  endfor
55
58
  endif
56
59
  endunless
57
60
  endfor
58
61
  endfor
59
- for item in allProductsPaginated
60
- assign handle = item.handle
61
- assign productF = item | sort
62
- if idSelectedList contains item.id
63
- assign products = products | concat: productF
64
- endif
65
- endfor
66
- assign products = products | uniq
62
+ assign products = relatedListProduct | uniq
67
63
  when 'vendor'
68
64
  assign vendorAssignProduct = assignProduct.vendor
69
65
  assign productFilter = allProductsPaginated | where: 'vendor', vendorAssignProduct
@@ -22,11 +22,16 @@ const DEVICES = [
22
22
  'tablet',
23
23
  'mobile'
24
24
  ];
25
+ const DEFAULT_ADVANCED_DISPLAY_SETTING = {
26
+ desktop: true,
27
+ tablet: true,
28
+ mobile: true
29
+ };
25
30
  const ProductVariants = (props)=>{
26
31
  const { builderProps, styles: styles$1, setting, advanced } = props;
27
32
  const { align, swatchItemWidth, dropdownItemWidth, swatchSpacing, optionTypo } = styles$1 ?? {};
28
33
  const { label, optionType, showAsSwatches, layout, hasPreSelected } = setting ?? {};
29
- const advancedDisplay = advanced?.d;
34
+ const advancedDisplay = advanced?.d ?? DEFAULT_ADVANCED_DISPLAY_SETTING;
30
35
  const { uid } = builderProps ?? {};
31
36
  const variantGroup = optionType === 'groupOption';
32
37
  const getSwatchAutoWidth = ()=>{
@@ -243,7 +248,7 @@ const ProductVariants = (props)=>{
243
248
  productId: `{{ product.id | json | escape }}`,
244
249
  productUrl: `{{ product.url | json | escape }}`,
245
250
  productHandle: `{{ product.handle | json | escape }}`,
246
- displayState: advancedDisplay,
251
+ displayState: `${JSON.stringify(advancedDisplay)}`,
247
252
  totalVariantCombinations: `{{ total_combinations }}`,
248
253
  firstAvailableVariant: `{{ product.selected_or_first_available_variant | json | escape }}`
249
254
  });
@@ -283,7 +288,7 @@ const ProductVariants = (props)=>{
283
288
  '>
284
289
  ${system.Liquid(`{%- assign options = product.options_with_values -%}`)}
285
290
  ${system.Liquid(`{%- assign variants = product.variants -%}`)}
286
- ${system.LiquidIf(`options.size == 0 or options.size == 1 and options[0].name == 'Title' and options[0].values.size == 1 and options[0].values[0] == 'Default Title'`, `<div></div>`, core.template`<div
291
+ ${system.LiquidIf(`options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'`, `<div></div>`, core.template`<div
287
292
  class="${pVariantClass}"
288
293
  style="${pVariantStyle}"
289
294
  >
@@ -14,7 +14,7 @@ const horizontalThree = [
14
14
  tablet: true
15
15
  },
16
16
  editorData: {
17
- css: '.{{rootClassName}} > div > div,.g5t77h4sjA gp-product-badge > div > div{\nwidth:100% !important;\n}',
17
+ css: '.{{rootClassName}} > div > div{\nwidth:100%;\n}',
18
18
  rootClassName: '{{rootClassName}}'
19
19
  },
20
20
  hasBoxShadow: {
@@ -29,7 +29,7 @@ const horizontalThree = [
29
29
  desktop: '100%'
30
30
  },
31
31
  pos: {
32
- desktop: 'absolute'
32
+ desktop: 'static'
33
33
  },
34
34
  right: {
35
35
  desktop: '0px'
@@ -52,9 +52,6 @@ const horizontalThree = [
52
52
  }
53
53
  }
54
54
  },
55
- top: {
56
- desktop: '-44px'
57
- },
58
55
  z: {
59
56
  desktop: 1
60
57
  }
@@ -154,7 +151,8 @@ const horizontalThree = [
154
151
  }
155
152
  },
156
153
  tag: 'ProductBadge',
157
- uid: 'gaWpBvn_TG'
154
+ uid: 'gHRinlrdow',
155
+ childrens: []
158
156
  },
159
157
  {
160
158
  advanced: {
@@ -28,7 +28,7 @@ const horizontalTwo = [
28
28
  desktop: '100%'
29
29
  },
30
30
  pos: {
31
- desktop: 'absolute'
31
+ desktop: 'static'
32
32
  },
33
33
  right: {
34
34
  desktop: '0px'
@@ -51,9 +51,6 @@ const horizontalTwo = [
51
51
  }
52
52
  }
53
53
  },
54
- top: {
55
- desktop: '-44px'
56
- },
57
54
  z: {
58
55
  desktop: 1
59
56
  }
@@ -153,7 +150,8 @@ const horizontalTwo = [
153
150
  }
154
151
  },
155
152
  tag: 'ProductBadge',
156
- uid: 'gPMEqW9TKV'
153
+ uid: 'gHRinlrdow',
154
+ childrens: []
157
155
  },
158
156
  {
159
157
  advanced: {
@@ -291,7 +291,8 @@ const verticalThree = [
291
291
  }
292
292
  },
293
293
  tag: 'ProductBadge',
294
- uid: 'gPMEqW9TKV'
294
+ uid: 'gHRinlrdow',
295
+ childrens: []
295
296
  },
296
297
  {
297
298
  childrens: [