@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.
Files changed (145) hide show
  1. package/api/estimateShippingMethods/graphql/index.d.ts +15 -15
  2. package/api/estimateShippingMethods/index.d.ts +15 -15
  3. package/api/fetch-graphql/fetch-graphql.d.ts +19 -19
  4. package/api/fetch-graphql/index.d.ts +15 -15
  5. package/api/getCart/getCart.d.ts +1 -1
  6. package/api/getCart/graphql/index.d.ts +15 -15
  7. package/api/getCart/index.d.ts +15 -15
  8. package/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts +1 -1
  9. package/api/getCustomer/graphql/index.d.ts +15 -15
  10. package/api/getCustomer/index.d.ts +15 -15
  11. package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +1 -1
  12. package/api/getStoreConfig/index.d.ts +15 -15
  13. package/api/initialize/index.d.ts +15 -15
  14. package/api/initializeCheckout/index.d.ts +15 -15
  15. package/api/initializeCheckout/initializeCheckout.d.ts +1 -1
  16. package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +15 -15
  17. package/api/isEmailAvailable/index.d.ts +15 -15
  18. package/api/setBillingAddress/index.d.ts +15 -15
  19. package/api/setBillingAddress/setBillingAddress.d.ts +1 -1
  20. package/api/setGuestEmailOnCart/index.d.ts +15 -15
  21. package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +1 -1
  22. package/api/setPaymentMethod/index.d.ts +15 -15
  23. package/api/setPaymentMethod/setPaymentMethod.d.ts +1 -1
  24. package/api/setShippingAddress/index.d.ts +15 -15
  25. package/api/setShippingAddress/setShippingAddress.d.ts +1 -1
  26. package/api/setShippingMethods/index.d.ts +15 -15
  27. package/api/setShippingMethods/setShippingMethods.d.ts +1 -1
  28. package/api/synchronizeCheckout/synchronizeCheckout.d.ts +1 -1
  29. package/api.js +9 -9
  30. package/chunks/ConditionalWrapper.js +3 -0
  31. package/chunks/ServerErrorSignal.js +3 -0
  32. package/chunks/TermsAndConditions.js +2 -2
  33. package/chunks/errors.js +11 -1
  34. package/chunks/setBillingAddress.js +2 -2
  35. package/chunks/setGuestEmailOnCart.js +6 -6
  36. package/chunks/setPaymentMethod.js +2 -2
  37. package/chunks/setShippingMethods.js +3 -3
  38. package/chunks/synchronizeCheckout.js +5 -5
  39. package/chunks/values.js +3 -0
  40. package/components/BillToShippingAddress/BillToShippingAddress.d.ts +2 -1
  41. package/components/BillToShippingAddress/index.d.ts +15 -15
  42. package/components/ConditionalWrapper/ConditionalWrapper.d.ts +8 -0
  43. package/{containers/Newsletter → components/ConditionalWrapper}/index.d.ts +2 -2
  44. package/components/EstimateShipping/EstimateShipping.d.ts +2 -2
  45. package/components/EstimateShipping/index.d.ts +15 -15
  46. package/components/LoginForm/LoginForm.d.ts +2 -2
  47. package/components/OutOfStock/index.d.ts +15 -15
  48. package/components/PaymentMethods/PaymentMethods.d.ts +7 -8
  49. package/components/PlaceOrder/PlaceOrder.d.ts +1 -1
  50. package/components/PlaceOrder/index.d.ts +15 -15
  51. package/components/ServerError/index.d.ts +15 -15
  52. package/components/ShippingMethods/ShippingMethods.d.ts +6 -4
  53. package/components/TermsAndConditions/TermsAndConditions.d.ts +2 -2
  54. package/components/index.d.ts +1 -1
  55. package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +5 -20
  56. package/containers/BillToShippingAddress.js +1 -1
  57. package/containers/EstimateShipping/EstimateShipping.d.ts +5 -2
  58. package/containers/EstimateShipping/index.d.ts +15 -15
  59. package/containers/EstimateShipping.js +1 -1
  60. package/containers/LoginForm/LoginForm.d.ts +4 -5
  61. package/containers/LoginForm.js +1 -1
  62. package/containers/MergedCartBanner/MergedCartBanner.d.ts +5 -4
  63. package/containers/MergedCartBanner.js +1 -1
  64. package/containers/OutOfStock/OutOfStock.d.ts +1 -0
  65. package/containers/OutOfStock/index.d.ts +15 -15
  66. package/containers/OutOfStock.js +1 -1
  67. package/containers/PaymentMethods/PaymentMethods.d.ts +6 -23
  68. package/containers/PaymentMethods.js +1 -1
  69. package/containers/PlaceOrder/PlaceOrder.d.ts +3 -6
  70. package/containers/PlaceOrder/index.d.ts +15 -15
  71. package/containers/PlaceOrder.js +1 -1
  72. package/containers/ServerError/ServerError.d.ts +1 -0
  73. package/containers/ServerError.js +1 -1
  74. package/containers/ShippingMethods/ShippingMethods.d.ts +8 -11
  75. package/containers/ShippingMethods/utils/emitShippingEstimateEvent.d.ts +1 -1
  76. package/containers/ShippingMethods.js +1 -1
  77. package/containers/TermsAndConditions/TermsAndConditions.d.ts +1 -0
  78. package/containers/TermsAndConditions.js +1 -1
  79. package/containers/index.d.ts +0 -1
  80. package/data/models/country.d.ts +15 -15
  81. package/data/models/custom-attribute.d.ts +15 -15
  82. package/data/models/email-availability.d.ts +15 -15
  83. package/data/models/index.d.ts +1 -0
  84. package/data/models/payment-method.d.ts +15 -15
  85. package/data/models/price.d.ts +15 -15
  86. package/data/models/shipping-estimate.d.ts +4 -0
  87. package/data/models/store-config.d.ts +1 -4
  88. package/data/models/values.d.ts +11 -0
  89. package/data/transforms/transform-cart.d.ts +1 -1
  90. package/data/transforms/transform-shipping-methods.d.ts +1 -1
  91. package/i18n/en_US.json.d.ts +0 -3
  92. package/lib/dispatchApiCall.d.ts +6 -22
  93. package/lib/enqueueRequest.d.ts +11 -24
  94. package/lib/events.d.ts +8 -0
  95. package/lib/index.d.ts +3 -2
  96. package/lib/network-error.d.ts +15 -15
  97. package/lib/values.d.ts +17 -0
  98. package/msw/browser.d.ts +15 -15
  99. package/msw/fixtures/fragments/cart.d.ts +15 -15
  100. package/msw/fixtures/index.d.ts +15 -15
  101. package/msw/fixtures/mutations/index.d.ts +15 -15
  102. package/msw/fixtures/queries/index.d.ts +15 -15
  103. package/msw/server.d.ts +15 -15
  104. package/package.json +1 -1
  105. package/render/index.d.ts +15 -15
  106. package/render.js +5 -6
  107. package/signals/ShippingEstimateSignal.d.ts +6 -5
  108. package/signals/index.d.ts +0 -5
  109. package/tests/constants.d.ts +15 -15
  110. package/{api/getCart/fixtures.d.ts → tests/fixtures/cart.d.ts} +3 -3
  111. package/{api/getCustomer/fixtures.d.ts → tests/fixtures/customer.d.ts} +1 -1
  112. package/tests/fixtures/payments.d.ts +8 -0
  113. package/{api/estimateShippingMethods/fixtures.d.ts → tests/fixtures/shipping.d.ts} +1 -1
  114. package/tests/integration/utils/index.d.ts +15 -15
  115. package/tests/integration/utils/setup.d.ts +1 -1
  116. package/tests/integration/utils/user-actions.d.ts +15 -15
  117. package/tests/mocks/svg.d.ts +15 -15
  118. package/tests/utils/expectError.d.ts +15 -15
  119. package/tests/utils/index.d.ts +15 -15
  120. package/tests/utils/mockEvents.d.ts +15 -15
  121. package/chunks/ShippingEstimateSignal.js +0 -14
  122. package/chunks/store-config.js +0 -3
  123. package/chunks/withConditionalRendering.js +0 -3
  124. package/chunks/withSkeleton.js +0 -3
  125. package/components/Newsletter/Newsletter.d.ts +0 -6
  126. package/components/Newsletter/NewsletterSkeleton.d.ts +0 -4
  127. package/components/Newsletter/index.d.ts +0 -20
  128. package/containers/Newsletter/Newsletter.d.ts +0 -9
  129. package/containers/Newsletter.d.ts +0 -3
  130. package/containers/Newsletter.js +0 -3
  131. package/hocs/index.d.ts +0 -19
  132. package/hocs/withConditionalRendering.d.ts +0 -13
  133. package/hocs/withSkeleton.d.ts +0 -8
  134. package/hooks/index.d.ts +0 -19
  135. package/hooks/useBreakpoint/index.d.ts +0 -18
  136. package/hooks/useBreakpoint/useBreakpoint.d.ts +0 -18
  137. package/hooks/useStableList/index.d.ts +0 -2
  138. package/hooks/useStableList/useStableList.d.ts +0 -2
  139. package/lib/debounce.d.ts +0 -30
  140. package/lib/fetch-error.d.ts +0 -23
  141. package/signals/CartSignal.d.ts +0 -7
  142. package/signals/IsBillToShippingSignal.d.ts +0 -18
  143. package/signals/IsSubscribedToNewsletterSignal.d.ts +0 -18
  144. package/signals/SelectedPaymentMethodSignal.d.ts +0 -18
  145. 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 Z}from"../chunks/store-config.js";import{classes as M,VComponent as D,Slot as x}from"@dropins/tools/lib.js";import{c as S,d as u}from"../chunks/ShippingEstimateSignal.js";import"@dropins/tools/event-bus.js";import{s as $}from"../chunks/setPaymentMethod.js";/* empty css */import{Skeleton as q,SkeletonRow as g,IllustratedMessage as F,Icon as V,ProgressSpinner as G,ToggleButton as J,RadioButton as K}from"@dropins/tools/components.js";import{W as Q}from"../chunks/withSkeleton.js";import*as v from"@dropins/tools/preact-compat.js";import{useText as W}from"@dropins/tools/i18n.js";import{w as X}from"../chunks/withConditionalRendering.js";import{useRef as Y,useState as ee,useEffect as L,useCallback as te}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";import"../chunks/errors.js";const ne=r=>v.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},v.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"}),v.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),oe=()=>w(q,{"data-testid":"payment-methods-skeleton",children:[n(g,{size:"medium",variant:"heading"}),n(g,{size:"medium",variant:"empty"}),n(g,{fullWidth:!0,size:"xlarge"}),n(g,{fullWidth:!0,size:"xlarge"})]}),ae=({code:r,icon:s,loading:e,onChange:m,selected:c,title:a,UIComponentType:p="ToggleButton"})=>{const o={busy:e,className:"checkout-payment-methods__method",label:a,name:"payment-method",value:r,onChange:()=>m(r)};return p==="ToggleButton"?n(J,{...o,icon:s?n(V,{source:s}):void 0,selected:c}):n(K,{...o,checked:c,icon:s??void 0})},re=({className:r,title:s,loading:e=!1,onChange:m=()=>{},options:c,paymentMethodContent:a,UIComponentType:p,selection:o})=>{const h=W({EmptyState:"Checkout.PaymentMethods.emptyState"});return w("div",{className:M(["checkout-payment-methods",r]),children:[s&&n(D,{className:"checkout-payment-methods__title",node:s}),!e&&c.length===0&&n(F,{icon:n(V,{source:ne}),message:n("p",{children:h.EmptyState})}),w("div",{className:M(["checkout-payment-methods__wrapper",["checkout-payment-methods__wrapper--loading",e]]),children:[e&&n(G,{className:"checkout-payment-methods__spinner"}),n("div",{className:M(["checkout-payment-methods__methods",["checkout-payment-methods--full-width",c.length%2!==0]]),children:c==null?void 0:c.map(d=>n(ae,{UIComponentType:p,code:d.code,icon:d.icon,selected:d.code===o,title:d.displayLabel??!0?d.title:"",onChange:m},d.code))}),a&&n("div",{className:"checkout-payment-methods__content",children:a})]})]})},ie=Q(re,oe),ce=(r,s)=>{const e=Y(r);return s(e.current,r)||(e.current=r),e.current},N=({displayTitle:r=!0,UIComponentType:s="ToggleButton",slots:e,setOnChange:m={}})=>{var b,_,H,E,I;const[c]=ee(m),a=e==null?void 0:e.Methods;L(()=>{e!=null&&e.Handlers&&console.warn("The `slots.Handlers` prop is deprecated and will be removed in future versions. Use the `Methods` object instead."),m&&console.warn("The `setOnChange` prop is deprecated and will be removed in future versions. Use the `Methods` object instead.")},[]);const p=W({Title:"Checkout.PaymentMethods.title"}),o=S.value.data,h=!!S.value.data,d=S.value.pending,O=(o==null?void 0:o.isVirtual)??!1,j=(b=o==null?void 0:o.shippingAddresses)==null?void 0:b[0],A=(o==null?void 0:o.availablePaymentMethods)||[],y=(_=o==null?void 0:o.selectedPaymentMethod)==null?void 0:_.code,T=O?!0:!!j,l=ce(A.filter(t=>{var i;return((i=a==null?void 0:a[t.code])==null?void 0:i.enabled)!==!1}),(t,i)=>t.length!==i.length?!1:t.every((f,P)=>f.code===i[P].code)),k=te(t=>{var i;u.value=t,!(!t||!T)&&t!==y&&(c[t]===!1||((i=a==null?void 0:a[t])==null?void 0:i.setOnChange)===!1||$({code:t}).catch(console.error))},[T,a,y,c]);L(()=>{if(!h||!!!(l!=null&&l.length))return;const i=l[0].code,f=y||u.value,P=f?l.some(R=>R.code===f):!1;k(P?f:i)},[l,h,k,y]);const U=t=>{k(t)},C=u.value?((E=(H=e==null?void 0:e.Methods)==null?void 0:H[u.value])==null?void 0:E.render)||((I=e==null?void 0:e.Handlers)==null?void 0:I[u.value]):null,z=C?n(x,{context:{cartId:Z.cartId||"",replaceHTML(t){this.replaceWith(t)}},name:"PaymentMethodContent",slot:C},C):void 0,B=l.map(t=>{const i=(a==null?void 0:a[t.code])||{};return{...t,...i}});return n(ie,{UIComponentType:s,initialized:h,loading:h&&d,options:B,paymentMethodContent:z,selection:u.value,title:r?n(x,{name:"checkout-payment-methods-title",slot:e==null?void 0:e.Title,children:n("h2",{children:p.Title})}):void 0,onChange:U})};N.displayName="PaymentMethodsContainer";const Te=X(N);export{Te as PaymentMethods,Te as default};
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
@@ -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 v}from"../chunks/store-config.js";import{classes as g,Slot as x}from"@dropins/tools/lib.js";import{c as y,b as E,d as l,i as P}from"../chunks/ShippingEstimateSignal.js";import{events as w}from"@dropins/tools/event-bus.js";import{U as N}from"../chunks/errors.js";/* empty css */import{Button as T}from"@dropins/tools/components.js";import{w as I}from"../chunks/withConditionalRendering.js";import{useState as U,useCallback as u,useEffect as z}from"@dropins/tools/preact-hooks.js";import{useText as D,Text as H}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";const _=({children:c,className:r,disabled:a=!1,onClick:t})=>o("div",{className:g(["checkout-place-order",r]),children:o(T,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:a,size:"medium",type:"submit",variant:"primary",onClick:t,children:c},"placeOrder")}),d=({disabled:c=!1,handleValidation:r,handlePlaceOrder:a,slots:t,...f})=>{const[p,C]=U(!1),{data:O,pending:k}=y.value,S=!!O,s=D({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),i=u(e=>{E.value=e instanceof TypeError||e instanceof N?s.CheckoutUnexpectedError:e.message},[s]),b=u(async()=>{try{if(!(r?r():!0))return;await a({cartId:v.cartId||"",code:l.value||"",isSubscribedToNewsletter:P.value||!1})}catch(e){i(e)}},[r,a,i]);return z(()=>{const e=w.on("cart/initialized",n=>{const h=(n==null?void 0:n.items)||[];C(h.some(m=>m.outOfStock||m.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[]),o(_,{...f,disabled:c||!S||k||p,onClick:b,children:t!=null&&t.Content?o(x,{context:{code:l.value||""},name:"Content",slot:t.Content}):o(H,{id:"Checkout.PlaceOrder.button"})})};d.displayName="PlaceOrderContainer";const W=I(d);export{W as PlaceOrder,W as default};
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};
@@ -4,6 +4,7 @@ export interface ServerErrorProps {
4
4
  autoScroll?: boolean;
5
5
  onRetry?: () => void;
6
6
  onServerError?: (error: string) => void;
7
+ active?: boolean;
7
8
  }
8
9
  export declare const ServerError: Container<ServerErrorProps>;
9
10
  //# sourceMappingURL=ServerError.d.ts.map
@@ -1,3 +1,3 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as s,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as l,Button as p,Icon as f}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{classes as a}from"@dropins/tools/lib.js";/* empty css *//* empty css *//* empty css */import{S as h}from"../chunks/OrderError.js";import{useText as d}from"@dropins/tools/i18n.js";/* empty css */import"../chunks/store-config.js";import{b as u}from"../chunks/ShippingEstimateSignal.js";import"@dropins/tools/event-bus.js";import{useRef as v,useEffect as m}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";function g(e){e.scrollIntoView({behavior:"smooth"}),e.focus()}const k=({className:e,contactSupport:t,errorMessage:i,onClick:c,errorMessageRef:r})=>{const o=d({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return s(l,{action:s(p,{className:a(["checkout-server-error__button"]),onClick:c,children:o.Button}),"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:a(["checkout-server-error",e]),"data-testid":"checkout-server-error",heading:i??o.Title,icon:s(f,{className:a(["checkout-server-error__icon"]),source:h}),message:n("p",{ref:r,"data-testid":"checkout-server-error-message",id:a(["checkout-server-error__message"]),children:[o.Message,s("br",{}),s("span",{children:t??o.ContactSupport})]})})},A=({onRetry:e,onServerError:t,autoScroll:i=!1})=>{const c=v(null),r=u.value,o=async()=>{e==null||e(),u.value=void 0};return m(()=>{r&&(t==null||t(r))},[r,t]),m(()=>{!i||!r||!c.current||g(c.current)},[r,i]),r?s(k,{errorMessage:r,errorMessageRef:c,onClick:o}):null};export{A as ServerError,A as default};
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 { SlotProps } from '@dropins/tools/types/elsie/src/lib';
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
- onShippingMethodSelect?: (method: ShippingMethod) => void;
8
- preSelectedMethod?: {
9
- carrierCode: string;
10
- methodCode: string;
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(method: ShippingMethod): void;
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 f,jsx as o,Fragment as x}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/store-config.js";import{classes as E,VComponent as O,Slot as w}from"@dropins/tools/lib.js";import{c as H,s as b,a as L}from"../chunks/ShippingEstimateSignal.js";import{events as N}from"@dropins/tools/event-bus.js";import{t as P,s as V}from"../chunks/setShippingMethods.js";/* empty css */import{Skeleton as B,SkeletonRow as v,IllustratedMessage as D,Icon as I,ProgressSpinner as Z,RadioButton as q,Price as F}from"@dropins/tools/components.js";import{W as $}from"../chunks/withSkeleton.js";import*as a from"@dropins/tools/preact-compat.js";import{useText as y}from"@dropins/tools/i18n.js";import{w as A}from"../chunks/withConditionalRendering.js";import{useMemo as T,useCallback as G,useEffect as J}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";import"../chunks/errors.js";const K=n=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},a.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"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.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"}),a.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"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Q=()=>f(B,{"data-testid":"shipping-methods-skeleton",children:[o(v,{size:"small",variant:"heading"}),o(v,{size:"small",variant:"empty"}),o(v,{fullWidth:!0,size:"medium"}),o(v,{fullWidth:!0,size:"medium"})]}),U=({className:n,isLoading:t=!1,onSelectionChange:r=()=>{},options:h,selection:m,title:i,...c})=>{const l=y({EmptyState:"Checkout.ShippingMethods.emptyState"});return f("div",{...c,className:E(["checkout-shipping-methods",n]),children:[i&&o(O,{className:"checkout-shipping-methods__title",node:i}),!t&&h.length===0&&o(D,{icon:o(I,{source:K}),message:o("p",{children:l.EmptyState})}),f("div",{className:E(["checkout-shipping-methods__content"]),children:[t&&o(Z,{className:"checkout-shipping-methods__spinner"}),o("div",{className:E(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:h.map(e=>o(q,{"aria-busy":t,checked:(m==null?void 0:m.value)===e.value,className:"checkout-shipping-methods__method","data-testid":"shipping-method-radiobutton",description:e.title,id:e.value,label:f(x,{children:[o(F,{amount:e.amount.value,currency:e.amount.currency})," ",o("span",{children:e.carrier.title})]}),name:"shipping-method",value:e.value,onChange:()=>r(e)},e.value))})]})]})},X=$(U,Q);function Y(n){const t=N.lastPayload("shipping/estimate");if(!(t!=null&&t.address))return;const r={address:t.address,shippingMethod:P(n)};N.emit("shipping/estimate",r)}function _(n,t){return n.code===t.code&&n.carrier.code===t.carrier.code}function tt({preSelectedMethod:n,onShippingMethodSelect:t}){const r=H.value.data,h=H.value.pending,m=b.value.data,i=b.value.pending,c=L.value,l=r==null?void 0:r.shippingAddresses,e=l==null?void 0:l[0],k=!!e,C=e==null?void 0:e.availableShippingMethods,d=e==null?void 0:e.selectedShippingMethod,s=C||m,W=G(p=>{if(!k)return;const g={method_code:p.code,carrier_code:p.carrier.code};V([g]).catch(j=>{console.error("Setting shipping methods on cart failed:",j)})},[k]),R=p=>{L.value=p,t==null||t(p),k||Y(p)},u=T(()=>{if(!(s!=null&&s.length))return;const p=s[0],g=c||d;return g?s.some(M=>_(M,g))?g:p:s.find(S=>S.carrier.code===(n==null?void 0:n.carrierCode)&&S.code===(n==null?void 0:n.methodCode))||p},[c,d,s,n]);return J(()=>{u&&((!c||!_(u,c))&&(L.value=u,t==null||t(u)),(!d||!_(u,d))&&W(u))},[u,c,d,W,t]),{isLoading:h||i,options:s,selection:u,onSelectionChange:R}}const z=({displayTitle:n=!0,preSelectedMethod:t,shippingMethodsSlot:r,onShippingMethodSelect:h,initialData:m,slots:i,...c})=>{const l=y({Title:"Checkout.ShippingMethods.title"}),{isLoading:e,options:k,selection:C,onSelectionChange:d}=tt({preSelectedMethod:t,onShippingMethodSelect:h}),s=T(()=>{if(n)return o(w,{name:"checkout-shipping-methods-title",slot:i==null?void 0:i.Title,children:o("h3",{children:l.Title})})},[n,i==null?void 0:i.Title,l.Title]);return f(x,{children:[o(X,{...c,initialized:k!==void 0,isLoading:e,options:k??[],selection:C,title:s,onSelectionChange:d}),!e&&r&&o(w,{name:"ShippingMethods",slot:r})]})};z.displayName="ShippingMethodsContainer";const vt=A(z);export{vt as ShippingMethods,vt as default};
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 S}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as b,SkeletonRow as I,Checkbox as z}from"@dropins/tools/components.js";import{p as E}from"../chunks/TermsAndConditions.js";import{classes as p,VComponent as N,Slot as w}from"@dropins/tools/lib.js";/* empty css *//* empty css *//* empty css *//* empty css */import{W}from"../chunks/withSkeleton.js";import{A as j}from"../chunks/checkout.js";import{s as y}from"../chunks/store-config.js";import"../chunks/ShippingEstimateSignal.js";import{events as D}from"@dropins/tools/event-bus.js";import{useState as d,useCallback as f,useEffect as H}from"@dropins/tools/preact-hooks.js";import{useText as P,MarkupText as R}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";const V=({html:t})=>{const n=E.sanitize(t,{ADD_ATTR:["target"]});return n===""?null:e("span",{dangerouslySetInnerHTML:{__html:n}})},$=()=>e(b,{className:"checkout-terms-and-conditions-skeleton","data-testid":"checkout-terms-and-conditions-skeleton",children:e(I,{fullWidth:!0,size:"small",variant:"row"})}),q=({className:t,agreements:n,error:r,...i})=>e("div",{className:"checkout-terms-and-conditions","data-testid":"checkout-terms-and-conditions",children:S("form",{...i,noValidate:!0,className:p(["checkout-terms-and-conditions__form",t]),"data-testid":"checkout-terms-and-conditions-form",name:"checkout-terms-and-conditions__form",children:[n&&e(N,{className:p(["checkout-terms-and-conditions__agreements"]),"data-testid":"checkout-terms-and-conditions-agreements",node:n}),r&&e("div",{className:"checkout-terms-and-conditions__error","data-testid":"checkout-terms-and-conditions-error",children:r})]})}),L=W(q,$),ae=({slots:t,...n})=>{const[r,i]=d(!0),[k,g]=d(!1),[A,c]=d(""),{errorMessage:m}=P({errorMessage:"Checkout.TermsAndConditions.error"}),_=f(()=>{c("")},[]),C=f(()=>{c(m)},[m]);return H(()=>{const o=D.on("checkout/initialized",()=>{var s;g(!0),i(((s=y.config)==null?void 0:s.isCheckoutAgreementsEnabled)??!0)},{eager:!0});return()=>{o==null||o.off()}},[]),r?e(L,{...n,agreements:e(w,{context:{appendAgreement(o){this._registerMethod((...s)=>{const l=o(...s);if(!l)return;const{mode:T,name:u,text:a,translationId:h}=l;if(!a&&!h){console.warn(`The agreement ${u} is misconfigured. Please provide a text or a translationId.`);return}const x=a?e(V,{html:a}):e(R,{id:h}),v=e(z,{checked:T===j.AUTO,label:x,name:u,required:!0,onChange:_,onInvalid:C});this._setProps(M=>({children:[...M.children||[],v]}))})}},name:"Agreements",slot:t==null?void 0:t.Agreements}),error:A,initialized:k}):null};export{ae as TermsAndConditions,ae as default};
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};
@@ -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';
@@ -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
@@ -28,4 +28,5 @@ export * from './region';
28
28
  export * from './shipping-estimate';
29
29
  export * from './shipping-method';
30
30
  export * from './store-config';
31
+ export * from './values';
31
32
  //# sourceMappingURL=index.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 type PaymentMethod = {
18
18
  code: string;
19
19
  title: 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 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
- isCheckoutAgreementsEnabled: boolean;
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
@@ -1,5 +1,5 @@
1
- import { Cart as CartModel } from '../models';
2
1
  import { GetCartQuery } from '../../__generated__/types';
2
+ import { Cart as CartModel } from '../models';
3
3
 
4
4
  type Cart = GetCartQuery['cart'];
5
5
  declare const transformCart: (data: Cart) => CartModel | undefined;
@@ -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[] | undefined;
13
+ export declare const transformShippingMethods: (data: AvailableShippingMethods) => ShippingMethod[];
14
14
  export {};
15
15
  //# sourceMappingURL=transform-shipping-methods.d.ts.map
@@ -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:",
@@ -1,32 +1,16 @@
1
1
  import { FetchOptions } from '../api';
2
- import { QueueNames } from './enqueueRequest';
2
+ import { QueueName } from './enqueueRequest';
3
3
 
4
- declare const signalTypes: {
5
- cart: import('@preact/signals-core').Signal<{
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?: QueueNames;
25
- signalType: T;
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 extends SignalTypesKeys>(params: DispatchApiCallParams<T>): Promise<SignalDataMap[T]>;
14
+ declare function dispatchApiCall<T>(params: DispatchApiCallParams<T>): Promise<T>;
31
15
  export { dispatchApiCall };
32
16
  //# sourceMappingURL=dispatchApiCall.d.ts.map