@dropins/storefront-checkout 2.0.0-beta3 → 2.0.0-beta5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.js +7 -7
- package/chunks/ConditionalWrapper.js +1 -1
- package/chunks/Summary.js +3 -0
- package/chunks/dom.js +3 -0
- package/chunks/events.js +3 -0
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +4 -1
- package/components/LoginFormSummary/LoginFormSummary.d.ts +10 -0
- package/{tests/utils → components/LoginFormSummary}/index.d.ts +2 -3
- package/components/PaymentMethods/PaymentMethods.d.ts +5 -3
- package/components/PaymentMethodsSummary/PaymentMethodsSummary.d.ts +11 -0
- package/components/PaymentMethodsSummary/index.d.ts +19 -0
- package/components/ShippingMethods/ShippingMethods.d.ts +3 -1
- package/components/ShippingMethodsSummary/ShippingMethodsSummary.d.ts +14 -0
- package/components/ShippingMethodsSummary/index.d.ts +19 -0
- package/components/Summary/Summary.d.ts +10 -0
- package/{msw/fixtures → components/Summary}/index.d.ts +3 -4
- package/components/index.d.ts +4 -0
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +7 -2
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm/LoginForm.d.ts +14 -2
- package/containers/LoginForm.js +1 -1
- package/containers/LoginFormSummary/LoginFormSummary.d.ts +14 -0
- package/containers/LoginFormSummary/index.d.ts +19 -0
- package/containers/LoginFormSummary.d.ts +3 -0
- package/containers/LoginFormSummary.js +3 -0
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods/PaymentMethods.d.ts +8 -0
- package/containers/PaymentMethods.js +1 -1
- package/containers/PaymentMethodsSummary/PaymentMethodsSummary.d.ts +18 -0
- package/containers/PaymentMethodsSummary/index.d.ts +19 -0
- package/containers/PaymentMethodsSummary.d.ts +3 -0
- package/containers/PaymentMethodsSummary.js +3 -0
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods/ShippingMethods.d.ts +7 -2
- package/containers/ShippingMethods.js +1 -1
- package/containers/ShippingMethodsSummary/ShippingMethodsSummary.d.ts +15 -0
- package/containers/ShippingMethodsSummary/index.d.ts +19 -0
- package/containers/ShippingMethodsSummary.d.ts +3 -0
- package/containers/ShippingMethodsSummary.js +3 -0
- package/containers/TermsAndConditions.js +1 -1
- package/containers/index.d.ts +2 -0
- package/data/models/shipping-estimate.d.ts +2 -1
- package/i18n/en_US.json.d.ts +35 -28
- package/lib/events.d.ts +1 -0
- package/package.json +1 -1
- package/render.js +6 -6
- package/{msw → tests}/fixtures/fragments/index.d.ts +1 -1
- package/tests/fixtures/index.d.ts +21 -0
- package/tests/fixtures/{cart.d.ts → models/cart.d.ts} +2 -2
- package/tests/fixtures/models/customer.d.ts +5 -0
- package/tests/fixtures/models/index.d.ts +21 -0
- package/tests/fixtures/{payments.d.ts → models/payments.d.ts} +1 -1
- package/tests/fixtures/{shipping.d.ts → models/shipping.d.ts} +1 -1
- package/{msw → tests}/fixtures/queries/index.d.ts +1 -1
- package/{msw → tests/mocks}/browser.d.ts +2 -2
- package/tests/fixtures/customer.d.ts +0 -5
- package/tests/utils/expectError.d.ts +0 -25
- package/tests/utils/mockEvents.d.ts +0 -21
- /package/{msw → tests}/fixtures/fragments/available-shipping-methods.d.ts +0 -0
- /package/{msw → tests}/fixtures/fragments/billing-address.d.ts +0 -0
- /package/{msw → tests}/fixtures/fragments/cart.d.ts +0 -0
- /package/{msw → tests}/fixtures/fragments/shipping-address.d.ts +0 -0
- /package/{msw → tests}/fixtures/mutations/estimate-shipping-methods.d.ts +0 -0
- /package/{msw → tests}/fixtures/mutations/index.d.ts +0 -0
- /package/{msw → tests}/fixtures/mutations/set-billing-address.d.ts +0 -0
- /package/{msw → tests}/fixtures/mutations/set-guest-email.d.ts +0 -0
- /package/{msw → tests}/fixtures/mutations/set-payment-method.d.ts +0 -0
- /package/{msw → tests}/fixtures/mutations/set-shipping-address.d.ts +0 -0
- /package/{msw → tests}/fixtures/mutations/set-shipping-methods.d.ts +0 -0
- /package/{msw → tests}/fixtures/queries/get-cart.d.ts +0 -0
- /package/{msw → tests}/fixtures/queries/get-customer.d.ts +0 -0
- /package/{msw → tests}/fixtures/queries/get-store-config.d.ts +0 -0
- /package/{msw → tests}/fixtures/queries/is-email-available.d.ts +0 -0
- /package/{msw → tests/mocks}/handlers.d.ts +0 -0
- /package/{msw → tests/mocks}/server.d.ts +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 './PaymentMethodsSummary';
|
|
18
|
+
export { PaymentMethodsSummary as default } from './PaymentMethodsSummary';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as a,Fragment as f}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{Slot as i}from"@dropins/tools/lib.js";/* empty css */import"../chunks/errors.js";import{events as P}from"@dropins/tools/event-bus.js";import{a as M}from"../chunks/events.js";import"@dropins/tools/preact-compat.js";import{c as l}from"../chunks/classes.js";/* empty css *//* empty css */import{useState as N,useCallback as S,useEffect as g}from"@dropins/tools/preact-hooks.js";import{S as k}from"../chunks/Summary.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";function u({node:e,...t}){return e?Array.isArray(e)?a(f,{children:e.map((m,r)=>a(u,{node:m,className:t.className,...t},r))}):(t.className=l([e.props.className,t.className]),a(e.type,{ref:e.ref,...e.props,...t},e.key)):null}const D=({className:e,details:t,heading:m,onEditClick:r,...s})=>a(k,{className:l([e,"checkout-payment-methods-summary"]),"data-testid":"checkout-payment-methods-summary",heading:m,onEditClick:r,...s,children:a(u,{className:"checkout-payment-methods-summary__details","data-testid":"checkout-payment-methods-summary-details",node:t})}),_=e=>e===null?!1:e.code!==""&&e.title!=="",b=({initialData:e={selectedPaymentMethod:null},onEditClick:t,slots:m})=>{const[r,s]=N(e),n=r.selectedPaymentMethod,y=S(()=>{t==null||t()},[t]);if(g(()=>{const o=P.on("checkout/updated",c=>{s(p=>({...p,selectedPaymentMethod:(c==null?void 0:c.selectedPaymentMethod)??null}))});return()=>{o==null||o.off()}},[]),!_(n))return null;const d=m!=null&&m.Heading?a(i,{name:"PaymentMethodsSummaryTitle",slot:m.Heading}):void 0,h=a(i,{context:{selectedPaymentMethod:n},name:"PaymentMethodsSummaryDetails",slot:m==null?void 0:m.Details,children:a("span",{className:"checkout-payment-methods-summary__label","data-testid":"checkout-payment-methods-summary-label",children:n.title})});return a(D,{details:h,heading:d,onEditClick:y})};b.getInitialData=async()=>{const e=M(),t=(e==null?void 0:e.selectedPaymentMethod)??null;return Promise.resolve({selectedPaymentMethod:t})};export{b as PaymentMethodsSummary,b as default};
|
package/containers/PlaceOrder.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as U,jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{h as I,U as v,s as B}from"../chunks/errors.js";import{classes as j,Slot as w}from"@dropins/tools/lib.js";import{events as d}from"@dropins/tools/event-bus.js";import{g as y}from"../chunks/values.js";import{W as
|
|
3
|
+
import{jsxs as U,jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{h as I,U as v,s as B}from"../chunks/errors.js";import{classes as j,Slot as w}from"@dropins/tools/lib.js";import{events as d}from"@dropins/tools/event-bus.js";import{g as M}from"../chunks/events.js";import{g as y}from"../chunks/values.js";import{W as N}from"../chunks/ConditionalWrapper.js";/* empty css */import{Skeleton as T,SkeletonRow as g,Button as W}from"@dropins/tools/components.js";import{s as _}from"../chunks/ServerErrorSignal.js";import{useState as E,useCallback as m,useEffect as f}from"@dropins/tools/preact-hooks.js";import{useText as H}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const L=()=>U(T,{"data-testid":"place-order-skeleton",children:[o(g,{size:"small",variant:"empty"}),o(g,{size:"small"})]}),Q=({children:c,className:r,disabled:s=!1,onClick:a})=>o("div",{className:j(["checkout-place-order",r]),children:o(W,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:s,size:"medium",type:"submit",variant:"primary",onClick:a,children:c},"placeOrder")}),R=N(Q,L),re=({disabled:c=!1,active:r=!0,handleValidation:s,handlePlaceOrder:a,slots:i,...S})=>{var C;const[x,p]=E(!1),[P,h]=E(!1),b=I.value,l=H({CheckoutUnexpectedError:"Checkout.ServerError.unexpected",placeOrderButton:"Checkout.PlaceOrder.button"}),k=m(e=>{_.value=e instanceof TypeError||e instanceof v?l.CheckoutUnexpectedError:e.message},[l]),z=m(async()=>{var e;try{if(s&&!s())return;await a({cartId:B.cartId,code:((e=y("selectedPaymentMethod"))==null?void 0:e.code)??""})}catch(t){k(t)}},[s,a,k]),n=m(e=>{(!e||e.isEmpty)&&h(!1)},[]);return f(()=>{if(r===!1)return;const e=d.on("cart/initialized",t=>{const u=(t==null?void 0:t.items)||[];h(u.some(O=>O.outOfStock||O.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[r]),f(()=>{if(!r)return;const e=M();if(e){p(!0),n(e);return}const t=d.on("checkout/initialized",u=>{p(!0),n(u)},{eager:!0});return()=>{t==null||t.off()}},[r,n]),f(()=>{if(!r)return;const e=d.on("checkout/updated",n,{eager:!1});return()=>{e==null||e.off()}},[r,n]),o(R,{...S,disabled:c||P||b,initialized:x,visible:r,onClick:z,children:o(w,{context:{code:((C=y("selectedPaymentMethod"))==null?void 0:C.code)??""},name:"Content",slot:i==null?void 0:i.Content,children:l.placeOrderButton})})};export{re as PlaceOrder,re as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as t,jsxs as l}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as p,Icon as f,Button as d}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{classes as a}from"@dropins/tools/lib.js";/* empty css */import"../chunks/errors.js";import"@dropins/tools/event-bus.js";import{s as h}from"../chunks/dom.js";import"@dropins/tools/preact-compat.js";/* empty css */import{S as v}from"../chunks/OrderError.js";import{useText as k}from"@dropins/tools/i18n.js";/* empty css */import{useRef as g,useEffect as m}from"@dropins/tools/preact-hooks.js";import{s as n}from"../chunks/ServerErrorSignal.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const C=({className:i,contactSupport:o,errorMessage:e,onClick:c,errorMessageRef:s})=>{const r=k({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"}),u=e!==""?e:r.Title;return t(p,{action:t(d,{className:a(["checkout-server-error__button"]),name:"server-error-button",onClick:c,children:r.Button}),"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:a(["checkout-server-error",i]),"data-testid":"checkout-server-error",heading:u,icon:t(f,{className:a(["checkout-server-error__icon"]),source:v}),message:l("p",{ref:s,"data-testid":"checkout-server-error-message",id:a(["checkout-server-error__message"]),children:[r.Message,t("br",{}),t("span",{children:o??r.ContactSupport})]})})},F=({active:i=!0,onRetry:o,onServerError:e,autoScroll:c=!1})=>{const s=g(null),r=n.value,u=async()=>{o==null||o(),n.value=void 0};return m(()=>{r&&(e==null||e(r))},[r,e]),m(()=>{!c||!r||!s.current||h(s.current)},[r,c]),!i||!r?null:t(C,{errorMessage:r,errorMessageRef:s,onClick:u})};export{F as ServerError,F as default};
|
|
@@ -4,13 +4,18 @@ import { TitleProps } from '../../types/TitleProps';
|
|
|
4
4
|
import { Container } from '@dropins/tools/types/elsie/src/lib';
|
|
5
5
|
import { HTMLAttributes } from 'preact/compat';
|
|
6
6
|
|
|
7
|
+
interface CartSyncError {
|
|
8
|
+
method: ShippingMethod;
|
|
9
|
+
error: Error;
|
|
10
|
+
}
|
|
7
11
|
export interface ShippingMethodsProps extends HTMLAttributes<HTMLDivElement>, TitleProps {
|
|
8
|
-
onSelectionChange?: (method: ShippingMethod) => void;
|
|
9
|
-
onSelectionError?: (error: unknown, method: ShippingMethod) => void;
|
|
10
12
|
UIComponentType?: UIComponentType;
|
|
11
13
|
active?: boolean;
|
|
12
14
|
autoSync?: boolean;
|
|
15
|
+
onCartSyncError?: (error: CartSyncError) => void;
|
|
16
|
+
onSelectionChange?: (method: ShippingMethod) => void;
|
|
13
17
|
}
|
|
14
18
|
export declare function emitShippingEstimateEvent(selection: ShippingMethod): void;
|
|
15
19
|
export declare const ShippingMethods: Container<ShippingMethodsProps>;
|
|
20
|
+
export {};
|
|
16
21
|
//# sourceMappingURL=ShippingMethods.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as
|
|
3
|
+
import{jsxs as _,jsx as n,Fragment as Z}from"@dropins/tools/preact-jsx-runtime.js";import{h as te,a as ne}from"../chunks/errors.js";import{classes as U,VComponent as re,Slot as oe}from"@dropins/tools/lib.js";import{s as ie,t as se}from"../chunks/setShippingMethods.js";import{events as W}from"@dropins/tools/event-bus.js";import{h as x,g as ce}from"../chunks/events.js";import{n as ae,g as q}from"../chunks/values.js";import{W as ue}from"../chunks/ConditionalWrapper.js";/* empty css */import{Skeleton as le,SkeletonRow as w,ProgressSpinner as pe,IllustratedMessage as de,Icon as he,InLineAlert as me,RadioButton as fe,Price as F,ToggleButton as ge}from"@dropins/tools/components.js";import{s as ke}from"../chunks/dom.js";import{useRef as ve,useEffect as T,useState as H,useCallback as k,useMemo as Ee}from"@dropins/tools/preact-hooks.js";import*as c from"@dropins/tools/preact-compat.js";import{useText as $}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const Se=i=>c.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},c.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"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),c.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"}),c.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"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),c.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Ce=()=>_(le,{"data-testid":"shipping-methods-skeleton",children:[n(w,{size:"small",variant:"heading"}),n(w,{size:"small",variant:"empty"}),n(w,{fullWidth:!0,size:"medium"}),n(w,{fullWidth:!0,size:"medium"})]}),Me=({className:i,isLoading:t=!1,onSelectionChange:f=()=>{},options:v,selection:p,title:a,UIComponentType:l="RadioButton",error:d=null,onDismissError:V=()=>{},...P})=>{const E=$({EmptyState:"Checkout.ShippingMethods.emptyState"}),S=d!==null,C=ve(null);T(()=>{S&&C.current&&ke(C.current)},[S]);const j=(r,R)=>{const B={busy:t,key:r.value,className:"checkout-shipping-methods__method",name:"shipping-method",value:r.value,onChange:()=>f(r)};return R==="RadioButton"?n(fe,{...B,checked:(p==null?void 0:p.value)===r.value,"data-testid":"shipping-method-radioButton",description:r.title,id:r.value,label:_(Z,{children:[n(F,{amount:r.amount.value,currency:r.amount.currency})," ",n("span",{children:r.carrier.title})]})}):n(ge,{...B,"data-testid":"shipping-method-toggleButton",label:_(Z,{children:[n("span",{children:r.carrier.title}),n(F,{amount:r.amount.value,currency:r.amount.currency})]}),selected:(p==null?void 0:p.value)===r.value})};return _("div",{...P,className:U(["checkout-shipping-methods",i]),"data-testid":"checkout-shipping-methods",children:[a&&n(re,{className:"checkout-shipping-methods__title",node:a}),_("div",{className:U(["checkout-shipping-methods__content"]),children:[t&&n(pe,{className:"checkout-shipping-methods__spinner"}),n("div",{className:U(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t],["checkout-shipping-methods__options--toggleButton",l==="ToggleButton"]]),children:v.length===0?n(de,{"data-testid":"checkout-shipping-methods-empty",icon:n(he,{source:Se}),message:n("p",{children:E.EmptyState})}):v.map(r=>j(r,l))})]}),S&&n("div",{ref:C,className:"checkout-shipping-methods__error","data-testid":"checkout-shipping-methods-alert",children:n(me,{heading:d,type:"error",variant:"primary",onDismiss:V})})]})},Le=ue(Me,Ce);function ye(i,t){return i?t.some(f=>z(f,i)):!1}function z(i,t){return!i||!t||i.amount.value!==t.amount.value?!1:i.code===t.code&&i.carrier.code===t.carrier.code}function _e(i){const t=W.lastPayload("shipping/estimate");t&&W.emit("shipping/estimate",{...t,shippingMethod:se(i)})}const Oe=({UIComponentType:i="RadioButton",active:t=!0,autoSync:f=!0,displayTitle:v=!0,initialData:p,slots:a,onCartSyncError:l,onSelectionChange:d,...V})=>{const[P,E]=H(null),[S,C]=H(!1),[j,r]=H(),[R,B]=H(null),G=te.value,J=ne.value,K=G||J,{cartSyncError:A,defaultTitle:D}=$({cartSyncError:"Checkout.ShippingMethods.cartSyncError",defaultTitle:"Checkout.ShippingMethods.title"}),Q=k(()=>{E(null)},[]),s=k(e=>{E(null),B(o=>z(o,e)?o:(ae({selectedShippingMethod:e}),e))},[]),M=k(async(e,o)=>{if(!f||!x())return;const u={method_code:e.code,carrier_code:e.carrier.code};ie([u]).catch(h=>{s(o??null),l==null||l({method:e,error:h}),l||E(A)})},[f,s,l,A]),X=k(async e=>{const o=q("selectedShippingMethod");s(e),d==null||d(e),x()||_e(e),await M(e,o)},[d,s,M]),L=k(e=>{var b;const o=!e||e.isEmpty,u=!!(e!=null&&e.isVirtual);if(o||u){C(u),s(null),r([]);return}const h=(b=e.shippingAddresses)==null?void 0:b[0];if(!h)return;const m=h.availableShippingMethods??[];if(r(m),m.length===0){s(null);return}const y=h.selectedShippingMethod??null,g=q("selectedShippingMethod"),N=ye(g,m),ee=z(g,y);if(g&&N&&!ee){M(g,y);return}if((!g||!N)&&y){s(y);return}if((!g||!N)&&!y){const O=m[0];s(O),M(O)}},[M,s]),I=k(e=>{if(e===void 0)return;const{shippingMethod:o,availableShippingMethods:u}=e,h=(u==null?void 0:u.find(m=>m.code===(o==null?void 0:o.methodCode)&&m.carrier.code===(o==null?void 0:o.carrierCode)))??null;r(u),s(h)},[s]);T(()=>{if(!t)return;const e=ce();if(e){L(e);return}const o=W.on("checkout/initialized",L,{eager:!0});return()=>{o==null||o.off()}},[t,L]),T(()=>{if(!t)return;const e=W.on("checkout/updated",L,{eager:!1});return()=>{e==null||e.off()}},[t,L]),T(()=>{if(!t||x())return;const e=W.on("shipping/estimate",I,{eager:!0});return()=>{e==null||e.off()}},[t,I]);const Y=Ee(()=>{if(v)return n(oe,{name:"checkout-shipping-methods-title",slot:a==null?void 0:a.Title,children:n("h3",{children:D})})},[v,a==null?void 0:a.Title,D]);return n(Le,{...V,UIComponentType:i,error:P,initialized:j!==void 0,isLoading:K,options:j??[],selection:R,title:Y,visible:t&&!S,onDismissError:Q,onSelectionChange:X})};export{Oe as ShippingMethods,Oe as default,_e as emitShippingEstimateEvent};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ShippingMethod } from '../../data/models';
|
|
2
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
4
|
+
|
|
5
|
+
export interface ShippingMethodsSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
onEditClick?: () => void;
|
|
7
|
+
slots?: {
|
|
8
|
+
Heading?: SlotProps;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ShippingMethodsSummaryData {
|
|
12
|
+
shippingMethod: ShippingMethod | null;
|
|
13
|
+
}
|
|
14
|
+
export declare const ShippingMethodsSummary: Container<ShippingMethodsSummaryProps, ShippingMethodsSummaryData>;
|
|
15
|
+
//# sourceMappingURL=ShippingMethodsSummary.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 './ShippingMethodsSummary';
|
|
18
|
+
export { ShippingMethodsSummary as default } from './ShippingMethodsSummary';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as p,jsxs as a}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{Slot as l}from"@dropins/tools/lib.js";/* empty css */import"../chunks/errors.js";import{events as g}from"@dropins/tools/event-bus.js";import{a as S}from"../chunks/events.js";import"@dropins/tools/preact-compat.js";/* empty css *//* empty css */import{useState as f,useCallback as y,useEffect as M}from"@dropins/tools/preact-hooks.js";import{c as k}from"../chunks/classes.js";import{S as _}from"../chunks/Summary.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";const b=({className:t,shippingMethod:e,heading:s,onEditClick:i,...o})=>p(_,{className:k([t,"checkout-shipping-methods-summary"]),"data-testid":"checkout-shipping-methods-summary",heading:s,onEditClick:i,...o,children:a("div",{className:"checkout-shipping-methods-summary__content",children:[p("span",{className:"checkout-shipping-methods-summary__label","data-testid":"checkout-shipping-methods-summary-label",children:e.label}),e.description&&p("span",{className:"checkout-shipping-methods-summary__description","data-testid":"checkout-shipping-methods-summary-description",children:e.description})]})}),v=({initialData:t,onEditClick:e,slots:s})=>{const[i,o]=f((t==null?void 0:t.shippingMethod)??null),c=y(()=>{e==null||e()},[e]);if(M(()=>{const r=g.on("checkout/updated",m=>{var n,h;const u=((h=(n=m==null?void 0:m.shippingAddresses)==null?void 0:n[0])==null?void 0:h.selectedShippingMethod)??null;o(u)});return()=>{r==null||r.off()}},[]),!i)return null;const d=s!=null&&s.Heading?p(l,{name:"ShippingMethodsHeadingTitle",slot:s.Heading}):void 0;return p(b,{heading:d,shippingMethod:{label:i.carrier.title,description:i.title},onEditClick:c})};v.getInitialData=async()=>{var s,i;const t=S(),e=((i=(s=t==null?void 0:t.shippingAddresses)==null?void 0:s[0])==null?void 0:i.selectedShippingMethod)??null;return Promise.resolve({shippingMethod:e})};export{v as ShippingMethodsSummary,v as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e,jsxs as M}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as v,SkeletonRow as S,Checkbox as b}from"@dropins/tools/components.js";import{p as N}from"../chunks/TermsAndConditions.js";import{classes as f,VComponent as U,Slot as w}from"@dropins/tools/lib.js";/* empty css
|
|
3
|
+
import{jsx as e,jsxs as M}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as v,SkeletonRow as S,Checkbox as b}from"@dropins/tools/components.js";import{p as N}from"../chunks/TermsAndConditions.js";import{classes as f,VComponent as U,Slot as w}from"@dropins/tools/lib.js";/* empty css */import{s as E}from"../chunks/errors.js";import{A as V}from"../chunks/checkout.js";import{events as W}from"@dropins/tools/event-bus.js";import{g as j}from"../chunks/events.js";import"@dropins/tools/preact-compat.js";/* empty css *//* empty css */import{useState as g,useEffect as y}from"@dropins/tools/preact-hooks.js";import{W as D}from"../chunks/ConditionalWrapper.js";import{useText as H,MarkupText as L}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const P=({html:n})=>{const t=N.sanitize(n,{ADD_ATTR:["target"]});return t===""?null:e("span",{dangerouslySetInnerHTML:{__html:t}})},R=()=>e(v,{className:"checkout-terms-and-conditions-skeleton","data-testid":"checkout-terms-and-conditions-skeleton",children:e(S,{fullWidth:!0,size:"small",variant:"row"})}),$=({className:n,agreements:t,error:r,...s})=>e("div",{className:"checkout-terms-and-conditions","data-testid":"checkout-terms-and-conditions",children:M("form",{...s,noValidate:!0,className:f(["checkout-terms-and-conditions__form",n]),"data-testid":"checkout-terms-and-conditions-form",name:"checkout-terms-and-conditions__form",children:[t&&e(U,{className:f(["checkout-terms-and-conditions__agreements"]),"data-testid":"checkout-terms-and-conditions-agreements",node:t}),r&&e("div",{className:"checkout-terms-and-conditions__error","data-testid":"checkout-terms-and-conditions-error",children:r})]})}),q=D($,R),de=({active:n=!0,slots:t,...r})=>{var c;const[s,d]=g(!1),[k,m]=g(""),{errorMessage:_}=H({errorMessage:"Checkout.TermsAndConditions.error"}),i=((c=E.config)==null?void 0:c.agreementsEnabled)===!1,A=()=>{m("")},C=()=>{m(_)};return y(()=>{if(!n||i)return;if(j()){d(!0);return}const o=W.on("checkout/initialized",()=>{d(!0)},{eager:!0});return()=>{o==null||o.off()}},[n,i]),e(q,{...r,agreements:e(w,{context:{appendAgreement(l){this._registerMethod((...o)=>{const u=l(...o);if(!u)return;const{mode:T,name:p,text:a,translationId:h}=u;if(!a&&!h){console.warn(`The agreement ${p} is misconfigured. Please provide a text or a translationId.`);return}const x=a?e(P,{html:a}):e(L,{id:h}),z=e(b,{checked:T===V.AUTO,label:x,name:p,required:!0,onChange:A,onInvalid:C});this._setProps(I=>({children:[...I.children||[],z]}))})}},name:"Agreements",slot:t==null?void 0:t.Agreements}),error:k,initialized:s,visible:n&&!i})};export{de as TermsAndConditions,de as default};
|
package/containers/index.d.ts
CHANGED
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
export * from './BillToShippingAddress';
|
|
18
18
|
export * from './EstimateShipping';
|
|
19
19
|
export * from './LoginForm';
|
|
20
|
+
export * from './LoginFormSummary';
|
|
20
21
|
export * from './MergedCartBanner';
|
|
21
22
|
export * from './OutOfStock';
|
|
22
23
|
export * from './PaymentMethods';
|
|
23
24
|
export * from './PlaceOrder';
|
|
24
25
|
export * from './ServerError';
|
|
25
26
|
export * from './ShippingMethods';
|
|
27
|
+
export * from './ShippingMethodsSummary';
|
|
26
28
|
export * from './TermsAndConditions';
|
|
27
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -16,7 +16,8 @@ export interface ShippingEstimateShippingMethod {
|
|
|
16
16
|
}
|
|
17
17
|
export interface ShippingEstimate {
|
|
18
18
|
address: PartialShippingAddress;
|
|
19
|
-
shippingMethod: ShippingEstimateShippingMethod | null;
|
|
20
19
|
availableShippingMethods?: ShippingMethod[];
|
|
20
|
+
shippingMethod: ShippingEstimateShippingMethod | null;
|
|
21
|
+
success?: boolean;
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=shipping-estimate.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -1,76 +1,83 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"Checkout": {
|
|
3
3
|
"BillToShippingAddress": {
|
|
4
|
+
"cartSyncError": "We were unable to save your changes. Please try again later.",
|
|
4
5
|
"title": "Bill to shipping address"
|
|
5
6
|
},
|
|
6
7
|
"EmptyCart": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
8
|
+
"button": "Start shopping",
|
|
9
|
+
"title": "Your cart is empty"
|
|
9
10
|
},
|
|
10
11
|
"EstimateShipping": {
|
|
11
12
|
"estimated": "Estimated Shipping",
|
|
12
13
|
"freeShipping": "Free",
|
|
13
14
|
"label": "Shipping",
|
|
14
15
|
"taxToBeDetermined": "TBD",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
16
|
+
"withoutTaxes": "Excluding taxes",
|
|
17
|
+
"withTaxes": "Including taxes"
|
|
17
18
|
},
|
|
18
19
|
"LoginForm": {
|
|
19
|
-
"title": "Contact details",
|
|
20
20
|
"account": "Already have an account?",
|
|
21
21
|
"ariaLabel": "Email",
|
|
22
|
-
"invalidEmailError": "Please enter a valid email address.",
|
|
23
|
-
"missingEmailError": "Enter an email address.",
|
|
24
22
|
"emailExists": {
|
|
25
23
|
"alreadyHaveAccount": "It looks like you already have an account.",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
24
|
+
"forFasterCheckout": "for a faster checkout.",
|
|
25
|
+
"signInButton": "Sign in"
|
|
28
26
|
},
|
|
29
27
|
"floatingLabel": "Email *",
|
|
28
|
+
"invalidEmailError": "Please enter a valid email address.",
|
|
29
|
+
"missingEmailError": "Enter an email address.",
|
|
30
|
+
"cartSyncError": "We were unable to save your changes. Please try again later.",
|
|
30
31
|
"placeholder": "Enter your email address",
|
|
31
32
|
"signIn": "Sign In",
|
|
33
|
+
"signOut": "Sign Out",
|
|
32
34
|
"switch": "Do you want to switch account?",
|
|
33
|
-
"
|
|
35
|
+
"title": "Contact details"
|
|
34
36
|
},
|
|
35
37
|
"MergedCartBanner": {
|
|
36
38
|
"items": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
+
"many": "{{count}} items from a previous session were added to your cart. Please review your new subtotal.",
|
|
40
|
+
"one": "1 item from a previous session was added to your cart. Please review your new subtotal."
|
|
39
41
|
}
|
|
40
42
|
},
|
|
41
43
|
"OutOfStock": {
|
|
42
|
-
"title": "Your cart contains items that are out of stock",
|
|
43
|
-
"message": "The following items are out of stock:",
|
|
44
44
|
"actions": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
45
|
+
"removeOutOfStock": "Remove out of stock items",
|
|
46
|
+
"reviewCart": "Review cart"
|
|
47
47
|
},
|
|
48
|
+
"alert": "Out of stock!",
|
|
48
49
|
"lowInventory": {
|
|
49
|
-
"
|
|
50
|
-
"
|
|
50
|
+
"many": "Only {{count}} left!",
|
|
51
|
+
"one": "Last item!"
|
|
51
52
|
},
|
|
52
|
-
"
|
|
53
|
+
"message": "The following items are out of stock:",
|
|
54
|
+
"title": "Your cart contains items that are out of stock"
|
|
53
55
|
},
|
|
54
56
|
"PaymentMethods": {
|
|
55
|
-
"
|
|
56
|
-
"emptyState": "No payment methods available"
|
|
57
|
+
"cartSyncError": "We were unable to save your changes. Please try again later.",
|
|
58
|
+
"emptyState": "No payment methods available",
|
|
59
|
+
"title": "Payment"
|
|
57
60
|
},
|
|
58
61
|
"PlaceOrder": {
|
|
59
62
|
"button": "Place Order"
|
|
60
63
|
},
|
|
61
64
|
"ServerError": {
|
|
62
|
-
"
|
|
65
|
+
"button": "Try again",
|
|
63
66
|
"contactSupport": "If you continue to have issues, please contact support.",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
67
|
+
"title": "We were unable to process your order",
|
|
68
|
+
"unexpected": "An unexpected error occurred while processing your order. Please try again later."
|
|
66
69
|
},
|
|
67
70
|
"ShippingMethods": {
|
|
68
|
-
"
|
|
69
|
-
"emptyState": "This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."
|
|
71
|
+
"cartSyncError": "We were unable to save your changes. Please try again later.",
|
|
72
|
+
"emptyState": "This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct.",
|
|
73
|
+
"title": "Shipping options"
|
|
74
|
+
},
|
|
75
|
+
"Summary": {
|
|
76
|
+
"Edit": "Edit"
|
|
70
77
|
},
|
|
71
78
|
"TermsAndConditions": {
|
|
72
|
-
"
|
|
73
|
-
"
|
|
79
|
+
"error": "Please accept the Terms and Conditions to continue.",
|
|
80
|
+
"label": "I have read, understand, and accept our <a href='https://www.adobe.com/legal/terms.html' target='_blank'>Terms of Use, Terms of Sales, Privacy Policy, and Return Policy</a>."
|
|
74
81
|
},
|
|
75
82
|
"title": "Checkout"
|
|
76
83
|
}
|
package/lib/events.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Cart as DataModel } from '../data/models';
|
|
|
2
2
|
|
|
3
3
|
export declare function getInitialCheckoutData(): DataModel | null;
|
|
4
4
|
export declare function getLatestCheckoutUpdate(): DataModel | null;
|
|
5
|
+
export declare function getCheckoutData(): DataModel | null;
|
|
5
6
|
export declare function hasShippingAddress(): boolean;
|
|
6
7
|
export declare function isVirtualCart(): boolean;
|
|
7
8
|
export declare function getCartEmail(): string | null;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-checkout", "version": "2.0.0-
|
|
1
|
+
{"name": "@dropins/storefront-checkout", "version": "2.0.0-beta5", "@dropins/tools": "~1.2.1", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
(function(
|
|
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;margin:0 0 var(--spacing-medium) 0}.checkout-login-form__heading:empty{display:none}.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,.checkout-login-form__title h2{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}.checkout-login-form__heading-label,.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
|
|
5
|
-
.checkout-shipping-methods__title,.checkout-shipping-methods__title h3{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}.checkout-shipping-methods__options--toggleButton{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-shipping-methods__options--toggleButton .dropin-toggle-button__content{justify-content:start;display:grid;grid-template-columns:1fr min-content}.checkout-shipping-methods__options--toggleButton .checkout-shipping-methods__method{margin-bottom:0;width:auto}
|
|
3
|
+
(function(n,o){try{if(typeof document<"u"){const t=document.createElement("style"),r=o.styleId;for(const e in o.attributes)t.setAttribute(e,o.attributes[e]);t.setAttribute("data-dropin",r),t.appendChild(document.createTextNode(n));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-xbig)}
|
|
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;margin:0 0 var(--spacing-medium) 0;align-items:center}.checkout-login-form__heading:empty{display:none}.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,.checkout-login-form__title h2{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}.checkout-login-form__heading-label,.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}.checkout-login-form__heading-label a,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:1fr;grid-template-rows:1fr}.checkout-login-form__heading-label{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:var(--spacing-medium)}}.checkout-login-form-summary__email{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.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);letter-spacing:var(--type-body-2-strong-letter-spacing);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-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);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{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);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}@media only screen and (width >= 320px) and (width <= 768px){.checkout-out-of-stock__items{grid-template-columns:repeat(3,100px)}}.checkout-payment-methods-summary__label{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.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)}.checkout-shipping-methods-summary__content{display:flex;flex-direction:column;gap:var(--spacing-xsmall)}.checkout-shipping-methods-summary__label{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-shipping-methods-summary__description{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.summary{display:flex;flex-direction:column;gap:var(--spacing-xsmall)}.summary--inline{align-items:flex-start;flex-direction:row;justify-content:space-between}.summary__header{align-items:center;display:flex;justify-content:space-between}.summary .dropin-button{color:var(--color-brand-500);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);text-decoration:none;margin:0;padding:0}.summary .dropin-button:hover{--textColor: var(--color-brand-700);text-decoration:solid underline var(--textColor);text-underline-offset:6px}.checkout-terms-and-conditions{display:grid}.checkout-terms-and-conditions__error{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-alert-800);text-align:left;margin-top:var(--spacing-xsmall)}.checkout-terms-and-conditions__error:empty{display:none}
|
|
5
|
+
.checkout-shipping-methods__title,.checkout-shipping-methods__title h3{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}.checkout-shipping-methods__options--toggleButton{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-shipping-methods__options--toggleButton .dropin-toggle-button__content{justify-content:start;display:grid;grid-template-columns:1fr min-content}.checkout-shipping-methods__options--toggleButton .checkout-shipping-methods__method{margin-bottom:0;width:auto}.checkout-shipping-methods__error{margin-top:var(--spacing-medium)}
|
|
6
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,.checkout-payment-methods__title h2{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__wrapper--loading{opacity:.4;pointer-events:none}.checkout-payment-methods__methods{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-payment-methods__content{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:var(--spacing-xbig)}.checkout-payment-methods__content>div[data-slot=PaymentMethodSlot]:not(:empty){margin-top:var(--spacing-medium)}.checkout-payment-methods--full-width{grid-template-columns:1fr}.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}}
|
|
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"});
|
|
9
|
-
import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/errors.js";import{events as
|
|
7
|
+
.checkout-payment-methods__title,.checkout-payment-methods__title h2{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__wrapper--loading{opacity:.4;pointer-events:none}.checkout-payment-methods__methods{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-payment-methods__content{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:var(--spacing-xbig)}.checkout-payment-methods__content>div[data-slot=PaymentMethodSlot]:not(:empty){margin-top:var(--spacing-medium)}.checkout-payment-methods--full-width{grid-template-columns:1fr}.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}.checkout-payment-methods__error{margin-top:var(--spacing-medium)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-payment-methods__methods{grid-template-columns:1fr}}
|
|
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}.checkout-bill-to-shipping-address__error{margin-top:var(--spacing-medium)}`,{styleId:"checkout"});
|
|
9
|
+
import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/errors.js";import{events as y}from"@dropins/tools/event-bus.js";import{c as g}from"./chunks/synchronizeCheckout.js";import{UIProvider as p}from"@dropins/tools/components.js";import{useState as b,useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.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 w(r)&&!E(r)};function w(e){return!!e&&typeof e=="object"}function E(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||j(e)}var v=typeof Symbol=="function"&&Symbol.for,P=v?Symbol.for("react.element"):60103;function j(e){return e.$$typeof===P}function M(e){return Array.isArray(e)?[]:{}}function i(e,r){return r.clone!==!1&&r.isMergeableObject(e)?o(M(e),e,r):e}function A(e,r,t){return e.concat(r).map(function(a){return i(a,t)})}function T(e,r){if(!r.customMerge)return o;var t=r.customMerge(e);return typeof t=="function"?t:o}function I(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function u(e){return Object.keys(e).concat(I(e))}function m(e,r){try{return r in e}catch{return!1}}function C(e,r){return m(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function x(e,r,t){var a={};return t.isMergeableObject(e)&&u(e).forEach(function(n){a[n]=i(e[n],t)}),u(r).forEach(function(n){C(e,n)||(m(e,n)&&t.isMergeableObject(r[n])?a[n]=T(n,t)(e[n],r[n],t):a[n]=i(r[n],t))}),a}function o(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||A,t.isMergeableObject=t.isMergeableObject||S,t.cloneUnlessOtherwiseSpecified=i;var a=Array.isArray(r),n=Array.isArray(e),s=a===n;return s?a?t.arrayMerge(e,r,t):x(e,r,t):i(r,t)}o.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(a,n){return o(a,n,t)},{})};var D=o,_=D;const L=O(_),R={BillToShippingAddress:{cartSyncError:"We were unable to save your changes. Please try again later.",title:"Bill to shipping address"},EmptyCart:{button:"Start shopping",title:"Your cart is empty"},EstimateShipping:{estimated:"Estimated Shipping",freeShipping:"Free",label:"Shipping",taxToBeDetermined:"TBD",withoutTaxes:"Excluding taxes",withTaxes:"Including taxes"},LoginForm:{account:"Already have an account?",ariaLabel:"Email",emailExists:{alreadyHaveAccount:"It looks like you already have an account.",forFasterCheckout:"for a faster checkout.",signInButton:"Sign in"},floatingLabel:"Email *",invalidEmailError:"Please enter a valid email address.",missingEmailError:"Enter an email address.",cartSyncError:"We were unable to save your changes. Please try again later.",placeholder:"Enter your email address",signIn:"Sign In",signOut:"Sign Out",switch:"Do you want to switch account?",title:"Contact details"},MergedCartBanner:{items:{many:"{{count}} items from a previous session were added to your cart. Please review your new subtotal.",one:"1 item from a previous session was added to your cart. Please review your new subtotal."}},OutOfStock:{actions:{removeOutOfStock:"Remove out of stock items",reviewCart:"Review cart"},alert:"Out of stock!",lowInventory:{many:"Only {{count}} left!",one:"Last item!"},message:"The following items are out of stock:",title:"Your cart contains items that are out of stock"},PaymentMethods:{cartSyncError:"We were unable to save your changes. Please try again later.",emptyState:"No payment methods available",title:"Payment"},PlaceOrder:{button:"Place Order"},ServerError:{button:"Try again",contactSupport:"If you continue to have issues, please contact support.",title:"We were unable to process your order",unexpected:"An unexpected error occurred while processing your order. Please try again later."},ShippingMethods:{cartSyncError:"We were unable to save your changes. Please try again later.",emptyState:"This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct.",title:"Shipping options"},Summary:{Edit:"Edit"},TermsAndConditions:{error:"Please accept the Terms and Conditions to continue.",label:"I have read, understand, and accept our <a href='https://www.adobe.com/legal/terms.html' target='_blank'>Terms of Use, Terms of Sales, Privacy Policy, and Return Policy</a>."},title:"Checkout"},U={Checkout:R},B={default:U},k=({children:e})=>{var s;const[r,t]=b(),a=(s=g.getConfig())==null?void 0:s.langDefinitions;h(()=>{const c=y.on("locale",l=>{l!==r&&t(l)},{eager:!0});return()=>{c==null||c.off()}},[r]);const n=L(B,a??{});return f(p,{lang:r,langDefinitions:n,children:e})},G=new d(f(k,{}));export{k as Provider,G as render};
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export * from './shipping-address';
|
|
18
17
|
export * from './available-shipping-methods';
|
|
19
18
|
export * from './billing-address';
|
|
20
19
|
export * from './cart';
|
|
20
|
+
export * from './shipping-address';
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
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 './fragments/index';
|
|
18
|
+
export * from './models/index';
|
|
19
|
+
export * from './mutations/index';
|
|
20
|
+
export * from './queries/index';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Cart } from '
|
|
2
|
-
import { ShippingMethod } from '
|
|
1
|
+
import { Cart } from '../../../data/models/cart';
|
|
2
|
+
import { ShippingMethod } from '../../../data/models/shipping-method';
|
|
3
3
|
|
|
4
4
|
declare const emptyCart: Cart;
|
|
5
5
|
declare const simpleCart: Cart;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 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 './cart';
|
|
18
|
+
export * from './customer';
|
|
19
|
+
export * from './payments';
|
|
20
|
+
export * from './shipping';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
17
|
export * from './get-cart';
|
|
18
|
+
export * from './get-customer';
|
|
18
19
|
export * from './get-store-config';
|
|
19
20
|
export * from './is-email-available';
|
|
20
|
-
export * from './get-customer';
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ADOBE CONFIDENTIAL
|
|
3
3
|
* __________________
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
5
|
+
* Copyright 2025 Adobe
|
|
6
6
|
* All Rights Reserved.
|
|
7
7
|
*
|
|
8
8
|
* NOTICE: All information contained herein is, and remains
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export
|
|
17
|
+
export {};
|
|
18
18
|
//# sourceMappingURL=browser.d.ts.map
|