@graphcommerce/magento-wishlist 1.0.0 → 1.0.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 CHANGED
@@ -1,5 +1,80 @@
1
1
  # @graphcommerce/magento-wishlist
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ * [#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.
10
+
11
+ Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
12
+
13
+ All occurences of `<Trans>` and `t` need to be replaced:
14
+
15
+ ```tsx
16
+ import { Trans, t } from '@lingui/macro'
17
+
18
+ function MyComponent() {
19
+ const foo = 'bar'
20
+ return (
21
+ <div aria-label={t`Account ${foo}`}>
22
+ <Trans>My Translation {foo}</Trans>
23
+ </div>
24
+ )
25
+ }
26
+ ```
27
+
28
+ Needs to be replaced with:
29
+
30
+ ```tsx
31
+ import { Trans } from '@lingui/react'
32
+ import { i18n } from '@lingui/core'
33
+
34
+ function MyComponent() {
35
+ const foo = 'bar'
36
+ return (
37
+ <div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
38
+ <Trans key='My Translation {foo}' values={{ foo }}></Trans>
39
+ </div>
40
+ )
41
+ }
42
+ ```
43
+
44
+ [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)
45
+
46
+ * Updated dependencies [[`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
47
+ - @graphcommerce/magento-cart@4.2.13
48
+ - @graphcommerce/magento-customer@4.2.11
49
+ - @graphcommerce/magento-product@4.3.3
50
+ - @graphcommerce/magento-product-configurable@4.1.3
51
+ - @graphcommerce/magento-store@4.2.2
52
+ - @graphcommerce/next-ui@4.7.2
53
+ - @graphcommerce/graphql@3.1.3
54
+
55
+ ## 1.0.2
56
+
57
+ ### Patch Changes
58
+
59
+ - Updated dependencies []:
60
+ - @graphcommerce/magento-cart@4.2.12
61
+ - @graphcommerce/magento-customer@4.2.10
62
+ - @graphcommerce/magento-product@4.3.2
63
+ - @graphcommerce/magento-product-configurable@4.1.2
64
+
65
+ ## 1.0.1
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [[`25ef6cf08`](https://github.com/graphcommerce-org/graphcommerce/commit/25ef6cf08c278105307d6f604b7135d637e9046c), [`80e30bb77`](https://github.com/graphcommerce-org/graphcommerce/commit/80e30bb77015755fbc00a7935d590f80c1c1c18c)]:
70
+ - @graphcommerce/graphql@3.1.2
71
+ - @graphcommerce/magento-customer@4.2.9
72
+ - @graphcommerce/magento-cart@4.2.11
73
+ - @graphcommerce/magento-product@4.3.1
74
+ - @graphcommerce/magento-product-configurable@4.1.1
75
+ - @graphcommerce/magento-store@4.2.1
76
+ - @graphcommerce/next-ui@4.7.1
77
+
3
78
  ## 1.0.0
4
79
 
5
80
  ### Major 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 { t } from '@lingui/macro'
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={inWishlist ? t`Remove from wishlist` : t`Add to wishlist`}
173
- aria-label={inWishlist ? t`Remove from wishlist` : t`Add to wishlist`}
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 { t } from '@lingui/macro'
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={t`Wishlist`}
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/macro'
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>Add to Cart</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>View shopping cart</Trans>
123
+ <Trans id='View shopping cart' />
124
124
  </Button>
125
125
  </PageLink>
126
126
  }
127
127
  >
128
- <Trans>
129
- <strong>{name}</strong> has been added to your shopping cart!
130
- </Trans>
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.regular_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, t } from '@lingui/macro'
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>Remove Product</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.0",
3
+ "version": "1.0.3",
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.6",
16
+ "@graphcommerce/eslint-config-pwa": "^4.1.7",
17
17
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
18
- "@graphcommerce/typescript-config-pwa": "^4.0.2",
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.1",
22
+ "@graphcommerce/graphql": "3.1.3",
23
23
  "@graphcommerce/image": "3.1.5",
24
- "@graphcommerce/magento-cart": "4.2.10",
25
- "@graphcommerce/magento-customer": "4.2.8",
26
- "@graphcommerce/magento-product": "4.3.0",
27
- "@graphcommerce/magento-product-configurable": "4.1.0",
28
- "@graphcommerce/magento-store": "4.2.0",
29
- "@graphcommerce/next-ui": "4.7.0"
24
+ "@graphcommerce/magento-cart": "4.2.13",
25
+ "@graphcommerce/magento-customer": "4.2.11",
26
+ "@graphcommerce/magento-product": "4.3.3",
27
+ "@graphcommerce/magento-product-configurable": "4.1.3",
28
+ "@graphcommerce/magento-store": "4.2.2",
29
+ "@graphcommerce/next-ui": "4.7.2"
30
30
  },
31
31
  "peerDependencies": {
32
- "@lingui/macro": "^3.13.2",
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",