@everymatrix/nuts-inbox-widget 1.45.14 → 1.45.15
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nuts-inbox-widget.cjs.js +1 -1
- package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +8 -2
- package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +12 -1
- package/dist/collection/components/nuts-popover/nuts-popover.js +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nuts-inbox-widget.js +1 -1
- package/dist/esm/nuts-inbox-widget_3.entry.js +8 -2
- package/dist/nuts-inbox-widget/nuts-inbox-widget.esm.js +1 -1
- package/dist/nuts-inbox-widget/p-9e0ae141.entry.js +1 -0
- package/dist/types/components/nuts-inbox-widget/nuts-inbox-widget.d.ts +1 -0
- package/package.json +1 -1
- package/dist/nuts-inbox-widget/p-a97eb392.entry.js +0 -1
- /package/dist/types/Users/{adrian.pripon/Documents/Work → StefanO/Desktop/Proj}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → StefanO/Desktop/Proj}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.dev.d.ts +0 -0
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
11
|
+
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -4315,6 +4315,10 @@ const NutsInboxWidget = class {
|
|
|
4315
4315
|
this.popoverVisible = false;
|
|
4316
4316
|
window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
|
|
4317
4317
|
}
|
|
4318
|
+
resetUnseenCount() {
|
|
4319
|
+
// reset the unseen count if all notif are marked as read
|
|
4320
|
+
this.unseenCount = 0;
|
|
4321
|
+
}
|
|
4318
4322
|
positionIcon() {
|
|
4319
4323
|
if (this.bellIconPosition == 'left') {
|
|
4320
4324
|
this.bellIconRef.style.justifyContent = 'flex-start';
|
|
@@ -4328,6 +4332,7 @@ const NutsInboxWidget = class {
|
|
|
4328
4332
|
this.socketRef = lookup(this.socketUrl, {
|
|
4329
4333
|
reconnection: true,
|
|
4330
4334
|
reconnectionDelayMax: 10000,
|
|
4335
|
+
reconnectionAttempts: 10,
|
|
4331
4336
|
transports: ['websocket'],
|
|
4332
4337
|
auth: {
|
|
4333
4338
|
token: `${this.token}`,
|
|
@@ -4382,7 +4387,7 @@ const NutsInboxWidget = class {
|
|
|
4382
4387
|
return (index.h("div", { onClick: this.togglePopover, class: "BellIcon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" }, ' ', index.h("path", { d: "M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z" }), ' '), this.unseenCount > 0 ? (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: "nc-bell-button-dot css-0 css-1eg2znq" }, index.h("rect", { x: "1.5", y: "1.5", width: "13", height: "13", rx: "6.5", fill: "url(#paint0_linear_1722_2699)", stroke: "#1E1E26", "stroke-width": "3" }), index.h("defs", null, index.h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" }, index.h("stop", { "stop-color": "#FF512F" }), index.h("stop", { offset: "1", "stop-color": "#DD2476" }))))) : ('')));
|
|
4383
4388
|
}
|
|
4384
4389
|
render() {
|
|
4385
|
-
return (index.h("div", { key: '
|
|
4390
|
+
return (index.h("div", { key: '6608ab0a33cc81adb6089b6e749f99007d64f9d5', ref: this.assignRefToStylingContainer, class: "Wrapper" }, index.h("div", { key: '282445044d0a944f07ca1b68c6a175bbb54d7e01', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.popoverVisible && (index.h("nuts-popover", { key: '84b182fcdab242863a4c41168a758728c8ee81fc', "notification-action": this.notificationAction, sessionId: this.sessionId, "unseen-count": this.unseenCount, token: this.token, "backend-url": this.backendUrl, "operator-id": this.operatorId, "user-id": this.userId, language: this.language, "client-styling": this.clientStyling, "translation-url": this.translationUrl }))));
|
|
4386
4391
|
}
|
|
4387
4392
|
get el() { return index.getElement(this); }
|
|
4388
4393
|
static get watchers() { return {
|
|
@@ -40866,6 +40871,7 @@ const NutsPopover = class {
|
|
|
40866
40871
|
});
|
|
40867
40872
|
if (markedAllNotificationsAsRead) {
|
|
40868
40873
|
this.allNotificationsRead.emit();
|
|
40874
|
+
this.unseenCount = 0;
|
|
40869
40875
|
}
|
|
40870
40876
|
};
|
|
40871
40877
|
this.assignRefToStylingContainer = (ref) => {
|
|
@@ -40934,7 +40940,7 @@ const NutsPopover = class {
|
|
|
40934
40940
|
}
|
|
40935
40941
|
}
|
|
40936
40942
|
render() {
|
|
40937
|
-
return (index.h("div", { key: '
|
|
40943
|
+
return (index.h("div", { key: '1f9211a87708005993b3e04cd1ceb3f63257c03e', class: "Popover", ref: this.assignRefToStylingContainer }, index.h("div", { key: '325d48e696006bae9973b36ac14fae0aa162b0d8', class: "Header" }, index.h("div", { key: 'f8bb5efeee0ff3e8eb59291a7814e9f92e942a44', class: "Title" }, translate$1('notifications', this.language), this.unseenCount > 0 ? (index.h("div", { class: "UnseenCounter" }, this.unseenCount)) : ('')), this.showMarkAll ? (index.h("div", { class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate$1('markAllAsRead', this.language))) : ('')), index.h("div", { key: 'd469681f75c7c2d342bae4274c1c69cf91b28ea1', class: "NotificationList" }, !this.isLoading &&
|
|
40938
40944
|
(this.notifications.length > 0 ? (this.notifications.map((item) => {
|
|
40939
40945
|
var _a;
|
|
40940
40946
|
return (index.h("nuts-notification", { "client-styling": this.clientStyling, key: item.id, "user-id": this.userId, "operator-id": this.operatorId, content: item.content, "message-id": item.id, badge: ((_a = item.actor) === null || _a === void 0 ? void 0 : _a.data) || '', sessionId: this.sessionId, date: item.createdAt, read: item.read, seen: item.seen, language: this.language, "notification-action": this.notificationAction, token: this.token, "backend-url": this.backendUrl, "redirect-url": item.cta.data.url, "translation-url": this.translationUrl }));
|
|
@@ -85,6 +85,10 @@ export class NutsInboxWidget {
|
|
|
85
85
|
this.popoverVisible = false;
|
|
86
86
|
window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
|
|
87
87
|
}
|
|
88
|
+
resetUnseenCount() {
|
|
89
|
+
// reset the unseen count if all notif are marked as read
|
|
90
|
+
this.unseenCount = 0;
|
|
91
|
+
}
|
|
88
92
|
positionIcon() {
|
|
89
93
|
if (this.bellIconPosition == 'left') {
|
|
90
94
|
this.bellIconRef.style.justifyContent = 'flex-start';
|
|
@@ -98,6 +102,7 @@ export class NutsInboxWidget {
|
|
|
98
102
|
this.socketRef = io(this.socketUrl, {
|
|
99
103
|
reconnection: true,
|
|
100
104
|
reconnectionDelayMax: 10000,
|
|
105
|
+
reconnectionAttempts: 10,
|
|
101
106
|
transports: ['websocket'],
|
|
102
107
|
auth: {
|
|
103
108
|
token: `${this.token}`,
|
|
@@ -152,7 +157,7 @@ export class NutsInboxWidget {
|
|
|
152
157
|
return (h("div", { onClick: this.togglePopover, class: "BellIcon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" }, ' ', h("path", { d: "M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z" }), ' '), this.unseenCount > 0 ? (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: "nc-bell-button-dot css-0 css-1eg2znq" }, h("rect", { x: "1.5", y: "1.5", width: "13", height: "13", rx: "6.5", fill: "url(#paint0_linear_1722_2699)", stroke: "#1E1E26", "stroke-width": "3" }), h("defs", null, h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" }, h("stop", { "stop-color": "#FF512F" }), h("stop", { offset: "1", "stop-color": "#DD2476" }))))) : ('')));
|
|
153
158
|
}
|
|
154
159
|
render() {
|
|
155
|
-
return (h("div", { key: '
|
|
160
|
+
return (h("div", { key: '6608ab0a33cc81adb6089b6e749f99007d64f9d5', ref: this.assignRefToStylingContainer, class: "Wrapper" }, h("div", { key: '282445044d0a944f07ca1b68c6a175bbb54d7e01', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.popoverVisible && (h("nuts-popover", { key: '84b182fcdab242863a4c41168a758728c8ee81fc', "notification-action": this.notificationAction, sessionId: this.sessionId, "unseen-count": this.unseenCount, token: this.token, "backend-url": this.backendUrl, "operator-id": this.operatorId, "user-id": this.userId, language: this.language, "client-styling": this.clientStyling, "translation-url": this.translationUrl }))));
|
|
156
161
|
}
|
|
157
162
|
static get is() { return "nuts-inbox-widget"; }
|
|
158
163
|
static get encapsulation() { return "shadow"; }
|
|
@@ -500,6 +505,12 @@ export class NutsInboxWidget {
|
|
|
500
505
|
"target": "window",
|
|
501
506
|
"capture": false,
|
|
502
507
|
"passive": false
|
|
508
|
+
}, {
|
|
509
|
+
"name": "allNotificationsRead",
|
|
510
|
+
"method": "resetUnseenCount",
|
|
511
|
+
"target": undefined,
|
|
512
|
+
"capture": false,
|
|
513
|
+
"passive": false
|
|
503
514
|
}];
|
|
504
515
|
}
|
|
505
516
|
}
|
|
@@ -52,6 +52,7 @@ export class NutsPopover {
|
|
|
52
52
|
});
|
|
53
53
|
if (markedAllNotificationsAsRead) {
|
|
54
54
|
this.allNotificationsRead.emit();
|
|
55
|
+
this.unseenCount = 0;
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
58
|
this.assignRefToStylingContainer = (ref) => {
|
|
@@ -120,7 +121,7 @@ export class NutsPopover {
|
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
render() {
|
|
123
|
-
return (h("div", { key: '
|
|
124
|
+
return (h("div", { key: '1f9211a87708005993b3e04cd1ceb3f63257c03e', class: "Popover", ref: this.assignRefToStylingContainer }, h("div", { key: '325d48e696006bae9973b36ac14fae0aa162b0d8', class: "Header" }, h("div", { key: 'f8bb5efeee0ff3e8eb59291a7814e9f92e942a44', class: "Title" }, translate('notifications', this.language), this.unseenCount > 0 ? (h("div", { class: "UnseenCounter" }, this.unseenCount)) : ('')), this.showMarkAll ? (h("div", { class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate('markAllAsRead', this.language))) : ('')), h("div", { key: 'd469681f75c7c2d342bae4274c1c69cf91b28ea1', class: "NotificationList" }, !this.isLoading &&
|
|
124
125
|
(this.notifications.length > 0 ? (this.notifications.map((item) => {
|
|
125
126
|
var _a;
|
|
126
127
|
return (h("nuts-notification", { "client-styling": this.clientStyling, key: item.id, "user-id": this.userId, "operator-id": this.operatorId, content: item.content, "message-id": item.id, badge: ((_a = item.actor) === null || _a === void 0 ? void 0 : _a.data) || '', sessionId: this.sessionId, date: item.createdAt, read: item.read, seen: item.seen, language: this.language, "notification-action": this.notificationAction, token: this.token, "backend-url": this.backendUrl, "redirect-url": item.cta.data.url, "translation-url": this.translationUrl }));
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["nuts-inbox-widget_3",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["nuts-inbox-widget_3",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["nuts-inbox-widget_3",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["nuts-inbox-widget_3",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{"unseenCount":["unseenCountHandler"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -4311,6 +4311,10 @@ const NutsInboxWidget = class {
|
|
|
4311
4311
|
this.popoverVisible = false;
|
|
4312
4312
|
window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
|
|
4313
4313
|
}
|
|
4314
|
+
resetUnseenCount() {
|
|
4315
|
+
// reset the unseen count if all notif are marked as read
|
|
4316
|
+
this.unseenCount = 0;
|
|
4317
|
+
}
|
|
4314
4318
|
positionIcon() {
|
|
4315
4319
|
if (this.bellIconPosition == 'left') {
|
|
4316
4320
|
this.bellIconRef.style.justifyContent = 'flex-start';
|
|
@@ -4324,6 +4328,7 @@ const NutsInboxWidget = class {
|
|
|
4324
4328
|
this.socketRef = lookup(this.socketUrl, {
|
|
4325
4329
|
reconnection: true,
|
|
4326
4330
|
reconnectionDelayMax: 10000,
|
|
4331
|
+
reconnectionAttempts: 10,
|
|
4327
4332
|
transports: ['websocket'],
|
|
4328
4333
|
auth: {
|
|
4329
4334
|
token: `${this.token}`,
|
|
@@ -4378,7 +4383,7 @@ const NutsInboxWidget = class {
|
|
|
4378
4383
|
return (h("div", { onClick: this.togglePopover, class: "BellIcon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" }, ' ', h("path", { d: "M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z" }), ' '), this.unseenCount > 0 ? (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: "nc-bell-button-dot css-0 css-1eg2znq" }, h("rect", { x: "1.5", y: "1.5", width: "13", height: "13", rx: "6.5", fill: "url(#paint0_linear_1722_2699)", stroke: "#1E1E26", "stroke-width": "3" }), h("defs", null, h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" }, h("stop", { "stop-color": "#FF512F" }), h("stop", { offset: "1", "stop-color": "#DD2476" }))))) : ('')));
|
|
4379
4384
|
}
|
|
4380
4385
|
render() {
|
|
4381
|
-
return (h("div", { key: '
|
|
4386
|
+
return (h("div", { key: '6608ab0a33cc81adb6089b6e749f99007d64f9d5', ref: this.assignRefToStylingContainer, class: "Wrapper" }, h("div", { key: '282445044d0a944f07ca1b68c6a175bbb54d7e01', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.popoverVisible && (h("nuts-popover", { key: '84b182fcdab242863a4c41168a758728c8ee81fc', "notification-action": this.notificationAction, sessionId: this.sessionId, "unseen-count": this.unseenCount, token: this.token, "backend-url": this.backendUrl, "operator-id": this.operatorId, "user-id": this.userId, language: this.language, "client-styling": this.clientStyling, "translation-url": this.translationUrl }))));
|
|
4382
4387
|
}
|
|
4383
4388
|
get el() { return getElement(this); }
|
|
4384
4389
|
static get watchers() { return {
|
|
@@ -40862,6 +40867,7 @@ const NutsPopover = class {
|
|
|
40862
40867
|
});
|
|
40863
40868
|
if (markedAllNotificationsAsRead) {
|
|
40864
40869
|
this.allNotificationsRead.emit();
|
|
40870
|
+
this.unseenCount = 0;
|
|
40865
40871
|
}
|
|
40866
40872
|
};
|
|
40867
40873
|
this.assignRefToStylingContainer = (ref) => {
|
|
@@ -40930,7 +40936,7 @@ const NutsPopover = class {
|
|
|
40930
40936
|
}
|
|
40931
40937
|
}
|
|
40932
40938
|
render() {
|
|
40933
|
-
return (h("div", { key: '
|
|
40939
|
+
return (h("div", { key: '1f9211a87708005993b3e04cd1ceb3f63257c03e', class: "Popover", ref: this.assignRefToStylingContainer }, h("div", { key: '325d48e696006bae9973b36ac14fae0aa162b0d8', class: "Header" }, h("div", { key: 'f8bb5efeee0ff3e8eb59291a7814e9f92e942a44', class: "Title" }, translate$1('notifications', this.language), this.unseenCount > 0 ? (h("div", { class: "UnseenCounter" }, this.unseenCount)) : ('')), this.showMarkAll ? (h("div", { class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate$1('markAllAsRead', this.language))) : ('')), h("div", { key: 'd469681f75c7c2d342bae4274c1c69cf91b28ea1', class: "NotificationList" }, !this.isLoading &&
|
|
40934
40940
|
(this.notifications.length > 0 ? (this.notifications.map((item) => {
|
|
40935
40941
|
var _a;
|
|
40936
40942
|
return (h("nuts-notification", { "client-styling": this.clientStyling, key: item.id, "user-id": this.userId, "operator-id": this.operatorId, content: item.content, "message-id": item.id, badge: ((_a = item.actor) === null || _a === void 0 ? void 0 : _a.data) || '', sessionId: this.sessionId, date: item.createdAt, read: item.read, seen: item.seen, language: this.language, "notification-action": this.notificationAction, token: this.token, "backend-url": this.backendUrl, "redirect-url": item.cta.data.url, "translation-url": this.translationUrl }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as i}from"./p-80fb2012.js";export{s as setNonce}from"./p-80fb2012.js";import{g as e}from"./p-e1255160.js";(()=>{const i=import.meta.url,e={};return""!==i&&(e.resourcesUrl=new URL(".",i).href),n(e)})().then((async n=>(await e(),i([["p-
|
|
1
|
+
import{p as n,b as i}from"./p-80fb2012.js";export{s as setNonce}from"./p-80fb2012.js";import{g as e}from"./p-e1255160.js";(()=>{const i=import.meta.url,e={};return""!==i&&(e.resourcesUrl=new URL(".",i).href),n(e)})().then((async n=>(await e(),i([["p-9e0ae141",[[1,"nuts-inbox-widget",{backendUrl:[513,"backend-url"],socketUrl:[513,"socket-url"],userId:[513,"user-id"],sessionId:[513,"session-id"],operatorId:[513,"operator-id"],subscriberId:[513,"subscriber-id"],deviceId:[513,"device-id"],language:[513],environment:[513],applicationIdentifier:[513,"application-identifier"],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],bellIconPosition:[513,"bell-icon-position"],notificationAction:[513,"notification-action"],translationUrl:[513,"translation-url"],isLoading:[32],popoverVisible:[32],unseenCount:[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"]],{subscriberId:["initializeHandler"],operatorId:["initializeHandler"],applicationIdentifier:["initializeHandler"],translationUrl:["handleNewTranslations"]}],[0,"nuts-popover",{language:[513],userId:[513,"user-id"],operatorId:[513,"operator-id"],token:[513],sessionId:[513,"session-id"],backendUrl:[513,"backend-url"],unseenCount:[514,"unseen-count"],clientStylingUrl:[513,"client-styling-url"],notificationAction:[513,"notification-action"],clientStyling:[1537,"client-styling"],translationUrl:[513,"translation-url"],notifications:[32],isLoading:[32],showMarkAll:[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]],{unseenCount:["unseenCountHandler"],translationUrl:["handleNewTranslations"]}],[0,"nuts-notification",{badge:[513],content:[513],date:[513],showSettings:[516,"show-settings"],read:[516],seen:[516],language:[513],sessionId:[513,"session-id"],subscriberId:[513,"subscriber-id"],userId:[513,"user-id"],messageId:[513,"message-id"],operatorId:[513,"operator-id"],token:[513],backendUrl:[513,"backend-url"],redirectUrl:[513,"redirect-url"],notificationAction:[513,"notification-action"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],clientStyling:[1537,"client-styling"],showSettingsModal:[32],messageSeen:[32],messageRead:[32],displayedContent:[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]],{translationUrl:["handleNewTranslations"]}]]]],n))));
|