abledom 0.0.4 → 0.0.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/esm/index.js +111 -84
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +111 -84
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -107,8 +107,8 @@ var DOMBuilder = class {
|
|
|
107
107
|
(_a = this._stack[0]) == null ? void 0 : _a.appendChild(document.createTextNode(text));
|
|
108
108
|
return this;
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
element(callback) {
|
|
111
|
+
callback(this._stack[0]);
|
|
112
112
|
return this;
|
|
113
113
|
}
|
|
114
114
|
};
|
|
@@ -323,7 +323,7 @@ var _NotificationUI = class _NotificationUI {
|
|
|
323
323
|
);
|
|
324
324
|
};
|
|
325
325
|
}
|
|
326
|
-
).
|
|
326
|
+
).element(log_default).closeTag().openTag(
|
|
327
327
|
"button",
|
|
328
328
|
{
|
|
329
329
|
class: "button",
|
|
@@ -347,12 +347,12 @@ var _NotificationUI = class _NotificationUI {
|
|
|
347
347
|
revealButton.style.display = "none";
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
).
|
|
350
|
+
).element(reveal_default).closeTag().text(notification.message).openTag("a", {
|
|
351
351
|
class: "button close",
|
|
352
352
|
href: "/",
|
|
353
353
|
title: "Open help",
|
|
354
354
|
target: "_blank"
|
|
355
|
-
}).
|
|
355
|
+
}).element(help_default).closeTag().openTag(
|
|
356
356
|
"button",
|
|
357
357
|
{
|
|
358
358
|
class: "button close",
|
|
@@ -365,7 +365,7 @@ var _NotificationUI = class _NotificationUI {
|
|
|
365
365
|
(_a = _NotificationUI._highlight) == null ? void 0 : _a.hide();
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
).
|
|
368
|
+
).element(close_default).closeTag().closeTag().closeTag();
|
|
369
369
|
}
|
|
370
370
|
toggle(show, initial = false) {
|
|
371
371
|
var _a;
|
|
@@ -401,7 +401,6 @@ var NotificationsUI = class {
|
|
|
401
401
|
__publicField(this, "_alignBottomRightButton");
|
|
402
402
|
__publicField(this, "_isMuted", false);
|
|
403
403
|
__publicField(this, "_notifications", /* @__PURE__ */ new Set());
|
|
404
|
-
var _a;
|
|
405
404
|
const container = this._container = win.document.createElement("div");
|
|
406
405
|
container.__abledomui = true;
|
|
407
406
|
container.id = "abledom-report";
|
|
@@ -414,83 +413,111 @@ var NotificationsUI = class {
|
|
|
414
413
|
container.appendChild(notificationsContainer);
|
|
415
414
|
const menuElement = this._menuElement = win.document.createElement("div");
|
|
416
415
|
menuElement.className = "abledom-menu-container";
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
hideAllButton
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
416
|
+
container.appendChild(menuElement);
|
|
417
|
+
new DOMBuilder(menuElement).openTag("div", { class: "abledom-menu" }).openTag(
|
|
418
|
+
"span",
|
|
419
|
+
{
|
|
420
|
+
class: "notifications-count",
|
|
421
|
+
title: "Number of notifications"
|
|
422
|
+
},
|
|
423
|
+
(notificationCountElement) => {
|
|
424
|
+
this._notificationCountElement = notificationCountElement;
|
|
425
|
+
}
|
|
426
|
+
).closeTag().openTag(
|
|
427
|
+
"button",
|
|
428
|
+
{
|
|
429
|
+
class: "button",
|
|
430
|
+
title: "Show all notifications"
|
|
431
|
+
},
|
|
432
|
+
(showAllButton) => {
|
|
433
|
+
this._showAllButton = showAllButton;
|
|
434
|
+
showAllButton.onclick = () => {
|
|
435
|
+
this.showAll();
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
).element(showall_default).closeTag().openTag(
|
|
439
|
+
"button",
|
|
440
|
+
{
|
|
441
|
+
class: "button",
|
|
442
|
+
title: "Hide all notifications"
|
|
443
|
+
},
|
|
444
|
+
(hideAllButton) => {
|
|
445
|
+
this._hideAllButton = hideAllButton;
|
|
446
|
+
hideAllButton.onclick = () => {
|
|
447
|
+
this.hideAll();
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
).element(hideall_default).closeTag().openTag(
|
|
451
|
+
"button",
|
|
452
|
+
{
|
|
453
|
+
class: "button",
|
|
454
|
+
title: "Mute newly appearing notifications"
|
|
455
|
+
},
|
|
456
|
+
(muteButton) => {
|
|
457
|
+
muteButton.onclick = () => {
|
|
458
|
+
const isMuted = this._isMuted = muteButton.classList.toggle(pressedClass);
|
|
459
|
+
if (isMuted) {
|
|
460
|
+
muteButton.setAttribute(
|
|
461
|
+
"title",
|
|
462
|
+
"Unmute newly appearing notifications"
|
|
463
|
+
);
|
|
464
|
+
} else {
|
|
465
|
+
muteButton.setAttribute(
|
|
466
|
+
"title",
|
|
467
|
+
"Mute newly appearing notifications"
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
).element(muteall_default).closeTag().openTag(
|
|
473
|
+
"button",
|
|
474
|
+
{
|
|
475
|
+
class: "button align-button align-button-first pressed",
|
|
476
|
+
title: "Attach notifications to bottom left"
|
|
477
|
+
},
|
|
478
|
+
(alignBottomLeftButton) => {
|
|
479
|
+
this._alignBottomLeftButton = alignBottomLeftButton;
|
|
480
|
+
alignBottomLeftButton.onclick = () => {
|
|
481
|
+
this.setUIAlignment("bottom-left" /* BottomLeft */);
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
).element(alignbottomleft_default).closeTag().openTag(
|
|
485
|
+
"button",
|
|
486
|
+
{
|
|
487
|
+
class: "button align-button",
|
|
488
|
+
title: "Attach notifications to top left"
|
|
489
|
+
},
|
|
490
|
+
(alignTopLeftButton) => {
|
|
491
|
+
this._alignTopLeftButton = alignTopLeftButton;
|
|
492
|
+
alignTopLeftButton.onclick = () => {
|
|
493
|
+
this.setUIAlignment("top-left" /* TopLeft */);
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
).element(aligntopleft_default).closeTag().openTag(
|
|
497
|
+
"button",
|
|
498
|
+
{
|
|
499
|
+
class: "button align-button",
|
|
500
|
+
title: "Attach notifications to top right"
|
|
501
|
+
},
|
|
502
|
+
(alignTopRightButton) => {
|
|
503
|
+
this._alignTopRightButton = alignTopRightButton;
|
|
504
|
+
alignTopRightButton.onclick = () => {
|
|
505
|
+
this.setUIAlignment("top-right" /* TopRight */);
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
).element(aligntopright_default).closeTag().openTag(
|
|
509
|
+
"button",
|
|
510
|
+
{
|
|
511
|
+
class: "button align-button align-button-last",
|
|
512
|
+
title: "Attach notifications to bottom right"
|
|
513
|
+
},
|
|
514
|
+
(alignBottomRightButton) => {
|
|
515
|
+
this._alignBottomRightButton = alignBottomRightButton;
|
|
516
|
+
alignBottomRightButton.onclick = () => {
|
|
517
|
+
this.setUIAlignment("bottom-right" /* BottomRight */);
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
).element(alignbottomright_default).closeTag().closeTag();
|
|
494
521
|
win.document.body.appendChild(container);
|
|
495
522
|
}
|
|
496
523
|
setUIAlignment(alignment) {
|