@dargmuesli/nuxt-cookie-control 5.0.0-beta.2 → 5.0.0-beta.3

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,38 +4,49 @@
4
4
  ![Nuxt Cookie Control](https://drive.google.com/a/broj42.com/uc?id=1FGQVyj2s0OT-gpTYxH_FuQhe6oU9iejW)
5
5
 
6
6
 
7
- Continuing Dario Ferderber's work on [gitlab.com/broj42/nuxt-cookie-control](https://gitlab.com/broj42/nuxt-cookie-control).
7
+ Translated for: ar, az, cs, da, de, en, es, fr, hr, hu, it, ja, ko, lt, nl, no, pt, ru, sk, tr and uk
8
8
 
9
- 🚩 **Make sure to read the Migration instructions for all major version updates like [v2.0.0](https://github.com/dargmuesli/nuxt-cookie-control/releases/tag/2.0.0), [v3.0.0](https://github.com/dargmuesli/nuxt-cookie-control/releases/tag/3.0.0) and following!**
9
+ Vue 3 support
10
+
11
+ ✅ Components and composables are [auto-imported](https://nuxt.com/docs/guide/concepts/auto-imports)
12
+
13
+ 🚩 API changes since continuing Dario Ferderber's work on [gitlab.com/broj42/nuxt-cookie-control](https://gitlab.com/broj42/nuxt-cookie-control), make sure to read the README!
14
+
15
+
16
+ ## 🚀 Getting Started
10
17
 
11
18
  [![Stackblitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/dargmuesli/nuxt-cookie-control?file=playground%2Fapp.vue)
12
19
 
13
- ## 🚀 Usage
20
+ ### Installation
14
21
  ```bash
15
22
  npm i -D @dargmuesli/nuxt-cookie-control
16
23
  yarn add -D @dargmuesli/nuxt-cookie-control
17
24
  pnpm i -D @dargmuesli/nuxt-cookie-control
18
25
  ```
19
26
 
20
-
27
+ ### Configuration
21
28
  ```javascript
22
29
  // nuxt.config.js
23
30
 
24
31
  modules: [
25
32
  '@dargmuesli/nuxt-cookie-control'
26
- ]
33
+ ],
34
+ cookieControl: {
35
+ // typed module options
36
+ }
37
+
27
38
  // or
39
+
28
40
  modules: [
29
41
  ['@dargmuesli/nuxt-cookie-control', {
30
- // module options
42
+ // untyped module options
31
43
  }]
32
44
  ]
33
45
  ```
34
46
 
35
- Components and composables are [auto-imported](https://nuxt.com/docs/guide/concepts/auto-imports)!
36
-
47
+ ### Usage
37
48
  ```html
38
- <!-- component.vue -->
49
+ <!-- app.vue -->
39
50
 
40
51
  <template>
41
52
  <CookieControl locale="en" />
@@ -49,56 +60,39 @@ const {
49
60
  isModalActive,
50
61
  moduleOptions
51
62
  } = useCookieControl()
63
+
64
+ // example: react to a cookie being accepted
65
+ watch(
66
+ () => cookiesEnabledIds.value,
67
+ (current, previous) => {
68
+ if (
69
+ (!previous?.includes('google-analytics') &&
70
+ current?.includes('google-analytics'))
71
+ ) {
72
+ // cookie with id `google-analytics` got added
73
+ window.location.reload() // placeholder for your custom change handler
74
+ }
75
+ },
76
+ { deep: true }
77
+ )
52
78
  </script>
53
79
  ```
54
- ## Component Slots
55
- ### Bar
56
- ```html
57
- <CookieControl>
58
- <template #bar>
59
- <h3>Bar title</h3>
60
- <p>Bar description (you can use $cookies.text.barDescription)</p>
61
- <n-link>Go somewhere</n-link>
62
- </template>
63
- </CookieControl>
64
- ```
65
- ### Modal
66
- ```html
67
- <template #modal>
68
- <h3>Modal title</h3>
69
- <p>Modal description</p>
70
- </template>
71
- ```
72
- ### Cookie
73
- ```html
74
- <template #cookie="{config}">
75
- <span v-for="c in config" :key="c.id" v-text="c.cookies"/>
76
- </template>
77
- ```
78
80
 
79
- ## Props
80
- - locale: `['en']`
81
- ```html
82
- <CookieControl locale="de"/>
81
+ ```ts
82
+ // plugins/analytics.client.ts
83
+
84
+ // example: initialization based on enabled cookies
85
+ const cookieControl = useCookieControl()
86
+
87
+ if (cookieControl.cookiesEnabledIds.value.includes('google-analytics')) {
88
+ initGoogleAnalytics() // placeholder for your custom initialization
89
+ }
83
90
  ```
84
91
 
85
- Currently available:
86
- - ar
87
- - de
88
- - en
89
- - es
90
- - fr
91
- - hr
92
- - hu
93
- - it
94
- - ja
95
- - nl
96
- - no
97
- - pt
98
- - ru
99
- - uk
100
-
101
- ## Module Options
92
+
93
+ ## API
94
+
95
+ ### Module Options
102
96
 
103
97
  ```javascript
104
98
  // Position of cookie bar.
@@ -191,7 +185,7 @@ localeTexts: {
191
185
  }
192
186
  ```
193
187
 
194
- ### Cookies
188
+ #### Cookies
195
189
 
196
190
  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: ... }`).
197
191
 
@@ -209,6 +203,40 @@ Every property the includes a `{ en: ... }` value is a translatable property tha
209
203
  }
210
204
  ```
211
205
 
206
+ ### Component Slots
207
+
208
+ #### Bar
209
+ ```html
210
+ <CookieControl>
211
+ <template #bar>
212
+ <h3>Bar title</h3>
213
+ <p>Bar description (you can use $cookies.text.barDescription)</p>
214
+ <n-link>Go somewhere</n-link>
215
+ </template>
216
+ </CookieControl>
217
+ ```
218
+
219
+ #### Modal
220
+ ```html
221
+ <template #modal>
222
+ <h3>Modal title</h3>
223
+ <p>Modal description</p>
224
+ </template>
225
+ ```
226
+
227
+ #### Cookie
228
+ ```html
229
+ <template #cookie="{config}">
230
+ <span v-for="c in config" :key="c.id" v-text="c.cookies"/>
231
+ </template>
232
+ ```
233
+
234
+ ### Props
235
+ - locale: `['en']`
236
+ ```html
237
+ <CookieControl locale="de"/>
238
+ ```
239
+
212
240
 
213
241
  <!-- Badges -->
214
242
  [npm-version-src]: https://badgen.net/npm/v/@dargmuesli/nuxt-cookie-control/latest
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.3",
4
4
  "configKey": "cookieControl",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0"
package/dist/module.mjs CHANGED
@@ -2,7 +2,7 @@ import { resolve } from 'node:path';
2
2
  import { createResolver, defineNuxtModule, addPlugin, addImports, addTemplate, extendWebpackConfig, resolvePath } from '@nuxt/kit';
3
3
 
4
4
  const name = "@dargmuesli/nuxt-cookie-control";
5
- const version = "5.0.0-beta.2";
5
+ const version = "5.0.0-beta.3";
6
6
 
7
7
  const en = {
8
8
  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: "Q\u0259bul et",
3
+ acceptAll: "Ham\u0131s\u0131n\u0131 q\u0259bul et",
4
+ bannerDescription: "Biz \xF6z kukil\u0259rimizd\u0259n v\u0259 \xFC\xE7\xFCnc\xFC t\u0259r\u0259f kukil\u0259rind\u0259n istifad\u0259 edirik ki, biz bu veb-sayt\u0131 d\xFCzg\xFCn g\xF6st\u0259r\u0259 bil\u0259k v\u0259 t\u0259klif etdiyimiz xidm\u0259tl\u0259ri t\u0259kmill\u0259\u015Fdirm\u0259k m\u0259qs\u0259dil\u0259 bu veb-saytdan nec\u0259 istifad\u0259 olundu\u011Funu daha yax\u015F\u0131 ba\u015Fa d\xFC\u015F\u0259k. Kukid\u0259n istifad\u0259 icaz\u0259l\u0259ri il\u0259 ba\u011Fl\u0131 q\u0259rar bu bannerd\u0259 se\xE7im edildikd\u0259n sonra g\xF6r\xFCn\u0259c\u0259k kuki d\xFCym\u0259sind\u0259n istifad\u0259 etm\u0259kl\u0259 ist\u0259nil\u0259n vaxt d\u0259yi\u015Fdiril\u0259 bil\u0259r.",
5
+ bannerTitle: "Kukil\u0259r",
6
+ close: "Ba\u011Fla",
7
+ cookiesFunctional: "Funksional kukil\u0259r",
8
+ cookiesNecessary: "Z\u0259ruri kukil\u0259r",
9
+ cookiesOptional: "\u0130st\u0259y\u0259 ba\u011Fl\u0131 kukil\u0259r",
10
+ decline: "R\u0259dd et",
11
+ declineAll: "Ham\u0131s\u0131n\u0131 r\u0259dd et",
12
+ here: "burada",
13
+ iframeBlocked: "Bunu g\xF6rm\u0259k \xFC\xE7\xFCn funksional kukil\u0259ri aktiv edin",
14
+ manageCookies: "Kukil\u0259ri idar\u0259 et",
15
+ save: "Yadda saxla",
16
+ settingsUnsaved: "Yadda saxlanmam\u0131\u015F ayarlar\u0131n\u0131z var"
17
+ };
@@ -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: "P\u0159ijmout",
3
+ acceptAll: "P\u0159ijmout v\u0161e",
4
+ bannerDescription: "Pou\u017E\xEDv\xE1me soubory cookie a cookie t\u0159et\xEDch stran, abychom mohli v\u0161e spr\xE1vn\u011B zobrazovat a l\xE9pe porozum\u011Bt tomu, jak tento web pou\u017E\xEDv\xE1te, s c\xEDlem zlep\u0161it nab\xEDzen\xE9 slu\u017Eby. Rozhodnut\xED lze kdykoli zm\u011Bnit pomoc\xED tla\u010D\xEDtka cookie, kter\xE9 se zobraz\xED po proveden\xED v\xFDb\u011Bru na tomto banneru.",
5
+ bannerTitle: "Cookies",
6
+ close: "Zav\u0159\xEDt",
7
+ cookiesFunctional: "Obslu\u017En\xE9 cookies",
8
+ cookiesNecessary: "Nezbytn\xE9 cookies",
9
+ cookiesOptional: "Voliteln\xE9 cookies",
10
+ decline: "Zam\xEDtnout",
11
+ declineAll: "Zam\xEDtnout v\u0161e",
12
+ here: "zde",
13
+ iframeBlocked: "Chcete-li ji zobrazit, povolte obslu\u017En\xE9 cookies",
14
+ manageCookies: "Dal\u0161\xED informace a p\u0159izp\u016Fsoben\xED",
15
+ save: "Ulo\u017Eit",
16
+ settingsUnsaved: "M\xE1te neulo\u017Een\xE1 nastaven\xED"
17
+ };
@@ -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: "Accepter",
3
+ acceptAll: "Accepter alle",
4
+ bannerDescription: "Vi bruger vores egne cookies og tredjepartscookies, s\xE5 vi kan vise dig denne hjemmeside og bedre forst\xE5 hvordan du bruger den, med henblik p\xE5 at forbedre de tjenester som vi tilbyder. Du kan til enhver tid tr\xE6kke dit samtykke vedr. brug af cookies tilbage. Dette g\xF8res ved hj\xE6lp af cookie-knappen, der vises n\xE5r et valg er foretaget p\xE5 dette banner.",
5
+ bannerTitle: "Cookies",
6
+ close: "Luk",
7
+ cookiesFunctional: "Funktionelle cookies",
8
+ cookiesNecessary: "N\xF8dvendige cookies",
9
+ cookiesOptional: "Valgfrie cookies",
10
+ decline: "Afvis",
11
+ declineAll: "Afvis alle",
12
+ here: "Her",
13
+ iframeBlocked: "For at se dette skal du aktivere funktionelle cookies",
14
+ manageCookies: "L\xE6s mere og tilpas",
15
+ save: "Gem",
16
+ settingsUnsaved: "Du har indstillinger, der ikke er gemt"
17
+ };
@@ -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: "\uD5C8\uC6A9\uD558\uAE30",
3
+ acceptAll: "\uBAA8\uB450 \uD5C8\uC6A9\uD558\uAE30",
4
+ bannerDescription: "\uB2F9\uC0AC\uAC00 \uC81C\uACF5\uD558\uB294 \uC11C\uBE44\uC2A4\uB97C \uAC1C\uC120\uD558\uAE30 \uC704\uD574 \uADC0\uD558\uC5D0\uAC8C \uC774 \uC6F9\uC0AC\uC774\uD2B8\uB97C \uBCF4\uC5EC\uC8FC\uACE0 \uADC0\uD558\uC758 \uC0AC\uC6A9 \uBC29\uBC95\uC744 \uB354 \uC798 \uC774\uD574\uD560 \uC218 \uC788\uB3C4\uB85D \uC790\uCCB4 \uCFE0\uD0A4 \uBC0F \uD0C0\uC0AC \uCFE0\uD0A4\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4. \uD0D0\uC0C9\uC744 \uACC4\uC18D\uD55C\uB2E4\uBA74 \uCFE0\uD0A4\uB97C \uD5C8\uC6A9\uD55C \uAC83\uC73C\uB85C \uAC04\uC8FC\uB429\uB2C8\uB2E4.",
5
+ bannerTitle: "\uCFE0\uD0A4",
6
+ close: "\uB2EB\uAE30",
7
+ cookiesFunctional: "\uAE30\uB2A5\uC801 \uCFE0\uD0A4",
8
+ cookiesNecessary: "\uD544\uC218 \uCFE0\uD0A4\uD0A4",
9
+ cookiesOptional: "\uC120\uD0DD\uC801 \uCFE0\uD0A4",
10
+ decline: "\uAC70\uBD80\uD558\uAE30",
11
+ declineAll: "\uBAA8\uB450 \uAC70\uBD80\uD558\uAE30",
12
+ here: "\uC5EC\uAE30",
13
+ iframeBlocked: "\uC774 \uCF58\uD150\uCE20\uB97C \uBCFC \uC218 \uC788\uB3C4\uB85D \uAE30\uB2A5\uC801 \uCFE0\uD0A4\uB97C \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694.",
14
+ manageCookies: "\uCFE0\uD0A4 \uAD00\uB9AC",
15
+ save: "\uC800\uC7A5\uD558\uAE30",
16
+ settingsUnsaved: "\uBCC0\uACBD \uC0AC\uD56D\uC774 \uC800\uC7A5\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."
17
+ };
@@ -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: "Sutinku",
3
+ acceptAll: "Sutinku su visais",
4
+ bannerDescription: "Mes naudojame savo slapukus and tre\u010Di\u0173j\u0173 \u0161ali\u0173 slapukus tam, kad gal\u0117tume geriau suprasti kaip svetain\u0117 veikia ir yra naudojama bei tobulinti savo teikiamas paslaugas. J\u016Bs bet kuriuo metu galite pakeisti sutikim\u0105 d\u0117l slapuk\u0173 naudojimo paspaud\u0119 slapuk\u0173 mygtuk\u0105 kuris atsiras kai \u0161ioje reklamjuost\u0117je padarysite pasirinkim\u0105.",
5
+ bannerTitle: "Slapukai",
6
+ close: "U\u017Edaryti",
7
+ cookiesFunctional: "Funkciniai slapukai",
8
+ cookiesNecessary: "B\u016Btinieji slapukai",
9
+ cookiesOptional: "Pasirinktiniai slapukai",
10
+ decline: "At\u0161aukti",
11
+ declineAll: "At\u0161aukti visk\u0105",
12
+ here: "\u010Dia",
13
+ iframeBlocked: "Nor\u0117dami matyti, leiskite naudoti funkcinius slapukus",
14
+ manageCookies: "Su\u017Einoti daugiau ir pritaikyti",
15
+ save: "I\u0161saugoti",
16
+ settingsUnsaved: "J\u016Bs nei\u0161saugojote vis\u0173 nustatym\u0173"
17
+ };
@@ -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: "Prija\u0165",
3
+ acceptAll: "Prija\u0165 v\u0161etko",
4
+ bannerDescription: "S\xFAbory cookie a s\xFAbory cookie tret\xEDch str\xE1n pou\u017E\xEDvame na to, aby sme mohli v\u0161etko spr\xE1vne zobrazi\u0165 a lep\u0161ie pochopi\u0165, ako pou\u017E\xEDvate t\xFAto webov\xFA lokalitu, aby sme mohli zlep\u0161i\u0165 pon\xFAkan\xE9 slu\u017Eby. Rozhodnutia m\xF4\u017Eete kedyko\u013Evek zmeni\u0165 pomocou tla\u010Didla cookie, ktor\xE9 sa zobraz\xED po vykonan\xED v\xFDberu na tomto banneri.",
5
+ bannerTitle: "Cookies",
6
+ close: "Zatvori\u0165",
7
+ cookiesFunctional: "Obslu\u017En\xE9 cookies",
8
+ cookiesNecessary: "Nevyhnutn\xE9 cookies",
9
+ cookiesOptional: "Volite\u013En\xE9 cookies",
10
+ decline: "Odmietnu\u0165",
11
+ declineAll: "Odmietnu\u0165 v\u0161etky",
12
+ here: "tu",
13
+ iframeBlocked: "Ak ho chcete zobrazi\u0165, povo\u013Ete obslu\u017En\xE9 cookies",
14
+ manageCookies: "\u010Eal\u0161ie inform\xE1cie a prisp\xF4sobenie",
15
+ save: "Ulo\u017Ei\u0165",
16
+ settingsUnsaved: "M\xE1te neulo\u017Een\xE9 nastavenia"
17
+ };
@@ -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: "Kabul etmek",
3
+ acceptAll: "T\xFCm\xFCn\xFC kabul et",
4
+ bannerDescription: "Bu web sitesini do\u011Fru bir \u015Fekilde g\xF6r\xFCnt\xFCleyebilmek ve teklifimizi geli\u015Ftirmek i\xE7in bu web sitesinin nas\u0131l kullan\u0131ld\u0131\u011F\u0131n\u0131 daha iyi anlayabilmek i\xE7in kendi ve \xFC\xE7\xFCnc\xFC taraf \xE7erezlerimizi kullan\u0131yoruz. \xC7erez kullanma izni ile ilgili karar, bu banner \xFCzerinde bir se\xE7im yap\u0131ld\u0131ktan sonra g\xF6r\xFCnen \xE7erez d\xFC\u011Fmesi arac\u0131l\u0131\u011F\u0131yla herhangi bir zamanda de\u011Fi\u015Ftirilebilir.",
5
+ bannerTitle: "\xC7erezler",
6
+ close: "Kapat",
7
+ cookiesFunctional: "\u0130\u015Flevsel \xE7erezler",
8
+ cookiesNecessary: "Gerekli \xE7erezler",
9
+ cookiesOptional: "\u0130ste\u011Fe ba\u011Fl\u0131 \xE7erezler",
10
+ decline: "Reddetmek",
11
+ declineAll: "T\xFCm\xFCn\xFC reddet",
12
+ here: "here",
13
+ iframeBlocked: "Bunu g\xF6rmek i\xE7in l\xFCtfen i\u015Flevsel \xE7erezleri etkinle\u015Ftirin",
14
+ manageCookies: "\xC7erezleri y\xF6net",
15
+ save: "Kaydet",
16
+ settingsUnsaved: "Kaydedilmemi\u015F ayarlar mevcut"
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.3",
4
4
  "description": "Nuxt Cookies Control Module",
5
5
  "author": "Dario Ferderber <dario.ferderber@broj42.com>",
6
6
  "maintainers": [
@@ -36,33 +36,31 @@
36
36
  "lint": "pnpm prepack && eslint --ext .js,.ts,.vue . && nuxi typecheck playground"
37
37
  },
38
38
  "dependencies": {
39
- "@nuxt/kit": "3.1.1",
40
- "@sindresorhus/slugify": "2.1.1",
39
+ "@nuxt/kit": "3.2.2",
40
+ "@sindresorhus/slugify": "2.2.0",
41
41
  "css-vars-ponyfill": "2.4.8",
42
42
  "js-cookie": "3.0.1",
43
43
  "string-replace-loader": "3.1.0"
44
44
  },
45
45
  "devDependencies": {
46
+ "@dargmuesli/nuxt-cookie-control": "link:.",
46
47
  "@nuxt/module-builder": "0.2.1",
47
48
  "@nuxtjs/eslint-config-typescript": "12.0.0",
48
- "@types/js-cookie": "3.0.2",
49
- "eslint": "8.33.0",
49
+ "@types/js-cookie": "3.0.3",
50
+ "eslint": "8.34.0",
50
51
  "eslint-config-prettier": "8.6.0",
51
52
  "eslint-plugin-prettier": "4.2.1",
52
53
  "husky": "8.0.3",
53
- "lint-staged": "13.1.0",
54
- "nuxt": "3.1.1",
55
- "prettier": "2.8.3",
56
- "typescript": "4.9.4",
57
- "vue": "3.2.45",
58
- "vue-tsc": "1.0.24",
54
+ "lint-staged": "13.1.2",
55
+ "nuxt": "3.2.2",
56
+ "prettier": "2.8.4",
57
+ "typescript": "4.9.5",
58
+ "vue": "3.2.47",
59
+ "vue-tsc": "1.1.7",
59
60
  "webpack": "5.75.0"
60
61
  },
61
- "resolutions": {
62
- "@dargmuesli/nuxt-cookie-control": "link:./"
63
- },
64
62
  "publishConfig": {
65
63
  "access": "public"
66
64
  },
67
- "scheduleVersion": "2.2.2"
65
+ "scheduleVersion": "4.4.1"
68
66
  }