@liquidcommerce/elements-sdk 2.6.0-beta.6 → 2.6.0-beta.61
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 +83 -2519
- package/dist/index.checkout.esm.js +16576 -0
- package/dist/index.esm.js +23632 -21083
- 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 +46 -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 +21 -20
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +40 -13
- package/dist/types/core/api/http-client.service.d.ts +0 -1
- package/dist/types/core/base-component.service.d.ts +2 -1
- 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 +56 -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 -70
- package/dist/types/core/client/client-config.service.d.ts +8 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +4 -1
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -50
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +9 -4
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -75
- 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 +16 -56
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +17 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +14 -3
- 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 +95 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +238 -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 +9 -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 +41 -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 +47 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +2 -1
- package/dist/types/interfaces/injection.interface.d.ts +47 -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 -5
- package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +23 -9
- 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-items.component.d.ts +4 -3
- 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-image-carousel.component.d.ts +3 -0
- 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 +2 -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 +9 -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 +9 -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 +2 -1
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +27 -30
- 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 +47 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-search.component.d.ts → product-list-search.component.d.ts} +11 -4
- 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 +23 -8
- package/dist/types/modules/product-list/product-list.component.d.ts +10 -45
- 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 +5 -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/purchase-min-alert/index.d.ts +0 -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/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +10 -0
- package/docs/v1/README.md +210 -0
- package/docs/v1/api/actions/address-actions.md +281 -0
- package/docs/v1/api/actions/cart-actions.md +337 -0
- package/docs/v1/api/actions/checkout-actions.md +387 -0
- package/docs/v1/api/actions/product-actions.md +115 -0
- package/docs/v1/api/client.md +482 -0
- package/docs/v1/api/configuration.md +1 -0
- package/docs/v1/api/injection-methods.md +247 -0
- package/docs/v1/api/typescript-types.md +1 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +96 -0
- package/docs/v1/examples/checkout-flow.md +91 -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 +507 -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 +431 -0
- package/docs/v1/guides/best-practices.md +324 -0
- package/docs/v1/guides/cart-component.md +737 -0
- package/docs/v1/guides/checkout-component.md +672 -0
- package/docs/v1/guides/events.md +926 -0
- package/docs/v1/guides/product-component.md +686 -0
- package/docs/v1/guides/product-list-component.md +598 -0
- package/docs/v1/guides/theming.md +216 -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 +89 -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 +44 -0
- package/docs/v1/reference/error-handling.md +70 -0
- package/docs/v1/reference/performance.md +54 -0
- package/docs/v1/reference/troubleshooting.md +72 -0
- package/package.json +28 -17
- 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/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -42
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -211
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -5
- 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/cart/cart.commands.helper.d.ts +0 -9
- 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-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/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
- package/dist/types/utils/helper.d.ts +0 -27
- 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
|
@@ -1,81 +1,23 @@
|
|
|
1
1
|
import type { FulfillmentType } from '@/enums';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
price: number;
|
|
5
|
-
partNumber: string;
|
|
6
|
-
stock: number;
|
|
7
|
-
isEngravable: boolean;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
fulfillmentType: FulfillmentType;
|
|
10
|
-
retailerId: string;
|
|
2
|
+
import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
3
|
+
export type IProductFulfillmentEventData = IFulfillment & {
|
|
11
4
|
retailerName: string;
|
|
12
|
-
retailerAddress:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
location: string;
|
|
22
|
-
};
|
|
23
|
-
presale?: {
|
|
24
|
-
canPurchaseOn: null | string;
|
|
25
|
-
estimatedShipBy: null | string;
|
|
26
|
-
isActive: boolean;
|
|
27
|
-
language: string;
|
|
28
|
-
presaleLimit: number;
|
|
29
|
-
price: number;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export interface IBaseProductSizeEventData {
|
|
33
|
-
id: string;
|
|
34
|
-
upc: string;
|
|
35
|
-
size: string;
|
|
36
|
-
pack: boolean;
|
|
37
|
-
packDesc: string;
|
|
38
|
-
container: string;
|
|
39
|
-
containerType: string;
|
|
40
|
-
maxQuantityPerOrder: number;
|
|
41
|
-
image: string;
|
|
42
|
-
uom: string;
|
|
43
|
-
volume: string;
|
|
44
|
-
attributes: IBaseProductSizeAttributesEventData;
|
|
45
|
-
shippingFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
46
|
-
onDemandFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
47
|
-
}
|
|
48
|
-
export interface IBaseProductEventData {
|
|
5
|
+
retailerAddress: IRetailerAddress;
|
|
6
|
+
retailerAddressFormatted: string;
|
|
7
|
+
variant: IProductVariant;
|
|
8
|
+
};
|
|
9
|
+
export interface IProductSizeEventData extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
10
|
+
onDemandFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
11
|
+
shippingFulfillments: Record<string, IProductFulfillmentEventData>;
|
|
12
|
+
}
|
|
13
|
+
export interface IBaseProductEventData extends Omit<IProduct, 'sizes'> {
|
|
49
14
|
identifier: string;
|
|
50
15
|
selectedSizeId: string | null;
|
|
51
|
-
selectedFulfillmentId: string | null;
|
|
52
16
|
selectedFulfillmentType: FulfillmentType;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
category: string;
|
|
58
|
-
classification: string;
|
|
59
|
-
type: string;
|
|
60
|
-
salsifyGrouping: string;
|
|
61
|
-
subType: string;
|
|
62
|
-
images: string[];
|
|
63
|
-
region: string;
|
|
64
|
-
country: string;
|
|
65
|
-
material: string;
|
|
66
|
-
abv: string;
|
|
67
|
-
proof: string;
|
|
68
|
-
age: string;
|
|
69
|
-
color: string;
|
|
70
|
-
flavor: string;
|
|
71
|
-
variety: string;
|
|
72
|
-
appellation: string;
|
|
73
|
-
vintage: string;
|
|
74
|
-
description: string;
|
|
75
|
-
htmlDescription: string;
|
|
76
|
-
tastingNotes: string;
|
|
77
|
-
noAvailabilityPrice: number;
|
|
78
|
-
sizes: Record<string, IBaseProductSizeEventData>;
|
|
17
|
+
selectedFulfillmentId: string | null;
|
|
18
|
+
productHasAvailability: boolean;
|
|
19
|
+
fulfillmentHasAvailability: boolean;
|
|
20
|
+
sizes: Record<string, IProductSizeEventData>;
|
|
79
21
|
}
|
|
80
22
|
export interface IProductLoadedEventData extends IBaseProductEventData {
|
|
81
23
|
}
|
|
@@ -86,7 +28,6 @@ export interface IProductQuantityChangedEventData {
|
|
|
86
28
|
}
|
|
87
29
|
export interface IProductAddToCartEventData {
|
|
88
30
|
identifier: string;
|
|
89
|
-
upc: string;
|
|
90
31
|
fulfillmentId: string;
|
|
91
32
|
partNumber: string;
|
|
92
33
|
quantity: number;
|
|
@@ -95,7 +36,7 @@ export interface IProductAddToCartEventData {
|
|
|
95
36
|
export interface IProductSizeChangedEventData {
|
|
96
37
|
identifier: string;
|
|
97
38
|
selectedSizeId: string;
|
|
98
|
-
|
|
39
|
+
selectedSize: string;
|
|
99
40
|
previousSizeId: string;
|
|
100
41
|
previousSize: string;
|
|
101
42
|
}
|
|
@@ -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,7 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { FulfillmentType } from '@/enums';
|
|
3
|
-
import type { IAddressAddress } from '@/interfaces/api/address.interface';
|
|
4
|
-
import type { ICartItemAttributes, IRetailerExpectation, IRetailerFees } from '@/interfaces/cloud';
|
|
1
|
+
import type { ICartEvent, ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
5
2
|
export interface ICartItemStore {
|
|
6
3
|
id: string;
|
|
7
4
|
variantId: string;
|
|
@@ -32,64 +29,27 @@ export interface ICartItemStore {
|
|
|
32
29
|
updating: boolean;
|
|
33
30
|
error: string | null;
|
|
34
31
|
}
|
|
35
|
-
export interface
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
platformFee: number;
|
|
40
|
-
giftCardTotal: number;
|
|
41
|
-
engravingFee: number;
|
|
42
|
-
deliveryFee: number;
|
|
43
|
-
discounts: number;
|
|
44
|
-
quantity: number;
|
|
32
|
+
export interface ICartFulfillmentStore extends ICartFulfillment {
|
|
33
|
+
loading: boolean;
|
|
34
|
+
error: string | null;
|
|
35
|
+
updating: boolean;
|
|
45
36
|
}
|
|
46
|
-
export interface
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
fees: IRetailerFees;
|
|
51
|
-
expectation: IRetailerExpectation;
|
|
52
|
-
shippingFee: number;
|
|
53
|
-
subtotal: number;
|
|
54
|
-
items: string[];
|
|
55
|
-
engravingFee: number;
|
|
56
|
-
deliveryFee: number;
|
|
57
|
-
retailerId: string;
|
|
58
|
-
loading?: boolean;
|
|
59
|
-
error?: string | null;
|
|
60
|
-
updating?: boolean;
|
|
37
|
+
export interface ICartRetailerStore extends ICartRetailer {
|
|
38
|
+
loading: boolean;
|
|
39
|
+
error: string | null;
|
|
40
|
+
updating: boolean;
|
|
61
41
|
}
|
|
62
|
-
export interface
|
|
42
|
+
export interface ICartStore {
|
|
63
43
|
id: string;
|
|
64
|
-
name: string;
|
|
65
|
-
platformFee: number;
|
|
66
|
-
shippingFee: number;
|
|
67
44
|
subtotal: number;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
error?: string | null;
|
|
75
|
-
updating?: boolean;
|
|
76
|
-
}
|
|
77
|
-
export interface ICartPromoCodeStore {
|
|
78
|
-
code: string;
|
|
79
|
-
discountAmount: number;
|
|
80
|
-
}
|
|
81
|
-
export interface ICartStore {
|
|
82
|
-
id: string | null;
|
|
45
|
+
itemsQuantity: number;
|
|
46
|
+
items: Record<string, ICartItemStore>;
|
|
47
|
+
fulfillments: Record<string, ICartFulfillmentStore>;
|
|
48
|
+
retailers: Record<string, ICartRetailerStore>;
|
|
49
|
+
promoCode: ICartPromoCode | null;
|
|
50
|
+
events: ICartEvent[];
|
|
83
51
|
loading: boolean;
|
|
84
52
|
error: string | null;
|
|
85
|
-
items: Record<string, ICartItemStore>;
|
|
86
|
-
totals: ICartTotalsStore;
|
|
87
|
-
retailers: Record<string, IRetailerStore>;
|
|
88
|
-
promoCode: ICartPromoCodeStore | null;
|
|
89
|
-
fulfillments: Record<string, IRetailerFulfillmentStore>;
|
|
90
53
|
rerender: boolean;
|
|
91
54
|
shouldReset: boolean;
|
|
92
|
-
updatedAt: string;
|
|
93
|
-
createdAt: string;
|
|
94
|
-
events: IElementsCartEvent[];
|
|
95
55
|
}
|
|
@@ -1,121 +1,29 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export interface ICheckoutMarketingPreferencesStore {
|
|
4
|
-
canEmail: boolean;
|
|
5
|
-
canSms: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface ICheckoutPromoCodeStore {
|
|
8
|
-
code: string;
|
|
9
|
-
discountAmount: number;
|
|
10
|
-
}
|
|
11
|
-
export interface ICheckoutGiftCardStore {
|
|
12
|
-
code: string;
|
|
13
|
-
discountAmount: number;
|
|
14
|
-
}
|
|
15
|
-
export interface ICheckoutItemStore {
|
|
16
|
-
liquidId: string;
|
|
17
|
-
variantId: string;
|
|
18
|
-
cartItemId: string;
|
|
19
|
-
retailerId: string;
|
|
20
|
-
fulfillmentId: string;
|
|
21
|
-
salsifyGrouping: string;
|
|
22
|
-
name: string;
|
|
23
|
-
catPath: string;
|
|
24
|
-
volume: string;
|
|
25
|
-
uom: string;
|
|
26
|
-
proof: string;
|
|
27
|
-
abv: string;
|
|
28
|
-
containerType: string;
|
|
29
|
-
container: string;
|
|
30
|
-
size: string;
|
|
31
|
-
pack: boolean;
|
|
32
|
-
packDesc: string;
|
|
33
|
-
mainImage: string;
|
|
34
|
-
brand: string;
|
|
35
|
-
partNumber: string;
|
|
36
|
-
upc: string;
|
|
37
|
-
sku: string;
|
|
38
|
-
price: number;
|
|
39
|
-
unitPrice: number;
|
|
40
|
-
quantity: number;
|
|
41
|
-
unitTax: number;
|
|
42
|
-
bottleDeposits: number;
|
|
43
|
-
attributes: ICartItemAttributes;
|
|
44
|
-
retailerName: string;
|
|
45
|
-
expectationDetail: string;
|
|
1
|
+
import type { ICheckoutAmounts, ICheckoutBilling, ICheckoutCustomer, ICheckoutEvent, ICheckoutFulfillment, ICheckoutGiftCard, ICheckoutGiftRecipient, ICheckoutItem, ICheckoutMarketingPreferences, ICheckoutPaymentConfirm, ICheckoutPaymentSession, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer, ICheckoutShippingAddress } from '@/interfaces/api/checkout.interface';
|
|
2
|
+
export interface ICheckoutItemStore extends ICheckoutItem {
|
|
46
3
|
loading: boolean;
|
|
47
4
|
updating: boolean;
|
|
48
5
|
error: string | null;
|
|
49
6
|
}
|
|
50
|
-
export interface IOnDemandFulfillmentTipInfo {
|
|
51
|
-
fulfillmentId: string;
|
|
52
|
-
retailerId: string;
|
|
53
|
-
retailerName: string;
|
|
54
|
-
subtotal: number;
|
|
55
|
-
tip: number;
|
|
56
|
-
}
|
|
57
|
-
export interface ICheckoutPresaleStore {
|
|
58
|
-
isLocked: boolean;
|
|
59
|
-
expiresAt: string | null;
|
|
60
|
-
}
|
|
61
|
-
export interface ICheckoutCustomerStore {
|
|
62
|
-
id?: string;
|
|
63
|
-
firstName: string;
|
|
64
|
-
lastName: string;
|
|
65
|
-
email: string;
|
|
66
|
-
phone: string;
|
|
67
|
-
birthDate: string;
|
|
68
|
-
company: string;
|
|
69
|
-
}
|
|
70
7
|
export interface ICheckoutCustomerFormStore {
|
|
71
|
-
data:
|
|
8
|
+
data: ICheckoutCustomer;
|
|
72
9
|
isEditing: boolean;
|
|
73
10
|
isValid: boolean;
|
|
74
11
|
isSaving: boolean;
|
|
75
12
|
}
|
|
76
|
-
export interface ICheckoutGiftRecipientStore {
|
|
77
|
-
firstName: string;
|
|
78
|
-
lastName: string;
|
|
79
|
-
email: string;
|
|
80
|
-
phone: string;
|
|
81
|
-
message: string;
|
|
82
|
-
}
|
|
83
13
|
export interface ICheckoutGiftRecipientFormStore {
|
|
84
|
-
data:
|
|
14
|
+
data: ICheckoutGiftRecipient;
|
|
85
15
|
isEditing: boolean;
|
|
86
16
|
isValid: boolean;
|
|
87
17
|
isSaving: boolean;
|
|
88
18
|
}
|
|
89
|
-
export interface
|
|
90
|
-
firstName: string;
|
|
91
|
-
lastName: string;
|
|
92
|
-
email: string;
|
|
93
|
-
phone: string;
|
|
94
|
-
company: string;
|
|
95
|
-
addressOne: string;
|
|
96
|
-
addressTwo: string;
|
|
97
|
-
city: string;
|
|
98
|
-
state: string;
|
|
99
|
-
zipCode: string;
|
|
100
|
-
}
|
|
101
|
-
export interface ICheckoutPaymentCardStore {
|
|
102
|
-
brand: string;
|
|
103
|
-
last4: string;
|
|
104
|
-
expMonth: string;
|
|
105
|
-
expYear: string;
|
|
106
|
-
}
|
|
107
|
-
export interface ICheckoutPaymentMethodStore {
|
|
108
|
-
id: string;
|
|
109
|
-
card: ICheckoutPaymentCardStore;
|
|
19
|
+
export interface ICheckoutPaymentMethodStore extends ICheckoutPaymentConfirm {
|
|
110
20
|
}
|
|
111
|
-
export interface ICheckoutPaymentSessionStore {
|
|
112
|
-
key: string;
|
|
113
|
-
secret: string;
|
|
21
|
+
export interface ICheckoutPaymentSessionStore extends ICheckoutPaymentSession {
|
|
114
22
|
}
|
|
115
23
|
export interface ICheckoutPaymentFormStore {
|
|
116
24
|
paymentSession: ICheckoutPaymentSessionStore | null;
|
|
117
25
|
paymentMethod: ICheckoutPaymentMethodStore | null;
|
|
118
|
-
data:
|
|
26
|
+
data: ICheckoutBilling | null;
|
|
119
27
|
billingSameAsShipping: boolean;
|
|
120
28
|
isEditing: boolean;
|
|
121
29
|
isValid: boolean;
|
|
@@ -124,19 +32,21 @@ export interface ICheckoutPaymentFormStore {
|
|
|
124
32
|
export interface ICheckoutStore {
|
|
125
33
|
token: string;
|
|
126
34
|
cartId: string;
|
|
127
|
-
presale:
|
|
35
|
+
presale: ICheckoutPresale | null;
|
|
128
36
|
isGift: boolean;
|
|
129
|
-
marketingPreferences:
|
|
37
|
+
marketingPreferences: ICheckoutMarketingPreferences;
|
|
130
38
|
customerForm: ICheckoutCustomerFormStore;
|
|
131
39
|
giftRecipientForm: ICheckoutGiftRecipientFormStore;
|
|
132
40
|
paymentForm: ICheckoutPaymentFormStore;
|
|
133
|
-
|
|
134
|
-
promoCode:
|
|
135
|
-
giftCards:
|
|
41
|
+
shippingAddress: ICheckoutShippingAddress;
|
|
42
|
+
promoCode: ICheckoutPromoCode | null;
|
|
43
|
+
giftCards: ICheckoutGiftCard[];
|
|
44
|
+
itemsQuantity: number;
|
|
136
45
|
items: Record<string, ICheckoutItemStore>;
|
|
137
|
-
|
|
46
|
+
fulfillments: Record<string, ICheckoutFulfillment>;
|
|
47
|
+
retailers: Record<string, ICheckoutRetailer>;
|
|
48
|
+
amounts: ICheckoutAmounts;
|
|
138
49
|
orderNumber: string | null;
|
|
139
|
-
onDemandFulfillmentTipInfo: Record<string, IOnDemandFulfillmentTipInfo>;
|
|
140
50
|
tipSelection: number;
|
|
141
51
|
deliveryInstructions: string;
|
|
142
52
|
giftCardError: string | null;
|
|
@@ -145,6 +55,5 @@ export interface ICheckoutStore {
|
|
|
145
55
|
loading: boolean;
|
|
146
56
|
updating: boolean;
|
|
147
57
|
error: string | null;
|
|
148
|
-
|
|
149
|
-
events: IElementsCheckoutEvents[];
|
|
58
|
+
events: ICheckoutEvent[];
|
|
150
59
|
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
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';
|
|
3
5
|
import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
|
+
import type { IPLProductStore, IProductListStore } from '@/core/store/interfaces/product-list.interface';
|
|
4
7
|
import type { ComponentType } from '@/enums';
|
|
5
|
-
import type {
|
|
8
|
+
import type { ICartPromoCode } from '@/interfaces/api/cart.interface';
|
|
9
|
+
import type { ICheckoutGiftRecipient, ICheckoutMarketingPreferences, ICheckoutPresale, ICheckoutPromoCode, ICheckoutRetailer } from '@/interfaces/api/checkout.interface';
|
|
6
10
|
export interface IDrawerContentConfig {
|
|
7
11
|
type: ComponentType;
|
|
8
12
|
data?: Record<string, any>;
|
|
9
13
|
}
|
|
14
|
+
export type UIDrawerMode = 'drawer' | 'modal';
|
|
10
15
|
export interface IDrawerStore {
|
|
11
16
|
isOpen: boolean;
|
|
12
17
|
contentConfig: IDrawerContentConfig | null;
|
|
18
|
+
mode: UIDrawerMode;
|
|
13
19
|
}
|
|
14
20
|
export interface IUIStore {
|
|
15
21
|
drawer: IDrawerStore;
|
|
@@ -19,13 +25,18 @@ export interface IGlobalStore {
|
|
|
19
25
|
products: Record<string, IProductStore>;
|
|
20
26
|
cart: ICartStore;
|
|
21
27
|
checkout: ICheckoutStore;
|
|
28
|
+
productsList: Record<string, IProductListStore>;
|
|
22
29
|
ui: IUIStore;
|
|
30
|
+
metadata: IElementsMetadataStore;
|
|
23
31
|
}
|
|
24
32
|
export interface IPersistedStore {
|
|
25
33
|
p?: string;
|
|
26
34
|
c?: string;
|
|
27
35
|
}
|
|
28
|
-
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.${string}` | `productsList.${string}.${keyof IProductListStore}` | `productsList.${string}.products.${string}` | `productsList.${string}.products.${string}.${keyof IPLProductStore}` | `metadata.${keyof IElementsMetadataStore}` | `metadata.checkout.${keyof ICheckoutMetadata}` | `metadata.checkout.injection.${keyof ICheckoutInjection}`;
|
|
29
40
|
interface MiddlewareContext {
|
|
30
41
|
action: string;
|
|
31
42
|
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,30 @@
|
|
|
1
|
+
import type { FulfillmentType } from '@/enums';
|
|
2
|
+
import type { IProduct } from '@/interfaces/api/product.interface';
|
|
3
|
+
import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
|
|
4
|
+
import type { IPagination } from '@/modules/product-list/product-list.interface';
|
|
5
|
+
import type { IProductFulfillmentStore, IProductSizeStore } from './product.interface';
|
|
6
|
+
export interface IPLProductStore extends Omit<IProduct, 'sizes'> {
|
|
7
|
+
id: string;
|
|
8
|
+
sizes: Record<string, IProductSizeStore>;
|
|
9
|
+
quantity: number;
|
|
10
|
+
selectedSizeId: string | null;
|
|
11
|
+
selectedFulfillmentType: FulfillmentType;
|
|
12
|
+
selectedFulfillmentId: string | null;
|
|
13
|
+
selectedFulfillment: IProductFulfillmentStore | null;
|
|
14
|
+
engravingLines: string[];
|
|
15
|
+
productHasAvailability: boolean;
|
|
16
|
+
fulfillmentHasAvailability: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
updating: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface IProductListStore {
|
|
21
|
+
products: Record<string, IPLProductStore>;
|
|
22
|
+
appliedFilters: Record<string, string[]>;
|
|
23
|
+
filters: IFilterSchema[];
|
|
24
|
+
pagination: IPagination;
|
|
25
|
+
searchTerm: string;
|
|
26
|
+
rows: number;
|
|
27
|
+
columns: number;
|
|
28
|
+
loading: boolean;
|
|
29
|
+
rerender: boolean;
|
|
30
|
+
}
|
|
@@ -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,16 @@ 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: Record<string, IProductListStore>;
|
|
16
|
+
export declare function createInitialProductListState(): IProductListStore;
|
|
12
17
|
export declare const initialStoreState: IGlobalStore;
|
|
@@ -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;
|
|
@@ -32,6 +32,7 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
32
32
|
readonly CART_PROMO_CODE_FAILED: "cart_promo_code_failed";
|
|
33
33
|
readonly CART_PRODUCT_ADD_SUCCESS: "cart_product_add_success";
|
|
34
34
|
readonly CART_PRODUCT_ADD_FAILED: "cart_product_add_failed";
|
|
35
|
+
readonly INTERNAL_CART_TO_CHECKOUT: "internal_cart_to_checkout";
|
|
35
36
|
readonly CHECKOUT_LOADED: "checkout_loaded";
|
|
36
37
|
readonly CHECKOUT_OPENED: "checkout_opened";
|
|
37
38
|
readonly CHECKOUT_CLOSED: "checkout_closed";
|
|
@@ -67,7 +68,6 @@ export declare const ELEMENTS_FORM: {
|
|
|
67
68
|
export declare const COMPONENT_TYPE: {
|
|
68
69
|
readonly DRAWER: "drawer";
|
|
69
70
|
readonly INPUT: "input";
|
|
70
|
-
readonly BIRTHDATE_INPUT: "birthdate-input";
|
|
71
71
|
readonly ENGRAVING_FORM: "engraving-form";
|
|
72
72
|
readonly ENGRAVING_VIEW: "engraving-view";
|
|
73
73
|
readonly BUTTONS_CART_OPEN: "buttons-cart-open";
|
|
@@ -97,6 +97,10 @@ export declare const COMPONENT_TYPE: {
|
|
|
97
97
|
readonly PRODUCT_LIST_FILTERS: "product-list-filters";
|
|
98
98
|
readonly PRODUCT_LIST_SEARCH: "product-list-search";
|
|
99
99
|
readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
|
|
100
|
+
readonly PRODUCT_LIST_ENGRAVING_FORM: "product-list-engraving-form";
|
|
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";
|
|
100
104
|
readonly CART: "cart";
|
|
101
105
|
readonly CART_RETAILER: "cart-retailer";
|
|
102
106
|
readonly CART_ITEM: "cart-item";
|
|
@@ -146,3 +150,37 @@ export declare const DEBUG_MODE: {
|
|
|
146
150
|
readonly PANEL: "panel";
|
|
147
151
|
};
|
|
148
152
|
export type DebugMode = (typeof DEBUG_MODE)[keyof typeof DEBUG_MODE];
|
|
153
|
+
export declare const CART_EVENT_TYPE: {
|
|
154
|
+
readonly GENERIC: "generic";
|
|
155
|
+
readonly PROMO_CODE: "promo-code";
|
|
156
|
+
};
|
|
157
|
+
export type CartEventType = (typeof CART_EVENT_TYPE)[keyof typeof CART_EVENT_TYPE];
|
|
158
|
+
export declare const CART_EVENT_LEVEL: {
|
|
159
|
+
readonly SUCCESS: "success";
|
|
160
|
+
readonly WARNING: "warning";
|
|
161
|
+
readonly ERROR: "error";
|
|
162
|
+
};
|
|
163
|
+
export type CartEventLevel = (typeof CART_EVENT_LEVEL)[keyof typeof CART_EVENT_LEVEL];
|
|
164
|
+
export declare const CHECKOUT_EVENT_TYPE: {
|
|
165
|
+
readonly GENERIC: "generic";
|
|
166
|
+
readonly PROMO_CODE: "promo-code";
|
|
167
|
+
readonly GIFT_CARD: "gift-card";
|
|
168
|
+
};
|
|
169
|
+
export type CheckoutEventType = (typeof CHECKOUT_EVENT_TYPE)[keyof typeof CHECKOUT_EVENT_TYPE];
|
|
170
|
+
export declare const CHECKOUT_EVENT_LEVEL: {
|
|
171
|
+
readonly SUCCESS: "success";
|
|
172
|
+
readonly WARNING: "warning";
|
|
173
|
+
readonly ERROR: "error";
|
|
174
|
+
};
|
|
175
|
+
export type CheckoutEventLevel = (typeof CHECKOUT_EVENT_LEVEL)[keyof typeof CHECKOUT_EVENT_LEVEL];
|
|
176
|
+
export declare const DISPLAY_MODE: {
|
|
177
|
+
readonly MODAL: "modal";
|
|
178
|
+
readonly DRAWER: "drawer";
|
|
179
|
+
};
|
|
180
|
+
export type DisplayModeType = (typeof DISPLAY_MODE)[keyof typeof DISPLAY_MODE];
|
|
181
|
+
export declare const NAVIGATION_SOURCE: {
|
|
182
|
+
readonly PRODUCT: "product";
|
|
183
|
+
readonly PRODUCT_LIST_CARD: "product-list-card";
|
|
184
|
+
readonly PRE_CART: "pre-cart";
|
|
185
|
+
};
|
|
186
|
+
export type NavigationSourceType = (typeof NAVIGATION_SOURCE)[keyof typeof NAVIGATION_SOURCE];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ElementsCheckout } from '@/clients/checkout';
|
|
2
|
+
import type { DebugMode, ElementsEnv } from '@/enums';
|
|
3
|
+
import { DEBUG_MODE, ELEMENTS_ENV } from '@/enums';
|
|
4
|
+
import type { IElementsCheckoutActions, IElementsCheckoutClient } from '@/interfaces/client.interface';
|
|
5
|
+
import type { IInjectedComponent } from '@/interfaces/component.interface';
|
|
6
|
+
import type { ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/config.interface';
|
|
7
|
+
export { DEBUG_MODE, ELEMENTS_ENV, ElementsCheckout };
|
|
8
|
+
export type { DebugMode, ElementsEnv, IElementsCheckoutActions, IElementsCheckoutClient, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig, };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
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
|
+
export type { LiquidCommerceGlobal } from './global';
|
|
6
|
+
export * from './interfaces/api';
|
|
7
|
+
export * from './interfaces/client.interface';
|
|
8
|
+
export * from './interfaces/component.interface';
|
|
9
|
+
export * from './interfaces/config.interface';
|
|
5
10
|
export * from './interfaces/configs';
|
|
6
|
-
export * from './interfaces/
|
|
11
|
+
export * from './interfaces/injection.interface';
|