@liquidcommerce/elements-sdk 2.5.6-beta.1 → 2.5.6-beta.11

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.
Files changed (67) hide show
  1. package/README.md +99 -25
  2. package/dist/index.esm.js +12684 -11647
  3. package/dist/types/constants/core.constant.d.ts +1 -0
  4. package/dist/types/core/api-client.service.d.ts +1 -1
  5. package/dist/types/core/auth.service.d.ts +0 -1
  6. package/dist/types/core/client/client-action.service.d.ts +0 -4
  7. package/dist/types/core/client/client-config.service.d.ts +4 -0
  8. package/dist/types/core/fingerprint.service.d.ts +2 -1
  9. package/dist/types/core/google-tag-manager.service.d.ts +0 -19
  10. package/dist/types/core/logger/logger.service.d.ts +0 -2
  11. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +0 -2
  12. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +0 -10
  13. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +14 -8
  14. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +0 -6
  15. package/dist/types/core/singleton-manager.service.d.ts +6 -1
  16. package/dist/types/core/store/interfaces/checkout.interface.d.ts +75 -80
  17. package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
  18. package/dist/types/core/store/store.constant.d.ts +1 -1
  19. package/dist/types/core/telemetry/telemetry.interface.d.ts +1 -1
  20. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  21. package/dist/types/enums/core.enum.d.ts +16 -10
  22. package/dist/types/interfaces/cloud/checkout.interface.d.ts +1 -1
  23. package/dist/types/interfaces/configs/checkout.interface.d.ts +0 -1
  24. package/dist/types/interfaces/core.interface.d.ts +5 -1
  25. package/dist/types/modules/cart/components/cart-retailer.component.d.ts +0 -2
  26. package/dist/types/modules/checkout/checkout.commands.d.ts +27 -25
  27. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +14 -0
  28. package/dist/types/modules/checkout/components/checkout-buyer-summary.component.d.ts +7 -0
  29. package/dist/types/modules/checkout/components/{checkout-information-section.component.d.ts → checkout-buyer.component.d.ts} +5 -5
  30. package/dist/types/modules/checkout/components/checkout-deliver-to-summary.component.d.ts +7 -0
  31. package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +13 -0
  32. package/dist/types/modules/checkout/components/checkout-information.component.d.ts +17 -0
  33. package/dist/types/modules/checkout/components/{checkout-summary-section.component.d.ts → checkout-order-summary.component.d.ts} +1 -1
  34. package/dist/types/modules/checkout/components/checkout-payment-summary.component.d.ts +7 -0
  35. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +30 -0
  36. package/dist/types/modules/checkout/components/{summary/checkout-place-order-button.component.d.ts → checkout-place-order-button.component.d.ts} +1 -5
  37. package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +7 -0
  38. package/dist/types/modules/checkout/components/{information/checkout-stripe-form.component.d.ts → checkout-stripe-form.component.d.ts} +5 -3
  39. package/dist/types/modules/checkout/components/checkout-stripe-handler.component.d.ts +50 -0
  40. package/dist/types/modules/checkout/components/index.d.ts +23 -18
  41. package/dist/types/modules/checkout/constant.d.ts +0 -1
  42. package/dist/types/modules/product/components/components.d.ts +1 -1
  43. package/dist/types/modules/product/utils/helpers.d.ts +0 -7
  44. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +4 -4
  45. package/dist/types/modules/ui-components/input/input.component.d.ts +4 -4
  46. package/docs/ACTIONS.md +29 -29
  47. package/docs/CONFIGURATION.md +20 -1
  48. package/docs/EVENTS.md +62 -29
  49. package/docs/THEMING.md +2 -5
  50. package/package.json +7 -7
  51. package/umd/elements.js +1 -1
  52. package/dist/types/modules/checkout/checkout.commands.helper.d.ts +0 -13
  53. package/dist/types/modules/checkout/components/information/checkout-billing-form.component.d.ts +0 -18
  54. package/dist/types/modules/checkout/components/information/checkout-buyer-information-form.component.d.ts +0 -12
  55. package/dist/types/modules/checkout/components/information/checkout-delivery-information-form.component.d.ts +0 -17
  56. package/dist/types/modules/checkout/components/information/checkout-payment-form.component.d.ts +0 -21
  57. package/dist/types/modules/product/utils/index.d.ts +0 -2
  58. /package/dist/types/modules/checkout/components/{summary/checkout-amounts.component.d.ts → checkout-amounts.component.d.ts} +0 -0
  59. /package/dist/types/modules/checkout/components/{summary/checkout-completed.component.d.ts → checkout-completed.component.d.ts} +0 -0
  60. /package/dist/types/modules/checkout/components/{summary/checkout-gift-cards.component.d.ts → checkout-gift-cards.component.d.ts} +0 -0
  61. /package/dist/types/modules/checkout/components/{summary/checkout-item-quantity.component.d.ts → checkout-item-quantity.component.d.ts} +0 -0
  62. /package/dist/types/modules/checkout/components/{summary/checkout-item.component.d.ts → checkout-item.component.d.ts} +0 -0
  63. /package/dist/types/modules/checkout/components/{summary/checkout-items.component.d.ts → checkout-items.component.d.ts} +0 -0
  64. /package/dist/types/modules/checkout/components/{summary/checkout-presale-expired.component.d.ts → checkout-presale-expired.component.d.ts} +0 -0
  65. /package/dist/types/modules/checkout/components/{summary/checkout-promo-code.component.d.ts → checkout-promo-code.component.d.ts} +0 -0
  66. /package/dist/types/modules/checkout/components/{summary/checkout-tips.component.d.ts → checkout-tips.component.d.ts} +0 -0
  67. /package/dist/types/modules/checkout/components/{summary/promo-pc-gc.component.d.ts → promo-pc-gc.component.d.ts} +0 -0
@@ -1,4 +1,5 @@
1
1
  export declare const API_CLIENT_URL: {
2
+ beta: string;
2
3
  local: string;
3
4
  development: string;
4
5
  staging: string;
@@ -23,7 +23,7 @@ export declare class ApiClientService {
23
23
  prepareCheckout(params: ICheckoutPrepareParams): Promise<ICheckoutPrepareResponse>;
24
24
  getPaymentSession(params: IUserPaymentSession): Promise<IUserSession>;
25
25
  confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ILiquidPaymentToken>;
26
- checkoutComplete(params: ICheckoutCompleteParams): Promise<ICheckoutCompleteResponse['order']>;
26
+ checkoutComplete(params: Partial<ICheckoutCompleteParams>): Promise<ICheckoutCompleteResponse['order']>;
27
27
  catalogSearch(params: ICatalogParams): Promise<ICatalog>;
28
28
  private validResponseData;
29
29
  private ensureClientInitialized;
@@ -42,7 +42,6 @@ export declare class AuthService {
42
42
  private constructor();
43
43
  static getInstance(config: IAuthConfig): AuthService;
44
44
  authenticate(): Promise<boolean>;
45
- private requestWithoutAuth;
46
45
  isTokenExpired(): boolean;
47
46
  private request;
48
47
  private buildUrl;
@@ -4,7 +4,6 @@ import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.int
4
4
  import { type FulfillmentType } from '@/enums';
5
5
  import type { IAddress, ICoords } from '@/interfaces/cloud';
6
6
  import type { IAddressData } from '@/modules/address/address.interface';
7
- import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
8
7
  export interface IProductActions {
9
8
  getDetails: (identifier: string) => IBaseProductEventData;
10
9
  }
@@ -42,9 +41,6 @@ export interface ICheckoutActions {
42
41
  toggleIsGift: (active?: boolean) => Promise<void>;
43
42
  toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
44
43
  toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => void;
45
- updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
46
- updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
47
- updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
48
44
  getDetails: () => ICheckoutDetailsEventData;
49
45
  }
50
46
  export declare class ClientActionService {
@@ -14,10 +14,12 @@ export interface IClientConfigs {
14
14
  proxy: IElementsProxyConfig | null;
15
15
  deviceType: DeviceType;
16
16
  userDeviceId?: string;
17
+ localStorageKeyPrefix?: string;
17
18
  isLocalStorageAvailable?: boolean;
18
19
  version?: string;
19
20
  clientPrepared: boolean;
20
21
  promoTicker: IPromoTicker[] | null;
22
+ paymentMethodId?: string;
21
23
  }
22
24
  export interface IClientConfigInput {
23
25
  env?: ElementsEnv;
@@ -26,6 +28,7 @@ export interface IClientConfigInput {
26
28
  customTheme?: IClientCustomThemeConfig;
27
29
  proxy?: IElementsProxyConfig;
28
30
  promoTicker?: IPromoTicker[];
31
+ paymentMethodId?: string;
29
32
  }
30
33
  export declare class ClientConfigService {
31
34
  private config;
@@ -34,6 +37,7 @@ export declare class ClientConfigService {
34
37
  getConfigs(): IClientConfigs;
35
38
  get<K extends keyof IClientConfigs>(key: K): IClientConfigs[K];
36
39
  set<K extends keyof IClientConfigs>(key: K, value: IClientConfigs[K]): void;
40
+ isBeta(): boolean;
37
41
  isDevelopment(): boolean;
38
42
  isStaging(): boolean;
39
43
  isProduction(): boolean;
@@ -4,9 +4,10 @@ interface FingerprintData {
4
4
  timezone: string;
5
5
  }
6
6
  export declare class FingerPrintService {
7
- private readonly keyPrefix;
8
7
  private isLocalStorageAvailable;
9
8
  private cachedFingerprint;
9
+ private readonly clientConfig;
10
+ constructor();
10
11
  static getInstance(): FingerPrintService;
11
12
  getId(partnerCode: string): Promise<string>;
12
13
  getFingerprintData(): FingerprintData;
@@ -80,26 +80,7 @@ export declare class GoogleTagManagerService {
80
80
  removeFromCart(item: BaseItem): void;
81
81
  beginCheckout(items: BaseItem[], coupon?: string): void;
82
82
  addShippingInfo(items: BaseItem[], coupon?: string): void;
83
- addShippingInfoWithCustomerData(value: number, coupon?: string, customerData?: {
84
- phone?: string;
85
- email?: string;
86
- birth_date?: string;
87
- customer_id?: string;
88
- }, amounts?: {
89
- subtotal?: number;
90
- total_before_discounts?: number;
91
- discounts?: number;
92
- gift_cards?: number;
93
- net_total?: number;
94
- }): void;
95
83
  addPaymentInfo(items: BaseItem[], paymentType?: string, coupon?: string): void;
96
- addPaymentInfoWithoutItems(value: number, paymentType?: string, coupon?: string, amounts?: {
97
- subtotal?: number;
98
- total_before_discounts?: number;
99
- discounts?: number;
100
- gift_cards?: number;
101
- net_total?: number;
102
- }): void;
103
84
  purchase(purchaseData: PurchaseData & {
104
85
  subtotal?: number;
105
86
  total_before_discounts?: number;
@@ -14,7 +14,5 @@ export declare class LoggerService {
14
14
  info(message: string, data?: Record<string, any>): void;
15
15
  warn(message: string, data?: Record<string, any>): void;
16
16
  error(message: string, error?: Error | Record<string, any>): void;
17
- group(label: string, collapsed?: boolean): void;
18
- groupEnd(): void;
19
17
  private sendToTelemetry;
20
18
  }
@@ -92,11 +92,9 @@ export interface ICartItemEngravingUpdatedEventData {
92
92
  export interface ICartPromoCodeEventData {
93
93
  discountAmount?: number;
94
94
  newTotal?: number;
95
- applied: boolean;
96
95
  }
97
96
  export interface ICartPromoCodeFailedEventData {
98
97
  error: string;
99
- attempted: boolean;
100
98
  }
101
99
  export interface ICartProductAddEventData {
102
100
  itemsAdded: number;
@@ -43,25 +43,18 @@ export interface ICheckoutItemEngravingUpdatedEventData {
43
43
  engravingLines: string[];
44
44
  previousEngravingLines: string[];
45
45
  }
46
- export interface ICheckoutFormUpdatedEventData {
47
- fieldName: string;
48
- }
49
46
  export interface ICheckoutPromoCodeEventData {
50
47
  discountAmount?: number;
51
48
  newTotal?: number;
52
- applied: boolean;
53
49
  }
54
50
  export interface ICheckoutPromoCodeFailedEventData {
55
51
  error: string;
56
- attempted: boolean;
57
52
  }
58
53
  export interface ICheckoutGiftCardEventData {
59
- applied: boolean;
60
54
  newTotal?: number;
61
55
  }
62
56
  export interface ICheckoutGiftCardFailedEventData {
63
57
  error: string;
64
- attempted: boolean;
65
58
  }
66
59
  export interface ICheckoutProductAddEventData {
67
60
  itemsAdded: number;
@@ -107,9 +100,6 @@ export interface ICheckoutItemEventData {
107
100
  }
108
101
  export interface ICheckoutDetailsEventData {
109
102
  cartId: string;
110
- acceptedAccountCreation: boolean;
111
- hasAgeVerify: boolean;
112
- hasSubstitutionPolicy: boolean;
113
103
  isGift: boolean;
114
104
  billingSameAsShipping: boolean;
115
105
  marketingPreferences: {
@@ -1,8 +1,14 @@
1
1
  import type { IAddressActionEventData } 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, ICheckoutFormUpdatedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
4
- import type { IElementsClientIsReadyEventData, IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub/interfaces/product.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';
4
+ import type { IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub/interfaces/product.interface';
5
5
  import { ELEMENTS_ACTIONS_EVENT } from '@/enums';
6
+ export interface IElementsClientIsReadyEventData {
7
+ isReady: boolean;
8
+ message: string;
9
+ timestamp: number;
10
+ version?: string;
11
+ }
6
12
  export interface IEventMetadata {
7
13
  eventId: string;
8
14
  namespace: 'actions' | 'forms';
@@ -17,6 +23,9 @@ export interface IEnhancedEventData<T> {
17
23
  }
18
24
  export interface IElementsActionsEventsMap {
19
25
  [ELEMENTS_ACTIONS_EVENT.CLIENT_READY]: IElementsClientIsReadyEventData;
26
+ [ELEMENTS_ACTIONS_EVENT.ADDRESS_UPDATED]: IAddressActionEventData;
27
+ [ELEMENTS_ACTIONS_EVENT.ADDRESS_CLEARED]: boolean;
28
+ [ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]: IAddressActionEventData;
20
29
  [ELEMENTS_ACTIONS_EVENT.PRODUCT_LOADED]: IProductLoadedEventData;
21
30
  [ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_DECREASE]: IProductQuantityChangedEventData;
22
31
  [ELEMENTS_ACTIONS_EVENT.PRODUCT_QUANTITY_INCREASE]: IProductQuantityChangedEventData;
@@ -40,9 +49,6 @@ export interface IElementsActionsEventsMap {
40
49
  [ELEMENTS_ACTIONS_EVENT.CART_PROMO_CODE_FAILED]: ICartPromoCodeFailedEventData;
41
50
  [ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_SUCCESS]: ICartProductAddEventData;
42
51
  [ELEMENTS_ACTIONS_EVENT.CART_PRODUCT_ADD_FAILED]: ICartProductAddFailedEventData;
43
- [ELEMENTS_ACTIONS_EVENT.ADDRESS_UPDATED]: IAddressActionEventData;
44
- [ELEMENTS_ACTIONS_EVENT.ADDRESS_CLEARED]: boolean;
45
- [ELEMENTS_ACTIONS_EVENT.ADDRESS_FAILED]: IAddressActionEventData;
46
52
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_OPENED]: boolean;
47
53
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_CLOSED]: boolean;
48
54
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_LOADED]: ICheckoutLoadedEventData;
@@ -50,9 +56,9 @@ export interface IElementsActionsEventsMap {
50
56
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_IS_GIFT_TOGGLED]: ICheckoutToggleEventData;
51
57
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED]: ICheckoutToggleEventData;
52
58
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_MARKETING_PREFERENCES_TOGGLED]: ICheckoutMarketingPreferencesToggleEventData;
53
- [ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]: ICheckoutFormUpdatedEventData;
54
- [ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]: ICheckoutFormUpdatedEventData;
55
- [ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]: ICheckoutFormUpdatedEventData;
59
+ [ELEMENTS_ACTIONS_EVENT.CHECKOUT_CUSTOMER_INFORMATION_UPDATED]: boolean;
60
+ [ELEMENTS_ACTIONS_EVENT.CHECKOUT_GIFT_INFORMATION_UPDATED]: boolean;
61
+ [ELEMENTS_ACTIONS_EVENT.CHECKOUT_BILLING_INFORMATION_UPDATED]: boolean;
56
62
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_REMOVED]: ICheckoutItemRemovedEventData;
57
63
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_INCREASE]: ICheckoutItemQuantityChangedEventData;
58
64
  [ELEMENTS_ACTIONS_EVENT.CHECKOUT_ITEM_QUANTITY_DECREASE]: ICheckoutItemQuantityChangedEventData;
@@ -1,11 +1,5 @@
1
1
  import type { FulfillmentType } from '@/enums';
2
2
  import type { IAddress, ICoords } from '@/interfaces/cloud';
3
- export interface IElementsClientIsReadyEventData {
4
- isReady: boolean;
5
- message: string;
6
- timestamp: number;
7
- version?: string;
8
- }
9
3
  export interface IBaseProductFulfillmentEventData {
10
4
  price: number;
11
5
  partNumber: string;
@@ -1,10 +1,15 @@
1
1
  import type { IClientConfigs } from '@/core/client/client-config.service';
2
2
  import type { LiquidCommerceElementsBuilderClientConstructor, LiquidCommerceElementsClientConstructor } from '@/interfaces/core.interface';
3
3
  export declare class SingletonManager {
4
- private static instances;
5
4
  private static clientConstructor;
5
+ private static regularClientInstances;
6
+ private static builderClientInstances;
7
+ private static currentContext;
6
8
  private static getInstances;
7
9
  private constructor();
10
+ static setContext({ isBuilder }: {
11
+ isBuilder: boolean;
12
+ }): void;
8
13
  static setClientConstructor(lceConstructor: LiquidCommerceElementsClientConstructor | LiquidCommerceElementsBuilderClientConstructor): void;
9
14
  static getClientConstructor(): LiquidCommerceElementsClientConstructor | LiquidCommerceElementsBuilderClientConstructor | null;
10
15
  static getClassInstance<T>(className: string, instanceCreator: () => T): T;
@@ -12,43 +12,6 @@ export interface ICheckoutGiftCardStore {
12
12
  code: string;
13
13
  discountAmount: number;
14
14
  }
15
- export interface ICheckoutPaymentStore {
16
- key: string;
17
- secret: string;
18
- paymentMethodId: string | null;
19
- sendSubmitSignal: boolean;
20
- }
21
- export interface ICheckoutGiftRecipientStore {
22
- firstName: string;
23
- lastName: string;
24
- email: string;
25
- phone: string;
26
- birthDate: string;
27
- addressTwo: string | null;
28
- message: string | null;
29
- }
30
- export interface ICheckoutCustomerStore {
31
- id?: string;
32
- firstName: string;
33
- lastName: string;
34
- email: string;
35
- phone: string;
36
- birthDate: string;
37
- addressTwo: string;
38
- company: string;
39
- }
40
- export interface ICheckoutBillingStore {
41
- firstName: string;
42
- lastName: string;
43
- email: string;
44
- phone: string;
45
- company: string | null;
46
- addressOne: string;
47
- addressTwo: string | null;
48
- city: string;
49
- state: string;
50
- zipCode: string;
51
- }
52
15
  export interface ICheckoutItemStore {
53
16
  liquidId: string;
54
17
  variantId: string;
@@ -84,13 +47,6 @@ export interface ICheckoutItemStore {
84
47
  updating: boolean;
85
48
  error: string | null;
86
49
  }
87
- export interface ICheckoutReadyForSubmitStore {
88
- customer: boolean;
89
- gift: boolean;
90
- billing: boolean;
91
- payment: boolean;
92
- prepared: boolean;
93
- }
94
50
  export interface IOnDemandFulfillmentTipInfo {
95
51
  fulfillmentId: string;
96
52
  retailerId: string;
@@ -98,56 +54,95 @@ export interface IOnDemandFulfillmentTipInfo {
98
54
  subtotal: number;
99
55
  tip: number;
100
56
  }
101
- export interface ICheckoutStripeFormStatusStore {
102
- isComplete: boolean;
103
- hasError: boolean;
104
- isProcessing: boolean;
105
- errorMessage: string | null;
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
+ export interface ICheckoutCustomerFormStore {
71
+ data: ICheckoutCustomerStore;
72
+ isEditing: boolean;
73
+ isValid: boolean;
74
+ isSaving: boolean;
75
+ }
76
+ export interface ICheckoutGiftRecipientStore {
77
+ firstName: string;
78
+ lastName: string;
79
+ email: string;
80
+ phone: string;
81
+ message: string;
82
+ }
83
+ export interface ICheckoutGiftRecipientFormStore {
84
+ data: ICheckoutGiftRecipientStore;
85
+ isEditing: boolean;
86
+ isValid: boolean;
87
+ isSaving: boolean;
88
+ }
89
+ export interface ICheckoutBillingStore {
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
+ }
105
+ export interface ICheckoutPaymentMethodStore {
106
+ id: string;
107
+ card: ICheckoutPaymentCardStore;
108
+ }
109
+ export interface ICheckoutPaymentSessionStore {
110
+ key: string;
111
+ secret: string;
106
112
  }
107
- export interface ICheckoutCardInfoStore {
108
- brand: string | null;
109
- country: string | null;
110
- expMonth: number | null;
111
- expYear: number | null;
112
- last4: string | null;
113
- funding: string | null;
113
+ export interface ICheckoutPaymentFormStore {
114
+ paymentSession: ICheckoutPaymentSessionStore | null;
115
+ paymentMethod: ICheckoutPaymentMethodStore | null;
116
+ data: ICheckoutBillingStore | null;
117
+ billingSameAsShipping: boolean;
118
+ isEditing: boolean;
119
+ isValid: boolean;
120
+ isSaving: boolean;
114
121
  }
115
122
  export interface ICheckoutStore {
116
123
  token: string;
117
124
  cartId: string;
118
- loading: boolean;
119
- updating: boolean;
120
- error: string | null;
121
- warning: string[];
122
- isPresaleLocked: boolean;
123
- presaleExpiresAt: string | null;
124
- acceptedAccountCreation: boolean;
125
- deliveryTips: [];
126
- hasAgeVerify: boolean;
127
- hasSubstitutionPolicy: boolean;
125
+ presale: ICheckoutPresaleStore | null;
128
126
  isGift: boolean;
129
- billingSameAsShipping: boolean;
130
127
  marketingPreferences: ICheckoutMarketingPreferencesStore;
131
- giftRecipient: ICheckoutGiftRecipientStore;
132
- customer: ICheckoutCustomerStore;
133
- payment: ICheckoutPaymentStore;
134
- billing: ICheckoutBillingStore | null;
128
+ customerForm: ICheckoutCustomerFormStore;
129
+ giftRecipientForm: ICheckoutGiftRecipientFormStore;
130
+ paymentForm: ICheckoutPaymentFormStore;
131
+ shippingAddressTwo: string;
135
132
  promoCode: ICheckoutPromoCodeStore | null;
136
133
  giftCards: ICheckoutGiftCardStore[];
137
- amounts: ICheckoutTotalAmounts;
138
134
  items: Record<string, ICheckoutItemStore>;
139
- readyForSubmit: ICheckoutReadyForSubmitStore;
135
+ amounts: ICheckoutTotalAmounts;
140
136
  orderNumber: string | null;
141
- rerender: boolean;
142
- isFormValid: boolean;
143
- invalidFields: string[];
144
- focusField: string | null;
145
137
  onDemandFulfillmentTipInfo: Record<string, IOnDemandFulfillmentTipInfo>;
146
138
  tipSelection: number;
147
- stripeFormStatus: ICheckoutStripeFormStatusStore;
148
- deliveryInstructions: string | null;
149
- card: ICheckoutCardInfoStore;
139
+ deliveryInstructions: string;
150
140
  giftCardError: string | null;
151
141
  promoCodeError: string | null;
142
+ rerender: boolean;
143
+ loading: boolean;
144
+ updating: boolean;
145
+ error: string | null;
146
+ warning: string[];
152
147
  events: IElementsCheckoutEvents[];
153
148
  }
@@ -1,5 +1,5 @@
1
1
  import type { IAddressStore } from '@/core/store/interfaces/address.interface';
2
- import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentStore, ICheckoutPromoCodeStore, ICheckoutReadyForSubmitStore, ICheckoutStore, ICheckoutStripeFormStatusStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutPresaleStore, ICheckoutPromoCodeStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
3
3
  import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
4
4
  import type { ComponentType } from '@/enums';
5
5
  import type { ICartItemStore, ICartPromoCodeStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from './cart.interface';
@@ -25,7 +25,7 @@ export interface IPersistedStore {
25
25
  p?: string;
26
26
  c?: string;
27
27
  }
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.totals.${keyof ICartTotalsStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof IRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof IRetailerFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCodeStore}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.customer.${keyof ICheckoutCustomerStore}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferencesStore}` | `checkout.payment.${keyof ICheckoutPaymentStore}` | `checkout.billing.${keyof ICheckoutBillingStore}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipientStore}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCodeStore}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.readyForSubmit.${keyof ICheckoutReadyForSubmitStore}` | `checkout.onDemandFulfillmentTipInfo.${string}` | `checkout.readyForSubmit.${string}` | `checkout.stripeFormStatus.${keyof ICheckoutStripeFormStatusStore}`;
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.totals.${keyof ICartTotalsStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof IRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof IRetailerFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCodeStore}` | `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
29
  interface MiddlewareContext {
30
30
  action: string;
31
31
  payload: any;
@@ -3,7 +3,7 @@ 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
5
  import type { IProductStore } from '@/core/store/interfaces/product.interface';
6
- export declare const LOCAL_STORAGE_PREFIX = "liquid_elements";
6
+ export declare const LOCAL_STORAGE_PREFIX = "lce";
7
7
  export declare const initialProductState: IProductStore;
8
8
  export declare const initialCartState: ICartStore;
9
9
  export declare const initialCheckoutState: ICheckoutStore;
@@ -55,8 +55,8 @@ export interface ITelemetryComponentContext {
55
55
  }
56
56
  export interface ITelemetryUserContext {
57
57
  deviceId: string;
58
- sessionId?: string;
59
58
  isLocalStorageAvailable: boolean;
59
+ selectedAddress?: string;
60
60
  }
61
61
  export interface ITelemetryBrowserContext {
62
62
  userAgent: string;
@@ -4,6 +4,7 @@ export declare class TelemetryService {
4
4
  private eventQueue;
5
5
  private batchTimer;
6
6
  private readonly clientConfig;
7
+ private readonly store;
7
8
  private stats;
8
9
  private isShuttingDown;
9
10
  constructor();
@@ -1,4 +1,5 @@
1
1
  export declare const ELEMENTS_ENV: {
2
+ readonly BETA: "beta";
2
3
  readonly LOCAL: "local";
3
4
  readonly DEVELOPMENT: "development";
4
5
  readonly STAGING: "staging";
@@ -7,6 +8,9 @@ export declare const ELEMENTS_ENV: {
7
8
  export type ElementsEnv = (typeof ELEMENTS_ENV)[keyof typeof ELEMENTS_ENV];
8
9
  export declare const ELEMENTS_ACTIONS_EVENT: {
9
10
  readonly CLIENT_READY: "client_ready";
11
+ readonly ADDRESS_UPDATED: "address_updated";
12
+ readonly ADDRESS_CLEARED: "address_cleared";
13
+ readonly ADDRESS_FAILED: "address_failed";
10
14
  readonly PRODUCT_LOADED: "product_loaded";
11
15
  readonly PRODUCT_QUANTITY_INCREASE: "product_quantity_increase";
12
16
  readonly PRODUCT_QUANTITY_DECREASE: "product_quantity_decrease";
@@ -30,9 +34,6 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
30
34
  readonly CART_PROMO_CODE_FAILED: "cart_promo_code_failed";
31
35
  readonly CART_PRODUCT_ADD_SUCCESS: "cart_product_add_success";
32
36
  readonly CART_PRODUCT_ADD_FAILED: "cart_product_add_failed";
33
- readonly ADDRESS_UPDATED: "address_updated";
34
- readonly ADDRESS_CLEARED: "address_cleared";
35
- readonly ADDRESS_FAILED: "address_failed";
36
37
  readonly CHECKOUT_LOADED: "checkout_loaded";
37
38
  readonly CHECKOUT_OPENED: "checkout_opened";
38
39
  readonly CHECKOUT_CLOSED: "checkout_closed";
@@ -41,8 +42,8 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
41
42
  readonly CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED: "checkout_billing_same_as_shipping_toggled";
42
43
  readonly CHECKOUT_MARKETING_PREFERENCES_TOGGLED: "checkout_marketing_preferences_toggled";
43
44
  readonly CHECKOUT_CUSTOMER_INFORMATION_UPDATED: "checkout_customer_information_updated";
44
- readonly CHECKOUT_BILLING_INFORMATION_UPDATED: "checkout_billing_information_updated";
45
45
  readonly CHECKOUT_GIFT_INFORMATION_UPDATED: "checkout_gift_information_updated";
46
+ readonly CHECKOUT_BILLING_INFORMATION_UPDATED: "checkout_billing_information_updated";
46
47
  readonly CHECKOUT_ITEM_REMOVED: "checkout_item_removed";
47
48
  readonly CHECKOUT_ITEM_QUANTITY_INCREASE: "checkout_item_quantity_increase";
48
49
  readonly CHECKOUT_ITEM_QUANTITY_DECREASE: "checkout_item_quantity_decrease";
@@ -108,18 +109,22 @@ export declare const COMPONENT_TYPE: {
108
109
  readonly CART_BODY: "cart-body";
109
110
  readonly CART_FULFILLMENT: "cart-fulfillment";
110
111
  readonly CHECKOUT: "checkout";
111
- readonly CHECKOUT_INFORMATION_SECTION: "checkout-information-section";
112
+ readonly CHECKOUT_INFORMATION: "checkout-information";
113
+ readonly CHECKOUT_STRIPE_HANDLER: "checkout-stripe-handler";
112
114
  readonly CHECKOUT_STRIPE_FORM: "checkout-stripe-form";
113
- readonly CHECKOUT_PAYMENT_FORM: "checkout-payment-form";
114
- readonly CHECKOUT_BILLING_FORM: "checkout-billing-form";
115
- readonly CHECKOUT_SUMMARY_SECTION: "checkout-summary-section";
115
+ readonly CHECKOUT_PAYMENT: "checkout-payment";
116
+ readonly CHECKOUT_PAYMENT_SUMMARY: "checkout-payment-summary";
117
+ readonly CHECKOUT_BILLING: "checkout-billing";
118
+ readonly CHECKOUT_ORDER_SUMMARY: "checkout-order-summary";
116
119
  readonly CHECKOUT_PROMO_CODE: "checkout-promo-code";
117
120
  readonly CHECKOUT_GIFT_CARDS: "checkout-gift-cards";
118
121
  readonly CHECKOUT_AMOUNTS: "checkout-amounts";
119
122
  readonly CHECKOUT_ITEMS: "checkout-items";
120
123
  readonly CHECKOUT_COMPLETED: "checkout-completed";
121
- readonly CHECKOUT_DELIVERY_INFORMATION_FORM: "checkout-delivery-information-form";
122
- readonly CHECKOUT_BUYER_INFORMATION_FORM: "checkout-buyer-information-form";
124
+ readonly CHECKOUT_DELIVER_TO: "checkout-deliver-to";
125
+ readonly CHECKOUT_DELIVER_TO_SUMMARY: "checkout-deliver-to-summary";
126
+ readonly CHECKOUT_BUYER: "checkout-buyer";
127
+ readonly CHECKOUT_BUYER_SUMMARY: "checkout-buyer-summary";
123
128
  readonly CHECKOUT_TIPS: "checkout-tips";
124
129
  readonly CHECKOUT_PC_GC: "checkout-pc-gc";
125
130
  readonly CHECKOUT_ITEM: "checkout-item";
@@ -128,6 +133,7 @@ export declare const COMPONENT_TYPE: {
128
133
  readonly CHECKOUT_HEADER: "checkout-header";
129
134
  readonly CHECKOUT_PRESALE_COUNTDOWN: "checkout-presale-countdown";
130
135
  readonly CHECKOUT_PRESALE_EXPIRED: "checkout-presale-expired";
136
+ readonly CHECKOUT_SEND_AS_GIFT: "checkout-send-as-gift";
131
137
  };
132
138
  export type ComponentType = (typeof COMPONENT_TYPE)[keyof typeof COMPONENT_TYPE];
133
139
  export declare const FULFILLMENT_TYPE: {
@@ -189,7 +189,7 @@ export interface ICheckoutPrepareResponse {
189
189
  giftOptions: ICheckoutGiftOptions;
190
190
  marketingPreferences: ICheckoutMarketingPreferences;
191
191
  shippingAddress: IAddress;
192
- billingAddress: ICheckoutBillingAddress | IBillingAddress;
192
+ billingAddress: ICheckoutBillingAddress;
193
193
  amounts: ICheckoutTotalAmounts;
194
194
  items: ICheckoutItem[];
195
195
  retailers: ICheckoutRetailer[];
@@ -17,7 +17,6 @@ export interface ICheckoutLayout {
17
17
  thankYouButtonText: string;
18
18
  drawerHeaderText: string;
19
19
  placeOrderButtonText: string;
20
- placeOrderButtonShowRequiredFields: boolean;
21
20
  checkoutCompleted: ICheckoutCompleted;
22
21
  }
23
22
  export interface ICheckoutCompleted {
@@ -23,6 +23,7 @@ export interface ILiquidCommerceElementsBuilderConfig {
23
23
  promoTicker?: IPromoTicker[];
24
24
  customTheme?: IClientCustomThemeConfig;
25
25
  debugMode?: DebugMode;
26
+ paymentMethodId?: string;
26
27
  }
27
28
  export interface ILiquidCommerceElementsConfig {
28
29
  env?: ElementsEnv;
@@ -30,6 +31,7 @@ export interface ILiquidCommerceElementsConfig {
30
31
  customTheme?: IClientCustomThemeConfig;
31
32
  proxy?: IElementsProxyConfig;
32
33
  debugMode?: DebugMode;
34
+ paymentMethodId?: string;
33
35
  }
34
36
  export interface IInjectProductElement {
35
37
  containerId: string;
@@ -66,7 +68,9 @@ export interface ILiquidCommerceElementsUIMethod {
66
68
  cartButton(containerId: string, showItemsCount?: boolean): void;
67
69
  floatingCartButton(showItemsCount?: boolean): void;
68
70
  cartSubtotal(elementId: string): void;
69
- cartItemsCount(elementId: string): void;
71
+ cartItemsCount(elementId: string, options?: {
72
+ hideZero: boolean;
73
+ }): void;
70
74
  }
71
75
  export interface ILiquidCommerceElementsActions {
72
76
  product: IProductActions;
@@ -17,7 +17,5 @@ export declare class CartRetailerComponent extends BaseComponent<ICartRetailerPa
17
17
  onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
18
18
  afterRender(): void;
19
19
  private setupSectionToggle;
20
- protected beforeAutoDestroy(): void;
21
- protected onAutoDestroy(): void;
22
20
  protected template(): HTMLElement;
23
21
  }