@vtex/checkout 0.14.1 → 0.15.0
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/dist/surface/types.d.ts +32 -0
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
package/dist/surface/types.d.ts
CHANGED
|
@@ -4,13 +4,37 @@ export type AddItemData = {
|
|
|
4
4
|
id: string;
|
|
5
5
|
seller: string;
|
|
6
6
|
};
|
|
7
|
+
export type RemoveItemData = {
|
|
8
|
+
originalIndex: number;
|
|
9
|
+
};
|
|
7
10
|
export type Offering = {
|
|
8
11
|
type: string;
|
|
9
12
|
name: string;
|
|
10
13
|
id: string;
|
|
11
14
|
};
|
|
15
|
+
export type CompositionItem = {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
quantity: number;
|
|
19
|
+
value: number;
|
|
20
|
+
itemValue: number;
|
|
21
|
+
};
|
|
22
|
+
export type CompositionGroup = {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
items: Array<CompositionItem>;
|
|
26
|
+
};
|
|
27
|
+
export type AttachmentValue = {
|
|
28
|
+
key: string;
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
export type Attachment = {
|
|
32
|
+
id: string;
|
|
33
|
+
values: Array<AttachmentValue>;
|
|
34
|
+
};
|
|
12
35
|
export type BaseCartItem = {
|
|
13
36
|
id: string;
|
|
37
|
+
originalIndex: number;
|
|
14
38
|
quantity: number;
|
|
15
39
|
imageUrl: string;
|
|
16
40
|
productUrl: string;
|
|
@@ -19,19 +43,27 @@ export type BaseCartItem = {
|
|
|
19
43
|
export type CartAvailableItem = BaseCartItem & {
|
|
20
44
|
status: 'available';
|
|
21
45
|
price: number;
|
|
46
|
+
compositionCount: number;
|
|
47
|
+
compositions: Array<CompositionGroup>;
|
|
48
|
+
attachments: Array<Attachment>;
|
|
22
49
|
};
|
|
23
50
|
export type CartUnavailableItem = BaseCartItem & {
|
|
24
51
|
status: 'unavailable';
|
|
25
52
|
price?: number;
|
|
53
|
+
compositionCount: number;
|
|
54
|
+
compositions: Array<CompositionGroup>;
|
|
55
|
+
attachments: Array<Attachment>;
|
|
26
56
|
};
|
|
27
57
|
export type CartItem = CartAvailableItem | CartUnavailableItem;
|
|
28
58
|
export type UseCart = {
|
|
29
59
|
items: CartItem[];
|
|
30
60
|
addItem: (data: AddItemData) => Promise<void>;
|
|
61
|
+
removeItem: (data: RemoveItemData) => Promise<void>;
|
|
31
62
|
};
|
|
32
63
|
export type UseCartPunchout = {
|
|
33
64
|
items: CartItem[];
|
|
34
65
|
addItem: (data: AddItemData) => Promise<void>;
|
|
66
|
+
removeItem: (data: RemoveItemData) => Promise<void>;
|
|
35
67
|
sync: () => Promise<void>;
|
|
36
68
|
};
|
|
37
69
|
type Branding = {
|
package/dist/types.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export * from './surface/types.js';
|
|
|
4
4
|
export type ExtensionPointComponent = (props: {
|
|
5
5
|
api: ExtensionPointApi;
|
|
6
6
|
}) => ReactNode;
|
|
7
|
-
export type ExtensionPointsKeys = 'cart.cart-list.before' | 'cart.cart-list.after' | 'cart.order-summary.after' | 'cart.cart-item.after' | 'cart.order-button.after' | 'delivery.cart-item.after' | 'delivery.information-form.after' | 'delivery.order-button.after' | 'review.cart-item.after' | 'payment.cart-item.after' | 'payment.order-button.after' | 'order-placed.cart-item.after' | 'layout.footer' | 'punchout.cart-item.after' | 'punchout.order-summary.cta';
|
|
7
|
+
export type ExtensionPointsKeys = 'cart.cart-list.before' | 'cart.cart-list.after' | 'cart.order-summary.after' | 'cart.cart-item.after' | 'cart.assembly-options.button.after' | 'cart.order-button.after' | 'delivery.cart-item.after' | 'delivery.information-form.after' | 'delivery.order-button.after' | 'review.cart-item.after' | 'payment.cart-item.after' | 'payment.order-button.after' | 'order-placed.cart-item.after' | 'layout.footer' | 'punchout.cart-item.after' | 'punchout.order-summary.cta';
|
|
8
8
|
export type ExtensionPoints = Partial<Record<ExtensionPointsKeys, () => ReactNode>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtex/checkout",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"author": "VTEX",
|
|
5
5
|
"bin": {
|
|
6
6
|
"checkout": "./bin/run.js"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"ws": "^8.18.0",
|
|
26
26
|
"cors": "2.8.5",
|
|
27
27
|
"typescript": "^5.3.3",
|
|
28
|
-
"@vtex/checkout-ui-core": "0.
|
|
28
|
+
"@vtex/checkout-ui-core": "0.15.0",
|
|
29
29
|
"ora": "^8.1.0",
|
|
30
30
|
"chalk": "^5.3.0"
|
|
31
31
|
},
|