@gem-sdk/components 12.0.0-staging.78 → 12.0.0-staging.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),Text=require("../../text/components/Text.js"),useDynamicProduct=require("../hooks/useDynamicProduct.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),getPrice=require("../helpers/product-price-breakdown/getPrice.js"),useSubscriptionSellingType=require("../hooks/useSubscriptionSellingType.js");const PostPurchaseProductPrice=({styles:e,style:r,builderAttrs:o,builderProps:i,children:s,setting:t})=>{let c=core.useCurrentVariant(),l=core.useProduct(),{isOneTime:n}=useSubscriptionSellingType.useSubscriptionSellingType(),u=core.useProductStore(e=>e.selectedSellingPlan),a=core.convertDecimalToNumber(c?.price)??0,p=core.convertDecimalToNumber(c?.salePrice)??0,d=parseFloat(core.shopifyPriceRounding(core.useProductOfferDiscount(),2)),{isDynamicProduct:g}=useDynamicProduct.useDynamicProduct(),{t:m}=core.useI18nStore(),{isEditMode:P}=core.useRenderMode(),{priceType:f,source:y}=t??{},x="compare"===f,h="offer"===f,b="price"===y,j="compare-price"===y,R=c?.sellingPlanGroups,S=l?.sellingPlanGroups,N=React.useMemo(()=>{if(!u||n)return null;let e=c?.sellingPlanGroups??l?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===u)return e}return null},[JSON.stringify(R),JSON.stringify(S),u,n]),T=JSON.stringify(N?.pricingPolicies),D=N?.baseID,v=React.useMemo(()=>!N||a<=0||n?0:getPrice.calculateSellingPlanDiscount({variantPrice:a,pricingPolicies:N.pricingPolicies}),[T,a,n]),q=React.useMemo(()=>{let e=h&&!n&&u&&D;if(e){let e=parseFloat(core.shopifyPriceRounding(a-v,2)),r=parseFloat(core.shopifyPriceRounding(e-d,2));return r>0?r:0}let r=parseFloat(core.shopifyPriceRounding(a-d,2));return r>0?r:0},[h,n,u,D,a,v,d]),M=React.useMemo(()=>x?b?a:p:h?q:a,[x,b,h,a,p,q]),k=core.useFormatMoney(parseFloat(core.shopifyPriceRounding(Number(M)||0,2)),!1),F=l?.baseID?.replace("gid://shopify/Product/",""),O=React.useMemo(()=>x&&(!d&&p<a||j&&!p||b&&a<=0),[x,d,a,p,j,b]);return(!M&&!h||O)&&P?jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:jsxRuntime.jsx("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:jsxRuntime.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:m("No compare price")})})}):O&&!P?null:jsxRuntime.jsxs("div",{...o,className:core.cls(i?.uid),style:{...r},id:`shopify-text-element-${i?.uid}`,"data-product-id":F,children:[jsxRuntime.jsx(Text.default,{styles:e,setting:{text:g?"$???":k},className:core.cls({"gp-money":h,"gp-product-compare-price":x,"gp-line-through":x&&e?.lineThrough})}),s]})};exports.default=PostPurchaseProductPrice;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react"),Text=require("../../text/components/Text.js"),useDynamicProduct=require("../hooks/useDynamicProduct.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),getPrice=require("../helpers/product-price-breakdown/getPrice.js"),useSubscriptionSellingType=require("../hooks/useSubscriptionSellingType.js");const PostPurchaseProductPrice=({styles:e,style:r,builderAttrs:o,builderProps:i,children:s,setting:t})=>{let c=core.useCurrentVariant(),l=core.useProduct(),{isOneTime:n}=useSubscriptionSellingType.useSubscriptionSellingType(),u=core.useProductStore(e=>e.selectedSellingPlan),a=core.convertDecimalToNumber(c?.price)??0,p=core.convertDecimalToNumber(c?.salePrice)??0,d=parseFloat(core.shopifyPriceRounding(core.useProductOfferDiscount(),2)),{isDynamicProduct:g}=useDynamicProduct.useDynamicProduct(),{t:m}=core.useI18nStore(),{isEditMode:P}=core.useRenderMode(),{priceType:f,source:y}=t??{},x="compare"===f,h="offer"===f,b="price"===y,j="compare-price"===y,R=c?.sellingPlanGroups,S=l?.sellingPlanGroups,N=React.useMemo(()=>{if(!u||n)return null;let e=c?.sellingPlanGroups??l?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===u)return e}return null},[JSON.stringify(R),JSON.stringify(S),u,n]),T=JSON.stringify(N?.pricingPolicies),D=N?.baseID,v=React.useMemo(()=>!N||a<=0||n?0:getPrice.calculateSellingPlanDiscount({variantPrice:a,pricingPolicies:N.pricingPolicies}),[T,a,n]),q=React.useMemo(()=>{let e=h&&!n&&u&&D;if(e){let e=parseFloat(core.shopifyPriceRounding(a-v,2)),r=parseFloat(core.shopifyPriceRounding(e-d,2));return r>0?r:0}let r=parseFloat(core.shopifyPriceRounding(a-d,2));return r>0?r:0},[h,n,u,D,a,v,d]),M=React.useMemo(()=>x?b?a:p:h?q:a,[x,b,h,a,p,q]),k=core.useFormatMoney(parseFloat(core.shopifyPriceRounding(Number(M)||0,2)),!1),F=l?.baseID?.replace("gid://shopify/Product/",""),O=React.useMemo(()=>x&&(!d&&p<a||j&&!p||b&&a<=0),[x,d,a,p,j,b]);return(!M&&!h||O)&&P?jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:m("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:jsxRuntime.jsx("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:jsxRuntime.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:m("No compare price")})})}):O&&!P?null:jsxRuntime.jsxs("div",{...o,className:core.cls(i?.uid),style:{...r},id:`shopify-text-element-${i?.uid}`,"data-product-id":F,children:[jsxRuntime.jsx(Text.default,{styles:e,setting:{text:g?"$???":k},className:core.cls({"gp-money":h,"gp-product-compare-price":x,"gp-line-through":x&&e?.lineThrough})}),s]})};exports.default=PostPurchaseProductPrice;
@@ -1 +1 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),TooltipHover=require("../../../../../common/components/TooltipHover.js"),index=require("../../../constants/index.js");const OneTimePurchaseTooltip=React.forwardRef(({setting:e},i)=>{let{t}=core.useI18nStore();return jsxRuntime.jsx("div",{ref:i,"data-selling-type":e?.sellingType,id:"product-subscription",children:jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:jsxRuntime.jsx("div",{className:"gp-px-2 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg gp-w-fit",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:jsxRuntime.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:t(e?.sellingType===index.SubscriptionEnum.ONE_TIME?"This product is only available as a subscription":"This product is only available as a one-time purchase")})})})})});OneTimePurchaseTooltip.displayName="OneTimePurchaseTooltip",exports.OneTimePurchaseTooltip=OneTimePurchaseTooltip;
1
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),TooltipHover=require("../../../../../common/components/TooltipHover.js"),index=require("../../../constants/index.js");const OneTimePurchaseTooltip=React.forwardRef(({setting:e},i)=>{let{t}=core.useI18nStore();return jsxRuntime.jsx("div",{ref:i,"data-selling-type":e?.sellingType,id:"product-subscription",children:jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:t("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:jsxRuntime.jsx("div",{className:"gp-px-2 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg gp-w-fit",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:jsxRuntime.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:t(e?.sellingType===index.SubscriptionEnum.ONE_TIME?"This product is only available as a subscription":"This product is only available as a one-time purchase")})})})})});OneTimePurchaseTooltip.displayName="OneTimePurchaseTooltip",exports.OneTimePurchaseTooltip=OneTimePurchaseTooltip;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGpDiscountTag=require("./hooks/useGpDiscountTag.js");const ProductTag=({setting:e,styles:s,builderProps:t,...i})=>{let{customContent:a}=e??{},l=i["bundle-item"],{textAlign:o}=s??{},{t:r}=core.useI18nStore(),{mode:u,product:n,salePrice:d,priceSave:c,currentProductId:x,unitCustomDisplay:m,shouldPlaceholderNoDiscount:p}=useGpDiscountTag.useGpDiscountTag({setting:e,styles:s,builderProps:t,...i});if(p)return jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:jsxRuntime.jsx(NoDataState.default,{builderAttrs:t?.builderData,elementType:"secondary",description:r("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let y=system.createStyle(styles.getWrapperTextStyle(s)),j=system.createStyle(styles.getContainerStyle(s)),g=system.createClass(classes.getWrapperTextClass(s)),f=system.createClass(classes.getContainerClass()),T=system.createClass(classes.getRootClass({mode:u,salePrice:d,priceSave:c,bundleItem:l}));return jsxRuntime.jsx("div",{className:T,style:{...core.makeStyleResponsive("ta",o)},id:`shopify-text-element-${t?.uid}`,"data-id":t?.uid,"data-product-id":x,"gp-data-hidden":"false",children:system.If(!n," ",jsxRuntime.jsx("div",{className:f,style:j,children:jsxRuntime.jsx("div",{className:g,style:y,children:jsxRuntime.jsxs("div",{className:"gp-flex gp-break-all",children:[jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${t?.uid}-prefix`},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:m,options:{isCannotEditing:!0},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${t?.uid}-suffix`}}})]})})}))})};exports.default=ProductTag;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),NoDataState=require("../../../common/components/NoDataState.js"),TooltipHover=require("../../../common/components/TooltipHover.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGpDiscountTag=require("./hooks/useGpDiscountTag.js");const ProductTag=({setting:e,styles:s,builderProps:t,...i})=>{let{customContent:a}=e??{},l=i["bundle-item"],{textAlign:o}=s??{},{t:r}=core.useI18nStore(),{mode:u,product:n,salePrice:d,priceSave:c,currentProductId:x,unitCustomDisplay:m,shouldPlaceholderNoDiscount:p}=useGpDiscountTag.useGpDiscountTag({setting:e,styles:s,builderProps:t,...i});if(p)return jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:r("Not be displayed when published"),position:"bottom",width:"205px",children:jsxRuntime.jsx(NoDataState.default,{builderAttrs:t?.builderData,elementType:"secondary",description:r("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let y=system.createStyle(styles.getWrapperTextStyle(s)),j=system.createStyle(styles.getContainerStyle(s)),g=system.createClass(classes.getWrapperTextClass(s)),f=system.createClass(classes.getContainerClass()),T=system.createClass(classes.getRootClass({mode:u,salePrice:d,priceSave:c,bundleItem:l}));return jsxRuntime.jsx("div",{className:T,style:{...core.makeStyleResponsive("ta",o)},id:`shopify-text-element-${t?.uid}`,"data-id":t?.uid,"data-product-id":x,"gp-data-hidden":"false",children:system.If(!n," ",jsxRuntime.jsx("div",{className:f,style:j,children:jsxRuntime.jsx("div",{className:g,style:y,children:jsxRuntime.jsxs("div",{className:"gp-flex gp-break-all",children:[jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${t?.uid}-prefix`},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:m,options:{isCannotEditing:!0},excludeFlex:!0}}),jsxRuntime.jsx(Text.default,{styles:s,setting:{...e,text:a?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${t?.uid}-suffix`}}})]})})}))})};exports.default=ProductTag;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useCurrentVariant as t,useProduct as o,useProductStore as i,convertDecimalToNumber as l,shopifyPriceRounding as s,useProductOfferDiscount as p,useI18nStore as a,useRenderMode as n,useFormatMoney as c,cls as g}from"@gem-sdk/core";import{useMemo as m}from"react";import d from"../../text/components/Text.js";import{useDynamicProduct as u}from"../hooks/useDynamicProduct.js";import f from"../../../common/components/TooltipHover.js";import{calculateSellingPlanDiscount as P}from"../helpers/product-price-breakdown/getPrice.js";import{useSubscriptionSellingType as h}from"../hooks/useSubscriptionSellingType.js";let PostPurchaseProductPrice=({styles:y,style:x,builderAttrs:b,builderProps:N,children:j,setting:S})=>{let k=t(),D=o(),{isOneTime:F}=h(),v=i(e=>e.selectedSellingPlan),w=l(k?.price)??0,G=l(k?.salePrice)??0,T=parseFloat(s(p(),2)),{isDynamicProduct:I}=u(),{t:J}=a(),{isEditMode:O}=n(),{priceType:$,source:H}=S??{},q="compare"===$,z="offer"===$,A="price"===H,B="compare-price"===H,C=k?.sellingPlanGroups,E=D?.sellingPlanGroups,K=m(()=>{if(!v||F)return null;let e=k?.sellingPlanGroups??D?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===v)return e}return null},[JSON.stringify(C),JSON.stringify(E),v,F]),L=JSON.stringify(K?.pricingPolicies),M=K?.baseID,Q=m(()=>!K||w<=0||F?0:P({variantPrice:w,pricingPolicies:K.pricingPolicies}),[L,w,F]),R=m(()=>{let e=z&&!F&&v&&M;if(e){let e=parseFloat(s(w-Q,2)),r=parseFloat(s(e-T,2));return r>0?r:0}let r=parseFloat(s(w-T,2));return r>0?r:0},[z,F,v,M,w,Q,T]),U=m(()=>q?A?w:G:z?R:w,[q,A,z,w,G,R]),V=c(parseFloat(s(Number(U)||0,2)),!1),W=D?.baseID?.replace("gid://shopify/Product/",""),X=m(()=>q&&(!T&&G<w||B&&!G||A&&w<=0),[q,T,w,G,B,A]);return(!U&&!z||X)&&O?e(f,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:J("No compare price")})})}):X&&!O?null:r("div",{...b,className:g(N?.uid),style:{...x},id:`shopify-text-element-${N?.uid}`,"data-product-id":W,children:[e(d,{styles:y,setting:{text:I?"$???":V},className:g({"gp-money":z,"gp-product-compare-price":q,"gp-line-through":q&&y?.lineThrough})}),j]})};export{PostPurchaseProductPrice as default};
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useCurrentVariant as t,useProduct as o,useProductStore as i,convertDecimalToNumber as l,shopifyPriceRounding as s,useProductOfferDiscount as p,useI18nStore as a,useRenderMode as n,useFormatMoney as c,cls as g}from"@gem-sdk/core";import{useMemo as m}from"react";import d from"../../text/components/Text.js";import{useDynamicProduct as u}from"../hooks/useDynamicProduct.js";import f from"../../../common/components/TooltipHover.js";import{calculateSellingPlanDiscount as P}from"../helpers/product-price-breakdown/getPrice.js";import{useSubscriptionSellingType as h}from"../hooks/useSubscriptionSellingType.js";let PostPurchaseProductPrice=({styles:y,style:x,builderAttrs:b,builderProps:N,children:j,setting:S})=>{let k=t(),D=o(),{isOneTime:F}=h(),v=i(e=>e.selectedSellingPlan),w=l(k?.price)??0,G=l(k?.salePrice)??0,T=parseFloat(s(p(),2)),{isDynamicProduct:I}=u(),{t:J}=a(),{isEditMode:O}=n(),{priceType:$,source:H}=S??{},q="compare"===$,z="offer"===$,A="price"===H,B="compare-price"===H,C=k?.sellingPlanGroups,E=D?.sellingPlanGroups,K=m(()=>{if(!v||F)return null;let e=k?.sellingPlanGroups??D?.sellingPlanGroups??[];for(let r of e)if(r?.sellingPlans){for(let e of r.sellingPlans)if(e?.baseID===v)return e}return null},[JSON.stringify(C),JSON.stringify(E),v,F]),L=JSON.stringify(K?.pricingPolicies),M=K?.baseID,Q=m(()=>!K||w<=0||F?0:P({variantPrice:w,pricingPolicies:K.pricingPolicies}),[L,w,F]),R=m(()=>{let e=z&&!F&&v&&M;if(e){let e=parseFloat(s(w-Q,2)),r=parseFloat(s(e-T,2));return r>0?r:0}let r=parseFloat(s(w-T,2));return r>0?r:0},[z,F,v,M,w,Q,T]),U=m(()=>q?A?w:G:z?R:w,[q,A,z,w,G,R]),V=c(parseFloat(s(Number(U)||0,2)),!1),W=D?.baseID?.replace("gid://shopify/Product/",""),X=m(()=>q&&(!T&&G<w||B&&!G||A&&w<=0),[q,T,w,G,B,A]);return(!U&&!z||X)&&O?e(f,{enable:!0,text:J("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-h-[28px] gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:J("No compare price")})})}):X&&!O?null:r("div",{...b,className:g(N?.uid),style:{...x},id:`shopify-text-element-${N?.uid}`,"data-product-id":W,children:[e(d,{styles:y,setting:{text:I?"$???":V},className:g({"gp-money":z,"gp-product-compare-price":q,"gp-line-through":q&&y?.lineThrough})}),j]})};export{PostPurchaseProductPrice as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{useI18nStore as i}from"@gem-sdk/core";import o from"../../../../../common/components/TooltipHover.js";import{SubscriptionEnum as r}from"../../../constants/index.js";let OneTimePurchaseTooltip=t(({setting:t},p)=>{let{t:s}=i();return e("div",{ref:p,"data-selling-type":t?.sellingType,id:"product-subscription",children:e(o,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-px-2 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg gp-w-fit",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:s(t?.sellingType===r.ONE_TIME?"This product is only available as a subscription":"This product is only available as a one-time purchase")})})})})});OneTimePurchaseTooltip.displayName="OneTimePurchaseTooltip";export{OneTimePurchaseTooltip};
1
+ import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{useI18nStore as i}from"@gem-sdk/core";import o from"../../../../../common/components/TooltipHover.js";import{SubscriptionEnum as r}from"../../../constants/index.js";let OneTimePurchaseTooltip=t(({setting:t},p)=>{let{t:s}=i();return e("div",{ref:p,"data-selling-type":t?.sellingType,id:"product-subscription",children:e(o,{enable:!0,text:s("Not be displayed when published"),width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-px-2 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg gp-w-fit",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:s(t?.sellingType===r.ONE_TIME?"This product is only available as a subscription":"This product is only available as a one-time purchase")})})})})});OneTimePurchaseTooltip.displayName="OneTimePurchaseTooltip";export{OneTimePurchaseTooltip};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useI18nStore as s,makeStyleResponsive as o}from"@gem-sdk/core";import i from"../../../common/components/NoDataState.js";import l from"../../../common/components/TooltipHover.js";import r from"../../../text/components/Text.js";import{createStyle as d,createClass as m,If as n}from"@gem-sdk/system";import{getWrapperTextStyle as a,getContainerStyle as p}from"./common/styles.js";import{getWrapperTextClass as c,getContainerClass as u,getRootClass as x}from"./common/classes.js";import{useGpDiscountTag as f}from"./hooks/useGpDiscountTag.js";let ProductTag=({setting:g,styles:y,builderProps:h,...b})=>{let{customContent:j}=g??{},N=b["bundle-item"],{textAlign:T}=y??{},{t:v}=s(),{mode:k,product:w,salePrice:A,priceSave:D,currentProductId:F,unitCustomDisplay:S,shouldPlaceholderNoDiscount:$}=f({setting:g,styles:y,builderProps:h,...b});if($)return e(l,{enable:!0,text:"Not be displayed when published",position:"bottom",width:"205px",children:e(i,{builderAttrs:h?.builderData,elementType:"secondary",description:v("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let q=d(a(y)),C=d(p(y)),I=m(c(y)),P=m(u()),E=m(x({mode:k,salePrice:A,priceSave:D,bundleItem:N}));return e("div",{className:E,style:{...o("ta",T)},id:`shopify-text-element-${h?.uid}`,"data-id":h?.uid,"data-product-id":F,"gp-data-hidden":"false",children:n(!w," ",e("div",{className:P,style:C,children:e("div",{className:I,style:q,children:t("div",{className:"gp-flex gp-break-all",children:[e(r,{styles:y,setting:{...g,text:j?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${h?.uid}-prefix`},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:S,options:{isCannotEditing:!0},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:j?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${h?.uid}-suffix`}}})]})})}))})};export{ProductTag as default};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useI18nStore as s,makeStyleResponsive as o}from"@gem-sdk/core";import i from"../../../common/components/NoDataState.js";import l from"../../../common/components/TooltipHover.js";import r from"../../../text/components/Text.js";import{createStyle as d,createClass as m,If as n}from"@gem-sdk/system";import{getWrapperTextStyle as a,getContainerStyle as p}from"./common/styles.js";import{getWrapperTextClass as c,getContainerClass as u,getRootClass as x}from"./common/classes.js";import{useGpDiscountTag as f}from"./hooks/useGpDiscountTag.js";let ProductTag=({setting:g,styles:y,builderProps:h,...b})=>{let{customContent:j}=g??{},N=b["bundle-item"],{textAlign:T}=y??{},{t:v}=s(),{mode:k,product:w,salePrice:A,priceSave:D,currentProductId:F,unitCustomDisplay:S,shouldPlaceholderNoDiscount:$}=f({setting:g,styles:y,builderProps:h,...b});if($)return e(l,{enable:!0,text:v("Not be displayed when published"),position:"bottom",width:"205px",children:e(i,{builderAttrs:h?.builderData,elementType:"secondary",description:v("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let q=d(a(y)),C=d(p(y)),I=m(c(y)),P=m(u()),E=m(x({mode:k,salePrice:A,priceSave:D,bundleItem:N}));return e("div",{className:E,style:{...o("ta",T)},id:`shopify-text-element-${h?.uid}`,"data-id":h?.uid,"data-product-id":F,"gp-data-hidden":"false",children:n(!w," ",e("div",{className:P,style:C,children:e("div",{className:I,style:q,children:t("div",{className:"gp-flex gp-break-all",children:[e(r,{styles:y,setting:{...g,text:j?.prefix?.replaceAll(" ","&nbsp;"),options:{useState:!0,uniqueId:`${h?.uid}-prefix`},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:S,options:{isCannotEditing:!0},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:j?.suffix?.replaceAll(" ","&nbsp;"),excludeFlex:!0,options:{useState:!0,uniqueId:`${h?.uid}-suffix`}}})]})})}))})};export{ProductTag as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "12.0.0-staging.78",
3
+ "version": "12.0.0-staging.80",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js && node ./scripts/translate/en-keys-usage.js"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "12.0.0-staging.77",
29
+ "@gem-sdk/core": "12.0.0-staging.79",
30
30
  "@gem-sdk/styles": "12.0.0-staging.66",
31
31
  "@gem-sdk/system": "12.0.0-staging.66",
32
32
  "@types/react-transition-group": "^4.4.12",