@liquidcommerce/elements-sdk 2.6.0-beta.17 → 2.6.0-beta.19

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 (40) hide show
  1. package/README.md +7 -7
  2. package/dist/index.esm.js +10477 -10580
  3. package/dist/types/core/api/api-client.service.d.ts +6 -6
  4. package/dist/types/core/client/client-action.service.d.ts +1 -2
  5. package/dist/types/core/client/client-config.service.d.ts +2 -0
  6. package/dist/types/core/google-tag-manager.service.d.ts +1 -1
  7. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
  8. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +35 -51
  9. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
  10. package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
  11. package/dist/types/core/store/interfaces/checkout.interface.d.ts +15 -106
  12. package/dist/types/core/store/interfaces/core.interface.d.ts +3 -2
  13. package/dist/types/enums/cloud.enum.d.ts +0 -77
  14. package/dist/types/enums/core.enum.d.ts +24 -0
  15. package/dist/types/interfaces/api/cart.interface.d.ts +11 -7
  16. package/dist/types/interfaces/api/checkout.interface.d.ts +211 -0
  17. package/dist/types/interfaces/api/product.interface.d.ts +2 -2
  18. package/dist/types/interfaces/cloud/index.d.ts +0 -2
  19. package/dist/types/interfaces/cloud/retailer.interface.d.ts +9 -1
  20. package/dist/types/interfaces/core.interface.d.ts +7 -1
  21. package/dist/types/modules/cart/cart.commands.d.ts +4 -4
  22. package/dist/types/modules/checkout/checkout.commands.d.ts +18 -9
  23. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  24. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  25. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  26. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  27. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  28. package/dist/types/modules/checkout/constant.d.ts +3 -0
  29. package/dist/types/modules/product/product.commands.d.ts +1 -0
  30. package/dist/types/modules/product-list/product-list.commands.d.ts +1 -0
  31. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -0
  32. package/docs/ACTIONS.md +13 -13
  33. package/docs/EVENTS.md +7 -7
  34. package/package.json +5 -5
  35. package/umd/elements.js +1 -1
  36. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  37. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  38. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  39. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  40. package/dist/types/utils/helper.d.ts +0 -28
@@ -0,0 +1,211 @@
1
+ import type { CheckoutEventLevel, CheckoutEventType, FulfillmentType } from '@/enums';
2
+ import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
3
+ import type { ICart } from '@/interfaces/api/cart.interface';
4
+ import type { IProductPresale } from '@/interfaces/api/product.interface';
5
+ export interface ICheckoutComplete {
6
+ orderNumber: string;
7
+ }
8
+ export interface ICheckoutPaymentSession {
9
+ key: string;
10
+ secret: string;
11
+ }
12
+ export interface ICheckoutPaymentConfirmParams {
13
+ confirmationTokenId: string;
14
+ setupIntentId: string;
15
+ }
16
+ export interface ICheckoutPaymentConfirmCard {
17
+ brand: string;
18
+ expMonth: string;
19
+ expYear: string;
20
+ last4: string;
21
+ }
22
+ export interface ICheckoutPaymentConfirm {
23
+ id: string;
24
+ card: ICheckoutPaymentConfirmCard;
25
+ }
26
+ export interface ICheckoutCustomer {
27
+ email: string;
28
+ firstName: string;
29
+ lastName: string;
30
+ company: string;
31
+ phone: string;
32
+ birthDate: string;
33
+ }
34
+ export interface ICheckoutBilling {
35
+ firstName: string;
36
+ lastName: string;
37
+ email: string;
38
+ phone: string;
39
+ company: string;
40
+ one: string;
41
+ two: string;
42
+ city: string;
43
+ state: string;
44
+ zip: string;
45
+ }
46
+ export interface ICheckoutGiftRecipient {
47
+ firstName: string;
48
+ lastName: string;
49
+ email: string;
50
+ phone: string;
51
+ message: string;
52
+ }
53
+ export interface ICheckoutMarketingPreferences {
54
+ canEmail: boolean;
55
+ canSms: boolean;
56
+ }
57
+ export interface ICheckoutDeliveryTip {
58
+ fulfillmentId: string;
59
+ tip: number;
60
+ }
61
+ export interface ICheckoutDeliveryInstructions {
62
+ fulfillmentId: string;
63
+ instructions: string;
64
+ }
65
+ export interface ICheckoutPrepareParams {
66
+ cartId: string;
67
+ customer?: ICheckoutCustomer;
68
+ shippingAddressTwo?: string;
69
+ billingAddress?: ICheckoutBilling;
70
+ isGift?: boolean;
71
+ billingSameAsShipping?: boolean;
72
+ giftOptions?: ICheckoutGiftRecipient;
73
+ marketingPreferences?: ICheckoutMarketingPreferences;
74
+ deliveryTips?: ICheckoutDeliveryTip[];
75
+ deliveryInstructions?: ICheckoutDeliveryInstructions[];
76
+ payment?: string;
77
+ promoCode?: string;
78
+ giftCards?: string[];
79
+ }
80
+ export interface ICheckoutUpdateItem {
81
+ id?: string;
82
+ partNumber: string;
83
+ quantity: number;
84
+ fulfillmentId: string;
85
+ engravingLines?: string[];
86
+ }
87
+ export interface ICheckoutItemsUpdateParams {
88
+ cartId: string;
89
+ items: ICheckoutUpdateItem[];
90
+ location?: ILocation;
91
+ }
92
+ export interface ICheckoutItemsUpdateResponse {
93
+ cart: ICart;
94
+ checkout: ICheckoutPrepare;
95
+ }
96
+ export interface ICheckoutAmounts {
97
+ subtotal: number;
98
+ engraving: number;
99
+ service: number;
100
+ shipping: number;
101
+ delivery: number;
102
+ platform: number;
103
+ discounts: number;
104
+ giftCards: number;
105
+ tax: number;
106
+ tip: number;
107
+ total: number;
108
+ }
109
+ export interface ICheckoutPromoCode {
110
+ code: string;
111
+ discount: number;
112
+ freeDelivery: boolean;
113
+ freeServiceFee: boolean;
114
+ freeShipping: boolean;
115
+ }
116
+ export interface ICheckoutGiftCard {
117
+ code: string;
118
+ applied: number;
119
+ }
120
+ export interface ICheckoutShippingAddress extends IAddressAddress, IAddressCoordinates {
121
+ }
122
+ export interface ICheckoutItemEngraving {
123
+ isEngravable: boolean;
124
+ hasEngraving: boolean;
125
+ fee: number;
126
+ maxCharsPerLine: number;
127
+ maxLines: number;
128
+ location: string;
129
+ lines: string[];
130
+ }
131
+ export interface ICheckoutItemAttributes {
132
+ engraving: ICheckoutItemEngraving;
133
+ presale: IProductPresale;
134
+ }
135
+ export interface ICheckoutItem {
136
+ variantId: string;
137
+ cartItemId: string;
138
+ liquidId: string;
139
+ retailerId: string;
140
+ fulfillmentId: string;
141
+ salsifyPid?: string;
142
+ salsifyGrouping?: string;
143
+ name: string;
144
+ catPath: string;
145
+ volume: string;
146
+ uom: string;
147
+ proof: string;
148
+ abv: string;
149
+ containerType: string;
150
+ container: string;
151
+ size: string;
152
+ pack: boolean;
153
+ packDesc: string;
154
+ mainImage: string;
155
+ brand: string;
156
+ partNumber: string;
157
+ upc: string;
158
+ sku: string;
159
+ price: number;
160
+ unitPrice: number;
161
+ quantity: number;
162
+ tax: number;
163
+ unitTax: number;
164
+ bottleDeposits: number;
165
+ attributes: ICheckoutItemAttributes;
166
+ }
167
+ export interface ICheckoutFulfillment {
168
+ id: string;
169
+ deliveryInstructions: string;
170
+ type: FulfillmentType;
171
+ expectation: string;
172
+ engravingExpectation: string;
173
+ itemIds: string[];
174
+ doesAllowPromos: boolean;
175
+ doesAllowGiftCards: boolean;
176
+ amounts: ICheckoutAmounts;
177
+ }
178
+ export interface ICheckoutRetailer {
179
+ id: string;
180
+ name: string;
181
+ fulfillments: Record<string, ICheckoutFulfillment>;
182
+ amounts: ICheckoutAmounts;
183
+ }
184
+ export interface ICheckoutPresale {
185
+ isLocked: boolean;
186
+ expiresAt: string;
187
+ }
188
+ export interface ICheckoutEvent {
189
+ type: CheckoutEventType;
190
+ message: string;
191
+ level: CheckoutEventLevel;
192
+ }
193
+ export interface ICheckoutPrepare {
194
+ token: string;
195
+ cartId: string;
196
+ customer: ICheckoutCustomer;
197
+ isGift: boolean;
198
+ billingSameAsShipping: boolean;
199
+ payment?: string;
200
+ giftOptions: ICheckoutGiftRecipient;
201
+ marketingPreferences: ICheckoutMarketingPreferences;
202
+ shippingAddress: ICheckoutShippingAddress;
203
+ billingAddress: ICheckoutBilling;
204
+ promoCode: ICheckoutPromoCode | null;
205
+ amounts: ICheckoutAmounts;
206
+ giftCards: ICheckoutGiftCard[];
207
+ presale: ICheckoutPresale | null;
208
+ items: Record<string, ICheckoutItem>;
209
+ retailers: Record<string, ICheckoutRetailer>;
210
+ events: ICheckoutEvent[];
211
+ }
@@ -73,8 +73,8 @@ export interface IFulfillment {
73
73
  type: FulfillmentType;
74
74
  doesAllowGiftCards: boolean;
75
75
  doesAllowPromos: boolean;
76
- expectationText: string;
77
- engravingExpectationText: string;
76
+ expectation: string;
77
+ engravingExpectation: string;
78
78
  fee: number;
79
79
  timezone: string;
80
80
  hourStatus: IProductFulfillmentHourStatus;
@@ -1,3 +1 @@
1
- export * from './checkout.interface';
2
- export * from './core.interface';
3
1
  export * from './retailer.interface';
@@ -1,6 +1,14 @@
1
1
  import type { FulfillmentType } from '@/enums';
2
- import type { DAYS_OF_WEEK } from '@/enums/cloud.enum';
3
2
  import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
3
+ export declare enum DAYS_OF_WEEK {
4
+ MONDAY = "monday",
5
+ TUESDAY = "tuesday",
6
+ WEDNESDAY = "wednesday",
7
+ THURSDAY = "thursday",
8
+ FRIDAY = "friday",
9
+ SATURDAY = "saturday",
10
+ SUNDAY = "sunday"
11
+ }
4
12
  export interface IRetailerTimes {
5
13
  startsAt: string;
6
14
  endsAt: string;
@@ -28,6 +28,7 @@ export interface ILiquidCommerceElementsBaseConfig {
28
28
  promoTicker?: IPromoTicker[];
29
29
  customTheme?: IClientCustomThemeConfig;
30
30
  debugMode?: DebugMode;
31
+ checkoutUrl?: string;
31
32
  }
32
33
  export interface ILiquidCommerceElementsBuilderConfig extends ILiquidCommerceElementsBaseConfig {
33
34
  }
@@ -65,6 +66,11 @@ export interface IProcessInjectElementParams {
65
66
  containerId: string;
66
67
  identifier?: string;
67
68
  options?: IAddressOptions;
69
+ checkoutId?: string;
70
+ }
71
+ export interface IInjectCheckoutParams {
72
+ containerId: string;
73
+ checkoutId?: string;
68
74
  }
69
75
  export interface ILiquidCommerceElementsUIMethod {
70
76
  cartButton(containerId: string, showItemsCount?: boolean): void;
@@ -101,7 +107,7 @@ export interface ILiquidCommerceElementsClient {
101
107
  injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
102
108
  injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
103
109
  injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
104
- injectCheckoutElement(containerId: string): Promise<IInjectedComponent | null>;
110
+ injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
105
111
  injectProductList(params: IInjectProductListParams): Promise<void>;
106
112
  ui: ILiquidCommerceElementsUIMethod;
107
113
  actions: ILiquidCommerceElementsActions;
@@ -8,17 +8,15 @@ export interface AddItemParams {
8
8
  identifier: string;
9
9
  }
10
10
  export declare class CartCommands extends BaseCommand {
11
- private readonly uiCommands;
12
- private readonly checkoutCommands;
13
- private readonly commonCommands;
14
11
  constructor();
15
12
  static getInstance(): CartCommands;
16
13
  updateItemQuantity(itemId: string, delta: number): Promise<void>;
17
14
  removeItem(itemId: string, isNotStandAlone?: boolean): Promise<void>;
18
15
  updateItemEngraving(productItemId: string, engravingLines: string[]): Promise<void>;
19
16
  addItem(params: AddItemParams): Promise<void>;
20
- addPresaleItem(params: AddItemParams): Promise<void>;
21
17
  handleGoToCheckout(): Promise<void>;
18
+ private trackBeginCheckout;
19
+ private resolveCheckoutRedirectUrl;
22
20
  applyPromoCode(promoCode: string): Promise<void>;
23
21
  removePromoCode(): Promise<void>;
24
22
  rerenderCart(): void;
@@ -31,4 +29,6 @@ export declare class CartCommands extends BaseCommand {
31
29
  private updateFulfillment;
32
30
  private addNewFulfillmentAndRetailer;
33
31
  private cleanupAfterItemRemoval;
32
+ private syncCartState;
33
+ private buildCartLoadedEventData;
34
34
  }
@@ -1,11 +1,18 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
3
+ import type { ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
4
+ import type { ICheckoutBilling, ICheckoutCustomer, ICheckoutGiftRecipient } from '@/interfaces/api/checkout.interface';
5
+ import type { AddItemParams } from '@/modules/cart/cart.commands';
6
+ import type { PresaleExpiredReason } from '@/modules/checkout/components';
3
7
  export declare class CheckoutCommands extends BaseCommand {
4
8
  private readonly uiCommands;
5
- private readonly commonCommands;
6
9
  constructor();
7
10
  static getInstance(): CheckoutCommands;
8
- loadCheckout(cartIdParam?: string): Promise<void>;
11
+ addPresaleItem(params: AddItemParams): Promise<void>;
12
+ loadCheckout(params: {
13
+ customCartId?: string;
14
+ isForPresale?: boolean;
15
+ }): Promise<void>;
9
16
  toggleIsGift(active?: boolean): Promise<void>;
10
17
  toggleBillingSameAsShipping(active?: boolean): Promise<void>;
11
18
  toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<void>;
@@ -17,7 +24,7 @@ export declare class CheckoutCommands extends BaseCommand {
17
24
  applyGiftCard(code: string): Promise<void>;
18
25
  removeGiftCard(code: string): Promise<void>;
19
26
  clearGiftCardError(): Promise<void>;
20
- openPresaleExpiredDrawer(): void;
27
+ openPresaleExpiredDrawer(reason?: PresaleExpiredReason): void;
21
28
  rerenderCheckout(): void;
22
29
  updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
23
30
  removeItemEngraving(productItemId: string): Promise<void>;
@@ -28,18 +35,18 @@ export declare class CheckoutCommands extends BaseCommand {
28
35
  clearCheckoutError(): Promise<void>;
29
36
  editCustomerForm(): Promise<void>;
30
37
  saveCustomerForm({ shippingAddressTwo, deliveryInstructions, customerData, }: {
31
- customerData: ICheckoutCustomerStore;
38
+ customerData: ICheckoutCustomer;
32
39
  shippingAddressTwo: string;
33
40
  deliveryInstructions: string;
34
41
  }): Promise<void>;
35
42
  editGiftRecipientForm(): Promise<void>;
36
- saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipientStore & {
43
+ saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipient & {
37
44
  shippingAddressTwo: string;
38
45
  deliveryInstructions: string;
39
46
  }): Promise<void>;
40
47
  editPaymentForm(): Promise<void>;
41
48
  savePaymentForm({ billingFormData, paymentSession, }: {
42
- billingFormData?: ICheckoutBillingStore;
49
+ billingFormData?: ICheckoutBilling;
43
50
  paymentSession?: {
44
51
  confirmationTokenId: string;
45
52
  setupIntentId: string;
@@ -47,7 +54,9 @@ export declare class CheckoutCommands extends BaseCommand {
47
54
  }): Promise<void>;
48
55
  checkoutComplete(): Promise<void>;
49
56
  private updateStoreFromCheckoutResponse;
50
- private partialLoadCheckout;
57
+ private syncFromItemUpdate;
58
+ private syncCheckoutState;
59
+ private refreshCheckout;
51
60
  private dataForCheckoutPrepare;
52
- private buildCheckoutItemStore;
61
+ getDetails(): ICheckoutDetailsEventData;
53
62
  }
@@ -1,8 +1,8 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
- import type { ICheckoutBillingStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICheckoutBilling } from '@/interfaces/api/checkout.interface';
3
3
  import type { ICheckoutComponent } from '@/interfaces/configs';
4
4
  export interface ICheckoutBillingComponentParams {
5
- isFormValid: (isValid: boolean, data: ICheckoutBillingStore) => void;
5
+ isFormValid: (isValid: boolean, data: ICheckoutBilling) => void;
6
6
  }
7
7
  export declare class CheckoutBillingComponent extends BaseComponent<ICheckoutBillingComponentParams, ICheckoutComponent> {
8
8
  private billingData;
@@ -1,8 +1,11 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
2
  export declare class CheckoutPresaleCountdownComponent extends BaseComponent<null> {
3
+ private static readonly DEFAULT_PRESALE_DURATION_SECONDS;
4
+ private static readonly ONE_MINUTE_THRESHOLD_SECONDS;
5
+ private static readonly COUNTDOWN_UPDATE_INTERVAL_MS;
3
6
  private countdownInterval;
4
7
  private expiresAt;
5
- private totalDuration;
8
+ private initialDurationSeconds;
6
9
  private rootElement;
7
10
  private scrollHandler;
8
11
  private scrollContainer;
@@ -11,16 +14,26 @@ export declare class CheckoutPresaleCountdownComponent extends BaseComponent<nul
11
14
  get hostClasses(): string[];
12
15
  constructor();
13
16
  onStoreChanged(changes: IOnStoreChanged[]): boolean;
17
+ private resetCountdownState;
14
18
  protected afterRender(): void;
15
19
  protected disconnected(): void;
16
20
  private setupDrawerScrollDetection;
21
+ private findScrollContainer;
22
+ private setScrolledState;
17
23
  private isScrollable;
18
24
  private cleanupScrollListener;
19
25
  private updateExpiresAt;
20
26
  private startCountdown;
21
27
  private stopCountdown;
22
28
  private updateCountdown;
29
+ private updateWarningState;
30
+ private updateTimerDisplay;
31
+ private updateProgressBar;
23
32
  private formatTime;
24
33
  private handleExpire;
25
34
  protected template(): HTMLElement;
35
+ private createTextContainer;
36
+ private createHeader;
37
+ private createSubtitle;
38
+ private createProgressBar;
26
39
  }
@@ -1,11 +1,17 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
- export declare class CheckoutPresaleExpiredComponent extends BaseComponent<null, ICheckoutComponent> {
3
+ export type PresaleExpiredReason = 'time_expired' | 'items_unavailable';
4
+ export interface ICheckoutPresaleExpiredComponentParams {
5
+ reason: PresaleExpiredReason;
6
+ }
7
+ export declare class CheckoutPresaleExpiredComponent extends BaseComponent<ICheckoutPresaleExpiredComponentParams, ICheckoutComponent> {
4
8
  private autoCloseInterval;
5
9
  private autoCloseSeconds;
6
10
  private autoCloseElement;
7
11
  get hostClasses(): string[];
8
12
  get hostAttributes(): Record<string, string>;
13
+ private isItemsUnavailable;
14
+ private isTimeExpired;
9
15
  protected afterRender(): void;
10
16
  protected disconnected(): void;
11
17
  private handleExit;
@@ -6,8 +6,8 @@ export declare class CheckoutTipsComponent extends BaseComponent<null, ICheckout
6
6
  constructor();
7
7
  protected afterRender(): void;
8
8
  private getTipSelection;
9
- private getOnDemandFulfillmentTipInfo;
10
- private getFulfillmentTipInfoArray;
9
+ private getOnDemandFulfillments;
10
+ private getRetailerNameForFulfillment;
11
11
  private handlePercentageSelect;
12
12
  private handleFulfillmentTipInput;
13
13
  private removeTipFromFulfillment;
@@ -7,8 +7,6 @@ export declare class CheckoutPcGcComponent extends BaseComponent<null, ICheckout
7
7
  onStoreWatch(changes: IOnStoreChanged[]): void;
8
8
  private updateAppliedGiftCards;
9
9
  private createAppliedGiftCardElement;
10
- private pcInputContainer;
11
- private gcInputContainer;
12
10
  private inputContainer;
13
11
  private createErrorElement;
14
12
  protected template(): HTMLElement[];
@@ -8,6 +8,7 @@ export declare const customerFormFields: {
8
8
  readonly addressTwo: "addressTwo";
9
9
  readonly company: "company";
10
10
  };
11
+ export type CustomerFieldName = (typeof customerFormFields)[keyof typeof customerFormFields];
11
12
  export declare const giftFormFields: {
12
13
  readonly firstName: "firstName";
13
14
  readonly lastName: "lastName";
@@ -16,6 +17,7 @@ export declare const giftFormFields: {
16
17
  readonly addressTwo: "addressTwo";
17
18
  readonly message: "message";
18
19
  };
20
+ export type GiftFieldName = (typeof giftFormFields)[keyof typeof giftFormFields];
19
21
  export declare const billingFormFields: {
20
22
  readonly firstName: "firstName";
21
23
  readonly lastName: "lastName";
@@ -28,3 +30,4 @@ export declare const billingFormFields: {
28
30
  readonly state: "state";
29
31
  readonly zipCode: "zipCode";
30
32
  };
33
+ export type BillingFieldName = (typeof billingFormFields)[keyof typeof billingFormFields];
@@ -7,6 +7,7 @@ import { type AddItemParams } from '@/modules/cart/cart.commands';
7
7
  export declare class ProductCommands extends BaseCommand {
8
8
  private readonly uiCommands;
9
9
  private readonly cartCommands;
10
+ private readonly checkoutCommands;
10
11
  constructor();
11
12
  static getInstance(): ProductCommands;
12
13
  createProductInstance(productId: string, firstTime?: boolean): Promise<void>;
@@ -5,6 +5,7 @@ import { type AddItemParams } from '@/modules/cart/cart.commands';
5
5
  export declare class ProductListCommands extends BaseCommand {
6
6
  private readonly uiCommands;
7
7
  private readonly cartCommands;
8
+ private readonly checkoutCommands;
8
9
  constructor();
9
10
  static getInstance(): ProductListCommands;
10
11
  getProductList(params: IProductSearchParams): Promise<IProductSearchResponse>;
@@ -15,6 +15,7 @@ export declare class EngravingFormComponent extends BaseComponent<IEngravingForm
15
15
  private addToCartButton;
16
16
  private fulfillmentId;
17
17
  private partNumber;
18
+ private isPresale;
18
19
  beforeConnected(): void;
19
20
  private calculateTotalPrice;
20
21
  private productInformationSection;
package/docs/ACTIONS.md CHANGED
@@ -26,8 +26,8 @@ await actions.cart.applyPromoCode('SAVE20');
26
26
 
27
27
  // 2. Listen for success/failure feedback via events
28
28
  window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
29
- const { discountAmount, newTotal } = event.detail.data;
30
- showSuccessMessage(`🎉 Promo applied! You saved $${discountAmount}!`);
29
+ const { discount, newTotal } = event.detail.data;
30
+ showSuccessMessage(`🎉 Promo applied! You saved $${discount}!`);
31
31
  updateCartDisplay(newTotal);
32
32
  });
33
33
 
@@ -262,7 +262,7 @@ All actions provide feedback through events. Here are all available success/fail
262
262
  'lce:actions.cart_product_add_failed' // { identifiers: string[], error: string }
263
263
 
264
264
  // Promo code management
265
- 'lce:actions.cart_promo_code_applied' // { discountAmount?: number, newTotal?: number }
265
+ 'lce:actions.cart_promo_code_applied' // { discount?: number, newTotal?: number }
266
266
  'lce:actions.cart_promo_code_removed' // { newTotal?: number }
267
267
  'lce:actions.cart_promo_code_failed' // { error: string }
268
268
  ```
@@ -274,7 +274,7 @@ All actions provide feedback through events. Here are all available success/fail
274
274
  'lce:actions.checkout_product_add_failed' // { identifiers: string[], error: string, isPresale?: boolean }
275
275
 
276
276
  // Promo code management
277
- 'lce:actions.checkout_promo_code_applied' // { discountAmount?: number, newTotal?: number }
277
+ 'lce:actions.checkout_promo_code_applied' // { discount?: number, newTotal?: number }
278
278
  'lce:actions.checkout_promo_code_removed' // { newTotal?: number }
279
279
  'lce:actions.checkout_promo_code_failed' // { error: string }
280
280
 
@@ -335,10 +335,10 @@ window.addEventListener('lce:actions.cart_product_add_success', function(event)
335
335
  ```javascript
336
336
  // ✅ Create reusable handlers
337
337
  const handlePromoSuccess = (event) => {
338
- const { discountAmount, newTotal } = event.detail.data;
339
- showSuccessMessage(`Discount applied! Saved: $${discountAmount}`);
338
+ const { discount, newTotal } = event.detail.data;
339
+ showSuccessMessage(`Discount applied! Saved: $${discount}`);
340
340
  updatePriceDisplay(newTotal);
341
- trackPromoSuccess(discountAmount);
341
+ trackPromoSuccess(discount);
342
342
  };
343
343
 
344
344
  const handlePromoFailure = (event) => {
@@ -472,12 +472,12 @@ await actions.cart.applyPromoCode('WELCOME10');
472
472
 
473
473
  // Listen for success
474
474
  window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
475
- const { discountAmount, newTotal } = event.detail.data;
476
- showMessage(`Welcome discount applied! You saved $${discountAmount}!`);
475
+ const { discount, newTotal } = event.detail.data;
476
+ showMessage(`Welcome discount applied! You saved $${discount}!`);
477
477
  updateCartDisplay(newTotal);
478
478
 
479
479
  // Track successful promo usage
480
- analytics.track('Promo Applied', { discount: discountAmount });
480
+ analytics.track('Promo Applied', { discount: discount });
481
481
  });
482
482
 
483
483
  // Listen for failure and try fallback
@@ -624,12 +624,12 @@ const customer = getCurrentCustomer();
624
624
 
625
625
  // Set up event listeners first
626
626
  window.addEventListener('lce:actions.checkout_promo_code_applied', function(event) {
627
- const { discountAmount, newTotal } = event.detail.data;
628
- showCheckoutSuccess(`Discount applied! You saved $${discountAmount}`);
627
+ const { discount, newTotal } = event.detail.data;
628
+ showCheckoutSuccess(`Discount applied! You saved $${discount}`);
629
629
  updateCheckoutTotal(newTotal);
630
630
 
631
631
  // Track successful conversion optimization
632
- analytics.track('Checkout Discount Applied', { discount: discountAmount });
632
+ analytics.track('Checkout Discount Applied', { discount: discount });
633
633
  });
634
634
 
635
635
  window.addEventListener('lce:actions.checkout_promo_code_failed', function(event) {
package/docs/EVENTS.md CHANGED
@@ -470,7 +470,7 @@ These events fire when programmatic actions succeed or fail, giving you complete
470
470
 
471
471
  // Promo code feedback
472
472
  'lce:actions.cart_promo_code_applied' // → "Promo code worked - show success!"
473
- // Data: { discountAmount?: number, newTotal?: number }
473
+ // Data: { discount?: number, newTotal?: number }
474
474
 
475
475
  'lce:actions.cart_promo_code_removed' // → "Promo code removed successfully"
476
476
  // Data: { newTotal?: number }
@@ -490,7 +490,7 @@ These events fire when programmatic actions succeed or fail, giving you complete
490
490
 
491
491
  // Promo code feedback
492
492
  'lce:actions.checkout_promo_code_applied' // → "Checkout discount applied!"
493
- // Data: { discountAmount?: number, newTotal?: number }
493
+ // Data: { discount?: number, newTotal?: number }
494
494
 
495
495
  'lce:actions.checkout_promo_code_removed' // → "Checkout discount removed"
496
496
  // Data: { newTotal?: number }
@@ -519,11 +519,11 @@ await actions.cart.applyPromoCode('SECRET20');
519
519
 
520
520
  // Get feedback (secure)
521
521
  window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
522
- const { discountAmount, newTotal } = event.detail.data;
522
+ const { discount, newTotal } = event.detail.data;
523
523
  // ✅ You get: discount amount, new total
524
524
  // 🚫 You DON'T get: 'SECRET20' (secure!)
525
525
 
526
- showSuccessMessage(`🎉 Discount applied! You saved $${discountAmount}!`);
526
+ showSuccessMessage(`🎉 Discount applied! You saved $${discount}!`);
527
527
  updateCartTotal(newTotal);
528
528
  });
529
529
  ```
@@ -539,14 +539,14 @@ async function applyPromoCodeWithFeedback(code) {
539
539
 
540
540
  // Set up event listeners BEFORE firing action
541
541
  const successHandler = (event) => {
542
- const { discountAmount, newTotal } = event.detail.data;
542
+ const { discount, newTotal } = event.detail.data;
543
543
  hideLoadingMessage();
544
- showSuccessMessage(`🎉 Success! You saved $${discountAmount}!`);
544
+ showSuccessMessage(`🎉 Success! You saved $${discount}!`);
545
545
  updatePriceDisplay(newTotal);
546
546
 
547
547
  // Track successful promo usage
548
548
  analytics.track('Promo Applied', {
549
- discount: discountAmount,
549
+ discount: discount,
550
550
  newTotal: newTotal
551
551
  });
552
552
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "LiquidCommerce Elements SDK",
4
4
  "license": "UNLICENSED",
5
5
  "author": "LiquidCommerce Team",
6
- "version": "2.6.0-beta.17",
6
+ "version": "2.6.0-beta.19",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",
@@ -70,7 +70,7 @@
70
70
  "embeddable commerce"
71
71
  ],
72
72
  "devDependencies": {
73
- "@biomejs/biome": "2.3.8",
73
+ "@biomejs/biome": "2.3.10",
74
74
  "@commitlint/cli": "^20.2.0",
75
75
  "@commitlint/config-conventional": "^20.2.0",
76
76
  "@rollup/plugin-alias": "^6.0.0",
@@ -83,14 +83,14 @@
83
83
  "@semantic-release/commit-analyzer": "^13.0.1",
84
84
  "@semantic-release/git": "^10.0.1",
85
85
  "@semantic-release/github": "^12.0.2",
86
- "@semantic-release/npm": "^13.1.2",
86
+ "@semantic-release/npm": "^13.1.3",
87
87
  "@semantic-release/release-notes-generator": "^14.1.0",
88
88
  "@types/core-js": "^2.5.8",
89
- "@types/node": "^25.0.0",
89
+ "@types/node": "^25.0.3",
90
90
  "conventional-changelog-cli": "^5.0.0",
91
91
  "husky": "^9.1.7",
92
92
  "process": "^0.11.10",
93
- "rollup": "^4.53.3",
93
+ "rollup": "^4.53.5",
94
94
  "rollup-obfuscator": "^4.1.1",
95
95
  "rollup-plugin-typescript2": "^0.36.0",
96
96
  "semantic-release": "^25.0.2",