@liquidcommerce/elements-sdk 2.6.0-beta.44 → 2.6.0-beta.46
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.checkout.esm.js +7217 -7338
- package/dist/index.esm.js +12004 -12342
- package/dist/ssr-stub.esm.js +5 -4
- package/dist/types/clients/base.d.ts +1 -2
- package/dist/types/constants/core.constant.d.ts +0 -5
- package/dist/types/core/api/api-client.service.d.ts +16 -15
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +13 -5
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/core.interface.d.ts +7 -11
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +12 -28
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +5 -4
- package/dist/types/interfaces/client.interface.d.ts +11 -1
- package/dist/types/interfaces/config.interface.d.ts +2 -1
- package/dist/types/modules/address/address-input.component.d.ts +0 -11
- package/dist/types/modules/address/address.command.d.ts +1 -1
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +3 -2
- package/dist/types/modules/product/product.commands.d.ts +1 -3
- package/dist/types/modules/product-list/components/card-components/index.d.ts +0 -2
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -3
- package/dist/types/modules/product-list/components/index.d.ts +1 -1
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +2 -5
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +0 -2
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +21 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +30 -14
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +0 -2
- package/dist/types/modules/product-list/product-list-card.component.d.ts +18 -16
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +6 -53
- package/dist/types/modules/product-list/product-list.component.d.ts +1 -10
- package/dist/types/modules/product-list/product-list.interface.d.ts +0 -30
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +1 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -10
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +4 -1
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +6 -4
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +10 -0
- package/package.json +8 -8
- package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +0 -12
- package/dist/types/modules/product-list/components/card-components/product-title.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +0 -26
- package/dist/types/modules/ui-components/modal/modal.component.d.ts +0 -23
- package/dist/types/modules/ui-components/styles/modal.style.d.ts +0 -1
package/dist/ssr-stub.esm.js
CHANGED
|
@@ -157,7 +157,6 @@ const COMPONENT_TYPE = {
|
|
|
157
157
|
PURCHASE_MIN_ALERT: 'purchase-min-alert',
|
|
158
158
|
ALERT: 'alert',
|
|
159
159
|
PROMO_CODE_TICKER: 'promo-code-ticker',
|
|
160
|
-
MODAL: 'modal',
|
|
161
160
|
ADDRESS: 'address',
|
|
162
161
|
ADDRESS_INPUT: 'address-input',
|
|
163
162
|
ADDRESS_DISPLAY: 'address-display',
|
|
@@ -179,9 +178,10 @@ const COMPONENT_TYPE = {
|
|
|
179
178
|
PRODUCT_LIST_FILTERS: 'product-list-filters',
|
|
180
179
|
PRODUCT_LIST_SEARCH: 'product-list-search',
|
|
181
180
|
PRODUCT_LIST_CARD_LOADING: 'product-list-card-loading',
|
|
182
|
-
PRODUCT_LIST_RETAILERS: 'product-list-retailers',
|
|
183
181
|
PRODUCT_LIST_ENGRAVING_FORM: 'product-list-engraving-form',
|
|
184
182
|
PRODUCT_LIST_PRODUCT_PRE_CART: 'product-list-product-pre-cart',
|
|
183
|
+
PRODUCT_LIST_PRODUCT_ENGRAVING_LINES: 'product-list-product-engraving-lines',
|
|
184
|
+
PRODUCT_LIST_SIZE_SELECTOR: 'product-list-size-selector',
|
|
185
185
|
CART: 'cart',
|
|
186
186
|
CART_RETAILER: 'cart-retailer',
|
|
187
187
|
CART_ITEM: 'cart-item',
|
|
@@ -252,8 +252,9 @@ const DISPLAY_MODE = {
|
|
|
252
252
|
DRAWER: 'drawer',
|
|
253
253
|
};
|
|
254
254
|
const NAVIGATION_SOURCE = {
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
PRODUCT: 'product',
|
|
256
|
+
PRODUCT_LIST_CARD: 'product-list-card',
|
|
257
|
+
PRE_CART: 'pre-cart',
|
|
257
258
|
};
|
|
258
259
|
|
|
259
260
|
const SSR_WARN = '[LiquidCommerce Elements] This SDK is designed for the browser. ' + 'Calls made during SSR return null. The SDK will initialize on the client.';
|
|
@@ -36,7 +36,7 @@ export declare abstract class ElementsBaseClient {
|
|
|
36
36
|
protected clientPrepared: boolean;
|
|
37
37
|
protected componentFactoryInitialized: boolean;
|
|
38
38
|
protected cartDrawerElement: HTMLElement | null;
|
|
39
|
-
|
|
39
|
+
private heavyInitTimeoutId;
|
|
40
40
|
protected injectedComponents: Map<string, IInjectedComponent>;
|
|
41
41
|
constructor(clientConfigs: IClientConfigs);
|
|
42
42
|
prepare(): Promise<void>;
|
|
@@ -50,7 +50,6 @@ export declare abstract class ElementsBaseClient {
|
|
|
50
50
|
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
51
51
|
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
52
52
|
protected ensureCartDrawerExists(): void;
|
|
53
|
-
protected ensureModalExists(): void;
|
|
54
53
|
protected ensureAllComponentsRegistered(): void;
|
|
55
54
|
protected createInjectedComponentWrapper(containerId: string, type: ComponentType, element: HTMLElement): IInjectedComponent;
|
|
56
55
|
destroy(): void;
|
|
@@ -3,9 +3,6 @@ export declare const API_CLIENT_URL: {
|
|
|
3
3
|
staging: string;
|
|
4
4
|
production: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const PRODUCT_LIST_CARD_VARIANT: {
|
|
7
|
-
STANDARD: string;
|
|
8
|
-
};
|
|
9
6
|
export declare const PRODUCT_LIST_FILTER_TYPES: {
|
|
10
7
|
ENGRAVING: string;
|
|
11
8
|
PRESALE: string;
|
|
@@ -45,6 +42,4 @@ export declare const Z_INDEX: {
|
|
|
45
42
|
readonly ADDRESS_ACTIONS: 5050;
|
|
46
43
|
readonly SKELETON_WAVE: 5040;
|
|
47
44
|
readonly CONTENT_OVERLAY: 5030;
|
|
48
|
-
readonly MODAL: 2147483640;
|
|
49
45
|
};
|
|
50
|
-
export declare const DESKTOP_BREAKPOINT = 1024;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ApiResult } from '@/core/api/api-result';
|
|
1
2
|
import type { AuthClientService } from '@/core/api/auth-client.service';
|
|
2
|
-
import type { IPersistedStore } from '@/core/store/interfaces/core.interface';
|
|
3
|
+
import type { IPersistedStore, IPersistedStoreAction } from '@/core/store/interfaces/core.interface';
|
|
3
4
|
import type { IAddressAutocompleteResult, IAddressDetailsResult, ILocation } from '@/interfaces/api/address.interface';
|
|
4
5
|
import type { ICart, ICartUpdateParams } from '@/interfaces/api/cart.interface';
|
|
5
6
|
import type { ICheckoutComplete, ICheckoutItemsUpdateParams, ICheckoutItemsUpdateResponse, ICheckoutPaymentConfirm, ICheckoutPaymentConfirmParams, ICheckoutPaymentSession, ICheckoutPrepare, ICheckoutPrepareParams } from '@/interfaces/api/checkout.interface';
|
|
@@ -11,18 +12,18 @@ export declare class ApiClientService {
|
|
|
11
12
|
constructor();
|
|
12
13
|
static getInstance(): ApiClientService;
|
|
13
14
|
setClient(client: AuthClientService): Promise<void>;
|
|
14
|
-
setPersistedStore(userDeviceId: string, data: IPersistedStore): Promise<
|
|
15
|
-
getPersistedStore(userDeviceId: string): Promise<IPersistedStore
|
|
16
|
-
deletePersistedStore(userDeviceId: string): Promise<
|
|
17
|
-
getAddressSuggestions(input: string): Promise<IAddressAutocompleteResult[]
|
|
18
|
-
getAddressDetails(id: string): Promise<IAddressDetailsResult
|
|
19
|
-
getProductsData(identifier: string[], location?: ILocation): Promise<IProductAvailabilityResponse
|
|
20
|
-
catalogSearch(params: IProductSearchParams): Promise<IProductSearchResponse
|
|
21
|
-
getCartData(id: string | null): Promise<ICart
|
|
22
|
-
updateCart(params: ICartUpdateParams): Promise<ICart
|
|
23
|
-
prepareCheckout(params: ICheckoutPrepareParams): Promise<ICheckoutPrepare
|
|
24
|
-
updateCheckoutItems(params: ICheckoutItemsUpdateParams): Promise<ICheckoutItemsUpdateResponse
|
|
25
|
-
getPaymentSession(cartId: string): Promise<ICheckoutPaymentSession
|
|
26
|
-
confirmPaymentSession(params: ICheckoutPaymentConfirmParams): Promise<ICheckoutPaymentConfirm
|
|
27
|
-
checkoutComplete(token: string): Promise<ICheckoutComplete
|
|
15
|
+
setPersistedStore(userDeviceId: string, data: IPersistedStore): Promise<ApiResult<IPersistedStoreAction>>;
|
|
16
|
+
getPersistedStore(userDeviceId: string): Promise<ApiResult<IPersistedStore>>;
|
|
17
|
+
deletePersistedStore(userDeviceId: string): Promise<ApiResult<IPersistedStoreAction>>;
|
|
18
|
+
getAddressSuggestions(input: string): Promise<ApiResult<IAddressAutocompleteResult[]>>;
|
|
19
|
+
getAddressDetails(id: string): Promise<ApiResult<IAddressDetailsResult>>;
|
|
20
|
+
getProductsData(identifier: string[], location?: ILocation): Promise<ApiResult<IProductAvailabilityResponse>>;
|
|
21
|
+
catalogSearch(params: IProductSearchParams): Promise<ApiResult<IProductSearchResponse>>;
|
|
22
|
+
getCartData(id: string | null): Promise<ApiResult<ICart>>;
|
|
23
|
+
updateCart(params: ICartUpdateParams): Promise<ApiResult<ICart>>;
|
|
24
|
+
prepareCheckout(params: ICheckoutPrepareParams): Promise<ApiResult<ICheckoutPrepare>>;
|
|
25
|
+
updateCheckoutItems(params: ICheckoutItemsUpdateParams): Promise<ApiResult<ICheckoutItemsUpdateResponse>>;
|
|
26
|
+
getPaymentSession(cartId: string): Promise<ApiResult<ICheckoutPaymentSession>>;
|
|
27
|
+
confirmPaymentSession(params: ICheckoutPaymentConfirmParams): Promise<ApiResult<ICheckoutPaymentConfirm>>;
|
|
28
|
+
checkoutComplete(token: string): Promise<ApiResult<ICheckoutComplete>>;
|
|
28
29
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface IApiErrorDetail {
|
|
2
|
+
field?: string;
|
|
3
|
+
message: string;
|
|
4
|
+
code?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ApiError {
|
|
7
|
+
status: number;
|
|
8
|
+
message: string;
|
|
9
|
+
errors: IApiErrorDetail[];
|
|
10
|
+
}
|
|
11
|
+
export type ApiResult<T> = {
|
|
12
|
+
success: true;
|
|
13
|
+
data: T;
|
|
14
|
+
} | {
|
|
15
|
+
success: false;
|
|
16
|
+
error: ApiError;
|
|
17
|
+
};
|
|
18
|
+
export declare function apiSuccess<T>(data: T): ApiResult<T>;
|
|
19
|
+
export declare function apiError<T = never>(status: number, message: string, errors?: IApiErrorDetail[]): ApiResult<T>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ApiResult } from '@/core/api/api-result';
|
|
1
2
|
import type { ElementsEnv } from '@/enums';
|
|
2
3
|
import type { IAllConfigs } from '@/interfaces/configs/global.interface';
|
|
3
4
|
export interface IAuthConfig {
|
|
@@ -13,13 +14,20 @@ export interface IAuth {
|
|
|
13
14
|
accessToken: string;
|
|
14
15
|
expiration: number;
|
|
15
16
|
}
|
|
16
|
-
export interface IApiResponseBase {
|
|
17
|
-
message: string;
|
|
18
|
-
}
|
|
19
17
|
export interface IApiResponse<T> {
|
|
20
18
|
message: string;
|
|
21
19
|
data: T;
|
|
22
20
|
}
|
|
21
|
+
export interface IApiErrorDetail {
|
|
22
|
+
field?: string;
|
|
23
|
+
message: string;
|
|
24
|
+
code?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface IApiError {
|
|
27
|
+
statusCode: number;
|
|
28
|
+
message: string;
|
|
29
|
+
errors: IApiErrorDetail[];
|
|
30
|
+
}
|
|
23
31
|
export interface IAuthWithConfigs {
|
|
24
32
|
auth: IAuth;
|
|
25
33
|
configs: IAllConfigs;
|
|
@@ -46,8 +54,8 @@ export declare class AuthClientService {
|
|
|
46
54
|
}>;
|
|
47
55
|
authenticate(): Promise<boolean>;
|
|
48
56
|
refreshToken(): Promise<boolean>;
|
|
49
|
-
get<
|
|
50
|
-
post<
|
|
57
|
+
get<TData = unknown>(path: string, options?: IHttpRequestOptions): Promise<ApiResult<TData>>;
|
|
58
|
+
post<TData = unknown>(path: string, options?: IHttpRequestOptions): Promise<ApiResult<TData>>;
|
|
51
59
|
private performAuthentication;
|
|
52
60
|
private performTokenRefresh;
|
|
53
61
|
private request;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
2
|
-
import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/client.interface';
|
|
2
|
+
import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsCheckoutClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/client.interface';
|
|
3
|
+
type ClientConstructor = LiquidCommerceElementsClientConstructor | LiquidCommerceElementsBuilderClientConstructor | LiquidCommerceElementsCheckoutClientConstructor;
|
|
4
|
+
export type SDKContext = 'regular' | 'builder' | 'checkout';
|
|
3
5
|
export declare class SingletonManager {
|
|
4
6
|
private static clientConstructor;
|
|
5
|
-
private static
|
|
6
|
-
private static builderClientInstances;
|
|
7
|
+
private static contexts;
|
|
7
8
|
private static currentContext;
|
|
9
|
+
private static initializationInProgress;
|
|
8
10
|
private static getInstances;
|
|
9
11
|
private constructor();
|
|
10
|
-
static setContext(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
static
|
|
14
|
-
static
|
|
12
|
+
static setContext(context: SDKContext): void;
|
|
13
|
+
static finalizeInitialization(): void;
|
|
14
|
+
static hasContext(context: SDKContext): boolean;
|
|
15
|
+
static destroyContext(context: SDKContext): void;
|
|
16
|
+
static setClientConstructor(lceConstructor: ClientConstructor): void;
|
|
17
|
+
static getClientConstructor(): ClientConstructor | null;
|
|
15
18
|
static getClassInstance<T>(className: string, instanceCreator: () => T): T;
|
|
16
19
|
static getClient<T>(clientConfigs: IClientConfigs): Promise<T>;
|
|
17
20
|
}
|
|
21
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartSt
|
|
|
3
3
|
import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutItemStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
4
|
import type { ICheckoutInjection, ICheckoutMetadata, IElementsMetadataStore } from '@/core/store/interfaces/metadata.interface';
|
|
5
5
|
import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
|
-
import type { IProductListStore } from '@/core/store/interfaces/product-list.interface';
|
|
6
|
+
import type { IPLProductStore, IProductListStore } from '@/core/store/interfaces/product-list.interface';
|
|
7
7
|
import type { ComponentType } from '@/enums';
|
|
8
8
|
import type { ICartPromoCode } from '@/interfaces/api/cart.interface';
|
|
9
9
|
import type { ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer } from '@/interfaces/api/checkout.interface';
|
|
@@ -11,21 +11,14 @@ export interface IDrawerContentConfig {
|
|
|
11
11
|
type: ComponentType;
|
|
12
12
|
data?: Record<string, any>;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
type: ComponentType;
|
|
16
|
-
data?: Record<string, any>;
|
|
17
|
-
}
|
|
14
|
+
export type UIDrawerMode = 'drawer' | 'modal';
|
|
18
15
|
export interface IDrawerStore {
|
|
19
16
|
isOpen: boolean;
|
|
20
17
|
contentConfig: IDrawerContentConfig | null;
|
|
18
|
+
mode: UIDrawerMode;
|
|
21
19
|
}
|
|
22
20
|
export interface IUIStore {
|
|
23
21
|
drawer: IDrawerStore;
|
|
24
|
-
modal: IModalStore;
|
|
25
|
-
}
|
|
26
|
-
export interface IModalStore {
|
|
27
|
-
isOpen: boolean;
|
|
28
|
-
contentConfig: IModalContentConfig | null;
|
|
29
22
|
}
|
|
30
23
|
export interface IGlobalStore {
|
|
31
24
|
address: IAddressStore;
|
|
@@ -40,7 +33,10 @@ export interface IPersistedStore {
|
|
|
40
33
|
p?: string;
|
|
41
34
|
c?: string;
|
|
42
35
|
}
|
|
43
|
-
export
|
|
36
|
+
export interface IPersistedStoreAction {
|
|
37
|
+
success: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof ICartRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof ICartFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCode}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.paymentSession.${keyof ICheckoutPaymentSessionStore}` | `checkout.paymentForm.paymentMethod.${keyof ICheckoutPaymentMethodStore}` | `checkout.presale.${keyof ICheckoutPresale}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferences}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipient}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCode}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.retailers.${string}` | `checkout.retailers.${string}.${keyof ICheckoutRetailer}` | `checkout.fulfillments.${string}` | `productsList.${keyof IProductListStore}` | `productsList.products.${string}` | `productsList.products.${string}.${keyof IPLProductStore}` | `metadata.${keyof IElementsMetadataStore}` | `metadata.checkout.${keyof ICheckoutMetadata}` | `metadata.checkout.injection.${keyof ICheckoutInjection}`;
|
|
44
40
|
interface MiddlewareContext {
|
|
45
41
|
action: string;
|
|
46
42
|
payload: any;
|
|
@@ -1,45 +1,29 @@
|
|
|
1
1
|
import type { IPagination } from 'modules/product-list/product-list.interface';
|
|
2
2
|
import type { FulfillmentType } from '@/enums';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IProduct } from '@/interfaces/api/product.interface';
|
|
4
4
|
import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
|
|
5
|
-
import type { IProductSizeStore } from './product.interface';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
retailerAddressFormatted: string;
|
|
10
|
-
variant: IProductVariant;
|
|
11
|
-
image: string | null;
|
|
12
|
-
};
|
|
13
|
-
export interface IProductList extends IProduct {
|
|
5
|
+
import type { IProductFulfillmentStore, IProductSizeStore } from './product.interface';
|
|
6
|
+
export interface IPLProductStore extends Omit<IProduct, 'sizes'> {
|
|
7
|
+
id: string;
|
|
8
|
+
sizes: Record<string, IProductSizeStore>;
|
|
14
9
|
quantity: number;
|
|
15
10
|
selectedSizeId: string | null;
|
|
16
11
|
selectedFulfillmentType: FulfillmentType;
|
|
17
12
|
selectedFulfillmentId: string | null;
|
|
18
13
|
selectedFulfillment: IProductFulfillmentStore | null;
|
|
14
|
+
engravingLines: string[];
|
|
19
15
|
productHasAvailability: boolean;
|
|
20
16
|
fulfillmentHasAvailability: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
sizes: Record<string, IProductSizeStore>;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
updating: boolean;
|
|
24
19
|
}
|
|
25
20
|
export interface IProductListStore {
|
|
26
|
-
products:
|
|
27
|
-
|
|
21
|
+
products: Record<string, IPLProductStore>;
|
|
22
|
+
appliedFilters: Record<string, string[]>;
|
|
28
23
|
filters: IFilterSchema[];
|
|
29
24
|
pagination: IPagination;
|
|
30
|
-
appliedFilters: Record<string, string[]>;
|
|
31
25
|
searchTerm: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
columns: number;
|
|
35
|
-
};
|
|
36
|
-
userProducts: {
|
|
37
|
-
[productId: string]: {
|
|
38
|
-
selectedSizeId: string;
|
|
39
|
-
selectedFulfillmentType: FulfillmentType;
|
|
40
|
-
selectedFulfillment: IProductFulfillmentStore | null;
|
|
41
|
-
selectedQuantity: number;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
26
|
+
rows: number;
|
|
27
|
+
columns: number;
|
|
44
28
|
loading: boolean;
|
|
45
29
|
}
|
|
@@ -28,6 +28,7 @@ export declare class StoreService {
|
|
|
28
28
|
createProductInstance(productId: string): boolean;
|
|
29
29
|
removeProductInstance(productId: string): boolean;
|
|
30
30
|
getProductInstances(): Record<string, IProductStore>;
|
|
31
|
+
destroy(): void;
|
|
31
32
|
getState(): IGlobalStore;
|
|
32
33
|
private setupMiddleware;
|
|
33
34
|
private loggingMiddleware;
|
|
@@ -10,6 +10,7 @@ export declare class TelemetryService {
|
|
|
10
10
|
constructor();
|
|
11
11
|
static getInstance(): TelemetryService;
|
|
12
12
|
isEnabled(): boolean;
|
|
13
|
+
destroy(): void;
|
|
13
14
|
captureEvent(level: TelemetryLevel, message: string, options?: ITelemetryEventOptions): void;
|
|
14
15
|
private buildErrorContext;
|
|
15
16
|
private buildSDKContext;
|
|
@@ -76,7 +76,6 @@ export declare const COMPONENT_TYPE: {
|
|
|
76
76
|
readonly PURCHASE_MIN_ALERT: "purchase-min-alert";
|
|
77
77
|
readonly ALERT: "alert";
|
|
78
78
|
readonly PROMO_CODE_TICKER: "promo-code-ticker";
|
|
79
|
-
readonly MODAL: "modal";
|
|
80
79
|
readonly ADDRESS: "address";
|
|
81
80
|
readonly ADDRESS_INPUT: "address-input";
|
|
82
81
|
readonly ADDRESS_DISPLAY: "address-display";
|
|
@@ -98,9 +97,10 @@ export declare const COMPONENT_TYPE: {
|
|
|
98
97
|
readonly PRODUCT_LIST_FILTERS: "product-list-filters";
|
|
99
98
|
readonly PRODUCT_LIST_SEARCH: "product-list-search";
|
|
100
99
|
readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
|
|
101
|
-
readonly PRODUCT_LIST_RETAILERS: "product-list-retailers";
|
|
102
100
|
readonly PRODUCT_LIST_ENGRAVING_FORM: "product-list-engraving-form";
|
|
103
101
|
readonly PRODUCT_LIST_PRODUCT_PRE_CART: "product-list-product-pre-cart";
|
|
102
|
+
readonly PRODUCT_LIST_PRODUCT_ENGRAVING_LINES: "product-list-product-engraving-lines";
|
|
103
|
+
readonly PRODUCT_LIST_SIZE_SELECTOR: "product-list-size-selector";
|
|
104
104
|
readonly CART: "cart";
|
|
105
105
|
readonly CART_RETAILER: "cart-retailer";
|
|
106
106
|
readonly CART_ITEM: "cart-item";
|
|
@@ -179,7 +179,8 @@ export declare const DISPLAY_MODE: {
|
|
|
179
179
|
};
|
|
180
180
|
export type DisplayModeType = (typeof DISPLAY_MODE)[keyof typeof DISPLAY_MODE];
|
|
181
181
|
export declare const NAVIGATION_SOURCE: {
|
|
182
|
-
readonly
|
|
183
|
-
readonly
|
|
182
|
+
readonly PRODUCT: "product";
|
|
183
|
+
readonly PRODUCT_LIST_CARD: "product-list-card";
|
|
184
|
+
readonly PRE_CART: "pre-cart";
|
|
184
185
|
};
|
|
185
186
|
export type NavigationSourceType = (typeof NAVIGATION_SOURCE)[keyof typeof NAVIGATION_SOURCE];
|
|
@@ -5,7 +5,7 @@ import type { IProductActions } from '@/core/client/actions/client-product-actio
|
|
|
5
5
|
import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
6
6
|
import type { IAddressOptions } from '@/modules/address/address.interface';
|
|
7
7
|
import type { IInjectedComponent } from './component.interface';
|
|
8
|
-
import type { UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent } from './configs';
|
|
8
|
+
import type { UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent, UpdateProductListComponent } from './configs';
|
|
9
9
|
import type { IBuilderInjectElementParams, IInjectCheckoutBuilderParams, IInjectCheckoutParams, IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams } from './injection.interface';
|
|
10
10
|
export interface ILiquidCommerceElementsUIMethod {
|
|
11
11
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
@@ -36,6 +36,7 @@ export interface ILiquidCommerceElementsBuilderClient {
|
|
|
36
36
|
updateAddressComponent(configs: UpdateAddressComponent): void;
|
|
37
37
|
updateCartComponent(configs: UpdateCartComponent): void;
|
|
38
38
|
updateCheckoutComponent(configs: UpdateCheckoutComponent): void;
|
|
39
|
+
updateProductListComponent(configs: UpdateProductListComponent): void;
|
|
39
40
|
injectElement(params: IBuilderInjectElementParams): Promise<IInjectedComponent | null>;
|
|
40
41
|
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
41
42
|
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
@@ -58,5 +59,14 @@ export interface ILiquidCommerceElementsClient {
|
|
|
58
59
|
getInjectedComponents(): Map<string, IInjectedComponent>;
|
|
59
60
|
destroy(): void;
|
|
60
61
|
}
|
|
62
|
+
export interface ILiquidCommerceElementsCheckoutClient {
|
|
63
|
+
prepare(): Promise<void>;
|
|
64
|
+
injectCheckout(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
65
|
+
actions: {
|
|
66
|
+
checkout: IElementsCheckoutActions;
|
|
67
|
+
};
|
|
68
|
+
destroy(): void;
|
|
69
|
+
}
|
|
61
70
|
export type LiquidCommerceElementsClientConstructor = new (clientConfigs: IClientConfigs) => ILiquidCommerceElementsClient;
|
|
62
71
|
export type LiquidCommerceElementsBuilderClientConstructor = new (clientConfigs: IClientConfigs) => ILiquidCommerceElementsBuilderClient;
|
|
72
|
+
export type LiquidCommerceElementsCheckoutClientConstructor = new (clientConfigs: IClientConfigs) => ILiquidCommerceElementsCheckoutClient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DebugMode, ElementsEnv } from '@/enums';
|
|
2
|
-
import type { IPromoTicker, UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent } from './configs';
|
|
2
|
+
import type { IPromoTicker, UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent, UpdateProductListComponent } from './configs';
|
|
3
3
|
export type DeepPartial<T> = {
|
|
4
4
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
5
5
|
};
|
|
@@ -18,6 +18,7 @@ export interface IClientCustomThemeConfig {
|
|
|
18
18
|
address?: UpdateAddressComponent;
|
|
19
19
|
cart?: UpdateCartComponent;
|
|
20
20
|
checkout?: UpdateCheckoutComponent;
|
|
21
|
+
productList?: UpdateProductListComponent;
|
|
21
22
|
}
|
|
22
23
|
export interface ILiquidCommerceElementsCheckoutConfig {
|
|
23
24
|
pageUrl: string;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
2
|
-
import { type NavigationSourceType } from 'enums';
|
|
3
|
-
import type { IFulfillment } from 'interfaces/api/product.interface';
|
|
4
|
-
import type { IProductListComponent } from 'interfaces/configs';
|
|
5
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
6
2
|
import type { IAddressComponent } from '@/interfaces/configs';
|
|
7
3
|
import type { IAddressOptions } from './address.interface';
|
|
@@ -9,12 +5,6 @@ export interface IAddressInputComponentParams {
|
|
|
9
5
|
productId?: string;
|
|
10
6
|
isIndependentComponent?: boolean;
|
|
11
7
|
options?: IAddressOptions;
|
|
12
|
-
navigationSource?: NavigationSourceType;
|
|
13
|
-
product?: IProductListProduct;
|
|
14
|
-
shippingFulfillment?: IFulfillment | null;
|
|
15
|
-
onDemandFulfillment?: IFulfillment | null;
|
|
16
|
-
showCollections?: boolean;
|
|
17
|
-
config?: IProductListComponent;
|
|
18
8
|
}
|
|
19
9
|
export declare class AddressInputComponent extends BaseComponent<IAddressInputComponentParams, IAddressComponent> {
|
|
20
10
|
private suggestions;
|
|
@@ -34,7 +24,6 @@ export declare class AddressInputComponent extends BaseComponent<IAddressInputCo
|
|
|
34
24
|
private closeDrawer;
|
|
35
25
|
private handleCancel;
|
|
36
26
|
private handleCheckAvailability;
|
|
37
|
-
private reopenAddToCartDrawer;
|
|
38
27
|
private handleSuggestionClick;
|
|
39
28
|
private handleDocumentClick;
|
|
40
29
|
private searchAddresses;
|
|
@@ -6,7 +6,7 @@ export declare class AddressCommands extends BaseCommand {
|
|
|
6
6
|
constructor();
|
|
7
7
|
static getInstance(): AddressCommands;
|
|
8
8
|
searchAddresses(query: string): Promise<IAddressAutocompleteResult[]>;
|
|
9
|
-
getAddressDetails(addressId: string): Promise<IAddressDetailsResult>;
|
|
9
|
+
getAddressDetails(addressId: string): Promise<IAddressDetailsResult | null>;
|
|
10
10
|
setSelectedAddress(addressData: IAddressData): Promise<void>;
|
|
11
11
|
setAddressManually(address: IAddressAddress, coordinates: IAddressCoordinates): Promise<void>;
|
|
12
12
|
clearSelectedAddress(): Promise<void>;
|
|
@@ -8,6 +8,7 @@ export interface ICheckoutCompletedComponentParams {
|
|
|
8
8
|
giftRecipientEmail: string | null;
|
|
9
9
|
checkoutToken?: string;
|
|
10
10
|
cartId?: string;
|
|
11
|
+
isCompleted?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare class CheckoutCompletedComponent extends BaseComponent<ICheckoutCompletedComponentParams, ICheckoutComponent> {
|
|
13
14
|
get hostClasses(): string[];
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import { type NavigationSourceType } from '@/enums';
|
|
2
3
|
import type { IProductComponent } from '@/interfaces/configs';
|
|
3
4
|
export interface IProductRetailersPopupListComponentParams {
|
|
4
5
|
productId: string;
|
|
6
|
+
navigationSource: NavigationSourceType;
|
|
5
7
|
}
|
|
6
8
|
export declare class ProductRetailersPopupListComponent extends BaseComponent<IProductRetailersPopupListComponentParams, IProductComponent> {
|
|
7
9
|
get hostClasses(): string[];
|
|
8
|
-
|
|
9
|
-
private getProductId;
|
|
10
|
+
beforeSetupStoreWatchers(): void;
|
|
10
11
|
private onFulfillmentTabClick;
|
|
11
12
|
private onRetailerCardClick;
|
|
12
13
|
protected template(): HTMLElement[];
|
|
@@ -16,7 +16,7 @@ export declare class ProductCommands extends BaseCommand {
|
|
|
16
16
|
selectSize(productId: string, sizeId: string): Promise<void>;
|
|
17
17
|
selectFulfillment(productId: string, selectedFulfillmentId: string): Promise<void>;
|
|
18
18
|
updateQuantity(productId: string, delta: number): Promise<void>;
|
|
19
|
-
changeFulfillmentType(productId: string,
|
|
19
|
+
changeFulfillmentType(productId: string, newFulfillmentType: FulfillmentType): Promise<void>;
|
|
20
20
|
removeProduct(productId: string): Promise<void>;
|
|
21
21
|
openProductDrawer(productId: string, contentType: IProductDrawerContentConfig['type'], data?: Record<string, any>): Promise<void>;
|
|
22
22
|
closeProductDrawer(productId: string): Promise<void>;
|
|
@@ -24,6 +24,4 @@ export declare class ProductCommands extends BaseCommand {
|
|
|
24
24
|
addToCart(productId: string, params: AddItemParams): Promise<void>;
|
|
25
25
|
addPresaleToCart(productId: string, params: AddItemParams): Promise<void>;
|
|
26
26
|
productDataForEventFromStore(identifier: string): IBaseProductEventData;
|
|
27
|
-
private findFirstAvailableSize;
|
|
28
|
-
private loadProductStoreUpdate;
|
|
29
27
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * from './product-badge';
|
|
2
2
|
export * from './product-button';
|
|
3
|
-
export * from './product-fulfillments';
|
|
4
3
|
export * from './product-price-and-personalization';
|
|
5
4
|
export * from './product-quantity-selector';
|
|
6
5
|
export * from './product-sizes-list';
|
|
7
|
-
export * from './product-title';
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
|
|
2
2
|
import type { ProductListCardCornerRadius } from 'interfaces/configs';
|
|
3
|
-
|
|
3
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
4
|
+
export interface IProductListSizeSelectorParams {
|
|
4
5
|
sizes: Record<string, IProductSizeStore>;
|
|
5
|
-
|
|
6
|
+
selectedSizeId: string | null;
|
|
6
7
|
cornerRadius: ProductListCardCornerRadius;
|
|
7
8
|
onSelect?: (size: IProductSizeStore) => void;
|
|
8
9
|
}
|
|
9
|
-
export declare
|
|
10
|
+
export declare class ProductListSizeSelectorComponent extends BaseComponent<IProductListSizeSelectorParams> {
|
|
11
|
+
private onOutsideClick;
|
|
12
|
+
get hostClasses(): string[];
|
|
13
|
+
protected disconnected?(): void;
|
|
14
|
+
protected template(): HTMLElement[];
|
|
15
|
+
}
|
|
@@ -4,6 +4,6 @@ export * from './filter-components/product-list-apply-filter-button';
|
|
|
4
4
|
export * from './product-list-card-loading.component';
|
|
5
5
|
export * from './product-list-engraving.component';
|
|
6
6
|
export * from './product-list-filters.component';
|
|
7
|
+
export * from './product-list-product-engraving-lines.component';
|
|
7
8
|
export * from './product-list-product-pre-cart.component';
|
|
8
|
-
export * from './product-list-retailers.component';
|
|
9
9
|
export * from './product-list-search.component';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
2
3
|
import type { IEngravingFormComponentParams } from 'modules/ui-components/engraving';
|
|
3
|
-
export declare class ProductListEngravingComponent extends BaseComponent<IEngravingFormComponentParams> {
|
|
4
|
+
export declare class ProductListEngravingComponent extends BaseComponent<IEngravingFormComponentParams, IProductListComponent> {
|
|
4
5
|
protected template(): HTMLElement[];
|
|
5
6
|
private createHeader;
|
|
6
|
-
private handleClose;
|
|
7
|
-
private handleEngravingComplete;
|
|
8
|
-
private handleEngravingCancel;
|
|
9
|
-
private reopenAddToCartDrawer;
|
|
10
7
|
}
|
|
@@ -24,7 +24,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
24
24
|
private priceFilterChevronIcon?;
|
|
25
25
|
private fulfillmentFilterChevronIcon?;
|
|
26
26
|
private priceSliderWrapper?;
|
|
27
|
-
private resizeHandler;
|
|
28
27
|
private boundDrawerClosedHandler;
|
|
29
28
|
private priceFilterDebounceTimer;
|
|
30
29
|
constructor();
|
|
@@ -32,7 +31,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
32
31
|
protected connected(): Promise<void>;
|
|
33
32
|
private setupDrawerCloseListener;
|
|
34
33
|
protected disconnected(): void;
|
|
35
|
-
private setupResizeListener;
|
|
36
34
|
private detectIfRenderedInDrawer;
|
|
37
35
|
onStoreWatch(): void;
|
|
38
36
|
private syncFiltersFromStore;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
3
|
+
export interface IProductListProductEngravingLinesComponentParams {
|
|
4
|
+
identifier: string;
|
|
5
|
+
lines: string[];
|
|
6
|
+
maxLines: number;
|
|
7
|
+
maxCharsPerLine: number;
|
|
8
|
+
location?: string;
|
|
9
|
+
fee: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class ProductListProductEngravingLinesComponent extends BaseComponent<IProductListProductEngravingLinesComponentParams, IProductListComponent> {
|
|
12
|
+
private engravingLines;
|
|
13
|
+
private addEngravingButton;
|
|
14
|
+
constructor();
|
|
15
|
+
protected disconnected?(): void;
|
|
16
|
+
template(): HTMLElement;
|
|
17
|
+
private engravingLinesSection;
|
|
18
|
+
private actionButtonsSection;
|
|
19
|
+
private calculateTotalPrice;
|
|
20
|
+
private addToCartButtonText;
|
|
21
|
+
}
|