@graphcommerce/magento-store 4.2.0 → 4.2.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,65 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1448](https://github.com/graphcommerce-org/graphcommerce/pull/1448) [`c30893857`](https://github.com/graphcommerce-org/graphcommerce/commit/c3089385791291e812a48c2691a39a2325ee0439) Thanks [@timhofman](https://github.com/timhofman)! - correct price formatting when opting for decimal formatting
8
+
9
+ ## 4.2.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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.
14
+
15
+ Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
16
+
17
+ All occurences of `<Trans>` and `t` need to be replaced:
18
+
19
+ ```tsx
20
+ import { Trans, t } from '@lingui/macro'
21
+
22
+ function MyComponent() {
23
+ const foo = 'bar'
24
+ return (
25
+ <div aria-label={t`Account ${foo}`}>
26
+ <Trans>My Translation {foo}</Trans>
27
+ </div>
28
+ )
29
+ }
30
+ ```
31
+
32
+ Needs to be replaced with:
33
+
34
+ ```tsx
35
+ import { Trans } from '@lingui/react'
36
+ import { i18n } from '@lingui/core'
37
+
38
+ function MyComponent() {
39
+ const foo = 'bar'
40
+ return (
41
+ <div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
42
+ <Trans key='My Translation {foo}' values={{ foo }}></Trans>
43
+ </div>
44
+ )
45
+ }
46
+ ```
47
+
48
+ [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)
49
+
50
+ - Updated dependencies [[`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
51
+ - @graphcommerce/next-ui@4.7.2
52
+ - @graphcommerce/graphql@3.1.3
53
+
54
+ ## 4.2.1
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [[`25ef6cf08`](https://github.com/graphcommerce-org/graphcommerce/commit/25ef6cf08c278105307d6f604b7135d637e9046c), [`80e30bb77`](https://github.com/graphcommerce-org/graphcommerce/commit/80e30bb77015755fbc00a7935d590f80c1c1c18c)]:
59
+ - @graphcommerce/graphql@3.1.2
60
+ - @graphcommerce/graphql-mesh@4.1.3
61
+ - @graphcommerce/next-ui@4.7.1
62
+
3
63
  ## 4.2.0
4
64
 
5
65
  ### Minor Changes
package/Money.tsx CHANGED
@@ -30,7 +30,7 @@ export function Money(props: MoneyProps) {
30
30
  const { data: config } = useQuery(StoreConfigDocument)
31
31
  const locale = config?.storeConfig?.locale
32
32
 
33
- const digits = round && (value ?? 0) % 1 === 0
33
+ const digits = (value ?? 0) % 1 !== 0
34
34
 
35
35
  const numberFormatter = useMemo(() => {
36
36
  if (!locale) return undefined
@@ -38,10 +38,12 @@ export function Money(props: MoneyProps) {
38
38
  return new Intl.NumberFormat(locale.replace('_', '-'), {
39
39
  style: 'currency',
40
40
  currency: currency ?? config?.storeConfig?.base_currency_code ?? '',
41
- ...(digits && { minimumFractionDigits: 0 }),
41
+ ...(round && !digits && { minimumFractionDigits: 0 }),
42
+ ...(round && digits && { minimumFractionDigits: 2 }),
43
+ ...(!round && { minimumFractionDigits: 2 }),
42
44
  ...formatOptions,
43
45
  })
44
- }, [config?.storeConfig?.base_currency_code, currency, digits, formatOptions, locale])
46
+ }, [config?.storeConfig?.base_currency_code, currency, digits, formatOptions, locale, round])
45
47
 
46
48
  if (!numberFormatter || !value) return null
47
49
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-store",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.2.0",
5
+ "version": "4.2.3",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,20 +12,21 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.1.6",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.7",
16
16
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
17
- "@graphcommerce/typescript-config-pwa": "^4.0.2",
17
+ "@graphcommerce/typescript-config-pwa": "^4.0.3",
18
18
  "@playwright/test": "^1.21.1",
19
19
  "type-fest": "^2.12.2"
20
20
  },
21
21
  "dependencies": {
22
- "@graphcommerce/graphql": "3.1.1",
23
- "@graphcommerce/graphql-mesh": "4.1.2",
22
+ "@graphcommerce/graphql": "3.1.3",
23
+ "@graphcommerce/graphql-mesh": "4.1.3",
24
24
  "@graphcommerce/image": "3.1.5",
25
- "@graphcommerce/next-ui": "4.7.0"
25
+ "@graphcommerce/next-ui": "4.7.2"
26
26
  },
27
27
  "peerDependencies": {
28
- "@lingui/macro": "^3.13.2",
28
+ "@lingui/react": "^3.13.2",
29
+ "@lingui/core": "^3.13.2",
29
30
  "@mui/material": "5.5.3",
30
31
  "next": "12.1.2",
31
32
  "react": "^17.0.2",