@graphcommerce/magento-category 4.4.0 → 4.5.1
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 +46 -0
- package/components/CategoryChildren/CategoryChildren.tsx +3 -5
- package/components/CategoryHeroNav/CategoryHeroNav.tsx +7 -3
- package/components/CategoryMeta/CategoryMeta.graphql +0 -1
- package/components/CategoryMeta/CategoryMeta.tsx +4 -7
- package/index.ts +1 -1
- package/package.json +8 -8
- package/{hooks/useMagentoMenuToNavigation.ts → utils/magentoMenuToNavigation.ts} +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @graphcommerce/magento-product@4.5.1
|
|
9
|
+
- @graphcommerce/magento-store@4.2.29
|
|
10
|
+
|
|
11
|
+
## 4.5.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#1602](https://github.com/graphcommerce-org/graphcommerce/pull/1602) [`5f781a217`](https://github.com/graphcommerce-org/graphcommerce/commit/5f781a217ce63ed56bc1a9983487b04400a8a315) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Default styles and layout fixes
|
|
16
|
+
|
|
17
|
+
- Scaled icons and fonts down. Size in typography is now more gradual: https://graphcommerce.vercel.app/test/typography
|
|
18
|
+
- Multiple accessibility fixes. Missing button/input labels, and fixed spacing issues resulting in high % appropriately sized tap targets
|
|
19
|
+
- Replaced responsiveVal usage with better performaning breakpointVal where possible
|
|
20
|
+
- All buttons are now Pill by default.
|
|
21
|
+
- Cleaned up checkout styles
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#1601](https://github.com/graphcommerce-org/graphcommerce/pull/1601) [`04708dacc`](https://github.com/graphcommerce-org/graphcommerce/commit/04708daccc213c6ea927bc67fa3bd0d5b1fad619) Thanks [@paales](https://github.com/paales)! - Navigation now uses a single `const selection = useNavigationSelection()` motionValue to control the state of the menu, to prevent excessive rerenders.
|
|
26
|
+
|
|
27
|
+
* [#1590](https://github.com/graphcommerce-org/graphcommerce/pull/1590) [`ec96a0eb0`](https://github.com/graphcommerce-org/graphcommerce/commit/ec96a0eb049ee2204f32f9c578455cf9c131dbd2) Thanks [@paales](https://github.com/paales)! - Filtered category pages are now servered by a separate route with getServerSideProps. Since there are practically infinite variations of filters, it doesn't make sense to query those on a URL level and we're leveraging the backend caching possibilities.
|
|
28
|
+
|
|
29
|
+
* Updated dependencies [[`b40a352f7`](https://github.com/graphcommerce-org/graphcommerce/commit/b40a352f7bccdb831dce1d45baf98d51b0921d58), [`04708dacc`](https://github.com/graphcommerce-org/graphcommerce/commit/04708daccc213c6ea927bc67fa3bd0d5b1fad619), [`bb94e7045`](https://github.com/graphcommerce-org/graphcommerce/commit/bb94e7045460cb671c45d612a0833731d7c20c30), [`b0dc4e2e1`](https://github.com/graphcommerce-org/graphcommerce/commit/b0dc4e2e1982d502d38dd50a0f493396360a7a15), [`4a5286dfe`](https://github.com/graphcommerce-org/graphcommerce/commit/4a5286dfeaa1719e594a0078f274fbab53969c4e), [`40983df17`](https://github.com/graphcommerce-org/graphcommerce/commit/40983df170ed0435c47496285dfe30aafeb2eeac), [`d46d5ed0c`](https://github.com/graphcommerce-org/graphcommerce/commit/d46d5ed0cc5794391b7527fc17bbb68ec2212e33), [`5f781a217`](https://github.com/graphcommerce-org/graphcommerce/commit/5f781a217ce63ed56bc1a9983487b04400a8a315), [`ec96a0eb0`](https://github.com/graphcommerce-org/graphcommerce/commit/ec96a0eb049ee2204f32f9c578455cf9c131dbd2)]:
|
|
30
|
+
- @graphcommerce/magento-product@4.5.0
|
|
31
|
+
- @graphcommerce/next-ui@4.22.0
|
|
32
|
+
- @graphcommerce/magento-store@4.2.28
|
|
33
|
+
- @graphcommerce/framer-scroller@2.1.33
|
|
34
|
+
- @graphcommerce/graphql@3.4.7
|
|
35
|
+
- @graphcommerce/image@3.1.9
|
|
36
|
+
|
|
37
|
+
## 4.4.1
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [[`1f7ee6f6c`](https://github.com/graphcommerce-org/graphcommerce/commit/1f7ee6f6cfb28544439ed36e10929ac530d1b2b7), [`707dbc73d`](https://github.com/graphcommerce-org/graphcommerce/commit/707dbc73d181204d88fdbbd2e09340e25b2b5f7b)]:
|
|
42
|
+
- @graphcommerce/next-ui@4.21.0
|
|
43
|
+
- @graphcommerce/graphql@3.4.6
|
|
44
|
+
- @graphcommerce/framer-scroller@2.1.32
|
|
45
|
+
- @graphcommerce/magento-product@4.4.25
|
|
46
|
+
- @graphcommerce/magento-store@4.2.27
|
|
47
|
+
- @graphcommerce/image@3.1.8
|
|
48
|
+
|
|
3
49
|
## 4.4.0
|
|
4
50
|
|
|
5
51
|
### Minor Changes
|
|
@@ -40,16 +40,14 @@ export function CategoryChildren(props: CategoryChildrenProps) {
|
|
|
40
40
|
{children.map((cat) => {
|
|
41
41
|
if (!cat?.url_path || !cat.name || !cat.include_in_menu) return null
|
|
42
42
|
|
|
43
|
-
const linkParams = cloneDeep(params)
|
|
44
|
-
linkParams.url = cat.url_path
|
|
45
|
-
delete linkParams.currentPage
|
|
46
|
-
|
|
47
43
|
return (
|
|
48
44
|
<ProductListLink
|
|
49
45
|
key={cat.url_path}
|
|
50
46
|
underline='none'
|
|
51
47
|
color='inherit'
|
|
52
|
-
{
|
|
48
|
+
url={cat.url_path}
|
|
49
|
+
filters={{ category_uid: { eq: cat.uid } }}
|
|
50
|
+
sort={params.sort}
|
|
53
51
|
className={classes.link}
|
|
54
52
|
sx={(theme) => ({
|
|
55
53
|
whiteSpace: 'nowrap',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProductListLink } from '@graphcommerce/magento-product'
|
|
2
|
-
import { responsiveVal, Row, extendableComponent } from '@graphcommerce/next-ui'
|
|
2
|
+
import { responsiveVal, breakpointVal, Row, extendableComponent } from '@graphcommerce/next-ui'
|
|
3
3
|
import { Box, SxProps, Theme, Typography } from '@mui/material'
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import { CategoryHeroNavFragment } from './CategoryHeroNav.gql'
|
|
@@ -33,7 +33,6 @@ export function CategoryHeroNav({ children, title, asset, sx = [] }: CategoryHer
|
|
|
33
33
|
marginBottom: theme.spacings.xxl,
|
|
34
34
|
paddingBottom: theme.page.vertical,
|
|
35
35
|
[theme.breakpoints.up('md')]: {
|
|
36
|
-
rowGap: theme.spacings.md,
|
|
37
36
|
width: '100%',
|
|
38
37
|
paddingRight: theme.page.horizontal,
|
|
39
38
|
paddingTop: 0,
|
|
@@ -117,7 +116,12 @@ export function CategoryHeroNav({ children, title, asset, sx = [] }: CategoryHer
|
|
|
117
116
|
'& video': {
|
|
118
117
|
objectFit: 'cover',
|
|
119
118
|
width: '100%',
|
|
120
|
-
|
|
119
|
+
...breakpointVal(
|
|
120
|
+
'borderRadius',
|
|
121
|
+
theme.shape.borderRadius * 2,
|
|
122
|
+
theme.shape.borderRadius * 3,
|
|
123
|
+
theme.breakpoints.values,
|
|
124
|
+
),
|
|
121
125
|
},
|
|
122
126
|
[theme.breakpoints.up('md')]: {
|
|
123
127
|
minHeight: '80vh',
|
|
@@ -5,13 +5,10 @@ import { i18n } from '@lingui/core'
|
|
|
5
5
|
import { CategoryMetaFragment } from './CategoryMeta.gql'
|
|
6
6
|
|
|
7
7
|
export type CategoryMetaProps = CategoryMetaFragment &
|
|
8
|
-
Partial<PageMetaProps> & {
|
|
9
|
-
params?: ProductListParams
|
|
10
|
-
current_page?: number | null | undefined
|
|
11
|
-
}
|
|
8
|
+
Partial<PageMetaProps> & { params?: ProductListParams }
|
|
12
9
|
|
|
13
10
|
export function CategoryMeta(props: CategoryMetaProps) {
|
|
14
|
-
const { meta_title, meta_description, name, params
|
|
11
|
+
const { meta_title, meta_description, name, params } = props
|
|
15
12
|
let {
|
|
16
13
|
title = meta_title ?? name ?? '',
|
|
17
14
|
metaDescription = meta_description ?? undefined,
|
|
@@ -21,8 +18,8 @@ export function CategoryMeta(props: CategoryMetaProps) {
|
|
|
21
18
|
|
|
22
19
|
if (params?.url && !canonical) canonical = `/${params.url}`
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const anyFilterActive =
|
|
22
|
+
Object.keys(params?.filters ?? {}).filter((k) => k !== 'category_uid').length > 0
|
|
26
23
|
const currentPage = params?.currentPage ?? 1
|
|
27
24
|
const isPaginated = currentPage > 1 && !anyFilterActive
|
|
28
25
|
|
package/index.ts
CHANGED
|
@@ -3,5 +3,5 @@ export * from './components/CategoryDescription/CategoryDescription'
|
|
|
3
3
|
export * from './components/CategoryHeroNav/CategoryHeroNav'
|
|
4
4
|
export * from './components/CategoryHeroNav/CategoryHeroNavTitle'
|
|
5
5
|
export * from './components/CategoryMeta/CategoryMeta'
|
|
6
|
-
export * from './
|
|
6
|
+
export * from './utils/magentoMenuToNavigation'
|
|
7
7
|
export * from './queries/getCategoryStaticPaths'
|
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.5.1",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.10",
|
|
16
16
|
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
17
17
|
"@graphcommerce/typescript-config-pwa": "^4.0.4",
|
|
18
18
|
"@playwright/test": "^1.21.1",
|
|
19
19
|
"type-fest": "^2.12.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
23
|
-
"@graphcommerce/graphql": "3.4.
|
|
24
|
-
"@graphcommerce/image": "3.1.
|
|
25
|
-
"@graphcommerce/magento-product": "4.
|
|
26
|
-
"@graphcommerce/magento-store": "4.2.
|
|
27
|
-
"@graphcommerce/next-ui": "4.
|
|
22
|
+
"@graphcommerce/framer-scroller": "2.1.33",
|
|
23
|
+
"@graphcommerce/graphql": "3.4.7",
|
|
24
|
+
"@graphcommerce/image": "3.1.9",
|
|
25
|
+
"@graphcommerce/magento-product": "4.5.1",
|
|
26
|
+
"@graphcommerce/magento-store": "4.2.29",
|
|
27
|
+
"@graphcommerce/next-ui": "4.22.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@lingui/react": "^3.13.2",
|
|
@@ -43,8 +43,18 @@ export function categoryToNav(props: Item | null | undefined): NavigationNode |
|
|
|
43
43
|
* Converts the Magento GraphQL category tree to a NavigationNode tree, which can be used in the
|
|
44
44
|
* Navigation component.
|
|
45
45
|
*/
|
|
46
|
-
export function
|
|
46
|
+
export function magentoMenuToNavigation(menu: MenuQueryFragment['menu'], includeRoot: boolean) {
|
|
47
47
|
return ((includeRoot ? menu?.items : menu?.items?.[0]?.children) || [])
|
|
48
48
|
.map(categoryToNav)
|
|
49
49
|
.filter(nonNullable)
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Converts the Magento GraphQL category tree to a NavigationNode tree, which can be used in the
|
|
54
|
+
* Navigation component.
|
|
55
|
+
*
|
|
56
|
+
* @deprecated Please use magentoMenuToNavigation instead.
|
|
57
|
+
*/
|
|
58
|
+
export function useMagentoMenuToNavigation(menu: MenuQueryFragment['menu'], includeRoot: boolean) {
|
|
59
|
+
return magentoMenuToNavigation(menu, includeRoot)
|
|
60
|
+
}
|