@entur/utils 0.12.0 → 1.0.0-alpha.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/consentUtils.d.ts +33 -0
- package/dist/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/usercentrics.d.ts +71 -0
- package/dist/utils.cjs.development.js +449 -0
- package/dist/utils.cjs.development.js.map +1 -1
- package/dist/utils.cjs.production.min.js +1 -1
- package/dist/utils.cjs.production.min.js.map +1 -1
- package/dist/utils.esm.js +445 -1
- package/dist/utils.esm.js.map +1 -1
- package/package.json +4 -3
package/dist/utils.esm.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState } from 'react';
|
|
2
2
|
import warning from 'tiny-warning';
|
|
3
|
+
import { space, shadows, fontSizes, lineHeights } from '@entur/tokens';
|
|
3
4
|
|
|
4
5
|
function useDebounce(callBack, debounceTime) {
|
|
5
6
|
var timeoutRef = useRef();
|
|
@@ -198,5 +199,448 @@ var getNodeText = function getNodeText(node) {
|
|
|
198
199
|
return 'unknown';
|
|
199
200
|
};
|
|
200
201
|
|
|
201
|
-
|
|
202
|
+
function _regeneratorRuntime() {
|
|
203
|
+
_regeneratorRuntime = function () {
|
|
204
|
+
return exports;
|
|
205
|
+
};
|
|
206
|
+
var exports = {},
|
|
207
|
+
Op = Object.prototype,
|
|
208
|
+
hasOwn = Op.hasOwnProperty,
|
|
209
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
210
|
+
obj[key] = desc.value;
|
|
211
|
+
},
|
|
212
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
213
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
214
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
215
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
216
|
+
function define(obj, key, value) {
|
|
217
|
+
return Object.defineProperty(obj, key, {
|
|
218
|
+
value: value,
|
|
219
|
+
enumerable: !0,
|
|
220
|
+
configurable: !0,
|
|
221
|
+
writable: !0
|
|
222
|
+
}), obj[key];
|
|
223
|
+
}
|
|
224
|
+
try {
|
|
225
|
+
define({}, "");
|
|
226
|
+
} catch (err) {
|
|
227
|
+
define = function (obj, key, value) {
|
|
228
|
+
return obj[key] = value;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
232
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
233
|
+
generator = Object.create(protoGenerator.prototype),
|
|
234
|
+
context = new Context(tryLocsList || []);
|
|
235
|
+
return defineProperty(generator, "_invoke", {
|
|
236
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
237
|
+
}), generator;
|
|
238
|
+
}
|
|
239
|
+
function tryCatch(fn, obj, arg) {
|
|
240
|
+
try {
|
|
241
|
+
return {
|
|
242
|
+
type: "normal",
|
|
243
|
+
arg: fn.call(obj, arg)
|
|
244
|
+
};
|
|
245
|
+
} catch (err) {
|
|
246
|
+
return {
|
|
247
|
+
type: "throw",
|
|
248
|
+
arg: err
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
exports.wrap = wrap;
|
|
253
|
+
var ContinueSentinel = {};
|
|
254
|
+
function Generator() {}
|
|
255
|
+
function GeneratorFunction() {}
|
|
256
|
+
function GeneratorFunctionPrototype() {}
|
|
257
|
+
var IteratorPrototype = {};
|
|
258
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
259
|
+
return this;
|
|
260
|
+
});
|
|
261
|
+
var getProto = Object.getPrototypeOf,
|
|
262
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
263
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
264
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
265
|
+
function defineIteratorMethods(prototype) {
|
|
266
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
267
|
+
define(prototype, method, function (arg) {
|
|
268
|
+
return this._invoke(method, arg);
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
273
|
+
function invoke(method, arg, resolve, reject) {
|
|
274
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
275
|
+
if ("throw" !== record.type) {
|
|
276
|
+
var result = record.arg,
|
|
277
|
+
value = result.value;
|
|
278
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
279
|
+
invoke("next", value, resolve, reject);
|
|
280
|
+
}, function (err) {
|
|
281
|
+
invoke("throw", err, resolve, reject);
|
|
282
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
283
|
+
result.value = unwrapped, resolve(result);
|
|
284
|
+
}, function (error) {
|
|
285
|
+
return invoke("throw", error, resolve, reject);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
reject(record.arg);
|
|
289
|
+
}
|
|
290
|
+
var previousPromise;
|
|
291
|
+
defineProperty(this, "_invoke", {
|
|
292
|
+
value: function (method, arg) {
|
|
293
|
+
function callInvokeWithMethodAndArg() {
|
|
294
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
295
|
+
invoke(method, arg, resolve, reject);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
303
|
+
var state = "suspendedStart";
|
|
304
|
+
return function (method, arg) {
|
|
305
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
306
|
+
if ("completed" === state) {
|
|
307
|
+
if ("throw" === method) throw arg;
|
|
308
|
+
return doneResult();
|
|
309
|
+
}
|
|
310
|
+
for (context.method = method, context.arg = arg;;) {
|
|
311
|
+
var delegate = context.delegate;
|
|
312
|
+
if (delegate) {
|
|
313
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
314
|
+
if (delegateResult) {
|
|
315
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
316
|
+
return delegateResult;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
320
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
321
|
+
context.dispatchException(context.arg);
|
|
322
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
323
|
+
state = "executing";
|
|
324
|
+
var record = tryCatch(innerFn, self, context);
|
|
325
|
+
if ("normal" === record.type) {
|
|
326
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
327
|
+
return {
|
|
328
|
+
value: record.arg,
|
|
329
|
+
done: context.done
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
337
|
+
var methodName = context.method,
|
|
338
|
+
method = delegate.iterator[methodName];
|
|
339
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
340
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
341
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
342
|
+
var info = record.arg;
|
|
343
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
344
|
+
}
|
|
345
|
+
function pushTryEntry(locs) {
|
|
346
|
+
var entry = {
|
|
347
|
+
tryLoc: locs[0]
|
|
348
|
+
};
|
|
349
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
350
|
+
}
|
|
351
|
+
function resetTryEntry(entry) {
|
|
352
|
+
var record = entry.completion || {};
|
|
353
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
354
|
+
}
|
|
355
|
+
function Context(tryLocsList) {
|
|
356
|
+
this.tryEntries = [{
|
|
357
|
+
tryLoc: "root"
|
|
358
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
359
|
+
}
|
|
360
|
+
function values(iterable) {
|
|
361
|
+
if (iterable) {
|
|
362
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
363
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
364
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
365
|
+
if (!isNaN(iterable.length)) {
|
|
366
|
+
var i = -1,
|
|
367
|
+
next = function next() {
|
|
368
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
369
|
+
return next.value = undefined, next.done = !0, next;
|
|
370
|
+
};
|
|
371
|
+
return next.next = next;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return {
|
|
375
|
+
next: doneResult
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
function doneResult() {
|
|
379
|
+
return {
|
|
380
|
+
value: undefined,
|
|
381
|
+
done: !0
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
385
|
+
value: GeneratorFunctionPrototype,
|
|
386
|
+
configurable: !0
|
|
387
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
388
|
+
value: GeneratorFunction,
|
|
389
|
+
configurable: !0
|
|
390
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
391
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
392
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
393
|
+
}, exports.mark = function (genFun) {
|
|
394
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
395
|
+
}, exports.awrap = function (arg) {
|
|
396
|
+
return {
|
|
397
|
+
__await: arg
|
|
398
|
+
};
|
|
399
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
400
|
+
return this;
|
|
401
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
402
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
403
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
404
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
405
|
+
return result.done ? result.value : iter.next();
|
|
406
|
+
});
|
|
407
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
408
|
+
return this;
|
|
409
|
+
}), define(Gp, "toString", function () {
|
|
410
|
+
return "[object Generator]";
|
|
411
|
+
}), exports.keys = function (val) {
|
|
412
|
+
var object = Object(val),
|
|
413
|
+
keys = [];
|
|
414
|
+
for (var key in object) keys.push(key);
|
|
415
|
+
return keys.reverse(), function next() {
|
|
416
|
+
for (; keys.length;) {
|
|
417
|
+
var key = keys.pop();
|
|
418
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
419
|
+
}
|
|
420
|
+
return next.done = !0, next;
|
|
421
|
+
};
|
|
422
|
+
}, exports.values = values, Context.prototype = {
|
|
423
|
+
constructor: Context,
|
|
424
|
+
reset: function (skipTempReset) {
|
|
425
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
426
|
+
},
|
|
427
|
+
stop: function () {
|
|
428
|
+
this.done = !0;
|
|
429
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
430
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
431
|
+
return this.rval;
|
|
432
|
+
},
|
|
433
|
+
dispatchException: function (exception) {
|
|
434
|
+
if (this.done) throw exception;
|
|
435
|
+
var context = this;
|
|
436
|
+
function handle(loc, caught) {
|
|
437
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
438
|
+
}
|
|
439
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
440
|
+
var entry = this.tryEntries[i],
|
|
441
|
+
record = entry.completion;
|
|
442
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
443
|
+
if (entry.tryLoc <= this.prev) {
|
|
444
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
445
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
446
|
+
if (hasCatch && hasFinally) {
|
|
447
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
448
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
449
|
+
} else if (hasCatch) {
|
|
450
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
451
|
+
} else {
|
|
452
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
453
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
abrupt: function (type, arg) {
|
|
459
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
460
|
+
var entry = this.tryEntries[i];
|
|
461
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
462
|
+
var finallyEntry = entry;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
467
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
468
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
469
|
+
},
|
|
470
|
+
complete: function (record, afterLoc) {
|
|
471
|
+
if ("throw" === record.type) throw record.arg;
|
|
472
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
473
|
+
},
|
|
474
|
+
finish: function (finallyLoc) {
|
|
475
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
476
|
+
var entry = this.tryEntries[i];
|
|
477
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
catch: function (tryLoc) {
|
|
481
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
482
|
+
var entry = this.tryEntries[i];
|
|
483
|
+
if (entry.tryLoc === tryLoc) {
|
|
484
|
+
var record = entry.completion;
|
|
485
|
+
if ("throw" === record.type) {
|
|
486
|
+
var thrown = record.arg;
|
|
487
|
+
resetTryEntry(entry);
|
|
488
|
+
}
|
|
489
|
+
return thrown;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
throw new Error("illegal catch attempt");
|
|
493
|
+
},
|
|
494
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
495
|
+
return this.delegate = {
|
|
496
|
+
iterator: values(iterable),
|
|
497
|
+
resultName: resultName,
|
|
498
|
+
nextLoc: nextLoc
|
|
499
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
500
|
+
}
|
|
501
|
+
}, exports;
|
|
502
|
+
}
|
|
503
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
504
|
+
try {
|
|
505
|
+
var info = gen[key](arg);
|
|
506
|
+
var value = info.value;
|
|
507
|
+
} catch (error) {
|
|
508
|
+
reject(error);
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
if (info.done) {
|
|
512
|
+
resolve(value);
|
|
513
|
+
} else {
|
|
514
|
+
Promise.resolve(value).then(_next, _throw);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
function _asyncToGenerator(fn) {
|
|
518
|
+
return function () {
|
|
519
|
+
var self = this,
|
|
520
|
+
args = arguments;
|
|
521
|
+
return new Promise(function (resolve, reject) {
|
|
522
|
+
var gen = fn.apply(self, args);
|
|
523
|
+
function _next(value) {
|
|
524
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
525
|
+
}
|
|
526
|
+
function _throw(err) {
|
|
527
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
528
|
+
}
|
|
529
|
+
_next(undefined);
|
|
530
|
+
});
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
var CMP_INITIALIZE_EVENT = 'UC_UI_INITIALIZED';
|
|
535
|
+
var CONSENT_UPDATED_EVENT = 'UC_CONSENT';
|
|
536
|
+
var CMP_SHADOW_ROOT_ID = 'usercentrics-cmp-ui';
|
|
537
|
+
var acceptAllConsents = function acceptAllConsents() {
|
|
538
|
+
return window.__ucCmp.acceptAllConsents();
|
|
539
|
+
};
|
|
540
|
+
var denyAllConsents = function denyAllConsents() {
|
|
541
|
+
return window.__ucCmp.denyAllConsents();
|
|
542
|
+
};
|
|
543
|
+
var updateServicesConsents = function updateServicesConsents(serviceConsents) {
|
|
544
|
+
return window.__ucCmp.updateServicesConsents(serviceConsents);
|
|
545
|
+
};
|
|
546
|
+
var changeLanguage = function changeLanguage(language) {
|
|
547
|
+
return window.__ucCmp.changeLanguage(language);
|
|
548
|
+
};
|
|
549
|
+
var showCookieBanner = function showCookieBanner() {
|
|
550
|
+
return window.__ucCmp.showFirstLayer();
|
|
551
|
+
};
|
|
552
|
+
var hideCookieBanner = function hideCookieBanner() {
|
|
553
|
+
return window.__ucCmp.closeCmp();
|
|
554
|
+
};
|
|
555
|
+
function styleCookieBanner() {
|
|
556
|
+
return _styleCookieBanner.apply(this, arguments);
|
|
557
|
+
}
|
|
558
|
+
function _styleCookieBanner() {
|
|
559
|
+
_styleCookieBanner = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
560
|
+
var _cmpElement$shadowRoo;
|
|
561
|
+
var cmpElement, sheet;
|
|
562
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
563
|
+
while (1) {
|
|
564
|
+
switch (_context.prev = _context.next) {
|
|
565
|
+
case 0:
|
|
566
|
+
_context.next = 2;
|
|
567
|
+
return waitForElementWithId(CMP_SHADOW_ROOT_ID);
|
|
568
|
+
case 2:
|
|
569
|
+
cmpElement = document.getElementById(CMP_SHADOW_ROOT_ID);
|
|
570
|
+
console.log('cmp', cmpElement);
|
|
571
|
+
sheet = new CSSStyleSheet();
|
|
572
|
+
sheet.replaceSync(cmpStyleSheet);
|
|
573
|
+
cmpElement == null ? void 0 : (_cmpElement$shadowRoo = cmpElement.shadowRoot) == null ? void 0 : _cmpElement$shadowRoo.adoptedStyleSheets.push(sheet);
|
|
574
|
+
case 7:
|
|
575
|
+
case "end":
|
|
576
|
+
return _context.stop();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}, _callee);
|
|
580
|
+
}));
|
|
581
|
+
return _styleCookieBanner.apply(this, arguments);
|
|
582
|
+
}
|
|
583
|
+
function formatConsentEvent(event) {
|
|
584
|
+
var _event$detail$service, _event$detail;
|
|
585
|
+
return Object.entries((_event$detail$service = event == null ? void 0 : (_event$detail = event.detail) == null ? void 0 : _event$detail.services) != null ? _event$detail$service : {}).map(function (service) {
|
|
586
|
+
var _service$1$consent$gi, _service$1$consent;
|
|
587
|
+
return {
|
|
588
|
+
id: service[0],
|
|
589
|
+
name: service[1].name,
|
|
590
|
+
consentGiven: (_service$1$consent$gi = (_service$1$consent = service[1].consent) == null ? void 0 : _service$1$consent.given) != null ? _service$1$consent$gi : false,
|
|
591
|
+
category: service[1].category
|
|
592
|
+
};
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
var cookieBanner = {
|
|
596
|
+
acceptAllConsents: acceptAllConsents,
|
|
597
|
+
denyAllConsents: denyAllConsents,
|
|
598
|
+
updateServicesConsents: updateServicesConsents,
|
|
599
|
+
changeLanguage: changeLanguage,
|
|
600
|
+
showCookieBanner: showCookieBanner,
|
|
601
|
+
hideCookieBanner: hideCookieBanner,
|
|
602
|
+
eventListner: {
|
|
603
|
+
CONSENT_UPDATED_EVENT: CONSENT_UPDATED_EVENT,
|
|
604
|
+
CMP_INITIALIZE_EVENT: CMP_INITIALIZE_EVENT
|
|
605
|
+
},
|
|
606
|
+
formatConsentEvent: formatConsentEvent
|
|
607
|
+
};
|
|
608
|
+
if (typeof window !== 'undefined') styleCookieBanner();
|
|
609
|
+
/** Utils */
|
|
610
|
+
// Returns true when element with id is available in the DOM
|
|
611
|
+
function waitForElementWithId(_x) {
|
|
612
|
+
return _waitForElementWithId.apply(this, arguments);
|
|
613
|
+
}
|
|
614
|
+
/** Stylesheet for CookieBanner */
|
|
615
|
+
function _waitForElementWithId() {
|
|
616
|
+
_waitForElementWithId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(selector) {
|
|
617
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
618
|
+
while (1) {
|
|
619
|
+
switch (_context2.prev = _context2.next) {
|
|
620
|
+
case 0:
|
|
621
|
+
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
622
|
+
var observer = new MutationObserver(function (_, observer) {
|
|
623
|
+
var element = document.querySelector('#' + selector);
|
|
624
|
+
if (element) {
|
|
625
|
+
observer.disconnect();
|
|
626
|
+
resolve(true);
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
observer.observe(document.body, {
|
|
630
|
+
childList: true,
|
|
631
|
+
subtree: true
|
|
632
|
+
});
|
|
633
|
+
}));
|
|
634
|
+
case 1:
|
|
635
|
+
case "end":
|
|
636
|
+
return _context2.stop();
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}, _callee2);
|
|
640
|
+
}));
|
|
641
|
+
return _waitForElementWithId.apply(this, arguments);
|
|
642
|
+
}
|
|
643
|
+
var cmpStyleSheet = "\n .cmp-wrapper.cmp-wrapper.cmp-wrapper { \n width: 100%;\n\n .cmp:not(.second) {\n padding: " + space.rem.large + "rem calc((100dvw - 54rem) / 2);\n border-radius: unset;\n box-shadow: " + shadows.cardShadow + ";\n\n .language-selector-menu {\n right: calc((100dvw - 64rem) / 2);\n }\n } \n\n .privacy-title {\n font-size: " + fontSizes.rem.extraLarge2 + "rem;\n }\n .privacy-text {\n font-size: " + fontSizes.rem.large + "rem;\n line-height: " + lineHeights.rem.large + "rem;\n }\n\n\n .buttons-row {\n justify-content: flex-end;\n }\n\n button[data-action=\"consent\"] {\n flex-grow: unset;\n flex-basis: unset;\n width: fit-content;\n min-width: 9.5rem;\n height: 3rem;\n cursor: pointer;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 500;\n \n &[data-action-type=\"accept\"] {\n background-color: var(--components-button-primary-contrast-default);\n color: var(--components-button-primary-contrast-text);\n\n &:hover {\n background-color: var(--components-button-primary-contrast-hover);\n }\n }\n \n &[data-action-type=\"more\"],\n &[data-action-type=\"deny\"] {\n background-color: transparent;\n color: var(--components-button-secondary-contrast-text);\n border: 2px solid var(--components-button-secondary-contrast-border);\n\n &:hover {\n background-color: var(--components-button-secondary-contrast-hover);\n }\n }\n }\n\n .poweredBy {\n display: none;\n }\n }\n";
|
|
644
|
+
|
|
645
|
+
export { CMP_INITIALIZE_EVENT, CONSENT_UPDATED_EVENT, ConditionalWrapper, cmpStyleSheet, cookieBanner, getNodeText, mergeRefs, useDebounce, useForceUpdate, useOnClickOutside, useOnEscape, useOnMount, useRandomId, useWindowDimensions, waitForElementWithId, warnAboutMissingStyles };
|
|
202
646
|
//# sourceMappingURL=utils.esm.js.map
|
package/dist/utils.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.esm.js","sources":["../src/useDebounce.ts","../src/useRandomId.ts","../src/useOnMount.ts","../src/mergeRefs.ts","../src/useForceUpdate.ts","../src/useOnClickOutside.ts","../src/useOnEscape.ts","../src/useWindowDimensions.ts","../src/ConditionalWrapper.tsx","../src/warnAboutMissingStyles.ts","../src/getNodeText.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nexport function useDebounce<T extends (...args: any[]) => any>(\n callBack: T,\n debounceTime: number,\n) {\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n const debouncedFunc = (...args: any[]) => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n timeoutRef.current = setTimeout(() => {\n callBack(...args);\n }, debounceTime);\n };\n\n return debouncedFunc as T;\n}\n","import React from 'react';\n\nexport const useRandomId = (prefix?: string): string => {\n const ref = React.useRef(String(Math.random()).substring(2));\n return `${prefix}-${ref.current}`;\n};\n","import React from 'react';\n\nexport function useOnMount(callback: () => void): void {\n const hasRun = React.useRef<boolean>(false);\n\n React.useEffect(() => {\n if (!hasRun.current) {\n hasRun.current = true;\n callback();\n }\n }, [callback]);\n}\n","export const mergeRefs = <T extends HTMLElement>(\n ...refs: (\n | React.MutableRefObject<T>\n | React.ForwardedRef<T>\n | ((node: T | null) => void)\n | undefined\n )[]\n) => {\n return (node: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) ref.current = node;\n }\n };\n};\n","import { useState } from 'react';\n\nexport const useForceUpdate = () => {\n const [_, setValue] = useState(0);\n return () => setValue(value => value + 1);\n};\n","import React, { useEffect } from 'react';\n\nexport const useOnClickOutside = (\n refs: (React.RefObject<HTMLElement> | React.MutableRefObject<any>)[],\n handler: () => void,\n) => {\n useEffect(() => {\n const listener = (event: Event) => {\n // If the ref contains the clicked element, then the click is not outside\n if (refs.some(ref => elementContainsEventTarget(ref.current, event))) {\n return;\n }\n\n handler();\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [refs, handler]);\n};\n\nconst elementContainsEventTarget = (\n element: HTMLElement | null,\n event: Event,\n) => {\n if (!element) {\n return false;\n }\n\n if (element.contains(event.target as Node)) {\n return true;\n }\n\n // For elements inside a Shadow DOM we need to check the composedPath\n if (event.composed && event.composedPath) {\n const contains = event.composedPath().find(target => {\n if (target === window) {\n return false;\n }\n return element.contains(target as Node);\n });\n return contains ? true : false;\n }\n\n return false;\n};\n","import React, { useEffect } from 'react';\n\nexport const useOnEscape = (\n ref: React.RefObject<any> | React.MutableRefObject<any>,\n handler: () => void,\n) => {\n useEffect(() => {\n const runIfKeyIsEscape = (event: KeyboardEvent) => {\n if (event.key === 'Escape') handler();\n };\n\n const currentRef = ref.current;\n currentRef?.addEventListener('keydown', runIfKeyIsEscape);\n\n return () => currentRef?.removeEventListener('keydown', runIfKeyIsEscape);\n }, [ref, handler]);\n};\n","// from https://stackoverflow.com/questions/36862334/get-viewport-window-height-in-reactjs\nimport { useState, useEffect } from 'react';\n\ntype WindowDimensions = {\n width: number | undefined;\n height: number | undefined;\n};\n\nconst getWindowDimensions = () => {\n if (typeof window === 'undefined')\n return { width: undefined, height: undefined };\n\n const { innerWidth: width, innerHeight: height } = window;\n return {\n width,\n height,\n };\n};\n\nexport const useWindowDimensions = (): WindowDimensions => {\n const [windowDimensions, setWindowDimensions] = useState(\n getWindowDimensions(),\n );\n\n useEffect(() => {\n function handleResize() {\n setWindowDimensions(getWindowDimensions());\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }\n }, []);\n\n return windowDimensions;\n};\n","import React from 'react';\n\ntype ConditionalWrapperType = {\n condition: boolean;\n wrapper: any;\n children: any;\n};\n\nexport const ConditionalWrapper = ({\n condition,\n wrapper,\n children,\n}: ConditionalWrapperType) => (condition ? wrapper(children) : <>{children}</>);\n","import warning from 'tiny-warning';\n\nconst packagesToCheck: Set<string> = new Set();\nlet checkTimeoutId: number;\n\nfunction checkAndWarn() {\n const missingImports = Array.from(packagesToCheck)\n .filter(\n namespace =>\n parseInt(\n window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(`--eds-${namespace}`),\n ) !== 1,\n )\n .sort();\n\n // Finally, we warn about those pesky imports\n const singleMissingImport = missingImports.length === 1;\n warning(\n missingImports.length === 0,\n `You are missing ${\n singleMissingImport\n ? 'a CSS import'\n : `${missingImports.length} CSS imports`\n }!\n\nPlease add the following CSS import${\n singleMissingImport ? '' : 's'\n } somewhere in your app:\n\n${missingImports\n .map(namespace => `\\t@import '@entur/${namespace}/dist/styles.css';`)\n .join('\\n')}\n`,\n );\n}\n\n/** Warns the developer if they have forgotten to include styles */\nexport function warnAboutMissingStyles(...namespaces: string[]): void {\n // We skip this check in production, and when we build static sites\n if (\n !__DEV__ ||\n typeof window === 'undefined' ||\n (typeof process !== 'undefined' && process?.env?.TEST === 'true')\n ) {\n return;\n }\n // First, let's clear earlier calls to setTimeout\n window.clearTimeout(checkTimeoutId);\n\n // Next, let's add all namespaces to the set of packages to check\n namespaces.forEach(namespace => packagesToCheck.add(namespace));\n\n // Finally. let's trigger a run of the checker.\n checkTimeoutId = window.setTimeout(checkAndWarn, 1000);\n}\n","// with inspiration from https://stackoverflow.com/questions/50428910/get-text-content-from-node-in-react\nexport const getNodeText = (\n node: React.ReactNode | string | number | string[] | number[],\n): string => {\n if (node === null || node === undefined) return '';\n if (['string', 'number'].includes(typeof node)) return node.toString();\n if (node instanceof Array) return node.map(getNodeText).join('').trim();\n if (typeof node === 'object')\n // @ts-expect-error props does exist for react nodes\n return getNodeText(node.props?.children ?? '').trim();\n return 'unknown';\n};\n"],"names":["useDebounce","callBack","debounceTime","timeoutRef","useRef","useEffect","current","clearTimeout","debouncedFunc","args","setTimeout","useRandomId","prefix","ref","React","String","Math","random","substring","useOnMount","callback","hasRun","mergeRefs","refs","node","useForceUpdate","useState","setValue","value","useOnClickOutside","handler","listener","event","some","elementContainsEventTarget","document","addEventListener","removeEventListener","element","contains","target","composed","composedPath","find","window","useOnEscape","runIfKeyIsEscape","key","currentRef","getWindowDimensions","width","undefined","height","innerWidth","innerHeight","useWindowDimensions","windowDimensions","setWindowDimensions","handleResize","ConditionalWrapper","condition","wrapper","children","createElement","Fragment","packagesToCheck","Set","checkTimeoutId","checkAndWarn","missingImports","Array","from","filter","namespace","parseInt","getComputedStyle","documentElement","getPropertyValue","sort","singleMissingImport","length","warning","map","join","warnAboutMissingStyles","process","env","TEST","namespaces","forEach","add","getNodeText","includes","toString","trim","props"],"mappings":";;;AAEgB,SAAAA,WAAW,CACzBC,QAAW,EACXC,YAAoB,EAAA;EAEpB,IAAMC,UAAU,GAAGC,MAAM,EAAiC,CAAA;AAE1DC,EAAAA,SAAS,CAAC,YAAK;AACb,IAAA,OAAO,YAAK;MACV,IAAIF,UAAU,CAACG,OAAO,EAAE;AACtBC,QAAAA,YAAY,CAACJ,UAAU,CAACG,OAAO,CAAC,CAAA;AACjC,OAAA;KACF,CAAA;GACF,EAAE,EAAE,CAAC,CAAA;AAEN,EAAA,IAAME,aAAa,GAAG,SAAhBA,aAAa,GAAsB;AAAA,IAAA,KAAA,IAAA,IAAA,GAAA,SAAA,CAAA,MAAA,EAAfC,IAAW,GAAA,IAAA,KAAA,CAAA,IAAA,CAAA,EAAA,IAAA,GAAA,CAAA,EAAA,IAAA,GAAA,IAAA,EAAA,IAAA,EAAA,EAAA;MAAXA,IAAW,CAAA,IAAA,CAAA,GAAA,SAAA,CAAA,IAAA,CAAA,CAAA;AAAA,KAAA;IACnC,IAAIN,UAAU,CAACG,OAAO,EAAE;AACtBC,MAAAA,YAAY,CAACJ,UAAU,CAACG,OAAO,CAAC,CAAA;AACjC,KAAA;AAEDH,IAAAA,UAAU,CAACG,OAAO,GAAGI,UAAU,CAAC,YAAK;MACnCT,QAAQ,CAAA,KAAA,CAAA,KAAA,CAAA,EAAIQ,IAAI,CAAC,CAAA;KAClB,EAAEP,YAAY,CAAC,CAAA;GACjB,CAAA;AAED,EAAA,OAAOM,aAAkB,CAAA;AAC3B;;ICzBaG,WAAW,GAAG,SAAdA,WAAW,CAAIC,MAAe,EAAY;AACrD,EAAA,IAAMC,GAAG,GAAGC,KAAK,CAACV,MAAM,CAACW,MAAM,CAACC,IAAI,CAACC,MAAM,EAAE,CAAC,CAACC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;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AAK,QAAQ;AAC1B;AACA,IAAA,OAAOmE,WAAW,CAAA,CAAA,oBAAA,GAAA,CAAA,WAAA,GAACnE,IAAI,CAACuE,KAAK,KAAA,IAAA,GAAA,KAAA,CAAA,GAAV,WAAYjC,CAAAA,QAAQ,KAAI,IAAA,GAAA,oBAAA,GAAA,EAAE,CAAC,CAACgC,IAAI,EAAE,CAAA;AACvD,EAAA,OAAO,SAAS,CAAA;AAClB;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../src/useDebounce.ts","../src/useRandomId.ts","../src/useOnMount.ts","../src/mergeRefs.ts","../src/useForceUpdate.ts","../src/useOnClickOutside.ts","../src/useOnEscape.ts","../src/useWindowDimensions.ts","../src/ConditionalWrapper.tsx","../src/warnAboutMissingStyles.ts","../src/getNodeText.ts","../src/consentUtils.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nexport function useDebounce<T extends (...args: any[]) => any>(\n callBack: T,\n debounceTime: number,\n) {\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n const debouncedFunc = (...args: any[]) => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n timeoutRef.current = setTimeout(() => {\n callBack(...args);\n }, debounceTime);\n };\n\n return debouncedFunc as T;\n}\n","import React from 'react';\n\nexport const useRandomId = (prefix?: string): string => {\n const ref = React.useRef(String(Math.random()).substring(2));\n return `${prefix}-${ref.current}`;\n};\n","import React from 'react';\n\nexport function useOnMount(callback: () => void): void {\n const hasRun = React.useRef<boolean>(false);\n\n React.useEffect(() => {\n if (!hasRun.current) {\n hasRun.current = true;\n callback();\n }\n }, [callback]);\n}\n","export const mergeRefs = <T extends HTMLElement>(\n ...refs: (\n | React.MutableRefObject<T>\n | React.ForwardedRef<T>\n | ((node: T | null) => void)\n | undefined\n )[]\n) => {\n return (node: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) ref.current = node;\n }\n };\n};\n","import { useState } from 'react';\n\nexport const useForceUpdate = () => {\n const [_, setValue] = useState(0);\n return () => setValue(value => value + 1);\n};\n","import React, { useEffect } from 'react';\n\nexport const useOnClickOutside = (\n refs: (React.RefObject<HTMLElement> | React.MutableRefObject<any>)[],\n handler: () => void,\n) => {\n useEffect(() => {\n const listener = (event: Event) => {\n // If the ref contains the clicked element, then the click is not outside\n if (refs.some(ref => elementContainsEventTarget(ref.current, event))) {\n return;\n }\n\n handler();\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [refs, handler]);\n};\n\nconst elementContainsEventTarget = (\n element: HTMLElement | null,\n event: Event,\n) => {\n if (!element) {\n return false;\n }\n\n if (element.contains(event.target as Node)) {\n return true;\n }\n\n // For elements inside a Shadow DOM we need to check the composedPath\n if (event.composed && event.composedPath) {\n const contains = event.composedPath().find(target => {\n if (target === window) {\n return false;\n }\n return element.contains(target as Node);\n });\n return contains ? true : false;\n }\n\n return false;\n};\n","import React, { useEffect } from 'react';\n\nexport const useOnEscape = (\n ref: React.RefObject<any> | React.MutableRefObject<any>,\n handler: () => void,\n) => {\n useEffect(() => {\n const runIfKeyIsEscape = (event: KeyboardEvent) => {\n if (event.key === 'Escape') handler();\n };\n\n const currentRef = ref.current;\n currentRef?.addEventListener('keydown', runIfKeyIsEscape);\n\n return () => currentRef?.removeEventListener('keydown', runIfKeyIsEscape);\n }, [ref, handler]);\n};\n","// from https://stackoverflow.com/questions/36862334/get-viewport-window-height-in-reactjs\nimport { useState, useEffect } from 'react';\n\ntype WindowDimensions = {\n width: number | undefined;\n height: number | undefined;\n};\n\nconst getWindowDimensions = () => {\n if (typeof window === 'undefined')\n return { width: undefined, height: undefined };\n\n const { innerWidth: width, innerHeight: height } = window;\n return {\n width,\n height,\n };\n};\n\nexport const useWindowDimensions = (): WindowDimensions => {\n const [windowDimensions, setWindowDimensions] = useState(\n getWindowDimensions(),\n );\n\n useEffect(() => {\n function handleResize() {\n setWindowDimensions(getWindowDimensions());\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }\n }, []);\n\n return windowDimensions;\n};\n","import React from 'react';\n\ntype ConditionalWrapperType = {\n condition: boolean;\n wrapper: any;\n children: any;\n};\n\nexport const ConditionalWrapper = ({\n condition,\n wrapper,\n children,\n}: ConditionalWrapperType) => (condition ? wrapper(children) : <>{children}</>);\n","import warning from 'tiny-warning';\n\nconst packagesToCheck: Set<string> = new Set();\nlet checkTimeoutId: number;\n\nfunction checkAndWarn() {\n const missingImports = Array.from(packagesToCheck)\n .filter(\n namespace =>\n parseInt(\n window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(`--eds-${namespace}`),\n ) !== 1,\n )\n .sort();\n\n // Finally, we warn about those pesky imports\n const singleMissingImport = missingImports.length === 1;\n warning(\n missingImports.length === 0,\n `You are missing ${\n singleMissingImport\n ? 'a CSS import'\n : `${missingImports.length} CSS imports`\n }!\n\nPlease add the following CSS import${\n singleMissingImport ? '' : 's'\n } somewhere in your app:\n\n${missingImports\n .map(namespace => `\\t@import '@entur/${namespace}/dist/styles.css';`)\n .join('\\n')}\n`,\n );\n}\n\n/** Warns the developer if they have forgotten to include styles */\nexport function warnAboutMissingStyles(...namespaces: string[]): void {\n // We skip this check in production, and when we build static sites\n if (\n !__DEV__ ||\n typeof window === 'undefined' ||\n (typeof process !== 'undefined' && process?.env?.TEST === 'true')\n ) {\n return;\n }\n // First, let's clear earlier calls to setTimeout\n window.clearTimeout(checkTimeoutId);\n\n // Next, let's add all namespaces to the set of packages to check\n namespaces.forEach(namespace => packagesToCheck.add(namespace));\n\n // Finally. let's trigger a run of the checker.\n checkTimeoutId = window.setTimeout(checkAndWarn, 1000);\n}\n","// with inspiration from https://stackoverflow.com/questions/50428910/get-text-content-from-node-in-react\nexport const getNodeText = (\n node: React.ReactNode | string | number | string[] | number[],\n): string => {\n if (node === null || node === undefined) return '';\n if (['string', 'number'].includes(typeof node)) return node.toString();\n if (node instanceof Array) return node.map(getNodeText).join('').trim();\n if (typeof node === 'object')\n // @ts-expect-error props does exist for react nodes\n return getNodeText(node.props?.children ?? '').trim();\n return 'unknown';\n};\n","import { fontSizes, lineHeights, shadows, space } from '@entur/tokens';\nimport { ConsentDetails } from './types';\n\nexport const CMP_INITIALIZE_EVENT = 'UC_UI_INITIALIZED';\nexport const CONSENT_UPDATED_EVENT = 'UC_CONSENT';\nconst CMP_SHADOW_ROOT_ID = 'usercentrics-cmp-ui';\n\ntype Consents =\n | {\n id: string;\n name: string;\n consentGiven: boolean;\n category: string;\n }[]\n | undefined;\n\nconst acceptAllConsents = () => window.__ucCmp.acceptAllConsents();\nconst denyAllConsents = () => window.__ucCmp.denyAllConsents();\nconst updateServicesConsents = (serviceConsents: {\n id: string;\n consent: boolean;\n}) => window.__ucCmp.updateServicesConsents(serviceConsents);\nconst changeLanguage = (language: string) =>\n window.__ucCmp.changeLanguage(language);\nconst showCookieBanner = () => window.__ucCmp.showFirstLayer();\nconst hideCookieBanner = () => window.__ucCmp.closeCmp();\n\nasync function styleCookieBanner() {\n await waitForElementWithId(CMP_SHADOW_ROOT_ID);\n const cmpElement = document.getElementById(\n CMP_SHADOW_ROOT_ID,\n ) as HTMLElement | null;\n console.log('cmp', cmpElement);\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(cmpStyleSheet);\n cmpElement?.shadowRoot?.adoptedStyleSheets.push(sheet);\n}\n\nfunction formatConsentEvent(\n event: Event & { detail?: ConsentDetails },\n): Consents {\n return Object.entries(event?.detail?.services ?? {}).map(service => {\n return {\n id: service[0],\n name: service[1].name,\n consentGiven: service[1].consent?.given ?? false,\n category: service[1].category,\n };\n });\n}\n\nexport const cookieBanner = {\n acceptAllConsents,\n denyAllConsents,\n updateServicesConsents,\n changeLanguage,\n showCookieBanner,\n hideCookieBanner,\n eventListner: {\n CONSENT_UPDATED_EVENT,\n CMP_INITIALIZE_EVENT,\n },\n formatConsentEvent,\n};\n\nif (typeof window !== 'undefined') styleCookieBanner();\n\n/** Utils */\n\n// Returns true when element with id is available in the DOM\nexport async function waitForElementWithId(selector: string) {\n return new Promise(resolve => {\n const observer = new MutationObserver((_, observer) => {\n const element = document.querySelector('#' + selector);\n if (element) {\n observer.disconnect();\n resolve(true);\n }\n });\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n });\n });\n}\n\n/** Stylesheet for CookieBanner */\n\nexport const cmpStyleSheet = `\n .cmp-wrapper.cmp-wrapper.cmp-wrapper { \n width: 100%;\n\n .cmp:not(.second) {\n padding: ${space.rem.large}rem calc((100dvw - 54rem) / 2);\n border-radius: unset;\n box-shadow: ${shadows.cardShadow};\n\n .language-selector-menu {\n right: calc((100dvw - 64rem) / 2);\n }\n } \n\n .privacy-title {\n font-size: ${fontSizes.rem.extraLarge2}rem;\n }\n .privacy-text {\n font-size: ${fontSizes.rem.large}rem;\n line-height: ${lineHeights.rem.large}rem;\n }\n\n\n .buttons-row {\n justify-content: flex-end;\n }\n\n button[data-action=\"consent\"] {\n flex-grow: unset;\n flex-basis: unset;\n width: fit-content;\n min-width: 9.5rem;\n height: 3rem;\n cursor: pointer;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 500;\n \n &[data-action-type=\"accept\"] {\n background-color: var(--components-button-primary-contrast-default);\n color: var(--components-button-primary-contrast-text);\n\n &:hover {\n background-color: var(--components-button-primary-contrast-hover);\n }\n }\n \n &[data-action-type=\"more\"],\n &[data-action-type=\"deny\"] {\n background-color: transparent;\n color: var(--components-button-secondary-contrast-text);\n border: 2px solid var(--components-button-secondary-contrast-border);\n\n &:hover {\n background-color: var(--components-button-secondary-contrast-hover);\n }\n }\n }\n\n .poweredBy {\n display: none;\n }\n }\n`;\n"],"names":["useDebounce","callBack","debounceTime","timeoutRef","useRef","useEffect","current","clearTimeout","debouncedFunc","args","setTimeout","useRandomId","prefix","ref","React","String","Math","random","substring","useOnMount","callback","hasRun","mergeRefs","refs","node","useForceUpdate","useState","setValue","value","useOnClickOutside","handler","listener","event","some","elementContainsEventTarget","document","addEventListener","removeEventListener","element","contains","target","composed","composedPath","find","window","useOnEscape","runIfKeyIsEscape","key","currentRef","getWindowDimensions","width","undefined","height","innerWidth","innerHeight","useWindowDimensions","windowDimensions","setWindowDimensions","handleResize","ConditionalWrapper","condition","wrapper","children","createElement","Fragment","packagesToCheck","Set","checkTimeoutId","checkAndWarn","missingImports","Array","from","filter","namespace","parseInt","getComputedStyle","documentElement","getPropertyValue","sort","singleMissingImport","length","warning","map","join","warnAboutMissingStyles","process","env","TEST","namespaces","forEach","add","getNodeText","includes","toString","trim","props","CMP_INITIALIZE_EVENT","CONSENT_UPDATED_EVENT","CMP_SHADOW_ROOT_ID","acceptAllConsents","__ucCmp","denyAllConsents","updateServicesConsents","serviceConsents","changeLanguage","language","showCookieBanner","showFirstLayer","hideCookieBanner","closeCmp","styleCookieBanner","waitForElementWithId","cmpElement","getElementById","console","log","sheet","CSSStyleSheet","replaceSync","cmpStyleSheet","shadowRoot","adoptedStyleSheets","push","formatConsentEvent","Object","entries","detail","services","service","id","name","consentGiven","consent","given","category","cookieBanner","eventListner","selector","Promise","resolve","observer","MutationObserver","_","querySelector","disconnect","observe","body","childList","subtree","space","rem","large","shadows","cardShadow","fontSizes","extraLarge2","lineHeights"],"mappings":";;;;AAEgB,SAAAA,WAAW,CACzBC,QAAW,EACXC,YAAoB,EAAA;EAEpB,IAAMC,UAAU,GAAGC,MAAM,EAAiC,CAAA;AAE1DC,EAAAA,SAAS,CAAC,YAAK;AACb,IAAA,OAAO,YAAK;MACV,IAAIF,UAAU,CAACG,OAAO,EAAE;AACtBC,QAAAA,YAAY,CAACJ,UAAU,CAACG,OAAO,CAAC,CAAA;AACjC,OAAA;KACF,CAAA;GACF,EAAE,EAAE,CAAC,CAAA;AAEN,EAAA,IAAME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AAA,KAAA,KAAA;AAAA,YAAA,OAAA,SAAA,CAAA,IAAA,EAAA,CAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KAAA,EAAA,QAAA,CAAA,CAAA;GACH,CAAA,CAAA,CAAA;AAAA,EAAA,OAAA,qBAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AAAA,CAAA;AAIY7B,IAAAA,aAAa,GAKT8B,2GAAAA,GAAAA,KAAK,CAACC,GAAG,CAACC,KAAK,GAEZC,kFAAAA,GAAAA,OAAO,CAACC,UAAU,oJAQnBC,SAAS,CAACJ,GAAG,CAACK,WAAW,GAAA,qDAAA,GAGzBD,SAAS,CAACJ,GAAG,CAACC,KAAK,GAAA,2BAAA,GACjBK,WAAW,CAACN,GAAG,CAACC,KAAK,GA4CzC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/utils.esm.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://
|
|
13
|
+
"url": "https://github.com/entur/design-system.git",
|
|
14
14
|
"directory": "packages/utils"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"react-dom": ">=16.8.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
+
"@entur/tokens": "^3.17.3",
|
|
29
30
|
"tiny-warning": "^1.0.3"
|
|
30
31
|
},
|
|
31
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "b653c119e54372ec210ed20aa99ded642f114c69"
|
|
32
33
|
}
|