@graphcommerce/magento-store 4.1.9 → 4.2.2

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,70 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.2.2
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/next-ui@4.7.2
46
+ - @graphcommerce/graphql@3.1.3
47
+
48
+ ## 4.2.1
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [[`25ef6cf08`](https://github.com/graphcommerce-org/graphcommerce/commit/25ef6cf08c278105307d6f604b7135d637e9046c), [`80e30bb77`](https://github.com/graphcommerce-org/graphcommerce/commit/80e30bb77015755fbc00a7935d590f80c1c1c18c)]:
53
+ - @graphcommerce/graphql@3.1.2
54
+ - @graphcommerce/graphql-mesh@4.1.3
55
+ - @graphcommerce/next-ui@4.7.1
56
+
57
+ ## 4.2.0
58
+
59
+ ### Minor Changes
60
+
61
+ - [#1416](https://github.com/graphcommerce-org/graphcommerce/pull/1416) [`f3d06dd83`](https://github.com/graphcommerce-org/graphcommerce/commit/f3d06dd836c9a76412b419d4d2c79bbd0ee92e04) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - SEO audit
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [[`f3d06dd83`](https://github.com/graphcommerce-org/graphcommerce/commit/f3d06dd836c9a76412b419d4d2c79bbd0ee92e04)]:
66
+ - @graphcommerce/next-ui@4.7.0
67
+
3
68
  ## 4.1.9
4
69
 
5
70
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import { useQuery } from '@graphcommerce/graphql'
2
2
  import { FlagAvatar, extendableComponent } from '@graphcommerce/next-ui'
3
3
  import { Button, SxProps, Theme } from '@mui/material'
4
- import PageLink from 'next/link'
4
+ import { useRouter } from 'next/router'
5
5
  import { StoreConfigDocument } from '../../StoreConfig.gql'
6
6
 
7
7
  export type StoreSwitcherButtonProps = { sx?: SxProps<Theme> }
@@ -14,17 +14,22 @@ export function StoreSwitcherButton(props: StoreSwitcherButtonProps) {
14
14
  const { sx } = props
15
15
  const config = useQuery(StoreConfigDocument)
16
16
  const country = config.data?.storeConfig?.locale?.split('_')?.[1]?.toLowerCase() ?? ''
17
+ const router = useRouter()
17
18
 
18
19
  return (
19
- <PageLink href='/switch-stores' passHref>
20
- <Button variant='text' size='medium' className={classes.root} sx={sx}>
21
- <FlagAvatar
22
- country={country}
23
- className={classes.avatar}
24
- sx={{ height: 20, width: 20, marginRight: '10px' }}
25
- />
26
- {config.data?.storeConfig?.store_name} - {config.data?.storeConfig?.base_currency_code}
27
- </Button>
28
- </PageLink>
20
+ <Button
21
+ variant='text'
22
+ size='medium'
23
+ className={classes.root}
24
+ onClick={() => router.push('/switch-stores')}
25
+ sx={sx}
26
+ >
27
+ <FlagAvatar
28
+ country={country}
29
+ className={classes.avatar}
30
+ sx={{ height: 20, width: 20, marginRight: '10px' }}
31
+ />
32
+ {config.data?.storeConfig?.store_name} - {config.data?.storeConfig?.base_currency_code}
33
+ </Button>
29
34
  )
30
35
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-store",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.1.9",
5
+ "version": "4.2.2",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,21 @@
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/graphql": "3.1.1",
23
- "@graphcommerce/graphql-mesh": "4.1.2",
22
+ "@graphcommerce/graphql": "3.1.3",
23
+ "@graphcommerce/graphql-mesh": "4.1.3",
24
24
  "@graphcommerce/image": "3.1.5",
25
- "@graphcommerce/next-ui": "4.6.2"
25
+ "@graphcommerce/next-ui": "4.7.2"
26
26
  },
27
27
  "peerDependencies": {
28
- "@lingui/macro": "^3.13.2",
28
+ "@lingui/react": "^3.13.2",
29
+ "@lingui/core": "^3.13.2",
29
30
  "@mui/material": "5.5.3",
30
31
  "next": "12.1.2",
31
32
  "react": "^17.0.2",