@propeller-commerce/propeller-v2-vue-ui 0.3.38 → 0.3.39

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
@@ -8,6 +8,19 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
8
8
  between minor versions; breaking changes are called out below and in
9
9
  [MIGRATION.md](./MIGRATION.md).
10
10
 
11
+ ## [0.3.39] - 2026-07-21
12
+
13
+ ### Fixed
14
+
15
+ - **`SearchBar` autosuggest now filters results by the active language.**
16
+ Follow-up to 0.3.38's category-search routing: the backend search matches
17
+ across all languages, so FR/ES-only products leaked into an EN preview. The
18
+ autosuggest now drops results with no name in the active language (and
19
+ adjusts the "View all (N)" total by the dropped count), and the result row
20
+ displays the name in the active language (falling back to the first
21
+ available) instead of always the first name in the array. Mirrors react-ui
22
+ 0.4.29.
23
+
11
24
  ## [0.3.38] - 2026-07-21
12
25
 
13
26
  ### Fixed
package/dist/index.cjs CHANGED
@@ -2041,6 +2041,7 @@ function useProductSearch(options) {
2041
2041
  const currentSortField = vue.ref(options.sortField?.value ?? propellerSdkV2.ProductSortField.RELEVANCE);
2042
2042
  const currentSortOrder = vue.ref(options.sortOrder?.value ?? "DESC");
2043
2043
  function filterByLanguage(products, lang) {
2044
+ if (!lang) return products;
2044
2045
  return products.filter((p) => {
2045
2046
  const names = p.names || p.names || [];
2046
2047
  if (!names || names.length === 0) return true;
@@ -2267,8 +2268,12 @@ function useProductSearch(options) {
2267
2268
  };
2268
2269
  const response = await service.getCategory(variables);
2269
2270
  const productsResponse = response?.products;
2270
- searchResults.value = productsResponse?.items ?? [];
2271
- searchItemsFound.value = productsResponse?.itemsFound ?? searchResults.value.length;
2271
+ const rawItems = productsResponse?.items ?? [];
2272
+ const items = filterByLanguage(rawItems, lang);
2273
+ const untranslated = rawItems.length - items.length;
2274
+ const apiTotal = productsResponse?.itemsFound ?? rawItems.length;
2275
+ searchResults.value = items;
2276
+ searchItemsFound.value = Math.max(0, apiTotal - untranslated);
2272
2277
  } catch {
2273
2278
  searchResults.value = [];
2274
2279
  searchItemsFound.value = 0;
@@ -20104,9 +20109,11 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
20104
20109
  const url = typeof builder === "function" ? builder(item, infra.language) : isCluster ? "/cluster/" + id + "/" + slug : "/product/" + id + "/" + slug;
20105
20110
  const priceNet = displayItem?.price?.net || 0;
20106
20111
  const priceGross = displayItem?.price?.gross || 0;
20112
+ const lang = infra.language;
20113
+ const localizedName = lang && item.names?.find((n) => n.language === lang)?.value || item.names?.[0]?.value || "Product";
20107
20114
  return {
20108
20115
  id,
20109
- name: item.names?.[0]?.value || "Product",
20116
+ name: localizedName,
20110
20117
  sku: item.sku || displayItem?.sku || "",
20111
20118
  // `price` stays gross for back-compat; the row picks net/gross per toggle.
20112
20119
  price: priceGross,