@dargmuesli/nuxt-cookie-control 2.0.0-beta.4 → 2.0.0-beta.6

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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.6",
4
4
  "configKey": "cookieControl",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0"
package/dist/module.mjs CHANGED
@@ -11,7 +11,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
11
11
  const __dirname = __cjs_path__.dirname(__filename);
12
12
  const require = __cjs_mod__.createRequire(import.meta.url);
13
13
  const name = "@dargmuesli/nuxt-cookie-control";
14
- const version = "2.0.0-beta.4";
14
+ const version = "2.0.0-beta.6";
15
15
 
16
16
  const en = {
17
17
  acceptAll: "Accept all",
@@ -141,6 +141,7 @@
141
141
 
142
142
  <script setup lang="ts">
143
143
  import Cookies from 'js-cookie'
144
+ import { ref, computed, onBeforeMount } from 'vue'
144
145
 
145
146
  import { Cookie, CookieType, Locale, Translatable } from '../types'
146
147
  import {
@@ -150,6 +151,8 @@ import {
150
151
  useResolveTranslatable,
151
152
  } from '../methods'
152
153
 
154
+ import { useCookieControl } from '#imports'
155
+
153
156
  export interface Props {
154
157
  locale?: Locale
155
158
  }
@@ -15,9 +15,13 @@
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
18
+ import { computed } from 'vue'
19
+
18
20
  import { LOCALE_DEFAULT } from '../constants'
19
21
  import { Locale } from '../types'
20
22
 
23
+ import { useCookieControl } from '#imports'
24
+
21
25
  export interface Props {
22
26
  locale?: Locale
23
27
  }
@@ -1 +1,2 @@
1
+ import { useNuxtApp } from "#imports";
1
2
  export const useCookieControl = () => useNuxtApp().$cookies;
@@ -1,8 +1,8 @@
1
1
  import { Ref } from 'vue';
2
- import { Cookie, Locale, ModuleOptions, Translatable } from './types';
2
+ import { Cookie, ModuleOptions, Translatable } from './types';
3
3
  export declare const useAcceptNecessary: () => () => void;
4
4
  export declare const acceptNecessary: (enabled: Ref<Cookie[]>, consent: Ref<boolean>, necessaryCookies?: Cookie[]) => void;
5
- export declare const useResolveTranslatable: (locale?: Locale) => (translatable: Translatable) => string;
5
+ export declare const useResolveTranslatable: (locale?: import("./types").Locale) => (translatable: Translatable) => string;
6
6
  export declare const useSetConsent: () => () => void;
7
7
  export declare const setConsent: ({ isInit, isConsentGiven, moduleOptions, cookiesEnabled, cookiesEnabledIds, }: {
8
8
  isInit: boolean;
@@ -28,7 +28,7 @@ export const acceptNecessary = (enabled, consent, necessaryCookies = []) => {
28
28
  export const useResolveTranslatable = (locale = LOCALE_DEFAULT) => {
29
29
  return (translatable) => resolveTranslatable(translatable, locale);
30
30
  };
31
- const resolveTranslatable = (translatable, locale) => {
31
+ const resolveTranslatable = (translatable, locale = LOCALE_DEFAULT) => {
32
32
  if (typeof translatable === "string")
33
33
  return translatable;
34
34
  if (!locale)
@@ -1,4 +1,6 @@
1
+ import { ref } from "vue";
1
2
  import { setConsent } from "./methods.mjs";
3
+ import { defineNuxtPlugin } from "#imports";
2
4
  import moduleOptions from "#build/cookie-control-options";
3
5
  export default defineNuxtPlugin((_nuxtApp) => {
4
6
  const isConsentGiven = ref();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.6",
4
4
  "description": "Nuxt Cookies Control Module",
5
5
  "author": "Dario Ferderber <dario.ferderber@broj42.com>",
6
6
  "maintainers": [