@graphcommerce/googlerecaptcha 1.1.7 → 2.0.0

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,28 +1,46 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [1.1.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googlerecaptcha@1.1.1...@graphcommerce/googlerecaptcha@1.1.2) (2021-11-12)
3
+ ## 2.0.0
7
4
 
5
+ ### Major Changes
8
6
 
9
- ### Bug Fixes
7
+ - [#1258](https://github.com/ho-nl/m2-pwa/pull/1258)
8
+ [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)
9
+ Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5
10
10
 
11
- * remove fragment ([3d8a964](https://github.com/ho-nl/m2-pwa/commit/3d8a964f3009f04b3ba09d54272a31b592e7a052))
12
- * remove hiding recaptcha from themeProvider, add to component ([6a49f77](https://github.com/ho-nl/m2-pwa/commit/6a49f77ef9fd22ea66e7acd1322c65ac6426fd3b))
11
+ ### Patch Changes
13
12
 
13
+ - Updated dependencies
14
+ [[`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05)]:
15
+ - @graphcommerce/graphql@3.0.0
14
16
 
17
+ All notable changes to this project will be documented in this file. See
18
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
15
19
 
20
+ ## [1.1.8](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googlerecaptcha@1.1.7...@graphcommerce/googlerecaptcha@1.1.8) (2021-12-20)
16
21
 
22
+ ### Bug Fixes
17
23
 
18
- # 1.1.0 (2021-11-03)
24
+ - make sure we're not loading gogole properties when keys are not given
25
+ ([8636715](https://github.com/ho-nl/m2-pwa/commit/8636715d61985e0919208ffb64354c3ebb43ed01))
19
26
 
27
+ ## [1.1.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/googlerecaptcha@1.1.1...@graphcommerce/googlerecaptcha@1.1.2) (2021-11-12)
20
28
 
21
29
  ### Bug Fixes
22
30
 
23
- * make sure we're not throwing a warning on the production env. ([7ee4499](https://github.com/ho-nl/m2-pwa/commit/7ee449959509a13e684c19e2ff707e378d6b5c35))
31
+ - remove fragment
32
+ ([3d8a964](https://github.com/ho-nl/m2-pwa/commit/3d8a964f3009f04b3ba09d54272a31b592e7a052))
33
+ - remove hiding recaptcha from themeProvider, add to component
34
+ ([6a49f77](https://github.com/ho-nl/m2-pwa/commit/6a49f77ef9fd22ea66e7acd1322c65ac6426fd3b))
35
+
36
+ # 1.1.0 (2021-11-03)
37
+
38
+ ### Bug Fixes
24
39
 
40
+ - make sure we're not throwing a warning on the production env.
41
+ ([7ee4499](https://github.com/ho-nl/m2-pwa/commit/7ee449959509a13e684c19e2ff707e378d6b5c35))
25
42
 
26
43
  ### Features
27
44
 
28
- * google recaptcha v3 integration ([a9fcc16](https://github.com/ho-nl/m2-pwa/commit/a9fcc16f93951e61378c99a2e183e2d754da1d50))
45
+ - google recaptcha v3 integration
46
+ ([a9fcc16](https://github.com/ho-nl/m2-pwa/commit/a9fcc16f93951e61378c99a2e183e2d754da1d50))
package/README.md CHANGED
@@ -11,4 +11,4 @@ This package makes it easy to add Google Recaptcha v3 to GraphCommerce
11
11
  3. Add `recaptchaLink` to your Apollo Client.
12
12
  [example](../../examples/magento-graphcms/lib/createApolloClient.ts)
13
13
  4. Add `X-Recaptcha` header to your `.meshrc.yml`.
14
- [example](../../examples/magento-graphcms/lib/createApolloClient.ts)
14
+ [example](../../examples/magento-graphcms/.meshrc.yml)
@@ -1,36 +1,23 @@
1
- import { makeStyles } from '@material-ui/core'
2
1
  import Script from 'next/script'
3
2
  import React from 'react'
4
3
 
5
- const useStyles = makeStyles(
6
- {
7
- '@global': {
8
- body: {
9
- '& .grecaptcha-badge': {
10
- visibility: 'hidden', // https://developers.google.com/recaptcha/docs/faq
11
- },
12
- },
13
- },
14
- },
15
- { name: 'IconBlock' },
16
- )
17
-
18
4
  export default function GoogleRecaptchaV3Script() {
19
5
  const siteKey = process.env.NEXT_PUBLIC_GOOGLE_RECAPTCHA_V3_SITE_KEY
20
- useStyles()
21
6
 
22
7
  if (process.env.NODE_ENV !== 'production' && !siteKey)
23
8
  console.warn(
24
9
  '[@graphcommerce/googletagmanager]: NEXT_PUBLIC_GOOGLE_RECAPTCHA_V3_SITE_KEY not found',
25
10
  )
26
11
 
12
+ if (!siteKey) return null
13
+
27
14
  return (
28
- <Script
29
- id={`google-recaptcha-v3-${siteKey}`}
30
- strategy='lazyOnload'
31
- src={`https://www.google.com/recaptcha/api.js?render=${siteKey}`}
32
- async
33
- defer
34
- />
15
+ <>
16
+ <Script
17
+ strategy='lazyOnload'
18
+ src={`https://www.google.com/recaptcha/api.js?render=${siteKey}`}
19
+ />
20
+ <style>{`.grecaptcha-badge': { visibility: 'hidden' }`}</style>
21
+ </>
35
22
  )
36
23
  }
@@ -1,5 +1,4 @@
1
- import { GraphQLRequest } from '@apollo/client'
2
- import { setContext } from '@apollo/client/link/context'
1
+ import { GraphQLRequest, setContext } from '@graphcommerce/graphql'
3
2
 
4
3
  const isMutation = (operation: GraphQLRequest) =>
5
4
  operation.query.definitions.some(
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@graphcommerce/googlerecaptcha",
3
- "version": "1.1.7",
3
+ "version": "2.0.0",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
- "browserslist": [
7
- "extends @graphcommerce/browserslist-config-pwa"
8
- ],
9
6
  "eslintConfig": {
10
7
  "extends": "@graphcommerce/eslint-config-pwa",
11
8
  "parserOptions": {
@@ -13,19 +10,17 @@
13
10
  }
14
11
  },
15
12
  "devDependencies": {
16
- "@graphcommerce/browserslist-config-pwa": "^3.0.3",
17
- "@graphcommerce/eslint-config-pwa": "^3.1.9",
18
- "@graphcommerce/prettier-config-pwa": "^3.0.5",
19
- "@graphcommerce/typescript-config-pwa": "^3.1.2",
20
- "@playwright/test": "^1.17.1",
13
+ "@graphcommerce/eslint-config-pwa": "^4.0.0",
14
+ "@graphcommerce/prettier-config-pwa": "^4.0.0",
15
+ "@graphcommerce/typescript-config-pwa": "^4.0.0",
16
+ "@playwright/test": "^1.18.1",
21
17
  "@types/grecaptcha": "^3.0.3"
22
18
  },
23
19
  "dependencies": {
24
- "@apollo/client": "^3.5.6",
25
- "@material-ui/core": "^4.12.3",
26
- "next": "^12.0.7",
20
+ "@graphcommerce/graphql": "^3.0.0",
21
+ "@mui/material": "^5.4.1",
22
+ "next": "^12.0.10",
27
23
  "react": "^17.0.2",
28
24
  "react-dom": "^17.0.2"
29
- },
30
- "gitHead": "06b4426d199de9ec2a9d2ac86d42ab047e59e7e7"
25
+ }
31
26
  }