@graphcommerce/magento-newsletter 7.0.0-canary.21 → 7.0.1-canary.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +173 -1
- package/components/CheckoutNewsletter/CheckoutNewsletter.tsx +1 -1
- package/components/CustomerNewsletterToggle/CustomerNewsletterToggle.tsx +1 -0
- package/components/GuestNewsletter/GuestNewsletter.tsx +69 -0
- package/components/GuestNewsletterToggle/GuestNewsletterToggle.tsx +1 -0
- package/components/SignupNewsletter/SignupNewsletter.tsx +0 -1
- package/components/index.ts +1 -0
- package/package.json +13 -11
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,178 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## 7.0.
|
3
|
+
## 7.0.1-canary.0
|
4
|
+
|
5
|
+
## 7.0.0
|
6
|
+
|
7
|
+
### Patch Changes
|
8
|
+
|
9
|
+
- [#2021](https://github.com/graphcommerce-org/graphcommerce/pull/2021) [`06ab7d24d`](https://github.com/graphcommerce-org/graphcommerce/commit/06ab7d24dcf345c6acd39471df544a726a166ece) - Prevent email address overlap with toggle button on narrow columns ([@carlocarels90](https://github.com/carlocarels90))
|
10
|
+
|
11
|
+
- [#1959](https://github.com/graphcommerce-org/graphcommerce/pull/1959) [`f164217af`](https://github.com/graphcommerce-org/graphcommerce/commit/f164217af6847cff8555e19e7fc25f03528144e5) - Moved the GuestNewsletter component to inside the magento-newsletter package ([@JoshuaS98](https://github.com/JoshuaS98))
|
12
|
+
|
13
|
+
## 6.2.0-canary.98
|
14
|
+
|
15
|
+
## 6.2.0-canary.97
|
16
|
+
|
17
|
+
## 6.2.0-canary.96
|
18
|
+
|
19
|
+
## 6.2.0-canary.95
|
20
|
+
|
21
|
+
## 6.2.0-canary.94
|
22
|
+
|
23
|
+
## 6.2.0-canary.93
|
24
|
+
|
25
|
+
## 6.2.0-canary.92
|
26
|
+
|
27
|
+
## 6.2.0-canary.91
|
28
|
+
|
29
|
+
## 6.2.0-canary.90
|
30
|
+
|
31
|
+
## 6.2.0-canary.89
|
32
|
+
|
33
|
+
## 6.2.0-canary.88
|
34
|
+
|
35
|
+
## 6.2.0-canary.87
|
36
|
+
|
37
|
+
## 6.2.0-canary.86
|
38
|
+
|
39
|
+
## 6.2.0-canary.85
|
40
|
+
|
41
|
+
## 6.2.0-canary.84
|
42
|
+
|
43
|
+
## 6.2.0-canary.83
|
44
|
+
|
45
|
+
## 6.2.0-canary.82
|
46
|
+
|
47
|
+
### Patch Changes
|
48
|
+
|
49
|
+
- [#2021](https://github.com/graphcommerce-org/graphcommerce/pull/2021) [`06ab7d24d`](https://github.com/graphcommerce-org/graphcommerce/commit/06ab7d24dcf345c6acd39471df544a726a166ece) - Prevent email address overlap with toggle button on narrow columns ([@carlocarels90](https://github.com/carlocarels90))
|
50
|
+
|
51
|
+
## 6.2.0-canary.81
|
52
|
+
|
53
|
+
## 6.2.0-canary.80
|
54
|
+
|
55
|
+
## 6.2.0-canary.79
|
56
|
+
|
57
|
+
## 6.2.0-canary.78
|
58
|
+
|
59
|
+
## 6.2.0-canary.77
|
60
|
+
|
61
|
+
## 6.2.0-canary.76
|
62
|
+
|
63
|
+
## 6.2.0-canary.75
|
64
|
+
|
65
|
+
## 6.2.0-canary.74
|
66
|
+
|
67
|
+
## 6.2.0-canary.73
|
68
|
+
|
69
|
+
## 6.2.0-canary.72
|
70
|
+
|
71
|
+
## 6.2.0-canary.71
|
72
|
+
|
73
|
+
## 6.2.0-canary.70
|
74
|
+
|
75
|
+
## 6.2.0-canary.69
|
76
|
+
|
77
|
+
## 6.2.0-canary.68
|
78
|
+
|
79
|
+
## 6.2.0-canary.67
|
80
|
+
|
81
|
+
## 6.2.0-canary.66
|
82
|
+
|
83
|
+
## 6.2.0-canary.65
|
84
|
+
|
85
|
+
## 6.2.0-canary.64
|
86
|
+
|
87
|
+
## 6.2.0-canary.63
|
88
|
+
|
89
|
+
## 6.2.0-canary.62
|
90
|
+
|
91
|
+
## 6.2.0-canary.61
|
92
|
+
|
93
|
+
## 6.2.0-canary.60
|
94
|
+
|
95
|
+
## 6.2.0-canary.59
|
96
|
+
|
97
|
+
## 6.2.0-canary.58
|
98
|
+
|
99
|
+
## 6.2.0-canary.57
|
100
|
+
|
101
|
+
## 6.2.0-canary.56
|
102
|
+
|
103
|
+
## 6.2.0-canary.55
|
104
|
+
|
105
|
+
## 6.2.0-canary.54
|
106
|
+
|
107
|
+
## 6.2.0-canary.53
|
108
|
+
|
109
|
+
## 6.2.0-canary.52
|
110
|
+
|
111
|
+
## 6.2.0-canary.51
|
112
|
+
|
113
|
+
## 6.2.0-canary.50
|
114
|
+
|
115
|
+
## 6.2.0-canary.49
|
116
|
+
|
117
|
+
### Patch Changes
|
118
|
+
|
119
|
+
- [#1959](https://github.com/graphcommerce-org/graphcommerce/pull/1959) [`f164217af`](https://github.com/graphcommerce-org/graphcommerce/commit/f164217af6847cff8555e19e7fc25f03528144e5) - Moved the GuestNewsletter component to inside the magento-newsletter package ([@JoshuaS98](https://github.com/JoshuaS98))
|
120
|
+
|
121
|
+
## 6.2.0-canary.48
|
122
|
+
|
123
|
+
## 6.2.0-canary.47
|
124
|
+
|
125
|
+
## 6.2.0-canary.46
|
126
|
+
|
127
|
+
## 6.2.0-canary.45
|
128
|
+
|
129
|
+
## 6.2.0-canary.44
|
130
|
+
|
131
|
+
## 6.2.0-canary.43
|
132
|
+
|
133
|
+
## 6.2.0-canary.42
|
134
|
+
|
135
|
+
## 6.2.0-canary.41
|
136
|
+
|
137
|
+
## 6.2.0-canary.40
|
138
|
+
|
139
|
+
## 6.2.0-canary.39
|
140
|
+
|
141
|
+
## 6.2.0-canary.38
|
142
|
+
|
143
|
+
## 6.2.0-canary.37
|
144
|
+
|
145
|
+
## 6.2.0-canary.36
|
146
|
+
|
147
|
+
## 6.2.0-canary.35
|
148
|
+
|
149
|
+
## 6.2.0-canary.34
|
150
|
+
|
151
|
+
## 6.2.0-canary.33
|
152
|
+
|
153
|
+
## 6.2.0-canary.32
|
154
|
+
|
155
|
+
## 6.2.0-canary.31
|
156
|
+
|
157
|
+
## 6.2.0-canary.30
|
158
|
+
|
159
|
+
## 6.2.0-canary.29
|
160
|
+
|
161
|
+
## 6.2.0-canary.28
|
162
|
+
|
163
|
+
## 6.2.0-canary.27
|
164
|
+
|
165
|
+
## 6.2.0-canary.26
|
166
|
+
|
167
|
+
## 6.2.0-canary.25
|
168
|
+
|
169
|
+
## 6.2.0-canary.24
|
170
|
+
|
171
|
+
## 6.2.0-canary.23
|
172
|
+
|
173
|
+
## 6.2.0-canary.22
|
174
|
+
|
175
|
+
## 6.2.0-canary.21
|
4
176
|
|
5
177
|
## 6.2.0-canary.20
|
6
178
|
|
@@ -2,7 +2,7 @@ import { CheckboxElement, useFormCompose } from '@graphcommerce/ecommerce-ui'
|
|
2
2
|
import { DocumentNode } from '@graphcommerce/graphql'
|
3
3
|
import { useCartQuery } from '@graphcommerce/magento-cart'
|
4
4
|
import { useCustomerQuery, useCustomerSession } from '@graphcommerce/magento-customer'
|
5
|
-
import {
|
5
|
+
import { useFormGqlMutation, useFormPersist } from '@graphcommerce/react-hook-form'
|
6
6
|
import { Box, SxProps, Theme } from '@mui/material'
|
7
7
|
import { GetCustomerNewsletterToggleDocument } from '../CustomerNewsletterToggle/GetCustomerNewsLetterToggle.gql'
|
8
8
|
import { GetCartEmailDocument } from '../SignupNewsletter/GetCartEmail.gql'
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import {
|
2
|
+
ApolloErrorSnackbar,
|
3
|
+
TextFieldElement,
|
4
|
+
useFormGqlMutation,
|
5
|
+
} from '@graphcommerce/ecommerce-ui'
|
6
|
+
import { Form, MessageSnackbar, Button } from '@graphcommerce/next-ui'
|
7
|
+
import { i18n } from '@lingui/core'
|
8
|
+
import { Trans } from '@lingui/react'
|
9
|
+
import { SxProps, Theme } from '@mui/material'
|
10
|
+
import { GuestNewsletterToggleDocument } from '../GuestNewsletterToggle/GuestNewsletterToggle.gql'
|
11
|
+
|
12
|
+
type GuestNewsletterProps = {
|
13
|
+
sx?: SxProps<Theme>
|
14
|
+
}
|
15
|
+
|
16
|
+
export function GuestNewsletter(props: GuestNewsletterProps) {
|
17
|
+
const { sx = [] } = props
|
18
|
+
const form = useFormGqlMutation(GuestNewsletterToggleDocument, {}, { errorPolicy: 'all' })
|
19
|
+
|
20
|
+
const { handleSubmit, formState, error, control } = form
|
21
|
+
const submit = handleSubmit(() => {})
|
22
|
+
|
23
|
+
const submittedWithoutErrors = formState.isSubmitSuccessful && !error
|
24
|
+
|
25
|
+
return (
|
26
|
+
<Form
|
27
|
+
noValidate
|
28
|
+
onSubmit={submit}
|
29
|
+
sx={[(theme) => ({ gap: theme.spacings.xs }), ...(Array.isArray(sx) ? sx : [sx])]}
|
30
|
+
>
|
31
|
+
<TextFieldElement
|
32
|
+
required
|
33
|
+
variant='outlined'
|
34
|
+
type='email'
|
35
|
+
label={i18n._(/* i18n */ 'Email address')}
|
36
|
+
control={control}
|
37
|
+
name='email'
|
38
|
+
size='medium'
|
39
|
+
inputProps={{ autoComplete: 'email' }}
|
40
|
+
disabled={submittedWithoutErrors}
|
41
|
+
/>
|
42
|
+
|
43
|
+
<Button
|
44
|
+
loading={formState.isSubmitting}
|
45
|
+
variant='pill'
|
46
|
+
color='primary'
|
47
|
+
type='submit'
|
48
|
+
size='large'
|
49
|
+
disabled={submittedWithoutErrors}
|
50
|
+
>
|
51
|
+
{submittedWithoutErrors ? <Trans id='Subscribed' /> : <Trans id='Subscribe' />}
|
52
|
+
</Button>
|
53
|
+
|
54
|
+
<MessageSnackbar
|
55
|
+
open={submittedWithoutErrors}
|
56
|
+
variant='pill'
|
57
|
+
action={
|
58
|
+
<Button size='medium' variant='pill' color='secondary' fullWidth>
|
59
|
+
<Trans id='Ok' />
|
60
|
+
</Button>
|
61
|
+
}
|
62
|
+
>
|
63
|
+
<Trans id='You have been successfully subscribed to our newsletter.' />
|
64
|
+
</MessageSnackbar>
|
65
|
+
|
66
|
+
<ApolloErrorSnackbar error={error} />
|
67
|
+
</Form>
|
68
|
+
)
|
69
|
+
}
|
package/components/index.ts
CHANGED
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/magento-newsletter",
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
5
|
-
"version": "7.0.
|
5
|
+
"version": "7.0.1-canary.0",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -12,20 +12,22 @@
|
|
12
12
|
}
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
|
-
"@graphcommerce/eslint-config-pwa": "7.0.
|
16
|
-
"@graphcommerce/prettier-config-pwa": "7.0.
|
17
|
-
"@graphcommerce/typescript-config-pwa": "7.0.
|
15
|
+
"@graphcommerce/eslint-config-pwa": "7.0.1-canary.0",
|
16
|
+
"@graphcommerce/prettier-config-pwa": "7.0.1-canary.0",
|
17
|
+
"@graphcommerce/typescript-config-pwa": "7.0.1-canary.0"
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"@graphcommerce/
|
21
|
-
"@graphcommerce/
|
22
|
-
"@graphcommerce/magento-
|
23
|
-
"@graphcommerce/
|
24
|
-
"@graphcommerce/
|
20
|
+
"@graphcommerce/ecommerce-ui": "7.0.1-canary.0",
|
21
|
+
"@graphcommerce/graphql": "7.0.1-canary.0",
|
22
|
+
"@graphcommerce/magento-cart": "7.0.1-canary.0",
|
23
|
+
"@graphcommerce/magento-customer": "7.0.1-canary.0",
|
24
|
+
"@graphcommerce/next-ui": "7.0.1-canary.0",
|
25
|
+
"@graphcommerce/react-hook-form": "7.0.1-canary.0"
|
25
26
|
},
|
26
27
|
"peerDependencies": {
|
27
|
-
"@lingui/react": "^
|
28
|
-
"@lingui/core": "^
|
28
|
+
"@lingui/react": "^4.2.1",
|
29
|
+
"@lingui/core": "^4.2.1",
|
30
|
+
"@lingui/macro": "^4.2.1",
|
29
31
|
"@mui/material": "^5.10.16",
|
30
32
|
"framer-motion": "^10.0.0",
|
31
33
|
"next": "^13.2.0",
|