@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,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, ICheckoutPaymentMethodStore } 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
- confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<void>;
13
+ confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ICheckoutPaymentMethodStore | null>;
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;
33
- checkoutComplete(): Promise<void>;
34
- startPreparingCheckoutSubmit(): Promise<void>;
19
+ clearGiftCardError(): Promise<void>;
35
20
  openPresaleExpiredDrawer(): void;
36
21
  rerenderCheckout(): void;
37
- focusFirstInvalidField(): Promise<void>;
38
- private buildItemUpdate;
39
22
  updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
40
23
  removeItemEngraving(productItemId: string): Promise<void>;
41
24
  removeItem(itemId: string, isNotStandAlone?: boolean): Promise<void>;
42
25
  updateTips(percentage: number): Promise<void>;
43
26
  updateFulfillmentTip(fulfillmentId: string, tipAmount: number): Promise<void>;
44
27
  removeFulfillmentTip(fulfillmentId: string): Promise<void>;
28
+ clearCheckoutError(): Promise<void>;
29
+ editCustomerForm(): Promise<void>;
30
+ saveCustomerForm({ shippingAddressTwo, deliveryInstructions, ...customerData }: ICheckoutCustomerStore & {
31
+ shippingAddressTwo: string;
32
+ deliveryInstructions: string;
33
+ }): Promise<void>;
34
+ editGiftRecipientForm(): Promise<void>;
35
+ saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipientStore & {
36
+ shippingAddressTwo: string;
37
+ deliveryInstructions: string;
38
+ }): Promise<void>;
39
+ editPaymentForm(): Promise<void>;
40
+ savePaymentForm({ billingFormData, paymentSession, }: {
41
+ billingFormData?: ICheckoutBillingStore;
42
+ paymentSession?: {
43
+ confirmationTokenId: string;
44
+ setupIntentId: string;
45
+ };
46
+ }): Promise<void>;
47
+ checkoutComplete(): 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
+ }
@@ -0,0 +1,30 @@
1
+ import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ export interface ICheckoutSendToFormComponentParams {
4
+ isIndependentComponent: boolean;
5
+ }
6
+ export declare class CheckoutPaymentComponent extends BaseComponent<ICheckoutSendToFormComponentParams, ICheckoutComponent> {
7
+ private stripeHandlerElement;
8
+ private betaNoticeElement;
9
+ private saveButton;
10
+ private errorMessageElement;
11
+ private billingFormData;
12
+ private isValidBillingForm;
13
+ private isBillingSameAsShipping;
14
+ private stripeFormStatus;
15
+ private savedCardInfo;
16
+ private showingStripeSummary;
17
+ private isSavingPayment;
18
+ get hostClasses(): string[];
19
+ constructor();
20
+ onStoreWatch(changes: IOnStoreChanged[]): void;
21
+ private handleBillingSameAsShippingChange;
22
+ afterRender(): Promise<void>;
23
+ private updateSaveButtonState;
24
+ private updateErrorMessage;
25
+ private showError;
26
+ protected template(): HTMLElement[];
27
+ private handleSaveButtonClick;
28
+ private validatePrerequisites;
29
+ disconnected(): void;
30
+ }
@@ -8,15 +8,11 @@ export declare class CheckoutPlaceOrderButtonComponent extends BaseComponent<nul
8
8
  constructor();
9
9
  afterRender(): void;
10
10
  disconnected(): void;
11
- onStoreChanged(changes: IOnStoreChanged[]): boolean;
11
+ onStoreWatch(changes: IOnStoreChanged[]): void;
12
12
  private updateButtonState;
13
- private determineErrorMessage;
14
13
  private clearErrorTimeout;
15
14
  private updateErrorDisplay;
16
15
  private determineButtonState;
17
- private applyButtonState;
18
16
  private handlePlaceOrderClick;
19
- private showPaymentError;
20
- private handleCheckoutReadyForSubmit;
21
17
  protected template(): HTMLElement[];
22
18
  }
@@ -0,0 +1,7 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ export declare class CheckoutSendAsGiftComponent extends BaseComponent<null, ICheckoutComponent> {
4
+ get hostClasses(): string[];
5
+ constructor();
6
+ protected template(): HTMLElement[];
7
+ }
@@ -17,9 +17,10 @@ export interface IStripeConfig {
17
17
  elementOptions?: Record<string, any>;
18
18
  }
19
19
  export interface IStripeFormStatus {
20
- isComplete: boolean;
21
- hasError: boolean;
20
+ isFormComplete: boolean;
22
21
  isProcessing: boolean;
22
+ hasCompletedPayment: boolean;
23
+ hasError: boolean;
23
24
  errorMessage: string | null;
24
25
  }
25
26
  export declare class CheckoutStripeFormComponent extends HTMLElement {
@@ -31,6 +32,7 @@ export declare class CheckoutStripeFormComponent extends HTMLElement {
31
32
  private _isFormComplete;
32
33
  private _hasUsedCurrentSession;
33
34
  private _stripeConfig;
35
+ private _sessionRefreshPromise;
34
36
  initialize({ data }: {
35
37
  data: {
36
38
  stripeConfig: IStripeConfig;
@@ -38,11 +40,11 @@ export declare class CheckoutStripeFormComponent extends HTMLElement {
38
40
  }): Promise<void>;
39
41
  private initializeStripe;
40
42
  private setupEventListeners;
41
- private handleSubmitEvent;
42
43
  private handleRefreshSession;
43
44
  private handleSubmit;
44
45
  private requestSessionRefresh;
45
46
  private refreshPaymentSession;
47
+ private resetForm;
46
48
  private updateStripeFormStatus;
47
49
  private createConfirmationTokenId;
48
50
  disconnected(): Promise<void>;
@@ -0,0 +1,50 @@
1
+ import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
+ import type { ICheckoutComponent } from '@/interfaces/configs';
3
+ import type { IStripeFormStatus } from '@/modules/checkout/components/checkout-stripe-form.component';
4
+ export interface ICheckoutStripeHandlerCallbacks {
5
+ onStripeFormStatusChanged?: (status: IStripeFormStatus) => void;
6
+ onSavedCardInfoChanged?: (cardInfo: {
7
+ brand?: string;
8
+ last4?: string;
9
+ } | null) => void;
10
+ onEditModeVisibilityChanged?: (showingSummary: boolean) => void;
11
+ onPaymentSessionConfirmed?: (confirmationTokenId: string, setupIntentId: string) => Promise<void>;
12
+ }
13
+ export interface ICheckoutStripeHandlerComponentParams {
14
+ isIndependentComponent: boolean;
15
+ callbacks?: ICheckoutStripeHandlerCallbacks;
16
+ }
17
+ export declare class CheckoutStripeHandlerComponent extends BaseComponent<ICheckoutStripeHandlerComponentParams, ICheckoutComponent> {
18
+ private stripeFormElement;
19
+ private rootComponent;
20
+ private isCreatingStripeForm;
21
+ private stripeFormContainer;
22
+ private stripeSummaryContainer;
23
+ private callbacks;
24
+ private stripeFormStatus;
25
+ private isInEditMode;
26
+ private savedCardInfo;
27
+ private isChangingPayment;
28
+ get hostClasses(): string[];
29
+ constructor();
30
+ beforeConnected(): void;
31
+ onStoreWatch(changes: IOnStoreChanged[]): void;
32
+ private handleSavedCardChange;
33
+ private handleEditModeChange;
34
+ private updateDisplayState;
35
+ afterRender(): Promise<void>;
36
+ private setupStripeFormEventListeners;
37
+ private showStripeSummary;
38
+ private hideStripeSummary;
39
+ private showStripeForm;
40
+ private hideStripeForm;
41
+ private handleChangePayment;
42
+ protected template(): HTMLElement[];
43
+ submitStripeForm(): void;
44
+ getStripeFormStatus(): IStripeFormStatus;
45
+ private findRootComponent;
46
+ private removeExistingStripeForm;
47
+ private doStripeConfig;
48
+ private createAndMountStripeForm;
49
+ disconnected(): void;
50
+ }
@@ -1,20 +1,25 @@
1
+ export * from './checkout-amounts.component';
2
+ export * from './checkout-billing.component';
3
+ export * from './checkout-buyer.component';
4
+ export * from './checkout-buyer-summary.component';
5
+ export * from './checkout-completed.component';
6
+ export * from './checkout-deliver-to.component';
7
+ export * from './checkout-deliver-to-summary.component';
8
+ export * from './checkout-gift-cards.component';
1
9
  export * from './checkout-header.component';
2
- export * from './checkout-information-section.component';
10
+ export * from './checkout-information.component';
11
+ export * from './checkout-item.component';
12
+ export * from './checkout-item-quantity.component';
13
+ export * from './checkout-items.component';
14
+ export * from './checkout-order-summary.component';
15
+ export * from './checkout-payment.component';
16
+ export * from './checkout-payment-summary.component';
17
+ export * from './checkout-place-order-button.component';
3
18
  export * from './checkout-presale-countdown.component';
4
- export * from './checkout-summary-section.component';
5
- export * from './information/checkout-billing-form.component';
6
- export * from './information/checkout-buyer-information-form.component';
7
- export * from './information/checkout-delivery-information-form.component';
8
- export * from './information/checkout-payment-form.component';
9
- export * from './information/checkout-stripe-form.component';
10
- export * from './summary/checkout-amounts.component';
11
- export * from './summary/checkout-completed.component';
12
- export * from './summary/checkout-gift-cards.component';
13
- export * from './summary/checkout-item.component';
14
- export * from './summary/checkout-item-quantity.component';
15
- export * from './summary/checkout-items.component';
16
- export * from './summary/checkout-place-order-button.component';
17
- export * from './summary/checkout-presale-expired.component';
18
- export * from './summary/checkout-promo-code.component';
19
- export * from './summary/checkout-tips.component';
20
- export * from './summary/promo-pc-gc.component';
19
+ export * from './checkout-presale-expired.component';
20
+ export * from './checkout-promo-code.component';
21
+ export * from './checkout-send-as-gift.component';
22
+ export * from './checkout-stripe-form.component';
23
+ export * from './checkout-stripe-handler.component';
24
+ export * from './checkout-tips.component';
25
+ export * from './promo-pc-gc.component';
@@ -13,7 +13,6 @@ export declare const giftFormFields: {
13
13
  readonly lastName: "lastName";
14
14
  readonly email: "email";
15
15
  readonly phone: "phone";
16
- readonly birthDate: "birthDate";
17
16
  readonly addressTwo: "addressTwo";
18
17
  readonly message: "message";
19
18
  };
@@ -1,7 +1,7 @@
1
1
  import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
2
2
  import { type FulfillmentType } from '@/enums';
3
3
  import type { IProductSizeAttributes } from '@/interfaces/cloud';
4
- import { type RetailerStatus } from '@/modules/product/utils';
4
+ import type { RetailerStatus } from '@/modules/product/utils/retailer-hours';
5
5
  export declare function renderPopupRetailerCard({ fulfillment, selectedFulfillmentType, isSelected, fulfillmentStatus, selectedSizeAttributes, }: {
6
6
  fulfillment: IProductFulfillmentStore;
7
7
  selectedFulfillmentType: FulfillmentType;
@@ -1,10 +1,3 @@
1
1
  import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
2
2
  import { type FulfillmentType } from '@/enums';
3
- import type { IProductSize, IRetailer } from '@/interfaces/cloud';
4
- export declare const filterRetailersByFulfillmentType: ({ retailers, selectedSize, engravingLines, fulfillmentType, }: {
5
- retailers: IRetailer[];
6
- selectedSize: IProductSize | null;
7
- engravingLines: string[];
8
- fulfillmentType: FulfillmentType;
9
- }) => IRetailer[];
10
3
  export declare function fulfillmentAddress(address: IProductFulfillmentStore['retailerAddress'], selectedFulfillmentType: FulfillmentType): string;
@@ -1,4 +1,4 @@
1
- import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
1
+ import { BaseComponent } from '@/core/base-component.service';
2
2
  export interface IBirthdateValidation {
3
3
  required?: boolean;
4
4
  minYear?: number;
@@ -16,7 +16,6 @@ export interface IBirthdateInputComponentParams {
16
16
  label?: string;
17
17
  name: string;
18
18
  disabled?: boolean;
19
- storePath?: string;
20
19
  }
21
20
  export declare class BirthdateInputComponent extends BaseComponent<IBirthdateInputComponentParams, null> {
22
21
  get hostClasses(): string[];
@@ -24,8 +23,7 @@ export declare class BirthdateInputComponent extends BaseComponent<IBirthdateInp
24
23
  private dayInput;
25
24
  private yearInput;
26
25
  private errorContainer;
27
- constructor();
28
- onStoreWatch(changes: IOnStoreChanged[]): void;
26
+ private validationTimeout;
29
27
  afterRender(): void;
30
28
  private populateInitialValue;
31
29
  private setupEventListeners;
@@ -34,6 +32,8 @@ export declare class BirthdateInputComponent extends BaseComponent<IBirthdateInp
34
32
  private formatYear;
35
33
  private handleNavigation;
36
34
  private handleChange;
35
+ private isFieldsComplete;
36
+ private scheduleValidation;
37
37
  private getFormattedValue;
38
38
  private validateDate;
39
39
  private calculateAge;
@@ -1,4 +1,4 @@
1
- import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
1
+ import { BaseComponent } from '@/core/base-component.service';
2
2
  export interface IInputValidation {
3
3
  required?: boolean;
4
4
  min?: number;
@@ -19,21 +19,21 @@ export interface IInputComponentParams {
19
19
  name: string;
20
20
  autocomplete?: boolean;
21
21
  disabled?: boolean;
22
- storePath?: string;
23
22
  }
24
23
  export declare class InputComponent extends BaseComponent<IInputComponentParams, null> {
25
24
  get hostClasses(): string[];
26
25
  private inputElement;
27
26
  private errorContainer;
28
- constructor();
29
- onStoreChanged(changes: IOnStoreChanged[]): boolean;
27
+ private validationTimeout;
30
28
  private handlePhoneKeydown;
31
29
  private formatPhoneNumber;
32
30
  private formatDate;
33
31
  private validateEmail;
34
32
  private validateTel;
35
33
  private validateDate;
34
+ private isFieldComplete;
36
35
  private validateInput;
36
+ private scheduleValidation;
37
37
  private showErrors;
38
38
  private clearErrors;
39
39
  getValue(): string;
package/docs/ACTIONS.md CHANGED
@@ -24,15 +24,15 @@ const actions = window.elements.actions;
24
24
  // 1. Fire the action (simple, clean)
25
25
  await actions.cart.applyPromoCode('SAVE20');
26
26
 
27
- // 2. Listen for success/failure feedback via events
27
+ // 2. Listen for success/failure feedback via events
28
28
  window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
29
- const { applied, discountAmount, newTotal } = event.detail.data;
29
+ const { discountAmount, newTotal } = event.detail.data;
30
30
  showSuccessMessage(`🎉 Promo applied! You saved $${discountAmount}!`);
31
31
  updateCartDisplay(newTotal);
32
32
  });
33
33
 
34
34
  window.addEventListener('lce:actions.cart_promo_code_failed', function(event) {
35
- const { attempted, error } = event.detail.data;
35
+ const { error } = event.detail.data;
36
36
  showErrorMessage('Promo code could not be applied. Please try again.');
37
37
  });
38
38
  ```
@@ -262,26 +262,26 @@ 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' // { applied: true, discountAmount?: number, newTotal?: number }
266
- 'lce:actions.cart_promo_code_removed' // { applied: false }
267
- 'lce:actions.cart_promo_code_failed' // { attempted: true, error: string }
265
+ 'lce:actions.cart_promo_code_applied' // { discountAmount?: number, newTotal?: number }
266
+ 'lce:actions.cart_promo_code_removed' // { newTotal?: number }
267
+ 'lce:actions.cart_promo_code_failed' // { error: string }
268
268
  ```
269
269
 
270
270
  ### **Checkout Action Events**
271
271
  ```javascript
272
- // Product management
273
- 'lce:actions.checkout_product_add_success' // { itemsAdded: number, identifiers: string[] }
274
- 'lce:actions.checkout_product_add_failed' // { identifiers: string[], error: string }
272
+ // Product management
273
+ 'lce:actions.checkout_product_add_success' // { itemsAdded: number, identifiers: string[], isPresale?: boolean }
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' // { applied: true, discountAmount?: number, newTotal?: number }
278
- 'lce:actions.checkout_promo_code_removed' // { applied: false }
279
- 'lce:actions.checkout_promo_code_failed' // { attempted: true, error: string }
277
+ 'lce:actions.checkout_promo_code_applied' // { discountAmount?: number, newTotal?: number }
278
+ 'lce:actions.checkout_promo_code_removed' // { newTotal?: number }
279
+ 'lce:actions.checkout_promo_code_failed' // { error: string }
280
280
 
281
281
  // Gift card management
282
- 'lce:actions.checkout_gift_card_applied' // { applied: true, newTotal?: number }
283
- 'lce:actions.checkout_gift_card_removed' // { applied: false }
284
- 'lce:actions.checkout_gift_card_failed' // { attempted: true, error: string }
282
+ 'lce:actions.checkout_gift_card_applied' // { newTotal?: number }
283
+ 'lce:actions.checkout_gift_card_removed' // { newTotal?: number }
284
+ 'lce:actions.checkout_gift_card_failed' // { error: string }
285
285
  ```
286
286
 
287
287
  ### **Address Action Events**
@@ -335,14 +335,14 @@ 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 { applied, discountAmount, newTotal } = event.detail.data;
338
+ const { discountAmount, newTotal } = event.detail.data;
339
339
  showSuccessMessage(`Discount applied! Saved: $${discountAmount}`);
340
340
  updatePriceDisplay(newTotal);
341
341
  trackPromoSuccess(discountAmount);
342
342
  };
343
343
 
344
344
  const handlePromoFailure = (event) => {
345
- const { attempted, error } = event.detail.data;
345
+ const { error } = event.detail.data;
346
346
  showErrorMessage('Promo code could not be applied');
347
347
  trackPromoFailure();
348
348
  };
@@ -472,19 +472,19 @@ 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 { applied, discountAmount, newTotal } = event.detail.data;
475
+ const { discountAmount, newTotal } = event.detail.data;
476
476
  showMessage(`Welcome discount applied! You saved $${discountAmount}!`);
477
477
  updateCartDisplay(newTotal);
478
-
478
+
479
479
  // Track successful promo usage
480
480
  analytics.track('Promo Applied', { discount: discountAmount });
481
481
  });
482
482
 
483
483
  // Listen for failure and try fallback
484
484
  window.addEventListener('lce:actions.cart_promo_code_failed', function(event) {
485
- const { attempted, error } = event.detail.data;
485
+ const { error } = event.detail.data;
486
486
  console.log('First promo failed, trying backup promo');
487
-
487
+
488
488
  // Try another strategy
489
489
  actions.cart.applyPromoCode('FIRSTTIME');
490
490
  });
@@ -494,9 +494,9 @@ await actions.cart.removePromoCode();
494
494
 
495
495
  // Listen for removal confirmation
496
496
  window.addEventListener('lce:actions.cart_promo_code_removed', function(event) {
497
- const { applied } = event.detail.data;
497
+ const { newTotal } = event.detail.data;
498
498
  showMessage("Previous promo removed. Applying better discount...");
499
-
499
+
500
500
  // Apply better deal
501
501
  actions.cart.applyPromoCode('BETTER20');
502
502
  });
@@ -624,31 +624,31 @@ 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 { applied, discountAmount, newTotal } = event.detail.data;
627
+ const { discountAmount, newTotal } = event.detail.data;
628
628
  showCheckoutSuccess(`Discount applied! You saved $${discountAmount}`);
629
629
  updateCheckoutTotal(newTotal);
630
-
630
+
631
631
  // Track successful conversion optimization
632
632
  analytics.track('Checkout Discount Applied', { discount: discountAmount });
633
633
  });
634
634
 
635
635
  window.addEventListener('lce:actions.checkout_promo_code_failed', function(event) {
636
- const { attempted, error } = event.detail.data;
636
+ const { error } = event.detail.data;
637
637
  console.log('Promo code failed:', error);
638
-
638
+
639
639
  // Try fallback strategies or notify user
640
640
  showCheckoutError('Discount could not be applied');
641
641
  });
642
642
 
643
643
  // Apply gift card event listeners
644
644
  window.addEventListener('lce:actions.checkout_gift_card_applied', function(event) {
645
- const { applied, newTotal } = event.detail.data;
645
+ const { newTotal } = event.detail.data;
646
646
  showCheckoutSuccess('Gift card applied to your order!');
647
647
  updateCheckoutTotal(newTotal);
648
648
  });
649
649
 
650
650
  window.addEventListener('lce:actions.checkout_gift_card_failed', function(event) {
651
- const { attempted, error } = event.detail.data;
651
+ const { error } = event.detail.data;
652
652
  showCheckoutError('Gift card could not be applied. Please check and try again.');
653
653
  });
654
654