@gem-sdk/components 2.1.27-staging.5 → 2.1.28

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 (64) hide show
  1. package/dist/cjs/article/components/ArticleImage.js +1 -2
  2. package/dist/cjs/banner/components/hero-banner/index.liquid.js +7 -4
  3. package/dist/cjs/carousel/components/Carousel.liquid.js +2 -3
  4. package/dist/cjs/common/const.js +1 -1
  5. package/dist/cjs/helpers.js +4 -26
  6. package/dist/cjs/image/components/AdaptiveImage.liquid.js +5 -6
  7. package/dist/cjs/image/components/Image.js +2 -22
  8. package/dist/cjs/image/components/Image.liquid.js +4 -6
  9. package/dist/cjs/image/components/NextImage.liquid.js +3 -4
  10. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +3 -7
  11. package/dist/cjs/index.js +0 -2
  12. package/dist/cjs/product/components/Product.liquid.js +2 -3
  13. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
  14. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
  15. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  16. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  17. package/dist/cjs/product/components/ProductVariants/index.liquid.js +18 -11
  18. package/dist/cjs/product/components/ProductVariants/variants/Base.liquid.js +0 -1
  19. package/dist/cjs/product/components/ProductVariants/variants/Dropdown.liquid.js +12 -26
  20. package/dist/cjs/product/components/ProductVariants/variants/DropdownGroup.liquid.js +37 -4
  21. package/dist/cjs/tab/hooks/useTabInteraction.js +9 -13
  22. package/dist/cjs/text/components/Text.js +2 -2
  23. package/dist/cjs/text/components/Text.liquid.js +2 -2
  24. package/dist/cjs/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  25. package/dist/cjs/third-party/setting/RechargeSubscriptions.js +2 -5
  26. package/dist/cjs/video/components/HTML5Embed.js +2 -2
  27. package/dist/cjs/video/components/HTML5Embed.liquid.js +3 -6
  28. package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  29. package/dist/esm/article/components/ArticleImage.js +1 -2
  30. package/dist/esm/banner/components/hero-banner/index.liquid.js +7 -4
  31. package/dist/esm/carousel/components/Carousel.liquid.js +2 -3
  32. package/dist/esm/common/const.js +1 -1
  33. package/dist/esm/helpers.js +5 -25
  34. package/dist/esm/image/components/AdaptiveImage.liquid.js +5 -6
  35. package/dist/esm/image/components/Image.js +3 -23
  36. package/dist/esm/image/components/Image.liquid.js +4 -6
  37. package/dist/esm/image/components/NextImage.liquid.js +3 -4
  38. package/dist/esm/image-comparison/components/CompareImage.liquid.js +3 -7
  39. package/dist/esm/index.js +1 -1
  40. package/dist/esm/product/components/Product.liquid.js +2 -3
  41. package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
  42. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
  43. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  44. package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  45. package/dist/esm/product/components/ProductVariants/index.liquid.js +19 -12
  46. package/dist/esm/product/components/ProductVariants/variants/Base.liquid.js +0 -1
  47. package/dist/esm/product/components/ProductVariants/variants/Dropdown.liquid.js +12 -26
  48. package/dist/esm/product/components/ProductVariants/variants/DropdownGroup.liquid.js +37 -4
  49. package/dist/esm/tab/hooks/useTabInteraction.js +10 -14
  50. package/dist/esm/text/components/Text.js +2 -2
  51. package/dist/esm/text/components/Text.liquid.js +2 -2
  52. package/dist/esm/third-party/components/RechargeSubscriptions.liquid.js +1 -1
  53. package/dist/esm/third-party/setting/RechargeSubscriptions.js +2 -5
  54. package/dist/esm/video/components/HTML5Embed.js +2 -2
  55. package/dist/esm/video/components/HTML5Embed.liquid.js +3 -6
  56. package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  57. package/dist/types/index.d.ts +8 -27
  58. package/package.json +3 -3
  59. package/dist/cjs/image/components/NoDataImage.js +0 -133
  60. package/dist/cjs/product/components/ProductVariants/variants/combine/index.js +0 -47
  61. package/dist/cjs/text/components/common.js +0 -14
  62. package/dist/esm/image/components/NoDataImage.js +0 -129
  63. package/dist/esm/product/components/ProductVariants/variants/combine/index.js +0 -44
  64. package/dist/esm/text/components/common.js +0 -12
@@ -29,8 +29,7 @@ const ArticleImage = ({ className, setting = {}, styles = {}, advanced, builderP
29
29
  setting: {
30
30
  ...setting,
31
31
  alt: image.alt,
32
- image,
33
- disableNoDataState: true
32
+ image
34
33
  },
35
34
  styles: styles,
36
35
  advanced: advanced
@@ -14,7 +14,7 @@ var NextImage_liquid = require('../../../image/components/NextImage.liquid.js');
14
14
  var getSrcSet = require('../../../image/helpers/getSrcSet.js');
15
15
  var helpers$1 = require('../../../image/components/helpers.js');
16
16
 
17
- const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyLoadImage = true })=>{
17
+ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyloadImage = true })=>{
18
18
  const { link, layout, verticalAlign, order, alignBanner, alt, title } = setting ?? {};
19
19
  const { background, overlayEnable, overlayColor, overlayOpacity, verticalGutter, contentWidth, hoverEffect, hoverEffectDuration, hoverEffectScale, cornerBg, borderBg, hasActiveShadow, shadowBg, sizeSetting, contentPadding } = styles ?? {};
20
20
  const enableParallax = setting?.enableParallax || false;
@@ -43,6 +43,9 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
43
43
  } else if (data.videoType === 'html5') {
44
44
  delete data.video;
45
45
  }
46
+ if (data.type !== 'image') {
47
+ delete data.image;
48
+ }
46
49
  }
47
50
  return background;
48
51
  };
@@ -131,7 +134,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
131
134
  tablet: helpers$1.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
132
135
  mobile: helpers$1.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
133
136
  };
134
- const enableLazyLoad = !setting?.preload && enableLazyLoadImage;
137
+ const enableLazyLoad = !setting?.preload && enableLazyloadImage;
135
138
  const renderInnerHeroBanner = ()=>{
136
139
  return core.template /* liquid */ `
137
140
  <div
@@ -181,7 +184,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
181
184
  alt,
182
185
  title,
183
186
  imagePlaceholder,
184
- enableLazyLoadImage
187
+ enableLazyloadImage
185
188
  })}
186
189
  <div class="${core.cls('gp-absolute gp-w-full gp-h-full')}">
187
190
  <div
@@ -224,7 +227,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
224
227
  alt: `lazy image ${device}`,
225
228
  className: `gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg ${device === 'tablet' ? 'gp_lazybg_tl' : ''} ${device === 'mobile' ? 'gp_lazybg_mb' : ''}`,
226
229
  isDisableAspectStyle: true,
227
- enableLazyLoadImage
230
+ enableLazyloadImage
228
231
  }));
229
232
  }).join('') : ''}
230
233
  </div></div>
@@ -13,7 +13,7 @@ const DEVICES = [
13
13
  'tablet',
14
14
  'desktop'
15
15
  ];
16
- const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ftShapeProductImage, ...props })=>{
16
+ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ...props })=>{
17
17
  const setting = arrow.mappingNavigationCarousel(props.setting);
18
18
  const styleHeight = core.makeStyleResponsive('h', core.getHeightByShapeGlobalSize(styles?.sizeSetting));
19
19
  const styleWidth = core.makeStyleWithDefault('w', core.getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
@@ -112,8 +112,7 @@ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId
112
112
  setting,
113
113
  styles,
114
114
  moveToIdx,
115
- isHiddenArrowWhenDisabled,
116
- ftShapeProductImage
115
+ isHiddenArrowWhenDisabled
117
116
  }).replaceAll("'", '&#039;')}' style="${{
118
117
  ...core.makeStyleResponsive('jc', styles?.align),
119
118
  ...rootStyles
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const ELEMENT_Z_INDEX = {
4
- STICKY: 1000,
4
+ STICKY: 100000,
5
5
  DIALOG: 100001,
6
6
  CART_DRAWER: 100002,
7
7
  CART_DRAWER_CONFIRM_MODAL: 100003
@@ -34,7 +34,7 @@ const isHexTransparent = (hex)=>{
34
34
  return Boolean(a);
35
35
  };
36
36
  const youtubeShortsRegex = /^(?:https?:\/\/)?(?:www\.)?youtube\.com\/shorts\/([^"&?/\s]{11})$/i;
37
- const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceInventoryQuantity })=>{
37
+ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, isCapitalize, defaultVal = '', translate, isReplaceLocationOrigin, isReplaceInventoryQuantity })=>{
38
38
  const hasLiquidInValue = new RegExp(/\{\{.*?\}\}|\{%.*?%\}/).test(val?.toString() ?? '');
39
39
  const translateLimit = pageContext?.isTranslateWithLocale ? 1000 : 5000;
40
40
  if (!translate || !val?.toString().trim() || val.toString().length > translateLimit || hasLiquidInValue || pageContext?.isPreviewing) return val ?? defaultVal;
@@ -49,6 +49,9 @@ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, d
49
49
  if (isReplaceInventoryQuantity) {
50
50
  locale += ` | replace: '<$quantity$>', inventory_quantity | replace: '&lt;$quantity$&gt;', inventory_quantity`;
51
51
  }
52
+ if (isCapitalize) {
53
+ locale = `${locale} | downcase`;
54
+ }
52
55
  if (isLiquid) return locale;
53
56
  return `{{ ${locale} }}`;
54
57
  };
@@ -123,31 +126,7 @@ const replaceLinkData = (text, isTranslate)=>{
123
126
  }
124
127
  return text;
125
128
  };
126
- const getAllHrefFromString = (htmlString)=>{
127
- if (!htmlString) return [];
128
- const regex = /href="([^"]*)"/g;
129
- const hrefs = [];
130
- let match;
131
- while((match = regex.exec(htmlString)) !== null){
132
- match[1] && hrefs.push(match[1]);
133
- }
134
- return hrefs;
135
- };
136
- const replaceAllHrefFromString = (htmlString, hrefs)=>{
137
- if (!htmlString) return '';
138
- const regex = /href="([^"]*)"/g;
139
- let match;
140
- let i = 0;
141
- while((match = regex.exec(htmlString)) !== null){
142
- if (match[1]) {
143
- htmlString = htmlString.replace(match[1], hrefs[i] ?? '');
144
- i++;
145
- }
146
- }
147
- return htmlString;
148
- };
149
129
 
150
- exports.getAllHrefFromString = getAllHrefFromString;
151
130
  exports.getDynamicSourceLocales = getDynamicSourceLocales;
152
131
  exports.getInsertLinkData = getInsertLinkData;
153
132
  exports.getSettingPreloadData = getSettingPreloadData;
@@ -155,6 +134,5 @@ exports.getStaticLocale = getStaticLocale;
155
134
  exports.isHexTransparent = isHexTransparent;
156
135
  exports.isTransparentColor = isTransparentColor;
157
136
  exports.isTransparentRGBA = isTransparentRGBA;
158
- exports.replaceAllHrefFromString = replaceAllHrefFromString;
159
137
  exports.replaceLinkData = replaceLinkData;
160
138
  exports.youtubeShortsRegex = youtubeShortsRegex;
@@ -6,7 +6,7 @@ var core = require('@gem-sdk/core');
6
6
  var getSrcSet = require('../helpers/getSrcSet.js');
7
7
  var helpers = require('./helpers.js');
8
8
 
9
- const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyLoadImage = true, pageContext, ...props })=>{
9
+ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyloadImage = true, ...props })=>{
10
10
  const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
11
11
  const srcDesktop = getSrcSet.getImageSrc(srcSet?.desktop, 'desktop') || fallBackImage;
12
12
  const srcTablet = (getSrcSet.getImageSrc(srcSet?.tablet, 'tablet') ?? getSrcSet.getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
@@ -31,17 +31,16 @@ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className,
31
31
  }}"
32
32
  />
33
33
  `, core.template`
34
- ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['mobile'] ?? helpers.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
35
- ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['tablet'] ?? helpers.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
34
+ ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyloadImage ? imagePlaceholder?.['mobile'] ?? helpers.createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
35
+ ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyloadImage ? imagePlaceholder?.['tablet'] ?? helpers.createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
36
36
  <img
37
37
  ${{
38
38
  ...props
39
39
  }}
40
40
  class="${core.cls(className, {
41
- gp_lazyload: enableLazyLoadImage,
42
- gp_force_load: pageContext?.isOptimizePlan
41
+ gp_lazyload: enableLazyloadImage
43
42
  })}"
44
- src="${enableLazyLoadImage ? imagePlaceholder?.['desktop'] ?? helpers.createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
43
+ src="${enableLazyloadImage ? imagePlaceholder?.['desktop'] ?? helpers.createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
45
44
  data-src="${srcDesktop}"
46
45
  width="100%"
47
46
  alt="${alt}"
@@ -8,13 +8,10 @@ var Link = require('../../link/components/Link.js');
8
8
  var AdaptiveImage = require('./AdaptiveImage.js');
9
9
  var NextImage = require('./NextImage.js');
10
10
  var helpers = require('./helpers.js');
11
- var NoDataImage = require('./NoDataImage.js');
12
- var React = require('react');
13
11
 
14
12
  const Image = ({ styles, className, setting, builderAttrs, builderProps, style, children, onClick, onLoad })=>{
15
13
  const { image, imageLink, srcSet, isNotLazyload } = setting ?? {};
16
14
  const { customAspectRadio } = styles ?? {};
17
- const currentDevice = core.useCurrentDevice();
18
15
  const { shape } = styles ?? {};
19
16
  const WrapLink = imageLink?.link ? Link.default : 'div';
20
17
  const opacity = {
@@ -59,18 +56,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
59
56
  custom: customAspectRadio
60
57
  })
61
58
  };
62
- const isShowNoDataState = React.useMemo(()=>{
63
- if (setting?.disableNoDataState) return false;
64
- if (currentDevice === 'mobile') return !setting?.srcSet?.mobile?.src && !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
65
- if (currentDevice === 'tablet') return !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
66
- return !setting?.srcSet?.desktop?.src;
67
- }, [
68
- currentDevice,
69
- setting?.disableNoDataState,
70
- setting?.srcSet?.desktop?.src,
71
- setting?.srcSet?.mobile?.src,
72
- setting?.srcSet?.tablet?.src
73
- ]);
74
59
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
75
60
  ...builderAttrs,
76
61
  "data-id": builderProps?.uid,
@@ -98,15 +83,10 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
98
83
  ...core.makeStyleResponsive('jc', styles?.align)
99
84
  },
100
85
  children: [
101
- isShowNoDataState ? /*#__PURE__*/ jsxRuntime.jsx(NoDataImage.default, {
102
- style: {
103
- ...imageWidth,
104
- ...imageHeight
105
- }
106
- }) : setting?.isAdaptive ? /*#__PURE__*/ jsxRuntime.jsx(AdaptiveImage.default, {
86
+ setting?.isAdaptive ? /*#__PURE__*/ jsxRuntime.jsx(AdaptiveImage.default, {
107
87
  srcSet: setting.srcSet,
108
88
  pictureClass: "gp-contents",
109
- className: core.cls(className, 'gp-inline-block gp-w-full gp-max-w-full', core.handleConvertClassColor(styles?.borderImg)),
89
+ className: core.cls(className, 'gp-w-full gp-max-w-full', core.handleConvertClassColor(styles?.borderImg)),
110
90
  alt: setting.alt,
111
91
  style: {
112
92
  ...imageWidth,
@@ -7,7 +7,7 @@ var AdaptiveImage_liquid = require('./AdaptiveImage.liquid.js');
7
7
  var NextImage_liquid = require('./NextImage.liquid.js');
8
8
  var helpers = require('../../helpers.js');
9
9
 
10
- const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyLoadImage = true, pageContext })=>{
10
+ const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyloadImage = true })=>{
11
11
  const { imageLink, isNotLazyload } = setting ?? {};
12
12
  const { shape } = styles ?? {};
13
13
  const { Wrap: WrapLink, urlData } = helpers.getInsertLinkData('div', imageLink);
@@ -34,7 +34,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
34
34
  }}
35
35
  data-id="${builderProps?.uid}"
36
36
  role="presentation"
37
- class="${core.cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
37
+ class="${core.cls('gp-group/image', builderProps?.uid, advanced?.cssClass)}"
38
38
  style="${{
39
39
  ...style,
40
40
  ...core.makeStyleResponsive('ta', styles?.align)
@@ -76,8 +76,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
76
76
  aspectRatio: core.getAspectRatioGlobalSize(styles?.shape),
77
77
  layout: styles?.objectFit,
78
78
  priority: setting?.priority,
79
- enableLazyLoadImage,
80
- pageContext
79
+ enableLazyloadImage
81
80
  }) : NextImage_liquid.default({
82
81
  ...setting?.image,
83
82
  priority: setting?.priority,
@@ -106,8 +105,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
106
105
  layout: styles?.objectFit
107
106
  },
108
107
  isNotLazyload,
109
- enableLazyLoadImage,
110
- pageContext
108
+ enableLazyloadImage
111
109
  })}
112
110
  </${WrapLink}>
113
111
  </div>`;
@@ -7,7 +7,7 @@ var getSrcSet = require('../helpers/getSrcSet.js');
7
7
  var index = require('../../product/components/ProductVariants/index.js');
8
8
  var helpers = require('./helpers.js');
9
9
 
10
- const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', srcIsLiquidCode, alt = 'Alt image', width = 2237, height = 1678, backupFileKey, backupFilePath, storage, style, priority, vw, className, base64, baseSrc, isDisableAspectStyle, isDisableObjectFit, customAttrs, customLazyload, isNotLazyload, enableLazyLoadImage = true, pageContext, srcset, sizes, ...props })=>{
10
+ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', srcIsLiquidCode, alt = 'Alt image', width = 2237, height = 1678, backupFileKey, backupFilePath, storage, style, priority, vw, className, base64, baseSrc, isDisableAspectStyle, isDisableObjectFit, customAttrs, customLazyload, isNotLazyload, enableLazyloadImage = true, srcset, sizes, ...props })=>{
11
11
  const { aspectRatio, layout, qualityPercent, qualityType } = setting ?? {};
12
12
  const newBackupFilekey = backupFileKey ? getSrcSet.getNewBackupFileKey(backupFileKey ?? '', src) : '';
13
13
  const srcImage = srcIsLiquidCode ? baseSrc : getSrcSet.getImageSrc({
@@ -97,13 +97,12 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
97
97
  ${customAttrs}
98
98
  draggable="false"
99
99
  class="${core.cls(className, {
100
- gp_lazyload: !customLazyload && enableLazyLoadImage,
101
- gp_force_load: pageContext?.isOptimizePlan
100
+ gp_lazyload: !customLazyload && enableLazyloadImage
102
101
  })}"
103
102
  ${{
104
103
  'data-src': srcImage,
105
104
  'data-srcset': srcSetImg,
106
- src: enableLazyLoadImage ? imagePlaceholder : srcImage,
105
+ src: enableLazyloadImage ? imagePlaceholder : srcImage,
107
106
  width,
108
107
  height,
109
108
  alt,
@@ -11,7 +11,7 @@ var helpers$1 = require('../../helpers.js');
11
11
  var helpers = require('./common/helpers.js');
12
12
 
13
13
  const CompareImage = (props)=>{
14
- const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid = '', styles, advanced, builderData, preload = false, enableLazyLoadImage, pageContext, translate } = props;
14
+ const { handle = null, handleSize = 40, hover = false, leftImage, leftImageAlt = '', leftImageTitle = '', leftImageCss = {}, leftImageLabel = null, onSliderPositionChange, rightImage, rightImageAlt = '', rightImageTitle = '', rightImageCss = {}, rightImageLabel = null, sliderLineColor = '#ffffff', sliderLineWidth = 2, sliderPositionPercentage = 0.5, vertical = false, enableLabel = false, componentUid = '', styles, advanced, builderData, preload = false, pageContext, translate } = props;
15
15
  const horizontal = !vertical;
16
16
  const leftRatio = (leftImage?.width ?? 0) / (leftImage?.height ?? 1);
17
17
  const rightRatio = (rightImage?.width ?? 0) / (rightImage?.height ?? 1);
@@ -271,9 +271,7 @@ const CompareImage = (props)=>{
271
271
  style: {
272
272
  ...initStyles.rightImage,
273
273
  ...core.makeStyleResponsive('objf', styles?.imageScale)
274
- },
275
- enableLazyLoadImage,
276
- pageContext
274
+ }
277
275
  })}
278
276
  ${NextImage_liquid.default({
279
277
  customAttrs: {
@@ -289,9 +287,7 @@ const CompareImage = (props)=>{
289
287
  style: {
290
288
  ...initStyles.rightImage,
291
289
  ...core.makeStyleResponsive('objf', styles?.imageScale)
292
- },
293
- enableLazyLoadImage,
294
- pageContext
290
+ }
295
291
  })}
296
292
  <div id="image-comparison-slider-${componentUid}" style="${{
297
293
  ...initStyles.slider
package/dist/cjs/index.js CHANGED
@@ -622,7 +622,6 @@ exports.nextComponent = next.default;
622
622
  exports.liquidComponents = index_liquid;
623
623
  exports.builderComponent = builder.default;
624
624
  exports.ELEMENT_Z_INDEX = _const.ELEMENT_Z_INDEX;
625
- exports.getAllHrefFromString = helpers.getAllHrefFromString;
626
625
  exports.getDynamicSourceLocales = helpers.getDynamicSourceLocales;
627
626
  exports.getInsertLinkData = helpers.getInsertLinkData;
628
627
  exports.getSettingPreloadData = helpers.getSettingPreloadData;
@@ -630,7 +629,6 @@ exports.getStaticLocale = helpers.getStaticLocale;
630
629
  exports.isHexTransparent = helpers.isHexTransparent;
631
630
  exports.isTransparentColor = helpers.isTransparentColor;
632
631
  exports.isTransparentRGBA = helpers.isTransparentRGBA;
633
- exports.replaceAllHrefFromString = helpers.replaceAllHrefFromString;
634
632
  exports.replaceLinkData = helpers.replaceLinkData;
635
633
  exports.youtubeShortsRegex = helpers.youtubeShortsRegex;
636
634
  exports.postPurchaseTextSetting = index$M.default;
@@ -9,7 +9,6 @@ var helpers = require('../../helpers.js');
9
9
  const PRODUCT_ID_LATEST = 'latest';
10
10
  const PREFIX_PRODUCT_ID = 'gid://shopify/Product/';
11
11
  const PREFIX_PRODUCT_VARIANT_ID = 'gid://shopify/ProductVariant/';
12
- const PREFIX_PRODUCT_OPTION_VALUE_ID = 'gid://shopify/ProductOptionValue/';
13
12
  const STATIC_PRODUCT_STATUS = 'static';
14
13
  const DYNAMIC_PRODUCT_STATUS = 'dynamic';
15
14
  const Product = ({ children, setting, styles, style, builderProps, rawChildren, advanced })=>{
@@ -25,8 +24,8 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
25
24
  const formatProductId = productSetting?.productId?.replace(PREFIX_PRODUCT_ID, '').toLowerCase() || PRODUCT_ID_LATEST;
26
25
  const formatVariantId = initVariantId?.replace(PREFIX_PRODUCT_VARIANT_ID, '') || '';
27
26
  const productStatus = productSetting?.productStatus ?? STATIC_PRODUCT_STATUS;
28
- const preSelectedOptionIds = productSetting?.selectedOptions?.map((option)=>option?.valueBaseID?.replace(PREFIX_PRODUCT_OPTION_VALUE_ID, ''));
29
27
  return core.template /* liquid */ `
28
+
30
29
  {%- assign gpBkProduct = product -%}
31
30
  ${productStatus !== DYNAMIC_PRODUCT_STATUS ? `
32
31
  {%- liquid
@@ -101,7 +100,7 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
101
100
  {%- endif -%}
102
101
  <gp-product data-uid="${builderProps?.uid}" data-id="${builderProps?.uid}" style="${{
103
102
  ...advancedStyle
104
- }}" class="${advanced?.cssClass}" gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${preSelectedOptionIds}], "isSyncProduct": "${isSyncProduct}", "variantSelected": {{ variant | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
103
+ }}" class="${advanced?.cssClass}" gp-context='{"productId": {{ product.id }}, "isSyncProduct": "${isSyncProduct}", "variantSelected": {{ variant | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
105
104
  gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }}}'>
106
105
  <product-form class="product-form">
107
106
  {%- form 'product', product, id: product_form_id, class: 'form contents', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
@@ -13,7 +13,7 @@ var NextImage_liquid = require('../../../../image/components/NextImage.liquid.js
13
13
  var Video_liquid = require('../../../../image/components/Video.liquid.js');
14
14
  var _function = require('../../../helpers/function.js');
15
15
 
16
- const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
16
+ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
17
17
  const ftAspectRatio = common.getAspectRatio(setting.ftShape);
18
18
  const getStyleFeaturedImageDisplay = ()=>{
19
19
  return common.getDisplayStyle((device)=>![
@@ -153,7 +153,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
153
153
  },
154
154
  priority: setting?.preload,
155
155
  className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${className}`,
156
- enableLazyLoadImage
156
+ enableLazyloadImage
157
157
  })}`;
158
158
  };
159
159
  const renderNoImage = ()=>{
@@ -171,7 +171,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
171
171
  },
172
172
  priority: setting?.preload,
173
173
  className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
174
- enableLazyLoadImage
174
+ enableLazyloadImage
175
175
  })}`;
176
176
  };
177
177
  const getValueFromValueContainUnit = (value)=>{
@@ -398,11 +398,10 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
398
398
  },
399
399
  className: `gp-w-full featured-image-only !gp-rounded-none`,
400
400
  customLazyload: true,
401
- enableLazyLoadImage
401
+ enableLazyloadImage
402
402
  })}
403
403
  {%- endif -%}
404
- `,
405
- ftShapeProductImage: setting?.ftShape
404
+ `
406
405
  })}
407
406
  `;
408
407
  };
@@ -10,7 +10,7 @@ var common = require('../common/common.js');
10
10
  var productGallery = require('../common/productGallery.js');
11
11
  var _function = require('../../../helpers/function.js');
12
12
 
13
- const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
13
+ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
14
14
  const getCarouselDisplay = ()=>{
15
15
  const isDisplayCarousel = (type, position, device)=>{
16
16
  const layout = core.getResponsiveValueByScreen(position, device);
@@ -90,7 +90,7 @@ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage,
90
90
  customLazyload: true,
91
91
  style: style,
92
92
  className: '!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer',
93
- enableLazyLoadImage
93
+ enableLazyloadImage
94
94
  })}`;
95
95
  };
96
96
  const aspectRatioToPaddingBottom = ()=>{
@@ -12,7 +12,7 @@ var Modal3d_liquid = require('../../../../image/components/Modal3d.liquid.js');
12
12
  var Video_liquid = require('../../../../image/components/Video.liquid.js');
13
13
  var HTML5Embed_liquid = require('../../../../video/components/HTML5Embed.liquid.js');
14
14
 
15
- const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyLoadImage, ...setting })=>{
15
+ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyloadImage, ...setting })=>{
16
16
  const getGridDisplay = ()=>{
17
17
  const isDisplayGrid = (type, position, device)=>{
18
18
  const layout = core.getResponsiveValueByScreen(position, device);
@@ -101,7 +101,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
101
101
  style: style,
102
102
  className: '!gp-rounded-none',
103
103
  customLazyload: false,
104
- enableLazyLoadImage
104
+ enableLazyloadImage
105
105
  })}
106
106
  ${setting?.galleryHoverEffect !== 'none' ? `<div class="${core.cls('zoom-element !gp-max-w-none', productFeaturedImage.getZoomImageClass())}">
107
107
  ${NextImage_liquid.default({
@@ -115,7 +115,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
115
115
  style: style,
116
116
  className: '!gp-rounded-none gp-w-full gp-h-full',
117
117
  customLazyload: false,
118
- enableLazyLoadImage
118
+ enableLazyloadImage
119
119
  })}
120
120
  </div>` : ''}
121
121
  ${setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' ? `
@@ -298,7 +298,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
298
298
  },
299
299
  className: '!gp-rounded-none',
300
300
  customLazyload: false,
301
- enableLazyLoadImage
301
+ enableLazyloadImage
302
302
  })}`;
303
303
  };
304
304
  return core.template`
@@ -11,7 +11,7 @@ var helpers = require('../../../../helpers.js');
11
11
  var productGallery = require('../common/productGallery.js');
12
12
 
13
13
  const ProductImages = (productImageProps)=>{
14
- const { setting, styles, builderProps, style, advanced, rawChildren, pageContext, enableLazyLoadImage } = productImageProps;
14
+ const { setting, styles, builderProps, style, advanced, rawChildren, pageContext, enableLazyloadImage } = productImageProps;
15
15
  const settings = {
16
16
  ...setting,
17
17
  ...styles
@@ -116,7 +116,7 @@ const ProductImages = (productImageProps)=>{
116
116
  builderPropUID: `gp-carousel-${builderProps?.uid}`,
117
117
  ...settings,
118
118
  children: renderProductBadge(),
119
- enableLazyLoadImage
119
+ enableLazyloadImage
120
120
  })}
121
121
  ${common.shouldSkipLiquidRenderForSingleImage(settings?.position, core.template`
122
122
  <div
@@ -132,7 +132,7 @@ const ProductImages = (productImageProps)=>{
132
132
  ${ProductGalleryCarousel_liquid.default({
133
133
  builderPropUID: `gp-gallery-${builderProps?.uid}`,
134
134
  ...settings,
135
- enableLazyLoadImage
135
+ enableLazyloadImage
136
136
  })}
137
137
  </div>
138
138
  ${ProductGalleryGrid_liquid.default({
@@ -142,7 +142,7 @@ const ProductImages = (productImageProps)=>{
142
142
  },
143
143
  children: renderProductBadge(),
144
144
  ...settings,
145
- enableLazyLoadImage
145
+ enableLazyloadImage
146
146
  })}
147
147
  `)}
148
148
  </div>
@@ -97,9 +97,15 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
97
97
  <div
98
98
  option-name="{{option.name | escape}}"
99
99
  class="${core.cls('gp-flex variant-inside', {
100
- ...core.getLayoutClasses(layout),
100
+ 'gp-flex-col': layout?.desktop === 'vertical',
101
+ 'gp-flex-row': layout?.desktop === 'horizontal',
102
+ 'tablet:gp-flex-row': layout?.tablet === 'horizontal',
103
+ 'tablet:gp-flex-col': layout?.tablet === 'vertical',
104
+ 'mobile:gp-flex-row': layout?.mobile === 'horizontal',
105
+ 'mobile:gp-flex-col': layout?.mobile === 'vertical'
106
+ }, {
101
107
  ..._function.getAlignClasses(layout, align)
102
- })}"
108
+ })} {% if hiddenPresetOptions contains option.name %} gp-hidden {% endif %}"
103
109
 
104
110
  >
105
111
  {% assign showVariantClass = 'variant-display' %}
@@ -131,7 +137,15 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
131
137
  <div
132
138
  variant-option-name="{{option.name | escape}}"
133
139
  class="${core.cls({
134
- ...core.getAlignmentClasses(align)
140
+ 'gp-justify-start': align?.desktop === 'left',
141
+ 'gp-justify-center': align?.desktop === 'center',
142
+ 'gp-justify-end': align?.desktop === 'right',
143
+ 'tablet:gp-justify-start': align?.tablet === 'left',
144
+ 'tablet:gp-justify-center': align?.tablet === 'center',
145
+ 'tablet:gp-justify-end': align?.tablet === 'right',
146
+ 'mobile:gp-justify-start': align?.mobile === 'left',
147
+ 'mobile:gp-justify-center': align?.mobile === 'center',
148
+ 'mobile:gp-justify-end': align?.mobile === 'right'
135
149
  }, 'gp-flex gp-w-full gp-flex-wrap gp-items-center variant-option-group')}"
136
150
  style="${{
137
151
  ...core.makeStyle({
@@ -314,10 +328,6 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
314
328
  `;
315
329
  };
316
330
  return core.template`
317
- {%- assign total_combinations = 1 -%}
318
- {%- for option in product.options_with_values -%}
319
- {%- assign total_combinations = total_combinations | times: option.values.size -%}
320
- {%- endfor -%}
321
331
  <gp-product-variants
322
332
  data-id="${uid}"
323
333
  class="${advanced?.cssClass}"
@@ -333,10 +343,7 @@ const ProductVariants = ({ builderProps, style, styles, setting, advanced })=>{
333
343
  "moneyFormat": {{shop.money_format | json | escape}},
334
344
  "productId": {{product.id | json | escape}},
335
345
  "productUrl": {{product.url | json | escape}},
336
- "productHandle": {{product.handle | json | escape}},
337
- "displayState": ${JSON.stringify(advancedDisplay)},
338
- "totalVariantCombinations": {{total_combinations}},
339
- "firstAvailableVariant": {{product.selected_or_first_available_variant | json | escape}}
346
+ "displayState":${JSON.stringify(advancedDisplay)}
340
347
  }
341
348
  '>
342
349
  {%- assign options = product.options_with_values -%}
@@ -156,7 +156,6 @@ const BaseVariant = ({ optionTransform, optionTypography, optionBgColor, optionT
156
156
  option-data="{{option.name | escape}}"
157
157
  option-value="{{value | escape}}"
158
158
  option-position="{{option.position}}"
159
- data-gp-option-available="{{value.available}}"
160
159
  option-type="${type || 'rectangle_list'}"
161
160
  data-disabled="{%- if option_disabled == true -%} disabled {%- endif -%}"
162
161
  data-hidden='true'