@dargmuesli/nuxt-cookie-control 4.0.0 → 4.0.2

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/dist/module.d.ts CHANGED
@@ -28,8 +28,8 @@ interface LocaleStrings {
28
28
  settingsUnsaved: string;
29
29
  }
30
30
  interface ModuleOptions {
31
- barPosition?: 'top-left' | 'top-right' | 'top-full' | 'bottom-left' | 'bottom-right' | 'bottom-full';
32
- colors?: false | Record<string, any>;
31
+ barPosition: 'top-left' | 'top-right' | 'top-full' | 'bottom-left' | 'bottom-right' | 'bottom-full';
32
+ colors: false | Record<string, any>;
33
33
  cookieExpiryOffsetMs: number;
34
34
  cookieNameCookiesEnabledIds: string;
35
35
  cookieNameIsConsentGiven: string;
@@ -37,14 +37,14 @@ interface ModuleOptions {
37
37
  necessary: Cookie[];
38
38
  optional: Cookie[];
39
39
  };
40
- domain?: string;
41
- isAcceptNecessaryButtonEnabled?: boolean;
42
- isControlButtonEnabled?: boolean;
43
- isCookieIdVisible?: boolean;
44
- isCssEnabled?: boolean;
45
- isCssPolyfillEnabled?: boolean;
46
- isDashInDescriptionEnabled?: boolean;
47
- isIframeBlocked?: boolean | {
40
+ domain: string;
41
+ isAcceptNecessaryButtonEnabled: boolean;
42
+ isControlButtonEnabled: boolean;
43
+ isCookieIdVisible: boolean;
44
+ isCssEnabled: boolean;
45
+ isCssPolyfillEnabled: boolean;
46
+ isDashInDescriptionEnabled: boolean;
47
+ isIframeBlocked: boolean | {
48
48
  initialState: boolean;
49
49
  };
50
50
  locales: Locale[];
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
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 = "4.0.0";
5
+ const version = "4.0.2";
6
6
 
7
7
  const en = {
8
8
  accept: "Accept",
@@ -3,7 +3,7 @@
3
3
  <section class="cookieControl">
4
4
  <transition :name="`cookieControl__Bar--${moduleOptions.barPosition}`">
5
5
  <div
6
- v-if="isColorsSet && isConsentGiven === undefined"
6
+ v-if="isConsentGiven === undefined"
7
7
  :class="`cookieControl__Bar cookieControl__Bar--${moduleOptions.barPosition}`"
8
8
  >
9
9
  <div class="cookieControl__BarContainer">
@@ -30,9 +30,7 @@
30
30
  </transition>
31
31
  <button
32
32
  v-if="
33
- moduleOptions.isControlButtonEnabled &&
34
- isColorsSet &&
35
- isConsentGiven !== undefined
33
+ moduleOptions.isControlButtonEnabled && isConsentGiven !== undefined
36
34
  "
37
35
  aria-label="Cookie control"
38
36
  class="cookieControl__ControlButton"
@@ -92,7 +90,7 @@
92
90
  :id="resolveTranslatable(cookie.name)"
93
91
  type="checkbox"
94
92
  :checked="
95
- getCookieIds(localCookiesEnabled)?.includes(
93
+ getCookieIds(localCookiesEnabled).includes(
96
94
  getCookieId(cookie)
97
95
  ) ||
98
96
  (getCookie(
@@ -201,7 +199,6 @@ const resolveTranslatable = useResolveTranslatable(props.locale)
201
199
 
202
200
  // data
203
201
  const expires = new Date()
204
- const isColorsSet = ref(false)
205
202
  const localCookiesEnabled = ref([...(cookiesEnabled.value || [])])
206
203
 
207
204
  // computations
@@ -223,7 +220,7 @@ const accept = () => {
223
220
  const decline = () => {
224
221
  setCookies({
225
222
  isConsentGiven: true,
226
- cookiesOptionalEnabled: moduleOptions.cookies?.necessary,
223
+ cookiesOptionalEnabled: moduleOptions.cookies.necessary,
227
224
  })
228
225
  }
229
226
  const acceptPartial = () => {
@@ -232,7 +229,7 @@ const acceptPartial = () => {
232
229
  setCookies({
233
230
  isConsentGiven: true,
234
231
  cookiesOptionalEnabled: [
235
- ...moduleOptions.cookies?.necessary,
232
+ ...moduleOptions.cookies.necessary,
236
233
  ...moduleOptions.cookies.optional,
237
234
  ].filter((cookie) => localCookiesEnabledIds.includes(getCookieId(cookie))),
238
235
  })
@@ -280,7 +277,7 @@ const setCookies = ({
280
277
  ? [
281
278
  ...moduleOptions.cookies.necessary,
282
279
  ...moduleOptions.cookies.optional.filter((cookieOptional: Cookie) =>
283
- cookiesOptionalEnabledNew?.includes(cookieOptional)
280
+ cookiesOptionalEnabledNew.includes(cookieOptional)
284
281
  ),
285
282
  ]
286
283
  : []
@@ -310,8 +307,6 @@ onBeforeMount(async () => {
310
307
  )
311
308
  }
312
309
  }
313
-
314
- isColorsSet.value = true
315
310
  }
316
311
 
317
312
  if (getCookie(moduleOptions.cookieNameIsConsentGiven) === 'true') {
@@ -319,7 +314,7 @@ onBeforeMount(async () => {
319
314
  if (
320
315
  typeof moduleOptions.isIframeBlocked === 'boolean'
321
316
  ? moduleOptions.isIframeBlocked === true
322
- : moduleOptions.isIframeBlocked?.initialState === true
317
+ : moduleOptions.isIframeBlocked.initialState === true
323
318
  ) {
324
319
  localCookiesEnabled.value.push(cookieOptional)
325
320
  }
@@ -11,7 +11,7 @@ export default {
11
11
  declineAll: "Alle ablehnen",
12
12
  here: "hier",
13
13
  iframeBlocked: "Um den Inhalt zu sehen, aktivieren Sie bitte funktionale Cookies",
14
- manageCookies: "Mehr erfahren und individuell anpassen",
14
+ manageCookies: "Mehr erfahren und anpassen",
15
15
  save: "Speichern",
16
16
  settingsUnsaved: "Es gibt nicht gespeicherte Einstellungen"
17
17
  };
@@ -31,8 +31,8 @@ export interface LocaleStrings {
31
31
  settingsUnsaved: string;
32
32
  }
33
33
  export interface ModuleOptions {
34
- barPosition?: 'top-left' | 'top-right' | 'top-full' | 'bottom-left' | 'bottom-right' | 'bottom-full';
35
- colors?: false | Record<string, any>;
34
+ barPosition: 'top-left' | 'top-right' | 'top-full' | 'bottom-left' | 'bottom-right' | 'bottom-full';
35
+ colors: false | Record<string, any>;
36
36
  cookieExpiryOffsetMs: number;
37
37
  cookieNameCookiesEnabledIds: string;
38
38
  cookieNameIsConsentGiven: string;
@@ -40,14 +40,14 @@ export interface ModuleOptions {
40
40
  necessary: Cookie[];
41
41
  optional: Cookie[];
42
42
  };
43
- domain?: string;
44
- isAcceptNecessaryButtonEnabled?: boolean;
45
- isControlButtonEnabled?: boolean;
46
- isCookieIdVisible?: boolean;
47
- isCssEnabled?: boolean;
48
- isCssPolyfillEnabled?: boolean;
49
- isDashInDescriptionEnabled?: boolean;
50
- isIframeBlocked?: boolean | {
43
+ domain: string;
44
+ isAcceptNecessaryButtonEnabled: boolean;
45
+ isControlButtonEnabled: boolean;
46
+ isCookieIdVisible: boolean;
47
+ isCssEnabled: boolean;
48
+ isCssPolyfillEnabled: boolean;
49
+ isDashInDescriptionEnabled: boolean;
50
+ isIframeBlocked: boolean | {
51
51
  initialState: boolean;
52
52
  };
53
53
  locales: Locale[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "Nuxt Cookies Control Module",
5
5
  "author": "Dario Ferderber <dario.ferderber@broj42.com>",
6
6
  "maintainers": [
@@ -33,7 +33,7 @@
33
33
  "dev": "pnpm dev:prepare && nuxi dev playground",
34
34
  "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
35
35
  "dev:build": "nuxi build playground",
36
- "lint": "eslint --ext .js,.ts,.vue . && nuxi typecheck playground"
36
+ "lint": "pnpm prepack && eslint --ext .js,.ts,.vue . && nuxi typecheck playground"
37
37
  },
38
38
  "dependencies": {
39
39
  "@nuxt/kit": "3.1.1",