@dargmuesli/nuxt-cookie-control 8.0.0-beta.3 → 8.0.0-beta.4

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
  en: 'This cookie stores preferences.'
209
209
  },
210
210
  id: 'p', // use a short cookie id to save bandwidth and prefixes to separate
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": "8.0.0-beta.3",
3
+ "version": "8.0.0-beta.4",
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 = "8.0.0-beta.3";
6
+ const version = "8.0.0-beta.4";
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
- cookie.id,
99
- )
97
+ isConsentGiven === undefined
98
+ ? cookie.isPreselected
99
+ : getCookieIds(localCookiesEnabled).includes(
100
+ cookie.id,
101
+ )
100
102
  "
101
103
  @change="toogleCookie(cookie)"
102
104
  />
@@ -139,9 +141,16 @@
139
141
  :key="entry[0]"
140
142
  >
141
143
  <br />
142
- <a :href="entry[0]">{{
143
- entry[1] || entry[0]
144
- }}</a>
144
+ <NuxtLink
145
+ :to="entry[0]"
146
+ @click="
147
+ !entry[0].toLowerCase().startsWith('http')
148
+ ? (isModalActive = false)
149
+ : null
150
+ "
151
+ >
152
+ {{ entry[1] || entry[0] }}
153
+ </NuxtLink>
145
154
  </span>
146
155
  </template>
147
156
  </label>
@@ -13,7 +13,7 @@ const plugin = defineNuxtPlugin((_nuxtApp) => {
13
13
  moduleOptions.cookieOptions
14
14
  ).value?.split(COOKIE_ID_SEPARATOR);
15
15
  const isConsentGiven = ref(
16
- cookieIsConsentGiven === void 0 ? void 0 : cookieIsConsentGiven.value === getAllCookieIdsString(moduleOptions)
16
+ cookieIsConsentGiven.value === void 0 ? void 0 : cookieIsConsentGiven.value === getAllCookieIdsString(moduleOptions)
17
17
  );
18
18
  const cookiesEnabled = ref(
19
19
  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
@@ -23,10 +23,10 @@
23
23
  "lint-staged": "15.2.2",
24
24
  "nuxt": "3.11.1",
25
25
  "prettier": "3.2.5",
26
- "typescript": "5.4.2",
26
+ "typescript": "5.4.3",
27
27
  "vue": "3.4.21",
28
- "vue-tsc": "2.0.6",
29
- "webpack": "5.90.3"
28
+ "vue-tsc": "2.0.7",
29
+ "webpack": "5.91.0"
30
30
  },
31
31
  "engines": {
32
32
  "node": ">=16"
@@ -79,5 +79,5 @@
79
79
  },
80
80
  "type": "module",
81
81
  "types": "./dist/module.d.ts",
82
- "version": "8.0.0-beta.3"
82
+ "version": "8.0.0-beta.4"
83
83
  }