@graphcommerce/magento-product 4.0.2 → 4.0.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,60 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1292](https://github.com/ho-nl/m2-pwa/pull/1292)
8
+ [`5a1ba9e66`](https://github.com/ho-nl/m2-pwa/commit/5a1ba9e664abbac89c4f5f71f7d6d6ed1aefa5c0)
9
+ Thanks [@paales](https://github.com/paales)! - Renamed SvgIcon to IconSvg to prevent collisions
10
+ with MUI
11
+
12
+ - Updated dependencies
13
+ [[`5a1ba9e66`](https://github.com/ho-nl/m2-pwa/commit/5a1ba9e664abbac89c4f5f71f7d6d6ed1aefa5c0),
14
+ [`990df655b`](https://github.com/ho-nl/m2-pwa/commit/990df655b73b469718d6cb5837ee65dfe2ad6a1d),
15
+ [`63f9b56eb`](https://github.com/ho-nl/m2-pwa/commit/63f9b56eb68ba790567ff1427e599fd2c3c8f1ee)]:
16
+ - @graphcommerce/magento-cart@4.1.3
17
+ - @graphcommerce/next-ui@4.2.0
18
+
19
+ ## 4.0.4
20
+
21
+ ### Patch Changes
22
+
23
+ - [#1285](https://github.com/ho-nl/m2-pwa/pull/1285)
24
+ [`c85294ba6`](https://github.com/ho-nl/m2-pwa/commit/c85294ba6d742ce78c074559a1e95409b25a5017)
25
+ Thanks [@paales](https://github.com/paales)! - upgraded dependencies
26
+
27
+ - Updated dependencies
28
+ [[`ed9703b06`](https://github.com/ho-nl/m2-pwa/commit/ed9703b062d23ee01b1605ff9917c0ac3247fc25),
29
+ [`c85294ba6`](https://github.com/ho-nl/m2-pwa/commit/c85294ba6d742ce78c074559a1e95409b25a5017),
30
+ [`16d77b280`](https://github.com/ho-nl/m2-pwa/commit/16d77b2806e49e376d06bc0d578d38eb724b0c17)]:
31
+ - @graphcommerce/magento-store@4.1.0
32
+ - @graphcommerce/next-ui@4.1.3
33
+ - @graphcommerce/framer-scroller@2.0.4
34
+
35
+ ## 4.0.3
36
+
37
+ ### Patch Changes
38
+
39
+ - [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)
40
+ Thanks [@paales](https://github.com/paales)! - made packages public
41
+
42
+ * [#1278](https://github.com/ho-nl/m2-pwa/pull/1278)
43
+ [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20)
44
+ Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Upgraded dependencies to the latest version
45
+
46
+ * Updated dependencies
47
+ [[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96),
48
+ [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20),
49
+ [`3a719c88c`](https://github.com/ho-nl/m2-pwa/commit/3a719c88cad1eab58602de28c41adc0fc4827e1d),
50
+ [`5ffcb56bf`](https://github.com/ho-nl/m2-pwa/commit/5ffcb56bfcbe49ebeaf24f9341e819a145ab9a14)]:
51
+ - @graphcommerce/framer-scroller@2.0.3
52
+ - @graphcommerce/graphql@3.0.3
53
+ - @graphcommerce/image@3.1.0
54
+ - @graphcommerce/magento-cart@4.1.2
55
+ - @graphcommerce/magento-store@4.0.3
56
+ - @graphcommerce/next-ui@4.1.2
57
+
3
58
  ## 4.0.2
4
59
 
5
60
  ### Patch Changes
@@ -6,11 +6,13 @@ import {
6
6
  MessageSnackbar,
7
7
  TextInputNumber,
8
8
  iconChevronRight,
9
- SvgIcon,
9
+ IconSvg,
10
10
  extendableComponent,
11
+ AnimatedRow,
11
12
  } from '@graphcommerce/next-ui'
12
13
  import { Trans } from '@lingui/macro'
13
- import { Divider, Typography, ButtonProps, Box } from '@mui/material'
14
+ import { Divider, Typography, ButtonProps, Box, Alert } from '@mui/material'
15
+ import { AnimatePresence } from 'framer-motion'
14
16
  import PageLink from 'next/link'
15
17
  import React from 'react'
16
18
  import { ProductAddToCartDocument, ProductAddToCartMutationVariables } from './ProductAddToCart.gql'
@@ -38,7 +40,7 @@ export default function ProductAddToCart(
38
40
  defaultValues: { ...variables },
39
41
  })
40
42
 
41
- const { handleSubmit, formState, error, muiRegister, required } = form
43
+ const { handleSubmit, formState, error, muiRegister, required, data } = form
42
44
  const submitHandler = handleSubmit(() => {})
43
45
 
44
46
  return (
@@ -80,23 +82,36 @@ export default function ProductAddToCart(
80
82
  })}
81
83
  {...buttonProps}
82
84
  >
83
- Add to Cart
85
+ <Trans>Add to Cart</Trans>
84
86
  </Button>
85
87
 
86
88
  <ApolloCartErrorAlert error={error} />
87
89
 
90
+ <AnimatePresence initial={false}>
91
+ {data?.addProductsToCart?.user_errors.map((e) => (
92
+ <AnimatedRow key={e?.code}>
93
+ <Alert severity='error'>{e?.message}</Alert>
94
+ </AnimatedRow>
95
+ ))}
96
+ </AnimatePresence>
97
+
88
98
  <MessageSnackbar
89
- open={!formState.isSubmitting && formState.isSubmitSuccessful && !error?.message}
99
+ open={
100
+ !formState.isSubmitting &&
101
+ formState.isSubmitSuccessful &&
102
+ !error?.message &&
103
+ !data?.addProductsToCart?.user_errors?.length
104
+ }
90
105
  variant='pill'
91
106
  action={
92
- <PageLink href='/cart'>
107
+ <PageLink href='/cart' passHref>
93
108
  <Button
94
109
  size='medium'
95
110
  variant='pill'
96
111
  color='secondary'
97
- endIcon={<SvgIcon src={iconChevronRight} />}
112
+ endIcon={<IconSvg src={iconChevronRight} />}
98
113
  >
99
- View shopping cart
114
+ <Trans>View shopping cart</Trans>
100
115
  </Button>
101
116
  </PageLink>
102
117
  }
@@ -1,5 +1,5 @@
1
1
  import { cloneDeep } from '@graphcommerce/graphql'
2
- import { iconCancelAlt, SvgIcon } from '@graphcommerce/next-ui'
2
+ import { iconCancelAlt, IconSvg } from '@graphcommerce/next-ui'
3
3
  import { Chip, ChipProps, SxProps, Theme } from '@mui/material'
4
4
  import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
5
5
  import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
@@ -45,7 +45,7 @@ export default function FilterCheckboxType(props: FilterCheckboxTypeProps) {
45
45
  }
46
46
  : undefined
47
47
  }
48
- deleteIcon={isActive ? <SvgIcon src={iconCancelAlt} size='small' /> : undefined}
48
+ deleteIcon={isActive ? <IconSvg src={iconCancelAlt} size='small' /> : undefined}
49
49
  label={label}
50
50
  clickable
51
51
  {...chipProps}
@@ -3,7 +3,7 @@ import {
3
3
  iconChevronLeft,
4
4
  iconChevronRight,
5
5
  responsiveVal,
6
- SvgIcon,
6
+ IconSvg,
7
7
  useScrollY,
8
8
  extendableComponent,
9
9
  } from '@graphcommerce/next-ui'
@@ -107,7 +107,7 @@ export default function ProductListFiltersContainer(props: ProductListFiltersCon
107
107
  size='small'
108
108
  sx={{ position: 'absolute', top: 2, left: 2, zIndex: 10 }}
109
109
  >
110
- <SvgIcon src={iconChevronLeft} />
110
+ <IconSvg src={iconChevronLeft} />
111
111
  </ScrollerButton>
112
112
  <Box
113
113
  className={classes.container}
@@ -165,7 +165,7 @@ export default function ProductListFiltersContainer(props: ProductListFiltersCon
165
165
  size='small'
166
166
  sx={{ position: 'absolute', top: 2, right: 2, zIndex: 10 }}
167
167
  >
168
- <SvgIcon src={iconChevronRight} />
168
+ <IconSvg src={iconChevronRight} />
169
169
  </ScrollerButton>
170
170
  </ScrollerProvider>
171
171
  </MotionDiv>
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  responsiveVal,
3
3
  iconOrderBefore,
4
- SvgIcon,
4
+ IconSvg,
5
5
  extendableComponent,
6
6
  } from '@graphcommerce/next-ui'
7
7
  import { Box, darken, lighten, Typography } from '@mui/material'
@@ -31,7 +31,7 @@ export default function ProductSidebarDelivery() {
31
31
  borderRadius: responsiveVal(theme.shape.borderRadius * 3, theme.shape.borderRadius * 4),
32
32
  })}
33
33
  >
34
- <SvgIcon
34
+ <IconSvg
35
35
  className={classes.image}
36
36
  src={iconOrderBefore}
37
37
  size='small'
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.0.2",
5
+ "version": "4.0.5",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,20 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.0.2",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.1",
17
- "@graphcommerce/typescript-config-pwa": "^4.0.1",
15
+ "@graphcommerce/eslint-config-pwa": "^4.0.4",
16
+ "@graphcommerce/prettier-config-pwa": "^4.0.2",
17
+ "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
18
  "@playwright/test": "^1.19.1"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/framer-scroller": "^2.0.2",
22
- "@graphcommerce/graphql": "^3.0.2",
23
- "@graphcommerce/image": "^3.0.2",
24
- "@graphcommerce/magento-cart": "^4.1.1",
25
- "@graphcommerce/magento-store": "^4.0.2",
26
- "@graphcommerce/next-ui": "^4.1.1",
27
- "schema-dts": "^1.0.0",
28
- "type-fest": "^2.11.2"
21
+ "@graphcommerce/framer-scroller": "^2.0.4",
22
+ "@graphcommerce/graphql": "^3.0.3",
23
+ "@graphcommerce/image": "^3.1.0",
24
+ "@graphcommerce/magento-cart": "^4.1.3",
25
+ "@graphcommerce/magento-store": "^4.1.0",
26
+ "@graphcommerce/next-ui": "^4.2.0",
27
+ "schema-dts": "^1.1.0",
28
+ "type-fest": "^2.12.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@lingui/macro": "^3.13.2",