@liquidcommerce/elements-sdk 2.6.0-beta.76 → 2.6.0-beta.78

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.
@@ -3,6 +3,7 @@ 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[];
6
+ protected get hostAttributes(): Record<string, string>;
6
7
  private createSkeletonCard;
7
8
  protected template(): HTMLElement[];
8
9
  }
@@ -0,0 +1,3 @@
1
+ import type { ProductListFilterType } from '@/interfaces/injection.interface';
2
+ import type { IProductListFilters } from './product-list.interface';
3
+ export declare function parseQueryParamsToFilters(configuredFilters: ProductListFilterType[], search?: string): IProductListFilters | null;
@@ -9,7 +9,7 @@ export declare class ProductListCommands extends BaseCommand {
9
9
  private readonly cartCommands;
10
10
  constructor();
11
11
  static getInstance(): ProductListCommands;
12
- initializeListStore(slug: string): void;
12
+ initializeListStore(slug: string, configuredFilters?: ProductListFilterType[]): void;
13
13
  updateSearchTerm(slug: string, searchTerm: string): void;
14
14
  setLoading(slug: string, isLoading: boolean): void;
15
15
  rerenderProductLists(): void;
@@ -151,6 +151,11 @@ await client.injectProductList({
151
151
  });
152
152
  ```
153
153
 
154
+ > The `filters` array also acts as the whitelist for **URL query param filtering** —
155
+ > the product list reads `?brands=...&price=...` etc. from `window.location.search`
156
+ > on first mount and applies them. See
157
+ > [URL Query Param Filters](../guides/product-list-component.md#url-query-param-filters).
158
+
154
159
  ### Example — URL map (partner-owned dedicated PDPs)
155
160
 
156
161
  Use this form when each product has a hand-curated URL that can't be derived
@@ -128,6 +128,55 @@ The following filter type values can be used in the `filters` array:
128
128
  filters: ['price', 'brands', 'categories', 'fulfillment', 'sizes']
129
129
  ```
130
130
 
131
+ ## URL Query Param Filters
132
+
133
+ The product list auto-applies filters from the page URL on first load. Useful for category landing pages, "shop the look" links, marketing emails, or any flow where you want to deep-link into a pre-filtered list.
134
+
135
+ ### Whitelist
136
+
137
+ Only filter keys that are configured for the list are honored — anything else in the URL is silently ignored. The whitelist resolves in this priority order:
138
+
139
+ 1. `data-filters` on `<div data-liquid-commerce-elements-products-list>` (use this when the page does **not** mount a filters UI but you still want URL filtering — e.g. a curated category page).
140
+ 2. `data-filters` on the matching `<... -products-list-filters>` container (the common case when a filters panel is mounted).
141
+ 3. `availableFilters` from the theme config for the list slug.
142
+ 4. `filters` array passed to `injectProductList(...)` programmatically.
143
+
144
+ ### Supported formats
145
+
146
+ | Filter | URL format | Example |
147
+ | --- | --- | --- |
148
+ | Multi-value (`brands`, `categories`, `flavor`, `region`, `variety`, `vintage`, `country`, `appellation`, `materials`, `sizes`) | Comma-separated **or** repeated keys | `?brands=Bacardi,Glenlivet` or `?brands=Bacardi&brands=Glenlivet` |
149
+ | `fulfillment` | Single value: `all`, `shipping`, or `onDemand` | `?fulfillment=shipping` |
150
+ | `engraving` | `true` or `false` | `?engraving=true` |
151
+ | `price` | `min-max` range; `min-` or `-max` are accepted | `?price=20-150`, `?price=20-`, `?price=-150` |
152
+
153
+ Invalid values are dropped (e.g. `?fulfillment=garbage`, `?price=abc` — no error, the filter just isn't applied). Combining params is supported:
154
+
155
+ ```
156
+ https://yoursite.com/best-sellers?brands=Bacardi&categories=Wine&price=20-150&fulfillment=shipping
157
+ ```
158
+
159
+ ### Behavior
160
+
161
+ - URL params win over any state persisted from a previous session.
162
+ - Once the list mounts, the filters panel (if present) reflects the seeded values, and the initial product fetch is filtered.
163
+ - Subsequent in-page interactions (toggling filters, scrolling, etc.) do not write back to the URL — the URL is read-only at load time.
164
+
165
+ ### Standalone use (no filters component)
166
+
167
+ URL filtering works without injecting a filters panel. Declare the whitelist on the products-list container itself:
168
+
169
+ ```html
170
+ <div
171
+ data-liquid-commerce-elements-products-list="curated-page"
172
+ data-filters="price,brands,categories"
173
+ data-rows="4"
174
+ data-columns="4"
175
+ ></div>
176
+ ```
177
+
178
+ Now `https://yoursite.com/curated-page?brands=Bacardi&price=20-150` filters the list on load even though no filters UI is present.
179
+
131
180
  ## Search Functionality
132
181
 
133
182
  ### Search Box
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "LiquidCommerce Elements SDK",
4
4
  "license": "UNLICENSED",
5
5
  "author": "LiquidCommerce Team",
6
- "version": "2.6.0-beta.76",
6
+ "version": "2.6.0-beta.78",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",
@@ -78,8 +78,8 @@
78
78
  ],
79
79
  "devDependencies": {
80
80
  "@biomejs/biome": "^2.4.14",
81
- "@commitlint/cli": "^20.5.3",
82
- "@commitlint/config-conventional": "^20.5.3",
81
+ "@commitlint/cli": "^21.0.0",
82
+ "@commitlint/config-conventional": "^21.0.0",
83
83
  "@rollup/plugin-alias": "^6.0.0",
84
84
  "@rollup/plugin-commonjs": "^29.0.2",
85
85
  "@rollup/plugin-json": "^6.1.0",
@@ -93,7 +93,7 @@
93
93
  "@semantic-release/npm": "^13.1.5",
94
94
  "@semantic-release/release-notes-generator": "^14.1.0",
95
95
  "@types/core-js": "^2.5.8",
96
- "@types/node": "^25.6.0",
96
+ "@types/node": "^25.6.2",
97
97
  "conventional-changelog": "^7.2.0",
98
98
  "husky": "^9.1.7",
99
99
  "process": "^0.11.10",