@gem-sdk/components 2.0.0-dev.699 → 2.0.0-dev.701

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 (108) hide show
  1. package/dist/cjs/banner/components/HeroBanner.js +2 -2
  2. package/dist/cjs/banner/components/HeroBanner.liquid.js +3 -2
  3. package/dist/cjs/banner/components/HeroBannerItem.js +3 -3
  4. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +3 -3
  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/AdaptiveImage.js +4 -4
  14. package/dist/cjs/image/components/Image.js +1 -1
  15. package/dist/cjs/image/components/Image.liquid.js +3 -2
  16. package/dist/cjs/image/components/common/classes.js +3 -1
  17. package/dist/cjs/image/helpers/getSrcSet.js +2 -1
  18. package/dist/cjs/image/setting/configs/settings.js +9 -0
  19. package/dist/cjs/index.js +2 -0
  20. package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +5 -1
  21. package/dist/cjs/product/components/ProductBundle/common/styles.js +2 -2
  22. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +1 -1
  23. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +1 -1
  24. package/dist/cjs/product/components/ProductBundle/setting/ProductBundleDiscount.js +2 -8
  25. package/dist/cjs/product/components/ProductImagesV2/common/common.js +1 -1
  26. package/dist/cjs/product/components/ProductImagesV2/index.liquid.js +6 -3
  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/stock-counter/components/common/getContent.js +1 -1
  33. package/dist/cjs/text/components/Text.liquid.js +1 -0
  34. package/dist/cjs/text/components/common/getDisplayText.js +11 -20
  35. package/dist/cjs/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
  36. package/dist/cjs/third-party/components/ProductOptionsVariantOption.js +2 -2
  37. package/dist/cjs/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
  38. package/dist/cjs/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
  39. package/dist/cjs/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  40. package/dist/cjs/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
  41. package/dist/cjs/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
  42. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
  43. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
  44. package/dist/cjs/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
  45. package/dist/cjs/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
  46. package/dist/cjs/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
  47. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
  48. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
  49. package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
  50. package/dist/cjs/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
  51. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
  52. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
  53. package/dist/cjs/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
  54. package/dist/esm/banner/components/HeroBanner.js +2 -2
  55. package/dist/esm/banner/components/HeroBanner.liquid.js +3 -2
  56. package/dist/esm/banner/components/HeroBannerItem.js +3 -3
  57. package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -3
  58. package/dist/esm/button/components/Button.js +4 -1
  59. package/dist/esm/carousel/carousel-item/common/getClass.js +1 -1
  60. package/dist/esm/grid/row/commons/getClass.js +1 -1
  61. package/dist/esm/grid/row/commons/getStyle.js +2 -1
  62. package/dist/esm/grid/row/setting/configs/settings.js +21 -0
  63. package/dist/esm/grid/row/setting/configs/uiV2.js +10 -4
  64. package/dist/esm/helpers.js +30 -2
  65. package/dist/esm/icon-list-v2/components/IconList.liquid.js +1 -0
  66. package/dist/esm/image/components/AdaptiveImage.js +4 -4
  67. package/dist/esm/image/components/Image.js +1 -1
  68. package/dist/esm/image/components/Image.liquid.js +3 -2
  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/index.liquid.js +6 -3
  80. package/dist/esm/product/components/ProductVariants/index.liquid.js +8 -3
  81. package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +4 -6
  82. package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +3 -5
  83. package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +2 -1
  84. package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +2 -1
  85. package/dist/esm/stock-counter/components/common/getContent.js +1 -1
  86. package/dist/esm/text/components/Text.liquid.js +1 -0
  87. package/dist/esm/text/components/common/getDisplayText.js +12 -21
  88. package/dist/esm/third-party/components/EcomsendBackInStockAlert.liquid.js +8 -8
  89. package/dist/esm/third-party/components/ProductOptionsVariantOption.js +2 -2
  90. package/dist/esm/third-party/components/ProductOptionsVariantOption.liquid.js +2 -2
  91. package/dist/esm/third-party/components/UnlimitedBundlesDiscounts.liquid.js +1 -1
  92. package/dist/esm/third-party/configs/EcoboostifyShoppableReelUgc.js +1 -1
  93. package/dist/esm/third-party/configs/NotifyBackInStockPreOrder.js +1 -1
  94. package/dist/esm/third-party/setting/EcoboostifyShoppableReelUgc/index.js +2 -2
  95. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/index.js +5 -0
  96. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV1.js +14 -0
  97. package/dist/esm/third-party/setting/EcomsendBackInStockAlert/uiV2.js +31 -0
  98. package/dist/esm/third-party/setting/FlyBundlesUpsellsFbt/uiV1.js +5 -0
  99. package/dist/esm/third-party/setting/NotifyBackInStockPreOrder/index.js +2 -2
  100. package/dist/esm/third-party/setting/ProductOptionsVariantOption/index.js +1 -7
  101. package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV1.js +0 -9
  102. package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -30
  103. package/dist/esm/third-party/setting/RequestQuoteHidePrice/index.js +2 -1
  104. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/index.js +5 -1
  105. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV1.js +9 -0
  106. package/dist/esm/third-party/setting/UnlimitedBundlesDiscounts/uiV2.js +12 -0
  107. package/dist/types/index.d.ts +8 -3
  108. package/package.json +2 -2
@@ -14,7 +14,7 @@ var useHeroBanner = require('./hooks/useHeroBanner.js');
14
14
  var common = require('./common/common.js');
15
15
 
16
16
  const HeroBanner = (props)=>{
17
- const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
17
+ const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyLoadImage = true } = props;
18
18
  const mode = core.useEditorMode();
19
19
  const { enableLink } = setting ?? {};
20
20
  const link = common.getBannerLink(setting);
@@ -50,7 +50,7 @@ const HeroBanner = (props)=>{
50
50
  children: children,
51
51
  rawChildren: props.rawChildren,
52
52
  builderProps: builderProps,
53
- enableLazyloadImage: enableLazyloadImage,
53
+ enableLazyLoadImage: enableLazyLoadImage,
54
54
  elementRef: elementRef,
55
55
  transform: transform,
56
56
  dataVideo: dataVideo,
@@ -12,7 +12,8 @@ var helpers = require('../../helpers.js');
12
12
  var common = require('./common/common.js');
13
13
 
14
14
  const HeroBanner = (props)=>{
15
- const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
15
+ const { builderAttrs, builderProps, setting, styles, style, children, advanced, pageContext } = props;
16
+ const { enableLazyLoadImage } = pageContext ?? {};
16
17
  const { enableLink } = setting ?? {};
17
18
  const link = common.getBannerLink(setting);
18
19
  const { cssClass } = advanced ?? {};
@@ -57,7 +58,7 @@ const HeroBanner = (props)=>{
57
58
  setting,
58
59
  styles,
59
60
  children,
60
- enableLazyloadImage,
61
+ enableLazyLoadImage,
61
62
  rawChildren: props.rawChildren,
62
63
  builderProps
63
64
  });
@@ -18,10 +18,10 @@ var common$1 = require('../../video/helpers/common.js');
18
18
 
19
19
  const HeroBannerItem = (props)=>{
20
20
  const mode = core.useEditorMode();
21
- const { enableLazyloadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
21
+ const { enableLazyLoadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
22
22
  const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
23
23
  const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
24
- const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage && mode !== 'edit' && mode !== 'preview-post-purchase';
24
+ const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyLoadImage && mode !== 'edit' && mode !== 'preview-post-purchase';
25
25
  const isNotLiquid = true;
26
26
  const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
27
27
  const containerStyle = system.createStyle({
@@ -184,7 +184,7 @@ const HeroBannerItem = (props)=>{
184
184
  style: adaptiveStyle,
185
185
  alt: alt,
186
186
  title: title,
187
- enableLazyloadImage: enableLazyImage,
187
+ enableLazyLoadImage: enableLazyImage,
188
188
  fallbackImg: common.fallbackImg
189
189
  })
190
190
  ]
@@ -17,11 +17,11 @@ var common$2 = require('../../video/helpers/common.js');
17
17
  var common$1 = require('../../grid/row/commons/common.js');
18
18
 
19
19
  const HeroBannerItem = (props)=>{
20
- const { enableLazyloadImage, setting, styles, children, builderProps, rawChildren } = props;
20
+ const { enableLazyLoadImage, setting, styles, children, builderProps, rawChildren } = props;
21
21
  const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
22
22
  const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
23
23
  const transform = '';
24
- const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage;
24
+ const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyLoadImage;
25
25
  const isNotLiquid = false;
26
26
  const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
27
27
  const dataVideo = common.getResponsiveSetting(background || {}).desktop;
@@ -91,7 +91,7 @@ const HeroBannerItem = (props)=>{
91
91
  alt: `lazy image ${device}`,
92
92
  className: lazyBackgroundClasses(device),
93
93
  isDisableAspectStyle: true,
94
- enableLazyLoadImage: enableLazyloadImage
94
+ enableLazyLoadImage
95
95
  }));
96
96
  }).join('');
97
97
  };
@@ -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
@@ -11,7 +11,7 @@ var data = require('./common/data.js');
11
11
  var styles = require('./common/styles.js');
12
12
 
13
13
  const AdaptiveImage = (props)=>{
14
- const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass, enableLazyloadImage, ...restProps } = props;
14
+ const { alt, style, srcSet, layout, priority, className, aspectRatio, borderRadius, pictureClass, enableLazyLoadImage, ...restProps } = props;
15
15
  const { getDeviceSource } = data.getAdaptiveImageData(props);
16
16
  const { srcTablet, srcMobile } = getDeviceSource();
17
17
  const loadingAttrs = system.createAttr({
@@ -32,7 +32,7 @@ const AdaptiveImage = (props)=>{
32
32
  const adaptiveImageClasses = system.createClass({
33
33
  ...classes.getAdaptiveImageClasses({
34
34
  className,
35
- hasLazyLoad: enableLazyloadImage
35
+ hasLazyLoad: enableLazyLoadImage
36
36
  })
37
37
  });
38
38
  const renderSource = ()=>{
@@ -40,11 +40,11 @@ const AdaptiveImage = (props)=>{
40
40
  children: [
41
41
  srcMobile && /*#__PURE__*/ jsxRuntime.jsx("source", {
42
42
  media: "(max-width: 767px)",
43
- srcSet: enableLazyloadImage ? constants.IMAGE_PLACEHOLDER : srcMobile
43
+ srcSet: enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcMobile
44
44
  }),
45
45
  srcTablet && /*#__PURE__*/ jsxRuntime.jsx("source", {
46
46
  media: "(max-width: 1024px)",
47
- srcSet: enableLazyloadImage ? constants.IMAGE_PLACEHOLDER : srcTablet
47
+ srcSet: enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcTablet
48
48
  })
49
49
  ]
50
50
  });
@@ -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,
@@ -11,8 +11,9 @@ var styles = require('./common/styles.js');
11
11
  var classes = require('./common/classes.js');
12
12
  var attributes = require('./common/attributes.js');
13
13
 
14
- const Image = ({ style, styles: styles$1, setting, advanced, className, pageContext, builderAttrs, builderProps, enableLazyLoadImage = true })=>{
14
+ const Image = ({ style, styles: styles$1, setting, advanced, className, pageContext, builderAttrs, builderProps })=>{
15
15
  const { imageLink, isAdaptive, enableImageLink } = setting ?? {};
16
+ const { enableLazyLoadImage } = pageContext ?? {};
16
17
  const { Wrapper: HTMLTag, urlData } = helpers.getLinkData({
17
18
  defaultWrap: 'div',
18
19
  setting: imageLink,
@@ -24,7 +25,7 @@ const Image = ({ style, styles: styles$1, setting, advanced, className, pageCont
24
25
  const containerStyles = system.createStyle(styles.getContainerStyles(style, styles$1));
25
26
  const wrapperClasses = system.createClass(classes.getWrapperClasses());
26
27
  const imageClasses = system.createClass(classes.getImageClasses(className, styles$1));
27
- const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass));
28
+ const containerClasses = system.createClass(classes.getContainerClasses(builderProps?.uid, advanced?.cssClass, styles$1?.shape));
28
29
  const containerAttrs = system.createAttr(attributes.getContainerAttrs(builderAttrs, builderProps?.uid));
29
30
  const linkWrapperAttrs = attributes.getLinkWrapperAttrs({
30
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%)`
@@ -18,7 +18,8 @@ var _function = require('../../helpers/function.js');
18
18
  const ProductImages = (props)=>{
19
19
  const productImageProps = common.setDefaultWhenUndefineSetting(props);
20
20
  const { setting, styles, builderProps, style } = productImageProps;
21
- const { rawChildren, pageContext, enableLazyLoadImage } = props;
21
+ const { rawChildren, pageContext } = props;
22
+ const { enableLazyLoadImage } = pageContext ?? {};
22
23
  const settings = {
23
24
  ...setting,
24
25
  ...styles
@@ -97,7 +98,8 @@ const ProductImages = (props)=>{
97
98
  >
98
99
  ${GalleryCarousel_liquid.default({
99
100
  builderPropUID: `gp-gallery-${builderProps?.uid}`,
100
- ...settings
101
+ ...settings,
102
+ enableLazyLoadImage
101
103
  })}
102
104
  </div>
103
105
  ${GalleryGrid_liquid.default({
@@ -106,7 +108,8 @@ const ProductImages = (props)=>{
106
108
  ...styleInsideLayout
107
109
  },
108
110
  children: renderProductBadge(),
109
- ...settings
111
+ ...settings,
112
+ enableLazyLoadImage
110
113
  })}
111
114
  `;
112
115
  };
@@ -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: [