@graphcommerce/magento-product-configurable 10.0.0-canary.67 → 10.0.0-canary.72
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 +20 -0
- package/ConfigurableCartItem/OptionsList.tsx +4 -4
- package/Swatches/ColorSwatchData.tsx +11 -13
- package/Swatches/ImageSwatchData.tsx +5 -5
- package/Swatches/TextSwatchData.tsx +2 -5
- package/components/ConfigurableProductOptions/ConfigurableProductOption.tsx +2 -3
- package/package.json +19 -19
- package/plugins/ConfigurableProductPage/ConfigurableProductPageDescription.tsx +1 -1
- package/plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd.tsx +1 -1
- package/plugins/ConfigurableProductPage/ConfigurableProductPageMeta.tsx +0 -1
- package/utils/defaultConfigurableOptionsSelection.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.0.0-canary.72
|
|
4
|
+
|
|
5
|
+
## 10.0.0-canary.71
|
|
6
|
+
|
|
7
|
+
## 10.0.0-canary.70
|
|
8
|
+
|
|
9
|
+
### Major Changes
|
|
10
|
+
|
|
11
|
+
- [#2565](https://github.com/graphcommerce-org/graphcommerce/pull/2565) [`c96dfcd`](https://github.com/graphcommerce-org/graphcommerce/commit/c96dfcdca981baca387c270ad9e2b9515cdd00cc) - Updated to Apollo Client 4 ([@paales](https://github.com/paales))
|
|
12
|
+
|
|
13
|
+
## 10.0.0-canary.69
|
|
14
|
+
|
|
15
|
+
## 10.0.0-canary.68
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- [#2557](https://github.com/graphcommerce-org/graphcommerce/pull/2557) [`ceaadd8`](https://github.com/graphcommerce-org/graphcommerce/commit/ceaadd87f0648982a068a3b07b1fa149c9127f49) - ## Material UI v5 → v7 Migration
|
|
20
|
+
|
|
21
|
+
This release upgrades Material UI from v5 to v7 with full CSS variables support. ([@paales](https://github.com/paales))
|
|
22
|
+
|
|
3
23
|
## 10.0.0-canary.67
|
|
4
24
|
|
|
5
25
|
## 10.0.0-canary.66
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extendableComponent } from '@graphcommerce/next-ui'
|
|
1
|
+
import { extendableComponent, sxx } from '@graphcommerce/next-ui'
|
|
2
2
|
import type { SxProps, Theme } from '@mui/material'
|
|
3
3
|
import { Box } from '@mui/material'
|
|
4
4
|
import type { ConfigurableCartItemFragment } from './ConfigurableCartItem.gql'
|
|
@@ -18,15 +18,15 @@ export function OptionsList(props: CartItemOptionsListProps) {
|
|
|
18
18
|
return (
|
|
19
19
|
<Box
|
|
20
20
|
className={classes.root}
|
|
21
|
-
sx={
|
|
21
|
+
sx={sxx(
|
|
22
22
|
{
|
|
23
23
|
gridArea: 'itemOptions',
|
|
24
24
|
cursor: 'default',
|
|
25
25
|
marginLeft: 0,
|
|
26
26
|
paddingBottom: '4px',
|
|
27
27
|
},
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
sx,
|
|
29
|
+
)}
|
|
30
30
|
>
|
|
31
31
|
{configurable_options &&
|
|
32
32
|
configurable_options.map((option) => (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extendableComponent, responsiveVal } from '@graphcommerce/next-ui'
|
|
1
|
+
import { extendableComponent, responsiveVal, sxx } from '@graphcommerce/next-ui'
|
|
2
2
|
import type { SxProps, Theme } from '@mui/material'
|
|
3
3
|
import { Box } from '@mui/material'
|
|
4
4
|
import type { ColorSwatchDataFragment } from './ColorSwatchData.gql'
|
|
@@ -23,19 +23,17 @@ export function ColorSwatchData(props: ColorSwatchDataProps) {
|
|
|
23
23
|
<Box
|
|
24
24
|
className={classes.color}
|
|
25
25
|
style={{ backgroundColor: value ?? undefined }}
|
|
26
|
-
sx={
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
marginTop: responsiveVal(2, 4),
|
|
36
|
-
},
|
|
26
|
+
sx={sxx({
|
|
27
|
+
margin: '0 auto',
|
|
28
|
+
height: responsiveVal(22, 30),
|
|
29
|
+
width: responsiveVal(22, 30),
|
|
30
|
+
borderRadius: '50%',
|
|
31
|
+
'&.sizeSmall': {
|
|
32
|
+
height: responsiveVal(8, 12),
|
|
33
|
+
width: responsiveVal(8, 12),
|
|
34
|
+
marginTop: responsiveVal(2, 4),
|
|
37
35
|
},
|
|
38
|
-
|
|
36
|
+
})}
|
|
39
37
|
/>
|
|
40
38
|
{size !== 'small' && (
|
|
41
39
|
<Box component='span' className={classes.label}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Image } from '@graphcommerce/image'
|
|
2
|
-
import { extendableComponent, responsiveVal } from '@graphcommerce/next-ui'
|
|
2
|
+
import { extendableComponent, responsiveVal, sxx } from '@graphcommerce/next-ui'
|
|
3
3
|
import type { SxProps, Theme } from '@mui/material'
|
|
4
4
|
import { Box } from '@mui/material'
|
|
5
5
|
import type { ImageSwatchDataFragment } from './ImageSwatchData.gql'
|
|
@@ -20,12 +20,12 @@ export function ImageSwatchData(props: ImageSwatchDataProps) {
|
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<Box
|
|
23
|
-
sx={
|
|
23
|
+
sx={sxx(
|
|
24
24
|
(theme) => ({
|
|
25
25
|
'& .image': {
|
|
26
26
|
height: responsiveVal(40, 80),
|
|
27
27
|
width: responsiveVal(40, 80),
|
|
28
|
-
border: `3px solid ${theme.palette.divider}`,
|
|
28
|
+
border: `3px solid ${theme.vars.palette.divider}`,
|
|
29
29
|
boxSizing: 'border-box',
|
|
30
30
|
borderRadius: '50%',
|
|
31
31
|
objectFit: 'cover',
|
|
@@ -35,8 +35,8 @@ export function ImageSwatchData(props: ImageSwatchDataProps) {
|
|
|
35
35
|
height: 20,
|
|
36
36
|
},
|
|
37
37
|
}),
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
sx,
|
|
39
|
+
)}
|
|
40
40
|
>
|
|
41
41
|
{thumbnail ? (
|
|
42
42
|
<Image
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
|
-
import { extendableComponent } from '@graphcommerce/next-ui'
|
|
2
|
+
import { extendableComponent, sxx } from '@graphcommerce/next-ui'
|
|
3
3
|
import type { SxProps, Theme } from '@mui/material'
|
|
4
4
|
import { Box } from '@mui/material'
|
|
5
5
|
import type { TextSwatchDataFragment } from './TextSwatchData.gql'
|
|
@@ -18,10 +18,7 @@ export function TextSwatchData(props: TextSwatchDataProps) {
|
|
|
18
18
|
const classes = withState({ size })
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<Box
|
|
22
|
-
className={classes.root}
|
|
23
|
-
sx={[{ width: '100%', height: '100%' }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
24
|
-
>
|
|
21
|
+
<Box className={classes.root} sx={sxx({ width: '100%', height: '100%' }, sx)}>
|
|
25
22
|
{size !== 'small' ? (
|
|
26
23
|
<>
|
|
27
24
|
<Box
|
|
@@ -2,7 +2,7 @@ import type { ActionCardItemBase } from '@graphcommerce/ecommerce-ui'
|
|
|
2
2
|
import { ActionCardListForm } from '@graphcommerce/ecommerce-ui'
|
|
3
3
|
import type { AddProductsToCartFields } from '@graphcommerce/magento-product/components'
|
|
4
4
|
import { useFormAddProductsToCart } from '@graphcommerce/magento-product/components'
|
|
5
|
-
import { filterNonNullableKeys, nonNullable, SectionHeader } from '@graphcommerce/next-ui'
|
|
5
|
+
import { filterNonNullableKeys, nonNullable, SectionHeader, sxx } from '@graphcommerce/next-ui'
|
|
6
6
|
import { useWatch } from '@graphcommerce/react-hook-form'
|
|
7
7
|
import { t } from '@lingui/core/macro'
|
|
8
8
|
import type { SxProps, Theme } from '@mui/material'
|
|
@@ -77,13 +77,12 @@ export function ConfigurableProductOption(props: ConfigurableProductOptionProps)
|
|
|
77
77
|
if (!values) return null
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
|
-
<Box key={fieldName} sx={
|
|
80
|
+
<Box key={fieldName} sx={sx}>
|
|
81
81
|
<SectionHeader
|
|
82
82
|
labelLeft={optionStartLabels?.[attribute_code ?? ''] ?? label}
|
|
83
83
|
labelRight={optionEndLabels?.[attribute_code ?? '']}
|
|
84
84
|
sx={{ mt: 0 }}
|
|
85
85
|
/>
|
|
86
|
-
|
|
87
86
|
<ActionCardListForm<
|
|
88
87
|
ActionCardItemBase & ConfigurableOptionValueFragment,
|
|
89
88
|
AddProductsToCartFields
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-product-configurable",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "10.0.0-canary.
|
|
5
|
+
"version": "10.0.0-canary.72",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,27 +12,27 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/ecommerce-ui": "^10.0.0-canary.
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.
|
|
17
|
-
"@graphcommerce/graphql": "^10.0.0-canary.
|
|
18
|
-
"@graphcommerce/graphql-mesh": "^10.0.0-canary.
|
|
19
|
-
"@graphcommerce/image": "^10.0.0-canary.
|
|
20
|
-
"@graphcommerce/lingui-next": "10.0.0-canary.
|
|
21
|
-
"@graphcommerce/magento-cart": "^10.0.0-canary.
|
|
22
|
-
"@graphcommerce/magento-cart-items": "^10.0.0-canary.
|
|
23
|
-
"@graphcommerce/magento-category": "^10.0.0-canary.
|
|
24
|
-
"@graphcommerce/magento-customer": "^10.0.0-canary.
|
|
25
|
-
"@graphcommerce/magento-product": "^10.0.0-canary.
|
|
26
|
-
"@graphcommerce/magento-product-simple": "^10.0.0-canary.
|
|
27
|
-
"@graphcommerce/magento-store": "^10.0.0-canary.
|
|
28
|
-
"@graphcommerce/next-ui": "^10.0.0-canary.
|
|
29
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
30
|
-
"@graphcommerce/react-hook-form": "^10.0.0-canary.
|
|
31
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.
|
|
15
|
+
"@graphcommerce/ecommerce-ui": "^10.0.0-canary.72",
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.72",
|
|
17
|
+
"@graphcommerce/graphql": "^10.0.0-canary.72",
|
|
18
|
+
"@graphcommerce/graphql-mesh": "^10.0.0-canary.72",
|
|
19
|
+
"@graphcommerce/image": "^10.0.0-canary.72",
|
|
20
|
+
"@graphcommerce/lingui-next": "10.0.0-canary.72",
|
|
21
|
+
"@graphcommerce/magento-cart": "^10.0.0-canary.72",
|
|
22
|
+
"@graphcommerce/magento-cart-items": "^10.0.0-canary.72",
|
|
23
|
+
"@graphcommerce/magento-category": "^10.0.0-canary.72",
|
|
24
|
+
"@graphcommerce/magento-customer": "^10.0.0-canary.72",
|
|
25
|
+
"@graphcommerce/magento-product": "^10.0.0-canary.72",
|
|
26
|
+
"@graphcommerce/magento-product-simple": "^10.0.0-canary.72",
|
|
27
|
+
"@graphcommerce/magento-store": "^10.0.0-canary.72",
|
|
28
|
+
"@graphcommerce/next-ui": "^10.0.0-canary.72",
|
|
29
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.72",
|
|
30
|
+
"@graphcommerce/react-hook-form": "^10.0.0-canary.72",
|
|
31
|
+
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.72",
|
|
32
32
|
"@lingui/core": "^5",
|
|
33
33
|
"@lingui/macro": "^5",
|
|
34
34
|
"@lingui/react": "^5",
|
|
35
|
-
"@mui/material": "^
|
|
35
|
+
"@mui/material": "^7.0.0",
|
|
36
36
|
"framer-motion": "^11.0.0",
|
|
37
37
|
"next": "*",
|
|
38
38
|
"react": "^19.2.0",
|
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
ProductPageJsonLdProps,
|
|
5
5
|
} from '@graphcommerce/magento-product'
|
|
6
6
|
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
7
|
-
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
8
7
|
import { isTypename } from '@graphcommerce/next-ui'
|
|
8
|
+
import { useConfigurableSelectedVariant } from '../../hooks'
|
|
9
9
|
|
|
10
10
|
export const config: PluginConfig = {
|
|
11
11
|
type: 'component',
|
|
@@ -21,7 +21,6 @@ export function ProductPageMeta(props: PluginProps<ProductPageMetaProps> & AddTo
|
|
|
21
21
|
const isValidVariant = (variant?.url_rewrites ?? []).length > 0 && variant?.url_key
|
|
22
22
|
const targetUrl = isValidVariant ? productLink(variant) : productLink(product)
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
useEffect(() => {
|
|
26
25
|
if (product.__typename !== 'ConfigurableProduct') return
|
|
27
26
|
// Filter asPath with #, for zoomed gallery
|
|
@@ -25,7 +25,7 @@ type BaseQuery =
|
|
|
25
25
|
*/
|
|
26
26
|
export async function defaultConfigurableOptionsSelection<Q extends BaseQuery = BaseQuery>(
|
|
27
27
|
urlKey: string,
|
|
28
|
-
client: ApolloClient
|
|
28
|
+
client: ApolloClient,
|
|
29
29
|
query: Q,
|
|
30
30
|
): Promise<Q & Pick<AddProductsToCartFormProps, 'defaultValues'>> {
|
|
31
31
|
const simple = query?.products?.items?.find((p) => p?.url_key === urlKey)
|