@propeller-commerce/propeller-v2-react-ui 0.15.4 → 0.15.5
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 +19 -0
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,25 @@ 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.5] - 2026-08-10
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `useMenu` no longer drops categories that lack a translation in the active
|
|
16
|
+
language. The query filtered server-side — `names(language: $language)` — so a
|
|
17
|
+
category with no entry for that language came back with `names: []` and
|
|
18
|
+
`slugs: []`. `mapCategory`'s `?? raw.names?.[0]` fallback then had nothing to
|
|
19
|
+
fall back to, and the row rendered with a blank label and an empty slug:
|
|
20
|
+
invisible and unclickable. Switching a bilingual storefront to a language with
|
|
21
|
+
partial translations collapsed the menu to whichever categories happened to be
|
|
22
|
+
translated (PWP-927).
|
|
23
|
+
|
|
24
|
+
`names` and `slugs` are now fetched unfiltered — every translation — and
|
|
25
|
+
`mapCategory` picks the active language, falling back to whichever translation
|
|
26
|
+
exists. `slugs` gained a `language` field so the slug follows the same rule as
|
|
27
|
+
the name. `$language` is gone from the query signature (an unused variable is
|
|
28
|
+
a GraphQL validation error); it still keys the cache and drives the pick.
|
|
29
|
+
|
|
11
30
|
## [0.15.4] - 2026-08-10
|
|
12
31
|
|
|
13
32
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -1592,15 +1592,15 @@ function buildCategoriesQuery(depth) {
|
|
|
1592
1592
|
categories {
|
|
1593
1593
|
categoryId
|
|
1594
1594
|
hidden
|
|
1595
|
-
names
|
|
1596
|
-
slugs
|
|
1595
|
+
names { value language }
|
|
1596
|
+
slugs { value language }
|
|
1597
1597
|
${buildCategoriesQuery(depth - 1)}
|
|
1598
1598
|
}
|
|
1599
1599
|
`;
|
|
1600
1600
|
}
|
|
1601
1601
|
function mapCategory(raw, language) {
|
|
1602
1602
|
const nameEntry = raw.names?.find((n) => n.language === language) ?? raw.names?.[0];
|
|
1603
|
-
const slugEntry = raw.slugs?.[0];
|
|
1603
|
+
const slugEntry = raw.slugs?.find((s) => s.language === language) ?? raw.slugs?.[0];
|
|
1604
1604
|
return {
|
|
1605
1605
|
categoryId: raw.categoryId,
|
|
1606
1606
|
name: nameEntry?.value ?? "",
|
|
@@ -1676,17 +1676,17 @@ function useMenu(options) {
|
|
|
1676
1676
|
inflightFetches.set(key, promise);
|
|
1677
1677
|
try {
|
|
1678
1678
|
const gql = `
|
|
1679
|
-
query Menu($categoryId: Float
|
|
1679
|
+
query Menu($categoryId: Float) {
|
|
1680
1680
|
category(categoryId: $categoryId) {
|
|
1681
1681
|
categoryId
|
|
1682
1682
|
hidden
|
|
1683
|
-
names
|
|
1684
|
-
slugs
|
|
1683
|
+
names { value language }
|
|
1684
|
+
slugs { value language }
|
|
1685
1685
|
${buildCategoriesQuery(depth)}
|
|
1686
1686
|
}
|
|
1687
1687
|
}
|
|
1688
1688
|
`;
|
|
1689
|
-
const variables = { categoryId: rootCategoryId
|
|
1689
|
+
const variables = { categoryId: rootCategoryId };
|
|
1690
1690
|
const data = await graphqlClient.query(gql, variables);
|
|
1691
1691
|
const root = data?.category ?? null;
|
|
1692
1692
|
const items = root ? (root.categories ?? []).filter((cat) => !isHidden(cat)).map((cat) => mapCategory(cat, language)) : [];
|