@liquidcommerce/elements-sdk 2.2.0-beta.5 → 2.2.0-beta.7
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 +7550 -7279
- package/dist/types/core/client/client-action.service.d.ts +13 -11
- package/dist/types/modules/address/address.command.d.ts +1 -1
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-price.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-retailers.component.d.ts +1 -0
- package/package.json +1 -1
- package/umd/elements.js +1 -1
|
@@ -9,18 +9,19 @@ export interface IProductActions {
|
|
|
9
9
|
export interface IAddressActions {
|
|
10
10
|
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
11
11
|
setAddressManually: (address: Omit<IAddress, 'id'>, coordinates: ICoords) => Promise<void>;
|
|
12
|
-
clear: () => void
|
|
12
|
+
clear: () => Promise<void>;
|
|
13
13
|
getDetails: () => IAddressData | null;
|
|
14
14
|
}
|
|
15
|
+
export interface IAddProductParams {
|
|
16
|
+
identifier: string;
|
|
17
|
+
fulfillmentType: FulfillmentType;
|
|
18
|
+
quantity: number;
|
|
19
|
+
}
|
|
15
20
|
export interface ICartActions {
|
|
16
21
|
openCart: () => void;
|
|
17
22
|
closeCart: () => void;
|
|
18
23
|
toggleCart: () => void;
|
|
19
|
-
addProduct: (params:
|
|
20
|
-
identifier: string;
|
|
21
|
-
fulfillmentType: FulfillmentType;
|
|
22
|
-
quantity: number;
|
|
23
|
-
}>, openCart?: boolean) => Promise<void>;
|
|
24
|
+
addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
|
|
24
25
|
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
25
26
|
removePromoCode: () => Promise<void>;
|
|
26
27
|
resetCart: () => Promise<void>;
|
|
@@ -30,11 +31,7 @@ export interface ICheckoutActions {
|
|
|
30
31
|
openCheckout: () => void;
|
|
31
32
|
closeCheckout: () => void;
|
|
32
33
|
toggleCheckout: () => void;
|
|
33
|
-
addProduct: (params:
|
|
34
|
-
identifier: string;
|
|
35
|
-
fulfillmentType: FulfillmentType;
|
|
36
|
-
quantity: number;
|
|
37
|
-
}>, openCheckout?: boolean) => Promise<void>;
|
|
34
|
+
addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
|
|
38
35
|
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
39
36
|
removePromoCode: () => Promise<void>;
|
|
40
37
|
applyGiftCard: (code: string) => Promise<void>;
|
|
@@ -54,8 +51,13 @@ export declare class ClientActionService {
|
|
|
54
51
|
private readonly api;
|
|
55
52
|
private readonly themeProvider;
|
|
56
53
|
private readonly logger;
|
|
54
|
+
private pendingCartParams;
|
|
55
|
+
private pendingCartOpenFlag;
|
|
57
56
|
constructor();
|
|
58
57
|
static getInstance(): ClientActionService;
|
|
58
|
+
private setupAddressUpdateListener;
|
|
59
|
+
private retryPendingCartOperation;
|
|
60
|
+
private clearPendingCartOperation;
|
|
59
61
|
private getLocation;
|
|
60
62
|
private productActions;
|
|
61
63
|
private addressActions;
|
|
@@ -10,7 +10,7 @@ export declare class AddressCommands extends BaseCommand {
|
|
|
10
10
|
getAddressDetails(addressId: string): Promise<IAddressDetailsResult>;
|
|
11
11
|
setSelectedAddress(addressData: IAddressData): Promise<void>;
|
|
12
12
|
setAddressManually(address: Omit<IAddress, 'id'>, coordinates: ICoords): Promise<void>;
|
|
13
|
-
clearSelectedAddress(): void
|
|
13
|
+
clearSelectedAddress(): Promise<void>;
|
|
14
14
|
private shouldResetCartForAddressChange;
|
|
15
15
|
private persistSessionData;
|
|
16
16
|
getDetails(): IAddressData | null;
|
|
@@ -9,6 +9,7 @@ export declare class ProductAddToCartSectionComponent extends BaseComponent<IAdd
|
|
|
9
9
|
private qtyDecreaseButton;
|
|
10
10
|
private quantityText;
|
|
11
11
|
get hostClasses(): string[];
|
|
12
|
+
get hostAttributes(): Record<string, string>;
|
|
12
13
|
constructor();
|
|
13
14
|
private getProductId;
|
|
14
15
|
private getAvailableQuantity;
|
|
@@ -5,6 +5,7 @@ export interface IProductPriceComponentParams {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class ProductPriceComponent extends BaseComponent<IProductPriceComponentParams, IProductComponent> {
|
|
7
7
|
get hostClasses(): string[];
|
|
8
|
+
get hostAttributes(): Record<string, string>;
|
|
8
9
|
constructor();
|
|
9
10
|
private getProductId;
|
|
10
11
|
protected template(): string;
|
|
@@ -6,6 +6,7 @@ export interface IProductRetailersComponent {
|
|
|
6
6
|
export declare class ProductRetailersComponent extends BaseComponent<IProductRetailersComponent, IProductComponent> {
|
|
7
7
|
get hostClasses(): string[];
|
|
8
8
|
constructor();
|
|
9
|
+
get hostAttributes(): Record<string, string>;
|
|
9
10
|
private getProductId;
|
|
10
11
|
protected template(): HTMLElement | HTMLElement[];
|
|
11
12
|
}
|
package/package.json
CHANGED