@graphcommerce/magento-product 4.3.2 → 4.3.3
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 +48 -0
- package/components/ProductAddToCart/ProductAddToCart.tsx +7 -6
- package/components/ProductListCount/ProductListCount.tsx +4 -4
- package/components/ProductListFilters/FilterRangeType.tsx +9 -7
- package/components/ProductListItem/ProductListItem.tsx +2 -2
- package/components/ProductListSort/ProductListSort.tsx +2 -2
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1451](https://github.com/graphcommerce-org/graphcommerce/pull/1451) [`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061) Thanks [@paales](https://github.com/paales)! - Removed all occurences of @lingui/macro and moved to @lingui/macro / @lingui/core in preparation to move to swc.
|
|
8
|
+
|
|
9
|
+
Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
|
|
10
|
+
|
|
11
|
+
All occurences of `<Trans>` and `t` need to be replaced:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Trans, t } from '@lingui/macro'
|
|
15
|
+
|
|
16
|
+
function MyComponent() {
|
|
17
|
+
const foo = 'bar'
|
|
18
|
+
return (
|
|
19
|
+
<div aria-label={t`Account ${foo}`}>
|
|
20
|
+
<Trans>My Translation {foo}</Trans>
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Needs to be replaced with:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { Trans } from '@lingui/react'
|
|
30
|
+
import { i18n } from '@lingui/core'
|
|
31
|
+
|
|
32
|
+
function MyComponent() {
|
|
33
|
+
const foo = 'bar'
|
|
34
|
+
return (
|
|
35
|
+
<div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
|
|
36
|
+
<Trans key='My Translation {foo}' values={{ foo }}></Trans>
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[More examples for Trans](https://lingui.js.org/ref/macro.html#examples-of-jsx-macros) and [more examples for `t`](https://lingui.js.org/ref/macro.html#examples-of-js-macros)
|
|
43
|
+
|
|
44
|
+
- Updated dependencies [[`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
|
|
45
|
+
- @graphcommerce/framer-scroller@2.1.10
|
|
46
|
+
- @graphcommerce/magento-cart@4.2.13
|
|
47
|
+
- @graphcommerce/magento-store@4.2.2
|
|
48
|
+
- @graphcommerce/next-ui@4.7.2
|
|
49
|
+
- @graphcommerce/graphql@3.1.3
|
|
50
|
+
|
|
3
51
|
## 4.3.2
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
extendableComponent,
|
|
11
11
|
AnimatedRow,
|
|
12
12
|
} from '@graphcommerce/next-ui'
|
|
13
|
-
import { Trans } from '@lingui/
|
|
13
|
+
import { Trans } from '@lingui/react'
|
|
14
14
|
import { Divider, Typography, ButtonProps, Box, Alert } from '@mui/material'
|
|
15
15
|
import { AnimatePresence } from 'framer-motion'
|
|
16
16
|
import PageLink from 'next/link'
|
|
@@ -93,7 +93,7 @@ export function ProductAddToCart(
|
|
|
93
93
|
})}
|
|
94
94
|
{...buttonProps}
|
|
95
95
|
>
|
|
96
|
-
<Trans
|
|
96
|
+
<Trans id='Add to Cart' />
|
|
97
97
|
</Button>
|
|
98
98
|
{additionalButtons}
|
|
99
99
|
</Box>
|
|
@@ -125,14 +125,15 @@ export function ProductAddToCart(
|
|
|
125
125
|
color='secondary'
|
|
126
126
|
endIcon={<IconSvg src={iconChevronRight} />}
|
|
127
127
|
>
|
|
128
|
-
<Trans
|
|
128
|
+
<Trans id='View shopping cart' />
|
|
129
129
|
</Button>
|
|
130
130
|
</PageLink>
|
|
131
131
|
}
|
|
132
132
|
>
|
|
133
|
-
<Trans
|
|
134
|
-
<
|
|
135
|
-
|
|
133
|
+
<Trans
|
|
134
|
+
id='<0>{name}</0> has been added to your shopping cart!'
|
|
135
|
+
components={{ 0: <strong /> }}
|
|
136
|
+
/>
|
|
136
137
|
</MessageSnackbar>
|
|
137
138
|
</Box>
|
|
138
139
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { responsiveVal, extendableComponent } from '@graphcommerce/next-ui'
|
|
2
|
-
import { Trans } from '@lingui/
|
|
2
|
+
import { Trans } from '@lingui/react'
|
|
3
3
|
import { Box, Divider, SxProps, Theme, Typography } from '@mui/material'
|
|
4
4
|
import { ProductListCountFragment } from './ProductListCount.gql'
|
|
5
5
|
|
|
@@ -35,9 +35,9 @@ export function ProductListCount(props: ProductCountProps) {
|
|
|
35
35
|
>
|
|
36
36
|
<Divider component='div' className={classes.line} />
|
|
37
37
|
<Typography variant='body2' color='text.disabled' className={classes.count}>
|
|
38
|
-
{total_count === 0 && <Trans
|
|
39
|
-
{total_count === 1 && <Trans
|
|
40
|
-
{(total_count ?? 0) > 1 && <Trans
|
|
38
|
+
{total_count === 0 && <Trans id='no products' />}
|
|
39
|
+
{total_count === 1 && <Trans id='one product' />}
|
|
40
|
+
{(total_count ?? 0) > 1 && <Trans id='{total_count} products' values={{ total_count }} />}
|
|
41
41
|
</Typography>
|
|
42
42
|
<Divider component='div' className={classes.line} />
|
|
43
43
|
</Box>
|
|
@@ -2,7 +2,7 @@ import { cloneDeep } from '@graphcommerce/graphql'
|
|
|
2
2
|
import type { FilterRangeTypeInput } from '@graphcommerce/graphql-mesh'
|
|
3
3
|
import { Money } from '@graphcommerce/magento-store'
|
|
4
4
|
import { ChipMenu, ChipMenuProps, extendableComponent } from '@graphcommerce/next-ui'
|
|
5
|
-
import { Trans } from '@lingui/
|
|
5
|
+
import { Trans } from '@lingui/react'
|
|
6
6
|
import { Box, Slider } from '@mui/material'
|
|
7
7
|
import React, { useEffect } from 'react'
|
|
8
8
|
import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
|
|
@@ -79,16 +79,18 @@ export function FilterRangeType(props: FilterRangeTypeProps) {
|
|
|
79
79
|
|
|
80
80
|
if (from === min && to !== max)
|
|
81
81
|
currentLabel = (
|
|
82
|
-
<Trans
|
|
83
|
-
Below <
|
|
84
|
-
|
|
82
|
+
<Trans
|
|
83
|
+
id='Below <0/>'
|
|
84
|
+
components={{ 0: <Money round value={Number(currentFilter?.to)} /> }}
|
|
85
|
+
/>
|
|
85
86
|
)
|
|
86
87
|
|
|
87
88
|
if (from !== min && to === max)
|
|
88
89
|
currentLabel = (
|
|
89
|
-
<Trans
|
|
90
|
-
Above <
|
|
91
|
-
|
|
90
|
+
<Trans
|
|
91
|
+
id='Above <0/>'
|
|
92
|
+
components={{ 0: <Money round value={Number(currentFilter?.from)} /> }}
|
|
93
|
+
/>
|
|
92
94
|
)
|
|
93
95
|
|
|
94
96
|
if (from !== min && to !== max)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Image, ImageProps } from '@graphcommerce/image'
|
|
2
2
|
import { responsiveVal, extendableComponent } from '@graphcommerce/next-ui'
|
|
3
|
-
import { Trans } from '@lingui/
|
|
3
|
+
import { Trans } from '@lingui/react'
|
|
4
4
|
import { ButtonBase, Typography, Box, styled, SxProps, Theme } from '@mui/material'
|
|
5
5
|
import PageLink from 'next/link'
|
|
6
6
|
import { useRouter } from 'next/router'
|
|
@@ -135,7 +135,7 @@ export function ProductListItem(props: ProductListItemProps) {
|
|
|
135
135
|
}}
|
|
136
136
|
className={`${classes.placeholder} ${classes.image}`}
|
|
137
137
|
>
|
|
138
|
-
<Trans
|
|
138
|
+
<Trans id='No Image' />
|
|
139
139
|
</Box>
|
|
140
140
|
)}
|
|
141
141
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery, cloneDeep } from '@graphcommerce/graphql'
|
|
2
2
|
import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
|
3
3
|
import { ChipMenu, ChipMenuProps, extendableComponent } from '@graphcommerce/next-ui'
|
|
4
|
-
import { Trans } from '@lingui/
|
|
4
|
+
import { Trans } from '@lingui/react'
|
|
5
5
|
import { ListItem, ListItemText, SxProps, Theme } from '@mui/material'
|
|
6
6
|
import React from 'react'
|
|
7
7
|
import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
|
|
@@ -28,7 +28,7 @@ export function ProductListSort(props: ProductListSortProps) {
|
|
|
28
28
|
const [currentSort = defaultSort] = Object.keys(params.sort)
|
|
29
29
|
const currentOption = sort_fields?.options?.find((option) => option?.value === currentSort)
|
|
30
30
|
const selected = currentSort !== defaultSort
|
|
31
|
-
const label = <Trans
|
|
31
|
+
const label = <Trans id='Sort By' />
|
|
32
32
|
|
|
33
33
|
const removeFilter = () => {
|
|
34
34
|
const linkParams = cloneDeep(params)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.3.
|
|
5
|
+
"version": "4.3.3",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,24 +12,25 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.7",
|
|
16
16
|
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "^4.0.
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "^4.0.3",
|
|
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.1.
|
|
22
|
+
"@graphcommerce/framer-scroller": "2.1.10",
|
|
23
|
+
"@graphcommerce/graphql": "3.1.3",
|
|
24
24
|
"@graphcommerce/graphql-mesh": "4.1.3",
|
|
25
25
|
"@graphcommerce/image": "3.1.5",
|
|
26
|
-
"@graphcommerce/magento-cart": "4.2.
|
|
27
|
-
"@graphcommerce/magento-store": "4.2.
|
|
28
|
-
"@graphcommerce/next-ui": "4.7.
|
|
26
|
+
"@graphcommerce/magento-cart": "4.2.13",
|
|
27
|
+
"@graphcommerce/magento-store": "4.2.2",
|
|
28
|
+
"@graphcommerce/next-ui": "4.7.2",
|
|
29
29
|
"schema-dts": "^1.1.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@lingui/
|
|
32
|
+
"@lingui/react": "^3.13.2",
|
|
33
|
+
"@lingui/core": "^3.13.2",
|
|
33
34
|
"@mui/material": "5.5.3",
|
|
34
35
|
"framer-motion": "^6.2.4",
|
|
35
36
|
"next": "12.1.2",
|