@graphcommerce/magento-search 4.1.9 → 4.1.10

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,51 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.1.10
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 [[`50188e378`](https://github.com/graphcommerce-org/graphcommerce/commit/50188e378b4c77561ebc600958ea11cd114fa61a), [`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
45
+ - @graphcommerce/react-hook-form@3.1.3
46
+ - @graphcommerce/next-ui@4.7.2
47
+ - @graphcommerce/graphql@3.1.3
48
+
3
49
  ## 4.1.9
4
50
 
5
51
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import { extendableComponent } from '@graphcommerce/next-ui'
2
- import { Trans } from '@lingui/macro'
2
+ import { Trans } from '@lingui/react'
3
3
  import { Box, SxProps, Theme, Typography } from '@mui/material'
4
4
 
5
5
  export type NoSearchResultsProps = { search: string; sx?: SxProps<Theme> }
@@ -26,10 +26,10 @@ export function NoSearchResults(props: NoSearchResultsProps) {
26
26
  ]}
27
27
  >
28
28
  <Typography variant='h5' align='center'>
29
- <Trans>We couldn&apos;t find any results for {term}</Trans>
29
+ <Trans id="We couldn't find any results for {term}" values={{ term }} />
30
30
  </Typography>
31
31
  <p>
32
- <Trans>Try a different search</Trans>
32
+ <Trans id='Try a different search' />
33
33
  </p>
34
34
  </Box>
35
35
  )
@@ -1,5 +1,5 @@
1
1
  import { iconSearch, responsiveVal, IconSvg, extendableComponent } from '@graphcommerce/next-ui'
2
- import { Trans } from '@lingui/macro'
2
+ import { Trans } from '@lingui/react'
3
3
  import { TextField, TextFieldProps } from '@mui/material'
4
4
 
5
5
  export type SearchButtonProps = TextFieldProps
@@ -22,7 +22,7 @@ export function SearchButton(props: SearchButtonProps) {
22
22
  variant='outlined'
23
23
  size='small'
24
24
  className={classes.root}
25
- label={label ?? <Trans>Search...</Trans>}
25
+ label={label ?? <Trans id='Search...' />}
26
26
  id='search-input'
27
27
  InputLabelProps={{ shrink: false }}
28
28
  InputProps={{
@@ -6,7 +6,8 @@ import {
6
6
  extendableComponent,
7
7
  } from '@graphcommerce/next-ui'
8
8
  import { useForm, useFormAutoSubmit, useFormMuiRegister } from '@graphcommerce/react-hook-form'
9
- import { t, Trans } from '@lingui/macro'
9
+ import { i18n } from '@lingui/core'
10
+ import { Trans } from '@lingui/react'
10
11
  import { Box, IconButton, SxProps, TextField, TextFieldProps, Theme } from '@mui/material'
11
12
  import { useRouter } from 'next/router'
12
13
 
@@ -60,8 +61,8 @@ export function SearchForm(props: SearchFormProps) {
60
61
  paddingRight: '7px',
61
62
  })}
62
63
  >
63
- {totalResults === 1 && <Trans>{totalResults} result</Trans>}
64
- {totalResults > 1 && <Trans>{totalResults} results</Trans>}
64
+ {totalResults === 1 && <Trans id='{totalResults} result' values={{ totalResults }} />}
65
+ {totalResults > 1 && <Trans id='{totalResults} results' values={{ totalResults }} />}
65
66
  </Box>
66
67
  )}
67
68
  <IconButton onClick={handleReset} size='small'>
@@ -88,7 +89,7 @@ export function SearchForm(props: SearchFormProps) {
88
89
  <TextField
89
90
  variant='outlined'
90
91
  type='text'
91
- placeholder={t`Search`}
92
+ placeholder={i18n._(/* i18n */ `Search`)}
92
93
  defaultValue={search}
93
94
  error={formState.isSubmitted && !!formState.errors.search}
94
95
  helperText={formState.isSubmitted && formState.errors.search?.message}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-search",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.1.9",
5
+ "version": "4.1.10",
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.2",
22
+ "@graphcommerce/graphql": "3.1.3",
23
23
  "@graphcommerce/image": "3.1.5",
24
- "@graphcommerce/next-ui": "4.7.1",
25
- "@graphcommerce/react-hook-form": "3.1.2"
24
+ "@graphcommerce/next-ui": "4.7.2",
25
+ "@graphcommerce/react-hook-form": "3.1.3"
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",