@everymatrix/nuts-inbox-widget 0.0.1 → 0.0.2

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.
Files changed (26) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/nuts-inbox-widget.cjs.js +1 -1
  3. package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +46 -12
  4. package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +3 -2
  5. package/dist/collection/components/nuts-notification/nuts-notification.css +1 -1
  6. package/dist/collection/components/nuts-notification/nuts-notification.js +5 -7
  7. package/dist/collection/components/nuts-popover/nuts-popover.css +12 -0
  8. package/dist/collection/components/nuts-popover/nuts-popover.js +41 -11
  9. package/dist/collection/utils/locale.utils.js +22 -0
  10. package/dist/components/nuts-inbox-widget.js +2 -1
  11. package/dist/components/nuts-notification2.js +26 -6
  12. package/dist/components/nuts-popover2.js +22 -8
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/esm/nuts-inbox-widget.js +1 -1
  15. package/dist/esm/nuts-inbox-widget_3.entry.js +46 -12
  16. package/dist/nuts-inbox-widget/nuts-inbox-widget.esm.js +1 -1
  17. package/dist/nuts-inbox-widget/p-4c544b5f.entry.js +1 -0
  18. package/dist/nuts-inbox-widget/p-d2307506.entry.js +1 -0
  19. package/dist/nuts-inbox-widget/p-e082a57a.entry.js +1 -0
  20. package/dist/types/components/nuts-inbox-widget/nuts-inbox-widget.d.ts +1 -1
  21. package/dist/types/components/nuts-notification/nuts-notification.d.ts +0 -6
  22. package/dist/types/components/nuts-popover/nuts-popover.d.ts +2 -6
  23. package/dist/types/components.d.ts +2 -26
  24. package/dist/types/utils/locale.utils.d.ts +1 -0
  25. package/package.json +1 -1
  26. package/dist/nuts-inbox-widget/p-2f19681b.entry.js +0 -1
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- 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"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"notifications":[32],"isLoading":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]]],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]]]]]], options);
17
+ 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"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]]],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]]]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- 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"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"notifications":[32],"isLoading":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]]],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]]]]]], options);
18
+ 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"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"notifications":[32],"isLoading":[32],"showMarkAll":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"newNotification","newNotificationHandler"]]],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"]]]]]], options);
19
19
  });
@@ -4004,7 +4004,7 @@ const NutsInboxWidget = class {
4004
4004
  this.clientStyling = '';
4005
4005
  this.isLoading = true;
4006
4006
  this.popoverVisible = false;
4007
- this.ntsEndpoint = 'https://nts.everymatrix.com/ss';
4007
+ this.ntsEndpoint = 'http://localhost:3000';
4008
4008
  this.token = null;
4009
4009
  this.setClientStyling = () => {
4010
4010
  let sheet = document.createElement('style');
@@ -4134,6 +4134,7 @@ const NutsInboxWidget = class {
4134
4134
  }
4135
4135
  togglePopover() {
4136
4136
  this.popoverVisible = !this.popoverVisible;
4137
+ window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
4137
4138
  }
4138
4139
  async connectedCallback() {
4139
4140
  if (this.userId && this.operatorId && this.applicationIdentifier) {
@@ -5340,6 +5341,29 @@ function formatDistanceToNow(dirtyDate, options) {
5340
5341
  return formatDistance$1i(dirtyDate, Date.now(), options);
5341
5342
  }
5342
5343
 
5344
+ const DEFAULT_LANGUAGE = 'en';
5345
+ const SUPPORTED_LANGUAGES = ['hr', 'en'];
5346
+ const TRANSLATIONS = {
5347
+ en: {
5348
+ notifications: 'Notifications',
5349
+ noMessages: 'Nothing new to see here yet',
5350
+ markAllAsRead: 'Mark all as read',
5351
+ markAsRead: 'Mark as read',
5352
+ removeMessage: 'Remove the message'
5353
+ },
5354
+ hr: {
5355
+ notifications: 'értesítéseket',
5356
+ noMessages: 'Itt még semmi újat nem látni',
5357
+ markAllAsRead: 'összes megjelölése olvasottként',
5358
+ markAsRead: 'Jelöld olvasottként',
5359
+ removeMessage: 'Távolítsa el az üzenetet'
5360
+ }
5361
+ };
5362
+ const translate$1 = (key, customLang) => {
5363
+ const lang = customLang;
5364
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
5365
+ };
5366
+
5343
5367
  var formatDistanceLocale$1g = {
5344
5368
  lessThanXSeconds: {
5345
5369
  one: "minder as 'n sekonde",
@@ -39788,7 +39812,7 @@ const dateFnsLocales = /*#__PURE__*/Object.freeze({
39788
39812
  zhTW: locale
39789
39813
  });
39790
39814
 
39791
- const nutsNotificationCss = ":host{display:block}p{display:block;margin-block-start:0em;margin-block-end:0em;margin-inline-start:0px;margin-inline-end:0px}.NotificationContainer{animation:show 600ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;opacity:0;transform-origin:top center;padding:15px;position:relative;display:flex;line-height:20px;justify-content:flex-start;align-items:center;border-radius:7px;margin:10px 15px;color:white;background:#23232b;font-weight:400;font-size:14px}@keyframes show{100%{opacity:1;transform:none}}.NotificationContainer .AvatarContainer{margin-right:10px;width:40px;min-width:40px;height:40px;border-radius:50%;display:flex;justify-content:center;align-items:center;font-size:40px;border:1px solid #525266;overflow:hidden}.NotificationContainer .AvatarContainer .Avatar{box-sizing:border-box;position:relative;display:block;user-select:none;overflow:hidden;width:38px;min-width:38px;height:38px;border-radius:32px;text-decoration:none;border:0px;background-color:transparent;padding:0px}.NotificationContainer .AvatarContainer .Avatar .AvatarImage{object-fit:cover;width:100%;height:100%;display:block}.NotificationContainer .ContentContainer{display:flex;flex-direction:column}.NotificationContainer .Date{min-width:55px;font-size:12px;font-weight:400;opacity:0.5;line-height:14.4px;color:#525266}.NotificationContainer .Settings{opacity:0;margin-left:auto;cursor:pointer}.NotificationContainer .SettingsDropdown{z-index:999;position:absolute;background:#292933;box-shadow:rgba(0, 0, 0, 0.2) 0px 5px 20px;border-radius:7px;padding:4px;border:none;left:200px;top:40px;transition-property:opacity;transition-duration:150ms;transition-timing-function:ease;opacity:1;z-index:300;width:max-content;display:flex;flex-direction:column}.NotificationContainer .SettingsDropdown svg{margin-right:10px}.NotificationContainer .SettingsDropdown button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:white;font-weight:400;font-size:14px}.NotificationContainer .SettingsDropdown button:hover{background:#3d3d4d;transition:300ms}.NotificationContainer:hover .Settings{opacity:0.5}.Unseen::before{content:\"\";position:absolute;inset:0px;width:5px;border-radius:7px 0px 0px 7px;background:linear-gradient(0deg, #ff512f 0%, #dd2476 100%)}.Unseen:hover .UnseenButton{opacity:0;width:0px}";
39815
+ const nutsNotificationCss = ":host{display:block}p{display:block;margin-block-start:0em;margin-block-end:0em;margin-inline-start:0px;margin-inline-end:0px}.NotificationContainer{animation:show 600ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;opacity:0;transform-origin:top center;padding:15px;position:relative;display:flex;line-height:20px;justify-content:flex-start;align-items:center;border-radius:7px;margin:10px 15px;color:white;background:#23232b;font-weight:400;font-size:14px}@keyframes show{100%{opacity:1;transform:none}}.NotificationContainer .AvatarContainer{margin-right:10px;width:40px;min-width:40px;height:40px;border-radius:50%;display:flex;justify-content:center;align-items:center;font-size:40px;border:1px solid #525266;overflow:hidden}.NotificationContainer .AvatarContainer .Avatar{box-sizing:border-box;position:relative;display:block;user-select:none;overflow:hidden;width:38px;min-width:38px;height:38px;border-radius:32px;text-decoration:none;border:0px;background-color:transparent;padding:0px}.NotificationContainer .AvatarContainer .Avatar .AvatarImage{object-fit:cover;width:100%;height:100%;display:block}.NotificationContainer .ContentContainer{display:flex;flex-direction:column}.NotificationContainer .Date{min-width:55px;font-size:12px;font-weight:400;opacity:0.5;line-height:14.4px;color:#525266}.NotificationContainer .Settings{opacity:0;margin-left:auto;cursor:pointer}.NotificationContainer .SettingsDropdown{z-index:999;position:absolute;background:#292933;box-shadow:rgba(0, 0, 0, 0.2) 0px 5px 20px;border-radius:7px;padding:4px;border:none;left:190px;top:40px;transition-property:opacity;transition-duration:150ms;transition-timing-function:ease;opacity:1;z-index:300;width:max-content;display:flex;flex-direction:column}.NotificationContainer .SettingsDropdown svg{margin-right:10px}.NotificationContainer .SettingsDropdown button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:white;font-weight:400;font-size:14px}.NotificationContainer .SettingsDropdown button:hover{background:#3d3d4d;transition:300ms}.NotificationContainer:hover .Settings{opacity:0.5}.Unseen::before{content:\"\";position:absolute;inset:0px;width:5px;border-radius:7px 0px 0px 7px;background:linear-gradient(0deg, #ff512f 0%, #dd2476 100%)}.Unseen:hover .UnseenButton{opacity:0;width:0px}";
39792
39816
 
39793
39817
  const dateFnsLocale = (lang) => {
39794
39818
  return lang in dateFnsLocales ? dateFnsLocales[lang] : locale$1s;
@@ -39798,9 +39822,6 @@ const NutsNotification = class {
39798
39822
  index.registerInstance(this, hostRef);
39799
39823
  this.messageDeteled = index.createEvent(this, "messageDeleted", 7);
39800
39824
  this.settingsOpened = index.createEvent(this, "settingsOpened", 7);
39801
- /**
39802
- * Client custom styling via inline styles
39803
- */
39804
39825
  this.clientStyling = '';
39805
39826
  this.showSettingsModal = false;
39806
39827
  this.messageSeen = false;
@@ -39890,22 +39911,20 @@ const NutsNotification = class {
39890
39911
  }
39891
39912
  }
39892
39913
  render() {
39893
- return (index.h("div", { class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: el => this.stylingContainer = el }, this.badge ? index.h("div", { class: "AvatarContainer" }, index.h("div", { class: "Avatar" }, index.h("img", { class: "AvatarImage", src: this.badge }))) : '', index.h("div", { class: "ContentContainer" }, index.h("p", null, this.content), index.h("p", { class: "Date" }, formatDistanceToNow(new Date(this.date), { addSuffix: true, locale: dateFnsLocale(this.language) }))), index.h("div", { class: "Settings", onClick: () => this.toggleSettingsModal() }, index.h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M20.625 15.5C20.625 16.5547 21.4453 17.375 22.5 17.375C23.5156 17.375 24.375 16.5547 24.375 15.5C24.375 14.4844 23.5156 13.625 22.5 13.625C21.4453 13.625 20.625 14.4844 20.625 15.5ZM9.375 15.5C9.375 14.4844 8.51562 13.625 7.5 13.625C6.44531 13.625 5.625 14.4844 5.625 15.5C5.625 16.5547 6.44531 17.375 7.5 17.375C8.51562 17.375 9.375 16.5547 9.375 15.5ZM16.875 15.5C16.875 14.4844 16.0156 13.625 15 13.625C13.9453 13.625 13.125 14.4844 13.125 15.5C13.125 16.5547 13.9453 17.375 15 17.375C16.0156 17.375 16.875 16.5547 16.875 15.5Z", fill: "currentColor" }))), this.showSettingsModal ? index.h("div", { class: "SettingsDropdown" }, index.h("button", { onClick: () => this.markAsRead(this.messageId) }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })), "Mark as read"), index.h("button", { onClick: () => this.deleteMessage(this.messageId) }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })), "Remove the message")) : '', this.messageSeen ? '' : index.h("div", { class: "UnseenButton" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10px", height: "10px", viewBox: "0 0 16 16", fill: "none" }, 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" })))))));
39914
+ return (index.h("div", { class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: el => this.stylingContainer = el }, this.badge ? index.h("div", { class: "AvatarContainer" }, index.h("div", { class: "Avatar" }, index.h("img", { class: "AvatarImage", src: this.badge }))) : '', index.h("div", { class: "ContentContainer" }, index.h("p", null, this.content), index.h("p", { class: "Date" }, formatDistanceToNow(new Date(this.date), { addSuffix: true, locale: dateFnsLocale(this.language) }))), index.h("div", { class: "Settings", onClick: () => this.toggleSettingsModal() }, index.h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M20.625 15.5C20.625 16.5547 21.4453 17.375 22.5 17.375C23.5156 17.375 24.375 16.5547 24.375 15.5C24.375 14.4844 23.5156 13.625 22.5 13.625C21.4453 13.625 20.625 14.4844 20.625 15.5ZM9.375 15.5C9.375 14.4844 8.51562 13.625 7.5 13.625C6.44531 13.625 5.625 14.4844 5.625 15.5C5.625 16.5547 6.44531 17.375 7.5 17.375C8.51562 17.375 9.375 16.5547 9.375 15.5ZM16.875 15.5C16.875 14.4844 16.0156 13.625 15 13.625C13.9453 13.625 13.125 14.4844 13.125 15.5C13.125 16.5547 13.9453 17.375 15 17.375C16.0156 17.375 16.875 16.5547 16.875 15.5Z", fill: "currentColor" }))), this.showSettingsModal ? index.h("div", { class: "SettingsDropdown" }, index.h("button", { onClick: () => this.markAsRead(this.messageId) }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })), translate$1('markAsRead', this.language)), index.h("button", { onClick: () => this.deleteMessage(this.messageId) }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })), translate$1('removeMessage', this.language))) : '', this.messageSeen ? '' : index.h("div", { class: "UnseenButton" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10px", height: "10px", viewBox: "0 0 16 16", fill: "none" }, 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" })))))));
39894
39915
  }
39895
39916
  };
39896
39917
  NutsNotification.style = nutsNotificationCss;
39897
39918
 
39898
- const nutsPopoverCss = ":host{display:block}.Popover{padding:15px 0px;height:auto;border-radius:7px;box-shadow:rgba(0, 0, 0, 0.2) 0px 5px 20px;background:#1e1e26;margin:0px;font-family:inherit;color:#333737;direction:ltr;width:420px;z-index:999}.Popover .Header{display:flex;justify-content:space-between;padding:0 20px 10px 20px;box-shadow:0px 5px 5px -5px rgba(0, 0, 0, 0.55)}.Popover .Header .Title{color:white;font-size:20px;font-style:normal;font-weight:700;line-height:24px;text-align:center}.Popover .Header .Title .UnseenCounter{text-decoration:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;text-transform:uppercase;border-radius:10px;letter-spacing:0.25px;text-overflow:ellipsis;overflow:hidden;padding:0px;margin-left:10px;width:25px;height:20px;pointer-events:none;border:none;background:linear-gradient(0deg, #ff512f 0%, #dd2476 100%);font-family:inherit;line-height:14px;color:white;font-weight:bold;font-size:12px}.Popover .Header .MarkAsRead{margin-top:5px;margin-right:10px;font-size:14px;font-style:normal;font-weight:400;line-height:17px;color:#828299;cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .MarkAsRead:hover{opacity:0.7;transition:250ms}.Popover .NotificationList{height:400px;overflow:auto}";
39919
+ const nutsPopoverCss = ":host{display:block}.Popover{padding:15px 0px;height:auto;border-radius:7px;box-shadow:rgba(0, 0, 0, 0.2) 0px 5px 20px;background:#1e1e26;margin:0px;font-family:inherit;color:#333737;direction:ltr;width:420px;z-index:999}.Popover .Header{display:flex;justify-content:space-between;padding:0 20px 10px 20px;box-shadow:0px 5px 5px -5px rgba(0, 0, 0, 0.55)}.Popover .Header .Title{color:white;font-size:20px;font-style:normal;font-weight:700;line-height:24px;text-align:center;padding-left:10px}.Popover .Header .Title .UnseenCounter{text-decoration:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;text-transform:uppercase;border-radius:10px;letter-spacing:0.25px;text-overflow:ellipsis;overflow:hidden;padding:0px;margin-left:10px;width:25px;height:20px;pointer-events:none;border:none;background:linear-gradient(0deg, #ff512f 0%, #dd2476 100%);font-family:inherit;line-height:14px;color:white;font-weight:bold;font-size:12px}.Popover .Header .MarkAsRead{margin-top:5px;margin-right:10px;font-size:14px;font-style:normal;font-weight:400;line-height:17px;color:#828299;cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .MarkAsRead:hover{opacity:0.7;transition:250ms}.Popover .NotificationList{height:400px;overflow:auto}.Popover .NotificationList .NoMessages{display:flex;justify-content:center;flex-direction:column;align-items:center;height:100%}.Popover .NotificationList .NoMessages p{color:white;opacity:0.7}";
39899
39920
 
39900
39921
  const NutsPopover = class {
39901
39922
  constructor(hostRef) {
39902
39923
  index.registerInstance(this, hostRef);
39903
39924
  this.allNotificationsRead = index.createEvent(this, "allNotificationsRead", 7);
39904
- /**
39905
- * Client custom styling via inline styles
39906
- */
39907
39925
  this.clientStyling = '';
39908
39926
  this.isLoading = true;
39927
+ this.showMarkAll = false;
39909
39928
  this.setClientStyling = () => {
39910
39929
  let sheet = document.createElement('style');
39911
39930
  sheet.innerHTML = this.clientStyling;
@@ -39929,10 +39948,19 @@ const NutsPopover = class {
39929
39948
  this.notifications = this.notifications.filter((item) => {
39930
39949
  return item._id != event.detail;
39931
39950
  });
39951
+ this.getNotifications();
39932
39952
  }
39933
39953
  newNotificationHandler(event) {
39934
39954
  this.notifications = [event.detail, ...this.notifications];
39935
39955
  }
39956
+ unseenCountHandler(newValue) {
39957
+ if (newValue == 0) {
39958
+ this.showMarkAll = false;
39959
+ }
39960
+ else {
39961
+ this.showMarkAll = true;
39962
+ }
39963
+ }
39936
39964
  getNotifications() {
39937
39965
  let url = new URL(`${this.backendUrl}/v1/widgets/notifications/feed`);
39938
39966
  const headers = new Headers();
@@ -39970,13 +39998,19 @@ const NutsPopover = class {
39970
39998
  }
39971
39999
  connectedCallback() {
39972
40000
  this.getNotifications();
40001
+ if (this.unseenCount != 0) {
40002
+ this.showMarkAll = true;
40003
+ }
39973
40004
  }
39974
40005
  render() {
39975
- return (index.h("div", { class: "Popover", ref: el => this.stylingContainer = el }, index.h("div", { class: "Header" }, index.h("div", { class: "Title" }, "Notifications", this.unseenCount > 0 ? index.h("div", { class: "UnseenCounter" }, this.unseenCount) : ''), index.h("div", { class: "MarkAsRead", onClick: () => this.markAllAsRead() }, "Mark all as read")), index.h("div", { class: "NotificationList" }, !this.isLoading && this.notifications.map((item) => {
40006
+ return (index.h("div", { class: "Popover", ref: el => this.stylingContainer = el }, index.h("div", { class: "Header" }, index.h("div", { class: "Title" }, translate$1('noMessages', this.language), this.unseenCount > 0 ? index.h("div", { class: "UnseenCounter" }, this.unseenCount) : ''), this.showMarkAll ? index.h("div", { class: "MarkAsRead", onClick: () => this.markAllAsRead() }, translate$1('markAllAsRead', this.language)) : ''), index.h("div", { class: "NotificationList" }, !this.isLoading && (this.notifications.length > 0 ? this.notifications.map((item) => {
39976
40007
  var _a;
39977
40008
  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) || '', date: item.createdAt, read: item.read, seen: item.seen, language: this.language, token: this.token, "backend-url": this.backendUrl }));
39978
- }))));
40009
+ }) : index.h("div", { class: "NoMessages" }, index.h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, index.h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }), index.h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }), index.h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), index.h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), index.h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), index.h("p", null, translate$1('noMessages', this.language)))))));
39979
40010
  }
40011
+ static get watchers() { return {
40012
+ "unseenCount": ["unseenCountHandler"]
40013
+ }; }
39980
40014
  };
39981
40015
  NutsPopover.style = nutsPopoverCss;
39982
40016
 
@@ -18,7 +18,7 @@ export class NutsInboxWidget {
18
18
  this.clientStyling = '';
19
19
  this.isLoading = true;
20
20
  this.popoverVisible = false;
21
- this.ntsEndpoint = 'https://nts.everymatrix.com/ss';
21
+ this.ntsEndpoint = 'http://localhost:3000';
22
22
  this.token = null;
23
23
  this.setClientStyling = () => {
24
24
  let sheet = document.createElement('style');
@@ -148,6 +148,7 @@ export class NutsInboxWidget {
148
148
  }
149
149
  togglePopover() {
150
150
  this.popoverVisible = !this.popoverVisible;
151
+ window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
151
152
  }
152
153
  async connectedCallback() {
153
154
  if (this.userId && this.operatorId && this.applicationIdentifier) {
@@ -372,7 +373,7 @@ export class NutsInboxWidget {
372
373
  "optional": false,
373
374
  "docs": {
374
375
  "tags": [],
375
- "text": "Custom styling url for the novu iFrame, formatted as a JSON object according to the documentation: https://docs.novu.co/notification-center/custom-styling/"
376
+ "text": "Client styling url for a css file"
376
377
  },
377
378
  "attribute": "client-styling-url",
378
379
  "reflect": true
@@ -92,7 +92,7 @@ p {
92
92
  border-radius: 7px;
93
93
  padding: 4px;
94
94
  border: none;
95
- left: 200px;
95
+ left: 190px;
96
96
  top: 40px;
97
97
  transition-property: opacity;
98
98
  transition-duration: 150ms;
@@ -1,14 +1,12 @@
1
1
  import { Component, h, Prop, State, Event, Listen } from '@stencil/core';
2
2
  import { formatDistanceToNow } from 'date-fns';
3
+ import { translate } from '../../utils/locale.utils';
3
4
  import * as dateFnsLocales from 'date-fns/locale';
4
5
  const dateFnsLocale = (lang) => {
5
6
  return lang in dateFnsLocales ? dateFnsLocales[lang] : dateFnsLocales.enUS;
6
7
  };
7
8
  export class NutsNotification {
8
9
  constructor() {
9
- /**
10
- * Client custom styling via inline styles
11
- */
12
10
  this.clientStyling = '';
13
11
  this.showSettingsModal = false;
14
12
  this.messageSeen = false;
@@ -113,11 +111,11 @@ export class NutsNotification {
113
111
  h("button", { onClick: () => this.markAsRead(this.messageId) },
114
112
  h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
115
113
  h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })),
116
- "Mark as read"),
114
+ translate('markAsRead', this.language)),
117
115
  h("button", { onClick: () => this.deleteMessage(this.messageId) },
118
116
  h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
119
117
  h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })),
120
- "Remove the message")) : '',
118
+ translate('removeMessage', this.language))) : '',
121
119
  this.messageSeen ? '' : h("div", { class: "UnseenButton" },
122
120
  h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10px", height: "10px", viewBox: "0 0 16 16", fill: "none" },
123
121
  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" }),
@@ -350,7 +348,7 @@ export class NutsNotification {
350
348
  "optional": false,
351
349
  "docs": {
352
350
  "tags": [],
353
- "text": "Client custom styling via inline styles"
351
+ "text": ""
354
352
  },
355
353
  "attribute": "client-styling",
356
354
  "reflect": true,
@@ -368,7 +366,7 @@ export class NutsNotification {
368
366
  "optional": false,
369
367
  "docs": {
370
368
  "tags": [],
371
- "text": "Custom styling url for the novu iFrame, formatted as a JSON object according to the documentation: https://docs.novu.co/notification-center/custom-styling/"
369
+ "text": ""
372
370
  },
373
371
  "attribute": "client-styling-url",
374
372
  "reflect": true
@@ -28,6 +28,7 @@
28
28
  font-weight: 700;
29
29
  line-height: 24px;
30
30
  text-align: center;
31
+ padding-left: 10px;
31
32
  }
32
33
  .Popover .Header .Title .UnseenCounter {
33
34
  text-decoration: none;
@@ -72,4 +73,15 @@
72
73
  .Popover .NotificationList {
73
74
  height: 400px;
74
75
  overflow: auto;
76
+ }
77
+ .Popover .NotificationList .NoMessages {
78
+ display: flex;
79
+ justify-content: center;
80
+ flex-direction: column;
81
+ align-items: center;
82
+ height: 100%;
83
+ }
84
+ .Popover .NotificationList .NoMessages p {
85
+ color: white;
86
+ opacity: 0.7;
75
87
  }
@@ -1,11 +1,10 @@
1
- import { Component, h, Listen, Event, Prop, State } from '@stencil/core';
1
+ import { Component, h, Listen, Event, Prop, State, Watch } from '@stencil/core';
2
+ import { translate } from '../../utils/locale.utils';
2
3
  export class NutsPopover {
3
4
  constructor() {
4
- /**
5
- * Client custom styling via inline styles
6
- */
7
5
  this.clientStyling = '';
8
6
  this.isLoading = true;
7
+ this.showMarkAll = false;
9
8
  this.setClientStyling = () => {
10
9
  let sheet = document.createElement('style');
11
10
  sheet.innerHTML = this.clientStyling;
@@ -29,10 +28,19 @@ export class NutsPopover {
29
28
  this.notifications = this.notifications.filter((item) => {
30
29
  return item._id != event.detail;
31
30
  });
31
+ this.getNotifications();
32
32
  }
33
33
  newNotificationHandler(event) {
34
34
  this.notifications = [event.detail, ...this.notifications];
35
35
  }
36
+ unseenCountHandler(newValue) {
37
+ if (newValue == 0) {
38
+ this.showMarkAll = false;
39
+ }
40
+ else {
41
+ this.showMarkAll = true;
42
+ }
43
+ }
36
44
  getNotifications() {
37
45
  let url = new URL(`${this.backendUrl}/v1/widgets/notifications/feed`);
38
46
  const headers = new Headers();
@@ -70,18 +78,35 @@ export class NutsPopover {
70
78
  }
71
79
  connectedCallback() {
72
80
  this.getNotifications();
81
+ if (this.unseenCount != 0) {
82
+ this.showMarkAll = true;
83
+ }
73
84
  }
74
85
  render() {
75
86
  return (h("div", { class: "Popover", ref: el => this.stylingContainer = el },
76
87
  h("div", { class: "Header" },
77
88
  h("div", { class: "Title" },
78
- "Notifications",
89
+ translate('noMessages', this.language),
79
90
  this.unseenCount > 0 ? h("div", { class: "UnseenCounter" }, this.unseenCount) : ''),
80
- h("div", { class: "MarkAsRead", onClick: () => this.markAllAsRead() }, "Mark all as read")),
81
- h("div", { class: "NotificationList" }, !this.isLoading && this.notifications.map((item) => {
91
+ this.showMarkAll ? h("div", { class: "MarkAsRead", onClick: () => this.markAllAsRead() }, translate('markAllAsRead', this.language)) : ''),
92
+ h("div", { class: "NotificationList" }, !this.isLoading && (this.notifications.length > 0 ? this.notifications.map((item) => {
82
93
  var _a;
83
94
  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) || '', date: item.createdAt, read: item.read, seen: item.seen, language: this.language, token: this.token, "backend-url": this.backendUrl }));
84
- }))));
95
+ }) : h("div", { class: "NoMessages" },
96
+ h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" },
97
+ h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
98
+ h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
99
+ h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }),
100
+ h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }),
101
+ h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
102
+ h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
103
+ h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
104
+ h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
105
+ h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }),
106
+ h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }),
107
+ h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }),
108
+ h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })),
109
+ h("p", null, translate('noMessages', this.language)))))));
85
110
  }
86
111
  static get is() { return "nuts-popover"; }
87
112
  static get originalStyleUrls() { return {
@@ -205,7 +230,7 @@ export class NutsPopover {
205
230
  "optional": false,
206
231
  "docs": {
207
232
  "tags": [],
208
- "text": "Client custom styling via inline styles"
233
+ "text": ""
209
234
  },
210
235
  "attribute": "client-styling",
211
236
  "reflect": true,
@@ -223,7 +248,7 @@ export class NutsPopover {
223
248
  "optional": false,
224
249
  "docs": {
225
250
  "tags": [],
226
- "text": "Custom styling url for the novu iFrame, formatted as a JSON object according to the documentation: https://docs.novu.co/notification-center/custom-styling/"
251
+ "text": ""
227
252
  },
228
253
  "attribute": "client-styling-url",
229
254
  "reflect": true
@@ -231,7 +256,8 @@ export class NutsPopover {
231
256
  }; }
232
257
  static get states() { return {
233
258
  "notifications": {},
234
- "isLoading": {}
259
+ "isLoading": {},
260
+ "showMarkAll": {}
235
261
  }; }
236
262
  static get events() { return [{
237
263
  "method": "allNotificationsRead",
@@ -249,6 +275,10 @@ export class NutsPopover {
249
275
  "references": {}
250
276
  }
251
277
  }]; }
278
+ static get watchers() { return [{
279
+ "propName": "unseenCount",
280
+ "methodName": "unseenCountHandler"
281
+ }]; }
252
282
  static get listeners() { return [{
253
283
  "name": "messageDeleted",
254
284
  "method": "messageDeteledHandler",
@@ -0,0 +1,22 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['hr', 'en'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ notifications: 'Notifications',
6
+ noMessages: 'Nothing new to see here yet',
7
+ markAllAsRead: 'Mark all as read',
8
+ markAsRead: 'Mark as read',
9
+ removeMessage: 'Remove the message'
10
+ },
11
+ hr: {
12
+ notifications: 'értesítéseket',
13
+ noMessages: 'Itt még semmi újat nem látni',
14
+ markAllAsRead: 'összes megjelölése olvasottként',
15
+ markAsRead: 'Jelöld olvasottként',
16
+ removeMessage: 'Távolítsa el az üzenetet'
17
+ }
18
+ };
19
+ export const translate = (key, customLang) => {
20
+ const lang = customLang;
21
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
22
+ };
@@ -4008,7 +4008,7 @@ const NutsInboxWidget$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
4008
4008
  this.clientStyling = '';
4009
4009
  this.isLoading = true;
4010
4010
  this.popoverVisible = false;
4011
- this.ntsEndpoint = 'https://nts.everymatrix.com/ss';
4011
+ this.ntsEndpoint = 'http://localhost:3000';
4012
4012
  this.token = null;
4013
4013
  this.setClientStyling = () => {
4014
4014
  let sheet = document.createElement('style');
@@ -4138,6 +4138,7 @@ const NutsInboxWidget$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
4138
4138
  }
4139
4139
  togglePopover() {
4140
4140
  this.popoverVisible = !this.popoverVisible;
4141
+ window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
4141
4142
  }
4142
4143
  async connectedCallback() {
4143
4144
  if (this.userId && this.operatorId && this.applicationIdentifier) {
@@ -1172,6 +1172,29 @@ function formatDistanceToNow(dirtyDate, options) {
1172
1172
  return formatDistance$1i(dirtyDate, Date.now(), options);
1173
1173
  }
1174
1174
 
1175
+ const DEFAULT_LANGUAGE = 'en';
1176
+ const SUPPORTED_LANGUAGES = ['hr', 'en'];
1177
+ const TRANSLATIONS = {
1178
+ en: {
1179
+ notifications: 'Notifications',
1180
+ noMessages: 'Nothing new to see here yet',
1181
+ markAllAsRead: 'Mark all as read',
1182
+ markAsRead: 'Mark as read',
1183
+ removeMessage: 'Remove the message'
1184
+ },
1185
+ hr: {
1186
+ notifications: 'értesítéseket',
1187
+ noMessages: 'Itt még semmi újat nem látni',
1188
+ markAllAsRead: 'összes megjelölése olvasottként',
1189
+ markAsRead: 'Jelöld olvasottként',
1190
+ removeMessage: 'Távolítsa el az üzenetet'
1191
+ }
1192
+ };
1193
+ const translate$1 = (key, customLang) => {
1194
+ const lang = customLang;
1195
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
1196
+ };
1197
+
1175
1198
  var formatDistanceLocale$1g = {
1176
1199
  lessThanXSeconds: {
1177
1200
  one: "minder as 'n sekonde",
@@ -35620,7 +35643,7 @@ const dateFnsLocales = /*#__PURE__*/Object.freeze({
35620
35643
  zhTW: locale
35621
35644
  });
35622
35645
 
35623
- const nutsNotificationCss = ":host{display:block}p{display:block;margin-block-start:0em;margin-block-end:0em;margin-inline-start:0px;margin-inline-end:0px}.NotificationContainer{animation:show 600ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;opacity:0;transform-origin:top center;padding:15px;position:relative;display:flex;line-height:20px;justify-content:flex-start;align-items:center;border-radius:7px;margin:10px 15px;color:white;background:#23232b;font-weight:400;font-size:14px}@keyframes show{100%{opacity:1;transform:none}}.NotificationContainer .AvatarContainer{margin-right:10px;width:40px;min-width:40px;height:40px;border-radius:50%;display:flex;justify-content:center;align-items:center;font-size:40px;border:1px solid #525266;overflow:hidden}.NotificationContainer .AvatarContainer .Avatar{box-sizing:border-box;position:relative;display:block;user-select:none;overflow:hidden;width:38px;min-width:38px;height:38px;border-radius:32px;text-decoration:none;border:0px;background-color:transparent;padding:0px}.NotificationContainer .AvatarContainer .Avatar .AvatarImage{object-fit:cover;width:100%;height:100%;display:block}.NotificationContainer .ContentContainer{display:flex;flex-direction:column}.NotificationContainer .Date{min-width:55px;font-size:12px;font-weight:400;opacity:0.5;line-height:14.4px;color:#525266}.NotificationContainer .Settings{opacity:0;margin-left:auto;cursor:pointer}.NotificationContainer .SettingsDropdown{z-index:999;position:absolute;background:#292933;box-shadow:rgba(0, 0, 0, 0.2) 0px 5px 20px;border-radius:7px;padding:4px;border:none;left:200px;top:40px;transition-property:opacity;transition-duration:150ms;transition-timing-function:ease;opacity:1;z-index:300;width:max-content;display:flex;flex-direction:column}.NotificationContainer .SettingsDropdown svg{margin-right:10px}.NotificationContainer .SettingsDropdown button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:white;font-weight:400;font-size:14px}.NotificationContainer .SettingsDropdown button:hover{background:#3d3d4d;transition:300ms}.NotificationContainer:hover .Settings{opacity:0.5}.Unseen::before{content:\"\";position:absolute;inset:0px;width:5px;border-radius:7px 0px 0px 7px;background:linear-gradient(0deg, #ff512f 0%, #dd2476 100%)}.Unseen:hover .UnseenButton{opacity:0;width:0px}";
35646
+ const nutsNotificationCss = ":host{display:block}p{display:block;margin-block-start:0em;margin-block-end:0em;margin-inline-start:0px;margin-inline-end:0px}.NotificationContainer{animation:show 600ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;opacity:0;transform-origin:top center;padding:15px;position:relative;display:flex;line-height:20px;justify-content:flex-start;align-items:center;border-radius:7px;margin:10px 15px;color:white;background:#23232b;font-weight:400;font-size:14px}@keyframes show{100%{opacity:1;transform:none}}.NotificationContainer .AvatarContainer{margin-right:10px;width:40px;min-width:40px;height:40px;border-radius:50%;display:flex;justify-content:center;align-items:center;font-size:40px;border:1px solid #525266;overflow:hidden}.NotificationContainer .AvatarContainer .Avatar{box-sizing:border-box;position:relative;display:block;user-select:none;overflow:hidden;width:38px;min-width:38px;height:38px;border-radius:32px;text-decoration:none;border:0px;background-color:transparent;padding:0px}.NotificationContainer .AvatarContainer .Avatar .AvatarImage{object-fit:cover;width:100%;height:100%;display:block}.NotificationContainer .ContentContainer{display:flex;flex-direction:column}.NotificationContainer .Date{min-width:55px;font-size:12px;font-weight:400;opacity:0.5;line-height:14.4px;color:#525266}.NotificationContainer .Settings{opacity:0;margin-left:auto;cursor:pointer}.NotificationContainer .SettingsDropdown{z-index:999;position:absolute;background:#292933;box-shadow:rgba(0, 0, 0, 0.2) 0px 5px 20px;border-radius:7px;padding:4px;border:none;left:190px;top:40px;transition-property:opacity;transition-duration:150ms;transition-timing-function:ease;opacity:1;z-index:300;width:max-content;display:flex;flex-direction:column}.NotificationContainer .SettingsDropdown svg{margin-right:10px}.NotificationContainer .SettingsDropdown button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:white;font-weight:400;font-size:14px}.NotificationContainer .SettingsDropdown button:hover{background:#3d3d4d;transition:300ms}.NotificationContainer:hover .Settings{opacity:0.5}.Unseen::before{content:\"\";position:absolute;inset:0px;width:5px;border-radius:7px 0px 0px 7px;background:linear-gradient(0deg, #ff512f 0%, #dd2476 100%)}.Unseen:hover .UnseenButton{opacity:0;width:0px}";
35624
35647
 
35625
35648
  const dateFnsLocale = (lang) => {
35626
35649
  return lang in dateFnsLocales ? dateFnsLocales[lang] : locale$1s;
@@ -35631,9 +35654,6 @@ const NutsNotification = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
35631
35654
  this.__registerHost();
35632
35655
  this.messageDeteled = createEvent(this, "messageDeleted", 7);
35633
35656
  this.settingsOpened = createEvent(this, "settingsOpened", 7);
35634
- /**
35635
- * Client custom styling via inline styles
35636
- */
35637
35657
  this.clientStyling = '';
35638
35658
  this.showSettingsModal = false;
35639
35659
  this.messageSeen = false;
@@ -35723,7 +35743,7 @@ const NutsNotification = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
35723
35743
  }
35724
35744
  }
35725
35745
  render() {
35726
- return (h("div", { class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: el => this.stylingContainer = el }, this.badge ? h("div", { class: "AvatarContainer" }, h("div", { class: "Avatar" }, h("img", { class: "AvatarImage", src: this.badge }))) : '', h("div", { class: "ContentContainer" }, h("p", null, this.content), h("p", { class: "Date" }, formatDistanceToNow(new Date(this.date), { addSuffix: true, locale: dateFnsLocale(this.language) }))), h("div", { class: "Settings", onClick: () => this.toggleSettingsModal() }, h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M20.625 15.5C20.625 16.5547 21.4453 17.375 22.5 17.375C23.5156 17.375 24.375 16.5547 24.375 15.5C24.375 14.4844 23.5156 13.625 22.5 13.625C21.4453 13.625 20.625 14.4844 20.625 15.5ZM9.375 15.5C9.375 14.4844 8.51562 13.625 7.5 13.625C6.44531 13.625 5.625 14.4844 5.625 15.5C5.625 16.5547 6.44531 17.375 7.5 17.375C8.51562 17.375 9.375 16.5547 9.375 15.5ZM16.875 15.5C16.875 14.4844 16.0156 13.625 15 13.625C13.9453 13.625 13.125 14.4844 13.125 15.5C13.125 16.5547 13.9453 17.375 15 17.375C16.0156 17.375 16.875 16.5547 16.875 15.5Z", fill: "currentColor" }))), this.showSettingsModal ? h("div", { class: "SettingsDropdown" }, h("button", { onClick: () => this.markAsRead(this.messageId) }, h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })), "Mark as read"), h("button", { onClick: () => this.deleteMessage(this.messageId) }, h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })), "Remove the message")) : '', this.messageSeen ? '' : h("div", { class: "UnseenButton" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10px", height: "10px", viewBox: "0 0 16 16", fill: "none" }, 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" })))))));
35746
+ return (h("div", { class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: el => this.stylingContainer = el }, this.badge ? h("div", { class: "AvatarContainer" }, h("div", { class: "Avatar" }, h("img", { class: "AvatarImage", src: this.badge }))) : '', h("div", { class: "ContentContainer" }, h("p", null, this.content), h("p", { class: "Date" }, formatDistanceToNow(new Date(this.date), { addSuffix: true, locale: dateFnsLocale(this.language) }))), h("div", { class: "Settings", onClick: () => this.toggleSettingsModal() }, h("svg", { width: "30", height: "30", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M20.625 15.5C20.625 16.5547 21.4453 17.375 22.5 17.375C23.5156 17.375 24.375 16.5547 24.375 15.5C24.375 14.4844 23.5156 13.625 22.5 13.625C21.4453 13.625 20.625 14.4844 20.625 15.5ZM9.375 15.5C9.375 14.4844 8.51562 13.625 7.5 13.625C6.44531 13.625 5.625 14.4844 5.625 15.5C5.625 16.5547 6.44531 17.375 7.5 17.375C8.51562 17.375 9.375 16.5547 9.375 15.5ZM16.875 15.5C16.875 14.4844 16.0156 13.625 15 13.625C13.9453 13.625 13.125 14.4844 13.125 15.5C13.125 16.5547 13.9453 17.375 15 17.375C16.0156 17.375 16.875 16.5547 16.875 15.5Z", fill: "currentColor" }))), this.showSettingsModal ? h("div", { class: "SettingsDropdown" }, h("button", { onClick: () => this.markAsRead(this.messageId) }, h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M14.9434 5.17969C14.2109 4.59375 13.625 4.125 10.1387 1.60547C9.64062 1.25391 8.67383 0.375 8 0.375V0.404297C7.9707 0.404297 7.9707 0.375 7.9707 0.375C7.29688 0.375 6.33008 1.25391 5.83203 1.60547C2.3457 4.125 1.75977 4.59375 1.02734 5.17969C0.675781 5.44336 0.5 5.85352 0.5 6.26367V13.9688C0.5 14.7598 1.11523 15.375 1.90625 15.375H14.0938C14.8555 15.375 15.5 14.7598 15.5 13.9688V6.26367C15.5 5.85352 15.2949 5.44336 14.9434 5.17969ZM9.37695 11.1562C8.9668 11.4785 8.46875 11.6543 8 11.6543C7.50195 11.6543 7.00391 11.4785 6.59375 11.1562L2.375 7.8457V6.49805C2.99023 6 3.72266 5.44336 6.94531 3.12891C7.0332 3.04102 7.15039 2.95312 7.26758 2.86523C7.41406 2.74805 7.73633 2.48438 8 2.33789C8.23438 2.48438 8.55664 2.74805 8.70312 2.86523C8.82031 2.95312 8.9375 3.04102 9.02539 3.12891C12.2188 5.44336 12.9805 6 13.625 6.49805V7.8457L9.37695 11.1562Z", fill: "currentColor" })), translate$1('markAsRead', this.language)), h("button", { onClick: () => this.deleteMessage(this.messageId) }, h("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" })), translate$1('removeMessage', this.language))) : '', this.messageSeen ? '' : h("div", { class: "UnseenButton" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10px", height: "10px", viewBox: "0 0 16 16", fill: "none" }, 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" })))))));
35727
35747
  }
35728
35748
  static get style() { return nutsNotificationCss; }
35729
35749
  }, [0, "nuts-notification", {
@@ -35759,4 +35779,4 @@ function defineCustomElement() {
35759
35779
  } });
35760
35780
  }
35761
35781
 
35762
- export { NutsNotification as N, defineCustomElement as d };
35782
+ export { NutsNotification as N, defineCustomElement as d, translate$1 as t };