@dargmuesli/nuxt-cookie-control 5.3.0 → 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
@@ -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
@@ -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.3.0",
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.3.0";
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,
@@ -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.3.0",
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"