@graphcommerce/magento-product 8.0.6-canary.0 → 8.0.6-canary.2

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,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.6-canary.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`0767bc4`](https://github.com/graphcommerce-org/graphcommerce/commit/0767bc40f7b596209f24ca4e745ff0441f3275c9) - Upgrade input components to no longer use muiRegister, which improves INP scores
8
+ ([@FrankHarland](https://github.com/FrankHarland))
9
+
10
+ - [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`43bd04a`](https://github.com/graphcommerce-org/graphcommerce/commit/43bd04a777c5800cc7e01bee1e123a5aad82f194) - Prevent BillingPage query from rerunning on each mutation
11
+ ([@FrankHarland](https://github.com/FrankHarland))
12
+
13
+ ## 8.0.6-canary.1
14
+
3
15
  ## 8.0.6-canary.0
4
16
 
5
17
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import { useFormState } from '@graphcommerce/ecommerce-ui'
2
2
  import { useEventCallback } from '@mui/material'
3
- import { useEffect, useState } from 'react'
3
+ import { startTransition, useEffect, useState } from 'react'
4
4
  import { UseAddProductsToCartActionFragment } from './UseAddProductsToCartAction.gql'
5
5
  import { toUserErrors } from './toUserErrors'
6
6
  import { AddToCartItemSelector, useFormAddProductsToCart } from './useFormAddProductsToCart'
@@ -69,7 +69,9 @@ export function useAddProductsToCartAction(
69
69
  if (!sku) console.warn(`You must provide a 'sku' to useAddProductsToCartAction`)
70
70
  }
71
71
  setValue(`cartItems.${index}.sku`, sku ?? '')
72
- onClickIncoming?.(e)
72
+ startTransition(() => {
73
+ onClickIncoming?.(e)
74
+ })
73
75
  }),
74
76
  onMouseDown: useEventCallback((e) => e.stopPropagation()),
75
77
  showSuccess,
@@ -2,11 +2,10 @@ fragment JsonLdProductOffer on ProductInterface {
2
2
  price_range {
3
3
  minimum_price {
4
4
  regular_price {
5
- value
6
- currency
5
+ ...Money
7
6
  }
8
7
  final_price {
9
- value
8
+ ...Money
10
9
  }
11
10
  }
12
11
  }
@@ -1,12 +1,10 @@
1
1
  import { JsonLd } from '@graphcommerce/next-ui'
2
2
  import { JsonLdProductFragment } from './JsonLdProduct.gql'
3
3
 
4
- type ProductPageJsonLdProps<T extends { '@type': string }> = {
5
- product: JsonLdProductFragment
6
- render: (product: JsonLdProductFragment) => T & { '@context': 'https://schema.org' }
7
- }
8
-
9
- export function ProductPageJsonLd<T extends { '@type': string }>(props: ProductPageJsonLdProps<T>) {
4
+ export function ProductPageJsonLd<
5
+ T extends { '@type': string },
6
+ P extends JsonLdProductFragment,
7
+ >(props: { product: P; render: (product: P) => T & { '@context': 'https://schema.org' } }) {
10
8
  const { product, render } = props
11
9
  return <JsonLd<T> item={render(product)} />
12
10
  }
@@ -1,10 +1,10 @@
1
+ import { NumberFieldElement } from '@graphcommerce/ecommerce-ui'
1
2
  import type { ProductInterface } from '@graphcommerce/graphql-mesh'
2
3
  import { ApolloCartErrorAlert, useFormGqlMutationCart } from '@graphcommerce/magento-cart'
3
4
  import { Money, MoneyProps } from '@graphcommerce/magento-store'
4
5
  import {
5
6
  Button,
6
7
  MessageSnackbar,
7
- TextInputNumber,
8
8
  iconChevronRight,
9
9
  IconSvg,
10
10
  extendableComponent,
@@ -40,7 +40,7 @@ export function ProductAddToCart(
40
40
  defaultValues: { ...variables },
41
41
  })
42
42
 
43
- const { handleSubmit, formState, error, muiRegister, required, data } = form
43
+ const { handleSubmit, formState, error, control, required, data } = form
44
44
  const submitHandler = handleSubmit(() => {})
45
45
 
46
46
  return (
@@ -58,15 +58,17 @@ export function ProductAddToCart(
58
58
  <Money {...price} />
59
59
  </Typography>
60
60
 
61
- <TextInputNumber
61
+ <NumberFieldElement
62
62
  variant='outlined'
63
63
  error={formState.isSubmitted && !!formState.errors.quantity}
64
64
  required={required.quantity}
65
65
  inputProps={{ min: 1 }}
66
- {...muiRegister('quantity', { required: required.quantity })}
66
+ name='quantity'
67
+ rules={{ required: required.quantity }}
67
68
  helperText={formState.isSubmitted && formState.errors.quantity?.message}
68
69
  disabled={formState.isSubmitting}
69
70
  size='small'
71
+ control={control}
70
72
  />
71
73
  {children}
72
74
  <Box
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-product",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.0.6-canary.0",
5
+ "version": "8.0.6-canary.2",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -18,18 +18,18 @@
18
18
  "typescript": "5.3.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "@graphcommerce/ecommerce-ui": "^8.0.6-canary.0",
22
- "@graphcommerce/eslint-config-pwa": "^8.0.6-canary.0",
23
- "@graphcommerce/framer-next-pages": "^8.0.6-canary.0",
24
- "@graphcommerce/framer-scroller": "^8.0.6-canary.0",
25
- "@graphcommerce/graphql": "^8.0.6-canary.0",
26
- "@graphcommerce/graphql-mesh": "^8.0.6-canary.0",
27
- "@graphcommerce/image": "^8.0.6-canary.0",
28
- "@graphcommerce/magento-cart": "^8.0.6-canary.0",
29
- "@graphcommerce/magento-store": "^8.0.6-canary.0",
30
- "@graphcommerce/next-ui": "^8.0.6-canary.0",
31
- "@graphcommerce/prettier-config-pwa": "^8.0.6-canary.0",
32
- "@graphcommerce/typescript-config-pwa": "^8.0.6-canary.0",
21
+ "@graphcommerce/ecommerce-ui": "^8.0.6-canary.2",
22
+ "@graphcommerce/eslint-config-pwa": "^8.0.6-canary.2",
23
+ "@graphcommerce/framer-next-pages": "^8.0.6-canary.2",
24
+ "@graphcommerce/framer-scroller": "^8.0.6-canary.2",
25
+ "@graphcommerce/graphql": "^8.0.6-canary.2",
26
+ "@graphcommerce/graphql-mesh": "^8.0.6-canary.2",
27
+ "@graphcommerce/image": "^8.0.6-canary.2",
28
+ "@graphcommerce/magento-cart": "^8.0.6-canary.2",
29
+ "@graphcommerce/magento-store": "^8.0.6-canary.2",
30
+ "@graphcommerce/next-ui": "^8.0.6-canary.2",
31
+ "@graphcommerce/prettier-config-pwa": "^8.0.6-canary.2",
32
+ "@graphcommerce/typescript-config-pwa": "^8.0.6-canary.2",
33
33
  "@lingui/core": "^4.2.1",
34
34
  "@lingui/macro": "^4.2.1",
35
35
  "@lingui/react": "^4.2.1",