@gem-sdk/components 24.0.0-staging.13 → 24.0.0-staging.15

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.
@@ -1 +1 @@
1
- "use strict";var e=require("@gem-sdk/core"),t=require("./helpers.js");const r={mobile:768,tablet:1024,desktop:1440},i={Image:{desktop:1024,tablet:1024,mobile:480},HeroBanner:{desktop:1920,tablet:1280,mobile:768},ImageComparison:{desktop:1024,tablet:768,mobile:576},ProductFeatureImage:{desktop:1024,tablet:1024,mobile:576},GalleryList:{desktop:256,tablet:256,mobile:128},ArticleImage:{desktop:1024,tablet:768,mobile:480}},s="high",a={high:100,medium:70},o=["GalleryList"],l="original",n=/\s*%\s*$/,p=e=>{if("number"==typeof e)return e;let t=Number.parseFloat(String(e??"").replace(n,""));return Number.isFinite(t)?t:100},u=/^\{\{\s*([\s\S]*?)\s*\}\}$/,d=/\{\{|\{%/,m=e=>!!e&&e.includes("cdn.shopify")&&!t.isCannotResizeImageByQuery(e),c=({qualityType:t,qualityPercent:r})=>{if(!t&&!r)return;let i={};for(let o of e.DEVICES){let n=e.getResponsiveValueByScreen(t,o,s)??s;if("finest"===n){i[o]=l;continue}let u="custom"===n?p(e.getResponsiveValueByScreen(r,o,100)):a[n]??100;i[o]=(u>0?u:100)/100}return i},g=(e,t)=>{let r=e.match(u);return r?`{{ ${r[1]} | append: '?width=${t}' | replace: '?', '&' | replace_first: '&', '?' }}`:`${e}${e.includes("?")?"&":"?"}width=${t}`},b=({sizeTarget:t="Image",qualityType:s,qualityPercent:a})=>{let n=c({qualityType:s,qualityPercent:a}),p=i[t]??i.Image,u=!o.includes(t),d=t=>{let r=e.getResponsiveValueByScreen(n,t,1)??1;return r===l?u?l:p[t]:Math.round(p[t]*r)};return e.DEVICES.map(e=>({device:e,width:d(e),descriptor:r[e]})).sort((e,t)=>e.descriptor-t.descriptor)},S=e=>e.every(e=>e.width===l);exports.ORIGINAL_QUALITY=l,exports.SRCSET_DEVICE_DESCRIPTORS=r,exports.SRCSET_TARGET_WIDTHS=i,exports.appendWidthParam=g,exports.canResizeByShopifyCdn=m,exports.getImageSrcset=({src:t,resolvedSrc:r,sizeTarget:i,qualityType:s,qualityPercent:a})=>{if(!t)return;let o=u.test(t);if(!o&&d.test(t))return;let n=o?e.hasTranslatedLiquid(t)?r:void 0:t;if(!m(n))return;let p=b({sizeTarget:i,qualityType:s,qualityPercent:a});if(!S(p))return p.map(({width:e,descriptor:r})=>{let i=e===l?t:g(t,e);return`${i} ${r}w`}).join(", ")},exports.getQualityMultiplier=c,exports.getSrcsetCandidates=b,exports.isEveryCandidateOriginal=S;
1
+ "use strict";var e=require("@gem-sdk/core"),t=require("./helpers.js");const r={mobile:768,tablet:1024,desktop:1440},i={Image:{desktop:1024,tablet:1024,mobile:480},HeroBanner:{desktop:1920,tablet:1280,mobile:768},ImageComparison:{desktop:1024,tablet:768,mobile:576},ProductFeatureImage:{desktop:1024,tablet:1024,mobile:576},GalleryList:{desktop:256,tablet:256,mobile:256},ArticleImage:{desktop:1024,tablet:768,mobile:480}},s="high",o={high:100,medium:70},a="original",l=/\s*%\s*$/,n=e=>{if("number"==typeof e)return e;let t=Number.parseFloat(String(e??"").replace(l,""));return Number.isFinite(t)?t:100},p=/^\{\{\s*([\s\S]*?)\s*\}\}$/,u=/\{\{|\{%/,d=e=>!!e&&e.includes("cdn.shopify")&&!t.isCannotResizeImageByQuery(e),m=({qualityType:t,qualityPercent:r})=>{if(!t&&!r)return;let i={};for(let l of e.DEVICES){let p=e.getResponsiveValueByScreen(t,l,s)??s;if("finest"===p){i[l]=a;continue}let u="custom"===p?n(e.getResponsiveValueByScreen(r,l,100)):o[p]??100;i[l]=(u>0?u:100)/100}return i},c=(e,t)=>{let r=e.match(p);return r?`{{ ${r[1]} | append: '?width=${t}' | replace: '?', '&' | replace_first: '&', '?' }}`:`${e}${e.includes("?")?"&":"?"}width=${t}`},g=({sizeTarget:t="Image",qualityType:s,qualityPercent:o})=>{let l=m({qualityType:s,qualityPercent:o}),n=i[t]??i.Image,p=t=>{let r=e.getResponsiveValueByScreen(l,t,1)??1;return r===a?a:Math.round(n[t]*r)};return e.DEVICES.map(e=>({device:e,width:p(e),descriptor:r[e]})).sort((e,t)=>e.descriptor-t.descriptor)},b=e=>e.every(e=>e.width===a);exports.ORIGINAL_QUALITY=a,exports.SRCSET_DEVICE_DESCRIPTORS=r,exports.SRCSET_TARGET_WIDTHS=i,exports.appendWidthParam=c,exports.canResizeByShopifyCdn=d,exports.getImageSrcset=({src:t,resolvedSrc:r,sizeTarget:i,qualityType:s,qualityPercent:o})=>{if(!t)return;let l=p.test(t);if(!l&&u.test(t))return;let n=l?e.hasTranslatedLiquid(t)?r:void 0:t;if(!d(n))return;let m=g({sizeTarget:i,qualityType:s,qualityPercent:o});if(!b(m))return m.map(({width:e,descriptor:r})=>{let i=e===a?t:c(t,e);return`${i} ${r}w`}).join(", ")},exports.getQualityMultiplier=m,exports.getSrcsetCandidates=g,exports.isEveryCandidateOriginal=b;
@@ -1 +1 @@
1
- "use strict";var e=require("./constants.js");const t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/,"| escape }}"),o=e=>{if(null==e)return e;let o=e.toString();return t.test(o)?r(o):o.replaceAll("'","'").replaceAll("’","'").replaceAll('"',""")},a=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);exports.checkIconVisibility=e=>e?.enableIcon===!0,exports.escapeSingleQuoteForAttr=o,exports.getGPProductButtonState=({styles:e,setting:t})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:o(t?.label),outOfStockLabel:o(t?.outOfStockLabel),customURL:{link:o(t?.customURL?.link),target:t?.customURL?.target}},variantID:"{{variant.id}}",inStock:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),exports.getRenderComparePriceSettings=e=>({lineThrough:!0,typo:a(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),exports.getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:a(e?.priceTypo)}),exports.renderSeparator=t=>({dot:e.SEPARATOR.DOT,"vertical-line":e.SEPARATOR.VERTICAL_LINE,"horizontal-line":e.SEPARATOR.HORIZONTAL_LINE})[t??"horizontal-line"]??e.SEPARATOR.HORIZONTAL_LINE;
1
+ "use strict";var e=require("./constants.js");const t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/," | escape }}"),o=e=>{if(null==e)return e;let o=e.toString();return t.test(o)?r(o):o.replaceAll("'","'").replaceAll("’","'").replaceAll('"',""")},a=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);exports.checkIconVisibility=e=>e?.enableIcon===!0,exports.escapeSingleQuoteForAttr=o,exports.getGPProductButtonState=({styles:e,setting:t})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:o(t?.label),outOfStockLabel:o(t?.outOfStockLabel),customURL:{link:o(t?.customURL?.link),target:t?.customURL?.target}},variantID:"{{variant.id}}",inStock:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),exports.getRenderComparePriceSettings=e=>({lineThrough:!0,typo:a(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),exports.getRenderRegularPriceSettings=e=>({lineThrough:!1,typo:a(e?.priceTypo)}),exports.renderSeparator=t=>({dot:e.SEPARATOR.DOT,"vertical-line":e.SEPARATOR.VERTICAL_LINE,"horizontal-line":e.SEPARATOR.HORIZONTAL_LINE})[t??"horizontal-line"]??e.SEPARATOR.HORIZONTAL_LINE;
@@ -1,20 +1,20 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),i=require("../../common/productGallery.js"),t=require("../../common/common.js"),o=require("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),r=require("../../composables/getProductImagesClassName.js"),s=require("../../../../../carousel-v3/components/root/Carousel.liquid.js"),a=require("../../composables/getProductImagesStyles.js"),l=require("../../../../../image/common/liquidSrcset.js"),d=require("../../composables/getProductImagesAttr.js"),p=require("../../../../../image/components/NextImage.liquid.js"),g=require("../../../../helpers/function.js"),u=require("@gem-sdk/system");exports.default=({builderPropUID:m,children:n,pageContext:c,...C})=>{let{featuredImageGalleryClasses:y,galleryItemClasses:h}=r.getProductImagesClassName(C),{galleryCarouselSettingAttrs:v}=d.getProductImagesAttr(C),{galleryCarouselStyle:L,galleryCarouselItemStyle:f}=a.getProductImagesStyles(C),q=i.getShapeByLayout({shape:C.shape,shapeForBottom:C.shapeForBottom,shapeFor1Col:C.shapeFor1Col,shapeFor2Col:C.shapeFor2Col,shapeForFtOnly:C.shapeForFtOnly,shapeForInsideBottom:C.shapeForInsideBottom,shapeForInside:C.shapeForInside},C.position),b=l.getLiquidImageSrcset({liquidSrc:"media.preview_image",sizeTarget:"GalleryList",qualityType:C.qualityType,qualityPercent:C.qualityPercent}),I=(i,t)=>e.template`${p.default({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:b,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:i,style:t,className:"!gp-rounded-none gp-w-full gp-h-full gp-top-0 gp-left-0 gp-cursor-pointer"})}`,w=e=>`
2
- ${u.LiquidIf("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
3
- ${u.LiquidIf("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
4
- ${u.LiquidIf("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
5
- ${o.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${e??""}`)}`,parentId:`${m}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:f,children:`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),i=require("@gem-sdk/system"),t=require("../../../../../carousel-v3/components/item/CarouselItem.liquid.js"),o=require("../../../../../carousel-v3/components/root/Carousel.liquid.js"),r=require("../../../../../image/common/liquidSrcset.js"),s=require("../../../../../image/components/NextImage.liquid.js"),a=require("../../../../helpers/function.js"),l=require("../../common/common.js"),d=require("../../common/productGallery.js"),p=require("../../composables/getProductImagesAttr.js"),g=require("../../composables/getProductImagesClassName.js"),u=require("../../composables/getProductImagesStyles.js");exports.default=({builderPropUID:m,children:n,pageContext:c,...C})=>{let{featuredImageGalleryClasses:y,galleryItemClasses:h}=g.getProductImagesClassName(C),{galleryCarouselSettingAttrs:v}=p.getProductImagesAttr(C),{galleryCarouselStyle:L,galleryCarouselItemStyle:f}=u.getProductImagesStyles(C),q=d.getShapeByLayout({shape:C.shape,shapeForBottom:C.shapeForBottom,shapeFor1Col:C.shapeFor1Col,shapeFor2Col:C.shapeFor2Col,shapeForFtOnly:C.shapeForFtOnly,shapeForInsideBottom:C.shapeForInsideBottom,shapeForInside:C.shapeForInside},C.position),b=r.getLiquidImageSrcset({liquidSrc:"media.preview_image",sizeTarget:"GalleryList",qualityType:C.qualityType,qualityPercent:C.qualityPercent}),I=(i,t)=>e.template`${s.default({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:b,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:i,style:t,className:"!gp-rounded-none gp-w-full gp-h-full gp-top-0 gp-left-0 gp-cursor-pointer"})}`,w=e=>`
2
+ ${i.LiquidIf("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
3
+ ${i.LiquidIf("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
4
+ ${i.LiquidIf("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
5
+ ${t.default({id:"{{imageID}}",contentType:"productImage",className:`${h(`gp-gallery-image-item ${e??""}`)}`,parentId:`${m}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:f,children:`
6
6
  <div class="gp-w-full gp-relative gp-h-full"
7
7
 
8
8
  >
9
- ${I({aspectRatio:t.getAspectRatio(q),layout:C?.layout,qualityPercent:C?.qualityPercent,qualityType:C?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
9
+ ${I({aspectRatio:l.getAspectRatio(q),layout:C?.layout,qualityPercent:C?.qualityPercent,qualityType:C?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
10
10
 
11
- ${u.LiquidIf("media.media_type == 'video' or media.media_type == 'external_video'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
11
+ ${i.LiquidIf("media.media_type == 'video' or media.media_type == 'external_video'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
12
12
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
13
13
  <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
14
14
  <path d="M17.6869 12.2646L17.6868 12.2646L6.78379 18.4464C6.78378 18.4464 6.78376 18.4464 6.78374 18.4464C6.52931 18.5903 6.1665 18.4179 6.1665 18.0416V5.95844C6.1665 5.58218 6.52917 5.40981 6.7836 5.55354C6.78366 5.55357 6.78373 5.55361 6.78379 5.55365L17.6868 11.7354L17.6869 11.7354C17.8819 11.846 17.8819 12.154 17.6869 12.2646Z" stroke="#F9F9F9" stroke-miterlimit="10"/>
15
15
  </svg>
16
16
  </div>`)}
17
- ${u.LiquidIf("media.media_type == 'model'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
17
+ ${i.LiquidIf("media.media_type == 'model'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
18
18
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
19
19
  <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
20
20
  <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7441 4.57034C11.9017 4.47655 12.098 4.47655 12.2555 4.57034L18.5889 8.33957C18.7404 8.42971 18.8332 8.59296 18.8332 8.76923V15.2308C18.8332 15.407 18.7404 15.5703 18.5889 15.6604L12.2555 19.4297C12.098 19.5234 11.9017 19.5234 11.7441 19.4297L5.41079 15.6604C5.25932 15.5703 5.1665 15.407 5.1665 15.2308V8.76923C5.1665 8.59296 5.25932 8.42971 5.41079 8.33957L11.7441 4.57034ZM6.1665 9.64865V14.9465L11.4998 18.1206V12.8227L6.1665 9.64865ZM12.4998 12.8227V18.1206L17.8332 14.9465V9.64865L12.4998 12.8227ZM17.3555 8.76923L11.9998 11.9566L6.64417 8.76923L11.9998 5.58185L17.3555 8.76923Z" fill="#F9F9F9"/>
@@ -22,7 +22,7 @@
22
22
  </div>`)}
23
23
 
24
24
  <div class="gp-absolute gp-inset-0 gp-flex gp-cursor-pointer gp-items-center gp-justify-center gp-bg-black/50 gp-opacity-0 gp-transition-opacity gp-duration-100 group-hover:gp-opacity-100"
25
- style="${g.getStyleOfObject(i.getZoomDisplay(C?.clickOpenLightBox))}"
25
+ style="${a.getStyleOfObject(d.getZoomDisplay(C?.clickOpenLightBox))}"
26
26
  >
27
27
  <svg
28
28
  height="100%"
@@ -40,7 +40,7 @@
40
40
  </svg>
41
41
  </div>
42
42
  </div>
43
- `})}`,F=u.LiquidIf("product.media.size > 1",u.LiquidFor("media in product.media",`${u.LiquidIf("media.media_type == 'image'",u.LiquidFor("image in product.images",u.LiquidIf("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
- ${u.LiquidIf("media.id == product.featured_media.id ",w(C?.borderActive?.border!=="none"?"active":""),w())}`));return e.template`
45
- ${s.default({builderProps:{uid:m},rootId:`${m}-{{product.id}}`,rootClass:`${y}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:(()=>{let e=i.getCarouselVerticalConfigByPosition(C.position),t=[e.desktop?"gp-px-0":"gp-py-0",e.tablet?"tablet:gp-px-0":"tablet:gp-py-0",e.mobile?"mobile:gp-px-0":"mobile:gp-py-0"];return` ${t.join(" ")}`})(),slidesClass:i.getMinHeightByPosition(C.position,C.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:v,rootStyles:{...(()=>{let o=(i,t,o)=>{let r=e.getResponsiveValueByScreen(t,o),s=e.getResponsiveValueByScreen(i,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),l=["left","right","inside-left","inside-right"].includes(r??"");return l||a},r=i.checkDisplayGalleryByWidth({shapeByLayout:q}),s={desktop:r.desktop&&o(C.type,C.position,"desktop"),tablet:r.tablet&&o(C.type,C.position,"tablet"),mobile:r.mobile&&o(C.type,C.position,"mobile")};return t.getDisplayStyle(e=>!s[e],"flex")})()},styles:L,disableMarginAuto:!0,children:F,shouldInitByLayout:t.getGalleryCarouselShouldInitByLayout(C.position),carouselType:"feature_image_thumbs"})}
43
+ `})}`,F=i.LiquidIf("product.media.size > 1",i.LiquidFor("media in product.media",`${i.LiquidIf("media.media_type == 'image'",i.LiquidFor("image in product.images",i.LiquidIf("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
+ ${i.LiquidIf("media.id == product.featured_media.id ",w(C?.borderActive?.border!=="none"?"active":""),w())}`));return e.template`
45
+ ${o.default({builderProps:{uid:m},rootId:`${m}-{{product.id}}`,rootClass:`${y}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:(()=>{let e=d.getCarouselVerticalConfigByPosition(C.position),i=[e.desktop?"gp-px-0":"gp-py-0",e.tablet?"tablet:gp-px-0":"tablet:gp-py-0",e.mobile?"mobile:gp-px-0":"mobile:gp-py-0"];return` ${i.join(" ")}`})(),slidesClass:d.getMinHeightByPosition(C.position,C.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:v,rootStyles:{...(()=>{let i=(i,t,o)=>{let r=e.getResponsiveValueByScreen(t,o),s=e.getResponsiveValueByScreen(i,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),l=["left","right","inside-left","inside-right"].includes(r??"");return l||a},t=d.checkDisplayGalleryByWidth({shapeByLayout:q}),o={desktop:t.desktop&&i(C.type,C.position,"desktop"),tablet:t.tablet&&i(C.type,C.position,"tablet"),mobile:t.mobile&&i(C.type,C.position,"mobile")};return l.getDisplayStyle(e=>!o[e],"flex")})()},styles:L,disableMarginAuto:!0,children:F,shouldInitByLayout:l.getGalleryCarouselShouldInitByLayout(C.position),carouselType:"feature_image_thumbs"})}
46
46
  `};
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./common/classes.js"),e=require("@gem-sdk/core");exports.default=n=>{let{pageContext:a,children:o}=n,{productItemClass:r,gpProductClass:i}=t.getClass(n);return e.template`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "hasPreSelected": false, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${i}"
5
5
  >
6
6
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@gem-sdk/core"),e=require("./common/classes.js");exports.default=n=>{let{pageContext:a,rawChildren:o}=n,{productItemClass:r,gpProductClass:i}=e.getClass(n);return t.template`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "hasPreSelected": false, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${i}"
5
5
  >
6
6
  <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
@@ -1 +1 @@
1
- import{hasTranslatedLiquid as e,DEVICES as t,getResponsiveValueByScreen as r}from"@gem-sdk/core";import{isCannotResizeImageByQuery as i}from"./helpers.js";let l={mobile:768,tablet:1024,desktop:1440},a={Image:{desktop:1024,tablet:1024,mobile:480},HeroBanner:{desktop:1920,tablet:1280,mobile:768},ImageComparison:{desktop:1024,tablet:768,mobile:576},ProductFeatureImage:{desktop:1024,tablet:1024,mobile:576},GalleryList:{desktop:256,tablet:256,mobile:128},ArticleImage:{desktop:1024,tablet:768,mobile:480}},o="high",s={high:100,medium:70},n=["GalleryList"],d="original",m=/\s*%\s*$/,p=e=>{if("number"==typeof e)return e;let t=Number.parseFloat(String(e??"").replace(m,""));return Number.isFinite(t)?t:100},u=/^\{\{\s*([\s\S]*?)\s*\}\}$/,c=/\{\{|\{%/,b=e=>!!e&&e.includes("cdn.shopify")&&!i(e),f=({qualityType:e,qualityPercent:i})=>{if(!e&&!i)return;let l={};for(let a of t){let t=r(e,a,o)??o;if("finest"===t){l[a]=d;continue}let n="custom"===t?p(r(i,a,100)):s[t]??100;l[a]=(n>0?n:100)/100}return l},g=(e,t)=>{let r=e.match(u);return r?`{{ ${r[1]} | append: '?width=${t}' | replace: '?', '&' | replace_first: '&', '?' }}`:`${e}${e.includes("?")?"&":"?"}width=${t}`},h=({sizeTarget:e="Image",qualityType:i,qualityPercent:o})=>{let s=f({qualityType:i,qualityPercent:o}),m=a[e]??a.Image,p=!n.includes(e),u=e=>{let t=r(s,e,1)??1;return t===d?p?d:m[e]:Math.round(m[e]*t)};return t.map(e=>({device:e,width:u(e),descriptor:l[e]})).sort((e,t)=>e.descriptor-t.descriptor)},I=e=>e.every(e=>e.width===d),S=({src:t,resolvedSrc:r,sizeTarget:i,qualityType:l,qualityPercent:a})=>{if(!t)return;let o=u.test(t);if(!o&&c.test(t))return;let s=o?e(t)?r:void 0:t;if(!b(s))return;let n=h({sizeTarget:i,qualityType:l,qualityPercent:a});if(!I(n))return n.map(({width:e,descriptor:r})=>{let i=e===d?t:g(t,e);return`${i} ${r}w`}).join(", ")};export{d as ORIGINAL_QUALITY,l as SRCSET_DEVICE_DESCRIPTORS,a as SRCSET_TARGET_WIDTHS,g as appendWidthParam,b as canResizeByShopifyCdn,S as getImageSrcset,f as getQualityMultiplier,h as getSrcsetCandidates,I as isEveryCandidateOriginal};
1
+ import{hasTranslatedLiquid as e,DEVICES as t,getResponsiveValueByScreen as r}from"@gem-sdk/core";import{isCannotResizeImageByQuery as i}from"./helpers.js";let l={mobile:768,tablet:1024,desktop:1440},o={Image:{desktop:1024,tablet:1024,mobile:480},HeroBanner:{desktop:1920,tablet:1280,mobile:768},ImageComparison:{desktop:1024,tablet:768,mobile:576},ProductFeatureImage:{desktop:1024,tablet:1024,mobile:576},GalleryList:{desktop:256,tablet:256,mobile:256},ArticleImage:{desktop:1024,tablet:768,mobile:480}},a="high",s={high:100,medium:70},n="original",d=/\s*%\s*$/,m=e=>{if("number"==typeof e)return e;let t=Number.parseFloat(String(e??"").replace(d,""));return Number.isFinite(t)?t:100},p=/^\{\{\s*([\s\S]*?)\s*\}\}$/,u=/\{\{|\{%/,c=e=>!!e&&e.includes("cdn.shopify")&&!i(e),b=({qualityType:e,qualityPercent:i})=>{if(!e&&!i)return;let l={};for(let o of t){let t=r(e,o,a)??a;if("finest"===t){l[o]=n;continue}let d="custom"===t?m(r(i,o,100)):s[t]??100;l[o]=(d>0?d:100)/100}return l},f=(e,t)=>{let r=e.match(p);return r?`{{ ${r[1]} | append: '?width=${t}' | replace: '?', '&' | replace_first: '&', '?' }}`:`${e}${e.includes("?")?"&":"?"}width=${t}`},g=({sizeTarget:e="Image",qualityType:i,qualityPercent:a})=>{let s=b({qualityType:i,qualityPercent:a}),d=o[e]??o.Image,m=e=>{let t=r(s,e,1)??1;return t===n?n:Math.round(d[e]*t)};return t.map(e=>({device:e,width:m(e),descriptor:l[e]})).sort((e,t)=>e.descriptor-t.descriptor)},h=e=>e.every(e=>e.width===n),I=({src:t,resolvedSrc:r,sizeTarget:i,qualityType:l,qualityPercent:o})=>{if(!t)return;let a=p.test(t);if(!a&&u.test(t))return;let s=a?e(t)?r:void 0:t;if(!c(s))return;let d=g({sizeTarget:i,qualityType:l,qualityPercent:o});if(!h(d))return d.map(({width:e,descriptor:r})=>{let i=e===n?t:f(t,e);return`${i} ${r}w`}).join(", ")};export{n as ORIGINAL_QUALITY,l as SRCSET_DEVICE_DESCRIPTORS,o as SRCSET_TARGET_WIDTHS,f as appendWidthParam,c as canResizeByShopifyCdn,I as getImageSrcset,b as getQualityMultiplier,g as getSrcsetCandidates,h as isEveryCandidateOriginal};
@@ -1 +1 @@
1
- import{SEPARATOR as e}from"./constants.js";let t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/,"| escape }}"),o=e=>{if(null==e)return e;let o=e.toString();return t.test(o)?r(o):o.replaceAll("'","&#39;").replaceAll("’","&#39;").replaceAll('"',"&quot;")},a=e=>e?.enableIcon===!0,l=e=>({lineThrough:!1,typo:s(e?.priceTypo)}),i=e=>({lineThrough:!0,typo:s(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),c=({styles:e,setting:t})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:o(t?.label),outOfStockLabel:o(t?.outOfStockLabel),customURL:{link:o(t?.customURL?.link),target:t?.customURL?.target}},variantID:"{{variant.id}}",inStock:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),n=t=>({dot:e.DOT,"vertical-line":e.VERTICAL_LINE,"horizontal-line":e.HORIZONTAL_LINE})[t??"horizontal-line"]??e.HORIZONTAL_LINE,s=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);export{a as checkIconVisibility,o as escapeSingleQuoteForAttr,c as getGPProductButtonState,i as getRenderComparePriceSettings,l as getRenderRegularPriceSettings,n as renderSeparator};
1
+ import{SEPARATOR as e}from"./constants.js";let t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/," | escape }}"),o=e=>{if(null==e)return e;let o=e.toString();return t.test(o)?r(o):o.replaceAll("'","&#39;").replaceAll("’","&#39;").replaceAll('"',"&quot;")},a=e=>e?.enableIcon===!0,l=e=>({lineThrough:!1,typo:s(e?.priceTypo)}),i=e=>({lineThrough:!0,typo:s(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),c=({styles:e,setting:t})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:o(t?.label),outOfStockLabel:o(t?.outOfStockLabel),customURL:{link:o(t?.customURL?.link),target:t?.customURL?.target}},variantID:"{{variant.id}}",inStock:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),n=t=>({dot:e.DOT,"vertical-line":e.VERTICAL_LINE,"horizontal-line":e.HORIZONTAL_LINE})[t??"horizontal-line"]??e.HORIZONTAL_LINE,s=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);export{a as checkIconVisibility,o as escapeSingleQuoteForAttr,c as getGPProductButtonState,i as getRenderComparePriceSettings,l as getRenderRegularPriceSettings,n as renderSeparator};
@@ -1,20 +1,20 @@
1
- import{template as e,getResponsiveValueByScreen as t}from"@gem-sdk/core";import{getShapeByLayout as i,getMinHeightByPosition as o,getZoomDisplay as r,checkDisplayGalleryByWidth as s,getCarouselVerticalConfigByPosition as a}from"../../common/productGallery.js";import{getGalleryCarouselShouldInitByLayout as p,getAspectRatio as l,getDisplayStyle as d}from"../../common/common.js";import m from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";import{getProductImagesClassName as g}from"../../composables/getProductImagesClassName.js";import n from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import{getProductImagesStyles as c}from"../../composables/getProductImagesStyles.js";import{getLiquidImageSrcset as u}from"../../../../../image/common/liquidSrcset.js";import{getProductImagesAttr as C}from"../../composables/getProductImagesAttr.js";import h from"../../../../../image/components/NextImage.liquid.js";import{getStyleOfObject as y}from"../../../../helpers/function.js";import{LiquidIf as v,LiquidFor as f}from"@gem-sdk/system";let b=({builderPropUID:b,children:w,pageContext:L,...F})=>{let{featuredImageGalleryClasses:x,galleryItemClasses:$}=g(F),{galleryCarouselSettingAttrs:I}=C(F),{galleryCarouselStyle:_,galleryCarouselItemStyle:q}=c(F),j=i({shape:F.shape,shapeForBottom:F.shapeForBottom,shapeFor1Col:F.shapeFor1Col,shapeFor2Col:F.shapeFor2Col,shapeForFtOnly:F.shapeForFtOnly,shapeForInsideBottom:F.shapeForInsideBottom,shapeForInside:F.shapeForInside},F.position),k=u({liquidSrc:"media.preview_image",sizeTarget:"GalleryList",qualityType:F.qualityType,qualityPercent:F.qualityPercent}),V=(t,i)=>e`${h({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:k,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:t,style:i,className:"!gp-rounded-none gp-w-full gp-h-full gp-top-0 gp-left-0 gp-cursor-pointer"})}`,M=e=>`
2
- ${v("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
3
- ${v("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
4
- ${v("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
5
- ${m({id:"{{imageID}}",contentType:"productImage",className:`${$(`gp-gallery-image-item ${e??""}`)}`,parentId:`${b}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:q,children:`
1
+ import{template as e,getResponsiveValueByScreen as t}from"@gem-sdk/core";import{LiquidIf as i,LiquidFor as o}from"@gem-sdk/system";import r from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";import s from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import{getLiquidImageSrcset as a}from"../../../../../image/common/liquidSrcset.js";import p from"../../../../../image/components/NextImage.liquid.js";import{getStyleOfObject as l}from"../../../../helpers/function.js";import{getGalleryCarouselShouldInitByLayout as d,getAspectRatio as m,getDisplayStyle as g}from"../../common/common.js";import{getShapeByLayout as n,getMinHeightByPosition as c,getZoomDisplay as u,checkDisplayGalleryByWidth as C,getCarouselVerticalConfigByPosition as h}from"../../common/productGallery.js";import{getProductImagesAttr as y}from"../../composables/getProductImagesAttr.js";import{getProductImagesClassName as v}from"../../composables/getProductImagesClassName.js";import{getProductImagesStyles as f}from"../../composables/getProductImagesStyles.js";let b=({builderPropUID:b,children:w,pageContext:L,...F})=>{let{featuredImageGalleryClasses:x,galleryItemClasses:$}=v(F),{galleryCarouselSettingAttrs:I}=y(F),{galleryCarouselStyle:_,galleryCarouselItemStyle:q}=f(F),j=n({shape:F.shape,shapeForBottom:F.shapeForBottom,shapeFor1Col:F.shapeFor1Col,shapeFor2Col:F.shapeFor2Col,shapeForFtOnly:F.shapeForFtOnly,shapeForInsideBottom:F.shapeForInsideBottom,shapeForInside:F.shapeForInside},F.position),k=a({liquidSrc:"media.preview_image",sizeTarget:"GalleryList",qualityType:F.qualityType,qualityPercent:F.qualityPercent}),V=(t,i)=>e`${p({srcIsLiquidCode:!0,src:"{{media.preview_image | image_url}}",srcset:k,width:"{{media.width}}",height:"{{media.height}}",alt:"{{media.alt | escape}}",setting:t,style:i,className:"!gp-rounded-none gp-w-full gp-h-full gp-top-0 gp-left-0 gp-cursor-pointer"})}`,M=e=>`
2
+ ${i("media.media_type == 'video'","{% assign mediaSourceUrl = media.sources.last.url %}")}
3
+ ${i("media.media_type == 'external_video'","{% assign mediaSourceUrl = media | external_video_url %}")}
4
+ ${i("media.media_type == 'image'","{% assign mediaSourceUrl = media.src %}")}
5
+ ${r({id:"{{imageID}}",contentType:"productImage",className:`${$(`gp-gallery-image-item ${e??""}`)}`,parentId:`${b}-{{product.id}}`,builderAttrs:{"data-outline":e?"active":"deactive"},style:q,children:`
6
6
  <div class="gp-w-full gp-relative gp-h-full"
7
7
 
8
8
  >
9
- ${V({aspectRatio:l(j),layout:F?.layout,qualityPercent:F?.qualityPercent,qualityType:F?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
9
+ ${V({aspectRatio:m(j),layout:F?.layout,qualityPercent:F?.qualityPercent,qualityType:F?.qualityType},{width:"100%",height:"100%",cursor:"pointer"})}
10
10
 
11
- ${v("media.media_type == 'video' or media.media_type == 'external_video'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
11
+ ${i("media.media_type == 'video' or media.media_type == 'external_video'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
12
12
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
13
13
  <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
14
14
  <path d="M17.6869 12.2646L17.6868 12.2646L6.78379 18.4464C6.78378 18.4464 6.78376 18.4464 6.78374 18.4464C6.52931 18.5903 6.1665 18.4179 6.1665 18.0416V5.95844C6.1665 5.58218 6.52917 5.40981 6.7836 5.55354C6.78366 5.55357 6.78373 5.55361 6.78379 5.55365L17.6868 11.7354L17.6869 11.7354C17.8819 11.846 17.8819 12.154 17.6869 12.2646Z" stroke="#F9F9F9" stroke-miterlimit="10"/>
15
15
  </svg>
16
16
  </div>`)}
17
- ${v("media.media_type == 'model'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
17
+ ${i("media.media_type == 'model'",`<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
18
18
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
19
19
  <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
20
20
  <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7441 4.57034C11.9017 4.47655 12.098 4.47655 12.2555 4.57034L18.5889 8.33957C18.7404 8.42971 18.8332 8.59296 18.8332 8.76923V15.2308C18.8332 15.407 18.7404 15.5703 18.5889 15.6604L12.2555 19.4297C12.098 19.5234 11.9017 19.5234 11.7441 19.4297L5.41079 15.6604C5.25932 15.5703 5.1665 15.407 5.1665 15.2308V8.76923C5.1665 8.59296 5.25932 8.42971 5.41079 8.33957L11.7441 4.57034ZM6.1665 9.64865V14.9465L11.4998 18.1206V12.8227L6.1665 9.64865ZM12.4998 12.8227V18.1206L17.8332 14.9465V9.64865L12.4998 12.8227ZM17.3555 8.76923L11.9998 11.9566L6.64417 8.76923L11.9998 5.58185L17.3555 8.76923Z" fill="#F9F9F9"/>
@@ -22,7 +22,7 @@ import{template as e,getResponsiveValueByScreen as t}from"@gem-sdk/core";import{
22
22
  </div>`)}
23
23
 
24
24
  <div class="gp-absolute gp-inset-0 gp-flex gp-cursor-pointer gp-items-center gp-justify-center gp-bg-black/50 gp-opacity-0 gp-transition-opacity gp-duration-100 group-hover:gp-opacity-100"
25
- style="${y(r(F?.clickOpenLightBox))}"
25
+ style="${l(u(F?.clickOpenLightBox))}"
26
26
  >
27
27
  <svg
28
28
  height="100%"
@@ -40,7 +40,7 @@ import{template as e,getResponsiveValueByScreen as t}from"@gem-sdk/core";import{
40
40
  </svg>
41
41
  </div>
42
42
  </div>
43
- `})}`,P=v("product.media.size > 1",f("media in product.media",`${v("media.media_type == 'image'",f("image in product.images",v("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
- ${v("media.id == product.featured_media.id ",M(F?.borderActive?.border!=="none"?"active":""),M())}`));return e`
45
- ${n({builderProps:{uid:b},rootId:`${b}-{{product.id}}`,rootClass:`${x}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:(()=>{let e=a(F.position),t=[e.desktop?"gp-px-0":"gp-py-0",e.tablet?"tablet:gp-px-0":"tablet:gp-py-0",e.mobile?"mobile:gp-px-0":"mobile:gp-py-0"];return` ${t.join(" ")}`})(),slidesClass:o(F.position,F.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:I,rootStyles:{...(()=>{let e=(e,i,o)=>{let r=t(i,o),s=t(e,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),p=["left","right","inside-left","inside-right"].includes(r??"");return p||a},i=s({shapeByLayout:j}),o={desktop:i.desktop&&e(F.type,F.position,"desktop"),tablet:i.tablet&&e(F.type,F.position,"tablet"),mobile:i.mobile&&e(F.type,F.position,"mobile")};return d(e=>!o[e],"flex")})()},styles:_,disableMarginAuto:!0,children:P,shouldInitByLayout:p(F.position),carouselType:"feature_image_thumbs"})}
43
+ `})}`,P=i("product.media.size > 1",o("media in product.media",`${i("media.media_type == 'image'",o("image in product.images",i("image.src == media.src","{% assign imageID = image.id %}{% break %}")),"{% assign imageID = '' %}")}
44
+ ${i("media.id == product.featured_media.id ",M(F?.borderActive?.border!=="none"?"active":""),M())}`));return e`
45
+ ${s({builderProps:{uid:b},rootId:`${b}-{{product.id}}`,rootClass:`${x}`,rootAttrs:{type:"grid-carousel","product-media":"{{product.media.size}}"},wrapperClass:(()=>{let e=h(F.position),t=[e.desktop?"gp-px-0":"gp-py-0",e.tablet?"tablet:gp-px-0":"tablet:gp-py-0",e.mobile?"mobile:gp-px-0":"mobile:gp-py-0"];return` ${t.join(" ")}`})(),slidesClass:c(F.position,F.navigationPosition),isHiddenArrowWhenDisabled:!0,setting:I,rootStyles:{...(()=>{let e=(e,i,o)=>{let r=t(i,o),s=t(e,o),a="slider"===s&&("bottom-center"===r||"inside-bottom"===r),p=["left","right","inside-left","inside-right"].includes(r??"");return p||a},i=C({shapeByLayout:j}),o={desktop:i.desktop&&e(F.type,F.position,"desktop"),tablet:i.tablet&&e(F.type,F.position,"tablet"),mobile:i.mobile&&e(F.type,F.position,"mobile")};return g(e=>!o[e],"flex")})()},styles:_,disableMarginAuto:!0,children:P,shouldInitByLayout:d(F.position),carouselType:"feature_image_thumbs"})}
46
46
  `};export{b as default};
@@ -1,14 +1,14 @@
1
- import{getClass as t}from"./common/classes.js";import{template as n}from"@gem-sdk/core";let o=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=t(o);return n`
1
+ import{getClass as t}from"./common/classes.js";import{template as n}from"@gem-sdk/core";let e=e=>{let{pageContext:a,children:o}=e,{productItemClass:r,gpProductClass:i}=t(e);return n`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "hasPreSelected": false, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${i}"
5
5
  >
6
- <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(e)}}</script>
6
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
7
7
  {%- form 'product', product, id: product_form_id, class: 'form contents ${r}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
8
8
  <input type="hidden" name="id" value="{{ variant.id }}" />
9
9
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
10
10
  <button type="submit" onclick="return false;" style="display:none;"></button>
11
- ${a}
11
+ ${o}
12
12
  {%- endform -%}
13
13
  </gp-product>
14
- `};export{o as default};
14
+ `};export{e as default};
@@ -1,18 +1,18 @@
1
- import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let o=o=>{let{pageContext:a,rawChildren:r}=o,{productItemClass:i,gpProductClass:c}=e(o);return t`
1
+ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as e}from"./common/classes.js";let a=a=>{let{pageContext:o,rawChildren:r}=a,{productItemClass:i,gpProductClass:c}=e(a);return t`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
3
+ gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "hasPreSelected": false, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "formId": "{{ product_form_id }}"}'
4
4
  class="${c}"
5
5
  >
6
- <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(a)}}</script>
6
+ <script gp-data type="application/json">{"variantSelected": {{ variant | json }}, "quantity": 1, "productUrl":{{ product.url | json }}, "productHandle":{{ product.handle | json }}, "collectionUrl": {{ collection.url | json }}, "collectionHandle": {{ collection.handle | json }},"pageContext" : ${JSON.stringify(o)}}</script>
7
7
  {%- form 'product', product, id: product_form_id, class: 'form contents ${i}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
8
8
  <input type="hidden" name="id" value="{{ variant.id }}" />
9
9
  <input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
10
10
  <button type="submit" onclick="return false;" style="display:none;"></button>
11
11
  ${t`
12
- ${r?.map((e,o)=>{if(e)return t`
13
- ${n({...e,index:o})}
12
+ ${r?.map((e,a)=>{if(e)return t`
13
+ ${n({...e,index:a})}
14
14
  `}).join("")}
15
15
  `}
16
16
  {%- endform -%}
17
17
  </gp-product>
18
- `};export{o as default};
18
+ `};export{a as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "24.0.0-staging.13",
3
+ "version": "24.0.0-staging.15",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -19,7 +19,7 @@
19
19
  "post:publish": "node ./scripts/convert-publish.js",
20
20
  "pre:publish": "node ./scripts/convert-publish.js -p",
21
21
  "relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/element-relationship/index.js",
22
- "test": "jest -c ./../../helpers/jest.config.ts && yarn test:data",
22
+ "test": "jest -c ./../../helpers/jest.config.ts --testPathIgnorePatterns data.liquid.test && yarn test:data",
23
23
  "test:data": "NODE_OPTIONS=--experimental-vm-modules GP_BASE_ASSET_URL=https://assets.gemcommerce.xyz jest -c ./../../helpers/jest.config.ts --testPathPatterns data.liquid.test",
24
24
  "test:data:update": "yarn test:data -u",
25
25
  "test:watch": "jest -c ./../../helpers/jest.config.ts --watch",