@gem-sdk/components 8.0.0-dev.123 → 8.0.0-dev.125
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/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/common/classes.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/common/styles.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanRadio.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/post-purchase/product/components/product-subscription/ProductSubscription.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/common/classes.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/common/styles.js +1 -1
- package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanRadio.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 +1 -1
package/dist/cjs/post-purchase/product/components/product-subscription/ProductSubscription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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"),useSellingPlanChange=require("./hooks/useSellingPlanChange.js"),useSellingSubscription=require("./hooks/useSellingSubscription.js"),useSellingPlanOptions=require("./hooks/useSellingPlanOptions.js"),useSubscriptionVisibility=require("./hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./components/OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./components/SellingPlanDropdown.js"),SellingPlanLabel=require("./components/SellingPlanLabel.js"),SellingPlanRadio=require("./components/SellingPlanRadio.js"),SubscriptionDetail=require("./components/SubscriptionDetail.js"),SubscriptionRadio=require("./components/SubscriptionRadio.js");const ProductSubscription=({styles:e,setting:s,builderProps:i})=>{let n=core.useProduct(),{defaultValue:l,selectedSellingPlan:t,setSelectedSellingPlan:r}=useSellingSubscription.useSellingSubscription(s),u=useSellingPlanOptions.useSellingPlanOptions(s),{selectedValue:a,handleSellingPlanChange:o}=useSellingPlanChange.useSellingPlanChange({defaultValue:l,selectedSellingPlan:t,setSelectedSellingPlan:r,sellingPlanOptions:u}),c=React.useRef(null),p=React.useId(),{selectedType:S,shouldShowRadio:d,isOneTimeHidden:m,hasNoSellingPlanOptions:g,setSubscriptionSellingType:j}=useSubscriptionVisibility.useSubscriptionVisibility({setting:s}),x=system.createStyle(styles.getSubscriptionStyles(e
|
|
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"),useSellingPlanChange=require("./hooks/useSellingPlanChange.js"),useSellingSubscription=require("./hooks/useSellingSubscription.js"),useSellingPlanOptions=require("./hooks/useSellingPlanOptions.js"),useSubscriptionVisibility=require("./hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./components/OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./components/SellingPlanDropdown.js"),SellingPlanLabel=require("./components/SellingPlanLabel.js"),SellingPlanRadio=require("./components/SellingPlanRadio.js"),SubscriptionDetail=require("./components/SubscriptionDetail.js"),SubscriptionRadio=require("./components/SubscriptionRadio.js");const ProductSubscription=({styles:e,setting:s,builderProps:i})=>{let n=core.useProduct(),{defaultValue:l,selectedSellingPlan:t,setSelectedSellingPlan:r}=useSellingSubscription.useSellingSubscription(s),u=useSellingPlanOptions.useSellingPlanOptions(s),{selectedValue:a,handleSellingPlanChange:o}=useSellingPlanChange.useSellingPlanChange({defaultValue:l,selectedSellingPlan:t,setSelectedSellingPlan:r,sellingPlanOptions:u}),c=React.useRef(null),p=React.useId(),{selectedType:S,shouldShowRadio:d,isOneTimeHidden:m,hasNoSellingPlanOptions:g,setSubscriptionSellingType:j}=useSubscriptionVisibility.useSubscriptionVisibility({setting:s}),x=system.createStyle(styles.getSubscriptionStyles(e)),b=system.createStyle(styles.getSubscriptionWrapperStyles(e?.align)),R=system.createClass(classes.getWrapperClasses()),P=system.createClass(classes.getContainerClasses()),{isEditMode:y}=core.useRenderMode(),h=`product-subscription-${n?.baseID}`,O=n?.baseID,T=`subscription-type-selection-${p}`,C=s?.sellingType===index.SubscriptionEnum.ONE_TIME,I=s?.sellingType===index.SubscriptionEnum.SUBSCRIPTION;if(m||g)return y?jsxRuntime.jsx(OneTimePurchaseTooltip.OneTimePurchaseTooltip,{ref:c,setting:s}):null;let q=e=>jsxRuntime.jsx("div",{ref:c,"data-selling-type":s?.sellingType,id:h,className:R,style:b,children:e}),E=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:s?.sellingStyle==="radio"?jsxRuntime.jsx(SellingPlanRadio.SellingPlanRadio,{setting:s,styles:e,builderProps:i,productId:O??"",sellingPlanOptions:u,selectedValue:a,onChange:o}):jsxRuntime.jsx(SellingPlanDropdown.SellingPlanDropdown,{setting:s,sellingPlanOptions:u,selectedValue:a,onChange:o})});return q(C&&d?jsxRuntime.jsx("div",{className:P,style:x,children:jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${O}-one-time-radio`,name:T,value:index.SubscriptionEnum.ONE_TIME,checked:S===index.SubscriptionEnum.ONE_TIME,className:"!gp-items-start",onChange:e=>{e.target.checked&&j(index.SubscriptionEnum.ONE_TIME)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e})})}):I&&d?jsxRuntime.jsxs("div",{className:P,style:x,children:[jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${O}-subscription-radio`,name:T,value:index.SubscriptionEnum.SUBSCRIPTION,checked:S===index.SubscriptionEnum.SUBSCRIPTION,className:"!gp-items-start",onChange:e=>{e.target.checked&&j(index.SubscriptionEnum.SUBSCRIPTION)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e})}),S===index.SubscriptionEnum.SUBSCRIPTION&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"gp-pl-7",children:E()}),jsxRuntime.jsx("div",{className:"gp-pl-7",children:jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:s,styles:e})})]})]}):jsxRuntime.jsxs("div",{className:P,style:x,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e}),E(),jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:s,styles:e})]}))};exports.default=ProductSubscription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var core=require("@gem-sdk/core");const getWrapperClasses=()=>core.composeClasses("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>core.composeClasses("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>core.composeClasses("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>core.composeClasses("gp-mb-2 gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>core.composeClasses("gp-flex gp-flex-col
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core");const getWrapperClasses=()=>core.composeClasses("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>core.composeClasses("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>core.composeClasses("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>core.composeClasses("gp-mb-2 gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>core.composeClasses("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>core.composeClasses("gp-text-[14px] gp-leading-[1.3] gp-text-text-light-500"),getSubscriptionRadioLabelClasses=e=>{let s=e?"gp-opacity-50 gp-cursor-not-allowed":"";return core.composeClasses(`gp-flex gp-items-center gp-cursor-pointer gp-gap-2 ${s}`.trim())},getSubscriptionRadioInputClasses=()=>core.composeClasses("gp-relative gp-min-h-[24px] gp-min-w-[24px] gp-w-5 gp-h-5 gp-cursor-pointer gp-appearance-none gp-rounded-full gp-bg-light-100 gp-transition-all gp-border-light-500 gp-border-2 checked:gp-border-[#1879b9] checked:gp-border-[5px] checked:gp-after:gp-content-[''] checked:gp-after:gp-absolute checked:gp-after:gp-top-1/2 checked:gp-after:gp-left-1/2 checked:gp-after:gp-transform checked:gp-after:gp--translate-x-1/2 checked:gp-after:gp--translate-y-1/2 checked:gp-after:gp-h-2 checked:gp-after:gp-w-2 checked:gp-after:gp-rounded-full checked:gp-after:gp-bg-white disabled:gp-cursor-not-allowed"),getSellingPlanDropdownContainerClasses=()=>core.composeClasses("gp-relative"),getSellingPlanDropdownLabelClasses=()=>core.composeClasses("!gp-max-w-[calc(100%_-_66px)] gp-absolute gp-left-[12px] gp-top-[6px] gp-p-0 gp-text-xs gp-leading-[1.3] gp-text-[#737373] gp-transition-[top]"),getSellingPlanDropdownLabelSpanClasses=()=>core.composeClasses("gp-max-w-full"),getSellingPlanDropdownLabelInnerSpanClasses=()=>core.composeClasses("gp-block gp-overflow-hidden"),getSellingPlanDropdownSelectClasses=({isNoLabel:e=!1})=>core.composeClasses(`gp-min-h-[47px] gp-appearance-none gp-bg-transparent gp-w-full gp-whitespace-nowrap gp-rounded-[5px] gp-border gp-border-[#d9d9d9] gp-pl-[11px] gp-pr-[40px] gp-text-[14px] gp-outline-none gp-text-[#545454] gp-leading-[1.3] ${e?"gp-pt-0 gp-pb-0":"gp-pt-[21px] gp-pb-[6px]"}`),getSellingPlanDropdownOptionClasses=()=>core.composeClasses("gp-text-[14px] gp-text-black"),getSellingPlanDropdownIconContainerClasses=()=>core.composeClasses("gp-pointer-events-none gp-absolute gp-right-[2px] gp-top-[50%] gp-flex gp-h-[43%] gp-w-[40px] gp-translate-y-[-50%] gp-items-center gp-justify-center gp-border-l-[1px] gp-bg-white gp-border-[#545454]"),getSellingPlanDropdownIconClasses=()=>core.composeClasses("gp-h-[10px] gp-w-[10px]");exports.getContainerClasses=getContainerClasses,exports.getSellingPlanDropdownContainerClasses=getSellingPlanDropdownContainerClasses,exports.getSellingPlanDropdownIconClasses=getSellingPlanDropdownIconClasses,exports.getSellingPlanDropdownIconContainerClasses=getSellingPlanDropdownIconContainerClasses,exports.getSellingPlanDropdownLabelClasses=getSellingPlanDropdownLabelClasses,exports.getSellingPlanDropdownLabelInnerSpanClasses=getSellingPlanDropdownLabelInnerSpanClasses,exports.getSellingPlanDropdownLabelSpanClasses=getSellingPlanDropdownLabelSpanClasses,exports.getSellingPlanDropdownOptionClasses=getSellingPlanDropdownOptionClasses,exports.getSellingPlanDropdownSelectClasses=getSellingPlanDropdownSelectClasses,exports.getSellingPlanRadioContainerClasses=getSellingPlanRadioContainerClasses,exports.getSellingPlanRadioLabelClasses=getSellingPlanRadioLabelClasses,exports.getSellingPlanRadioOptionTextClasses=getSellingPlanRadioOptionTextClasses,exports.getSellingPlanRadioOptionsClasses=getSellingPlanRadioOptionsClasses,exports.getSubscriptionRadioInputClasses=getSubscriptionRadioInputClasses,exports.getSubscriptionRadioLabelClasses=getSubscriptionRadioLabelClasses,exports.getWrapperClasses=getWrapperClasses;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var SubscriptionBgColorEnum,core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");!function(e){e.info="#f0f8ff",e.success="#E8F8EB",e.warning="#FFF8E0",e.critical="#FFEBEB",e.none="#FAFAFA"}(SubscriptionBgColorEnum||(SubscriptionBgColorEnum={}));const getSubscriptionStyles=
|
|
1
|
+
"use strict";var SubscriptionBgColorEnum,core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");!function(e){e.info="#f0f8ff",e.success="#E8F8EB",e.warning="#FFF8E0",e.critical="#FFEBEB",e.none="#FAFAFA"}(SubscriptionBgColorEnum||(SubscriptionBgColorEnum={}));const getSubscriptionStyles=e=>{let{width:t,backgroundColor:r}=e??{},o=core.makeStyle({w:t}),i=core.makeStyle({rg:"9px"}),l=r?{backgroundColor:SubscriptionBgColorEnum[r]??SubscriptionBgColorEnum.none}:{};return core.filterTruthyStyles({...o,...l,...i})},getSubscriptionWrapperStyles=e=>core.filterTruthyStyles({...core.makeStyle({jc:e??"left"})}),getSellingPlanRadioOptionsStyles=({sellingPlanItemGap:e,sellingType:t})=>{let r=helper.postPurchaseSpacing[e??"tight"]||"9px",o=core.makeStyle({rg:"subscription"===t?r:"9px"});return core.filterTruthyStyles({...o})};exports.getSellingPlanRadioOptionsStyles=getSellingPlanRadioOptionsStyles,exports.getSubscriptionStyles=getSubscriptionStyles,exports.getSubscriptionWrapperStyles=getSubscriptionWrapperStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),SubscriptionRadio=require("./SubscriptionRadio.js"),classes=require("../common/classes.js");const SellingPlanRadio=({setting:s,
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),SubscriptionRadio=require("./SubscriptionRadio.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js");const SellingPlanRadio=({setting:s,styles:e,productId:l,sellingPlanOptions:a,builderProps:i,selectedValue:n,onChange:t})=>{let{sellingLabel:r}=s??{},{uid:c}=i??{},o=system.createClass(classes.getSellingPlanRadioContainerClasses()),m=system.createClass(classes.getSellingPlanRadioLabelClasses()),u=system.createClass(classes.getSellingPlanRadioOptionsClasses()),d=system.createClass(classes.getSellingPlanRadioOptionTextClasses()),g=styles.getSellingPlanRadioOptionsStyles({sellingPlanItemGap:e?.sellingPlanItemGap,sellingType:s?.sellingType});return jsxRuntime.jsxs("div",{className:o,style:g,children:[r&&jsxRuntime.jsx("label",{className:m,children:r}),jsxRuntime.jsx("div",{className:u,style:g,children:a.map(s=>jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{name:`${l}-selling-plan-options-${c??""}`,value:s.value,checked:n===s.value,onChange:s=>t(s.target.value),children:jsxRuntime.jsx("span",{className:d,children:s.label})},`${l}-${s.value}-${c??""}`))})]})};exports.SellingPlanRadio=SellingPlanRadio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var constants=require("../../../../common/constants.js");const 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:constants.postPurchaseSpacing,default:"tight"},{id:"sellingTitleTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"
|
|
1
|
+
"use strict";var constants=require("../../../../common/constants.js");const 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:constants.postPurchaseSpacing,default:"tight"},{id:"sellingTitleTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"medium",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"}]}];exports.ProductSubscriptionSettings=ProductSubscriptionSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const 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:"
|
|
1
|
+
"use strict";const 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:"Selling plans"},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"}}]}];exports.SettingUIV2=SettingUIV2;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"pageContext": ${JSON.stringify(l)},
|
|
5
5
|
"setting":${JSON.stringify(s)},
|
|
6
6
|
"styles":${JSON.stringify(r)},
|
|
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
|
`,p=system.createAttr({"section-id":"{{section.id}}","data-id":`${i?.uid}`}),{isOnlyFeatureAllDevices:m,isRenderGalleryGrid:n}=common.getConditionRenderGalleryImages(u?.position,s?.type),g=n?{}:system.createAttr({"data-only-image":system.LiquidIf("product.media.size > 1","false","true")}),{wrapperClasses:y,productImagesGalleryClasses:f}=getProductImagesClassName.getProductImagesClassName(e),I=system.createClass({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),$=system.createClass({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:h,wrapContainerStyleOnlyOneImage:S,galleryImageStyle:q}=getProductImagesStyles.getProductImagesStyles(u),C=productGallery.getShapeByLayout({shape:u.shape,shapeForBottom:u.shapeForBottom,shapeFor1Col:u.shapeFor1Col,shapeFor2Col:u.shapeFor2Col,shapeForFtOnly:u.shapeForFtOnly,shapeForInsideBottom:u.shapeForInsideBottom??productGallery.sizeSettingDefaultForNewLayout,shapeForInside:u.shapeForInside??productGallery.sizeSettingDefaultForNewLayout},u.position),G=common.getStyleInsideLayout(u.position,C,u?.spacing),j=()=>core.template`
|
|
13
13
|
${core.WrapRenderChildren({uid:i?.uid||"",customProps:o?.[0].customProps},o?.map(e=>{if(e)return core.template`${core.RenderChildren({...e,isInsideProductImage:!0,imageData:{imageShape:r?.ftShape,imageAlign:r?.align,imageLayout:r?.position},dotData:{dotSize:s?.ftDotSize,dotGapToCarousel:s?.ftDotGapToCarousel,dotStyle:s?.ftDotStyle}})}`}))}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"pageContext": ${JSON.stringify(l)},
|
|
5
5
|
"setting":${JSON.stringify(s)},
|
|
6
6
|
"styles":${JSON.stringify(r)},
|
|
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
|
`,p=system.createAttr({"section-id":"{{section.id}}","data-id":`${i?.uid}`}),{isOnlyFeatureAllDevices:m,isRenderGalleryGrid:n}=common.getConditionRenderGalleryImages(u?.position,s?.type),g=n?{}:system.createAttr({"data-only-image":system.LiquidIf("product.media.size > 1","false","true")}),{wrapperClasses:y,productImagesGalleryClasses:f}=getProductImagesClassName.getProductImagesClassName(e),I=system.createClass({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),$=system.createClass({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:h,wrapContainerStyleOnlyOneImage:S,galleryImageStyle:q}=getProductImagesStyles.getProductImagesStyles(u),v=productGallery.getShapeByLayout({shape:u.shape,shapeForBottom:u.shapeForBottom,shapeFor1Col:u.shapeFor1Col,shapeFor2Col:u.shapeFor2Col,shapeForFtOnly:u.shapeForFtOnly,shapeForInsideBottom:u.shapeForInsideBottom??productGallery.sizeSettingDefaultForNewLayout,shapeForInside:u.shapeForInside??productGallery.sizeSettingDefaultForNewLayout},u.position),C=common.getStyleInsideLayout(u.position,v,u?.spacing),G=()=>core.template`
|
|
13
13
|
${core.WrapRenderChildren({uid:i?.uid||"",customProps:o?.[0].customProps},o?.map(e=>{if(e)return core.template`${core.RenderChildren({...e,isInsideProductImage:!0,imageData:{imageShape:r?.ftShape,imageAlign:r?.align,imageLayout:r?.position},dotData:{dotSize:s?.ftDotSize,dotGapToCarousel:s?.ftDotGapToCarousel,dotStyle:s?.ftDotStyle}})}`}))}
|
|
@@ -3,7 +3,7 @@
|
|
|
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="${a}"
|
|
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 ${o}', 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
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=
|
|
2
|
-
${n?.map((e
|
|
3
|
-
${core.RenderChildren({...
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=t=>{let{pageContext:e,rawChildren:n}=t,{productItemClass:o,gpProductClass:r}=classes.getClass(t),a=()=>core.template`
|
|
2
|
+
${n?.map((t,e)=>{if(t)return core.template`
|
|
3
|
+
${core.RenderChildren({...t,index:e})}
|
|
4
4
|
`}).join("")}
|
|
5
5
|
`;return core.template`
|
|
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
|
-
class="${
|
|
8
|
+
class="${r}"
|
|
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(e)}}</script>
|
|
11
11
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${o}', 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
|
+
${a()}
|
|
16
16
|
{%- endform -%}
|
|
17
17
|
</gp-product>
|
|
18
18
|
`};exports.default=ProductListItem;
|
|
@@ -3,7 +3,7 @@
|
|
|
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="${a}"
|
|
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 ${o}', 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
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=
|
|
2
|
-
${n?.map((e
|
|
3
|
-
${core.RenderChildren({...
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),classes=require("./common/classes.js");const ProductListItem=t=>{let{pageContext:e,rawChildren:n}=t,{productItemClass:o,gpProductClass:r}=classes.getClass(t),a=()=>core.template`
|
|
2
|
+
${n?.map((t,e)=>{if(t)return core.template`
|
|
3
|
+
${core.RenderChildren({...t,index:e})}
|
|
4
4
|
`}).join("")}
|
|
5
5
|
`;return core.template`
|
|
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
|
-
class="${
|
|
8
|
+
class="${r}"
|
|
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(e)}}</script>
|
|
11
11
|
{%- form 'product', product, id: product_form_id, class: 'form contents ${o}', 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
|
+
${a()}
|
|
16
16
|
{%- endform -%}
|
|
17
17
|
</gp-product>
|
|
18
18
|
`};exports.default=ProductListItem;
|
|
@@ -71,23 +71,23 @@
|
|
|
71
71
|
`,G=system.createAttr(getAttr.getAttrs({uid:_,hasPreSelected:v,cssClass:a?.cssClass})),k=system.createStyle(styles.getWrapperStyle(e)),W=system.createClass({"gp-flex gp-flex-col !gp-ml-0":!0}),J=()=>{let e=core.isLocalEnv?"{{ 'gp-product-variant-v7-5.js' | asset_url }}":`${core.baseAssetURL}/assets-v2/gp-product-variant-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${helpers.getSettingPreloadData('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`};return core.template`
|
|
72
72
|
${system.Liquid("{%- assign total_combinations = 1 -%}")}
|
|
73
73
|
${system.LiquidFor("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
|
|
74
|
-
<gp-product-variants${G}>
|
|
74
|
+
<gp-product-variants ${G}>
|
|
75
75
|
<script gp-data type="application/json">
|
|
76
76
|
{
|
|
77
77
|
"setting":${JSON.stringify(j)?.replaceAll("'","'")},
|
|
78
78
|
"styles":${JSON.stringify(s)},
|
|
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(g)},
|
|
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>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),helpers=require("./common/helpers.js");const Product=e=>{let{children:t,setting:r,style:i,builderProps:a,rawChildren:o,advanced:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Row_liquid=require("../../../grid/components/row/Row.liquid.js"),system=require("@gem-sdk/system"),helpers$1=require("../../../helpers.js"),helpers=require("./common/helpers.js");const Product=e=>{let{children:t,setting:r,style:i,builderProps:a,rawChildren:o,advanced:d}=e,{isSyncProduct:s,productSetting:n}=r??{},c=n?.hasPreSelected??!1,{rowSetting:l,rowStyles:p,formatVariantId:u,formatProductId:f,productStatus:g,preSelectedOptionIds:m,productHandle:_,advancedStyle:y}=helpers.getData(e),v=()=>core.template`
|
|
2
2
|
{%- liquid
|
|
3
3
|
if request.page_type == 'product'
|
|
4
4
|
if '${g}' == '${helpers.STATIC_PRODUCT_STATUS}'
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
data-uid="${a?.uid}"
|
|
79
79
|
data-id="${a?.uid}"
|
|
80
80
|
style="${y}"
|
|
81
|
-
class="${
|
|
82
|
-
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${m}], "isSyncProduct": "${
|
|
81
|
+
class="${d?.cssClass}"
|
|
82
|
+
gp-context='{"productId": {{ product.id }}, "preSelectedOptionIds": [${m}], "isSyncProduct": "${s}", "hasPreSelected": ${c}, "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 }}" />
|
package/dist/esm/post-purchase/product/components/product-subscription/ProductSubscription.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s,Fragment as
|
|
1
|
+
import{jsx as e,jsxs as s,Fragment as t}from"react/jsx-runtime";import{useProduct as i,useRenderMode as o}from"@gem-sdk/core";import{createStyle as n,createClass as l}from"@gem-sdk/system";import{useRef as r,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 g}from"./common/styles.js";import{useSellingPlanChange as u}from"./hooks/useSellingPlanChange.js";import{useSellingSubscription as h}from"./hooks/useSellingSubscription.js";import{useSellingPlanOptions as S}from"./hooks/useSellingPlanOptions.js";import{useSubscriptionVisibility as f}from"./hooks/useSubscriptionVisibility.js";import{OneTimePurchaseTooltip as y}from"./components/OneTimePurchaseTooltip.js";import{SellingPlanDropdown as I}from"./components/SellingPlanDropdown.js";import{SellingPlanLabel as N}from"./components/SellingPlanLabel.js";import{SellingPlanRadio as P}from"./components/SellingPlanRadio.js";import{SubscriptionDetail as b}from"./components/SubscriptionDetail.js";import{SubscriptionRadio as j}from"./components/SubscriptionRadio.js";let ProductSubscription=({styles:T,setting:O,builderProps:k})=>{let C=i(),{defaultValue:v,selectedSellingPlan:E,setSelectedSellingPlan:R}=h(O),B=S(O),{selectedValue:U,handleSellingPlanChange:D}=u({defaultValue:v,selectedSellingPlan:E,setSelectedSellingPlan:R,sellingPlanOptions:B}),M=r(null),$=m(),{selectedType:_,shouldShowRadio:x,isOneTimeHidden:V,hasNoSellingPlanOptions:w,setSubscriptionSellingType:L}=f({setting:O}),q=n(d(T)),z=n(g(T?.align)),A=l(c()),F=l(p()),{isEditMode:G}=o(),H=`product-subscription-${C?.baseID}`,J=C?.baseID,K=`subscription-type-selection-${$}`,Q=O?.sellingType===a.ONE_TIME,W=O?.sellingType===a.SUBSCRIPTION;if(V||w)return G?e(y,{ref:M,setting:O}):null;let X=s=>e("div",{ref:M,"data-selling-type":O?.sellingType,id:H,className:A,style:z,children:s}),Y=()=>e(t,{children:O?.sellingStyle==="radio"?e(P,{setting:O,styles:T,builderProps:k,productId:J??"",sellingPlanOptions:B,selectedValue:U,onChange:D}):e(I,{setting:O,sellingPlanOptions:B,selectedValue:U,onChange:D})});return X(Q&&x?e("div",{className:F,style:q,children:e(j,{id:`${J}-one-time-radio`,name:K,value:a.ONE_TIME,checked:_===a.ONE_TIME,className:"!gp-items-start",onChange:e=>{e.target.checked&&L(a.ONE_TIME)},children:e(N,{setting:O,styles:T})})}):W&&x?s("div",{className:F,style:q,children:[e(j,{id:`${J}-subscription-radio`,name:K,value:a.SUBSCRIPTION,checked:_===a.SUBSCRIPTION,className:"!gp-items-start",onChange:e=>{e.target.checked&&L(a.SUBSCRIPTION)},children:e(N,{setting:O,styles:T})}),_===a.SUBSCRIPTION&&s(t,{children:[e("div",{className:"gp-pl-7",children:Y()}),e("div",{className:"gp-pl-7",children:e(b,{setting:O,styles:T})})]})]}):s("div",{className:F,style:q,children:[e(N,{setting:O,styles:T}),Y(),e(b,{setting:O,styles:T})]}))};export{ProductSubscription as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeClasses as e}from"@gem-sdk/core";let getWrapperClasses=()=>e("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>e("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>e("gp-mb-2 gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>e("gp-flex gp-flex-col
|
|
1
|
+
import{composeClasses as e}from"@gem-sdk/core";let getWrapperClasses=()=>e("gp-flex gp-gap-x-[10px] gap-[10px]"),getContainerClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioContainerClasses=()=>e("gp-relative gp-flex gp-flex-col"),getSellingPlanRadioLabelClasses=()=>e("gp-mb-2 gp-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>e("gp-text-[14px] gp-leading-[1.3] gp-text-text-light-500"),getSubscriptionRadioLabelClasses=p=>{let g=p?"gp-opacity-50 gp-cursor-not-allowed":"";return e(`gp-flex gp-items-center gp-cursor-pointer gp-gap-2 ${g}`.trim())},getSubscriptionRadioInputClasses=()=>e("gp-relative gp-min-h-[24px] gp-min-w-[24px] gp-w-5 gp-h-5 gp-cursor-pointer gp-appearance-none gp-rounded-full gp-bg-light-100 gp-transition-all gp-border-light-500 gp-border-2 checked:gp-border-[#1879b9] checked:gp-border-[5px] checked:gp-after:gp-content-[''] checked:gp-after:gp-absolute checked:gp-after:gp-top-1/2 checked:gp-after:gp-left-1/2 checked:gp-after:gp-transform checked:gp-after:gp--translate-x-1/2 checked:gp-after:gp--translate-y-1/2 checked:gp-after:gp-h-2 checked:gp-after:gp-w-2 checked:gp-after:gp-rounded-full checked:gp-after:gp-bg-white disabled:gp-cursor-not-allowed"),getSellingPlanDropdownContainerClasses=()=>e("gp-relative"),getSellingPlanDropdownLabelClasses=()=>e("!gp-max-w-[calc(100%_-_66px)] gp-absolute gp-left-[12px] gp-top-[6px] gp-p-0 gp-text-xs gp-leading-[1.3] gp-text-[#737373] gp-transition-[top]"),getSellingPlanDropdownLabelSpanClasses=()=>e("gp-max-w-full"),getSellingPlanDropdownLabelInnerSpanClasses=()=>e("gp-block gp-overflow-hidden"),getSellingPlanDropdownSelectClasses=({isNoLabel:p=!1})=>e(`gp-min-h-[47px] gp-appearance-none gp-bg-transparent gp-w-full gp-whitespace-nowrap gp-rounded-[5px] gp-border gp-border-[#d9d9d9] gp-pl-[11px] gp-pr-[40px] gp-text-[14px] gp-outline-none gp-text-[#545454] gp-leading-[1.3] ${p?"gp-pt-0 gp-pb-0":"gp-pt-[21px] gp-pb-[6px]"}`),getSellingPlanDropdownOptionClasses=()=>e("gp-text-[14px] gp-text-black"),getSellingPlanDropdownIconContainerClasses=()=>e("gp-pointer-events-none gp-absolute gp-right-[2px] gp-top-[50%] gp-flex gp-h-[43%] gp-w-[40px] gp-translate-y-[-50%] gp-items-center gp-justify-center gp-border-l-[1px] gp-bg-white gp-border-[#545454]"),getSellingPlanDropdownIconClasses=()=>e("gp-h-[10px] gp-w-[10px]");export{getContainerClasses,getSellingPlanDropdownContainerClasses,getSellingPlanDropdownIconClasses,getSellingPlanDropdownIconContainerClasses,getSellingPlanDropdownLabelClasses,getSellingPlanDropdownLabelInnerSpanClasses,getSellingPlanDropdownLabelSpanClasses,getSellingPlanDropdownOptionClasses,getSellingPlanDropdownSelectClasses,getSellingPlanRadioContainerClasses,getSellingPlanRadioLabelClasses,getSellingPlanRadioOptionTextClasses,getSellingPlanRadioOptionsClasses,getSubscriptionRadioInputClasses,getSubscriptionRadioLabelClasses,getWrapperClasses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var SubscriptionBgColorEnum;import{makeStyle as o,filterTruthyStyles as r}from"@gem-sdk/core";import{postPurchaseSpacing as t}from"../../../../common/helper.js";!function(o){o.info="#f0f8ff",o.success="#E8F8EB",o.warning="#FFF8E0",o.critical="#FFEBEB",o.none="#FAFAFA"}(SubscriptionBgColorEnum||(SubscriptionBgColorEnum={}));let getSubscriptionStyles=
|
|
1
|
+
var SubscriptionBgColorEnum;import{makeStyle as o,filterTruthyStyles as r}from"@gem-sdk/core";import{postPurchaseSpacing as t}from"../../../../common/helper.js";!function(o){o.info="#f0f8ff",o.success="#E8F8EB",o.warning="#FFF8E0",o.critical="#FFEBEB",o.none="#FAFAFA"}(SubscriptionBgColorEnum||(SubscriptionBgColorEnum={}));let getSubscriptionStyles=t=>{let{width:i,backgroundColor:n}=t??{},e=o({w:i}),l=o({rg:"9px"}),s=n?{backgroundColor:SubscriptionBgColorEnum[n]??SubscriptionBgColorEnum.none}:{};return r({...e,...s,...l})},getSubscriptionWrapperStyles=t=>r({...o({jc:t??"left"})}),getSellingPlanRadioOptionsStyles=({sellingPlanItemGap:i,sellingType:n})=>{let e=t[i??"tight"]||"9px",l=o({rg:"subscription"===n?e:"9px"});return r({...l})};export{getSellingPlanRadioOptionsStyles,getSubscriptionStyles,getSubscriptionWrapperStyles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as l}from"react/jsx-runtime";import{createClass as a}from"@gem-sdk/system";import{SubscriptionRadio as
|
|
1
|
+
import{jsxs as e,jsx as l}from"react/jsx-runtime";import{createClass as a}from"@gem-sdk/system";import{SubscriptionRadio as s}from"./SubscriptionRadio.js";import{getSellingPlanRadioContainerClasses as i,getSellingPlanRadioLabelClasses as n,getSellingPlanRadioOptionsClasses as m,getSellingPlanRadioOptionTextClasses as o}from"../common/classes.js";import{getSellingPlanRadioOptionsStyles as r}from"../common/styles.js";let SellingPlanRadio=({setting:t,styles:c,productId:p,sellingPlanOptions:d,builderProps:g,selectedValue:u,onChange:h})=>{let{sellingLabel:v}=t??{},{uid:y}=g??{},f=a(i()),$=a(n()),j=a(m()),N=a(o()),P=r({sellingPlanItemGap:c?.sellingPlanItemGap,sellingType:t?.sellingType});return e("div",{className:f,style:P,children:[v&&l("label",{className:$,children:v}),l("div",{className:j,style:P,children:d.map(e=>l(s,{name:`${p}-selling-plan-options-${y??""}`,value:e.value,checked:u===e.value,onChange:e=>h(e.target.value),children:l("span",{className:N,children:e.label})},`${p}-${e.value}-${y??""}`))})]})};export{SellingPlanRadio};
|
|
@@ -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 {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:"
|
|
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:"medium",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 {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:"
|
|
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:"Selling plans"},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};
|