@dropins/storefront-order 0.1.0-alpha10 → 0.1.0-alpha11
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/getOrderDetailsById/graphql/orderItemsFragment.graphql.d.ts +5 -1
- package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +1 -1
- package/api.js +21 -51
- package/chunks/OrderLoaders.js +1 -1
- package/chunks/convertCase.js +1 -0
- package/chunks/fetch-graphql.js +1 -1
- package/chunks/getAttributesForm.js +3 -3
- package/chunks/getCustomer.js +12 -28
- package/chunks/getStoreConfig.js +5 -2
- package/chunks/transform-order-details.js +81 -5
- package/components/OrderCancelReasonsForm/OrderCancelReasonsForm.d.ts +5 -0
- package/components/OrderCancelReasonsForm/index.d.ts +3 -0
- package/components/OrderLoaders/OrderLoaders.d.ts +1 -0
- package/components/OrderProductListContent/CartSummaryItem.d.ts +5 -0
- package/components/OrderProductListContent/OrderProductListContent.d.ts +5 -0
- package/components/OrderProductListContent/index.d.ts +4 -0
- package/components/index.d.ts +2 -1
- package/configs/mock.config.d.ts +468 -0
- package/containers/CustomerDetails.js +1 -1
- package/containers/OrderCancel/OrderCancel.d.ts +5 -0
- package/containers/OrderCancel.d.ts +3 -0
- package/containers/OrderCancel.js +79 -0
- package/containers/OrderProductList/OrderProductList.d.ts +5 -0
- package/containers/OrderProductList/index.d.ts +3 -0
- package/containers/OrderProductList.d.ts +3 -0
- package/containers/OrderProductList.js +1 -0
- package/containers/OrderSearch.js +1 -1
- package/containers/OrderStatus.js +1 -80
- package/containers/ShippingStatus.js +1 -1
- package/containers/index.d.ts +2 -0
- package/data/models/order-details.d.ts +25 -0
- package/data/models/store-config.d.ts +1 -0
- package/data/transforms/transform-order-details.d.ts +9 -0
- package/hooks/containers/useOrderProductList.d.ts +9 -0
- package/hooks/index.d.ts +1 -0
- package/i18n/en_US.json.d.ts +17 -2
- package/lib/setTaxStatus.d.ts +4 -0
- package/package.json +1 -1
- package/render.js +2 -2
- package/types/api/getOrderDetails.types.d.ts +23 -5
- package/types/index.d.ts +1 -0
- package/types/orderCancel.types.d.ts +8 -4
- package/types/orderProductList.types.d.ts +30 -0
- package/components/OrderCancel/OrderCancel.d.ts +0 -5
- /package/chunks/{CustomerDetailsContent.js → OrderCancelReasonsForm.js} +0 -0
- /package/{components → containers}/OrderCancel/index.d.ts +0 -0
|
@@ -1,80 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
mutation CANCEL_ORDER_MUTATION($orderId: ID!, $reason: String!) {
|
|
3
|
-
cancelOrder(input: { order_id: $orderId, reason: $reason }) {
|
|
4
|
-
error
|
|
5
|
-
order {
|
|
6
|
-
email
|
|
7
|
-
available_actions
|
|
8
|
-
status
|
|
9
|
-
number
|
|
10
|
-
id
|
|
11
|
-
order_date
|
|
12
|
-
carrier
|
|
13
|
-
shipping_method
|
|
14
|
-
is_virtual
|
|
15
|
-
applied_coupons {
|
|
16
|
-
code
|
|
17
|
-
}
|
|
18
|
-
shipments {
|
|
19
|
-
id
|
|
20
|
-
number
|
|
21
|
-
tracking {
|
|
22
|
-
title
|
|
23
|
-
number
|
|
24
|
-
carrier
|
|
25
|
-
}
|
|
26
|
-
comments {
|
|
27
|
-
message
|
|
28
|
-
timestamp
|
|
29
|
-
}
|
|
30
|
-
items {
|
|
31
|
-
id
|
|
32
|
-
product_sku
|
|
33
|
-
product_name
|
|
34
|
-
order_item {
|
|
35
|
-
...OrderItems
|
|
36
|
-
... on GiftCardOrderItem {
|
|
37
|
-
gift_card {
|
|
38
|
-
recipient_name
|
|
39
|
-
recipient_email
|
|
40
|
-
sender_name
|
|
41
|
-
sender_email
|
|
42
|
-
message
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
payment_methods {
|
|
49
|
-
name
|
|
50
|
-
type
|
|
51
|
-
}
|
|
52
|
-
shipping_address {
|
|
53
|
-
...AddressesList
|
|
54
|
-
}
|
|
55
|
-
billing_address {
|
|
56
|
-
...AddressesList
|
|
57
|
-
}
|
|
58
|
-
items {
|
|
59
|
-
...OrderItems
|
|
60
|
-
... on GiftCardOrderItem {
|
|
61
|
-
__typename
|
|
62
|
-
gift_card {
|
|
63
|
-
recipient_name
|
|
64
|
-
recipient_email
|
|
65
|
-
sender_name
|
|
66
|
-
sender_email
|
|
67
|
-
message
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
total {
|
|
72
|
-
...OrderSummary
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
${j}
|
|
78
|
-
${J}
|
|
79
|
-
${P}
|
|
80
|
-
`,ee=async(t,d,n,e)=>{if(!t)throw new Error("No order ID found");if(!d)throw new Error("No reason found");return B(Z,{variables:{orderId:t,reason:d}}).then(({errors:s,data:o})=>{if(s)return Q(s);if(o.cancelOrder.error!=null){e();return}const a=z(o.cancelOrder.order);n(a)})},re=()=>{const[t,d]=u(null);return y(()=>{const n=sessionStorage.getItem("orderStoreConfig"),e=n?JSON.parse(n):null;e?d(e):Y().then(s=>{s&&(sessionStorage.setItem("orderStoreConfig",JSON.stringify(s)),d(s))})},[]),t},te=({cancelButtonProps:t,modalProps:d,pickerProps:n,submitButtonProps:e,orderId:s})=>{const o=O({buttonText:"Order.OrderCancel.buttonText",ErrorHeading:"Order.OrderCancellationReasonsModal.errorHeading",ErrorDescription:"Order.OrderCancellationReasonsModal.errorDescription",orderCancellationLabel:"Order.OrderCancellationReasonsModal.label"}),[a,i]=u(!1),[m,g]=u(0),[C,M]=u(!1),[I,T]=u(!1),w=()=>{i(!0)},L=()=>{i(!1)},x=c=>{c.preventDefault();const l=Number(c.target.value);g(l)},R=re(),_=(R==null?void 0:R.orderCancellationReasons)??[];N.on("authenticated",c=>{c&&T(!0)},{eager:!0});const b=c=>c.map((l,H)=>({text:l==null?void 0:l.description,value:H.toString()})),$=async c=>(c.preventDefault(),ee(s,_[m].description,l=>{i(!1),I||(l.status="guest order cancellation requested"),N.emit("order/data",l)},()=>{M(!0)}));return p(A,{children:[r(h,{onClick:w,type:"button",variant:"secondary",...t,children:o.buttonText}),a&&p(k,{size:"medium",onClose:L,className:"order-order-cancel__modal",title:r("h2",{className:"order-order-cancel__title",children:r(S,{id:"Order.OrderCancellationReasonsModal.title"})}),"data-testid":"order-cancellation-reasons-modal",...d,children:[C&&r(q,{heading:o.ErrorHeading,description:o.ErrorDescription}),p(V,{onSubmit:$,children:[r("div",{className:"order-order-cancel__text",children:r(S,{id:"Order.OrderCancellationReasonsModal.description"})}),r(G,{name:"cancellationReasons",floatingLabel:o.orderCancellationLabel,defaultOption:b(_)[0],variant:"primary",options:b(_),value:String(m),handleSelect:x,required:!0,"data-testid":"order-cancellation-reasons-selector",...n}),r("div",{className:"order-order-cancel__button-container",children:r(h,{variant:"primary",...e,children:r(S,{id:"Order.OrderCancellationReasonsModal.button"})})})]})]})]})},ne=({className:t,children:d,orderData:n,slots:e,...s})=>{const o=O({cancel:"Order.OrderStatusContent.actions.cancel",return:"Order.OrderStatusContent.actions.return",reorder:"Order.OrderStatusContent.actions.reorder"}),a=W(()=>{const i=n==null?void 0:n.availableActions,m=!!(i!=null&&i.length);return r(A,{children:e!=null&&e.OrderActions?r(D,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:e==null?void 0:e.OrderActions,context:n}):r("div",{"data-testid":"availableActionsList",className:v(["order-order-actions__wrapper",["order-order-actions__wrapper--empty",!m]]),children:i==null?void 0:i.map((g,C)=>{switch(g){case f.CANCEL:return r(te,{orderId:atob(n.id)});case f.RETURN:return r(h,{variant:"secondary",children:o.return},C);case f.REORDER:return r(h,{variant:"secondary",children:o.reorder},C)}})})})},[n,e==null?void 0:e.OrderActions,o]);return r("div",{...s,className:v(["order-order-actions",t]),children:a})},oe=({orderData:t})=>{const[d,n]=u(t),[e,s]=u(t==null?void 0:t.status);return y(()=>{const o=N.on("order/data",a=>{n(a),s(a.status)},{eager:!0});return()=>{o==null||o.off()}},[]),{orderStatus:e,order:d}},ge=({slots:t,orderData:d,className:n,statusTitle:e,status:s})=>{const{orderStatus:o,order:a}=oe({orderData:d});return r("div",{className:v(["order-order-status",n]),children:a?r(X,{title:e,status:s||o,slots:t,orderData:a}):r(K,{withCard:!1})})};export{ge as OrderStatus,ge as default};
|
|
1
|
+
import{jsx as t,jsxs as C,Fragment as R}from"@dropins/tools/preact-jsx-runtime.js";import{Card as g,Header as f,Button as p}from"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import{Slot as E,classes as O}from"@dropins/tools/lib.js";import{useMemo as v}from"@dropins/tools/preact-compat.js";import{useText as i}from"@dropins/tools/i18n.js";import{useState as h,useEffect as N}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as w}from"@dropins/tools/event-bus.js";import{C as y}from"../chunks/OrderLoaders.js";const l={pending:"orderPending",shiping:"orderShipped",complete:"orderComplete",processing:"orderProcessing","on hold":"orderOnHold",canceled:"orderCanceled","suspected fraud":"orderSuspectedFraud","payment Review":"orderPaymentReview","order received":"orderReceived","guest order cancellation requested":"guestOrderCancellationRequested"},A=({slots:r,title:a,status:n,orderData:e})=>{const o=String(n).toLocaleLowerCase(),s=i(`Order.OrderStatusContent.${l[o]}.title`),d=i(`Order.OrderStatusContent.${l[o]}.message`),c=i(`Order.OrderStatusContent.${l[o]}.messageWithoutDate`);if(!n)return t("div",{});const m=e!=null&&e.orderStatusChangeDate?d==null?void 0:d.message.replace("{DATE}",e==null?void 0:e.orderStatusChangeDate):c.messageWithoutDate;return C(g,{className:"order-order-status-content",variant:"secondary",children:[t(f,{title:a??s.title}),C("div",{className:"order-order-status-content__wrapper",children:[t("div",{className:"order-order-status-content__wrapper-description",children:t("p",{children:m})}),t(_,{orderData:e,slots:r})]})]})};var u=(r=>(r.CANCEL="CANCEL",r.RETURN="RETURN",r.REORDER="REORDER",r))(u||{});const _=({className:r,children:a,orderData:n,slots:e,...o})=>{const s=i({cancel:"Order.OrderStatusContent.actions.cancel",return:"Order.OrderStatusContent.actions.return",reorder:"Order.OrderStatusContent.actions.reorder"}),d=v(()=>{const c=n==null?void 0:n.availableActions,m=!!(c!=null&&c.length);return t(R,{children:e!=null&&e.OrderActions?t(E,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:e==null?void 0:e.OrderActions,context:n}):t("div",{"data-testid":"availableActionsList",className:O(["order-order-actions__wrapper",["order-order-actions__wrapper--empty",!m]]),children:c==null?void 0:c.map(S=>{switch(S){case u.CANCEL:return t(p,{variant:"secondary",children:s.cancel});case u.RETURN:return t(p,{variant:"secondary",children:s.return});case u.REORDER:return t(p,{variant:"secondary",children:s.reorder})}})})})},[n,e==null?void 0:e.OrderActions,s]);return t("div",{...o,className:O(["order-order-actions",r]),children:d})},T=({orderData:r})=>{const[a,n]=h(r),[e,o]=h(r==null?void 0:r.status);return N(()=>{const s=w.on("order/data",d=>{n(d),o(d.status)},{eager:!0});return()=>{s==null||s.off()}},[]),{orderStatus:e,order:a}},B=({slots:r,orderData:a,className:n,statusTitle:e,status:o})=>{const{orderStatus:s,order:d}=T({orderData:a});return t("div",{className:O(["order-order-status",n]),children:d?t(A,{title:e,status:o||s,slots:r,orderData:d}):t(y,{withCard:!1})})};export{B as OrderStatus,B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as h,jsx as e,Fragment as A}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as E,classes as R}from"@dropins/tools/lib.js";import{Card as g,Header as u,Accordion as b,AccordionSection as x,ContentGrid as U,Image as w}from"@dropins/tools/components.js";import"../chunks/
|
|
1
|
+
import{jsxs as h,jsx as e,Fragment as A}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as E,classes as R}from"@dropins/tools/lib.js";import{Card as g,Header as u,Accordion as b,AccordionSection as x,ContentGrid as U,Image as w}from"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import{useText as Y}from"@dropins/tools/i18n.js";import{C as $}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import{useState as j,useEffect as F}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as q}from"@dropins/tools/event-bus.js";var m=(i=>(i.PENDING="pending",i.SHIPPING="shipping",i.COMPLETE="complete",i.PROCESSING="processing",i.HOLD="on hold",i.CANCELED="Canceled",i.SUSPECTED_FRAUD="suspected fraud",i.PAYMENT_REVIEW="payment review",i))(m||{});const V=({slots:i,orderData:n,collapseThreshold:d=0})=>{var C,f,T,S,I;const t=Y({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",notYetShippedImagesTitle:"Order.ShippingStatusCard.notYetShippedImagesTitle",noInfoTitle:"Order.OrderStatusContent.noInfoTitle"}),l=(C=n==null?void 0:n.status)==null?void 0:C.toLocaleLowerCase(),G=((f=n==null?void 0:n.shipments)==null?void 0:f.length)===1&&(l==null?void 0:l.includes(m.COMPLETE)),s=(T=n==null?void 0:n.items)==null?void 0:T.filter(c=>(c==null?void 0:c.quantityShipped)===0);return!n||l!=null&&l.includes(m.CANCELED)?null:(S=n==null?void 0:n.shipments)!=null&&S.length?h(A,{children:[(I=n==null?void 0:n.shipments)==null?void 0:I.map(({tracking:c,items:r,id:a},H)=>h(g,{variant:"secondary",className:"order-shipping-status-card",children:[e(u,{title:t.shippingCardTitle}),c==null?void 0:c.map(p=>{var o;return h("div",{className:"order-shipping-status-card__header",role:"status",children:[h("div",{className:"order-shipping-status-card__header--content",children:[h("p",{children:[t.carrier," ",(o=p==null?void 0:p.carrier)==null?void 0:o.toLocaleUpperCase()," | ",p==null?void 0:p.number]}),e("p",{children:p==null?void 0:p.title})]}),i!=null&&i.DeliveryTrackActions?e(E,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:i==null?void 0:i.DeliveryTrackActions,context:{trackInformation:p}}):null]},p.number)}),G?null:e(b,{actionIconPosition:"right","data-testid":"dropinAccordion",children:e(x,{"data-position":H+1,defaultOpen:d>=(r==null?void 0:r.length),title:`Package contents (${r==null?void 0:r.length} items)`,children:e(U,{maxColumns:6,emptyGridContent:e(A,{}),className:"order-shipping-status-card__images",children:r==null?void 0:r.map(p=>{var v,O,y,_,L,N;const o=(y=(O=(v=p==null?void 0:p.orderItem)==null?void 0:v.product)==null?void 0:O.thumbnail)==null?void 0:y.label,M=(N=(L=(_=p==null?void 0:p.orderItem)==null?void 0:_.product)==null?void 0:L.thumbnail)==null?void 0:N.url;return e(w,{alt:o,src:M,width:85,height:114},p.id)})})})}),i!=null&&i.DeliveryTimeLine?e(E,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:i==null?void 0:i.DeliveryTimeLine,context:{}}):null]},a)),s!=null&&s.length?h(g,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[e(u,{title:t.notYetShippedTitle}),e(b,{actionIconPosition:"right",children:e(x,{title:`${t.notYetShippedImagesTitle} ${s==null?void 0:s.length}`,children:e("div",{className:"order-shipping-status-card__images",children:s==null?void 0:s.map(({id:c,thumbnail:{url:r,label:a}})=>e(w,{alt:a,src:r,width:85,height:114},c))})})})]}):null]}):h(g,{variant:"secondary",className:"order-shipping-status-card",children:[e(u,{title:t.shippingInfoTitle}),e("div",{className:"order-shipping-status-card__header",children:h("div",{className:"order-shipping-status-card__header--content",children:[n!=null&&n.carrier?e("p",{children:n==null?void 0:n.carrier}):null,e("p",{children:t.noInfoTitle})]})})]})},W=({orderData:i})=>{const[n,d]=j(i);return F(()=>{const t=q.on("order/data",l=>{d(l)},{eager:!0});return()=>{t==null||t.off()}},[]),{order:n}},ni=({slots:i,className:n,collapseThreshold:d,orderData:t})=>{const{order:l}=W({orderData:t});return e("div",{className:R(["order-shipping-status",n]),children:l?e(V,{slots:i,orderData:l,collapseThreshold:d}):e($,{withCard:!1})})};export{ni as ShippingStatus,ni as default};
|
package/containers/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type OrderAddressModel = {
|
|
|
18
18
|
}[];
|
|
19
19
|
} | null;
|
|
20
20
|
export type OrderItemProductModel = {
|
|
21
|
+
stockStatus?: string;
|
|
21
22
|
canonicalUrl?: string;
|
|
22
23
|
id: string;
|
|
23
24
|
image?: string;
|
|
@@ -31,17 +32,40 @@ export type OrderItemProductModel = {
|
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
export type OrderItemModel = {
|
|
35
|
+
downloadableLinks: {
|
|
36
|
+
count: number;
|
|
37
|
+
result: string;
|
|
38
|
+
};
|
|
39
|
+
itemPrices: {
|
|
40
|
+
priceIncludingTax: MoneyProps;
|
|
41
|
+
originalPrice: MoneyProps;
|
|
42
|
+
originalPriceIncludingTax: MoneyProps;
|
|
43
|
+
price: MoneyProps;
|
|
44
|
+
discounts: [
|
|
45
|
+
{
|
|
46
|
+
label: string;
|
|
47
|
+
amount: {
|
|
48
|
+
value: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
};
|
|
53
|
+
bundleOptions: Record<string, string> | null;
|
|
34
54
|
type: string;
|
|
35
55
|
discounted: boolean;
|
|
36
56
|
id: string;
|
|
37
57
|
productName: string;
|
|
58
|
+
totalInclTax: MoneyProps;
|
|
59
|
+
priceInclTax: MoneyProps;
|
|
38
60
|
regularPrice: MoneyProps;
|
|
61
|
+
total: MoneyProps;
|
|
39
62
|
price: MoneyProps;
|
|
40
63
|
product: OrderItemProductModel;
|
|
41
64
|
selectedOptions?: Array<{
|
|
42
65
|
label: string;
|
|
43
66
|
value: any;
|
|
44
67
|
}>;
|
|
68
|
+
configurableOptions: Record<string, string | number | boolean> | undefined;
|
|
45
69
|
totalQuantity: number;
|
|
46
70
|
thumbnail: {
|
|
47
71
|
label: string;
|
|
@@ -52,6 +76,7 @@ export type OrderItemModel = {
|
|
|
52
76
|
senderEmail: string;
|
|
53
77
|
recipientEmail: string;
|
|
54
78
|
recipientName: string;
|
|
79
|
+
message: string;
|
|
55
80
|
};
|
|
56
81
|
quantityCanceled: number;
|
|
57
82
|
quantityInvoiced: number;
|
|
@@ -2,6 +2,15 @@ import { QueryType, ResponseData, OrderProps, OrderItemProps } from '../../types
|
|
|
2
2
|
import { TransformedData } from '../models';
|
|
3
3
|
|
|
4
4
|
export declare const transformConfigurableOptions: (item: OrderItemProps) => Record<string, string> | undefined;
|
|
5
|
+
export declare const transformBundleOptions: (data: any) => {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
} | null;
|
|
8
|
+
export declare const transformLinks: (links: {
|
|
9
|
+
title: string;
|
|
10
|
+
}[]) => {
|
|
11
|
+
count: number;
|
|
12
|
+
result: string;
|
|
13
|
+
} | null;
|
|
5
14
|
export declare const transformOrderData: (orderData: OrderProps) => any;
|
|
6
15
|
export declare const transformOrderDetails: <T extends "orderData">(queryType: QueryType, response: ResponseData<T>) => TransformedData<T>;
|
|
7
16
|
//# sourceMappingURL=transform-order-details.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OrderDataModel } from '../../data/models';
|
|
2
|
+
import { TaxTypes, UseOrderProductListProps } from '../../types';
|
|
3
|
+
|
|
4
|
+
export declare const useOrderProductList: ({ orderData, }: UseOrderProductListProps) => {
|
|
5
|
+
loading: boolean;
|
|
6
|
+
taxConfig: TaxTypes;
|
|
7
|
+
order: OrderDataModel | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useOrderProductList.d.ts.map
|
package/hooks/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export * from './containers/useOrderSearch';
|
|
|
2
2
|
export * from './containers/useOrderStatus';
|
|
3
3
|
export * from './containers/useShippingStatus';
|
|
4
4
|
export * from './containers/useCustomerDetails';
|
|
5
|
+
export * from './containers/useOrderProductList';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"Order": {
|
|
3
|
+
"OrderProductListContent":{
|
|
4
|
+
"cancelledTitle":"Cancelled",
|
|
5
|
+
"allOrdersTitle":"Your order",
|
|
6
|
+
"downloadableCount":"Files",
|
|
7
|
+
"stockStatus": {
|
|
8
|
+
"inStock":"In stock",
|
|
9
|
+
"outOfStock":"Out of stock"
|
|
10
|
+
},
|
|
11
|
+
"GiftCard": {
|
|
12
|
+
"sender": "Sender",
|
|
13
|
+
"recipient": "Recipient",
|
|
14
|
+
"message": "Note"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
3
17
|
"OrderSearchForm": {
|
|
4
18
|
"title": "Enter your information to view order details",
|
|
5
19
|
"description": "You can find your order number in the receipt you received via email.",
|
|
@@ -69,7 +83,8 @@ declare const _default: {
|
|
|
69
83
|
},
|
|
70
84
|
"guestOrderCancellationRequested": {
|
|
71
85
|
"title": "cancellation requested",
|
|
72
|
-
"message": "The cancellation has been requested. Check your email for further instructions."
|
|
86
|
+
"message": "The cancellation has been requested on {DATE}. Check your email for further instructions.",
|
|
87
|
+
"messageWithoutDate": "The cancellation has been requested. Check your email for further instructions."
|
|
73
88
|
}
|
|
74
89
|
},
|
|
75
90
|
"CustomerDetails": {
|
|
@@ -98,7 +113,7 @@ declare const _default: {
|
|
|
98
113
|
"OrderCancel": {
|
|
99
114
|
"buttonText": "Cancel Order"
|
|
100
115
|
},
|
|
101
|
-
"
|
|
116
|
+
"OrderCancellationReasonsForm": {
|
|
102
117
|
"title": "Cancel order",
|
|
103
118
|
"description": "Select a reason for canceling the order",
|
|
104
119
|
"label": "Reason for cancel",
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-order", "version": "0.1.0-
|
|
1
|
+
{"name": "@dropins/storefront-order", "version": "0.1.0-alpha11", "@dropins/elsie": "0.34.0"}
|
package/render.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(a,
|
|
2
|
-
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as a}from"@dropins/tools/lib.js";import{useState as n,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as c}from"@dropins/tools/components.js";import{events as l}from"@dropins/tools/event-bus.js";const u={OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",postcode:"Zip Code",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping info",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:"Package contents"},OrderStatusContent:{noInfoTitle:"Check back later for more details.",actions:{cancel:"Cancel order",return:"Return or replace",reorder:"Reorder"},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"cancellation requested",message:"The cancellation has been requested. Check your email for further instructions."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},billingMethods:{title:"Payment method"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},
|
|
1
|
+
(function(a,e){try{if(typeof document<"u"){const r=document.createElement("style"),n=e.styleId;for(const t in e.attributes)r.setAttribute(t,e.attributes[t]);r.setAttribute("data-dropin",n),r.appendChild(document.createTextNode(a));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})('.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "postcode" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--postcode{grid-area:postcode}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.order-order-status-content{margin-bottom:var(--spacing-small)}.order-order-status-content.dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-shipping-status-card{margin-bottom:var(--spacing-small)}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card.dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p{margin:0;padding:0;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important;overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small);border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-actions__wrapper--empty{display:none}.order-customer-details-content .dropin-card__content{gap:0}.dropin-customer-details .dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.order-customer-details-content__container{display:grid;flex-direction:column;gap:var(--spacing-medium)}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:max-content max-content;grid-template-rows:auto auto auto;gap:var(--spacing-medium);grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2}.order-customer-details-content__container-billing_address{grid-area:2 / 2 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-billing_methods{grid-area:3 / 2 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-billing_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-billing_methods p.order-customer-details-content__container-billing_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0;padding:0;display:inline-flex;overflow:hidden}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(2){text-align:left;cursor:default;margin-bottom:var(--spacing-xsmall)}.order-customer-details-content__container-description p:nth-child(2){position:relative}.order-customer-details-content__container-description p:nth-child(2) span{position:absolute}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(7){float:left;width:auto;margin-right:var(--spacing-xsmall)}.order-customer-details-content__container-description p:nth-child(5){position:relative;margin-right:var(--spacing-xsmall)}.order-customer-details-content__container-description p:nth-child(5) span{position:absolute}.order-customer-details-content__container-description p:nth-child(2),.order-customer-details-content__container-description p:nth-child(6),.order-customer-details-content__container-description p:nth-child(8){display:inline;width:50%}.order-customer-details-content__container-description p:nth-child(2):after,.order-customer-details-content__container-description p:nth-child(6):after,.order-customer-details-content__container-description p:nth-child(8):after{content:"\\a";white-space:pre;display:block;height:var(--spacing-xsmall)}.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(n+9){display:block;width:100%;margin-bottom:var(--spacing-xsmall)}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0;padding:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-order-cancel-reasons-form__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}',{styleId:"order"});
|
|
2
|
+
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as a}from"@dropins/tools/lib.js";import{useState as n,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as c}from"@dropins/tools/components.js";import{events as l}from"@dropins/tools/event-bus.js";const u={OrderProductListContent:{cancelledTitle:"Cancelled",allOrdersTitle:"Your order",downloadableCount:"Files",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},GiftCard:{sender:"Sender",recipient:"Recipient",message:"Note"}},OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",postcode:"Zip Code",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping info",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:"Package contents"},OrderStatusContent:{noInfoTitle:"Check back later for more details.",actions:{cancel:"Cancel order",return:"Return or replace",reorder:"Reorder"},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"cancellation requested",message:"The cancellation has been requested on {DATE}. Check your email for further instructions.",messageWithoutDate:"The cancellation has been requested. Check your email for further instructions."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},billingMethods:{title:"Payment method"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},OrderCancellationReasonsForm:{title:"Cancel order",description:"Select a reason for canceling the order",label:"Reason for cancel",button:"Submit Cancellation",errorHeading:"Error",errorDescription:"There was an error processing your order cancellation."}},p={Order:u},h={default:p},m=({children:o})=>{const[t,s]=n("en_US");return d(()=>{const e=l.on("locale",i=>{s(i)},{eager:!0});return()=>{e==null||e.off()}},[]),r(c,{lang:t,langDefinitions:h,children:o})},b=new a(r(m,{}));export{b as render};
|
|
@@ -24,6 +24,7 @@ export interface ProductProps {
|
|
|
24
24
|
thumbnail?: ThumbnailImageProps;
|
|
25
25
|
image: ThumbnailImageProps;
|
|
26
26
|
canonical_url: string;
|
|
27
|
+
id: string;
|
|
27
28
|
uid: string;
|
|
28
29
|
name: string;
|
|
29
30
|
__typename: string;
|
|
@@ -78,11 +79,9 @@ interface InvoiceProps {
|
|
|
78
79
|
}[];
|
|
79
80
|
}
|
|
80
81
|
export interface GiftMessageProps {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
to: string;
|
|
85
|
-
};
|
|
82
|
+
form: string;
|
|
83
|
+
message: string;
|
|
84
|
+
to: string;
|
|
86
85
|
}
|
|
87
86
|
export interface GiftWrappingProps {
|
|
88
87
|
gift_wrapping: {
|
|
@@ -100,6 +99,7 @@ export interface giftCardProps {
|
|
|
100
99
|
sender_email: string;
|
|
101
100
|
recipient_email: string;
|
|
102
101
|
recipient_name: string;
|
|
102
|
+
message: string;
|
|
103
103
|
}
|
|
104
104
|
export interface OrderItemProps {
|
|
105
105
|
__typename: string;
|
|
@@ -128,8 +128,26 @@ export interface OrderItemProps {
|
|
|
128
128
|
label: string;
|
|
129
129
|
value: string;
|
|
130
130
|
}[];
|
|
131
|
+
bundle_options: any;
|
|
131
132
|
status: string;
|
|
132
133
|
gift_card?: giftCardProps;
|
|
134
|
+
downloadable_links: {
|
|
135
|
+
title: string;
|
|
136
|
+
}[];
|
|
137
|
+
prices: {
|
|
138
|
+
price_including_tax: MoneyProps;
|
|
139
|
+
original_price: MoneyProps;
|
|
140
|
+
original_price_including_tax: MoneyProps;
|
|
141
|
+
price: MoneyProps;
|
|
142
|
+
discounts: [
|
|
143
|
+
{
|
|
144
|
+
label: string;
|
|
145
|
+
amount: {
|
|
146
|
+
value: number;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
];
|
|
150
|
+
};
|
|
133
151
|
}
|
|
134
152
|
export interface PaymentMethodsProps {
|
|
135
153
|
name: string;
|
package/types/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonProps, PickerProps } from '@dropins/tools/types/elsie/src/src/components';
|
|
2
|
+
import { PickerOption } from '@dropins/tools/types/elsie/src/components';
|
|
2
3
|
|
|
3
4
|
export interface OrderCancelProps {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
orderId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface OrderCancelReasonFormProps {
|
|
8
|
+
orderId: string;
|
|
6
9
|
pickerProps?: PickerProps;
|
|
7
10
|
submitButtonProps?: ButtonProps;
|
|
8
|
-
orderId: string
|
|
11
|
+
cancelOrder: (orderId: string, reason: string, onSuccess: Function, onError: Function) => Promise<void | null | undefined>;
|
|
12
|
+
cancelReasons: PickerOption[];
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=orderCancel.types.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { OrderDataModel, OrderItemModel } from '../data/models';
|
|
2
|
+
|
|
3
|
+
type options = Record<string, string | number | boolean>;
|
|
4
|
+
export type TaxTypes = {
|
|
5
|
+
taxIncluded: boolean;
|
|
6
|
+
taxExcluded: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface OrderProductListProps {
|
|
9
|
+
orderData?: OrderDataModel;
|
|
10
|
+
className?: string;
|
|
11
|
+
withHeader?: boolean;
|
|
12
|
+
showConfigurableOptions?: (options: options | {}) => options;
|
|
13
|
+
}
|
|
14
|
+
export interface OrderProductListContentProps extends Omit<OrderProductListProps, 'className'> {
|
|
15
|
+
order?: OrderDataModel;
|
|
16
|
+
taxConfig: TaxTypes;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface CartSummaryItemProps {
|
|
20
|
+
taxConfig: TaxTypes;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
translations: Record<string, string>;
|
|
23
|
+
showConfigurableOptions?: (options: options | {}) => options;
|
|
24
|
+
itemType: string;
|
|
25
|
+
product: OrderItemModel;
|
|
26
|
+
}
|
|
27
|
+
export interface UseOrderProductListProps extends Omit<OrderProductListProps, 'className' | 'withHeader' | 'showConfigurableOptions'> {
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=orderProductList.types.d.ts.map
|
|
File without changes
|
|
File without changes
|