@dargmuesli/nuxt-cookie-control 4.0.1 → 4.0.3

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": "4.0.1",
3
+ "version": "4.0.3",
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.1";
5
+ const version = "4.0.3";
6
6
 
7
7
  const en = {
8
8
  accept: "Accept",
@@ -80,14 +80,14 @@
80
80
  cookieType === CookieType.NECESSARY &&
81
81
  cookie.name !== 'functional'
82
82
  "
83
- :id="resolveTranslatable(cookie.name)"
83
+ :id="resolveTranslatable(cookie.name, props.locale)"
84
84
  type="checkbox"
85
85
  disabled
86
86
  checked
87
87
  />
88
88
  <input
89
89
  v-else
90
- :id="resolveTranslatable(cookie.name)"
90
+ :id="resolveTranslatable(cookie.name, props.locale)"
91
91
  type="checkbox"
92
92
  :checked="
93
93
  getCookieIds(localCookiesEnabled).includes(
@@ -102,7 +102,9 @@
102
102
  "
103
103
  @change="toogleCookie(cookie)"
104
104
  />
105
- <label :for="resolveTranslatable(cookie.name)">
105
+ <label
106
+ :for="resolveTranslatable(cookie.name, props.locale)"
107
+ >
106
108
  {{ getName(cookie.name) }}
107
109
  </label>
108
110
  <span class="cookieControl__ModalCookieName">
@@ -176,7 +178,7 @@ import {
176
178
  getCookieIds,
177
179
  removeCookie,
178
180
  setCookie,
179
- useResolveTranslatable,
181
+ resolveTranslatable,
180
182
  } from '../methods'
181
183
 
182
184
  import { useCookieControl } from '#imports'
@@ -195,7 +197,6 @@ const {
195
197
  isModalActive,
196
198
  moduleOptions,
197
199
  } = useCookieControl()
198
- const resolveTranslatable = useResolveTranslatable(props.locale)
199
200
 
200
201
  // data
201
202
  const expires = new Date()
@@ -254,13 +255,11 @@ const toogleCookie = (cookie: Cookie) => {
254
255
  const getDescription = (description: Translatable) =>
255
256
  `${
256
257
  moduleOptions.isDashInDescriptionEnabled === false ? '' : '-'
257
- } ${resolveTranslatable(description)}`
258
+ } ${resolveTranslatable(description, props.locale)}`
258
259
  const getName = (name: Translatable) => {
259
260
  return name === 'functional'
260
261
  ? localeStrings.value?.cookiesFunctional
261
- : typeof name === 'string'
262
- ? name
263
- : name[props.locale]
262
+ : resolveTranslatable(name, props.locale)
264
263
  }
265
264
  const init = () => {
266
265
  expires.setTime(expires.getTime() + moduleOptions.cookieExpiryOffsetMs)
@@ -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
  };
@@ -1,7 +1,9 @@
1
- .cookieControl__Modal-enter-active, .cookieControl__Modal-leave-active {
1
+ .cookieControl__Modal-enter-active,
2
+ .cookieControl__Modal-leave-active {
2
3
  transition: opacity 0.25s;
3
4
  }
4
- .cookieControl__Modal-enter, .cookieControl__Modal-leave-to {
5
+ .cookieControl__Modal-enter,
6
+ .cookieControl__Modal-leave-to {
5
7
  opacity: 0;
6
8
  }
7
9
  .cookieControl__Bar--center {
@@ -9,16 +11,40 @@
9
11
  left: 50%;
10
12
  transform: translate(-50%, -50%);
11
13
  }
12
- .cookieControl__Bar--center-enter-active, .cookieControl__Bar--top-left-enter-active, .cookieControl__Bar--top-full-enter-active, .cookieControl__Bar--top-right-enter-active, .cookieControl__Bar--bottom-left-enter-active, .cookieControl__Bar--bottom-full-enter-active, .cookieControl__Bar--bottom-right-enter-active, .cookieControl__Bar--center-leave-active, .cookieControl__Bar--top-left-leave-active, .cookieControl__Bar--top-full-leave-active, .cookieControl__Bar--top-right-leave-active, .cookieControl__Bar--bottom-left-leave-active, .cookieControl__Bar--bottom-full-leave-active, .cookieControl__Bar--bottom-right-leave-active {
14
+ .cookieControl__Bar--center-enter-active,
15
+ .cookieControl__Bar--top-left-enter-active,
16
+ .cookieControl__Bar--top-full-enter-active,
17
+ .cookieControl__Bar--top-right-enter-active,
18
+ .cookieControl__Bar--bottom-left-enter-active,
19
+ .cookieControl__Bar--bottom-full-enter-active,
20
+ .cookieControl__Bar--bottom-right-enter-active,
21
+ .cookieControl__Bar--center-leave-active,
22
+ .cookieControl__Bar--top-left-leave-active,
23
+ .cookieControl__Bar--top-full-leave-active,
24
+ .cookieControl__Bar--top-right-leave-active,
25
+ .cookieControl__Bar--bottom-left-leave-active,
26
+ .cookieControl__Bar--bottom-full-leave-active,
27
+ .cookieControl__Bar--bottom-right-leave-active {
13
28
  transition: transform 0.25s;
14
29
  }
15
- .cookieControl__Bar--top-left-enter, .cookieControl__Bar--top-full-enter, .cookieControl__Bar--top-right-enter, .cookieControl__Bar--top-left-leave-to, .cookieControl__Bar--top-full-leave-to, .cookieControl__Bar--top-right-leave-to {
30
+ .cookieControl__Bar--top-left-enter,
31
+ .cookieControl__Bar--top-full-enter,
32
+ .cookieControl__Bar--top-right-enter,
33
+ .cookieControl__Bar--top-left-leave-to,
34
+ .cookieControl__Bar--top-full-leave-to,
35
+ .cookieControl__Bar--top-right-leave-to {
16
36
  transform: translateY(-100%);
17
37
  }
18
- .cookieControl__Bar--bottom-left-enter, .cookieControl__Bar--bottom-full-enter, .cookieControl__Bar--bottom-right-enter, .cookieControl__Bar--bottom-left-leave-to, .cookieControl__Bar--bottom-right-leave-to, .cookieControl__Bar--bottom-full-leave-to {
38
+ .cookieControl__Bar--bottom-left-enter,
39
+ .cookieControl__Bar--bottom-full-enter,
40
+ .cookieControl__Bar--bottom-right-enter,
41
+ .cookieControl__Bar--bottom-left-leave-to,
42
+ .cookieControl__Bar--bottom-right-leave-to,
43
+ .cookieControl__Bar--bottom-full-leave-to {
19
44
  transform: translateY(100%);
20
45
  }
21
- .cookieControl__Bar--center-enter, .cookieControl__Bar--center-leave-to {
46
+ .cookieControl__Bar--center-enter,
47
+ .cookieControl__Bar--center-leave-to {
22
48
  transform: translate(-50%, -50%) scale(0.95);
23
49
  }
24
50
  .cookieControl {
@@ -37,9 +63,10 @@
37
63
  .cookieControl__Bar {
38
64
  position: fixed;
39
65
  background-color: var(--cookie-control-barBackground);
40
- font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
66
+ font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
41
67
  }
42
- .cookieControl__Bar h3, .cookieControl__Bar p {
68
+ .cookieControl__Bar h3,
69
+ .cookieControl__Bar p {
43
70
  color: var(--cookie-control-barTextColor);
44
71
  max-width: 900px;
45
72
  }
@@ -68,7 +95,8 @@
68
95
  align-items: flex-end;
69
96
  justify-content: space-between;
70
97
  }
71
- .cookieControl__Bar--top-full, .cookieControl__Bar--bottom-full {
98
+ .cookieControl__Bar--top-full,
99
+ .cookieControl__Bar--bottom-full {
72
100
  left: 0;
73
101
  right: 0;
74
102
  }
@@ -78,25 +106,41 @@
78
106
  .cookieControl__Bar--bottom-full {
79
107
  bottom: 0;
80
108
  }
81
- .cookieControl__Bar--center p, .cookieControl__Bar--top-left p, .cookieControl__Bar--top-right p, .cookieControl__Bar--bottom-left p, .cookieControl__Bar--bottom-right p {
109
+ .cookieControl__Bar--center p,
110
+ .cookieControl__Bar--top-left p,
111
+ .cookieControl__Bar--top-right p,
112
+ .cookieControl__Bar--bottom-left p,
113
+ .cookieControl__Bar--bottom-right p {
82
114
  max-width: 400px;
83
115
  }
84
- .cookieControl__Bar--center .cookieControl__BarContainer, .cookieControl__Bar--top-left .cookieControl__BarContainer, .cookieControl__Bar--top-right .cookieControl__BarContainer, .cookieControl__Bar--bottom-left .cookieControl__BarContainer, .cookieControl__Bar--bottom-right .cookieControl__BarContainer {
116
+ .cookieControl__Bar--center .cookieControl__BarContainer,
117
+ .cookieControl__Bar--top-left .cookieControl__BarContainer,
118
+ .cookieControl__Bar--top-right .cookieControl__BarContainer,
119
+ .cookieControl__Bar--bottom-left .cookieControl__BarContainer,
120
+ .cookieControl__Bar--bottom-right .cookieControl__BarContainer {
85
121
  flex-direction: column;
86
122
  }
87
- .cookieControl__Bar--center .cookieControl__BarButtons, .cookieControl__Bar--top-left .cookieControl__BarButtons, .cookieControl__Bar--top-right .cookieControl__BarButtons, .cookieControl__Bar--bottom-left .cookieControl__BarButtons, .cookieControl__Bar--bottom-right .cookieControl__BarButtons {
123
+ .cookieControl__Bar--center .cookieControl__BarButtons,
124
+ .cookieControl__Bar--top-left .cookieControl__BarButtons,
125
+ .cookieControl__Bar--top-right .cookieControl__BarButtons,
126
+ .cookieControl__Bar--bottom-left .cookieControl__BarButtons,
127
+ .cookieControl__Bar--bottom-right .cookieControl__BarButtons {
88
128
  margin-top: 20px;
89
129
  }
90
- .cookieControl__Bar--top-left, .cookieControl__Bar--top-right {
130
+ .cookieControl__Bar--top-left,
131
+ .cookieControl__Bar--top-right {
91
132
  top: 20px;
92
133
  }
93
- .cookieControl__Bar--bottom-left, .cookieControl__Bar--bottom-right {
134
+ .cookieControl__Bar--bottom-left,
135
+ .cookieControl__Bar--bottom-right {
94
136
  bottom: 20px;
95
137
  }
96
- .cookieControl__Bar--top-left, .cookieControl__Bar--bottom-left {
138
+ .cookieControl__Bar--top-left,
139
+ .cookieControl__Bar--bottom-left {
97
140
  left: 20px;
98
141
  }
99
- .cookieControl__Bar--top-right, .cookieControl__Bar--bottom-right {
142
+ .cookieControl__Bar--top-right,
143
+ .cookieControl__Bar--bottom-right {
100
144
  right: 20px;
101
145
  }
102
146
  .cookieControl__BarButtons {
@@ -113,14 +157,14 @@
113
157
  text-align: center;
114
158
  }
115
159
  .cookieControl__Modal:before {
116
- content: "";
160
+ content: '';
117
161
  min-height: 100vh;
118
162
  display: inline-block;
119
163
  vertical-align: middle;
120
164
  }
121
165
  .cookieControl__Modal:after {
122
166
  position: absolute;
123
- content: "";
167
+ content: '';
124
168
  top: 0;
125
169
  left: 0;
126
170
  right: 0;
@@ -211,7 +255,7 @@
211
255
  }
212
256
  .cookieControl__ModalContent label:before {
213
257
  position: absolute;
214
- content: "";
258
+ content: '';
215
259
  top: 50%;
216
260
  left: 3px;
217
261
  width: 15px;
@@ -259,24 +303,30 @@
259
303
  padding: 20px;
260
304
  border: 2px solid #ddd;
261
305
  }
262
- .cookieControl__BlockedIframe p, .cookieControl__BlockedIframe a {
263
- font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
306
+ .cookieControl__BlockedIframe p,
307
+ .cookieControl__BlockedIframe a {
308
+ font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
264
309
  }
265
310
  @media screen and (max-width: 768px) {
266
311
  .cookieControl__Bar {
267
312
  flex-direction: column;
268
313
  left: 0;
269
314
  right: 0;
270
- }
271
- .cookieControl__Bar p, .cookieControl__Bar h3 {
315
+ }
316
+ .cookieControl__Bar p,
317
+ .cookieControl__Bar h3 {
272
318
  max-width: 100%;
273
- }
274
- .cookieControl__Bar--top-full, .cookieControl__Bar--top-left, .cookieControl__Bar--top-right {
319
+ }
320
+ .cookieControl__Bar--top-full,
321
+ .cookieControl__Bar--top-left,
322
+ .cookieControl__Bar--top-right {
275
323
  top: 0;
276
- }
277
- .cookieControl__Bar--bottom-full, .cookieControl__Bar--bottom-left, .cookieControl__Bar--bottom-right {
324
+ }
325
+ .cookieControl__Bar--bottom-full,
326
+ .cookieControl__Bar--bottom-left,
327
+ .cookieControl__Bar--bottom-right {
278
328
  bottom: 0;
279
- }
329
+ }
280
330
  .cookieControl__ModalContent {
281
331
  position: absolute;
282
332
  top: 0;
@@ -286,28 +336,29 @@
286
336
  max-width: none;
287
337
  max-height: 100%;
288
338
  padding: 80px 20px 20px;
289
- }
339
+ }
290
340
  .cookieControl__BarButtons {
291
341
  width: 100%;
292
342
  margin-top: 20px;
293
343
  flex-direction: column;
294
344
  justify-content: center;
295
- }
345
+ }
296
346
  .cookieControl__BarButtons button {
297
347
  width: 100%;
298
- }
348
+ }
299
349
  .cookieControl__BarButtons button + button {
300
350
  margin: 10px 0 0;
301
- }
302
- .cookieControl__BarContainer, .cookieControl__ModalButtons {
351
+ }
352
+ .cookieControl__BarContainer,
353
+ .cookieControl__ModalButtons {
303
354
  flex-direction: column;
304
- }
355
+ }
305
356
  .cookieControl__ModalButtons button {
306
357
  width: 100%;
307
- }
358
+ }
308
359
  .cookieControl__ModalButtons button + button {
309
360
  margin: 10px 0 0;
310
- }
361
+ }
311
362
  }
312
363
  .cookieControl__ControlButton {
313
364
  position: fixed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-cookie-control",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "Nuxt Cookies Control Module",
5
5
  "author": "Dario Ferderber <dario.ferderber@broj42.com>",
6
6
  "maintainers": [