@liquidcommerce/elements-sdk 2.6.7 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +302 -71
- package/dist/index.checkout.esm.js +16034 -0
- package/dist/index.esm.js +14201 -12166
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +22 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +11 -1
- package/dist/types/clients/checkout.d.ts +13 -0
- package/dist/types/constants/core.constant.d.ts +9 -3
- package/dist/types/core/api/api-client.service.d.ts +0 -2
- package/dist/types/core/client/actions/base-action.service.d.ts +15 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +37 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +50 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +12 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -73
- package/dist/types/core/client/client-config.service.d.ts +3 -4
- package/dist/types/core/store/interfaces/core.interface.d.ts +14 -1
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +45 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
- package/dist/types/core/store/store.constant.d.ts +4 -0
- package/dist/types/enums/core.enum.d.ts +3 -1
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +7 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/interfaces/api/checkout.interface.d.ts +2 -1
- package/dist/types/interfaces/api/product-list.interface.d.ts +13 -5
- package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/global.interface.d.ts +4 -2
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +28 -0
- package/dist/types/interfaces/core.interface.d.ts +28 -6
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +6 -2
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +4 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +10 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +10 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +13 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -3
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +2 -1
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -37
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +18 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +22 -0
- package/dist/types/modules/product-list/product-list-card.component.d.ts +35 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +53 -3
- package/dist/types/modules/product-list/product-list.component.d.ts +16 -43
- package/dist/types/{enums/cloud.enum.d.ts → modules/product-list/product-list.constants.d.ts} +20 -1
- package/dist/types/modules/product-list/product-list.interface.d.ts +32 -24
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -1
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +4 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
- package/dist/types/modules/ui-components/modal/modal.component.d.ts +23 -0
- package/dist/types/modules/ui-components/styles/modal.style.d.ts +1 -0
- package/dist/types/modules/ui-components/ui.commands.d.ts +3 -1
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/docs/ACTIONS.md +1 -0
- package/docs/CONFIGURATION.md +178 -34
- package/docs/DOCUMENTATION_INDEX.md +12 -4
- package/docs/THEMING.md +107 -18
- package/package.json +19 -12
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +0 -37
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/{elements-builder-client.d.ts → clients/builder.d.ts} +0 -0
- /package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +0 -0
- /package/dist/types/{elements-client.d.ts → clients/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IInjectCheckoutParams, IInjectedComponent, ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/core.interface';
|
|
2
|
+
export declare const SHARED_ATTR: {
|
|
3
|
+
readonly SCRIPT: {
|
|
4
|
+
readonly CHECKOUT_PARAM: "data-checkout-param";
|
|
5
|
+
};
|
|
6
|
+
readonly ELEMENT: {
|
|
7
|
+
readonly CHECKOUT: "data-lce-checkout";
|
|
8
|
+
readonly HIDE_HEADER: "hide-header";
|
|
9
|
+
readonly EXIT_CHECKOUT: "data-lce-exit-checkout";
|
|
10
|
+
};
|
|
11
|
+
readonly JSON_SCRIPT: {
|
|
12
|
+
readonly DEVELOPMENT: "data-liquid-commerce-elements-development";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function startsWithLcePrefix(value: string | null): boolean;
|
|
16
|
+
export declare function getDevelopmentConfigs(): ILiquidCommerceElementsDevelopmentConfig | undefined;
|
|
17
|
+
export declare function triggerAutoInit(initFunction: () => Promise<void>, errorPrefix: string): void;
|
|
18
|
+
export declare function setupCheckout(script: HTMLScriptElement, injectFn: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>, exitCheckoutFn: () => void, options: {
|
|
19
|
+
requireCheckoutId?: boolean;
|
|
20
|
+
errorPrefix: string;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
export declare function setupExitCheckoutHandlers(exitCheckoutFn: () => void): void;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import '@/modules/theme-provider/styles/register-styles';
|
|
2
|
+
import '@/modules/address/styles/register-styles';
|
|
3
|
+
import '@/modules/cart/styles/register-styles';
|
|
4
|
+
import '@/modules/checkout/styles/register-styles';
|
|
5
|
+
import '@/modules/product/styles/register-styles';
|
|
6
|
+
import '@/modules/product-list/styles/register-styles';
|
|
1
7
|
import { ApiClientService } from '@/core/api/api-client.service';
|
|
2
8
|
import { AuthClientService } from '@/core/api/auth-client.service';
|
|
3
9
|
import { ClientActionService } from '@/core/client/client-action.service';
|
|
@@ -10,7 +16,7 @@ import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
|
10
16
|
import { StoreService } from '@/core/store/store.service';
|
|
11
17
|
import { TelemetryService } from '@/core/telemetry/telemetry.service';
|
|
12
18
|
import { type ComponentType } from '@/enums';
|
|
13
|
-
import type { IInjectProductElement, IInjectProductListParams, IInjectedComponent, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
|
|
19
|
+
import type { IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams, IInjectedComponent, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
|
|
14
20
|
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
15
21
|
export declare abstract class ElementsBaseClient {
|
|
16
22
|
protected readonly authClient: AuthClientService;
|
|
@@ -28,6 +34,7 @@ export declare abstract class ElementsBaseClient {
|
|
|
28
34
|
protected clientPrepared: boolean;
|
|
29
35
|
protected componentFactoryInitialized: boolean;
|
|
30
36
|
protected cartDrawerCreated: boolean;
|
|
37
|
+
protected modalCreated: boolean;
|
|
31
38
|
protected injectedComponents: Map<string, IInjectedComponent>;
|
|
32
39
|
constructor(clientConfigs: IClientConfigs);
|
|
33
40
|
prepare(): Promise<void>;
|
|
@@ -38,7 +45,10 @@ export declare abstract class ElementsBaseClient {
|
|
|
38
45
|
protected processInjectElement(params: IProcessInjectElementParams): Promise<IInjectedComponent | null>;
|
|
39
46
|
protected processInjectProduct(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
40
47
|
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
48
|
+
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
49
|
+
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
41
50
|
protected ensureCartDrawerExists(): void;
|
|
51
|
+
protected ensureModalExists(): void;
|
|
42
52
|
protected ensureAllComponentsRegistered(): void;
|
|
43
53
|
protected createInjectedComponentWrapper(containerId: string, type: ComponentType, element: HTMLElement): IInjectedComponent;
|
|
44
54
|
protected rerenderInjectedComponentsByType(type: ComponentType): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ICheckoutActions } from '@/core/client/actions/client-checkout-action.service';
|
|
2
|
+
import type { IInjectCheckoutParams, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/core.interface';
|
|
3
|
+
import '@/modules/theme-provider/styles/register-styles';
|
|
4
|
+
import '@/modules/checkout/styles/register-styles';
|
|
5
|
+
export interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {
|
|
6
|
+
}
|
|
7
|
+
export interface IElementsCheckoutClient {
|
|
8
|
+
injectCheckout: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>;
|
|
9
|
+
actions: {
|
|
10
|
+
checkout: IElementsCheckoutActions;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function ElementsCheckout(apiKey: string, config: ILiquidCommerceElementsCheckoutClientConfig): Promise<IElementsCheckoutClient | null>;
|
|
@@ -7,9 +7,9 @@ export declare const PRODUCT_LIST_CARD_VARIANT: {
|
|
|
7
7
|
STANDARD: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const PRODUCT_LIST_FILTER_TYPES: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
ENGRAVING: string;
|
|
11
|
+
PRESALE: string;
|
|
12
|
+
FULFILLMENT: string;
|
|
13
13
|
PRICE: string;
|
|
14
14
|
BRANDS: string;
|
|
15
15
|
CATEGORIES: string;
|
|
@@ -45,4 +45,10 @@ export declare const Z_INDEX: {
|
|
|
45
45
|
readonly ADDRESS_ACTIONS: 5050;
|
|
46
46
|
readonly SKELETON_WAVE: 5040;
|
|
47
47
|
readonly CONTENT_OVERLAY: 5030;
|
|
48
|
+
readonly MODAL: 2147483640;
|
|
49
|
+
};
|
|
50
|
+
export declare const DESKTOP_BREAKPOINT = 1024;
|
|
51
|
+
export declare const DISPLAY_MODE: {
|
|
52
|
+
MODAL: string;
|
|
53
|
+
DRAWER: string;
|
|
48
54
|
};
|
|
@@ -5,14 +5,12 @@ import type { ICart, ICartUpdateParams } from '@/interfaces/api/cart.interface';
|
|
|
5
5
|
import type { ICheckoutComplete, ICheckoutItemsUpdateParams, ICheckoutItemsUpdateResponse, ICheckoutPaymentConfirm, ICheckoutPaymentConfirmParams, ICheckoutPaymentSession, ICheckoutPrepare, ICheckoutPrepareParams } from '@/interfaces/api/checkout.interface';
|
|
6
6
|
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
7
7
|
import type { IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
|
|
8
|
-
import type { IAllConfigs } from '@/interfaces/configs';
|
|
9
8
|
export declare class ApiClientService {
|
|
10
9
|
private client;
|
|
11
10
|
private readonly logger;
|
|
12
11
|
constructor();
|
|
13
12
|
static getInstance(): ApiClientService;
|
|
14
13
|
setClient(client: AuthClientService): Promise<void>;
|
|
15
|
-
getAllConfigs(): Promise<IAllConfigs>;
|
|
16
14
|
setPersistedStore(userDeviceId: string, data: IPersistedStore): Promise<void>;
|
|
17
15
|
getPersistedStore(userDeviceId: string): Promise<IPersistedStore | null>;
|
|
18
16
|
deletePersistedStore(userDeviceId: string): Promise<void>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApiClientService } from '@/core/api/api-client.service';
|
|
2
|
+
import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
3
|
+
import { PubSubService } from '@/core/pubsub/pubsub.service';
|
|
4
|
+
import { StoreService } from '@/core/store/store.service';
|
|
5
|
+
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
6
|
+
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
7
|
+
export declare abstract class BaseActionService {
|
|
8
|
+
protected readonly pubSub: PubSubService;
|
|
9
|
+
protected readonly store: StoreService;
|
|
10
|
+
protected readonly api: ApiClientService;
|
|
11
|
+
protected readonly themeProvider: ThemeProviderService;
|
|
12
|
+
protected readonly logger: ReturnType<typeof LoggerFactory.get>;
|
|
13
|
+
constructor(loggerName: string);
|
|
14
|
+
protected getLocation(): ILocation | undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
|
|
2
|
+
import { BaseActionService } from './base-action.service';
|
|
3
|
+
export interface IAddressActions {
|
|
4
|
+
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
5
|
+
setAddressManually: (address: IAddressAddress, coordinates: IAddressCoordinates) => Promise<void>;
|
|
6
|
+
clear: () => Promise<void>;
|
|
7
|
+
getDetails: () => IAddressData | null;
|
|
8
|
+
}
|
|
9
|
+
export declare class ClientAddressActionService extends BaseActionService {
|
|
10
|
+
private readonly command;
|
|
11
|
+
constructor();
|
|
12
|
+
static getInstance(): ClientAddressActionService;
|
|
13
|
+
get actions(): IAddressActions;
|
|
14
|
+
private setAddressByPlacesId;
|
|
15
|
+
private setAddressManually;
|
|
16
|
+
private clear;
|
|
17
|
+
private getDetails;
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
2
|
+
import { type FulfillmentType } from '@/enums';
|
|
3
|
+
import { BaseActionService } from './base-action.service';
|
|
4
|
+
export interface IAddProductParams {
|
|
5
|
+
identifier: string;
|
|
6
|
+
fulfillmentType: FulfillmentType;
|
|
7
|
+
quantity: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ICartActions {
|
|
10
|
+
openCart: () => void;
|
|
11
|
+
closeCart: () => void;
|
|
12
|
+
toggleCart: () => void;
|
|
13
|
+
addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
|
|
14
|
+
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
15
|
+
removePromoCode: () => Promise<void>;
|
|
16
|
+
resetCart: () => Promise<void>;
|
|
17
|
+
getDetails: () => IBaseCartEventData;
|
|
18
|
+
}
|
|
19
|
+
export declare class ClientCartActionService extends BaseActionService {
|
|
20
|
+
private readonly command;
|
|
21
|
+
private pendingCartParams;
|
|
22
|
+
private pendingCartOpenFlag;
|
|
23
|
+
constructor();
|
|
24
|
+
static getInstance(): ClientCartActionService;
|
|
25
|
+
get actions(): ICartActions;
|
|
26
|
+
private setupAddressUpdateListener;
|
|
27
|
+
private retryPendingCartOperation;
|
|
28
|
+
private clearPendingCartOperation;
|
|
29
|
+
private openCart;
|
|
30
|
+
private closeCart;
|
|
31
|
+
private toggleCart;
|
|
32
|
+
private addProduct;
|
|
33
|
+
private applyPromoCode;
|
|
34
|
+
private removePromoCode;
|
|
35
|
+
private resetCart;
|
|
36
|
+
private getDetails;
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
2
|
+
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
|
|
3
|
+
import { BaseActionService } from './base-action.service';
|
|
4
|
+
import type { IAddProductParams } from './client-cart-action.service';
|
|
5
|
+
export interface ICheckoutActions {
|
|
6
|
+
openCheckout: () => void;
|
|
7
|
+
closeCheckout: () => void;
|
|
8
|
+
toggleCheckout: () => void;
|
|
9
|
+
exitCheckout: () => void;
|
|
10
|
+
addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
|
|
11
|
+
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
12
|
+
removePromoCode: () => Promise<void>;
|
|
13
|
+
applyGiftCard: (code: string) => Promise<void>;
|
|
14
|
+
removeGiftCard: (code: string) => Promise<void>;
|
|
15
|
+
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
16
|
+
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
17
|
+
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
18
|
+
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
19
|
+
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
20
|
+
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
21
|
+
getDetails: () => ICheckoutDetailsEventData;
|
|
22
|
+
}
|
|
23
|
+
export declare class ClientCheckoutActionService extends BaseActionService {
|
|
24
|
+
private readonly command;
|
|
25
|
+
private readonly allowedCustomerFields;
|
|
26
|
+
private readonly allowedBillingFields;
|
|
27
|
+
private readonly allowedGiftFields;
|
|
28
|
+
private cartActionsAddProduct;
|
|
29
|
+
constructor();
|
|
30
|
+
static getInstance(): ClientCheckoutActionService;
|
|
31
|
+
setCartActionsAddProduct(addProductFn: (params: IAddProductParams[]) => Promise<void>): void;
|
|
32
|
+
get actions(): ICheckoutActions;
|
|
33
|
+
private normalizeCheckoutFieldValue;
|
|
34
|
+
private openCheckout;
|
|
35
|
+
private closeCheckout;
|
|
36
|
+
private toggleCheckout;
|
|
37
|
+
private exitCheckout;
|
|
38
|
+
private addProduct;
|
|
39
|
+
private applyPromoCode;
|
|
40
|
+
private removePromoCode;
|
|
41
|
+
private applyGiftCard;
|
|
42
|
+
private removeGiftCard;
|
|
43
|
+
private toggleIsGift;
|
|
44
|
+
private toggleBillingSameAsShipping;
|
|
45
|
+
private toggleMarketingPreferences;
|
|
46
|
+
private updateCustomerInfo;
|
|
47
|
+
private updateBillingInfo;
|
|
48
|
+
private updateGiftInfo;
|
|
49
|
+
private getDetails;
|
|
50
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
2
|
+
import { BaseActionService } from './base-action.service';
|
|
3
|
+
export interface IProductActions {
|
|
4
|
+
getDetails: (identifier: string) => IBaseProductEventData;
|
|
5
|
+
}
|
|
6
|
+
export declare class ClientProductActionService extends BaseActionService {
|
|
7
|
+
private readonly command;
|
|
8
|
+
constructor();
|
|
9
|
+
static getInstance(): ClientProductActionService;
|
|
10
|
+
get actions(): IProductActions;
|
|
11
|
+
private getDetails;
|
|
12
|
+
}
|
|
@@ -1,77 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
|
-
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
4
|
-
import { type FulfillmentType } from '@/enums';
|
|
5
|
-
import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
|
|
6
|
-
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
|
|
7
|
-
export interface IAddProductParams {
|
|
8
|
-
identifier: string;
|
|
9
|
-
fulfillmentType: FulfillmentType;
|
|
10
|
-
quantity: number;
|
|
11
|
-
}
|
|
12
|
-
export interface IAddressActions {
|
|
13
|
-
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
14
|
-
setAddressManually: (address: IAddressAddress, coordinates: IAddressCoordinates) => Promise<void>;
|
|
15
|
-
clear: () => Promise<void>;
|
|
16
|
-
getDetails: () => IAddressData | null;
|
|
17
|
-
}
|
|
18
|
-
export interface ICartActions {
|
|
19
|
-
openCart: () => void;
|
|
20
|
-
closeCart: () => void;
|
|
21
|
-
toggleCart: () => void;
|
|
22
|
-
addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
|
|
23
|
-
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
24
|
-
removePromoCode: () => Promise<void>;
|
|
25
|
-
resetCart: () => Promise<void>;
|
|
26
|
-
getDetails: () => IBaseCartEventData;
|
|
27
|
-
}
|
|
28
|
-
export interface ICheckoutActions {
|
|
29
|
-
openCheckout: () => void;
|
|
30
|
-
closeCheckout: () => void;
|
|
31
|
-
toggleCheckout: () => void;
|
|
32
|
-
addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
|
|
33
|
-
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
34
|
-
removePromoCode: () => Promise<void>;
|
|
35
|
-
applyGiftCard: (code: string) => Promise<void>;
|
|
36
|
-
removeGiftCard: (code: string) => Promise<void>;
|
|
37
|
-
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
38
|
-
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
39
|
-
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
40
|
-
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
41
|
-
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
42
|
-
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
43
|
-
getDetails: () => ICheckoutDetailsEventData;
|
|
44
|
-
}
|
|
45
|
-
export interface IProductActions {
|
|
46
|
-
getDetails: (identifier: string) => IBaseProductEventData;
|
|
47
|
-
}
|
|
1
|
+
import type { ILiquidCommerceElementsActions } from '@/interfaces/core.interface';
|
|
48
2
|
export declare class ClientActionService {
|
|
49
|
-
private readonly
|
|
50
|
-
private readonly
|
|
51
|
-
private readonly
|
|
52
|
-
private readonly
|
|
53
|
-
private readonly themeProvider;
|
|
54
|
-
private readonly logger;
|
|
55
|
-
private readonly allowedCustomerFields;
|
|
56
|
-
private readonly allowedBillingFields;
|
|
57
|
-
private readonly allowedGiftFields;
|
|
58
|
-
private pendingCartParams;
|
|
59
|
-
private pendingCartOpenFlag;
|
|
3
|
+
private readonly productActionService;
|
|
4
|
+
private readonly addressActionService;
|
|
5
|
+
private readonly cartActionService;
|
|
6
|
+
private readonly checkoutActionService;
|
|
60
7
|
constructor();
|
|
61
8
|
static getInstance(): ClientActionService;
|
|
62
|
-
|
|
63
|
-
private retryPendingCartOperation;
|
|
64
|
-
private clearPendingCartOperation;
|
|
65
|
-
private getLocation;
|
|
66
|
-
private normalizeCheckoutFieldValue;
|
|
67
|
-
private productActions;
|
|
68
|
-
private addressActions;
|
|
69
|
-
private cartActions;
|
|
70
|
-
private checkoutActions;
|
|
71
|
-
actions: {
|
|
72
|
-
product: IProductActions;
|
|
73
|
-
address: IAddressActions;
|
|
74
|
-
cart: ICartActions;
|
|
75
|
-
checkout: ICheckoutActions;
|
|
76
|
-
};
|
|
9
|
+
get actions(): ILiquidCommerceElementsActions;
|
|
77
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DebugMode, type ElementsEnv } from '@/enums';
|
|
2
2
|
import type { IPromoTicker } from '@/interfaces/configs';
|
|
3
|
-
import type { IClientCustomThemeConfig, IElementsProxyConfig } from '@/interfaces/core.interface';
|
|
3
|
+
import type { IClientCustomThemeConfig, IElementsProxyConfig, ILiquidCommerceElementsCheckoutConfig } from '@/interfaces/core.interface';
|
|
4
4
|
export type DeviceType = 'desktop' | 'tablet' | 'mobile';
|
|
5
5
|
export interface IClientConfigs {
|
|
6
6
|
apiKey: string;
|
|
@@ -22,7 +22,7 @@ export interface IClientConfigs {
|
|
|
22
22
|
paymentMethodId?: string;
|
|
23
23
|
openShadowDom?: boolean;
|
|
24
24
|
hasCustomApiUrl?: boolean;
|
|
25
|
-
|
|
25
|
+
checkout: ILiquidCommerceElementsCheckoutConfig | null;
|
|
26
26
|
}
|
|
27
27
|
export interface IClientConfigInput {
|
|
28
28
|
env?: ElementsEnv;
|
|
@@ -36,7 +36,7 @@ export interface IClientConfigInput {
|
|
|
36
36
|
paymentMethodId?: string;
|
|
37
37
|
openShadowDom?: boolean;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
40
40
|
}
|
|
41
41
|
export declare class ClientConfigService {
|
|
42
42
|
private config;
|
|
@@ -54,7 +54,6 @@ export declare class ClientConfigService {
|
|
|
54
54
|
debuggingDisabled(): boolean;
|
|
55
55
|
hasCustomTheme(): boolean;
|
|
56
56
|
isMobile(): boolean;
|
|
57
|
-
isLocalStorageAvailable(): boolean;
|
|
58
57
|
getProxyConfig(): IElementsProxyConfig | null;
|
|
59
58
|
private validateInputs;
|
|
60
59
|
private buildConfiguration;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
2
|
import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
3
3
|
import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutItemStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
|
+
import type { ICheckoutInjection, ICheckoutMetadata, IElementsMetadataStore } from '@/core/store/interfaces/metadata.interface';
|
|
4
5
|
import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
|
+
import type { IProductListStore } from '@/core/store/interfaces/product-list.interface';
|
|
5
7
|
import type { ComponentType } from '@/enums';
|
|
6
8
|
import type { ICartPromoCode } from '@/interfaces/api/cart.interface';
|
|
7
9
|
import type { ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer } from '@/interfaces/api/checkout.interface';
|
|
@@ -9,25 +11,36 @@ export interface IDrawerContentConfig {
|
|
|
9
11
|
type: ComponentType;
|
|
10
12
|
data?: Record<string, any>;
|
|
11
13
|
}
|
|
14
|
+
export interface IModalContentConfig {
|
|
15
|
+
type: ComponentType;
|
|
16
|
+
data?: Record<string, any>;
|
|
17
|
+
}
|
|
12
18
|
export interface IDrawerStore {
|
|
13
19
|
isOpen: boolean;
|
|
14
20
|
contentConfig: IDrawerContentConfig | null;
|
|
15
21
|
}
|
|
16
22
|
export interface IUIStore {
|
|
17
23
|
drawer: IDrawerStore;
|
|
24
|
+
modal: IModalStore;
|
|
25
|
+
}
|
|
26
|
+
export interface IModalStore {
|
|
27
|
+
isOpen: boolean;
|
|
28
|
+
contentConfig: IModalContentConfig | null;
|
|
18
29
|
}
|
|
19
30
|
export interface IGlobalStore {
|
|
20
31
|
address: IAddressStore;
|
|
21
32
|
products: Record<string, IProductStore>;
|
|
22
33
|
cart: ICartStore;
|
|
23
34
|
checkout: ICheckoutStore;
|
|
35
|
+
productsList: IProductListStore;
|
|
24
36
|
ui: IUIStore;
|
|
37
|
+
metadata: IElementsMetadataStore;
|
|
25
38
|
}
|
|
26
39
|
export interface IPersistedStore {
|
|
27
40
|
p?: string;
|
|
28
41
|
c?: string;
|
|
29
42
|
}
|
|
30
|
-
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}`;
|
|
43
|
+
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}` | `ui.modal.${keyof IModalStore}` | `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}` | `metadata.${keyof IElementsMetadataStore}` | `metadata.checkout.${keyof ICheckoutMetadata}` | `metadata.checkout.injection.${keyof ICheckoutInjection}` | `productsList.${string}`;
|
|
31
44
|
interface MiddlewareContext {
|
|
32
45
|
action: string;
|
|
33
46
|
payload: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ICheckoutInjection {
|
|
2
|
+
containerId: string;
|
|
3
|
+
injectedAt: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ICheckoutMetadata {
|
|
6
|
+
injection: ICheckoutInjection | null;
|
|
7
|
+
returnUrl: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface IElementsMetadataStore {
|
|
10
|
+
checkout: ICheckoutMetadata;
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { IPagination } from 'modules/product-list/product-list.interface';
|
|
2
|
+
import type { FulfillmentType } from '@/enums';
|
|
3
|
+
import type { IFulfillment, IProduct, IProductVariant, IRetailer, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
4
|
+
import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
|
|
5
|
+
import type { IProductSizeStore } from './product.interface';
|
|
6
|
+
export type IProductFulfillmentStore = IFulfillment & {
|
|
7
|
+
retailerName: string;
|
|
8
|
+
retailerAddress: IRetailerAddress;
|
|
9
|
+
retailerAddressFormatted: string;
|
|
10
|
+
variant: IProductVariant;
|
|
11
|
+
image: string | null;
|
|
12
|
+
};
|
|
13
|
+
export interface IProductList extends IProduct {
|
|
14
|
+
quantity: number;
|
|
15
|
+
selectedSizeId: string | null;
|
|
16
|
+
selectedFulfillmentType: FulfillmentType;
|
|
17
|
+
selectedFulfillmentId: string | null;
|
|
18
|
+
selectedFulfillment: IProductFulfillmentStore | null;
|
|
19
|
+
productHasAvailability: boolean;
|
|
20
|
+
fulfillmentHasAvailability: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface IProductListProduct extends Omit<IProduct, 'sizes'> {
|
|
23
|
+
sizes: Record<string, IProductSizeStore>;
|
|
24
|
+
}
|
|
25
|
+
export interface IProductListStore {
|
|
26
|
+
products: IProductListProduct[];
|
|
27
|
+
retailers: Record<string, IRetailer>;
|
|
28
|
+
filters: IFilterSchema[];
|
|
29
|
+
pagination: IPagination;
|
|
30
|
+
appliedFilters: Record<string, string[]>;
|
|
31
|
+
searchTerm: string;
|
|
32
|
+
gridConfig?: {
|
|
33
|
+
rows: number;
|
|
34
|
+
columns: number;
|
|
35
|
+
};
|
|
36
|
+
userProducts: {
|
|
37
|
+
[productId: string]: {
|
|
38
|
+
selectedSizeId: string;
|
|
39
|
+
selectedFulfillmentType: FulfillmentType;
|
|
40
|
+
selectedFulfillment: IProductFulfillmentStore | null;
|
|
41
|
+
selectedQuantity: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
loading: boolean;
|
|
45
|
+
}
|
|
@@ -13,6 +13,7 @@ export type IProductFulfillmentStore = IFulfillment & {
|
|
|
13
13
|
retailerAddress: IRetailerAddress;
|
|
14
14
|
retailerAddressFormatted: string;
|
|
15
15
|
variant: IProductVariant;
|
|
16
|
+
image?: string;
|
|
16
17
|
};
|
|
17
18
|
export interface IProductSizeStore extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
18
19
|
onDemandFulfillments: Record<string, IProductFulfillmentStore>;
|
|
@@ -2,11 +2,15 @@ import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
|
2
2
|
import type { ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
3
3
|
import type { ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
4
|
import type { IGlobalStore, IUIStore } from '@/core/store/interfaces/core.interface';
|
|
5
|
+
import type { IElementsMetadataStore } from '@/core/store/interfaces/metadata.interface';
|
|
5
6
|
import type { IProductStore } from '@/core/store/interfaces/product.interface';
|
|
7
|
+
import type { IProductListStore } from './interfaces/product-list.interface';
|
|
6
8
|
export declare const LOCAL_STORAGE_PREFIX = "lce";
|
|
7
9
|
export declare const initialAddressState: IAddressStore;
|
|
8
10
|
export declare const initialProductState: IProductStore;
|
|
9
11
|
export declare const initialCartState: ICartStore;
|
|
10
12
|
export declare const initialCheckoutState: ICheckoutStore;
|
|
11
13
|
export declare const initialUIState: IUIStore;
|
|
14
|
+
export declare const initialMetadataState: IElementsMetadataStore;
|
|
15
|
+
export declare const initialProductsListState: IProductListStore;
|
|
12
16
|
export declare const initialStoreState: IGlobalStore;
|
|
@@ -68,7 +68,6 @@ export declare const ELEMENTS_FORM: {
|
|
|
68
68
|
export declare const COMPONENT_TYPE: {
|
|
69
69
|
readonly DRAWER: "drawer";
|
|
70
70
|
readonly INPUT: "input";
|
|
71
|
-
readonly BIRTHDATE_INPUT: "birthdate-input";
|
|
72
71
|
readonly ENGRAVING_FORM: "engraving-form";
|
|
73
72
|
readonly ENGRAVING_VIEW: "engraving-view";
|
|
74
73
|
readonly BUTTONS_CART_OPEN: "buttons-cart-open";
|
|
@@ -77,6 +76,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
77
76
|
readonly PURCHASE_MIN_ALERT: "purchase-min-alert";
|
|
78
77
|
readonly ALERT: "alert";
|
|
79
78
|
readonly PROMO_CODE_TICKER: "promo-code-ticker";
|
|
79
|
+
readonly MODAL: "modal";
|
|
80
80
|
readonly ADDRESS: "address";
|
|
81
81
|
readonly ADDRESS_INPUT: "address-input";
|
|
82
82
|
readonly ADDRESS_DISPLAY: "address-display";
|
|
@@ -98,6 +98,8 @@ export declare const COMPONENT_TYPE: {
|
|
|
98
98
|
readonly PRODUCT_LIST_FILTERS: "product-list-filters";
|
|
99
99
|
readonly PRODUCT_LIST_SEARCH: "product-list-search";
|
|
100
100
|
readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
|
|
101
|
+
readonly PRODUCT_LIST_RETAILERS: "product-list-retailers";
|
|
102
|
+
readonly PRODUCT_LIST_ENGRAVING_FORM: "product-list-engraving-form";
|
|
101
103
|
readonly CART: "cart";
|
|
102
104
|
readonly CART_RETAILER: "cart-retailer";
|
|
103
105
|
readonly CART_ITEM: "cart-item";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IElementsCheckoutActions, IElementsCheckoutClient } from '@/clients/checkout';
|
|
2
|
+
import { ElementsCheckout } from '@/clients/checkout';
|
|
3
|
+
import type { DebugMode, ElementsEnv } from '@/enums';
|
|
4
|
+
import { DEBUG_MODE, ELEMENTS_ENV } from '@/enums';
|
|
5
|
+
import type { IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/core.interface';
|
|
6
|
+
export { DEBUG_MODE, ELEMENTS_ENV, ElementsCheckout };
|
|
7
|
+
export type { DebugMode, ElementsEnv, IElementsCheckoutActions, IElementsCheckoutClient, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig, };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export * from './clients/builder';
|
|
2
|
+
export * from './clients/main';
|
|
1
3
|
export * from './core/sdk-error-handler';
|
|
2
|
-
export * from './elements-builder-client';
|
|
3
|
-
export * from './elements-client';
|
|
4
4
|
export * from './enums';
|
|
5
5
|
export * from './interfaces/configs';
|
|
6
6
|
export * from './interfaces/core.interface';
|
|
@@ -63,7 +63,8 @@ export interface ICheckoutDeliveryInstructions {
|
|
|
63
63
|
instructions: string;
|
|
64
64
|
}
|
|
65
65
|
export interface ICheckoutPrepareParams {
|
|
66
|
-
cartId
|
|
66
|
+
cartId?: string;
|
|
67
|
+
token?: string;
|
|
67
68
|
customer?: ICheckoutCustomer;
|
|
68
69
|
shippingAddressTwo?: string;
|
|
69
70
|
billingAddress?: ICheckoutBilling;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FILTER_KEYS } from 'modules/product-list/product-list.constants';
|
|
2
2
|
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
3
3
|
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
4
4
|
export interface IProductSearchParams {
|
|
@@ -7,16 +7,24 @@ export interface IProductSearchParams {
|
|
|
7
7
|
pageToken?: string;
|
|
8
8
|
page?: number;
|
|
9
9
|
perPage?: number;
|
|
10
|
-
filters?:
|
|
10
|
+
filters?: IFilterParams[];
|
|
11
11
|
}
|
|
12
|
-
export type
|
|
12
|
+
export type IFilterParamsValue = string | string[] | {
|
|
13
|
+
min?: string | number;
|
|
14
|
+
max?: string | number;
|
|
15
|
+
} | boolean;
|
|
16
|
+
export interface IFilterParams {
|
|
17
|
+
key: string;
|
|
18
|
+
values: IFilterParamsValue;
|
|
19
|
+
}
|
|
20
|
+
export type FacetFilterKeys = typeof FILTER_KEYS.BRANDS | typeof FILTER_KEYS.CATEGORIES | typeof FILTER_KEYS.FLAVOR | typeof FILTER_KEYS.REGION | typeof FILTER_KEYS.VARIETY | typeof FILTER_KEYS.VINTAGE | typeof FILTER_KEYS.COUNTRY | typeof FILTER_KEYS.APPELLATION | typeof FILTER_KEYS.TAGS | typeof FILTER_KEYS.MATERIALS | typeof FILTER_KEYS.SIZES | typeof FILTER_KEYS.ENGRAVING | typeof FILTER_KEYS.PRESALE | typeof FILTER_KEYS.FULFILLMENT | typeof FILTER_KEYS.PRICE | typeof FILTER_KEYS.AVAILABILITY | typeof FILTER_KEYS.COLORS;
|
|
13
21
|
export interface IFilterSchema {
|
|
14
|
-
|
|
22
|
+
type: FacetFilterKeys;
|
|
15
23
|
values: IFilterValue[];
|
|
16
24
|
}
|
|
17
25
|
export interface IFilterValue {
|
|
18
26
|
value: string;
|
|
19
|
-
|
|
27
|
+
name: string;
|
|
20
28
|
count: number;
|
|
21
29
|
}
|
|
22
30
|
export interface INavigationResponse {
|
|
@@ -4,6 +4,7 @@ import type { IAddressComponent } from './address.interface';
|
|
|
4
4
|
import type { ICartComponent } from './cart.interface';
|
|
5
5
|
import type { ICheckoutComponent } from './checkout.interface';
|
|
6
6
|
import type { IProductComponent } from './product.interface';
|
|
7
|
+
import type { IProductListComponent } from './product-list.interface';
|
|
7
8
|
export interface IFontFamily {
|
|
8
9
|
name: string;
|
|
9
10
|
weights: number[];
|
|
@@ -55,6 +56,7 @@ export interface IAllConfigs {
|
|
|
55
56
|
address: IAddressComponent;
|
|
56
57
|
cart: ICartComponent;
|
|
57
58
|
checkout: ICheckoutComponent;
|
|
59
|
+
productList: IProductListComponent;
|
|
58
60
|
}
|
|
59
|
-
export type ConfigsKeyType = 'all' | 'configurations' | 'global' | 'product' | 'address' | 'cart' | 'checkout';
|
|
60
|
-
export type ConfigsType = IAllConfigs | IElementsConfigurations | IComponentGlobalConfigs | IProductComponent | IAddressComponent | ICartComponent | ICheckoutComponent;
|
|
61
|
+
export type ConfigsKeyType = 'all' | 'configurations' | 'global' | 'product' | 'address' | 'cart' | 'checkout' | 'productList';
|
|
62
|
+
export type ConfigsType = IAllConfigs | IElementsConfigurations | IComponentGlobalConfigs | IProductComponent | IAddressComponent | ICartComponent | ICheckoutComponent | IProductListComponent;
|