@consent.software/catalog 1.4.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consent.software/catalog",
3
- "version": "1.4.3",
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.3',
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(0, 0, 0, 0);
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) => this.setLevel(event, ['functional'])}
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) => this.setLevel(event, ['functional', 'analytics'])}
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.setLevel(event, ['functional', 'analytics', 'marketing'])}
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.setLevel(event, ['functional', 'analytics', 'marketing', 'all'])}
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) => this.setLevel(event, ['functional'])}
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) => this.setLevel(event, ['functional', 'analytics'])}
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.setLevel(event, ['functional', 'analytics', 'marketing'])}
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(0, 0, 0, 0.1)';
281
- pageOverlay.style.backdropFilter = 'blur(2px)';
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 setLevel(event: MouseEvent, levelsArg: csInterfaces.TCookieLevel[]) {
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
@@ -6,10 +6,10 @@ import { delayFor } from '@push.rocks/smartdelay';
6
6
  @customElement('consentsoftware-toggle')
7
7
  export class ConsentsoftwareToggle extends LitElement {
8
8
  @property({ type: Boolean })
9
- public required = false;
9
+ public accessor required = false;
10
10
 
11
11
  @property({ type: Boolean, reflect: true })
12
- public selected = false;
12
+ public accessor selected = false;
13
13
 
14
14
  /**
15
15
  * We always track the knob’s left offset in `currentX`.