@graphcommerce/magento-cart 4.2.2 → 4.2.5

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,45 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`4169b8c68`](https://github.com/graphcommerce-org/graphcommerce/commit/4169b8c686f682ff6e981b029f13abd87fd5f52a)]:
8
+ - @graphcommerce/magento-customer@4.2.3
9
+
10
+ ## 4.2.4
11
+
12
+ ### Patch Changes
13
+
14
+ - [#1379](https://github.com/graphcommerce-org/graphcommerce/pull/1379) [`b8d04130a`](https://github.com/graphcommerce-org/graphcommerce/commit/b8d04130a1b1cb8fc85308939235140288744465) Thanks [@paales](https://github.com/paales)! - Removed unused trigger: onChange for useForm handler
15
+
16
+ - Updated dependencies [[`3c801f45c`](https://github.com/graphcommerce-org/graphcommerce/commit/3c801f45c7df55131acf30ae2fe0d2344830d480), [`3192fab82`](https://github.com/graphcommerce-org/graphcommerce/commit/3192fab82560e2211dfcacadc3b0b305260527d8), [`104abd14e`](https://github.com/graphcommerce-org/graphcommerce/commit/104abd14e1585ef0d8de77937d25156b8fa1e201), [`0e425e85e`](https://github.com/graphcommerce-org/graphcommerce/commit/0e425e85ee8fed280349317ee0440c7bceea5823), [`2a125b1f9`](https://github.com/graphcommerce-org/graphcommerce/commit/2a125b1f98bb9272d96c3577f21d6c984caad892), [`8a354d1cd`](https://github.com/graphcommerce-org/graphcommerce/commit/8a354d1cd4757497ddfc9b1969a0addbc8ff616b)]:
17
+ - @graphcommerce/next-ui@4.6.0
18
+ - @graphcommerce/react-hook-form@3.1.0
19
+ - @graphcommerce/image@3.1.4
20
+ - @graphcommerce/ecommerce-ui@1.0.6
21
+ - @graphcommerce/framer-scroller@2.1.5
22
+ - @graphcommerce/magento-customer@4.2.2
23
+ - @graphcommerce/magento-store@4.1.6
24
+
25
+ ## 4.2.3
26
+
27
+ ### Patch Changes
28
+
29
+ - [#1378](https://github.com/graphcommerce-org/graphcommerce/pull/1378) [`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5) Thanks [@paales](https://github.com/paales)! - Pin all versions internally so we can’t end up in an unfixable state for the user
30
+
31
+ - Updated dependencies [[`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5), [`22ff9df16`](https://github.com/graphcommerce-org/graphcommerce/commit/22ff9df1677742ae8e07d9b7e5b12fbb487580dc)]:
32
+ - @graphcommerce/ecommerce-ui@1.0.5
33
+ - @graphcommerce/framer-next-pages@3.1.5
34
+ - @graphcommerce/framer-scroller@2.1.4
35
+ - @graphcommerce/graphql@3.0.7
36
+ - @graphcommerce/image@3.1.3
37
+ - @graphcommerce/magento-customer@4.2.1
38
+ - @graphcommerce/magento-graphql@3.0.6
39
+ - @graphcommerce/magento-store@4.1.5
40
+ - @graphcommerce/next-ui@4.5.1
41
+ - @graphcommerce/react-hook-form@3.0.7
42
+
3
43
  ## 4.2.2
4
44
 
5
45
  ### Patch Changes
@@ -40,11 +40,13 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
40
40
  )
41
41
  : []
42
42
 
43
- const form = useForm({ mode: 'onChange' })
43
+ const form = useForm()
44
44
 
45
45
  const { handleSubmit, formState, control } = form
46
46
 
47
- const submit = handleSubmit(() => {})
47
+ const submit = handleSubmit((values) => {
48
+ console.log(values)
49
+ })
48
50
 
49
51
  useFormPersist({ form, name: 'PaymentAgreementsForm' })
50
52
 
@@ -68,10 +70,12 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
68
70
  defaultValue=''
69
71
  name={`agreement[${agreement.agreement_id}]`}
70
72
  control={control}
71
- rules={{ required: t`You have to agree in order to proceed` }}
73
+ rules={{
74
+ required: t`You have to agree in order to proceed`,
75
+ }}
72
76
  render={({
73
77
  field: { onChange, value, name, ref, onBlur },
74
- fieldState: { error },
78
+ fieldState: { error, invalid },
75
79
  }) => (
76
80
  <FormControl
77
81
  error={!!formState.errors[String(agreement.agreement_id)]}
@@ -79,7 +83,17 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
79
83
  sx={{ display: 'block' }}
80
84
  >
81
85
  <FormControlLabel
82
- control={<Checkbox color='secondary' required />}
86
+ control={
87
+ <Checkbox
88
+ color='secondary'
89
+ required
90
+ checked={!!value}
91
+ name={name}
92
+ inputRef={ref}
93
+ onBlur={onBlur}
94
+ onChange={(e) => onChange(e)}
95
+ />
96
+ }
83
97
  label={
84
98
  <PageLink href={href} passHref>
85
99
  <Link color='secondary' underline='hover'>
@@ -87,13 +101,8 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
87
101
  </Link>
88
102
  </PageLink>
89
103
  }
90
- checked={!!value}
91
- inputRef={ref}
92
- onBlur={onBlur}
93
- name={name}
94
- onChange={(e) => onChange(e as React.ChangeEvent<HTMLInputElement>)}
95
104
  />
96
- {error?.message && <FormHelperText>{error.message}</FormHelperText>}
105
+ {error?.message && <FormHelperText error>{error.message}</FormHelperText>}
97
106
  </FormControl>
98
107
  )}
99
108
  />
@@ -37,6 +37,7 @@ export function CartStartCheckout(props: CartStartCheckoutProps) {
37
37
  >
38
38
  <PageLink href='/checkout' passHref>
39
39
  <Button
40
+ id='cart-start-checkout'
40
41
  variant='pill'
41
42
  color='secondary'
42
43
  size='large'
@@ -74,7 +74,7 @@ export function InlineAccount(props: InlineAccountProps) {
74
74
  })}
75
75
  >
76
76
  <div>
77
- <Typography variant='h4' className={classes.title} sx={{ paddingBottom: 8 }}>
77
+ <Typography variant='h4' className={classes.title} sx={{ paddingBottom: '8px' }}>
78
78
  {title ?? <Trans>No account yet?</Trans>}
79
79
  </Typography>
80
80
  {description ?? <Trans>You can track your order status and much more!</Trans>}
@@ -16,7 +16,7 @@ export function useCartQuery<Q, V extends { cartId: string; [index: string]: unk
16
16
  document: TypedDocumentNode<Q, V>,
17
17
  options: QueryHookOptions<Q, Omit<V, 'cartId'>> & { allowUrl?: boolean } = {},
18
18
  ) {
19
- const { allowUrl = false, ...queryOptions } = options
19
+ const { allowUrl = true, ...queryOptions } = options
20
20
 
21
21
  const router = useRouter()
22
22
  const currentCartId = useCurrentCartId()
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.2.2",
5
+ "version": "4.2.5",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,28 +12,28 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.1.3",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.4",
16
16
  "@graphcommerce/prettier-config-pwa": "^4.0.5",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
18
  "@playwright/test": "^1.20.1"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/ecommerce-ui": "^1.0.4",
22
- "@graphcommerce/framer-next-pages": "^3.1.4",
23
- "@graphcommerce/framer-scroller": "^2.1.3",
24
- "@graphcommerce/graphql": "^3.0.6",
25
- "@graphcommerce/image": "^3.1.2",
26
- "@graphcommerce/magento-customer": "^4.2.0",
27
- "@graphcommerce/magento-graphql": "^3.0.5",
28
- "@graphcommerce/magento-store": "^4.1.4",
29
- "@graphcommerce/next-ui": "^4.5.0",
30
- "@graphcommerce/react-hook-form": "^3.0.6"
21
+ "@graphcommerce/ecommerce-ui": "1.0.6",
22
+ "@graphcommerce/framer-next-pages": "3.1.5",
23
+ "@graphcommerce/framer-scroller": "2.1.5",
24
+ "@graphcommerce/graphql": "3.0.7",
25
+ "@graphcommerce/image": "3.1.4",
26
+ "@graphcommerce/magento-customer": "4.2.3",
27
+ "@graphcommerce/magento-graphql": "3.0.6",
28
+ "@graphcommerce/magento-store": "4.1.6",
29
+ "@graphcommerce/next-ui": "4.6.0",
30
+ "@graphcommerce/react-hook-form": "3.1.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@lingui/macro": "^3.13.2",
34
- "@mui/material": "^5.4.1",
34
+ "@mui/material": "5.5.3",
35
35
  "framer-motion": "^6.2.4",
36
- "next": "^12.0.10",
36
+ "next": "12.1.2",
37
37
  "react": "^17.0.2",
38
38
  "react-dom": "^17.0.2"
39
39
  }