@liquidcommerce/elements-sdk 2.1.1 → 2.2.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/index.esm.js +8558 -7401
  2. package/dist/types/core/base-component.service.d.ts +3 -0
  3. package/dist/types/core/client/client-action.service.d.ts +13 -11
  4. package/dist/types/core/client/client-config.service.d.ts +5 -3
  5. package/dist/types/core/command/common-command.service.d.ts +1 -0
  6. package/dist/types/core/fingerprint.service.d.ts +4 -1
  7. package/dist/types/core/google-tag-manager.service.d.ts +26 -2
  8. package/dist/types/core/logger/logger-factory.d.ts +3 -0
  9. package/dist/types/core/logger/logger.service.d.ts +8 -5
  10. package/dist/types/core/store/interfaces/checkout.interface.d.ts +0 -1
  11. package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
  12. package/dist/types/core/store/store.service.d.ts +3 -0
  13. package/dist/types/core/telemetry/telemetry.interface.d.ts +80 -0
  14. package/dist/types/core/telemetry/telemetry.service.d.ts +26 -0
  15. package/dist/types/interfaces/cloud/retailer.interface.d.ts +1 -0
  16. package/dist/types/interfaces/configs/global.interface.d.ts +11 -0
  17. package/dist/types/interfaces/core.interface.d.ts +2 -7
  18. package/dist/types/modules/address/address.command.d.ts +2 -1
  19. package/dist/types/modules/checkout/checkout.commands.d.ts +1 -1
  20. package/dist/types/modules/checkout/components/information/checkout-delivery-information-form.component.d.ts +1 -1
  21. package/dist/types/modules/checkout/components/summary/checkout-completed.component.d.ts +1 -0
  22. package/dist/types/modules/checkout/components/summary/checkout-place-order-button.component.d.ts +0 -1
  23. package/dist/types/modules/checkout/constant.d.ts +0 -1
  24. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
  25. package/dist/types/modules/product/components/product-price.component.d.ts +1 -0
  26. package/dist/types/modules/product/components/product-retailers.component.d.ts +1 -0
  27. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +6 -3
  28. package/dist/types/static/icon/index.d.ts +0 -1
  29. package/dist/types/utils/format.d.ts +2 -1
  30. package/dist/types/utils/timezone.d.ts +16 -0
  31. package/package.json +4 -4
  32. package/umd/elements.js +1 -1
  33. package/dist/types/static/icon/completed.icon.d.ts +0 -2
@@ -2,6 +2,7 @@ import { ClientConfigService } from '@/core/client/client-config.service';
2
2
  import { LoggerFactory } from '@/core/logger/logger-factory';
3
3
  import { PubSubService } from '@/core/pubsub';
4
4
  import { type StorePaths, StoreService } from '@/core/store';
5
+ import { TelemetryService } from '@/core/telemetry/telemetry.service';
5
6
  import type { ComponentType } from '@/enums';
6
7
  import type { ConfigsKeyType, ConfigsType } from '@/interfaces/configs';
7
8
  import { ThemeProviderService } from '@/modules/theme-provider';
@@ -30,6 +31,7 @@ export declare abstract class BaseComponent<TParams = Record<string, any>, TConf
30
31
  protected readonly pubSub: PubSubService;
31
32
  protected readonly logger: ReturnType<typeof LoggerFactory.get>;
32
33
  protected readonly clientConfig: ClientConfigService;
34
+ protected readonly telemetry: TelemetryService;
33
35
  private initialized;
34
36
  private isDestroyed;
35
37
  private renderScheduled;
@@ -65,6 +67,7 @@ export declare abstract class BaseComponent<TParams = Record<string, any>, TConf
65
67
  private render;
66
68
  private logRenderInfo;
67
69
  protected rerender(context?: string): void;
70
+ private captureComponentError;
68
71
  private updateHostClasses;
69
72
  addHostClasses(...classes: string[]): void;
70
73
  removeHostClasses(...classes: string[]): void;
@@ -9,18 +9,19 @@ export interface IProductActions {
9
9
  export interface IAddressActions {
10
10
  setAddressByPlacesId: (placesId: string) => Promise<void>;
11
11
  setAddressManually: (address: Omit<IAddress, 'id'>, coordinates: ICoords) => Promise<void>;
12
- clear: () => void;
12
+ clear: () => Promise<void>;
13
13
  getDetails: () => IAddressData | null;
14
14
  }
15
+ export interface IAddProductParams {
16
+ identifier: string;
17
+ fulfillmentType: FulfillmentType;
18
+ quantity: number;
19
+ }
15
20
  export interface ICartActions {
16
21
  openCart: () => void;
17
22
  closeCart: () => void;
18
23
  toggleCart: () => void;
19
- addProduct: (params: Array<{
20
- identifier: string;
21
- fulfillmentType: FulfillmentType;
22
- quantity: number;
23
- }>, openCart?: boolean) => Promise<void>;
24
+ addProduct: (params: IAddProductParams[], openCart?: boolean) => Promise<void>;
24
25
  applyPromoCode: (promoCode: string) => Promise<void>;
25
26
  removePromoCode: () => Promise<void>;
26
27
  resetCart: () => Promise<void>;
@@ -30,11 +31,7 @@ export interface ICheckoutActions {
30
31
  openCheckout: () => void;
31
32
  closeCheckout: () => void;
32
33
  toggleCheckout: () => void;
33
- addProduct: (params: Array<{
34
- identifier: string;
35
- fulfillmentType: FulfillmentType;
36
- quantity: number;
37
- }>, openCheckout?: boolean) => Promise<void>;
34
+ addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
38
35
  applyPromoCode: (promoCode: string) => Promise<void>;
39
36
  removePromoCode: () => Promise<void>;
40
37
  applyGiftCard: (code: string) => Promise<void>;
@@ -54,8 +51,13 @@ export declare class ClientActionService {
54
51
  private readonly api;
55
52
  private readonly themeProvider;
56
53
  private readonly logger;
54
+ private pendingCartParams;
55
+ private pendingCartOpenFlag;
57
56
  constructor();
58
57
  static getInstance(): ClientActionService;
58
+ private setupAddressUpdateListener;
59
+ private retryPendingCartOperation;
60
+ private clearPendingCartOperation;
59
61
  private getLocation;
60
62
  private productActions;
61
63
  private addressActions;
@@ -1,5 +1,6 @@
1
1
  import { type ElementsEnv } from '@/enums';
2
- import type { IClientCustomThemeConfig, IElementsProxyConfig, IPromoTicker } from '@/interfaces/core.interface';
2
+ import type { IPromoTicker } from '@/interfaces/configs';
3
+ import type { IClientCustomThemeConfig, IElementsProxyConfig } from '@/interfaces/core.interface';
3
4
  export type DeviceType = 'desktop' | 'tablet' | 'mobile';
4
5
  export interface IClientConfigs {
5
6
  apiKey: string;
@@ -7,6 +8,7 @@ export interface IClientConfigs {
7
8
  isBuilder: boolean;
8
9
  enableDebugging: boolean;
9
10
  baseUrl: string;
11
+ partnerCode?: string;
10
12
  customTheme: IClientCustomThemeConfig | null;
11
13
  proxy: IElementsProxyConfig | null;
12
14
  deviceType: DeviceType;
@@ -14,7 +16,7 @@ export interface IClientConfigs {
14
16
  isLocalStorageAvailable?: boolean;
15
17
  version?: string;
16
18
  clientPrepared: boolean;
17
- promoTicker: IPromoTicker | null;
19
+ promoTicker: IPromoTicker[] | null;
18
20
  }
19
21
  export interface IClientConfigInput {
20
22
  env?: ElementsEnv;
@@ -22,7 +24,7 @@ export interface IClientConfigInput {
22
24
  enableDebugging?: boolean;
23
25
  customTheme?: IClientCustomThemeConfig;
24
26
  proxy?: IElementsProxyConfig;
25
- promoTicker?: IPromoTicker;
27
+ promoTicker?: IPromoTicker[];
26
28
  }
27
29
  export declare class ClientConfigService {
28
30
  private config;
@@ -2,4 +2,5 @@ import { BaseCommand } from './base-command.service';
2
2
  export declare class CommonCommands extends BaseCommand {
3
3
  static getInstance(): CommonCommands;
4
4
  loadCart(): Promise<void>;
5
+ private persistSessionData;
5
6
  }
@@ -4,11 +4,11 @@ interface FingerprintData {
4
4
  canvas: string;
5
5
  browser: string;
6
6
  timezone: string;
7
+ audio: string;
7
8
  }
8
9
  export declare class FingerPrintService {
9
10
  private readonly keyPrefix;
10
11
  private isLocalStorageAvailable;
11
- private fingerprintCache;
12
12
  static getInstance(): FingerPrintService;
13
13
  getId(partnerCode: string): Promise<string>;
14
14
  getFingerprintData(): Promise<FingerprintData>;
@@ -18,10 +18,13 @@ export declare class FingerPrintService {
18
18
  private _findIdByPrefix;
19
19
  private _generateFingerprint;
20
20
  private _getScreen;
21
+ private _getColorGamut;
21
22
  private _getWebGL;
22
23
  private _getCanvas;
23
24
  private _getBrowser;
25
+ private _getBrowserEngine;
24
26
  private _getTimezone;
27
+ private _getAudioFingerprint;
25
28
  private _hash;
26
29
  private _simpleHash;
27
30
  }
@@ -83,10 +83,34 @@ export declare class GoogleTagManagerService {
83
83
  email?: string;
84
84
  birth_date?: string;
85
85
  customer_id?: string;
86
+ }, amounts?: {
87
+ subtotal?: number;
88
+ total_before_discounts?: number;
89
+ discounts?: number;
90
+ gift_cards?: number;
91
+ net_total?: number;
86
92
  }): void;
87
93
  addPaymentInfo(items: BaseItem[], paymentType?: string, coupon?: string): void;
88
- addPaymentInfoWithoutItems(value: number, paymentType?: string, coupon?: string): void;
89
- purchase(purchaseData: PurchaseData): void;
94
+ addPaymentInfoWithoutItems(value: number, paymentType?: string, coupon?: string, amounts?: {
95
+ subtotal?: number;
96
+ total_before_discounts?: number;
97
+ discounts?: number;
98
+ gift_cards?: number;
99
+ net_total?: number;
100
+ }): void;
101
+ purchase(purchaseData: PurchaseData & {
102
+ subtotal?: number;
103
+ total_before_discounts?: number;
104
+ discounts?: number;
105
+ gift_cards?: number;
106
+ net_total?: number;
107
+ }): void;
108
+ promoCodeAttempt(code: string): void;
109
+ promoCodeApplied(code: string, discountAmount?: number): void;
110
+ promoCodeFailed(code: string, reason?: string): void;
111
+ giftCardAttempt(code: string): void;
112
+ giftCardApplied(code: string, appliedAmount?: number): void;
113
+ giftCardFailed(code: string, reason?: string): void;
90
114
  increaseQuantity(item: BaseItem): void;
91
115
  decreaseQuantity(item: BaseItem): void;
92
116
  }
@@ -1,8 +1,11 @@
1
+ import type { TelemetryService } from '@/core/telemetry/telemetry.service';
1
2
  import { LoggerService } from './logger.service';
2
3
  export declare class LoggerFactory {
3
4
  private static instances;
4
5
  private static enableLoggingGlobally;
6
+ private static telemetryService;
5
7
  private static getInstances;
6
8
  static get(context: string): LoggerService;
7
9
  static setEnableLogging(enable: boolean): void;
10
+ static setTelemetryService(telemetry: TelemetryService): void;
8
11
  }
@@ -1,17 +1,20 @@
1
+ import type { TelemetryService } from '@/core/telemetry/telemetry.service';
1
2
  export declare class LoggerService {
2
3
  private readonly prefix;
3
4
  private readonly colors;
4
5
  private readonly context;
5
6
  private enableLogging;
7
+ private telemetryService;
6
8
  private constructor();
7
9
  static getInstance(context: string): LoggerService;
8
10
  setEnableLogging(enable: boolean): void;
11
+ setTelemetryService(telemetry: TelemetryService): void;
9
12
  private getPrefix;
10
- debug(...args: any[]): void;
11
- log(...args: any[]): void;
12
- info(...args: any[]): void;
13
- warn(...args: any[]): void;
14
- error(...args: any[]): void;
13
+ debug(message: string, data?: Record<string, any>): void;
14
+ info(message: string, data?: Record<string, any>): void;
15
+ warn(message: string, data?: Record<string, any>): void;
16
+ error(message: string, error?: Error | Record<string, any>): void;
15
17
  group(label: string, collapsed?: boolean): void;
16
18
  groupEnd(): void;
19
+ private sendToTelemetry;
17
20
  }
@@ -25,7 +25,6 @@ export interface ICheckoutGiftRecipientStore {
25
25
  phone: string;
26
26
  birthDate: string;
27
27
  addressTwo: string | null;
28
- company: string | null;
29
28
  message: string | null;
30
29
  }
31
30
  export interface ICheckoutCustomerStore {
@@ -1,4 +1,4 @@
1
- import type { IAddressStore, ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentStore, ICheckoutStore, IProductSizeStore, IProductStore } from '@/core/store';
1
+ import type { IAddressStore, ICartPromoCodeStore, ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentStore, ICheckoutPromoCodeStore, ICheckoutReadyForSubmitStore, ICheckoutStore, ICheckoutStripeFormStatusStore, IProductSizeStore, IProductStore } from '@/core/store';
2
2
  import type { ComponentType } from '@/enums';
3
3
  import type { ICartItemStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from './cart.interface';
4
4
  export interface IDrawerContentConfig {
@@ -23,7 +23,7 @@ export interface IPersistedStore {
23
23
  p: string;
24
24
  c: string;
25
25
  }
26
- 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 ICartStore['promoCode']}` | `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 ICheckoutStore['giftRecipient']}` | `checkout.giftCards.${string}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.readyForSubmit.${keyof ICheckoutStore['readyForSubmit']}` | `checkout.onDemandFulfillmentTipInfo.${string}` | `checkout.readyForSubmit.${string}` | `checkout.stripeFormStatus.${keyof ICheckoutStore['stripeFormStatus']}`;
26
+ 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}`;
27
27
  interface MiddlewareContext {
28
28
  action: string;
29
29
  payload: any;
@@ -35,7 +35,10 @@ export declare class StoreService {
35
35
  private immutableSet;
36
36
  private notifyListeners;
37
37
  private debouncedSave;
38
+ forceSave(): void;
38
39
  private saveStore;
39
40
  private loadPersistedState;
41
+ private loadFromDBPersistence;
42
+ private addBeforeUnloadHandler;
40
43
  private getAddressDataFromId;
41
44
  }
@@ -0,0 +1,80 @@
1
+ import type { DeviceType } from '@/core/client/client-config.service';
2
+ import type { ComponentType, ElementsEnv } from '@/enums';
3
+ export type TelemetryLevel = 'debug' | 'log' | 'info' | 'warn' | 'error' | 'fatal';
4
+ export interface ITelemetryConfig {
5
+ enabled: boolean;
6
+ endpoint: string;
7
+ batchSize: number;
8
+ batchInterval: number;
9
+ includeDebugLogs: boolean;
10
+ includeWarnings: boolean;
11
+ includeErrors: boolean;
12
+ maxQueueSize: number;
13
+ }
14
+ export interface ITelemetryEventOptions {
15
+ context?: string;
16
+ error?: Error;
17
+ component?: ITelemetryComponentContext;
18
+ data?: Record<string, any>;
19
+ }
20
+ export interface ITelemetryEvent {
21
+ eventId: string;
22
+ timestamp: number;
23
+ level: TelemetryLevel;
24
+ message: string;
25
+ context?: string;
26
+ error?: ITelemetryError;
27
+ component?: ITelemetryComponentContext;
28
+ data?: Record<string, any>;
29
+ metadata: {
30
+ sdk: ITelemetrySDKContext;
31
+ user: ITelemetryUserContext;
32
+ browser: ITelemetryBrowserContext;
33
+ };
34
+ }
35
+ export interface ITelemetryError {
36
+ name: string;
37
+ message: string;
38
+ stack?: string;
39
+ code?: string | number;
40
+ statusCode?: number;
41
+ }
42
+ export interface ITelemetrySDKContext {
43
+ version: string;
44
+ env: ElementsEnv;
45
+ isBuilder: boolean;
46
+ partnerCode?: string;
47
+ }
48
+ export interface ITelemetryComponentContext {
49
+ type: ComponentType;
50
+ tagName: string;
51
+ renderCount?: number;
52
+ renderTrigger?: string;
53
+ renderDuration?: number;
54
+ useShadowDom?: boolean;
55
+ }
56
+ export interface ITelemetryUserContext {
57
+ deviceId: string;
58
+ sessionId?: string;
59
+ isLocalStorageAvailable: boolean;
60
+ }
61
+ export interface ITelemetryBrowserContext {
62
+ userAgent: string;
63
+ deviceType: DeviceType;
64
+ url: string;
65
+ referrer?: string;
66
+ timezone?: string;
67
+ }
68
+ export interface ITelemetryBatchPayload {
69
+ batchId: string;
70
+ timestamp: number;
71
+ events: ITelemetryEvent[];
72
+ }
73
+ export interface ITelemetryStats {
74
+ totalEvents: number;
75
+ eventsByLevel: Record<TelemetryLevel, number>;
76
+ batchesSent: number;
77
+ failedBatches: number;
78
+ queuedEvents: number;
79
+ droppedEvents: number;
80
+ }
@@ -0,0 +1,26 @@
1
+ import type { ITelemetryEventOptions, TelemetryLevel } from './telemetry.interface';
2
+ export declare class TelemetryService {
3
+ private config;
4
+ private eventQueue;
5
+ private batchTimer;
6
+ private readonly clientConfig;
7
+ private stats;
8
+ private isShuttingDown;
9
+ constructor();
10
+ static getInstance(): TelemetryService;
11
+ isEnabled(): boolean;
12
+ captureEvent(level: TelemetryLevel, message: string, options?: ITelemetryEventOptions): void;
13
+ private buildErrorContext;
14
+ private buildSDKContext;
15
+ private buildUserContext;
16
+ private buildBrowserContext;
17
+ private shouldCapture;
18
+ private addToQueue;
19
+ private startBatchTimer;
20
+ private flushQueue;
21
+ private createBatch;
22
+ private sendBatch;
23
+ private truncateStackTrace;
24
+ private handleInternalError;
25
+ private shutdown;
26
+ }
@@ -15,6 +15,7 @@ export type RetailerHours = {
15
15
  export interface IRetailerExpectation {
16
16
  detail: string;
17
17
  short: string;
18
+ engraving: string;
18
19
  }
19
20
  export interface IRetailerFreeDelivery {
20
21
  min: number;
@@ -22,6 +22,16 @@ export interface IGlobalTheme {
22
22
  successColor: string;
23
23
  drawerBackgroundColor: string;
24
24
  }
25
+ export interface IPromoTicker {
26
+ promoCode: string;
27
+ text: string[];
28
+ separator: string;
29
+ activeFrom: string;
30
+ activeUntil: string;
31
+ }
32
+ export interface IExperienceFeatures {
33
+ promoTicker: IPromoTicker[];
34
+ }
25
35
  export interface IGlobalLayout {
26
36
  enablePersonalization: boolean;
27
37
  personalizationText: string;
@@ -34,6 +44,7 @@ export interface IGlobalLayout {
34
44
  export interface IComponentGlobalConfigs {
35
45
  theme: IGlobalTheme;
36
46
  layout: IGlobalLayout;
47
+ experienceFeatures: IExperienceFeatures;
37
48
  }
38
49
  export type UpdateComponentGlobalConfigs = DeepPartial<IComponentGlobalConfigs>;
39
50
  export interface IAllConfigs {
@@ -2,7 +2,7 @@ import type { IAddressActions, ICartActions, ICheckoutActions, IProductActions }
2
2
  import type { IClientConfigs } from '@/core/client/client-config.service';
3
3
  import type { ComponentType, ElementsEnv } from '@/enums';
4
4
  import type { IAddressOptions } from '@/modules/address/address.interface';
5
- import type { UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent } from './configs';
5
+ import type { IPromoTicker, UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent } from './configs';
6
6
  export type DeepPartial<T> = {
7
7
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
8
8
  };
@@ -17,14 +17,9 @@ export interface IClientCustomThemeConfig {
17
17
  cart?: UpdateCartComponent;
18
18
  checkout?: UpdateCheckoutComponent;
19
19
  }
20
- export interface IPromoTicker {
21
- promoCode: string;
22
- text: string[];
23
- separator?: string;
24
- }
25
20
  export interface ILiquidCommerceElementsConfig {
26
21
  env?: ElementsEnv;
27
- promoTicker?: IPromoTicker;
22
+ promoTicker?: IPromoTicker[];
28
23
  customTheme?: IClientCustomThemeConfig;
29
24
  proxy?: IElementsProxyConfig;
30
25
  isBuilder?: boolean;
@@ -10,6 +10,7 @@ export declare class AddressCommands extends BaseCommand {
10
10
  getAddressDetails(addressId: string): Promise<IAddressDetailsResult>;
11
11
  setSelectedAddress(addressData: IAddressData): Promise<void>;
12
12
  setAddressManually(address: Omit<IAddress, 'id'>, coordinates: ICoords): Promise<void>;
13
- clearSelectedAddress(): void;
13
+ clearSelectedAddress(): Promise<void>;
14
+ private persistSessionData;
14
15
  getDetails(): IAddressData | null;
15
16
  }
@@ -22,7 +22,7 @@ export declare class CheckoutCommands extends BaseCommand {
22
22
  applyPromoCode(code: string): Promise<void>;
23
23
  clearPromoCodeError(): Promise<void>;
24
24
  removePromoCode(): Promise<void>;
25
- applyGiftCard(code?: string): Promise<void>;
25
+ applyGiftCard(code: string): Promise<void>;
26
26
  clearGiftCardError(): Promise<void>;
27
27
  removeGiftCard(code: string): Promise<void>;
28
28
  updateCustomerInfo(fieldName: CustomerFieldName, fieldValue: string): void;
@@ -1,8 +1,8 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
3
  export declare class CheckoutDeliveryInformationComponent extends BaseComponent<null, ICheckoutComponent> {
4
- constructor();
5
4
  get hostClasses(): string[];
5
+ constructor();
6
6
  private hasOnDemandFulfillments;
7
7
  private handleDeliveryInstructionsChange;
8
8
  private handleFirstNameChange;
@@ -5,6 +5,7 @@ export interface ICheckoutCompletedComponentParams {
5
5
  orderTotal: number;
6
6
  cardLast4: string;
7
7
  customerEmail: string;
8
+ giftRecipientEmail: string | null;
8
9
  }
9
10
  export declare class CheckoutCompletedComponent extends BaseComponent<ICheckoutCompletedComponentParams, ICheckoutComponent> {
10
11
  get hostClasses(): string[];
@@ -16,7 +16,6 @@ export declare class CheckoutPlaceOrderButtonComponent extends BaseComponent<nul
16
16
  private determineButtonState;
17
17
  private applyButtonState;
18
18
  private handlePlaceOrderClick;
19
- private focusFirstInvalidField;
20
19
  private showPaymentError;
21
20
  private handleCheckoutReadyForSubmit;
22
21
  protected template(): HTMLElement[];
@@ -15,7 +15,6 @@ export declare const giftFormFields: {
15
15
  readonly phone: "phone";
16
16
  readonly birthDate: "birthDate";
17
17
  readonly addressTwo: "addressTwo";
18
- readonly company: "company";
19
18
  readonly message: "message";
20
19
  };
21
20
  export declare const billingFormFields: {
@@ -9,6 +9,7 @@ export declare class ProductAddToCartSectionComponent extends BaseComponent<IAdd
9
9
  private qtyDecreaseButton;
10
10
  private quantityText;
11
11
  get hostClasses(): string[];
12
+ get hostAttributes(): Record<string, string>;
12
13
  constructor();
13
14
  private getProductId;
14
15
  private getAvailableQuantity;
@@ -5,6 +5,7 @@ export interface IProductPriceComponentParams {
5
5
  }
6
6
  export declare class ProductPriceComponent extends BaseComponent<IProductPriceComponentParams, IProductComponent> {
7
7
  get hostClasses(): string[];
8
+ get hostAttributes(): Record<string, string>;
8
9
  constructor();
9
10
  private getProductId;
10
11
  protected template(): string;
@@ -6,6 +6,7 @@ export interface IProductRetailersComponent {
6
6
  export declare class ProductRetailersComponent extends BaseComponent<IProductRetailersComponent, IProductComponent> {
7
7
  get hostClasses(): string[];
8
8
  constructor();
9
+ get hostAttributes(): Record<string, string>;
9
10
  private getProductId;
10
11
  protected template(): HTMLElement | HTMLElement[];
11
12
  }
@@ -1,16 +1,19 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
+ import type { IPromoTicker } from '@/interfaces/configs';
2
3
  export interface IPromoCodeTickerParams {
3
4
  context: 'cart' | 'checkout';
4
- promoCode: string;
5
- text: string[];
6
- separator?: string;
5
+ tickers: IPromoTicker[];
7
6
  }
8
7
  export declare class PromoCodeTickerComponent extends BaseComponent<IPromoCodeTickerParams, null> {
9
8
  get hostClasses(): string[];
10
9
  private applyButton;
11
10
  private promoCodeApplied;
11
+ private currentActiveTicker;
12
12
  beforeSetupStoreWatchers(): void;
13
13
  onStoreWatch(changes: IOnStoreChanged[]): void;
14
+ private isPromoCodeApplied;
15
+ private getActiveTickers;
16
+ private selectCurrentTicker;
14
17
  private generateTextContent;
15
18
  private handlePromoClick;
16
19
  protected template(): HTMLElement[];
@@ -4,7 +4,6 @@ export * from './checkbox.icon';
4
4
  export * from './chevron-down.icon';
5
5
  export * from './chevron-left.icon';
6
6
  export * from './close.icon';
7
- export * from './completed.icon';
8
7
  export * from './error-info.icon';
9
8
  export * from './icon.types';
10
9
  export * from './info.icon';
@@ -16,7 +16,8 @@ export declare function buildFormattedAddressString(address: {
16
16
  zip: string;
17
17
  country?: string;
18
18
  }): string;
19
- export declare function splitCategoryPath(catPath: string): {
19
+ export declare function capitalizeFirstLetter(text: string): string;
20
+ export declare function splitCategoryPath(catPath?: string): {
20
21
  category: string;
21
22
  category2: string;
22
23
  category3: string;
@@ -0,0 +1,16 @@
1
+ export declare function detectUserTimezone(addressState?: string): string;
2
+ export declare function getCurrentTimeInTimezone(timezone: string): Date;
3
+ export declare function getCurrentTimeInUserTimezone(addressState?: string): Date;
4
+ export declare function isDateTimeInRange(options: {
5
+ startDate?: Date | string | null;
6
+ endDate?: Date | string | null;
7
+ addressState?: string;
8
+ }): boolean;
9
+ export declare function filterActiveItems<T extends {
10
+ activeFrom: Date | string;
11
+ activeUntil: Date | string;
12
+ }>(items: T[], addressState?: string): T[];
13
+ export declare function hasActiveItems<T extends {
14
+ activeFrom: Date | string;
15
+ activeUntil: Date | string;
16
+ }>(items: T[], addressState?: string): boolean;
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.1.1",
6
+ "version": "2.2.0-beta.10",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",
@@ -84,16 +84,16 @@
84
84
  "@semantic-release/npm": "^12.0.2",
85
85
  "@semantic-release/release-notes-generator": "^14.1.0",
86
86
  "@types/core-js": "^2.5.8",
87
- "@types/node": "^24.5.2",
87
+ "@types/node": "^24.6.2",
88
88
  "conventional-changelog-cli": "^5.0.0",
89
89
  "husky": "^9.1.7",
90
90
  "process": "^0.11.10",
91
- "rollup": "^4.52.2",
91
+ "rollup": "^4.52.3",
92
92
  "rollup-obfuscator": "^4.1.1",
93
93
  "rollup-plugin-typescript2": "^0.36.0",
94
94
  "semantic-release": "^24.2.9",
95
95
  "ts-node": "^10.9.2",
96
- "typescript": "^5.9.2"
96
+ "typescript": "^5.9.3"
97
97
  },
98
98
  "engines": {
99
99
  "node": ">=20"