@graphcommerce/magento-cart-email 2.107.43 → 3.0.0

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,114 +1,126 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
3
+ ## 3.0.0
5
4
 
6
- # [2.107.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.106.4...@graphcommerce/magento-cart-email@2.107.0) (2021-12-01)
5
+ ### Major Changes
7
6
 
7
+ - [#1258](https://github.com/ho-nl/m2-pwa/pull/1258)
8
+ [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)
9
+ Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
8
10
 
9
- ### Features
11
+ ### Patch Changes
10
12
 
11
- * add title to login form ([563157b](https://github.com/ho-nl/m2-pwa/commit/563157bc7059d0b10d8e93c71b918b816ca45943))
13
+ - Updated dependencies
14
+ [[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
15
+ - @graphcommerce/graphql@3.0.0
16
+ - @graphcommerce/image@3.0.0
17
+ - @graphcommerce/magento-cart@4.0.0
18
+ - @graphcommerce/magento-customer@4.0.0
19
+ - @graphcommerce/magento-product@4.0.0
20
+ - @graphcommerce/magento-store@4.0.0
21
+ - @graphcommerce/next-ui@4.0.0
22
+ - @graphcommerce/react-hook-form@3.0.0
12
23
 
24
+ All notable changes to this project will be documented in this file. See
25
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
13
26
 
27
+ # [2.107.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.106.4...@graphcommerce/magento-cart-email@2.107.0) (2021-12-01)
14
28
 
29
+ ### Features
15
30
 
31
+ - add title to login form
32
+ ([563157b](https://github.com/ho-nl/m2-pwa/commit/563157bc7059d0b10d8e93c71b918b816ca45943))
16
33
 
17
34
  # [2.106.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.105.31...@graphcommerce/magento-cart-email@2.106.0) (2021-11-12)
18
35
 
19
-
20
36
  ### Bug Fixes
21
37
 
22
- * even more translations ([1a1f988](https://github.com/ho-nl/m2-pwa/commit/1a1f98837c704b978f6b42b619d9c52f540b2d48))
23
-
38
+ - even more translations
39
+ ([1a1f988](https://github.com/ho-nl/m2-pwa/commit/1a1f98837c704b978f6b42b619d9c52f540b2d48))
24
40
 
25
41
  ### Features
26
42
 
27
- * added tons of translations ([9bb0ac7](https://github.com/ho-nl/m2-pwa/commit/9bb0ac709b58df6ea6141e92e4923a5ca9ae2963))
28
-
29
-
30
-
31
-
43
+ - added tons of translations
44
+ ([9bb0ac7](https://github.com/ho-nl/m2-pwa/commit/9bb0ac709b58df6ea6141e92e4923a5ca9ae2963))
32
45
 
33
46
  ## [2.105.30](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.105.29...@graphcommerce/magento-cart-email@2.105.30) (2021-11-12)
34
47
 
35
-
36
48
  ### Bug Fixes
37
49
 
38
- * always show customer login form explanation ([ef51662](https://github.com/ho-nl/m2-pwa/commit/ef51662b91ad1d3851cfcc75925f8f81b214f348))
39
-
40
-
41
-
42
-
50
+ - always show customer login form explanation
51
+ ([ef51662](https://github.com/ho-nl/m2-pwa/commit/ef51662b91ad1d3851cfcc75925f8f81b214f348))
43
52
 
44
53
  ## [2.105.29](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.105.28...@graphcommerce/magento-cart-email@2.105.29) (2021-11-12)
45
54
 
46
-
47
55
  ### Bug Fixes
48
56
 
49
- * **checkout-email-form:** spacing too large ([f54e217](https://github.com/ho-nl/m2-pwa/commit/f54e2170b5c47c1c33e74db45e3bcae3d3523c4e))
50
-
51
-
52
-
53
-
57
+ - **checkout-email-form:** spacing too large
58
+ ([f54e217](https://github.com/ho-nl/m2-pwa/commit/f54e2170b5c47c1c33e74db45e3bcae3d3523c4e))
54
59
 
55
60
  # [2.105.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.104.37...@graphcommerce/magento-cart-email@2.105.0) (2021-10-27)
56
61
 
57
-
58
62
  ### Features
59
63
 
60
- * **nextjs:** upgraded to nextjs 12 ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
61
-
62
-
63
-
64
-
64
+ - **nextjs:** upgraded to nextjs 12
65
+ ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
65
66
 
66
67
  ## [2.104.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.104.0...@graphcommerce/magento-cart-email@2.104.1) (2021-09-27)
67
68
 
68
69
  **Note:** Version bump only for package @graphcommerce/magento-cart-email
69
70
 
70
-
71
-
72
-
73
-
74
71
  # 2.104.0 (2021-09-27)
75
72
 
76
-
77
73
  ### Bug Fixes
78
74
 
79
- * adjust imports to correct ones ([c6e3092](https://github.com/ho-nl/m2-pwa/commit/c6e3092569d1c49fe138b3810704da8e04acbbe2))
80
- * email field not filled in checkout ([910caca](https://github.com/ho-nl/m2-pwa/commit/910cacaa49fc5fef2ee4066df828c5a6dd4a2700))
81
- * ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
82
- * implement next-ui barrel imports ([75bea70](https://github.com/ho-nl/m2-pwa/commit/75bea703dba898f18a2a1dfa3243ebd0a4e6f0e1))
83
- * make sure ComposedForm actually submits correctly ([c6499d9](https://github.com/ho-nl/m2-pwa/commit/c6499d9d36f874cd65b310cbf7f63f5a88fa86cd))
84
- * make sure the session token gets deactivated when trying to merge carts when it cant ([2a9416b](https://github.com/ho-nl/m2-pwa/commit/2a9416b5c9efcd28a27f4183922ab419f62ea767))
85
- * ref couldn't be forwarded for ShippingAddressForm ([1f90f1a](https://github.com/ho-nl/m2-pwa/commit/1f90f1a30437d656fcf841026ad13bb2b45d831b))
86
- * rename NextButton to Button, change imports ([976adb0](https://github.com/ho-nl/m2-pwa/commit/976adb0bf906310d1efce888dcc9be1e28ce0f1b))
87
-
75
+ - adjust imports to correct ones
76
+ ([c6e3092](https://github.com/ho-nl/m2-pwa/commit/c6e3092569d1c49fe138b3810704da8e04acbbe2))
77
+ - email field not filled in checkout
78
+ ([910caca](https://github.com/ho-nl/m2-pwa/commit/910cacaa49fc5fef2ee4066df828c5a6dd4a2700))
79
+ - ignore md files from triggering version updates
80
+ ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
81
+ - implement next-ui barrel imports
82
+ ([75bea70](https://github.com/ho-nl/m2-pwa/commit/75bea703dba898f18a2a1dfa3243ebd0a4e6f0e1))
83
+ - make sure ComposedForm actually submits correctly
84
+ ([c6499d9](https://github.com/ho-nl/m2-pwa/commit/c6499d9d36f874cd65b310cbf7f63f5a88fa86cd))
85
+ - make sure the session token gets deactivated when trying to merge carts when it cant
86
+ ([2a9416b](https://github.com/ho-nl/m2-pwa/commit/2a9416b5c9efcd28a27f4183922ab419f62ea767))
87
+ - ref couldn't be forwarded for ShippingAddressForm
88
+ ([1f90f1a](https://github.com/ho-nl/m2-pwa/commit/1f90f1a30437d656fcf841026ad13bb2b45d831b))
89
+ - rename NextButton to Button, change imports
90
+ ([976adb0](https://github.com/ho-nl/m2-pwa/commit/976adb0bf906310d1efce888dcc9be1e28ce0f1b))
88
91
 
89
92
  ### Features
90
93
 
91
- * add barrel file for magento-customer ([02fb7f0](https://github.com/ho-nl/m2-pwa/commit/02fb7f004de968ee968b00e364b2b370f4f7d4f1))
92
- * **cart:** merge customer and guest carts when logging in ([25ebc0f](https://github.com/ho-nl/m2-pwa/commit/25ebc0f4e825f8512e2c3f1e01bf23a2d019b0d3))
93
- * **cart:** when a cart is not active anymore show a clear cart button ([5d04a14](https://github.com/ho-nl/m2-pwa/commit/5d04a14726c040b20b34c0b88f923aee1dff22e5))
94
- * **graphql:** introduced new graphql package that holds all generated files ([a3e7aa0](https://github.com/ho-nl/m2-pwa/commit/a3e7aa05540540533b5ced9a95f1f802ecbe499f))
95
- * **image:** introduced completely rewritten Image component ([e3413b3](https://github.com/ho-nl/m2-pwa/commit/e3413b3a57392d6571ea64cb8d9c8dca05ea31df))
96
- * **inline-account:** re-added the component ([c508d34](https://github.com/ho-nl/m2-pwa/commit/c508d341ca34daa26a6db13ead72f7f4bdc72160))
97
- * next.js 11 ([7d61407](https://github.com/ho-nl/m2-pwa/commit/7d614075a778f488045034f74be4f75b93f63c43))
98
- * **playwright:** added new playwright package to enable browser testing ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
99
- * renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of [@reachdigital](https://github.com/reachdigital) ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
100
- * submit composed form sequentially ([890d839](https://github.com/ho-nl/m2-pwa/commit/890d8393d635c3777aa17cfa8d4dafc13c2e6cdc))
101
- * upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
102
- * useFormMutationCart and simpler imports ([012f090](https://github.com/ho-nl/m2-pwa/commit/012f090e8f54d09f35d393c61ad1e2319f5a90ff))
103
-
94
+ - add barrel file for magento-customer
95
+ ([02fb7f0](https://github.com/ho-nl/m2-pwa/commit/02fb7f004de968ee968b00e364b2b370f4f7d4f1))
96
+ - **cart:** merge customer and guest carts when logging in
97
+ ([25ebc0f](https://github.com/ho-nl/m2-pwa/commit/25ebc0f4e825f8512e2c3f1e01bf23a2d019b0d3))
98
+ - **cart:** when a cart is not active anymore show a clear cart button
99
+ ([5d04a14](https://github.com/ho-nl/m2-pwa/commit/5d04a14726c040b20b34c0b88f923aee1dff22e5))
100
+ - **graphql:** introduced new graphql package that holds all generated files
101
+ ([a3e7aa0](https://github.com/ho-nl/m2-pwa/commit/a3e7aa05540540533b5ced9a95f1f802ecbe499f))
102
+ - **image:** introduced completely rewritten Image component
103
+ ([e3413b3](https://github.com/ho-nl/m2-pwa/commit/e3413b3a57392d6571ea64cb8d9c8dca05ea31df))
104
+ - **inline-account:** re-added the component
105
+ ([c508d34](https://github.com/ho-nl/m2-pwa/commit/c508d341ca34daa26a6db13ead72f7f4bdc72160))
106
+ - next.js 11
107
+ ([7d61407](https://github.com/ho-nl/m2-pwa/commit/7d614075a778f488045034f74be4f75b93f63c43))
108
+ - **playwright:** added new playwright package to enable browser testing
109
+ ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9))
110
+ - renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of
111
+ [@reachdigital](https://github.com/reachdigital)
112
+ ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe))
113
+ - submit composed form sequentially
114
+ ([890d839](https://github.com/ho-nl/m2-pwa/commit/890d8393d635c3777aa17cfa8d4dafc13c2e6cdc))
115
+ - upgraded to nextjs 11
116
+ ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
117
+ - useFormMutationCart and simpler imports
118
+ ([012f090](https://github.com/ho-nl/m2-pwa/commit/012f090e8f54d09f35d393c61ad1e2319f5a90ff))
104
119
 
105
120
  ### Reverts
106
121
 
107
- * Revert "chore: upgrade @apollo/client" ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
108
-
109
-
110
-
111
-
122
+ - Revert "chore: upgrade @apollo/client"
123
+ ([55ff24e](https://github.com/ho-nl/m2-pwa/commit/55ff24ede0e56c85b8095edadadd1ec5e0b1b8d2))
112
124
 
113
125
  # Change Log
114
126
 
@@ -126,8 +138,7 @@ All notable changes to this project will be documented in this file. See
126
138
 
127
139
  ### Bug Fixes
128
140
 
129
- - make sure the session token gets deactivated when trying to merge carts when
130
- it cant
141
+ - make sure the session token gets deactivated when trying to merge carts when it cant
131
142
  ([2a9416b](https://github.com/ho-nl/m2-pwa/commit/2a9416b5c9efcd28a27f4183922ab419f62ea767))
132
143
 
133
144
  ## [2.102.5](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart-email@2.102.4...@graphcommerce/magento-cart-email@2.102.5) (2021-08-13)
@@ -1,4 +1,4 @@
1
- import { useMutation } from '@apollo/client'
1
+ import { useMutation } from '@graphcommerce/graphql'
2
2
  import {
3
3
  ApolloCartErrorAlert,
4
4
  useCartQuery,
@@ -9,35 +9,34 @@ import {
9
9
  SignUpFormInline,
10
10
  useFormIsEmailAvailable,
11
11
  } from '@graphcommerce/magento-customer'
12
- import { AnimatedRow, Button, FormDiv, FormRow } from '@graphcommerce/next-ui'
12
+ import { AnimatedRow, extendableComponent, FormDiv, FormRow } from '@graphcommerce/next-ui'
13
13
  import { emailPattern, useFormCompose, UseFormComposeOptions } from '@graphcommerce/react-hook-form'
14
14
  import { Trans } from '@lingui/macro'
15
- import { CircularProgress, makeStyles, TextField, Typography } from '@material-ui/core'
16
- import { Alert } from '@material-ui/lab'
15
+ import {
16
+ CircularProgress,
17
+ TextField,
18
+ Typography,
19
+ Alert,
20
+ Button,
21
+ SxProps,
22
+ Theme,
23
+ } from '@mui/material'
17
24
  import { AnimatePresence } from 'framer-motion'
18
25
  import React, { useEffect, useState } from 'react'
19
- import EmailHelperList from '../EmailHelperList'
20
26
  import { CartEmailDocument } from './CartEmail.gql'
21
27
  import { SetGuestEmailOnCartDocument } from './SetGuestEmailOnCart.gql'
22
28
 
23
- const useStyles = makeStyles(
24
- () => ({
25
- helperList: {
26
- marginBottom: 0,
27
- },
28
- formRow: {
29
- paddingTop: 0,
30
- paddingBottom: 0,
31
- },
32
- }),
33
- { name: 'EmailForm' },
34
- )
35
-
36
- export type EmailFormProps = Pick<UseFormComposeOptions, 'step'>
29
+ export type EmailFormProps = Pick<UseFormComposeOptions, 'step'> & {
30
+ children?: React.ReactNode
31
+ sx?: SxProps<Theme>
32
+ }
33
+
34
+ const name = 'EmailForm' as const
35
+ const parts = ['root', 'formRow'] as const
36
+ const { classes } = extendableComponent(name, parts)
37
37
 
38
38
  export default function EmailForm(props: EmailFormProps) {
39
- const { step } = props
40
- const classes = useStyles()
39
+ const { step, children, sx } = props
41
40
  const [expand, setExpand] = useState(false)
42
41
 
43
42
  useMergeCustomerCart()
@@ -82,16 +81,16 @@ export default function EmailForm(props: EmailFormProps) {
82
81
  if (formState.isSubmitting) endAdornment = <CircularProgress />
83
82
 
84
83
  return (
85
- <FormDiv contained>
84
+ <FormDiv contained background='default' className={classes.root} sx={sx}>
86
85
  <AnimatePresence initial={false}>
87
86
  <AnimatedRow key='emailform'>
88
87
  <form noValidate onSubmit={submit}>
89
88
  <FormRow>
90
- <Typography variant='h5' gutterBottom>
89
+ <Typography variant='h5' component='h2' gutterBottom>
91
90
  <Trans>Login or create an account</Trans>
92
91
  </Typography>
93
92
  </FormRow>
94
- <FormRow className={classes.formRow}>
93
+ <FormRow className={classes.formRow} sx={{ py: 0 }}>
95
94
  <TextField
96
95
  variant='outlined'
97
96
  type='email'
@@ -124,13 +123,9 @@ export default function EmailForm(props: EmailFormProps) {
124
123
 
125
124
  {mode === 'signup' && expand && (
126
125
  <AnimatedRow key='inline-signup'>
127
- <SignUpFormInline
128
- helperList={
129
- <EmailHelperList key='signup-helper-list' classes={{ root: classes.helperList }} />
130
- }
131
- key='signup-form-inline'
132
- email={watch('email')}
133
- />
126
+ <SignUpFormInline key='signup-form-inline' email={watch('email')}>
127
+ {children}
128
+ </SignUpFormInline>
134
129
  </AnimatedRow>
135
130
  )}
136
131
 
@@ -141,10 +136,8 @@ export default function EmailForm(props: EmailFormProps) {
141
136
  </Alert>
142
137
  </FormRow>
143
138
  )}
144
- {mode !== 'session-expired' && ((mode !== 'signup' && expand) || !expand) && (
145
- <AnimatedRow key='email-helperlist'>
146
- <EmailHelperList />
147
- </AnimatedRow>
139
+ {children && mode !== 'session-expired' && ((mode !== 'signup' && expand) || !expand) && (
140
+ <AnimatedRow key='email-helperlist'>{children}</AnimatedRow>
148
141
  )}
149
142
  </AnimatePresence>
150
143
  </FormDiv>
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-cart-email",
3
- "version": "2.107.43",
3
+ "version": "3.0.0",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
- "browserslist": [
7
- "extends @graphcommerce/browserslist-config-pwa"
8
- ],
9
6
  "eslintConfig": {
10
7
  "extends": "@graphcommerce/eslint-config-pwa",
11
8
  "parserOptions": {
@@ -13,30 +10,25 @@
13
10
  }
14
11
  },
15
12
  "devDependencies": {
16
- "@graphcommerce/browserslist-config-pwa": "^3.0.3",
17
- "@graphcommerce/eslint-config-pwa": "^3.1.10",
18
- "@graphcommerce/prettier-config-pwa": "^3.0.5",
19
- "@graphcommerce/typescript-config-pwa": "^3.1.2",
20
- "@playwright/test": "^1.17.1"
13
+ "@graphcommerce/eslint-config-pwa": "^4.0.0",
14
+ "@graphcommerce/prettier-config-pwa": "^4.0.0",
15
+ "@graphcommerce/typescript-config-pwa": "^4.0.0",
16
+ "@playwright/test": "^1.18.1"
21
17
  },
22
18
  "dependencies": {
23
- "@apollo/client": "^3.5.6",
24
- "@graphcommerce/graphql": "^2.105.13",
25
- "@graphcommerce/image": "^2.105.13",
26
- "@graphcommerce/magento-cart": "^3.10.3",
27
- "@graphcommerce/magento-customer": "^3.6.44",
28
- "@graphcommerce/magento-product": "^3.8.13",
29
- "@graphcommerce/magento-store": "^3.4.12",
30
- "@graphcommerce/next-ui": "^3.25.3",
31
- "@graphcommerce/react-hook-form": "^2.104.7",
32
- "@lingui/macro": "^3.13.0",
33
- "@material-ui/core": "^4.12.3",
34
- "@material-ui/lab": "^4.0.0-alpha.60",
35
- "clsx": "^1.1.1",
36
- "framer-motion": "^5.5.5",
37
- "next": "^12.0.7",
19
+ "@graphcommerce/graphql": "^3.0.0",
20
+ "@graphcommerce/image": "^3.0.0",
21
+ "@graphcommerce/magento-cart": "^4.0.0",
22
+ "@graphcommerce/magento-customer": "^4.0.0",
23
+ "@graphcommerce/magento-product": "^4.0.0",
24
+ "@graphcommerce/magento-store": "^4.0.0",
25
+ "@graphcommerce/next-ui": "^4.0.0",
26
+ "@graphcommerce/react-hook-form": "^3.0.0",
27
+ "@lingui/macro": "^3.13.2",
28
+ "@mui/material": "^5.4.1",
29
+ "framer-motion": "^6.2.4",
30
+ "next": "^12.0.10",
38
31
  "react": "^17.0.2",
39
32
  "react-dom": "^17.0.2"
40
- },
41
- "gitHead": "41e42c8cd6f565ab0cbba81a1954a0041dc46768"
33
+ }
42
34
  }
@@ -1,34 +0,0 @@
1
- import { UseStyles } from '@graphcommerce/next-ui'
2
- import { Trans } from '@lingui/macro'
3
- import { makeStyles, Theme } from '@material-ui/core'
4
- import clsx from 'clsx'
5
-
6
- const useStyles = makeStyles(
7
- (theme: Theme) => ({
8
- root: {
9
- ...theme.typography.body2,
10
- paddingLeft: theme.spacings.xs,
11
- },
12
- }),
13
- { name: 'EmailHelperList' },
14
- )
15
-
16
- type HelperListProps = UseStyles<typeof useStyles>
17
-
18
- export default function EmailHelperList(props: HelperListProps) {
19
- const classes = useStyles(props)
20
-
21
- return (
22
- <ul className={clsx(classes.root)}>
23
- <li>
24
- <Trans>E-mail address of existing customers will be recognized, sign in is optional.</Trans>
25
- </li>
26
- <li>
27
- <Trans>Fill in password fields to create an account.</Trans>
28
- </li>
29
- <li>
30
- <Trans>Leave passwords fields empty to order as guest.</Trans>
31
- </li>
32
- </ul>
33
- )
34
- }