@dropins/storefront-checkout 0.1.0-alpha53 → 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/api/fragments.d.ts +2 -0
- package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +15 -15
- package/api.js +4 -4
- package/chunks/fetch-graphql.js +2 -2
- package/chunks/isEmailAvailable.js +1 -1
- package/chunks/placeOrder2.js +3 -249
- package/chunks/setBillingAddress.js +3 -3
- package/chunks/setGuestEmailOnCart.js +3 -3
- package/chunks/setPaymentMethod.js +3 -3
- package/chunks/setShippingMethods.js +3 -3
- package/chunks/store-config.js +1 -1
- package/chunks/synchronizeCheckout.js +6 -6
- package/chunks/withConditionalRendering.js +1 -1
- package/components/PlaceOrder/PlaceOrder.d.ts +1 -1
- package/components/index.d.ts +1 -3
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +4 -2
- package/containers/MergedCartBanner/index.d.ts +15 -15
- package/containers/MergedCartBanner.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/fragments.js +249 -3
- package/lib/index.d.ts +3 -1
- package/package.json +1 -1
- package/render.js +7 -4
- 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,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,5 +1,7 @@
|
|
|
1
1
|
import { AlertBannerProps } from '@dropins/tools/types/elsie/src/components';
|
|
2
|
-
import { Container } from '@dropins/tools/types/elsie/src/lib/types';
|
|
3
2
|
|
|
4
|
-
export declare const MergedCartBanner:
|
|
3
|
+
export declare const MergedCartBanner: {
|
|
4
|
+
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs').ConditionalProps & AlertBannerProps): import("preact/compat").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
5
7
|
//# sourceMappingURL=MergedCartBanner.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
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
|
-
*******************************************************************/
|
|
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
17
|
export * from './MergedCartBanner';
|
|
18
18
|
export { MergedCartBanner as default } from './MergedCartBanner';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as
|
|
3
|
+
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as g,Icon as u}from"@dropins/tools/components.js";import{c as h}from"../chunks/classes.js";import{events as B}from"@dropins/tools/event-bus.js";import*as l from"@dropins/tools/preact-compat.js";import{useState as I,useEffect as M}from"@dropins/tools/preact-compat.js";import{w as v}from"../chunks/withConditionalRendering.js";import{useText as w,Text as x}from"@dropins/tools/i18n.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/ServerErrorSignal.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/lib.js";import"@dropins/tools/fetch-graphql.js";const H=t=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),C=({className:t,initialData:V,...c})=>{const[r,a]=I(0),i=w({mergedCartBannerItems:e(x,{id:"Checkout.MergedCartBanner.items",fields:{count:r},plural:r})});M(()=>{const n=B.on("cart/merged",o=>{var m;const s=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((f,p)=>f+p.quantity,0);s>0&&a(s)});return()=>{n==null||n.off()}},[]);const d=()=>{a(0)};return r?e(g,{...c,"aria-label":i.mergedCartBannerItems,className:h(["checkout__banner",t]),"data-testid":"merged-cart-banner",icon:e(u,{source:H}),message:e("span",{children:i.mergedCartBannerItems}),onDismiss:d,variant:"neutral"}):null};C.displayName="MergedCartBannerContainer";const A=v(C);export{A as MergedCartBanner,A as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2024 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as t,jsxs as
|
|
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{
|
|
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
|
|
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/fragments.js
CHANGED
|
@@ -93,7 +93,7 @@ const e=`
|
|
|
93
93
|
}
|
|
94
94
|
same_as_billing
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
96
|
+
`,d=`
|
|
97
97
|
fragment CHECKOUT_DATA_FRAGMENT on Cart {
|
|
98
98
|
id
|
|
99
99
|
is_virtual
|
|
@@ -117,10 +117,256 @@ const e=`
|
|
|
117
117
|
|
|
118
118
|
${e}
|
|
119
119
|
${t}
|
|
120
|
-
`,
|
|
120
|
+
`,l=`
|
|
121
121
|
fragment CUSTOMER_FRAGMENT on Customer {
|
|
122
122
|
firstname
|
|
123
123
|
lastname
|
|
124
124
|
email
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
`,r=`
|
|
127
|
+
fragment ORDER_ADDRESS_FRAGMENT on OrderAddress {
|
|
128
|
+
city
|
|
129
|
+
company
|
|
130
|
+
country_code
|
|
131
|
+
fax
|
|
132
|
+
firstname
|
|
133
|
+
lastname
|
|
134
|
+
middlename
|
|
135
|
+
postcode
|
|
136
|
+
prefix
|
|
137
|
+
region
|
|
138
|
+
region_id
|
|
139
|
+
street
|
|
140
|
+
suffix
|
|
141
|
+
telephone
|
|
142
|
+
vat_id
|
|
143
|
+
custom_attributesV2 {
|
|
144
|
+
code
|
|
145
|
+
... on AttributeValue {
|
|
146
|
+
value
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`,a=`
|
|
151
|
+
fragment PRODUCT_FRAGMENT on ProductInterface {
|
|
152
|
+
__typename
|
|
153
|
+
canonical_url
|
|
154
|
+
uid
|
|
155
|
+
name
|
|
156
|
+
sku
|
|
157
|
+
only_x_left_in_stock
|
|
158
|
+
stock_status
|
|
159
|
+
image {
|
|
160
|
+
url
|
|
161
|
+
}
|
|
162
|
+
thumbnail {
|
|
163
|
+
label
|
|
164
|
+
url
|
|
165
|
+
}
|
|
166
|
+
price_range {
|
|
167
|
+
maximum_price {
|
|
168
|
+
regular_price {
|
|
169
|
+
currency
|
|
170
|
+
value
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`,_=`
|
|
176
|
+
fragment PRICE_FRAGMENT on OrderItemInterface {
|
|
177
|
+
prices {
|
|
178
|
+
price_including_tax {
|
|
179
|
+
value
|
|
180
|
+
currency
|
|
181
|
+
}
|
|
182
|
+
original_price {
|
|
183
|
+
value
|
|
184
|
+
currency
|
|
185
|
+
}
|
|
186
|
+
original_price_including_tax {
|
|
187
|
+
value
|
|
188
|
+
currency
|
|
189
|
+
}
|
|
190
|
+
price {
|
|
191
|
+
value
|
|
192
|
+
currency
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
`,n=`
|
|
197
|
+
fragment GIFT_CARD_FRAGMENT on GiftCardOrderItem {
|
|
198
|
+
...PRICE_FRAGMENT
|
|
199
|
+
gift_message {
|
|
200
|
+
message
|
|
201
|
+
}
|
|
202
|
+
gift_card {
|
|
203
|
+
recipient_name
|
|
204
|
+
recipient_email
|
|
205
|
+
sender_name
|
|
206
|
+
sender_email
|
|
207
|
+
message
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
`,i=`
|
|
211
|
+
fragment ORDER_ITEM_FRAGMENT on OrderItemInterface {
|
|
212
|
+
__typename
|
|
213
|
+
status
|
|
214
|
+
product_name
|
|
215
|
+
id
|
|
216
|
+
quantity_ordered
|
|
217
|
+
quantity_shipped
|
|
218
|
+
quantity_canceled
|
|
219
|
+
quantity_invoiced
|
|
220
|
+
quantity_refunded
|
|
221
|
+
quantity_returned
|
|
222
|
+
product_sale_price {
|
|
223
|
+
value
|
|
224
|
+
currency
|
|
225
|
+
}
|
|
226
|
+
selected_options {
|
|
227
|
+
label
|
|
228
|
+
value
|
|
229
|
+
}
|
|
230
|
+
product {
|
|
231
|
+
...PRODUCT_FRAGMENT
|
|
232
|
+
}
|
|
233
|
+
...PRICE_FRAGMENT
|
|
234
|
+
}
|
|
235
|
+
`,c=`
|
|
236
|
+
fragment BUNDLE_ORDER_ITEM_FRAGMENT on BundleOrderItem {
|
|
237
|
+
...PRICE_FRAGMENT
|
|
238
|
+
bundle_options {
|
|
239
|
+
uid
|
|
240
|
+
label
|
|
241
|
+
values {
|
|
242
|
+
uid
|
|
243
|
+
product_name
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
`,o=`
|
|
248
|
+
fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {
|
|
249
|
+
grand_total {
|
|
250
|
+
value
|
|
251
|
+
currency
|
|
252
|
+
}
|
|
253
|
+
total_giftcard {
|
|
254
|
+
currency
|
|
255
|
+
value
|
|
256
|
+
}
|
|
257
|
+
subtotal {
|
|
258
|
+
currency
|
|
259
|
+
value
|
|
260
|
+
}
|
|
261
|
+
taxes {
|
|
262
|
+
amount {
|
|
263
|
+
currency
|
|
264
|
+
value
|
|
265
|
+
}
|
|
266
|
+
rate
|
|
267
|
+
}
|
|
268
|
+
total_tax {
|
|
269
|
+
currency
|
|
270
|
+
value
|
|
271
|
+
}
|
|
272
|
+
total_shipping {
|
|
273
|
+
currency
|
|
274
|
+
value
|
|
275
|
+
}
|
|
276
|
+
discounts {
|
|
277
|
+
amount {
|
|
278
|
+
currency
|
|
279
|
+
value
|
|
280
|
+
}
|
|
281
|
+
label
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
`,u=`
|
|
285
|
+
fragment ORDER_FRAGMENT on CustomerOrder {
|
|
286
|
+
email
|
|
287
|
+
id
|
|
288
|
+
number
|
|
289
|
+
order_date
|
|
290
|
+
order_status_change_date
|
|
291
|
+
status
|
|
292
|
+
token
|
|
293
|
+
carrier
|
|
294
|
+
shipping_method
|
|
295
|
+
printed_card_included
|
|
296
|
+
gift_receipt_included
|
|
297
|
+
available_actions
|
|
298
|
+
is_virtual
|
|
299
|
+
payment_methods {
|
|
300
|
+
name
|
|
301
|
+
type
|
|
302
|
+
}
|
|
303
|
+
applied_coupons {
|
|
304
|
+
code
|
|
305
|
+
}
|
|
306
|
+
shipments {
|
|
307
|
+
id
|
|
308
|
+
tracking {
|
|
309
|
+
title
|
|
310
|
+
number
|
|
311
|
+
carrier
|
|
312
|
+
}
|
|
313
|
+
comments {
|
|
314
|
+
message
|
|
315
|
+
timestamp
|
|
316
|
+
}
|
|
317
|
+
items {
|
|
318
|
+
id
|
|
319
|
+
product_sku
|
|
320
|
+
product_name
|
|
321
|
+
order_item {
|
|
322
|
+
...ORDER_ITEM_FRAGMENT
|
|
323
|
+
... on GiftCardOrderItem {
|
|
324
|
+
...GIFT_CARD_FRAGMENT
|
|
325
|
+
product {
|
|
326
|
+
...PRODUCT_FRAGMENT
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
payment_methods {
|
|
333
|
+
name
|
|
334
|
+
type
|
|
335
|
+
}
|
|
336
|
+
shipping_address {
|
|
337
|
+
...ORDER_ADDRESS_FRAGMENT
|
|
338
|
+
}
|
|
339
|
+
billing_address {
|
|
340
|
+
...ORDER_ADDRESS_FRAGMENT
|
|
341
|
+
}
|
|
342
|
+
items {
|
|
343
|
+
...ORDER_ITEM_FRAGMENT
|
|
344
|
+
... on BundleOrderItem {
|
|
345
|
+
...BUNDLE_ORDER_ITEM_FRAGMENT
|
|
346
|
+
}
|
|
347
|
+
... on GiftCardOrderItem {
|
|
348
|
+
...GIFT_CARD_FRAGMENT
|
|
349
|
+
product {
|
|
350
|
+
...PRODUCT_FRAGMENT
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
... on DownloadableOrderItem {
|
|
354
|
+
product_name
|
|
355
|
+
downloadable_links {
|
|
356
|
+
sort_order
|
|
357
|
+
title
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
total {
|
|
362
|
+
...ORDER_SUMMARY_FRAGMENT
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
${c}
|
|
366
|
+
${n}
|
|
367
|
+
${r}
|
|
368
|
+
${i}
|
|
369
|
+
${o}
|
|
370
|
+
${_}
|
|
371
|
+
${a}
|
|
372
|
+
`;export{d as CHECKOUT_DATA_FRAGMENT,l as CUSTOMER_FRAGMENT,u as ORDER_FRAGMENT,i as ORDER_ITEM_FRAGMENT};
|
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"}
|