@liquidcommerce/elements-sdk 2.7.44 → 2.7.45
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/README.md +5 -3
- package/dist/index.checkout.esm.js +10918 -8932
- package/dist/index.esm.js +13321 -11337
- package/dist/ssr-stub.esm.js +3 -0
- package/dist/types/core/a11y/focus-manager.service.d.ts +1 -1
- package/dist/types/core/api/api-result.d.ts +3 -0
- package/dist/types/core/client/actions/client-analytics-action.service.d.ts +35 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +6 -0
- package/dist/types/core/client/client-action.service.d.ts +1 -0
- package/dist/types/core/client/client-config.service.d.ts +2 -0
- package/dist/types/core/google-tag-manager.service.d.ts +3 -2
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +6 -0
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +3 -1
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +4 -0
- package/dist/types/enums/core.enum.d.ts +3 -0
- package/dist/types/index.checkout.d.ts +4 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/analytics.interface.d.ts +41 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +2 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +7 -1
- package/dist/types/interfaces/api/delivery.interface.d.ts +24 -0
- package/dist/types/interfaces/api/index.d.ts +1 -0
- package/dist/types/interfaces/api/product.interface.d.ts +2 -0
- package/dist/types/interfaces/client.interface.d.ts +5 -0
- package/dist/types/interfaces/config.interface.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +3 -1
- package/dist/types/modules/cart/components/cart-item.component.d.ts +2 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +41 -0
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-delivery-method.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-delivery-scheduling.component.d.ts +53 -0
- package/dist/types/modules/checkout/components/checkout-express-checkout.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-item.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/index.d.ts +1 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +5 -0
- package/dist/types/ssr/stub.checkout.d.ts +3 -1
- package/dist/types/ssr/stub.d.ts +3 -1
- package/dist/types/utils/delivery-scheduling.d.ts +75 -0
- package/dist/types/utils/fulfillment-unavailable.d.ts +8 -0
- package/docs/v1/README.md +1 -0
- package/docs/v1/api/actions/analytics-actions.md +326 -0
- package/docs/v1/api/actions/checkout-actions.md +47 -2
- package/docs/v1/api/actions/product-actions.md +1 -0
- package/docs/v1/api/client.md +9 -2
- package/docs/v1/api/configuration.md +4 -0
- package/docs/v1/api/typescript-types.md +110 -1
- package/docs/v1/guides/accessibility.md +8 -1
- package/docs/v1/guides/cart-component.md +2 -0
- package/docs/v1/guides/checkout-component.md +64 -2
- package/docs/v1/guides/events.md +36 -2
- package/docs/v1/guides/product-component.md +6 -0
- package/docs/v1/reference/analytics.md +52 -9
- package/package.json +1 -1
package/dist/ssr-stub.esm.js
CHANGED
|
@@ -115,6 +115,7 @@ const ELEMENTS_ACTIONS_EVENT = {
|
|
|
115
115
|
CART_PRODUCT_ADD_FAILED: 'cart_product_add_failed',
|
|
116
116
|
INTERNAL_CART_TO_CHECKOUT: 'internal_cart_to_checkout',
|
|
117
117
|
CHECKOUT_LOADED: 'checkout_loaded',
|
|
118
|
+
CHECKOUT_DELIVERY_SELECTION_UPDATED: 'checkout_delivery_selection_updated',
|
|
118
119
|
CHECKOUT_OPENED: 'checkout_opened',
|
|
119
120
|
CHECKOUT_CLOSED: 'checkout_closed',
|
|
120
121
|
CHECKOUT_FAILED: 'checkout_failed',
|
|
@@ -142,6 +143,7 @@ const ELEMENTS_ACTIONS_EVENT = {
|
|
|
142
143
|
CHECKOUT_PRODUCT_ADD_SUCCESS: 'checkout_product_add_success',
|
|
143
144
|
CHECKOUT_PRODUCT_ADD_FAILED: 'checkout_product_add_failed',
|
|
144
145
|
CHECKOUT_EXPRESS_CHECKOUT_AVAILABILITY: 'checkout_express_checkout_availability',
|
|
146
|
+
CHECKOUT_EXPRESS_CHECKOUT_STARTED: 'checkout_express_checkout_started',
|
|
145
147
|
CHECKOUT_PAYMENT_FORM_FAILED: 'checkout_payment_form_failed',
|
|
146
148
|
};
|
|
147
149
|
const ELEMENTS_FORM = {
|
|
@@ -215,6 +217,7 @@ const COMPONENT_TYPE = {
|
|
|
215
217
|
CHECKOUT_BUYER: 'checkout-buyer',
|
|
216
218
|
CHECKOUT_BUYER_SUMMARY: 'checkout-buyer-summary',
|
|
217
219
|
CHECKOUT_TIPS: 'checkout-tips',
|
|
220
|
+
CHECKOUT_DELIVERY_SCHEDULING: 'checkout-delivery-scheduling',
|
|
218
221
|
CHECKOUT_PC_GC: 'checkout-pc-gc',
|
|
219
222
|
CHECKOUT_ITEM: 'checkout-item',
|
|
220
223
|
CHECKOUT_ITEM_QUANTITY: 'checkout-item-quantity',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const A11Y_PERSIST_ATTRIBUTE = "data-lce-a11y-persist";
|
|
2
|
-
export type FocusScope = 'drawer' | 'product-drawer';
|
|
2
|
+
export type FocusScope = 'drawer' | 'product-drawer' | 'delivery-scheduling';
|
|
3
3
|
export declare class FocusManagerService {
|
|
4
4
|
private readonly triggerStacks;
|
|
5
5
|
private hiddenBackground;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IAnalyticsAddress, IAnalyticsAddressFailure, IAnalyticsAvailability, IAnalyticsFulfillmentAvailability, IAnalyticsItem, IAnalyticsItemList } from '@/interfaces/analytics.interface';
|
|
2
|
+
import { BaseActionService } from './base-action.service';
|
|
3
|
+
export interface IAnalyticsActions {
|
|
4
|
+
search: (searchTerm: string) => void;
|
|
5
|
+
viewItem: (item: IAnalyticsItem) => void;
|
|
6
|
+
viewItemList: (items: IAnalyticsItem[], list?: IAnalyticsItemList) => void;
|
|
7
|
+
selectItem: (item: IAnalyticsItem, list?: IAnalyticsItemList) => void;
|
|
8
|
+
addToCart: (item: IAnalyticsItem) => void;
|
|
9
|
+
removeFromCart: (item: IAnalyticsItem) => void;
|
|
10
|
+
viewCart: (items: IAnalyticsItem[]) => void;
|
|
11
|
+
beginCheckout: (items: IAnalyticsItem[], options?: {
|
|
12
|
+
coupon?: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
addressUpdated: (address: IAnalyticsAddress) => void;
|
|
15
|
+
addressFailed: (failure: IAnalyticsAddressFailure) => void;
|
|
16
|
+
productNoAvailability: (details: IAnalyticsAvailability) => void;
|
|
17
|
+
productSizeNoAvailability: (details: IAnalyticsAvailability) => void;
|
|
18
|
+
productFulfillmentNoAvailability: (details: IAnalyticsFulfillmentAvailability) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare class ClientAnalyticsActionService extends BaseActionService {
|
|
21
|
+
private readonly googleTagManager;
|
|
22
|
+
constructor();
|
|
23
|
+
static getInstance(): ClientAnalyticsActionService;
|
|
24
|
+
get actions(): IAnalyticsActions;
|
|
25
|
+
private report;
|
|
26
|
+
private check;
|
|
27
|
+
private toGtmItem;
|
|
28
|
+
private toGtmItems;
|
|
29
|
+
private toList;
|
|
30
|
+
private toAvailability;
|
|
31
|
+
private toOptionalString;
|
|
32
|
+
private toAddress;
|
|
33
|
+
private toCoordinates;
|
|
34
|
+
private validateItem;
|
|
35
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
2
2
|
import type { IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse, ICheckoutMarketingPreferences } from '@/interfaces/api/checkout.interface';
|
|
3
|
+
import type { DeliverySlot } from '@/interfaces/api/delivery.interface';
|
|
3
4
|
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
4
5
|
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
|
|
5
6
|
import { BaseActionService } from './base-action.service';
|
|
@@ -35,6 +36,8 @@ export interface ICheckoutActions {
|
|
|
35
36
|
}) => Promise<void>;
|
|
36
37
|
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
37
38
|
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
39
|
+
loadDeliverySlots: (fulfillmentId: string) => Promise<DeliverySlot[]>;
|
|
40
|
+
chooseDeliverySlot: (fulfillmentId: string, slotId: string | null) => Promise<void>;
|
|
38
41
|
getDetails: () => ICheckoutDetailsEventData;
|
|
39
42
|
getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
|
|
40
43
|
addAnonymousProduct: (params: IAnonymousCheckoutAddProductParams) => Promise<IAnonymousCheckoutAddProductResponse>;
|
|
@@ -53,6 +56,7 @@ export declare class ClientCheckoutActionService extends BaseActionService {
|
|
|
53
56
|
private openCheckout;
|
|
54
57
|
private closeCheckout;
|
|
55
58
|
private toggleCheckout;
|
|
59
|
+
private reportCheckoutOpened;
|
|
56
60
|
private exitCheckout;
|
|
57
61
|
private setSavedPaymentMethod;
|
|
58
62
|
private clearSavedPaymentMethod;
|
|
@@ -69,6 +73,8 @@ export declare class ClientCheckoutActionService extends BaseActionService {
|
|
|
69
73
|
private updateCustomerInfo;
|
|
70
74
|
private updateBillingInfo;
|
|
71
75
|
private updateGiftInfo;
|
|
76
|
+
private loadDeliverySlots;
|
|
77
|
+
private chooseDeliverySlot;
|
|
72
78
|
private getDetails;
|
|
73
79
|
private addAnonymousProduct;
|
|
74
80
|
private getProductAvailabilityByState;
|
|
@@ -4,6 +4,7 @@ export declare class ClientActionService {
|
|
|
4
4
|
private readonly addressActionService;
|
|
5
5
|
private readonly cartActionService;
|
|
6
6
|
private readonly checkoutActionService;
|
|
7
|
+
private readonly analyticsActionService;
|
|
7
8
|
constructor();
|
|
8
9
|
static getInstance(): ClientActionService;
|
|
9
10
|
get actions(): ILiquidCommerceElementsActions;
|
|
@@ -23,6 +23,7 @@ export interface IClientConfigs {
|
|
|
23
23
|
openShadowDom?: boolean;
|
|
24
24
|
hasCustomApiUrl?: boolean;
|
|
25
25
|
mockMode: boolean;
|
|
26
|
+
enableExpressCheckout: boolean;
|
|
26
27
|
checkout: ILiquidCommerceElementsCheckoutConfig | null;
|
|
27
28
|
isCheckoutOnly: boolean;
|
|
28
29
|
}
|
|
@@ -38,6 +39,7 @@ export interface IClientConfigInput {
|
|
|
38
39
|
customApiUrl?: string;
|
|
39
40
|
openShadowDom?: boolean;
|
|
40
41
|
mockMode?: boolean;
|
|
42
|
+
enableExpressCheckout?: boolean;
|
|
41
43
|
};
|
|
42
44
|
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
43
45
|
isCheckoutOnly?: boolean;
|
|
@@ -101,6 +101,7 @@ export declare class GoogleTagManagerService {
|
|
|
101
101
|
gift_cards?: number;
|
|
102
102
|
net_total?: number;
|
|
103
103
|
}): void;
|
|
104
|
+
search(searchTerm: string): void;
|
|
104
105
|
promoCodeAttempt(code: string): void;
|
|
105
106
|
promoCodeApplied(code: string, discount?: number): void;
|
|
106
107
|
promoCodeFailed(code: string, reason?: string): void;
|
|
@@ -108,8 +109,8 @@ export declare class GoogleTagManagerService {
|
|
|
108
109
|
giftCardApplied(code: string, appliedAmount?: number): void;
|
|
109
110
|
giftCardFailed(code: string, reason?: string): void;
|
|
110
111
|
addressUpdated(addressData: {
|
|
111
|
-
googlePlacesId
|
|
112
|
-
formattedAddress
|
|
112
|
+
googlePlacesId?: string;
|
|
113
|
+
formattedAddress?: string;
|
|
113
114
|
address: {
|
|
114
115
|
one?: string;
|
|
115
116
|
two?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ICheckoutAmounts, ICheckoutItem } from '@/interfaces/api/checkout.interface';
|
|
2
|
+
import type { CheckoutDeliveryScheduling } from '@/interfaces/api/delivery.interface';
|
|
2
3
|
export interface IBaseCheckoutEventData {
|
|
3
4
|
token: string;
|
|
4
5
|
cartId: string;
|
|
@@ -12,6 +13,7 @@ export interface IBaseCheckoutEventData {
|
|
|
12
13
|
hasGiftCards: boolean;
|
|
13
14
|
amounts: ICheckoutAmounts;
|
|
14
15
|
itemCount: number;
|
|
16
|
+
deliveryScheduling: Record<string, CheckoutDeliveryScheduling>;
|
|
15
17
|
items: Record<string, ICheckoutItem>;
|
|
16
18
|
}
|
|
17
19
|
export interface ICheckoutLoadedEventData extends IBaseCheckoutEventData {
|
|
@@ -118,6 +120,10 @@ export interface ICheckoutExpressCheckoutAvailabilityEventData {
|
|
|
118
120
|
available: boolean;
|
|
119
121
|
wallets: string[];
|
|
120
122
|
}
|
|
123
|
+
export interface ICheckoutExpressCheckoutStartedEventData {
|
|
124
|
+
cartId: string;
|
|
125
|
+
wallet: string;
|
|
126
|
+
}
|
|
121
127
|
export interface ICheckoutPaymentFormFailedEventData {
|
|
122
128
|
cartId: string;
|
|
123
129
|
reason: 'blocked' | 'timeout' | 'error';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IAddressActionEventData, IAddressFailedEventData } from '@/core/pubsub/interfaces/address.interface';
|
|
2
2
|
import type { ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartShopRetailerEventData, ICartUpdatedEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
|
-
import type { ICheckoutBillingInformationUpdatedEventData, ICheckoutCustomerInformationUpdatedEventData, ICheckoutDeliveryMethodUpdatedEventData, ICheckoutExpressCheckoutAvailabilityEventData, ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutGiftInformationUpdatedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutPaymentFormFailedEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
|
+
import type { ICheckoutBillingInformationUpdatedEventData, ICheckoutCustomerInformationUpdatedEventData, ICheckoutDeliveryMethodUpdatedEventData, ICheckoutDetailsEventData, ICheckoutExpressCheckoutAvailabilityEventData, ICheckoutExpressCheckoutStartedEventData, ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutGiftInformationUpdatedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutPaymentFormFailedEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
4
4
|
import type { IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
5
5
|
import { ELEMENTS_ACTIONS_EVENT } from '@/enums';
|
|
6
6
|
export interface IElementsClientIsReadyEventData {
|
|
@@ -58,6 +58,7 @@ export interface IElementsActionsEventsMap {
|
|
|
58
58
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_OPENED]: boolean;
|
|
59
59
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CLOSED]: boolean;
|
|
60
60
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_LOADED]: ICheckoutLoadedEventData;
|
|
61
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_DELIVERY_SELECTION_UPDATED]: ICheckoutDetailsEventData;
|
|
61
62
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_FAILED]: ICheckoutFailedEventData;
|
|
62
63
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_IS_GIFT_TOGGLED]: ICheckoutToggleEventData;
|
|
63
64
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED]: ICheckoutToggleEventData;
|
|
@@ -83,6 +84,7 @@ export interface IElementsActionsEventsMap {
|
|
|
83
84
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PRODUCT_ADD_SUCCESS]: ICheckoutProductAddEventData;
|
|
84
85
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PRODUCT_ADD_FAILED]: ICheckoutProductAddFailedEventData;
|
|
85
86
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_EXPRESS_CHECKOUT_AVAILABILITY]: ICheckoutExpressCheckoutAvailabilityEventData;
|
|
87
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_EXPRESS_CHECKOUT_STARTED]: ICheckoutExpressCheckoutStartedEventData;
|
|
86
88
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_PAYMENT_FORM_FAILED]: ICheckoutPaymentFormFailedEventData;
|
|
87
89
|
}
|
|
88
90
|
export type SpecificActionEvent = keyof IElementsActionsEventsMap;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ICheckoutAmounts, ICheckoutBilling, ICheckoutCustomer, ICheckoutEvent, ICheckoutFulfillment, ICheckoutFulfillmentMethod, ICheckoutGiftCard, ICheckoutGiftRecipient, ICheckoutItem, ICheckoutMarketingPreferences, ICheckoutPaymentConfirm, ICheckoutPaymentSession, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer, ICheckoutShippingAddress } from '@/interfaces/api/checkout.interface';
|
|
2
|
+
export type DeliveryWindowLapse = 'expired' | 'unavailable' | 'required';
|
|
2
3
|
export interface ICheckoutItemStore extends ICheckoutItem {
|
|
3
4
|
loading: boolean;
|
|
4
5
|
updating: boolean;
|
|
@@ -64,6 +65,9 @@ export interface ICheckoutStore {
|
|
|
64
65
|
itemsQuantity: number;
|
|
65
66
|
items: Record<string, ICheckoutItemStore>;
|
|
66
67
|
fulfillments: Record<string, ICheckoutFulfillment>;
|
|
68
|
+
deliveryWindowLapses: Record<string, DeliveryWindowLapse>;
|
|
69
|
+
deliveryScheduleNotice: string | null;
|
|
70
|
+
splitStoreDeliveryRefused: boolean;
|
|
67
71
|
retailers: Record<string, ICheckoutRetailer>;
|
|
68
72
|
amounts: ICheckoutAmounts;
|
|
69
73
|
orderNumber: string | null;
|
|
@@ -34,6 +34,7 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
34
34
|
readonly CART_PRODUCT_ADD_FAILED: "cart_product_add_failed";
|
|
35
35
|
readonly INTERNAL_CART_TO_CHECKOUT: "internal_cart_to_checkout";
|
|
36
36
|
readonly CHECKOUT_LOADED: "checkout_loaded";
|
|
37
|
+
readonly CHECKOUT_DELIVERY_SELECTION_UPDATED: "checkout_delivery_selection_updated";
|
|
37
38
|
readonly CHECKOUT_OPENED: "checkout_opened";
|
|
38
39
|
readonly CHECKOUT_CLOSED: "checkout_closed";
|
|
39
40
|
readonly CHECKOUT_FAILED: "checkout_failed";
|
|
@@ -61,6 +62,7 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
61
62
|
readonly CHECKOUT_PRODUCT_ADD_SUCCESS: "checkout_product_add_success";
|
|
62
63
|
readonly CHECKOUT_PRODUCT_ADD_FAILED: "checkout_product_add_failed";
|
|
63
64
|
readonly CHECKOUT_EXPRESS_CHECKOUT_AVAILABILITY: "checkout_express_checkout_availability";
|
|
65
|
+
readonly CHECKOUT_EXPRESS_CHECKOUT_STARTED: "checkout_express_checkout_started";
|
|
64
66
|
readonly CHECKOUT_PAYMENT_FORM_FAILED: "checkout_payment_form_failed";
|
|
65
67
|
};
|
|
66
68
|
export declare const ELEMENTS_FORM: {
|
|
@@ -134,6 +136,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
134
136
|
readonly CHECKOUT_BUYER: "checkout-buyer";
|
|
135
137
|
readonly CHECKOUT_BUYER_SUMMARY: "checkout-buyer-summary";
|
|
136
138
|
readonly CHECKOUT_TIPS: "checkout-tips";
|
|
139
|
+
readonly CHECKOUT_DELIVERY_SCHEDULING: "checkout-delivery-scheduling";
|
|
137
140
|
readonly CHECKOUT_PC_GC: "checkout-pc-gc";
|
|
138
141
|
readonly CHECKOUT_ITEM: "checkout-item";
|
|
139
142
|
readonly CHECKOUT_ITEM_QUANTITY: "checkout-item-quantity";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ElementsCheckout } from '@/clients/checkout';
|
|
2
2
|
import type { DebugMode, ElementsEnv } from '@/enums';
|
|
3
3
|
import { DEBUG_MODE, ELEMENTS_ENV } from '@/enums';
|
|
4
|
-
import type {
|
|
4
|
+
import type { IAnalyticsAddress, IAnalyticsAddressFailure, IAnalyticsAvailability, IAnalyticsFulfillmentAvailability, IAnalyticsItem, IAnalyticsItemList } from '@/interfaces/analytics.interface';
|
|
5
|
+
import type { IAnalyticsActions, IElementsCheckoutActions, IElementsCheckoutClient } from '@/interfaces/client.interface';
|
|
5
6
|
import type { IInjectedComponent } from '@/interfaces/component.interface';
|
|
6
7
|
import type { ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/config.interface';
|
|
7
8
|
import type { IInjectCheckoutParams, IInjectExpressCheckoutParams } from '@/interfaces/injection.interface';
|
|
8
|
-
export type {
|
|
9
|
+
export type { CheckoutDeliveryScheduling, CheckoutDeliverySelection, DeliveryAvailability, DeliverySlot, } from './interfaces/api/delivery.interface';
|
|
10
|
+
export type { DebugMode, ElementsEnv, IAnalyticsActions, IAnalyticsAddress, IAnalyticsAddressFailure, IAnalyticsAvailability, IAnalyticsFulfillmentAvailability, IAnalyticsItem, IAnalyticsItemList, IElementsCheckoutActions, IElementsCheckoutClient, IInjectCheckoutParams, IInjectExpressCheckoutParams, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig, };
|
|
9
11
|
export { DEBUG_MODE, ELEMENTS_ENV, ElementsCheckout };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './clients/main';
|
|
|
3
3
|
export * from './core/sdk-error-handler';
|
|
4
4
|
export * from './enums';
|
|
5
5
|
export type { LiquidCommerceGlobal } from './global';
|
|
6
|
+
export * from './interfaces/analytics.interface';
|
|
6
7
|
export * from './interfaces/api';
|
|
7
8
|
export * from './interfaces/client.interface';
|
|
8
9
|
export * from './interfaces/component.interface';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FulfillmentType } from '@/enums';
|
|
2
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
3
|
+
export interface IAnalyticsItem {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
brand?: string;
|
|
7
|
+
size?: string;
|
|
8
|
+
categoryPath?: string;
|
|
9
|
+
price?: number;
|
|
10
|
+
quantity?: number;
|
|
11
|
+
type?: string;
|
|
12
|
+
subType?: string;
|
|
13
|
+
image?: string;
|
|
14
|
+
upc?: string;
|
|
15
|
+
groupingId?: string;
|
|
16
|
+
index?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface IAnalyticsItemList {
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IAnalyticsAddress {
|
|
23
|
+
placesId?: string;
|
|
24
|
+
formattedAddress?: string;
|
|
25
|
+
address: Partial<IAddressAddress>;
|
|
26
|
+
coordinates?: IAddressCoordinates;
|
|
27
|
+
}
|
|
28
|
+
export interface IAnalyticsAddressFailure {
|
|
29
|
+
placesId?: string;
|
|
30
|
+
formattedAddress?: string;
|
|
31
|
+
address?: Partial<IAddressAddress>;
|
|
32
|
+
error: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IAnalyticsAvailability {
|
|
35
|
+
item: IAnalyticsItem;
|
|
36
|
+
reason: string;
|
|
37
|
+
address?: Partial<IAddressAddress>;
|
|
38
|
+
}
|
|
39
|
+
export interface IAnalyticsFulfillmentAvailability extends IAnalyticsAvailability {
|
|
40
|
+
fulfillmentType: FulfillmentType;
|
|
41
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CartEventLevel, CartEventType, FulfillmentType } from '@/enums';
|
|
2
2
|
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
3
|
+
import type { DeliveryAvailability } from '@/interfaces/api/delivery.interface';
|
|
3
4
|
import type { IProductPresale } from '@/interfaces/api/product.interface';
|
|
4
5
|
export interface ICartUpdateItem {
|
|
5
6
|
id?: string;
|
|
@@ -24,6 +25,7 @@ export interface ICartFulfillment {
|
|
|
24
25
|
subtotal: number;
|
|
25
26
|
hasUnmetMinimumPurchaseAmount: boolean;
|
|
26
27
|
minimumPurchaseAmount: number;
|
|
28
|
+
deliveryAvailability?: DeliveryAvailability;
|
|
27
29
|
}
|
|
28
30
|
export interface ICartRetailer {
|
|
29
31
|
id: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CheckoutEventLevel, CheckoutEventType, FulfillmentType } from '@/enums';
|
|
2
2
|
import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
|
|
3
3
|
import type { ICart, ICartUpdateItem } from '@/interfaces/api/cart.interface';
|
|
4
|
+
import type { CheckoutDeliveryScheduling, CheckoutDeliverySelection, DeliveryAvailability } from '@/interfaces/api/delivery.interface';
|
|
4
5
|
import type { IProductPresale } from '@/interfaces/api/product.interface';
|
|
5
6
|
export interface ICheckoutComplete {
|
|
6
7
|
orderNumber: string;
|
|
@@ -80,6 +81,8 @@ export interface ICheckoutPrepareParams {
|
|
|
80
81
|
giftOptions?: ICheckoutGiftRecipient;
|
|
81
82
|
marketingPreferences?: ICheckoutMarketingPreferences;
|
|
82
83
|
deliveryTips?: ICheckoutDeliveryTip[];
|
|
84
|
+
deliverySelections?: CheckoutDeliverySelection[];
|
|
85
|
+
deliverySlotsFulfillmentId?: string;
|
|
83
86
|
deliveryInstructions?: ICheckoutDeliveryInstructions[];
|
|
84
87
|
payment?: string;
|
|
85
88
|
promoCode?: string;
|
|
@@ -96,6 +99,7 @@ export interface ICheckoutItemsUpdateParams {
|
|
|
96
99
|
cartId: string;
|
|
97
100
|
items: ICheckoutUpdateItem[];
|
|
98
101
|
location?: ILocation;
|
|
102
|
+
checkout?: ICheckoutFulfillmentCarryOver;
|
|
99
103
|
}
|
|
100
104
|
export interface ICheckoutItemsUpdateResponse {
|
|
101
105
|
cart: ICart;
|
|
@@ -134,8 +138,9 @@ export interface ICheckoutFulfillmentMethod {
|
|
|
134
138
|
partNumber: string;
|
|
135
139
|
retailerId: string;
|
|
136
140
|
reason: CheckoutFulfillmentUnavailableReason | null;
|
|
141
|
+
deliveryAvailability?: DeliveryAvailability;
|
|
137
142
|
}
|
|
138
|
-
export type ICheckoutFulfillmentCarryOver = Omit<ICheckoutPrepareParams, 'cartId' | 'token' | 'deliveryTips' | 'deliveryInstructions'>;
|
|
143
|
+
export type ICheckoutFulfillmentCarryOver = Omit<ICheckoutPrepareParams, 'cartId' | 'token' | 'deliveryTips' | 'deliveryInstructions' | 'deliverySelections' | 'deliverySlotsFulfillmentId'>;
|
|
139
144
|
export interface ICheckoutFulfillmentParams {
|
|
140
145
|
cartId: string;
|
|
141
146
|
location: ILocation;
|
|
@@ -223,6 +228,7 @@ export interface ICheckoutItem {
|
|
|
223
228
|
attributes: ICheckoutItemAttributes;
|
|
224
229
|
}
|
|
225
230
|
export interface ICheckoutFulfillment {
|
|
231
|
+
deliveryScheduling?: CheckoutDeliveryScheduling;
|
|
226
232
|
id: string;
|
|
227
233
|
deliveryInstructions: string;
|
|
228
234
|
type: FulfillmentType;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface DeliverySlot {
|
|
2
|
+
id: string;
|
|
3
|
+
start: string;
|
|
4
|
+
end: string;
|
|
5
|
+
cutoff: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DeliveryAvailability {
|
|
8
|
+
status: 'available' | 'unavailable';
|
|
9
|
+
canDeliverNow: boolean;
|
|
10
|
+
canSchedule: boolean;
|
|
11
|
+
timezone: string | null;
|
|
12
|
+
nextSlot: DeliverySlot | null;
|
|
13
|
+
checkedAt: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CheckoutDeliveryScheduling {
|
|
16
|
+
availability: DeliveryAvailability;
|
|
17
|
+
slots: DeliverySlot[];
|
|
18
|
+
selectedSlotId: string | null;
|
|
19
|
+
selectedSlot?: DeliverySlot | null;
|
|
20
|
+
}
|
|
21
|
+
export interface CheckoutDeliverySelection {
|
|
22
|
+
fulfillmentId: string;
|
|
23
|
+
slotId: string | null;
|
|
24
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FulfillmentType } from '@/enums';
|
|
2
2
|
import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
|
|
3
|
+
import type { DeliveryAvailability } from '@/interfaces/api/delivery.interface';
|
|
3
4
|
export interface IProductAvailabilityParams {
|
|
4
5
|
identifiers: string[];
|
|
5
6
|
location?: ILocation;
|
|
@@ -83,6 +84,7 @@ export interface IFulfillment {
|
|
|
83
84
|
fee: number;
|
|
84
85
|
timezone: string;
|
|
85
86
|
hourStatus: IProductFulfillmentHourStatus;
|
|
87
|
+
deliveryAvailability?: DeliveryAvailability;
|
|
86
88
|
}
|
|
87
89
|
export type IRetailerAddress = IAddressAddress & IAddressCoordinates;
|
|
88
90
|
export interface IRetailer {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IAddressActions } from '@/core/client/actions/client-address-action.service';
|
|
2
|
+
import type { IAnalyticsActions } from '@/core/client/actions/client-analytics-action.service';
|
|
2
3
|
import type { ICartActions } from '@/core/client/actions/client-cart-action.service';
|
|
3
4
|
import type { ICheckoutActions } from '@/core/client/actions/client-checkout-action.service';
|
|
4
5
|
import type { IProductActions } from '@/core/client/actions/client-product-action.service';
|
|
@@ -7,6 +8,7 @@ import type { IAddressOptions } from '@/modules/address/address.interface';
|
|
|
7
8
|
import type { IInjectedComponent } from './component.interface';
|
|
8
9
|
import type { UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent, UpdateProductListComponent } from './configs';
|
|
9
10
|
import type { IBuilderInjectElementParams, IInjectCheckoutBuilderParams, IInjectCheckoutParams, IInjectExpressCheckoutParams, IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams } from './injection.interface';
|
|
11
|
+
export type { IAnalyticsActions };
|
|
10
12
|
export interface ILiquidCommerceElementsUIMethod {
|
|
11
13
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
12
14
|
floatingCartButton(showItemsCount?: boolean): void;
|
|
@@ -20,6 +22,7 @@ export interface ILiquidCommerceElementsActions {
|
|
|
20
22
|
address: IAddressActions;
|
|
21
23
|
cart: ICartActions;
|
|
22
24
|
checkout: ICheckoutActions;
|
|
25
|
+
analytics: IAnalyticsActions;
|
|
23
26
|
}
|
|
24
27
|
export interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {
|
|
25
28
|
}
|
|
@@ -28,6 +31,7 @@ export interface IElementsCheckoutClient {
|
|
|
28
31
|
injectExpressCheckout: (params: IInjectExpressCheckoutParams) => Promise<IInjectedComponent | null>;
|
|
29
32
|
actions: {
|
|
30
33
|
checkout: IElementsCheckoutActions;
|
|
34
|
+
analytics: IAnalyticsActions;
|
|
31
35
|
};
|
|
32
36
|
destroy(): void;
|
|
33
37
|
}
|
|
@@ -66,6 +70,7 @@ export interface ILiquidCommerceElementsCheckoutClient {
|
|
|
66
70
|
injectCheckout(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
67
71
|
actions: {
|
|
68
72
|
checkout: IElementsCheckoutActions;
|
|
73
|
+
analytics: IAnalyticsActions;
|
|
69
74
|
};
|
|
70
75
|
destroy(): void;
|
|
71
76
|
}
|
|
@@ -14,6 +14,7 @@ export interface ILiquidCommerceElementsDevelopmentConfig {
|
|
|
14
14
|
customApiUrl?: string;
|
|
15
15
|
openShadowDom?: boolean;
|
|
16
16
|
mockMode?: boolean;
|
|
17
|
+
enableExpressCheckout?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export interface IClientCustomThemeConfig {
|
|
19
20
|
global?: UpdateComponentGlobalConfigs;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
2
|
import type { IBaseCartEventData, ICartShopRetailerEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
|
+
import type { ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
3
4
|
export interface AddItemParams {
|
|
4
5
|
fulfillmentId: string;
|
|
5
6
|
partNumber: string;
|
|
@@ -19,7 +20,8 @@ export declare class CartCommands extends BaseCommand {
|
|
|
19
20
|
updateItemEngraving(productItemId: string, engravingLines: string[]): Promise<void>;
|
|
20
21
|
addItem(params: AddItemParams): Promise<void>;
|
|
21
22
|
handleGoToCheckout(): Promise<void>;
|
|
22
|
-
|
|
23
|
+
trackViewCart(): void;
|
|
24
|
+
trackBeginCheckout(cartStore: ICartStore): void;
|
|
23
25
|
private resolveCheckoutRedirectUrl;
|
|
24
26
|
applyPromoCode(promoCode: string): Promise<void>;
|
|
25
27
|
removePromoCode(): Promise<void>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICartFulfillmentStore } from '@/core/store/interfaces/cart.interface';
|
|
2
3
|
export interface ICartItemComponentParams {
|
|
3
4
|
itemId: string;
|
|
4
5
|
}
|
|
6
|
+
export declare function cartItemExpectationText(fulfillment: ICartFulfillmentStore, hasEngraving: boolean): string;
|
|
5
7
|
export declare class CartItemComponent extends BaseComponent<ICartItemComponentParams, null> {
|
|
6
8
|
get hostClasses(): string[];
|
|
7
9
|
get hostAttributes(): Record<string, string>;
|
|
@@ -3,6 +3,7 @@ import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkou
|
|
|
3
3
|
import type { ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
4
|
import type { FulfillmentType } from '@/enums';
|
|
5
5
|
import type { CheckoutPaymentSessionType, ICheckoutBilling, ICheckoutCustomer, ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPaymentSession, ICheckoutPrepare } from '@/interfaces/api/checkout.interface';
|
|
6
|
+
import type { DeliverySlot } from '@/interfaces/api/delivery.interface';
|
|
6
7
|
import type { AddItemParams } from '@/modules/cart/cart.commands';
|
|
7
8
|
import type { PresaleExpiredReason } from '@/modules/checkout/components';
|
|
8
9
|
import { type IExpressWalletBillingDetails } from '@/modules/checkout/express-wallet';
|
|
@@ -22,9 +23,39 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
22
23
|
private customerEditRevision;
|
|
23
24
|
private customerEditedGeneration;
|
|
24
25
|
private confirmedPayment;
|
|
26
|
+
private offeredDeliverySlots;
|
|
27
|
+
private offeredDeliveryAddress;
|
|
28
|
+
private savingDeliverySelection;
|
|
25
29
|
private expressHandoff;
|
|
26
30
|
private get requiresBirthDate();
|
|
27
31
|
assertPaymentReady(): void;
|
|
32
|
+
private assertDeliveryScheduleReady;
|
|
33
|
+
private lapsedDeliveryWindowIds;
|
|
34
|
+
private clearLapsedDeliveryWindows;
|
|
35
|
+
private offeredSlots;
|
|
36
|
+
private findOfferedDeliverySlot;
|
|
37
|
+
loadDeliverySlots(fulfillmentId: string): Promise<DeliverySlot[]>;
|
|
38
|
+
chooseDeliverySlot(fulfillmentId: string, slotId: string | null): Promise<void>;
|
|
39
|
+
private deliverySelectionError;
|
|
40
|
+
private completionError;
|
|
41
|
+
private freshCart;
|
|
42
|
+
private dropDeliveryScheduling;
|
|
43
|
+
private lapsedWindowGroupIds;
|
|
44
|
+
private scheduledGroupIds;
|
|
45
|
+
private forgetDeliveryWindow;
|
|
46
|
+
private assertDeliverySlotChoosable;
|
|
47
|
+
private responseFulfillments;
|
|
48
|
+
private findResponseFulfillment;
|
|
49
|
+
private withDeliverySlotDetails;
|
|
50
|
+
private responseFulfillmentIds;
|
|
51
|
+
private expiredDeliveryMarksWith;
|
|
52
|
+
private pruneExpiredDeliveryWindows;
|
|
53
|
+
private expireDeliveryWindows;
|
|
54
|
+
private requestPrepare;
|
|
55
|
+
private withStoreNamedFailure;
|
|
56
|
+
private knownRetailers;
|
|
57
|
+
private prepareWithWindowRecovery;
|
|
58
|
+
private prepareRecoveringWindow;
|
|
28
59
|
retryLoadCheckout(): Promise<void>;
|
|
29
60
|
private paymentSessionRequest;
|
|
30
61
|
constructor();
|
|
@@ -129,10 +160,20 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
129
160
|
private deliveryMethodCarryOver;
|
|
130
161
|
private refreshPaymentAfterDeliveryMethodSwitch;
|
|
131
162
|
changeDeliveryLocation(trigger?: HTMLElement | null): void;
|
|
163
|
+
private updateItemsOnCheckout;
|
|
164
|
+
private static lostCustomer;
|
|
132
165
|
private syncFromItemUpdate;
|
|
133
166
|
private syncCheckoutState;
|
|
134
167
|
private refreshCheckout;
|
|
135
168
|
private dataForCheckoutPrepare;
|
|
136
169
|
private normalizeForApi;
|
|
137
170
|
getDetails(): ICheckoutDetailsEventData;
|
|
171
|
+
trackBeginCheckout(): void;
|
|
172
|
+
trackPresaleCheckoutStart(): void;
|
|
173
|
+
reportExpressCheckoutStarted({ wallet, reportBeginCheckout }: {
|
|
174
|
+
wallet: string;
|
|
175
|
+
reportBeginCheckout: boolean;
|
|
176
|
+
}): void;
|
|
177
|
+
private checkoutItemsForAnalytics;
|
|
178
|
+
private toAnalyticsItem;
|
|
138
179
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
2
|
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
import type { PlacedDelivery } from '@/utils/delivery-scheduling';
|
|
3
4
|
export interface ICheckoutCompletedComponentParams {
|
|
4
5
|
orderNumber: string;
|
|
5
6
|
orderTotal: number;
|
|
@@ -9,10 +10,13 @@ export interface ICheckoutCompletedComponentParams {
|
|
|
9
10
|
checkoutToken?: string;
|
|
10
11
|
cartId?: string;
|
|
11
12
|
isCompleted?: boolean;
|
|
13
|
+
delivery?: PlacedDelivery;
|
|
12
14
|
}
|
|
13
15
|
export declare class CheckoutCompletedComponent extends BaseComponent<ICheckoutCompletedComponentParams, ICheckoutComponent> {
|
|
14
16
|
get hostClasses(): string[];
|
|
15
17
|
private hasAnnouncedCompletion;
|
|
16
18
|
protected afterRender(): void;
|
|
19
|
+
private createDeliveryLine;
|
|
20
|
+
private createDeliveryGroup;
|
|
17
21
|
protected template(): HTMLElement[];
|
|
18
22
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutFulfillmentMethod } from '@/interfaces/api/checkout.interface';
|
|
2
3
|
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
4
|
+
export declare function deliveryMethodExpectationText(method: ICheckoutFulfillmentMethod): string;
|
|
3
5
|
export declare class CheckoutDeliveryMethodComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
6
|
get hostClasses(): string[];
|
|
5
7
|
constructor();
|