@liquidcommerce/elements-sdk 2.4.5 → 2.5.0

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 (63) hide show
  1. package/dist/index.esm.js +11564 -10161
  2. package/dist/types/constants/core.constant.d.ts +32 -0
  3. package/dist/types/constants/index.d.ts +0 -1
  4. package/dist/types/{modules/api-client → core}/api-client.service.d.ts +3 -2
  5. package/dist/types/core/auth.service.d.ts +21 -0
  6. package/dist/types/core/base-component.service.d.ts +4 -3
  7. package/dist/types/core/client/client-action.service.d.ts +4 -2
  8. package/dist/types/core/client/client-config.service.d.ts +1 -0
  9. package/dist/types/core/command/base-command.service.d.ts +5 -3
  10. package/dist/types/core/command/command.service.d.ts +2 -0
  11. package/dist/types/core/google-tag-manager.service.d.ts +1 -2
  12. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +4 -1
  13. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -1
  14. package/dist/types/core/sdk-error-handler.d.ts +1 -0
  15. package/dist/types/core/store/interfaces/core.interface.d.ts +4 -2
  16. package/dist/types/core/store/store.constant.d.ts +5 -1
  17. package/dist/types/core/store/store.service.d.ts +2 -1
  18. package/dist/types/core/utils.d.ts +0 -4
  19. package/dist/types/elements-base-client.d.ts +3 -3
  20. package/dist/types/enums/core.enum.d.ts +10 -0
  21. package/dist/types/enums/index.d.ts +0 -1
  22. package/dist/types/interfaces/cloud/catalog.interface.d.ts +43 -0
  23. package/dist/types/interfaces/cloud/index.d.ts +1 -0
  24. package/dist/types/interfaces/core.interface.d.ts +13 -0
  25. package/dist/types/modules/cart/cart.commands.d.ts +1 -2
  26. package/dist/types/modules/cart/cart.commands.helper.d.ts +3 -2
  27. package/dist/types/modules/checkout/checkout.commands.d.ts +1 -2
  28. package/dist/types/modules/checkout/checkout.commands.helper.d.ts +1 -1
  29. package/dist/types/modules/product/components/components.d.ts +1 -1
  30. package/dist/types/modules/product/components/index.d.ts +1 -2
  31. package/dist/types/modules/product/product.commands.d.ts +2 -3
  32. package/dist/types/modules/product/utils/helpers.d.ts +1 -1
  33. package/dist/types/modules/product/utils/retailer-hours.d.ts +1 -1
  34. package/dist/types/modules/product-list/components/index.d.ts +3 -0
  35. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +7 -0
  36. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -0
  37. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +21 -0
  38. package/dist/types/modules/product-list/product-list.commands.d.ts +15 -0
  39. package/dist/types/modules/product-list/product-list.component.d.ts +76 -0
  40. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +0 -2
  41. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +1 -0
  42. package/dist/types/modules/theme-provider/styles/product-list/product-list.style.d.ts +1 -0
  43. package/dist/types/modules/theme-provider/styles/ui/loading.style.d.ts +1 -0
  44. package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
  45. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +1 -1
  46. package/dist/types/modules/ui-components/ui.commands.d.ts +1 -1
  47. package/package.json +12 -9
  48. package/umd/elements.js +1 -1
  49. package/dist/types/constants/z-index.constant.d.ts +0 -24
  50. package/dist/types/core/pubsub/index.d.ts +0 -2
  51. package/dist/types/core/pubsub/interfaces/index.d.ts +0 -5
  52. package/dist/types/core/store/index.d.ts +0 -2
  53. package/dist/types/core/store/interfaces/index.d.ts +0 -5
  54. package/dist/types/enums/debug.enum.d.ts +0 -6
  55. package/dist/types/modules/address/index.d.ts +0 -4
  56. package/dist/types/modules/api-client/api-client.interface.d.ts +0 -21
  57. package/dist/types/modules/api-client/index.d.ts +0 -2
  58. package/dist/types/modules/cart/index.d.ts +0 -1
  59. package/dist/types/modules/checkout/index.d.ts +0 -1
  60. package/dist/types/modules/product/index.d.ts +0 -1
  61. package/dist/types/modules/theme-provider/index.d.ts +0 -2
  62. package/dist/types/modules/ui-components/loading/index.d.ts +0 -1
  63. /package/dist/types/modules/{ui-components/loading → product/components}/product-loading.component.d.ts +0 -0
@@ -4,3 +4,35 @@ export declare const API_CLIENT_URL: {
4
4
  staging: string;
5
5
  production: string;
6
6
  };
7
+ export declare const PRODUCT_LIST_CARD_VARIANT: {
8
+ STANDARD: string;
9
+ };
10
+ export declare const PRODUCT_LIST_FILTER_TYPES: {
11
+ PERSONALIZATION: string;
12
+ PRE_ORDER: string;
13
+ DELIVERY_OPTIONS: string;
14
+ };
15
+ export declare const Z_INDEX: {
16
+ readonly DRAWER_WRAPPER: 2147483640;
17
+ readonly DRAWER_CONTENT: 5952;
18
+ readonly DRAWER_BACKDROP: 5951;
19
+ readonly ADDRESS_SUGGESTIONS: 5850;
20
+ readonly PRODUCT_DRAWER: 5840;
21
+ readonly CART_LOADING: 5750;
22
+ readonly LOADING_SPINNER: 5740;
23
+ readonly LOADING_INDICATOR: 5730;
24
+ readonly ERROR_MESSAGE: 5650;
25
+ readonly ALERT_BANNER: 5640;
26
+ readonly NOTIFICATION: 5630;
27
+ readonly CAROUSEL_CONTROLS: 5580;
28
+ readonly TOOLTIP: 5570;
29
+ readonly PROGRESS_BAR: 5560;
30
+ readonly CHECKOUT_HEADER: 5920;
31
+ readonly INDEPENDENT_BUTTON: 5910;
32
+ readonly CART_HEADER: 5920;
33
+ readonly TOGGLE_SLIDER: 5150;
34
+ readonly FORM_CONTROLS: 5130;
35
+ readonly ADDRESS_ACTIONS: 5050;
36
+ readonly SKELETON_WAVE: 5040;
37
+ readonly CONTENT_OVERLAY: 5030;
38
+ };
@@ -1,2 +1 @@
1
1
  export * from './core.constant';
2
- export * from './z-index.constant';
@@ -1,6 +1,6 @@
1
1
  import type { AuthService } from '@/core/auth.service';
2
- import type { IPersistedStore } from '@/core/store/interfaces';
3
- import type { IAddressAutocompleteResult, IAddressDetailsResult, ICart, ICartUpdateParams, ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse, ILiquidPaymentToken, ILoc, IProductData } from '@/interfaces/cloud';
2
+ import type { IPersistedStore } from '@/core/store/interfaces/core.interface';
3
+ import type { IAddressAutocompleteResult, IAddressDetailsResult, ICart, ICartUpdateParams, ICatalog, ICatalogParams, ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse, ILiquidPaymentToken, ILoc, IProductData } from '@/interfaces/cloud';
4
4
  import type { IUserPaymentSession, IUserSession } from '@/interfaces/cloud/user.interface';
5
5
  import type { IAllConfigs } from '@/interfaces/configs';
6
6
  export declare class ApiClientService {
@@ -24,6 +24,7 @@ export declare class ApiClientService {
24
24
  getPaymentSession(params: IUserPaymentSession): Promise<IUserSession>;
25
25
  confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ILiquidPaymentToken>;
26
26
  checkoutComplete(params: ICheckoutCompleteParams): Promise<ICheckoutCompleteResponse['order']>;
27
+ catalogSearch(params: ICatalogParams): Promise<ICatalog>;
27
28
  private validResponseData;
28
29
  private ensureClientInitialized;
29
30
  }
@@ -9,6 +9,27 @@ export interface IHttpRequestOptions {
9
9
  body?: any;
10
10
  critical?: boolean;
11
11
  }
12
+ export interface IAuth {
13
+ token: string;
14
+ exp: number;
15
+ type: 'ACCESS_TOKEN';
16
+ }
17
+ export interface IResponseMetadata {
18
+ languages: string[];
19
+ timestamp: number;
20
+ timezone: string;
21
+ requestId: string;
22
+ path: string;
23
+ version: string;
24
+ }
25
+ export interface IApiResponseBase {
26
+ statusCode: number;
27
+ message: string;
28
+ metadata: IResponseMetadata;
29
+ }
30
+ export type IApiResponseWithData<T> = IApiResponseBase & {
31
+ data: T;
32
+ };
12
33
  export declare class AuthService {
13
34
  private readonly apiKey;
14
35
  private readonly baseUrl;
@@ -1,11 +1,12 @@
1
1
  import { ClientConfigService } from '@/core/client/client-config.service';
2
2
  import { LoggerFactory } from '@/core/logger/logger-factory';
3
- import { PubSubService } from '@/core/pubsub';
4
- import { type StorePaths, StoreService } from '@/core/store';
3
+ import { PubSubService } from '@/core/pubsub/pubsub.service';
4
+ import type { StorePaths } from '@/core/store/interfaces/core.interface';
5
+ import { StoreService } from '@/core/store/store.service';
5
6
  import { TelemetryService } from '@/core/telemetry/telemetry.service';
6
7
  import type { ComponentType } from '@/enums';
7
8
  import type { ConfigsKeyType, ConfigsType } from '@/interfaces/configs';
8
- import { ThemeProviderService } from '@/modules/theme-provider';
9
+ import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
9
10
  import { CommandService } from './command/command.service';
10
11
  export interface IBaseComponentConfig {
11
12
  type: ComponentType;
@@ -1,7 +1,9 @@
1
- import type { IBaseCartEventData, IBaseProductEventData, ICheckoutDetailsEventData } from '@/core/pubsub';
1
+ import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
2
+ import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
3
+ import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
2
4
  import { type FulfillmentType } from '@/enums';
3
5
  import type { IAddress, ICoords } from '@/interfaces/cloud';
4
- import type { IAddressData } from '@/modules/address';
6
+ import type { IAddressData } from '@/modules/address/address.interface';
5
7
  import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
6
8
  export interface IProductActions {
7
9
  getDetails: (identifier: string) => IBaseProductEventData;
@@ -9,6 +9,7 @@ export interface IClientConfigs {
9
9
  debugMode: DebugMode;
10
10
  baseUrl: string;
11
11
  partnerCode?: string;
12
+ partnerName?: string;
12
13
  customTheme: IClientCustomThemeConfig | null;
13
14
  proxy: IElementsProxyConfig | null;
14
15
  deviceType: DeviceType;
@@ -1,10 +1,11 @@
1
+ import { ApiClientService } from '@/core/api-client.service';
1
2
  import { ClientConfigService } from '@/core/client/client-config.service';
2
3
  import { GoogleTagManagerService } from '@/core/google-tag-manager.service';
3
4
  import { LoggerFactory } from '@/core/logger/logger-factory';
4
- import { PubSubService } from '@/core/pubsub';
5
- import { StoreService } from '@/core/store';
5
+ import { PubSubService } from '@/core/pubsub/pubsub.service';
6
+ import { StoreService } from '@/core/store/store.service';
6
7
  import type { ILoc } from '@/interfaces/cloud';
7
- import { ApiClientService } from '@/modules/api-client/api-client.service';
8
+ import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
8
9
  export declare abstract class BaseCommand {
9
10
  protected store: StoreService;
10
11
  protected api: ApiClientService;
@@ -12,6 +13,7 @@ export declare abstract class BaseCommand {
12
13
  protected pubSub: PubSubService;
13
14
  protected googleTagManager: GoogleTagManagerService;
14
15
  protected clientConfig: ClientConfigService;
16
+ protected themeProvider: ThemeProviderService;
15
17
  constructor();
16
18
  protected getLocation(): ILoc | undefined;
17
19
  }
@@ -2,12 +2,14 @@ import { AddressCommands } from '@/modules/address/address.command';
2
2
  import { CartCommands } from '@/modules/cart/cart.commands';
3
3
  import { CheckoutCommands } from '@/modules/checkout/checkout.commands';
4
4
  import { ProductCommands } from '@/modules/product/product.commands';
5
+ import { ProductListCommands } from '@/modules/product-list/product-list.commands';
5
6
  import { UICommands } from '@/modules/ui-components/ui.commands';
6
7
  import { CommonCommands } from './common-command.service';
7
8
  export declare class CommandService {
8
9
  readonly ui: UICommands;
9
10
  readonly address: AddressCommands;
10
11
  readonly product: ProductCommands;
12
+ readonly productList: ProductListCommands;
11
13
  readonly cart: CartCommands;
12
14
  readonly checkout: CheckoutCommands;
13
15
  readonly common: CommonCommands;
@@ -63,6 +63,7 @@ export declare class GoogleTagManagerService {
63
63
  private waitForDOMReady;
64
64
  private isGTMAlreadyLoaded;
65
65
  private isContainerLoaded;
66
+ private isContainerInitialized;
66
67
  private initializeGtag;
67
68
  private loadGTMScript;
68
69
  private processEventQueue;
@@ -112,8 +113,6 @@ export declare class GoogleTagManagerService {
112
113
  giftCardAttempt(code: string): void;
113
114
  giftCardApplied(code: string, appliedAmount?: number): void;
114
115
  giftCardFailed(code: string, reason?: string): void;
115
- increaseQuantity(item: BaseItem): void;
116
- decreaseQuantity(item: BaseItem): void;
117
116
  addressUpdated(addressData: {
118
117
  googlePlacesId: string;
119
118
  formattedAddress: string;
@@ -1,4 +1,7 @@
1
- import type { IAddressActionEventData, ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartUpdatedEventData, ICheckoutFailedEventData, ICheckoutFormUpdatedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData, IElementsClientIsReadyEventData, IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub';
1
+ import type { IAddressActionEventData } from '@/core/pubsub/interfaces/address.interface';
2
+ import type { ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartUpdatedEventData } from '@/core/pubsub/interfaces/cart.interface';
3
+ import type { ICheckoutFailedEventData, ICheckoutFormUpdatedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData } from '@/core/pubsub/interfaces/checkout.interface';
4
+ import type { IElementsClientIsReadyEventData, IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub/interfaces/product.interface';
2
5
  import { ELEMENTS_ACTIONS_EVENT } from '@/enums';
3
6
  export interface IEventMetadata {
4
7
  eventId: string;
@@ -1,4 +1,4 @@
1
- import type { IElementsActionsEventsMap, IElementsFormsEventsMap, SpecificActionEvent, SpecificFormEvent } from '@/core/pubsub/interfaces';
1
+ import type { IElementsActionsEventsMap, IElementsFormsEventsMap, SpecificActionEvent, SpecificFormEvent } from '@/core/pubsub/interfaces/core.interface';
2
2
  export declare class PubSubService {
3
3
  private readonly logger;
4
4
  private clientReadyEvent;
@@ -0,0 +1 @@
1
+ export declare function isSDKError(error: Error | any, source?: string | null): boolean;
@@ -1,6 +1,8 @@
1
- import type { IAddressStore, ICartPromoCodeStore, ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentStore, ICheckoutPromoCodeStore, ICheckoutReadyForSubmitStore, ICheckoutStore, ICheckoutStripeFormStatusStore, IProductSizeStore, IProductStore } from '@/core/store';
1
+ import type { IAddressStore } from '@/core/store/interfaces/address.interface';
2
+ import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentStore, ICheckoutPromoCodeStore, ICheckoutReadyForSubmitStore, ICheckoutStore, ICheckoutStripeFormStatusStore } from '@/core/store/interfaces/checkout.interface';
3
+ import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
2
4
  import type { ComponentType } from '@/enums';
3
- import type { ICartItemStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from './cart.interface';
5
+ import type { ICartItemStore, ICartPromoCodeStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from './cart.interface';
4
6
  export interface IDrawerContentConfig {
5
7
  type: ComponentType;
6
8
  data?: Record<string, any>;
@@ -1,4 +1,8 @@
1
- import type { IAddressStore, ICartStore, ICheckoutStore, IGlobalStore, IProductStore, IUIStore } from '@/core/store/interfaces';
1
+ import type { IAddressStore } from '@/core/store/interfaces/address.interface';
2
+ import type { ICartStore } from '@/core/store/interfaces/cart.interface';
3
+ import type { ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
4
+ import type { IGlobalStore, IUIStore } from '@/core/store/interfaces/core.interface';
5
+ import type { IProductStore } from '@/core/store/interfaces/product.interface';
2
6
  export declare const LOCAL_STORAGE_PREFIX = "liquid_elements";
3
7
  export declare const initialProductState: IProductStore;
4
8
  export declare const initialCartState: ICartStore;
@@ -1,5 +1,6 @@
1
1
  import type { IOnStoreChanged } from '@/core/base-component.service';
2
- import type { IGlobalStore, IPersistedStore, IProductStore, StorePaths } from '@/core/store/interfaces';
2
+ import type { IGlobalStore, IPersistedStore, StorePaths } from '@/core/store/interfaces/core.interface';
3
+ import type { IProductStore } from '@/core/store/interfaces/product.interface';
3
4
  export declare class StoreService {
4
5
  private state;
5
6
  private listeners;
@@ -21,7 +21,3 @@ export interface ICustomResponse {
21
21
  export declare function fetchAdapter(fetchFunc: FetchFunction): HttpClient;
22
22
  export declare const xhrFetch: HttpClient;
23
23
  export declare function getFetchImplementation(): HttpClient;
24
- export declare function objectValues<T>(obj: Record<string, T>): T[];
25
- export declare function objectEntries<T>(obj: Record<string, T>): Array<[string, T]>;
26
- export declare function arrayFind<T>(array: T[], predicate: (item: T, index: number, array: T[]) => boolean): T | undefined;
27
- export declare function arrayFindIndex<T>(array: T[], predicate: (item: T, index: number, array: T[]) => boolean): number;
@@ -1,3 +1,4 @@
1
+ import { ApiClientService } from '@/core/api-client.service';
1
2
  import { AuthService } from '@/core/auth.service';
2
3
  import { ClientActionService } from '@/core/client/client-action.service';
3
4
  import { ClientConfigService, type IClientConfigs } from '@/core/client/client-config.service';
@@ -6,12 +7,11 @@ import { DebugPanelService } from '@/core/debug-panel/debug-panel.service';
6
7
  import { FingerPrintService } from '@/core/fingerprint.service';
7
8
  import { GoogleTagManagerService } from '@/core/google-tag-manager.service';
8
9
  import { LoggerFactory } from '@/core/logger/logger-factory';
9
- import { StoreService } from '@/core/store';
10
+ import { StoreService } from '@/core/store/store.service';
10
11
  import { TelemetryService } from '@/core/telemetry/telemetry.service';
11
12
  import { type ComponentType } from '@/enums';
12
13
  import type { IInjectedComponent, ILiquidCommerceElementsActions, IProcessInjectElementParams } from '@/interfaces/core.interface';
13
- import { ApiClientService } from '@/modules/api-client';
14
- import { ThemeProviderService } from '@/modules/theme-provider';
14
+ import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
15
15
  export declare abstract class ElementsBaseClient {
16
16
  protected readonly authService: AuthService;
17
17
  protected readonly clientConfig: ClientConfigService;
@@ -93,6 +93,10 @@ export declare const COMPONENT_TYPE: {
93
93
  readonly PRODUCT_ADD_TO_CART_SECTION: "product-add-to-cart-section";
94
94
  readonly PRODUCT_DRAWER: "product-drawer";
95
95
  readonly PRODUCT_LOADING: "product-loading";
96
+ readonly PRODUCT_LIST: "product-list";
97
+ readonly PRODUCT_LIST_CARD: "product-list-card";
98
+ readonly PRODUCT_LIST_FILTERS: "product-list-filters";
99
+ readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
96
100
  readonly CART: "cart";
97
101
  readonly CART_RETAILER: "cart-retailer";
98
102
  readonly CART_ITEM: "cart-item";
@@ -131,3 +135,9 @@ export declare const FULFILLMENT_TYPE: {
131
135
  readonly SHIPPING: "shipping";
132
136
  };
133
137
  export type FulfillmentType = (typeof FULFILLMENT_TYPE)[keyof typeof FULFILLMENT_TYPE];
138
+ export declare const DEBUG_MODE: {
139
+ readonly NONE: "none";
140
+ readonly CONSOLE: "console";
141
+ readonly PANEL: "panel";
142
+ };
143
+ export type DebugMode = (typeof DEBUG_MODE)[keyof typeof DEBUG_MODE];
@@ -1,3 +1,2 @@
1
1
  export * from './cloud.enum';
2
2
  export * from './core.enum';
3
- export * from './debug.enum';
@@ -0,0 +1,43 @@
1
+ import type { IProduct } from '@/interfaces/cloud/product.interface';
2
+ import type { ILocBase } from './address.interface';
3
+ import type { IRetailer } from './retailer.interface';
4
+ export declare enum ENUM_NAVIGATION_ORDER_DIRECTION_TYPE {
5
+ ASC = "asc",
6
+ DESC = "desc"
7
+ }
8
+ export declare enum ENUM_ORDER_BY {
9
+ PRICE = "price"
10
+ }
11
+ export interface ICatalogParams extends ILocBase {
12
+ search?: string;
13
+ pageToken?: string;
14
+ entity?: string;
15
+ page?: number;
16
+ perPage?: number;
17
+ visitorId?: string;
18
+ retailers?: string[];
19
+ orderBy?: ENUM_ORDER_BY;
20
+ orderDirection?: ENUM_NAVIGATION_ORDER_DIRECTION_TYPE;
21
+ filters?: Array<Record<any, any>>;
22
+ }
23
+ export interface ICatalog {
24
+ retailers?: IRetailer[];
25
+ products?: IProduct[];
26
+ navigation?: INavigationSchema;
27
+ }
28
+ export interface ICursorSchema {
29
+ nextPageToken: string;
30
+ previousPageToken: string;
31
+ }
32
+ export interface INavigationSchema {
33
+ id: string;
34
+ correctedQuery: string;
35
+ attributionToken: string;
36
+ currentPage: number;
37
+ totalPages: number;
38
+ totalCount: number;
39
+ availableOrderBy: ENUM_ORDER_BY[];
40
+ availableOrderDirection: ENUM_NAVIGATION_ORDER_DIRECTION_TYPE[];
41
+ cursor: ICursorSchema;
42
+ filters: any[];
43
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './address.interface';
2
2
  export * from './cart.interface';
3
+ export * from './catalog.interface';
3
4
  export * from './checkout.interface';
4
5
  export * from './core.interface';
5
6
  export * from './product.interface';
@@ -1,3 +1,4 @@
1
+ import type { PRODUCT_LIST_CARD_VARIANT, PRODUCT_LIST_FILTER_TYPES } from '@/constants';
1
2
  import type { IAddressActions, ICartActions, ICheckoutActions, IProductActions } from '@/core/client/client-action.service';
2
3
  import type { IClientConfigs } from '@/core/client/client-config.service';
3
4
  import type { ComponentType, DebugMode, ElementsEnv } from '@/enums';
@@ -34,6 +35,17 @@ export interface IInjectProductElement {
34
35
  containerId: string;
35
36
  identifier: string;
36
37
  }
38
+ export type ProductListCardVariantType = (typeof PRODUCT_LIST_CARD_VARIANT)[keyof typeof PRODUCT_LIST_CARD_VARIANT];
39
+ export type ProductListFilterType = (typeof PRODUCT_LIST_FILTER_TYPES)[keyof typeof PRODUCT_LIST_FILTER_TYPES];
40
+ export interface IInjectProductListParams {
41
+ containerId: string;
42
+ rows?: number;
43
+ columns?: number;
44
+ cardVariant?: ProductListCardVariantType;
45
+ fillCard?: boolean;
46
+ filters?: ProductListFilterType[];
47
+ productUrl?: string;
48
+ }
37
49
  export interface IBuilderInjectElementParams {
38
50
  type: ComponentType;
39
51
  containerId: string;
@@ -83,6 +95,7 @@ export interface ILiquidCommerceElementsClient {
83
95
  injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
84
96
  injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
85
97
  injectCheckoutElement(containerId: string): Promise<IInjectedComponent | null>;
98
+ injectProductList(params: IInjectProductListParams): Promise<void>;
86
99
  ui: ILiquidCommerceElementsUIMethod;
87
100
  actions: ILiquidCommerceElementsActions;
88
101
  getInjectedComponents(): Map<string, IInjectedComponent>;
@@ -1,5 +1,5 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { IBaseCartEventData } from '@/core/pubsub';
2
+ import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
3
3
  export interface AddItemParams {
4
4
  upc: string;
5
5
  fulfillmentId: string;
@@ -11,7 +11,6 @@ export interface AddItemParams {
11
11
  export declare class CartCommands extends BaseCommand {
12
12
  private readonly uiCommands;
13
13
  private readonly checkoutCommands;
14
- private readonly pubSubService;
15
14
  private readonly commonCommands;
16
15
  constructor();
17
16
  static getInstance(): CartCommands;
@@ -1,5 +1,6 @@
1
- import type { IBaseCartEventData } from '@/core/pubsub';
2
- import type { IAddressStore, ICartItemStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from '@/core/store';
1
+ import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
2
+ import type { IAddressStore } from '@/core/store/interfaces/address.interface';
3
+ import type { ICartItemStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from '@/core/store/interfaces/cart.interface';
3
4
  import type { ICart, ICartItem, ICartRetailer, IRetailerFulfillments } from '@/interfaces/cloud';
4
5
  export declare function buildCartItemStore(apiItem: ICartItem): ICartItemStore;
5
6
  export declare function buildCartTotals(cart: ICart): ICartTotalsStore;
@@ -1,11 +1,10 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { ICheckoutItemStore, ICheckoutStripeFormStatusStore } from '@/core/store';
2
+ import type { ICheckoutItemStore, ICheckoutStripeFormStatusStore } from '@/core/store/interfaces/checkout.interface';
3
3
  import type { ICart, ICheckoutFulfillment, ICheckoutItem, ICheckoutPrepareResponse, ICheckoutRetailer } from '@/interfaces/cloud';
4
4
  import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
5
5
  export declare function buildCheckoutItemStore(apiItem: ICheckoutItem, retailer: ICheckoutRetailer, fulfillment: ICheckoutFulfillment): ICheckoutItemStore;
6
6
  export declare class CheckoutCommands extends BaseCommand {
7
7
  private readonly uiCommands;
8
- private readonly themeProvider;
9
8
  private readonly commonCommands;
10
9
  constructor();
11
10
  static getInstance(): CheckoutCommands;
@@ -1,4 +1,4 @@
1
- import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore } from '@/core/store';
1
+ import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore } from '@/core/store/interfaces/checkout.interface';
2
2
  export declare function validateCustomerInfo(customer: ICheckoutCustomerStore): {
3
3
  isValid: boolean;
4
4
  invalidFields: string[];
@@ -1,4 +1,4 @@
1
- import type { IProductFulfillmentStore } from '@/core/store';
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
4
  import { type RetailerStatus } from '@/modules/product/utils';
@@ -1,11 +1,10 @@
1
- export * from '../../ui-components/engraving/engraving-form.component';
2
- export * from '../../ui-components/engraving/engraving-view.component';
3
1
  export * from './components';
4
2
  export * from './product-add-to-cart-section.component';
5
3
  export * from './product-description.component';
6
4
  export * from './product-drawer.component';
7
5
  export * from './product-image-carousel.component';
8
6
  export * from './product-interactions.component';
7
+ export * from './product-loading.component';
9
8
  export * from './product-options.component';
10
9
  export * from './product-price.component';
11
10
  export * from './product-retailers.component';
@@ -1,11 +1,10 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { IBaseProductEventData } from '@/core/pubsub';
3
- import type { IProductDrawerContentConfig } from '@/core/store';
2
+ import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
3
+ import type { IProductDrawerContentConfig } from '@/core/store/interfaces/product.interface';
4
4
  import { type FulfillmentType } from '@/enums';
5
5
  import type { IProductData } from '@/interfaces/cloud';
6
6
  import { type AddItemParams } from '@/modules/cart/cart.commands';
7
7
  export declare class ProductCommands extends BaseCommand {
8
- private readonly themeProvider;
9
8
  private readonly uiCommands;
10
9
  private readonly cartCommands;
11
10
  constructor();
@@ -1,4 +1,4 @@
1
- import type { IProductFulfillmentStore } from '@/core/store';
1
+ import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
2
2
  import { type FulfillmentType } from '@/enums';
3
3
  import type { IProductSize, IRetailer } from '@/interfaces/cloud';
4
4
  export declare const filterRetailersByFulfillmentType: ({ retailers, selectedSize, engravingLines, fulfillmentType, }: {
@@ -1,4 +1,4 @@
1
- import type { IProductFulfillmentStore } from '@/core/store';
1
+ import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
2
2
  export interface RetailerStatus {
3
3
  message: string | null;
4
4
  isOpen: boolean;
@@ -0,0 +1,3 @@
1
+ export * from './product-list-card.component';
2
+ export * from './product-list-card-loading.component';
3
+ export * from './product-list-filters.component';
@@ -0,0 +1,7 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { IProductListComponentParams } from '@/modules/product-list/product-list.component';
3
+ export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams> {
4
+ get hostClasses(): string[];
5
+ private createSkeletonCard;
6
+ protected template(): HTMLElement[];
7
+ }
@@ -0,0 +1,36 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { IProduct, IRetailerFulfillments } from '@/interfaces/cloud';
3
+ import type { ProductListCardVariantType } from '@/interfaces/core.interface';
4
+ export interface IProductListCardParams {
5
+ variant: ProductListCardVariantType;
6
+ fillCard: boolean;
7
+ product: IProduct;
8
+ fulfillments: IRetailerFulfillments[];
9
+ productUrl?: string;
10
+ }
11
+ export interface IProductAvailabilityData {
12
+ hasAvailability: boolean;
13
+ upc: string;
14
+ fulfillmentId: string;
15
+ partNumber: string;
16
+ quantity: number;
17
+ state: string;
18
+ isPresale: boolean;
19
+ isPresaleActive: boolean;
20
+ }
21
+ export interface IProductVariantParams {
22
+ image: string;
23
+ name: string;
24
+ size: string | null;
25
+ price: number;
26
+ availability: IProductAvailabilityData;
27
+ }
28
+ export declare class ProductListCardComponent extends BaseComponent<IProductListCardParams> {
29
+ get hostClasses(): string[];
30
+ private getAvailabilityData;
31
+ private isPresaleActive;
32
+ private handleAddToCart;
33
+ protected template(): HTMLElement[];
34
+ private generateProductUrl;
35
+ private createVariantStandard;
36
+ }
@@ -0,0 +1,21 @@
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ export interface IProductListFiltersParams {
3
+ enablePersonalized: boolean;
4
+ enablePreOrder: boolean;
5
+ enableDeliveryOptions: boolean;
6
+ onPersonalizedChange?: (enabled: boolean) => void;
7
+ onPreOrderChange?: (enabled: boolean) => void;
8
+ onDeliveryOptionsChange?: (value: 'all' | 'shipping' | 'onDemand') => void;
9
+ currentFilters?: {
10
+ personalized: boolean;
11
+ preOrder: boolean;
12
+ deliveryOptions: 'all' | 'shipping' | 'onDemand';
13
+ };
14
+ }
15
+ export declare class ProductListFiltersComponent extends BaseComponent<IProductListFiltersParams> {
16
+ get hostClasses(): string[];
17
+ private isSameDayDeliveryDisabled;
18
+ private isPersonalizationDisabled;
19
+ private isPreOrderDisabled;
20
+ protected template(): HTMLElement[];
21
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '@/core/command/base-command.service';
2
+ import type { ICatalog, ICatalogParams, IProduct } from '@/interfaces/cloud';
3
+ import { type AddItemParams } from '@/modules/cart/cart.commands';
4
+ export declare class ProductListCommands extends BaseCommand {
5
+ private readonly uiCommands;
6
+ private readonly cartCommands;
7
+ constructor();
8
+ static getInstance(): ProductListCommands;
9
+ getProductList(params: ICatalogParams): Promise<ICatalog>;
10
+ addToCart(params: AddItemParams): Promise<void>;
11
+ addPresaleToCart(params: AddItemParams): Promise<void>;
12
+ trackViewItemList(products: IProduct[]): void;
13
+ trackSelectItem(product: IProduct): void;
14
+ private convertProductToBaseItem;
15
+ }