@dropins/storefront-order 1.2.1 → 1.3.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{c as ne,r as se}from"./chunks/requestGuestOrderCancel.js";import{s as M,f as m,h as T}from"./chunks/fetch-graphql.js";import{g as ie,r as ue,a as de,b as le}from"./chunks/fetch-graphql.js";import{g as Ee}from"./chunks/getAttributesForm.js";import{g as me,a as Te,r as Re}from"./chunks/requestGuestReturn.js";import{g as ge,a as he}from"./chunks/getGuestOrder.js";import{g as De}from"./chunks/getCustomerOrdersReturn.js";import{a as G}from"./chunks/initialize.js";import{c as Me,g as Ge,d as Ce,i as Ne}from"./chunks/initialize.js";import{g as xe}from"./chunks/getStoreConfig.js";import{h as R}from"./chunks/network-error.js";import{events as d}from"@dropins/tools/event-bus.js";import{ADDRESS_FRAGMENT as C,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as N,GIFT_CARD_DETAILS_FRAGMENT as y,ORDER_ITEM_DETAILS_FRAGMENT as x,ORDER_SUMMARY_FRAGMENT as F,PRICE_DETAILS_FRAGMENT as P,PRODUCT_DETAILS_FRAGMENT as I,ORDER_ITEM_FRAGMENT as b,GIFT_WRAPPING_FRAGMENT as S,GIFT_MESSAGE_FRAGMENT as v,APPLIED_GIFT_CARDS_FRAGMENT as L}from"./fragments.js";import{verifyReCaptcha as $}from"@dropins/tools/recaptcha.js";import{c as Pe,a as Ie,r as be}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const A=(t,r)=>t+r.amount.value,w=(t,r)=>({id:t,totalQuantity:r.totalQuantity,possibleOnepageCheckout:!0,items:r.items.map(e=>{var a,o,n,s,c,i,u,l;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:(a=e.product)==null?void 0:a.canonicalUrl,mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((c=e.product)==null?void 0:c.sku)??"",topLevelSku:(i=e.product)==null?void 0:i.sku},prices:{price:{value:e.price.value,currency:e.price.currency,regularPrice:((u=e.regularPrice)==null?void 0:u.value)??e.price.value}},configurableOptions:((l=e.selectedOptions)==null?void 0:l.map(p=>({optionLabel:p.label,valueLabel:p.value})))||[]}}),prices:{subtotalExcludingTax:{value:r.subtotalExclTax.value,currency:r.subtotalExclTax.currency},subtotalIncludingTax:{value:r.subtotalInclTax.value,currency:r.subtotalInclTax.currency}},discountAmount:r.discounts.reduce(A,0)}),k=t=>{var a,o,n;const r=t.coupons[0],e=(a=t.payments)==null?void 0:a[0];return{appliedCouponCode:(r==null?void 0:r.code)??"",email:t.email,grandTotal:t.grandTotal.value,orderId:t.number,orderType:"checkout",otherTax:0,salesTax:t.totalTax.value,shipping:{shippingMethod:((o=t.shipping)==null?void 0:o.code)??"",shippingAmount:((n=t.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:t.subtotalExclTax.value,subtotalIncludingTax:t.subtotalInclTax.value,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:t.grandTotal.value,orderId:t.number}]:[],discountAmount:t.discounts.reduce(A,0),taxAmount:t.totalTax.value}},g=t=>{var e,a;const r=(a=(e=t==null?void 0:t.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return r?G(r):null},E={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},U={PLACE_ORDER:"place-order"};function h(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function _(t,r){const e=h();e.push({[t]:null}),e.push({[t]:r})}function Q(t){h().push(e=>{const a=e.getState?e.getState():{};e.push({event:t,eventInfo:{...a}})})}function O(t,r){const e=k(r),a=w(t,r);_(E.ORDER_CONTEXT,{...e}),_(E.SHOPPING_CART_CONTEXT,{...a}),Q(U.PLACE_ORDER)}class H extends Error{constructor(r){super(r),this.name="PlaceOrderError"}}const D=t=>{const r=t.map(e=>e.message).join(" ");throw new H(r)},f=`
3
+ import{c as ce,r as ie}from"./chunks/requestGuestOrderCancel.js";import{s as f,f as m,h as T}from"./chunks/fetch-graphql.js";import{g as de,r as le,a as pe,b as Ee}from"./chunks/fetch-graphql.js";import{g as me}from"./chunks/getAttributesForm.js";import{g as Re,a as Ae,r as he}from"./chunks/requestGuestReturn.js";import{g as Oe,a as Ce}from"./chunks/getGuestOrder.js";import{g as fe}from"./chunks/getCustomerOrdersReturn.js";import{a as M}from"./chunks/initialize.js";import{c as Ne,g as Ge,d as xe,i as ye}from"./chunks/initialize.js";import{g as Fe}from"./chunks/getStoreConfig.js";import{h as R}from"./chunks/network-error.js";import{events as d}from"@dropins/tools/event-bus.js";import{ADDRESS_FRAGMENT as N,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as G,GIFT_CARD_DETAILS_FRAGMENT as x,ORDER_ITEM_DETAILS_FRAGMENT as y,ORDER_SUMMARY_FRAGMENT as b,PRICE_DETAILS_FRAGMENT as F,PRODUCT_DETAILS_FRAGMENT as P,ORDER_ITEM_FRAGMENT as I,GIFT_WRAPPING_FRAGMENT as L,GIFT_MESSAGE_FRAGMENT as S,APPLIED_GIFT_CARDS_FRAGMENT as v}from"./fragments.js";import{verifyReCaptcha as $}from"@dropins/tools/recaptcha.js";import{c as Ie,a as Le,r as Se}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const A=(t,r)=>t+r.amount.value,w=(t,r)=>({id:t,totalQuantity:r.totalQuantity,possibleOnepageCheckout:!0,items:r.items.map(e=>{var a,o,n,s,c,i,u,E;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:(a=e.product)==null?void 0:a.canonicalUrl,mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((c=e.product)==null?void 0:c.sku)??"",topLevelSku:(i=e.product)==null?void 0:i.sku},prices:{price:{value:e.price.value,currency:e.price.currency,regularPrice:((u=e.regularPrice)==null?void 0:u.value)??e.price.value}},configurableOptions:((E=e.selectedOptions)==null?void 0:E.map(_=>({optionLabel:_.label,valueLabel:_.value})))||[]}}),prices:{subtotalExcludingTax:{value:r.subtotalExclTax.value,currency:r.subtotalExclTax.currency},subtotalIncludingTax:{value:r.subtotalInclTax.value,currency:r.subtotalInclTax.currency}},discountAmount:r.discounts.reduce(A,0)}),k=t=>{var a,o,n;const r=t.coupons[0],e=(a=t.payments)==null?void 0:a[0];return{appliedCouponCode:(r==null?void 0:r.code)??"",email:t.email,grandTotal:t.grandTotal.value,orderId:t.number,orderType:"checkout",otherTax:0,salesTax:t.totalTax.value,shipping:{shippingMethod:((o=t.shipping)==null?void 0:o.code)??"",shippingAmount:((n=t.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:t.subtotalExclTax.value,subtotalIncludingTax:t.subtotalInclTax.value,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:t.grandTotal.value,orderId:t.number}]:[],discountAmount:t.discounts.reduce(A,0),taxAmount:t.totalTax.value}},h=t=>{var e,a;const r=(a=(e=t==null?void 0:t.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return r?M(r):null},l={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext",CHANNEL_CONTEXT:"channelContext"},U={PLACE_ORDER:"place-order"};function g(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function p(t,r){const e=g();e.push({[t]:null}),e.push({[t]:r})}function H(t){g().push(e=>{const a=e.getState?e.getState():{};e.push({event:t,eventInfo:{...a}})})}function Q(){return{_id:"https://ns.adobe.com/xdm/channels/web",_type:"https://ns.adobe.com/xdm/channel-types/web"}}function X(){p(l.CHANNEL_CONTEXT,Q())}function O(t,r){const e=k(r),a=w(t,r);p(l.ORDER_CONTEXT,{...e}),p(l.SHOPPING_CART_CONTEXT,{...a}),X(),H(U.PLACE_ORDER)}class q extends Error{constructor(r){super(r),this.name="PlaceOrderError"}}const C=t=>{const r=t.map(e=>e.message).join(" ");throw new q(r)},D=`
4
4
  fragment PLACE_ORDER_FRAGMENT on CustomerOrder {
5
5
  printed_card_included
6
6
  gift_receipt_included
@@ -71,18 +71,18 @@ import{c as ne,r as se}from"./chunks/requestGuestOrderCancel.js";import{s as M,f
71
71
  }
72
72
  }
73
73
 
74
- ${C}
75
74
  ${N}
76
- ${y}
75
+ ${G}
77
76
  ${x}
77
+ ${y}
78
+ ${b}
78
79
  ${F}
79
80
  ${P}
80
81
  ${I}
81
- ${b}
82
+ ${L}
82
83
  ${S}
83
84
  ${v}
84
- ${L}
85
- `,X=`
85
+ `,B=`
86
86
  mutation PLACE_ORDER_MUTATION($cartId: String!) {
87
87
  placeOrder(input: { cart_id: $cartId }) {
88
88
  errors {
@@ -95,8 +95,8 @@ import{c as ne,r as se}from"./chunks/requestGuestOrderCancel.js";import{s as M,f
95
95
  }
96
96
  }
97
97
 
98
- ${f}
99
- `,q=async()=>{const t=await $();t&&M("X-ReCaptcha",t)},te=async t=>{if(!t)throw new Error("No cart ID found");return await q(),m(X,{method:"POST",variables:{cartId:t}}).then(r=>{var a,o,n,s,c;(a=r.errors)!=null&&a.length&&T(r.errors),(s=(n=(o=r.data)==null?void 0:o.placeOrder)==null?void 0:n.errors)!=null&&s.length&&D((c=r.data.placeOrder)==null?void 0:c.errors);const e=g(r);return e&&(d.emit("order/placed",e),d.emit("cart/reset",void 0),O(t,e)),e}).catch(R)},B=`
98
+ ${D}
99
+ `,V=async()=>{const t=await $();t&&f("X-ReCaptcha",t)},ae=async t=>{if(!t)throw new Error("No cart ID found");return await V(),m(B,{method:"POST",variables:{cartId:t}}).then(r=>{var a,o,n,s,c;(a=r.errors)!=null&&a.length&&T(r.errors),(s=(n=(o=r.data)==null?void 0:o.placeOrder)==null?void 0:n.errors)!=null&&s.length&&C((c=r.data.placeOrder)==null?void 0:c.errors);const e=h(r);return e&&(d.emit("order/placed",e),d.emit("cart/reset",void 0),O(t,e)),e}).catch(R)},Y=`
100
100
  mutation setPaymentMethodAndPlaceOrder($cartId: String!, $paymentMethod: PaymentMethodInput!) {
101
101
  setPaymentMethodOnCart(
102
102
  input: {
@@ -122,5 +122,5 @@ import{c as ne,r as se}from"./chunks/requestGuestOrderCancel.js";import{s as M,f
122
122
  }
123
123
  }
124
124
 
125
- ${f}
126
- `,re=async(t,r)=>{if(!t)throw new Error("No cart ID found");if(!r)throw new Error("No payment method found");return m(B,{variables:{cartId:t,paymentMethod:r}}).then(e=>{var o,n,s,c,i,u;(o=e.errors)!=null&&o.length&&T(e.errors),(c=(s=(n=e.data)==null?void 0:n.placeOrder)==null?void 0:s.errors)!=null&&c.length&&D((i=e.data.placeOrder)==null?void 0:i.errors);const a=g({data:{placeOrder:(u=e.data)==null?void 0:u.placeOrder}});return a&&(d.emit("order/placed",a),d.emit("cart/reset",void 0),O(t,a)),a}).catch(R)};export{ne as cancelOrder,Me as config,Pe as confirmCancelOrder,Ie as confirmGuestReturn,m as fetchGraphQl,Ee as getAttributesForm,me as getAttributesList,ie as getConfig,ge as getCustomer,De as getCustomerOrdersReturn,he as getGuestOrder,Ge as getOrderDetailsById,xe as getStoreConfig,Ce as guestOrderByToken,Ne as initialize,te as placeOrder,ue as removeFetchGraphQlHeader,be as reorderItems,se as requestGuestOrderCancel,Te as requestGuestReturn,Re as requestReturn,de as setEndpoint,M as setFetchGraphQlHeader,le as setFetchGraphQlHeaders,re as setPaymentMethodAndPlaceOrder};
125
+ ${D}
126
+ `,oe=async(t,r)=>{if(!t)throw new Error("No cart ID found");if(!r)throw new Error("No payment method found");return m(Y,{variables:{cartId:t,paymentMethod:r}}).then(e=>{var o,n,s,c,i,u;(o=e.errors)!=null&&o.length&&T(e.errors),(c=(s=(n=e.data)==null?void 0:n.placeOrder)==null?void 0:s.errors)!=null&&c.length&&C((i=e.data.placeOrder)==null?void 0:i.errors);const a=h({data:{placeOrder:(u=e.data)==null?void 0:u.placeOrder}});return a&&(d.emit("order/placed",a),d.emit("cart/reset",void 0),O(t,a)),a}).catch(R)};export{ce as cancelOrder,Ne as config,Ie as confirmCancelOrder,Le as confirmGuestReturn,m as fetchGraphQl,me as getAttributesForm,Re as getAttributesList,de as getConfig,Oe as getCustomer,fe as getCustomerOrdersReturn,Ce as getGuestOrder,Ge as getOrderDetailsById,Fe as getStoreConfig,xe as guestOrderByToken,ye as initialize,ae as placeOrder,le as removeFetchGraphQlHeader,Se as reorderItems,ie as requestGuestOrderCancel,Ae as requestGuestReturn,he as requestReturn,pe as setEndpoint,f as setFetchGraphQlHeader,Ee as setFetchGraphQlHeaders,oe as setPaymentMethodAndPlaceOrder};
@@ -1,3 +1,3 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as i,jsxs as b,Fragment as u}from"@dropins/tools/preact-jsx-runtime.js";import{Price as B,Image as K,CartItem as Q,Icon as R,Incrementer as G}from"@dropins/tools/components.js";import{useCallback as H}from"@dropins/tools/preact-hooks.js";import{Slot as M,classes as Z}from"@dropins/tools/lib.js";import{O as J}from"./OrderLoaders.js";import*as S from"@dropins/tools/preact-compat.js";const U=l=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),ae=({slots:l,placeholderImage:T="",loading:$,product:e,itemType:j,taxConfig:q,translations:x,disabledIncrementer:W,onQuantity:v,showConfigurableOptions:E,routeProductDetails:P})=>{var _,D,f,L,V;const{taxExcluded:d,taxIncluded:k}=q,t=H((n,s,r)=>i(B,{amount:n,currency:s,weight:"normal",...r}),[]),N=H(n=>{var o,F;const s=(n==null?void 0:n.productName)??"",r={title:s,src:((F=(o=n==null?void 0:n.product)==null?void 0:o.thumbnail)==null?void 0:F.url)??T,alt:s,width:90,height:120,loading:"lazy"};return i(M,{slotTag:"span",contentTag:"span","data-testid":`cartSummaryItemImage-${n.id}`,name:"CartSummaryItemImage",slot:l==null?void 0:l.CartSummaryItemImage,context:{data:n,defaultImageProps:r},children:i(K,{...r})})},[T,l==null?void 0:l.CartSummaryItemImage]);if(!e)return i(J,{});let y={};const w=j==="cancelled",z=(D=(_=e==null?void 0:e.product)==null?void 0:_.stockStatus)==null?void 0:D.includes("IN_STOCK"),a=e==null?void 0:e.giftCard,A=e.totalQuantity>1?{quantity:e.totalQuantity}:{},I=e.discounted,{includeAndExcludeTax:c,includeTax:h,excludeTax:m}=e.taxCalculations,g=e==null?void 0:e.totalQuantity,O={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.senderEmail?{[x.sender]:a==null?void 0:a.senderEmail}:{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.recipientEmail?{[x.recipient]:a==null?void 0:a.recipientEmail}:{},...a!=null&&a.message?{[x.message]:a==null?void 0:a.message}:{},...e!=null&&e.downloadableLinks?{[`${(f=e==null?void 0:e.downloadableLinks)==null?void 0:f.count} ${x.downloadableCount}`]:(L=e==null?void 0:e.downloadableLinks)==null?void 0:L.result}:{}};if(k&&d){const n=t(c.originalPrice.value,c.originalPrice.currency),s=t(c.baseOriginalPrice.value*g,c.baseOriginalPrice.currency,{variant:e.discounted?"strikethrough":"default",weight:"bold"}),r=t(c.baseDiscountedPrice.value*g,c.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(c.baseExcludingTax.value*g,c.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:!0,taxIncluded:void 0,price:n,total:b(u,{children:[s,e.discounted?r:null]}),totalExcludingTax:o}}else if(!k&&d){const n=t(m.originalPrice.value,m.originalPrice.currency),s=t(m.baseOriginalPrice.value*g,m.baseOriginalPrice.currency,{variant:I?"strikethrough":"default",weight:"bold"}),r=t(m.baseDiscountedPrice.value*g,m.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(m.baseExcludingTax.value*g,m.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:void 0,taxIncluded:void 0,price:n,total:b(u,{children:[s,I?r:null]}),totalExcludingTax:o}}else if(k&&!d){const n=t(h.singleItemPrice.value,h.singleItemPrice.currency),s=t(h.baseOriginalPrice.value*g,h.baseOriginalPrice.currency,{variant:I?"strikethrough":"default",weight:"bold"}),r=t(h.baseDiscountedPrice.value*g,h.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});y={taxExcluded:void 0,taxIncluded:!0,price:n,total:b(u,{children:[s,I?r:null]})}}return i(Q,{loading:$,alert:w&&!z?b("span",{children:[i(R,{source:U}),x.outOfStock]}):i(u,{}),configurations:(E==null?void 0:E(O))??O,title:P?i("a",{"data-testid":"product-name",className:Z(["cart-summary-item__title",["cart-summary-item__title--strikethrough",w]]),href:P(e),children:e==null?void 0:e.productName}):i("div",{"data-testid":"product-name",className:Z(["cart-summary-item__title",["cart-summary-item__title--strikethrough",w]]),children:e==null?void 0:e.productName}),sku:i("div",{children:(V=e==null?void 0:e.product)==null?void 0:V.sku}),...A,image:P?i("a",{href:P(e),children:N(e)}):N(e),...y,footer:b(u,{children:[v&&!W?i(G,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:n=>v==null?void 0:v(Number(n)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0,i(M,{"data-testid":"Footer",name:"Footer",slot:l==null?void 0:l.Footer,context:{item:e}})]})})};export{ae as C,U as S};
3
+ import{jsx as i,jsxs as b,Fragment as v}from"@dropins/tools/preact-jsx-runtime.js";import{Price as A,Image as B,CartItem as K,Icon as Q,Incrementer as R}from"@dropins/tools/components.js";import{useCallback as F}from"@dropins/tools/preact-hooks.js";import{Slot as H}from"@dropins/tools/lib.js";import{O as G}from"./OrderLoaders.js";import*as w from"@dropins/tools/preact-compat.js";const J=l=>w.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},w.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),w.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),ee=({slots:l,placeholderImage:S="",loading:M,product:e,itemType:Z,taxConfig:$,translations:x,disabledIncrementer:j,onQuantity:P,showConfigurableOptions:E,routeProductDetails:I})=>{var O,D,f,L,V;const{taxExcluded:d,taxIncluded:k}=$,t=F((n,c,s)=>i(A,{amount:n,currency:c,weight:"normal",...s}),[]),T=F(n=>{var o,_;const c=(n==null?void 0:n.productName)??"",s={title:c,src:((_=(o=n==null?void 0:n.product)==null?void 0:o.thumbnail)==null?void 0:_.url)??S,alt:c,width:90,height:120,loading:"lazy"};return i(H,{slotTag:"span",contentTag:"span","data-testid":`cartSummaryItemImage-${n.id}`,name:"CartSummaryItemImage",slot:l==null?void 0:l.CartSummaryItemImage,context:{data:n,defaultImageProps:s},children:i(B,{...s})})},[S,l==null?void 0:l.CartSummaryItemImage]);if(!e)return i(G,{});let u={};const q=Z==="cancelled",W=(D=(O=e==null?void 0:e.product)==null?void 0:O.stockStatus)==null?void 0:D.includes("IN_STOCK"),a=e==null?void 0:e.giftCard,z=e.totalQuantity>1?{quantity:e.totalQuantity}:{},y=e.discounted,{includeAndExcludeTax:r,includeTax:h,excludeTax:m}=e.taxCalculations,g=e==null?void 0:e.totalQuantity,N={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.senderEmail?{[x.sender]:a==null?void 0:a.senderEmail}:{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.recipientEmail?{[x.recipient]:a==null?void 0:a.recipientEmail}:{},...a!=null&&a.message?{[x.message]:a==null?void 0:a.message}:{},...e!=null&&e.downloadableLinks?{[`${(f=e==null?void 0:e.downloadableLinks)==null?void 0:f.count} ${x.downloadableCount}`]:(L=e==null?void 0:e.downloadableLinks)==null?void 0:L.result}:{}};if(k&&d){const n=t(r.originalPrice.value,r.originalPrice.currency),c=t(r.baseOriginalPrice.value*g,r.baseOriginalPrice.currency,{variant:e.discounted?"strikethrough":"default",weight:"bold"}),s=t(r.baseDiscountedPrice.value*g,r.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(r.baseExcludingTax.value*g,r.baseExcludingTax.currency,{weight:"bold"});u={taxExcluded:!0,taxIncluded:void 0,price:n,total:b(v,{children:[c,e.discounted?s:null]}),totalExcludingTax:o}}else if(!k&&d){const n=t(m.originalPrice.value,m.originalPrice.currency),c=t(m.baseOriginalPrice.value*g,m.baseOriginalPrice.currency,{variant:y?"strikethrough":"default",weight:"bold"}),s=t(m.baseDiscountedPrice.value*g,m.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(m.baseExcludingTax.value*g,m.baseExcludingTax.currency,{weight:"bold"});u={taxExcluded:void 0,taxIncluded:void 0,price:n,total:b(v,{children:[c,y?s:null]}),totalExcludingTax:o}}else if(k&&!d){const n=t(h.singleItemPrice.value,h.singleItemPrice.currency),c=t(h.baseOriginalPrice.value*g,h.baseOriginalPrice.currency,{variant:y?"strikethrough":"default",weight:"bold"}),s=t(h.baseDiscountedPrice.value*g,h.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});u={taxExcluded:void 0,taxIncluded:!0,price:n,total:b(v,{children:[c,y?s:null]})}}return i(K,{loading:M,alert:q&&!W?b("span",{children:[i(Q,{source:J}),x.outOfStock]}):i(v,{}),configurations:(E==null?void 0:E(N))??N,title:I?i("a",{"data-testid":"product-name",className:"cart-summary-item__title",href:I(e),children:e==null?void 0:e.productName}):i("div",{"data-testid":"product-name",className:"cart-summary-item__title",children:e==null?void 0:e.productName}),sku:i("div",{children:(V=e==null?void 0:e.product)==null?void 0:V.sku}),...z,image:I?i("a",{href:I(e),children:T(e)}):T(e),...u,footer:b(v,{children:[P&&!j?i(R,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:n=>P==null?void 0:P(Number(n)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0,i(H,{"data-testid":"Footer",name:"Footer",slot:l==null?void 0:l.Footer,context:{item:e}})]})})};export{ee as C,J as S};
package/lib/acdl.d.ts CHANGED
@@ -6,6 +6,7 @@ import { OrderDataModel } from '../data/models';
6
6
  export declare const contexts: {
7
7
  SHOPPING_CART_CONTEXT: string;
8
8
  ORDER_CONTEXT: string;
9
+ CHANNEL_CONTEXT: string;
9
10
  };
10
11
  /**
11
12
  * See: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/events.ts
@@ -14,5 +15,6 @@ export declare const events: {
14
15
  PLACE_ORDER: string;
15
16
  };
16
17
  export declare function getAdobeDataLayer(): any;
18
+ export declare function setChannelContext(): void;
17
19
  export declare function publishPlaceOrderEvent(cartId: string, data: OrderDataModel): void;
18
20
  //# sourceMappingURL=acdl.d.ts.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-order", "version": "1.2.1", "@dropins/tools": "~1.2.0", "license": "SEE LICENSE IN LICENSE.md"}
1
+ {"name": "@dropins/storefront-order", "version": "1.3.0-beta1", "@dropins/tools": "~1.2.0", "license": "SEE LICENSE IN LICENSE.md"}