@jarijokinen/consent 0.0.5 → 0.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarijokinen/consent",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "A zero-dependency, vanilla JavaScript consent manager with native Google Consent Mode v2 support.",
5
5
  "main": "src/consent.js",
6
6
  "repository": {
@@ -33,6 +33,10 @@ const country = document.cookie.split(/(?:^|;\s*)cc=/).pop().split(';')[0]
33
33
  const countryDefault = !country || window.consent.countries.includes(country)
34
34
  ? 'denied' : 'granted';
35
35
 
36
+ if (countryDefault === 'granted') {
37
+ window.consent.consentMissing = false;
38
+ }
39
+
36
40
  gtag('consent', 'default', {
37
41
  ...Object.fromEntries(Object.entries(window.consent.state).map(([k, v]) =>
38
42
  [k, v ?? countryDefault]))
package/src/consent.js CHANGED
@@ -5,9 +5,9 @@ export const consent = (options) => {
5
5
  ad_storage: 'Marketing'
6
6
  },
7
7
  actions: {
8
- allowAll: 'Allow All',
8
+ denyAll: 'Deny All',
9
9
  allowSelected: 'Allow Selected',
10
- denyAll: 'Deny All'
10
+ allowAll: 'Allow All'
11
11
  },
12
12
  dialogMarkup: `
13
13
  <h2 class="consent-title"></h2>