@gem-sdk/components 12.0.0-dev.55 → 12.0.0-dev.57
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/buyer-consent/components/BuyerConsent.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.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/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/third-party/components/SealSubscriptions.liquid.js +10 -6
- package/dist/esm/post-purchase/buyer-consent/components/BuyerConsent.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.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/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/third-party/components/SealSubscriptions.liquid.js +13 -9
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../common/helpers.js"),core=require("@gem-sdk/core"),helpers=require("../../../helpers.js");const DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:e,builderProps:s,setting:t})=>{let r=core.useProduct(),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),helpers$1=require("../common/helpers.js"),core=require("@gem-sdk/core"),helpers=require("../../../helpers.js");const DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:e,builderProps:s,setting:t})=>{let r=core.useProduct(),c=core.usePageStore(e=>e.buyerConsentPreCheck),l=core.useProductStore(e=>e.uid),a=core.useProductStore(e=>e.isAgreeBuyWithSubscription),o=core.useProductStore(e=>e.setIsAgreeBuyWithSubscription),{description:n,policyLabel:u,policyLink:i,align:y}=t??{},m=r?.id?`buyer-consent-product-${s?.uid}-${r.id}`:void 0,d=helpers$1.getComponentTag(i),C=system.createStyle(styles.getWrapperStyles({styles:e})),p=system.createClass(classes.getWrapperClassName({align:y,uid:s?.uid})),h=system.createStyle(styles.getContainerStyles({styles:e})),x=system.createClass(classes.getCheckboxContainerClassName()),g=system.createStyle(styles.getCheckboxInputStyles()),j=system.createStyle(styles.getTextStyle({styles:e})),S=system.createClass(classes.getCheckboxClassName()),b=system.createClass(classes.getLinkComponentClassName()),k=system.createStyle(classes.getLinkComponentStyles()),P=React.useMemo(()=>{let e=helpers.extractProductID(r?.baseID??""),s=`${e}_${l}`;return c?.[s]??!0},[c,l,r?.baseID]),R=e=>{o(e.target.checked)};return React.useEffect(()=>{o(P)},[o,P]),jsxRuntime.jsx("div",{"data-id":s?.uid,style:C,className:p,children:jsxRuntime.jsxs("label",{htmlFor:m,dir:e?.direction??"ltr",style:h,className:x,children:[jsxRuntime.jsx("input",{id:m,name:m,type:"checkbox",style:g,className:S,checked:a,onChange:R}),jsxRuntime.jsxs("bdo",{dir:e?.direction??"ltr",style:j,children:[n," ",jsxRuntime.jsx(d,{target:"_blank",rel:"noreferrer",href:i,className:b,style:k,children:u})]})]})})};exports.default=BuyerConsent;
|
package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core");require("react");var Row=require("../../../../../grid/components/row/Row.js"),ChildrenDroppable=require("../../../../../grid/components/ChildrenDroppable.js"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),classes=require("../common/classes.js");const ProductOfferItem=e=>{let{product:r,setting:s,builderProps:t,children:i,index:d,totalProduct:o,builderAttrs:c,styles:a}=e,
|
|
2
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core");require("react");var Row=require("../../../../../grid/components/row/Row.js"),ChildrenDroppable=require("../../../../../grid/components/ChildrenDroppable.js"),system=require("@gem-sdk/system"),attrs=require("../common/attrs.js"),classes=require("../common/classes.js");const ProductOfferItem=e=>{let{product:r,setting:s,builderProps:t,children:i,index:d,totalProduct:o,builderAttrs:c,styles:a}=e,u=core.useEditorMode(),{variantSelected:l,productOfferLayout:n,layout:m,...j}=s??{};Object.keys(m||{}).forEach(e=>{n?.[e]==="2col"&&m?.[e]&&(m[e].display="fill")});let f=l?.[r?.baseID??""]?.variantId,x=system.createAttr({...attrs.getProductOfferAttrs(r,t?.uid)}),p=system.createClass({...classes.getProductOfferItemClasses(d,s,o)});return jsxRuntime.jsx("div",{className:p,children:jsxRuntime.jsx(core.ProductProvider,{product:r,readOnly:!0,initialVariantId:f??"Latest",uid:t?.uid,children:jsxRuntime.jsx("div",{..."edit"===u?{...x}:{},children:jsxRuntime.jsx(Row.default,{builderAttrs:c,setting:{...j,layout:m},styles:a,children:core.isEmptyChildren(i)?jsxRuntime.jsx(ChildrenDroppable.default,{}):i})})})},`uid-${r?.id}`)};exports.ProductOfferItem=ProductOfferItem;
|
|
@@ -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-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-
|
|
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-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-[#545454]"),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-[18px] gp-min-w-[18px] gp-mt-[3px] gp-w-4 gp-h-4 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-[6px] 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 core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");const getSubscriptionStyles=e=>{let{width:t}=e??{},r=core.makeStyle({w:t}),l=core.makeStyle({rg:"
|
|
1
|
+
"use strict";var core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");const getSubscriptionStyles=e=>{let{width:t}=e??{},r=core.makeStyle({w:t}),l=core.makeStyle({rg:"8px"});return core.filterTruthyStyles({...r,...l})},getSubscriptionWrapperStyles=e=>core.filterTruthyStyles({...core.makeStyle({jc:e??"left"})}),getSellingPlanRadioOptionsStyles=({sellingPlanItemGap:e,sellingType:t})=>{let r=helper.postPurchaseSpacing[e??"tight"]||"9px",l=core.makeStyle({rg:"subscription"===t?r:"9px"});return core.filterTruthyStyles({...l})};exports.getSellingPlanRadioOptionsStyles=getSellingPlanRadioOptionsStyles,exports.getSubscriptionStyles=getSubscriptionStyles,exports.getSubscriptionWrapperStyles=getSubscriptionWrapperStyles;
|
|
@@ -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:"
|
|
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:"Source",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:"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:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"One-time purchase",popoverLabel:"Selling option title",isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:"Content",setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:"Align"}]}]},{label:"Selling plans",controls:[{type:"control",label:"Selling plans",setting:{id:"sellingPlans"}},{type:"control",label:"Label",setting:{id:"sellingLabel"},layout:"horizontal",isHideClear:!0,conditionDisplay:'sellingType === "subscription"'},{type:"control",label:"Style",setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:"Item gap",setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:"Subscription detail",setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:"Label",iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:"Subscription detail",isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:"Content",setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:"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",setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:"Align",conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"width"},layout:"horizontal"}]},{controls:[{label:"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;
|
|
1
|
+
"use strict";const SettingUIV2=[{label:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"One-time purchase",popoverLabel:"Selling option title",isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:"Content",setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:"Align"}]}]},{label:"Selling plans",controls:[{type:"control",label:"Source",popoverLabel:"Selling plans",setting:{id:"sellingPlans"}},{type:"control",label:"Label",setting:{id:"sellingLabel"},layout:"horizontal",isHideClear:!0,conditionDisplay:'sellingType === "subscription"'},{type:"control",label:"Style",setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:"Item gap",setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:"Subscription detail",setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:"Label",iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:"Subscription detail",isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:"Content",setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:"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",setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:"Align",conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"width"},layout:"horizontal"}]},{controls:[{label:"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;
|
|
@@ -37,17 +37,21 @@
|
|
|
37
37
|
const productWrapper = detail?.element?.closest('gp-product');
|
|
38
38
|
if (!productWrapper) return;
|
|
39
39
|
|
|
40
|
-
const
|
|
41
|
-
const
|
|
40
|
+
const gpPriceElements = productWrapper.querySelectorAll('gp-product-price .gp-price.gp-money');
|
|
41
|
+
const compareAtPriceElements = productWrapper.querySelectorAll('gp-product-price .gp-product-compare-price');
|
|
42
42
|
|
|
43
|
-
if (
|
|
44
|
-
|
|
43
|
+
if (gpPriceElements.length > 0 && typeof detail.price !== 'undefined') {
|
|
44
|
+
gpPriceElements.forEach(function(el) {
|
|
45
|
+
el.innerHTML = formatCurrency(detail.price, moneyFormatGp);
|
|
46
|
+
});
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
if (
|
|
49
|
+
if (compareAtPriceElements.length > 0) {
|
|
48
50
|
const compareAtPrice = detail?.compareAtPrice || 0;
|
|
49
51
|
setTimeout(function() {
|
|
50
|
-
|
|
52
|
+
compareAtPriceElements.forEach(function(el) {
|
|
53
|
+
el.innerHTML = formatCurrency(compareAtPrice, moneyFormatGp);
|
|
54
|
+
});
|
|
51
55
|
});
|
|
52
56
|
}
|
|
53
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useMemo as t,useEffect as s}from"react";import{createStyle as o,createClass as i}from"@gem-sdk/system";import{getWrapperStyles as m,getContainerStyles as c,getCheckboxInputStyles as n,getTextStyle as
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useMemo as t,useEffect as s}from"react";import{createStyle as o,createClass as i}from"@gem-sdk/system";import{getWrapperStyles as m,getContainerStyles as c,getCheckboxInputStyles as n,getTextStyle as d}from"../common/styles.js";import{getWrapperClassName as l,getCheckboxContainerClassName as a,getCheckboxClassName as u,getLinkComponentClassName as p,getLinkComponentStyles as h}from"../common/classes.js";import{getComponentTag as y}from"../common/helpers.js";import{useProduct as b,usePageStore as f,useProductStore as C}from"@gem-sdk/core";import{extractProductID as g}from"../../../helpers.js";let DEFAULT_PRE_CHECK_VALUE=!0,COMPONENT_ID_PREFIX="buyer-consent-product",BuyerConsent=({styles:k,builderProps:_,setting:E})=>{let N=b(),j=f(e=>e.buyerConsentPreCheck),I=C(e=>e.uid),A=C(e=>e.isAgreeBuyWithSubscription),B=C(e=>e.setIsAgreeBuyWithSubscription),{description:D,policyLabel:P,policyLink:$,align:x}=E??{},F=N?.id?`buyer-consent-product-${_?.uid}-${N.id}`:void 0,v=y($),L=o(m({styles:k})),O=i(l({align:x,uid:_?.uid})),R=o(c({styles:k})),S=i(a()),T=o(n()),U=o(d({styles:k})),W=i(u()),H=i(p()),K=o(h()),M=t(()=>{let e=g(N?.baseID??""),r=`${e}_${I}`;return j?.[r]??!0},[j,I,N?.baseID]),V=e=>{B(e.target.checked)};return s(()=>{B(M)},[B,M]),e("div",{"data-id":_?.uid,style:L,className:O,children:r("label",{htmlFor:F,dir:k?.direction??"ltr",style:R,className:S,children:[e("input",{id:F,name:F,type:"checkbox",style:T,className:W,checked:A,onChange:V}),r("bdo",{dir:k?.direction??"ltr",style:U,children:[D," ",e(v,{target:"_blank",rel:"noreferrer",href:$,className:H,style:K,children:P})]})]})})};export{BuyerConsent as default};
|
package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as r}from"react/jsx-runtime";import{useEditorMode as t,ProductProvider as e,isEmptyChildren as
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{useEditorMode as t,ProductProvider as e,isEmptyChildren as i}from"@gem-sdk/core";import"react";import o from"../../../../../grid/components/row/Row.js";import m from"../../../../../grid/components/ChildrenDroppable.js";import{createAttr as s,createClass as d}from"@gem-sdk/system";import{getProductOfferAttrs as l}from"../common/attrs.js";import{getProductOfferItemClasses as c}from"../common/classes.js";let ProductOfferItem=n=>{let{product:a,setting:p,builderProps:f,children:u,index:h,totalProduct:j,builderAttrs:g,styles:y}=n,I=t(),{variantSelected:b,productOfferLayout:O,layout:k,...v}=p??{};Object.keys(k||{}).forEach(r=>{O?.[r]==="2col"&&k?.[r]&&(k[r].display="fill")});let w=b?.[a?.baseID??""]?.variantId,x=s({...l(a,f?.uid)}),D=d({...c(h,p,j)});return r("div",{className:D,children:r(e,{product:a,readOnly:!0,initialVariantId:w??"Latest",uid:f?.uid,children:r("div",{..."edit"===I?{...x}:{},children:r(o,{builderAttrs:g,setting:{...v,layout:k},styles:y,children:i(u)?r(m,{}):u})})})},`uid-${a?.id}`)};export{ProductOfferItem};
|
|
@@ -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-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>e("gp-text-[14px] gp-leading-[1.3] gp-text-
|
|
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-text-xs gp-leading-[1.3]"),getSellingPlanRadioOptionsClasses=()=>e("gp-flex gp-flex-col"),getSellingPlanRadioOptionTextClasses=()=>e("gp-text-[14px] gp-leading-[1.3] gp-text-[#545454]"),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-[18px] gp-min-w-[18px] gp-mt-[3px] gp-w-4 gp-h-4 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-[6px] 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
|
-
import{makeStyle as t,filterTruthyStyles as e}from"@gem-sdk/core";import{postPurchaseSpacing as r}from"../../../../common/helper.js";let getSubscriptionStyles=r=>{let{width:i}=r??{},p=t({w:i}),l=t({rg:"
|
|
1
|
+
import{makeStyle as t,filterTruthyStyles as e}from"@gem-sdk/core";import{postPurchaseSpacing as r}from"../../../../common/helper.js";let getSubscriptionStyles=r=>{let{width:i}=r??{},p=t({w:i}),l=t({rg:"8px"});return e({...p,...l})},getSubscriptionWrapperStyles=r=>e({...t({jc:r??"left"})}),getSellingPlanRadioOptionsStyles=({sellingPlanItemGap:i,sellingType:p})=>{let l=r[i??"tight"]||"9px",o=t({rg:"subscription"===p?l:"9px"});return e({...o})};export{getSellingPlanRadioOptionsStyles,getSubscriptionStyles,getSubscriptionWrapperStyles};
|
|
@@ -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:"
|
|
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:"Source",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:"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:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"One-time purchase",popoverLabel:"Selling option title",isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:"Content",setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:"Align"}]}]},{label:"Selling plans",controls:[{type:"control",label:"Selling plans",setting:{id:"sellingPlans"}},{type:"control",label:"Label",setting:{id:"sellingLabel"},layout:"horizontal",isHideClear:!0,conditionDisplay:'sellingType === "subscription"'},{type:"control",label:"Style",setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:"Item gap",setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:"Subscription detail",setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:"Label",iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:"Subscription detail",isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:"Content",setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:"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",setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:"Align",conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"width"},layout:"horizontal"}]},{controls:[{label:"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};
|
|
1
|
+
let SettingUIV2=[{label:"Selling options",controls:[{type:"control",label:"Type",setting:{id:"sellingType"}},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_discount}",popoverLabel:"Selling option title",isHideClear:!0,controls:[{label:"Content",setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:"Align"}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:"Title",iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"One-time purchase",popoverLabel:"Selling option title",isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:"Content",setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:"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",setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:"Align"}]}]},{label:"Selling plans",controls:[{type:"control",label:"Source",popoverLabel:"Selling plans",setting:{id:"sellingPlans"}},{type:"control",label:"Label",setting:{id:"sellingLabel"},layout:"horizontal",isHideClear:!0,conditionDisplay:'sellingType === "subscription"'},{type:"control",label:"Style",setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:"Item gap",setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:"Subscription detail",setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:"Label",iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:"Subscription detail",isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:"Content",setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:"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",setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:"Align",conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:"Size",controls:[{type:"control",label:"Width",setting:{id:"width"},layout:"horizontal"}]},{controls:[{label:"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};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{template as e,makeStyleResponsive as t}from"@gem-sdk/core";let SealSubscriptions=({setting:r,advanced:
|
|
1
|
+
import{template as e,makeStyleResponsive as t}from"@gem-sdk/core";let SealSubscriptions=({setting:r,advanced:n})=>{let{align:o}=r??{};return e`
|
|
2
2
|
<div
|
|
3
|
-
class="${
|
|
4
|
-
style="${{...t("ta",
|
|
3
|
+
class="${n?.cssClass}"
|
|
4
|
+
style="${{...t("ta",o)}}"
|
|
5
5
|
>
|
|
6
6
|
<div class="sealsubs-target-element" data-handle="{{ product.handle }}"></div>
|
|
7
7
|
</div>
|
|
@@ -37,17 +37,21 @@ import{template as e,makeStyleResponsive as t}from"@gem-sdk/core";let SealSubscr
|
|
|
37
37
|
const productWrapper = detail?.element?.closest('gp-product');
|
|
38
38
|
if (!productWrapper) return;
|
|
39
39
|
|
|
40
|
-
const
|
|
41
|
-
const
|
|
40
|
+
const gpPriceElements = productWrapper.querySelectorAll('gp-product-price .gp-price.gp-money');
|
|
41
|
+
const compareAtPriceElements = productWrapper.querySelectorAll('gp-product-price .gp-product-compare-price');
|
|
42
42
|
|
|
43
|
-
if (
|
|
44
|
-
|
|
43
|
+
if (gpPriceElements.length > 0 && typeof detail.price !== 'undefined') {
|
|
44
|
+
gpPriceElements.forEach(function(el) {
|
|
45
|
+
el.innerHTML = formatCurrency(detail.price, moneyFormatGp);
|
|
46
|
+
});
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
if (
|
|
49
|
+
if (compareAtPriceElements.length > 0) {
|
|
48
50
|
const compareAtPrice = detail?.compareAtPrice || 0;
|
|
49
51
|
setTimeout(function() {
|
|
50
|
-
|
|
52
|
+
compareAtPriceElements.forEach(function(el) {
|
|
53
|
+
el.innerHTML = formatCurrency(compareAtPrice, moneyFormatGp);
|
|
54
|
+
});
|
|
51
55
|
});
|
|
52
56
|
}
|
|
53
57
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "12.0.0-dev.
|
|
3
|
+
"version": "12.0.0-dev.57",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"i18n:generate-keys-usage": "node ./scripts/en-keys-usage.js"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/core": "12.0.0-dev.
|
|
30
|
+
"@gem-sdk/core": "12.0.0-dev.57",
|
|
31
31
|
"@gem-sdk/styles": "12.0.0-dev.53",
|
|
32
32
|
"@gem-sdk/system": "12.0.0-dev.53",
|
|
33
33
|
"@types/react-transition-group": "^4.4.12",
|