@liquidcommerce/elements-sdk 2.6.0-beta.7 → 2.6.0-beta.9
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/index.esm.js +9889 -9710
- package/dist/types/core/client/client-action.service.d.ts +11 -7
- package/dist/types/core/command/common-command.service.d.ts +1 -0
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +26 -51
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +9 -0
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -74
- package/dist/types/core/store/interfaces/cart.interface.d.ts +1 -1
- package/dist/types/elements-base-client.d.ts +1 -1
- package/dist/types/interfaces/api/cart.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
- package/package.json +1 -1
- package/umd/elements.js +1 -1
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -4
|
@@ -4,8 +4,10 @@ import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.int
|
|
|
4
4
|
import { type FulfillmentType } from '@/enums';
|
|
5
5
|
import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
|
|
6
6
|
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
|
|
7
|
-
export interface
|
|
8
|
-
|
|
7
|
+
export interface IAddProductParams {
|
|
8
|
+
identifier: string;
|
|
9
|
+
fulfillmentType: FulfillmentType;
|
|
10
|
+
quantity: number;
|
|
9
11
|
}
|
|
10
12
|
export interface IAddressActions {
|
|
11
13
|
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
@@ -13,11 +15,6 @@ export interface IAddressActions {
|
|
|
13
15
|
clear: () => Promise<void>;
|
|
14
16
|
getDetails: () => IAddressData | null;
|
|
15
17
|
}
|
|
16
|
-
export interface IAddProductParams {
|
|
17
|
-
identifier: string;
|
|
18
|
-
fulfillmentType: FulfillmentType;
|
|
19
|
-
quantity: number;
|
|
20
|
-
}
|
|
21
18
|
export interface ICartActions {
|
|
22
19
|
openCart: () => void;
|
|
23
20
|
closeCart: () => void;
|
|
@@ -46,6 +43,9 @@ export interface ICheckoutActions {
|
|
|
46
43
|
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
47
44
|
getDetails: () => ICheckoutDetailsEventData;
|
|
48
45
|
}
|
|
46
|
+
export interface IProductActions {
|
|
47
|
+
getDetails: (identifier: string) => IBaseProductEventData;
|
|
48
|
+
}
|
|
49
49
|
export declare class ClientActionService {
|
|
50
50
|
private readonly pubSub;
|
|
51
51
|
private readonly command;
|
|
@@ -53,6 +53,9 @@ export declare class ClientActionService {
|
|
|
53
53
|
private readonly api;
|
|
54
54
|
private readonly themeProvider;
|
|
55
55
|
private readonly logger;
|
|
56
|
+
private readonly allowedCustomerFields;
|
|
57
|
+
private readonly allowedBillingFields;
|
|
58
|
+
private readonly allowedGiftFields;
|
|
56
59
|
private pendingCartParams;
|
|
57
60
|
private pendingCartOpenFlag;
|
|
58
61
|
constructor();
|
|
@@ -61,6 +64,7 @@ export declare class ClientActionService {
|
|
|
61
64
|
private retryPendingCartOperation;
|
|
62
65
|
private clearPendingCartOperation;
|
|
63
66
|
private getLocation;
|
|
67
|
+
private normalizeCheckoutFieldValue;
|
|
64
68
|
private productActions;
|
|
65
69
|
private addressActions;
|
|
66
70
|
private cartActions;
|
|
@@ -3,5 +3,6 @@ import { BaseCommand } from './base-command.service';
|
|
|
3
3
|
export declare class CommonCommands extends BaseCommand {
|
|
4
4
|
static getInstance(): CommonCommands;
|
|
5
5
|
syncCartFromResponse(cartApi: ICart, publishEvent?: boolean): void;
|
|
6
|
+
private buildCartLoadedEventData;
|
|
6
7
|
loadCart(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -1,56 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
variantId: string;
|
|
5
|
-
liquidId: string;
|
|
6
|
-
retailerId: string;
|
|
7
|
-
partNumber: string;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
upc: string;
|
|
10
|
-
sku: string;
|
|
11
|
-
salsifyGrouping: string;
|
|
12
|
-
catPath: string;
|
|
13
|
-
volume: string;
|
|
14
|
-
uom: string;
|
|
15
|
-
pack: boolean;
|
|
16
|
-
packDesc: string;
|
|
17
|
-
container: string;
|
|
18
|
-
containerType: string;
|
|
19
|
-
name: string;
|
|
20
|
-
brand: string;
|
|
21
|
-
size: string;
|
|
22
|
-
price: number;
|
|
23
|
-
quantity: number;
|
|
24
|
-
maxQuantity: number;
|
|
25
|
-
unitPrice: number;
|
|
26
|
-
mainImage: string;
|
|
27
|
-
attributes: ICartItemAttributes;
|
|
28
|
-
}
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
2
|
+
import type { ICartItem, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
29
3
|
export interface IBaseCartEventData {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
items: Record<string, ICartItemEventData>;
|
|
33
|
-
location: {
|
|
34
|
-
placesId: string;
|
|
35
|
-
address: {
|
|
36
|
-
one: string;
|
|
37
|
-
two: string;
|
|
38
|
-
city: string;
|
|
39
|
-
state: string;
|
|
40
|
-
zip: string;
|
|
41
|
-
country: string;
|
|
42
|
-
};
|
|
43
|
-
coordinates: {
|
|
44
|
-
latitude: number;
|
|
45
|
-
longitude: number;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
4
|
+
cartId: string;
|
|
5
|
+
promoCodeDiscount: number | null;
|
|
48
6
|
subtotal: number;
|
|
49
7
|
itemCount: number;
|
|
8
|
+
items: Record<string, ICartItem>;
|
|
9
|
+
retailers: Record<string, ICartRetailer>;
|
|
10
|
+
location: {
|
|
11
|
+
placesId: string;
|
|
12
|
+
formattedAddress: string;
|
|
13
|
+
address: IAddressAddress;
|
|
14
|
+
coordinates: IAddressCoordinates;
|
|
15
|
+
} | null;
|
|
50
16
|
}
|
|
51
17
|
export interface ICartLoadedEventData extends IBaseCartEventData {
|
|
52
18
|
}
|
|
53
19
|
export interface ICartFailedEventData {
|
|
20
|
+
cartId: string;
|
|
54
21
|
message: string;
|
|
55
22
|
}
|
|
56
23
|
export interface ICartUpdatedEventData {
|
|
@@ -58,37 +25,45 @@ export interface ICartUpdatedEventData {
|
|
|
58
25
|
current: IBaseCartEventData;
|
|
59
26
|
}
|
|
60
27
|
export interface ICartItemAddedEventData {
|
|
61
|
-
|
|
28
|
+
cartId: string;
|
|
29
|
+
itemId: string;
|
|
62
30
|
fulfillmentId: string;
|
|
63
31
|
partNumber: string;
|
|
64
32
|
quantity: number;
|
|
65
33
|
engravingLines?: string[];
|
|
66
34
|
}
|
|
67
35
|
export interface ICartItemRemovedEventData {
|
|
68
|
-
|
|
36
|
+
cartId: string;
|
|
37
|
+
itemId: string;
|
|
69
38
|
}
|
|
70
39
|
export interface ICartItemQuantityChangedEventData {
|
|
71
|
-
|
|
40
|
+
cartId: string;
|
|
41
|
+
itemId: string;
|
|
72
42
|
quantity: number;
|
|
73
43
|
previousQuantity: number;
|
|
74
44
|
}
|
|
75
45
|
export interface ICartItemEngravingUpdatedEventData {
|
|
76
|
-
|
|
46
|
+
cartId: string;
|
|
47
|
+
itemId: string;
|
|
77
48
|
engravingLines: string[];
|
|
78
49
|
previousEngravingLines: string[];
|
|
79
50
|
}
|
|
80
51
|
export interface ICartPromoCodeEventData {
|
|
52
|
+
cartId: string;
|
|
81
53
|
discountAmount?: number;
|
|
82
|
-
|
|
54
|
+
newSubtotal?: number;
|
|
83
55
|
}
|
|
84
56
|
export interface ICartPromoCodeFailedEventData {
|
|
57
|
+
cartId: string;
|
|
85
58
|
error: string;
|
|
86
59
|
}
|
|
87
60
|
export interface ICartProductAddEventData {
|
|
61
|
+
cartId: string;
|
|
88
62
|
itemsAdded: number;
|
|
89
63
|
identifiers: string[];
|
|
90
64
|
}
|
|
91
65
|
export interface ICartProductAddFailedEventData {
|
|
66
|
+
cartId: string;
|
|
92
67
|
identifiers: string[];
|
|
93
68
|
error: string;
|
|
94
69
|
}
|
|
@@ -32,37 +32,46 @@ export interface ICheckoutSubmitFailedEventData {
|
|
|
32
32
|
message: string;
|
|
33
33
|
}
|
|
34
34
|
export interface ICheckoutItemQuantityChangedEventData {
|
|
35
|
+
cartId: string;
|
|
35
36
|
cartItemId: string;
|
|
36
37
|
quantity: number;
|
|
37
38
|
previousQuantity: number;
|
|
38
39
|
}
|
|
39
40
|
export interface ICheckoutItemRemovedEventData {
|
|
41
|
+
cartId: string;
|
|
40
42
|
cartItemId: string;
|
|
41
43
|
}
|
|
42
44
|
export interface ICheckoutItemEngravingUpdatedEventData {
|
|
45
|
+
cartId: string;
|
|
43
46
|
cartItemId: string;
|
|
44
47
|
engravingLines: string[];
|
|
45
48
|
previousEngravingLines: string[];
|
|
46
49
|
}
|
|
47
50
|
export interface ICheckoutPromoCodeEventData {
|
|
51
|
+
cartId: string;
|
|
48
52
|
discountAmount?: number;
|
|
49
53
|
newTotal?: number;
|
|
50
54
|
}
|
|
51
55
|
export interface ICheckoutPromoCodeFailedEventData {
|
|
56
|
+
cartId: string;
|
|
52
57
|
error: string;
|
|
53
58
|
}
|
|
54
59
|
export interface ICheckoutGiftCardEventData {
|
|
60
|
+
cartId: string;
|
|
55
61
|
newTotal?: number;
|
|
56
62
|
}
|
|
57
63
|
export interface ICheckoutGiftCardFailedEventData {
|
|
64
|
+
cartId: string;
|
|
58
65
|
error: string;
|
|
59
66
|
}
|
|
60
67
|
export interface ICheckoutProductAddEventData {
|
|
68
|
+
cartId: string;
|
|
61
69
|
itemsAdded: number;
|
|
62
70
|
identifiers: string[];
|
|
63
71
|
isPresale?: boolean;
|
|
64
72
|
}
|
|
65
73
|
export interface ICheckoutProductAddFailedEventData {
|
|
74
|
+
cartId: string;
|
|
66
75
|
identifiers: string[];
|
|
67
76
|
error: string;
|
|
68
77
|
isPresale?: boolean;
|
|
@@ -1,81 +1,23 @@
|
|
|
1
1
|
import type { FulfillmentType } from '@/enums';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
price: number;
|
|
5
|
-
partNumber: string;
|
|
6
|
-
stock: number;
|
|
7
|
-
isEngravable: boolean;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
fulfillmentType: FulfillmentType;
|
|
10
|
-
retailerId: string;
|
|
2
|
+
import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
3
|
+
export type IProductFulfillmentEventData = IFulfillment & {
|
|
11
4
|
retailerName: string;
|
|
12
|
-
retailerAddress:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
location: string;
|
|
22
|
-
};
|
|
23
|
-
presale?: {
|
|
24
|
-
canPurchaseOn: null | string;
|
|
25
|
-
estimatedShipBy: null | string;
|
|
26
|
-
isActive: boolean;
|
|
27
|
-
language: string;
|
|
28
|
-
presaleLimit: number;
|
|
29
|
-
price: number;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export interface IBaseProductSizeEventData {
|
|
33
|
-
id: string;
|
|
34
|
-
upc: string;
|
|
35
|
-
size: string;
|
|
36
|
-
pack: boolean;
|
|
37
|
-
packDesc: string;
|
|
38
|
-
container: string;
|
|
39
|
-
containerType: string;
|
|
40
|
-
maxQuantityPerOrder: number;
|
|
41
|
-
image: string;
|
|
42
|
-
uom: string;
|
|
43
|
-
volume: string;
|
|
44
|
-
attributes: IBaseProductSizeAttributesEventData;
|
|
45
|
-
shippingFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
46
|
-
onDemandFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
47
|
-
}
|
|
48
|
-
export interface IBaseProductEventData {
|
|
5
|
+
retailerAddress: IRetailerAddress;
|
|
6
|
+
retailerAddressFormatted: string;
|
|
7
|
+
variant: IProductVariant;
|
|
8
|
+
};
|
|
9
|
+
export interface IProductSizeEventData extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
10
|
+
onDemandFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
11
|
+
shippingFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
12
|
+
}
|
|
13
|
+
export interface IBaseProductEventData extends Omit<IProduct, 'sizes'> {
|
|
49
14
|
identifier: string;
|
|
50
15
|
selectedSizeId: string | null;
|
|
51
|
-
selectedFulfillmentId: string | null;
|
|
52
16
|
selectedFulfillmentType: FulfillmentType;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
category: string;
|
|
58
|
-
classification: string;
|
|
59
|
-
type: string;
|
|
60
|
-
salsifyGrouping: string;
|
|
61
|
-
subType: string;
|
|
62
|
-
images: string[];
|
|
63
|
-
region: string;
|
|
64
|
-
country: string;
|
|
65
|
-
material: string;
|
|
66
|
-
abv: string;
|
|
67
|
-
proof: string;
|
|
68
|
-
age: string;
|
|
69
|
-
color: string;
|
|
70
|
-
flavor: string;
|
|
71
|
-
variety: string;
|
|
72
|
-
appellation: string;
|
|
73
|
-
vintage: string;
|
|
74
|
-
description: string;
|
|
75
|
-
htmlDescription: string;
|
|
76
|
-
tastingNotes: string;
|
|
77
|
-
noAvailabilityPrice: number;
|
|
78
|
-
sizes: Record<string, IBaseProductSizeEventData>;
|
|
17
|
+
selectedFulfillmentId: string | null;
|
|
18
|
+
productHasAvailability: boolean;
|
|
19
|
+
fulfillmentHasAvailability: boolean;
|
|
20
|
+
sizes: Record<string, IProductSizeEventData>;
|
|
79
21
|
}
|
|
80
22
|
export interface IProductLoadedEventData extends IBaseProductEventData {
|
|
81
23
|
}
|
|
@@ -94,7 +36,7 @@ export interface IProductAddToCartEventData {
|
|
|
94
36
|
export interface IProductSizeChangedEventData {
|
|
95
37
|
identifier: string;
|
|
96
38
|
selectedSizeId: string;
|
|
97
|
-
|
|
39
|
+
selectedSize: string;
|
|
98
40
|
previousSizeId: string;
|
|
99
41
|
previousSize: string;
|
|
100
42
|
}
|
|
@@ -10,7 +10,7 @@ import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
|
10
10
|
import { StoreService } from '@/core/store/store.service';
|
|
11
11
|
import { TelemetryService } from '@/core/telemetry/telemetry.service';
|
|
12
12
|
import { type ComponentType } from '@/enums';
|
|
13
|
-
import type {
|
|
13
|
+
import type { IInjectProductElement, IInjectProductListParams, IInjectedComponent, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
|
|
14
14
|
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
15
15
|
export declare abstract class ElementsBaseClient {
|
|
16
16
|
protected readonly authClient: AuthClientService;
|
|
@@ -2,6 +2,7 @@ import type { DeepPartial } from '@/interfaces/core.interface';
|
|
|
2
2
|
export type FulfillmentDisplayType = 'carousel' | 'popup';
|
|
3
3
|
export interface IProductLayout {
|
|
4
4
|
showImages: boolean;
|
|
5
|
+
showOnlyMainImage: boolean;
|
|
5
6
|
showTitle: boolean;
|
|
6
7
|
showDescription: boolean;
|
|
7
8
|
showQuantityCounter: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
-
|
|
2
|
+
import type { ICartComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CartBodyComponent extends BaseComponent<null, ICartComponent> {
|
|
3
4
|
get hostClasses(): string[];
|
|
4
5
|
constructor();
|
|
5
6
|
private createEmptyCartElement;
|
package/package.json
CHANGED