@propeller-commerce/propeller-v2-react-ui 0.15.8 → 0.15.10

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,43 @@ 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.15.10] - 2026-08-11
12
+
13
+ ### Fixed
14
+
15
+ - **The cart sidebar's "Bonus items" heading stayed English on a localized
16
+ page.** `CartIconAndSidebar` renders `CartBonusItems` itself but passed it no
17
+ `labels`, so the block always fell back to its English defaults — while the
18
+ same component on the cart and checkout pages, where the host passes `labels`
19
+ directly, translated correctly. Same shape as the `cartItemLabels` gap fixed
20
+ in 0.4.24.
21
+
22
+ ### Added
23
+
24
+ - `CartIconAndSidebar` accepts `cartBonusItemsLabels` (keys: `title`, `sku`),
25
+ forwarded to the embedded bonus-items block. Hosts already translating
26
+ `CartBonusItems` on the cart page can pass the same map.
27
+
28
+ ## [0.15.9] - 2026-08-11
29
+
30
+ ### Fixed
31
+
32
+ - **The product specifications table emptied out in a language the catalogue is
33
+ only partly translated into** (PWP-928). A localized list carries only the
34
+ languages someone authored, so asking for one nobody wrote returns nothing —
35
+ it does not fall back. `ProductSpecifications` matched strictly on
36
+ `language === props.language`, which failed twice over: the label fell through
37
+ to `attributeDescription.name` and printed the raw PIM code
38
+ (`QUANTORE_70001706`) at the user, and the value resolved to `''` — and since
39
+ `getAttributes()` drops rows with an empty value, the row disappeared
40
+ entirely. On a Dutch-only catalogue browsed in English the whole table went
41
+ blank. Both now prefer the active language and fall back to whichever
42
+ translation exists, matching `GridFilters`, `ProductDescription` and the menu.
43
+ Empty localized rows the backend really does return
44
+ (`{ language: 'FR', values: [] }`) are skipped rather than winning the
45
+ fallback. Language matching is now case-insensitive: with `language="en"` the
46
+ component previously rendered nothing at all.
47
+
11
48
  ## [0.15.8] - 2026-08-11
12
49
 
13
50
  ### Fixed
package/dist/index.cjs CHANGED
@@ -7497,7 +7497,15 @@ function CartIconAndSidebar(rawProps) {
7497
7497
  },
7498
7498
  item.itemId
7499
7499
  )) }),
7500
- /* @__PURE__ */ jsxRuntime.jsx(CartBonusItemsImpl, { cart: props.cart, includeTax: useTax, className: "mt-4" })
7500
+ /* @__PURE__ */ jsxRuntime.jsx(
7501
+ CartBonusItemsImpl,
7502
+ {
7503
+ cart: props.cart,
7504
+ includeTax: useTax,
7505
+ className: "mt-4",
7506
+ labels: props.cartBonusItemsLabels
7507
+ }
7508
+ )
7501
7509
  ] }),
7502
7510
  " ",
7503
7511
  items.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-cart-icon__sidebar-footer px-5 py-4 border-t border-border space-y-3 bg-surface-hover", children: [
@@ -16489,19 +16497,27 @@ function ProductSpecifications(rawProps) {
16489
16497
  (a) => (a.attributeDescription?.group || "") === group
16490
16498
  );
16491
16499
  }
16500
+ function pickLocalized(rows, isUsable) {
16501
+ const list = (rows || []).filter(isUsable);
16502
+ const lang = (props.language || "NL").toUpperCase();
16503
+ return list.find((row) => (row.language || "").toUpperCase() === lang) || list[0];
16504
+ }
16492
16505
  function getAttributeLabel(attr) {
16493
- const lang = props.language || "NL";
16494
- const descs = attr.attributeDescription?.descriptions || [];
16495
- const match = descs.find((d) => d.language === lang);
16506
+ const match = pickLocalized(
16507
+ attr.attributeDescription?.descriptions,
16508
+ (d) => !!d.value
16509
+ );
16496
16510
  return match?.value || attr.attributeDescription?.name || "";
16497
16511
  }
16498
16512
  function getAttributeValue(attr) {
16499
16513
  const v = attr.value;
16500
16514
  if (!v) return "";
16501
- const lang = props.language || "NL";
16502
16515
  if (v.type === propellerSdkV2.AttributeType.TEXT) {
16503
16516
  const tv = v;
16504
- const entry = tv.textValues?.find((row) => row.language === lang);
16517
+ const entry = pickLocalized(
16518
+ tv.textValues,
16519
+ (row) => (row?.values || []).some(Boolean)
16520
+ );
16505
16521
  const vals = (entry?.values || []).filter(Boolean);
16506
16522
  return vals.join(", ");
16507
16523
  }