@liquidcommerce/elements-sdk 2.7.6 → 2.7.8

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 (37) hide show
  1. package/dist/index.checkout.esm.js +7459 -6841
  2. package/dist/index.esm.js +22723 -22468
  3. package/dist/types/auto-initialize/shared-utils.d.ts +19 -2
  4. package/dist/types/clients/checkout.d.ts +1 -0
  5. package/dist/types/clients/helpers.d.ts +1 -0
  6. package/dist/types/core/api/api-client.service.d.ts +3 -1
  7. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +6 -0
  8. package/dist/types/core/client/actions/client-product-action.service.d.ts +3 -0
  9. package/dist/types/core/client/client-config.service.d.ts +5 -0
  10. package/dist/types/core/store/interfaces/product-list.interface.d.ts +2 -1
  11. package/dist/types/index.d.ts +2 -0
  12. package/dist/types/interfaces/api/checkout.interface.d.ts +22 -1
  13. package/dist/types/interfaces/api/index.d.ts +5 -0
  14. package/dist/types/interfaces/api/product-list.interface.d.ts +1 -1
  15. package/dist/types/interfaces/api/product.interface.d.ts +7 -1
  16. package/dist/types/interfaces/config.interface.d.ts +5 -10
  17. package/dist/types/interfaces/configs/product-list.interface.d.ts +6 -1
  18. package/dist/types/modules/checkout/checkout.commands.d.ts +2 -1
  19. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +1 -1
  20. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +1 -1
  21. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +1 -1
  22. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +1 -1
  23. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +2 -2
  24. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +1 -1
  25. package/dist/types/modules/product-list/components/index.d.ts +1 -1
  26. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +1 -1
  27. package/dist/types/modules/product-list/{product-list-card.component.d.ts → components/product-list-card.component.d.ts} +1 -1
  28. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +3 -3
  29. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +4 -5
  30. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +2 -2
  31. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +2 -2
  32. package/dist/types/modules/product-list/product-list.commands.d.ts +3 -2
  33. package/dist/types/modules/product-list/product-list.component.d.ts +2 -1
  34. package/dist/types/modules/product-list/product-list.interface.d.ts +9 -0
  35. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +0 -1
  36. package/docs/v1/guides/product-list-component.md +10 -10
  37. package/package.json +6 -6
@@ -1,12 +1,22 @@
1
+ import type { IAddProductParams } from '@/core/client/actions/client-cart-action.service';
2
+ import type { IAnonymousCheckoutAddProductItem } from '@/interfaces/api/checkout.interface';
1
3
  import type { IInjectedComponent } from '@/interfaces/component.interface';
2
- import type { ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/config.interface';
4
+ import type { IClientCustomThemeConfig, ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/config.interface';
3
5
  import type { IInjectCheckoutParams } from '@/interfaces/injection.interface';
6
+ export interface IQueryParamActions {
7
+ addProduct: (params: IAddProductParams[], open?: boolean) => Promise<void>;
8
+ applyPromoCode: (promoCode: string) => Promise<void>;
9
+ }
4
10
  export declare const SHARED_ATTR: {
5
11
  readonly SCRIPT: {
6
12
  readonly MAIN: "data-liquid-commerce-elements";
7
13
  readonly TOKEN: "data-token";
8
14
  readonly ENV: "data-env";
9
15
  readonly DEBUG_MODE: "data-debug-mode";
16
+ readonly PRODUCT_PARAM: "data-product-param";
17
+ readonly PRODUCT_FULFILLMENT_TYPE_PARAM: "data-product-fulfillment-type-param";
18
+ readonly PRODUCT_QUANTITY_PARAM: "data-product-quantity-param";
19
+ readonly PROMO_CODE_PARAM: "data-promo-code-param";
10
20
  readonly CHECKOUT_PARAM: "data-checkout-param";
11
21
  readonly CHECKOUT_URL: "data-checkout-url";
12
22
  };
@@ -17,13 +27,20 @@ export declare const SHARED_ATTR: {
17
27
  };
18
28
  readonly JSON_SCRIPT: {
19
29
  readonly DEVELOPMENT: "data-liquid-commerce-elements-development";
30
+ readonly CUSTOM_THEME: "data-liquid-commerce-elements-custom-theme";
20
31
  };
21
32
  };
22
33
  export declare function startsWithLcePrefix(value: string | null): boolean;
23
34
  export declare function getDevelopmentConfigs(): ILiquidCommerceElementsDevelopmentConfig | undefined;
35
+ export declare function getCustomThemeConfig(): IClientCustomThemeConfig | undefined;
24
36
  export declare function triggerAutoInit(initFunction: () => Promise<void>, errorPrefix: string): void;
25
37
  export declare function setupCheckout(script: HTMLScriptElement, injectFn: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>, exitCheckoutFn: () => void, options: {
26
- requireCheckoutId?: boolean;
27
38
  errorPrefix: string;
28
39
  }): Promise<void>;
29
40
  export declare function setupExitCheckoutHandlers(exitCheckoutFn: () => void): void;
41
+ export declare function addProductViaQueryParam(actions: IQueryParamActions, script: HTMLScriptElement, errorPrefix: string): Promise<void>;
42
+ export declare function extractAnonymousProductFromQueryParams(script: HTMLScriptElement, errorPrefix: string): {
43
+ item: IAnonymousCheckoutAddProductItem;
44
+ promoCode?: string;
45
+ } | null;
46
+ export declare function applyPromoCodeViaQueryParam(actions: IQueryParamActions, script: HTMLScriptElement, errorPrefix: string): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import type { IElementsCheckoutClient } from '@/interfaces/client.interface';
2
2
  import type { ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/config.interface';
3
3
  import '@/modules/theme-provider/styles/register-styles';
4
+ import '@/modules/address/styles/register-styles';
4
5
  import '@/modules/checkout/styles/register-styles';
5
6
  export declare function ElementsCheckout(apiKey: string, config: ILiquidCommerceElementsCheckoutClientConfig): Promise<IElementsCheckoutClient | null>;
@@ -1,4 +1,5 @@
1
1
  import { type ComponentType } from '@/enums';
2
+ export declare function normalizeProductListLists<T extends Record<string, any>>(data: T): T;
2
3
  export declare function deepMergeConfigs<T extends Record<string, any>>(target: T, source: Partial<T>, currentPath?: string): T;
3
4
  export declare const layoutFieldToComponentTypes: Map<string, ComponentType[]>;
4
5
  export declare function getComponentTypesForLayoutFields(parentPath: string, layoutFields: Record<string, any>): ComponentType[];
@@ -3,7 +3,7 @@ import type { AuthClientService } from '@/core/api/auth-client.service';
3
3
  import type { IPersistedStore, IPersistedStoreAction } from '@/core/store/interfaces/core.interface';
4
4
  import type { IAddressAutocompleteResult, IAddressDetailsResult, ILocation } from '@/interfaces/api/address.interface';
5
5
  import type { ICart, ICartUpdateParams } from '@/interfaces/api/cart.interface';
6
- import type { ICheckoutComplete, ICheckoutItemsUpdateParams, ICheckoutItemsUpdateResponse, ICheckoutPaymentConfirm, ICheckoutPaymentConfirmParams, ICheckoutPaymentSession, ICheckoutPrepare, ICheckoutPrepareParams } from '@/interfaces/api/checkout.interface';
6
+ import type { IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse, ICheckoutComplete, ICheckoutItemsUpdateParams, ICheckoutItemsUpdateResponse, ICheckoutPaymentConfirm, ICheckoutPaymentConfirmParams, ICheckoutPaymentSession, ICheckoutPrepare, ICheckoutPrepareParams } from '@/interfaces/api/checkout.interface';
7
7
  import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
8
8
  import type { IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
9
9
  export declare class ApiClientService {
@@ -19,11 +19,13 @@ export declare class ApiClientService {
19
19
  getAddressDetails(id: string): Promise<ApiResult<IAddressDetailsResult>>;
20
20
  getProductsData(identifier: string[], location?: ILocation): Promise<ApiResult<IProductAvailabilityResponse>>;
21
21
  productListSearch(params: IProductSearchParams): Promise<ApiResult<IProductSearchResponse>>;
22
+ getProductAvailabilityByState(identifiers: string[], state?: string): Promise<ApiResult<IProductAvailabilityResponse>>;
22
23
  getCartData(id: string | null): Promise<ApiResult<ICart>>;
23
24
  updateCart(params: ICartUpdateParams): Promise<ApiResult<ICart>>;
24
25
  prepareCheckout(params: ICheckoutPrepareParams): Promise<ApiResult<ICheckoutPrepare>>;
25
26
  updateCheckoutItems(params: ICheckoutItemsUpdateParams): Promise<ApiResult<ICheckoutItemsUpdateResponse>>;
26
27
  getPaymentSession(cartId: string): Promise<ApiResult<ICheckoutPaymentSession>>;
27
28
  confirmPaymentSession(params: ICheckoutPaymentConfirmParams): Promise<ApiResult<ICheckoutPaymentConfirm>>;
29
+ addAnonymousProduct(params: IAnonymousCheckoutAddProductParams): Promise<ApiResult<IAnonymousCheckoutAddProductResponse>>;
28
30
  checkoutComplete(token: string): Promise<ApiResult<ICheckoutComplete>>;
29
31
  }
@@ -1,4 +1,6 @@
1
1
  import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
2
+ import type { IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse } from '@/interfaces/api/checkout.interface';
3
+ import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
2
4
  import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
3
5
  import { BaseActionService } from './base-action.service';
4
6
  import type { IAddProductParams } from './client-cart-action.service';
@@ -19,6 +21,8 @@ export interface ICheckoutActions {
19
21
  updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
20
22
  updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
21
23
  getDetails: () => ICheckoutDetailsEventData;
24
+ getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
25
+ addAnonymousProduct: (params: IAnonymousCheckoutAddProductParams) => Promise<IAnonymousCheckoutAddProductResponse>;
22
26
  }
23
27
  export declare class ClientCheckoutActionService extends BaseActionService {
24
28
  private readonly command;
@@ -47,4 +51,6 @@ export declare class ClientCheckoutActionService extends BaseActionService {
47
51
  private updateBillingInfo;
48
52
  private updateGiftInfo;
49
53
  private getDetails;
54
+ private addAnonymousProduct;
55
+ private getProductAvailabilityByState;
50
56
  }
@@ -1,7 +1,9 @@
1
1
  import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
2
+ import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
2
3
  import { BaseActionService } from './base-action.service';
3
4
  export interface IProductActions {
4
5
  getDetails: (identifier: string) => IBaseProductEventData;
6
+ getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
5
7
  }
6
8
  export declare class ClientProductActionService extends BaseActionService {
7
9
  private readonly command;
@@ -9,4 +11,5 @@ export declare class ClientProductActionService extends BaseActionService {
9
11
  static getInstance(): ClientProductActionService;
10
12
  get actions(): IProductActions;
11
13
  private getDetails;
14
+ private getProductAvailabilityByState;
12
15
  }
@@ -22,7 +22,9 @@ export interface IClientConfigs {
22
22
  paymentMethodId?: string;
23
23
  openShadowDom?: boolean;
24
24
  hasCustomApiUrl?: boolean;
25
+ mockMode: boolean;
25
26
  checkout: ILiquidCommerceElementsCheckoutConfig | null;
27
+ isCheckoutOnly: boolean;
26
28
  }
27
29
  export interface IClientConfigInput {
28
30
  env?: ElementsEnv;
@@ -35,8 +37,10 @@ export interface IClientConfigInput {
35
37
  customApiUrl?: string;
36
38
  paymentMethodId?: string;
37
39
  openShadowDom?: boolean;
40
+ mockMode?: boolean;
38
41
  };
39
42
  checkout?: ILiquidCommerceElementsCheckoutConfig;
43
+ isCheckoutOnly?: boolean;
40
44
  }
41
45
  export declare class ClientConfigService {
42
46
  private config;
@@ -49,6 +53,7 @@ export declare class ClientConfigService {
49
53
  isStaging(): boolean;
50
54
  isProduction(): boolean;
51
55
  isBuilder(): boolean;
56
+ isCheckoutOnly(): boolean;
52
57
  isDebuggingEnabled(): boolean;
53
58
  isDebugPanelEnabled(): boolean;
54
59
  debuggingDisabled(): boolean;
@@ -1,7 +1,7 @@
1
- import type { IPagination } from 'modules/product-list/product-list.interface';
2
1
  import type { FulfillmentType } from '@/enums';
3
2
  import type { IProduct } from '@/interfaces/api/product.interface';
4
3
  import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
4
+ import type { IPagination } from '@/modules/product-list/product-list.interface';
5
5
  import type { IProductFulfillmentStore, IProductSizeStore } from './product.interface';
6
6
  export interface IPLProductStore extends Omit<IProduct, 'sizes'> {
7
7
  id: string;
@@ -26,4 +26,5 @@ export interface IProductListStore {
26
26
  rows: number;
27
27
  columns: number;
28
28
  loading: boolean;
29
+ rerender: boolean;
29
30
  }
@@ -2,6 +2,8 @@ export * from './clients/builder';
2
2
  export * from './clients/main';
3
3
  export * from './core/sdk-error-handler';
4
4
  export * from './enums';
5
+ export type { LiquidCommerceGlobal } from './global';
6
+ export * from './interfaces/api';
5
7
  export * from './interfaces/client.interface';
6
8
  export * from './interfaces/component.interface';
7
9
  export * from './interfaces/config.interface';
@@ -1,6 +1,6 @@
1
1
  import type { CheckoutEventLevel, CheckoutEventType, FulfillmentType } from '@/enums';
2
2
  import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
3
- import type { ICart } from '@/interfaces/api/cart.interface';
3
+ import type { ICart, ICartUpdateItem } from '@/interfaces/api/cart.interface';
4
4
  import type { IProductPresale } from '@/interfaces/api/product.interface';
5
5
  export interface ICheckoutComplete {
6
6
  orderNumber: string;
@@ -94,6 +94,27 @@ export interface ICheckoutItemsUpdateResponse {
94
94
  cart: ICart;
95
95
  checkout: ICheckoutPrepare;
96
96
  }
97
+ export interface IAnonymousCheckoutAddProductItem {
98
+ identifier: string;
99
+ fulfillmentType: FulfillmentType;
100
+ quantity: number;
101
+ }
102
+ export interface IAnonymousCheckoutAddProductParams {
103
+ items?: IAnonymousCheckoutAddProductItem[];
104
+ cartItems?: ICartUpdateItem[];
105
+ location: ILocation;
106
+ promoCode?: string;
107
+ }
108
+ export interface IAnonymousCheckoutUnavailableItem {
109
+ identifier: string;
110
+ productName: string | null;
111
+ fulfillmentType: FulfillmentType;
112
+ reason: 'product_not_available' | 'fulfillment_not_available';
113
+ }
114
+ export interface IAnonymousCheckoutAddProductResponse {
115
+ checkout: ICheckoutPrepare | null;
116
+ unavailableItems: IAnonymousCheckoutUnavailableItem[];
117
+ }
97
118
  export interface ICheckoutAmounts {
98
119
  subtotal: number;
99
120
  engraving: number;
@@ -0,0 +1,5 @@
1
+ export * from './address.interface';
2
+ export * from './cart.interface';
3
+ export * from './checkout.interface';
4
+ export * from './product.interface';
5
+ export * from './product-list.interface';
@@ -1,6 +1,6 @@
1
- import type { FILTER_KEYS } from 'modules/product-list/product-list.constants';
2
1
  import type { ILocation } from '@/interfaces/api/address.interface';
3
2
  import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
3
+ import type { FILTER_KEYS } from '@/modules/product-list/product-list.constants';
4
4
  export interface IProductSearchParams {
5
5
  slug: string;
6
6
  location?: ILocation;
@@ -8,6 +8,12 @@ export interface IProductAvailabilityResponse {
8
8
  products: IProduct[];
9
9
  retailers: Record<string, IRetailer>;
10
10
  }
11
+ export interface IProductPriceInfo {
12
+ currency: string;
13
+ minimum: number;
14
+ average: number;
15
+ maximum: number;
16
+ }
11
17
  export interface IProductVariant {
12
18
  retailerId: string;
13
19
  shippingFulfillmentId: string;
@@ -64,7 +70,7 @@ export interface IProduct {
64
70
  type: string;
65
71
  subType: string;
66
72
  salsifyGrouping: string;
67
- noAvailabilityPrice: number;
73
+ priceInfo: IProductPriceInfo | null;
68
74
  sizes: Record<string, IProductSize>;
69
75
  }
70
76
  export interface IFulfillment {
@@ -11,6 +11,7 @@ export interface ILiquidCommerceElementsDevelopmentConfig {
11
11
  customApiUrl?: string;
12
12
  paymentMethodId?: string;
13
13
  openShadowDom?: boolean;
14
+ mockMode?: boolean;
14
15
  }
15
16
  export interface IClientCustomThemeConfig {
16
17
  global?: UpdateComponentGlobalConfigs;
@@ -21,7 +22,7 @@ export interface IClientCustomThemeConfig {
21
22
  productList?: UpdateProductListComponent;
22
23
  }
23
24
  export interface ILiquidCommerceElementsCheckoutConfig {
24
- pageUrl: string;
25
+ pageUrl?: string;
25
26
  }
26
27
  export interface ILiquidCommerceElementsBaseConfig {
27
28
  env?: ElementsEnv;
@@ -29,18 +30,12 @@ export interface ILiquidCommerceElementsBaseConfig {
29
30
  customTheme?: IClientCustomThemeConfig;
30
31
  debugMode?: DebugMode;
31
32
  checkout?: ILiquidCommerceElementsCheckoutConfig;
33
+ proxy?: IElementsProxyConfig;
34
+ development?: ILiquidCommerceElementsDevelopmentConfig;
32
35
  }
33
36
  export interface ILiquidCommerceElementsBuilderConfig extends ILiquidCommerceElementsBaseConfig {
34
37
  }
35
38
  export interface ILiquidCommerceElementsConfig extends ILiquidCommerceElementsBaseConfig {
36
- proxy?: IElementsProxyConfig;
37
- development?: ILiquidCommerceElementsDevelopmentConfig;
38
39
  }
39
- export interface ILiquidCommerceElementsCheckoutClientConfig {
40
- env?: ElementsEnv;
41
- customTheme?: IClientCustomThemeConfig;
42
- debugMode?: DebugMode;
43
- checkout?: ILiquidCommerceElementsCheckoutConfig;
44
- proxy?: IElementsProxyConfig;
45
- development?: ILiquidCommerceElementsDevelopmentConfig;
40
+ export interface ILiquidCommerceElementsCheckoutClientConfig extends ILiquidCommerceElementsBaseConfig {
46
41
  }
@@ -39,4 +39,9 @@ export interface IProductListComponent {
39
39
  theme: IProductListTheme;
40
40
  layout: IProductListLayout;
41
41
  }
42
- export type UpdateProductListComponent = DeepPartial<IProductListComponent>;
42
+ export interface UpdateProductListComponent {
43
+ theme?: DeepPartial<IProductListTheme>;
44
+ layout?: {
45
+ lists?: Record<string, DeepPartial<IPLCList>>;
46
+ };
47
+ }
@@ -1,7 +1,7 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
2
  import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
3
3
  import type { ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
4
- import type { ICheckoutBilling, ICheckoutCustomer, ICheckoutGiftRecipient } from '@/interfaces/api/checkout.interface';
4
+ import type { ICheckoutBilling, ICheckoutCustomer, ICheckoutGiftRecipient, ICheckoutPrepare } from '@/interfaces/api/checkout.interface';
5
5
  import type { AddItemParams } from '@/modules/cart/cart.commands';
6
6
  import type { PresaleExpiredReason } from '@/modules/checkout/components';
7
7
  export declare class CheckoutCommands extends BaseCommand {
@@ -14,6 +14,7 @@ export declare class CheckoutCommands extends BaseCommand {
14
14
  cartId?: string;
15
15
  isForPresale?: boolean;
16
16
  }): Promise<void>;
17
+ loadCheckoutFromResponse(response: ICheckoutPrepare): void;
17
18
  toggleIsGift(active?: boolean): Promise<void>;
18
19
  toggleBillingSameAsShipping(active?: boolean): Promise<void>;
19
20
  toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<void>;
@@ -8,7 +8,7 @@ export interface IProductRetailersPopupListComponentParams {
8
8
  }
9
9
  export declare class ProductRetailersPopupListComponent extends BaseComponent<IProductRetailersPopupListComponentParams, IProductComponent> {
10
10
  get hostClasses(): string[];
11
- private get isProductListContext();
11
+ private get isProductContext();
12
12
  beforeSetupStoreWatchers(): void;
13
13
  private onFulfillmentTabClick;
14
14
  private onRetailerCardClick;
@@ -1,4 +1,4 @@
1
- import type { PLCCardStyle } from 'interfaces/configs/product-list.interface';
1
+ import type { PLCCardStyle } from '@/interfaces/configs/product-list.interface';
2
2
  export interface IQuantitySelectorParams {
3
3
  initialQuantity: number;
4
4
  minQuantity: number;
@@ -1,5 +1,5 @@
1
- import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
2
1
  import { BaseComponent } from '@/core/base-component.service';
2
+ import type { IProductSizeStore } from '@/core/store/interfaces/product.interface';
3
3
  export interface IProductListSizeSelectorParams {
4
4
  sizes: Record<string, IProductSizeStore>;
5
5
  selectedSizeId: string | null;
@@ -1,4 +1,4 @@
1
- import type { IExtendedFilterSchema, IProductListFilters } from 'modules/product-list/product-list.interface';
1
+ import type { IExtendedFilterSchema, IProductListFilters } from '@/modules/product-list/product-list.interface';
2
2
  export interface ICreateChipsContainerParams {
3
3
  currentFilters?: IProductListFilters;
4
4
  sanitizedFilters?: IExtendedFilterSchema[];
@@ -1,5 +1,5 @@
1
- import { FULFILLMENT_OPTIONS } from 'modules/product-list/product-list.constants';
2
- import type { IProductListFilters } from 'modules/product-list/product-list.interface';
1
+ import { FULFILLMENT_OPTIONS } from '@/modules/product-list/product-list.constants';
2
+ import type { IProductListFilters } from '@/modules/product-list/product-list.interface';
3
3
  export interface ICreateFulfillmentFilterParams {
4
4
  currentFilters?: IProductListFilters;
5
5
  deliveryCollapsed: boolean;
@@ -1,4 +1,4 @@
1
- import type { IProductListFilters } from 'modules/product-list/product-list.interface';
1
+ import type { IProductListFilters } from '@/modules/product-list/product-list.interface';
2
2
  export interface ICreateEngravingFilterParams {
3
3
  currentFilters?: IProductListFilters;
4
4
  isPersonalizationDisabled: boolean;
@@ -1,6 +1,6 @@
1
- export * from '../product-list-card.component';
2
1
  export * from './filter-components';
3
2
  export * from './filter-components/product-list-apply-filter-button';
3
+ export * from './product-list-card.component';
4
4
  export * from './product-list-card-loading.component';
5
5
  export * from './product-list-engraving.component';
6
6
  export * from './product-list-filters.component';
@@ -1,5 +1,5 @@
1
- import type { IProductListComponent } from 'interfaces/configs';
2
1
  import { BaseComponent } from '@/core/base-component.service';
2
+ import type { IProductListComponent } from '@/interfaces/configs';
3
3
  import type { IProductListComponentParams } from '@/modules/product-list/product-list.component';
4
4
  export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
5
5
  get hostClasses(): string[];
@@ -1,5 +1,5 @@
1
- import type { IProductListComponent } from 'interfaces/configs';
2
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
+ import type { IProductListComponent } from '@/interfaces/configs';
3
3
  export interface IProductListCardParams {
4
4
  slug: string;
5
5
  productId: string;
@@ -1,6 +1,6 @@
1
- import { BaseComponent } from 'core/base-component.service';
2
- import type { IProductListComponent } from 'interfaces/configs';
3
- import type { IEngravingFormComponentParams } from 'modules/ui-components/engraving';
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { IProductListComponent } from '@/interfaces/configs';
3
+ import type { IEngravingFormComponentParams } from '@/modules/ui-components/engraving';
4
4
  interface IProductListEngravingParams extends IEngravingFormComponentParams {
5
5
  slug: string;
6
6
  }
@@ -1,12 +1,10 @@
1
- import { BaseComponent } from 'core/base-component.service';
2
- import type { ProductListFilterType } from 'interfaces/injection.interface';
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { ProductListFilterType } from '@/interfaces/injection.interface';
3
3
  export interface IProductListFiltersParams {
4
4
  slug: string;
5
5
  filters: ProductListFilterType[];
6
6
  }
7
7
  export declare class ProductListFiltersComponent extends BaseComponent<IProductListFiltersParams> {
8
- private readonly DEFAULT_MIN_PRICE;
9
- private readonly DEFAULT_MAX_PRICE;
10
8
  private readonly FILTER_DEBOUNCE_DELAY_MS;
11
9
  private isRenderedInDrawerMode;
12
10
  private permanentFilters;
@@ -34,6 +32,8 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
34
32
  private detectIfRenderedInDrawer;
35
33
  onStoreWatch(): void;
36
34
  private syncFiltersFromStore;
35
+ private createFilterSection;
36
+ private rebuildContainer;
37
37
  private refreshUIStates;
38
38
  private transformFilterValue;
39
39
  private fetchFilters;
@@ -55,7 +55,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
55
55
  private togglePriceFilterCollapse;
56
56
  private buildPriceFilterElements;
57
57
  private buildDynamicFiltersElements;
58
- private getFilterElements;
59
58
  private buildCheckboxFilterElements;
60
59
  private toggleCheckboxFilterExpansion;
61
60
  private renderCheckboxItemsForFilter;
@@ -1,5 +1,5 @@
1
- import { BaseComponent } from 'core/base-component.service';
2
- import type { IProductListComponent } from 'interfaces/configs';
1
+ import { BaseComponent } from '@/core/base-component.service';
2
+ import type { IProductListComponent } from '@/interfaces/configs';
3
3
  export interface IProductListProductEngravingLinesComponentParams {
4
4
  slug: string;
5
5
  identifier: string;
@@ -1,5 +1,5 @@
1
- import { BaseComponent, type IOnStoreChanged } from 'core/base-component.service';
2
- import type { IProductListComponent } from 'interfaces/configs';
1
+ import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
+ import type { IProductListComponent } from '@/interfaces/configs';
3
3
  export interface IProductListProductPreCartComponentParams {
4
4
  slug: string;
5
5
  productId: string;
@@ -3,7 +3,7 @@ import { type FulfillmentType } from '@/enums';
3
3
  import type { IFilterSchema, INavigationResponse, IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
4
4
  import type { ProductListFilterType } from '@/interfaces/injection.interface';
5
5
  import { type AddItemParams } from '@/modules/cart/cart.commands';
6
- import type { IExtendedFilterSchema, IPagination, IProductListFilters } from './product-list.interface';
6
+ import type { IExtendedFilterSchema, ILoadInitialProductsParams, IPagination, IProductListFilters } from './product-list.interface';
7
7
  export declare class ProductListCommands extends BaseCommand {
8
8
  private readonly uiCommands;
9
9
  private readonly cartCommands;
@@ -12,7 +12,8 @@ export declare class ProductListCommands extends BaseCommand {
12
12
  initializeListStore(slug: string): void;
13
13
  updateSearchTerm(slug: string, searchTerm: string): void;
14
14
  setLoading(slug: string, isLoading: boolean): void;
15
- loadInitialProducts(slug: string, page: number, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
15
+ rerenderProductLists(): void;
16
+ loadInitialProducts({ slug, page, perPage, searchTerm, currentFilters, configuredFilters, }: ILoadInitialProductsParams): Promise<void>;
16
17
  loadMoreProducts(slug: string, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
17
18
  getProductList(params: IProductSearchParams): Promise<IProductSearchResponse>;
18
19
  syncFiltersFromComponent(slug: string, filters: IProductListFilters): void;
@@ -1,5 +1,5 @@
1
- import type { IProductListComponent } from 'interfaces/configs';
2
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
+ import type { IProductListComponent } from '@/interfaces/configs';
3
3
  import type { ProductListFilterType } from '@/interfaces/injection.interface';
4
4
  export interface IProductListComponentParams {
5
5
  slug: string;
@@ -45,5 +45,6 @@ export declare class ProductListComponent extends BaseComponent<IProductListComp
45
45
  private cleanupScrollObserver;
46
46
  private doCleanup;
47
47
  onStoreWatch(changes: IOnStoreChanged[]): Promise<void>;
48
+ onStoreChanged(): boolean;
48
49
  protected template(): HTMLElement[];
49
50
  }
@@ -1,4 +1,5 @@
1
1
  import type { IFilterValue } from '@/interfaces/api/product-list.interface';
2
+ import type { ProductListFilterType } from '@/interfaces/injection.interface';
2
3
  export interface IPriceConfig {
3
4
  min?: string;
4
5
  max?: string;
@@ -54,3 +55,11 @@ export interface IRenderCheckboxItemsParams {
54
55
  state: ICheckboxLabelStates;
55
56
  onCheckboxChange: (value: string, checked: boolean) => void;
56
57
  }
58
+ export interface ILoadInitialProductsParams {
59
+ slug: string;
60
+ page: number;
61
+ perPage: number;
62
+ searchTerm: string;
63
+ currentFilters: IProductListFilters;
64
+ configuredFilters: ProductListFilterType[];
65
+ }
@@ -19,5 +19,4 @@ export declare class ThemeProviderService {
19
19
  getComponentConfig(componentType: ComponentType): ConfigsType | undefined;
20
20
  getStylesheet(componentType: ComponentType): GeneratedStylesheet[];
21
21
  private getBaseStylesheets;
22
- private deepMerge;
23
22
  }
@@ -29,7 +29,7 @@ Use data attributes to configure the product list:
29
29
  ></script>
30
30
 
31
31
  <div
32
- data-liquid-commerce-elements-products-list
32
+ data-liquid-commerce-elements-products-list="my-collection-slug"
33
33
  data-rows="3"
34
34
  data-columns="4"
35
35
  data-filters="price,brand,category"
@@ -38,7 +38,7 @@ Use data attributes to configure the product list:
38
38
  ```
39
39
 
40
40
  **Attributes:**
41
- - `data-liquid-commerce-elements-products-list`: Marks element as product list container
41
+ - `data-liquid-commerce-elements-products-list`: Product list container; value is the collection slug
42
42
  - `data-rows`: Number of rows to display (default: 3)
43
43
  - `data-columns`: Number of columns (default: 4)
44
44
  - `data-filters`: Comma-separated filter types
@@ -52,14 +52,14 @@ Separate containers for search and filters:
52
52
 
53
53
  ```html
54
54
  <!-- Search container -->
55
- <div data-search-container></div>
55
+ <div data-liquid-commerce-elements-products-list-search="my-collection-slug"></div>
56
56
 
57
57
  <!-- Filters container -->
58
- <div data-filters-container data-filters="price,brand,fulfillment"></div>
58
+ <div data-liquid-commerce-elements-products-list-filters="my-collection-slug" data-filters="price,brand,fulfillment"></div>
59
59
 
60
60
  <!-- Product list -->
61
61
  <div
62
- data-liquid-commerce-elements-products-list
62
+ data-liquid-commerce-elements-products-list="my-collection-slug"
63
63
  data-rows="4"
64
64
  data-columns="3"
65
65
  data-product-url="/products/{identifier}"
@@ -343,18 +343,18 @@ const client = await Elements('YOUR_API_KEY', {
343
343
  <h1>Whiskey Collection</h1>
344
344
 
345
345
  <!-- Search -->
346
- <div data-search-container></div>
347
-
346
+ <div data-liquid-commerce-elements-products-list-search="whiskey-collection"></div>
347
+
348
348
  <div class="catalog">
349
349
  <!-- Filters sidebar -->
350
350
  <aside>
351
- <div data-filters-container data-filters="price,brand,size"></div>
351
+ <div data-liquid-commerce-elements-products-list-filters="whiskey-collection" data-filters="price,brand,size"></div>
352
352
  </aside>
353
-
353
+
354
354
  <!-- Product grid -->
355
355
  <main>
356
356
  <div
357
- data-liquid-commerce-elements-products-list
357
+ data-liquid-commerce-elements-products-list="whiskey-collection"
358
358
  data-rows="4"
359
359
  data-columns="3"
360
360
  data-product-url="/whiskey/{identifier}"
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.7.6",
6
+ "version": "2.7.8",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",
@@ -81,9 +81,9 @@
81
81
  "embeddable commerce"
82
82
  ],
83
83
  "devDependencies": {
84
- "@biomejs/biome": "^2.4.2",
85
- "@commitlint/cli": "^20.4.1",
86
- "@commitlint/config-conventional": "^20.4.1",
84
+ "@biomejs/biome": "^2.4.4",
85
+ "@commitlint/cli": "^20.4.2",
86
+ "@commitlint/config-conventional": "^20.4.2",
87
87
  "@rollup/plugin-alias": "^6.0.0",
88
88
  "@rollup/plugin-commonjs": "^29.0.0",
89
89
  "@rollup/plugin-json": "^6.1.0",
@@ -97,11 +97,11 @@
97
97
  "@semantic-release/npm": "^13.1.4",
98
98
  "@semantic-release/release-notes-generator": "^14.1.0",
99
99
  "@types/core-js": "^2.5.8",
100
- "@types/node": "^25.2.3",
100
+ "@types/node": "^25.3.0",
101
101
  "conventional-changelog-cli": "^5.0.0",
102
102
  "husky": "^9.1.7",
103
103
  "process": "^0.11.10",
104
- "rollup": "^4.57.1",
104
+ "rollup": "^4.59.0",
105
105
  "rollup-obfuscator": "^4.1.1",
106
106
  "rollup-plugin-typescript2": "^0.36.0",
107
107
  "semantic-release": "^25.0.3",