@graphcommerce/magento-store 4.2.1 → 4.2.4

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,63 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`0363b9671`](https://github.com/graphcommerce-org/graphcommerce/commit/0363b9671db7c2932321d97faf6f1eb385238397), [`3ac90b57c`](https://github.com/graphcommerce-org/graphcommerce/commit/3ac90b57c68b96f9d81771d6664ed9435a28fc1d)]:
8
+ - @graphcommerce/next-ui@4.8.0
9
+
10
+ ## 4.2.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [#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
15
+
16
+ ## 4.2.2
17
+
18
+ ### Patch Changes
19
+
20
+ - [#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.
21
+
22
+ Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
23
+
24
+ All occurences of `<Trans>` and `t` need to be replaced:
25
+
26
+ ```tsx
27
+ import { Trans, t } from '@lingui/macro'
28
+
29
+ function MyComponent() {
30
+ const foo = 'bar'
31
+ return (
32
+ <div aria-label={t`Account ${foo}`}>
33
+ <Trans>My Translation {foo}</Trans>
34
+ </div>
35
+ )
36
+ }
37
+ ```
38
+
39
+ Needs to be replaced with:
40
+
41
+ ```tsx
42
+ import { Trans } from '@lingui/react'
43
+ import { i18n } from '@lingui/core'
44
+
45
+ function MyComponent() {
46
+ const foo = 'bar'
47
+ return (
48
+ <div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
49
+ <Trans key='My Translation {foo}' values={{ foo }}></Trans>
50
+ </div>
51
+ )
52
+ }
53
+ ```
54
+
55
+ [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)
56
+
57
+ - Updated dependencies [[`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
58
+ - @graphcommerce/next-ui@4.7.2
59
+ - @graphcommerce/graphql@3.1.3
60
+
3
61
  ## 4.2.1
4
62
 
5
63
  ### Patch 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.1",
5
+ "version": "4.2.4",
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.2",
22
+ "@graphcommerce/graphql": "3.1.3",
23
23
  "@graphcommerce/graphql-mesh": "4.1.3",
24
24
  "@graphcommerce/image": "3.1.5",
25
- "@graphcommerce/next-ui": "4.7.1"
25
+ "@graphcommerce/next-ui": "4.8.0"
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",