@dropins/storefront-cart 0.3.0 → 0.4.0-beta1
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/api.js +5 -5
- package/chunks/CartFragment.js +235 -0
- package/chunks/EmptyCart.js +1 -0
- package/chunks/getEstimateShipping.js +48 -0
- package/chunks/getEstimatedTotals.js +4 -51
- package/chunks/getStoreConfig.js +4 -4
- package/chunks/resetCart.js +1 -230
- package/chunks/updateProductsFromCart.js +4 -4
- package/components/Cart/Cart.d.ts +2 -1
- package/components/EstimateShipping/EstimateShipping.d.ts +20 -0
- package/components/EstimateShipping/index.d.ts +2 -0
- package/components/MiniCart/MiniCart.d.ts +1 -0
- package/components/OrderSummary/OrderSummary.d.ts +37 -0
- package/components/OrderSummary/index.d.ts +3 -0
- package/components/index.d.ts +3 -1
- package/containers/Cart/Cart.d.ts +4 -6
- package/containers/Cart.js +1 -1
- package/containers/EstimateShipping/EstimateShipping.d.ts +7 -0
- package/containers/EstimateShipping/index.d.ts +3 -0
- package/containers/EstimateShipping.d.ts +3 -0
- package/containers/EstimateShipping.js +1 -0
- package/containers/MiniCart.js +1 -1
- package/containers/OrderSummary/OrderSummary.d.ts +16 -0
- package/containers/OrderSummary/index.d.ts +3 -0
- package/containers/OrderSummary.d.ts +3 -0
- package/containers/OrderSummary.js +1 -0
- package/containers/index.d.ts +2 -0
- package/data/models/cart-model.d.ts +9 -1
- package/data/models/index.d.ts +1 -0
- package/data/models/shipping-models.d.ts +16 -0
- package/data/transforms/__fixtures__/productTypesData.d.ts +223 -5
- package/data/transforms/transform-shipping.d.ts +5 -0
- package/i18n/en_US.json.d.ts +57 -2
- package/lib/state.d.ts +1 -0
- package/package.json +1 -1
- package/render.js +2 -2
- package/chunks/MiniCart.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as d,jsx as t,Fragment as M}from"@dropins/tools/preact-jsx-runtime.js";import*as j from"@dropins/tools/preact-compat.js";import{useState as V,useEffect as J}from"@dropins/tools/preact-compat.js";import{classes as l,VComponent as y,Slot as rr}from"@dropins/tools/lib.js";import{events as K}from"@dropins/tools/event-bus.js";import{s as er,i as tr}from"../chunks/resetCart.js";import{g as ar}from"../chunks/getEstimatedTotals.js";import{Accordion as ir,AccordionSection as cr,ProgressSpinner as nr,Divider as mr,Price as s,Button as ur}from"@dropins/tools/components.js";/* empty css */import{useText as Y}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/CartFragment.js";const or=()=>{const[x,D]=V(!1),[T,h]=V();return{handleEstimateTotals:(r,p)=>{D(!0);const{shippingCountry:_,shippingState:e="",shippingZip:S=""}=r,a={countryCode:_,postcode:S,region:{region:e},shipping_method:{carrier_code:(p==null?void 0:p.carrier_code)||"",method_code:(p==null?void 0:p.method_code)||""}};ar(a).then(i=>{var B,C,v,u,P,N,w,I,k,E,L,o,O,W,A,G,c,n,U,X;i&&h({estimatedTaxTotal:{amount:(B=i.totalTax)==null?void 0:B.value,currency:(C=i.totalTax)==null?void 0:C.currency},estimatedSubTotal:{excludingTax:{amount:(u=(v=i.subtotal)==null?void 0:v.excludingTax)==null?void 0:u.value,currency:(N=(P=i.subtotal)==null?void 0:P.excludingTax)==null?void 0:N.currency},includingTax:{amount:(I=(w=i.subtotal)==null?void 0:w.includingTax)==null?void 0:I.value,currency:(E=(k=i.subtotal)==null?void 0:k.includingTax)==null?void 0:E.currency},includingDiscountOnly:{amount:(o=(L=i.subtotal)==null?void 0:L.includingDiscountOnly)==null?void 0:o.value,currency:(W=(O=i.subtotal)==null?void 0:O.includingDiscountOnly)==null?void 0:W.currency}},estimatedGrandTotalPrice:{includingTax:{amount:(A=i.total)==null?void 0:A.includingTax.value,currency:(G=i.total)==null?void 0:G.includingTax.currency},excludingTax:{amount:(c=i.total)==null?void 0:c.excludingTax.value,currency:(n=i.total)==null?void 0:n.excludingTax.currency}},estimatedAppliedTaxes:{taxes:(U=i.appliedTaxes)==null?void 0:U.map(m=>{var g,b;return{label:m.label,amount:{value:(g=m.amount)==null?void 0:g.value,currency:(b=m.amount)==null?void 0:b.currency}}})},estimatedItems:{items:(X=i.items)==null?void 0:X.map(m=>{var g,b,z,F,Z,q,$,Q,R,H;return{uid:m.uid,price:{amount:(g=m.price)==null?void 0:g.value,currency:(b=m.price)==null?void 0:b.currency},taxedPrice:{amount:(z=m.taxedPrice)==null?void 0:z.value,currency:(F=m.taxedPrice)==null?void 0:F.currency},rowTotal:{amount:(Z=m.rowTotal)==null?void 0:Z.value,currency:(q=m.rowTotal)==null?void 0:q.currency},rowTotalIncludingTax:{amount:($=m.rowTotalIncludingTax)==null?void 0:$.value,currency:(Q=m.rowTotalIncludingTax)==null?void 0:Q.currency},regularPrice:{amount:(R=m.regularPrice)==null?void 0:R.value,currency:(H=m.regularPrice)==null?void 0:H.currency}}})}})}).finally(()=>{D(!1)})},estimatedTotals:T,loading:x}},lr=x=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...x},j.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),sr=x=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...x},j.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),dr=({className:x,children:D,variant:T="primary",heading:h,loading:f=!0,subTotal:r,shipping:p,discounts:_,taxTotal:e,taxesApplied:S,total:a,primaryAction:i,...B})=>{const[C,v]=V(!1),u=Y({checkout:"Cart.PriceSummary.checkout",discountedPrice:"Cart.CartItem.discountedPrice",download:"Cart.CartItem.download",heading:"Cart.Cart.heading",message:"Cart.CartItem.message",regularPrice:"Cart.CartItem.regularPrice",recipient:"Cart.CartItem.recipient",sender:"Cart.CartItem.sender",file:"Cart.CartItem.file",files:"Cart.CartItem.files",orderSummary:"Cart.PriceSummary.orderSummary",taxesBreakdownTitle:"Cart.PriceSummary.taxes.breakdown",taxTotal:"Cart.PriceSummary.taxes.total",taxEstimated:"Cart.PriceSummary.taxes.estimated",taxTotalOnly:"Cart.PriceSummary.taxes.totalOnly",showTaxBreakdown:"Cart.PriceSummary.taxes.showBreakdown",hideTaxBreakdown:"Cart.PriceSummary.taxes.hideBreakdown",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",subtotalLabel:"Cart.PriceSummary.subTotal.label",subtotalWithTaxes:"Cart.PriceSummary.subTotal.withTaxes",subtotalWithoutTaxes:"Cart.PriceSummary.subTotal.withoutTaxes",totalEstimated:"Cart.PriceSummary.total.estimated",totalLabel:"Cart.PriceSummary.total.label",totalWithoutTax:"Cart.PriceSummary.total.withoutTax",shippingLabel:"Cart.PriceSummary.shipping.label",zipPlaceholder:"Cart.PriceSummary.shipping.zipPlaceholder",editZipAction:"Cart.PriceSummary.shipping.editZipAction",shippingWithTaxes:"Cart.PriceSummary.shipping.withTaxes",shippingWithoutTaxes:"Cart.PriceSummary.shipping.withoutTaxes",shippingEstimated:"Cart.PriceSummary.shipping.estimated",shippingEstimatedByState:"Cart.PriceSummary.shipping.alternateField.state",shippingEstimatedByZip:"Cart.PriceSummary.shipping.alternateField.zip",destinationLinkAriaLabel:"Cart.PriceSummary.shipping.destinationLinkAriaLabel",applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder"}),P=r&&d("div",{className:l(["cart-order-summary__entry","cart-order-summary__subTotal"]),children:[t("span",{className:"cart-order-summary__label",children:u.subtotalLabel}),t(y,{node:r.price,className:"cart-order-summary__price"}),r.taxIncluded&&t("div",{"data-testid":"sub-total-tax-caption",className:"cart-order-summary__caption",children:t("span",{children:u.subtotalWithTaxes})}),r.taxExcluded?t("div",{"data-testid":"sub-total-tax-caption-excluded",className:"cart-order-summary__caption",children:d("span",{children:[r.priceExcludingTax," ",u.subtotalWithoutTaxes]})}):void 0]}),N=p&&t(y,{node:p,className:"cart-order-summary__shipping"}),w=_&&_.length>0&&t(M,{children:_.map(o=>d("div",{className:l(["cart-order-summary__entry","cart-order-summary__discount"]),children:[t("span",{className:"cart-order-summary__label",children:o.label}),t(y,{node:o.price,className:"cart-order-summary__price"}),o.caption&&t(y,{node:o.caption,className:"cart-order-summary__caption"})]},o.label))}),I=S&&S.length>0?t(ir,{"data-testid":"tax-breakdown",className:"cart-order-summary__taxes",iconOpen:lr,iconClose:sr,children:d(cr,{title:u.taxesBreakdownTitle,secondaryText:!C&&e?t(y,{node:e.price,className:"cart-order-summary__price"}):void 0,renderContentWhenClosed:!1,onStateChange:v,children:[t("div",{className:"cart-order-summary__appliedTaxes",children:S.map(o=>d("div",{className:l(["cart-order-summary__entry","cart-order-summary__taxEntry"]),children:[t("span",{className:l(["cart-order-summary__label","cart-order-summary__label--muted"]),children:o.label}),t(y,{node:o.price,className:l(["cart-order-summary__price","cart-order-summary__price--muted"])})]},o.label))}),d("div",{className:l(["cart-order-summary__entry","cart-order-summary__taxTotal"]),children:[t("span",{className:"cart-order-summary__label",children:u.taxTotal}),e&&t(y,{node:e.price,className:"cart-order-summary__price"})]})]})}):e&&d("div",{"data-testid":"tax-total-only",className:l(["cart-order-summary__entry","cart-order-summary__taxTotal"]),children:[t("span",{className:"cart-order-summary__label",children:e.estimated?u.taxEstimated:u.taxTotalOnly}),t(y,{node:e.price,className:"cart-order-summary__price"})]}),k=a&&d("div",{"data-testid":"total-content",className:l(["cart-order-summary__entry","cart-order-summary__total",a.estimated&&"cart-order-summary__total--padded"]),children:[t("span",{className:l(["cart-order-summary__label","cart-order-summary__label--bold"]),children:a.estimated?u.totalEstimated:u.totalLabel}),t(y,{node:a.price,className:l(["cart-order-summary__price","cart-order-summary__price--bold"])})]}),E=a&&a.priceWithoutTax&&d("div",{"data-testid":"total-without-tax",className:l(["cart-order-summary__entry","cart-order-summary__totalWithoutTax"]),children:[t("span",{className:l(["cart-order-summary__label","cart-order-summary__label--muted"]),children:u.totalWithoutTax}),t(y,{node:a.priceWithoutTax,className:l(["cart-order-summary__price","cart-order-summary__price--muted"])})]}),L=i&&t("div",{className:l(["cart-order-summary__entry","cart-order-summary__primaryAction"]),children:i});return d("div",{...B,className:l(["cart-order-summary",["cart-order-summary--loading",f],[`cart-order-summary__${T}`,T],x]),children:[f&&t(nr,{className:"cart-order-summary__spinner"}),d("div",{className:"cart-order-summary__heading",children:[h&&t(y,{node:h,className:"cart-order-summary__heading-text"}),t(mr,{variant:"primary",className:"cart-order-summary__divider-primary"})]}),d("div",{className:"cart-order-summary__content",children:[P,N,w,I,k,E,L]})]})},pr=({children:x,initialData:D=null,routeCheckout:T,slots:h,...f})=>{var C,v,u,P,N,w,I,k,E,L,o,O,W,A,G;const[r,p]=V(D),{handleEstimateTotals:_,estimatedTotals:e,loading:S}=or(),a=(C=er.config)==null?void 0:C.shoppingCartDisplaySetting;J(()=>{const c=K.on("cart/data",n=>{p(n)},{eager:!0});return()=>{c==null||c.off()}},[]),J(()=>{const c=K.on("shipping/estimate",n=>{var m,g,b,z,F;const U={shippingCountry:(m=n==null?void 0:n.address)==null?void 0:m.countryCode,shippingState:(g=n==null?void 0:n.address)==null?void 0:g.region,shippingZip:(b=n==null?void 0:n.address)==null?void 0:b.postCode},X={carrier_code:((z=n==null?void 0:n.shippingMethod)==null?void 0:z.carrierCode)||"",method_code:((F=n==null?void 0:n.shippingMethod)==null?void 0:F.methodCode)||""};_(U,X)});return()=>{c==null||c.off()}},[_]);const i=Y({checkout:"Cart.PriceSummary.checkout",orderSummary:"Cart.PriceSummary.orderSummary",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined"}),B=!(r!=null&&r.isVirtual)&&(h!=null&&h.EstimateShipping)?t(rr,{name:"EstimateShipping",slot:h.EstimateShipping},"estimateShippingId"):void 0;return!Object.keys(r??{}).length||(r==null?void 0:r.totalQuantity)===0?null:t(dr,{...f,"data-testid":"cart-order-summary",heading:t("div",{children:i.orderSummary}),shipping:B,loading:S,subTotal:{taxIncluded:(a==null?void 0:a.subtotal)==="INCLUDING_TAX"&&!(a!=null&&a.zeroTax),taxExcluded:(a==null?void 0:a.subtotal)==="INCLUDING_EXCLUDING_TAX",zeroTaxSubtotal:a==null?void 0:a.zeroTax,priceExcludingTax:(v=e==null?void 0:e.estimatedSubTotal)!=null&&v.excludingTax?t(s,{"data-testid":"subtotal",...(u=e==null?void 0:e.estimatedSubTotal)==null?void 0:u.excludingTax}):t(s,{"data-testid":"subtotal",amount:(P=r==null?void 0:r.subtotal.excludingTax)==null?void 0:P.value,currency:(N=r==null?void 0:r.subtotal.excludingTax)==null?void 0:N.currency}),price:!(a!=null&&a.zeroTax)&&(a==null?void 0:a.subtotal)==="INCLUDING_TAX"||!(a!=null&&a.zeroTax)&&(a==null?void 0:a.subtotal)==="INCLUDING_EXCLUDING_TAX"?(w=e==null?void 0:e.estimatedSubTotal)!=null&&w.includingTax?t(s,{"data-testid":"subtotal",...(I=e==null?void 0:e.estimatedSubTotal)==null?void 0:I.includingTax}):t(s,{"data-testid":"subtotal",amount:(k=r==null?void 0:r.subtotal.includingTax)==null?void 0:k.value,currency:(E=r==null?void 0:r.subtotal.includingTax)==null?void 0:E.currency}):t(s,{"data-testid":"subtotal",amount:(L=r==null?void 0:r.subtotal.excludingTax)==null?void 0:L.value,currency:(o=r==null?void 0:r.subtotal.excludingTax)==null?void 0:o.currency})},discounts:r==null?void 0:r.appliedDiscounts.map(c=>({label:c.label,price:t(s,{"data-testid":"summary-discount-total",amount:-c.amount.value,currency:c.amount.currency,sale:!0})})),taxTotal:r!=null&&r.isVirtual?{price:t("span",{"data-testid":"tax-total",children:i.taxToBeDetermined})}:{price:e!=null&&e.estimatedTaxTotal?t(s,{"data-testid":"tax-total",...e==null?void 0:e.estimatedTaxTotal}):r!=null&&r.totalTax?t(s,{"data-testid":"tax-total",amount:(O=r==null?void 0:r.totalTax)==null?void 0:O.value,currency:(W=r==null?void 0:r.totalTax)==null?void 0:W.currency}):t("span",{"data-testid":"tax-total",children:i.taxToBeDetermined}),estimated:!!(e!=null&&e.estimatedTaxTotal)},taxesApplied:r!=null&&r.isVirtual?void 0:a!=null&&a.fullSummary&&(e!=null&&e.estimatedAppliedTaxes)?(G=(A=e==null?void 0:e.estimatedAppliedTaxes)==null?void 0:A.taxes)==null?void 0:G.map(c=>({label:c.label,price:t(s,{"data-testid":"applied-taxes",amount:c.amount.value,currency:c.amount.currency})})):a!=null&&a.fullSummary?r==null?void 0:r.appliedTaxes.map(c=>({label:c.label,price:t(s,{"data-testid":"applied-taxes",amount:c.amount.value,currency:c.amount.currency})})):void 0,total:{price:e!=null&&e.estimatedGrandTotalPrice?t(s,{...e==null?void 0:e.estimatedGrandTotalPrice.includingTax}):t(s,{amount:r==null?void 0:r.total.includingTax.value,currency:r==null?void 0:r.total.includingTax.currency}),estimated:!!(e!=null&&e.estimatedGrandTotalPrice),priceWithoutTax:a!=null&&a.grandTotal?e!=null&&e.estimatedAppliedTaxes?t(s,{...e==null?void 0:e.estimatedGrandTotalPrice.excludingTax}):t(s,{amount:r==null?void 0:r.total.excludingTax.value,currency:r==null?void 0:r.total.excludingTax.currency}):void 0},primaryAction:T&&t(ur,{"data-testid":"checkout-button",variant:"primary",disabled:r==null?void 0:r.hasOutOfStockItems,"aria-disabled":r==null?void 0:r.hasOutOfStockItems,href:r!=null&&r.hasOutOfStockItems?void 0:T({cartId:r.id}),children:i.checkout})})};pr.getInitialData=async function(){return tr()};export{pr as OrderSummary,pr as default};
|
package/containers/index.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export interface CartModel {
|
|
|
27
27
|
}[];
|
|
28
28
|
};
|
|
29
29
|
isGuestCart?: boolean;
|
|
30
|
+
hasOutOfStockItems?: boolean;
|
|
31
|
+
hasFullyOutOfStockItems?: boolean;
|
|
30
32
|
}
|
|
31
33
|
interface TotalPriceModifier {
|
|
32
34
|
amount: Price;
|
|
@@ -64,6 +66,12 @@ export interface Item {
|
|
|
64
66
|
recipientEmail?: string;
|
|
65
67
|
sender?: string;
|
|
66
68
|
senderEmail?: string;
|
|
69
|
+
lowInventory?: boolean;
|
|
70
|
+
insufficientQuantity?: boolean;
|
|
71
|
+
onlyXLeftInStock?: number | null;
|
|
72
|
+
outOfStock?: boolean;
|
|
73
|
+
notAvailableMessage?: string;
|
|
74
|
+
stockLevel?: String;
|
|
67
75
|
}
|
|
68
76
|
interface ItemError {
|
|
69
77
|
id: string;
|
|
@@ -73,7 +81,7 @@ interface ItemImage {
|
|
|
73
81
|
src: string;
|
|
74
82
|
alt: string;
|
|
75
83
|
}
|
|
76
|
-
interface Price {
|
|
84
|
+
export interface Price {
|
|
77
85
|
value: number;
|
|
78
86
|
currency: string;
|
|
79
87
|
}
|
package/data/models/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Price } from './cart-model';
|
|
2
|
+
|
|
3
|
+
export interface PartialAddress {
|
|
4
|
+
countryCode: string;
|
|
5
|
+
postCode?: string;
|
|
6
|
+
region?: string;
|
|
7
|
+
regionCode?: string;
|
|
8
|
+
regionId?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ShippingMethod {
|
|
11
|
+
carrierCode: string;
|
|
12
|
+
methodCode: string;
|
|
13
|
+
amountExclTax?: Price;
|
|
14
|
+
amountInclTax?: Price;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=shipping-models.d.ts.map
|
|
@@ -323,7 +323,7 @@ declare const simple: {
|
|
|
323
323
|
};
|
|
324
324
|
declare const simpleCustomizable: {
|
|
325
325
|
__typename: string;
|
|
326
|
-
customizable_options: {
|
|
326
|
+
customizable_options: ({
|
|
327
327
|
type: string;
|
|
328
328
|
customizable_option_uid: string;
|
|
329
329
|
label: string;
|
|
@@ -332,7 +332,15 @@ declare const simpleCustomizable: {
|
|
|
332
332
|
label: string;
|
|
333
333
|
value: string;
|
|
334
334
|
}[];
|
|
335
|
-
}
|
|
335
|
+
} | {
|
|
336
|
+
type: string;
|
|
337
|
+
customizable_option_uid: string;
|
|
338
|
+
label: string;
|
|
339
|
+
values: {
|
|
340
|
+
label: string;
|
|
341
|
+
value: string;
|
|
342
|
+
}[];
|
|
343
|
+
})[];
|
|
336
344
|
uid: string;
|
|
337
345
|
quantity: number;
|
|
338
346
|
errors: null;
|
|
@@ -482,7 +490,7 @@ declare const configurable: {
|
|
|
482
490
|
};
|
|
483
491
|
};
|
|
484
492
|
declare const configurableCustomizable: {
|
|
485
|
-
customizable_options: {
|
|
493
|
+
customizable_options: ({
|
|
486
494
|
type: string;
|
|
487
495
|
customizable_option_uid: string;
|
|
488
496
|
label: string;
|
|
@@ -491,7 +499,15 @@ declare const configurableCustomizable: {
|
|
|
491
499
|
label: string;
|
|
492
500
|
value: string;
|
|
493
501
|
}[];
|
|
494
|
-
}
|
|
502
|
+
} | {
|
|
503
|
+
type: string;
|
|
504
|
+
customizable_option_uid: string;
|
|
505
|
+
label: string;
|
|
506
|
+
values: {
|
|
507
|
+
label: string;
|
|
508
|
+
value: string;
|
|
509
|
+
}[];
|
|
510
|
+
})[];
|
|
495
511
|
__typename: string;
|
|
496
512
|
configurable_options: {
|
|
497
513
|
configurable_product_option_uid: string;
|
|
@@ -706,5 +722,207 @@ declare const downloadbleWithMultipleLinks: {
|
|
|
706
722
|
};
|
|
707
723
|
};
|
|
708
724
|
};
|
|
709
|
-
|
|
725
|
+
declare const simpleLowInventory: {
|
|
726
|
+
__typename: string;
|
|
727
|
+
is_available: boolean;
|
|
728
|
+
customizable_options: never[];
|
|
729
|
+
product: {
|
|
730
|
+
only_x_left_in_stock: number;
|
|
731
|
+
name: string;
|
|
732
|
+
sku: string;
|
|
733
|
+
thumbnail: {
|
|
734
|
+
url: string;
|
|
735
|
+
label: string;
|
|
736
|
+
};
|
|
737
|
+
url_key: string;
|
|
738
|
+
url_suffix: string;
|
|
739
|
+
categories: {
|
|
740
|
+
url_path: string;
|
|
741
|
+
url_key: string;
|
|
742
|
+
}[];
|
|
743
|
+
price_range: {
|
|
744
|
+
maximum_price: {
|
|
745
|
+
regular_price: {
|
|
746
|
+
value: number;
|
|
747
|
+
currency: string;
|
|
748
|
+
};
|
|
749
|
+
final_price: {
|
|
750
|
+
value: number;
|
|
751
|
+
currency: string;
|
|
752
|
+
};
|
|
753
|
+
discount: {
|
|
754
|
+
amount_off: number;
|
|
755
|
+
percent_off: number;
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
uid: string;
|
|
761
|
+
quantity: number;
|
|
762
|
+
errors: null;
|
|
763
|
+
prices: {
|
|
764
|
+
price: {
|
|
765
|
+
value: number;
|
|
766
|
+
currency: string;
|
|
767
|
+
};
|
|
768
|
+
total_item_discount: {
|
|
769
|
+
value: number;
|
|
770
|
+
currency: string;
|
|
771
|
+
};
|
|
772
|
+
row_total: {
|
|
773
|
+
value: number;
|
|
774
|
+
currency: string;
|
|
775
|
+
};
|
|
776
|
+
price_including_tax: {
|
|
777
|
+
value: number;
|
|
778
|
+
currency: string;
|
|
779
|
+
};
|
|
780
|
+
row_total_including_tax: {
|
|
781
|
+
value: number;
|
|
782
|
+
};
|
|
783
|
+
original_row_total: {
|
|
784
|
+
value: number;
|
|
785
|
+
currency: string;
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
declare const complexInsufficientQuantity: {
|
|
790
|
+
is_available: boolean;
|
|
791
|
+
not_available_message: string;
|
|
792
|
+
product: {
|
|
793
|
+
only_x_left_in_stock: number;
|
|
794
|
+
stock_status: string;
|
|
795
|
+
name: string;
|
|
796
|
+
sku: string;
|
|
797
|
+
thumbnail: {
|
|
798
|
+
url: string;
|
|
799
|
+
label: string;
|
|
800
|
+
};
|
|
801
|
+
url_key: string;
|
|
802
|
+
url_suffix: string;
|
|
803
|
+
categories: {
|
|
804
|
+
url_path: string;
|
|
805
|
+
url_key: string;
|
|
806
|
+
}[];
|
|
807
|
+
price_range: {
|
|
808
|
+
maximum_price: {
|
|
809
|
+
regular_price: {
|
|
810
|
+
value: number;
|
|
811
|
+
currency: string;
|
|
812
|
+
};
|
|
813
|
+
final_price: {
|
|
814
|
+
value: number;
|
|
815
|
+
currency: string;
|
|
816
|
+
};
|
|
817
|
+
discount: {
|
|
818
|
+
amount_off: number;
|
|
819
|
+
percent_off: number;
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
__typename: string;
|
|
825
|
+
links: {
|
|
826
|
+
title: string;
|
|
827
|
+
url: string;
|
|
828
|
+
}[];
|
|
829
|
+
uid: string;
|
|
830
|
+
quantity: number;
|
|
831
|
+
errors: null;
|
|
832
|
+
prices: {
|
|
833
|
+
price: {
|
|
834
|
+
value: number;
|
|
835
|
+
currency: string;
|
|
836
|
+
};
|
|
837
|
+
total_item_discount: {
|
|
838
|
+
value: number;
|
|
839
|
+
currency: string;
|
|
840
|
+
};
|
|
841
|
+
row_total: {
|
|
842
|
+
value: number;
|
|
843
|
+
currency: string;
|
|
844
|
+
};
|
|
845
|
+
price_including_tax: {
|
|
846
|
+
value: number;
|
|
847
|
+
currency: string;
|
|
848
|
+
};
|
|
849
|
+
row_total_including_tax: {
|
|
850
|
+
value: number;
|
|
851
|
+
};
|
|
852
|
+
original_row_total: {
|
|
853
|
+
value: number;
|
|
854
|
+
currency: string;
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
declare const complexInsufficientQuantityGeneralMessage: {
|
|
859
|
+
is_available: boolean;
|
|
860
|
+
not_available_message: string;
|
|
861
|
+
product: {
|
|
862
|
+
only_x_left_in_stock: number;
|
|
863
|
+
stock_status: string;
|
|
864
|
+
name: string;
|
|
865
|
+
sku: string;
|
|
866
|
+
thumbnail: {
|
|
867
|
+
url: string;
|
|
868
|
+
label: string;
|
|
869
|
+
};
|
|
870
|
+
url_key: string;
|
|
871
|
+
url_suffix: string;
|
|
872
|
+
categories: {
|
|
873
|
+
url_path: string;
|
|
874
|
+
url_key: string;
|
|
875
|
+
}[];
|
|
876
|
+
price_range: {
|
|
877
|
+
maximum_price: {
|
|
878
|
+
regular_price: {
|
|
879
|
+
value: number;
|
|
880
|
+
currency: string;
|
|
881
|
+
};
|
|
882
|
+
final_price: {
|
|
883
|
+
value: number;
|
|
884
|
+
currency: string;
|
|
885
|
+
};
|
|
886
|
+
discount: {
|
|
887
|
+
amount_off: number;
|
|
888
|
+
percent_off: number;
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
__typename: string;
|
|
894
|
+
links: {
|
|
895
|
+
title: string;
|
|
896
|
+
url: string;
|
|
897
|
+
}[];
|
|
898
|
+
uid: string;
|
|
899
|
+
quantity: number;
|
|
900
|
+
errors: null;
|
|
901
|
+
prices: {
|
|
902
|
+
price: {
|
|
903
|
+
value: number;
|
|
904
|
+
currency: string;
|
|
905
|
+
};
|
|
906
|
+
total_item_discount: {
|
|
907
|
+
value: number;
|
|
908
|
+
currency: string;
|
|
909
|
+
};
|
|
910
|
+
row_total: {
|
|
911
|
+
value: number;
|
|
912
|
+
currency: string;
|
|
913
|
+
};
|
|
914
|
+
price_including_tax: {
|
|
915
|
+
value: number;
|
|
916
|
+
currency: string;
|
|
917
|
+
};
|
|
918
|
+
row_total_including_tax: {
|
|
919
|
+
value: number;
|
|
920
|
+
};
|
|
921
|
+
original_row_total: {
|
|
922
|
+
value: number;
|
|
923
|
+
currency: string;
|
|
924
|
+
};
|
|
925
|
+
};
|
|
926
|
+
};
|
|
927
|
+
export { bundleOptions, bundleOptionsEmpty, giftCardPhysical, giftCardVirtual, simple, simpleCustomizable, configurable, configurableCustomizable, giftCard, downloadbleWithMultipleLinks, simpleLowInventory, complexInsufficientQuantity, complexInsufficientQuantityGeneralMessage, };
|
|
710
928
|
//# sourceMappingURL=productTypesData.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PartialAddress, ShippingMethod } from '../models';
|
|
2
|
+
|
|
3
|
+
export declare const transformPartialAddress: (data: any) => PartialAddress;
|
|
4
|
+
export declare const transformShippingMethod: (data: any) => ShippingMethod | null;
|
|
5
|
+
//# sourceMappingURL=transform-shipping.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"Cart": {
|
|
3
3
|
"Cart": {
|
|
4
|
-
"heading": "Shopping Cart"
|
|
4
|
+
"heading": "Shopping Cart ({count})"
|
|
5
5
|
},
|
|
6
6
|
"MiniCart": {
|
|
7
7
|
"heading": "Shopping Cart ({count})",
|
|
@@ -18,6 +18,38 @@ declare const _default: {
|
|
|
18
18
|
"taxToBeDetermined": "TBD",
|
|
19
19
|
"checkout": "Checkout",
|
|
20
20
|
"orderSummary": "Order Summary",
|
|
21
|
+
"subTotal": {
|
|
22
|
+
"label": "Subtotal",
|
|
23
|
+
"withTaxes": "Including taxes",
|
|
24
|
+
"withoutTaxes": "excluding taxes"
|
|
25
|
+
},
|
|
26
|
+
"shipping": {
|
|
27
|
+
"label": "Shipping",
|
|
28
|
+
"editZipAction": "Apply",
|
|
29
|
+
"estimated": "Estimated Shipping",
|
|
30
|
+
"estimatedDestination": "Estimated Shipping to ",
|
|
31
|
+
"destinationLinkAriaLabel": "Change destination",
|
|
32
|
+
"zipPlaceholder": "Zip Code",
|
|
33
|
+
"withTaxes": "Including taxes",
|
|
34
|
+
"withoutTaxes": "excluding taxes",
|
|
35
|
+
"alternateField": {
|
|
36
|
+
"zip": "Estimate using country/zip",
|
|
37
|
+
"state": "Estimate using country/state"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"taxes": {
|
|
41
|
+
"total": "Tax Total",
|
|
42
|
+
"totalOnly": "Tax",
|
|
43
|
+
"breakdown": "Taxes",
|
|
44
|
+
"showBreakdown": "Show Tax Breakdown",
|
|
45
|
+
"hideBreakdown": "Hide Tax Breakdown",
|
|
46
|
+
"estimated": "Estimated Tax"
|
|
47
|
+
},
|
|
48
|
+
"total": {
|
|
49
|
+
"estimated": "Estimated Total",
|
|
50
|
+
"label": "Total",
|
|
51
|
+
"withoutTax": "Total excluding taxes"
|
|
52
|
+
},
|
|
21
53
|
"estimatedShippingForm": {
|
|
22
54
|
"country": {
|
|
23
55
|
"placeholder": "Country"
|
|
@@ -42,7 +74,30 @@ declare const _default: {
|
|
|
42
74
|
"regularPrice": "Regular Price",
|
|
43
75
|
"sender": "From",
|
|
44
76
|
"file": "{count} file",
|
|
45
|
-
"files": "{count} files"
|
|
77
|
+
"files": "{count} files",
|
|
78
|
+
"lowInventory": "Only {count} left!",
|
|
79
|
+
"insufficientQuantity": "Only {inventory} of {count} in stock",
|
|
80
|
+
"insufficientQuantityGeneral": "Not enough items for sale"
|
|
81
|
+
},
|
|
82
|
+
"EstimateShipping": {
|
|
83
|
+
"label": "Shipping",
|
|
84
|
+
"editZipAction": "Apply",
|
|
85
|
+
"estimated": "Estimated Shipping",
|
|
86
|
+
"estimatedDestination": "Estimated Shipping to ",
|
|
87
|
+
"destinationLinkAriaLabel": "Change destination",
|
|
88
|
+
"zipPlaceholder": "Zip Code",
|
|
89
|
+
"withTaxes": "Including taxes",
|
|
90
|
+
"withoutTaxes": "excluding taxes",
|
|
91
|
+
"alternateField": {
|
|
92
|
+
"zip": "Estimate using country/zip",
|
|
93
|
+
"state": "Estimate using country/state"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"OutOfStockMessage": {
|
|
97
|
+
"heading": "Your cart contains items with limited stock",
|
|
98
|
+
"message": "Please adjust quantities to continue",
|
|
99
|
+
"alert": "Out of stock",
|
|
100
|
+
"action": "Remove all out of stock items from cart"
|
|
46
101
|
}
|
|
47
102
|
}
|
|
48
103
|
}
|
package/lib/state.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-cart", "version": "0.
|
|
1
|
+
{"name": "@dropins/storefront-cart", "version": "0.4.0-beta1", "@dropins/tools": "~0.27.0"}
|
package/render.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(i,r){try{if(typeof document<"u"){const a=document.createElement("style"),n=r.styleId;for(const t in r.attributes)a.setAttribute(t,r.attributes[t]);a.setAttribute("data-dropin",n),a.appendChild(document.createTextNode(i));const e=document.querySelector('style[data-dropin="sdk"]');if(e)e.after(a);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(a):document.head.append(a)}}}catch(a){console.error("dropin-styles (injectCodeFunction)",a)}})(".cart-
|
|
2
|
-
import{deepmerge as
|
|
1
|
+
(function(i,r){try{if(typeof document<"u"){const a=document.createElement("style"),n=r.styleId;for(const t in r.attributes)a.setAttribute(t,r.attributes[t]);a.setAttribute("data-dropin",n),a.appendChild(document.createTextNode(i));const e=document.querySelector('style[data-dropin="sdk"]');if(e)e.after(a);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(a):document.head.append(a)}}}catch(a){console.error("dropin-styles (injectCodeFunction)",a)}})(".cart-cart{container-type:inline-size;container-name:cart}.cart-cart__wrapper{display:grid;grid-template-rows:auto 1fr;grid-gap:var(--spacing-medium)}.cart-cart__heading{display:grid;row-gap:var(--spacing-small);padding:var(--spacing-medium);padding-bottom:0;font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.cart-cart__heading-divider{width:100%;margin:0}.cart-cart__content{display:grid;grid-template-columns:1fr;padding:0 var(--spacing-medium)}.cart-cart__empty-cart{justify-self:center;align-self:center;width:100%;max-width:800px}.dropin-price-summary__shipping--zip,.dropin-price-summary__shipping--state{background-color:var(--color-neutral-50)}@container cart (width >= 1024px){.cart-cart__wrapper{grid-template-columns:repeat(var(--grid-3-columns),1fr);grid-column-gap:var(--grid-3-gutters);margin:0 var(--grid-3-margins)}.cart-cart__heading{padding:var(--spacing-small) 0 0 0}.cart-cart__content{padding:0}.cart-cart__heading,.cart-cart__content{grid-column:1 / span 8}.cart-cart__order-summary{grid-row:1 / span 3;grid-column:9 / span 4;height:min-content}.cart-cart__heading--full-width,.cart-cart__content--empty,.cart-cart__content--full-width{grid-column:1 / span 12}}.cart-empty-cart{container-type:inline-size;container-name:cart}.cart-empty-cart__wrapper .dropin-card--secondary{display:grid;grid-auto-rows:min-content;justify-content:center;text-align:center}@container cart (width < 737px){.cart-empty-cart__wrapper .dropin-card{border:unset;border-style:hidden}}.cart-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xsmall);align-items:flex-end;color:var(--color-neutral-800)}.cart-estimate-shipping__label,.cart-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-estimate-shipping__price{text-align:right}a.cart-estimate-shippingLink{text-decoration:underline}.cart-estimate-shipping__label--bold,.cart-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.cart-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-estimate-shipping--zip,.cart-estimate-shipping--state{background-color:var(--color-neutral-50)}.cart-estimate-shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small);padding-left:var(--spacing-small)}a.cart-estimate-shipping__link{text-decoration:underline}.cart-estimate-shipping--hide{display:none!important}.cart-estimate-shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-estimate-shipping--loading{opacity:.4;pointer-events:none}.cart-mini-cart{display:flex;flex-direction:column;height:100%;padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium);box-sizing:border-box}.cart-mini-cart__empty-cart{width:100%;max-width:800px;height:100%;display:flex;flex-direction:column;justify-content:center;align-self:center}.cart-mini-cart__heading{display:grid;row-gap:var(--spacing-xsmall);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing)}.cart-mini-cart__heading-divider{width:100%;margin:var(--spacing-xxsmall) 0 0 0}.cart-mini-cart__products{flex:1;overflow-y:auto;max-height:100%;padding-top:var(--spacing-medium);padding-bottom:var(--spacing-medium)}.cart-mini-cart__products .dropin-cart-item__configurations li{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cart-mini-cart__footer{display:grid;grid-auto-flow:row;gap:var(--spacing-small);padding-top:var(--spacing-small);row-gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total-excluding-taxes{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall);color:var(--color-neutral-700)}.cart-mini-cart__footer__ctas{display:grid;grid-auto-flow:row;gap:var(--spacing-xsmall);padding-top:var(--spacing-small)}.cart-order-summary{display:grid;position:relative;grid-auto-flow:row;padding:var(--spacing-medium)}.cart-order-summary__primary{background-color:var(--color-neutral-200)}.cart-order-summary__secondary{background-color:var(--color-neutral-50)}.cart-order-summary__content{display:grid;gap:var(--spacing-xsmall);margin-top:var(--spacing-small)}.cart-order-summary__heading{display:grid;font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);color:var(--color-neutral-800);gap:var(--spacing-small)}.cart-order-summary__label,.cart-order-summary__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-order-summary__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-order-summary__price{text-align:right}.cart-order-summary__taxes .dropin-divider:last-child{margin-bottom:0}.cart-order-summary__total{margin-top:var(--spacing-medium)}.cart-order-summary__label--bold,.cart-order-summary__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.cart-order-summary__divider-primary,.cart-order-summary__divider-secondary{width:100%;margin:0}.cart-order-summary__divider-secondary{margin:0}.cart-order-summary__taxEntry.cart-order-summary__entry{margin-top:0}.cart-order-summary__entry,.cart-order-summary__taxEntry{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.cart-order-summary__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-order-summary__primaryAction{margin-top:var(--spacing-small);grid-template-columns:1fr}.cart-order-summary__shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small);padding-left:var(--spacing-small)}a.cart-order-summary__shippingLink{text-decoration:underline}.cart-order-summary__shipping--hide{display:none!important}.cart-order-summary__shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-order-summary__shipping--zip,.cart-order-summary__shipping--state{background-color:var(--color-neutral-50)}.cart-order-summary__taxes .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.cart-order-summary--loading{opacity:.4;pointer-events:none}.cart-order-summary__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}",{styleId:"Cart"});
|
|
2
|
+
import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as c,Render as d}from"@dropins/tools/lib.js";import{useState as u,useEffect as p}from"@dropins/tools/preact-hooks.js";import{UIProvider as m}from"@dropins/tools/components.js";import{events as g}from"@dropins/tools/event-bus.js";import"./chunks/resetCart.js";import{c as h}from"./chunks/getStoreConfig.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/CartFragment.js";const f={Cart:{heading:"Shopping Cart ({count})"},MiniCart:{heading:"Shopping Cart ({count})",subtotal:"Subtotal",subtotalExcludingTaxes:"Subtotal excluding taxes",cartLink:"View Cart",checkoutLink:"Checkout"},EmptyCart:{heading:"Your cart is empty",cta:"Start shopping"},PriceSummary:{taxToBeDetermined:"TBD",checkout:"Checkout",orderSummary:"Order Summary",subTotal:{label:"Subtotal",withTaxes:"Including taxes",withoutTaxes:"excluding taxes"},shipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to ",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},taxes:{total:"Tax Total",totalOnly:"Tax",breakdown:"Taxes",showBreakdown:"Show Tax Breakdown",hideBreakdown:"Hide Tax Breakdown",estimated:"Estimated Tax"},total:{estimated:"Estimated Total",label:"Total",withoutTax:"Total excluding taxes"},estimatedShippingForm:{country:{placeholder:"Country"},state:{placeholder:"State"},zip:{placeholder:"Zip Code"},apply:{label:"Apply"}},freeShipping:"Free"},CartItem:{discountedPrice:"Discounted Price",download:"file",message:"Note",recipient:"To",regularPrice:"Regular Price",sender:"From",file:"{count} file",files:"{count} files",lowInventory:"Only {count} left!",insufficientQuantity:"Only {inventory} of {count} in stock",insufficientQuantityGeneral:"Not enough items for sale"},EstimateShipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to ",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},OutOfStockMessage:{heading:"Your cart contains items with limited stock",message:"Please adjust quantities to continue",alert:"Out of stock",action:"Remove all out of stock items from cart"}},x={Cart:f},S={default:x},T=({children:o})=>{var i;const[t,s]=u(),r=(i=h.getConfig())==null?void 0:i.langDefinitions;p(()=>{const e=g.on("locale",a=>{a!==t&&s(a)},{eager:!0});return()=>{e==null||e.off()}},[t]);const l=c(S,r??{});return n(m,{lang:t,langDefinitions:l,children:o})},z=new d(n(T,{}));export{z as render};
|
package/chunks/MiniCart.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{classes as o}from"@dropins/tools/lib.js";import{IllustratedMessage as i,Icon as s,Button as m}from"@dropins/tools/components.js";import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import*as t from"@dropins/tools/preact-compat.js";import{useText as l}from"@dropins/tools/i18n.js";const p=e=>t.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("g",{clipPath:"url(#clip0_102_196)"},t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z",stroke:"currentColor",strokeLinejoin:"round"}),t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.25 6.37L20.89 8.06L20.14 14.8H6.19",stroke:"currentColor",strokeLinejoin:"round"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_102_196"},t.createElement("rect",{vectorEffect:"non-scaling-stroke",width:19.29,height:19.5,fill:"white",transform:"translate(2.3501 2.25)"})))),E=({className:e,children:d,ctaLinkURL:a,...n})=>{const c=l({emptyCart:"Cart.EmptyCart.heading",cta:"Cart.EmptyCart.cta"});return r("div",{...n,className:o(["cart-empty-cart",e]),children:r(i,{className:o(["cart-empty-cart__wrapper",e]),"data-testid":"cart-empty-cart",heading:c.emptyCart,icon:r(s,{className:"cart-empty-cart__icon",source:p}),action:a?r(m,{"data-testid":"cart-empty-cart-button",size:"medium",variant:"primary",type:"submit",href:a,children:c.cta},"routeHome"):void 0})})};export{E};
|