@gem-sdk/components 2.1.27-staging.1 → 2.1.27

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 (56) 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 +1 -1
  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/post-purchase/product/components/ProductOffer.js +1 -5
  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 +1 -0
  23. package/dist/cjs/video/components/HTML5Embed.js +2 -2
  24. package/dist/cjs/video/components/HTML5Embed.liquid.js +3 -6
  25. package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  26. package/dist/esm/article/components/ArticleImage.js +1 -2
  27. package/dist/esm/banner/components/hero-banner/index.liquid.js +7 -4
  28. package/dist/esm/carousel/components/Carousel.liquid.js +2 -3
  29. package/dist/esm/common/const.js +1 -1
  30. package/dist/esm/helpers.js +1 -1
  31. package/dist/esm/image/components/AdaptiveImage.liquid.js +5 -6
  32. package/dist/esm/image/components/Image.js +3 -23
  33. package/dist/esm/image/components/Image.liquid.js +4 -6
  34. package/dist/esm/image/components/NextImage.liquid.js +3 -4
  35. package/dist/esm/image-comparison/components/CompareImage.liquid.js +3 -7
  36. package/dist/esm/post-purchase/product/components/ProductOffer.js +1 -5
  37. package/dist/esm/product/components/Product.liquid.js +2 -3
  38. package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +5 -6
  39. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
  40. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  41. package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  42. package/dist/esm/product/components/ProductVariants/index.liquid.js +19 -12
  43. package/dist/esm/product/components/ProductVariants/variants/Base.liquid.js +0 -1
  44. package/dist/esm/product/components/ProductVariants/variants/Dropdown.liquid.js +12 -26
  45. package/dist/esm/product/components/ProductVariants/variants/DropdownGroup.liquid.js +37 -4
  46. package/dist/esm/tab/hooks/useTabInteraction.js +10 -14
  47. package/dist/esm/text/components/Text.js +1 -0
  48. package/dist/esm/video/components/HTML5Embed.js +2 -2
  49. package/dist/esm/video/components/HTML5Embed.liquid.js +3 -6
  50. package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +3 -5
  51. package/dist/types/index.d.ts +6 -23
  52. package/package.json +3 -3
  53. package/dist/cjs/image/components/NoDataImage.js +0 -133
  54. package/dist/cjs/product/components/ProductVariants/variants/combine/index.js +0 -47
  55. package/dist/esm/image/components/NoDataImage.js +0 -129
  56. package/dist/esm/product/components/ProductVariants/variants/combine/index.js +0 -44
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@gem-sdk/core');
6
- var index = require('./combine/index.js');
6
+ var helpers = require('../../../../helpers.js');
7
7
 
8
- const DropdownVariant = ({ price: hasPrice, blankText, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder, optionTransform, hasPreSelected, optionTypo, combineWidth, combineHeight, soldOutStyle })=>{
8
+ const DropdownVariant = ({ price, blankText, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder, optionTransform, hasPreSelected, optionTypo, combineWidth, combineHeight, soldOutStyle })=>{
9
9
  const swatchWidthResponsive = core.makeStyleResponsive('w', core.makeWidth(combineWidth));
10
10
  const getCustomCSSActiveState = ()=>{
11
11
  return core.makeStyle({
@@ -27,6 +27,7 @@ const DropdownVariant = ({ price: hasPrice, blankText, optionTypography, optionB
27
27
  option-data="{{option.name}}"
28
28
  option-type="{{optionType}}"
29
29
  class="${core.cls('gp-truncate gp-bg-auto gp-pl-4 gp-pr-6 gp-outline-none dropdown-option-item', core.handleConvertClassColor(optionBorder), appendTypoClass, core.getGlobalColorStateClass('text', optionTextColor), core.getGlobalColorStateClass('bg', optionBgColor), 'gp-outline-none', 'gp-shadow-none')}"
30
+
30
31
  style="${{
31
32
  ...core.getStyleShadowState(optionShadow, 'box-shadow', optionHasShadow),
32
33
  ...getCustomCSSActiveState(),
@@ -48,8 +49,40 @@ const DropdownVariant = ({ price: hasPrice, blankText, optionTypography, optionB
48
49
  'background-position': 'right 16px center'
49
50
  }}"
50
51
  >
51
- ${index.renderBlankOption(hasPreSelected, blankText)}
52
- ${index.renderCombineVariants(isSoldOutMark, hasPreSelected, hasPrice)}
52
+ ${!hasPreSelected ? `<option value="blank" selected>${blankText || helpers.getStaticLocale('ProductVariants', 'please_select')}</option>` : ''}
53
+ ${`{%- for variantItem in variants -%}
54
+ ${isSoldOutMark ? `{%- if variantItem.available == false -%}
55
+ {%- if variantItem.id == variant.id -%}
56
+ <option origin-price="{{variantItem.price}}" disabled ${!hasPreSelected ? '' : 'selected'} value="{{variantItem.id}}" key="{{variantItem.id}}">
57
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
58
+ </option>
59
+ {% else %}
60
+ <option origin-price="{{variantItem.price}}" disabled value="{{variantItem.id}}" key="{{variantItem.id}}">
61
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
62
+ </option>
63
+ {%- endif -%}
64
+ {%- else -%}
65
+ {%- if variantItem.id == variant.id -%}
66
+ <option origin-price="{{variantItem.price}}" ${!hasPreSelected ? '' : 'selected'} value="{{variantItem.id}}" key="{{variantItem.id}}">
67
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
68
+ </option>
69
+ {% else %}
70
+ <option origin-price="{{variantItem.price}}" value="{{variantItem.id}}" key="{{variantItem.id}}">
71
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
72
+ </option>
73
+ {%- endif -%}
74
+ {%- endif -%}` : `{%- if variantItem.id == variant.id -%}
75
+ <option origin-price="{{variantItem.price}}" ${!hasPreSelected ? '' : 'selected'} value="{{variantItem.id}}" key="{{variantItem.id}}">
76
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
77
+ </option>
78
+ {% else %}
79
+ <option origin-price="{{variantItem.price}}" value="{{variantItem.id}}" key="{{variantItem.id}}">
80
+ {{variantItem.title}} ${price ? '- {{variantItem.price | money}}' : ''}
81
+ </option>
82
+ {%- endif -%}`}
83
+
84
+ {%- endfor -%}
85
+ `}
53
86
  </select>
54
87
  `;
55
88
  };
@@ -4,18 +4,19 @@ var core = require('@gem-sdk/core');
4
4
  var React = require('react');
5
5
 
6
6
  const useTabInteraction = ({ activeKey, setActiveKey, activeTab, refContainer, componentUid })=>{
7
- const { trigger, onListener, interactionListenerLoaded, saveToElementInteractionData, findElementIncludingSelf } = core.useInteraction();
7
+ const [previousTab, setPreviousTab] = React.useState(activeKey || 1);
8
+ const { trigger, onListener, interactionListenerLoaded } = core.useInteraction();
8
9
  const mode = core.useEditorMode();
9
10
  const changeOpenTabInteraction = (params)=>{
10
- const { data, isRollback, element, key } = params || {};
11
- if (data === undefined && isRollback) return;
12
- const newData = Number(data) + 1;
11
+ const { data, isRollback } = params || {};
12
+ if (data === undefined && isRollback === undefined) return;
13
13
  if (isRollback) {
14
- setActiveKey(newData);
14
+ setActiveKey(previousTab);
15
+ setPreviousTab(activeTab);
15
16
  return;
16
17
  }
17
- saveToElementInteractionData(element, key, String(activeKey));
18
- setActiveKey(newData);
18
+ setPreviousTab(activeTab);
19
+ setActiveKey(data + 1);
19
20
  };
20
21
  const dispatchEventTabActive = (index)=>{
21
22
  trigger({
@@ -36,16 +37,11 @@ const useTabInteraction = ({ activeKey, setActiveKey, activeTab, refContainer, c
36
37
  dispatchEventTabActive(activeTab - 1);
37
38
  });
38
39
  const selector = `[data-id="${componentUid}"]`;
39
- const element = findElementIncludingSelf(document, selector);
40
40
  const removeListener = onListener({
41
41
  event: 'gp:change-open-tab',
42
42
  selector
43
43
  }, (params)=>{
44
- changeOpenTabInteraction({
45
- ...params,
46
- element,
47
- key: params?.uniqueStorageKey
48
- });
44
+ changeOpenTabInteraction(params);
49
45
  });
50
46
  return ()=>{
51
47
  removeListener?.();
@@ -9,6 +9,7 @@ var React = require('react');
9
9
  const Text = /*#__PURE__*/ React.forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
10
10
  const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
11
11
  const composeGlobalSize = core.makeGlobalSize(setting?.globalSize);
12
+ console.log('Text: ', text);
12
13
  const mode = core.useEditorMode();
13
14
  const getPlaceHolderWhenContentNone = ()=>{
14
15
  let classList = '';
@@ -51,14 +51,14 @@ const HTML5Embed = (props)=>{
51
51
  }),
52
52
  props.thumbnail && showThumbnail && /*#__PURE__*/ jsxRuntime.jsxs("div", {
53
53
  role: "presentation",
54
- className: "gp-absolute gp-top-0 gp-left-0 gp-w-full gp-h-full",
54
+ className: "gp-absolute gp-top-0 gp-left-0 gp-w-full",
55
55
  onClick: playVideoAndTurnOffThumbnail,
56
56
  style: props.style,
57
57
  children: [
58
58
  /*#__PURE__*/ jsxRuntime.jsx("img", {
59
59
  id: "video-thumbnail",
60
60
  src: props.thumbnail,
61
- className: "gp-w-full gp-h-full gp-object-contain gp-thumbnail-video",
61
+ className: "gp-w-full gp-h-full gp-object-cover gp-thumbnail-video",
62
62
  alt: "Video Thumbnail"
63
63
  }),
64
64
  /*#__PURE__*/ jsxRuntime.jsx("button", {
@@ -7,7 +7,6 @@ var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
7
7
  var helpers = require('../../helpers.js');
8
8
 
9
9
  const HTML5Embed = (props)=>{
10
- const { enableLazyLoadImage, pageContext } = props;
11
10
  const videoId = `gp-video-${props.uid}`;
12
11
  const preloadThumbnail = props.autoplay && props.thumbnail;
13
12
  const offLazyVideo = !props.lazy && props.isVideoComponent;
@@ -24,9 +23,7 @@ const HTML5Embed = (props)=>{
24
23
  '--op': 0,
25
24
  '--z': -1,
26
25
  display: 'none'
27
- },
28
- enableLazyLoadImage,
29
- pageContext
26
+ }
30
27
  })}
31
28
  ${core.RenderIf(props.autoplay, `<script>
32
29
  document.addEventListener("DOMContentLoaded", (event) => {
@@ -75,14 +72,14 @@ const HTML5Embed = (props)=>{
75
72
  </video>
76
73
  <div
77
74
  style="${props.style}"
78
- class="${core.cls('gp-absolute gp-top-0 gp-left-0 gp-w-full gp-h-full gp-thumbnail-video', {
75
+ class="${core.cls('gp-absolute gp-top-0 gp-left-0 gp-w-full gp-thumbnail-video', {
79
76
  'gp-hidden': !props.thumbnail || props.autoplay
80
77
  })}"
81
78
  >
82
79
  <img
83
80
  id="video-thumbnail"
84
81
  src="${props.thumbnail ?? ''}"
85
- class="gp-w-full gp-h-full gp-object-contain"
82
+ class="gp-w-full gp-h-full gp-object-cover"
86
83
  alt="Video Thumbnail"
87
84
  ></img>
88
85
  <button
@@ -7,7 +7,7 @@ var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
7
7
  var helpers = require('../../helpers.js');
8
8
 
9
9
  const LiteYouTubeEmbed = (props)=>{
10
- const { style, lazy, preload, enableLazyLoadImage, pageContext } = props;
10
+ const { style, lazy, preload } = props;
11
11
  const videoUid = `gp-video-${props.uid}`;
12
12
  const videoId = encodeURIComponent(props.id);
13
13
  const videoTitle = props.title;
@@ -42,7 +42,7 @@ const LiteYouTubeEmbed = (props)=>{
42
42
  data-title="${videoTitle}"
43
43
  style="${{
44
44
  ...core.makeStyleResponsive('bgi', {
45
- desktop: preload || !enableLazyLoadImage ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
45
+ desktop: preload ? `url('${posterUrl}')` : `url('${imagePlaceholder}')`
46
46
  }),
47
47
  ...style
48
48
  }}"
@@ -52,9 +52,7 @@ const LiteYouTubeEmbed = (props)=>{
52
52
  src: posterUrl,
53
53
  alt: 'Poster',
54
54
  className: `gp-invisible gp-w-full gp-h-full gp_lazyforbg`,
55
- isDisableAspectStyle: true,
56
- enableLazyLoadImage,
57
- pageContext
55
+ isDisableAspectStyle: true
58
56
  })}
59
57
  <button
60
58
  type="button"
@@ -25,8 +25,7 @@ const ArticleImage = ({ className, setting = {}, styles = {}, advanced, builderP
25
25
  setting: {
26
26
  ...setting,
27
27
  alt: image.alt,
28
- image,
29
- disableNoDataState: true
28
+ image
30
29
  },
31
30
  styles: styles,
32
31
  advanced: advanced
@@ -10,7 +10,7 @@ import NextImage from '../../../image/components/NextImage.liquid.js';
10
10
  import { getImageSrc, DEVICES } from '../../../image/helpers/getSrcSet.js';
11
11
  import { createBlurDataURL } from '../../../image/components/helpers.js';
12
12
 
13
- const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyLoadImage = true })=>{
13
+ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, children, rawChildren, advanced, enableLazyloadImage = true })=>{
14
14
  const { link, layout, verticalAlign, order, alignBanner, alt, title } = setting ?? {};
15
15
  const { background, overlayEnable, overlayColor, overlayOpacity, verticalGutter, contentWidth, hoverEffect, hoverEffectDuration, hoverEffectScale, cornerBg, borderBg, hasActiveShadow, shadowBg, sizeSetting, contentPadding } = styles ?? {};
16
16
  const enableParallax = setting?.enableParallax || false;
@@ -39,6 +39,9 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
39
39
  } else if (data.videoType === 'html5') {
40
40
  delete data.video;
41
41
  }
42
+ if (data.type !== 'image') {
43
+ delete data.image;
44
+ }
42
45
  }
43
46
  return background;
44
47
  };
@@ -127,7 +130,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
127
130
  tablet: createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0),
128
131
  mobile: createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.width ?? 0)
129
132
  };
130
- const enableLazyLoad = !setting?.preload && enableLazyLoadImage;
133
+ const enableLazyLoad = !setting?.preload && enableLazyloadImage;
131
134
  const renderInnerHeroBanner = ()=>{
132
135
  return template /* liquid */ `
133
136
  <div
@@ -177,7 +180,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
177
180
  alt,
178
181
  title,
179
182
  imagePlaceholder,
180
- enableLazyLoadImage
183
+ enableLazyloadImage
181
184
  })}
182
185
  <div class="${cls('gp-absolute gp-w-full gp-h-full')}">
183
186
  <div
@@ -220,7 +223,7 @@ const HeroBanner = ({ builderAttrs, builderProps, setting, styles, style, childr
220
223
  alt: `lazy image ${device}`,
221
224
  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' : ''}`,
222
225
  isDisableAspectStyle: true,
223
- enableLazyLoadImage
226
+ enableLazyloadImage
224
227
  }));
225
228
  }).join('') : ''}
226
229
  </div></div>
@@ -9,7 +9,7 @@ const DEVICES = [
9
9
  'tablet',
10
10
  'desktop'
11
11
  ];
12
- const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ftShapeProductImage, ...props })=>{
12
+ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId, rootAttr, rootClass, wrapperClass, rootStyles, children, rawChildren, isHiddenArrowWhenDisabled = true, advanced, disableMarginAuto, conditionAppendJs, ...props })=>{
13
13
  const setting = mappingNavigationCarousel(props.setting);
14
14
  const styleHeight = makeStyleResponsive('h', getHeightByShapeGlobalSize(styles?.sizeSetting));
15
15
  const styleWidth = makeStyleWithDefault('w', getWidthByShapeGlobalSize(styles?.sizeSetting, true), {
@@ -108,8 +108,7 @@ const Carousel = ({ builderAttrs, builderProps, style, styles, moveToIdx, rootId
108
108
  setting,
109
109
  styles,
110
110
  moveToIdx,
111
- isHiddenArrowWhenDisabled,
112
- ftShapeProductImage
111
+ isHiddenArrowWhenDisabled
113
112
  }).replaceAll("'", '&#039;')}' style="${{
114
113
  ...makeStyleResponsive('jc', styles?.align),
115
114
  ...rootStyles
@@ -1,5 +1,5 @@
1
1
  const ELEMENT_Z_INDEX = {
2
- STICKY: 1000,
2
+ STICKY: 100000,
3
3
  DIALOG: 100001,
4
4
  CART_DRAWER: 100002,
5
5
  CART_DRAWER_CONFIRM_MODAL: 100003
@@ -45,7 +45,7 @@ const getDynamicSourceLocales = ({ val, uid, settingId, isLiquid, pageContext, i
45
45
  locale += ` | replace: '$locationOrigin', locationOrigin`;
46
46
  }
47
47
  if (isReplaceInventoryQuantity) {
48
- locale += ` | replace: '<$quantity$>', inventory_quantity`;
48
+ locale += ` | replace: '<$quantity$>', inventory_quantity | replace: '&lt;$quantity$&gt;', inventory_quantity`;
49
49
  }
50
50
  if (isCapitalize) {
51
51
  locale = `${locale} | downcase`;
@@ -2,7 +2,7 @@ import { template, cls, RenderIf, makeStyleResponsive } from '@gem-sdk/core';
2
2
  import { getImageSrc } from '../helpers/getSrcSet.js';
3
3
  import { createBlurDataURL } from './helpers.js';
4
4
 
5
- const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyLoadImage = true, pageContext, ...props })=>{
5
+ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className, pictureClass, style, imagePlaceholder, enableLazyloadImage = true, ...props })=>{
6
6
  const fallBackImage = 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif';
7
7
  const srcDesktop = getImageSrc(srcSet?.desktop, 'desktop') || fallBackImage;
8
8
  const srcTablet = (getImageSrc(srcSet?.tablet, 'tablet') ?? getImageSrc(srcSet?.desktop, 'tablet')) || fallBackImage;
@@ -27,17 +27,16 @@ const AdaptiveImage = ({ srcSet, priority, alt, aspectRatio, layout, className,
27
27
  }}"
28
28
  />
29
29
  `, template`
30
- ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['mobile'] ?? createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
31
- ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? imagePlaceholder?.['tablet'] ?? createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
30
+ ${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyloadImage ? imagePlaceholder?.['mobile'] ?? createBlurDataURL(srcSet?.mobile?.width ?? srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.mobile?.height ?? srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcMobile}" />` : ''}
31
+ ${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyloadImage ? imagePlaceholder?.['tablet'] ?? createBlurDataURL(srcSet?.tablet?.width ?? srcSet?.desktop?.width ?? 0, srcSet?.tablet?.height ?? srcSet?.desktop?.height ?? 0) : srcTablet}" />` : ''}
32
32
  <img
33
33
  ${{
34
34
  ...props
35
35
  }}
36
36
  class="${cls(className, {
37
- gp_lazyload: enableLazyLoadImage,
38
- gp_force_load: pageContext?.isOptimizePlan
37
+ gp_lazyload: enableLazyloadImage
39
38
  })}"
40
- src="${enableLazyLoadImage ? imagePlaceholder?.['desktop'] ?? createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
39
+ src="${enableLazyloadImage ? imagePlaceholder?.['desktop'] ?? createBlurDataURL(srcSet?.desktop?.width ?? 0, srcSet?.desktop?.height ?? 0) : srcDesktop}"
41
40
  data-src="${srcDesktop}"
42
41
  width="100%"
43
42
  alt="${alt}"
@@ -1,16 +1,13 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useCurrentDevice, makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
2
+ import { makeStyleResponsive, getWidthByShapeGlobalSize, makeWidth, getHeightByShapeGlobalSize, cls, getStyleShadowState, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getGlobalColorStateClass, getGlobalColorStateStyle, makeStyleState, getCornerCSSFromGlobal } from '@gem-sdk/core';
3
3
  import Link from '../../link/components/Link.js';
4
4
  import AdaptiveImage from './AdaptiveImage.js';
5
5
  import NextImage from './NextImage.js';
6
6
  import { composeAspectRatio } from './helpers.js';
7
- import NoDataImage from './NoDataImage.js';
8
- import { useMemo } from 'react';
9
7
 
10
8
  const Image = ({ styles, className, setting, builderAttrs, builderProps, style, children, onClick, onLoad })=>{
11
9
  const { image, imageLink, srcSet, isNotLazyload } = setting ?? {};
12
10
  const { customAspectRadio } = styles ?? {};
13
- const currentDevice = useCurrentDevice();
14
11
  const { shape } = styles ?? {};
15
12
  const WrapLink = imageLink?.link ? Link : 'div';
16
13
  const opacity = {
@@ -55,18 +52,6 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
55
52
  custom: customAspectRadio
56
53
  })
57
54
  };
58
- const isShowNoDataState = useMemo(()=>{
59
- if (setting?.disableNoDataState) return false;
60
- if (currentDevice === 'mobile') return !setting?.srcSet?.mobile?.src && !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
61
- if (currentDevice === 'tablet') return !setting?.srcSet?.tablet?.src && !setting?.srcSet?.desktop?.src;
62
- return !setting?.srcSet?.desktop?.src;
63
- }, [
64
- currentDevice,
65
- setting?.disableNoDataState,
66
- setting?.srcSet?.desktop?.src,
67
- setting?.srcSet?.mobile?.src,
68
- setting?.srcSet?.tablet?.src
69
- ]);
70
55
  return /*#__PURE__*/ jsxs("div", {
71
56
  ...builderAttrs,
72
57
  "data-id": builderProps?.uid,
@@ -94,15 +79,10 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
94
79
  ...makeStyleResponsive('jc', styles?.align)
95
80
  },
96
81
  children: [
97
- isShowNoDataState ? /*#__PURE__*/ jsx(NoDataImage, {
98
- style: {
99
- ...imageWidth,
100
- ...imageHeight
101
- }
102
- }) : setting?.isAdaptive ? /*#__PURE__*/ jsx(AdaptiveImage, {
82
+ setting?.isAdaptive ? /*#__PURE__*/ jsx(AdaptiveImage, {
103
83
  srcSet: setting.srcSet,
104
84
  pictureClass: "gp-contents",
105
- className: cls(className, 'gp-inline-block gp-w-full gp-max-w-full', handleConvertClassColor(styles?.borderImg)),
85
+ className: cls(className, 'gp-w-full gp-max-w-full', handleConvertClassColor(styles?.borderImg)),
106
86
  alt: setting.alt,
107
87
  style: {
108
88
  ...imageWidth,
@@ -3,7 +3,7 @@ import AdaptiveImage from './AdaptiveImage.liquid.js';
3
3
  import NextImage from './NextImage.liquid.js';
4
4
  import { getInsertLinkData } from '../../helpers.js';
5
5
 
6
- const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyLoadImage = true, pageContext })=>{
6
+ const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyloadImage = true })=>{
7
7
  const { imageLink, isNotLazyload } = setting ?? {};
8
8
  const { shape } = styles ?? {};
9
9
  const { Wrap: WrapLink, urlData } = getInsertLinkData('div', imageLink);
@@ -30,7 +30,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
30
30
  }}
31
31
  data-id="${builderProps?.uid}"
32
32
  role="presentation"
33
- class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
33
+ class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass)}"
34
34
  style="${{
35
35
  ...style,
36
36
  ...makeStyleResponsive('ta', styles?.align)
@@ -72,8 +72,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
72
72
  aspectRatio: getAspectRatioGlobalSize(styles?.shape),
73
73
  layout: styles?.objectFit,
74
74
  priority: setting?.priority,
75
- enableLazyLoadImage,
76
- pageContext
75
+ enableLazyloadImage
77
76
  }) : NextImage({
78
77
  ...setting?.image,
79
78
  priority: setting?.priority,
@@ -102,8 +101,7 @@ const Image = ({ styles, className, setting, builderAttrs, builderProps, style,
102
101
  layout: styles?.objectFit
103
102
  },
104
103
  isNotLazyload,
105
- enableLazyLoadImage,
106
- pageContext
104
+ enableLazyloadImage
107
105
  })}
108
106
  </${WrapLink}>
109
107
  </div>`;
@@ -3,7 +3,7 @@ import { getNewBackupFileKey, getImageSrc, getSrcSet } from '../helpers/getSrcSe
3
3
  import { DEVICES } from '../../product/components/ProductVariants/index.js';
4
4
  import { createBlurDataURL } from './helpers.js';
5
5
 
6
- 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 })=>{
6
+ 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 })=>{
7
7
  const { aspectRatio, layout, qualityPercent, qualityType } = setting ?? {};
8
8
  const newBackupFilekey = backupFileKey ? getNewBackupFileKey(backupFileKey ?? '', src) : '';
9
9
  const srcImage = srcIsLiquidCode ? baseSrc : getImageSrc({
@@ -93,13 +93,12 @@ const NextImage = ({ setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f0
93
93
  ${customAttrs}
94
94
  draggable="false"
95
95
  class="${cls(className, {
96
- gp_lazyload: !customLazyload && enableLazyLoadImage,
97
- gp_force_load: pageContext?.isOptimizePlan
96
+ gp_lazyload: !customLazyload && enableLazyloadImage
98
97
  })}"
99
98
  ${{
100
99
  'data-src': srcImage,
101
100
  'data-srcset': srcSetImg,
102
- src: enableLazyLoadImage ? imagePlaceholder : srcImage,
101
+ src: enableLazyloadImage ? imagePlaceholder : srcImage,
103
102
  width,
104
103
  height,
105
104
  alt,
@@ -7,7 +7,7 @@ import { getSettingPreloadData } from '../../helpers.js';
7
7
  import { styleLazyPlaceholder } from './common/helpers.js';
8
8
 
9
9
  const CompareImage = (props)=>{
10
- 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;
10
+ 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;
11
11
  const horizontal = !vertical;
12
12
  const leftRatio = (leftImage?.width ?? 0) / (leftImage?.height ?? 1);
13
13
  const rightRatio = (rightImage?.width ?? 0) / (rightImage?.height ?? 1);
@@ -267,9 +267,7 @@ const CompareImage = (props)=>{
267
267
  style: {
268
268
  ...initStyles.rightImage,
269
269
  ...makeStyleResponsive('objf', styles?.imageScale)
270
- },
271
- enableLazyLoadImage,
272
- pageContext
270
+ }
273
271
  })}
274
272
  ${NextImage({
275
273
  customAttrs: {
@@ -285,9 +283,7 @@ const CompareImage = (props)=>{
285
283
  style: {
286
284
  ...initStyles.rightImage,
287
285
  ...makeStyleResponsive('objf', styles?.imageScale)
288
- },
289
- enableLazyLoadImage,
290
- pageContext
286
+ }
291
287
  })}
292
288
  <div id="image-comparison-slider-${componentUid}" style="${{
293
289
  ...initStyles.slider
@@ -65,12 +65,8 @@ const PostPurchaseProductOffer = ({ styles, builderAttrs, builderProps, children
65
65
  };
66
66
  const getClassNameForItem = (index)=>{
67
67
  let className = '';
68
- DEVICES.forEach((device)=>{
68
+ DEVICES.map((device)=>{
69
69
  const key = device === 'desktop' ? '' : `${device}:`;
70
- if (device === 'mobile') {
71
- className += ` mobile:gp-col-span-2`;
72
- return;
73
- }
74
70
  if (productOfferLayout?.[device] === '1col' && index % 3 === 0 || (totalProduct || 0) <= 1) {
75
71
  className += ` ${key}gp-col-span-2`;
76
72
  }
@@ -5,7 +5,6 @@ import { getStaticLocale, getSettingPreloadData } from '../../helpers.js';
5
5
  const PRODUCT_ID_LATEST = 'latest';
6
6
  const PREFIX_PRODUCT_ID = 'gid://shopify/Product/';
7
7
  const PREFIX_PRODUCT_VARIANT_ID = 'gid://shopify/ProductVariant/';
8
- const PREFIX_PRODUCT_OPTION_VALUE_ID = 'gid://shopify/ProductOptionValue/';
9
8
  const STATIC_PRODUCT_STATUS = 'static';
10
9
  const DYNAMIC_PRODUCT_STATUS = 'dynamic';
11
10
  const Product = ({ children, setting, styles, style, builderProps, rawChildren, advanced })=>{
@@ -21,8 +20,8 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
21
20
  const formatProductId = productSetting?.productId?.replace(PREFIX_PRODUCT_ID, '').toLowerCase() || PRODUCT_ID_LATEST;
22
21
  const formatVariantId = initVariantId?.replace(PREFIX_PRODUCT_VARIANT_ID, '') || '';
23
22
  const productStatus = productSetting?.productStatus ?? STATIC_PRODUCT_STATUS;
24
- const preSelectedOptionIds = productSetting?.selectedOptions?.map((option)=>option?.valueBaseID?.replace(PREFIX_PRODUCT_OPTION_VALUE_ID, ''));
25
23
  return template /* liquid */ `
24
+
26
25
  {%- assign gpBkProduct = product -%}
27
26
  ${productStatus !== DYNAMIC_PRODUCT_STATUS ? `
28
27
  {%- liquid
@@ -97,7 +96,7 @@ const Product = ({ children, setting, styles, style, builderProps, rawChildren,
97
96
  {%- endif -%}
98
97
  <gp-product data-uid="${builderProps?.uid}" data-id="${builderProps?.uid}" style="${{
99
98
  ...advancedStyle
100
- }}" 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 }}" }'
99
+ }}" class="${advanced?.cssClass}" gp-context='{"productId": {{ product.id }}, "isSyncProduct": "${isSyncProduct}", "variantSelected": {{ variant | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
101
100
  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 }}}'>
102
101
  <product-form class="product-form">
103
102
  {%- form 'product', product, id: product_form_id, class: 'form contents', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
@@ -9,7 +9,7 @@ import NextImage from '../../../../image/components/NextImage.liquid.js';
9
9
  import Video from '../../../../image/components/Video.liquid.js';
10
10
  import { getStyleOfObject } from '../../../helpers/function.js';
11
11
 
12
- const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
12
+ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
13
13
  const ftAspectRatio = getAspectRatio(setting.ftShape);
14
14
  const getStyleFeaturedImageDisplay = ()=>{
15
15
  return getDisplayStyle((device)=>![
@@ -149,7 +149,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
149
149
  },
150
150
  priority: setting?.preload,
151
151
  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}`,
152
- enableLazyLoadImage
152
+ enableLazyloadImage
153
153
  })}`;
154
154
  };
155
155
  const renderNoImage = ()=>{
@@ -167,7 +167,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
167
167
  },
168
168
  priority: setting?.preload,
169
169
  className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
170
- enableLazyLoadImage
170
+ enableLazyloadImage
171
171
  })}`;
172
172
  };
173
173
  const getValueFromValueContainUnit = (value)=>{
@@ -394,11 +394,10 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoad
394
394
  },
395
395
  className: `gp-w-full featured-image-only !gp-rounded-none`,
396
396
  customLazyload: true,
397
- enableLazyLoadImage
397
+ enableLazyloadImage
398
398
  })}
399
399
  {%- endif -%}
400
- `,
401
- ftShapeProductImage: setting?.ftShape
400
+ `
402
401
  })}
403
402
  `;
404
403
  };
@@ -6,7 +6,7 @@ import { convertSpacing, getDisplayStyle, getAspectRatio, getSrcImage } from '..
6
6
  import { getShapeByLayout, getSettingMinWidthForCarouselItem, getSettingWidthForCarouselItem, getMinHeightByPosition, getSliderPerShowConfig, getAllowDotConfig, getDotStyleConfig, getCarouselVerticalConfigByPosition, checkDisplayGalleryByWidth, getZoomDisplay } from '../common/productGallery.js';
7
7
  import { getStyleOfObject } from '../../../helpers/function.js';
8
8
 
9
- const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
9
+ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
10
10
  const getCarouselDisplay = ()=>{
11
11
  const isDisplayCarousel = (type, position, device)=>{
12
12
  const layout = getResponsiveValueByScreen(position, device);
@@ -86,7 +86,7 @@ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage,
86
86
  customLazyload: true,
87
87
  style: style,
88
88
  className: '!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer',
89
- enableLazyLoadImage
89
+ enableLazyloadImage
90
90
  })}`;
91
91
  };
92
92
  const aspectRatioToPaddingBottom = ()=>{
@@ -8,7 +8,7 @@ import Model3d from '../../../../image/components/Modal3d.liquid.js';
8
8
  import Video from '../../../../image/components/Video.liquid.js';
9
9
  import HTML5Embed from '../../../../video/components/HTML5Embed.liquid.js';
10
10
 
11
- const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyLoadImage, ...setting })=>{
11
+ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyloadImage, ...setting })=>{
12
12
  const getGridDisplay = ()=>{
13
13
  const isDisplayGrid = (type, position, device)=>{
14
14
  const layout = getResponsiveValueByScreen(position, device);
@@ -97,7 +97,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
97
97
  style: style,
98
98
  className: '!gp-rounded-none',
99
99
  customLazyload: false,
100
- enableLazyLoadImage
100
+ enableLazyloadImage
101
101
  })}
102
102
  ${setting?.galleryHoverEffect !== 'none' ? `<div class="${cls('zoom-element !gp-max-w-none', getZoomImageClass())}">
103
103
  ${NextImage({
@@ -111,7 +111,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
111
111
  style: style,
112
112
  className: '!gp-rounded-none gp-w-full gp-h-full',
113
113
  customLazyload: false,
114
- enableLazyLoadImage
114
+ enableLazyloadImage
115
115
  })}
116
116
  </div>` : ''}
117
117
  ${setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' ? `
@@ -294,7 +294,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
294
294
  },
295
295
  className: '!gp-rounded-none',
296
296
  customLazyload: false,
297
- enableLazyLoadImage
297
+ enableLazyloadImage
298
298
  })}`;
299
299
  };
300
300
  return template`