@dropins/storefront-checkout 0.1.0-alpha49 → 0.1.0-alpha50
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/errors/errors.d.ts +3 -0
- package/api/estimateShippingMethods/estimateShippingMethods.d.ts +1 -1
- package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +16 -16
- package/api/getCart/graphql/getCart.graphql.d.ts +16 -16
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +16 -16
- package/api/index.d.ts +0 -3
- package/api/initialize/initialize.d.ts +6 -1
- package/api/initializeCheckout/initializeCheckout.d.ts +3 -17
- package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +15 -15
- package/api/setBillingAddress/setBillingAddress.d.ts +2 -11
- package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +15 -15
- package/api/setShippingAddress/setShippingAddress.d.ts +3 -45
- package/api/utils/dispatchApiCall.d.ts +0 -16
- package/api.js +37 -1
- package/chunks/Heading.js +1 -0
- package/chunks/classes.js +1 -0
- package/chunks/fetch-graphql.js +10 -0
- package/chunks/getCart.graphql.js +7 -4
- package/chunks/getCustomer.js +2 -2
- package/chunks/placeOrder2.js +131 -0
- package/chunks/resetCustomer.js +1 -36
- package/chunks/setBillingAddress.js +5 -7
- package/chunks/setGuestEmailOnCart.js +3 -3
- package/chunks/setPaymentMethod.js +2 -2
- package/chunks/setShippingMethods.js +2 -2
- package/chunks/store-config.js +1 -0
- package/chunks/withConditionalRendering.js +1 -1
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +3 -3
- package/components/LoginForm/Email.d.ts +8 -8
- package/components/LoginForm/LoginForm.d.ts +14 -10
- package/components/LoginForm/SignIn.d.ts +3 -4
- package/components/LoginForm/SignOut.d.ts +3 -3
- package/components/PaymentMethods/PaymentMethods.d.ts +4 -3
- package/components/index.d.ts +0 -2
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +18 -6
- package/containers/BillToShippingAddress/index.d.ts +15 -16
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/ErrorBanner/ErrorBanner.d.ts +2 -2
- package/containers/ErrorBanner.js +1 -1
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm/LoginForm.d.ts +2 -3
- package/containers/LoginForm/index.d.ts +15 -16
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +2 -2
- package/containers/MergedCartBanner.js +1 -1
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +1 -5
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +15 -15
- package/containers/ShippingMethods.js +1 -1
- package/containers/index.d.ts +0 -2
- package/data/models/address.d.ts +11 -15
- package/data/models/api.d.ts +29 -0
- package/data/models/cart.d.ts +9 -5
- package/data/models/customer.d.ts +3 -14
- package/data/models/index.d.ts +19 -17
- package/data/models/region.d.ts +15 -15
- package/data/models/store-config.d.ts +0 -3
- package/data/transforms/index.d.ts +16 -18
- package/data/transforms/transform-address.d.ts +7 -5
- package/hocs/index.d.ts +16 -15
- package/hooks/index.d.ts +16 -16
- package/hooks/useStableList/index.d.ts +2 -0
- package/hooks/useStableList/useStableList.d.ts +2 -0
- package/i18n/en_US.json.d.ts +0 -18
- package/lib/index.d.ts +16 -15
- package/lib/validation.d.ts +5 -0
- package/msw/fixtures/fragments/cart.d.ts +3 -0
- package/msw/fixtures/fragments/index.d.ts +15 -18
- package/msw/fixtures/queries/index.d.ts +0 -3
- package/package.json +1 -1
- package/render.js +4 -4
- package/signals/IsBillToShippingSignal.d.ts +16 -20
- package/signals/index.d.ts +0 -3
- package/utils/index.d.ts +0 -6
- package/utils/refetchEstimatedShippingMethods/refetchEstimatedShippingMethods.d.ts +1 -0
- package/__generated__/types.d.ts +0 -15365
- package/api/fetchAddressFormFields/fetchAddressFormFields.d.ts +0 -18
- package/api/fetchAddressFormFields/fixtures.d.ts +0 -5
- package/api/fetchAddressFormFields/graphql/fetchAddressFormFields.graphql.d.ts +0 -18
- package/api/fetchAddressFormFields/index.d.ts +0 -19
- package/api/getCountries/fixtures.d.ts +0 -6
- package/api/getCountries/getCountries.d.ts +0 -18
- package/api/getCountries/graphql/getCountries.graphql.d.ts +0 -18
- package/api/getCountries/index.d.ts +0 -18
- package/api/getRegions/fixtures.d.ts +0 -5
- package/api/getRegions/getRegions.d.ts +0 -5
- package/api/getRegions/graphql/getRegions.graphql.d.ts +0 -18
- package/api/getRegions/index.d.ts +0 -18
- package/chunks/BillToShippingAddress.js +0 -1
- package/chunks/ShippingMethods.js +0 -1
- package/chunks/fixtures.js +0 -15
- package/chunks/getMultilineValues.js +0 -43
- package/chunks/placeOrder.js +0 -131
- package/chunks/setShippingAddress.js +0 -16
- package/chunks/transform-shipping-methods.js +0 -1
- package/components/AddressForm/AddressForm.d.ts +0 -22
- package/components/AddressForm/constants.d.ts +0 -20
- package/components/AddressForm/index.d.ts +0 -23
- package/components/AddressForm/useAddressBackup.d.ts +0 -8
- package/components/AddressForm/useAddressForm.d.ts +0 -39
- package/components/AddressForm/useCheckoutAddressEventEmitter.d.ts +0 -10
- package/components/AddressForm/usePreselectedFields.d.ts +0 -9
- package/components/AddressForm/utils.d.ts +0 -13
- package/components/FieldsForm/FieldsForm.d.ts +0 -13
- package/components/FieldsForm/FieldsFormSkeleton.d.ts +0 -4
- package/components/FieldsForm/fieldFactory.d.ts +0 -9
- package/components/FieldsForm/fixtures.d.ts +0 -5
- package/components/FieldsForm/index.d.ts +0 -22
- package/components/FieldsForm/validation.d.ts +0 -18
- package/containers/BillToShippingAddress/constants.d.ts +0 -18
- package/containers/BillingForm/BillingForm.d.ts +0 -9
- package/containers/BillingForm/constants.d.ts +0 -18
- package/containers/BillingForm/index.d.ts +0 -20
- package/containers/BillingForm.d.ts +0 -3
- package/containers/BillingForm.js +0 -1
- package/containers/LoginForm/constants.d.ts +0 -18
- package/containers/ShippingForm/ShippingForm.d.ts +0 -12
- package/containers/ShippingForm/constants.d.ts +0 -18
- package/containers/ShippingForm/index.d.ts +0 -20
- package/containers/ShippingForm.d.ts +0 -3
- package/containers/ShippingForm.js +0 -1
- package/data/models/address-form-fields.d.ts +0 -52
- package/data/transforms/transform-address-form-fields.d.ts +0 -66
- package/data/transforms/transform-countries.d.ts +0 -5
- package/data/transforms/transform-regions.d.ts +0 -8
- package/hooks/useValidity/index.d.ts +0 -18
- package/hooks/useValidity/useValidity.d.ts +0 -35
- package/msw/fixtures/fragments/american-regions.d.ts +0 -4
- package/msw/fixtures/fragments/countries.d.ts +0 -4
- package/msw/fixtures/fragments/form-fields.d.ts +0 -4
- package/msw/fixtures/queries/fetch-address-form-fields.d.ts +0 -4
- package/msw/fixtures/queries/get-countries.d.ts +0 -4
- package/msw/fixtures/queries/get-regions.d.ts +0 -4
- package/signals/AddressFormFieldsSignal.d.ts +0 -7
- package/signals/CountryListSignal.d.ts +0 -7
- package/signals/RegionsSignal.d.ts +0 -12
- package/utils/autocompleteFieldCodes/autocompleteFieldCodes.d.ts +0 -34
- package/utils/autocompleteFieldCodes/index.d.ts +0 -18
- package/utils/getMultilineValues/getMultilineValues.d.ts +0 -19
- package/utils/getMultilineValues/index.d.ts +0 -18
- package/utils/parseRegionId/index.d.ts +0 -18
- package/utils/parseRegionId/parseRegionId.d.ts +0 -18
- package/utils/processFormFields/index.d.ts +0 -18
- package/utils/processFormFields/processFormFields.d.ts +0 -21
- package/utils/scrollToElement/index.d.ts +0 -18
- package/utils/scrollToElement/scrollToElement.d.ts +0 -18
- package/utils/validateForms/index.d.ts +0 -18
- package/utils/validateForms/validateForms.d.ts +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as
|
|
1
|
+
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as u,Icon as g}from"@dropins/tools/components.js";import{c as p}from"../chunks/classes.js";import{events as I}from"@dropins/tools/event-bus.js";import*as i from"@dropins/tools/preact-compat.js";import{useState as h,useEffect as v}from"@dropins/tools/preact-compat.js";import{useText as B,Text as M}from"@dropins/tools/i18n.js";const w=t=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),b=({className:t,initialData:x,...c})=>{const[r,s]=h(0),a=B({mergedCartBannerItems:e(M,{id:"Checkout.MergedCartBanner.items",fields:{count:r},plural:r})});v(()=>{const n=I.on("cart/merged",o=>{var m;const l=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((d,f)=>d+f.quantity,0);l>0&&s(l)});return()=>{n==null||n.off()}},[]);const C=()=>{s(0)};return r?e(u,{...c,"aria-label":a.mergedCartBannerItems,className:p(["checkout__banner",t]),"data-testid":"merged-cart-banner",icon:e(g,{source:w}),message:e("span",{children:a.mergedCartBannerItems}),onDismiss:C,variant:"neutral"}):null};export{b as MergedCartBanner,b as default};
|
package/containers/OutOfStock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js"
|
|
1
|
+
import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Card as k,Icon as l,Image as h}from"@dropins/tools/components.js";/* empty css */import{classes as O}from"@dropins/tools/lib.js";import{S as d}from"../chunks/OrderError.js";import{useText as S}from"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";/* empty css */import{events as p}from"@dropins/tools/event-bus.js";import{useState as v,useCallback as _,useEffect as g}from"@dropins/tools/preact-compat.js";const N=({className:i,items:r,onRemoveOutOfStock:o,routeCart:a,...m})=>{const s=S({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return n(k,{className:O(["checkout-out-of-stock",i]),"data-testid":"checkout-out-of-stock",variant:"secondary",...m,children:[n("h4",{className:"checkout-out-of-stock__title",children:[e(l,{source:d,size:"16",stroke:"1"}),s.title]}),e("p",{className:"checkout-out-of-stock__message",children:s.message}),e("ol",{className:"checkout-out-of-stock__items",children:r.map(u=>e("li",{"data-testid":"out-of-stock-item",className:"checkout-out-of-stock__item",children:e(h,{loading:"eager",src:u.image.src,alt:u.image.alt,width:"100",height:"100",params:{width:100}})},u.sku))}),n("div",{className:"checkout-out-of-stock__actions",children:[a&&e("a",{"data-testid":"review-cart",className:"checkout-out-of-stock__action",href:a,children:s.reviewCart}),o&&e("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:o,children:s.removeOutOfStock})]})]})},z=({onCartProductsUpdate:i,routeCart:r})=>{const[o,a]=v([]),m=t=>t.outOfStock||t.insufficientQuantity,s=_(()=>{if(!i)return;const t=o.filter(c=>c.outOfStock).map(c=>({uid:c.uid,quantity:0}));i(t)},[o,i]);if(g(()=>{const t=p.on("cart/data",c=>{const f=(c==null?void 0:c.items)||[];a(f.filter(m))},{eager:!0});return()=>{t==null||t.off()}},[]),o.length===0)return null;const u=!o.some(t=>t.insufficientQuantity);return e(N,{items:o,onRemoveOutOfStock:u?s:void 0,routeCart:r==null?void 0:r()})};export{z as OutOfStock,z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as M,Fragment as R}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{c as C}from"../chunks/store-config.js";import{s as D}from"../chunks/fetch-graphql.js";import{s as $}from"../chunks/setPaymentMethod.js";/* empty css */import{IllustratedMessage as B,Icon as U,ProgressSpinner as Z,ToggleButton as F,Skeleton as q,SkeletonRow as y}from"@dropins/tools/components.js";/* empty css */import{classes as H,Slot as L}from"@dropins/tools/lib.js";import{H as G}from"../chunks/Heading.js";import{useRef as J}from"@dropins/tools/preact-hooks.js";/* empty css */import*as g from"@dropins/tools/preact-compat.js";import{useState as S,useCallback as T,useEffect as w}from"@dropins/tools/preact-compat.js";import{useText as K}from"@dropins/tools/i18n.js";import{w as Q}from"../chunks/withConditionalRendering.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";const X=e=>g.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Y=({code:e,loading:a,selected:r,onChange:d,title:h})=>n(F,{className:"checkout-payment-methods__method",label:h,name:"payment-method",value:e,selected:r,onChange:d,busy:a}),ee=({className:e,paymentMethodContent:a,loading:r=!1,initializing:d=!1,onChange:h=()=>{},options:s,selection:k})=>{const o=K({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return d?n(te,{}):M("div",{className:H(["checkout-payment-methods",e]),children:[n(G,{level:2,className:"checkout-payment-methods__title",children:o.Title}),!r&&s.length===0&&n(B,{icon:n(U,{source:X}),message:n("p",{children:o.EmptyState})}),M("div",{className:H(["checkout-payment-methods__wrapper"]),children:[r&&n(Z,{className:"checkout-payment-methods__spinner"}),n("div",{className:H(["checkout-payment-methods__methods",["checkout-payment-methods--loading",r],["checkout-payment-methods--full-width",s.length%2!==0]]),children:s==null?void 0:s.map(i=>n(Y,{code:i.code,onChange:h,selected:i.code===k,title:i.title},i.code))}),a&&n("div",{className:"checkout-payment-methods__content",children:a})]})]})},te=()=>M(q,{"data-testid":"payment-methods-skeleton",children:[n(y,{variant:"heading",size:"medium"}),n(y,{variant:"empty",size:"medium"}),n(y,{size:"xlarge",fullWidth:!0}),n(y,{size:"xlarge",fullWidth:!0})]}),N={free:e=>{const a=document.createElement("div");a.innerText="",e.replaceHTML(a)},checkmo:e=>{const a=document.createElement("div");a.innerText="",e.replaceHTML(a)}},ne=(e,a)=>{const r=J(e);return a(r.current,e)||(r.current=e),r.current},V=({slots:e})=>{var x,_;const[a,r]=S(),[d,h]=S(N),[s,k]=S(!0),o=C.value.data,i=!!C.value.data,W=C.value.pending,j=(o==null?void 0:o.isVirtual)??!1,z=(x=o==null?void 0:o.shippingAddresses)==null?void 0:x[0],A=(o==null?void 0:o.availablePaymentMethods)||[],l=(_=o==null?void 0:o.selectedPaymentMethod)==null?void 0:_.code,E=j?!0:!!z,m=ne(A,(t,c)=>t.length!==c.length?!1:t.every((p,v)=>p.code===c[v].code)),u=T(t=>{r(t),!(!t||!E)&&t!==l&&$(t).catch(console.error)},[E,l]);w(()=>{if(!i)return;if(!!!(m!=null&&m.length)){u(void 0);return}const c=m[0].code;if(!l){u(c);return}const p=m.some(v=>v.code===l);u(p?l:c)},[m,i,l,u]);const I=t=>{u(t)},b=T((t,c)=>{if(!t){console.warn("Payment method handler is ignored because it has no code");return}if(!c){console.warn("Payment method handler is ignored because it is empty");return}h(p=>({...p,[t]:c}))},[]);w(()=>{e!=null&&e.Handlers&&Object.entries(e.Handlers).forEach(([t,c])=>{b(t,c)})},[b,e==null?void 0:e.Handlers]);const f=e!=null&&e.Main?n(L,{name:"PaymentMethods",slot:e==null?void 0:e.Main,context:{replaceHTML(t){this.replaceWith(t),k(!1)}}}):null,P=a?d[a]:null,O=P?n(L,{name:"PaymentMethodContent",slot:P,context:{cartId:D.cartId||"",replaceHTML(t){this.replaceWith(t)}}},P):void 0;return w(()=>{!s&&d!=N&&console.warn("Payment method handlers you have added are ignored because the default content has been replaced")},[s,d]),M(R,{children:[f&&n(f.type,{ref:f.ref,...f.props}),s&&n(ee,{initializing:i===!1,loading:i&&W,onChange:I,options:m,paymentMethodContent:O,selection:a})]})};V.displayName="PaymentMethodsContainer";const ve=Q(V);export{ve as PaymentMethods,ve as default};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
2
|
|
|
3
|
-
export declare enum CheckoutForms {
|
|
4
|
-
BILLING = "billing_address",
|
|
5
|
-
LOGIN = "login-form",
|
|
6
|
-
SHIPPING = "shipping_address"
|
|
7
|
-
}
|
|
8
3
|
export interface PlaceOrderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
handleValidation?: () => boolean;
|
|
9
5
|
onPlaceOrder?: (ctx: PlaceOrderContext) => Promise<void>;
|
|
10
6
|
}
|
|
11
7
|
export interface PlaceOrderContext {
|
package/containers/PlaceOrder.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{events as x}from"@dropins/tools/event-bus.js";import{c as E,b as g}from"../chunks/store-config.js";import{U as P}from"../chunks/fetch-graphql.js";import{p as b}from"../chunks/placeOrder2.js";import{classes as l}from"@dropins/tools/lib.js";/* empty css */import{Button as v}from"@dropins/tools/components.js";import{Text as S,useText as U}from"@dropins/tools/i18n.js";import{w}from"../chunks/withConditionalRendering.js";import{useState as T,useCallback as p,useEffect as z}from"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const H=({className:e,onClick:t,disabled:n=!1})=>s("div",{className:l(["checkout-place-order",e]),children:s(v,{className:l(["checkout-place-order__button",e]),"data-testid":"place-order-button",disabled:n,onClick:t,size:"medium",type:"submit",variant:"primary",children:s(S,{id:"Checkout.PlaceOrder.button"})},"placeOrder")}),I=e=>e instanceof TypeError||e instanceof P,f=({handleValidation:e,onPlaceOrder:t})=>{var d;const[n,h]=T(!1),{data:c,pending:O}=E.value,k=!!c,a=((d=c==null?void 0:c.selectedPaymentMethod)==null?void 0:d.code)||"",i=U({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),m=p(r=>{const o=I(r)?i.CheckoutUnexpectedError:r.message;g.value=o},[i]),C=p(async()=>{try{if(!(e?e():!0))return;t?await t({code:a}):await b()}catch(r){m(r)}},[e,t,a,m]);return z(()=>{const r=x.on("cart/initialized",o=>{const y=(o==null?void 0:o.items)||[];h(y.some(u=>u.outOfStock||u.insufficientQuantity))},{eager:!0});return()=>{r==null||r.off()}},[]),s(H,{onClick:C,disabled:!k||O||n})};f.displayName="PlaceOrderContainer";const G=w(f);export{G as PlaceOrder,G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{
|
|
1
|
+
import{jsx as t,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{b as i}from"../chunks/store-config.js";import"../chunks/fetch-graphql.js";import{g as u}from"../chunks/getCustomer.js";/* empty css */import{IllustratedMessage as p,Icon as l,Button as d}from"@dropins/tools/components.js";/* empty css */import{classes as s}from"@dropins/tools/lib.js";import{useEffect as h}from"@dropins/tools/preact-hooks.js";/* empty css */import{S as v}from"../chunks/OrderError.js";import{useText as k}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";import"@dropins/tools/preact-compat.js";const f=({className:r,errorMessage:e,contactSupport:a,...c})=>{const{onClick:m}=c,o=k({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return t(p,{"aria-invalid":"true","aria-describedby":"checkout-server-error__message","aria-live":"polite",className:s(["checkout-server-error",r]),"data-testid":"checkout-server-error",heading:e??o.Title,message:n("p",{id:s(["checkout-server-error__message"]),children:[o.Message,t("br",{}),t("span",{children:a??o.ContactSupport})]}),icon:t(l,{className:s(["checkout-server-error__icon"]),source:v}),action:t(d,{className:s(["checkout-server-error__button"]),onClick:m,children:o.Button})})},O=({onServerError:r})=>{const e=i.value,a=async()=>{await u(),i.value=void 0};return h(()=>{e&&(r==null||r())},[e,r]),e?t(f,{errorMessage:e,onClick:a}):null};export{O as ServerError,O as default};
|
|
@@ -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
|
declare function useShippingEstimateEventEmitter(): void;
|
|
18
18
|
export default useShippingEstimateEventEmitter;
|
|
19
19
|
//# sourceMappingURL=useShippingEstimateEventEmitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as L,Fragment as z}from"@dropins/tools/preact-jsx-runtime.js";import{events as T}from"@dropins/tools/event-bus.js";import{s as v,e as M,c as W,a as V}from"../chunks/store-config.js";import"../chunks/fetch-graphql.js";import{s as A}from"../chunks/setShippingMethods.js";/* empty css */import{IllustratedMessage as O,Icon as P,ProgressSpinner as Z,RadioButton as $,Price as q,Skeleton as F,SkeletonRow as _}from"@dropins/tools/components.js";/* empty css */import{classes as j,Slot as G}from"@dropins/tools/lib.js";import{H as J}from"../chunks/Heading.js";import{useState as I,useEffect as S}from"@dropins/tools/preact-hooks.js";/* empty css */import*as u from"@dropins/tools/preact-compat.js";import{useCallback as K,useMemo as Q,useEffect as X}from"@dropins/tools/preact-compat.js";import{useText as Y}from"@dropins/tools/i18n.js";import{w as D}from"../chunks/withConditionalRendering.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";const U=e=>({countryCode:e.country_id,postCode:e.postcode||"",...e.region_id?{regionId:Number(e.region_id)}:{...e.region?{region:e.region}:{}}}),ee=e=>({carrierCode:e.carrier.code||"",methodCode:e.code||"",amount:e.amount,amountExclTax:e.amountExclTax,amountInclTax:e.amountInclTax}),te=e=>u.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},u.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"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.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"}),u.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"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),ne=({className:e,isLoading:t=!1,onSelectionChange:n=()=>{},options:s,selection:p,...a})=>{const c=Y({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return s===void 0?i(oe,{}):L("div",{...a,className:j(["checkout-shipping-methods",e]),children:[i(J,{level:3,className:"checkout-shipping-methods__title",children:c.Title}),!t&&s.length===0&&i(O,{icon:i(P,{source:te}),message:i("p",{children:c.EmptyState})}),L("div",{className:j(["checkout-shipping-methods__content"]),children:[t&&i(Z,{className:"checkout-shipping-methods__spinner"}),i("div",{className:j(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:s.map(o=>i($,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:o.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:L(z,{children:[i(q,{amount:o.amount.value,currency:o.amount.currency})," ",i("span",{children:o.carrier.title})]}),description:o.title,value:o.value,checked:(p==null?void 0:p.value)===o.value,onChange:()=>n(o)},o.value))})]})]})},oe=()=>L(F,{"data-testid":"shipping-methods-skeleton",children:[i(_,{variant:"heading",size:"small"}),i(_,{variant:"empty",size:"small"}),i(_,{size:"medium",fullWidth:!0}),i(_,{size:"medium",fullWidth:!0})]});function ie(){var C;const[e,t]=I(),[n,s]=I();S(()=>{T.on("checkout/estimate-shipping-address",({address:x,isValid:g})=>{t({address:x,isValid:g})})},[]),S(()=>{s(v.value)},[v.value]),S(()=>{M.value.pending?s(void 0):s(v.value)},[M.value.pending]);const{country_id:p,region_id:a,region:c,postcode:o}=(e==null?void 0:e.address)||{},f=!!e,r=W.value.data,k=!!((C=r==null?void 0:r.shippingAddresses)!=null&&C[0]),l=e==null?void 0:e.isValid;S(()=>{k||l||!n||!f||T.emit("shipping/estimate",{address:U({country_id:p,region_id:a,region:c,postcode:o}),shippingMethod:ee(n)})},[n,p,a,c,o,f,k,l])}const H=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code;function re({onCheckoutDataUpdate:e,preSelectedMethod:t,onShippingMethodSelect:n}){const p=!V.value.data,a=W.value.data,c=W.value.pending,o=M.value.data,f=M.value.pending,r=v.value,k=a==null?void 0:a.shippingAddresses,l=k==null?void 0:k[0],C=!!l,x=l==null?void 0:l.availableShippingMethods,g=l==null?void 0:l.selectedShippingMethod,d=x||o,y=K(h=>{if(!C)return;const E={method_code:h.code,carrier_code:h.carrier.code};A([E]).then(()=>{e==null||e()}).catch(b=>{console.error("setting shipping methods on cart failed:",b)})},[C,e]),R=h=>{v.value=h,n==null||n(h)},m=Q(()=>{if(!(d!=null&&d.length))return;const h=d[0],E=r||g;return E?d.some(w=>H(w,E))?E:h:d.find(N=>N.carrier.code===(t==null?void 0:t.carrierCode)&&N.code===(t==null?void 0:t.methodCode))||h},[r,g,d,t]);return X(()=>{m&&((!r||!H(m,r))&&(v.value=m,n==null||n(m)),(!g||!H(m,g))&&y(m))},[m,r,g,y,n]),{isLoading:c||p||f,options:d,selection:m,onSelectionChange:R}}const B=({preSelectedMethod:e,onCheckoutDataUpdate:t,shippingMethodsSlot:n,onShippingMethodSelect:s,initialData:p,...a})=>{const{isLoading:c,options:o,selection:f,onSelectionChange:r}=re({preSelectedMethod:e,onCheckoutDataUpdate:t,onShippingMethodSelect:s});return ie(),L(z,{children:[i(ne,{...a,isLoading:c,onSelectionChange:r,options:o,selection:f}),!c&&n&&i(G,{name:"ShippingMethods",slot:n})]})};B.displayName="ShippingMethodsContainer";const Me=D(B);export{Me as ShippingMethods,Me as default};
|
package/containers/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export * from './BillingForm';
|
|
18
17
|
export * from './BillToShippingAddress';
|
|
19
18
|
export * from './ErrorBanner';
|
|
20
19
|
export * from './EstimateShipping';
|
|
@@ -24,6 +23,5 @@ export * from './OutOfStock';
|
|
|
24
23
|
export * from './PaymentMethods';
|
|
25
24
|
export * from './PlaceOrder';
|
|
26
25
|
export * from './ServerError';
|
|
27
|
-
export * from './ShippingForm';
|
|
28
26
|
export * from './ShippingMethods';
|
|
29
27
|
//# sourceMappingURL=index.d.ts.map
|
package/data/models/address.d.ts
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { Region, Country,
|
|
1
|
+
import { Region, Country, CustomAttribute } from '.';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface Address {
|
|
4
|
+
id?: number;
|
|
5
|
+
city: string;
|
|
6
|
+
company?: string;
|
|
7
|
+
country: Country;
|
|
8
|
+
customAttributes: CustomAttribute[];
|
|
4
9
|
firstName: string;
|
|
5
10
|
lastName: string;
|
|
6
|
-
company?: string;
|
|
7
|
-
street: string[];
|
|
8
|
-
city: string;
|
|
9
11
|
postCode?: string;
|
|
10
|
-
vatId?: string;
|
|
11
|
-
telephone?: string;
|
|
12
12
|
region?: Region;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
availableShippingMethods?: ShippingMethod[];
|
|
18
|
-
selectedShippingMethod?: ShippingMethod;
|
|
19
|
-
};
|
|
20
|
-
export type BillingAddress = Address;
|
|
13
|
+
street: string[];
|
|
14
|
+
telephone?: string;
|
|
15
|
+
vatId?: string;
|
|
16
|
+
}
|
|
21
17
|
//# sourceMappingURL=address.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CustomAttribute } from './custom-attribute';
|
|
2
|
+
|
|
3
|
+
export interface CartAddress {
|
|
4
|
+
city: string;
|
|
5
|
+
company?: string;
|
|
6
|
+
countryCode: string;
|
|
7
|
+
customAttributes: CustomAttribute[];
|
|
8
|
+
firstName: string;
|
|
9
|
+
lastName: string;
|
|
10
|
+
postcode?: string;
|
|
11
|
+
region?: string;
|
|
12
|
+
regionId?: number;
|
|
13
|
+
saveInAddressBook?: boolean;
|
|
14
|
+
street: string[];
|
|
15
|
+
telephone?: string;
|
|
16
|
+
vatId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ShippingAddressInput {
|
|
19
|
+
address?: CartAddress;
|
|
20
|
+
customerAddressId?: number;
|
|
21
|
+
pickupLocationCode?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BillingAddressInput {
|
|
24
|
+
address?: CartAddress;
|
|
25
|
+
customerAddressId?: number;
|
|
26
|
+
sameAsShipping?: boolean;
|
|
27
|
+
useForShipping?: boolean;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=api.d.ts.map
|
package/data/models/cart.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { PaymentMethod } from '
|
|
2
|
-
import { ShippingAddress, BillingAddress } from './address';
|
|
1
|
+
import { Address, PaymentMethod, ShippingMethod } from '.';
|
|
3
2
|
|
|
4
|
-
export
|
|
3
|
+
export interface ShippingAddress extends Address {
|
|
4
|
+
availableShippingMethods?: ShippingMethod[];
|
|
5
|
+
selectedShippingMethod?: ShippingMethod;
|
|
6
|
+
sameAsBilling?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface Cart {
|
|
5
9
|
availablePaymentMethods?: PaymentMethod[];
|
|
6
|
-
billingAddress?:
|
|
10
|
+
billingAddress?: Address;
|
|
7
11
|
email?: string;
|
|
8
12
|
id: string;
|
|
9
13
|
isEmpty: boolean;
|
|
10
14
|
isVirtual: boolean;
|
|
11
15
|
selectedPaymentMethod?: PaymentMethod;
|
|
12
16
|
shippingAddresses?: ShippingAddress[];
|
|
13
|
-
}
|
|
17
|
+
}
|
|
14
18
|
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Address } from '.';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface CustomerAddress extends Address {
|
|
4
4
|
id: string;
|
|
5
|
-
|
|
6
|
-
lastName: string;
|
|
7
|
-
company?: string;
|
|
8
|
-
street: string[];
|
|
9
|
-
city: string;
|
|
10
|
-
postCode?: string;
|
|
11
|
-
vatId?: string;
|
|
12
|
-
telephone?: string;
|
|
13
|
-
region?: Region;
|
|
14
|
-
country: Country;
|
|
15
|
-
customAttributes: CustomAttribute[];
|
|
16
|
-
};
|
|
5
|
+
}
|
|
17
6
|
export type Customer = {
|
|
18
7
|
firstName: string;
|
|
19
8
|
lastName: string;
|
package/data/models/index.d.ts
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
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 './acdl';
|
|
18
|
-
export * from './address
|
|
18
|
+
export * from './address';
|
|
19
|
+
export * from './api';
|
|
19
20
|
export * from './cart';
|
|
20
21
|
export * from './country';
|
|
21
22
|
export * from './custom-attribute';
|
|
22
23
|
export * from './customer';
|
|
23
24
|
export * from './email-availability';
|
|
25
|
+
export * from './order';
|
|
26
|
+
export * from './payment-method';
|
|
24
27
|
export * from './price';
|
|
25
28
|
export * from './region';
|
|
26
29
|
export * from './shipping-estimate';
|
|
27
30
|
export * from './shipping-method';
|
|
28
31
|
export * from './store-config';
|
|
29
|
-
export * from './order';
|
|
30
32
|
//# sourceMappingURL=index.d.ts.map
|
package/data/models/region.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 Region = {
|
|
18
18
|
code: string;
|
|
19
19
|
id?: number;
|
|
@@ -21,9 +21,6 @@ export declare enum TaxDisplay {
|
|
|
21
21
|
}
|
|
22
22
|
export interface StoreConfig {
|
|
23
23
|
defaultCountry: string;
|
|
24
|
-
countriesWithRequiredRegion: string[];
|
|
25
|
-
displayStateIfOptional: boolean;
|
|
26
|
-
countriesWithOptionalZipCode: string[];
|
|
27
24
|
isGuestCheckoutEnabled: boolean;
|
|
28
25
|
isOnePageCheckoutEnabled: boolean;
|
|
29
26
|
shoppingCartDisplaySetting: {
|
|
@@ -1,27 +1,25 @@
|
|
|
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 './transform-acdl';
|
|
18
|
-
export * from './transform-address
|
|
18
|
+
export * from './transform-address';
|
|
19
19
|
export * from './transform-cart';
|
|
20
|
-
export * from './transform-countries';
|
|
21
20
|
export * from './transform-customer';
|
|
22
21
|
export * from './transform-email-availability';
|
|
23
22
|
export * from './transform-order';
|
|
24
|
-
export * from './transform-regions';
|
|
25
23
|
export * from './transform-shipping-estimate';
|
|
26
24
|
export * from './transform-shipping-methods';
|
|
27
25
|
export * from './transform-store-config';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { GetCartQuery } from '../../__generated__/types';
|
|
2
|
-
import { ShippingAddress as ShippingAddressModel,
|
|
3
|
-
import { CustomAttribute as CustomAttributeModel } from '../models';
|
|
1
|
+
import { CartAddressInput, GetCartQuery } from '../../__generated__/types';
|
|
2
|
+
import { Address as AddressModel, CustomAttribute as CustomAttributeModel, ShippingAddress as ShippingAddressModel, CartAddress as CartAddressModel } from '../models';
|
|
4
3
|
|
|
5
4
|
type ShippingAddresses = NonNullable<GetCartQuery['cart']>['shipping_addresses'];
|
|
6
5
|
type ShippingAddress = ShippingAddresses[0];
|
|
@@ -9,9 +8,10 @@ type BillingAddress = NonNullable<GetCartQuery['cart']>['billing_address'];
|
|
|
9
8
|
type NonNullableBillingAddress = NonNullable<BillingAddress>;
|
|
10
9
|
type CustomAttributes = NonNullableShippingAddress['custom_attributes'] | NonNullableBillingAddress['custom_attributes'];
|
|
11
10
|
export declare const transformCustomAttributes: (data: CustomAttributes) => CustomAttributeModel[];
|
|
12
|
-
declare const transformBillingAddress: (data: BillingAddress) =>
|
|
11
|
+
declare const transformBillingAddress: (data: BillingAddress) => AddressModel | undefined;
|
|
13
12
|
declare const transformShippingAddresses: (data: ({
|
|
14
13
|
__typename?: "ShippingCartAddress" | undefined;
|
|
14
|
+
id?: number | null | undefined;
|
|
15
15
|
firstname: string;
|
|
16
16
|
lastname: string;
|
|
17
17
|
company?: string | null | undefined;
|
|
@@ -20,6 +20,7 @@ declare const transformShippingAddresses: (data: ({
|
|
|
20
20
|
postcode?: string | null | undefined;
|
|
21
21
|
vat_id?: string | null | undefined;
|
|
22
22
|
telephone?: string | null | undefined;
|
|
23
|
+
same_as_billing: boolean;
|
|
23
24
|
region?: {
|
|
24
25
|
__typename?: "CartAddressRegion" | undefined;
|
|
25
26
|
region_id?: number | null | undefined;
|
|
@@ -85,5 +86,6 @@ declare const transformShippingAddresses: (data: ({
|
|
|
85
86
|
};
|
|
86
87
|
} | null | undefined;
|
|
87
88
|
} | null)[]) => ShippingAddressModel[] | undefined;
|
|
88
|
-
|
|
89
|
+
declare const transformCartAddressModelToInput: (address: CartAddressModel) => CartAddressInput;
|
|
90
|
+
export { BillingAddress, ShippingAddress, transformCartAddressModelToInput, transformBillingAddress, transformShippingAddresses, };
|
|
89
91
|
//# sourceMappingURL=transform-address.d.ts.map
|
package/hocs/index.d.ts
CHANGED
|
@@ -1,17 +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
|
+
export * from './withConditionalRendering';
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
package/hooks/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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 './useBreakpoint';
|
|
18
18
|
export * from './useLockScroll';
|
|
19
|
-
export * from './
|
|
19
|
+
export * from './useStableList';
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|