@scayle/storefront-product-listing 2.0.1 → 2.0.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @scayle/storefront-product-listing
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Refined `useAppliedFilters` to update the `appliedFilter` value only when query parameters beginning with the specified `filtersPrefix` change, preventing unnecessary updates of `appliedFilter` when unrelated query parameters are modified
8
+
9
+ **Before:**
10
+
11
+ Any change to query parameters, regardless of their name, such as `?someQueryParam=true`, would trigger a reactive update of `appliedFilter`.
12
+
13
+ **After:**
14
+
15
+ Only changes to query parameters that begin with the specified prefix (e.g., `filters`) will trigger an update. For example, only `?filters[someQueryParam]=true` will cause `appliedFilter` to update, while unrelated query parameters will be ignored.
16
+
3
17
  ## 2.0.1
4
18
 
5
19
  ### Patch Changes
@@ -261,7 +275,7 @@
261
275
  ### Patch Changes
262
276
 
263
277
  - The `useProductsByCategory` composable now sets the trackSearchAnalyticsEvent parameter by default if the current page evaluates to `1` and the `appliedFilter.term` is not empty.
264
- The default behavior can be overriden by passing `trackSearchAnalyticsEvent: false` as part of `ProductsByCategoryOptions.params`.
278
+ The default behavior can be overridden by passing `trackSearchAnalyticsEvent: false` as part of `ProductsByCategoryOptions.params`.
265
279
  For more details, check the [SCAYLE Search Analytics section](https://scayle.dev/en/developer-guide/products/search#scayle-search-analytics) in the SCAYLE Resource Center.
266
280
 
267
281
  ## 0.4.1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-product-listing",
3
3
  "configKey": "product-listing",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "compatibility": {
6
6
  "bridge": false,
7
7
  "nuxt": ">=3.13"
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineNuxtModule, createResolver, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const PACKAGE_NAME = "@scayle/storefront-product-listing";
4
- const PACKAGE_VERSION = "2.0.1";
4
+ const PACKAGE_VERSION = "2.0.2";
5
5
  const module = defineNuxtModule({
6
6
  meta: {
7
7
  name: PACKAGE_NAME,
@@ -2,9 +2,11 @@ import { computed, ref, watch } from "vue";
2
2
  import { parseFilterDataFromRoute } from "../utils/filters.js";
3
3
  export function useAppliedFilters(route, { filtersPrefix } = { filtersPrefix: "filters" }) {
4
4
  const appliedFilter = ref({ attributes: [] });
5
- const routeQueryString = computed(() => JSON.stringify(route.query));
6
- watch(routeQueryString, () => {
7
- appliedFilter.value = parseFilterDataFromRoute(route.query, filtersPrefix);
5
+ const parsedFilterQuery = computed(
6
+ () => parseFilterDataFromRoute(route.query, filtersPrefix)
7
+ );
8
+ watch(() => JSON.stringify(parsedFilterQuery.value), () => {
9
+ appliedFilter.value = parsedFilterQuery.value;
8
10
  }, { immediate: true });
9
11
  const appliedFiltersCount = computed(() => {
10
12
  let count = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-product-listing",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Collection of essential composables and utilities to work with product listing",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "@nuxt/module-builder": "1.0.1",
46
46
  "@nuxt/schema": "3.17.7",
47
47
  "@nuxt/test-utils": "3.19.2",
48
- "@types/node": "22.16.4",
48
+ "@types/node": "22.16.5",
49
49
  "@vitest/coverage-v8": "3.2.4",
50
50
  "@vueuse/core": "13.5.0",
51
51
  "dprint": "0.50.1",
@@ -60,10 +60,10 @@
60
60
  "unbuild": "3.5.0",
61
61
  "vitest": "3.2.4",
62
62
  "vue-router": "4.5.1",
63
- "vue-tsc": "3.0.1",
63
+ "vue-tsc": "3.0.3",
64
64
  "vue": "3.5.17",
65
- "@scayle/eslint-config-storefront": "4.6.1",
66
- "@scayle/storefront-nuxt": "8.34.1"
65
+ "@scayle/storefront-nuxt": "8.37.0",
66
+ "@scayle/eslint-config-storefront": "4.7.0"
67
67
  },
68
68
  "scripts": {
69
69
  "build": "nuxt-module-build build",