@edusight/notification-widget 1.0.32 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -23
- package/dist/{components-D8XxiFEB.js → components-Dq8aSwWR.js} +125 -131
- package/dist/components-Dq8aSwWR.js.map +1 -0
- package/dist/components-dwdMDd9K.cjs +71 -0
- package/dist/{components-D8XxiFEB.js.map → components-dwdMDd9K.cjs.map} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +121 -119
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/components-KafszaqK.cjs +0 -71
- package/dist/components-KafszaqK.cjs.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as d, jsxs as k } from "react/jsx-runtime";
|
|
2
|
-
import M, { Component as V, useState as C, useCallback as
|
|
2
|
+
import M, { Component as V, useState as C, useCallback as g, useEffect as y, createContext as z, useReducer as q, useRef as $, useContext as H } from "react";
|
|
3
3
|
import { io as J } from "socket.io-client";
|
|
4
4
|
import { NotificationClient as j } from "@edusight/notification-sdk";
|
|
5
|
-
import { M as G, a as Q, C as O, B as
|
|
6
|
-
import { N as Te, P as _e } from "./components-
|
|
7
|
-
import { u as ee, c as
|
|
5
|
+
import { M as G, a as Q, C as O, B as x, S as X, I as Y, L as Z } from "./components-Dq8aSwWR.js";
|
|
6
|
+
import { N as Te, P as _e } from "./components-Dq8aSwWR.js";
|
|
7
|
+
import { u as ee, c as D } from "./hooks-BTG0z6yd.js";
|
|
8
8
|
const te = ({ error: t, onRetry: r }) => /* @__PURE__ */ k(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
@@ -113,24 +113,24 @@ class ne extends V {
|
|
|
113
113
|
) : this.props.children;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const re = () => window.__notificationSDK?.client,
|
|
116
|
+
const re = () => window.__notificationSDK?.client, oe = ({
|
|
117
117
|
onPreferencesLoaded: t,
|
|
118
118
|
onError: r
|
|
119
119
|
}) => {
|
|
120
|
-
const l = re(), [p, a] = C(!0), [
|
|
120
|
+
const l = re(), [p, a] = C(!0), [o, n] = C(null), [s, f] = C(null), w = g(async () => {
|
|
121
121
|
try {
|
|
122
122
|
if (a(!0), n(null), !l)
|
|
123
123
|
throw new Error("Notification client not available");
|
|
124
124
|
const u = window.__notificationSDK?.config;
|
|
125
125
|
if (!u)
|
|
126
126
|
throw new Error("SDK configuration not available");
|
|
127
|
-
const { subscriberId:
|
|
128
|
-
if (!
|
|
127
|
+
const { subscriberId: b, tenantId: T, environmentId: m } = u;
|
|
128
|
+
if (!b || !T || !m)
|
|
129
129
|
throw new Error("SubscriberId, TenantId or EnvironmentId not available in config");
|
|
130
130
|
const E = await l.preferences.get(
|
|
131
131
|
T,
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
b,
|
|
133
|
+
m
|
|
134
134
|
), N = {
|
|
135
135
|
channels: {
|
|
136
136
|
email: E.emailEnabled ?? !0,
|
|
@@ -162,9 +162,9 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
162
162
|
});
|
|
163
163
|
}), f(N), t(N);
|
|
164
164
|
} catch (u) {
|
|
165
|
-
const
|
|
166
|
-
u?.response?.status === 404 || u?.status === 404 || (n(
|
|
167
|
-
const
|
|
165
|
+
const b = u instanceof Error ? u : new Error("Failed to load preferences");
|
|
166
|
+
u?.response?.status === 404 || u?.status === 404 || (n(b), r?.(b));
|
|
167
|
+
const m = {
|
|
168
168
|
channels: {
|
|
169
169
|
email: !0,
|
|
170
170
|
push: !0,
|
|
@@ -181,57 +181,56 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
181
181
|
weekdays: [!0, !0, !0, !0, !0, !1, !1]
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
|
-
f(
|
|
184
|
+
f(m), t(m);
|
|
185
185
|
} finally {
|
|
186
186
|
a(!1);
|
|
187
187
|
}
|
|
188
188
|
}, [l, t, r]);
|
|
189
|
-
return
|
|
190
|
-
l &&
|
|
191
|
-
}, [l,
|
|
189
|
+
return y(() => {
|
|
190
|
+
l && w();
|
|
191
|
+
}, [l, w]), {
|
|
192
192
|
isLoading: p,
|
|
193
|
-
error:
|
|
193
|
+
error: o,
|
|
194
194
|
preferences: s
|
|
195
195
|
};
|
|
196
|
-
},
|
|
197
|
-
const t =
|
|
196
|
+
}, ie = () => window.__notificationSDK?.client, ae = () => {
|
|
197
|
+
const t = ie(), [r, l] = C([]), [p, a] = C(!0), [o, n] = C(null), s = g(async () => {
|
|
198
198
|
try {
|
|
199
199
|
if (a(!0), n(null), !t)
|
|
200
|
-
throw new Error("Notification client not available");
|
|
200
|
+
throw new Error("[useWorkflows] Notification client not available");
|
|
201
201
|
const f = window.__notificationSDK?.config;
|
|
202
202
|
if (!f)
|
|
203
|
-
throw new Error("SDK configuration not available");
|
|
204
|
-
const { tenantId:
|
|
205
|
-
if (!
|
|
206
|
-
throw new Error("TenantId or EnvironmentId not available in config");
|
|
203
|
+
throw new Error("[useWorkflows] SDK configuration not available");
|
|
204
|
+
const { tenantId: w, environmentId: u } = f;
|
|
205
|
+
if (!w || !u)
|
|
206
|
+
throw new Error("[useWorkflows] TenantId or EnvironmentId not available in config");
|
|
207
207
|
const T = ((await t.workflows.list(
|
|
208
208
|
{ status: "active" },
|
|
209
|
-
|
|
210
|
-
m,
|
|
209
|
+
w,
|
|
211
210
|
u
|
|
212
|
-
))?.workflows || []).map((
|
|
213
|
-
workflowId:
|
|
214
|
-
name:
|
|
215
|
-
description:
|
|
211
|
+
))?.workflows || []).map((m) => ({
|
|
212
|
+
workflowId: m.workflowId,
|
|
213
|
+
name: m.name || m.workflowId,
|
|
214
|
+
description: m.description
|
|
216
215
|
}));
|
|
217
216
|
l(T);
|
|
218
217
|
} catch (f) {
|
|
219
|
-
const
|
|
220
|
-
n(
|
|
218
|
+
const w = f instanceof Error ? f : new Error("Failed to load workflows");
|
|
219
|
+
n(w), l([]);
|
|
221
220
|
} finally {
|
|
222
221
|
a(!1);
|
|
223
222
|
}
|
|
224
223
|
}, [t]);
|
|
225
|
-
return
|
|
224
|
+
return y(() => {
|
|
226
225
|
t && s();
|
|
227
226
|
}, [t, s]), {
|
|
228
227
|
workflows: r,
|
|
229
228
|
isLoading: p,
|
|
230
|
-
error:
|
|
229
|
+
error: o,
|
|
231
230
|
refetch: s
|
|
232
231
|
};
|
|
233
|
-
},
|
|
234
|
-
const t = H(
|
|
232
|
+
}, W = z(null), se = () => {
|
|
233
|
+
const t = H(W);
|
|
235
234
|
if (!t)
|
|
236
235
|
throw new Error("useSDK must be used within a NotificationWidget");
|
|
237
236
|
return t;
|
|
@@ -275,7 +274,7 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
275
274
|
isInitialized: !1,
|
|
276
275
|
error: null
|
|
277
276
|
});
|
|
278
|
-
return
|
|
277
|
+
return y(() => {
|
|
279
278
|
let a = !0;
|
|
280
279
|
return (async () => {
|
|
281
280
|
try {
|
|
@@ -309,37 +308,37 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
309
308
|
})(), () => {
|
|
310
309
|
a = !1;
|
|
311
310
|
};
|
|
312
|
-
}, [t]), /* @__PURE__ */ d(
|
|
311
|
+
}, [t]), /* @__PURE__ */ d(W.Provider, { value: l, children: r });
|
|
313
312
|
}, le = (t, r) => {
|
|
314
313
|
switch (r.type) {
|
|
315
314
|
case "SET_NOTIFICATIONS":
|
|
316
315
|
return {
|
|
317
316
|
...t,
|
|
318
317
|
notifications: r.payload,
|
|
319
|
-
unreadCount: r.payload.filter((
|
|
318
|
+
unreadCount: r.payload.filter((o) => !o.isRead).length
|
|
320
319
|
};
|
|
321
320
|
case "ADD_NOTIFICATION":
|
|
322
321
|
const l = [r.payload, ...t.notifications];
|
|
323
322
|
return {
|
|
324
323
|
...t,
|
|
325
324
|
notifications: l,
|
|
326
|
-
unreadCount: l.filter((
|
|
325
|
+
unreadCount: l.filter((o) => !o.isRead).length
|
|
327
326
|
};
|
|
328
327
|
case "UPDATE_NOTIFICATION":
|
|
329
328
|
const p = t.notifications.map(
|
|
330
|
-
(
|
|
329
|
+
(o) => o.id === r.payload.id ? { ...o, ...r.payload.updates } : o
|
|
331
330
|
);
|
|
332
331
|
return {
|
|
333
332
|
...t,
|
|
334
333
|
notifications: p,
|
|
335
|
-
unreadCount: p.filter((
|
|
334
|
+
unreadCount: p.filter((o) => !o.isRead).length
|
|
336
335
|
};
|
|
337
336
|
case "DELETE_NOTIFICATION":
|
|
338
|
-
const a = t.notifications.filter((
|
|
337
|
+
const a = t.notifications.filter((o) => o.id !== r.payload);
|
|
339
338
|
return {
|
|
340
339
|
...t,
|
|
341
340
|
notifications: a,
|
|
342
|
-
unreadCount: a.filter((
|
|
341
|
+
unreadCount: a.filter((o) => !o.isRead).length
|
|
343
342
|
};
|
|
344
343
|
case "SET_PREFERENCES":
|
|
345
344
|
return {
|
|
@@ -366,26 +365,26 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
366
365
|
className: p = "",
|
|
367
366
|
onError: a
|
|
368
367
|
}) => {
|
|
369
|
-
const [
|
|
368
|
+
const [o, n] = q(le, ce), { client: s, isInitialized: f, error: w } = se(), u = $(null), b = g((e) => {
|
|
370
369
|
n({
|
|
371
370
|
type: "SET_PREFERENCES",
|
|
372
371
|
payload: e
|
|
373
372
|
});
|
|
374
|
-
}, []), T =
|
|
373
|
+
}, []), T = g((e) => {
|
|
375
374
|
a && a(e);
|
|
376
|
-
}, [a]), { error:
|
|
377
|
-
onPreferencesLoaded:
|
|
375
|
+
}, [a]), { error: m } = oe({
|
|
376
|
+
onPreferencesLoaded: b,
|
|
378
377
|
onError: T
|
|
379
378
|
}), { workflows: E, isLoading: N } = ae(), { updatePreference: v, isSaving: _, error: K } = ee({
|
|
380
|
-
preferences:
|
|
381
|
-
onPreferencesChange:
|
|
379
|
+
preferences: o.preferences,
|
|
380
|
+
onPreferencesChange: b,
|
|
382
381
|
onError: T
|
|
383
382
|
});
|
|
384
|
-
|
|
383
|
+
y(() => {
|
|
385
384
|
if (!N && E.length > 0) {
|
|
386
|
-
const e = E.map((
|
|
387
|
-
workflowId:
|
|
388
|
-
name:
|
|
385
|
+
const e = E.map((i) => o.preferences.subscriptions.find((I) => I.workflowId === i.workflowId) || {
|
|
386
|
+
workflowId: i.workflowId,
|
|
387
|
+
name: i.name,
|
|
389
388
|
enabled: !0,
|
|
390
389
|
// Default to enabled
|
|
391
390
|
channels: {
|
|
@@ -395,24 +394,24 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
395
394
|
inApp: !0
|
|
396
395
|
}
|
|
397
396
|
});
|
|
398
|
-
JSON.stringify(e) !== JSON.stringify(
|
|
397
|
+
JSON.stringify(e) !== JSON.stringify(o.preferences.subscriptions) && n({
|
|
399
398
|
type: "SET_PREFERENCES",
|
|
400
399
|
payload: {
|
|
401
|
-
...
|
|
400
|
+
...o.preferences,
|
|
402
401
|
subscriptions: e
|
|
403
402
|
}
|
|
404
403
|
});
|
|
405
404
|
}
|
|
406
|
-
}, [E, N,
|
|
407
|
-
const A =
|
|
405
|
+
}, [E, N, o.preferences]);
|
|
406
|
+
const A = g((e) => {
|
|
408
407
|
try {
|
|
409
|
-
const
|
|
408
|
+
const i = D();
|
|
410
409
|
switch (e.type) {
|
|
411
410
|
case "notification_received": {
|
|
412
411
|
const c = e.data;
|
|
413
|
-
if (!
|
|
412
|
+
if (!i.validateWebSocketPayload(c))
|
|
414
413
|
break;
|
|
415
|
-
const I =
|
|
414
|
+
const I = i.toWidgetNotificationFromWebSocket(c);
|
|
416
415
|
n({
|
|
417
416
|
type: "ADD_NOTIFICATION",
|
|
418
417
|
payload: I
|
|
@@ -444,7 +443,7 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
444
443
|
}
|
|
445
444
|
} catch {
|
|
446
445
|
}
|
|
447
|
-
}, []),
|
|
446
|
+
}, []), R = g(async () => {
|
|
448
447
|
if (!(!s || !f || u.current))
|
|
449
448
|
try {
|
|
450
449
|
n({
|
|
@@ -499,7 +498,7 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
499
498
|
payload: { connected: !1, reconnecting: !1 }
|
|
500
499
|
}), a && a(e);
|
|
501
500
|
}
|
|
502
|
-
}, [s, f, A, a]), F =
|
|
501
|
+
}, [s, f, A, a]), F = g(() => {
|
|
503
502
|
if (u.current)
|
|
504
503
|
try {
|
|
505
504
|
u.current.disconnect && u.current.disconnect(), u.current = null, n({
|
|
@@ -508,22 +507,22 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
508
507
|
});
|
|
509
508
|
} catch {
|
|
510
509
|
}
|
|
511
|
-
}, []), P =
|
|
510
|
+
}, []), P = g(() => {
|
|
512
511
|
n({
|
|
513
512
|
type: "SET_UI_STATE",
|
|
514
|
-
payload: { isOpen: !
|
|
513
|
+
payload: { isOpen: !o.ui.isOpen }
|
|
515
514
|
});
|
|
516
|
-
}, [
|
|
515
|
+
}, [o.ui.isOpen]), U = g(() => {
|
|
517
516
|
n({
|
|
518
517
|
type: "SET_UI_STATE",
|
|
519
518
|
payload: { isOpen: !1 }
|
|
520
519
|
});
|
|
521
|
-
}, []), L =
|
|
520
|
+
}, []), L = g((e) => {
|
|
522
521
|
n({
|
|
523
522
|
type: "SET_UI_STATE",
|
|
524
523
|
payload: { currentView: e }
|
|
525
524
|
});
|
|
526
|
-
}, []), B =
|
|
525
|
+
}, []), B = g(async (e, i) => {
|
|
527
526
|
if (!s || !f)
|
|
528
527
|
return;
|
|
529
528
|
const c = window.__notificationSDK?.config;
|
|
@@ -531,7 +530,7 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
531
530
|
if (!e)
|
|
532
531
|
throw new Error("notificationId is required");
|
|
533
532
|
try {
|
|
534
|
-
switch (
|
|
533
|
+
switch (i.type) {
|
|
535
534
|
case "mark_read":
|
|
536
535
|
await s.inbox.markAsRead(e, c.tenantId, c.environmentId, c.subscriberId);
|
|
537
536
|
break;
|
|
@@ -545,10 +544,10 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
545
544
|
await s.inbox.delete(e, c.tenantId, c.environmentId, c.subscriberId);
|
|
546
545
|
break;
|
|
547
546
|
default:
|
|
548
|
-
|
|
547
|
+
i.handler && await i.handler(e);
|
|
549
548
|
break;
|
|
550
549
|
}
|
|
551
|
-
switch (
|
|
550
|
+
switch (i.type) {
|
|
552
551
|
case "mark_read":
|
|
553
552
|
n({
|
|
554
553
|
type: "UPDATE_NOTIFICATION",
|
|
@@ -579,7 +578,7 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
579
578
|
}
|
|
580
579
|
}
|
|
581
580
|
}, [s]);
|
|
582
|
-
return
|
|
581
|
+
return y(() => {
|
|
583
582
|
if (!s || !f) return;
|
|
584
583
|
(async () => {
|
|
585
584
|
try {
|
|
@@ -587,18 +586,18 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
587
586
|
type: "SET_UI_STATE",
|
|
588
587
|
payload: { isLoading: !0 }
|
|
589
588
|
});
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
589
|
+
const i = window.__notificationSDK?.config;
|
|
590
|
+
if (!i)
|
|
592
591
|
throw new Error("SDK configuration not available");
|
|
593
|
-
const c =
|
|
592
|
+
const c = D(), h = ((await s.inbox.getRenderedNotifications(
|
|
594
593
|
{
|
|
595
594
|
channel: "in_app",
|
|
596
595
|
limit: 50,
|
|
597
596
|
offset: 0
|
|
598
597
|
},
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
598
|
+
i.tenantId,
|
|
599
|
+
i.environmentId,
|
|
600
|
+
i.subscriberId
|
|
602
601
|
))?.items || []).map(
|
|
603
602
|
(S) => c.toWidgetNotification(S)
|
|
604
603
|
);
|
|
@@ -609,34 +608,34 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
609
608
|
type: "SET_UI_STATE",
|
|
610
609
|
payload: { isLoading: !1, error: null }
|
|
611
610
|
});
|
|
612
|
-
} catch (
|
|
611
|
+
} catch (i) {
|
|
613
612
|
n({
|
|
614
613
|
type: "SET_UI_STATE",
|
|
615
614
|
payload: {
|
|
616
615
|
isLoading: !1,
|
|
617
|
-
error:
|
|
616
|
+
error: i
|
|
618
617
|
}
|
|
619
|
-
}), a && a(
|
|
618
|
+
}), a && a(i);
|
|
620
619
|
}
|
|
621
620
|
})();
|
|
622
|
-
}, [s, f, a]),
|
|
621
|
+
}, [s, f, a]), y(() => (s && f && R(), () => {
|
|
623
622
|
F();
|
|
624
|
-
}), [s]),
|
|
625
|
-
if (!s || !f ||
|
|
623
|
+
}), [s]), y(() => {
|
|
624
|
+
if (!s || !f || o.websocket.connected) return;
|
|
626
625
|
const e = setInterval(async () => {
|
|
627
626
|
try {
|
|
628
|
-
const
|
|
629
|
-
if (!
|
|
627
|
+
const i = window.__notificationSDK?.config;
|
|
628
|
+
if (!i)
|
|
630
629
|
return;
|
|
631
|
-
const c =
|
|
630
|
+
const c = D(), h = ((await s.inbox.getRenderedNotifications(
|
|
632
631
|
{
|
|
633
632
|
channel: "in_app",
|
|
634
633
|
limit: 50,
|
|
635
634
|
offset: 0
|
|
636
635
|
},
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
636
|
+
i.tenantId,
|
|
637
|
+
i.environmentId,
|
|
638
|
+
i.subscriberId
|
|
640
639
|
))?.items || []).map(
|
|
641
640
|
(S) => c.toWidgetNotification(S)
|
|
642
641
|
);
|
|
@@ -648,36 +647,37 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
648
647
|
}
|
|
649
648
|
}, 3e4);
|
|
650
649
|
return () => clearInterval(e);
|
|
651
|
-
}, [s,
|
|
652
|
-
const e = (
|
|
653
|
-
if (
|
|
650
|
+
}, [s, o.websocket.connected]), y(() => {
|
|
651
|
+
const e = (i) => {
|
|
652
|
+
if (i.key === "notification_widget_sync" && i.newValue)
|
|
654
653
|
try {
|
|
655
|
-
const c = JSON.parse(
|
|
654
|
+
const c = JSON.parse(i.newValue);
|
|
656
655
|
A(c);
|
|
657
656
|
} catch {
|
|
658
657
|
}
|
|
659
658
|
};
|
|
660
659
|
return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
|
|
661
|
-
}, [A]),
|
|
660
|
+
}, [A]), y(() => {
|
|
662
661
|
n({
|
|
663
662
|
type: "SET_UI_STATE",
|
|
664
663
|
payload: { isLoading: _ }
|
|
665
664
|
});
|
|
666
|
-
}, [_]),
|
|
667
|
-
const e =
|
|
665
|
+
}, [_]), y(() => {
|
|
666
|
+
const e = w || K || m;
|
|
668
667
|
e && n({
|
|
669
668
|
type: "SET_UI_STATE",
|
|
670
669
|
payload: { error: e }
|
|
671
670
|
});
|
|
672
|
-
}, [
|
|
671
|
+
}, [w, K, m]), !f && !w ? /* @__PURE__ */ d(
|
|
673
672
|
"div",
|
|
674
673
|
{
|
|
675
|
-
className: `relative inline-block ${p}`,
|
|
674
|
+
className: `mx-widget-root relative inline-block ${p}`,
|
|
675
|
+
"data-mx-widget": "root",
|
|
676
676
|
"data-widget-size": r || "small",
|
|
677
677
|
"data-theme": l,
|
|
678
678
|
"data-testid": "notification-widget",
|
|
679
679
|
children: /* @__PURE__ */ d(O, { componentName: "BellComponent", children: /* @__PURE__ */ d(
|
|
680
|
-
|
|
680
|
+
x,
|
|
681
681
|
{
|
|
682
682
|
unreadCount: 0,
|
|
683
683
|
onClick: () => {
|
|
@@ -687,10 +687,11 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
687
687
|
}
|
|
688
688
|
) })
|
|
689
689
|
}
|
|
690
|
-
) :
|
|
690
|
+
) : w ? /* @__PURE__ */ d(
|
|
691
691
|
"div",
|
|
692
692
|
{
|
|
693
|
-
className: `relative inline-block ${p}`,
|
|
693
|
+
className: `mx-widget-root relative inline-block ${p}`,
|
|
694
|
+
"data-mx-widget": "root",
|
|
694
695
|
"data-widget-size": r || "small",
|
|
695
696
|
"data-theme": l,
|
|
696
697
|
"data-testid": "notification-widget",
|
|
@@ -701,12 +702,12 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
701
702
|
fallback: /* @__PURE__ */ d(
|
|
702
703
|
X,
|
|
703
704
|
{
|
|
704
|
-
error:
|
|
705
|
+
error: w.message,
|
|
705
706
|
onRetry: () => window.location.reload()
|
|
706
707
|
}
|
|
707
708
|
),
|
|
708
709
|
children: /* @__PURE__ */ d(
|
|
709
|
-
|
|
710
|
+
x,
|
|
710
711
|
{
|
|
711
712
|
unreadCount: 0,
|
|
712
713
|
onClick: () => {
|
|
@@ -721,18 +722,19 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
721
722
|
) : /* @__PURE__ */ k(
|
|
722
723
|
"div",
|
|
723
724
|
{
|
|
724
|
-
className: `relative inline-block ${p}`,
|
|
725
|
+
className: `mx-widget-root relative inline-block ${p}`,
|
|
726
|
+
"data-mx-widget": "root",
|
|
725
727
|
"data-widget-size": r || "small",
|
|
726
728
|
"data-theme": l,
|
|
727
729
|
"data-testid": "notification-widget",
|
|
728
730
|
children: [
|
|
729
731
|
/* @__PURE__ */ d(O, { componentName: "BellComponent", children: /* @__PURE__ */ d(
|
|
730
|
-
|
|
732
|
+
x,
|
|
731
733
|
{
|
|
732
|
-
unreadCount:
|
|
734
|
+
unreadCount: o.unreadCount,
|
|
733
735
|
onClick: P,
|
|
734
736
|
size: r,
|
|
735
|
-
disabled:
|
|
737
|
+
disabled: o.ui.isLoading
|
|
736
738
|
}
|
|
737
739
|
) }),
|
|
738
740
|
/* @__PURE__ */ d(
|
|
@@ -743,14 +745,14 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
743
745
|
children: /* @__PURE__ */ d(
|
|
744
746
|
Y,
|
|
745
747
|
{
|
|
746
|
-
isOpen:
|
|
748
|
+
isOpen: o.ui.isOpen,
|
|
747
749
|
onClose: U,
|
|
748
750
|
position: t,
|
|
749
|
-
currentView:
|
|
751
|
+
currentView: o.ui.currentView,
|
|
750
752
|
onViewChange: L,
|
|
751
|
-
notifications:
|
|
753
|
+
notifications: o.notifications,
|
|
752
754
|
onNotificationAction: B,
|
|
753
|
-
preferences:
|
|
755
|
+
preferences: o.preferences,
|
|
754
756
|
onPreferenceChange: v,
|
|
755
757
|
isPreferencesLoading: _
|
|
756
758
|
}
|
|
@@ -760,18 +762,18 @@ const re = () => window.__notificationSDK?.client, ie = ({
|
|
|
760
762
|
]
|
|
761
763
|
}
|
|
762
764
|
);
|
|
763
|
-
},
|
|
765
|
+
}, ge = ({
|
|
764
766
|
sdkConfig: t,
|
|
765
767
|
...r
|
|
766
|
-
}) => /* @__PURE__ */ d(ne, { onError: r.onError, children: /* @__PURE__ */ d(de, { config: t, children: /* @__PURE__ */ d(fe, { ...r }) }) }),
|
|
768
|
+
}) => /* @__PURE__ */ d(ne, { onError: r.onError, children: /* @__PURE__ */ d(de, { config: t, children: /* @__PURE__ */ d(fe, { ...r }) }) }), ye = "3.0.0", be = "@edusight/notification-widget";
|
|
767
769
|
export {
|
|
768
|
-
|
|
770
|
+
x as BellComponent,
|
|
769
771
|
Y as InboxPopover,
|
|
770
772
|
Te as NotificationItem,
|
|
771
|
-
|
|
773
|
+
ge as NotificationWidget,
|
|
772
774
|
ne as NotificationWidgetErrorBoundary,
|
|
773
775
|
_e as PreferencesView,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
+
ye as VERSION,
|
|
777
|
+
be as WIDGET_NAME
|
|
776
778
|
};
|
|
777
779
|
//# sourceMappingURL=index.esm.js.map
|