@consent.software/catalog 1.4.4 → 1.4.5
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_bundle/bundle.js +20 -35
- package/dist_bundle/bundle.js.map +2 -2
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/consentsoftware-cookieconsent.d.ts +1 -1
- package/dist_ts_web/elements/consentsoftware-cookieconsent.js +23 -32
- package/dist_watch/bundle.js +22 -31
- package/dist_watch/bundle.js.map +2 -2
- package/package.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/consentsoftware-cookieconsent.ts +29 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consent.software/catalog",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.",
|
|
6
6
|
"exports": {
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@consent.software/catalog',
|
|
6
|
-
version: '1.4.
|
|
6
|
+
version: '1.4.5',
|
|
7
7
|
description: 'A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.'
|
|
8
8
|
}
|
|
@@ -73,7 +73,7 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
73
73
|
align-items: center;
|
|
74
74
|
justify-content: center;
|
|
75
75
|
z-index: 1000; /* standard z-index for fixed elements */
|
|
76
|
-
background: rgba(
|
|
76
|
+
background: rgba(255, 255, 255, 0);
|
|
77
77
|
backdrop-filter: blur(0px);
|
|
78
78
|
transition: all 0.2s;
|
|
79
79
|
}
|
|
@@ -91,10 +91,6 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
91
91
|
min-width: calc(100vw / 3);
|
|
92
92
|
box-sizing: border-box;
|
|
93
93
|
overflow: hidden;
|
|
94
|
-
/*
|
|
95
|
-
* We start with margin-bottom as negative to hide the banner.
|
|
96
|
-
* The animation occurs when we toggle the gotIt/show attributes.
|
|
97
|
-
*/
|
|
98
94
|
will-change: transform; /* ensure efficient rendering */
|
|
99
95
|
transition: all 0.3s;
|
|
100
96
|
transform: scale(0.95);
|
|
@@ -112,18 +108,6 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
112
108
|
display: block;
|
|
113
109
|
}
|
|
114
110
|
|
|
115
|
-
/*
|
|
116
|
-
* Animate margin-bottom when [gotIt] toggles.
|
|
117
|
-
* If gotIt=true, push the banner down off-screen.
|
|
118
|
-
* If gotIt=false, pull the banner into view.
|
|
119
|
-
*/
|
|
120
|
-
:host([gotIt='true']) {
|
|
121
|
-
background: blue;
|
|
122
|
-
}
|
|
123
|
-
:host([gotIt='false']) {
|
|
124
|
-
background: red;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
111
|
.content {
|
|
128
112
|
margin: auto;
|
|
129
113
|
}
|
|
@@ -184,7 +168,6 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
184
168
|
|
|
185
169
|
constructor() {
|
|
186
170
|
super();
|
|
187
|
-
this.setAttribute('gotIt', 'true');
|
|
188
171
|
this.setAttribute('show', 'false');
|
|
189
172
|
}
|
|
190
173
|
|
|
@@ -205,27 +188,29 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
205
188
|
<!-- <div class="button-container">
|
|
206
189
|
<div
|
|
207
190
|
class="consent-button"
|
|
208
|
-
@click=${(event: MouseEvent) =>
|
|
191
|
+
@click=${(event: MouseEvent) =>
|
|
192
|
+
this.handleConsentButtonClick(event, ['functional'])}
|
|
209
193
|
>
|
|
210
194
|
Functional cookies
|
|
211
195
|
</div>
|
|
212
196
|
<div
|
|
213
197
|
class="consent-button"
|
|
214
|
-
@click=${(event: MouseEvent) =>
|
|
198
|
+
@click=${(event: MouseEvent) =>
|
|
199
|
+
this.handleConsentButtonClick(event, ['functional', 'analytics'])}
|
|
215
200
|
>
|
|
216
201
|
Analytics cookies
|
|
217
202
|
</div>
|
|
218
203
|
<div
|
|
219
204
|
class="consent-button"
|
|
220
205
|
@click=${(event: MouseEvent) =>
|
|
221
|
-
this.
|
|
206
|
+
this.handleConsentButtonClick(event, ['functional', 'analytics', 'marketing'])}
|
|
222
207
|
>
|
|
223
208
|
Marketing cookies
|
|
224
209
|
</div>
|
|
225
210
|
<div
|
|
226
211
|
class="consent-button"
|
|
227
212
|
@click=${(event: MouseEvent) =>
|
|
228
|
-
this.
|
|
213
|
+
this.handleConsentButtonClick(event, ['functional', 'analytics', 'marketing', 'all'])}
|
|
229
214
|
>
|
|
230
215
|
All cookies
|
|
231
216
|
</div>
|
|
@@ -234,20 +219,22 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
234
219
|
<div class="button-container">
|
|
235
220
|
<div
|
|
236
221
|
class="consent-button"
|
|
237
|
-
@click=${(event: MouseEvent) =>
|
|
222
|
+
@click=${(event: MouseEvent) =>
|
|
223
|
+
this.handleConsentButtonClick(event, ['functional'])}
|
|
238
224
|
>
|
|
239
225
|
Deny
|
|
240
226
|
</div>
|
|
241
227
|
<div
|
|
242
228
|
class="consent-button"
|
|
243
|
-
@click=${(event: MouseEvent) =>
|
|
229
|
+
@click=${(event: MouseEvent) =>
|
|
230
|
+
this.handleConsentButtonClick(event, ['functional', 'analytics'])}
|
|
244
231
|
>
|
|
245
232
|
Accept selection
|
|
246
233
|
</div>
|
|
247
234
|
<div
|
|
248
235
|
class="consent-button"
|
|
249
236
|
@click=${(event: MouseEvent) =>
|
|
250
|
-
this.
|
|
237
|
+
this.handleConsentButtonClick(event, ['functional', 'analytics', 'marketing'])}
|
|
251
238
|
>
|
|
252
239
|
Accept all cookies
|
|
253
240
|
</div>
|
|
@@ -255,6 +242,7 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
255
242
|
<div class="info-container">
|
|
256
243
|
consent management powered by
|
|
257
244
|
<a href="https://consent.software">consent.software</a>
|
|
245
|
+
(Open Source)
|
|
258
246
|
</div>
|
|
259
247
|
</div>
|
|
260
248
|
</div>
|
|
@@ -272,13 +260,12 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
272
260
|
const cookieLevel = await this.csWebclientInstance.getCookieLevels();
|
|
273
261
|
if (!cookieLevel) {
|
|
274
262
|
this.setAttribute('show', 'true');
|
|
275
|
-
this.setAttribute('gotIt', 'false');
|
|
276
263
|
requestAnimationFrame(async () => {
|
|
277
264
|
await this.updated();
|
|
278
265
|
const pageOverlay: HTMLDivElement = this.shadowRoot?.querySelector('.pageOverlay');
|
|
279
266
|
if (pageOverlay) {
|
|
280
|
-
pageOverlay.style.background = 'rgba(
|
|
281
|
-
pageOverlay.style.backdropFilter = 'blur(
|
|
267
|
+
pageOverlay.style.background = 'rgba(255,255,255, 0.1)';
|
|
268
|
+
pageOverlay.style.backdropFilter = 'blur(1px)';
|
|
282
269
|
}
|
|
283
270
|
const modalBox: HTMLDivElement = this.shadowRoot?.querySelector('.modalBox');
|
|
284
271
|
if (modalBox) {
|
|
@@ -288,7 +275,6 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
288
275
|
});
|
|
289
276
|
} else {
|
|
290
277
|
this.setAttribute('show', 'false');
|
|
291
|
-
this.setAttribute('gotIt', 'true');
|
|
292
278
|
}
|
|
293
279
|
}
|
|
294
280
|
|
|
@@ -313,10 +299,22 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
|
|
313
299
|
/**
|
|
314
300
|
* Sets the user’s chosen cookie level(s) and hides the banner.
|
|
315
301
|
*/
|
|
316
|
-
private async
|
|
302
|
+
private async handleConsentButtonClick(
|
|
303
|
+
event: MouseEvent,
|
|
304
|
+
levelsArg: csInterfaces.TCookieLevel[]
|
|
305
|
+
) {
|
|
317
306
|
console.log(`Set level to ${levelsArg}`);
|
|
307
|
+
const pageOverlay: HTMLDivElement = this.shadowRoot?.querySelector('.pageOverlay');
|
|
308
|
+
if (pageOverlay) {
|
|
309
|
+
pageOverlay.style.background = 'rgba(255,255,255, 0)';
|
|
310
|
+
pageOverlay.style.backdropFilter = 'blur(0px)';
|
|
311
|
+
}
|
|
312
|
+
const modalBox: HTMLDivElement = this.shadowRoot?.querySelector('.modalBox');
|
|
313
|
+
if (modalBox) {
|
|
314
|
+
modalBox.style.transform = `scale(0.95)`;
|
|
315
|
+
modalBox.style.opacity = '0';
|
|
316
|
+
}
|
|
318
317
|
await this.csWebclientInstance.setCookieLevels(levelsArg);
|
|
319
|
-
this.setAttribute('gotIt', 'true');
|
|
320
318
|
await delayFor(300);
|
|
321
319
|
this.setAttribute('show', 'false');
|
|
322
320
|
// After user selection, re-check for any required scripts to run
|