@gem-sdk/components 8.0.0-dev.122 → 8.0.0-dev.124
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.
- package/dist/cjs/builder.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -0
- package/dist/cjs/post-purchase/product/components/product-subscription/common/classes.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanDropdown.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanRadio.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSellingPlanChange.js +1 -0
- package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSellingSubscription.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
- package/dist/cjs/post-purchase/product/next.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-subscription/configs/settings.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-subscription/configs/ui-v2.js +1 -1
- package/dist/cjs/product/components/ProductImages.liquid.js +1 -1
- package/dist/cjs/product/components/product-images-v2/ProductImagesV2.liquid.js +4 -4
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +4 -4
- package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +6 -6
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +6 -6
- package/dist/cjs/product/components/product-variants/ProductVariants.liquid.js +11 -11
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +4 -4
- package/dist/esm/builder.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -0
- package/dist/esm/post-purchase/product/components/product-subscription/common/classes.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanDropdown.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanRadio.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSellingPlanChange.js +1 -0
- package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSellingSubscription.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
- package/dist/esm/post-purchase/product/next.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-subscription/configs/settings.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-subscription/configs/ui-v2.js +1 -1
- package/dist/esm/product/components/ProductImages.liquid.js +1 -1
- package/dist/esm/product/components/product-images-v2/ProductImagesV2.liquid.js +7 -7
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +7 -7
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +2 -2
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +5 -5
- package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +2 -2
- package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +5 -5
- package/dist/esm/product/components/product-variants/ProductVariants.liquid.js +32 -32
- package/dist/esm/product/components/product-wrap/Product.liquid.js +5 -5
- package/package.json +2 -2
- package/dist/cjs/post-purchase/product/components/product-subscription/components/ProductSubscription.js +0 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useDetectBothSubscriptionTypes.js +0 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/ProductSubscription.js +0 -1
- package/dist/esm/post-purchase/product/components/product-subscription/hooks/useDetectBothSubscriptionTypes.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"next/dynamic";import t from"../../common/components/Loading.js";import"react/jsx-runtime";import"react";import"@gem-sdk/core";let PostPurchaseProductTitle=o(()=>import("./components/ProductTitle.js"),{loading:t}),PostPurchaseProductDescription=o(()=>import("./components/ProductDescription.js"),{ssr:!1,loading:t}),PostPurchaseProductPrice=o(()=>import("./components/ProductPrice.js"),{loading:t}),PostPurchaseProductVariants=o(()=>import("./components/product-variant/components/ProductVariant.js"),{loading:t}),PostPurchaseAcceptButton=o(()=>import("./components/AcceptButton.js"),{loading:t}),PostPurchaseProductQuantity=o(()=>import("./components/ProductQuantity.js"),{loading:t}),PostPurchaseProductSubscription=o(()=>import("./components/product-subscription/
|
|
1
|
+
import o from"next/dynamic";import t from"../../common/components/Loading.js";import"react/jsx-runtime";import"react";import"@gem-sdk/core";let PostPurchaseProductTitle=o(()=>import("./components/ProductTitle.js"),{loading:t}),PostPurchaseProductDescription=o(()=>import("./components/ProductDescription.js"),{ssr:!1,loading:t}),PostPurchaseProductPrice=o(()=>import("./components/ProductPrice.js"),{loading:t}),PostPurchaseProductVariants=o(()=>import("./components/product-variant/components/ProductVariant.js"),{loading:t}),PostPurchaseAcceptButton=o(()=>import("./components/AcceptButton.js"),{loading:t}),PostPurchaseProductQuantity=o(()=>import("./components/ProductQuantity.js"),{loading:t}),PostPurchaseProductSubscription=o(()=>import("./components/product-subscription/ProductSubscription.js"),{loading:t}),PostPurchaseProductPriceBreakdown=o(()=>import("./components/ProductPriceBreakdown.js"),{loading:t}),PostPurchaseProductOffer=o(()=>import("./components/product-offer/components/ProductOffer.js"),{loading:t}),PostPurchaseProductDiscountTag=o(()=>import("./components/ProductDiscountTag.js"),{loading:t}),PostPurchaseProductImages=o(()=>import("./components/product-image/index.js"),{loading:t});var postPurchaseProduct={PostPurchaseProductTitle,PostPurchaseProductDescription,PostPurchaseProductPrice,PostPurchaseProductVariants,PostPurchaseAcceptButton,PostPurchaseProductQuantity,PostPurchaseProductPriceBreakdown,PostPurchaseProductOffer,PostPurchaseProductDiscountTag,PostPurchaseProductImages,PostPurchaseProductSubscription};export{postPurchaseProduct as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{postPurchaseSpacing as e}from"../../../../common/constants.js";let ProductSubscriptionSettings=[{id:"setting",controls:[{id:"sellingType",label:"Type",type:"pick-subscription",options:[{value:"one-time",label:"One-time purchase"},{value:"subscription",label:"Subscription"}],default:"subscription"},{id:"sellingPlans",label:"Selling plans",type:"selling-plan"},{id:"sellingTitle",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Subscribe and save up to {
|
|
1
|
+
import{postPurchaseSpacing as e}from"../../../../common/constants.js";let ProductSubscriptionSettings=[{id:"setting",controls:[{id:"sellingType",label:"Type",type:"pick-subscription",options:[{value:"one-time",label:"One-time purchase"},{value:"subscription",label:"Subscription"}],default:"subscription"},{id:"sellingPlans",label:"Selling plans",type:"selling-plan"},{id:"sellingTitle",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Subscribe and save up to {total_discount}",suggestContents:[{message:"{total_discount}",eg:"E.g: 50%"},{message:"{offer_discount}",eg:"E.g: 20%"},{message:"{selling_plan_max_discount}",eg:"E.g: 15%"}]},{id:"sellingLabel",label:"Text",type:"input",default:"Purchase options",placeholder:"E.g. Purchase options",action:{clear:!0}},{id:"sellingTitleOneTime",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"One-time purchase",suggestContents:[]},{id:"sellingStyle",label:"Style",type:"option:illustration",default:"dropdown",options:[{label:"Dropdown",value:"dropdown",svgName:"gp-selling-plan-dropdown"},{label:"Radio",value:"radio",svgName:"gp-selling-plan-radio"}]},{id:"subscriptionLabel",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",suggestContents:[{message:"{selling_plan_delivery_frequency}",eg:"E.g: every week"},{message:"{selling_plan_discount}",eg:"E.g: 10%"},{message:"{selling_plan_billing_cycle}",eg:"E.g: every 1 month"}]},{id:"enableSubscriptionDetail",label:"Enable subscription detail",type:"toggle",default:!1}]},{id:"style",controls:[{id:"sellingTitleDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingTitleOneTimeDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"subscriptionDetailDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingPlanItemGap",type:"select",label:"Item gap",options:e,default:"tight"},{id:"sellingTitleTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"sellingTitleOneTimeTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"medium",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleOneTimeAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"subscriptionDetailTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"subscriptionDetailAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,default:"100%",displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},{id:"backgroundColor",type:"select",label:"Background Color",options:[{label:"Transparent",value:"none",icon:"gp-bg-transparent"},{label:"Red",value:"critical",icon:"gp-bg-color-red"},{label:"Blue",value:"info",icon:"gp-bg-color-blue"},{label:"Green",value:"success",icon:"gp-bg-color-green"},{label:"Yellow",value:"warning",icon:"gp-bg-color-yellow"}],default:"none"},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",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:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"}]}];export{ProductSubscriptionSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let SettingUIV2=[{label:{en:"Selling options"},controls:[{type:"control",label:{en:"Type"},setting:{id:"sellingType"}},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {
|
|
1
|
+
let SettingUIV2=[{label:{en:"Selling options"},controls:[{type:"control",label:{en:"Type"},setting:{id:"sellingType"}},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:{en:"Selling option title"},isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'rtl' && sellingTitleAlign === 'left'",source:["subscriptionDetailDirection","sellingTitleAlign"]},{action:{controlId:"sellingTitleAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'ltr' && sellingTitleAlign === 'right'",source:["sellingTitleDirection","sellingTitleAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:{en:"Align"}}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"Purchase options",popoverLabel:{en:"Selling option title"},isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:{en:"Content"},setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleOneTimeDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleOneTimeAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'rtl' && sellingTitleOneTimeAlign === 'left'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]},{action:{controlId:"sellingTitleOneTimeAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'ltr' && sellingTitleOneTimeAlign === 'right'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:{en:"Align"}}]}]},{label:{en:"Selling plans"},controls:[{type:"control",label:{en:"Source"},setting:{id:"sellingPlans"}},{type:"control",label:{en:"Label"},setting:{id:"sellingLabel"},layout:"horizontal",isHideClear:!0,conditionDisplay:'sellingType === "subscription"'},{type:"control",label:{en:"Style"},setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:{en:"Item gap"},setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:{en:"Subscription detail"},setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:{en:"Subscription detail"},isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:{en:"Content"},setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:{en:"Direction"},setting:{id:"subscriptionDetailDirection"},conditionDisplay:"enableSubscriptionDetail === true",controlChangeTrigger:{settings:[{action:{controlId:"subscriptionDetailAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'rtl' && subscriptionDetailAlign === 'left'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]},{action:{controlId:"subscriptionDetailAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'ltr' && subscriptionDetailAlign === 'right'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:{en:"Align"},conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:{en:"Size"},controls:[{type:"control",label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{controls:[{label:{en:"Align"},conditionEnable:"activeScreenId === 'desktop' ? !(parseInt(width) >= 100 && width?.includes(\"%\")) : (!(parseInt(width) >= 100 && width?.includes(\"%\")) && width !== 'default')",setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{SettingUIV2};
|
|
@@ -3,7 +3,7 @@ import{template as t,cls as e,makeStyle as i,RenderIf as r,isLocalEnv as s,baseA
|
|
|
3
3
|
"id":${JSON.stringify(h?.uid)},
|
|
4
4
|
"setting":${JSON.stringify(j)},
|
|
5
5
|
"styles":${JSON.stringify($)},
|
|
6
|
-
"product":{{ product | json
|
|
6
|
+
"product":{{ product | json }}
|
|
7
7
|
}
|
|
8
8
|
`;return t`
|
|
9
9
|
{% assign featured_image = product.featured_image %}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{template as e,isLocalEnv as o,baseAssetURL as
|
|
1
|
+
import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as t,RenderChildren as s}from"@gem-sdk/core";import{getConditionRenderGalleryImages as i,getStyleInsideLayout as a,setDefaultWhenUndefineSetting as p}from"./common/common.js";import l from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import d from"./components/gallery-carousel/GalleryCarousel.liquid.js";import m from"./components/gallery-grid/GalleryGrid.liquid.js";import{getSettingPreloadData as c}from"../../../helpers.js";import{getShapeByLayout as u,sizeSettingDefaultForNewLayout as n}from"./common/productGallery.js";import{getProductImagesClassName as g}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as f}from"./composables/getProductImagesStyles.js";import{createAttr as y,LiquidIf as $,createClass as h,If as j,Liquid as S}from"@gem-sdk/system";import{getBorderActiveCss as v}from"./common/getBorderActiveCss.js";import{getStyleOfObject as F}from"../../helpers/function.js";let ProductImages=I=>{let P=p(I),{setting:C,styles:G,builderProps:D,style:b}=P,{rawChildren:z,pageContext:O}=I,{enableLazyLoadImage:_}=O??{},N={...C,...G},A=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(D?.uid)},
|
|
4
4
|
"pageContext": ${JSON.stringify(O)},
|
|
5
5
|
"setting":${JSON.stringify(C)},
|
|
6
6
|
"styles":${JSON.stringify(G)},
|
|
7
|
-
"productUrl":{{product.url | json
|
|
8
|
-
"product":{{product | json
|
|
9
|
-
"collectionUrl": {{ collection.url | json
|
|
10
|
-
"collection": {{ collection | json
|
|
7
|
+
"productUrl":{{product.url | json }},
|
|
8
|
+
"product":{{product | json }},
|
|
9
|
+
"collectionUrl": {{ collection.url | json }},
|
|
10
|
+
"collection": {{ collection | json }}
|
|
11
11
|
}
|
|
12
12
|
`,B=y({"section-id":"{{section.id}}","data-id":`${D?.uid}`}),{isOnlyFeatureAllDevices:U,isRenderGalleryGrid:k}=i(N?.position,C?.type),q=k?{}:y({"data-only-image":$("product.media.size > 1","false","true")}),{wrapperClasses:E,productImagesGalleryClasses:J}=g(I),w=h({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),T=h({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:x,wrapContainerStyleOnlyOneImage:L,galleryImageStyle:M}=f(N),R=u({shape:N.shape,shapeForBottom:N.shapeForBottom,shapeFor1Col:N.shapeFor1Col,shapeFor2Col:N.shapeFor2Col,shapeForFtOnly:N.shapeForFtOnly,shapeForInsideBottom:N.shapeForInsideBottom??n,shapeForInside:N.shapeForInside??n},N.position),V=a(N.position,R,N?.spacing),W=()=>e`
|
|
13
|
-
${
|
|
13
|
+
${t({uid:D?.uid||"",customProps:z?.[0].customProps},z?.map(o=>{if(o)return e`${s({...o,isInsideProductImage:!0,imageData:{imageShape:G?.ftShape,imageAlign:G?.align,imageLayout:G?.position},dotData:{dotSize:C?.ftDotSize,dotGapToCarousel:C?.ftDotGapToCarousel,dotStyle:C?.ftDotStyle}})}`}))}
|
|
14
14
|
`,H=()=>e`
|
|
15
15
|
<div
|
|
16
16
|
class="${J}"
|
|
@@ -40,5 +40,5 @@ import{template as e,isLocalEnv as o,baseAssetURL as s,WrapRenderChildren as r,R
|
|
|
40
40
|
${j(!U,H())}
|
|
41
41
|
</div>
|
|
42
42
|
</gp-product-images>
|
|
43
|
-
${j(o,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-images-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${
|
|
43
|
+
${j(o,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-images-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-images-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
44
44
|
`};export{ProductImages as default};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{template as e,isLocalEnv as o,baseAssetURL as
|
|
1
|
+
import{template as e,isLocalEnv as o,baseAssetURL as r,WrapRenderChildren as t,RenderChildren as s}from"@gem-sdk/core";import{getConditionRenderGalleryImages as i,getStyleInsideLayout as a,setDefaultWhenUndefineSetting as p}from"./common/common.js";import l from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import d from"./components/gallery-carousel/GalleryCarousel.liquid.js";import m from"./components/gallery-grid/GalleryGrid.liquid.js";import{getSettingPreloadData as c}from"../../../helpers.js";import{getShapeByLayout as u,sizeSettingDefaultForNewLayout as n}from"./common/productGallery.js";import{getProductImagesClassName as g}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as f}from"./composables/getProductImagesStyles.js";import{createAttr as y,LiquidIf as $,createClass as h,If as v,Liquid as j}from"@gem-sdk/system";import{getBorderActiveCss as S}from"./common/getBorderActiveCss.js";import{getStyleOfObject as F}from"../../helpers/function.js";let ProductImages=I=>{let P=p(I),{setting:C,styles:G,builderProps:D,style:b}=P,{rawChildren:z,pageContext:O}=I,{enableLazyLoadImage:_}=O??{},N={...C,...G},A=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(D?.uid)},
|
|
4
4
|
"pageContext": ${JSON.stringify(O)},
|
|
5
5
|
"setting":${JSON.stringify(C)},
|
|
6
6
|
"styles":${JSON.stringify(G)},
|
|
7
|
-
"productUrl":{{product.url | json
|
|
8
|
-
"product":{{product | json
|
|
9
|
-
"collectionUrl": {{ collection.url | json
|
|
10
|
-
"collection": {{ collection | json
|
|
7
|
+
"productUrl":{{product.url | json }},
|
|
8
|
+
"product":{{ product | json }},
|
|
9
|
+
"collectionUrl": {{ collection.url | json }},
|
|
10
|
+
"collection": {{ collection | json }}
|
|
11
11
|
}
|
|
12
12
|
`,B=y({"section-id":"{{section.id}}","data-id":`${D?.uid}`}),{isOnlyFeatureAllDevices:U,isRenderGalleryGrid:k}=i(N?.position,C?.type),q=k?{}:y({"data-only-image":$("product.media.size > 1","false","true")}),{wrapperClasses:E,productImagesGalleryClasses:J}=g(I),w=h({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),T=h({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:x,wrapContainerStyleOnlyOneImage:L,galleryImageStyle:M}=f(N),R=u({shape:N.shape,shapeForBottom:N.shapeForBottom,shapeFor1Col:N.shapeFor1Col,shapeFor2Col:N.shapeFor2Col,shapeForFtOnly:N.shapeForFtOnly,shapeForInsideBottom:N.shapeForInsideBottom??n,shapeForInside:N.shapeForInside??n},N.position),V=a(N.position,R,N?.spacing),W=()=>e`
|
|
13
|
-
${
|
|
13
|
+
${t({uid:D?.uid||"",customProps:z?.[0].customProps},z?.map(o=>{if(o)return e`${s({...o,isInsideProductImage:!0,imageData:{imageShape:G?.ftShape,imageAlign:G?.align,imageLayout:G?.position},dotData:{dotSize:C?.ftDotSize,dotGapToCarousel:C?.ftDotGapToCarousel,dotStyle:C?.ftDotStyle}})}`}))}
|
|
14
14
|
`,H=()=>e`
|
|
15
15
|
<div
|
|
16
16
|
class="${J}"
|
|
@@ -40,5 +40,5 @@ import{template as e,isLocalEnv as o,baseAssetURL as s,WrapRenderChildren as r,R
|
|
|
40
40
|
${v(!U,H())}
|
|
41
41
|
</div>
|
|
42
42
|
</gp-product-images-v3>
|
|
43
|
-
${v(o,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-images-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${
|
|
43
|
+
${v(o,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-images-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-images-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
44
44
|
`};export{ProductImages as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{template as t}from"@gem-sdk/core";import{getClass as
|
|
1
|
+
import{template as t}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=n(o);return t`
|
|
2
2
|
<gp-product
|
|
3
3
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
6
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json
|
|
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>
|
|
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 }}" />
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{template as t,RenderChildren as
|
|
2
|
-
${r?.map((
|
|
3
|
-
${
|
|
1
|
+
import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e),d=()=>t`
|
|
2
|
+
${r?.map((o,e)=>{if(o)return t`
|
|
3
|
+
${n({...o,index:e})}
|
|
4
4
|
`}).join("")}
|
|
5
5
|
`;return t`
|
|
6
6
|
<gp-product
|
|
7
7
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 , "inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
|
|
8
8
|
class="${c}"
|
|
9
9
|
>
|
|
10
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json
|
|
10
|
+
<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>
|
|
11
11
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${i}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
12
12
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
13
13
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
14
14
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
15
|
-
${
|
|
15
|
+
${d()}
|
|
16
16
|
{%- endform -%}
|
|
17
17
|
</gp-product>
|
|
18
18
|
`};export{ProductListItem as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{template as t}from"@gem-sdk/core";import{getClass as
|
|
1
|
+
import{template as t}from"@gem-sdk/core";import{getClass as n}from"./common/classes.js";let ProductListItem=o=>{let{pageContext:e,children:a}=o,{productItemClass:r,gpProductClass:i}=n(o);return t`
|
|
2
2
|
<gp-product
|
|
3
3
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
|
|
4
4
|
class="${i}"
|
|
5
5
|
>
|
|
6
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json
|
|
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>
|
|
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 }}" />
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{template as t,RenderChildren as
|
|
2
|
-
${r?.map((
|
|
3
|
-
${
|
|
1
|
+
import{template as t,RenderChildren as n}from"@gem-sdk/core";import{getClass as o}from"./common/classes.js";let ProductListItem=e=>{let{pageContext:a,rawChildren:r}=e,{productItemClass:i,gpProductClass:c}=o(e),d=()=>t`
|
|
2
|
+
${r?.map((o,e)=>{if(o)return t`
|
|
3
|
+
${n({...o,index:e})}
|
|
4
4
|
`}).join("")}
|
|
5
5
|
`;return t`
|
|
6
6
|
<gp-product
|
|
7
7
|
gp-context='{"variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "quantity": 1 ,"inventoryQuantity": {{ variant.inventory_quantity }}, "formId": "{{ product_form_id }}"}'
|
|
8
8
|
class="${c}"
|
|
9
9
|
>
|
|
10
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json
|
|
10
|
+
<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>
|
|
11
11
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${i}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
12
12
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
13
13
|
<input type="hidden" min="1" name="quantity" value="{{ quantity }}" />
|
|
14
14
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
15
|
-
${
|
|
15
|
+
${d()}
|
|
16
16
|
{%- endform -%}
|
|
17
17
|
</gp-product>
|
|
18
18
|
`};export{ProductListItem as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{template as
|
|
2
|
-
${f("value in values",
|
|
3
|
-
${_(
|
|
4
|
-
${v(`{%- assign presets = "${
|
|
5
|
-
${v(`{% assign hiddenPresetOptions = "${
|
|
1
|
+
import{template as t,isLocalEnv as i,baseAssetURL as e,DEVICES as o,getResponsiveValueByScreen as s}from"@gem-sdk/core";import n from"../../../text/components/Text.liquid.js";import a from"./components/variants/index.liquid.js";import r from"./components/dropdown-swatches/Dropdown.liquid.js";import p from"./components/dropdown-group/DropdownGroup.liquid.js";import{getSettingPreloadData as l}from"../../../helpers.js";import{mappingVariantStyles as d}from"./utils/mappingVariantStyles.js";import{createClass as m,createStyle as c,createAttr as u,Liquid as v,LiquidFor as f,LiquidIf as _,If as $}from"@gem-sdk/system";import{getAttrs as g}from"./common/main/getAttr.js";import{getVariantOptionGroupStyle as h,getWrapperStyle as y}from"./common/main/styles.js";import{getVariantOptionGroupClass as j,getWrapDropdownClass as w}from"./common/main/classes.js";import{getTextVariantTitleData as S,getDropdownGroupData as P}from"./common/main/getData.js";import{getWrapVariantOptionClass as b}from"./common/variants/classes.js";import{getStyleOfObject as A}from"../../helpers/function.js";import{getMarginBottomStyle as D}from"./common/variants/styles.js";import{renderOptionValuesNewFormatSwatches as N}from"./OptionVariantsNewFormat.liquid.js";import{renderOptionValuesOld as V}from"./OptionVariantsOldFormat.liquid.js";let DEFAULT_ADVANCED_DISPLAY_SETTING={desktop:!0,tablet:!0,mobile:!0},ProductVariants=E=>{let{builderProps:O,styles:T,setting:x,advanced:q}=E,{align:F,swatchItemWidth:G,dropdownItemWidth:C,swatchSpacing:I,optionTypo:k,marginBottom:L}=T??{},{label:J,optionType:z,showAsSwatches:M,layout:U,hasPreSelected:W}=x??{},R=q?.d??DEFAULT_ADVANCED_DISPLAY_SETTING,{uid:Y}=O??{},H="groupOption"===z,K=()=>{let t={};return o.forEach(i=>{let e=s(G,i);t[i]="auto"===e}),t},Q=()=>{let t={};return o.forEach(i=>{t[i]=C?.[i]==="fill"}),t},B=x?.variantPresets?d(x?.variantPresets,T):[],X=B?.map(t=>({...t,presets:{[t.optionType]:t.presets[t.optionType]}})),Z={...x,variantPresets:X},tt=t=>{let i={"'":"'",'"':"""},e=t;for(let o in i)t.indexOf(o)>=0&&(e=e.replaceAll(o,i[o]));return e},ti=()=>x?.variantPresets?.map(t=>`${tt(t.optionName)}($2)${t.optionType}`).join("($1)"),te=()=>x?.variantPresets?.filter(t=>!!t?.hide)?.map(t=>t.optionName).join(","),to=({showDropdown:i,isRenderDefault:e,typeOfOption:o})=>t`
|
|
2
|
+
${f("value in values",a({id:"{{option.name | escape}}-{{value | escape}}",variantKey:"{{option.name | escape}}-{{option.position}}-{{ forloop.index }}",showAsSwatches:M,uid:Y,name:"{{option.name | escape}}",value:{label:"{{value | escape}}"},checked:W?"{%- if option.selected_value == value -%}true{% else %}false{%- endif -%}":"false",optionPosition:"rootForloop",typeOfOption:o,activeClass:W?"{%- if option.selected_value == value -%}option-item-active{%- endif -%}":"",...T,...Z,swatchAutoWidth:K(),optionTypo:k,isRenderDefault:e}))}
|
|
3
|
+
${_(i?'type == "dropdown"':"false",r({...T,...Z,swatchAutoWidth:Q(),optionTypo:k}))}`,ts=x?.variantPresets?.map(t=>({name:tt(t.optionName),type:t.optionType})).map(t=>`${t.name}($1)${t.type}`).join("($2)").toString(),tn={renderVariantItem:to,variantPresetsLiquid:ts??""},ta=m(j(F)),tr=c(h(I,I)),tp=S(E,"Liquid"),tl=m(b(U,F)),td=()=>t`
|
|
4
|
+
${v(`{%- assign presets = "${ti()}" | split: '($1)' -%}`)}
|
|
5
|
+
${v(`{% assign hiddenPresetOptions = "${te()}" | split: ',' %}`)}
|
|
6
6
|
|
|
7
7
|
${v(`{% assign all_option_names = options | map: 'name' %}
|
|
8
8
|
{% assign filtered_options_string = '' %}
|
|
@@ -32,7 +32,7 @@ import{template as e,isLocalEnv as t,baseAssetURL as i,DEVICES as s,getResponsiv
|
|
|
32
32
|
${f("option in options",`
|
|
33
33
|
<div
|
|
34
34
|
option-name="{{option.name | escape}}"
|
|
35
|
-
class="${
|
|
35
|
+
class="${tl} ${_("hiddenPresetOptions contains option.name","gp-hidden")}"
|
|
36
36
|
style="${A(D(L))}${v("{% if forloop.last or option.name == last_option_name %}--mb:0;--mb-mobile:0;--mb-tablet:0;{% endif %}")}"
|
|
37
37
|
>
|
|
38
38
|
${v("{%- assign showVariantClass = 'variant-display' -%}")}
|
|
@@ -41,11 +41,11 @@ import{template as e,isLocalEnv as t,baseAssetURL as i,DEVICES as s,getResponsiv
|
|
|
41
41
|
${v("{%- assign presetDetail = preset | split: '($2)' -%}")}
|
|
42
42
|
${_("presetDetail[1] == 'dropdown' and presetDetail[0] == optionName",`${v("{%- assign showVariantClass = '' -%}")} ${v("{%- break -%}")}`)}
|
|
43
43
|
`)}
|
|
44
|
-
${$(J,
|
|
44
|
+
${$(J,n(tp)," ")}
|
|
45
45
|
<div
|
|
46
46
|
variant-option-name="{{option.name | escape}}"
|
|
47
|
-
class="${
|
|
48
|
-
style="${A(
|
|
47
|
+
class="${ta}"
|
|
48
|
+
style="${A(tr)}"
|
|
49
49
|
>
|
|
50
50
|
${v("{%- assign values = option.values -%}")}
|
|
51
51
|
${v("{%- assign rootForloop = forloop.index0 -%}")}
|
|
@@ -59,47 +59,47 @@ import{template as e,isLocalEnv as t,baseAssetURL as i,DEVICES as s,getResponsiv
|
|
|
59
59
|
{%- endif -%}
|
|
60
60
|
`)}
|
|
61
61
|
${$(!W,v("{%- assign selectedValue = null -%}"),"")}
|
|
62
|
-
${$(M,
|
|
62
|
+
${$(M,tm(),to({showDropdown:!1,isRenderDefault:!0,typeOfOption:"optionType"}))}
|
|
63
63
|
</div>
|
|
64
64
|
</div>`)}
|
|
65
|
-
`,
|
|
66
|
-
${_("shop.metafields.GEMPAGES.swatchesJSONFormat and shop.metafields.GEMPAGES.swatchesJSONFormat != blank",N(
|
|
67
|
-
`,
|
|
68
|
-
<div className="${
|
|
69
|
-
${p(
|
|
65
|
+
`,tm=()=>t`
|
|
66
|
+
${_("shop.metafields.GEMPAGES.swatchesJSONFormat and shop.metafields.GEMPAGES.swatchesJSONFormat != blank",N(tn),V(tn))}
|
|
67
|
+
`,tc=m(w(F)),tu=P(E),tv=()=>`
|
|
68
|
+
<div className="${tc}">
|
|
69
|
+
${p(tu)}
|
|
70
70
|
</div>
|
|
71
|
-
`,
|
|
71
|
+
`,tf=u(g({uid:Y,hasPreSelected:W,cssClass:q?.cssClass})),t_=c(y(E)),t$=m({"gp-flex gp-flex-col !gp-ml-0":!0}),tg=()=>{let t=i?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${e}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${l('class="gps-link" delay',"src")}="${t}" defer="defer"></script>`};return t`
|
|
72
72
|
${v("{%- assign total_combinations = 1 -%}")}
|
|
73
73
|
${f("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
|
|
74
|
-
<gp-product-variants${
|
|
74
|
+
<gp-product-variants ${tf}>
|
|
75
75
|
<script gp-data type="application/json">
|
|
76
76
|
{
|
|
77
77
|
"setting":${JSON.stringify(Z)?.replaceAll("'","'")},
|
|
78
78
|
"styles":${JSON.stringify(T)},
|
|
79
|
-
"variants":{{product.variants | json
|
|
80
|
-
"optionsWithValues": {{product.options_with_values | json
|
|
81
|
-
"variantSelected": {{ variant | json
|
|
82
|
-
"variantInventoryQuantity": {{product.variants | map: 'inventory_quantity' | json
|
|
83
|
-
"variantInventoryPolicy": {{product.variants | map: 'inventory_policy' | json
|
|
84
|
-
"moneyFormat": {{shop.money_format | json
|
|
85
|
-
"productId": {{product.id | json
|
|
86
|
-
"productUrl": {{product.url | json
|
|
87
|
-
"productHandle": {{product.handle | json
|
|
79
|
+
"variants":{{product.variants | json}},
|
|
80
|
+
"optionsWithValues": {{product.options_with_values | json}},
|
|
81
|
+
"variantSelected": {{ variant | json }},
|
|
82
|
+
"variantInventoryQuantity": {{product.variants | map: 'inventory_quantity' | json }},
|
|
83
|
+
"variantInventoryPolicy": {{product.variants | map: 'inventory_policy' | json }},
|
|
84
|
+
"moneyFormat": {{shop.money_format | json }},
|
|
85
|
+
"productId": {{product.id | json }},
|
|
86
|
+
"productUrl": {{product.url | json }},
|
|
87
|
+
"productHandle": {{product.handle | json }},
|
|
88
88
|
"displayState": ${JSON.stringify(R)},
|
|
89
89
|
"totalVariantCombinations": {{total_combinations}},
|
|
90
|
-
"firstAvailableVariant": {{product.selected_or_first_available_variant | json
|
|
90
|
+
"firstAvailableVariant": {{product.selected_or_first_available_variant | json }}
|
|
91
91
|
}
|
|
92
92
|
</script>
|
|
93
93
|
<div class="gp-hidden" style="--hvr-shadow: none; --hvr-shadow-tablet: none; --hvr-shadow-mobile: none"></div>
|
|
94
94
|
${v("{%- assign options = product.options_with_values -%}")}
|
|
95
95
|
${v("{%- assign variants = product.variants -%}")}
|
|
96
|
-
${_("options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'","<div></div>",
|
|
97
|
-
class="${
|
|
98
|
-
style="${
|
|
96
|
+
${_("options.size == 0 or options.size == 1 and variants.size == 1 and variants[0].title == 'Default Title' and variants[0].option1 == 'Default Title'","<div></div>",t`<div
|
|
97
|
+
class="${t$}"
|
|
98
|
+
style="${t_}"
|
|
99
99
|
>
|
|
100
|
-
${$(H,
|
|
100
|
+
${$(H,tv(),td())}
|
|
101
101
|
</div>`)}
|
|
102
102
|
</gp-product-variants>
|
|
103
103
|
|
|
104
|
-
${
|
|
104
|
+
${tg()}
|
|
105
105
|
`};export{ProductVariants as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-sdk/core";import
|
|
1
|
+
import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-sdk/core";import o from"../../../grid/components/row/Row.liquid.js";import{LiquidIf as d,If as a}from"@gem-sdk/system";import{getSettingPreloadData as n,getStaticLocale as s}from"../../../helpers.js";import{getData as c,DYNAMIC_PRODUCT_STATUS as p,STATIC_PRODUCT_STATUS as l,PRODUCT_ID_LATEST as u}from"./common/helpers.js";let Product=f=>{let{children:m,setting:g,style:y,builderProps:v,rawChildren:_,advanced:$}=f,{isSyncProduct:S,productSetting:j}=g??{},I=j?.hasPreSelected??!1,{rowSetting:b,rowStyles:h,formatVariantId:q,formatProductId:P,productStatus:V,preSelectedOptionIds:k,productHandle:w,advancedStyle:E}=c(f),x=()=>t`
|
|
2
2
|
{%- liquid
|
|
3
3
|
if request.page_type == 'product'
|
|
4
4
|
if '${V}' == '${l}'
|
|
@@ -58,7 +58,7 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
|
|
|
58
58
|
-%}
|
|
59
59
|
`,B=()=>t`
|
|
60
60
|
{%- assign gpBkProduct = product -%}
|
|
61
|
-
${
|
|
61
|
+
${a(V==p,A(),x())}
|
|
62
62
|
`,G=()=>t`
|
|
63
63
|
{%- assign initVariantId = ${q} -%}
|
|
64
64
|
{%- assign product_form_id = 'product-form-' | append: "${v?.uid}" -%}
|
|
@@ -81,19 +81,19 @@ import{template as t,RenderIf as e,isLocalEnv as i,baseAssetURL as r}from"@gem-s
|
|
|
81
81
|
class="${$?.cssClass}"
|
|
82
82
|
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${k}], "isSyncProduct": "${S}", "hasPreSelected": ${I}, "variantSelected": {{ variant | json | escape }}, "inventory_management": {{ variant.inventory_management | json | escape }}, "inventory_policy": {{ variant.inventory_policy | json | escape }}, "inventoryQuantity": {{ variant.inventory_quantity }}, "quantity": 1, "formId": "{{ product_form_id }}" }'
|
|
83
83
|
>
|
|
84
|
-
<script gp-data type="application/json">{"variantSelected": {{ variant | json
|
|
84
|
+
<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>
|
|
85
85
|
<product-form class="product-form">
|
|
86
86
|
{%- form 'product', product, id: product_form_id, class: 'form contents', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
|
|
87
87
|
<input type="hidden" name="id" value="{{ variant.id }}" />
|
|
88
88
|
<input type="hidden" name="quantity" value="{{ quantity }}" />
|
|
89
89
|
<button type="submit" onclick="return false;" style="display:none;"></button>
|
|
90
|
-
${
|
|
90
|
+
${o({builderProps:{...v,uid:v?.uid,uidInteraction:`${v?.uid}-row`},style:y,styles:h,setting:b,children:m,rawChildren:_})}
|
|
91
91
|
{%- endform -%}
|
|
92
92
|
</product-form>
|
|
93
93
|
</gp-product>
|
|
94
94
|
{%- assign product = gpBkProduct -%}
|
|
95
95
|
`;return t`
|
|
96
96
|
${B()}
|
|
97
|
-
${
|
|
97
|
+
${d("product != empty and product != null",O(),H())}
|
|
98
98
|
${e(i,`<script ${n('class="gps-link" delay',"src")}="{{ 'gp-product-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
99
99
|
`};export{Product as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "8.0.0-dev.
|
|
3
|
+
"version": "8.0.0-dev.124",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"i18n:generate": "node ./scripts/update-locales-to-setting.js"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/core": "8.0.0-dev.
|
|
30
|
+
"@gem-sdk/core": "8.0.0-dev.123",
|
|
31
31
|
"@gem-sdk/styles": "8.0.0-dev.115",
|
|
32
32
|
"@gem-sdk/system": "8.0.0-dev.115",
|
|
33
33
|
"@types/react-transition-group": "4.4.12",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),React=require("react"),index=require("../../../constants/index.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),useDetectBothSubscriptionTypes=require("../hooks/useDetectBothSubscriptionTypes.js"),useSellingSubscription=require("../hooks/useSellingSubscription.js"),useSubscriptionVisibility=require("../hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./SellingPlanDropdown.js"),SellingPlanLabel=require("./SellingPlanLabel.js"),SellingPlanRadio=require("./SellingPlanRadio.js"),SubscriptionDetail=require("./SubscriptionDetail.js"),SubscriptionRadio=require("./SubscriptionRadio.js");const ProductSubscription=({styles:e,setting:i})=>{let s=core.useProduct(),t=useSellingSubscription.useSellingSubscription(i),n=t.sellingPlans,l=t.defaultValue,r=React.useRef(null),u=React.useId(),a=useDetectBothSubscriptionTypes.useDetectBothSubscriptionTypes(r),{selectedType:o,shouldShowRadio:c,isOneTimeHidden:S,hasNoSellingPlanOptions:p,setSubscriptionSellingType:d}=useSubscriptionVisibility.useSubscriptionVisibility({setting:i,hasBothTypes:a,sellingPlans:n}),b=system.createStyle(styles.getSubscriptionStyles(e,i)),m=system.createStyle(styles.getSubscriptionWrapperStyles(e?.align)),j=system.createClass(classes.getWrapperClasses()),x=system.createClass(classes.getContainerClasses()),{isEditMode:g}=core.useRenderMode(),y=`product-subscription-${s?.baseID}`,R=s?.baseID,P=`subscription-type-selection-${u}`,h=i?.sellingType===index.SubscriptionEnum.ONE_TIME,T=i?.sellingType===index.SubscriptionEnum.SUBSCRIPTION;if(S||p)return g?jsxRuntime.jsx(OneTimePurchaseTooltip.OneTimePurchaseTooltip,{ref:r,setting:i}):null;let q=e=>jsxRuntime.jsx("div",{ref:r,"data-selling-type":i?.sellingType,id:y,className:j,style:m,children:e}),D=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:i?.sellingStyle==="radio"?jsxRuntime.jsx(SellingPlanRadio.SellingPlanRadio,{setting:i,defaultValue:l||""}):jsxRuntime.jsx(SellingPlanDropdown.SellingPlanDropdown,{setting:i,defaultValue:l||""})});return q(h&&c?jsxRuntime.jsx("div",{className:x,style:b,children:jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${R}-one-time-radio`,name:P,value:index.SubscriptionEnum.ONE_TIME,checked:o===index.SubscriptionEnum.ONE_TIME,onChange:e=>{e.target.checked&&d(index.SubscriptionEnum.ONE_TIME)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:i,styles:e})})}):T&&c?jsxRuntime.jsxs("div",{className:x,style:b,children:[jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${R}-subscription-radio`,name:P,value:index.SubscriptionEnum.SUBSCRIPTION,checked:o===index.SubscriptionEnum.SUBSCRIPTION,onChange:e=>{e.target.checked&&d(index.SubscriptionEnum.SUBSCRIPTION)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:i,styles:e})}),jsxRuntime.jsx("div",{className:"gp-pl-7",children:D()}),jsxRuntime.jsx("div",{className:"gp-pl-7",children:jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:i,styles:e})})]}):jsxRuntime.jsxs("div",{className:x,style:b,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:i,styles:e}),D(),jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:i,styles:e})]}))};exports.default=ProductSubscription;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var React=require("react"),index=require("../../../constants/index.js");const DEBOUNCE_DELAY=100,findSubscriptionContainer=e=>{let t=e.closest("[data-product-id]");return t instanceof HTMLElement?t:null},getSubscriptionElements=e=>Array.from(e.querySelectorAll("[data-selling-type]")).filter(e=>e instanceof HTMLElement),useDetectBothSubscriptionTypes=e=>{let[t,r]=React.useState(!1),n=React.useRef(null),u=React.useRef(null),i=React.useRef(null),c=React.useCallback(()=>{let t=e?.current;if(!t){r(!1);return}let n=findSubscriptionContainer(t);if(!n){r(!1);return}let u=getSubscriptionElements(n);if(u.length<2){r(!1);return}let i=u.some(e=>e.dataset.sellingType===index.SubscriptionEnum.ONE_TIME),c=u.some(e=>e.dataset.sellingType===index.SubscriptionEnum.SUBSCRIPTION),l=i&&c;r(l)},[e]),l=React.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),i.current&&(clearTimeout(i.current),i.current=null),n.current&&(n.current.disconnect(),n.current=null)},[]);return React.useEffect(()=>{if(!e?.current){r(!1);return}l();let t=requestAnimationFrame(()=>{c(),i.current=globalThis.setTimeout(()=>{c(),i.current=null},200)}),s=()=>{u.current&&clearTimeout(u.current),u.current=globalThis.setTimeout(c,100)};n.current=new MutationObserver(s);let a=findSubscriptionContainer(e.current);return a&&n.current.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-selling-type"]}),()=>{cancelAnimationFrame(t),l()}},[e,c,l]),t};exports.useDetectBothSubscriptionTypes=useDetectBothSubscriptionTypes;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s,Fragment as i}from"react/jsx-runtime";import{useProduct as t,useRenderMode as l}from"@gem-sdk/core";import{createStyle as o,createClass as r}from"@gem-sdk/system";import{useRef as n,useId as m}from"react";import{SubscriptionEnum as a}from"../../../constants/index.js";import{getWrapperClasses as c,getContainerClasses as p}from"../common/classes.js";import{getSubscriptionStyles as d,getSubscriptionWrapperStyles as u}from"../common/styles.js";import{useDetectBothSubscriptionTypes as g}from"../hooks/useDetectBothSubscriptionTypes.js";import{useSellingSubscription as f}from"../hooks/useSellingSubscription.js";import{useSubscriptionVisibility as h}from"../hooks/useSubscriptionVisibility.js";import{OneTimePurchaseTooltip as S}from"./OneTimePurchaseTooltip.js";import{SellingPlanDropdown as y}from"./SellingPlanDropdown.js";import{SellingPlanLabel as b}from"./SellingPlanLabel.js";import{SellingPlanRadio as I}from"./SellingPlanRadio.js";import{SubscriptionDetail as N}from"./SubscriptionDetail.js";import{SubscriptionRadio as T}from"./SubscriptionRadio.js";let ProductSubscription=({styles:j,setting:P})=>{let k=t(),O=f(P),v=O.sellingPlans,E=O.defaultValue,C=n(null),R=m(),B=g(C),{selectedType:D,shouldShowRadio:M,isOneTimeHidden:U,hasNoSellingPlanOptions:V,setSubscriptionSellingType:$}=h({setting:P,hasBothTypes:B,sellingPlans:v}),_=o(d(j,P)),x=o(u(j?.align)),w=r(c()),L=r(p()),{isEditMode:q}=l(),z=`product-subscription-${k?.baseID}`,A=k?.baseID,F=`subscription-type-selection-${R}`,G=P?.sellingType===a.ONE_TIME,H=P?.sellingType===a.SUBSCRIPTION;if(U||V)return q?e(S,{ref:C,setting:P}):null;let J=s=>e("div",{ref:C,"data-selling-type":P?.sellingType,id:z,className:w,style:x,children:s}),K=()=>e(i,{children:P?.sellingStyle==="radio"?e(I,{setting:P,defaultValue:E||""}):e(y,{setting:P,defaultValue:E||""})});return J(G&&M?e("div",{className:L,style:_,children:e(T,{id:`${A}-one-time-radio`,name:F,value:a.ONE_TIME,checked:D===a.ONE_TIME,onChange:e=>{e.target.checked&&$(a.ONE_TIME)},children:e(b,{setting:P,styles:j})})}):H&&M?s("div",{className:L,style:_,children:[e(T,{id:`${A}-subscription-radio`,name:F,value:a.SUBSCRIPTION,checked:D===a.SUBSCRIPTION,onChange:e=>{e.target.checked&&$(a.SUBSCRIPTION)},children:e(b,{setting:P,styles:j})}),e("div",{className:"gp-pl-7",children:K()}),e("div",{className:"gp-pl-7",children:e(N,{setting:P,styles:j})})]}):s("div",{className:L,style:_,children:[e(b,{setting:P,styles:j}),K(),e(N,{setting:P,styles:j})]}))};export{ProductSubscription as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as e,useRef as t,useCallback as r,useEffect as n}from"react";import{SubscriptionEnum as u}from"../../../constants/index.js";let DEBOUNCE_DELAY=100,findSubscriptionContainer=e=>{let t=e.closest("[data-product-id]");return t instanceof HTMLElement?t:null},getSubscriptionElements=e=>Array.from(e.querySelectorAll("[data-selling-type]")).filter(e=>e instanceof HTMLElement),useDetectBothSubscriptionTypes=i=>{let[l,c]=e(!1),s=t(null),o=t(null),a=t(null),m=r(()=>{let e=i?.current;if(!e){c(!1);return}let t=findSubscriptionContainer(e);if(!t){c(!1);return}let r=getSubscriptionElements(t);if(r.length<2){c(!1);return}let n=r.some(e=>e.dataset.sellingType===u.ONE_TIME),l=r.some(e=>e.dataset.sellingType===u.SUBSCRIPTION),s=n&&l;c(s)},[i]),p=r(()=>{o.current&&(clearTimeout(o.current),o.current=null),a.current&&(clearTimeout(a.current),a.current=null),s.current&&(s.current.disconnect(),s.current=null)},[]);return n(()=>{if(!i?.current){c(!1);return}p();let e=requestAnimationFrame(()=>{m(),a.current=globalThis.setTimeout(()=>{m(),a.current=null},200)}),t=()=>{o.current&&clearTimeout(o.current),o.current=globalThis.setTimeout(m,100)};s.current=new MutationObserver(t);let r=findSubscriptionContainer(i.current);return r&&s.current.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-selling-type"]}),()=>{cancelAnimationFrame(e),p()}},[i,m,p]),l};export{useDetectBothSubscriptionTypes};
|