@dargmuesli/nuxt-cookie-control 7.4.1 → 7.5.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/README.md CHANGED
@@ -208,6 +208,7 @@ Every property that includes a `{ en: ... }` value is a translatable property th
208
208
  },
209
209
  id: 'p', // if unset, `getCookieId(cookie)` returns the cookie's slugified name instead, which e.g. is used to fill the state's `enabledCookieIds` list
210
210
  // use a short cookie id to save bandwidth!
211
+ isPreselected: false // `true` is not GDPR compliant! This flag does not enable any cookies, it only preselects the cookie's modal toggle. The default is `false`.
211
212
  name: {
212
213
  en: 'Preferences' // you always have to specify a cookie name (in English)
213
214
  },
@@ -216,7 +217,7 @@ Every property that includes a `{ en: ... }` value is a translatable property th
216
217
  'https://example.com/terms': 'Terms of Service',
217
218
  },
218
219
  src: 'https://example.com/preferences/js?id=<API-KEY>',
219
- targetCookieIds: ['xmpl_a', 'xmpl_b']
220
+ targetCookieIds: ['xmpl_a', 'xmpl_b'],
220
221
  }
221
222
  ```
222
223
 
package/dist/module.d.mts CHANGED
@@ -7,6 +7,7 @@ type Translatable = string | PartialRecord<Locale, string>;
7
7
  interface Cookie {
8
8
  description?: Translatable;
9
9
  id?: string;
10
+ isPreselected?: boolean;
10
11
  name: Translatable;
11
12
  links?: Record<string, string | null>;
12
13
  src?: string;
package/dist/module.d.ts CHANGED
@@ -7,6 +7,7 @@ type Translatable = string | PartialRecord<Locale, string>;
7
7
  interface Cookie {
8
8
  description?: Translatable;
9
9
  id?: string;
10
+ isPreselected?: boolean;
10
11
  name: Translatable;
11
12
  links?: Record<string, string | null>;
12
13
  src?: string;
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "7.4.1",
3
+ "version": "7.5.1",
4
4
  "configKey": "cookieControl",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0"
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import { pathToFileURL } from 'node:url';
3
3
  import { createResolver, defineNuxtModule, addPlugin, addImports, addTemplate, extendWebpackConfig, extendViteConfig, resolvePath } from '@nuxt/kit';
4
4
 
5
5
  const name = "@dargmuesli/nuxt-cookie-control";
6
- const version = "7.4.1";
6
+ const version = "7.5.1";
7
7
 
8
8
  const en = {
9
9
  accept: "Accept",
@@ -94,9 +94,11 @@
94
94
  :id="resolveTranslatable(cookie.name, props.locale)"
95
95
  type="checkbox"
96
96
  :checked="
97
- getCookieIds(localCookiesEnabled).includes(
98
- getCookieId(cookie),
99
- )
97
+ isConsentGiven === undefined
98
+ ? cookie.isPreselected
99
+ : getCookieIds(localCookiesEnabled).includes(
100
+ getCookieId(cookie),
101
+ )
100
102
  "
101
103
  @change="toogleCookie(cookie)"
102
104
  />
@@ -12,7 +12,7 @@ const plugin = defineNuxtPlugin((_nuxtApp) => {
12
12
  moduleOptions.cookieOptions
13
13
  ).value?.split("|");
14
14
  const isConsentGiven = ref(
15
- cookieIsConsentGiven === void 0 ? void 0 : cookieIsConsentGiven.value === getAllCookieIdsString(moduleOptions)
15
+ cookieIsConsentGiven.value === void 0 ? void 0 : cookieIsConsentGiven.value === getAllCookieIdsString(moduleOptions)
16
16
  );
17
17
  const cookiesEnabled = ref(
18
18
  cookieCookiesEnabledIds === void 0 ? void 0 : [
@@ -10,6 +10,7 @@ export declare enum CookieType {
10
10
  export interface Cookie {
11
11
  description?: Translatable;
12
12
  id?: string;
13
+ isPreselected?: boolean;
13
14
  name: Translatable;
14
15
  links?: Record<string, string | null>;
15
16
  src?: string;
package/package.json CHANGED
@@ -24,10 +24,10 @@
24
24
  "lint-staged": "15.2.2",
25
25
  "nuxt": "3.11.1",
26
26
  "prettier": "3.2.5",
27
- "typescript": "5.4.2",
27
+ "typescript": "5.4.3",
28
28
  "vue": "3.4.21",
29
- "vue-tsc": "2.0.6",
30
- "webpack": "5.90.3"
29
+ "vue-tsc": "2.0.7",
30
+ "webpack": "5.91.0"
31
31
  },
32
32
  "engines": {
33
33
  "node": ">=16"
@@ -79,5 +79,5 @@
79
79
  },
80
80
  "type": "module",
81
81
  "types": "./dist/module.d.ts",
82
- "version": "7.4.1"
82
+ "version": "7.5.1"
83
83
  }