@graphcommerce/magento-cart-email 3.0.17 → 3.0.20
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 +71 -0
- package/EmailForm/EmailForm.tsx +9 -18
- package/package.json +12 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.0.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`0363b9671`](https://github.com/graphcommerce-org/graphcommerce/commit/0363b9671db7c2932321d97faf6f1eb385238397), [`c6a62a338`](https://github.com/graphcommerce-org/graphcommerce/commit/c6a62a338abf8af83d3a6eb7ed796586009910ca), [`3ac90b57c`](https://github.com/graphcommerce-org/graphcommerce/commit/3ac90b57c68b96f9d81771d6664ed9435a28fc1d), [`00f6167ff`](https://github.com/graphcommerce-org/graphcommerce/commit/00f6167ff4096bf7432f3d8e8e739ecbf6ab0dd2), [`7159d3ab3`](https://github.com/graphcommerce-org/graphcommerce/commit/7159d3ab31e937c9c921023c46e80db5813e789c), [`32370574b`](https://github.com/graphcommerce-org/graphcommerce/commit/32370574bef6345b857ae911049ca27a64bc7e08), [`ed2b67a06`](https://github.com/graphcommerce-org/graphcommerce/commit/ed2b67a0618d9db97e79ed2a8226e0ae12403943), [`4c146c682`](https://github.com/graphcommerce-org/graphcommerce/commit/4c146c68242e6edc616807fb73173cc959c26034)]:
|
|
8
|
+
- @graphcommerce/next-ui@4.8.0
|
|
9
|
+
- @graphcommerce/magento-product@4.3.5
|
|
10
|
+
- @graphcommerce/magento-customer@4.3.0
|
|
11
|
+
- @graphcommerce/magento-cart@4.2.15
|
|
12
|
+
- @graphcommerce/magento-store@4.2.4
|
|
13
|
+
|
|
14
|
+
## 3.0.19
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`c30893857`](https://github.com/graphcommerce-org/graphcommerce/commit/c3089385791291e812a48c2691a39a2325ee0439)]:
|
|
19
|
+
- @graphcommerce/magento-store@4.2.3
|
|
20
|
+
- @graphcommerce/magento-cart@4.2.14
|
|
21
|
+
- @graphcommerce/magento-customer@4.2.12
|
|
22
|
+
- @graphcommerce/magento-product@4.3.4
|
|
23
|
+
|
|
24
|
+
## 3.0.18
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#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.
|
|
29
|
+
|
|
30
|
+
Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
|
|
31
|
+
|
|
32
|
+
All occurences of `<Trans>` and `t` need to be replaced:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Trans, t } from '@lingui/macro'
|
|
36
|
+
|
|
37
|
+
function MyComponent() {
|
|
38
|
+
const foo = 'bar'
|
|
39
|
+
return (
|
|
40
|
+
<div aria-label={t`Account ${foo}`}>
|
|
41
|
+
<Trans>My Translation {foo}</Trans>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Needs to be replaced with:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Trans } from '@lingui/react'
|
|
51
|
+
import { i18n } from '@lingui/core'
|
|
52
|
+
|
|
53
|
+
function MyComponent() {
|
|
54
|
+
const foo = 'bar'
|
|
55
|
+
return (
|
|
56
|
+
<div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
|
|
57
|
+
<Trans key='My Translation {foo}' values={{ foo }}></Trans>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
[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)
|
|
64
|
+
|
|
65
|
+
- Updated dependencies [[`50188e378`](https://github.com/graphcommerce-org/graphcommerce/commit/50188e378b4c77561ebc600958ea11cd114fa61a), [`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
|
|
66
|
+
- @graphcommerce/react-hook-form@3.1.3
|
|
67
|
+
- @graphcommerce/magento-cart@4.2.13
|
|
68
|
+
- @graphcommerce/magento-customer@4.2.11
|
|
69
|
+
- @graphcommerce/magento-product@4.3.3
|
|
70
|
+
- @graphcommerce/magento-store@4.2.2
|
|
71
|
+
- @graphcommerce/next-ui@4.7.2
|
|
72
|
+
- @graphcommerce/graphql@3.1.3
|
|
73
|
+
|
|
3
74
|
## 3.0.17
|
|
4
75
|
|
|
5
76
|
### Patch Changes
|
package/EmailForm/EmailForm.tsx
CHANGED
|
@@ -11,16 +11,8 @@ import {
|
|
|
11
11
|
} from '@graphcommerce/magento-customer'
|
|
12
12
|
import { AnimatedRow, extendableComponent, FormDiv, FormRow } from '@graphcommerce/next-ui'
|
|
13
13
|
import { emailPattern, useFormCompose, UseFormComposeOptions } from '@graphcommerce/react-hook-form'
|
|
14
|
-
import { Trans } from '@lingui/
|
|
15
|
-
import {
|
|
16
|
-
CircularProgress,
|
|
17
|
-
TextField,
|
|
18
|
-
Typography,
|
|
19
|
-
Alert,
|
|
20
|
-
Button,
|
|
21
|
-
SxProps,
|
|
22
|
-
Theme,
|
|
23
|
-
} from '@mui/material'
|
|
14
|
+
import { Trans } from '@lingui/react'
|
|
15
|
+
import { CircularProgress, TextField, Typography, Alert, Button } from '@mui/material'
|
|
24
16
|
import { AnimatePresence } from 'framer-motion'
|
|
25
17
|
import React, { useEffect, useState } from 'react'
|
|
26
18
|
import { CartEmailDocument } from './CartEmail.gql'
|
|
@@ -28,7 +20,6 @@ import { SetGuestEmailOnCartDocument } from './SetGuestEmailOnCart.gql'
|
|
|
28
20
|
|
|
29
21
|
export type EmailFormProps = Pick<UseFormComposeOptions, 'step'> & {
|
|
30
22
|
children?: React.ReactNode
|
|
31
|
-
sx?: SxProps<Theme>
|
|
32
23
|
}
|
|
33
24
|
|
|
34
25
|
const name = 'EmailForm' as const
|
|
@@ -36,7 +27,7 @@ const parts = ['root', 'formRow'] as const
|
|
|
36
27
|
const { classes } = extendableComponent(name, parts)
|
|
37
28
|
|
|
38
29
|
export function EmailForm(props: EmailFormProps) {
|
|
39
|
-
const { step, children
|
|
30
|
+
const { step, children } = props
|
|
40
31
|
const [expand, setExpand] = useState(false)
|
|
41
32
|
|
|
42
33
|
useMergeCustomerCart()
|
|
@@ -67,27 +58,27 @@ export function EmailForm(props: EmailFormProps) {
|
|
|
67
58
|
if (mode === 'signin') {
|
|
68
59
|
endAdornment = (
|
|
69
60
|
<Button color='secondary' style={{ whiteSpace: 'nowrap' }} onClick={() => setExpand(!expand)}>
|
|
70
|
-
{expand ? <Trans
|
|
61
|
+
{expand ? <Trans id='Close' /> : <Trans id='Sign in' />}
|
|
71
62
|
</Button>
|
|
72
63
|
)
|
|
73
64
|
}
|
|
74
65
|
if (mode === 'signup') {
|
|
75
66
|
endAdornment = (
|
|
76
67
|
<Button color='secondary' style={{ whiteSpace: 'nowrap' }} onClick={() => setExpand(!expand)}>
|
|
77
|
-
{expand ? <Trans
|
|
68
|
+
{expand ? <Trans id='Close' /> : <Trans id='Create Account' />}
|
|
78
69
|
</Button>
|
|
79
70
|
)
|
|
80
71
|
}
|
|
81
72
|
if (formState.isSubmitting) endAdornment = <CircularProgress />
|
|
82
73
|
|
|
83
74
|
return (
|
|
84
|
-
<FormDiv
|
|
75
|
+
<FormDiv>
|
|
85
76
|
<AnimatePresence initial={false}>
|
|
86
77
|
<AnimatedRow key='emailform'>
|
|
87
78
|
<form noValidate onSubmit={submit}>
|
|
88
79
|
<FormRow>
|
|
89
80
|
<Typography variant='h5' component='h2' gutterBottom>
|
|
90
|
-
<Trans
|
|
81
|
+
<Trans id='Personal details' />
|
|
91
82
|
</Typography>
|
|
92
83
|
</FormRow>
|
|
93
84
|
<FormRow className={classes.formRow} sx={{ py: 0 }}>
|
|
@@ -96,7 +87,7 @@ export function EmailForm(props: EmailFormProps) {
|
|
|
96
87
|
type='email'
|
|
97
88
|
error={formState.isSubmitted && !!formState.errors.email}
|
|
98
89
|
helperText={formState.isSubmitted && formState.errors.email?.message}
|
|
99
|
-
label={<Trans
|
|
90
|
+
label={<Trans id='Email' />}
|
|
100
91
|
required={required.email}
|
|
101
92
|
{...muiRegister('email', {
|
|
102
93
|
required: required.email,
|
|
@@ -132,7 +123,7 @@ export function EmailForm(props: EmailFormProps) {
|
|
|
132
123
|
{mode === 'session-expired' && (
|
|
133
124
|
<FormRow>
|
|
134
125
|
<Alert severity='error'>
|
|
135
|
-
<Trans
|
|
126
|
+
<Trans id='You must sign in to continue' />
|
|
136
127
|
</Alert>
|
|
137
128
|
</FormRow>
|
|
138
129
|
)}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-cart-email",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.20",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,23 +12,24 @@
|
|
|
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
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/graphql": "3.1.
|
|
21
|
+
"@graphcommerce/graphql": "3.1.3",
|
|
22
22
|
"@graphcommerce/image": "3.1.5",
|
|
23
|
-
"@graphcommerce/magento-cart": "4.2.
|
|
24
|
-
"@graphcommerce/magento-customer": "4.
|
|
25
|
-
"@graphcommerce/magento-product": "4.3.
|
|
26
|
-
"@graphcommerce/magento-store": "4.2.
|
|
27
|
-
"@graphcommerce/next-ui": "4.
|
|
28
|
-
"@graphcommerce/react-hook-form": "3.1.
|
|
23
|
+
"@graphcommerce/magento-cart": "4.2.15",
|
|
24
|
+
"@graphcommerce/magento-customer": "4.3.0",
|
|
25
|
+
"@graphcommerce/magento-product": "4.3.5",
|
|
26
|
+
"@graphcommerce/magento-store": "4.2.4",
|
|
27
|
+
"@graphcommerce/next-ui": "4.8.0",
|
|
28
|
+
"@graphcommerce/react-hook-form": "3.1.3"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@lingui/
|
|
31
|
+
"@lingui/react": "^3.13.2",
|
|
32
|
+
"@lingui/core": "^3.13.2",
|
|
32
33
|
"@mui/material": "5.5.3",
|
|
33
34
|
"framer-motion": "^6.2.4",
|
|
34
35
|
"next": "12.1.2",
|