@graphcommerce/magento-customer 3.6.11 → 3.6.15

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.
@@ -21,14 +21,16 @@ export default function AddressSingleLine(props: CustomerAddressFragment) {
21
21
  // todo: detect correct format by locale
22
22
  // for now, US format will be returned by default
23
23
 
24
- let address = `$company ${prefix}, ${firstname}, $middlename ${lastname}, $suffix ${
25
- street?.[0]
26
- }, ${street?.slice(1).join(' ')}, ${postcode}, ${city}, ${regionName} $countryName`
27
-
28
- address = address.replace('$company', company ? `${company},` : '')
29
- address = address.replace('$middlename', middlename ? `${middlename},` : '')
30
- address = address.replace('$suffix', suffix ? `${suffix},` : '')
31
- address = address.replace('$countryName', countryName ? `${countryName},` : '')
24
+ const addressLine = [
25
+ company,
26
+ `${prefix} ${firstname} ${middlename} ${lastname} ${suffix}`,
27
+ `${street?.[0]} ${street?.[1]}`,
28
+ ...(street?.slice(2) ?? []),
29
+ `${postcode} ${city}`,
30
+ `${regionName} ${countryName}`,
31
+ ]
32
+ .map((v) => (v ?? '').replaceAll('null', '').replace(/\s\s+/g, ' ').trim())
33
+ .filter(Boolean)
32
34
 
33
- return <>{address}</>
35
+ return <>{addressLine.join(', ')}</>
34
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-customer",
3
- "version": "3.6.11",
3
+ "version": "3.6.15",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -14,27 +14,27 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@graphcommerce/browserslist-config-pwa": "^3.0.2",
17
- "@graphcommerce/eslint-config-pwa": "^3.1.6",
17
+ "@graphcommerce/eslint-config-pwa": "^3.1.8",
18
18
  "@graphcommerce/prettier-config-pwa": "^3.0.4",
19
19
  "@graphcommerce/typescript-config-pwa": "^3.1.1",
20
- "@playwright/test": "^1.16.2"
20
+ "@playwright/test": "^1.17.1"
21
21
  },
22
22
  "dependencies": {
23
- "@apollo/client": "^3.4.16",
24
- "@graphcommerce/graphql": "^2.105.6",
25
- "@graphcommerce/image": "^2.105.5",
26
- "@graphcommerce/magento-graphql": "^2.104.6",
27
- "@graphcommerce/magento-store": "^3.3.11",
28
- "@graphcommerce/next-ui": "^3.20.4",
29
- "@graphcommerce/react-hook-form": "^2.104.1",
30
- "@lingui/macro": "^3.12.1",
23
+ "@apollo/client": "^3.5.6",
24
+ "@graphcommerce/graphql": "^2.105.8",
25
+ "@graphcommerce/image": "^2.105.8",
26
+ "@graphcommerce/magento-graphql": "^2.104.8",
27
+ "@graphcommerce/magento-store": "^3.3.15",
28
+ "@graphcommerce/next-ui": "^3.20.8",
29
+ "@graphcommerce/react-hook-form": "^2.104.4",
30
+ "@lingui/macro": "^3.13.0",
31
31
  "@material-ui/core": "^4.12.3",
32
32
  "@material-ui/lab": "^4.0.0-alpha.60",
33
33
  "clsx": "^1.1.1",
34
- "framer-motion": "^4.1.17",
35
- "next": "^12.0.3",
34
+ "framer-motion": "^5.5.1",
35
+ "next": "^12.0.7",
36
36
  "react": "^17.0.2",
37
37
  "react-dom": "^17.0.2"
38
38
  },
39
- "gitHead": "b992ac3fbe719310988edb8ad811366431509bc2"
39
+ "gitHead": "a69bd94ffdcca6ca9487eec1cafe9ade3fcdffa3"
40
40
  }