@graphcommerce/magento-store 4.0.2 → 4.1.1

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,74 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1296](https://github.com/ho-nl/m2-pwa/pull/1296)
8
+ [`8473123fa`](https://github.com/ho-nl/m2-pwa/commit/8473123fa7d3f3eb1d282d9b4205c803a88010ea)
9
+ Thanks [@paales](https://github.com/paales)! - implement handling for canonical URLs based on
10
+ NEXT_PUBLIC_SITE_URL
11
+
12
+ - Updated dependencies
13
+ [[`a9cff2ce6`](https://github.com/ho-nl/m2-pwa/commit/a9cff2ce63fce5b86e9fd6bf63c10c782326d50e),
14
+ [`8473123fa`](https://github.com/ho-nl/m2-pwa/commit/8473123fa7d3f3eb1d282d9b4205c803a88010ea),
15
+ [`50e205c51`](https://github.com/ho-nl/m2-pwa/commit/50e205c51f4d0d67d41d22fd70e8ed9a0996489e)]:
16
+ - @graphcommerce/next-ui@4.2.2
17
+
18
+ ## 4.1.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [#1285](https://github.com/ho-nl/m2-pwa/pull/1285)
23
+ [`ed9703b06`](https://github.com/ho-nl/m2-pwa/commit/ed9703b062d23ee01b1605ff9917c0ac3247fc25)
24
+ Thanks [@paales](https://github.com/paales)! - Added the ability to configure `defaultProps` for
25
+ the <Money/> component.
26
+
27
+ ```ts
28
+ // For example in examples/magento-graphcms/theme.ts
29
+
30
+ const createOverrides = (theme: Theme): Components => ({
31
+ Money: {
32
+ defaultProps: {
33
+ round: true,
34
+ formatOptions: {
35
+ style: 'decimal',
36
+ },
37
+ },
38
+ },
39
+ })
40
+ ```
41
+
42
+ ### Patch Changes
43
+
44
+ - [#1285](https://github.com/ho-nl/m2-pwa/pull/1285)
45
+ [`c85294ba6`](https://github.com/ho-nl/m2-pwa/commit/c85294ba6d742ce78c074559a1e95409b25a5017)
46
+ Thanks [@paales](https://github.com/paales)! - upgraded dependencies
47
+
48
+ - Updated dependencies
49
+ [[`c85294ba6`](https://github.com/ho-nl/m2-pwa/commit/c85294ba6d742ce78c074559a1e95409b25a5017)]:
50
+ - @graphcommerce/next-ui@4.1.3
51
+
52
+ ## 4.0.3
53
+
54
+ ### Patch Changes
55
+
56
+ - [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96)
57
+ Thanks [@paales](https://github.com/paales)! - made packages public
58
+
59
+ * [#1278](https://github.com/ho-nl/m2-pwa/pull/1278)
60
+ [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20)
61
+ Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Upgraded dependencies to the latest version
62
+
63
+ * Updated dependencies
64
+ [[`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96),
65
+ [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20),
66
+ [`3a719c88c`](https://github.com/ho-nl/m2-pwa/commit/3a719c88cad1eab58602de28c41adc0fc4827e1d),
67
+ [`5ffcb56bf`](https://github.com/ho-nl/m2-pwa/commit/5ffcb56bfcbe49ebeaf24f9341e819a145ab9a14)]:
68
+ - @graphcommerce/graphql@3.0.3
69
+ - @graphcommerce/image@3.1.0
70
+ - @graphcommerce/next-ui@4.1.2
71
+
3
72
  ## 4.0.2
4
73
 
5
74
  ### Patch Changes
package/Money.tsx CHANGED
@@ -1,11 +1,30 @@
1
1
  import { useQuery } from '@graphcommerce/graphql'
2
- import React, { useMemo } from 'react'
2
+ import { ExtendableComponent } from '@graphcommerce/next-ui'
3
+ import { useThemeProps } from '@mui/material'
4
+ import { useMemo } from 'react'
3
5
  import { MoneyFragment } from './Money.gql'
4
6
  import { StoreConfigDocument } from './StoreConfig.gql'
5
7
 
6
- export type MoneyProps = MoneyFragment & { round?: boolean }
8
+ type OverridableProps = {
9
+ round?: boolean
10
+ /** @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#parameters */
11
+ formatOptions?: Intl.NumberFormatOptions
12
+ }
13
+
14
+ export type MoneyProps = MoneyFragment & OverridableProps
15
+
16
+ const name = 'Money'
17
+
18
+ /** Expose the component to be exendable in your theme.components */
19
+ declare module '@mui/material/styles/components' {
20
+ interface Components {
21
+ Money?: Pick<ExtendableComponent<OverridableProps>, 'defaultProps'>
22
+ }
23
+ }
24
+
25
+ export function Money(props: MoneyProps) {
26
+ const { currency, value, round = false, formatOptions } = useThemeProps({ name, props })
7
27
 
8
- export function Money({ currency, value, round = false }: MoneyProps) {
9
28
  const { data: config } = useQuery(StoreConfigDocument)
10
29
  const locale = config?.storeConfig?.locale
11
30
 
@@ -18,8 +37,9 @@ export function Money({ currency, value, round = false }: MoneyProps) {
18
37
  style: 'currency',
19
38
  currency: currency ?? config?.storeConfig?.base_currency_code ?? '',
20
39
  ...(digits && { minimumFractionDigits: 0 }),
40
+ ...formatOptions,
21
41
  })
22
- }, [config?.storeConfig?.base_currency_code, currency, digits, locale])
42
+ }, [config?.storeConfig?.base_currency_code, currency, digits, formatOptions, locale])
23
43
 
24
44
  if (!numberFormatter || !value) return null
25
45
 
package/PageMeta.tsx CHANGED
@@ -10,7 +10,7 @@ type PageMetaProps = Pick<NextPageMetaProps, 'title' | 'metaDescription' | 'meta
10
10
  }
11
11
 
12
12
  export function PageMeta(props: PageMetaProps) {
13
- const { title, canonical = '', ...pageMetaProps } = props
13
+ const { title, canonical, ...pageMetaProps } = props
14
14
  const config = useQuery(StoreConfigDocument)
15
15
 
16
16
  const prefix = config.data?.storeConfig?.title_prefix ?? ''
@@ -23,14 +23,10 @@ export function PageMeta(props: PageMetaProps) {
23
23
  if (separator && suffix) pageTitle += ` ${separator}`
24
24
  if (suffix) pageTitle += ` ${suffix}`
25
25
 
26
- const urlPath = ((canonical ?? '').startsWith('/') && canonical?.substr(1)) || canonical
27
-
28
26
  return (
29
27
  <NextPageMeta
30
28
  title={pageTitle ?? ''}
31
- canonical={
32
- urlPath ? `${config.data?.storeConfig?.secure_base_link_url ?? ''}${urlPath}` : undefined
33
- }
29
+ canonical={canonical ? `/${canonical}` : canonical}
34
30
  {...pageMetaProps}
35
31
  />
36
32
  )
@@ -19,6 +19,7 @@ query StoreConfig {
19
19
  category_url_suffix
20
20
  product_url_suffix
21
21
  secure_base_link_url
22
+ secure_base_url
22
23
 
23
24
  root_category_uid
24
25
 
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.0.2",
5
+ "version": "4.1.1",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,16 +12,16 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.0.2",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.1",
17
- "@graphcommerce/typescript-config-pwa": "^4.0.1",
15
+ "@graphcommerce/eslint-config-pwa": "^4.0.4",
16
+ "@graphcommerce/prettier-config-pwa": "^4.0.2",
17
+ "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
18
  "@playwright/test": "^1.19.1"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/graphql": "^3.0.2",
22
- "@graphcommerce/image": "^3.0.2",
23
- "@graphcommerce/next-ui": "^4.1.1",
24
- "type-fest": "^2.11.2"
21
+ "@graphcommerce/graphql": "^3.0.3",
22
+ "@graphcommerce/image": "^3.1.0",
23
+ "@graphcommerce/next-ui": "^4.2.2",
24
+ "type-fest": "^2.12.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@lingui/macro": "^3.13.2",