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/index.js
CHANGED
|
@@ -145,8 +145,8 @@ var DOMBuilder = class {
|
|
|
145
145
|
(_a = this._stack[0]) == null ? void 0 : _a.appendChild(document.createTextNode(text));
|
|
146
146
|
return this;
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
element(callback) {
|
|
149
|
+
callback(this._stack[0]);
|
|
150
150
|
return this;
|
|
151
151
|
}
|
|
152
152
|
};
|
|
@@ -361,7 +361,7 @@ var _NotificationUI = class _NotificationUI {
|
|
|
361
361
|
);
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
).
|
|
364
|
+
).element(log_default).closeTag().openTag(
|
|
365
365
|
"button",
|
|
366
366
|
{
|
|
367
367
|
class: "button",
|
|
@@ -385,12 +385,12 @@ var _NotificationUI = class _NotificationUI {
|
|
|
385
385
|
revealButton.style.display = "none";
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
).
|
|
388
|
+
).element(reveal_default).closeTag().text(notification.message).openTag("a", {
|
|
389
389
|
class: "button close",
|
|
390
390
|
href: "/",
|
|
391
391
|
title: "Open help",
|
|
392
392
|
target: "_blank"
|
|
393
|
-
}).
|
|
393
|
+
}).element(help_default).closeTag().openTag(
|
|
394
394
|
"button",
|
|
395
395
|
{
|
|
396
396
|
class: "button close",
|
|
@@ -403,7 +403,7 @@ var _NotificationUI = class _NotificationUI {
|
|
|
403
403
|
(_a = _NotificationUI._highlight) == null ? void 0 : _a.hide();
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
).
|
|
406
|
+
).element(close_default).closeTag().closeTag().closeTag();
|
|
407
407
|
}
|
|
408
408
|
toggle(show, initial = false) {
|
|
409
409
|
var _a;
|
|
@@ -439,7 +439,6 @@ var NotificationsUI = class {
|
|
|
439
439
|
__publicField(this, "_alignBottomRightButton");
|
|
440
440
|
__publicField(this, "_isMuted", false);
|
|
441
441
|
__publicField(this, "_notifications", /* @__PURE__ */ new Set());
|
|
442
|
-
var _a;
|
|
443
442
|
const container = this._container = win.document.createElement("div");
|
|
444
443
|
container.__abledomui = true;
|
|
445
444
|
container.id = "abledom-report";
|
|
@@ -452,83 +451,111 @@ var NotificationsUI = class {
|
|
|
452
451
|
container.appendChild(notificationsContainer);
|
|
453
452
|
const menuElement = this._menuElement = win.document.createElement("div");
|
|
454
453
|
menuElement.className = "abledom-menu-container";
|
|
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
|
-
hideAllButton
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
454
|
+
container.appendChild(menuElement);
|
|
455
|
+
new DOMBuilder(menuElement).openTag("div", { class: "abledom-menu" }).openTag(
|
|
456
|
+
"span",
|
|
457
|
+
{
|
|
458
|
+
class: "notifications-count",
|
|
459
|
+
title: "Number of notifications"
|
|
460
|
+
},
|
|
461
|
+
(notificationCountElement) => {
|
|
462
|
+
this._notificationCountElement = notificationCountElement;
|
|
463
|
+
}
|
|
464
|
+
).closeTag().openTag(
|
|
465
|
+
"button",
|
|
466
|
+
{
|
|
467
|
+
class: "button",
|
|
468
|
+
title: "Show all notifications"
|
|
469
|
+
},
|
|
470
|
+
(showAllButton) => {
|
|
471
|
+
this._showAllButton = showAllButton;
|
|
472
|
+
showAllButton.onclick = () => {
|
|
473
|
+
this.showAll();
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
).element(showall_default).closeTag().openTag(
|
|
477
|
+
"button",
|
|
478
|
+
{
|
|
479
|
+
class: "button",
|
|
480
|
+
title: "Hide all notifications"
|
|
481
|
+
},
|
|
482
|
+
(hideAllButton) => {
|
|
483
|
+
this._hideAllButton = hideAllButton;
|
|
484
|
+
hideAllButton.onclick = () => {
|
|
485
|
+
this.hideAll();
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
).element(hideall_default).closeTag().openTag(
|
|
489
|
+
"button",
|
|
490
|
+
{
|
|
491
|
+
class: "button",
|
|
492
|
+
title: "Mute newly appearing notifications"
|
|
493
|
+
},
|
|
494
|
+
(muteButton) => {
|
|
495
|
+
muteButton.onclick = () => {
|
|
496
|
+
const isMuted = this._isMuted = muteButton.classList.toggle(pressedClass);
|
|
497
|
+
if (isMuted) {
|
|
498
|
+
muteButton.setAttribute(
|
|
499
|
+
"title",
|
|
500
|
+
"Unmute newly appearing notifications"
|
|
501
|
+
);
|
|
502
|
+
} else {
|
|
503
|
+
muteButton.setAttribute(
|
|
504
|
+
"title",
|
|
505
|
+
"Mute newly appearing notifications"
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
).element(muteall_default).closeTag().openTag(
|
|
511
|
+
"button",
|
|
512
|
+
{
|
|
513
|
+
class: "button align-button align-button-first pressed",
|
|
514
|
+
title: "Attach notifications to bottom left"
|
|
515
|
+
},
|
|
516
|
+
(alignBottomLeftButton) => {
|
|
517
|
+
this._alignBottomLeftButton = alignBottomLeftButton;
|
|
518
|
+
alignBottomLeftButton.onclick = () => {
|
|
519
|
+
this.setUIAlignment("bottom-left" /* BottomLeft */);
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
).element(alignbottomleft_default).closeTag().openTag(
|
|
523
|
+
"button",
|
|
524
|
+
{
|
|
525
|
+
class: "button align-button",
|
|
526
|
+
title: "Attach notifications to top left"
|
|
527
|
+
},
|
|
528
|
+
(alignTopLeftButton) => {
|
|
529
|
+
this._alignTopLeftButton = alignTopLeftButton;
|
|
530
|
+
alignTopLeftButton.onclick = () => {
|
|
531
|
+
this.setUIAlignment("top-left" /* TopLeft */);
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
).element(aligntopleft_default).closeTag().openTag(
|
|
535
|
+
"button",
|
|
536
|
+
{
|
|
537
|
+
class: "button align-button",
|
|
538
|
+
title: "Attach notifications to top right"
|
|
539
|
+
},
|
|
540
|
+
(alignTopRightButton) => {
|
|
541
|
+
this._alignTopRightButton = alignTopRightButton;
|
|
542
|
+
alignTopRightButton.onclick = () => {
|
|
543
|
+
this.setUIAlignment("top-right" /* TopRight */);
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
).element(aligntopright_default).closeTag().openTag(
|
|
547
|
+
"button",
|
|
548
|
+
{
|
|
549
|
+
class: "button align-button align-button-last",
|
|
550
|
+
title: "Attach notifications to bottom right"
|
|
551
|
+
},
|
|
552
|
+
(alignBottomRightButton) => {
|
|
553
|
+
this._alignBottomRightButton = alignBottomRightButton;
|
|
554
|
+
alignBottomRightButton.onclick = () => {
|
|
555
|
+
this.setUIAlignment("bottom-right" /* BottomRight */);
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
).element(alignbottomright_default).closeTag().closeTag();
|
|
532
559
|
win.document.body.appendChild(container);
|
|
533
560
|
}
|
|
534
561
|
setUIAlignment(alignment) {
|