@notificationapi/react 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Badge.js +60 -64
- package/dist/assets/Box.js +26 -24
- package/dist/assets/Button.js +22 -19
- package/dist/assets/ButtonBase.js +193 -185
- package/dist/assets/DefaultPropsProvider.js +416 -4199
- package/dist/assets/DefaultPropsProvider2.js +992 -0
- package/dist/assets/Divider.js +22 -18
- package/dist/assets/GlobalStyles.js +23 -0
- package/dist/assets/Grow.js +1513 -120
- package/dist/assets/IconButton.js +8 -7
- package/dist/assets/List.js +12 -11
- package/dist/assets/Modal.js +18 -17
- package/dist/assets/Notification.js +787 -770
- package/dist/assets/Paper.js +8 -8
- package/dist/assets/Popover.js +37 -36
- package/dist/assets/Portal.js +39 -49
- package/dist/assets/Stack.js +32 -30
- package/dist/assets/Typography.js +84 -97
- package/dist/assets/createSvgIcon.js +25 -24
- package/dist/assets/createTheme.js +2828 -0
- package/dist/assets/exactProp.js +13 -0
- package/dist/assets/index.js +19 -148
- package/dist/assets/index2.js +151 -0
- package/dist/assets/useControlled.js +49 -0
- package/dist/assets/usePreviousProps.js +10 -0
- package/dist/assets/useTheme.js +6 -7
- package/dist/assets/{useTheme2.js → useThemeWithoutDefault.js} +63 -67
- package/dist/assets/utils.js +4 -4
- package/dist/components/Notifications/Inbox.js +593 -583
- package/dist/components/Notifications/InboxHeader.js +360 -1754
- package/dist/components/Notifications/Notification.js +4 -2
- package/dist/components/Notifications/NotificationFeed.js +40 -32
- package/dist/components/Notifications/NotificationLauncher.js +90 -64
- package/dist/components/Notifications/NotificationPopup.js +76 -65
- package/dist/components/Preferences/NotificationPreferencesInline.js +57 -39
- package/dist/components/Preferences/NotificationPreferencesPopup.js +111 -99
- package/dist/components/Preferences/PreferenceInput.js +427 -414
- package/dist/components/Preferences/Preferences.js +329 -278
- package/dist/components/Provider/index.d.ts +2 -0
- package/dist/components/Provider/index.js +1008 -401
- package/dist/components/Slack/SlackConnect.js +4627 -2024
- package/dist/main.d.ts +2 -0
- package/dist/main.js +6 -3
- package/dist/utils/theme.d.ts +17 -0
- package/dist/utils/theme.js +104 -0
- package/package.json +1 -1
- package/dist/assets/dividerClasses.js +0 -56
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { N as
|
|
2
|
+
import { N as c } from "../../assets/Notification.js";
|
|
3
3
|
import "../../assets/DefaultPropsProvider.js";
|
|
4
|
+
import "../../utils/theme.js";
|
|
5
|
+
import "../../assets/ButtonBase.js";
|
|
4
6
|
import "../../assets/Typography.js";
|
|
5
7
|
import "../../assets/IconButton.js";
|
|
6
8
|
import "../../assets/Badge.js";
|
|
7
9
|
export {
|
|
8
|
-
|
|
10
|
+
c as Notification
|
|
9
11
|
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Inbox as
|
|
4
|
-
import { NotificationAPIContext as
|
|
5
|
-
import { NotificationPreferencesPopup as
|
|
6
|
-
import { Filter as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { jsx as n, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useContext as u, useEffect as p } from "react";
|
|
3
|
+
import { Inbox as x } from "./Inbox.js";
|
|
4
|
+
import { NotificationAPIContext as b } from "../Provider/context.js";
|
|
5
|
+
import { NotificationPreferencesPopup as S } from "../Preferences/NotificationPreferencesPopup.js";
|
|
6
|
+
import { Filter as C } from "./interface.js";
|
|
7
|
+
import { getThemeColors as I } from "../../utils/theme.js";
|
|
8
|
+
import { W as H } from "../../assets/WebPushOptInMessage.js";
|
|
9
|
+
import { c as P } from "../../assets/createSvgIcon.js";
|
|
10
|
+
import { u as y } from "../../assets/ButtonBase.js";
|
|
11
|
+
import { D as v } from "../../assets/Divider.js";
|
|
12
|
+
const M = P(/* @__PURE__ */ n("path", {
|
|
11
13
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2s.07-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"
|
|
12
|
-
}), "Language"),
|
|
13
|
-
var a,
|
|
14
|
-
const [
|
|
15
|
-
if (
|
|
14
|
+
}), "Language"), R = (e) => {
|
|
15
|
+
var a, c, s, l;
|
|
16
|
+
const [m, o] = h(!1), i = u(b), g = y(), r = I(g);
|
|
17
|
+
if (p(() => {
|
|
16
18
|
if (!i) return;
|
|
17
19
|
i.markAsOpened();
|
|
18
|
-
const
|
|
20
|
+
const d = setInterval(() => {
|
|
19
21
|
i.markAsOpened();
|
|
20
22
|
}, 5e3);
|
|
21
|
-
return () => clearInterval(
|
|
23
|
+
return () => clearInterval(d);
|
|
22
24
|
}, [i]), !i)
|
|
23
25
|
return null;
|
|
24
26
|
const t = {
|
|
@@ -26,33 +28,34 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
26
28
|
pageSize: e.pageSize || 5,
|
|
27
29
|
pagePosition: e.pagePosition || "top",
|
|
28
30
|
style: e.style || {},
|
|
29
|
-
filter: e.filter ||
|
|
31
|
+
filter: e.filter || C.ALL,
|
|
30
32
|
infiniteScrollHeight: e.infiniteScrollHeight ? e.infiniteScrollHeight : window.innerHeight * 0.75,
|
|
31
33
|
renderers: {
|
|
32
34
|
notification: (a = e.renderers) == null ? void 0 : a.notification
|
|
33
35
|
},
|
|
34
36
|
header: {
|
|
35
|
-
title: (
|
|
36
|
-
button1ClickHandler: ((
|
|
37
|
-
button2ClickHandler: ((l = e.header) == null ? void 0 : l.button2ClickHandler) ?? (() =>
|
|
37
|
+
title: (c = e.header) == null ? void 0 : c.title,
|
|
38
|
+
button1ClickHandler: ((s = e.header) == null ? void 0 : s.button1ClickHandler) ?? i.markAsArchived,
|
|
39
|
+
button2ClickHandler: ((l = e.header) == null ? void 0 : l.button2ClickHandler) ?? (() => o(!0))
|
|
38
40
|
},
|
|
39
41
|
imageShape: e.imageShape || "circle",
|
|
40
42
|
newTab: e.newTab ?? !1
|
|
41
43
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ f(
|
|
43
45
|
"div",
|
|
44
46
|
{
|
|
45
47
|
style: {
|
|
46
48
|
padding: "0 12px",
|
|
47
49
|
boxSizing: "border-box",
|
|
48
50
|
borderRadius: 8,
|
|
49
|
-
background:
|
|
50
|
-
border:
|
|
51
|
+
background: r.paper,
|
|
52
|
+
border: `1px solid ${r.border}`,
|
|
53
|
+
color: r.text,
|
|
51
54
|
...e.style
|
|
52
55
|
},
|
|
53
56
|
children: [
|
|
54
57
|
/* @__PURE__ */ n(
|
|
55
|
-
|
|
58
|
+
x,
|
|
56
59
|
{
|
|
57
60
|
maxHeight: t.infiniteScrollHeight,
|
|
58
61
|
pagination: t.pagination,
|
|
@@ -65,13 +68,18 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
65
68
|
newTab: t.newTab
|
|
66
69
|
}
|
|
67
70
|
),
|
|
68
|
-
i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ n(I, { style: { margin: "10px 0" } }),
|
|
71
|
+
i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ f("div", { children: [
|
|
70
72
|
/* @__PURE__ */ n(
|
|
71
|
-
|
|
73
|
+
v,
|
|
74
|
+
{
|
|
75
|
+
style: { margin: "10px 0", borderColor: r.divider }
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ n(
|
|
79
|
+
H,
|
|
72
80
|
{
|
|
73
81
|
hideAfterInteraction: !0,
|
|
74
|
-
icon: /* @__PURE__ */ n(
|
|
82
|
+
icon: /* @__PURE__ */ n(M, { type: "text", style: { marginLeft: "9px" } }),
|
|
75
83
|
descriptionStyle: {
|
|
76
84
|
flexDirection: "column",
|
|
77
85
|
// Stack the elements vertically
|
|
@@ -93,10 +101,10 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
93
101
|
)
|
|
94
102
|
] }),
|
|
95
103
|
/* @__PURE__ */ n(
|
|
96
|
-
|
|
104
|
+
S,
|
|
97
105
|
{
|
|
98
|
-
open:
|
|
99
|
-
onClose: () =>
|
|
106
|
+
open: m,
|
|
107
|
+
onClose: () => o(!1)
|
|
100
108
|
}
|
|
101
109
|
)
|
|
102
110
|
]
|
|
@@ -104,5 +112,5 @@ const H = C(/* @__PURE__ */ n("path", {
|
|
|
104
112
|
);
|
|
105
113
|
};
|
|
106
114
|
export {
|
|
107
|
-
|
|
115
|
+
R as NotificationFeed
|
|
108
116
|
};
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Inbox as
|
|
4
|
-
import { UnreadBadge as
|
|
5
|
-
import { NotificationAPIContext as
|
|
6
|
-
import { NotificationPreferencesPopup as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useContext as y } from "react";
|
|
3
|
+
import { Inbox as z } from "./Inbox.js";
|
|
4
|
+
import { UnreadBadge as T } from "./UnreadBadge.js";
|
|
5
|
+
import { NotificationAPIContext as N } from "../Provider/context.js";
|
|
6
|
+
import { NotificationPreferencesPopup as k } from "../Preferences/NotificationPreferencesPopup.js";
|
|
7
|
+
import { getThemeColors as v } from "../../utils/theme.js";
|
|
8
|
+
import { W as H, L as A } from "../../assets/WebPushOptInMessage.js";
|
|
9
|
+
import { u as L } from "../../assets/ButtonBase.js";
|
|
10
|
+
import { N as w } from "../../assets/channelUtils.js";
|
|
11
|
+
import { I as W } from "../../assets/IconButton.js";
|
|
12
|
+
import { P as B } from "../../assets/Popover.js";
|
|
13
|
+
import { D as E } from "../../assets/Divider.js";
|
|
14
|
+
const K = (e) => {
|
|
15
|
+
var f, u, h, p, g, m, b, I;
|
|
16
|
+
const [x, d] = c(!1), [r, s] = c(!1), i = y(N), [C, P] = c(null), O = L(), n = v(O);
|
|
17
|
+
if (!i)
|
|
16
18
|
return null;
|
|
17
19
|
const t = {
|
|
18
20
|
buttonIcon: e.buttonIcon || /* @__PURE__ */ o(
|
|
19
|
-
|
|
21
|
+
w,
|
|
20
22
|
{
|
|
21
23
|
style: {
|
|
22
24
|
fontSize: e.buttonIconSize || 20,
|
|
23
|
-
color: e.iconColor ||
|
|
25
|
+
color: e.iconColor || n.icon
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
),
|
|
@@ -32,7 +34,7 @@ const j = (e) => {
|
|
|
32
34
|
popupWidth: e.popupWidth || 400,
|
|
33
35
|
popupHeight: e.popupHeight || 600,
|
|
34
36
|
buttonIconSize: e.buttonIconSize || 20,
|
|
35
|
-
iconColor: e.iconColor ||
|
|
37
|
+
iconColor: e.iconColor || n.icon,
|
|
36
38
|
pagination: e.pagination || "INFINITE_SCROLL",
|
|
37
39
|
pageSize: e.pageSize || 10,
|
|
38
40
|
pagePosition: e.pagePosition || "top",
|
|
@@ -44,24 +46,24 @@ const j = (e) => {
|
|
|
44
46
|
count: e.count || "COUNT_UNOPENED_NOTIFICATIONS",
|
|
45
47
|
filter: e.filter || "ALL",
|
|
46
48
|
header: {
|
|
47
|
-
title: (
|
|
48
|
-
button1ClickHandler: ((
|
|
49
|
-
button2ClickHandler: ((
|
|
49
|
+
title: (f = e.header) == null ? void 0 : f.title,
|
|
50
|
+
button1ClickHandler: ((u = e.header) == null ? void 0 : u.button1ClickHandler) ?? i.markAsArchived,
|
|
51
|
+
button2ClickHandler: ((h = e.header) == null ? void 0 : h.button2ClickHandler) ?? (() => d(!0))
|
|
50
52
|
},
|
|
51
53
|
renderers: {
|
|
52
|
-
notification: (
|
|
54
|
+
notification: (p = e.renderers) == null ? void 0 : p.notification
|
|
53
55
|
},
|
|
54
56
|
popoverPosition: {
|
|
55
57
|
anchorOrigin: {
|
|
56
58
|
vertical: ((m = (g = e.popoverPosition) == null ? void 0 : g.anchorOrigin) == null ? void 0 : m.vertical) ?? "top",
|
|
57
|
-
horizontal: ((
|
|
59
|
+
horizontal: ((I = (b = e.popoverPosition) == null ? void 0 : b.anchorOrigin) == null ? void 0 : I.horizontal) ?? "left"
|
|
58
60
|
}
|
|
59
61
|
},
|
|
60
62
|
newTab: e.newTab ?? !1
|
|
61
|
-
},
|
|
62
|
-
s(!
|
|
63
|
+
}, S = (a) => {
|
|
64
|
+
s(!r), P(a == null ? void 0 : a.currentTarget), r && i.markAsOpened();
|
|
63
65
|
};
|
|
64
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ l(
|
|
65
67
|
"div",
|
|
66
68
|
{
|
|
67
69
|
style: {
|
|
@@ -77,14 +79,14 @@ const j = (e) => {
|
|
|
77
79
|
style: {
|
|
78
80
|
display: "inline-block"
|
|
79
81
|
},
|
|
80
|
-
children: /* @__PURE__ */ o(
|
|
82
|
+
children: /* @__PURE__ */ o(T, { ...e.unreadBadgeProps, count: t.count, children: /* @__PURE__ */ o(W, { style: t.buttonStyles, onClick: S, children: t.buttonIcon }) })
|
|
81
83
|
}
|
|
82
84
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
+
/* @__PURE__ */ o(
|
|
86
|
+
B,
|
|
85
87
|
{
|
|
86
|
-
open:
|
|
87
|
-
anchorEl:
|
|
88
|
+
open: r,
|
|
89
|
+
anchorEl: C,
|
|
88
90
|
anchorReference: "anchorEl",
|
|
89
91
|
anchorOrigin: {
|
|
90
92
|
horizontal: "center",
|
|
@@ -98,45 +100,69 @@ const j = (e) => {
|
|
|
98
100
|
slotProps: {
|
|
99
101
|
paper: {
|
|
100
102
|
style: {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
borderRadius: 8,
|
|
104
|
+
backgroundColor: n.paper,
|
|
105
|
+
color: n.text
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
},
|
|
107
|
-
children:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
109
|
+
children: /* @__PURE__ */ l(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
style: {
|
|
113
|
+
width: t.popupWidth,
|
|
114
|
+
padding: "0 16px",
|
|
115
|
+
zIndex: t.popupZIndex,
|
|
116
|
+
height: t.popupHeight,
|
|
117
|
+
backgroundColor: n.paper,
|
|
118
|
+
color: n.text
|
|
119
|
+
},
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ o(
|
|
122
|
+
z,
|
|
123
|
+
{
|
|
124
|
+
maxHeight: t.popupHeight - 73,
|
|
125
|
+
pagination: t.pagination,
|
|
126
|
+
filter: t.filter,
|
|
127
|
+
pageSize: t.pageSize,
|
|
128
|
+
pagePosition: t.pagePosition,
|
|
129
|
+
notificationRenderer: t.renderers.notification,
|
|
130
|
+
header: t.header,
|
|
131
|
+
newTab: t.newTab
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ l("div", { children: [
|
|
135
|
+
/* @__PURE__ */ o(
|
|
136
|
+
E,
|
|
137
|
+
{
|
|
138
|
+
style: { margin: "10px 0", borderColor: n.divider }
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ o(
|
|
142
|
+
H,
|
|
143
|
+
{
|
|
144
|
+
hideAfterInteraction: !0,
|
|
145
|
+
icon: /* @__PURE__ */ o(
|
|
146
|
+
A,
|
|
147
|
+
{
|
|
148
|
+
type: "text",
|
|
149
|
+
style: { marginLeft: "9px" }
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
alertContainerStyle: { maxWidth: "345px" }
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] })
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
)
|
|
133
159
|
}
|
|
134
160
|
),
|
|
135
161
|
/* @__PURE__ */ o(
|
|
136
|
-
|
|
162
|
+
k,
|
|
137
163
|
{
|
|
138
|
-
open:
|
|
139
|
-
onClose: () =>
|
|
164
|
+
open: x,
|
|
165
|
+
onClose: () => d(!1)
|
|
140
166
|
}
|
|
141
167
|
)
|
|
142
168
|
]
|
|
@@ -144,5 +170,5 @@ const j = (e) => {
|
|
|
144
170
|
);
|
|
145
171
|
};
|
|
146
172
|
export {
|
|
147
|
-
|
|
173
|
+
K as NotificationLauncher
|
|
148
174
|
};
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Inbox as
|
|
4
|
-
import { UnreadBadge as
|
|
5
|
-
import { NotificationAPIContext as
|
|
6
|
-
import { NotificationPreferencesPopup as
|
|
7
|
-
import { Filter as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx as t, jsxs as a, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useContext as S } from "react";
|
|
3
|
+
import { Inbox as v } from "./Inbox.js";
|
|
4
|
+
import { UnreadBadge as N } from "./UnreadBadge.js";
|
|
5
|
+
import { NotificationAPIContext as k } from "../Provider/context.js";
|
|
6
|
+
import { NotificationPreferencesPopup as z } from "../Preferences/NotificationPreferencesPopup.js";
|
|
7
|
+
import { Filter as T } from "./interface.js";
|
|
8
|
+
import { getThemeColors as y } from "../../utils/theme.js";
|
|
9
|
+
import { W as H } from "../../assets/WebPushOptInMessage.js";
|
|
10
|
+
import { N as A } from "../../assets/channelUtils.js";
|
|
11
|
+
import { u as w } from "../../assets/ButtonBase.js";
|
|
12
|
+
import { I as B } from "../../assets/IconButton.js";
|
|
13
|
+
import { P as W } from "../../assets/Popover.js";
|
|
14
|
+
import { D as E } from "../../assets/Divider.js";
|
|
15
|
+
const V = (e) => {
|
|
16
|
+
var d, u, h, s, p, g, f, m;
|
|
17
|
+
const [I, l] = b(!1), [r, c] = b(null), i = S(k), P = w(), n = y(P);
|
|
18
|
+
if (!i)
|
|
17
19
|
return null;
|
|
18
|
-
const
|
|
19
|
-
buttonIcon: e.buttonIcon || /* @__PURE__ */
|
|
20
|
-
|
|
20
|
+
const o = {
|
|
21
|
+
buttonIcon: e.buttonIcon || /* @__PURE__ */ t(
|
|
22
|
+
A,
|
|
21
23
|
{
|
|
22
24
|
style: {
|
|
23
25
|
fontSize: e.buttonIconSize || 20,
|
|
24
|
-
color: e.iconColor ||
|
|
26
|
+
color: e.iconColor || n.icon
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
),
|
|
@@ -33,106 +35,115 @@ const j = (e) => {
|
|
|
33
35
|
popupWidth: e.popupWidth || 400,
|
|
34
36
|
popupHeight: e.popupHeight || 600,
|
|
35
37
|
buttonIconSize: e.buttonIconSize || 20,
|
|
36
|
-
iconColor: e.iconColor ||
|
|
38
|
+
iconColor: e.iconColor || n.icon,
|
|
37
39
|
pagination: e.pagination || "INFINITE_SCROLL",
|
|
38
40
|
pageSize: e.pageSize || 10,
|
|
39
41
|
pagePosition: e.pagePosition || "bottom",
|
|
40
42
|
popupZIndex: e.popupZIndex || 1030,
|
|
41
43
|
unreadBadgeProps: e.unreadBadgeProps ?? {},
|
|
42
44
|
count: e.count || "COUNT_UNOPENED_NOTIFICATIONS",
|
|
43
|
-
filter: e.filter ||
|
|
45
|
+
filter: e.filter || T.ALL,
|
|
44
46
|
header: {
|
|
45
|
-
title: (
|
|
46
|
-
button1ClickHandler: ((
|
|
47
|
-
button2ClickHandler: ((
|
|
47
|
+
title: (d = e.header) == null ? void 0 : d.title,
|
|
48
|
+
button1ClickHandler: ((u = e.header) == null ? void 0 : u.button1ClickHandler) ?? i.markAsArchived,
|
|
49
|
+
button2ClickHandler: ((h = e.header) == null ? void 0 : h.button2ClickHandler) ?? (() => l(!0))
|
|
48
50
|
},
|
|
49
51
|
renderers: {
|
|
50
|
-
notification: (
|
|
52
|
+
notification: (s = e.renderers) == null ? void 0 : s.notification
|
|
51
53
|
},
|
|
52
54
|
popoverPosition: {
|
|
53
55
|
anchorOrigin: {
|
|
54
|
-
vertical: ((
|
|
55
|
-
horizontal: ((
|
|
56
|
+
vertical: ((g = (p = e.popoverPosition) == null ? void 0 : p.anchorOrigin) == null ? void 0 : g.vertical) ?? "top",
|
|
57
|
+
horizontal: ((m = (f = e.popoverPosition) == null ? void 0 : f.anchorOrigin) == null ? void 0 : m.horizontal) ?? "left"
|
|
56
58
|
}
|
|
57
59
|
},
|
|
58
60
|
newTab: e.newTab ?? !1
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
+
}, C = (x) => {
|
|
62
|
+
c(x.currentTarget), i.markAsOpened();
|
|
61
63
|
};
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ a(O, { children: [
|
|
65
|
+
/* @__PURE__ */ t(
|
|
64
66
|
"div",
|
|
65
67
|
{
|
|
66
68
|
style: {
|
|
67
69
|
display: "inline-block"
|
|
68
70
|
},
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
|
|
71
|
+
children: /* @__PURE__ */ t(
|
|
72
|
+
N,
|
|
71
73
|
{
|
|
72
74
|
...e.unreadBadgeProps,
|
|
73
|
-
count:
|
|
74
|
-
filter:
|
|
75
|
-
children: /* @__PURE__ */
|
|
75
|
+
count: o.count,
|
|
76
|
+
filter: o.filter,
|
|
77
|
+
children: /* @__PURE__ */ t(B, { onClick: C, style: o.buttonStyles, children: o.buttonIcon })
|
|
76
78
|
}
|
|
77
79
|
)
|
|
78
80
|
}
|
|
79
81
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
|
+
W,
|
|
82
84
|
{
|
|
83
|
-
open: !!
|
|
84
|
-
onClose: () =>
|
|
85
|
-
anchorEl:
|
|
85
|
+
open: !!r,
|
|
86
|
+
onClose: () => c(null),
|
|
87
|
+
anchorEl: r,
|
|
86
88
|
slotProps: {
|
|
87
89
|
paper: {
|
|
88
90
|
style: {
|
|
89
|
-
borderRadius: 8
|
|
91
|
+
borderRadius: 8,
|
|
92
|
+
backgroundColor: n.paper,
|
|
93
|
+
color: n.text
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
},
|
|
93
|
-
"aria-hidden": !
|
|
94
|
-
anchorOrigin:
|
|
95
|
-
children: /* @__PURE__ */
|
|
97
|
+
"aria-hidden": !r,
|
|
98
|
+
anchorOrigin: o.popoverPosition.anchorOrigin,
|
|
99
|
+
children: /* @__PURE__ */ a(
|
|
96
100
|
"div",
|
|
97
101
|
{
|
|
98
102
|
style: {
|
|
99
|
-
width:
|
|
103
|
+
width: o.popupWidth,
|
|
100
104
|
padding: "0 16px",
|
|
101
105
|
zIndex: e.popupZIndex,
|
|
102
|
-
height:
|
|
106
|
+
height: o.popupHeight,
|
|
107
|
+
backgroundColor: n.paper,
|
|
108
|
+
color: n.text
|
|
103
109
|
},
|
|
104
110
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
111
|
+
/* @__PURE__ */ t(
|
|
112
|
+
v,
|
|
107
113
|
{
|
|
108
|
-
maxHeight:
|
|
109
|
-
pagination:
|
|
110
|
-
filter:
|
|
111
|
-
pageSize:
|
|
112
|
-
pagePosition:
|
|
113
|
-
notificationRenderer:
|
|
114
|
-
header:
|
|
115
|
-
newTab:
|
|
114
|
+
maxHeight: o.popupHeight - 73,
|
|
115
|
+
pagination: o.pagination,
|
|
116
|
+
filter: o.filter,
|
|
117
|
+
pageSize: o.pageSize,
|
|
118
|
+
pagePosition: o.pagePosition,
|
|
119
|
+
notificationRenderer: o.renderers.notification,
|
|
120
|
+
header: o.header,
|
|
121
|
+
newTab: o.newTab
|
|
116
122
|
}
|
|
117
123
|
),
|
|
118
|
-
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
124
|
+
i.webPushOptInMessage && localStorage.getItem("hideWebPushOptInMessage") !== "true" && /* @__PURE__ */ a("div", { children: [
|
|
125
|
+
/* @__PURE__ */ t(
|
|
126
|
+
E,
|
|
127
|
+
{
|
|
128
|
+
style: { margin: "10px 0", borderColor: n.divider }
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ t(H, { hideAfterInteraction: !0 })
|
|
121
132
|
] })
|
|
122
133
|
]
|
|
123
134
|
}
|
|
124
135
|
)
|
|
125
136
|
}
|
|
126
137
|
),
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
|
|
138
|
+
/* @__PURE__ */ t(
|
|
139
|
+
z,
|
|
129
140
|
{
|
|
130
141
|
open: I,
|
|
131
|
-
onClose: () =>
|
|
142
|
+
onClose: () => l(!1)
|
|
132
143
|
}
|
|
133
144
|
)
|
|
134
145
|
] });
|
|
135
146
|
};
|
|
136
147
|
export {
|
|
137
|
-
|
|
148
|
+
V as NotificationPopup
|
|
138
149
|
};
|