@liquidcommerce/elements-sdk 2.5.6-beta.4 → 2.5.6-beta.6

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 (51) hide show
  1. package/README.md +18 -15
  2. package/dist/index.esm.js +11745 -10946
  3. package/dist/types/core/client/client-action.service.d.ts +0 -4
  4. package/dist/types/core/google-tag-manager.service.d.ts +0 -19
  5. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +0 -2
  6. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +0 -10
  7. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +14 -8
  8. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +0 -6
  9. package/dist/types/core/store/interfaces/checkout.interface.d.ts +72 -80
  10. package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
  11. package/dist/types/enums/core.enum.d.ts +14 -10
  12. package/dist/types/interfaces/cloud/checkout.interface.d.ts +1 -1
  13. package/dist/types/interfaces/configs/checkout.interface.d.ts +0 -1
  14. package/dist/types/modules/checkout/checkout.commands.d.ts +25 -23
  15. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +14 -0
  16. package/dist/types/modules/checkout/components/checkout-buyer-summary.component.d.ts +7 -0
  17. package/dist/types/modules/checkout/components/{checkout-information-section.component.d.ts → checkout-buyer.component.d.ts} +5 -5
  18. package/dist/types/modules/checkout/components/checkout-deliver-to-summary.component.d.ts +7 -0
  19. package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +13 -0
  20. package/dist/types/modules/checkout/components/checkout-information.component.d.ts +17 -0
  21. package/dist/types/modules/checkout/components/{checkout-summary-section.component.d.ts → checkout-order-summary.component.d.ts} +1 -1
  22. package/dist/types/modules/checkout/components/checkout-payment-summary.component.d.ts +7 -0
  23. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +47 -0
  24. package/dist/types/modules/checkout/components/{summary/checkout-place-order-button.component.d.ts → checkout-place-order-button.component.d.ts} +1 -5
  25. package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +7 -0
  26. package/dist/types/modules/checkout/components/{information/checkout-stripe-form.component.d.ts → checkout-stripe-form.component.d.ts} +5 -3
  27. package/dist/types/modules/checkout/components/index.d.ts +22 -18
  28. package/dist/types/modules/checkout/constant.d.ts +0 -1
  29. package/dist/types/modules/product/utils/helpers.d.ts +0 -7
  30. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +4 -4
  31. package/dist/types/modules/ui-components/input/input.component.d.ts +4 -4
  32. package/docs/ACTIONS.md +29 -29
  33. package/docs/EVENTS.md +62 -29
  34. package/docs/THEMING.md +2 -5
  35. package/package.json +7 -7
  36. package/umd/elements.js +1 -1
  37. package/dist/types/modules/checkout/checkout.commands.helper.d.ts +0 -13
  38. package/dist/types/modules/checkout/components/information/checkout-billing-form.component.d.ts +0 -18
  39. package/dist/types/modules/checkout/components/information/checkout-buyer-information-form.component.d.ts +0 -12
  40. package/dist/types/modules/checkout/components/information/checkout-delivery-information-form.component.d.ts +0 -17
  41. package/dist/types/modules/checkout/components/information/checkout-payment-form.component.d.ts +0 -21
  42. /package/dist/types/modules/checkout/components/{summary/checkout-amounts.component.d.ts → checkout-amounts.component.d.ts} +0 -0
  43. /package/dist/types/modules/checkout/components/{summary/checkout-completed.component.d.ts → checkout-completed.component.d.ts} +0 -0
  44. /package/dist/types/modules/checkout/components/{summary/checkout-gift-cards.component.d.ts → checkout-gift-cards.component.d.ts} +0 -0
  45. /package/dist/types/modules/checkout/components/{summary/checkout-item-quantity.component.d.ts → checkout-item-quantity.component.d.ts} +0 -0
  46. /package/dist/types/modules/checkout/components/{summary/checkout-item.component.d.ts → checkout-item.component.d.ts} +0 -0
  47. /package/dist/types/modules/checkout/components/{summary/checkout-items.component.d.ts → checkout-items.component.d.ts} +0 -0
  48. /package/dist/types/modules/checkout/components/{summary/checkout-presale-expired.component.d.ts → checkout-presale-expired.component.d.ts} +0 -0
  49. /package/dist/types/modules/checkout/components/{summary/checkout-promo-code.component.d.ts → checkout-promo-code.component.d.ts} +0 -0
  50. /package/dist/types/modules/checkout/components/{summary/checkout-tips.component.d.ts → checkout-tips.component.d.ts} +0 -0
  51. /package/dist/types/modules/checkout/components/{summary/promo-pc-gc.component.d.ts → promo-pc-gc.component.d.ts} +0 -0
@@ -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 {
@@ -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;
@@ -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;
@@ -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,92 @@ 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;
106
60
  }
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;
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 ICheckoutPaymentStore {
106
+ key: string;
107
+ secret: string;
108
+ paymentMethodId: string | null;
109
+ card: ICheckoutPaymentCardStore | null;
110
+ }
111
+ export interface ICheckoutPaymentFormStore {
112
+ payment: ICheckoutPaymentStore;
113
+ billingSameAsShipping: boolean;
114
+ data: ICheckoutBillingStore | null;
115
+ isEditing: boolean;
116
+ isValid: boolean;
117
+ isSaving: boolean;
114
118
  }
115
119
  export interface ICheckoutStore {
116
120
  token: string;
117
121
  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;
122
+ presale: ICheckoutPresaleStore | null;
128
123
  isGift: boolean;
129
- billingSameAsShipping: boolean;
130
124
  marketingPreferences: ICheckoutMarketingPreferencesStore;
131
- giftRecipient: ICheckoutGiftRecipientStore;
132
- customer: ICheckoutCustomerStore;
133
- payment: ICheckoutPaymentStore;
134
- billing: ICheckoutBillingStore | null;
125
+ customerForm: ICheckoutCustomerFormStore;
126
+ giftRecipientForm: ICheckoutGiftRecipientFormStore;
127
+ paymentForm: ICheckoutPaymentFormStore;
128
+ shippingAddressTwo: string;
135
129
  promoCode: ICheckoutPromoCodeStore | null;
136
130
  giftCards: ICheckoutGiftCardStore[];
137
- amounts: ICheckoutTotalAmounts;
138
131
  items: Record<string, ICheckoutItemStore>;
139
- readyForSubmit: ICheckoutReadyForSubmitStore;
132
+ amounts: ICheckoutTotalAmounts;
140
133
  orderNumber: string | null;
141
- rerender: boolean;
142
- isFormValid: boolean;
143
- invalidFields: string[];
144
- focusField: string | null;
145
134
  onDemandFulfillmentTipInfo: Record<string, IOnDemandFulfillmentTipInfo>;
146
135
  tipSelection: number;
147
- stripeFormStatus: ICheckoutStripeFormStatusStore;
148
- deliveryInstructions: string | null;
149
- card: ICheckoutCardInfoStore;
136
+ deliveryInstructions: string;
150
137
  giftCardError: string | null;
151
138
  promoCodeError: string | null;
139
+ rerender: boolean;
140
+ loading: boolean;
141
+ updating: boolean;
142
+ error: string | null;
143
+ warning: string[];
152
144
  events: IElementsCheckoutEvents[];
153
145
  }
@@ -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, ICheckoutPaymentStore, 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.payment.${keyof ICheckoutPaymentStore}` | `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;
@@ -7,6 +7,9 @@ export declare const ELEMENTS_ENV: {
7
7
  export type ElementsEnv = (typeof ELEMENTS_ENV)[keyof typeof ELEMENTS_ENV];
8
8
  export declare const ELEMENTS_ACTIONS_EVENT: {
9
9
  readonly CLIENT_READY: "client_ready";
10
+ readonly ADDRESS_UPDATED: "address_updated";
11
+ readonly ADDRESS_CLEARED: "address_cleared";
12
+ readonly ADDRESS_FAILED: "address_failed";
10
13
  readonly PRODUCT_LOADED: "product_loaded";
11
14
  readonly PRODUCT_QUANTITY_INCREASE: "product_quantity_increase";
12
15
  readonly PRODUCT_QUANTITY_DECREASE: "product_quantity_decrease";
@@ -30,9 +33,6 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
30
33
  readonly CART_PROMO_CODE_FAILED: "cart_promo_code_failed";
31
34
  readonly CART_PRODUCT_ADD_SUCCESS: "cart_product_add_success";
32
35
  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
36
  readonly CHECKOUT_LOADED: "checkout_loaded";
37
37
  readonly CHECKOUT_OPENED: "checkout_opened";
38
38
  readonly CHECKOUT_CLOSED: "checkout_closed";
@@ -41,8 +41,8 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
41
41
  readonly CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED: "checkout_billing_same_as_shipping_toggled";
42
42
  readonly CHECKOUT_MARKETING_PREFERENCES_TOGGLED: "checkout_marketing_preferences_toggled";
43
43
  readonly CHECKOUT_CUSTOMER_INFORMATION_UPDATED: "checkout_customer_information_updated";
44
- readonly CHECKOUT_BILLING_INFORMATION_UPDATED: "checkout_billing_information_updated";
45
44
  readonly CHECKOUT_GIFT_INFORMATION_UPDATED: "checkout_gift_information_updated";
45
+ readonly CHECKOUT_BILLING_INFORMATION_UPDATED: "checkout_billing_information_updated";
46
46
  readonly CHECKOUT_ITEM_REMOVED: "checkout_item_removed";
47
47
  readonly CHECKOUT_ITEM_QUANTITY_INCREASE: "checkout_item_quantity_increase";
48
48
  readonly CHECKOUT_ITEM_QUANTITY_DECREASE: "checkout_item_quantity_decrease";
@@ -108,18 +108,21 @@ export declare const COMPONENT_TYPE: {
108
108
  readonly CART_BODY: "cart-body";
109
109
  readonly CART_FULFILLMENT: "cart-fulfillment";
110
110
  readonly CHECKOUT: "checkout";
111
- readonly CHECKOUT_INFORMATION_SECTION: "checkout-information-section";
111
+ readonly CHECKOUT_INFORMATION: "checkout-information";
112
112
  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";
113
+ readonly CHECKOUT_PAYMENT: "checkout-payment";
114
+ readonly CHECKOUT_PAYMENT_SUMMARY: "checkout-payment-summary";
115
+ readonly CHECKOUT_BILLING: "checkout-billing";
116
+ readonly CHECKOUT_ORDER_SUMMARY: "checkout-order-summary";
116
117
  readonly CHECKOUT_PROMO_CODE: "checkout-promo-code";
117
118
  readonly CHECKOUT_GIFT_CARDS: "checkout-gift-cards";
118
119
  readonly CHECKOUT_AMOUNTS: "checkout-amounts";
119
120
  readonly CHECKOUT_ITEMS: "checkout-items";
120
121
  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";
122
+ readonly CHECKOUT_DELIVER_TO: "checkout-deliver-to";
123
+ readonly CHECKOUT_DELIVER_TO_SUMMARY: "checkout-deliver-to-summary";
124
+ readonly CHECKOUT_BUYER: "checkout-buyer";
125
+ readonly CHECKOUT_BUYER_SUMMARY: "checkout-buyer-summary";
123
126
  readonly CHECKOUT_TIPS: "checkout-tips";
124
127
  readonly CHECKOUT_PC_GC: "checkout-pc-gc";
125
128
  readonly CHECKOUT_ITEM: "checkout-item";
@@ -128,6 +131,7 @@ export declare const COMPONENT_TYPE: {
128
131
  readonly CHECKOUT_HEADER: "checkout-header";
129
132
  readonly CHECKOUT_PRESALE_COUNTDOWN: "checkout-presale-countdown";
130
133
  readonly CHECKOUT_PRESALE_EXPIRED: "checkout-presale-expired";
134
+ readonly CHECKOUT_SEND_AS_GIFT: "checkout-send-as-gift";
131
135
  };
132
136
  export type ComponentType = (typeof COMPONENT_TYPE)[keyof typeof COMPONENT_TYPE];
133
137
  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 {
@@ -1,50 +1,52 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { ICheckoutItemStore, ICheckoutStripeFormStatusStore } from '@/core/store/interfaces/checkout.interface';
3
- import type { ICart, ICheckoutFulfillment, ICheckoutItem, ICheckoutPrepareResponse, ICheckoutRetailer } from '@/interfaces/cloud';
4
- import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
5
- export declare function buildCheckoutItemStore(apiItem: ICheckoutItem, retailer: ICheckoutRetailer, fulfillment: ICheckoutFulfillment): ICheckoutItemStore;
2
+ import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore } from '@/core/store/interfaces/checkout.interface';
6
3
  export declare class CheckoutCommands extends BaseCommand {
7
4
  private readonly uiCommands;
8
5
  private readonly commonCommands;
9
6
  constructor();
10
7
  static getInstance(): CheckoutCommands;
11
8
  loadCheckout(cartIdParam?: string): Promise<void>;
12
- partialLoadCheckout(params?: {
13
- cartId?: string;
14
- response?: ICheckoutPrepareResponse;
15
- cartResponse?: ICart;
16
- }): Promise<void>;
17
9
  toggleIsGift(active?: boolean): Promise<void>;
18
10
  toggleBillingSameAsShipping(active?: boolean): Promise<void>;
19
- toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): void;
11
+ toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<void>;
20
12
  getPaymentSession(): Promise<void>;
21
13
  confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<void>;
22
14
  applyPromoCode(code: string): Promise<void>;
23
- clearPromoCodeError(): Promise<void>;
24
15
  removePromoCode(): Promise<void>;
16
+ clearPromoCodeError(): Promise<void>;
25
17
  applyGiftCard(code: string): Promise<void>;
26
- clearGiftCardError(): Promise<void>;
27
18
  removeGiftCard(code: string): Promise<void>;
28
- updateCustomerInfo(fieldName: CustomerFieldName, fieldValue: string): void;
29
- updateBillingInfo(fieldName: BillingFieldName, fieldValue: string): void;
30
- updateGiftInfo(fieldName: GiftFieldName, fieldValue: string): void;
31
- private triggerAddShippingInfoEvent;
32
- private validateAndUpdateFormStatus;
19
+ clearGiftCardError(): Promise<void>;
33
20
  checkoutComplete(): Promise<void>;
34
- startPreparingCheckoutSubmit(): Promise<void>;
35
21
  openPresaleExpiredDrawer(): void;
36
22
  rerenderCheckout(): void;
37
- focusFirstInvalidField(): Promise<void>;
38
- private buildItemUpdate;
39
23
  updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
40
24
  removeItemEngraving(productItemId: string): Promise<void>;
41
25
  removeItem(itemId: string, isNotStandAlone?: boolean): Promise<void>;
42
26
  updateTips(percentage: number): Promise<void>;
43
27
  updateFulfillmentTip(fulfillmentId: string, tipAmount: number): Promise<void>;
44
28
  removeFulfillmentTip(fulfillmentId: string): Promise<void>;
29
+ clearCheckoutError(): Promise<void>;
30
+ editCustomerForm(): Promise<void>;
31
+ saveCustomerForm({ shippingAddressTwo, deliveryInstructions, ...customerData }: ICheckoutCustomerStore & {
32
+ shippingAddressTwo: string;
33
+ deliveryInstructions: string;
34
+ }): Promise<void>;
35
+ editGiftRecipientForm(): Promise<void>;
36
+ saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipientStore & {
37
+ shippingAddressTwo: string;
38
+ deliveryInstructions: string;
39
+ }): Promise<void>;
40
+ editPaymentForm(): Promise<void>;
41
+ savePaymentForm({ billingFormData, paymentSession, }: {
42
+ billingFormData?: ICheckoutBillingStore;
43
+ paymentSession?: {
44
+ confirmationTokenId: string;
45
+ setupIntentId: string;
46
+ };
47
+ }): Promise<void>;
45
48
  private updateStoreFromCheckoutResponse;
46
- updateStripeFormStatus(status: Partial<ICheckoutStripeFormStatusStore>): Promise<void>;
47
- removeCheckoutError(): Promise<void>;
48
- updateDeliveryInstructions(instructions: string): Promise<void>;
49
+ private partialLoadCheckout;
49
50
  private dataForCheckoutPrepare;
51
+ private buildCheckoutItemStore;
50
52
  }
@@ -0,0 +1,14 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { ICheckoutBillingStore } from '@/core/store/interfaces/checkout.interface';
3
+ import type { ICheckoutComponent } from '@/interfaces/configs';
4
+ export interface ICheckoutBillingComponentParams {
5
+ isFormValid: (isValid: boolean, data: ICheckoutBillingStore) => void;
6
+ }
7
+ export declare class CheckoutBillingComponent extends BaseComponent<ICheckoutBillingComponentParams, ICheckoutComponent> {
8
+ private billingData;
9
+ get hostClasses(): string[];
10
+ constructor();
11
+ private billingSameAsShippingToggle;
12
+ private updateSaveButtonState;
13
+ protected template(): HTMLElement[];
14
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ export declare class CheckoutBuyerSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
4
+ get hostClasses(): string[];
5
+ constructor();
6
+ protected template(): HTMLElement[];
7
+ }
@@ -1,12 +1,12 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
- export interface ICheckoutInformationSectionComponentParams {
4
- isIndependentComponent: boolean;
5
- }
6
- export declare class CheckoutInformationSectionComponent extends BaseComponent<ICheckoutInformationSectionComponentParams, ICheckoutComponent> {
3
+ export declare class CheckoutBuyer extends BaseComponent<null, ICheckoutComponent> {
4
+ private customerData;
5
+ private saveButtonText;
6
+ private saveButton;
7
7
  get hostClasses(): string[];
8
8
  constructor();
9
9
  onStoreWatch(changes: IOnStoreChanged[]): void;
10
- private handleBuyerInformationVisibility;
10
+ private updateSaveButtonState;
11
11
  protected template(): HTMLElement[];
12
12
  }
@@ -0,0 +1,7 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ export declare class CheckoutDeliverToSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
4
+ get hostClasses(): string[];
5
+ constructor();
6
+ protected template(): HTMLElement[];
7
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ export declare class CheckoutDeliverToComponent extends BaseComponent<null, ICheckoutComponent> {
4
+ private customerData;
5
+ private giftData;
6
+ private saveButtonText;
7
+ private saveButton;
8
+ get hostClasses(): string[];
9
+ constructor();
10
+ onStoreWatch(changes: IOnStoreChanged[]): void;
11
+ private updateSaveButtonState;
12
+ protected template(): HTMLElement[];
13
+ }
@@ -0,0 +1,17 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ export interface ICheckoutInformationSectionComponentParams {
4
+ isIndependentComponent: boolean;
5
+ }
6
+ export declare class CheckoutInformationComponent extends BaseComponent<ICheckoutInformationSectionComponentParams, ICheckoutComponent> {
7
+ private deliveryToForm;
8
+ private deliverToSummary;
9
+ private buyerForm;
10
+ private buyerSummary;
11
+ private paymentForm;
12
+ private paymentSummary;
13
+ get hostClasses(): string[];
14
+ constructor();
15
+ onStoreWatch(): void;
16
+ protected template(): HTMLElement[];
17
+ }
@@ -1,6 +1,6 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
- export declare class CheckoutSummarySectionComponent extends BaseComponent<null, ICheckoutComponent> {
3
+ export declare class CheckoutOrderSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
4
4
  get hostClasses(): string[];
5
5
  constructor();
6
6
  onStoreWatch(changes: IOnStoreChanged[]): void;
@@ -0,0 +1,7 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ export declare class CheckoutPaymentSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
4
+ get hostClasses(): string[];
5
+ constructor();
6
+ protected template(): HTMLElement[];
7
+ }