@dargmuesli/nuxt-cookie-control 6.3.1 → 6.4.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
@@ -4,7 +4,7 @@
4
4
 
5
5
  ![nuxt-cookie-control](https://drive.google.com/a/broj42.com/uc?id=19sFguJo7SKUvmH4xu9DhK9ZXzR6oWLX8)
6
6
 
7
- ✅ Translated for: ar, az, bg, cs, da, de, en, es, fi, fr, hr, hu, it, ja, ko, lt, nl, no, oc, pt, pl, ro, rs, ru, sk, sv, tr and uk
7
+ ✅ Translated for: ar, az, bg, ca, cs, da, de, en, es, fi, fr, hr, hu, it, ja, ko, lt, nl, no, oc, pt, pl, ro, rs, ru, sk, sv, tr and uk
8
8
 
9
9
  ✅ Vue 3 support
10
10
 
@@ -64,7 +64,7 @@ const {
64
64
  cookiesEnabledIds,
65
65
  isConsentGiven,
66
66
  isModalActive,
67
- moduleOptions
67
+ moduleOptions,
68
68
  } = useCookieControl()
69
69
 
70
70
  // example: react to a cookie being accepted
@@ -72,14 +72,14 @@ watch(
72
72
  () => cookiesEnabledIds.value,
73
73
  (current, previous) => {
74
74
  if (
75
- (!previous?.includes('google-analytics') &&
76
- current?.includes('google-analytics'))
75
+ !previous?.includes('google-analytics') &&
76
+ current?.includes('google-analytics')
77
77
  ) {
78
78
  // cookie with id `google-analytics` got added
79
79
  window.location.reload() // placeholder for your custom change handler
80
80
  }
81
81
  },
82
- { deep: true }
82
+ { deep: true },
83
83
  )
84
84
  </script>
85
85
  ```
@@ -91,7 +91,7 @@ watch(
91
91
  const cookieControl = useCookieControl()
92
92
 
93
93
  if (cookieControl.cookiesEnabledIds.value.includes('google-analytics')) {
94
- initGoogleAnalytics() // placeholder for your custom initialization
94
+ initGoogleAnalytics() // placeholder for your custom initialization
95
95
  }
96
96
  ```
97
97
 
@@ -197,20 +197,24 @@ localeTexts: {
197
197
 
198
198
  #### Cookies
199
199
 
200
- Every property the includes a `{ en: ... }` value is a translatable property that could instead only specify a string (`'...'`) or other locales as well (`{ de: ..., uk: ... }`).
200
+ Every property that includes a `{ en: ... }` value is a translatable property that could instead only specify a string (`'...'`) or other locales as well (`{ de: ..., uk: ... }`).
201
201
 
202
202
  ```javascript
203
203
  {
204
204
  description: {
205
- en: 'Used for cookie control.'
205
+ en: 'This cookie stores preferences.'
206
206
  },
207
- id: 'ga', // if unset, `getCookieId(cookie)` returns the cookie's slugified name instead, which e.g. is used to fill the state's `enabledCookieIds` list
207
+ 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
208
208
  // use a short cookie id to save bandwidth!
209
209
  name: {
210
- en: 'Google Analytics' // you always have to specify a cookie name (in English)
210
+ en: 'Preferences' // you always have to specify a cookie name (in English)
211
211
  },
212
- src: 'https://www.googletagmanager.com/gtag/js?id=<API-KEY>',
213
- targetCookieIds: ['cookie_control_consent', 'cookie_control_enabled_cookies']
212
+ links: {
213
+ 'https://example.com/privacy': 'Privacy Policy',
214
+ 'https://example.com/terms': 'Terms of Service',
215
+ },
216
+ src: 'https://example.com/preferences/js?id=<API-KEY>',
217
+ targetCookieIds: ['xmpl_a', 'xmpl_b']
214
218
  }
215
219
  ```
216
220
 
@@ -241,7 +245,7 @@ Every property the includes a `{ en: ... }` value is a translatable property tha
241
245
 
242
246
  ```html
243
247
  <template #cookie="{config}">
244
- <span v-for="c in config" :key="c.id" v-text="c.cookies"/>
248
+ <span v-for="c in config" :key="c.id" v-text="c.cookies" />
245
249
  </template>
246
250
  ```
247
251
 
@@ -249,7 +253,7 @@ Every property the includes a `{ en: ... }` value is a translatable property tha
249
253
 
250
254
  - locale: `['en']`
251
255
  ```html
252
- <CookieControl locale="de"/>
256
+ <CookieControl locale="de" />
253
257
  ```
254
258
 
255
259
 
package/dist/module.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { CookieOptions } from 'nuxt/app';
3
3
 
4
- type Locale = 'ar' | 'az' | 'bg' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'oc' | 'pt' | 'pl' | 'ro' | 'rs' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
4
+ type Locale = 'ar' | 'az' | 'bg' | 'ca' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'oc' | 'pt' | 'pl' | 'ro' | 'rs' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
5
5
  type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
6
6
  type Translatable = string | PartialRecord<Locale, string>;
7
7
  interface Cookie {
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "6.3.1",
3
+ "version": "6.4.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 = "6.3.1";
6
+ const version = "6.4.1";
7
7
 
8
8
  const en = {
9
9
  accept: "Accept",
@@ -0,0 +1,3 @@
1
+ import { LocaleStrings } from '../types';
2
+ declare const _default: LocaleStrings;
3
+ export default _default;
@@ -0,0 +1,17 @@
1
+ export default {
2
+ accept: "Acceptar",
3
+ acceptAll: "Acceptar-ho tot",
4
+ bannerDescription: "Utilitzem cookies pr\xF2pies i de tercers per tal de poder visualitzar correctament aquest lloc web i entendre millor com s'utilitza, amb l'objectiu de millorar els serveis que oferim. Una decisi\xF3 sobre els permisos d'\xFAs de cookies es pot canviar en qualsevol moment mitjan\xE7ant el bot\xF3 de cookies que apareixer\xE0 despr\xE9s d'haver fet una selecci\xF3 en aquest b\xE0ner.",
5
+ bannerTitle: "Cookies",
6
+ close: "Tancar",
7
+ cookiesFunctional: "Cookies funcionals",
8
+ cookiesNecessary: "Cookies necess\xE0ries",
9
+ cookiesOptional: "Cookies opcionals",
10
+ decline: "Declinar",
11
+ declineAll: "Declinar tot",
12
+ here: "aqu\xED",
13
+ iframeBlocked: "Per veure-ho, activeu les cookies funcionals",
14
+ manageCookies: "M\xE9s informaci\xF3 i personalitzaci\xF3",
15
+ save: "Desar",
16
+ settingsUnsaved: "Tens una configuraci\xF3 no desada"
17
+ };
@@ -1,6 +1,7 @@
1
1
  import ar from "./ar.mjs";
2
2
  import az from "./az.mjs";
3
3
  import bg from "./bg.mjs";
4
+ import ca from "./ca.mjs";
4
5
  import cs from "./cs.mjs";
5
6
  import da from "./da.mjs";
6
7
  import de from "./de.mjs";
@@ -30,6 +31,7 @@ export const locales = [
30
31
  ar,
31
32
  az,
32
33
  bg,
34
+ ca,
33
35
  cs,
34
36
  da,
35
37
  de,
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  import { CookieOptions } from 'nuxt/app';
3
- export type Locale = 'ar' | 'az' | 'bg' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'oc' | 'pt' | 'pl' | 'ro' | 'rs' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
3
+ export type Locale = 'ar' | 'az' | 'bg' | 'ca' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'oc' | 'pt' | 'pl' | 'ro' | 'rs' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
4
4
  export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
5
5
  export type Translatable = string | PartialRecord<Locale, string>;
6
6
  export declare enum CookieType {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "6.3.1",
3
+ "version": "6.4.1",
4
4
  "description": "Nuxt Cookie Control Module",
5
5
  "author": "Dario Ferderber <dario.ferderber@broj42.com>",
6
6
  "maintainers": [
@@ -59,9 +59,9 @@
59
59
  "eslint-config-prettier": "9.0.0",
60
60
  "eslint-plugin-prettier": "5.0.0",
61
61
  "husky": "8.0.3",
62
- "lint-staged": "14.0.0",
62
+ "lint-staged": "14.0.1",
63
63
  "nuxt": "3.6.5",
64
- "prettier": "3.0.1",
64
+ "prettier": "3.0.2",
65
65
  "typescript": "5.1.6",
66
66
  "vue": "3.3.4",
67
67
  "vue-tsc": "1.8.8",