@liquidcommerce/elements-sdk 2.6.0-beta.9 → 2.6.0-beta.91
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 +84 -2520
- package/dist/index.checkout.esm.js +16946 -0
- package/dist/index.esm.js +24448 -21193
- package/dist/ssr-stub.checkout.esm.js +18 -0
- package/dist/ssr-stub.esm.js +270 -0
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
- package/dist/types/clients/builder.d.ts +3 -0
- package/dist/types/clients/checkout.d.ts +6 -0
- package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
- package/dist/types/clients/main.d.ts +3 -0
- package/dist/types/constants/core.constant.d.ts +2 -6
- package/dist/types/core/api/api-client.service.d.ts +20 -18
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +37 -13
- package/dist/types/core/api/http-client.service.d.ts +0 -8
- package/dist/types/core/base-component.service.d.ts +2 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +22 -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 +38 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -74
- package/dist/types/core/client/client-config.service.d.ts +8 -5
- package/dist/types/core/google-tag-manager.service.d.ts +2 -1
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
- package/dist/types/core/store/store.constant.d.ts +5 -0
- 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 +39 -1
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +8 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
- package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
- package/dist/types/interfaces/api/index.d.ts +5 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
- package/dist/types/interfaces/api/product.interface.d.ts +10 -4
- package/dist/types/interfaces/client.interface.d.ts +72 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +40 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +5 -3
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +3 -1
- package/dist/types/interfaces/injection.interface.d.ts +49 -0
- package/dist/types/modules/address/address.command.d.ts +2 -1
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +4 -4
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +26 -10
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +1 -1
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +3 -0
- package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +3 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +5 -2
- package/dist/types/modules/product/product.commands.d.ts +3 -3
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -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-price-and-personalization.d.ts +13 -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 +13 -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 +7 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -2
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -31
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +55 -36
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +50 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
- package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +23 -8
- package/dist/types/modules/product-list/product-list.component.d.ts +14 -47
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +20 -35
- 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 -2
- 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 +6 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +6 -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/lce-element/lce-element.component.d.ts +2 -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 +5 -1
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +0 -14
- package/dist/types/utils/image-bg-removal.d.ts +3 -0
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +15 -0
- package/docs/v1/README.md +210 -0
- package/docs/v1/api/actions/address-actions.md +286 -0
- package/docs/v1/api/actions/cart-actions.md +357 -0
- package/docs/v1/api/actions/checkout-actions.md +525 -0
- package/docs/v1/api/actions/product-actions.md +204 -0
- package/docs/v1/api/client.md +517 -0
- package/docs/v1/api/configuration.md +532 -0
- package/docs/v1/api/injection-methods.md +292 -0
- package/docs/v1/api/typescript-types.md +419 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +199 -0
- package/docs/v1/examples/checkout-flow.md +90 -0
- package/docs/v1/examples/custom-theming.md +63 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +502 -0
- package/docs/v1/getting-started/installation.md +328 -0
- package/docs/v1/getting-started/quick-start.md +405 -0
- package/docs/v1/guides/address-component.md +435 -0
- package/docs/v1/guides/best-practices.md +365 -0
- package/docs/v1/guides/cart-component.md +725 -0
- package/docs/v1/guides/checkout-component.md +670 -0
- package/docs/v1/guides/events.md +926 -0
- package/docs/v1/guides/product-component.md +731 -0
- package/docs/v1/guides/product-list-component.md +631 -0
- package/docs/v1/guides/theming.md +213 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +69 -0
- package/docs/v1/integration/proxy-setup.md +106 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +58 -0
- package/docs/v1/reference/browser-support.md +45 -0
- package/docs/v1/reference/error-handling.md +75 -0
- package/docs/v1/reference/performance.md +52 -0
- package/docs/v1/reference/troubleshooting.md +136 -0
- package/package.json +33 -37
- package/dist/types/elements-builder-client.d.ts +0 -2
- package/dist/types/elements-client.d.ts +0 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -106
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -42
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -4
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/interfaces/core.interface.d.ts +0 -111
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- 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/dist/types/utils/helper.d.ts +0 -28
- package/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -592
- package/docs/TROUBLESHOOTING.md +0 -793
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/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,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,38 @@
|
|
|
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
|
+
engravingLines?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface ICartActions {
|
|
11
|
+
openCart: () => void;
|
|
12
|
+
closeCart: () => void;
|
|
13
|
+
toggleCart: () => void;
|
|
14
|
+
addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
|
|
15
|
+
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
16
|
+
removePromoCode: () => Promise<void>;
|
|
17
|
+
resetCart: () => Promise<void>;
|
|
18
|
+
getDetails: () => IBaseCartEventData;
|
|
19
|
+
}
|
|
20
|
+
export declare class ClientCartActionService extends BaseActionService {
|
|
21
|
+
private readonly command;
|
|
22
|
+
private pendingCartParams;
|
|
23
|
+
private pendingCartOpenFlag;
|
|
24
|
+
constructor();
|
|
25
|
+
static getInstance(): ClientCartActionService;
|
|
26
|
+
get actions(): ICartActions;
|
|
27
|
+
private setupAddressUpdateListener;
|
|
28
|
+
private retryPendingCartOperation;
|
|
29
|
+
private clearPendingCartOperation;
|
|
30
|
+
private openCart;
|
|
31
|
+
private closeCart;
|
|
32
|
+
private toggleCart;
|
|
33
|
+
private addProduct;
|
|
34
|
+
private applyPromoCode;
|
|
35
|
+
private removePromoCode;
|
|
36
|
+
private resetCart;
|
|
37
|
+
private getDetails;
|
|
38
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
2
|
+
import type { IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse } from '@/interfaces/api/checkout.interface';
|
|
3
|
+
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
4
|
+
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
|
|
5
|
+
import { BaseActionService } from './base-action.service';
|
|
6
|
+
import type { IAddProductParams } from './client-cart-action.service';
|
|
7
|
+
export interface ISavedPaymentMethodInput {
|
|
8
|
+
id: string;
|
|
9
|
+
card: {
|
|
10
|
+
brand: string;
|
|
11
|
+
last4: string;
|
|
12
|
+
expMonth?: string | number;
|
|
13
|
+
expYear?: string | number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ICheckoutActions {
|
|
17
|
+
openCheckout: () => void;
|
|
18
|
+
closeCheckout: () => void;
|
|
19
|
+
toggleCheckout: () => void;
|
|
20
|
+
exitCheckout: () => void;
|
|
21
|
+
setSavedPaymentMethod: (params: ISavedPaymentMethodInput) => void;
|
|
22
|
+
clearSavedPaymentMethod: () => void;
|
|
23
|
+
addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
|
|
24
|
+
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
25
|
+
removePromoCode: () => Promise<void>;
|
|
26
|
+
applyGiftCard: (code: string) => Promise<void>;
|
|
27
|
+
removeGiftCard: (code: string) => Promise<void>;
|
|
28
|
+
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
29
|
+
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
30
|
+
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
31
|
+
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
32
|
+
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
33
|
+
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
34
|
+
getDetails: () => ICheckoutDetailsEventData;
|
|
35
|
+
getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
|
|
36
|
+
addAnonymousProduct: (params: IAnonymousCheckoutAddProductParams) => Promise<IAnonymousCheckoutAddProductResponse>;
|
|
37
|
+
}
|
|
38
|
+
export declare class ClientCheckoutActionService extends BaseActionService {
|
|
39
|
+
private readonly command;
|
|
40
|
+
private readonly allowedCustomerFields;
|
|
41
|
+
private readonly allowedBillingFields;
|
|
42
|
+
private readonly allowedGiftFields;
|
|
43
|
+
private cartActionsAddProduct;
|
|
44
|
+
constructor();
|
|
45
|
+
static getInstance(): ClientCheckoutActionService;
|
|
46
|
+
setCartActionsAddProduct(addProductFn: (params: IAddProductParams[]) => Promise<void>): void;
|
|
47
|
+
get actions(): ICheckoutActions;
|
|
48
|
+
private normalizeCheckoutFieldValue;
|
|
49
|
+
private openCheckout;
|
|
50
|
+
private closeCheckout;
|
|
51
|
+
private toggleCheckout;
|
|
52
|
+
private exitCheckout;
|
|
53
|
+
private setSavedPaymentMethod;
|
|
54
|
+
private clearSavedPaymentMethod;
|
|
55
|
+
private addProduct;
|
|
56
|
+
private applyPromoCode;
|
|
57
|
+
private removePromoCode;
|
|
58
|
+
private applyGiftCard;
|
|
59
|
+
private removeGiftCard;
|
|
60
|
+
private toggleIsGift;
|
|
61
|
+
private toggleBillingSameAsShipping;
|
|
62
|
+
private toggleMarketingPreferences;
|
|
63
|
+
private updateCustomerInfo;
|
|
64
|
+
private updateBillingInfo;
|
|
65
|
+
private updateGiftInfo;
|
|
66
|
+
private getDetails;
|
|
67
|
+
private addAnonymousProduct;
|
|
68
|
+
private getProductAvailabilityByState;
|
|
69
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
2
|
+
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
3
|
+
import { BaseActionService } from './base-action.service';
|
|
4
|
+
export interface IProductActions {
|
|
5
|
+
getDetails: (identifier: string) => IBaseProductEventData;
|
|
6
|
+
getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
|
|
7
|
+
}
|
|
8
|
+
export declare class ClientProductActionService extends BaseActionService {
|
|
9
|
+
private readonly command;
|
|
10
|
+
constructor();
|
|
11
|
+
static getInstance(): ClientProductActionService;
|
|
12
|
+
get actions(): IProductActions;
|
|
13
|
+
private getDetails;
|
|
14
|
+
private getProductAvailabilityByState;
|
|
15
|
+
}
|
|
@@ -1,78 +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/components/checkout.type';
|
|
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
|
-
addPresaleProduct: (params: IAddProductParams) => Promise<void>;
|
|
34
|
-
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
35
|
-
removePromoCode: () => Promise<void>;
|
|
36
|
-
applyGiftCard: (code: string) => Promise<void>;
|
|
37
|
-
removeGiftCard: (code: string) => Promise<void>;
|
|
38
|
-
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
39
|
-
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
40
|
-
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
41
|
-
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
42
|
-
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
43
|
-
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
44
|
-
getDetails: () => ICheckoutDetailsEventData;
|
|
45
|
-
}
|
|
46
|
-
export interface IProductActions {
|
|
47
|
-
getDetails: (identifier: string) => IBaseProductEventData;
|
|
48
|
-
}
|
|
1
|
+
import type { ILiquidCommerceElementsActions } from '@/interfaces/client.interface';
|
|
49
2
|
export declare class ClientActionService {
|
|
50
|
-
private readonly
|
|
51
|
-
private readonly
|
|
52
|
-
private readonly
|
|
53
|
-
private readonly
|
|
54
|
-
private readonly themeProvider;
|
|
55
|
-
private readonly logger;
|
|
56
|
-
private readonly allowedCustomerFields;
|
|
57
|
-
private readonly allowedBillingFields;
|
|
58
|
-
private readonly allowedGiftFields;
|
|
59
|
-
private pendingCartParams;
|
|
60
|
-
private pendingCartOpenFlag;
|
|
3
|
+
private readonly productActionService;
|
|
4
|
+
private readonly addressActionService;
|
|
5
|
+
private readonly cartActionService;
|
|
6
|
+
private readonly checkoutActionService;
|
|
61
7
|
constructor();
|
|
62
8
|
static getInstance(): ClientActionService;
|
|
63
|
-
|
|
64
|
-
private retryPendingCartOperation;
|
|
65
|
-
private clearPendingCartOperation;
|
|
66
|
-
private getLocation;
|
|
67
|
-
private normalizeCheckoutFieldValue;
|
|
68
|
-
private productActions;
|
|
69
|
-
private addressActions;
|
|
70
|
-
private cartActions;
|
|
71
|
-
private checkoutActions;
|
|
72
|
-
actions: {
|
|
73
|
-
product: IProductActions;
|
|
74
|
-
address: IAddressActions;
|
|
75
|
-
cart: ICartActions;
|
|
76
|
-
checkout: ICheckoutActions;
|
|
77
|
-
};
|
|
9
|
+
get actions(): ILiquidCommerceElementsActions;
|
|
78
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DebugMode, type ElementsEnv } from '@/enums';
|
|
2
|
+
import type { IClientCustomThemeConfig, IElementsProxyConfig, ILiquidCommerceElementsCheckoutConfig } from '@/interfaces/config.interface';
|
|
2
3
|
import type { IPromoTicker } from '@/interfaces/configs';
|
|
3
|
-
import type { IClientCustomThemeConfig, IElementsProxyConfig } from '@/interfaces/core.interface';
|
|
4
4
|
export type DeviceType = 'desktop' | 'tablet' | 'mobile';
|
|
5
5
|
export interface IClientConfigs {
|
|
6
6
|
apiKey: string;
|
|
@@ -19,9 +19,11 @@ export interface IClientConfigs {
|
|
|
19
19
|
version?: string;
|
|
20
20
|
clientPrepared: boolean;
|
|
21
21
|
promoTicker: IPromoTicker[] | null;
|
|
22
|
-
paymentMethodId?: string;
|
|
23
22
|
openShadowDom?: boolean;
|
|
24
23
|
hasCustomApiUrl?: boolean;
|
|
24
|
+
mockMode: boolean;
|
|
25
|
+
checkout: ILiquidCommerceElementsCheckoutConfig | null;
|
|
26
|
+
isCheckoutOnly: boolean;
|
|
25
27
|
}
|
|
26
28
|
export interface IClientConfigInput {
|
|
27
29
|
env?: ElementsEnv;
|
|
@@ -32,9 +34,11 @@ export interface IClientConfigInput {
|
|
|
32
34
|
promoTicker?: IPromoTicker[];
|
|
33
35
|
development?: {
|
|
34
36
|
customApiUrl?: string;
|
|
35
|
-
paymentMethodId?: string;
|
|
36
37
|
openShadowDom?: boolean;
|
|
38
|
+
mockMode?: boolean;
|
|
37
39
|
};
|
|
40
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
41
|
+
isCheckoutOnly?: boolean;
|
|
38
42
|
}
|
|
39
43
|
export declare class ClientConfigService {
|
|
40
44
|
private config;
|
|
@@ -43,16 +47,15 @@ export declare class ClientConfigService {
|
|
|
43
47
|
getConfigs(): IClientConfigs;
|
|
44
48
|
get<K extends keyof IClientConfigs>(key: K): IClientConfigs[K];
|
|
45
49
|
set<K extends keyof IClientConfigs>(key: K, value: IClientConfigs[K]): void;
|
|
46
|
-
isDevelopment(): boolean;
|
|
47
50
|
isStaging(): boolean;
|
|
48
51
|
isProduction(): boolean;
|
|
49
52
|
isBuilder(): boolean;
|
|
53
|
+
isCheckoutOnly(): boolean;
|
|
50
54
|
isDebuggingEnabled(): boolean;
|
|
51
55
|
isDebugPanelEnabled(): boolean;
|
|
52
56
|
debuggingDisabled(): boolean;
|
|
53
57
|
hasCustomTheme(): boolean;
|
|
54
58
|
isMobile(): boolean;
|
|
55
|
-
isLocalStorageAvailable(): boolean;
|
|
56
59
|
getProxyConfig(): IElementsProxyConfig | null;
|
|
57
60
|
private validateInputs;
|
|
58
61
|
private buildConfiguration;
|
|
@@ -33,6 +33,7 @@ interface BaseItem {
|
|
|
33
33
|
quantity?: number;
|
|
34
34
|
item_type?: string;
|
|
35
35
|
item_subtype?: string;
|
|
36
|
+
item_image?: string;
|
|
36
37
|
upc?: string;
|
|
37
38
|
grouping_id?: string;
|
|
38
39
|
product_id?: string;
|
|
@@ -93,7 +94,7 @@ export declare class GoogleTagManagerService {
|
|
|
93
94
|
net_total?: number;
|
|
94
95
|
}): void;
|
|
95
96
|
promoCodeAttempt(code: string): void;
|
|
96
|
-
promoCodeApplied(code: string,
|
|
97
|
+
promoCodeApplied(code: string, discount?: number): void;
|
|
97
98
|
promoCodeFailed(code: string, reason?: string): void;
|
|
98
99
|
giftCardAttempt(code: string): void;
|
|
99
100
|
giftCardApplied(code: string, appliedAmount?: number): void;
|
|
@@ -13,6 +13,6 @@ export declare class LoggerService {
|
|
|
13
13
|
debug(message: string, data?: Record<string, any>): void;
|
|
14
14
|
info(message: string, data?: Record<string, any>): void;
|
|
15
15
|
warn(message: string, data?: Record<string, any>): void;
|
|
16
|
-
error(message: string,
|
|
16
|
+
error(message: string, errorOrData?: Error | Record<string, any>): void;
|
|
17
17
|
private sendToTelemetry;
|
|
18
18
|
}
|
|
@@ -1,25 +1,56 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ICheckoutTotalAmounts } from '@/interfaces/cloud';
|
|
1
|
+
import type { ICheckoutAmounts, ICheckoutItem } from '@/interfaces/api/checkout.interface';
|
|
3
2
|
export interface IBaseCheckoutEventData {
|
|
3
|
+
token: string;
|
|
4
4
|
cartId: string;
|
|
5
|
+
isGift: boolean;
|
|
6
|
+
billingSameAsShipping: boolean;
|
|
7
|
+
marketingPreferences: {
|
|
8
|
+
canEmail: boolean;
|
|
9
|
+
canSms: boolean;
|
|
10
|
+
};
|
|
11
|
+
hasPromoCode: boolean;
|
|
12
|
+
hasGiftCards: boolean;
|
|
13
|
+
amounts: ICheckoutAmounts;
|
|
14
|
+
itemCount: number;
|
|
15
|
+
items: Record<string, ICheckoutItem>;
|
|
5
16
|
}
|
|
6
17
|
export interface ICheckoutLoadedEventData extends IBaseCheckoutEventData {
|
|
7
18
|
}
|
|
19
|
+
export interface ICheckoutDetailsEventData extends IBaseCheckoutEventData {
|
|
20
|
+
}
|
|
21
|
+
export interface ICheckoutCustomerInformationUpdatedEventData {
|
|
22
|
+
cartId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ICheckoutGiftInformationUpdatedEventData {
|
|
25
|
+
cartId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ICheckoutBillingInformationUpdatedEventData {
|
|
28
|
+
cartId: string;
|
|
29
|
+
}
|
|
8
30
|
export interface ICheckoutTipUpdatedEventData {
|
|
31
|
+
cartId: string;
|
|
9
32
|
deliveryTips: Array<{
|
|
10
|
-
fulfillmentId
|
|
11
|
-
|
|
33
|
+
fulfillmentId: string;
|
|
34
|
+
tip: number;
|
|
35
|
+
}>;
|
|
36
|
+
previousDeliveryTips: Array<{
|
|
37
|
+
fulfillmentId: string;
|
|
38
|
+
tip: number;
|
|
12
39
|
}>;
|
|
13
40
|
}
|
|
14
41
|
export interface ICheckoutFailedEventData {
|
|
15
42
|
message: string;
|
|
16
43
|
}
|
|
17
44
|
export interface ICheckoutToggleEventData {
|
|
45
|
+
cartId: string;
|
|
18
46
|
isActive: boolean;
|
|
47
|
+
previousIsActive: boolean;
|
|
19
48
|
}
|
|
20
49
|
export interface ICheckoutMarketingPreferencesToggleEventData {
|
|
50
|
+
cartId: string;
|
|
21
51
|
fieldName: 'canEmail' | 'canSms';
|
|
22
52
|
isActive: boolean;
|
|
53
|
+
previousIsActive: boolean;
|
|
23
54
|
}
|
|
24
55
|
export interface ICheckoutSubmitStartedEventData {
|
|
25
56
|
started: boolean;
|
|
@@ -49,7 +80,7 @@ export interface ICheckoutItemEngravingUpdatedEventData {
|
|
|
49
80
|
}
|
|
50
81
|
export interface ICheckoutPromoCodeEventData {
|
|
51
82
|
cartId: string;
|
|
52
|
-
|
|
83
|
+
discount?: number;
|
|
53
84
|
newTotal?: number;
|
|
54
85
|
}
|
|
55
86
|
export interface ICheckoutPromoCodeFailedEventData {
|
|
@@ -76,49 +107,3 @@ export interface ICheckoutProductAddFailedEventData {
|
|
|
76
107
|
error: string;
|
|
77
108
|
isPresale?: boolean;
|
|
78
109
|
}
|
|
79
|
-
export interface ICheckoutItemEventData {
|
|
80
|
-
liquidId: string;
|
|
81
|
-
variantId: string;
|
|
82
|
-
cartItemId: string;
|
|
83
|
-
retailerId: string;
|
|
84
|
-
fulfillmentId: string;
|
|
85
|
-
salsifyGrouping: string;
|
|
86
|
-
name: string;
|
|
87
|
-
catPath: string;
|
|
88
|
-
volume: string;
|
|
89
|
-
uom: string;
|
|
90
|
-
proof: string;
|
|
91
|
-
abv: string;
|
|
92
|
-
containerType: string;
|
|
93
|
-
container: string;
|
|
94
|
-
size: string;
|
|
95
|
-
pack: boolean;
|
|
96
|
-
packDesc: string;
|
|
97
|
-
mainImage: string;
|
|
98
|
-
brand: string;
|
|
99
|
-
partNumber: string;
|
|
100
|
-
upc: string;
|
|
101
|
-
sku: string;
|
|
102
|
-
price: number;
|
|
103
|
-
unitPrice: number;
|
|
104
|
-
quantity: number;
|
|
105
|
-
unitTax: number;
|
|
106
|
-
bottleDeposits: number;
|
|
107
|
-
attributes: ICartItemAttributes;
|
|
108
|
-
retailerName: string;
|
|
109
|
-
expectationDetail: string;
|
|
110
|
-
}
|
|
111
|
-
export interface ICheckoutDetailsEventData {
|
|
112
|
-
cartId: string;
|
|
113
|
-
isGift: boolean;
|
|
114
|
-
billingSameAsShipping: boolean;
|
|
115
|
-
marketingPreferences: {
|
|
116
|
-
canEmail: boolean;
|
|
117
|
-
canSms: boolean;
|
|
118
|
-
};
|
|
119
|
-
hasPromoCode: boolean;
|
|
120
|
-
hasGiftCards: boolean;
|
|
121
|
-
amounts: ICheckoutTotalAmounts;
|
|
122
|
-
itemCount: number;
|
|
123
|
-
items: Record<string, ICheckoutItemEventData>;
|
|
124
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IAddressActionEventData } from '@/core/pubsub/interfaces/address.interface';
|
|
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, ICartUpdatedEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
|
-
import type { ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
|
+
import type { ICheckoutBillingInformationUpdatedEventData, ICheckoutCustomerInformationUpdatedEventData, ICheckoutFailedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutGiftInformationUpdatedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, 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 {
|
|
@@ -16,6 +16,10 @@ export interface IEventMetadata {
|
|
|
16
16
|
originalEvent: string;
|
|
17
17
|
actionNamespace?: 'address' | 'product' | 'cart' | 'checkout' | 'other';
|
|
18
18
|
timestamp: number;
|
|
19
|
+
sdkVersion: string;
|
|
20
|
+
env: string;
|
|
21
|
+
tenantName: string;
|
|
22
|
+
tenantCode: string;
|
|
19
23
|
}
|
|
20
24
|
export interface IEnhancedEventData<T> {
|
|
21
25
|
data: T;
|
|
@@ -25,7 +29,7 @@ export interface IElementsActionsEventsMap {
|
|
|
25
29
|
[ELEMENTS_ACTIONS_EVENT.CLIENT_READY]: IElementsClientIsReadyEventData;
|
|
26
30
|
[ELEMENTS_ACTIONS_EVENT.ADDRESS_UPDATED]: IAddressActionEventData;
|
|
27
31
|
[ELEMENTS_ACTIONS_EVENT.ADDRESS_CLEARED]: boolean;
|
|
28
|
-
[ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]:
|
|
32
|
+
[ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]: IAddressFailedEventData;
|
|
29
33
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_LOADED]: IProductLoadedEventData;
|
|
30
34
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_DECREASE]: IProductQuantityChangedEventData;
|
|
31
35
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_INCREASE]: IProductQuantityChangedEventData;
|
|
@@ -49,6 +53,7 @@ export interface IElementsActionsEventsMap {
|
|
|
49
53
|
[ELEMENTS_ACTIONS_EVENT.CART_PROMO_CODE_FAILED]: ICartPromoCodeFailedEventData;
|
|
50
54
|
[ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_SUCCESS]: ICartProductAddEventData;
|
|
51
55
|
[ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_FAILED]: ICartProductAddFailedEventData;
|
|
56
|
+
[ELEMENTS_ACTIONS_EVENT.INTERNAL_CART_TO_CHECKOUT]: object;
|
|
52
57
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_OPENED]: boolean;
|
|
53
58
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CLOSED]: boolean;
|
|
54
59
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_LOADED]: ICheckoutLoadedEventData;
|
|
@@ -56,9 +61,9 @@ export interface IElementsActionsEventsMap {
|
|
|
56
61
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_IS_GIFT_TOGGLED]: ICheckoutToggleEventData;
|
|
57
62
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED]: ICheckoutToggleEventData;
|
|
58
63
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_MARKETING_PREFERENCES_TOGGLED]: ICheckoutMarketingPreferencesToggleEventData;
|
|
59
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]:
|
|
60
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]:
|
|
61
|
-
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]:
|
|
64
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]: ICheckoutCustomerInformationUpdatedEventData;
|
|
65
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]: ICheckoutGiftInformationUpdatedEventData;
|
|
66
|
+
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]: ICheckoutBillingInformationUpdatedEventData;
|
|
62
67
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_REMOVED]: ICheckoutItemRemovedEventData;
|
|
63
68
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_INCREASE]: ICheckoutItemQuantityChangedEventData;
|
|
64
69
|
[ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_DECREASE]: ICheckoutItemQuantityChangedEventData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IElementsActionsEventsMap, IElementsFormsEventsMap, SpecificActionEvent, SpecificFormEvent } from '@/core/pubsub/interfaces/core.interface';
|
|
2
2
|
export declare class PubSubService {
|
|
3
3
|
private readonly logger;
|
|
4
|
-
private
|
|
4
|
+
private readonly clientConfig;
|
|
5
5
|
constructor();
|
|
6
6
|
private readonly eventPrefix;
|
|
7
7
|
static getInstance(): PubSubService;
|
|
@@ -9,5 +9,4 @@ export declare class PubSubService {
|
|
|
9
9
|
publishForm<K extends SpecificFormEvent>(eventType: K, data: IElementsFormsEventsMap[K]): void;
|
|
10
10
|
private publishSpecific;
|
|
11
11
|
private dispatchNativeEvents;
|
|
12
|
-
private setupClientReadyBuffering;
|
|
13
12
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
2
|
-
import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/
|
|
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 {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
1
|
+
import type { ICartEvent, ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
3
2
|
export interface ICartItemStore {
|
|
4
3
|
id: string;
|
|
5
4
|
variantId: string;
|
|
@@ -48,7 +47,7 @@ export interface ICartStore {
|
|
|
48
47
|
fulfillments: Record<string, ICartFulfillmentStore>;
|
|
49
48
|
retailers: Record<string, ICartRetailerStore>;
|
|
50
49
|
promoCode: ICartPromoCode | null;
|
|
51
|
-
events:
|
|
50
|
+
events: ICartEvent[];
|
|
52
51
|
loading: boolean;
|
|
53
52
|
error: string | null;
|
|
54
53
|
rerender: boolean;
|