@liquidcommerce/elements-sdk 2.5.11 → 2.6.0-beta.10
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 +1 -0
- package/dist/index.esm.js +10852 -10205
- package/dist/types/constants/core.constant.d.ts +11 -0
- package/dist/types/core/{api-client.service.d.ts → api/api-client.service.d.ts} +13 -13
- package/dist/types/core/{auth.service.d.ts → api/auth-client.service.d.ts} +5 -16
- package/dist/types/core/api/http-client.service.d.ts +45 -0
- package/dist/types/core/client/client-action.service.d.ts +18 -11
- package/dist/types/core/client/client-config.service.d.ts +3 -0
- package/dist/types/core/command/base-command.service.d.ts +3 -3
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
- package/dist/types/core/google-tag-manager.service.d.ts +12 -10
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +26 -63
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +11 -1
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -54
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +4 -2
- package/dist/types/core/store/interfaces/core.interface.d.ts +5 -4
- package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/elements-base-client.d.ts +4 -4
- package/dist/types/enums/cloud.enum.d.ts +20 -0
- package/dist/types/enums/core.enum.d.ts +1 -0
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +91 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
- package/dist/types/interfaces/api/product.interface.d.ts +106 -0
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +14 -10
- package/dist/types/interfaces/cloud/index.d.ts +0 -4
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +2 -2
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/global.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/interfaces/core.interface.d.ts +1 -0
- package/dist/types/modules/address/address.command.d.ts +2 -3
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/cart/cart.commands.d.ts +0 -1
- 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/product/components/components.d.ts +2 -4
- package/dist/types/modules/product/product.commands.d.ts +2 -2
- package/dist/types/modules/product-list/components/index.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
- package/dist/types/modules/product-list/product-list.commands.d.ts +3 -2
- package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
- package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
- package/dist/types/static/icon/filter.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/helper.d.ts +2 -1
- package/docs/THEMING.md +3 -0
- package/package.json +5 -6
- package/umd/elements.js +1 -1
- package/dist/types/core/utils.d.ts +0 -23
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
|
@@ -1,87 +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
|
-
modalities: FulfillmentType[];
|
|
11
|
-
retailerId: string;
|
|
2
|
+
import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
3
|
+
export type IProductFulfillmentEventData = IFulfillment & {
|
|
12
4
|
retailerName: string;
|
|
13
|
-
retailerAddress:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
location: string;
|
|
23
|
-
};
|
|
24
|
-
presale?: {
|
|
25
|
-
canPurchaseOn: null | string;
|
|
26
|
-
estimatedShipBy: null | string;
|
|
27
|
-
isActive: boolean;
|
|
28
|
-
language: string;
|
|
29
|
-
presaleLimit: number;
|
|
30
|
-
price: number;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface IBaseProductSizeEventData {
|
|
34
|
-
id: string;
|
|
35
|
-
upc: string;
|
|
36
|
-
size: string;
|
|
37
|
-
pack: boolean;
|
|
38
|
-
packDesc: string;
|
|
39
|
-
container: string;
|
|
40
|
-
containerType: string;
|
|
41
|
-
maxQuantityPerOrder: number;
|
|
42
|
-
image: string;
|
|
43
|
-
uom: string;
|
|
44
|
-
volume: string;
|
|
45
|
-
attributes: IBaseProductSizeAttributesEventData;
|
|
46
|
-
shippingFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
47
|
-
onDemandFulfillments: Record<string, IBaseProductFulfillmentEventData>;
|
|
48
|
-
}
|
|
49
|
-
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'> {
|
|
50
14
|
identifier: string;
|
|
51
15
|
selectedSizeId: string | null;
|
|
52
|
-
selectedFulfillmentId: string | null;
|
|
53
16
|
selectedFulfillmentType: FulfillmentType;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
category: string;
|
|
59
|
-
classification: string;
|
|
60
|
-
type: string;
|
|
61
|
-
salsifyGrouping: string;
|
|
62
|
-
subType: string;
|
|
63
|
-
mainImage: string | null;
|
|
64
|
-
images: string[];
|
|
65
|
-
region: string;
|
|
66
|
-
country: string;
|
|
67
|
-
material: string;
|
|
68
|
-
abv: string;
|
|
69
|
-
proof: string;
|
|
70
|
-
age: string;
|
|
71
|
-
color: string;
|
|
72
|
-
flavor: string;
|
|
73
|
-
variety: string;
|
|
74
|
-
appellation: string;
|
|
75
|
-
vintage: string;
|
|
76
|
-
description: string;
|
|
77
|
-
htmlDescription: string;
|
|
78
|
-
tastingNotes: string;
|
|
79
|
-
priceInfo: {
|
|
80
|
-
min: number;
|
|
81
|
-
max: number;
|
|
82
|
-
avg: number;
|
|
83
|
-
} | null;
|
|
84
|
-
sizes: Record<string, IBaseProductSizeEventData>;
|
|
17
|
+
selectedFulfillmentId: string | null;
|
|
18
|
+
productHasAvailability: boolean;
|
|
19
|
+
fulfillmentHasAvailability: boolean;
|
|
20
|
+
sizes: Record<string, IProductSizeEventData>;
|
|
85
21
|
}
|
|
86
22
|
export interface IProductLoadedEventData extends IBaseProductEventData {
|
|
87
23
|
}
|
|
@@ -92,7 +28,6 @@ export interface IProductQuantityChangedEventData {
|
|
|
92
28
|
}
|
|
93
29
|
export interface IProductAddToCartEventData {
|
|
94
30
|
identifier: string;
|
|
95
|
-
upc: string;
|
|
96
31
|
fulfillmentId: string;
|
|
97
32
|
partNumber: string;
|
|
98
33
|
quantity: number;
|
|
@@ -101,7 +36,7 @@ export interface IProductAddToCartEventData {
|
|
|
101
36
|
export interface IProductSizeChangedEventData {
|
|
102
37
|
identifier: string;
|
|
103
38
|
selectedSizeId: string;
|
|
104
|
-
|
|
39
|
+
selectedSize: string;
|
|
105
40
|
previousSizeId: string;
|
|
106
41
|
previousSize: string;
|
|
107
42
|
}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
1
2
|
export interface IAddressStore {
|
|
2
3
|
id: string;
|
|
3
4
|
formattedAddress: string;
|
|
4
|
-
address:
|
|
5
|
-
|
|
6
|
-
two: string;
|
|
7
|
-
city: string;
|
|
8
|
-
state: string;
|
|
9
|
-
zip: string;
|
|
10
|
-
country: string;
|
|
11
|
-
};
|
|
12
|
-
coordinates: {
|
|
13
|
-
lat: number;
|
|
14
|
-
long: number;
|
|
15
|
-
};
|
|
5
|
+
address: IAddressAddress;
|
|
6
|
+
coordinates: IAddressCoordinates;
|
|
16
7
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IElementsCartEvent } from 'utils/helper';
|
|
2
|
-
import type {
|
|
3
|
-
import type { IAddress, ICartItemAttributes, IRetailerExpectation, IRetailerFees } from '@/interfaces/cloud';
|
|
2
|
+
import type { ICartFulfillment, ICartItemAttributes, ICartPromoCode, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
4
3
|
export interface ICartItemStore {
|
|
5
4
|
id: string;
|
|
6
5
|
variantId: string;
|
|
@@ -31,64 +30,27 @@ export interface ICartItemStore {
|
|
|
31
30
|
updating: boolean;
|
|
32
31
|
error: string | null;
|
|
33
32
|
}
|
|
34
|
-
export interface
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
platformFee: number;
|
|
39
|
-
giftCardTotal: number;
|
|
40
|
-
engravingFee: number;
|
|
41
|
-
deliveryFee: number;
|
|
42
|
-
discounts: number;
|
|
43
|
-
quantity: number;
|
|
33
|
+
export interface ICartFulfillmentStore extends ICartFulfillment {
|
|
34
|
+
loading: boolean;
|
|
35
|
+
error: string | null;
|
|
36
|
+
updating: boolean;
|
|
44
37
|
}
|
|
45
|
-
export interface
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
fees: IRetailerFees;
|
|
50
|
-
expectation: IRetailerExpectation;
|
|
51
|
-
shippingFee: number;
|
|
52
|
-
subtotal: number;
|
|
53
|
-
items: string[];
|
|
54
|
-
engravingFee: number;
|
|
55
|
-
deliveryFee: number;
|
|
56
|
-
retailerId: string;
|
|
57
|
-
loading?: boolean;
|
|
58
|
-
error?: string | null;
|
|
59
|
-
updating?: boolean;
|
|
38
|
+
export interface ICartRetailerStore extends ICartRetailer {
|
|
39
|
+
loading: boolean;
|
|
40
|
+
error: string | null;
|
|
41
|
+
updating: boolean;
|
|
60
42
|
}
|
|
61
|
-
export interface
|
|
43
|
+
export interface ICartStore {
|
|
62
44
|
id: string;
|
|
63
|
-
name: string;
|
|
64
|
-
platformFee: number;
|
|
65
|
-
shippingFee: number;
|
|
66
45
|
subtotal: number;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
error?: string | null;
|
|
74
|
-
updating?: boolean;
|
|
75
|
-
}
|
|
76
|
-
export interface ICartPromoCodeStore {
|
|
77
|
-
code: string;
|
|
78
|
-
discountAmount: number;
|
|
79
|
-
}
|
|
80
|
-
export interface ICartStore {
|
|
81
|
-
id: string | null;
|
|
46
|
+
itemsQuantity: number;
|
|
47
|
+
items: Record<string, ICartItemStore>;
|
|
48
|
+
fulfillments: Record<string, ICartFulfillmentStore>;
|
|
49
|
+
retailers: Record<string, ICartRetailerStore>;
|
|
50
|
+
promoCode: ICartPromoCode | null;
|
|
51
|
+
events: IElementsCartEvent[];
|
|
82
52
|
loading: boolean;
|
|
83
53
|
error: string | null;
|
|
84
|
-
items: Record<string, ICartItemStore>;
|
|
85
|
-
totals: ICartTotalsStore;
|
|
86
|
-
retailers: Record<string, IRetailerStore>;
|
|
87
|
-
promoCode: ICartPromoCodeStore | null;
|
|
88
|
-
fulfillments: Record<string, IRetailerFulfillmentStore>;
|
|
89
54
|
rerender: boolean;
|
|
90
55
|
shouldReset: boolean;
|
|
91
|
-
updatedAt: string;
|
|
92
|
-
createdAt: string;
|
|
93
|
-
events: IElementsCartEvent[];
|
|
94
56
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IElementsCheckoutEvents } from 'utils/helper';
|
|
2
|
-
import type { ICartItemAttributes
|
|
2
|
+
import type { ICartItemAttributes } from '@/interfaces/api/cart.interface';
|
|
3
3
|
export interface ICheckoutMarketingPreferencesStore {
|
|
4
4
|
canEmail: boolean;
|
|
5
5
|
canSms: boolean;
|
|
@@ -101,6 +101,8 @@ export interface ICheckoutBillingStore {
|
|
|
101
101
|
export interface ICheckoutPaymentCardStore {
|
|
102
102
|
brand: string;
|
|
103
103
|
last4: string;
|
|
104
|
+
expMonth: string;
|
|
105
|
+
expYear: string;
|
|
104
106
|
}
|
|
105
107
|
export interface ICheckoutPaymentMethodStore {
|
|
106
108
|
id: string;
|
|
@@ -132,7 +134,7 @@ export interface ICheckoutStore {
|
|
|
132
134
|
promoCode: ICheckoutPromoCodeStore | null;
|
|
133
135
|
giftCards: ICheckoutGiftCardStore[];
|
|
134
136
|
items: Record<string, ICheckoutItemStore>;
|
|
135
|
-
amounts:
|
|
137
|
+
amounts: any;
|
|
136
138
|
orderNumber: string | null;
|
|
137
139
|
onDemandFulfillmentTipInfo: Record<string, IOnDemandFulfillmentTipInfo>;
|
|
138
140
|
tipSelection: number;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
|
+
import type { ICartFulfillmentStore, ICartItemStore, ICartRetailerStore, ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
2
3
|
import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutPresaleStore, ICheckoutPromoCodeStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
3
4
|
import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
|
|
4
5
|
import type { ComponentType } from '@/enums';
|
|
5
|
-
import type {
|
|
6
|
+
import type { ICartPromoCode } from '@/interfaces/api/cart.interface';
|
|
6
7
|
export interface IDrawerContentConfig {
|
|
7
8
|
type: ComponentType;
|
|
8
9
|
data?: Record<string, any>;
|
|
@@ -15,17 +16,17 @@ export interface IUIStore {
|
|
|
15
16
|
drawer: IDrawerStore;
|
|
16
17
|
}
|
|
17
18
|
export interface IGlobalStore {
|
|
18
|
-
cart: ICartStore;
|
|
19
19
|
address: IAddressStore;
|
|
20
|
+
products: Record<string, IProductStore>;
|
|
21
|
+
cart: ICartStore;
|
|
20
22
|
checkout: ICheckoutStore;
|
|
21
23
|
ui: IUIStore;
|
|
22
|
-
products: Record<string, IProductStore>;
|
|
23
24
|
}
|
|
24
25
|
export interface IPersistedStore {
|
|
25
26
|
p?: string;
|
|
26
27
|
c?: string;
|
|
27
28
|
}
|
|
28
|
-
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.
|
|
29
|
+
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 ICheckoutPresaleStore}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferencesStore}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipientStore}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCodeStore}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.onDemandFulfillmentTipInfo.${string}`;
|
|
29
30
|
interface MiddlewareContext {
|
|
30
31
|
action: string;
|
|
31
32
|
payload: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, FulfillmentType } from '@/enums';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IFulfillment, IProduct, IProductSize, IProductVariant, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
3
3
|
export interface IProductDrawerContentConfig {
|
|
4
4
|
type: ComponentType;
|
|
5
5
|
data?: Record<string, any>;
|
|
@@ -8,85 +8,31 @@ export interface IProductDrawerStore {
|
|
|
8
8
|
isOpen: boolean;
|
|
9
9
|
contentConfig: IProductDrawerContentConfig | null;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
isVariantEngravable: boolean;
|
|
13
|
-
stock: number;
|
|
14
|
-
price: number;
|
|
15
|
-
retailerId: string;
|
|
16
|
-
partNumber: string;
|
|
17
|
-
fulfillmentId: string;
|
|
18
|
-
fulfillmentType: FulfillmentType;
|
|
19
|
-
modalities: FulfillmentType[];
|
|
11
|
+
export type IProductFulfillmentStore = IFulfillment & {
|
|
20
12
|
retailerName: string;
|
|
21
|
-
retailerAddress:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fees: IRetailerFees;
|
|
27
|
-
hours: RetailerHours;
|
|
28
|
-
}
|
|
29
|
-
export interface IProductSizeStore {
|
|
30
|
-
id: string;
|
|
31
|
-
upc: string;
|
|
32
|
-
size: string;
|
|
33
|
-
pack: boolean;
|
|
34
|
-
packDesc: string | null;
|
|
35
|
-
container: string;
|
|
36
|
-
containerType: string;
|
|
37
|
-
maxQuantityPerOrder: number;
|
|
38
|
-
image: string;
|
|
39
|
-
uom: string;
|
|
40
|
-
volume: string;
|
|
41
|
-
attributes: IProductSizeAttributes;
|
|
13
|
+
retailerAddress: IRetailerAddress;
|
|
14
|
+
retailerAddressFormatted: string;
|
|
15
|
+
variant: IProductVariant;
|
|
16
|
+
};
|
|
17
|
+
export interface IProductSizeStore extends Omit<IProductSize, 'shippingVariants' | 'onDemandVariants'> {
|
|
42
18
|
onDemandFulfillments: Record<string, IProductFulfillmentStore>;
|
|
43
19
|
shippingFulfillments: Record<string, IProductFulfillmentStore>;
|
|
44
20
|
loading: boolean;
|
|
45
21
|
error: string | null;
|
|
46
22
|
}
|
|
47
|
-
export interface IProductStore {
|
|
23
|
+
export interface IProductStore extends Omit<IProduct, 'sizes'> {
|
|
48
24
|
identifier: string;
|
|
49
|
-
id: string;
|
|
50
|
-
name: string;
|
|
51
|
-
brand: string;
|
|
52
|
-
catPath: string;
|
|
53
|
-
category: string;
|
|
54
|
-
classification: string;
|
|
55
|
-
type: string;
|
|
56
|
-
salsifyGrouping: string;
|
|
57
|
-
subType: string;
|
|
58
|
-
mainImage: string | null;
|
|
59
|
-
images: string[];
|
|
60
|
-
region: string;
|
|
61
|
-
country: string;
|
|
62
|
-
material: string;
|
|
63
|
-
abv: string;
|
|
64
|
-
proof: string;
|
|
65
|
-
age: string;
|
|
66
|
-
color: string;
|
|
67
|
-
flavor: string;
|
|
68
|
-
variety: string;
|
|
69
|
-
appellation: string;
|
|
70
|
-
vintage: string;
|
|
71
|
-
description: string;
|
|
72
|
-
htmlDescription: string;
|
|
73
|
-
tastingNotes: string;
|
|
74
|
-
priceInfo?: {
|
|
75
|
-
min: number;
|
|
76
|
-
max: number;
|
|
77
|
-
avg: number;
|
|
78
|
-
};
|
|
79
|
-
quantity: number;
|
|
80
25
|
sizes: Record<string, IProductSizeStore>;
|
|
81
|
-
|
|
26
|
+
quantity: number;
|
|
82
27
|
selectedSizeId: string | null;
|
|
83
28
|
selectedFulfillmentType: FulfillmentType;
|
|
84
29
|
selectedFulfillmentId: string | null;
|
|
85
30
|
selectedFulfillment: IProductFulfillmentStore | null;
|
|
31
|
+
productHasAvailability: boolean;
|
|
86
32
|
fulfillmentHasAvailability: boolean;
|
|
33
|
+
drawer: IProductDrawerStore;
|
|
87
34
|
loading: boolean;
|
|
88
35
|
updating: boolean;
|
|
89
|
-
error: string | null;
|
|
90
|
-
drawer: IProductDrawerStore;
|
|
91
36
|
rerender: boolean;
|
|
37
|
+
error: string | null;
|
|
92
38
|
}
|
|
@@ -4,9 +4,9 @@ import type { ICheckoutStore } from '@/core/store/interfaces/checkout.interface'
|
|
|
4
4
|
import type { IGlobalStore, IUIStore } from '@/core/store/interfaces/core.interface';
|
|
5
5
|
import type { IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
6
|
export declare const LOCAL_STORAGE_PREFIX = "lce";
|
|
7
|
+
export declare const initialAddressState: IAddressStore;
|
|
7
8
|
export declare const initialProductState: IProductStore;
|
|
8
9
|
export declare const initialCartState: ICartStore;
|
|
9
10
|
export declare const initialCheckoutState: ICheckoutStore;
|
|
10
11
|
export declare const initialUIState: IUIStore;
|
|
11
|
-
export declare const initialAddressState: IAddressStore;
|
|
12
12
|
export declare const initialStoreState: IGlobalStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiClientService } from '@/core/api-client.service';
|
|
2
|
-
import {
|
|
1
|
+
import { ApiClientService } from '@/core/api/api-client.service';
|
|
2
|
+
import { AuthClientService } from '@/core/api/auth-client.service';
|
|
3
3
|
import { ClientActionService } from '@/core/client/client-action.service';
|
|
4
4
|
import { ClientConfigService, type IClientConfigs } from '@/core/client/client-config.service';
|
|
5
5
|
import { CommandService } from '@/core/command/command.service';
|
|
@@ -10,10 +10,10 @@ import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
|
10
10
|
import { StoreService } from '@/core/store/store.service';
|
|
11
11
|
import { TelemetryService } from '@/core/telemetry/telemetry.service';
|
|
12
12
|
import { type ComponentType } from '@/enums';
|
|
13
|
-
import type {
|
|
13
|
+
import type { IInjectProductElement, IInjectProductListParams, IInjectedComponent, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
|
|
14
14
|
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
15
15
|
export declare abstract class ElementsBaseClient {
|
|
16
|
-
protected readonly
|
|
16
|
+
protected readonly authClient: AuthClientService;
|
|
17
17
|
protected readonly clientConfig: ClientConfigService;
|
|
18
18
|
protected readonly store: StoreService;
|
|
19
19
|
protected readonly commands: CommandService;
|
|
@@ -75,3 +75,23 @@ export declare const ENUM_ADDRESS_TYPE: {
|
|
|
75
75
|
readonly BILLING: "billing";
|
|
76
76
|
};
|
|
77
77
|
export type AddressType = (typeof ENUM_ADDRESS_TYPE)[keyof typeof ENUM_ADDRESS_TYPE];
|
|
78
|
+
export declare const ENUM_FILTER_KEYS: {
|
|
79
|
+
readonly BRANDS: "brands";
|
|
80
|
+
readonly FLAVOR: "flavor";
|
|
81
|
+
readonly FULFILLMENT: "fulfillment";
|
|
82
|
+
readonly TAGS: "tags";
|
|
83
|
+
readonly REGION: "region";
|
|
84
|
+
readonly VARIETY: "variety";
|
|
85
|
+
readonly ENGRAVING: "engraving";
|
|
86
|
+
readonly PRICE: "price";
|
|
87
|
+
readonly PRESALE: "presale";
|
|
88
|
+
readonly AVAILABILITY: "availability";
|
|
89
|
+
readonly CATEGORIES: "categories";
|
|
90
|
+
readonly SIZES: "sizes";
|
|
91
|
+
readonly COLORS: "colors";
|
|
92
|
+
readonly APPELLATION: "appellation";
|
|
93
|
+
readonly COUNTRY: "country";
|
|
94
|
+
readonly VINTAGE: "vintage";
|
|
95
|
+
readonly MATERIALS: "materials";
|
|
96
|
+
readonly COLLECTION_TAGS: "collectionTags";
|
|
97
|
+
};
|
|
@@ -95,6 +95,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
95
95
|
readonly PRODUCT_LIST: "product-list";
|
|
96
96
|
readonly PRODUCT_LIST_CARD: "product-list-card";
|
|
97
97
|
readonly PRODUCT_LIST_FILTERS: "product-list-filters";
|
|
98
|
+
readonly PRODUCT_LIST_SEARCH: "product-list-search";
|
|
98
99
|
readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
|
|
99
100
|
readonly CART: "cart";
|
|
100
101
|
readonly CART_RETAILER: "cart-retailer";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
|
+
export interface IAddressAutocompleteResult {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAddressCoordinates {
|
|
7
|
+
latitude: number;
|
|
8
|
+
longitude: number;
|
|
9
|
+
}
|
|
10
|
+
export interface IAddressAddress {
|
|
11
|
+
one: string;
|
|
12
|
+
two: string;
|
|
13
|
+
city: string;
|
|
14
|
+
state: string;
|
|
15
|
+
zip: string;
|
|
16
|
+
country: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IAddressDetailsResult {
|
|
19
|
+
formattedAddress: string;
|
|
20
|
+
address: IAddressAddress;
|
|
21
|
+
coordinates: IAddressCoordinates;
|
|
22
|
+
}
|
|
23
|
+
export interface ILocation {
|
|
24
|
+
address: IAddressAddress;
|
|
25
|
+
coordinates: IAddressCoordinates;
|
|
26
|
+
}
|
|
27
|
+
export interface IAddressData extends IAddressStore {
|
|
28
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { CartEventEnum, FulfillmentType } from '@/enums';
|
|
2
|
+
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
3
|
+
import type { IProductPresale } from '@/interfaces/api/product.interface';
|
|
4
|
+
export interface ICartUpdateItem {
|
|
5
|
+
id?: string;
|
|
6
|
+
partNumber: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
fulfillmentId: string;
|
|
9
|
+
engravingLines?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ICartUpdateParams {
|
|
12
|
+
id: string;
|
|
13
|
+
items: ICartUpdateItem[];
|
|
14
|
+
promoCode?: string;
|
|
15
|
+
location?: ILocation;
|
|
16
|
+
}
|
|
17
|
+
export interface ICartFulfillment {
|
|
18
|
+
id: string;
|
|
19
|
+
canEngrave: boolean;
|
|
20
|
+
type: FulfillmentType;
|
|
21
|
+
expectation: string;
|
|
22
|
+
itemIds: string[];
|
|
23
|
+
subtotal: number;
|
|
24
|
+
hasUnmetMinimumPurchaseAmount: boolean;
|
|
25
|
+
minimumPurchaseAmount: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ICartRetailer {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
subtotal: number;
|
|
31
|
+
itemsQuantity: number;
|
|
32
|
+
fulfillments: Record<string, ICartFulfillment>;
|
|
33
|
+
}
|
|
34
|
+
export interface ICartItemAttributes {
|
|
35
|
+
engraving: ICartItemEngraving;
|
|
36
|
+
presale: IProductPresale;
|
|
37
|
+
}
|
|
38
|
+
export interface ICartItem {
|
|
39
|
+
id: string;
|
|
40
|
+
variantId: string;
|
|
41
|
+
liquidId: string;
|
|
42
|
+
retailerId: string;
|
|
43
|
+
partNumber: string;
|
|
44
|
+
fulfillmentId: string;
|
|
45
|
+
upc: string;
|
|
46
|
+
sku: string;
|
|
47
|
+
salsifyGrouping: string;
|
|
48
|
+
catPath: string;
|
|
49
|
+
volume: string;
|
|
50
|
+
uom: string;
|
|
51
|
+
pack: boolean;
|
|
52
|
+
packDesc: string;
|
|
53
|
+
container: string;
|
|
54
|
+
containerType: string;
|
|
55
|
+
name: string;
|
|
56
|
+
brand: string;
|
|
57
|
+
size: string;
|
|
58
|
+
price: number;
|
|
59
|
+
quantity: number;
|
|
60
|
+
maxQuantity: number;
|
|
61
|
+
unitPrice: number;
|
|
62
|
+
mainImage: string;
|
|
63
|
+
attributes: ICartItemAttributes;
|
|
64
|
+
}
|
|
65
|
+
export interface ICartPromoCode {
|
|
66
|
+
code: string;
|
|
67
|
+
discountAmount: number;
|
|
68
|
+
}
|
|
69
|
+
export interface ICart {
|
|
70
|
+
id: string;
|
|
71
|
+
subtotal: number;
|
|
72
|
+
itemsQuantity: number;
|
|
73
|
+
items: Record<string, ICartItem>;
|
|
74
|
+
retailers: Record<string, ICartRetailer>;
|
|
75
|
+
promoCode: ICartPromoCode | null;
|
|
76
|
+
events: ICartEvent[];
|
|
77
|
+
}
|
|
78
|
+
export interface ICartItemEngraving {
|
|
79
|
+
isEngravable: boolean;
|
|
80
|
+
hasEngraving: boolean;
|
|
81
|
+
fee: number;
|
|
82
|
+
maxCharsPerLine: number;
|
|
83
|
+
maxLines: number;
|
|
84
|
+
location: string;
|
|
85
|
+
lines: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface ICartEvent {
|
|
88
|
+
type: CartEventEnum;
|
|
89
|
+
message: string;
|
|
90
|
+
items?: Array<Partial<ICartItem>>;
|
|
91
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ENUM_FILTER_KEYS } from '@/enums';
|
|
2
|
+
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
3
|
+
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
4
|
+
export interface IProductSearchParams {
|
|
5
|
+
location?: ILocation;
|
|
6
|
+
search?: string;
|
|
7
|
+
pageToken?: string;
|
|
8
|
+
page?: number;
|
|
9
|
+
perPage?: number;
|
|
10
|
+
filters?: Array<Record<any, any>>;
|
|
11
|
+
}
|
|
12
|
+
export type FacetFilterKeys = typeof ENUM_FILTER_KEYS.BRANDS | typeof ENUM_FILTER_KEYS.FLAVOR | typeof ENUM_FILTER_KEYS.REGION | typeof ENUM_FILTER_KEYS.VARIETY | typeof ENUM_FILTER_KEYS.ENGRAVING | typeof ENUM_FILTER_KEYS.PRESALE | typeof ENUM_FILTER_KEYS.PRICE | typeof ENUM_FILTER_KEYS.AVAILABILITY | typeof ENUM_FILTER_KEYS.CATEGORIES | typeof ENUM_FILTER_KEYS.SIZES | typeof ENUM_FILTER_KEYS.COLORS | typeof ENUM_FILTER_KEYS.APPELLATION | typeof ENUM_FILTER_KEYS.COUNTRY | typeof ENUM_FILTER_KEYS.VINTAGE | typeof ENUM_FILTER_KEYS.MATERIALS | typeof ENUM_FILTER_KEYS.TAGS;
|
|
13
|
+
export interface IFilterSchema {
|
|
14
|
+
category: FacetFilterKeys;
|
|
15
|
+
values: IFilterValue[];
|
|
16
|
+
}
|
|
17
|
+
export interface IFilterValue {
|
|
18
|
+
value: string;
|
|
19
|
+
formattedValue: string;
|
|
20
|
+
count: number;
|
|
21
|
+
}
|
|
22
|
+
export interface INavigationResponse {
|
|
23
|
+
currentPage: number;
|
|
24
|
+
totalPages: number;
|
|
25
|
+
totalCount: number;
|
|
26
|
+
filters: IFilterSchema[];
|
|
27
|
+
}
|
|
28
|
+
export interface IProductSearchResponse extends IProductAvailabilityResponse {
|
|
29
|
+
navigation: INavigationResponse;
|
|
30
|
+
}
|