@dargmuesli/nuxt-cookie-control 5.2.3 → 5.4.0

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
  ![Nuxt Cookie Control](https://drive.google.com/a/broj42.com/uc?id=1FGQVyj2s0OT-gpTYxH_FuQhe6oU9iejW)
5
5
 
6
6
 
7
- ✅ Translated for: ar, az, cs, da, de, en, es, fi, fr, hr, hu, it, ja, ko, lt, nl, no, pt, ru, sk, sv, tr and uk
7
+ ✅ Translated for: ar, az, cs, da, de, en, es, fi, fr, hr, hu, it, ja, ko, lt, nl, no, pt, pl, ru, sk, sv, tr and uk
8
8
 
9
9
  ✅ Vue 3 support
10
10
 
@@ -171,6 +171,9 @@ isIframeBlocked: false,
171
171
  // initialState: false
172
172
  // },
173
173
 
174
+ // Switch to toggle the modal being shown right away, requiring a user's decision.
175
+ isModalForced: false,
176
+
174
177
  // The domain to set cookies on.
175
178
  // This is useful in case you have subdomains (shop.yourdomain.com)
176
179
  domain: 'yourdomain.com',
package/dist/module.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
- type Locale = 'ar' | 'az' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'pt' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
3
+ type Locale = 'ar' | 'az' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'pt' | 'pl' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
4
4
  type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
5
5
  type Translatable = string | PartialRecord<Locale, string>;
6
6
  interface Cookie {
@@ -48,6 +48,7 @@ interface ModuleOptions {
48
48
  isIframeBlocked: boolean | {
49
49
  initialState: boolean;
50
50
  };
51
+ isModalForced: boolean;
51
52
  locales: Locale[];
52
53
  localeTexts: PartialRecord<Locale, Partial<LocaleStrings>>;
53
54
  }
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "5.2.3",
3
+ "version": "5.4.0",
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, resolvePath } from '@nuxt/kit';
4
4
 
5
5
  const name = "@dargmuesli/nuxt-cookie-control";
6
- const version = "5.2.3";
6
+ const version = "5.4.0";
7
7
 
8
8
  const en = {
9
9
  accept: "Accept",
@@ -68,6 +68,7 @@ const DEFAULTS = {
68
68
  isCssPonyfillEnabled: false,
69
69
  isDashInDescriptionEnabled: true,
70
70
  isIframeBlocked: false,
71
+ isModalForced: false,
71
72
  domain: "",
72
73
  locales: ["en"],
73
74
  localeTexts: { en }
@@ -3,7 +3,7 @@
3
3
  <section class="cookieControl">
4
4
  <transition :name="`cookieControl__Bar--${moduleOptions.barPosition}`">
5
5
  <div
6
- v-if="!isConsentGiven"
6
+ v-if="!isConsentGiven && !moduleOptions.isModalForced"
7
7
  :class="`cookieControl__Bar cookieControl__Bar--${moduleOptions.barPosition}`"
8
8
  >
9
9
  <div class="cookieControl__BarContainer">
@@ -53,6 +53,7 @@
53
53
  <div class="cookieControl__ModalContentInner">
54
54
  <slot name="modal" />
55
55
  <button
56
+ v-if="!moduleOptions.isModalForced"
56
57
  class="cookieControl__ModalClose"
57
58
  @click="isModalActive = false"
58
59
  v-text="localeStrings?.close"
@@ -166,6 +167,7 @@
166
167
  v-text="localeStrings?.acceptAll"
167
168
  />
168
169
  <button
170
+ v-if="!moduleOptions.isModalForced"
169
171
  @click="
170
172
  () => {
171
173
  declineAll()
@@ -337,6 +339,10 @@ onBeforeMount(() => {
337
339
  }
338
340
  }
339
341
  }
342
+
343
+ if (moduleOptions.isModalForced && !isConsentGiven.value) {
344
+ isModalActive.value = true
345
+ }
340
346
  })
341
347
  watch(
342
348
  () => cookiesEnabled.value,
@@ -16,6 +16,7 @@ import lt from "./lt.mjs";
16
16
  import nl from "./nl.mjs";
17
17
  import no from "./no.mjs";
18
18
  import pt from "./pt.mjs";
19
+ import pl from "./pl.mjs";
19
20
  import ru from "./ru.mjs";
20
21
  import sk from "./sk.mjs";
21
22
  import sv from "./sv.mjs";
@@ -40,6 +41,7 @@ export const locales = [
40
41
  nl,
41
42
  no,
42
43
  pt,
44
+ pl,
43
45
  ru,
44
46
  sk,
45
47
  sv,
@@ -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: "Akceptuj",
3
+ acceptAll: "Akceptuj wszystkie",
4
+ bannerDescription: "U\u017Cywamy w\u0142asnych plik\xF3w cookie i plik\xF3w cookie stron trzecich, aby\u015Bmy mogli poprawnie wy\u015Bwietla\u0107 t\u0119 witryn\u0119 i lepiej zrozumie\u0107, w jaki spos\xF3b ta witryna jest u\u017Cywana, w celu ulepszenia oferowanych przez nas us\u0142ug. Decyzj\u0119 w sprawie zgody na korzystanie z plik\xF3w cookie mo\u017Cna zmieni\u0107 w dowolnym momencie za pomoc\u0105 przycisku cookie, kt\xF3ry pojawi si\u0119 po dokonaniu wyboru na tym banerze.",
5
+ bannerTitle: "Polityka cookies",
6
+ close: "Zamknij",
7
+ cookiesFunctional: "Funkcjonalne pliki cookies",
8
+ cookiesNecessary: "Niezb\u0119dne pliki cookies",
9
+ cookiesOptional: "Opcjonalne pliki cookies",
10
+ decline: "Zrezygnuj",
11
+ declineAll: "Zrezygnuj ze wszystkich",
12
+ here: "tutaj",
13
+ iframeBlocked: "W celu wy\u015Bwietlenia wymagane jest w\u0142\u0105czenie funkcjonalnych plik\xF3w cookies",
14
+ manageCookies: "Dowiedz si\u0119 wi\u0119cej",
15
+ save: "Zapisz",
16
+ settingsUnsaved: "Masz niezapisane ustawienia"
17
+ };
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- export type Locale = 'ar' | 'az' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'pt' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
2
+ export type Locale = 'ar' | 'az' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nl' | 'no' | 'pt' | 'pl' | 'ru' | 'sk' | 'sv' | 'tr' | 'uk';
3
3
  export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
4
4
  export type Translatable = string | PartialRecord<Locale, string>;
5
5
  export declare enum CookieType {
@@ -51,6 +51,7 @@ export interface ModuleOptions {
51
51
  isIframeBlocked: boolean | {
52
52
  initialState: boolean;
53
53
  };
54
+ isModalForced: boolean;
54
55
  locales: Locale[];
55
56
  localeTexts: PartialRecord<Locale, Partial<LocaleStrings>>;
56
57
  }
@@ -49,6 +49,7 @@ export const DEFAULTS = {
49
49
  isCssPonyfillEnabled: false,
50
50
  isDashInDescriptionEnabled: true,
51
51
  isIframeBlocked: false,
52
+ isModalForced: false,
52
53
  domain: "",
53
54
  locales: ["en"],
54
55
  localeTexts: { en }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "5.2.3",
3
+ "version": "5.4.0",
4
4
  "description": "Nuxt Cookies Control Module",
5
5
  "author": "Dario Ferderber <dario.ferderber@broj42.com>",
6
6
  "maintainers": [
@@ -36,7 +36,7 @@
36
36
  "lint": "pnpm prepack && eslint --ext .js,.ts,.vue . && nuxi typecheck playground"
37
37
  },
38
38
  "dependencies": {
39
- "@nuxt/kit": "3.3.3",
39
+ "@nuxt/kit": "3.4.0",
40
40
  "@sindresorhus/slugify": "2.2.0",
41
41
  "css-vars-ponyfill": "2.4.8",
42
42
  "js-cookie": "3.0.1",
@@ -47,17 +47,17 @@
47
47
  "@nuxt/module-builder": "0.2.1",
48
48
  "@nuxtjs/eslint-config-typescript": "12.0.0",
49
49
  "@types/js-cookie": "3.0.3",
50
- "eslint": "8.37.0",
50
+ "eslint": "8.38.0",
51
51
  "eslint-config-prettier": "8.8.0",
52
52
  "eslint-plugin-prettier": "4.2.1",
53
53
  "husky": "8.0.3",
54
- "lint-staged": "13.2.0",
55
- "nuxt": "3.3.3",
54
+ "lint-staged": "13.2.1",
55
+ "nuxt": "3.4.0",
56
56
  "prettier": "2.8.7",
57
- "typescript": "5.0.3",
57
+ "typescript": "5.0.4",
58
58
  "vue": "3.2.47",
59
59
  "vue-tsc": "1.2.0",
60
- "webpack": "5.77.0"
60
+ "webpack": "5.78.0"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public"