@gem-sdk/components 2.0.0-dev.849 → 2.0.0-dev.854
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/countdown-timer/components/TextCountdown.js +1 -1
- package/dist/cjs/post-purchase/product/components/ProductPriceBreakdown.js +1 -1
- package/dist/esm/post-purchase/countdown-timer/components/TextCountdown.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductPriceBreakdown.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),Text=require("../../text/Text.js"),useCountdownTimer=require("../hooks/useCountdownTimer.js");const TextCountdown=e=>{let{dateTime:t,setting:r,styles:u}=e,{typo:n,textAlign:
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),Text=require("../../text/Text.js"),useCountdownTimer=require("../hooks/useCountdownTimer.js");const TextCountdown=e=>{let{dateTime:t,setting:r,styles:u}=e,{typo:n,textAlign:s}=u||{},{conditionText:o,expiredText:x}=r||{},{format:i,isExpried:a}=useCountdownTimer.useCountdown(t),m=react.useMemo(()=>{let e={typo:n,textAlign:s};return e},[s,n]),T=react.useMemo(()=>a?x:`${o} ${i}`,[a,i,o,x]);return jsxRuntime.jsx(Text.default,{setting:{text:T},styles:m,textClass:"!gp-break-normal"})};exports.TextCountdown=TextCountdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),react=require("react"),helper=require("../../utils/helper.js"),MoneyLine=require("./priceBreakdown/MoneyLine.js");const PostPurchaseProductPriceBreakdown=({setting:e={},styles:t={},style:i,builderAttrs:l,builderProps:s,children:o})=>{let r=core.useCurrentVariant(),n=core.useProduct(),{quantity:a}=core.useQuantity(),u=r?.price??0,c=parseFloat(core.shopifyPriceRounding(core.useProductOfferDiscount(),2)),d=c*(a||1),p=u*(a||1),x=core.useFormatMoney(p,!0),m=core.useFormatMoney(d,!0),g=core.useFormatMoney(p-d,!0),h=n?.baseID?.replace("gid://shopify/Product/",""),{labelStyle:j,moneyStyle:b,spacing:f,width:y,align:L,isShowPrice:w}=t,R=react.useMemo(()=>helper.postPurchaseSpacing[f||"none"],[f]),[v,P]=react.useState(w);react.useEffect(()=>{P(w)},[w]);let q=react.useMemo(()=>[{title:e.subTotalLabel,money:x,uniqueId:"subTotalLabel"},{title:e.discountLabel,money:c>0?m:"No discount",uniqueId:"discountLabel"},{title:e.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}},{title:e.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}},{title:e.totalLabel,uniqueId:"totalLabel",money:g}],[c,m,e.discountLabel,e.shippingLabel,e.subTotalLabel,e.taxesLabel,e.totalLabel,x,g]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-text-[#1879B9] gp-h-4.5 gp-cursor-pointer",onClick:()=>P(e=>!e),onKeyUp:()=>null,role:"button",tabIndex:0,"aria-hidden":"true",children:[jsxRuntime.jsx("p",{className:"gp-underline",children:v?"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),react=require("react"),helper=require("../../utils/helper.js"),MoneyLine=require("./priceBreakdown/MoneyLine.js");const PostPurchaseProductPriceBreakdown=({setting:e={},styles:t={},style:i,builderAttrs:l,builderProps:s,children:o})=>{let r=core.useCurrentVariant(),n=core.useProduct(),{quantity:a}=core.useQuantity(),u=r?.price??0,c=parseFloat(core.shopifyPriceRounding(core.useProductOfferDiscount(),2)),d=c*(a||1),p=u*(a||1),x=core.useFormatMoney(p,!0),m=core.useFormatMoney(d,!0),g=core.useFormatMoney(p-d,!0),h=n?.baseID?.replace("gid://shopify/Product/",""),{labelStyle:j,moneyStyle:b,spacing:f,width:y,align:L,isShowPrice:w}=t,R=react.useMemo(()=>helper.postPurchaseSpacing[f||"none"],[f]),[v,P]=react.useState(w);react.useEffect(()=>{P(w)},[w]);let q=react.useMemo(()=>[{title:e.subTotalLabel,money:x,uniqueId:"subTotalLabel"},{title:e.discountLabel,money:c>0?m:"No discount",uniqueId:"discountLabel"},{title:e.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}},{title:e.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}},{title:e.totalLabel,uniqueId:"totalLabel",money:g}],[c,m,e.discountLabel,e.shippingLabel,e.subTotalLabel,e.taxesLabel,e.totalLabel,x,g]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-text-[#1879B9] gp-h-4.5 gp-cursor-pointer",onClick:()=>P(e=>!e),onKeyUp:()=>null,role:"button",tabIndex:0,"aria-hidden":"true",children:[jsxRuntime.jsx("p",{className:"gp-underline",children:v?"Hide price breakdown":"Show price breakdown"}),jsxRuntime.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`${!v||"gp-rotate-180"}`,children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),jsxRuntime.jsx("div",{className:"gp-w-full gp-h-[1px] gp-bg-[#E9E9E9] gp-my-3"}),v?jsxRuntime.jsx("div",{className:"gp-col-[1] gp-row-[1] gp-overflow-hidden",children:jsxRuntime.jsxs("div",{...l,className:core.cls(s?.uid,"gp-flex gp-w-full","gp-min-h-0","left"===L?"gp-justify-start":"right"===L?"gp-justify-end":"gp-justify-center"),style:{...i},id:`shopify-text-element-${s?.uid}`,"data-product-id":h,children:[jsxRuntime.jsx("div",{className:"gp-flex gp-flex-col",style:{...core.makeStyleResponsive("w",y),gap:R},children:q.map((e,t)=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(MoneyLine.default,{uniqueId:e.uniqueId,builderPropsUID:s?.uid,title:e.title,money:e.money,tooltipData:e.tooltip,labelTextStyles:{typo:j},moneyTextStyles:{typo:b}}),t==q.length-2&&jsxRuntime.jsx("hr",{})]},e.uniqueId))}),o]})}):null]})};exports.default=PostPurchaseProductPriceBreakdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import r from"../../text/Text.js";import{useCountdown as o}from"../hooks/useCountdownTimer.js";let TextCountdown=m=>{let{dateTime:n,setting:s,styles:i}=m,{typo:u,textAlign:x}=i||{},{conditionText:l,expiredText:p}=s||{},{format:a,isExpried:f}=o(n),C=e(()=>{let t={typo:u,textAlign:x};return t},[x,u]),T=e(()=>f?p:`${l} ${a}`,[f,a,l,p]);return t(r,{setting:{text:T},styles:C,textClass:"!gp-break-normal"})};export{TextCountdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as l}from"react/jsx-runtime";import{useCurrentVariant as i,useProduct as o,useQuantity as a,shopifyPriceRounding as n,useProductOfferDiscount as r,useFormatMoney as d,cls as p,makeStyleResponsive as s}from"@gem-sdk/core";import{useMemo as u,useState as c,useEffect as g}from"react";import{postPurchaseSpacing as h}from"../../utils/helper.js";import m from"./priceBreakdown/MoneyLine.js";let PostPurchaseProductPriceBreakdown=({setting:b={},styles:f={},style:w,builderAttrs:y,builderProps:L,children:x})=>{let v=i(),I=o(),{quantity:P}=a(),q=v?.price??0,N=parseFloat(n(r(),2)),k=N*(P||1),C=q*(P||1),j=d(C,!0),B=d(k,!0),T=d(C-k,!0),S=I?.baseID?.replace("gid://shopify/Product/",""),{labelStyle:D,moneyStyle:E,spacing:M,width:R,align:U,isShowPrice:$}=f,F=u(()=>h[M||"none"],[M]),[H,K]=c($);g(()=>{K($)},[$]);let Z=u(()=>[{title:b.subTotalLabel,money:j,uniqueId:"subTotalLabel"},{title:b.discountLabel,money:N>0?B:"No discount",uniqueId:"discountLabel"},{title:b.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}},{title:b.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}},{title:b.totalLabel,uniqueId:"totalLabel",money:T}],[N,B,b.discountLabel,b.shippingLabel,b.subTotalLabel,b.taxesLabel,b.totalLabel,j,T]);return e(t,{children:[e("div",{className:"gp-flex gp-text-[#1879B9] gp-h-4.5 gp-cursor-pointer",onClick:()=>K(e=>!e),onKeyUp:()=>null,role:"button",tabIndex:0,"aria-hidden":"true",children:[l("p",{className:"gp-underline",children:H?"
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as l}from"react/jsx-runtime";import{useCurrentVariant as i,useProduct as o,useQuantity as a,shopifyPriceRounding as n,useProductOfferDiscount as r,useFormatMoney as d,cls as p,makeStyleResponsive as s}from"@gem-sdk/core";import{useMemo as u,useState as c,useEffect as g}from"react";import{postPurchaseSpacing as h}from"../../utils/helper.js";import m from"./priceBreakdown/MoneyLine.js";let PostPurchaseProductPriceBreakdown=({setting:b={},styles:f={},style:w,builderAttrs:y,builderProps:L,children:x})=>{let v=i(),I=o(),{quantity:P}=a(),q=v?.price??0,N=parseFloat(n(r(),2)),k=N*(P||1),C=q*(P||1),j=d(C,!0),B=d(k,!0),T=d(C-k,!0),S=I?.baseID?.replace("gid://shopify/Product/",""),{labelStyle:D,moneyStyle:E,spacing:M,width:R,align:U,isShowPrice:$}=f,F=u(()=>h[M||"none"],[M]),[H,K]=c($);g(()=>{K($)},[$]);let Z=u(()=>[{title:b.subTotalLabel,money:j,uniqueId:"subTotalLabel"},{title:b.discountLabel,money:N>0?B:"No discount",uniqueId:"discountLabel"},{title:b.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}},{title:b.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}},{title:b.totalLabel,uniqueId:"totalLabel",money:T}],[N,B,b.discountLabel,b.shippingLabel,b.subTotalLabel,b.taxesLabel,b.totalLabel,j,T]);return e(t,{children:[e("div",{className:"gp-flex gp-text-[#1879B9] gp-h-4.5 gp-cursor-pointer",onClick:()=>K(e=>!e),onKeyUp:()=>null,role:"button",tabIndex:0,"aria-hidden":"true",children:[l("p",{className:"gp-underline",children:H?"Hide price breakdown":"Show price breakdown"}),l("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`${!H||"gp-rotate-180"}`,children:l("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),l("div",{className:"gp-w-full gp-h-[1px] gp-bg-[#E9E9E9] gp-my-3"}),H?l("div",{className:"gp-col-[1] gp-row-[1] gp-overflow-hidden",children:e("div",{...y,className:p(L?.uid,"gp-flex gp-w-full","gp-min-h-0","left"===U?"gp-justify-start":"right"===U?"gp-justify-end":"gp-justify-center"),style:{...w},id:`shopify-text-element-${L?.uid}`,"data-product-id":S,children:[l("div",{className:"gp-flex gp-flex-col",style:{...s("w",R),gap:F},children:Z.map((t,i)=>e("div",{children:[l(m,{uniqueId:t.uniqueId,builderPropsUID:L?.uid,title:t.title,money:t.money,tooltipData:t.tooltip,labelTextStyles:{typo:D},moneyTextStyles:{typo:E}}),i==Z.length-2&&l("hr",{})]},t.uniqueId))}),x]})}):null]})};export{PostPurchaseProductPriceBreakdown as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.854",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"format": "prettier --write \"./src/**/*.{ts,tsx}\""
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
24
|
+
"@gem-sdk/core": "2.0.0-dev.852",
|
|
25
25
|
"@gem-sdk/styles": "1.14.0-dev.831",
|
|
26
26
|
"@types/react-transition-group": "^4.4.5"
|
|
27
27
|
},
|