@dropins/storefront-checkout 0.1.0-alpha57 → 0.1.0-alpha58
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/components/PlaceOrder/PlaceOrder.d.ts +1 -1
- package/components/index.d.ts +1 -3
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm.js +1 -1
- package/containers/OrderConfirmationHeader.js +1 -1
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +1 -0
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods.js +1 -1
- package/lib/index.d.ts +3 -1
- package/package.json +1 -1
- package/render.js +3 -1
- package/chunks/Heading.js +0 -3
- package/components/Heading/Heading.d.ts +0 -8
- package/components/Heading/index.d.ts +0 -19
- package/components/OverlayLoader/OverlayLoader.d.ts +0 -6
- package/components/OverlayLoader/index.d.ts +0 -18
- package/lib/backup-data.d.ts +0 -20
- package/lib/redirect.d.ts +0 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent } from 'preact';
|
|
2
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
3
3
|
|
|
4
|
-
export interface PlaceOrderProps extends HTMLAttributes<
|
|
4
|
+
export interface PlaceOrderProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
onClick: (event: Event) => Promise<void>;
|
|
7
7
|
}
|
package/components/index.d.ts
CHANGED
|
@@ -16,13 +16,11 @@
|
|
|
16
16
|
*******************************************************************/
|
|
17
17
|
export * from './BillToShippingAddress';
|
|
18
18
|
export * from './EstimateShipping';
|
|
19
|
-
export * from './Heading';
|
|
20
19
|
export * from './LoginForm';
|
|
20
|
+
export * from './OrderConfirmationHeader';
|
|
21
21
|
export * from './OutOfStock';
|
|
22
|
-
export * from './OverlayLoader';
|
|
23
22
|
export * from './PaymentMethods';
|
|
24
23
|
export * from './PlaceOrder';
|
|
25
24
|
export * from './ServerError';
|
|
26
25
|
export * from './ShippingMethods';
|
|
27
|
-
export * from './OrderConfirmationHeader';
|
|
28
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as k,Fragment as M,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as A,SkeletonRow as L,Price as g}from"@dropins/tools/components.js";/* empty css
|
|
3
|
+
import{jsxs as k,Fragment as M,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as A,SkeletonRow as L,Price as g}from"@dropins/tools/components.js";/* empty css */import{VComponent as w,classes as I}from"@dropins/tools/lib.js";import{Text as l,useText as z}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{a as B,T as C}from"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import{events as x}from"@dropins/tools/event-bus.js";import{useState as G,useEffect as f}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";const P=({estimated:e=!1,price:o,priceExclTax:d,taxExcluded:p=!1,taxIncluded:a=!1})=>k(M,{children:[t("span",{className:"checkout-estimate-shipping__label",children:e?t(l,{id:"Checkout.EstimateShipping.estimated"}):t(l,{id:"Checkout.EstimateShipping.label"})}),t(w,{node:o,className:"checkout-estimate-shipping__price"}),a&&t("span",{"data-testid":"shipping-tax-included",className:I(["checkout-estimate-shipping__caption"]),children:t(l,{id:"Checkout.EstimateShipping.withTaxes"})}),p&&k("span",{"data-testid":"shipping-tax-included-excluded",className:I(["checkout-estimate-shipping__caption"]),children:[d," ",t(l,{id:"Checkout.EstimateShipping.withoutTaxes"})]})]}),U=()=>t(A,{"data-testid":"estimate-shipping-skeleton",children:t(L,{size:"xsmall"})}),Z=()=>{const[e,o]=G(),d=e!==void 0,p=(e==null?void 0:e.amount.value)===0,{data:a,pending:_}=B.value,D=_||a===void 0,T=a==null?void 0:a.shoppingCartDisplaySetting.shipping,N=T===C.INCLUDING_EXCLUDING_TAX,E=T===C.INCLUDING_TAX,S=z({freeShipping:"Checkout.EstimateShipping.freeShipping",taxToBeDetermined:"Checkout.EstimateShipping.taxToBeDetermined"});f(()=>{const i=x.on("shipping/estimate",n=>{const s=n.shippingMethod,{amount:c,amountExclTax:r,amountInclTax:m}=s;o({estimated:!0,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=x.on("checkout/initialized",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;o({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=x.on("checkout/updated",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;o({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]);const v=()=>p?t("span",{"data-testId":"free-shipping",children:S.freeShipping}):E&&(e!=null&&e.amountInclTax)?t(g,{"data-testid":"shipping",amount:e.amountInclTax.value,currency:e.amountInclTax.currency}):t(g,{"data-testid":"shipping",amount:e==null?void 0:e.amount.value,currency:e==null?void 0:e.amount.currency}),y=()=>e!=null&&e.amountExclTax?t(g,{"data-testid":"shipping-excluding-tax",amount:e.amountExclTax.value,currency:e.amountExclTax.currency}):t("span",{children:S.taxToBeDetermined});return t("div",{"data-testid":"estimate-shipping",className:"checkout-estimate-shipping",children:!d||D?t(U,{}):t(P,{estimated:e.estimated,price:v(),taxExcluded:N&&!p,taxIncluded:E&&!p,priceExclTax:y()})})};export{Z as EstimateShipping,Z as default};
|
package/containers/LoginForm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as r,jsxs as s,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{s as H}from"../chunks/fetch-graphql.js";import{c as R,b as V}from"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import"@dropins/tools/event-bus.js";import{classes as j}from"@dropins/tools/lib.js";import{i as q}from"../chunks/isEmailAvailable.js";import{s as D}from"../chunks/setGuestEmailOnCart.js";import{Field as W,Input as G,Skeleton as U,SkeletonRow as x}from"@dropins/tools/components.js";/* empty css *//* empty css */import{useText as b,Text as _}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{w as J}from"../chunks/withConditionalRendering.js";import{useState as v,useRef as K,useEffect as C}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const O=({value:t,error:i,hint:g,onChange:h,onBlur:o,onInvalid:u})=>{const m=b({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return r(W,{size:"medium",error:i,hint:g,children:r(G,{"aria-label":m.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:m.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",onBlur:o,onChange:h,onInvalid:u,placeholder:m.LoginFormPlaceholder,required:!0,type:"email",value:t})})},Q=({onClick:t})=>s("div",{className:"checkout-login-form__sign-in",children:[r(_,{id:"Checkout.LoginForm.account"}),r("a",{"data-testid":"sign-in-link",className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:t,children:r(_,{id:"Checkout.LoginForm.signIn"})})]}),X=({className:t,customerDetails:i,email:g,error:h,hint:o,loading:u=!1,name:m,onEmailBlur:f,onEmailChange:k,onEmailInvalid:E,onSignInClick:a,onSignOutClick:F,...L})=>{const l=b({Title:"Checkout.LoginForm.title"});return u?r(Y,{}):s("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[s("div",{className:"checkout-login-form__heading",children:[r("h2",{className:"checkout-login-form__title",children:l.Title}),i?r(Z,{onClick:d=>{d.preventDefault(),F==null||F()}}):r(Q,{onClick:d=>{d.preventDefault(),a==null||a(g)}})]}),i?s("div",{className:"checkout-login-form__customer-details",children:[r("div",{className:"checkout-login-form__customer-name",children:`${i.firstName} ${i.lastName}`}),r("div",{className:"checkout-login-form__customer-email",children:i.email})]}):r("div",{className:"checkout-login-form__content",children:s("form",{...L,className:j(["dropin-login-form__form",t]),name:m,noValidate:!0,children:[r("button",{type:"submit",disabled:!0,style:"display: none","aria-hidden":"true"}),r(O,{value:g,error:h,hint:o,onChange:k,onBlur:f,onInvalid:E})]})})]})},Y=()=>s(U,{"data-testid":"login-form-skeleton",children:[r(x,{variant:"heading",fullWidth:!0}),r(x,{size:"medium",fullWidth:!0})]}),Z=({onClick:t})=>s("p",{className:"checkout-login-form__sign-out",children:[r(_,{id:"Checkout.LoginForm.switch"}),r("a",{className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:t,children:r(_,{id:"Checkout.LoginForm.signOut"})})]}),S={EMAIL:/^[a-z0-9,!#$%&'*+/=?^_`{|}~-]+(\.[a-z0-9,!#$%&'*+/=?^_`{|}~-]+)*@([a-z0-9-]+\.)+[a-z]{2,}$/i},N=t=>S.EMAIL.test(t),rr=1e3,y=({onSignInClick:t,onSignOutClick:i,initialData:g,...h})=>{const[o,u]=v(""),[m,f]=v(""),[k,E]=v(!0),[a,F]=v(!0),L=K(""),l=R.value.data,d=(l==null?void 0:l.email)||"",p=V.value.data,c=b({LoginFormInvalidEmailError:"Checkout.LoginForm.invalidEmailError",LoginFormMissingEmailError:"Checkout.LoginForm.missingEmailError",LoginFormEmailExistsAlreadyHaveAccount:"Checkout.LoginForm.emailExists.alreadyHaveAccount",LoginFormEmailExistsSignInButton:"Checkout.LoginForm.emailExists.signInButton",LoginFormEmailExistsForFasterCheckout:"Checkout.LoginForm.emailExists.forFasterCheckout"}),A=e=>e.valid?"":e.valueMissing?c.LoginFormMissingEmailError:c.LoginFormInvalidEmailError,B=e=>N(e)?"":e===""?c.LoginFormMissingEmailError:c.LoginFormInvalidEmailError,M=e=>{const n=e.target;u(n.value),f(""),E(!0)},T=e=>{const n=e.target;f(B(n.value))},z=e=>{const n=e.target;f(A(n.validity))};C(()=>{!a||!l||(F(!1),u(l.email||""))},[l,a]),C(()=>{if(a||H.authenticated)return;const e=setTimeout(()=>{!N(o)||o===L.current||(L.current=o,q(o).then(n=>{E(n),d!==o&&D(o).catch(console.error)}).catch(n=>{console.error(n),E(!0)}))},rr);return()=>{e&&clearTimeout(e)}},[d,o,a]);const I=k?"":s(w,{children:[c.LoginFormEmailExistsAlreadyHaveAccount," ",r("a",{href:"#",onClick:e=>{e.preventDefault(),t==null||t(o)},children:c.LoginFormEmailExistsSignInButton})," ",c.LoginFormEmailExistsForFasterCheckout]}),$=e=>{t==null||t(N(e)?e:"")},P=p?{firstName:p.firstName,lastName:p.lastName,email:p.email}:void 0;return r(X,{...h,customerDetails:P,email:o,error:m,hint:I,loading:a,onEmailBlur:T,onEmailChange:M,onEmailInvalid:z,onSignInClick:$,onSignOutClick:i})};y.displayName="LoginFormContainer";const kr=J(y);export{kr as LoginForm,kr as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as t,jsxs as s}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Icon as A,
|
|
3
|
+
import{jsx as t,jsxs as s}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Icon as A,Header as E,Button as y,Skeleton as N,SkeletonRow as r}from"@dropins/tools/components.js";/* empty css */import"@dropins/tools/lib.js";/* empty css *//* empty css *//* empty css */import*as o from"@dropins/tools/preact-compat.js";import{useState as C,useEffect as b}from"@dropins/tools/preact-compat.js";import{useText as z,Text as v}from"@dropins/tools/i18n.js";import{s as f}from"../chunks/fetch-graphql.js";import"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import"@dropins/tools/event-bus.js";import{i as H}from"../chunks/isEmailAvailable.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";function p(e){var c;return{region:{region_id:e!=null&&e.regionId?Number(e==null?void 0:e.regionId):null,region:e==null?void 0:e.region},city:e==null?void 0:e.city,company:e==null?void 0:e.company,country_code:e==null?void 0:e.country,firstname:e==null?void 0:e.firstName,lastname:e==null?void 0:e.lastName,middlename:e==null?void 0:e.middleName,postcode:e==null?void 0:e.postCode,street:e==null?void 0:e.street,telephone:e==null?void 0:e.telephone,custom_attributesV2:((c=e==null?void 0:e.customAttributes)==null?void 0:c.map(l=>({attribute_code:l.code,value:l.value})))||[]}}const V=e=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},o.createElement("g",{clipPath:"url(#clip0_4797_15077)"},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.15 20.85L1.5 17.53V6.63L10.15 10V20.85Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.63001L10.15 3.20001L18.8 6.63001L10.15 10L1.5 6.63001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.17969 4.77002L14.8297 8.15002V11.47",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.7896 12.64V6.63L10.1396 10V20.85L14.8296 19.05",stroke:"currentColor",strokeLinejoin:"round"}),o.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M15.71 17.26C15.71 15.38 17.23 13.86 19.11 13.86C20.99 13.86 22.51 15.38 22.51 17.26C22.51 19.14 20.99 20.66 19.11 20.66C17.23 20.66 15.71 19.14 15.71 17.26Z",stroke:"currentColor"}),o.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M17.4805 17.49L18.5605 18.41L20.7205 16.33",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_4797_15077"},o.createElement("rect",{width:22,height:18.65,fill:"white",transform:"translate(1 2.70001)"})))),d=({customerName:e,isLoading:c,orderNumber:l,onSignUpClick:a})=>{const i=z({title:t(v,{id:"Checkout.OrderConfirmationHeader.title",fields:{name:e}}),defaultTitle:"Checkout.OrderConfirmationHeader.defaultTitle",order:t(v,{id:"Checkout.OrderConfirmationHeader.order",fields:{order:l}}),createAccountMessage:"Checkout.OrderConfirmationHeader.CreateAccount.message",createAccountButton:"Checkout.OrderConfirmationHeader.CreateAccount.button"});return c?t(w,{}):s("div",{className:"order-confirmation-header order-confirmation__card",children:[t(A,{source:V,size:"64",className:"order-confirmation-header__icon"}),t(E,{className:"order-confirmation-header__title",title:i.title,size:"large",divider:!1,children:e?i.title:i.defaultTitle}),l&&t("p",{className:"order-confirmation-header__order",children:i.order}),a&&s("div",{className:"order-confirmation-create-account",children:[t("p",{className:"order-confirmation-create-account__message",children:i.createAccountMessage}),t(y,{"data-testid":"create-account-button",className:"order-confirmation-create-account__button",size:"medium",variant:"secondary",type:"submit",onClick:a,children:i.createAccountButton})]})]})},w=()=>s(N,{"data-testid":"order-confirmation-header-skeleton",className:"order-confirmation-header",children:[t(r,{variant:"empty",size:"xlarge",fullWidth:!0}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{size:"small",fullWidth:!0}),t(r,{variant:"heading",size:"xsmall",fullWidth:!0})]}),U=({orderData:e,onSignUpClick:c})=>{var g;const[l,a]=C(!f.authenticated),[i,h]=C();b(()=>{f.authenticated||H(e.email).then(m=>h(!m)).catch(()=>h(!0)).finally(()=>a(!1))},[e.email]);const _=c&&!f.authenticated&&i===!1?()=>{const m=e.shippingAddress,n=e.billingAddress,L=[{code:"firstname",defaultValue:(n==null?void 0:n.firstName)||""},{code:"lastname",defaultValue:(n==null?void 0:n.lastName)||""},{code:"email",defaultValue:e.email||""}];let u;if(m){const k={...p(m),default_shipping:!0};u=[{...p(n),default_billing:!0},k]}else u=[{...p(n),default_billing:!0,default_shipping:!0}];c({inputsDefaultValueSet:L,addressesData:u})}:void 0;return t("div",{children:t(d,{customerName:(g=e.billingAddress)==null?void 0:g.firstName,isLoading:l,onSignUpClick:_,orderNumber:e.number})})};export{U as OrderConfirmationHeader,U as default};
|
package/containers/OutOfStock.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Card as k,Icon as l,Image as h}from"@dropins/tools/components.js";/* empty css
|
|
3
|
+
import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Card as k,Icon as l,Image as h}from"@dropins/tools/components.js";/* empty css */import{classes as O}from"@dropins/tools/lib.js";import{S as d}from"../chunks/OrderError.js";import{useText as p}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{events as S}from"@dropins/tools/event-bus.js";import{useState as v,useCallback as _,useEffect as g}from"@dropins/tools/preact-compat.js";const N=({className:i,items:r,onRemoveOutOfStock:o,routeCart:a,...m})=>{const s=p({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return n(k,{className:O(["checkout-out-of-stock",i]),"data-testid":"checkout-out-of-stock",variant:"secondary",...m,children:[n("h4",{className:"checkout-out-of-stock__title",children:[e(l,{source:d,size:"16",stroke:"1"}),s.title]}),e("p",{className:"checkout-out-of-stock__message",children:s.message}),e("ol",{className:"checkout-out-of-stock__items",children:r.map(u=>e("li",{"data-testid":"out-of-stock-item",className:"checkout-out-of-stock__item",children:e(h,{loading:"eager",src:u.image.src,alt:u.image.alt,width:"100",height:"100",params:{width:100}})},u.sku))}),n("div",{className:"checkout-out-of-stock__actions",children:[a&&e("a",{"data-testid":"review-cart",className:"checkout-out-of-stock__action",href:a,children:s.reviewCart}),o&&e("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:o,children:s.removeOutOfStock})]})]})},T=({onCartProductsUpdate:i,routeCart:r})=>{const[o,a]=v([]),m=t=>t.outOfStock||t.insufficientQuantity,s=_(()=>{if(!i)return;const t=o.filter(c=>c.outOfStock).map(c=>({uid:c.uid,quantity:0}));i(t)},[o,i]);if(g(()=>{const t=S.on("cart/data",c=>{const f=(c==null?void 0:c.items)||[];a(f.filter(m))},{eager:!0});return()=>{t==null||t.off()}},[]),o.length===0)return null;const u=!o.some(t=>t.insufficientQuantity);return e(N,{items:o,onRemoveOutOfStock:u?s:void 0,routeCart:r==null?void 0:r()})};export{T as OutOfStock,T as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as n,jsxs as M,Fragment as R}from"@dropins/tools/preact-jsx-runtime.js";import{s as D}from"../chunks/fetch-graphql.js";import{c as C}from"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import"@dropins/tools/event-bus.js";import{classes as H,Slot as L}from"@dropins/tools/lib.js";import{s as $}from"../chunks/setPaymentMethod.js";/* empty css
|
|
3
|
+
import{jsx as n,jsxs as M,Fragment as R}from"@dropins/tools/preact-jsx-runtime.js";import{s as D}from"../chunks/fetch-graphql.js";import{c as C}from"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import"@dropins/tools/event-bus.js";import{classes as H,Slot as L}from"@dropins/tools/lib.js";import{s as $}from"../chunks/setPaymentMethod.js";/* empty css */import{IllustratedMessage as B,Icon as U,ProgressSpinner as Z,ToggleButton as F,Skeleton as q,SkeletonRow as y}from"@dropins/tools/components.js";import*as g from"@dropins/tools/preact-compat.js";import{useState as S,useCallback as T,useEffect as w}from"@dropins/tools/preact-compat.js";import{useText as G}from"@dropins/tools/i18n.js";import{w as J}from"../chunks/withConditionalRendering.js";import{useRef as K}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const Q=e=>g.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),X=({code:e,loading:a,selected:r,onChange:d,title:h})=>n(F,{className:"checkout-payment-methods__method",label:h,name:"payment-method",value:e,selected:r,onChange:d,busy:a}),Y=({className:e,paymentMethodContent:a,loading:r=!1,initializing:d=!1,onChange:h=()=>{},options:c,selection:k})=>{const o=G({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return d?n(ee,{}):M("div",{className:H(["checkout-payment-methods",e]),children:[n("h2",{className:"checkout-payment-methods__title",children:o.Title}),!r&&c.length===0&&n(B,{icon:n(U,{source:Q}),message:n("p",{children:o.EmptyState})}),M("div",{className:H(["checkout-payment-methods__wrapper"]),children:[r&&n(Z,{className:"checkout-payment-methods__spinner"}),n("div",{className:H(["checkout-payment-methods__methods",["checkout-payment-methods--loading",r],["checkout-payment-methods--full-width",c.length%2!==0]]),children:c==null?void 0:c.map(i=>n(X,{code:i.code,onChange:h,selected:i.code===k,title:i.title},i.code))}),a&&n("div",{className:"checkout-payment-methods__content",children:a})]})]})},ee=()=>M(q,{"data-testid":"payment-methods-skeleton",children:[n(y,{variant:"heading",size:"medium"}),n(y,{variant:"empty",size:"medium"}),n(y,{size:"xlarge",fullWidth:!0}),n(y,{size:"xlarge",fullWidth:!0})]}),N={free:e=>{const a=document.createElement("div");a.innerText="",e.replaceHTML(a)},checkmo:e=>{const a=document.createElement("div");a.innerText="",e.replaceHTML(a)}},te=(e,a)=>{const r=K(e);return a(r.current,e)||(r.current=e),r.current},V=({slots:e})=>{var x,_;const[a,r]=S(),[d,h]=S(N),[c,k]=S(!0),o=C.value.data,i=!!C.value.data,W=C.value.pending,j=(o==null?void 0:o.isVirtual)??!1,z=(x=o==null?void 0:o.shippingAddresses)==null?void 0:x[0],A=(o==null?void 0:o.availablePaymentMethods)||[],l=(_=o==null?void 0:o.selectedPaymentMethod)==null?void 0:_.code,E=j?!0:!!z,m=te(A,(t,s)=>t.length!==s.length?!1:t.every((p,v)=>p.code===s[v].code)),u=T(t=>{r(t),!(!t||!E)&&t!==l&&$(t).catch(console.error)},[E,l]);w(()=>{if(!i)return;if(!!!(m!=null&&m.length)){u(void 0);return}const s=m[0].code;if(!l){u(s);return}const p=m.some(v=>v.code===l);u(p?l:s)},[m,i,l,u]);const I=t=>{u(t)},b=T((t,s)=>{if(!t){console.warn("Payment method handler is ignored because it has no code");return}if(!s){console.warn("Payment method handler is ignored because it is empty");return}h(p=>({...p,[t]:s}))},[]);w(()=>{e!=null&&e.Handlers&&Object.entries(e.Handlers).forEach(([t,s])=>{b(t,s)})},[b,e==null?void 0:e.Handlers]);const f=e!=null&&e.Main?n(L,{name:"PaymentMethods",slot:e==null?void 0:e.Main,context:{replaceHTML(t){this.replaceWith(t),k(!1)}}}):null,P=a?d[a]:null,O=P?n(L,{name:"PaymentMethodContent",slot:P,context:{cartId:D.cartId||"",replaceHTML(t){this.replaceWith(t)}}},P):void 0;return w(()=>{!c&&d!=N&&console.warn("Payment method handlers you have added are ignored because the default content has been replaced")},[c,d]),M(R,{children:[f&&n(f.type,{ref:f.ref,...f.props}),c&&n(Y,{initializing:i===!1,loading:i&&W,onChange:I,options:m,paymentMethodContent:O,selection:a})]})};V.displayName="PaymentMethodsContainer";const ke=J(V);export{ke as PaymentMethods,ke as default};
|
package/containers/PlaceOrder.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import{U as
|
|
3
|
+
import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import{U as E}from"../chunks/fetch-graphql.js";import{c as P}from"../chunks/store-config.js";import{s as g}from"../chunks/ServerErrorSignal.js";import{events as v}from"@dropins/tools/event-bus.js";import{classes as S}from"@dropins/tools/lib.js";import{p as b}from"../chunks/placeOrder2.js";/* empty css */import{Button as U}from"@dropins/tools/components.js";import{Text as w,useText as N}from"@dropins/tools/i18n.js";import{w as T}from"../chunks/withConditionalRendering.js";import{useState as z,useCallback as p,useEffect as H}from"@dropins/tools/preact-compat.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const I=r=>r instanceof TypeError||r instanceof E,M=({className:r,disabled:t=!1,onClick:o})=>c("div",{className:S(["checkout-place-order",r]),children:c(U,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:t,onClick:o,size:"medium",type:"submit",variant:"primary",children:c(w,{id:"Checkout.PlaceOrder.button"})},"placeOrder")}),u=({disabled:r=!1,handleValidation:t,onPlaceOrder:o,...f})=>{var l;const[h,O]=z(!1),{data:s,pending:k}=P.value,C=!!s,n=((l=s==null?void 0:s.selectedPaymentMethod)==null?void 0:l.code)||"",i=N({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),m=p(e=>{g.value=I(e)?i.CheckoutUnexpectedError:e.message},[i]),x=p(async()=>{try{if(!(t?t():!0))return;o?await o({code:n}):await b()}catch(e){m(e)}},[t,o,n,m]);return H(()=>{const e=v.on("cart/initialized",a=>{const y=(a==null?void 0:a.items)||[];O(y.some(d=>d.outOfStock||d.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[]),c(M,{...f,onClick:x,disabled:r||!C||k||h})};u.displayName="PlaceOrderContainer";const Y=T(u);export{Y as PlaceOrder,Y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as t,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as m,Icon as l,Button as n}from"@dropins/tools/components.js";/* empty css
|
|
3
|
+
import{jsx as t,jsxs as u}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as m,Icon as l,Button as n}from"@dropins/tools/components.js";/* empty css */import{classes as a}from"@dropins/tools/lib.js";/* empty css *//* empty css */import{S as p}from"../chunks/OrderError.js";import{useText as d}from"@dropins/tools/i18n.js";/* empty css */import{s as i}from"../chunks/ServerErrorSignal.js";import{useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";const v=({className:o,contactSupport:e,errorMessage:r,onClick:c})=>{const s=d({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return t(m,{"aria-invalid":"true","aria-describedby":"checkout-server-error__message","aria-live":"polite",className:a(["checkout-server-error",o]),"data-testid":"checkout-server-error",heading:r??s.Title,message:u("p",{id:a(["checkout-server-error__message"]),children:[s.Message,t("br",{}),t("span",{children:e??s.ContactSupport})]}),icon:t(l,{className:a(["checkout-server-error__icon"]),source:p}),action:t(n,{className:a(["checkout-server-error__button"]),onClick:c,children:s.Button})})},I=({onRetry:o,onServerError:e})=>{const r=i.value,c=async()=>{o==null||o(),i.value=void 0};return h(()=>{r&&(e==null||e(r))},[r,e]),r?t(v,{errorMessage:r,onClick:c}):null};export{I as ServerError,I as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as i,jsxs as L,Fragment as
|
|
3
|
+
import{jsx as i,jsxs as L,Fragment as R}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/fetch-graphql.js";import{s as v,e as M,c as x,a as V}from"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import{events as T}from"@dropins/tools/event-bus.js";import{classes as W,Slot as O}from"@dropins/tools/lib.js";import{s as P}from"../chunks/setShippingMethods.js";/* empty css */import{IllustratedMessage as Z,Icon as $,ProgressSpinner as q,RadioButton as F,Price as G,Skeleton as J,SkeletonRow as S}from"@dropins/tools/components.js";import*as p from"@dropins/tools/preact-compat.js";import{useRef as K,useEffect as z,useCallback as Q,useMemo as X}from"@dropins/tools/preact-compat.js";import{useText as Y}from"@dropins/tools/i18n.js";import{useState as I,useEffect as _}from"@dropins/tools/preact-hooks.js";import{w as D}from"../chunks/withConditionalRendering.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const U=e=>({countryCode:e.country_id,postCode:e.postcode||"",...e.region_id?{regionId:Number(e.region_id)}:{...e.region?{region:e.region}:{}}}),ee=e=>({carrierCode:e.carrier.code||"",methodCode:e.code||"",amount:e.amount,amountExclTax:e.amountExclTax,amountInclTax:e.amountInclTax}),te=e=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),ne=({className:e,isLoading:t=!1,onSelectionChange:n=()=>{},options:r,selection:a,...s})=>{const c=Y({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return r===void 0?i(oe,{}):L("div",{...s,className:W(["checkout-shipping-methods",e]),children:[i("h3",{className:"checkout-shipping-methods__title",children:c.Title}),!t&&r.length===0&&i(Z,{icon:i($,{source:te}),message:i("p",{children:c.EmptyState})}),L("div",{className:W(["checkout-shipping-methods__content"]),children:[t&&i(q,{className:"checkout-shipping-methods__spinner"}),i("div",{className:W(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:r.map(o=>i(F,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:o.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:L(R,{children:[i(G,{amount:o.amount.value,currency:o.amount.currency})," ",i("span",{children:o.carrier.title})]}),description:o.title,value:o.value,checked:(a==null?void 0:a.value)===o.value,onChange:()=>n(o)},o.value))})]})]})},oe=()=>L(J,{"data-testid":"shipping-methods-skeleton",children:[i(S,{variant:"heading",size:"small"}),i(S,{variant:"empty",size:"small"}),i(S,{size:"medium",fullWidth:!0}),i(S,{size:"medium",fullWidth:!0})]});function ie(){var C;const[e,t]=I(),[n,r]=I();_(()=>{T.on("checkout/estimate-shipping-address",({address:j,isValid:g})=>{t({address:j,isValid:g})})},[]),_(()=>{r(v.value)},[v.value]),_(()=>{M.value.pending?r(void 0):r(v.value)},[M.value.pending]);const{country_id:a,region_id:s,region:c,postcode:o}=(e==null?void 0:e.address)||{},f=!!e,l=x.value.data,k=!!((C=l==null?void 0:l.shippingAddresses)!=null&&C[0]),u=e==null?void 0:e.isValid;_(()=>{k||u||!n||!f||T.emit("shipping/estimate",{address:U({country_id:a,region_id:s,region:c,postcode:o}),shippingMethod:ee(n)})},[n,a,s,c,o,f,k,u])}const b=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code,re=e=>{var r,a,s,c;const t=(c=(s=(a=(r=x.value.data)==null?void 0:r.shippingAddresses)==null?void 0:a[0])==null?void 0:s.selectedShippingMethod)==null?void 0:c.carrier.code,n=K();z(()=>{t!==n.current&&(n.current=t,t&&(e==null||e()))},[t,e])};function se({onCheckoutDataUpdate:e,preSelectedMethod:t,onShippingMethodSelect:n}){const a=!V.value.data,s=x.value.data,c=x.value.pending,o=M.value.data,f=M.value.pending,l=v.value,k=s==null?void 0:s.shippingAddresses,u=k==null?void 0:k[0],C=!!u,j=u==null?void 0:u.availableShippingMethods,g=u==null?void 0:u.selectedShippingMethod,d=j||o,w=Q(m=>{if(!C)return;const E={method_code:m.code,carrier_code:m.carrier.code};P([E]).catch(y=>{console.error("Setting shipping methods on cart failed:",y)})},[C,e]),B=m=>{v.value=m,n==null||n(m)},h=X(()=>{if(!(d!=null&&d.length))return;const m=d[0],E=l||g;return E?d.some(H=>b(H,E))?E:m:d.find(N=>N.carrier.code===(t==null?void 0:t.carrierCode)&&N.code===(t==null?void 0:t.methodCode))||m},[l,g,d,t]);return z(()=>{h&&((!l||!b(h,l))&&(v.value=h,n==null||n(h)),(!g||!b(h,g))&&w(h))},[h,l,g,w,n]),{isLoading:c||a||f,options:d,selection:h,onSelectionChange:B}}const A=({preSelectedMethod:e,onCheckoutDataUpdate:t,shippingMethodsSlot:n,onShippingMethodSelect:r,initialData:a,...s})=>{const{isLoading:c,options:o,selection:f,onSelectionChange:l}=se({preSelectedMethod:e,onCheckoutDataUpdate:t,onShippingMethodSelect:r});return ie(),re(t),L(R,{children:[i(ne,{...s,isLoading:c,onSelectionChange:l,options:o,selection:f}),!c&&n&&i(O,{name:"ShippingMethods",slot:n})]})};A.displayName="ShippingMethodsContainer";const Me=D(A);export{Me as ShippingMethods,Me as default};
|
package/lib/index.d.ts
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
+
export * from './acdl';
|
|
17
18
|
export * from './fetch-error';
|
|
18
|
-
export * from './
|
|
19
|
+
export * from './network-error';
|
|
20
|
+
export * from './state';
|
|
19
21
|
export * from './validation';
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-checkout", "version": "0.1.0-
|
|
1
|
+
{"name": "@dropins/storefront-checkout", "version": "0.1.0-alpha58", "@dropins/tools": "~0.36.0"}
|
package/render.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
(function(r,o){try{if(typeof document<"u"){const t=document.createElement("style"),n=o.styleId;for(const e in o.attributes)t.setAttribute(e,o.attributes[e]);t.setAttribute("data-dropin",n),t.appendChild(document.createTextNode(r));const a=document.querySelector('style[data-dropin="sdk"]');if(a)a.after(t);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(`.checkout__banner{margin-bottom:var(--spacing-xlarge)}
|
|
4
|
-
.checkout-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.checkout-estimate-shipping__label,.checkout-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-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)}.checkout-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-estimate-shipping__price{text-align:right}.checkout-estimate-shipping__label--bold,.checkout-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.checkout-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__shipping .dropin-skeleton{grid-template-columns:1fr}.checkout-login-form__heading{display:grid;grid-template-columns:1fr max-content;grid-auto-rows:max-content}.checkout-login-form__content{grid-auto-rows:max-content}.checkout-login-form__customer-details{display:grid;grid-auto-flow:row;gap:var(--spacing-xxsmall)}.checkout-login-form__customer-name{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-login-form__customer-email{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-login-form__title{grid-column-start:1;color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);justify-self:flex-end;margin-top:var(--spacing-xxsmall)}a.checkout-login-form__link{font:var(--type-body-2-strong-font);margin-left:var(--spacing-xxsmall)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-login-form__heading{grid-template-columns:repeat(1,1fr [col-start]);grid-template-rows:1fr}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:0;margin-bottom:var(--spacing-medium)}}.
|
|
4
|
+
.checkout-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.checkout-estimate-shipping__label,.checkout-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-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)}.checkout-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-estimate-shipping__price{text-align:right}.checkout-estimate-shipping__label--bold,.checkout-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.checkout-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__shipping .dropin-skeleton{grid-template-columns:1fr}.checkout-login-form__heading{display:grid;grid-template-columns:1fr max-content;grid-auto-rows:max-content}.checkout-login-form__content{grid-auto-rows:max-content}.checkout-login-form__content .dropin-field__hint a{font-weight:400}.checkout-login-form__customer-details{display:grid;grid-auto-flow:row;gap:var(--spacing-xxsmall)}.checkout-login-form__customer-name{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-login-form__customer-email{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-login-form__title{grid-column-start:1;color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);justify-self:flex-end;margin-top:var(--spacing-xxsmall)}a.checkout-login-form__link{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-left:var(--spacing-xxsmall)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-login-form__heading{grid-template-columns:repeat(1,1fr [col-start]);grid-template-rows:1fr}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:0;margin-bottom:var(--spacing-medium)}}.order-confirmation-header{text-align:center;padding:var(--spacing-xxbig)}.order-confirmation-header__icon{margin-bottom:var(--spacing-small)}.order-confirmation-header__title{color:var(--color-neutral-800);font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);justify-content:center;margin:0}.order-confirmation-header__title:first-letter{text-transform:uppercase}.order-confirmation-header__order{color:var(--color-neutral-700);font:var(--type-details-overline-font);letter-spacing:var(--type-details-overline-letter-spacing);margin:var(--spacing-xxsmall) 0 0 0}.order-confirmation-header .success-icon{color:var(--color-positive-500)}.order-confirmation-create-account{display:grid;gap:var(--spacing-small);margin-top:var(--spacing-large)}.order-confirmation-create-account__message{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-confirmation-create-account__button{display:flex;margin:0 auto;text-align:center}.checkout-out-of-stock.dropin-card{border-color:var(--color-warning-500)}.checkout-out-of-stock .dropin-card__content{gap:var(--spacing-small);padding:var(--spacing-small)}.checkout-out-of-stock__title{color:var(--color-neutral-900);font:var(--type-body-2-strong-font);margin:0;display:flex;gap:var(--spacing-xxsmall);align-items:center;justify-content:left;text-align:center}.checkout-out-of-stock__message{color:var(--color-neutral-800);font:var(--type-body-2-default-font);margin:0}.checkout-out-of-stock__items{display:grid;grid-template-columns:repeat(5,100px);grid-gap:var(--spacing-small);list-style:none;padding:0;margin:0}.checkout-out-of-stock__item img{width:100%;height:auto}.checkout-out-of-stock__actions{display:flex;gap:var(--spacing-small);justify-content:flex-end}a.checkout-out-of-stock__action{font:var(--type-details-caption-1-font)}.checkout-out-of-stock__action{background:none;border:none;padding:0;cursor:pointer}.checkout-out-of-stock__action:hover{--textColor: var(--color-brand-700);text-decoration:solid underline var(--textColor);text-underline-offset:6px}.checkout-server-error{position:relative;text-align:center}.checkout-server-error__icon .error-icon{color:var(--color-alert-500)}.checkout-server-error a{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing)}
|
|
5
|
+
.checkout-shipping-methods__title{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-shipping-methods__content{position:relative;display:block}.checkout-shipping-methods__method{margin-bottom:var(--spacing-medium);width:fit-content;cursor:pointer;font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-shipping-methods__method:last-child{margin-bottom:0}.dropin-radio-button__label .dropin-price{color:var(--color-neutral-800);font-weight:400}.checkout-shipping-methods__options--loading{opacity:.4;pointer-events:none}.checkout-shipping-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}
|
|
5
6
|
.checkout-place-order{display:grid;padding-bottom:var(--spacing-big)}.checkout-place-order__button{align-self:flex-end;justify-self:flex-end}@media only screen and (min-width:320px) and (max-width: 768px){.checkout-place-order{background-color:var(--color-neutral-200);padding:var(--spacing-medium) var(--spacing-medium) var(--spacing-big) var(--spacing-medium)}.checkout-place-order__button{align-self:center;justify-self:stretch}}
|
|
7
|
+
.checkout-payment-methods__title{color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-payment-methods__wrapper{position:relative;display:grid}.checkout-payment-methods__methods{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-payment-methods__content{margin-top:var(--spacing-medium)}.checkout-payment-methods--full-width{grid-template-columns:1fr}.checkout-payment-methods--loading{opacity:.4;pointer-events:none}.checkout-payment-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.checkout__content [data-slot=PaymentMethods]:empty{display:none}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-payment-methods__methods{grid-template-columns:1fr}}
|
|
6
8
|
.checkout-bill-to-shipping-address label{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);gap:0}`,{styleId:"checkout"});
|
|
7
9
|
import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/fetch-graphql.js";import"./chunks/store-config.js";import"./chunks/ServerErrorSignal.js";import{events as p}from"@dropins/tools/event-bus.js";import{c as y}from"./chunks/synchronizeCheckout.js";import{UIProvider as g}from"@dropins/tools/components.js";import{useState as b,useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"./fragments.js";function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S=function(r){return E(r)&&!v(r)};function E(e){return!!e&&typeof e=="object"}function v(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||M(e)}var w=typeof Symbol=="function"&&Symbol.for,j=w?Symbol.for("react.element"):60103;function M(e){return e.$$typeof===j}function A(e){return Array.isArray(e)?[]:{}}function i(e,r){return r.clone!==!1&&r.isMergeableObject(e)?a(A(e),e,r):e}function P(e,r,t){return e.concat(r).map(function(o){return i(o,t)})}function T(e,r){if(!r.customMerge)return a;var t=r.customMerge(e);return typeof t=="function"?t:a}function C(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function l(e){return Object.keys(e).concat(C(e))}function m(e,r){try{return r in e}catch{return!1}}function I(e,r){return m(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function x(e,r,t){var o={};return t.isMergeableObject(e)&&l(e).forEach(function(n){o[n]=i(e[n],t)}),l(r).forEach(function(n){I(e,n)||(m(e,n)&&t.isMergeableObject(r[n])?o[n]=T(n,t)(e[n],r[n],t):o[n]=i(r[n],t))}),o}function a(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||P,t.isMergeableObject=t.isMergeableObject||S,t.cloneUnlessOtherwiseSpecified=i;var o=Array.isArray(r),n=Array.isArray(e),c=o===n;return c?o?t.arrayMerge(e,r,t):x(e,r,t):i(r,t)}a.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(o,n){return a(o,n,t)},{})};var D=a,k=D;const R=O(k),B={title:"Checkout",LoginForm:{title:"Contact details",account:"Already have an account?",ariaLabel:"Email",invalidEmailError:"Please enter a valid email address.",missingEmailError:"Enter an email address.",emailExists:{alreadyHaveAccount:"It looks like you already have an account.",signInButton:"Sign in",forFasterCheckout:"for a faster checkout."},floatingLabel:"Email *",placeholder:"Enter your email address",signIn:"Sign In",switch:"Do you want to switch account?",signOut:"Sign Out"},ShippingMethods:{title:"Shipping options",emptyState:"This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."},BillToShippingAddress:{title:"Bill to shipping address"},PaymentMethods:{title:"Payment",emptyState:"No payment methods available"},OutOfStock:{title:"Your cart contains items that are out of stock",message:"The following items are out of stock:",actions:{reviewCart:"Review cart",removeOutOfStock:"Remove out of stock items"},lowInventory:{one:"Last item!",many:"Only {{count}} left!"},alert:"Out of stock!"},PlaceOrder:{button:"Place Order"},ServerError:{title:"We were unable to process your order",contactSupport:"If you continue to have issues, please contact support.",unexpected:"An unexpected error occurred while processing your order. Please try again later.",button:"Try again"},EmptyCart:{title:"Your cart is empty",button:"Start shopping"},ErrorBanner:{genericMessage:"Server error detected. Please check your connection and try again."},MergedCartBanner:{items:{one:"1 item from a previous session was added to your cart. Please review your new subtotal.",many:"{{count}} items from a previous session were added to your cart. Please review your new subtotal."}},EstimateShipping:{estimated:"Estimated Shipping",freeShipping:"Free",label:"Shipping",taxToBeDetermined:"TBD",withTaxes:"Including taxes",withoutTaxes:"Excluding taxes"},OrderConfirmationHeader:{title:"{{name}}, thank you for your order!",defaultTitle:"Thank you for your order!",order:"ORDER #{{order}}",CreateAccount:{message:"Save your information for faster checkout next time.",button:"Create an account"}}},L={Checkout:B},_={default:L},U=({children:e})=>{var c;const[r,t]=b(),o=(c=y.getConfig())==null?void 0:c.langDefinitions;h(()=>{const s=p.on("locale",u=>{u!==r&&t(u)},{eager:!0});return()=>{s==null||s.off()}},[r]);const n=R(_,o??{});return f(g,{lang:r,langDefinitions:n,children:e})},Q=new d(f(U,{}));export{U as Provider,Q as render};
|
package/chunks/Heading.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
|
|
4
|
-
export interface HeadingProps extends Omit<HTMLAttributes<HTMLHeadingElement>, 'level'> {
|
|
5
|
-
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
-
}
|
|
7
|
-
export declare const Heading: FunctionComponent<HeadingProps>;
|
|
8
|
-
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export * from './Heading';
|
|
18
|
-
export { Heading as default } from './Heading';
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export * from './OverlayLoader';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/backup-data.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare const createBackup: <T>(key: string, value: T) => void;
|
|
18
|
-
export declare const restoreBackup: <T>(key: string) => T | null;
|
|
19
|
-
export declare const removeBackup: (key: string) => void;
|
|
20
|
-
//# sourceMappingURL=backup-data.d.ts.map
|
package/lib/redirect.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare function redirect(location: string): void;
|
|
18
|
-
//# sourceMappingURL=redirect.d.ts.map
|