@graphcommerce/magento-product 8.0.6-canary.3 → 8.0.6
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 +1 -20
- package/components/AddProductsToCart/AddProductsToCartSnackbar.tsx +3 -2
- package/components/AddProductsToCart/useAddProductsToCartAction.ts +2 -4
- package/components/JsonLdProduct/JsonLdProductOffer.graphql +3 -2
- package/components/JsonLdProduct/ProductPageJsonLd.tsx +6 -4
- package/components/ProductAddToCart/ProductAddToCart.tsx +4 -6
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
@@ -1,25 +1,6 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## 8.0.6
|
4
|
-
|
5
|
-
## 8.0.6-canary.2
|
6
|
-
|
7
|
-
### Patch Changes
|
8
|
-
|
9
|
-
- [#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
|
10
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
11
|
-
|
12
|
-
- [#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
|
13
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
14
|
-
|
15
|
-
## 8.0.6-canary.1
|
16
|
-
|
17
|
-
## 8.0.6-canary.0
|
18
|
-
|
19
|
-
### Patch Changes
|
20
|
-
|
21
|
-
- [#2196](https://github.com/graphcommerce-org/graphcommerce/pull/2196) [`84c50e4`](https://github.com/graphcommerce-org/graphcommerce/commit/84c50e49a1a7f154d4a8f4045c37e773e20283ad) - Allow Lingui to use linguiLocale with country identifiers like `en-us`, it would always load `en` in this case. Introced a new `useLocale` hook to use the correct locale string to use in Intl methods.
|
22
|
-
([@paales](https://github.com/paales))
|
3
|
+
## 8.0.6
|
23
4
|
|
24
5
|
## 8.0.5
|
25
6
|
|
@@ -9,9 +9,9 @@ import {
|
|
9
9
|
MessageSnackbar,
|
10
10
|
MessageSnackbarProps,
|
11
11
|
nonNullable,
|
12
|
-
useLocale,
|
13
12
|
} from '@graphcommerce/next-ui'
|
14
13
|
import { Trans } from '@lingui/react'
|
14
|
+
import { useRouter } from 'next/router'
|
15
15
|
import { useMemo } from 'react'
|
16
16
|
import { findAddedItems } from './findAddedItems'
|
17
17
|
import { toUserErrors } from './toUserErrors'
|
@@ -26,8 +26,9 @@ export function AddProductsToCartSnackbar(props: AddProductsToCartSnackbarProps)
|
|
26
26
|
const { errorSnackbar, successSnackbar } = props
|
27
27
|
const { error, data, redirect, control, submittedVariables } = useFormAddProductsToCart()
|
28
28
|
const formState = useFormState({ control })
|
29
|
+
const { locale } = useRouter()
|
29
30
|
|
30
|
-
const formatter = new Intl.ListFormat(
|
31
|
+
const formatter = new Intl.ListFormat(locale, { style: 'long', type: 'conjunction' })
|
31
32
|
|
32
33
|
const userErrors = toUserErrors(data)
|
33
34
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useFormState } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { useEventCallback } from '@mui/material'
|
3
|
-
import {
|
3
|
+
import { 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,9 +69,7 @@ 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
|
-
|
73
|
-
onClickIncoming?.(e)
|
74
|
-
})
|
72
|
+
onClickIncoming?.(e)
|
75
73
|
}),
|
76
74
|
onMouseDown: useEventCallback((e) => e.stopPropagation()),
|
77
75
|
showSuccess,
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { JsonLd } from '@graphcommerce/next-ui'
|
2
2
|
import { JsonLdProductFragment } from './JsonLdProduct.gql'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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>) {
|
8
10
|
const { product, render } = props
|
9
11
|
return <JsonLd<T> item={render(product)} />
|
10
12
|
}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { NumberFieldElement } from '@graphcommerce/ecommerce-ui'
|
2
1
|
import type { ProductInterface } from '@graphcommerce/graphql-mesh'
|
3
2
|
import { ApolloCartErrorAlert, useFormGqlMutationCart } from '@graphcommerce/magento-cart'
|
4
3
|
import { Money, MoneyProps } from '@graphcommerce/magento-store'
|
5
4
|
import {
|
6
5
|
Button,
|
7
6
|
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,
|
43
|
+
const { handleSubmit, formState, error, muiRegister, required, data } = form
|
44
44
|
const submitHandler = handleSubmit(() => {})
|
45
45
|
|
46
46
|
return (
|
@@ -58,17 +58,15 @@ export function ProductAddToCart(
|
|
58
58
|
<Money {...price} />
|
59
59
|
</Typography>
|
60
60
|
|
61
|
-
<
|
61
|
+
<TextInputNumber
|
62
62
|
variant='outlined'
|
63
63
|
error={formState.isSubmitted && !!formState.errors.quantity}
|
64
64
|
required={required.quantity}
|
65
65
|
inputProps={{ min: 1 }}
|
66
|
-
|
67
|
-
rules={{ required: required.quantity }}
|
66
|
+
{...muiRegister('quantity', { required: required.quantity })}
|
68
67
|
helperText={formState.isSubmitted && formState.errors.quantity?.message}
|
69
68
|
disabled={formState.isSubmitting}
|
70
69
|
size='small'
|
71
|
-
control={control}
|
72
70
|
/>
|
73
71
|
{children}
|
74
72
|
<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
|
5
|
+
"version": "8.0.6",
|
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
|
22
|
-
"@graphcommerce/eslint-config-pwa": "^8.0.6
|
23
|
-
"@graphcommerce/framer-next-pages": "^8.0.6
|
24
|
-
"@graphcommerce/framer-scroller": "^8.0.6
|
25
|
-
"@graphcommerce/graphql": "^8.0.6
|
26
|
-
"@graphcommerce/graphql-mesh": "^8.0.6
|
27
|
-
"@graphcommerce/image": "^8.0.6
|
28
|
-
"@graphcommerce/magento-cart": "^8.0.6
|
29
|
-
"@graphcommerce/magento-store": "^8.0.6
|
30
|
-
"@graphcommerce/next-ui": "^8.0.6
|
31
|
-
"@graphcommerce/prettier-config-pwa": "^8.0.6
|
32
|
-
"@graphcommerce/typescript-config-pwa": "^8.0.6
|
21
|
+
"@graphcommerce/ecommerce-ui": "^8.0.6",
|
22
|
+
"@graphcommerce/eslint-config-pwa": "^8.0.6",
|
23
|
+
"@graphcommerce/framer-next-pages": "^8.0.6",
|
24
|
+
"@graphcommerce/framer-scroller": "^8.0.6",
|
25
|
+
"@graphcommerce/graphql": "^8.0.6",
|
26
|
+
"@graphcommerce/graphql-mesh": "^8.0.6",
|
27
|
+
"@graphcommerce/image": "^8.0.6",
|
28
|
+
"@graphcommerce/magento-cart": "^8.0.6",
|
29
|
+
"@graphcommerce/magento-store": "^8.0.6",
|
30
|
+
"@graphcommerce/next-ui": "^8.0.6",
|
31
|
+
"@graphcommerce/prettier-config-pwa": "^8.0.6",
|
32
|
+
"@graphcommerce/typescript-config-pwa": "^8.0.6",
|
33
33
|
"@lingui/core": "^4.2.1",
|
34
34
|
"@lingui/macro": "^4.2.1",
|
35
35
|
"@lingui/react": "^4.2.1",
|