@gem-sdk/components 23.0.0-dev.11 → 23.0.0-dev.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.
Files changed (26) hide show
  1. package/dist/cjs/carousel-v3/components/root/CarouselEmbla.liquid.js +4 -4
  2. package/dist/cjs/image/settings/configs/ui-v2.js +1 -1
  3. package/dist/cjs/post-purchase/product/components/ProductPrice.js +1 -1
  4. package/dist/cjs/post-purchase/product/components/ProductQuantity.js +1 -1
  5. package/dist/cjs/post-purchase/product/hooks/useHandleQuantity.js +1 -1
  6. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  7. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/ui-v2.js +1 -1
  8. package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +1 -1
  9. package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +1 -1
  10. package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +1 -1
  11. package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +1 -1
  12. package/dist/cjs/product/components/product-wrap/Product.liquid.js +1 -1
  13. package/dist/esm/carousel-v3/components/root/CarouselEmbla.liquid.js +6 -6
  14. package/dist/esm/image/settings/configs/ui-v2.js +1 -1
  15. package/dist/esm/post-purchase/product/components/ProductPrice.js +1 -1
  16. package/dist/esm/post-purchase/product/components/ProductQuantity.js +1 -1
  17. package/dist/esm/post-purchase/product/hooks/useHandleQuantity.js +1 -1
  18. package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  19. package/dist/esm/post-purchase/product/settings/product-quantity/configs/ui-v2.js +1 -1
  20. package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +1 -1
  21. package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +5 -5
  22. package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +1 -1
  23. package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +5 -5
  24. package/dist/esm/product/components/product-wrap/Product.liquid.js +1 -1
  25. package/dist/types/index.d.ts +4 -2
  26. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),r=require("../../../helpers.js"),t=require("../arrow/common/helpers.js"),s=require("./common/classes.js"),o=require("./common/helpers.js"),a=require("./common/styles.js"),i=require("../arrow/Arrow.liquid.js"),l=require("./common/attrs.js"),d=require("../dot/Dots.liquid.js");exports.default=n=>{let{children:c,builderAttrs:p,builderProps:u,styles:v,isHiddenArrowWhenDisabled:g=!0,hiddenDotWhenOnlyOne:m,rootId:$,rawChildren:S,conditionAppendJs:h,productBadgeLiquid:w}=n,y=t.mappingNavigationCarousel(n.setting),f={...n,setting:y},{arrowButtonSize:C,arrowBackgroundColor:j,arrowGapToEachSide:q="16",roundedArrow:b,arrowIconSize:k,arrowCustomColor:P,arrowBorder:A,arrowShadow:D,showWhenHover:E}=y??{},{uniqueComponentId:I,loopConfig:R,arrowShowConfig:_,stateData:x}=o.getData(f),{rootClassRender:G,wrapperClassRender:O,wrapperInnerClass:T,sliderClass:W}=s.getClass(f),{sliderWrapperStyle:z,rootStyleRender:B,wrapperStyleRender:L,wrapperInnerStyle:H}=a.getStyle(f),{rootAttrRender:M,sliderAttr:N}=l.getAttr(f),U=()=>e.RenderIf(e.isLocalEnv,`<script ${r.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-carousel-v3-embla-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${r.getSettingPreloadData('class="gps-link" delay',"src")}="${e.baseAssetURL}/assets-v2/gp-carousel-v3-embla-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`),V=e=>i.default({uid:u?.uid,componentId:I,custom:y?.arrowCustom??"",showArrow:_,arrowButtonSize:C||{},arrowIconSize:k||{},arrowBackgroundColor:j??"",arrowCustomColor:P,gapToEachSize:q,showWhenHover:E,arrowBorder:A||{},arrowCorner:b||{},arrowShadow:D||{},left:"next"!==e,onClick:e=>{e.stopPropagation()},vertical:y?.vertical,isHiddenWhenDisabled:g,rootId:$});return e.template`
2
- <gp-carousel-v3 ${M} style="${B}" class="${G}">
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),r=require("../../../helpers.js"),t=require("../arrow/common/helpers.js"),s=require("./common/classes.js"),o=require("./common/helpers.js"),a=require("./common/styles.js"),i=require("../arrow/Arrow.liquid.js"),l=require("./common/attrs.js"),d=require("../dot/Dots.liquid.js");exports.default=n=>{let{children:c,builderAttrs:p,builderProps:u,styles:v,isHiddenArrowWhenDisabled:g=!0,hiddenDotWhenOnlyOne:$,rootId:m,rawChildren:S,conditionAppendJs:h,productBadgeLiquid:w}=n,y=t.mappingNavigationCarousel(n.setting),f={...n,setting:y},{arrowButtonSize:C,arrowBackgroundColor:j,arrowGapToEachSide:q="16",roundedArrow:k,arrowIconSize:P,arrowCustomColor:A,arrowBorder:D,arrowShadow:E,showWhenHover:I}=y??{},{uniqueComponentId:b,loopConfig:R,arrowShowConfig:_,stateData:x}=o.getData(f),{rootClassRender:G,wrapperClassRender:O,wrapperInnerClass:T,sliderClass:W}=s.getClass(f),{sliderWrapperStyle:z,rootStyleRender:B,wrapperStyleRender:L,wrapperInnerStyle:H}=a.getStyle(f),{rootAttrRender:M,sliderAttr:N}=l.getAttr(f),U=()=>e.RenderIf(e.isLocalEnv,`<script ${r.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-carousel-v4-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${r.getSettingPreloadData('class="gps-link" delay',"src")}="${e.baseAssetURL}/assets-v2/gp-carousel-v4-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`),V=e=>i.default({uid:u?.uid,componentId:b,custom:y?.arrowCustom??"",showArrow:_,arrowButtonSize:C||{},arrowIconSize:P||{},arrowBackgroundColor:j??"",arrowCustomColor:A,gapToEachSize:q,showWhenHover:I,arrowBorder:D||{},arrowCorner:k||{},arrowShadow:E||{},left:"next"!==e,onClick:e=>{e.stopPropagation()},vertical:y?.vertical,isHiddenWhenDisabled:g,rootId:m});return e.template`
2
+ <gp-carousel-v4 ${M} style="${B}" class="${G}">
3
3
  <script gp-data type="application/json">${x}</script>
4
4
  <div
5
5
  ${p}
@@ -17,9 +17,9 @@
17
17
  </div>
18
18
  ${V("next")}
19
19
  </div>
20
- ${d.default({loop:R,showDots:y?.dot,dotStyle:y?.dotStyle,dotGapToCarousel:y?.dotGapToCarousel,vertical:y?.vertical,uniqueComponentId:I,hiddenWhenOnlyOne:m})}
20
+ ${d.default({loop:R,showDots:y?.dot,dotStyle:y?.dotStyle,dotGapToCarousel:y?.dotGapToCarousel,vertical:y?.vertical,uniqueComponentId:b,hiddenWhenOnlyOne:$})}
21
21
  </div>
22
- </gp-carousel-v3>
22
+ </gp-carousel-v4>
23
23
  ${h?`{% if ${h} %} ${U()} {% endif %}`:U()}
24
24
 
25
25
  `};
@@ -1 +1 @@
1
- "use strict";exports.SettingUIV2=[{label:"Style",controls:[{setting:{id:"imageStyle"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"square",shapeValue:"1/1",shapeLinked:!0,width:"80px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"9999px",btrr:"9999px",bbrr:"9999px",btlr:"9999px",radiusType:"circle"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"original",shapeValue:"",width:"100%"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"0px",btrr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{label:"Source",controls:[{conditionDisplay:"isAdaptive === false",setting:{id:"image"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{conditionDisplay:"isAdaptive === true",setting:{id:"srcSet"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{label:"Scale",setting:{id:"objectFit"},conditionDisplay:'shape.shape !== "original"'}]},{label:"Size",hiddenOnMobile:!0,controls:[{setting:{id:"shape"},layout:"vertical"}]},{label:"Shape",hiddenOnMobile:!0,controls:[{label:"Border",controlConfig:{id:"border",type:"border-v2",linkWithSetting:{name:"wrapperBorder"}}},{label:"Corner",controlConfig:{id:"corner",type:"corner-v2",linkWithSetting:{name:"borderRadius"}}},{label:"Shadow",setting:{id:"shadow"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadow.enable === true",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!0}},{condition:"shadow.enable === false",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:"Link",setting:{id:"enableImageLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableImageLink == true'},{setting:{id:"imageLink"},conditionDisplay:"enableImageLink === true",layout:"vertical"}]},{label:"SEO",hiddenOnMobile:!0,controls:[{type:"combo",label:"Alt text",iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:"Content",setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:"Image title",iconName:"polaris-text-block",getValueFromSettingID:"title",isHideClear:!0,compoDefaultValue:"Title",controls:[{label:"Content",setting:{id:"title"},layout:"vertical"}]}]},{label:"Optimize LCP",conditionDisplay:'pageType !== "STATIC"',hiddenOnMobile:!0,controls:[{label:"Preload",setting:{id:"priority"}},{label:"Quality",setting:{id:"qualityType"},options:{disableMessage:"This setting only works with images uploaded to Shopify"},conditionEnable:"(activeScreenId === \"desktop\" && srcSet?.src && srcSet.src.includes('cdn.shopify.com')) || (activeScreenId === \"tablet\" && srcSet?.src && srcSet.src.includes('cdn.shopify.com')) || (activeScreenId === \"mobile\" && srcSet?.src && srcSet.src.includes('cdn.shopify.com'))"},{layout:"horizontal",label:"Quality",conditionDisplay:'qualityType == "custom" && ((activeScreenId === "desktop" && srcSet?.src && srcSet.src.includes("cdn.shopify.com")) || (activeScreenId === "tablet" && srcSet?.src && srcSet.src.includes("cdn.shopify.com")) || (activeScreenId === "mobile" && srcSet?.src && srcSet.src.includes("cdn.shopify.com")))',setting:{id:"qualityPercent"}}]},{controls:[{label:"Align",hiddenOnMobile:!0,setting:{id:"align"},conditionEnable:'!(shape.width === "default" || (parseInt(shape.width) >= 100 && shape.width?.includes("%")))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];
1
+ "use strict";const e="(isAdaptive === false ? image?.src : srcSet?.src)?.includes('cdn.shopify.com') === true",t=[{label:"Style",controls:[{setting:{id:"imageStyle"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"square",shapeValue:"1/1",shapeLinked:!0,width:"80px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"9999px",btrr:"9999px",bbrr:"9999px",btlr:"9999px",radiusType:"circle"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"original",shapeValue:"",width:"100%"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"0px",btrr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{label:"Source",controls:[{conditionDisplay:"isAdaptive === false",setting:{id:"image"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{conditionDisplay:"isAdaptive === true",setting:{id:"srcSet"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{label:"Scale",setting:{id:"objectFit"},conditionDisplay:'shape.shape !== "original"'}]},{label:"Size",hiddenOnMobile:!0,controls:[{setting:{id:"shape"},layout:"vertical"}]},{label:"Shape",hiddenOnMobile:!0,controls:[{label:"Border",controlConfig:{id:"border",type:"border-v2",linkWithSetting:{name:"wrapperBorder"}}},{label:"Corner",controlConfig:{id:"corner",type:"corner-v2",linkWithSetting:{name:"borderRadius"}}},{label:"Shadow",setting:{id:"shadow"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadow.enable === true",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!0}},{condition:"shadow.enable === false",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:"Link",setting:{id:"enableImageLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableImageLink == true'},{setting:{id:"imageLink"},conditionDisplay:"enableImageLink === true",layout:"vertical"}]},{label:"SEO",hiddenOnMobile:!0,controls:[{type:"combo",label:"Alt text",iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:"Content",setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:"Image title",iconName:"polaris-text-block",getValueFromSettingID:"title",isHideClear:!0,compoDefaultValue:"Title",controls:[{label:"Content",setting:{id:"title"},layout:"vertical"}]}]},{label:"Optimize LCP",conditionDisplay:'pageType !== "STATIC"',hiddenOnMobile:!0,controls:[{label:"Preload",setting:{id:"priority"}},{label:"Quality",setting:{id:"qualityType"},options:{disableMessage:"This setting only works with images uploaded to Shopify"},conditionEnable:e},{layout:"horizontal",label:"Quality",conditionDisplay:`qualityType == "custom" && ${e}`,setting:{id:"qualityPercent"}}]},{controls:[{label:"Align",hiddenOnMobile:!0,setting:{id:"align"},conditionEnable:'!(shape.width === "default" || (parseInt(shape.width) >= 100 && shape.width?.includes("%")))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];exports.SettingUIV2=t;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),i=require("../helpers/product-price-breakdown/getPrice.js"),s=require("../hooks/useSubscriptionSellingType.js"),o=require("../../../common/components/TooltipHover.js"),t=require("../hooks/useDynamicProduct.js"),l=require("../../text/components/Text.js"),n=require("react");exports.default=({styles:u,style:p,builderAttrs:a,builderProps:c,children:d,setting:g})=>{let m=r.useCurrentVariant(),f=r.useProduct(),{isOneTime:P}=s.useSubscriptionSellingType(),h=r.useProductStore(e=>e.selectedSellingPlan),y=r.convertDecimalToNumber(m?.price)??0,x=r.convertDecimalToNumber(m?.salePrice)??0,b=parseFloat(r.shopifyPriceRounding(r.useProductOfferDiscount(),2)),{isDynamicProduct:j}=t.useDynamicProduct(),{t:N}=r.useI18nStore(),{isEditMode:S}=r.useRenderMode(),{priceType:D,source:q}=g??{},v="compare"===D,M="offer"===D,T="price"===q,k="compare-price"===q,F=m?.sellingPlanGroups,R=f?.sellingPlanGroups,O=n.useMemo(()=>{if(!h||P)return null;let e=m?.sellingPlanGroups??f?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===h)return e}return null},[JSON.stringify(F),JSON.stringify(R),h,P]),w=JSON.stringify(O?.pricingPolicies),G=O?.baseID,I=n.useMemo(()=>!O||y<=0||P?0:i.calculateSellingPlanDiscount({variantPrice:y,pricingPolicies:O.pricingPolicies}),[w,y,P]),J=n.useMemo(()=>{let e=M&&!P&&h&&G;if(e){let e=parseFloat(r.shopifyPriceRounding(y-I,2)),i=parseFloat(r.shopifyPriceRounding(e-b,2));return i>0?i:0}let i=parseFloat(r.shopifyPriceRounding(y-b,2));return i>0?i:0},[M,P,h,G,y,I,b]),$=n.useMemo(()=>v?T?y:x:M?J:y,[v,T,M,y,x,J]),_=r.useFormatMoney(parseFloat(r.shopifyPriceRounding(Number($)||0,2)),!1),C=f?.baseID?.replace("gid://shopify/Product/",""),H=n.useMemo(()=>v&&(!b&&x<y||k&&!x||T&&y<=0),[v,b,y,x,k,T]);return(!$&&!M||H)&&S?e.jsx(o.default,{enable:!0,text:N("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e.jsx("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:N("No compare price")})})}):H&&!S?null:e.jsxs("div",{...a,className:r.cls(c?.uid),style:{...p},id:`shopify-text-element-${c?.uid}`,"data-product-id":C,children:[e.jsx(l.default,{styles:u,setting:{text:j?"$???":_},className:r.cls({"gp-money":M,"gp-product-compare-price":v,"gp-line-through":v&&u?.lineThrough})}),d]})};
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@gem-sdk/core"),i=require("../helpers/product-price-breakdown/getPrice.js"),s=require("../hooks/useSubscriptionSellingType.js"),o=require("../../../common/components/TooltipHover.js"),t=require("../hooks/useDynamicProduct.js"),l=require("../../text/components/Text.js"),n=require("react");exports.default=({styles:u,style:a,builderAttrs:p,builderProps:c,children:d,setting:g})=>{let f=r.useCurrentVariant(),m=r.useProduct(),{isOneTime:h}=s.useSubscriptionSellingType(),y=r.useProductStore(e=>e.selectedSellingPlan),P=r.convertDecimalToNumber(f?.price)??0,x=r.convertDecimalToNumber(f?.salePrice)??0,b=r.useProductOfferDiscount(),j=parseFloat(r.shopifyPriceRounding(b,2)),{isDynamicProduct:N}=t.useDynamicProduct(),{t:S}=r.useI18nStore(),{isEditMode:M}=r.useRenderMode(),{quantity:D,hasUpdatePrice:F}=r.useQuantity(),{priceType:R,source:q}=g??{},v=n.useMemo(()=>F&&D||1,[D,F]),T="compare"===R,k="offer"===R,O="price"===q,w="compare-price"===q,G=f?.sellingPlanGroups,I=m?.sellingPlanGroups,J=n.useMemo(()=>{if(!y||h)return null;let e=f?.sellingPlanGroups??m?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===y)return e}return null},[JSON.stringify(G),JSON.stringify(I),y,h]),$=JSON.stringify(J?.pricingPolicies),_=J?.baseID,C=n.useMemo(()=>!J||P<=0||h?0:i.calculateSellingPlanDiscount({variantPrice:P,pricingPolicies:J.pricingPolicies}),[$,P,h]),H=n.useMemo(()=>{let e=k&&!h&&y&&_;if(e){let e=parseFloat(r.shopifyPriceRounding(P-C,2)),i=parseFloat(r.shopifyPriceRounding(e-j,2));return i>0?i:0}let i=parseFloat(r.shopifyPriceRounding(P-j,2));return i>0?i:0},[k,h,y,_,P,C,j]),Q=n.useMemo(()=>T?O?P:x:k?H:P,[T,O,k,P,x,H]),V=n.useMemo(()=>{if(!k)return Q*v;let e=y&&!h&&_?parseFloat(r.shopifyPriceRounding(P-C,2)):P,i=parseFloat(r.shopifyPriceRounding(e*v,2)),s=parseFloat(r.shopifyPriceRounding(b*v,2));return Math.max(0,parseFloat(r.shopifyPriceRounding(i-s,2)))},[k,Q,v,P,b,C,y,_,h]),z=r.useFormatMoney(parseFloat(r.shopifyPriceRounding(Number(V)||0,2)),!1),A=m?.baseID?.replace("gid://shopify/Product/",""),B=n.useMemo(()=>T&&(!j&&x<P||w&&!x||O&&P<=0),[T,j,P,x,w,O]);return(!Q&&!k||B)&&M?e.jsx(o.default,{enable:!0,text:S("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e.jsx("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:S("No compare price")})})}):B&&!M?null:e.jsxs("div",{...p,className:r.cls(c?.uid),style:{...a},id:`shopify-text-element-${c?.uid}`,"data-product-id":A,children:[e.jsx(l.default,{styles:u,setting:{text:N?"$???":z},className:r.cls({"gp-money":k,"gp-product-compare-price":T,"gp-line-through":T&&u?.lineThrough})}),d]})};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("../helpers/product-quantity/getClasses.js"),a=require("../helpers/product-quantity/getStyles.js"),r=require("../hooks/useHandleQuantity.js"),l=require("@gem-sdk/system");exports.default=({setting:u={},styles:n={}})=>{let{inputWidth:i,align:c}=n,{quantity:p,setQuantity:d}=s.useQuantity(),{value:o,onBlurInput:C,onChangeInput:m}=r.useHandleQuantity(p,d,u),y=s.useCurrentVariantInStock(),g=l.createClass(t.getWrapperClasses(c)),j=l.createClass(t.getContainerClasses()),h=l.createClass(t.getWrapperInputClasses()),q=l.createClass(t.getLabelClasses()),x=l.createClass(t.getInputClasses()),v=l.createStyle({...a.getWrapperStyles(i)});return e.jsx("div",{className:g,children:e.jsx("div",{className:j,style:{...v},children:e.jsxs("div",{className:h,children:[e.jsx("label",{htmlFor:"input",className:q,children:u.title||"Quantity"}),e.jsx("input",{disabled:!y,autoComplete:"off",name:"Select Option",className:x,type:"number",value:o,min:1,onBlur:C,onChange:m})]})})})};
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("../helpers/product-quantity/getClasses.js"),a=require("../helpers/product-quantity/getStyles.js"),r=require("../hooks/useHandleQuantity.js"),l=require("@gem-sdk/system"),u=require("react");exports.default=({setting:i={},styles:n={}})=>{let{inputWidth:c,align:p}=n,{updatePrice:d=!1}=i,{quantity:o,setQuantity:C,setUpdatePrice:m}=s.useQuantity(),{value:y,onBlurInput:g,onChangeInput:j}=r.useHandleQuantity(o,C,i),h=s.useCurrentVariantInStock(),q=l.createClass(t.getWrapperClasses(p)),x=l.createClass(t.getContainerClasses()),f=l.createClass(t.getWrapperInputClasses()),v=l.createClass(t.getLabelClasses()),b=l.createClass(t.getInputClasses()),N=l.createStyle({...a.getWrapperStyles(c)});return u.useEffect(()=>(m(d),()=>m(!1)),[d,m]),e.jsx("div",{className:q,children:e.jsx("div",{className:x,style:{...N},children:e.jsxs("div",{className:f,children:[e.jsx("label",{htmlFor:"input",className:v,children:i.title||"Quantity"}),e.jsx("input",{disabled:!h,autoComplete:"off",name:"Select Option",className:b,type:"number",value:y,min:1,step:1,onBlur:g,onChange:j})]})})})};
@@ -1 +1 @@
1
- "use strict";var e=require("@gem-sdk/core"),t=require("react");exports.useHandleQuantity=(u,r,a)=>{let n=e.useIsSyncProduct(),s=e.useProduct(),i=a?.defaultQtyValue??1,[d,l]=t.useState(""),o=t.useCallback(e=>{let t=e.detail,a=s?.id;n&&t&&a==t.productId&&u!=t.quantity&&r(t.quantity)},[n,s?.id,u,r]);return t.useEffect(()=>(window.addEventListener("set-product-quantity",o),()=>{window.removeEventListener("set-product-quantity",o)}),[o]),t.useEffect(()=>{r(parseFloat(`${i}`)),l(`${i}`)},[r,i]),t.useEffect(()=>{l(`${u}`)},[u]),{value:d,onBlurInput:e=>{let t=e.target.value,u=1>Number(t)||isNaN(Number(t))?1:Number(t);r(u),l(`${u}`)},onChangeInput:e=>{isNaN(Number(e.target.value))||""===e.target.value||l(parseInt(e.target.value).toString())}}};
1
+ "use strict";var t=require("@gem-sdk/core"),e=require("react");exports.useHandleQuantity=(u,r,n)=>{let a=t.useIsSyncProduct(),l=t.useProduct(),i=n?.defaultQtyValue??1,[s,d]=e.useState(""),c=e.useCallback(t=>{let e=t.detail,n=l?.id;a&&e&&n==e.productId&&u!=e.quantity&&r(e.quantity)},[a,l?.id,u,r]);e.useEffect(()=>(window.addEventListener("set-product-quantity",c),()=>{window.removeEventListener("set-product-quantity",c)}),[c]);let o=t=>{let e=Number(t);return""!==t&&Number.isFinite(e)?Math.trunc(e):null};return e.useEffect(()=>{r(parseFloat(`${i}`)),d(`${i}`)},[r,i]),e.useEffect(()=>{d(`${u}`)},[u]),{value:s,onBlurInput:t=>{let e=o(t.target.value),u=null===e||e<1?1:e;r(u),d(`${u}`)},onChangeInput:t=>{let e=o(t.target.value);null!==e&&(d(e.toString()),e>=1&&r(e))}}};
@@ -1 +1 @@
1
- "use strict";exports.ProductQuantitySettings=[{id:"setting",controls:[{id:"title",label:"Label title",type:"input",placeholder:"Add...",default:"Quantity",fallbackValue:"Quantity",clearButton:!1},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1,disableDecimal:!0}]},{id:"style",controls:[{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"inputWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]}]},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"start"}]}];
1
+ "use strict";exports.ProductQuantitySettings=[{id:"setting",controls:[{id:"title",label:"Label title",type:"input",placeholder:"Add...",default:"Quantity",fallbackValue:"Quantity",clearButton:!1},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1,disableDecimal:!0},{id:"updatePrice",label:"Update price",type:"toggle",default:!0}]},{id:"style",controls:[{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"inputWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]}]},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"start"}]}];
@@ -1 +1 @@
1
- "use strict";exports.SettingUIV2=[{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"inputWidth"},layout:"horizontal"}]},{label:"Display options",controls:[{label:"Default quantity",setting:{id:"defaultQtyValue"},layout:"horizontal"},{type:"combo",label:"Label title",iconName:"polaris-text-block",getValueFromSettingID:"title",disableClearMessage:"This label title is needed for customers <br> to adjust the product's quantity",controls:[{label:"Content",setting:{id:"title"},layout:"vertical",options:{clearButton:!1}}]}]},{controls:[{type:"control",label:"Align",setting:{id:"align"},conditionEnable:'!(parseInt(inputWidth) >= 100 && inputWidth?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];
1
+ "use strict";exports.SettingUIV2=[{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"inputWidth"},layout:"horizontal"}]},{label:"Display options",controls:[{label:"Default quantity",setting:{id:"defaultQtyValue"},layout:"horizontal"},{label:"Update price",setting:{id:"updatePrice"}},{type:"combo",label:"Label title",iconName:"polaris-text-block",getValueFromSettingID:"title",disableClearMessage:"This label title is needed for customers <br> to adjust the product's quantity",controls:[{label:"Content",setting:{id:"title"},layout:"vertical",options:{clearButton:!1}}]}]},{controls:[{type:"control",label:"Align",setting:{id:"align"},conditionEnable:'!(parseInt(inputWidth) >= 100 && inputWidth?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];
@@ -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 | json }}, "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 }}, "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 | json }}, "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 }}, "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("./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 | json }}, "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 }}, "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 | json }}, "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 }}, "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>
@@ -82,7 +82,7 @@
82
82
  data-id="${c?.uid}"
83
83
  style="${P}"
84
84
  class="${p?.cssClass}"
85
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${S}], "isSyncProduct": "${u}", "hasPreSelected": ${g}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant | json }}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
85
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${S}], "isSyncProduct": "${u}", "hasPreSelected": ${g}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
86
86
  >
87
87
  <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 }}}</script>
88
88
  <product-form class="product-form">
@@ -1,5 +1,5 @@
1
- import{template as o,WrapRenderChildren as r,RenderChildren as s,RenderIf as e,isLocalEnv as t,baseAssetURL as i}from"@gem-sdk/core";import{getStaticLocale as a,getSettingPreloadData as l}from"../../../helpers.js";import{mappingNavigationCarousel as d}from"../arrow/common/helpers.js";import{getClass as p}from"./common/classes.js";import{getData as n}from"./common/helpers.js";import{getStyle as c}from"./common/styles.js";import m from"../arrow/Arrow.liquid.js";import{getAttr as u}from"./common/attrs.js";import $ from"../dot/Dots.liquid.js";let v=v=>{let{children:f,builderAttrs:g,builderProps:w,styles:h,isHiddenArrowWhenDisabled:S=!0,hiddenDotWhenOnlyOne:y,rootId:j,rawChildren:C,conditionAppendJs:k,productBadgeLiquid:b}=v,E=d(v.setting),I={...v,setting:E},{arrowButtonSize:A,arrowBackgroundColor:G,arrowGapToEachSide:P="16",roundedArrow:T,arrowIconSize:q,arrowCustomColor:x,arrowBorder:z,arrowShadow:B,showWhenHover:D}=E??{},{uniqueComponentId:O,loopConfig:W,arrowShowConfig:_,stateData:H}=n(I),{rootClassRender:M,wrapperClassRender:N,wrapperInnerClass:R,sliderClass:U}=p(I),{sliderWrapperStyle:V,rootStyleRender:F,wrapperStyleRender:J,wrapperInnerStyle:K}=c(I),{rootAttrRender:L,sliderAttr:Q}=u(I),X=()=>e(t,`<script ${l('class="gps-link" delay',"src")}="{{ 'gp-carousel-v3-embla-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${l('class="gps-link" delay',"src")}="${i}/assets-v2/gp-carousel-v3-embla-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`),Y=o=>m({uid:w?.uid,componentId:O,custom:E?.arrowCustom??"",showArrow:_,arrowButtonSize:A||{},arrowIconSize:q||{},arrowBackgroundColor:G??"",arrowCustomColor:x,gapToEachSize:P,showWhenHover:D,arrowBorder:z||{},arrowCorner:T||{},arrowShadow:B||{},left:"next"!==o,onClick:o=>{o.stopPropagation()},vertical:E?.vertical,isHiddenWhenDisabled:S,rootId:j});return o`
2
- <gp-carousel-v3 ${L} style="${F}" class="${M}">
1
+ import{template as o,WrapRenderChildren as r,RenderChildren as s,RenderIf as e,isLocalEnv as t,baseAssetURL as i}from"@gem-sdk/core";import{getStaticLocale as a,getSettingPreloadData as l}from"../../../helpers.js";import{mappingNavigationCarousel as d}from"../arrow/common/helpers.js";import{getClass as p}from"./common/classes.js";import{getData as n}from"./common/helpers.js";import{getStyle as c}from"./common/styles.js";import m from"../arrow/Arrow.liquid.js";import{getAttr as u}from"./common/attrs.js";import $ from"../dot/Dots.liquid.js";let v=v=>{let{children:f,builderAttrs:g,builderProps:w,styles:h,isHiddenArrowWhenDisabled:S=!0,hiddenDotWhenOnlyOne:y,rootId:j,rawChildren:C,conditionAppendJs:k,productBadgeLiquid:E}=v,I=d(v.setting),A={...v,setting:I},{arrowButtonSize:G,arrowBackgroundColor:P,arrowGapToEachSide:T="16",roundedArrow:b,arrowIconSize:q,arrowCustomColor:x,arrowBorder:z,arrowShadow:B,showWhenHover:D}=I??{},{uniqueComponentId:O,loopConfig:W,arrowShowConfig:_,stateData:H}=n(A),{rootClassRender:M,wrapperClassRender:N,wrapperInnerClass:R,sliderClass:U}=p(A),{sliderWrapperStyle:V,rootStyleRender:F,wrapperStyleRender:J,wrapperInnerStyle:K}=c(A),{rootAttrRender:L,sliderAttr:Q}=u(A),X=()=>e(t,`<script ${l('class="gps-link" delay',"src")}="{{ 'gp-carousel-v4-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${l('class="gps-link" delay',"src")}="${i}/assets-v2/gp-carousel-v4-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`),Y=o=>m({uid:w?.uid,componentId:O,custom:I?.arrowCustom??"",showArrow:_,arrowButtonSize:G||{},arrowIconSize:q||{},arrowBackgroundColor:P??"",arrowCustomColor:x,gapToEachSize:T,showWhenHover:D,arrowBorder:z||{},arrowCorner:b||{},arrowShadow:B||{},left:"next"!==o,onClick:o=>{o.stopPropagation()},vertical:I?.vertical,isHiddenWhenDisabled:S,rootId:j});return o`
2
+ <gp-carousel-v4 ${L} style="${F}" class="${M}">
3
3
  <script gp-data type="application/json">${H}</script>
4
4
  <div
5
5
  ${g}
@@ -7,19 +7,19 @@ import{template as o,WrapRenderChildren as r,RenderChildren as s,RenderIf as e,i
7
7
  style="${J}"
8
8
  >
9
9
  <div class="${R}" style="${K}">
10
- ${b??""}
10
+ ${E??""}
11
11
  ${Y("prev")}
12
12
  <div ${Q} style="${V}">
13
13
  <div class="${U}">
14
14
  ${o`
15
- ${C?.length?r({uid:w?.uid??"",customProps:C[0]?.customProps},C.map((r,e)=>{if(r)return o`${s({...r,index:e,parentSettings:E,parentStyle:h,background:E?.background,parentUid:w?.uid})}`})):f??`<div>${a("Carousel","no_slider")}</div>`}`}
15
+ ${C?.length?r({uid:w?.uid??"",customProps:C[0]?.customProps},C.map((r,e)=>{if(r)return o`${s({...r,index:e,parentSettings:I,parentStyle:h,background:I?.background,parentUid:w?.uid})}`})):f??`<div>${a("Carousel","no_slider")}</div>`}`}
16
16
  </div>
17
17
  </div>
18
18
  ${Y("next")}
19
19
  </div>
20
- ${$({loop:W,showDots:E?.dot,dotStyle:E?.dotStyle,dotGapToCarousel:E?.dotGapToCarousel,vertical:E?.vertical,uniqueComponentId:O,hiddenWhenOnlyOne:y})}
20
+ ${$({loop:W,showDots:I?.dot,dotStyle:I?.dotStyle,dotGapToCarousel:I?.dotGapToCarousel,vertical:I?.vertical,uniqueComponentId:O,hiddenWhenOnlyOne:y})}
21
21
  </div>
22
- </gp-carousel-v3>
22
+ </gp-carousel-v4>
23
23
  ${k?`{% if ${k} %} ${X()} {% endif %}`:X()}
24
24
 
25
25
  `};export{v as default};
@@ -1 +1 @@
1
- let e=[{label:"Style",controls:[{setting:{id:"imageStyle"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"square",shapeValue:"1/1",shapeLinked:!0,width:"80px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"9999px",btrr:"9999px",bbrr:"9999px",btlr:"9999px",radiusType:"circle"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"original",shapeValue:"",width:"100%"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"0px",btrr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{label:"Source",controls:[{conditionDisplay:"isAdaptive === false",setting:{id:"image"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{conditionDisplay:"isAdaptive === true",setting:{id:"srcSet"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{label:"Scale",setting:{id:"objectFit"},conditionDisplay:'shape.shape !== "original"'}]},{label:"Size",hiddenOnMobile:!0,controls:[{setting:{id:"shape"},layout:"vertical"}]},{label:"Shape",hiddenOnMobile:!0,controls:[{label:"Border",controlConfig:{id:"border",type:"border-v2",linkWithSetting:{name:"wrapperBorder"}}},{label:"Corner",controlConfig:{id:"corner",type:"corner-v2",linkWithSetting:{name:"borderRadius"}}},{label:"Shadow",setting:{id:"shadow"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadow.enable === true",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!0}},{condition:"shadow.enable === false",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:"Link",setting:{id:"enableImageLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableImageLink == true'},{setting:{id:"imageLink"},conditionDisplay:"enableImageLink === true",layout:"vertical"}]},{label:"SEO",hiddenOnMobile:!0,controls:[{type:"combo",label:"Alt text",iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:"Content",setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:"Image title",iconName:"polaris-text-block",getValueFromSettingID:"title",isHideClear:!0,compoDefaultValue:"Title",controls:[{label:"Content",setting:{id:"title"},layout:"vertical"}]}]},{label:"Optimize LCP",conditionDisplay:'pageType !== "STATIC"',hiddenOnMobile:!0,controls:[{label:"Preload",setting:{id:"priority"}},{label:"Quality",setting:{id:"qualityType"},options:{disableMessage:"This setting only works with images uploaded to Shopify"},conditionEnable:"(activeScreenId === \"desktop\" && srcSet?.src && srcSet.src.includes('cdn.shopify.com')) || (activeScreenId === \"tablet\" && srcSet?.src && srcSet.src.includes('cdn.shopify.com')) || (activeScreenId === \"mobile\" && srcSet?.src && srcSet.src.includes('cdn.shopify.com'))"},{layout:"horizontal",label:"Quality",conditionDisplay:'qualityType == "custom" && ((activeScreenId === "desktop" && srcSet?.src && srcSet.src.includes("cdn.shopify.com")) || (activeScreenId === "tablet" && srcSet?.src && srcSet.src.includes("cdn.shopify.com")) || (activeScreenId === "mobile" && srcSet?.src && srcSet.src.includes("cdn.shopify.com")))',setting:{id:"qualityPercent"}}]},{controls:[{label:"Align",hiddenOnMobile:!0,setting:{id:"align"},conditionEnable:'!(shape.width === "default" || (parseInt(shape.width) >= 100 && shape.width?.includes("%")))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{e as SettingUIV2};
1
+ let e="(isAdaptive === false ? image?.src : srcSet?.src)?.includes('cdn.shopify.com') === true",t=[{label:"Style",controls:[{setting:{id:"imageStyle"},layout:"vertical",controlChangeTrigger:{settings:[{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"square",shapeValue:"1/1",shapeLinked:!0,width:"80px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"9999px",btrr:"9999px",bbrr:"9999px",btlr:"9999px",radiusType:"circle"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"wrapperBorder",newValue:{border:"none",color:"transparent",borderWidth:"0px"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="circle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shadow",newValue:{enable:!1},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"shape",newValue:{shape:"original",shapeValue:"",width:"100%"},groupType:"style",controlType:"style"}},{condition:'imageStyle==="rectangle"',source:["imageStyle"],action:{controlId:"borderRadius",newValue:{bblr:"0px",btrr:"0px",bbrr:"0px",btlr:"0px",radiusType:"none"},groupType:"style",controlType:"style"}}],options:{noRecordHistory:!0}}}]},{label:"Source",controls:[{conditionDisplay:"isAdaptive === false",setting:{id:"image"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{conditionDisplay:"isAdaptive === true",setting:{id:"srcSet"},layout:"vertical",options:{updateFields:[{field:"preload",settingId:"priority"},{field:"altText",settingId:"alt"},{field:"imageTitle",settingId:"title"}]},controlChangeTrigger:{settings:[{action:{controlId:"priority",valueFromField:"preload",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"alt",valueFromField:"altText",groupType:"setting",controlType:"setting",removeDevice:!0}},{action:{controlId:"title",valueFromField:"imageTitle",groupType:"setting",controlType:"setting",removeDevice:!0}}],options:{noRecordHistory:!0}}},{label:"Scale",setting:{id:"objectFit"},conditionDisplay:'shape.shape !== "original"'}]},{label:"Size",hiddenOnMobile:!0,controls:[{setting:{id:"shape"},layout:"vertical"}]},{label:"Shape",hiddenOnMobile:!0,controls:[{label:"Border",controlConfig:{id:"border",type:"border-v2",linkWithSetting:{name:"wrapperBorder"}}},{label:"Corner",controlConfig:{id:"corner",type:"corner-v2",linkWithSetting:{name:"borderRadius"}}},{label:"Shadow",setting:{id:"shadow"},options:{updateFields:[{field:"enable",settingId:"hasActiveShadow"}]},controlChangeTrigger:{settings:[{condition:"shadow.enable === true",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!0}},{condition:"shadow.enable === false",source:["shadow","hasActiveShadow"],action:{controlId:"hasActiveShadow",groupType:"advanced",controlType:"advanced",newValue:!1}}],options:{noRecordHistory:!0}}}]},{controls:[{label:"Link",setting:{id:"enableImageLink"},options:{labelVariant:"primary",toggleStyle:"switch"}},{layout:"vertical",controlConfig:{id:"linkedToPreSalesPageBanner",type:"banner",message:"Pre-sales page elements with link should redirect to the Sales page."},conditionDisplay:'pageType === "GP_PRE_SALE_PAGE" && enableImageLink == true'},{setting:{id:"imageLink"},conditionDisplay:"enableImageLink === true",layout:"vertical"}]},{label:"SEO",hiddenOnMobile:!0,controls:[{type:"combo",label:"Alt text",iconName:"polaris-text-block",getValueFromSettingID:"alt",compoDefaultValue:"Describes the appearance of the image",isHideClear:!0,controls:[{label:"Content",setting:{id:"alt"},layout:"vertical"}]},{type:"combo",label:"Image title",iconName:"polaris-text-block",getValueFromSettingID:"title",isHideClear:!0,compoDefaultValue:"Title",controls:[{label:"Content",setting:{id:"title"},layout:"vertical"}]}]},{label:"Optimize LCP",conditionDisplay:'pageType !== "STATIC"',hiddenOnMobile:!0,controls:[{label:"Preload",setting:{id:"priority"}},{label:"Quality",setting:{id:"qualityType"},options:{disableMessage:"This setting only works with images uploaded to Shopify"},conditionEnable:e},{layout:"horizontal",label:"Quality",conditionDisplay:`qualityType == "custom" && ${e}`,setting:{id:"qualityPercent"}}]},{controls:[{label:"Align",hiddenOnMobile:!0,setting:{id:"align"},conditionEnable:'!(shape.width === "default" || (parseInt(shape.width) >= 100 && shape.width?.includes("%")))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{t as SettingUIV2};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useCurrentVariant as t,useProduct as i,useProductStore as o,convertDecimalToNumber as l,shopifyPriceRounding as s,useProductOfferDiscount as p,useI18nStore as a,useRenderMode as n,useFormatMoney as c,cls as g}from"@gem-sdk/core";import{calculateSellingPlanDiscount as m}from"../helpers/product-price-breakdown/getPrice.js";import{useSubscriptionSellingType as d}from"../hooks/useSubscriptionSellingType.js";import u from"../../../common/components/TooltipHover.js";import{useDynamicProduct as f}from"../hooks/useDynamicProduct.js";import h from"../../text/components/Text.js";import{useMemo as P}from"react";let y=({styles:y,style:x,builderAttrs:b,builderProps:N,children:j,setting:S})=>{let k=t(),D=i(),{isOneTime:F}=d(),v=o(e=>e.selectedSellingPlan),w=l(k?.price)??0,G=l(k?.salePrice)??0,T=parseFloat(s(p(),2)),{isDynamicProduct:I}=f(),{t:J}=a(),{isEditMode:O}=n(),{priceType:$,source:H}=S??{},q="compare"===$,z="offer"===$,A="price"===H,B="compare-price"===H,C=k?.sellingPlanGroups,E=D?.sellingPlanGroups,K=P(()=>{if(!v||F)return null;let e=k?.sellingPlanGroups??D?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===v)return e}return null},[JSON.stringify(C),JSON.stringify(E),v,F]),L=JSON.stringify(K?.pricingPolicies),M=K?.baseID,Q=P(()=>!K||w<=0||F?0:m({variantPrice:w,pricingPolicies:K.pricingPolicies}),[L,w,F]),R=P(()=>{let e=z&&!F&&v&&M;if(e){let e=parseFloat(s(w-Q,2)),r=parseFloat(s(e-T,2));return r>0?r:0}let r=parseFloat(s(w-T,2));return r>0?r:0},[z,F,v,M,w,Q,T]),U=P(()=>q?A?w:G:z?R:w,[q,A,z,w,G,R]),V=c(parseFloat(s(Number(U)||0,2)),!1),W=D?.baseID?.replace("gid://shopify/Product/",""),X=P(()=>q&&(!T&&G<w||B&&!G||A&&w<=0),[q,T,w,G,B,A]);return(!U&&!z||X)&&O?e(u,{enable:!0,text:J("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:J("No compare price")})})}):X&&!O?null:r("div",{...b,className:g(N?.uid),style:{...x},id:`shopify-text-element-${N?.uid}`,"data-product-id":W,children:[e(h,{styles:y,setting:{text:I?"$???":V},className:g({"gp-money":z,"gp-product-compare-price":q,"gp-line-through":q&&y?.lineThrough})}),j]})};export{y as default};
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useCurrentVariant as t,useProduct as o,useProductStore as i,convertDecimalToNumber as l,useProductOfferDiscount as s,shopifyPriceRounding as p,useI18nStore as a,useRenderMode as n,useQuantity as c,useFormatMoney as g,cls as m}from"@gem-sdk/core";import{calculateSellingPlanDiscount as d}from"../helpers/product-price-breakdown/getPrice.js";import{useSubscriptionSellingType as u}from"../hooks/useSubscriptionSellingType.js";import f from"../../../common/components/TooltipHover.js";import{useDynamicProduct as h}from"../hooks/useDynamicProduct.js";import P from"../../text/components/Text.js";import{useMemo as y}from"react";let x=({styles:x,style:b,builderAttrs:N,builderProps:F,children:j,setting:S})=>{let k=t(),D=o(),{isOneTime:v}=u(),w=i(e=>e.selectedSellingPlan),G=l(k?.price)??0,T=l(k?.salePrice)??0,I=s(),J=parseFloat(p(I,2)),{isDynamicProduct:O}=h(),{t:$}=a(),{isEditMode:H}=n(),{quantity:M,hasUpdatePrice:q}=c(),{priceType:z,source:A}=S??{},B=y(()=>q&&M||1,[M,q]),C="compare"===z,E="offer"===z,K="price"===A,L="compare-price"===A,Q=k?.sellingPlanGroups,R=D?.sellingPlanGroups,U=y(()=>{if(!w||v)return null;let e=k?.sellingPlanGroups??D?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===w)return e}return null},[JSON.stringify(Q),JSON.stringify(R),w,v]),V=JSON.stringify(U?.pricingPolicies),W=U?.baseID,X=y(()=>!U||G<=0||v?0:d({variantPrice:G,pricingPolicies:U.pricingPolicies}),[V,G,v]),Y=y(()=>{let e=E&&!v&&w&&W;if(e){let e=parseFloat(p(G-X,2)),r=parseFloat(p(e-J,2));return r>0?r:0}let r=parseFloat(p(G-J,2));return r>0?r:0},[E,v,w,W,G,X,J]),Z=y(()=>C?K?G:T:E?Y:G,[C,K,E,G,T,Y]),_=y(()=>{if(!E)return Z*B;let e=w&&!v&&W?parseFloat(p(G-X,2)):G,r=parseFloat(p(e*B,2)),t=parseFloat(p(I*B,2));return Math.max(0,parseFloat(p(r-t,2)))},[E,Z,B,G,I,X,w,W,v]),ee=g(parseFloat(p(Number(_)||0,2)),!1),er=D?.baseID?.replace("gid://shopify/Product/",""),et=y(()=>C&&(!J&&T<G||L&&!T||K&&G<=0),[C,J,G,T,L,K]);return(!Z&&!E||et)&&H?e(f,{enable:!0,text:$("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:$("No compare price")})})}):et&&!H?null:r("div",{...N,className:m(F?.uid),style:{...b},id:`shopify-text-element-${F?.uid}`,"data-product-id":er,children:[e(P,{styles:x,setting:{text:O?"$???":ee},className:m({"gp-money":E,"gp-product-compare-price":C,"gp-line-through":C&&x?.lineThrough})}),j]})};export{x as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useQuantity as r,useCurrentVariantInStock as s}from"@gem-sdk/core";import{getWrapperClasses as a,getContainerClasses as l,getWrapperInputClasses as o,getLabelClasses as m,getInputClasses as i}from"../helpers/product-quantity/getClasses.js";import{getWrapperStyles as n}from"../helpers/product-quantity/getStyles.js";import{useHandleQuantity as u}from"../hooks/useHandleQuantity.js";import{createClass as c,createStyle as d}from"@gem-sdk/system";let p=({setting:p={},styles:h={}})=>{let{inputWidth:f,align:y}=h,{quantity:g,setQuantity:N}=r(),{value:j,onBlurInput:v,onChangeInput:b}=u(g,N,p),k=s(),C=c(a(y)),P=c(l()),Q=c(o()),q=c(m()),x=c(i()),S=d({...n(f)});return e("div",{className:C,children:e("div",{className:P,style:{...S},children:t("div",{className:Q,children:[e("label",{htmlFor:"input",className:q,children:p.title||"Quantity"}),e("input",{disabled:!k,autoComplete:"off",name:"Select Option",className:x,type:"number",value:j,min:1,onBlur:v,onChange:b})]})})})};export{p as default};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useQuantity as r,useCurrentVariantInStock as s}from"@gem-sdk/core";import{getWrapperClasses as o,getContainerClasses as a,getWrapperInputClasses as m,getLabelClasses as l,getInputClasses as i}from"../helpers/product-quantity/getClasses.js";import{getWrapperStyles as n}from"../helpers/product-quantity/getStyles.js";import{useHandleQuantity as u}from"../hooks/useHandleQuantity.js";import{createClass as p,createStyle as c}from"@gem-sdk/system";import{useEffect as d}from"react";let f=({setting:f={},styles:h={}})=>{let{inputWidth:y,align:g}=h,{updatePrice:N=!1}=f,{quantity:j,setQuantity:v,setUpdatePrice:b}=r(),{value:k,onBlurInput:C,onChangeInput:P}=u(j,v,f),Q=s(),q=p(o(g)),x=p(a()),S=p(m()),B=p(l()),F=p(i()),H=c({...n(y)});return d(()=>(b(N),()=>b(!1)),[N,b]),e("div",{className:q,children:e("div",{className:x,style:{...H},children:t("div",{className:S,children:[e("label",{htmlFor:"input",className:B,children:f.title||"Quantity"}),e("input",{disabled:!Q,autoComplete:"off",name:"Select Option",className:F,type:"number",value:k,min:1,step:1,onBlur:C,onChange:P})]})})})};export{f as default};
@@ -1 +1 @@
1
- import{useIsSyncProduct as t,useProduct as e}from"@gem-sdk/core";import{useState as r,useCallback as a,useEffect as u}from"react";let n=(n,i,o)=>{let d=t(),l=e(),m=o?.defaultQtyValue??1,[p,s]=r(""),N=a(t=>{let e=t.detail,r=l?.id;d&&e&&r==e.productId&&n!=e.quantity&&i(e.quantity)},[d,l?.id,n,i]);return u(()=>(window.addEventListener("set-product-quantity",N),()=>{window.removeEventListener("set-product-quantity",N)}),[N]),u(()=>{i(parseFloat(`${m}`)),s(`${m}`)},[i,m]),u(()=>{s(`${n}`)},[n]),{value:p,onBlurInput:t=>{let e=t.target.value,r=1>Number(e)||isNaN(Number(e))?1:Number(e);i(r),s(`${r}`)},onChangeInput:t=>{isNaN(Number(t.target.value))||""===t.target.value||s(parseInt(t.target.value).toString())}}};export{n as useHandleQuantity};
1
+ import{useIsSyncProduct as t,useProduct as e}from"@gem-sdk/core";import{useState as n,useCallback as r,useEffect as u}from"react";let l=(l,a,i)=>{let o=t(),d=e(),p=i?.defaultQtyValue??1,[m,s]=n(""),c=r(t=>{let e=t.detail,n=d?.id;o&&e&&n==e.productId&&l!=e.quantity&&a(e.quantity)},[o,d?.id,l,a]);u(()=>(window.addEventListener("set-product-quantity",c),()=>{window.removeEventListener("set-product-quantity",c)}),[c]);let y=t=>{let e=Number(t);return""!==t&&Number.isFinite(e)?Math.trunc(e):null};return u(()=>{a(parseFloat(`${p}`)),s(`${p}`)},[a,p]),u(()=>{s(`${l}`)},[l]),{value:m,onBlurInput:t=>{let e=y(t.target.value),n=null===e||e<1?1:e;a(n),s(`${n}`)},onChangeInput:t=>{let e=y(t.target.value);null!==e&&(s(e.toString()),e>=1&&a(e))}}};export{l as useHandleQuantity};
@@ -1 +1 @@
1
- let t=[{id:"setting",controls:[{id:"title",label:"Label title",type:"input",placeholder:"Add...",default:"Quantity",fallbackValue:"Quantity",clearButton:!1},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1,disableDecimal:!0}]},{id:"style",controls:[{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"inputWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]}]},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"start"}]}];export{t as ProductQuantitySettings};
1
+ let e=[{id:"setting",controls:[{id:"title",label:"Label title",type:"input",placeholder:"Add...",default:"Quantity",fallbackValue:"Quantity",clearButton:!1},{id:"defaultQtyValue",label:"Text",type:"input:stepper",min:1,default:1,disableDecimal:!0},{id:"updatePrice",label:"Update price",type:"toggle",default:!0}]},{id:"style",controls:[{id:"dimensions",type:"group",label:"Dimensions",controls:[{id:"fullWidth",label:"Full Width",type:"toggle",devices:{desktop:{default:!1}}},{id:"inputWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]}]},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"start",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"end",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"start"}]}];export{e as ProductQuantitySettings};
@@ -1 +1 @@
1
- let t=[{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"inputWidth"},layout:"horizontal"}]},{label:"Display options",controls:[{label:"Default quantity",setting:{id:"defaultQtyValue"},layout:"horizontal"},{type:"combo",label:"Label title",iconName:"polaris-text-block",getValueFromSettingID:"title",disableClearMessage:"This label title is needed for customers <br> to adjust the product's quantity",controls:[{label:"Content",setting:{id:"title"},layout:"vertical",options:{clearButton:!1}}]}]},{controls:[{type:"control",label:"Align",setting:{id:"align"},conditionEnable:'!(parseInt(inputWidth) >= 100 && inputWidth?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];export{t as SettingUIV2};
1
+ let t=[{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"inputWidth"},layout:"horizontal"}]},{label:"Display options",controls:[{label:"Default quantity",setting:{id:"defaultQtyValue"},layout:"horizontal"},{label:"Update price",setting:{id:"updatePrice"}},{type:"combo",label:"Label title",iconName:"polaris-text-block",getValueFromSettingID:"title",disableClearMessage:"This label title is needed for customers <br> to adjust the product's quantity",controls:[{label:"Content",setting:{id:"title"},layout:"vertical",options:{clearButton:!1}}]}]},{controls:[{type:"control",label:"Align",setting:{id:"align"},conditionEnable:'!(parseInt(inputWidth) >= 100 && inputWidth?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];export{t as SettingUIV2};
@@ -1,6 +1,6 @@
1
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`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant | json }}, "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 }}, "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(e)}}</script>
@@ -1,6 +1,6 @@
1
- import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let e=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e);return t`
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`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant | json }}, "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 }}, "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
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>
@@ -9,10 +9,10 @@ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as
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((o,e)=>{if(o)return t`
13
- ${n({...o,index:e})}
12
+ ${r?.map((e,o)=>{if(e)return t`
13
+ ${n({...e,index:o})}
14
14
  `}).join("")}
15
15
  `}
16
16
  {%- endform -%}
17
17
  </gp-product>
18
- `};export{e as default};
18
+ `};export{o as default};
@@ -1,6 +1,6 @@
1
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`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant | json }}, "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 }}, "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(e)}}</script>
@@ -1,6 +1,6 @@
1
- import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let e=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e);return t`
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`
2
2
  <gp-product
3
- gp-context='{"variantSelected": {{ variant | json | escape }}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant | json }}, "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 }}, "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
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>
@@ -9,10 +9,10 @@ import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as
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((o,e)=>{if(o)return t`
13
- ${n({...o,index:e})}
12
+ ${r?.map((e,o)=>{if(e)return t`
13
+ ${n({...e,index:o})}
14
14
  `}).join("")}
15
15
  `}
16
16
  {%- endform -%}
17
17
  </gp-product>
18
- `};export{e as default};
18
+ `};export{o as default};
@@ -82,7 +82,7 @@ import{getData as t,DYNAMIC_PRODUCT_STATUS as e,STATIC_PRODUCT_STATUS as i,PRODU
82
82
  data-id="${_?.uid}"
83
83
  style="${E}"
84
84
  class="${$?.cssClass}"
85
- gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${j}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant | json }}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
85
+ gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${j}, "hasOnlyDefaultVariant": {{ product.has_only_default_variant }}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity | default: 0 }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
86
86
  >
87
87
  <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 }}}</script>
88
88
  <product-form class="product-form">
@@ -3332,6 +3332,7 @@ declare const PostPurchaseProductPriceBreakdown: React.FC<PostPurchaseProductPri
3332
3332
  type PostPurchaseProductQuantitySettingProps = {
3333
3333
  title?: string;
3334
3334
  defaultQtyValue?: number;
3335
+ updatePrice?: boolean;
3335
3336
  };
3336
3337
  type PostPurchaseProductQuantityStyleProps = {
3337
3338
  fullWidth?: ObjectDevices<boolean>;
@@ -3508,13 +3509,13 @@ type PostPurchaseProductPriceProps = BasePropsWrap<PostPurchaseProductPriceSetti
3508
3509
  children?: ReactNode;
3509
3510
  };
3510
3511
 
3511
- declare const PostPurchaseProductQuantity: React.FC<PostPurchaseProductQuantityProps>;
3512
+ declare const PostPurchaseProductQuantity: React$1.FC<PostPurchaseProductQuantityProps>;
3512
3513
 
3513
3514
  declare const PostPurchaseProductImages: (props: PostPurchaseProductImagesProps) => React.JSX.Element;
3514
3515
 
3515
3516
  declare const PostPurchaseProductTitle: React.FC<PostPurchaseProductTitleProps>;
3516
3517
 
3517
- declare const PostPurchaseProductPrice: React.FC<PostPurchaseProductPriceProps>;
3518
+ declare const PostPurchaseProductPrice: React$1.FC<PostPurchaseProductPriceProps>;
3518
3519
 
3519
3520
  declare const PostPurchaseAcceptButton: (props: PostPurchaseButtonProps) => React.JSX.Element;
3520
3521
 
@@ -8332,6 +8333,7 @@ declare const filterPageContext: (pageContext?: PageContext) => {
8332
8333
  showPriceCurrency?: boolean;
8333
8334
  enableLazyLoadImage?: boolean;
8334
8335
  hasCollectionHandle?: boolean;
8336
+ shopifyDomain?: string;
8335
8337
  } | undefined;
8336
8338
 
8337
8339
  declare const Accordion: TranslateObject<AccordionTranslateKeys>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "23.0.0-dev.11",
3
+ "version": "23.0.0-dev.15",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -32,9 +32,9 @@
32
32
  "react-youtube": "10.1.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@gem-sdk/core": "23.0.0-dev.10",
36
- "@gem-sdk/styles": "23.0.0-dev.7",
37
- "@gem-sdk/system": "23.0.0-dev.4",
35
+ "@gem-sdk/core": "23.0.0-dev.15",
36
+ "@gem-sdk/styles": "23.0.0-dev.15",
37
+ "@gem-sdk/system": "23.0.0-dev.15",
38
38
  "@thedutchcoder/postcss-rem-to-px": "0.0.2",
39
39
  "@types/react-transition-group": "^4.4.12",
40
40
  "autoprefixer": "10.4.23",