@graphcommerce/magento-wishlist 1.0.2 → 1.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 +71 -0
- package/components/ProductWishlistChip/ProductWishlistChipBase.tsx +11 -3
- package/components/WishlistFab/WishlistFab.tsx +2 -2
- package/components/WishlistItem/ProductAddToCart.tsx +8 -6
- package/components/WishlistItem/WishlistItem.tsx +1 -1
- package/components/WishlistItem/WishlistItemBase.tsx +3 -2
- package/package.json +12 -11
- package/queries/AddProductToWishlist.graphql +1 -7
- package/queries/RemoveProductFromWishlist.graphql +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @graphcommerce/magento-wishlist
|
|
2
2
|
|
|
3
|
+
## 1.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1454](https://github.com/graphcommerce-org/graphcommerce/pull/1454) [`d38b58bb3`](https://github.com/graphcommerce-org/graphcommerce/commit/d38b58bb3499a8055e1a60ec416064811e7412ed) Thanks [@paales](https://github.com/paales)! - Make sure to keep casing when generating graphql documents to match graphql-mesh's casing.
|
|
8
|
+
|
|
9
|
+
## 1.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1452](https://github.com/graphcommerce-org/graphcommerce/pull/1452) [`062c19664`](https://github.com/graphcommerce-org/graphcommerce/commit/062c19664689a0b8675e986806dbb243cfb6c063) Thanks [@paales](https://github.com/paales)! - Fix issue where the local graphql vscode plugin encountered a duplicate type
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`c30893857`](https://github.com/graphcommerce-org/graphcommerce/commit/c3089385791291e812a48c2691a39a2325ee0439)]:
|
|
16
|
+
- @graphcommerce/magento-store@4.2.3
|
|
17
|
+
- @graphcommerce/magento-cart@4.2.14
|
|
18
|
+
- @graphcommerce/magento-customer@4.2.12
|
|
19
|
+
- @graphcommerce/magento-product@4.3.4
|
|
20
|
+
- @graphcommerce/magento-product-configurable@4.1.4
|
|
21
|
+
|
|
22
|
+
## 1.0.3
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#1444](https://github.com/graphcommerce-org/graphcommerce/pull/1444) [`3b623efdd`](https://github.com/graphcommerce-org/graphcommerce/commit/3b623efdd1d26cc533b707ad4ef08c00989539a1) Thanks [@timhofman](https://github.com/timhofman)! - Lowest product price was based on regular_price instead of final_price
|
|
27
|
+
|
|
28
|
+
* [#1451](https://github.com/graphcommerce-org/graphcommerce/pull/1451) [`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061) Thanks [@paales](https://github.com/paales)! - Removed all occurences of @lingui/macro and moved to @lingui/macro / @lingui/core in preparation to move to swc.
|
|
29
|
+
|
|
30
|
+
Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
|
|
31
|
+
|
|
32
|
+
All occurences of `<Trans>` and `t` need to be replaced:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Trans, t } from '@lingui/macro'
|
|
36
|
+
|
|
37
|
+
function MyComponent() {
|
|
38
|
+
const foo = 'bar'
|
|
39
|
+
return (
|
|
40
|
+
<div aria-label={t`Account ${foo}`}>
|
|
41
|
+
<Trans>My Translation {foo}</Trans>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Needs to be replaced with:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Trans } from '@lingui/react'
|
|
51
|
+
import { i18n } from '@lingui/core'
|
|
52
|
+
|
|
53
|
+
function MyComponent() {
|
|
54
|
+
const foo = 'bar'
|
|
55
|
+
return (
|
|
56
|
+
<div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
|
|
57
|
+
<Trans key='My Translation {foo}' values={{ foo }}></Trans>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
[More examples for Trans](https://lingui.js.org/ref/macro.html#examples-of-jsx-macros) and [more examples for `t`](https://lingui.js.org/ref/macro.html#examples-of-js-macros)
|
|
64
|
+
|
|
65
|
+
* Updated dependencies [[`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
|
|
66
|
+
- @graphcommerce/magento-cart@4.2.13
|
|
67
|
+
- @graphcommerce/magento-customer@4.2.11
|
|
68
|
+
- @graphcommerce/magento-product@4.3.3
|
|
69
|
+
- @graphcommerce/magento-product-configurable@4.1.3
|
|
70
|
+
- @graphcommerce/magento-store@4.2.2
|
|
71
|
+
- @graphcommerce/next-ui@4.7.2
|
|
72
|
+
- @graphcommerce/graphql@3.1.3
|
|
73
|
+
|
|
3
74
|
## 1.0.2
|
|
4
75
|
|
|
5
76
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useQuery, useMutation, useApolloClient } from '@graphcommerce/graphql'
|
|
4
4
|
import { CustomerTokenDocument } from '@graphcommerce/magento-customer'
|
|
5
5
|
import { IconSvg, iconHeart, extendableComponent } from '@graphcommerce/next-ui'
|
|
6
|
-
import {
|
|
6
|
+
import { i18n } from '@lingui/core'
|
|
7
7
|
import { SxProps, Theme, IconButton } from '@mui/material'
|
|
8
8
|
import { useState, useEffect } from 'react'
|
|
9
9
|
import { useWishlistEnabled } from '../../hooks'
|
|
@@ -169,8 +169,16 @@ export function ProductWishlistChipBase(props: ProductWishlistChipProps) {
|
|
|
169
169
|
}),
|
|
170
170
|
...(Array.isArray(sx) ? sx : [sx]),
|
|
171
171
|
]}
|
|
172
|
-
title={
|
|
173
|
-
|
|
172
|
+
title={
|
|
173
|
+
inWishlist
|
|
174
|
+
? i18n._(/* i18n */ `Remove from wishlist`)
|
|
175
|
+
: i18n._(/* i18n */ `Add to wishlist`)
|
|
176
|
+
}
|
|
177
|
+
aria-label={
|
|
178
|
+
inWishlist
|
|
179
|
+
? i18n._(/* i18n */ `Remove from wishlist`)
|
|
180
|
+
: i18n._(/* i18n */ `Add to wishlist`)
|
|
181
|
+
}
|
|
174
182
|
>
|
|
175
183
|
{inWishlist ? activeHeart : heart}
|
|
176
184
|
</IconButton>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery } from '@graphcommerce/graphql'
|
|
2
2
|
import { CustomerTokenDocument } from '@graphcommerce/magento-customer'
|
|
3
3
|
import { iconHeart, DesktopHeaderBadge, IconSvg, extendableComponent } from '@graphcommerce/next-ui'
|
|
4
|
-
import {
|
|
4
|
+
import { i18n } from '@lingui/core'
|
|
5
5
|
import { Fab, FabProps as FabPropsType, NoSsr, SxProps, Theme } from '@mui/material'
|
|
6
6
|
import PageLink from 'next/link'
|
|
7
7
|
import React, { useEffect } from 'react'
|
|
@@ -55,7 +55,7 @@ function WishlistFabContent(props: WishlistFabContentProps) {
|
|
|
55
55
|
<Fab
|
|
56
56
|
color='inherit'
|
|
57
57
|
data-test-id='wishlist-fab'
|
|
58
|
-
aria-label={
|
|
58
|
+
aria-label={i18n._(/* i18n */ `Wishlist`)}
|
|
59
59
|
size='large'
|
|
60
60
|
className={classes.root}
|
|
61
61
|
{...FabProps}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
extendableComponent,
|
|
15
15
|
AnimatedRow,
|
|
16
16
|
} from '@graphcommerce/next-ui'
|
|
17
|
-
import { Trans } from '@lingui/
|
|
17
|
+
import { Trans } from '@lingui/react'
|
|
18
18
|
import { ButtonProps, Box, Alert } from '@mui/material'
|
|
19
19
|
import { AnimatePresence } from 'framer-motion'
|
|
20
20
|
import PageLink from 'next/link'
|
|
@@ -89,7 +89,7 @@ export function ProductAddToCart(
|
|
|
89
89
|
size='medium'
|
|
90
90
|
{...buttonProps}
|
|
91
91
|
>
|
|
92
|
-
<Trans
|
|
92
|
+
<Trans id='Add to Cart' />
|
|
93
93
|
</Button>
|
|
94
94
|
</Box>
|
|
95
95
|
|
|
@@ -120,14 +120,16 @@ export function ProductAddToCart(
|
|
|
120
120
|
color='secondary'
|
|
121
121
|
endIcon={<IconSvg src={iconChevronRight} />}
|
|
122
122
|
>
|
|
123
|
-
<Trans
|
|
123
|
+
<Trans id='View shopping cart' />
|
|
124
124
|
</Button>
|
|
125
125
|
</PageLink>
|
|
126
126
|
}
|
|
127
127
|
>
|
|
128
|
-
<Trans
|
|
129
|
-
<
|
|
130
|
-
|
|
128
|
+
<Trans
|
|
129
|
+
id='<0>{name}</0> has been added to your shopping cart!'
|
|
130
|
+
components={{ 0: <strong /> }}
|
|
131
|
+
values={{ name }}
|
|
132
|
+
/>
|
|
131
133
|
</MessageSnackbar>
|
|
132
134
|
</Box>
|
|
133
135
|
)
|
|
@@ -23,7 +23,7 @@ export function WishlistItem(props: WishlistItemProps) {
|
|
|
23
23
|
<ProductAddToCart
|
|
24
24
|
variables={{ sku: sku ?? '', quantity: 1 }}
|
|
25
25
|
name={name ?? ''}
|
|
26
|
-
price={price_range.minimum_price.
|
|
26
|
+
price={price_range.minimum_price.final_price}
|
|
27
27
|
/>
|
|
28
28
|
</WishlistItemBase>
|
|
29
29
|
)
|
|
@@ -7,7 +7,8 @@ import { CustomerTokenDocument } from '@graphcommerce/magento-customer'
|
|
|
7
7
|
import { useProductLink } from '@graphcommerce/magento-product'
|
|
8
8
|
import { Money } from '@graphcommerce/magento-store'
|
|
9
9
|
import { responsiveVal, extendableComponent, iconEllypsis, IconSvg } from '@graphcommerce/next-ui'
|
|
10
|
-
import { Trans
|
|
10
|
+
import { Trans } from '@lingui/react'
|
|
11
|
+
import { i18n } from '@lingui/core'
|
|
11
12
|
import { Badge, Box, Link, SxProps, Theme, Typography } from '@mui/material'
|
|
12
13
|
import IconButton from '@mui/material/IconButton'
|
|
13
14
|
import Menu from '@mui/material/Menu'
|
|
@@ -293,7 +294,7 @@ export function WishlistItemBase(props: WishlistItemBaseProps) {
|
|
|
293
294
|
}}
|
|
294
295
|
>
|
|
295
296
|
<MenuItem key='remove' id='remove' onClick={handleClose}>
|
|
296
|
-
<Trans
|
|
297
|
+
<Trans id='Remove Product' />
|
|
297
298
|
</MenuItem>
|
|
298
299
|
</Menu>
|
|
299
300
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-wishlist",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -13,23 +13,24 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.7",
|
|
17
17
|
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
18
|
-
"@graphcommerce/typescript-config-pwa": "^4.0.
|
|
18
|
+
"@graphcommerce/typescript-config-pwa": "^4.0.3",
|
|
19
19
|
"@playwright/test": "^1.21.1"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/graphql": "3.1.
|
|
22
|
+
"@graphcommerce/graphql": "3.1.3",
|
|
23
23
|
"@graphcommerce/image": "3.1.5",
|
|
24
|
-
"@graphcommerce/magento-cart": "4.2.
|
|
25
|
-
"@graphcommerce/magento-customer": "4.2.
|
|
26
|
-
"@graphcommerce/magento-product": "4.3.
|
|
27
|
-
"@graphcommerce/magento-product-configurable": "4.1.
|
|
28
|
-
"@graphcommerce/magento-store": "4.2.
|
|
29
|
-
"@graphcommerce/next-ui": "4.7.
|
|
24
|
+
"@graphcommerce/magento-cart": "4.2.14",
|
|
25
|
+
"@graphcommerce/magento-customer": "4.2.12",
|
|
26
|
+
"@graphcommerce/magento-product": "4.3.4",
|
|
27
|
+
"@graphcommerce/magento-product-configurable": "4.1.4",
|
|
28
|
+
"@graphcommerce/magento-store": "4.2.3",
|
|
29
|
+
"@graphcommerce/next-ui": "4.7.2"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@lingui/
|
|
32
|
+
"@lingui/react": "^3.13.2",
|
|
33
|
+
"@lingui/core": "^3.13.2",
|
|
33
34
|
"@mui/material": "^5.5.3",
|
|
34
35
|
"framer-motion": "^6.2.4",
|
|
35
36
|
"next": "^12.1.2",
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
sku: String
|
|
3
|
-
quantity: Int!
|
|
4
|
-
selected_options: [ID]
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
mutation addProductToWishlist($input: [WishlistItemInput!]!) {
|
|
1
|
+
mutation AddProductToWishlist($input: [WishlistItemInput!]!) {
|
|
8
2
|
addProductsToWishlist(wishlistId: 0, wishlistItems: $input) {
|
|
9
3
|
wishlist {
|
|
10
4
|
...WishlistSummaryFragment
|