@graphcommerce/magento-product 4.1.11 → 4.3.1
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 +32 -0
- package/components/ProductAddToCart/ProductAddToCart.tsx +26 -13
- package/components/ProductListItem/ProductListItem.tsx +6 -2
- package/components/ProductListItems/ProductListItemsBase.tsx +3 -1
- package/components/ProductPageCategory/productPageCategory.ts +1 -1
- package/components/ProductPageDescription/ProductPageDescription.tsx +1 -1
- package/components/index.ts +1 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`25ef6cf08`](https://github.com/graphcommerce-org/graphcommerce/commit/25ef6cf08c278105307d6f604b7135d637e9046c), [`80e30bb77`](https://github.com/graphcommerce-org/graphcommerce/commit/80e30bb77015755fbc00a7935d590f80c1c1c18c)]:
|
|
8
|
+
- @graphcommerce/graphql@3.1.2
|
|
9
|
+
- @graphcommerce/graphql-mesh@4.1.3
|
|
10
|
+
- @graphcommerce/magento-cart@4.2.11
|
|
11
|
+
- @graphcommerce/magento-store@4.2.1
|
|
12
|
+
- @graphcommerce/next-ui@4.7.1
|
|
13
|
+
- @graphcommerce/framer-scroller@2.1.9
|
|
14
|
+
|
|
15
|
+
## 4.3.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#1256](https://github.com/graphcommerce-org/graphcommerce/pull/1256) [`669a17a97`](https://github.com/graphcommerce-org/graphcommerce/commit/669a17a973c47c00fed4a649a9da0bfc5670c5da) Thanks [@timhofman](https://github.com/timhofman)! - Wishlist
|
|
20
|
+
|
|
21
|
+
## 4.2.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [#1416](https://github.com/graphcommerce-org/graphcommerce/pull/1416) [`f3d06dd83`](https://github.com/graphcommerce-org/graphcommerce/commit/f3d06dd836c9a76412b419d4d2c79bbd0ee92e04) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - SEO audit
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`f3d06dd83`](https://github.com/graphcommerce-org/graphcommerce/commit/f3d06dd836c9a76412b419d4d2c79bbd0ee92e04)]:
|
|
30
|
+
- @graphcommerce/magento-store@4.2.0
|
|
31
|
+
- @graphcommerce/next-ui@4.7.0
|
|
32
|
+
- @graphcommerce/magento-cart@4.2.10
|
|
33
|
+
- @graphcommerce/framer-scroller@2.1.8
|
|
34
|
+
|
|
3
35
|
## 4.1.11
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -22,6 +22,7 @@ const { classes, selectors } = extendableComponent('ProductAddToCart', [
|
|
|
22
22
|
'button',
|
|
23
23
|
'price',
|
|
24
24
|
'divider',
|
|
25
|
+
'buttonWrapper',
|
|
25
26
|
] as const)
|
|
26
27
|
|
|
27
28
|
export type AddToCartProps = React.ComponentProps<typeof ProductAddToCart>
|
|
@@ -31,10 +32,11 @@ export function ProductAddToCart(
|
|
|
31
32
|
variables: Omit<ProductAddToCartMutationVariables, 'cartId'>
|
|
32
33
|
name: string
|
|
33
34
|
price: MoneyProps
|
|
35
|
+
additionalButtons?: React.ReactNode
|
|
34
36
|
children?: React.ReactNode
|
|
35
37
|
} & Omit<ButtonProps, 'type' | 'name'>,
|
|
36
38
|
) {
|
|
37
|
-
const { name, children, variables, price, sx, ...buttonProps } = props
|
|
39
|
+
const { name, children, variables, price, sx, additionalButtons, ...buttonProps } = props
|
|
38
40
|
|
|
39
41
|
const form = useFormGqlMutationCart(ProductAddToCartDocument, {
|
|
40
42
|
defaultValues: { ...variables },
|
|
@@ -69,21 +71,32 @@ export function ProductAddToCart(
|
|
|
69
71
|
size='small'
|
|
70
72
|
/>
|
|
71
73
|
{children}
|
|
72
|
-
<
|
|
73
|
-
type='submit'
|
|
74
|
-
className={classes.button}
|
|
75
|
-
loading={formState.isSubmitting}
|
|
76
|
-
color='primary'
|
|
77
|
-
variant='pill'
|
|
78
|
-
size='large'
|
|
74
|
+
<Box
|
|
79
75
|
sx={(theme) => ({
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
display: 'flex',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
columnGap: theme.spacings.xs,
|
|
82
79
|
})}
|
|
83
|
-
{
|
|
80
|
+
className={classes.buttonWrapper}
|
|
84
81
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
82
|
+
<Button
|
|
83
|
+
type='submit'
|
|
84
|
+
className={classes.button}
|
|
85
|
+
loading={formState.isSubmitting}
|
|
86
|
+
color='primary'
|
|
87
|
+
variant='pill'
|
|
88
|
+
size='large'
|
|
89
|
+
sx={(theme) => ({
|
|
90
|
+
marginTop: theme.spacings.sm,
|
|
91
|
+
marginBottom: theme.spacings.sm,
|
|
92
|
+
width: '100%',
|
|
93
|
+
})}
|
|
94
|
+
{...buttonProps}
|
|
95
|
+
>
|
|
96
|
+
<Trans>Add to Cart</Trans>
|
|
97
|
+
</Button>
|
|
98
|
+
{additionalButtons}
|
|
99
|
+
</Box>
|
|
87
100
|
|
|
88
101
|
<ApolloCartErrorAlert error={error} />
|
|
89
102
|
|
|
@@ -43,7 +43,10 @@ type BaseProps = PropsWithChildren<
|
|
|
43
43
|
Pick<ImageProps, 'loading' | 'sizes' | 'dontReportWronglySizedImages'>
|
|
44
44
|
>
|
|
45
45
|
|
|
46
|
-
export type ProductListItemProps = BaseProps & {
|
|
46
|
+
export type ProductListItemProps = BaseProps & {
|
|
47
|
+
sx?: SxProps<Theme>
|
|
48
|
+
titleComponent?: React.ElementType
|
|
49
|
+
}
|
|
47
50
|
|
|
48
51
|
const StyledImage = styled(Image)({})
|
|
49
52
|
|
|
@@ -63,6 +66,7 @@ export function ProductListItem(props: ProductListItemProps) {
|
|
|
63
66
|
sizes,
|
|
64
67
|
dontReportWronglySizedImages,
|
|
65
68
|
aspectRatio = [4, 3],
|
|
69
|
+
titleComponent = 'h2',
|
|
66
70
|
sx = [],
|
|
67
71
|
} = props
|
|
68
72
|
|
|
@@ -218,7 +222,7 @@ export function ProductListItem(props: ProductListItemProps) {
|
|
|
218
222
|
})}
|
|
219
223
|
>
|
|
220
224
|
<Typography
|
|
221
|
-
component=
|
|
225
|
+
component={titleComponent}
|
|
222
226
|
variant='subtitle1'
|
|
223
227
|
sx={{
|
|
224
228
|
display: 'inline',
|
|
@@ -12,11 +12,12 @@ export type ProductItemsGridProps = {
|
|
|
12
12
|
renderers: ProductListItemRenderer
|
|
13
13
|
loadingEager?: number
|
|
14
14
|
size?: 'normal' | 'small'
|
|
15
|
+
titleComponent?: React.ElementType
|
|
15
16
|
sx?: BoxProps['sx']
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export function ProductListItemsBase(props: ProductItemsGridProps) {
|
|
19
|
-
const { items, sx = [], renderers, loadingEager = 0, size = 'normal' } = props
|
|
20
|
+
const { items, sx = [], renderers, loadingEager = 0, size = 'normal', titleComponent } = props
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
23
|
<Box
|
|
@@ -47,6 +48,7 @@ export function ProductListItemsBase(props: ProductItemsGridProps) {
|
|
|
47
48
|
? { 0: '100vw', 354: '50vw', 675: '30vw', 1255: '23vw', 1500: '337px' }
|
|
48
49
|
: { 0: '100vw', 367: '48vw', 994: '30vw', 1590: '23vw', 1920: '443px' }
|
|
49
50
|
}
|
|
51
|
+
titleComponent={titleComponent}
|
|
50
52
|
noReport
|
|
51
53
|
/>
|
|
52
54
|
) : null,
|
package/components/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './JsonLdProduct/jsonLdProduct'
|
|
2
2
|
export * from './ProductAddToCart/ProductAddToCart'
|
|
3
|
+
export * from './ProductAddToCart/ProductAddToCart.gql'
|
|
3
4
|
export * from './ProductList/ProductList.gql'
|
|
4
5
|
export * from './ProductListCount/ProductListCount'
|
|
5
6
|
export * from './ProductListFilters/ProductListFilters'
|
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": "4.1
|
|
5
|
+
"version": "4.3.1",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"type-fest": "^2.12.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
23
|
-
"@graphcommerce/graphql": "3.1.
|
|
24
|
-
"@graphcommerce/graphql-mesh": "4.1.
|
|
22
|
+
"@graphcommerce/framer-scroller": "2.1.9",
|
|
23
|
+
"@graphcommerce/graphql": "3.1.2",
|
|
24
|
+
"@graphcommerce/graphql-mesh": "4.1.3",
|
|
25
25
|
"@graphcommerce/image": "3.1.5",
|
|
26
|
-
"@graphcommerce/magento-cart": "4.2.
|
|
27
|
-
"@graphcommerce/magento-store": "4.1
|
|
28
|
-
"@graphcommerce/next-ui": "4.
|
|
26
|
+
"@graphcommerce/magento-cart": "4.2.11",
|
|
27
|
+
"@graphcommerce/magento-store": "4.2.1",
|
|
28
|
+
"@graphcommerce/next-ui": "4.7.1",
|
|
29
29
|
"schema-dts": "^1.1.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|