@everymatrix/nuts-inbox-widget 1.76.72 → 1.77.1

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 (40) hide show
  1. package/dist/cjs/{index-c16396a3.js → index-4522ef7e.js} +231 -3
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/nuts-inbox-widget.cjs.js +2 -2
  4. package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +68 -31
  5. package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +31 -16
  6. package/dist/collection/components/nuts-notification/constants.js +2 -1
  7. package/dist/collection/components/nuts-notification/nuts-notification.js +82 -13
  8. package/dist/collection/components/nuts-popover/nuts-popover.js +2 -2
  9. package/dist/collection/utils/utils.js +10 -2
  10. package/dist/esm/{index-6a331097.js → index-0160662f.js} +231 -3
  11. package/dist/esm/loader.js +3 -3
  12. package/dist/esm/nuts-inbox-widget.js +3 -3
  13. package/dist/esm/nuts-inbox-widget_3.entry.js +68 -31
  14. package/dist/nuts-inbox-widget/index-0160662f.js +2 -0
  15. package/dist/nuts-inbox-widget/nuts-inbox-widget.esm.js +1 -1
  16. package/dist/nuts-inbox-widget/nuts-inbox-widget_3.entry.js +1 -1
  17. package/dist/stencil.config.js +2 -1
  18. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.d.ts +2 -0
  19. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.dev.d.ts +2 -0
  20. package/dist/types/{Users/StefanO/Desktop/Proj → builds/emfe-widgets}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/index.d.ts +1 -0
  21. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  22. package/dist/types/components/nuts-inbox-widget/nuts-inbox-widget.d.ts +1 -1
  23. package/dist/types/components/nuts-notification/constants.d.ts +2 -1
  24. package/dist/types/components/nuts-notification/nuts-notification.d.ts +8 -0
  25. package/dist/types/components.d.ts +16 -0
  26. package/dist/types/utils/utils.d.ts +1 -1
  27. package/hydrate/index.d.ts +236 -0
  28. package/hydrate/index.js +60405 -0
  29. package/hydrate/index.mjs +60397 -0
  30. package/hydrate/package.json +12 -0
  31. package/package.json +10 -2
  32. package/dist/nuts-inbox-widget/index-6a331097.js +0 -2
  33. package/dist/types/Users/StefanO/Desktop/Proj/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.d.ts +0 -2
  34. package/dist/types/Users/StefanO/Desktop/Proj/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.dev.d.ts +0 -2
  35. /package/dist/types/{Users/StefanO/Desktop/Proj → builds/emfe-widgets}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
  36. /package/dist/types/{Users/StefanO/Desktop/Proj → builds/emfe-widgets}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/storybook/main.d.ts +0 -0
  37. /package/dist/types/{Users/StefanO/Desktop/Proj → builds/emfe-widgets}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/storybook/preview.d.ts +0 -0
  38. /package/dist/types/{Users/StefanO/Desktop/Proj → builds/emfe-widgets}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  39. /package/dist/types/{Users/StefanO/Desktop/Proj → builds/emfe-widgets}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  40. /package/dist/types/{Users/StefanO/Desktop/Proj → builds/emfe-widgets}/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,6 +1,7 @@
1
1
  import { getTranslations } from "../../utils/locale.utils";
2
2
  import { h } from "@stencil/core";
3
3
  import { io } from "socket.io-client";
4
+ import { Build } from "@stencil/core";
4
5
  import { initializeSession } from "../../api/methods";
5
6
  import { notificationCache } from "../../cache";
6
7
  export class NutsInboxWidget {
@@ -16,6 +17,8 @@ export class NutsInboxWidget {
16
17
  };
17
18
  this.togglePopover = () => {
18
19
  this.popoverVisible = !this.popoverVisible;
20
+ if (!Build.isBrowser)
21
+ return;
19
22
  window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
20
23
  };
21
24
  this.setClientStyling = () => {
@@ -24,6 +27,8 @@ export class NutsInboxWidget {
24
27
  this.stylingContainer.prepend(sheet);
25
28
  };
26
29
  this.setClientStylingURL = () => {
30
+ if (!Build.isBrowser)
31
+ return;
27
32
  let url = new URL(this.clientStylingUrl);
28
33
  let cssFile = document.createElement('style');
29
34
  fetch(url.href)
@@ -63,9 +68,10 @@ export class NutsInboxWidget {
63
68
  this.isLoading = false;
64
69
  this.popoverVisible = false;
65
70
  this.unseenCount = undefined;
66
- this.limitStylingAppends = false;
67
71
  }
68
72
  initializeHandler(newValue, oldValue) {
73
+ if (!Build.isBrowser)
74
+ return;
69
75
  if (newValue !== oldValue) {
70
76
  if (this.subscriberId && this.operatorId && this.applicationIdentifier) {
71
77
  initializeSession({
@@ -82,6 +88,8 @@ export class NutsInboxWidget {
82
88
  }
83
89
  }
84
90
  clickOutsideHandle(ev) {
91
+ if (!Build.isBrowser)
92
+ return;
85
93
  if (ev.composedPath().some((elem) => this.el === elem)) {
86
94
  return;
87
95
  }
@@ -91,10 +99,14 @@ export class NutsInboxWidget {
91
99
  resetUnseenCount() {
92
100
  // reset the unseen count if all notif are marked as read
93
101
  this.unseenCount = 0;
102
+ if (!Build.isBrowser)
103
+ return;
94
104
  window.postMessage({ type: 'all-notifications-read', value: true }, window.location.href);
95
105
  }
96
106
  closePopoverHandler() {
97
107
  this.popoverVisible = false;
108
+ if (!Build.isBrowser)
109
+ return;
98
110
  window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
99
111
  }
100
112
  positionIcon() {
@@ -106,6 +118,10 @@ export class NutsInboxWidget {
106
118
  }
107
119
  }
108
120
  setupSocket() {
121
+ if (!Build.isBrowser)
122
+ return;
123
+ if (this.socketRef)
124
+ return;
109
125
  if (this.token) {
110
126
  this.socketRef = io(this.socketUrl, {
111
127
  reconnection: true,
@@ -128,11 +144,15 @@ export class NutsInboxWidget {
128
144
  });
129
145
  this.socketRef.on('unseen_count_changed', (data) => {
130
146
  this.unseenCount = data.unseenCount;
147
+ if (!Build.isBrowser)
148
+ return;
131
149
  window.postMessage({ type: 'nuts-new-notifications', value: this.unseenCount }, window.location.href);
132
150
  });
133
151
  }
134
152
  }
135
153
  async connectedCallback() {
154
+ if (!Build.isBrowser)
155
+ return;
136
156
  if (this.subscriberId && this.operatorId && this.applicationIdentifier) {
137
157
  const initializeSessionResult = await initializeSession({
138
158
  baseUrl: this.baseUrl,
@@ -144,9 +164,6 @@ export class NutsInboxWidget {
144
164
  window.postMessage({ type: 'nuts-new-notifications', value: this.unseenCount }, window.location.href);
145
165
  this.setupSocket();
146
166
  }
147
- if (this.clientStylingUrl) {
148
- this.setClientStylingURL();
149
- }
150
167
  }
151
168
  handleStylingChange(newValue, oldValue) {
152
169
  if (newValue !== oldValue)
@@ -168,22 +185,21 @@ export class NutsInboxWidget {
168
185
  }
169
186
  }
170
187
  componentDidRender() {
171
- // start custom styling area
172
- if (!this.limitStylingAppends && this.stylingContainer) {
173
- if (this.clientStyling)
174
- this.setClientStyling();
175
- if (this.clientStylingUrl)
176
- this.setClientStylingURL();
177
- this.limitStylingAppends = true;
178
- }
179
- // end custom styling area
180
188
  this.positionIcon();
181
189
  }
190
+ componentDidLoad() {
191
+ if (this.clientStyling) {
192
+ this.setClientStyling();
193
+ }
194
+ if (this.clientStylingUrl) {
195
+ this.setClientStylingURL();
196
+ }
197
+ }
182
198
  renderBellIcon() {
183
199
  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" }))))) : ('')));
184
200
  }
185
201
  render() {
186
- return (h("div", { key: '15e43d27da4718c321f1d498b79b8491b8e298f5', ref: this.assignRefToStylingContainer, class: "Wrapper" }, h("div", { key: '29f955f1cab9088c6c52f55637ae64f4138c1a7c', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.token && this.popoverVisible && (h("nuts-popover", { key: '6859355573c32c22d69156d8ca04045bee6bc020', "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, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl }))));
202
+ return (h("div", { key: '976f73d1e55a55aa5370f1cf1e03dd81ffe2b21a', ref: this.assignRefToStylingContainer, class: "Wrapper" }, h("div", { key: 'b443d739125b7b7e4798fd751e71c18cbc7ea43b', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.token && this.popoverVisible && (h("nuts-popover", { key: '0dc6e5a66747b44d6e1827cfc517dece41a215a2', "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, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl }))));
187
203
  }
188
204
  static get is() { return "nuts-inbox-widget"; }
189
205
  static get encapsulation() { return "shadow"; }
@@ -466,8 +482,7 @@ export class NutsInboxWidget {
466
482
  return {
467
483
  "isLoading": {},
468
484
  "popoverVisible": {},
469
- "unseenCount": {},
470
- "limitStylingAppends": {}
485
+ "unseenCount": {}
471
486
  };
472
487
  }
473
488
  static get events() {
@@ -1 +1,2 @@
1
- export const MAX_NOTIFICATION_TEXT_LENGTH = 150;
1
+ export const MAX_NOTIFICATION_TEXT_LENGTH = 200;
2
+ export const MAX_NOTIFICATION_LINES = 5;
@@ -1,11 +1,11 @@
1
- import { h } from "@stencil/core";
1
+ import { h, Build } from "@stencil/core";
2
2
  import { formatDistanceToNow } from "date-fns";
3
3
  import { translate, getTranslations } from "../../utils/locale.utils";
4
4
  import * as dateFnsLocales from "date-fns/locale";
5
5
  import DOMPurify from "dompurify";
6
6
  import { WarningFilled, InfoCircleFilled, CheckCircleFilled, CloseCircleFilled, UpCircleFilled, QuestionCircleFilled, DownOutlined } from "@ant-design/icons-svg";
7
7
  import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
8
- import { MAX_NOTIFICATION_TEXT_LENGTH } from "./constants";
8
+ import { MAX_NOTIFICATION_LINES, MAX_NOTIFICATION_TEXT_LENGTH } from "./constants";
9
9
  import { truncate } from "../../utils/utils";
10
10
  import { deleteMessage, markAsRead } from "../../api/methods";
11
11
  const systemIcons = {
@@ -95,7 +95,9 @@ export class NutsNotification {
95
95
  this.messageDeteled.emit(this.messageId);
96
96
  };
97
97
  this.notificationActionHandler = () => {
98
- var _a, _b, _c;
98
+ var _a, _b, _c, _d;
99
+ if (!Build.isBrowser)
100
+ return;
99
101
  if (this.notificationAction == 'default' || !this.notificationAction) {
100
102
  if (this.redirectUrl.length > 0) {
101
103
  window.location.href = this.redirectUrl;
@@ -104,15 +106,16 @@ export class NutsNotification {
104
106
  if (this.notificationAction == 'postMessage') {
105
107
  window.postMessage({ type: 'NotificationRedirect', url: this.redirectUrl }, window.location.href);
106
108
  }
107
- if (((_a = this.content) === null || _a === void 0 ? void 0 : _a.length) <= MAX_NOTIFICATION_TEXT_LENGTH) {
109
+ if (((_a = this.content) === null || _a === void 0 ? void 0 : _a.length) <= this.maxTextLength &&
110
+ (((_b = this.content) === null || _b === void 0 ? void 0 : _b.match(/<br\s*\/?>|<\/p>/gi)) || []).length <= this.maxLines) {
108
111
  return;
109
112
  }
110
- if (((_b = this.displayedContent) === null || _b === void 0 ? void 0 : _b.length) !== ((_c = this.content) === null || _c === void 0 ? void 0 : _c.length) && this.displayedContent !== this.content) {
113
+ if (((_c = this.displayedContent) === null || _c === void 0 ? void 0 : _c.length) !== ((_d = this.content) === null || _d === void 0 ? void 0 : _d.length) && this.displayedContent !== this.content) {
111
114
  this.displayedContent = this.content;
112
115
  this.dropdownArrowRef.classList.add('FlipX');
113
116
  return;
114
117
  }
115
- this.displayedContent = truncate(this.content, MAX_NOTIFICATION_TEXT_LENGTH);
118
+ this.displayedContent = truncate(this.content, this.maxTextLength, this.maxLines);
116
119
  this.dropdownArrowRef.classList.remove('FlipX');
117
120
  };
118
121
  this.setClientStyling = () => {
@@ -160,6 +163,8 @@ export class NutsNotification {
160
163
  this.clientStylingUrl = undefined;
161
164
  this.translationUrl = '';
162
165
  this.clientStyling = '';
166
+ this.maxTextLength = MAX_NOTIFICATION_TEXT_LENGTH;
167
+ this.maxLines = MAX_NOTIFICATION_LINES;
163
168
  this.showSettingsModal = false;
164
169
  this.messageSeen = false;
165
170
  this.messageRead = false;
@@ -204,6 +209,8 @@ export class NutsNotification {
204
209
  // end custom styling area
205
210
  }
206
211
  async componentWillLoad() {
212
+ this.maxTextLength = Number(this.maxTextLength);
213
+ this.maxLines = Number(this.maxLines);
207
214
  if (this.translationUrl.length > 2) {
208
215
  await getTranslations(this.translationUrl);
209
216
  }
@@ -211,23 +218,49 @@ export class NutsNotification {
211
218
  connectedCallback() {
212
219
  this.messageSeen = this.seen;
213
220
  this.messageRead = this.read;
214
- this.displayedContent = truncate(this.content, MAX_NOTIFICATION_TEXT_LENGTH);
221
+ this.displayedContent = truncate(this.content, this.maxTextLength, this.maxLines);
215
222
  this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
216
223
  }
217
224
  render() {
218
- var _a, _b;
225
+ var _a, _b, _c;
219
226
  const sanitizedNotificationBody = DOMPurify.sanitize(this.displayedContent, {
220
227
  ALLOW_UNKNOWN_PROTOCOLS: true,
221
228
  ADD_ATTR: ['target', 'rel'],
222
- ALLOWED_TAGS: ['b', 'u', 'i', 'br', 'a', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
223
- 'strong', 'p', 'i', 'small', 'mark', 'del', 'b', 's', 'ins',
224
- 'sub', 'sup', 'var', 'cite', 'q', 'blockquote',
229
+ ALLOWED_TAGS: [
230
+ 'b',
231
+ 'u',
232
+ 'i',
233
+ 'br',
234
+ 'a',
235
+ 'em',
236
+ 'h1',
237
+ 'h2',
238
+ 'h3',
239
+ 'h4',
240
+ 'h5',
241
+ 'h6',
242
+ 'strong',
243
+ 'p',
244
+ 'i',
245
+ 'small',
246
+ 'mark',
247
+ 'del',
248
+ 'b',
249
+ 's',
250
+ 'ins',
251
+ 'sub',
252
+ 'sup',
253
+ 'var',
254
+ 'cite',
255
+ 'q',
256
+ 'blockquote'
225
257
  ]
226
258
  });
227
- return (h("div", { key: 'b34f31877d65b1fb42e713f8bcca276afc1e5b76', class: "Wrapper" }, h("div", { key: 'b0800f24753323926e0454b8f414b803c0895bb2', class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: this.assignRefToStylingContainer, onClick: this.notificationActionHandler }, this.badge ? (h("div", { class: "AvatarContainer" }, h("div", { class: "Avatar" }, ((_a = systemIcons[this.badge]) === null || _a === void 0 ? void 0 : _a.icon) ? (h("div", { innerHTML: systemIcons[this.badge].icon })) : (h("img", { class: "AvatarImage", src: this.badge }))))) : (''), h("div", { key: '589141b01303992d77fbfa2df3fb5b487ca5983b', class: "ContentContainer" }, h("div", { key: '7275fdb4a538e0c0304ebe0820fc6b521c71b108', innerHTML: sanitizedNotificationBody }), h("p", { key: '463226f1add7828670dcf8b50434c03fc2129ec0', class: "Date" }, formatDistanceToNow(new Date(this.date), {
259
+ return (h("div", { key: 'a74957d743897164ff0f3b3d17707a8db5f433fd', class: "Wrapper" }, h("div", { key: '7dd78a87e080e8ca578620356b2cff9acc9fd64c', class: 'NotificationContainer' + (this.messageSeen ? '' : ' Unseen'), ref: this.assignRefToStylingContainer, onClick: this.notificationActionHandler }, this.badge ? (h("div", { class: "AvatarContainer" }, h("div", { class: "Avatar" }, ((_a = systemIcons[this.badge]) === null || _a === void 0 ? void 0 : _a.icon) ? (h("div", { innerHTML: systemIcons[this.badge].icon })) : (h("img", { class: "AvatarImage", src: this.badge }))))) : (''), h("div", { key: 'ea80f329d9994c429bc6c66f2f414daf7e0771b0', class: "ContentContainer" }, h("div", { key: 'b817eecb9732eeb3b19c438c0fbe6398c822dcf0', innerHTML: sanitizedNotificationBody }), h("p", { key: 'cb2c821ba968bb6e95c5703e94c296857822ae77', class: "Date" }, formatDistanceToNow(new Date(this.date), {
228
260
  addSuffix: true,
229
261
  locale: dateFnsLocale(this.language)
230
- }))), h("div", { key: '474cfe140b4ff5af3ed2b26e833172014bc9d04d', class: "RightActionsContainer" }, h("div", { key: '48316785510b38b7698f790a9cfc9bcf882a13ce', class: "Settings", onClick: this.toggleSettingsModal }, h("svg", { key: '7f4b9395133a88910dc45bfb55cb6f1278b4f81a', width: "24", height: "24", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'c810faca29bca8ab36fa47199e5a007b82dc9053', 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" }))), ((_b = this.content) === null || _b === void 0 ? void 0 : _b.length) > MAX_NOTIFICATION_TEXT_LENGTH && (h("div", { key: '566e7888b1b4baf1d1421474918d3f5ae88476e1', class: "AccordionArrow", innerHTML: systemIcons.arrowDown.icon, ref: this.assignRefToDropdownArrow })))), this.showSettingsModal ? (h("div", { class: "SettingsDropdown" }, h("button", { onClick: this.toggleNotificationRead }, 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(this.messageRead ? 'markAsUnread' : 'markAsRead', this.language)), h("button", { onClick: this.deleteNotification }, 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('removeMessage', this.language)))) : ('')));
262
+ }))), h("div", { key: 'd35902296022dff85e84d2484846a724f4b098af', class: "RightActionsContainer" }, h("div", { key: 'b3f4f5d0452d89e58bf64a10d42140ad0d000f98', class: "Settings", onClick: this.toggleSettingsModal }, h("svg", { key: 'f5dab069aeb97ed7e7055277518b9850e47aa017', width: "24", height: "24", viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '79398e37d9fa8fa5fb856d739caaa6b3e343c79a', 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" }))), (((_b = this.content) === null || _b === void 0 ? void 0 : _b.length) > this.maxTextLength ||
263
+ (((_c = this.content) === null || _c === void 0 ? void 0 : _c.match(/<br\s*\/?>|<\/p>/gi)) || []).length > this.maxLines) && (h("div", { key: 'a75570887a9b7441b38c7cacf63ba525a17e795c', class: "AccordionArrow", innerHTML: systemIcons.arrowDown.icon, ref: this.assignRefToDropdownArrow })))), this.showSettingsModal ? (h("div", { class: "SettingsDropdown" }, h("button", { onClick: this.toggleNotificationRead }, 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(this.messageRead ? 'markAsUnread' : 'markAsRead', this.language)), h("button", { onClick: this.deleteNotification }, 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('removeMessage', this.language)))) : ('')));
231
264
  }
232
265
  static get is() { return "nuts-notification"; }
233
266
  static get originalStyleUrls() {
@@ -566,6 +599,42 @@ export class NutsNotification {
566
599
  "attribute": "client-styling",
567
600
  "reflect": true,
568
601
  "defaultValue": "''"
602
+ },
603
+ "maxTextLength": {
604
+ "type": "number",
605
+ "mutable": false,
606
+ "complexType": {
607
+ "original": "number",
608
+ "resolved": "number",
609
+ "references": {}
610
+ },
611
+ "required": false,
612
+ "optional": false,
613
+ "docs": {
614
+ "tags": [],
615
+ "text": "Max length of notification text before truncating"
616
+ },
617
+ "attribute": "max-text-length",
618
+ "reflect": true,
619
+ "defaultValue": "MAX_NOTIFICATION_TEXT_LENGTH"
620
+ },
621
+ "maxLines": {
622
+ "type": "number",
623
+ "mutable": false,
624
+ "complexType": {
625
+ "original": "number",
626
+ "resolved": "number",
627
+ "references": {}
628
+ },
629
+ "required": false,
630
+ "optional": false,
631
+ "docs": {
632
+ "tags": [],
633
+ "text": "Max number of lines before truncating"
634
+ },
635
+ "attribute": "max-lines",
636
+ "reflect": true,
637
+ "defaultValue": "MAX_NOTIFICATION_LINES"
569
638
  }
570
639
  };
571
640
  }
@@ -183,8 +183,8 @@ export class NutsPopover {
183
183
  extraSVGAttrs: { width: '30px', height: '30px', fill: '#A1A1B2' }
184
184
  }) })) : ((_b = this.notifications) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (this.notifications.map((item) => {
185
185
  var _a;
186
- return (h("nuts-notification", { "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, 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 }));
187
- })) : (h("div", { class: "NoMessages" }, h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), 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" }), 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" }), 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" }), 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" }), 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" }), 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" }), h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), h("p", null, translate('noMessages', this.language)))))), !this.isLoading && (h("div", { key: '2f6963fcdbde521150bcdf1a74df14c1c83c0590', class: "Pagination" }, h("div", { key: '50b7efd6616498cb39545f34748fe8ccfd044928', class: "Button" }, h("button", { key: '936b5f460c7d68a3388b3b1c463001302156c4f0', disabled: this.isNotificationsLoading || this.currentPage <= 0, onClick: this.prevPage }, h("svg", { key: '66c1f5220c386baa75dc639765cc8ff2be56cf13', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: '59cf1db0cedb6380700afae53a79cdd55bc4aca4', d: "M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z" })), translate('prev', this.language))), h("div", { key: 'b3deb3012ec1ce92a96b4cc1f4ae13b495d5792d', class: "Button" }, h("button", { key: '063fc0d76d6ca06eccc0129e8edcfa40e7cc8f4c', disabled: this.isNotificationsLoading || !this.hasMore, onClick: this.nextPage }, translate('next', this.language), h("svg", { key: '1a36392bd201328cd17fe6fa235450f54ac134bc', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: 'a66894d1ab1713d32c604a00251d2100da32c063', d: "M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z" }))))))));
186
+ return (h("nuts-notification", { "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, 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, "max-text-length": 200, "max-lines": 5 }));
187
+ })) : (h("div", { class: "NoMessages" }, h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), 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" }), 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" }), 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" }), 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" }), 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" }), 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" }), h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), h("p", null, translate('noMessages', this.language)))))), !this.isLoading && (h("div", { key: 'ac051bc217b20856ee2fbb05c164740a2ce15034', class: "Pagination" }, h("div", { key: '4103c2541b1534674f4a395782b57cb7f412e635', class: "Button" }, h("button", { key: 'b5ea8a82ad305692ba6b7e27de3156df8755b41a', disabled: this.isNotificationsLoading || this.currentPage <= 0, onClick: this.prevPage }, h("svg", { key: '84a373abf56f161f2f566c617c2227d713bfbad5', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: 'a8c8e4d65eb525f98db3a9f3770c64a4cff44b0e', d: "M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z" })), translate('prev', this.language))), h("div", { key: '20b18543fe251fe1f2b67e002fa07ec9be8146e7', class: "Button" }, h("button", { key: '797168392bd58e443953ccac835e33660956ea27', disabled: this.isNotificationsLoading || !this.hasMore, onClick: this.nextPage }, translate('next', this.language), h("svg", { key: '3602fbc69f946074355405ec83075069bb3787c1', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: '679cc4531c96fe91bbdc027acfee1eb71240495d', d: "M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z" }))))))));
188
188
  }
189
189
  static get is() { return "nuts-popover"; }
190
190
  static get originalStyleUrls() {
@@ -1,6 +1,14 @@
1
- export const truncate = (str, n) => {
1
+ export const truncate = (str, n, l) => {
2
2
  if (!str || n < 0) {
3
3
  return;
4
4
  }
5
- return str.length > n ? str.slice(0, n - 1) + '...' : str;
5
+ if (str.length > n) {
6
+ return str.slice(0, n - 1) + '...';
7
+ }
8
+ const matches = [...str.matchAll(/<br\s*\/?>|<\/p>/gi)];
9
+ if (matches.length >= l) {
10
+ const cutoffIndex = matches[l - 1].index;
11
+ return str.slice(0, cutoffIndex) + '...';
12
+ }
13
+ return str;
6
14
  };