@dargmuesli/nuxt-cookie-control 2.0.2 → 2.2.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/dist/module.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -1
- package/dist/runtime/components/CookieControl.vue +18 -18
- package/dist/runtime/locale/ar.mjs +1 -0
- package/dist/runtime/locale/de.mjs +2 -1
- package/dist/runtime/locale/en.mjs +1 -0
- package/dist/runtime/locale/es.mjs +1 -0
- package/dist/runtime/locale/fr.mjs +1 -0
- package/dist/runtime/locale/hr.mjs +1 -0
- package/dist/runtime/locale/hu.mjs +1 -0
- package/dist/runtime/locale/it.mjs +1 -0
- package/dist/runtime/locale/ja.mjs +1 -0
- package/dist/runtime/locale/nl.mjs +1 -0
- package/dist/runtime/locale/no.mjs +1 -0
- package/dist/runtime/locale/pt.mjs +1 -0
- package/dist/runtime/locale/ru.mjs +1 -0
- package/dist/runtime/locale/uk.mjs +1 -0
- package/dist/runtime/methods.d.ts +1 -1
- package/dist/runtime/methods.mjs +5 -8
- package/dist/runtime/types.d.ts +1 -0
- package/package.json +4 -4
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
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
|
|
14
|
+
const version = "2.2.0";
|
|
15
15
|
|
|
16
16
|
const en = {
|
|
17
17
|
acceptAll: "Accept all",
|
|
@@ -26,6 +26,7 @@ const en = {
|
|
|
26
26
|
manageCookies: "Manage cookies",
|
|
27
27
|
necessary: "Necessary cookies",
|
|
28
28
|
optional: "Optional cookies",
|
|
29
|
+
none: "none",
|
|
29
30
|
save: "Save",
|
|
30
31
|
unsaved: "You have unsaved settings"
|
|
31
32
|
};
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
</slot>
|
|
15
15
|
</div>
|
|
16
16
|
<div class="cookieControl__BarButtons">
|
|
17
|
+
<button
|
|
18
|
+
@click="setConsent({ reload: false })"
|
|
19
|
+
v-text="localeStrings?.acceptAll"
|
|
20
|
+
/>
|
|
17
21
|
<button
|
|
18
22
|
v-if="moduleOptions.isAcceptNecessaryButtonEnabled"
|
|
19
23
|
@click="acceptNecessary"
|
|
@@ -23,10 +27,6 @@
|
|
|
23
27
|
@click="isModalActive = true"
|
|
24
28
|
v-text="localeStrings?.manageCookies"
|
|
25
29
|
/>
|
|
26
|
-
<button
|
|
27
|
-
@click="setConsent({ reload: false })"
|
|
28
|
-
v-text="localeStrings?.acceptAll"
|
|
29
|
-
/>
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
v-if="
|
|
36
36
|
moduleOptions.isControlButtonEnabled && colorsSet && isConsentGiven
|
|
37
37
|
"
|
|
38
|
-
class="cookieControl__ControlButton"
|
|
39
38
|
aria-label="Cookie control"
|
|
39
|
+
class="cookieControl__ControlButton"
|
|
40
|
+
data-testid="nuxt-cookie-control-control-button"
|
|
40
41
|
@click="isModalActive = true"
|
|
41
42
|
>
|
|
42
43
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
/>
|
|
64
65
|
<div v-for="cookieType in CookieType" :key="cookieType">
|
|
65
66
|
<h3 v-text="localeStrings && localeStrings[cookieType]" />
|
|
66
|
-
<ul v-if="moduleOptions.cookies">
|
|
67
|
+
<ul v-if="moduleOptions.cookies[cookieType].length">
|
|
67
68
|
<li
|
|
68
69
|
v-for="cookie in moduleOptions.cookies[cookieType]"
|
|
69
70
|
:key="cookie.id"
|
|
@@ -99,22 +100,21 @@
|
|
|
99
100
|
<span v-if="cookie.description">
|
|
100
101
|
{{ getDescription(cookie.description) }}
|
|
101
102
|
</span>
|
|
103
|
+
<span v-if="cookie.targetCookieIds">
|
|
104
|
+
{{
|
|
105
|
+
' IDs: ' +
|
|
106
|
+
cookie.targetCookieIds
|
|
107
|
+
.map((id) => `"${id}"`)
|
|
108
|
+
.join(', ')
|
|
109
|
+
}}
|
|
110
|
+
</span>
|
|
102
111
|
</span>
|
|
103
112
|
</div>
|
|
104
|
-
<template v-if="cookie.targetCookieIds">
|
|
105
|
-
<slot name="cookie" v-bind="{ config: cookie }">
|
|
106
|
-
<ul>
|
|
107
|
-
<li
|
|
108
|
-
v-for="targetCookieId in cookie.targetCookieIds"
|
|
109
|
-
:key="targetCookieId"
|
|
110
|
-
>
|
|
111
|
-
{{ targetCookieId }}
|
|
112
|
-
</li>
|
|
113
|
-
</ul>
|
|
114
|
-
</slot>
|
|
115
|
-
</template>
|
|
116
113
|
</li>
|
|
117
114
|
</ul>
|
|
115
|
+
<p v-else>
|
|
116
|
+
{{ localeStrings?.none }}
|
|
117
|
+
</p>
|
|
118
118
|
</div>
|
|
119
119
|
<div class="cookieControl__ModalButtons">
|
|
120
120
|
<button
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
here: "\u0647\u0646\u0627",
|
|
11
11
|
manageCookies: "\u0625\u062F\u0627\u0631\u0629 \u0645\u0644\u0641\u0627\u062A \u062A\u0639\u0631\u064A\u0641 \u0627\u0644\u0627\u0631\u062A\u0628\u0627\u0637",
|
|
12
12
|
necessary: "\u0645\u0644\u0641\u0627\u062A \u062A\u0639\u0631\u064A\u0641 \u0627\u0644\u0627\u0631\u062A\u0628\u0627\u0637 \u0627\u0644\u0636\u0631\u0648\u0631\u064A\u0629",
|
|
13
|
+
none: "\u0644\u0627 \u0623\u062D\u062F",
|
|
13
14
|
optional: "\u0645\u0644\u0641\u0627\u062A \u062A\u0639\u0631\u064A\u0641 \u0627\u0644\u0627\u0631\u062A\u0628\u0627\u0637 \u0627\u0644\u0627\u062E\u062A\u064A\u0627\u0631\u064A\u0629",
|
|
14
15
|
save: "\u062D\u0641\u0638",
|
|
15
16
|
unsaved: "\u0644\u062F\u064A\u0643 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u063A\u064A\u0631 \u0645\u062D\u0641\u0648\u0638\u0629"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
acceptAll: "Alle akzeptieren",
|
|
3
|
-
acceptNecessary: "
|
|
3
|
+
acceptNecessary: "Nur notwendige akzeptieren",
|
|
4
4
|
barDescription: "Wir verwenden unsere eigenen Cookies und Cookies von Drittanbietern, damit wir Ihnen diese Website zeigen k\xF6nnen und verstehen wie Sie diese verwenden, um die von uns angebotenen Dienstleistungen zu verbessern. Wenn Sie weiter surfen, gehen wir davon aus, dass Sie die Cookies akzeptiert haben.",
|
|
5
5
|
barTitle: "Cookies",
|
|
6
6
|
blockedIframe: "Um den Inhalt zu sehen, aktivieren Sie bitte funktionale Cookies",
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
here: "hier",
|
|
11
11
|
manageCookies: "Cookies verwalten",
|
|
12
12
|
necessary: "Notwendige Cookies",
|
|
13
|
+
none: "keine",
|
|
13
14
|
optional: "Optionale Cookies",
|
|
14
15
|
save: "Speichern",
|
|
15
16
|
unsaved: "Sie haben nicht gespeicherte Einstellungen"
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
here: "itt",
|
|
11
11
|
manageCookies: "S\xFCtikk kezel\xE9se",
|
|
12
12
|
necessary: "Sz\xFCks\xE9ges s\xFCtikk",
|
|
13
|
+
none: "egyik sem",
|
|
13
14
|
optional: "Opcion\xE1lis s\xFCtik",
|
|
14
15
|
save: "Ment\xE9s",
|
|
15
16
|
unsaved: "Ment\xE9s n\xE9lk\xFCli be\xE1ll\xEDt\xE1sok vannak"
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
here: "\u8A2D\u5B9A",
|
|
11
11
|
manageCookies: "Cookie\u3092\u7BA1\u7406",
|
|
12
12
|
necessary: "\u4E0D\u53EF\u6B20\u306ACookie",
|
|
13
|
+
none: "\u306A\u3057",
|
|
13
14
|
optional: "\u4EFB\u610F\u306Ecookies",
|
|
14
15
|
save: "\u4FDD\u5B58",
|
|
15
16
|
unsaved: "\u4FDD\u5B58\u3055\u308C\u3066\u3044\u306A\u3044\u8A2D\u5B9A\u304C\u3042\u308A\u307E\u3059"
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
here: "\u0437\u0434\u0435\u0441\u044C",
|
|
11
11
|
manageCookies: "\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u0430\u043C\u0438 cookie",
|
|
12
12
|
necessary: "\u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0435 \u0444\u0430\u0439\u043B\u044B cookie",
|
|
13
|
+
none: "\u043D\u0438\u043A\u0442\u043E",
|
|
13
14
|
optional: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0444\u0430\u0439\u043B\u044B cookie",
|
|
14
15
|
save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
|
|
15
16
|
unsaved: "\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044C \u043D\u0435\u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438"
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
here: "\u0442\u0443\u0442",
|
|
11
11
|
manageCookies: "\u041A\u0435\u0440\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043B\u0430\u043C\u0438 cookie",
|
|
12
12
|
necessary: "\u041D\u0435\u043E\u0431\u0445\u0456\u0434\u043D\u0456 \u0444\u0430\u0439\u043B\u0438 cookie",
|
|
13
|
+
none: "\u043D\u0435\u043C\u0430\u0454",
|
|
13
14
|
optional: "\u0424\u0430\u043A\u0443\u043B\u044C\u0442\u0430\u0442\u0438\u0432\u043D\u0456 \u0444\u0430\u0439\u043B\u0438 cookie",
|
|
14
15
|
save: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438",
|
|
15
16
|
unsaved: "\u0423 \u0432\u0430\u0441 \u0454 \u043D\u0435\u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0456 \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { Cookie, ModuleOptions, Translatable } from './types';
|
|
3
3
|
export declare const useAcceptNecessary: () => () => void;
|
|
4
|
-
export declare const acceptNecessary: (cookiesEnabledRef: Ref<Cookie[]>,
|
|
4
|
+
export declare const acceptNecessary: (cookiesEnabledRef: Ref<Cookie[]>, cookiesNecessary?: Cookie[]) => void;
|
|
5
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, }: {
|
package/dist/runtime/methods.mjs
CHANGED
|
@@ -3,28 +3,25 @@ import slugify from "@sindresorhus/slugify";
|
|
|
3
3
|
import { useCookieControl } from "./composables.mjs";
|
|
4
4
|
import { LOCALE_DEFAULT } from "./constants.mjs";
|
|
5
5
|
export const useAcceptNecessary = () => {
|
|
6
|
-
const { cookiesEnabled,
|
|
6
|
+
const { cookiesEnabled, moduleOptions } = useCookieControl();
|
|
7
7
|
return () => acceptNecessary(
|
|
8
8
|
cookiesEnabled,
|
|
9
|
-
isConsentGiven,
|
|
10
9
|
moduleOptions.cookies?.necessary
|
|
11
10
|
);
|
|
12
11
|
};
|
|
13
|
-
export const acceptNecessary = (cookiesEnabledRef,
|
|
12
|
+
export const acceptNecessary = (cookiesEnabledRef, cookiesNecessary = []) => {
|
|
14
13
|
const expires = new Date();
|
|
15
14
|
expires.setFullYear(expires.getFullYear() + 1);
|
|
16
15
|
const necessaryCookieIds = cookiesNecessary.map(
|
|
17
16
|
(necessaryCookie) => getCookieId(necessaryCookie)
|
|
18
17
|
);
|
|
19
18
|
setCookies({
|
|
20
|
-
isConsentGiven:
|
|
19
|
+
isConsentGiven: true,
|
|
21
20
|
cookieIds: necessaryCookieIds,
|
|
22
21
|
expires
|
|
23
22
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setHead(cookiesEnabledRef.value);
|
|
27
|
-
}
|
|
23
|
+
setHead(cookiesEnabledRef.value);
|
|
24
|
+
window.location.reload();
|
|
28
25
|
};
|
|
29
26
|
export const useResolveTranslatable = (locale = LOCALE_DEFAULT) => {
|
|
30
27
|
return (translatable) => resolveTranslatable(translatable, locale);
|
package/dist/runtime/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dargmuesli/nuxt-cookie-control",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Nuxt Cookies Control Module",
|
|
5
5
|
"author": "Dario Ferderber <dario.ferderber@broj42.com>",
|
|
6
6
|
"maintainers": [
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"src/locale"
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
|
-
"prepack": "
|
|
33
|
-
"dev": "nuxi dev playground",
|
|
32
|
+
"prepack": "pnpm dev:prepare && nuxt-module-build",
|
|
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
36
|
"lint": "eslint --ext .js,.ts,.vue . && nuxi typecheck playground"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"prettier": "2.8.1",
|
|
56
56
|
"typescript": "4.9.4",
|
|
57
57
|
"vue": "3.2.45",
|
|
58
|
-
"vue-tsc": "1.0.
|
|
58
|
+
"vue-tsc": "1.0.13",
|
|
59
59
|
"webpack": "5.75.0"
|
|
60
60
|
},
|
|
61
61
|
"resolutions": {
|