@dropins/storefront-checkout 1.4.0-beta1 → 2.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/estimateShippingMethods/graphql/index.d.ts +15 -15
- package/api/estimateShippingMethods/index.d.ts +15 -15
- package/api/fetch-graphql/fetch-graphql.d.ts +19 -19
- package/api/fetch-graphql/index.d.ts +15 -15
- package/api/getCart/getCart.d.ts +1 -1
- package/api/getCart/graphql/index.d.ts +15 -15
- package/api/getCart/index.d.ts +15 -15
- package/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts +1 -1
- package/api/getCustomer/graphql/index.d.ts +15 -15
- package/api/getCustomer/index.d.ts +15 -15
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +1 -1
- package/api/getStoreConfig/index.d.ts +15 -15
- package/api/initialize/index.d.ts +15 -15
- package/api/initializeCheckout/index.d.ts +15 -15
- package/api/initializeCheckout/initializeCheckout.d.ts +1 -1
- package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +15 -15
- package/api/isEmailAvailable/index.d.ts +15 -15
- package/api/setBillingAddress/index.d.ts +15 -15
- package/api/setBillingAddress/setBillingAddress.d.ts +1 -1
- package/api/setGuestEmailOnCart/index.d.ts +15 -15
- package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +1 -1
- package/api/setPaymentMethod/index.d.ts +15 -15
- package/api/setPaymentMethod/setPaymentMethod.d.ts +1 -1
- package/api/setShippingAddress/index.d.ts +15 -15
- package/api/setShippingAddress/setShippingAddress.d.ts +1 -1
- package/api/setShippingMethods/index.d.ts +15 -15
- package/api/setShippingMethods/setShippingMethods.d.ts +1 -1
- package/api/synchronizeCheckout/synchronizeCheckout.d.ts +1 -1
- package/api.js +9 -9
- package/chunks/ConditionalWrapper.js +3 -0
- package/chunks/ServerErrorSignal.js +3 -0
- package/chunks/TermsAndConditions.js +2 -2
- package/chunks/errors.js +11 -1
- package/chunks/setBillingAddress.js +2 -2
- package/chunks/setGuestEmailOnCart.js +6 -6
- package/chunks/setPaymentMethod.js +2 -2
- package/chunks/setShippingMethods.js +3 -3
- package/chunks/synchronizeCheckout.js +5 -5
- package/chunks/values.js +3 -0
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +2 -1
- package/components/BillToShippingAddress/index.d.ts +15 -15
- package/components/ConditionalWrapper/ConditionalWrapper.d.ts +8 -0
- package/{containers/Newsletter → components/ConditionalWrapper}/index.d.ts +2 -2
- package/components/EstimateShipping/EstimateShipping.d.ts +2 -2
- package/components/EstimateShipping/index.d.ts +15 -15
- package/components/LoginForm/LoginForm.d.ts +2 -2
- package/components/OutOfStock/index.d.ts +15 -15
- package/components/PaymentMethods/PaymentMethods.d.ts +7 -8
- package/components/PlaceOrder/PlaceOrder.d.ts +1 -1
- package/components/PlaceOrder/index.d.ts +15 -15
- package/components/ServerError/index.d.ts +15 -15
- package/components/ShippingMethods/ShippingMethods.d.ts +6 -4
- package/components/TermsAndConditions/TermsAndConditions.d.ts +2 -2
- package/components/index.d.ts +1 -1
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +5 -20
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/EstimateShipping/EstimateShipping.d.ts +5 -2
- package/containers/EstimateShipping/index.d.ts +15 -15
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm/LoginForm.d.ts +4 -5
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +5 -4
- package/containers/MergedCartBanner.js +1 -1
- package/containers/OutOfStock/OutOfStock.d.ts +1 -0
- package/containers/OutOfStock/index.d.ts +15 -15
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods/PaymentMethods.d.ts +6 -23
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +3 -6
- package/containers/PlaceOrder/index.d.ts +15 -15
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError/ServerError.d.ts +1 -0
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods/ShippingMethods.d.ts +8 -11
- package/containers/ShippingMethods/utils/emitShippingEstimateEvent.d.ts +1 -1
- package/containers/ShippingMethods.js +1 -1
- package/containers/TermsAndConditions/TermsAndConditions.d.ts +1 -0
- package/containers/TermsAndConditions.js +1 -1
- package/containers/index.d.ts +0 -1
- package/data/models/country.d.ts +15 -15
- package/data/models/custom-attribute.d.ts +15 -15
- package/data/models/email-availability.d.ts +15 -15
- package/data/models/index.d.ts +1 -0
- package/data/models/payment-method.d.ts +15 -15
- package/data/models/price.d.ts +15 -15
- package/data/models/shipping-estimate.d.ts +4 -0
- package/data/models/store-config.d.ts +1 -4
- package/data/models/values.d.ts +11 -0
- package/data/transforms/transform-cart.d.ts +1 -1
- package/data/transforms/transform-shipping-methods.d.ts +1 -1
- package/i18n/en_US.json.d.ts +0 -3
- package/lib/dispatchApiCall.d.ts +6 -22
- package/lib/enqueueRequest.d.ts +11 -24
- package/lib/events.d.ts +8 -0
- package/lib/index.d.ts +3 -2
- package/lib/network-error.d.ts +15 -15
- package/lib/values.d.ts +17 -0
- package/msw/browser.d.ts +15 -15
- package/msw/fixtures/fragments/cart.d.ts +15 -15
- package/msw/fixtures/index.d.ts +15 -15
- package/msw/fixtures/mutations/index.d.ts +15 -15
- package/msw/fixtures/queries/index.d.ts +15 -15
- package/msw/server.d.ts +15 -15
- package/package.json +1 -1
- package/render/index.d.ts +15 -15
- package/render.js +5 -6
- package/signals/ShippingEstimateSignal.d.ts +6 -5
- package/signals/index.d.ts +0 -5
- package/tests/constants.d.ts +15 -15
- package/{api/getCart/fixtures.d.ts → tests/fixtures/cart.d.ts} +3 -3
- package/{api/getCustomer/fixtures.d.ts → tests/fixtures/customer.d.ts} +1 -1
- package/tests/fixtures/payments.d.ts +8 -0
- package/{api/estimateShippingMethods/fixtures.d.ts → tests/fixtures/shipping.d.ts} +1 -1
- package/tests/integration/utils/index.d.ts +15 -15
- package/tests/integration/utils/setup.d.ts +1 -1
- package/tests/integration/utils/user-actions.d.ts +15 -15
- package/tests/mocks/svg.d.ts +15 -15
- package/tests/utils/expectError.d.ts +15 -15
- package/tests/utils/index.d.ts +15 -15
- package/tests/utils/mockEvents.d.ts +15 -15
- package/chunks/ShippingEstimateSignal.js +0 -14
- package/chunks/store-config.js +0 -3
- package/chunks/withConditionalRendering.js +0 -3
- package/chunks/withSkeleton.js +0 -3
- package/components/Newsletter/Newsletter.d.ts +0 -6
- package/components/Newsletter/NewsletterSkeleton.d.ts +0 -4
- package/components/Newsletter/index.d.ts +0 -20
- package/containers/Newsletter/Newsletter.d.ts +0 -9
- package/containers/Newsletter.d.ts +0 -3
- package/containers/Newsletter.js +0 -3
- package/hocs/index.d.ts +0 -19
- package/hocs/withConditionalRendering.d.ts +0 -13
- package/hocs/withSkeleton.d.ts +0 -8
- package/hooks/index.d.ts +0 -19
- package/hooks/useBreakpoint/index.d.ts +0 -18
- package/hooks/useBreakpoint/useBreakpoint.d.ts +0 -18
- package/hooks/useStableList/index.d.ts +0 -2
- package/hooks/useStableList/useStableList.d.ts +0 -2
- package/lib/debounce.d.ts +0 -30
- package/lib/fetch-error.d.ts +0 -23
- package/signals/CartSignal.d.ts +0 -7
- package/signals/IsBillToShippingSignal.d.ts +0 -18
- package/signals/IsSubscribedToNewsletterSignal.d.ts +0 -18
- package/signals/SelectedPaymentMethodSignal.d.ts +0 -18
- package/signals/SelectedShippingMethodSignal.d.ts +0 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as w,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{s as
|
|
3
|
+
import{jsxs as w,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{h as D,s as $}from"../chunks/errors.js";import{classes as E,VComponent as F,Slot as z}from"@dropins/tools/lib.js";import{events as H}from"@dropins/tools/event-bus.js";import{W as G,i as J,h as K,g as Q}from"../chunks/ConditionalWrapper.js";import{n as X,g as Y}from"../chunks/values.js";import{s as ee}from"../chunks/setPaymentMethod.js";/* empty css */import{Skeleton as te,SkeletonRow as C,IllustratedMessage as ne,Icon as N,ProgressSpinner as oe,ToggleButton as re,RadioButton as ae}from"@dropins/tools/components.js";import*as S from"@dropins/tools/preact-compat.js";import{useText as O}from"@dropins/tools/i18n.js";import{useState as _,useCallback as v,useEffect as L,useMemo as ce}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const ie=t=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},S.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"}),S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),se=()=>w(te,{"data-testid":"payment-methods-skeleton",children:[n(C,{size:"medium",variant:"heading"}),n(C,{size:"medium",variant:"empty"}),n(C,{fullWidth:!0,size:"xlarge"}),n(C,{fullWidth:!0,size:"xlarge"})]}),le=({code:t,icon:o,isLoading:d,onChange:r,selected:a,title:m,UIComponentType:p="ToggleButton"})=>{const c={busy:d,className:"checkout-payment-methods__method",label:m,name:"payment-method",value:t,onChange:()=>r({code:t,title:m})};return p==="ToggleButton"?n(re,{...c,icon:o?n(N,{source:o}):void 0,selected:a}):n(ae,{...c,checked:a,icon:o??void 0})},de=({className:t,title:o,isLoading:d=!1,onChange:r=()=>{},options:a,paymentMethodContent:m,UIComponentType:p,selection:c})=>{const P=O({EmptyState:"Checkout.PaymentMethods.emptyState"});return w("div",{className:E(["checkout-payment-methods",t]),"data-testid":"checkout-payment-methods",children:[o&&n(F,{className:"checkout-payment-methods__title",node:o}),!d&&a.length===0&&n(ne,{"data-testid":"checkout-payment-methods-empty",icon:n(N,{source:ie}),message:n("p",{children:P.EmptyState})}),w("div",{className:E(["checkout-payment-methods__wrapper",["checkout-payment-methods__wrapper--loading",d]]),children:[d&&n(oe,{className:"checkout-payment-methods__spinner"}),n("div",{className:E(["checkout-payment-methods__methods",["checkout-payment-methods--full-width",a.length%2!==0]]),children:a==null?void 0:a.map(u=>n(le,{UIComponentType:p,code:u.code,icon:u.icon,selected:(c==null?void 0:c.code)===u.code,title:u.displayLabel??!0?u.title:"",onChange:r},u.code))}),m&&n("div",{className:"checkout-payment-methods__content",children:m})]})]})},me=G(de,se);function ue(t,o){return t?o.some(d=>d.code===t.code):!1}function he(t,o){return!t||!o?!1:t.code===o.code}function pe(t){return t?!!t.code&&!!t.title:!1}const Ie=({displayTitle:t=!0,active:o=!0,UIComponentType:d="ToggleButton",slots:r,autoSync:a=!0})=>{var I,b;const[m,p]=_(!1),[c,P]=_(null),[u,U]=_([]),i=r==null?void 0:r.Methods,B=D.value,j=u.filter(e=>{var s;return((s=i==null?void 0:i[e.code])==null?void 0:s.enabled)!==!1}).map(e=>{const s=(i==null?void 0:i[e.code])||{};return{...e,...s}}),V=O({Title:"Checkout.PaymentMethods.title"}),h=v(e=>{P(e),X({selectedPaymentMethod:e})},[]),y=v(async e=>{if(!(J()||K()))return;const l=i==null?void 0:i[e.code];((l==null?void 0:l.autoSync)??a)&&await ee({code:e.code}).catch(console.error)},[a,i]),A=v(async e=>{h(e),await y(e)},[h,y]),k=v(e=>{if(!e||e.isEmpty){h(null),U([]);return}const l=e.availablePaymentMethods??[];if(U(l),l.length===0){h(null);return}const g=e.selectedPaymentMethod??null,x=pe(g),f=Y("selectedPaymentMethod"),T=ue(f,l),q=he(f,g);if(f&&T&&!q){y(f);return}if((!f||!T)&&x){h(g);return}if((!f||!T)&&!x){const W=l[0];h(W),y(W)}},[h,y]);L(()=>{if(!o)return;const e=Q();if(e){p(!0),k(e);return}const s=H.on("checkout/initialized",l=>{p(!0),k(l)},{eager:!0});return()=>{s==null||s.off()}},[o,k]),L(()=>{if(!o)return;const e=H.on("checkout/updated",k,{eager:!1});return()=>{e==null||e.off()}},[o,k]);const M=c?(b=(I=r==null?void 0:r.Methods)==null?void 0:I[c.code])==null?void 0:b.render:null,R=M?n(z,{context:{cartId:$.cartId??"",replaceHTML(e){this.replaceWith(e)}},name:"PaymentMethodContent",slot:M},M):void 0,Z=ce(()=>{if(t)return n(z,{name:"checkout-payment-methods-title",slot:r==null?void 0:r.Title,children:n("h2",{children:V.Title})})},[t,r==null?void 0:r.Title,V.Title]);return n(me,{UIComponentType:d,initialized:m,isLoading:m&&B,options:j,paymentMethodContent:R,selection:c,title:Z,visible:o,onChange:A})};export{Ie as PaymentMethods,Ie as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
1
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
3
3
|
|
|
4
4
|
export interface ContentSlotContext {
|
|
@@ -7,18 +7,15 @@ export interface ContentSlotContext {
|
|
|
7
7
|
export interface HandlePlaceOrderContext {
|
|
8
8
|
code: string;
|
|
9
9
|
cartId: string;
|
|
10
|
-
isSubscribedToNewsletter: boolean;
|
|
11
10
|
}
|
|
12
11
|
export interface PlaceOrderProps extends HTMLAttributes<HTMLDivElement> {
|
|
13
12
|
disabled?: boolean;
|
|
13
|
+
active?: boolean;
|
|
14
14
|
handleValidation?: () => boolean;
|
|
15
15
|
handlePlaceOrder: (ctx: HandlePlaceOrderContext) => Promise<void>;
|
|
16
16
|
slots?: {
|
|
17
17
|
Content?: SlotProps<ContentSlotContext>;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export declare const PlaceOrder:
|
|
21
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & PlaceOrderProps): import("preact/compat").JSX.Element;
|
|
22
|
-
displayName: string;
|
|
23
|
-
};
|
|
20
|
+
export declare const PlaceOrder: Container<PlaceOrderProps>;
|
|
24
21
|
//# sourceMappingURL=PlaceOrder.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 './PlaceOrder';
|
|
18
18
|
export { PlaceOrder as default } from './PlaceOrder';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/containers/PlaceOrder.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{s 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{W as M,g as N}from"../chunks/ConditionalWrapper.js";import{g as y}from"../chunks/values.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=M(Q,L),te=({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=N();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{te as PlaceOrder,te as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as
|
|
3
|
+
import{jsx as o,jsxs as l}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as p,Icon as f,Button as h}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{classes as a}from"@dropins/tools/lib.js";/* empty css *//* empty css */import{S as d}from"../chunks/OrderError.js";import{useText as v}from"@dropins/tools/i18n.js";/* empty css */import"../chunks/errors.js";import"@dropins/tools/event-bus.js";import{s as n}from"../chunks/ServerErrorSignal.js";import{useRef as k,useEffect as m}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";function g(t){t.scrollIntoView({behavior:"smooth"}),t.focus()}const C=({className:t,contactSupport:s,errorMessage:e,onClick:i,errorMessageRef:c})=>{const r=v({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"}),u=e!==""?e:r.Title;return o(p,{action:o(h,{className:a(["checkout-server-error__button"]),name:"server-error-button",onClick:i,children:r.Button}),"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:a(["checkout-server-error",t]),"data-testid":"checkout-server-error",heading:u,icon:o(f,{className:a(["checkout-server-error__icon"]),source:d}),message:l("p",{ref:c,"data-testid":"checkout-server-error-message",id:a(["checkout-server-error__message"]),children:[r.Message,o("br",{}),o("span",{children:s??r.ContactSupport})]})})},A=({active:t=!0,onRetry:s,onServerError:e,autoScroll:i=!1})=>{const c=k(null),r=n.value,u=async()=>{s==null||s(),n.value=void 0};return m(()=>{r&&(e==null||e(r))},[r,e]),m(()=>{!i||!r||!c.current||g(c.current)},[r,i]),!t||!r?null:o(C,{errorMessage:r,errorMessageRef:c,onClick:u})};export{A as ServerError,A as default};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { ShippingMethod } from '../../data/models';
|
|
2
|
+
import { UIComponentType } from '../../types/ComponentTypes';
|
|
2
3
|
import { TitleProps } from '../../types/TitleProps';
|
|
3
|
-
import {
|
|
4
|
+
import { Container } from '@dropins/tools/types/elsie/src/lib';
|
|
4
5
|
import { HTMLAttributes } from 'preact/compat';
|
|
5
6
|
|
|
6
7
|
export interface ShippingMethodsProps extends HTMLAttributes<HTMLDivElement>, TitleProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
shippingMethodsSlot?: SlotProps;
|
|
8
|
+
onSelectionChange?: (method: ShippingMethod) => void;
|
|
9
|
+
onSelectionError?: (error: unknown, method: ShippingMethod) => void;
|
|
10
|
+
UIComponentType?: UIComponentType;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
autoSync?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const ShippingMethods:
|
|
15
|
-
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & ShippingMethodsProps): import("preact/compat").JSX.Element;
|
|
16
|
-
displayName: string;
|
|
17
|
-
};
|
|
14
|
+
export declare const ShippingMethods: Container<ShippingMethodsProps>;
|
|
18
15
|
//# sourceMappingURL=ShippingMethods.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ShippingMethod } from '../../../data/models/shipping-method';
|
|
2
2
|
|
|
3
|
-
export declare function emitShippingEstimateEvent(
|
|
3
|
+
export declare function emitShippingEstimateEvent(shippingMethod: ShippingMethod | null): void;
|
|
4
4
|
//# sourceMappingURL=emitShippingEstimateEvent.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 C,jsx as t,Fragment as I}from"@dropins/tools/preact-jsx-runtime.js";import{a as q,h as Y,b as ee}from"../chunks/errors.js";import{classes as w,VComponent as te,Slot as ne}from"@dropins/tools/lib.js";import{events as O}from"@dropins/tools/event-bus.js";import{W as ie,h as V,g as oe}from"../chunks/ConditionalWrapper.js";import{n as re,g as H}from"../chunks/values.js";import{t as se,s as ae}from"../chunks/setShippingMethods.js";/* empty css */import{Skeleton as ce,SkeletonRow as L,IllustratedMessage as pe,Icon as le,ProgressSpinner as ue,RadioButton as de,Price as D,ToggleButton as he}from"@dropins/tools/components.js";import*as p from"@dropins/tools/preact-compat.js";import{useText as F}from"@dropins/tools/i18n.js";import{useState as T,useCallback as S,useEffect as A,useMemo as me}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const ge=i=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},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"})),fe=()=>C(ce,{"data-testid":"shipping-methods-skeleton",children:[t(L,{size:"small",variant:"heading"}),t(L,{size:"small",variant:"empty"}),t(L,{fullWidth:!0,size:"medium"}),t(L,{fullWidth:!0,size:"medium"})]}),ke=({className:i,isLoading:o=!1,onSelectionChange:c=()=>{},options:d,selection:s,title:E,UIComponentType:l="RadioButton",...M})=>{const _=F({EmptyState:"Checkout.ShippingMethods.emptyState"}),b=(n,W)=>{const y={busy:o,key:n.value,className:"checkout-shipping-methods__method",name:"shipping-method",value:n.value,onChange:()=>c(n)};return W==="RadioButton"?t(de,{...y,checked:(s==null?void 0:s.value)===n.value,"data-testid":"shipping-method-radioButton",description:n.title,id:n.value,label:C(I,{children:[t(D,{amount:n.amount.value,currency:n.amount.currency})," ",t("span",{children:n.carrier.title})]})}):t(he,{...y,"data-testid":"shipping-method-toggleButton",label:C(I,{children:[t("span",{children:n.carrier.title}),t(D,{amount:n.amount.value,currency:n.amount.currency})]}),selected:(s==null?void 0:s.value)===n.value})};return C("div",{...M,className:w(["checkout-shipping-methods",i]),"data-testid":"checkout-shipping-methods",children:[E&&t(te,{className:"checkout-shipping-methods__title",node:E}),!o&&d.length===0&&t(pe,{"data-testid":"checkout-shipping-methods-empty",icon:t(le,{source:ge}),message:t("p",{children:_.EmptyState})}),C("div",{className:w(["checkout-shipping-methods__content"]),children:[o&&t(ue,{className:"checkout-shipping-methods__spinner"}),t("div",{className:w(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",o],["checkout-shipping-methods__options--toggleButton",l==="ToggleButton"]]),children:d.map(n=>b(n,l))})]})]})},ve=ie(ke,fe);function P(i){const o=q.peek();if(!(o!=null&&o.address))return;const c={address:o.address,shippingMethod:i?se(i):null};O.emit("shipping/estimate",c)}function Z(i,o){return i?o.some(c=>c.code===i.code):!1}function Se(i,o){return!i||!o?!1:i.code===o.code&&i.carrier.code===o.carrier.code}const Pe=({displayTitle:i=!0,initialData:o,onSelectionChange:c,onSelectionError:d,slots:s,UIComponentType:E="RadioButton",active:l=!0,autoSync:M=!0,..._})=>{const[b,n]=T(!1),[W,y]=T(null),[U,j]=T(),$=Y.value,G=ee.value,J=$||G,x=F({Title:"Checkout.ShippingMethods.title"}),a=S(e=>{y(e),re({selectedShippingMethod:e})},[]),f=S(async(e,r)=>{if(!M||!V())return;const m={method_code:e.code,carrier_code:e.carrier.code};try{await ae([m])}catch(h){a(r??null),d==null||d(h,e)}},[M,d,a]),K=S(async e=>{const r=H("selectedShippingMethod");a(e),c==null||c(e),V()||P(e),await f(e,r)},[c,a,f]),k=S(e=>{var N;const r=!e||e.isEmpty,m=!!(e!=null&&e.isVirtual);if(r||m){n(m),a(null),j([]);return}const h=(N=e.shippingAddresses)==null?void 0:N[0];if(!h)return;const v=h.availableShippingMethods??[];if(j(v),v.length===0){a(null);return}const u=h.selectedShippingMethod??null,g=H("selectedShippingMethod"),B=Z(g,v),X=Se(g,u);if(g&&B&&!X){f(g,u);return}if((!g||!B)&&u){a(u);return}if((!g||!B)&&!u){const R=v[0];a(R),f(R)}},[f,a]),z=S(e=>{if(e===void 0)return;const r=e.options;j(r);const m=r.length>0,h=H("selectedShippingMethod");if(!m){a(null),P(null);return}if(Z(h,r))return;const u=r[0];a(u),P(u)},[a]);A(()=>{if(!l)return;const e=oe();if(e){k(e);return}const r=O.on("checkout/initialized",k,{eager:!0});return()=>{r==null||r.off()}},[l,k]),A(()=>{if(!l)return;const e=O.on("checkout/updated",k,{eager:!1});return()=>{e==null||e.off()}},[l,k]),A(()=>{if(V())return;const e=q.subscribe(z);return()=>{e()}},[z]);const Q=me(()=>{if(i)return t(ne,{name:"checkout-shipping-methods-title",slot:s==null?void 0:s.Title,children:t("h3",{children:x.Title})})},[i,s==null?void 0:s.Title,x.Title]);return t(ve,{..._,UIComponentType:E,initialized:U!==void 0,isLoading:J,options:U??[],selection:W,title:Q,visible:l&&!b,onSelectionChange:K})};export{Pe as ShippingMethods,Pe as default};
|
|
@@ -2,6 +2,7 @@ import { AgreementMode } from '../../data/models';
|
|
|
2
2
|
import { Container, SlotMethod, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
3
|
|
|
4
4
|
export interface TermsAndConditionsProps {
|
|
5
|
+
active?: boolean;
|
|
5
6
|
slots?: {
|
|
6
7
|
Agreements?: SlotProps<{
|
|
7
8
|
appendAgreement: SlotMethod<{
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e,jsxs as
|
|
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 *//* empty css *//* empty css */import{W as E,g as V}from"../chunks/ConditionalWrapper.js";import{A as W}from"../chunks/checkout.js";import{s as j}from"../chunks/errors.js";import{events as y}from"@dropins/tools/event-bus.js";import{useState as g,useEffect as D}from"@dropins/tools/preact-hooks.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=E($,R),ie=({active:n=!0,slots:t,...r})=>{var m;const[s,d]=g(!1),[k,c]=g(""),{errorMessage:_}=H({errorMessage:"Checkout.TermsAndConditions.error"}),i=((m=j.config)==null?void 0:m.agreementsEnabled)===!1,A=()=>{c("")},C=()=>{c(_)};return D(()=>{if(!n||i)return;if(V()){d(!0);return}const o=y.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:h,text:a,translationId:p}=u;if(!a&&!p){console.warn(`The agreement ${h} is misconfigured. Please provide a text or a translationId.`);return}const x=a?e(P,{html:a}):e(L,{id:p}),z=e(b,{checked:T===W.AUTO,label:x,name:h,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{ie as TermsAndConditions,ie as default};
|
package/containers/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ export * from './BillToShippingAddress';
|
|
|
18
18
|
export * from './EstimateShipping';
|
|
19
19
|
export * from './LoginForm';
|
|
20
20
|
export * from './MergedCartBanner';
|
|
21
|
-
export * from './Newsletter';
|
|
22
21
|
export * from './OutOfStock';
|
|
23
22
|
export * from './PaymentMethods';
|
|
24
23
|
export * from './PlaceOrder';
|
package/data/models/country.d.ts
CHANGED
|
@@ -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 type Country = {
|
|
18
18
|
value: string;
|
|
19
19
|
label: string;
|
|
@@ -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 type CustomAttribute = {
|
|
18
18
|
code: string;
|
|
19
19
|
value: string;
|
|
@@ -1,18 +1,18 @@
|
|
|
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 type EmailAvailability = boolean;
|
|
18
18
|
//# sourceMappingURL=email-availability.d.ts.map
|
package/data/models/index.d.ts
CHANGED
|
@@ -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 type PaymentMethod = {
|
|
18
18
|
code: string;
|
|
19
19
|
title: string;
|
package/data/models/price.d.ts
CHANGED
|
@@ -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 type Price = {
|
|
18
18
|
value: number;
|
|
19
19
|
currency: string;
|
|
@@ -14,4 +14,8 @@ export interface ShippingEstimateShippingMethod {
|
|
|
14
14
|
amountExclTax?: Price;
|
|
15
15
|
amountInclTax?: Price;
|
|
16
16
|
}
|
|
17
|
+
export interface ShippingEstimate {
|
|
18
|
+
address: ShippingEstimatePartialAddress;
|
|
19
|
+
shippingMethod: ShippingEstimateShippingMethod | null;
|
|
20
|
+
}
|
|
17
21
|
//# sourceMappingURL=shipping-estimate.d.ts.map
|
|
@@ -21,10 +21,7 @@ export declare enum TaxDisplay {
|
|
|
21
21
|
}
|
|
22
22
|
export interface StoreConfig {
|
|
23
23
|
defaultCountry: string;
|
|
24
|
-
|
|
25
|
-
isGuestCheckoutEnabled: boolean;
|
|
26
|
-
isOnePageCheckoutEnabled: boolean;
|
|
27
|
-
newsletterEnabled: boolean;
|
|
24
|
+
agreementsEnabled: boolean;
|
|
28
25
|
shoppingCartDisplaySetting: {
|
|
29
26
|
shipping: TaxDisplay;
|
|
30
27
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Address, PaymentMethod, ShippingMethod } from '.';
|
|
2
|
+
|
|
3
|
+
export interface ValuesModel {
|
|
4
|
+
billingAddress: Address | null;
|
|
5
|
+
email: string;
|
|
6
|
+
isBillToShipping: boolean;
|
|
7
|
+
selectedPaymentMethod: PaymentMethod | null;
|
|
8
|
+
selectedShippingMethod: ShippingMethod | null;
|
|
9
|
+
shippingAddress: Address | null;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=values.d.ts.map
|
|
@@ -10,6 +10,6 @@ type SelectedShippingMethod = ShippingAddress['selected_shipping_method'];
|
|
|
10
10
|
export declare const isNullish: (value: any) => boolean;
|
|
11
11
|
export declare const transformSelectedShippingMethod: (data: SelectedShippingMethod) => ShippingMethod | undefined;
|
|
12
12
|
export declare const transformAvailableShippingMethod: (data: AvailableShippingMethod) => ShippingMethod | undefined;
|
|
13
|
-
export declare const transformShippingMethods: (data: AvailableShippingMethods) => ShippingMethod[]
|
|
13
|
+
export declare const transformShippingMethods: (data: AvailableShippingMethods) => ShippingMethod[];
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=transform-shipping-methods.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -38,9 +38,6 @@ declare const _default: {
|
|
|
38
38
|
"many": "{{count}} items from a previous session were added to your cart. Please review your new subtotal."
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
"Newsletter": {
|
|
42
|
-
"title": "Sign up to the latest news and events"
|
|
43
|
-
},
|
|
44
41
|
"OutOfStock": {
|
|
45
42
|
"title": "Your cart contains items that are out of stock",
|
|
46
43
|
"message": "The following items are out of stock:",
|
package/lib/dispatchApiCall.d.ts
CHANGED
|
@@ -1,32 +1,16 @@
|
|
|
1
1
|
import { FetchOptions } from '../api';
|
|
2
|
-
import {
|
|
2
|
+
import { QueueName } from './enqueueRequest';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
pending: boolean;
|
|
7
|
-
data?: import('../data/models/cart').Cart | null | undefined;
|
|
8
|
-
}>;
|
|
9
|
-
estimateShippingMethods: import('@preact/signals-core').Signal<{
|
|
10
|
-
pending: boolean;
|
|
11
|
-
data?: import('../data/models/shipping-method').ShippingMethod[] | undefined;
|
|
12
|
-
}>;
|
|
13
|
-
};
|
|
14
|
-
type SignalTypesType = typeof signalTypes;
|
|
15
|
-
type SignalTypesKeys = keyof SignalTypesType;
|
|
16
|
-
type SignalDataMap = {
|
|
17
|
-
[K in SignalTypesKeys]: SignalTypesType[K]['value']['data'];
|
|
18
|
-
};
|
|
19
|
-
type DispatchApiCallParams<T extends SignalTypesKeys> = {
|
|
20
|
-
defaultValueOnFail?: SignalDataMap[T];
|
|
4
|
+
type DispatchApiCallParams<T> = {
|
|
5
|
+
defaultValueOnFail?: T;
|
|
21
6
|
options?: FetchOptions;
|
|
22
7
|
path: string;
|
|
23
8
|
query: string;
|
|
24
|
-
queueName?:
|
|
25
|
-
|
|
26
|
-
transformer?: (data: any) => SignalDataMap[T];
|
|
9
|
+
queueName?: QueueName;
|
|
10
|
+
transformer?: (data: any) => T;
|
|
27
11
|
type: 'query' | 'mutation';
|
|
28
12
|
};
|
|
29
13
|
export declare function getValueAtPath(obj: any, path: string): any;
|
|
30
|
-
declare function dispatchApiCall<T
|
|
14
|
+
declare function dispatchApiCall<T>(params: DispatchApiCallParams<T>): Promise<T>;
|
|
31
15
|
export { dispatchApiCall };
|
|
32
16
|
//# sourceMappingURL=dispatchApiCall.d.ts.map
|