@graphcommerce/magento-cart 4.1.0 β 4.1.3
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 +105 -0
- package/components/ApolloCartError/ApolloCartErrorAlert.tsx +1 -2
- package/components/ApolloCartError/ApolloCartErrorFullPage.tsx +3 -7
- package/components/ApolloCartError/ApolloCartErrorSnackbar.tsx +1 -1
- package/components/CartFab/CartFab.tsx +5 -7
- package/components/CartItemSummary/index.tsx +3 -3
- package/components/CartStartCheckout/CartStartCheckout.tsx +2 -2
- package/components/CartSummary/index.tsx +1 -1
- package/components/CartTotals/CartTotals.tsx +5 -4
- package/components/EmptyCart/EmptyCart.tsx +2 -2
- package/package.json +17 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,110 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.1.3
|
|
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
|
+
* [#1292](https://github.com/ho-nl/m2-pwa/pull/1292)
|
|
13
|
+
[`63f9b56eb`](https://github.com/ho-nl/m2-pwa/commit/63f9b56eb68ba790567ff1427e599fd2c3c8f1ee)
|
|
14
|
+
Thanks [@paales](https://github.com/paales)! - added responsive size to the Fab component
|
|
15
|
+
|
|
16
|
+
* Updated dependencies
|
|
17
|
+
[[`5a1ba9e66`](https://github.com/ho-nl/m2-pwa/commit/5a1ba9e664abbac89c4f5f71f7d6d6ed1aefa5c0),
|
|
18
|
+
[`990df655b`](https://github.com/ho-nl/m2-pwa/commit/990df655b73b469718d6cb5837ee65dfe2ad6a1d),
|
|
19
|
+
[`63f9b56eb`](https://github.com/ho-nl/m2-pwa/commit/63f9b56eb68ba790567ff1427e599fd2c3c8f1ee)]:
|
|
20
|
+
- @graphcommerce/ecommerce-ui@1.0.2
|
|
21
|
+
- @graphcommerce/magento-customer@4.1.3
|
|
22
|
+
- @graphcommerce/next-ui@4.2.0
|
|
23
|
+
|
|
24
|
+
## 4.1.2
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)
|
|
29
|
+
Thanks [@paales](https://github.com/paales)! - made packages public
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
[[`4bb963d75`](https://github.com/ho-nl/m2-pwa/commit/4bb963d7595b5ce6e3a4924cc2e3e8b0210cdcd6),
|
|
33
|
+
[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96),
|
|
34
|
+
[`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20),
|
|
35
|
+
[`3a719c88c`](https://github.com/ho-nl/m2-pwa/commit/3a719c88cad1eab58602de28c41adc0fc4827e1d),
|
|
36
|
+
[`5ffcb56bf`](https://github.com/ho-nl/m2-pwa/commit/5ffcb56bfcbe49ebeaf24f9341e819a145ab9a14)]:
|
|
37
|
+
- @graphcommerce/framer-next-pages@3.1.0
|
|
38
|
+
- @graphcommerce/ecommerce-ui@1.0.1
|
|
39
|
+
- @graphcommerce/framer-scroller@2.0.3
|
|
40
|
+
- @graphcommerce/graphql@3.0.3
|
|
41
|
+
- @graphcommerce/image@3.1.0
|
|
42
|
+
- @graphcommerce/magento-customer@4.1.2
|
|
43
|
+
- @graphcommerce/magento-graphql@3.0.3
|
|
44
|
+
- @graphcommerce/magento-store@4.0.3
|
|
45
|
+
- @graphcommerce/next-ui@4.1.2
|
|
46
|
+
- @graphcommerce/react-hook-form@3.0.3
|
|
47
|
+
|
|
48
|
+
## 4.1.1
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- [#1274](https://github.com/ho-nl/m2-pwa/pull/1274)
|
|
53
|
+
[`381e4c86a`](https://github.com/ho-nl/m2-pwa/commit/381e4c86a8321ce96e1fa5c7d3c0a0c0ff3e02c7)
|
|
54
|
+
Thanks [@paales](https://github.com/paales)! - Moved `ApolloErrorAlert`, `ApolloErrorFullPage` and
|
|
55
|
+
`ApolloErrorSnackbar` to the ecommerce-ui package.
|
|
56
|
+
|
|
57
|
+
Created `ComposedSubmitButton` and `ComposedSubmitLinkOrButton` to reduce complexity from
|
|
58
|
+
`magento-graphcms` example.
|
|
59
|
+
|
|
60
|
+
Removed dependency an `@graphcommerce/react-hook-form` from `magento-graphcms` example.
|
|
61
|
+
|
|
62
|
+
Added dependency `@graphcommerce/ecommerce-ui` from `magento-graphcms` example.
|
|
63
|
+
|
|
64
|
+
* [#1276](https://github.com/ho-nl/m2-pwa/pull/1276)
|
|
65
|
+
[`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2)
|
|
66
|
+
Thanks [@paales](https://github.com/paales)! - We've moved lots of internal packages from
|
|
67
|
+
`dependencies` to `peerDependencies`. The result of this is that there will be significantly less
|
|
68
|
+
duplicate packages in the node_modules folders.
|
|
69
|
+
|
|
70
|
+
- [#1274](https://github.com/ho-nl/m2-pwa/pull/1274)
|
|
71
|
+
[`b08a8eb1d`](https://github.com/ho-nl/m2-pwa/commit/b08a8eb1d024b9d3e7712ef034029151670db275)
|
|
72
|
+
Thanks [@paales](https://github.com/paales)! - Fixed extraction of translations and updated
|
|
73
|
+
various translations for english πΊπΈπ¬π§ and dutch π³π±
|
|
74
|
+
|
|
75
|
+
* [#1276](https://github.com/ho-nl/m2-pwa/pull/1276)
|
|
76
|
+
[`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)
|
|
77
|
+
Thanks [@paales](https://github.com/paales)! - Upgraded to
|
|
78
|
+
[NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be
|
|
79
|
+
implementing
|
|
80
|
+
[On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta)
|
|
81
|
+
soon.
|
|
82
|
+
|
|
83
|
+
This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the
|
|
84
|
+
frontend to be able to revalidate pages manually.
|
|
85
|
+
|
|
86
|
+
- [#1274](https://github.com/ho-nl/m2-pwa/pull/1274)
|
|
87
|
+
[`5a4809b1a`](https://github.com/ho-nl/m2-pwa/commit/5a4809b1a705aa32f620f520085df48ee25f9949)
|
|
88
|
+
Thanks [@paales](https://github.com/paales)! - make sure the discount is rendered side-by-side
|
|
89
|
+
|
|
90
|
+
- Updated dependencies
|
|
91
|
+
[[`381e4c86a`](https://github.com/ho-nl/m2-pwa/commit/381e4c86a8321ce96e1fa5c7d3c0a0c0ff3e02c7),
|
|
92
|
+
[`351347afe`](https://github.com/ho-nl/m2-pwa/commit/351347afeae5bd837408d46c7593bcf5473dc621),
|
|
93
|
+
[`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2),
|
|
94
|
+
[`e7c8e2756`](https://github.com/ho-nl/m2-pwa/commit/e7c8e2756d637cbcd2e793d62ef5721d35d9fa7b),
|
|
95
|
+
[`b08a8eb1d`](https://github.com/ho-nl/m2-pwa/commit/b08a8eb1d024b9d3e7712ef034029151670db275),
|
|
96
|
+
[`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d)]:
|
|
97
|
+
- @graphcommerce/ecommerce-ui@1.0.0
|
|
98
|
+
- @graphcommerce/framer-next-pages@3.0.2
|
|
99
|
+
- @graphcommerce/magento-customer@4.1.1
|
|
100
|
+
- @graphcommerce/next-ui@4.1.1
|
|
101
|
+
- @graphcommerce/react-hook-form@3.0.2
|
|
102
|
+
- @graphcommerce/framer-scroller@2.0.2
|
|
103
|
+
- @graphcommerce/graphql@3.0.2
|
|
104
|
+
- @graphcommerce/image@3.0.2
|
|
105
|
+
- @graphcommerce/magento-graphql@3.0.2
|
|
106
|
+
- @graphcommerce/magento-store@4.0.2
|
|
107
|
+
|
|
3
108
|
## 4.1.0
|
|
4
109
|
|
|
5
110
|
### Minor Changes
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { ApolloErrorAlert, ApolloErrorAlertProps } from '@graphcommerce/ecommerce-ui'
|
|
1
2
|
import { useQuery } from '@graphcommerce/graphql'
|
|
2
3
|
import { CustomerTokenDocument } from '@graphcommerce/magento-customer'
|
|
3
4
|
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
4
|
-
import { ApolloErrorAlert, ApolloErrorAlertProps } from '@graphcommerce/next-ui'
|
|
5
5
|
import { t } from '@lingui/macro'
|
|
6
6
|
import { Button } from '@mui/material'
|
|
7
7
|
import Link from 'next/link'
|
|
8
|
-
import React from 'react'
|
|
9
8
|
import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
|
|
10
9
|
|
|
11
10
|
export type ApolloCartErrorAlertProps = ApolloErrorAlertProps
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
+
import { ApolloErrorFullPage, ApolloErrorFullPageProps } from '@graphcommerce/ecommerce-ui'
|
|
1
2
|
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
2
|
-
import {
|
|
3
|
-
ApolloErrorFullPage,
|
|
4
|
-
ApolloErrorFullPageProps,
|
|
5
|
-
iconSadFace,
|
|
6
|
-
SvgIcon,
|
|
7
|
-
} from '@graphcommerce/next-ui'
|
|
3
|
+
import { iconSadFace, IconSvg } from '@graphcommerce/next-ui'
|
|
8
4
|
import { Button } from '@mui/material'
|
|
9
5
|
import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
|
|
10
6
|
|
|
@@ -20,7 +16,7 @@ export function ApolloCartErrorFullPage(props: ApolloCartErrorFullPageProps) {
|
|
|
20
16
|
return (
|
|
21
17
|
<ApolloErrorFullPage
|
|
22
18
|
error={error}
|
|
23
|
-
icon={<
|
|
19
|
+
icon={<IconSvg src={iconSadFace} size='xxl' />}
|
|
24
20
|
button={action}
|
|
25
21
|
{...passedProps}
|
|
26
22
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ApolloErrorSnackbarProps, ApolloErrorSnackbar } from '@graphcommerce/ecommerce-ui'
|
|
1
2
|
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
2
|
-
import { ApolloErrorSnackbarProps, ApolloErrorSnackbar } from '@graphcommerce/next-ui'
|
|
3
3
|
import { Button } from '@mui/material'
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
extendableComponent,
|
|
3
3
|
iconShoppingBag,
|
|
4
|
-
responsiveVal,
|
|
5
4
|
DesktopHeaderBadge,
|
|
6
|
-
|
|
5
|
+
IconSvg,
|
|
7
6
|
useScrollY,
|
|
7
|
+
useFabSize,
|
|
8
8
|
} from '@graphcommerce/next-ui'
|
|
9
9
|
import { t } from '@lingui/macro'
|
|
10
10
|
import { alpha, Fab, FabProps, NoSsr, styled, useTheme, Box, SxProps, Theme } from '@mui/material'
|
|
@@ -43,8 +43,8 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
43
43
|
const paper1 = alpha(theme2.palette.background.paper, 1)
|
|
44
44
|
const backgroundColor = useTransform(scrollY, [0, 10], [paper0, paper1])
|
|
45
45
|
|
|
46
|
-
const cartIcon = icon ?? <
|
|
47
|
-
const fabIconSize =
|
|
46
|
+
const cartIcon = icon ?? <IconSvg src={iconShoppingBag} size='large' />
|
|
47
|
+
const fabIconSize = useFabSize('responsive')
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
50
|
<Box
|
|
@@ -60,11 +60,9 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
60
60
|
{...fabProps}
|
|
61
61
|
aria-label={t`Cart`}
|
|
62
62
|
color='inherit'
|
|
63
|
-
size='
|
|
63
|
+
size='responsive'
|
|
64
64
|
style={{ backgroundColor }}
|
|
65
65
|
sx={(theme) => ({
|
|
66
|
-
width: fabIconSize,
|
|
67
|
-
height: fabIconSize,
|
|
68
66
|
[theme.breakpoints.down('md')]: {
|
|
69
67
|
backgroundColor: `${theme.palette.background.paper} !important`,
|
|
70
68
|
},
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
iconChevronRight,
|
|
6
6
|
responsiveVal,
|
|
7
7
|
SectionContainer,
|
|
8
|
-
|
|
8
|
+
IconSvg,
|
|
9
9
|
extendableComponent,
|
|
10
10
|
} from '@graphcommerce/next-ui'
|
|
11
11
|
import { Trans } from '@lingui/macro'
|
|
@@ -83,7 +83,7 @@ export default function CartItemSummary(props: OrderSummaryProps) {
|
|
|
83
83
|
left: 8,
|
|
84
84
|
}}
|
|
85
85
|
>
|
|
86
|
-
<
|
|
86
|
+
<IconSvg src={iconChevronLeft} />
|
|
87
87
|
</ScrollerButton>
|
|
88
88
|
<Box className={classes.scrollerContainer} sx={{ padding: '1px' }}>
|
|
89
89
|
<Scroller className={classes.scroller}>
|
|
@@ -125,7 +125,7 @@ export default function CartItemSummary(props: OrderSummaryProps) {
|
|
|
125
125
|
right: 8,
|
|
126
126
|
}}
|
|
127
127
|
>
|
|
128
|
-
<
|
|
128
|
+
<IconSvg src={iconChevronRight} />
|
|
129
129
|
</ScrollerButton>
|
|
130
130
|
</ScrollerProvider>
|
|
131
131
|
</Box>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Money } from '@graphcommerce/magento-store'
|
|
2
|
-
import { iconChevronRight,
|
|
2
|
+
import { iconChevronRight, IconSvg, extendableComponent } from '@graphcommerce/next-ui'
|
|
3
3
|
import { Trans } from '@lingui/macro'
|
|
4
4
|
import { Box, Button, SxProps, Theme } from '@mui/material'
|
|
5
5
|
import PageLink from 'next/link'
|
|
@@ -34,7 +34,7 @@ export default function CartStartCheckout(props: CartStartCheckoutProps) {
|
|
|
34
34
|
color='secondary'
|
|
35
35
|
size='large'
|
|
36
36
|
className={classes.checkoutButton}
|
|
37
|
-
endIcon={<
|
|
37
|
+
endIcon={<IconSvg src={iconChevronRight} />}
|
|
38
38
|
disabled={!hasTotals}
|
|
39
39
|
sx={(theme) => ({
|
|
40
40
|
marginTop: theme.spacings.md,
|
|
@@ -102,7 +102,7 @@ export default function CartSummary(props: CartSummaryProps) {
|
|
|
102
102
|
<Box>
|
|
103
103
|
<SectionContainer
|
|
104
104
|
variantLeft='h5'
|
|
105
|
-
labelLeft={t`Billing
|
|
105
|
+
labelLeft={t`Billing address`}
|
|
106
106
|
sx={{ '& .SectionHeader': { marginTop: 0, paddingBottom: '8px' } }}
|
|
107
107
|
labelRight={
|
|
108
108
|
editable ? (
|
|
@@ -94,10 +94,12 @@ export default function CartTotals(props: CartTotalsProps) {
|
|
|
94
94
|
|
|
95
95
|
return (
|
|
96
96
|
<AnimatedRow
|
|
97
|
+
key={discount?.label}
|
|
97
98
|
sx={(theme) => ({
|
|
98
|
-
|
|
99
|
+
display: 'flex',
|
|
100
|
+
justifyContent: 'space-between',
|
|
101
|
+
typography: 'subtitle1',
|
|
99
102
|
})}
|
|
100
|
-
key={discount?.label}
|
|
101
103
|
>
|
|
102
104
|
<Box>{discount?.label}</Box>
|
|
103
105
|
<Box className={classes.money} sx={{ whiteSpace: 'nowrap' }}>
|
|
@@ -154,7 +156,6 @@ export default function CartTotals(props: CartTotalsProps) {
|
|
|
154
156
|
display: 'flex',
|
|
155
157
|
justifyContent: 'space-between',
|
|
156
158
|
typography: 'subtitle1',
|
|
157
|
-
fontWeight: theme.typography.fontWeightBold,
|
|
158
159
|
color: theme.palette.primary.main,
|
|
159
160
|
})}
|
|
160
161
|
>
|
|
@@ -175,7 +176,7 @@ export default function CartTotals(props: CartTotalsProps) {
|
|
|
175
176
|
sx={{
|
|
176
177
|
display: 'flex',
|
|
177
178
|
justifyContent: 'space-between',
|
|
178
|
-
typography: '
|
|
179
|
+
typography: 'body1',
|
|
179
180
|
color: 'text.disabled',
|
|
180
181
|
paddingTop: 0,
|
|
181
182
|
}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FullPageMessage,
|
|
1
|
+
import { FullPageMessage, IconSvg, iconShoppingBag } from '@graphcommerce/next-ui'
|
|
2
2
|
import { Trans } from '@lingui/macro'
|
|
3
3
|
import { Button } from '@mui/material'
|
|
4
4
|
import Link from 'next/link'
|
|
@@ -11,7 +11,7 @@ export default function EmptyCart(props: EmptyCartProps) {
|
|
|
11
11
|
return (
|
|
12
12
|
<FullPageMessage
|
|
13
13
|
title={<Trans>Your cart is empty</Trans>}
|
|
14
|
-
icon={<
|
|
14
|
+
icon={<IconSvg src={iconShoppingBag} size='xxl' />}
|
|
15
15
|
button={
|
|
16
16
|
<Link href='/' passHref>
|
|
17
17
|
<Button variant='pill' color='secondary' size='large'>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-cart",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.1.
|
|
5
|
+
"version": "4.1.3",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,21 +12,24 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^4.0.
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "^4.0.
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "^4.0.
|
|
18
|
-
"@playwright/test": "^1.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^4.0.3",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "^4.0.2",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "^4.0.2",
|
|
18
|
+
"@playwright/test": "^1.19.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/
|
|
22
|
-
"@graphcommerce/framer-
|
|
23
|
-
"@graphcommerce/
|
|
24
|
-
"@graphcommerce/
|
|
25
|
-
"@graphcommerce/
|
|
26
|
-
"@graphcommerce/magento-
|
|
27
|
-
"@graphcommerce/magento-
|
|
28
|
-
"@graphcommerce/
|
|
29
|
-
"@graphcommerce/
|
|
21
|
+
"@graphcommerce/ecommerce-ui": "^1.0.2",
|
|
22
|
+
"@graphcommerce/framer-next-pages": "^3.1.0",
|
|
23
|
+
"@graphcommerce/framer-scroller": "^2.0.3",
|
|
24
|
+
"@graphcommerce/graphql": "^3.0.3",
|
|
25
|
+
"@graphcommerce/image": "^3.1.0",
|
|
26
|
+
"@graphcommerce/magento-customer": "^4.1.3",
|
|
27
|
+
"@graphcommerce/magento-graphql": "^3.0.3",
|
|
28
|
+
"@graphcommerce/magento-store": "^4.0.3",
|
|
29
|
+
"@graphcommerce/next-ui": "^4.2.0",
|
|
30
|
+
"@graphcommerce/react-hook-form": "^3.0.3"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
30
33
|
"@lingui/macro": "^3.13.2",
|
|
31
34
|
"@mui/material": "^5.4.1",
|
|
32
35
|
"framer-motion": "^6.2.4",
|