@graphcommerce/magento-category 4.1.23 → 4.2.0
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 +39 -0
- package/hooks/useMagentoMenuToNavigation.ts +4 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1566](https://github.com/graphcommerce-org/graphcommerce/pull/1566) [`e167992df`](https://github.com/graphcommerce-org/graphcommerce/commit/e167992dfdc6964a392af719667f8a188626ab1b) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Introduced `@graphcommerce/next-ui/navigation` component.
|
|
8
|
+
|
|
9
|
+
- Navigation is always present in the DOM
|
|
10
|
+
- Configurable in LayoutNavigation.tsx
|
|
11
|
+
- Show categories directly, or nest them in a 'products' button
|
|
12
|
+
- Choose prefered mouseEvent: click or hover
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`e167992df`](https://github.com/graphcommerce-org/graphcommerce/commit/e167992dfdc6964a392af719667f8a188626ab1b), [`9c2504b4e`](https://github.com/graphcommerce-org/graphcommerce/commit/9c2504b4ed75f41d3003c4d3339814010e85e37e)]:
|
|
17
|
+
- @graphcommerce/next-ui@4.15.0
|
|
18
|
+
- @graphcommerce/framer-scroller@2.1.25
|
|
19
|
+
- @graphcommerce/magento-product@4.4.18
|
|
20
|
+
- @graphcommerce/magento-store@4.2.20
|
|
21
|
+
|
|
22
|
+
## 4.1.25
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [[`01f1588c9`](https://github.com/graphcommerce-org/graphcommerce/commit/01f1588c9200bb39dd61146e260bfa2b32060612)]:
|
|
27
|
+
- @graphcommerce/graphql@3.4.3
|
|
28
|
+
- @graphcommerce/magento-product@4.4.17
|
|
29
|
+
- @graphcommerce/magento-store@4.2.19
|
|
30
|
+
|
|
31
|
+
## 4.1.24
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [[`1afc6a547`](https://github.com/graphcommerce-org/graphcommerce/commit/1afc6a5473d6e31f47b5d0188801803b31865290), [`afcd8e4bf`](https://github.com/graphcommerce-org/graphcommerce/commit/afcd8e4bfb7010da4d5faeed85b61991ed7975f4), [`02e1988e5`](https://github.com/graphcommerce-org/graphcommerce/commit/02e1988e5f361c6f66ae30d3bbee38ef2ac062df), [`323fdee4b`](https://github.com/graphcommerce-org/graphcommerce/commit/323fdee4b15ae23e0e84dd0588cb2c6446dcfd50)]:
|
|
36
|
+
- @graphcommerce/graphql@3.4.2
|
|
37
|
+
- @graphcommerce/next-ui@4.14.0
|
|
38
|
+
- @graphcommerce/magento-product@4.4.16
|
|
39
|
+
- @graphcommerce/magento-store@4.2.18
|
|
40
|
+
- @graphcommerce/framer-scroller@2.1.24
|
|
41
|
+
|
|
3
42
|
## 4.1.23
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { NavigationNode, NavigationNodeButton, NavigationNodeHref } from '@graphcommerce/next-ui'
|
|
2
|
+
import { i18n } from '@lingui/core'
|
|
2
3
|
import { MenuQueryFragment } from '../queries/MenuQueryFragment.gql'
|
|
3
4
|
|
|
4
5
|
function nonNullable<T>(value: T): value is NonNullable<T> {
|
|
5
6
|
return value !== null && value !== undefined
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
type Item = NonNullable<NonNullable<MenuQueryFragment['menu']>['items']>[0]
|
|
9
|
+
export type Item = NonNullable<NonNullable<MenuQueryFragment['menu']>['items']>[0]
|
|
9
10
|
|
|
10
|
-
function categoryToNav(props: Item | null | undefined): NavigationNode | undefined {
|
|
11
|
+
export function categoryToNav(props: Item | null | undefined): NavigationNode | undefined {
|
|
11
12
|
if (!props) return undefined
|
|
12
13
|
const { uid, children, include_in_menu, name, url_path } = props
|
|
13
14
|
|
|
@@ -19,7 +20,7 @@ function categoryToNav(props: Item | null | undefined): NavigationNode | undefin
|
|
|
19
20
|
name,
|
|
20
21
|
id: uid,
|
|
21
22
|
childItems: [
|
|
22
|
-
{ name:
|
|
23
|
+
{ name: i18n._(/* i18n */ 'All {name}', { name }), href: `/${url_path}`, id: `${uid}-all` },
|
|
23
24
|
...children.map(categoryToNav).filter(nonNullable),
|
|
24
25
|
],
|
|
25
26
|
} as NavigationNodeButton
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-category",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.2.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"type-fest": "^2.12.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
23
|
-
"@graphcommerce/graphql": "3.4.
|
|
22
|
+
"@graphcommerce/framer-scroller": "2.1.25",
|
|
23
|
+
"@graphcommerce/graphql": "3.4.3",
|
|
24
24
|
"@graphcommerce/image": "3.1.7",
|
|
25
|
-
"@graphcommerce/magento-product": "4.4.
|
|
26
|
-
"@graphcommerce/magento-store": "4.2.
|
|
27
|
-
"@graphcommerce/next-ui": "4.
|
|
25
|
+
"@graphcommerce/magento-product": "4.4.18",
|
|
26
|
+
"@graphcommerce/magento-store": "4.2.20",
|
|
27
|
+
"@graphcommerce/next-ui": "4.15.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@lingui/react": "^3.13.2",
|