@social-mail/social-mail-client 1.2.76 → 1.2.78

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.
@@ -70,5 +70,27 @@ self.addEventListener("push", function(event) {
70
70
  const options = JSON.parse(event.data.text());
71
71
  options.icon ||= "/pwa/images/logo-72.png";
72
72
  const title = options.title;
73
+ const { url = "/" } = options;
74
+ options.data = { url };
73
75
  event.waitUntil(self.registration.showNotification(title, options));
74
- });
76
+ });
77
+
78
+ self.addEventListener("notificationclick", (event) => {
79
+
80
+ event.notification.close();
81
+
82
+ const { url } = event.notification.data;
83
+
84
+ event.waitUntil(
85
+ clients
86
+ .matchAll({
87
+ type: "window",
88
+ })
89
+ .then((clientList) => {
90
+ for (const client of clientList) {
91
+ if ("focus" in client) return client.focus();
92
+ }
93
+ if (clients.openWindow) return clients.openWindow(url);
94
+ }),
95
+ );
96
+ });
@@ -8858,7 +8858,8 @@ System.register(["tslib", "../../core/AtomBinder", "../../core/AtomComponent", "
8858
8858
  const originalTarget = e.target;
8859
8859
  let start = originalTarget;
8860
8860
  let clickEvent;
8861
- while (start) {
8861
+ const end = document.body;
8862
+ while (start && start !== end) {
8862
8863
  clickEvent || (clickEvent = start.getAttribute("data-click-event"));
8863
8864
  if (start.tagName === "A") {
8864
8865
  if (!clickEvent) {