@graphcommerce/magento-product 4.3.1 → 4.3.4

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
@@ -1,5 +1,68 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`c30893857`](https://github.com/graphcommerce-org/graphcommerce/commit/c3089385791291e812a48c2691a39a2325ee0439)]:
8
+ - @graphcommerce/magento-store@4.2.3
9
+ - @graphcommerce/magento-cart@4.2.14
10
+
11
+ ## 4.3.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#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.
16
+
17
+ Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
18
+
19
+ All occurences of `<Trans>` and `t` need to be replaced:
20
+
21
+ ```tsx
22
+ import { Trans, t } from '@lingui/macro'
23
+
24
+ function MyComponent() {
25
+ const foo = 'bar'
26
+ return (
27
+ <div aria-label={t`Account ${foo}`}>
28
+ <Trans>My Translation {foo}</Trans>
29
+ </div>
30
+ )
31
+ }
32
+ ```
33
+
34
+ Needs to be replaced with:
35
+
36
+ ```tsx
37
+ import { Trans } from '@lingui/react'
38
+ import { i18n } from '@lingui/core'
39
+
40
+ function MyComponent() {
41
+ const foo = 'bar'
42
+ return (
43
+ <div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
44
+ <Trans key='My Translation {foo}' values={{ foo }}></Trans>
45
+ </div>
46
+ )
47
+ }
48
+ ```
49
+
50
+ [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)
51
+
52
+ - Updated dependencies [[`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
53
+ - @graphcommerce/framer-scroller@2.1.10
54
+ - @graphcommerce/magento-cart@4.2.13
55
+ - @graphcommerce/magento-store@4.2.2
56
+ - @graphcommerce/next-ui@4.7.2
57
+ - @graphcommerce/graphql@3.1.3
58
+
59
+ ## 4.3.2
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies []:
64
+ - @graphcommerce/magento-cart@4.2.12
65
+
3
66
  ## 4.3.1
4
67
 
5
68
  ### Patch Changes
@@ -10,7 +10,7 @@ import {
10
10
  extendableComponent,
11
11
  AnimatedRow,
12
12
  } from '@graphcommerce/next-ui'
13
- import { Trans } from '@lingui/macro'
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>Add to Cart</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>View shopping cart</Trans>
128
+ <Trans id='View shopping cart' />
129
129
  </Button>
130
130
  </PageLink>
131
131
  }
132
132
  >
133
- <Trans>
134
- <strong>{name}</strong> has been added to your shopping cart!
135
- </Trans>
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/macro'
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>no products</Trans>}
39
- {total_count === 1 && <Trans>one product</Trans>}
40
- {(total_count ?? 0) > 1 && <Trans>{total_count} products</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/macro'
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 <Money round value={Number(currentFilter?.to)} />
84
- </Trans>
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 <Money round value={Number(currentFilter?.from)} />
91
- </Trans>
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/macro'
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>No Image</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/macro'
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>Sort By</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.1",
5
+ "version": "4.3.4",
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.6",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.7",
16
16
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
17
- "@graphcommerce/typescript-config-pwa": "^4.0.2",
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.9",
23
- "@graphcommerce/graphql": "3.1.2",
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.11",
27
- "@graphcommerce/magento-store": "4.2.1",
28
- "@graphcommerce/next-ui": "4.7.1",
26
+ "@graphcommerce/magento-cart": "4.2.14",
27
+ "@graphcommerce/magento-store": "4.2.3",
28
+ "@graphcommerce/next-ui": "4.7.2",
29
29
  "schema-dts": "^1.1.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@lingui/macro": "^3.13.2",
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",