@hkyhy/marsun-components-core 0.1.124 → 0.1.126
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/components/Tools/Inbox/InboxBell/InboxBell.d.ts +45 -4
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.js +383 -125
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.js.map +1 -1
- package/dist/components/Tools/Inbox/InboxBell/emphasizeQuoted.d.ts +3 -0
- package/dist/components/Tools/Inbox/InboxBell/emphasizeQuoted.js +13 -0
- package/dist/components/Tools/Inbox/InboxBell/emphasizeQuoted.js.map +1 -0
- package/dist/components/Tools/Inbox/InboxBell/inboxItemActions.d.ts +43 -0
- package/dist/components/Tools/Inbox/InboxBell/inboxItemActions.js +95 -0
- package/dist/components/Tools/Inbox/InboxBell/inboxItemActions.js.map +1 -0
- package/dist/components/Tools/Inbox/InboxBell/index.d.ts +2 -0
- package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js +66 -26
- package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js.map +1 -1
- package/dist/components/Tools/Inbox/InboxBell/toastPrefs.d.ts +10 -0
- package/dist/components/Tools/Inbox/InboxBell/toastPrefs.js +46 -0
- package/dist/components/Tools/Inbox/InboxBell/toastPrefs.js.map +1 -0
- package/dist/components/Tools/Inbox/index.d.ts +2 -0
- package/dist/components/Tools/index.d.ts +2 -1
- package/dist/index.js +224 -216
- package/dist/index.js.map +1 -1
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/package.json +1 -1
|
@@ -1,165 +1,317 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Badge as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { sanitizeInboxHtml as
|
|
6
|
-
import { INBOX_BADGE_REFRESH_EVENT as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as xe, Button as I, Drawer as Ce, Space as ue, Checkbox as J, notification as me, message as pe } from "antd";
|
|
3
|
+
import S from "classnames";
|
|
4
|
+
import { forwardRef as Pe, useState as g, useRef as E, useMemo as fe, useCallback as O, useImperativeHandle as Re, useEffect as b } from "react";
|
|
5
|
+
import { sanitizeInboxHtml as Ae } from "../sanitizeInboxHtml.js";
|
|
6
|
+
import { INBOX_BADGE_REFRESH_EVENT as ye } from "../requestInboxBadgeRefresh.js";
|
|
7
|
+
import { emphasizeQuoted as H } from "./emphasizeQuoted.js";
|
|
8
|
+
import { filterInboxActionsForHost as De, resolveInboxItemActions as _e, isInboxButtonDriven as Me } from "./inboxItemActions.js";
|
|
9
|
+
import { inboxSceneLabel as vt, isTerminalActionStatus as bt, normalizeInboxActions as Tt, resolveInboxSceneKey as wt } from "./inboxItemActions.js";
|
|
10
|
+
import { loadInboxToastPrefs as Ie, shouldToastForMessageType as Oe, saveInboxToastPrefs as He } from "./toastPrefs.js";
|
|
11
|
+
import { DEFAULT_INBOX_TOAST_PREFS as St } from "./toastPrefs.js";
|
|
12
|
+
import n from "./style.module.scss.js";
|
|
13
|
+
import { Bell as Fe } from "../../../Icons/Bell.js";
|
|
14
|
+
import Ue from "../../../StateBar/StateBar.js";
|
|
15
|
+
import ze from "../../../SegmentedRadio/SegmentedRadio.js";
|
|
16
|
+
import Ge from "../../../Layout/PageSpin/index.js";
|
|
17
|
+
import Ke from "../../../Empty/Empty.js";
|
|
18
|
+
import $e from "../../../VirtualScrollbar/VirtualScrollbar/index.js";
|
|
19
|
+
import F, { SEMANTIC_COLORS as x } from "../../../Tag/SemanticTag.js";
|
|
20
|
+
const je = [
|
|
14
21
|
{ key: "", label: "全部" },
|
|
15
22
|
{ key: "alert", label: "预警" },
|
|
16
23
|
{ key: "action", label: "行动" },
|
|
17
24
|
{ key: "remind", label: "提醒" }
|
|
18
|
-
],
|
|
25
|
+
], Ve = {
|
|
19
26
|
alert: "预警",
|
|
20
27
|
action: "行动",
|
|
21
28
|
remind: "提醒"
|
|
22
|
-
},
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
return
|
|
29
|
+
}, We = 300, Qe = 72;
|
|
30
|
+
function ge(u) {
|
|
31
|
+
const a = String(u || "").trim().toLowerCase();
|
|
32
|
+
return a ? Ve[a] || a : "";
|
|
26
33
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
function q(u) {
|
|
35
|
+
const a = String(u || "").trim().toLowerCase();
|
|
36
|
+
return a === "alert" ? x.DANGER : a === "action" ? x.PRIMARY : a === "remind" ? x.WARNING : x.DEFAULT;
|
|
37
|
+
}
|
|
38
|
+
function Xe(u) {
|
|
39
|
+
return [u.factory, u.variety, u.metric].map((a) => String(a || "").trim()).filter(Boolean).join(" · ");
|
|
40
|
+
}
|
|
41
|
+
function Ye(u) {
|
|
42
|
+
return String(u || "").trim() || x.DEFAULT;
|
|
43
|
+
}
|
|
44
|
+
function Je(u) {
|
|
45
|
+
try {
|
|
46
|
+
const a = JSON.parse(u);
|
|
47
|
+
if (!a || typeof a != "object") return null;
|
|
48
|
+
const C = String(a.messageType || a.message_type || "").trim(), L = String(a.title || "").trim(), T = String(a.summary || "").trim();
|
|
49
|
+
return !C && !L && !T ? null : {
|
|
50
|
+
messageType: C || void 0,
|
|
51
|
+
title: L || void 0,
|
|
52
|
+
summary: T || void 0
|
|
53
|
+
};
|
|
54
|
+
} catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const yt = Pe(function({
|
|
59
|
+
fetchInbox: a,
|
|
60
|
+
markRead: C,
|
|
61
|
+
onNavigate: L,
|
|
62
|
+
pollMs: T = 0,
|
|
63
|
+
locationKey: Z,
|
|
64
|
+
pageSize: h = 20,
|
|
65
|
+
className: he,
|
|
66
|
+
title: ve = "站内信",
|
|
67
|
+
streamPath: U = "/api/v1/msg-center/inbox/stream",
|
|
68
|
+
getAccessToken: z,
|
|
69
|
+
onItemAction: ee
|
|
70
|
+
}, be) {
|
|
71
|
+
const [G, w] = g(!1), [te, ne] = g(!1), [K, re] = g(""), [P, R] = g([]), [k, A] = g(0), [ae, $] = g({}), [j, Te] = g(""), [D, we] = g("all"), [B, Ne] = g(() => Ie()), [Se, oe] = g(!1), v = E(null), se = E(!1), le = E(B);
|
|
72
|
+
le.current = B;
|
|
73
|
+
const V = E(1), W = E(!1), N = E(!1), _ = fe(
|
|
74
|
+
() => ({
|
|
75
|
+
messageType: j || void 0,
|
|
76
|
+
unreadOnly: D === "unread" || void 0,
|
|
77
|
+
readOnly: D === "read" || void 0
|
|
78
|
+
}),
|
|
79
|
+
[j, D]
|
|
80
|
+
), Q = O(async () => {
|
|
81
|
+
ne(!0), re(""), V.current = 1, N.current = !1;
|
|
39
82
|
try {
|
|
40
|
-
const e = await
|
|
83
|
+
const e = await a({
|
|
41
84
|
currentPage: 1,
|
|
42
|
-
pageSize:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
h((e == null ? void 0 : e.itemList) || []), g(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), O((e == null ? void 0 : e.unreadByMessageType) || {});
|
|
85
|
+
pageSize: h,
|
|
86
|
+
..._
|
|
87
|
+
}), t = (e == null ? void 0 : e.pageData) || [], s = typeof (e == null ? void 0 : e.total) == "number" ? e.total : t.length;
|
|
88
|
+
R(t), N.current = t.length > 0 && t.length < s, A(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), $((e == null ? void 0 : e.unreadByMessageType) || {});
|
|
48
89
|
} catch (e) {
|
|
49
|
-
|
|
90
|
+
R([]), N.current = !1, re(e instanceof Error ? e.message : String(e));
|
|
50
91
|
} finally {
|
|
51
|
-
|
|
92
|
+
ne(!1);
|
|
52
93
|
}
|
|
53
|
-
}, [
|
|
94
|
+
}, [a, h, _]), ie = O(async () => {
|
|
95
|
+
if (!(W.current || !N.current)) {
|
|
96
|
+
W.current = !0, oe(!0);
|
|
97
|
+
try {
|
|
98
|
+
const e = V.current + 1, t = await a({
|
|
99
|
+
currentPage: e,
|
|
100
|
+
pageSize: h,
|
|
101
|
+
..._
|
|
102
|
+
}), s = (t == null ? void 0 : t.pageData) || [], o = typeof (t == null ? void 0 : t.total) == "number" ? t.total : 0;
|
|
103
|
+
R((i) => {
|
|
104
|
+
const p = new Set(i.map((f) => f.id)), c = s.filter((f) => (f == null ? void 0 : f.id) && !p.has(f.id)), d = c.length ? [...i, ...c] : i;
|
|
105
|
+
return N.current = c.length > 0 && (o > 0 ? d.length < o : c.length >= h), d;
|
|
106
|
+
}), s.length && (V.current = e), typeof (t == null ? void 0 : t.unreadTotal) == "number" && A(t.unreadTotal), t != null && t.unreadByMessageType && $(t.unreadByMessageType);
|
|
107
|
+
} catch {
|
|
108
|
+
N.current = !1;
|
|
109
|
+
} finally {
|
|
110
|
+
W.current = !1, oe(!1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}, [a, h, _]), Ee = O(
|
|
114
|
+
(e) => {
|
|
115
|
+
const t = e.currentTarget;
|
|
116
|
+
t.scrollHeight - t.scrollTop - t.clientHeight <= Qe && ie();
|
|
117
|
+
},
|
|
118
|
+
[ie]
|
|
119
|
+
), l = O(async () => {
|
|
54
120
|
try {
|
|
55
|
-
const e = await
|
|
56
|
-
|
|
121
|
+
const e = await a({ currentPage: 1, pageSize: h });
|
|
122
|
+
A(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), $((e == null ? void 0 : e.unreadByMessageType) || {});
|
|
57
123
|
} catch {
|
|
58
124
|
}
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
if (
|
|
64
|
-
if (!
|
|
65
|
-
|
|
125
|
+
}, [a, h]);
|
|
126
|
+
Re(be, () => ({ refreshBadge: l }), [l]), b(() => {
|
|
127
|
+
l();
|
|
128
|
+
}, [l]), b(() => {
|
|
129
|
+
if (Z !== void 0) {
|
|
130
|
+
if (!se.current) {
|
|
131
|
+
se.current = !0;
|
|
66
132
|
return;
|
|
67
133
|
}
|
|
68
|
-
|
|
134
|
+
l();
|
|
69
135
|
}
|
|
70
|
-
}, [
|
|
71
|
-
if (
|
|
136
|
+
}, [Z, l]), b(() => {
|
|
137
|
+
if (T <= 0) return;
|
|
72
138
|
const e = window.setInterval(() => {
|
|
73
|
-
|
|
74
|
-
},
|
|
139
|
+
l();
|
|
140
|
+
}, T);
|
|
75
141
|
return () => window.clearInterval(e);
|
|
76
|
-
}, [
|
|
142
|
+
}, [T, l]), b(() => {
|
|
77
143
|
const e = () => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
144
|
+
v.current != null && window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
145
|
+
v.current = null, l();
|
|
146
|
+
}, We);
|
|
81
147
|
}, t = () => {
|
|
82
148
|
document.visibilityState === "visible" && e();
|
|
83
149
|
};
|
|
84
150
|
return window.addEventListener("focus", e), document.addEventListener("visibilitychange", t), () => {
|
|
85
|
-
window.removeEventListener("focus", e), document.removeEventListener("visibilitychange", t),
|
|
151
|
+
window.removeEventListener("focus", e), document.removeEventListener("visibilitychange", t), v.current != null && (window.clearTimeout(v.current), v.current = null);
|
|
86
152
|
};
|
|
87
|
-
}, [
|
|
153
|
+
}, [l]), b(() => {
|
|
88
154
|
const e = () => {
|
|
89
|
-
|
|
155
|
+
l();
|
|
90
156
|
};
|
|
91
|
-
return window.addEventListener(
|
|
92
|
-
}, [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
(
|
|
97
|
-
|
|
157
|
+
return window.addEventListener(ye, e), () => window.removeEventListener(ye, e);
|
|
158
|
+
}, [l]), b(() => {
|
|
159
|
+
if (U === !1 || typeof z != "function" || typeof window > "u" || typeof EventSource > "u") return;
|
|
160
|
+
const e = String(z() || "").trim();
|
|
161
|
+
if (!e) return;
|
|
162
|
+
const t = String(U || "/api/v1/msg-center/inbox/stream").trim(), s = new URL(t, window.location.origin);
|
|
163
|
+
s.searchParams.set("access_token", e);
|
|
164
|
+
let o;
|
|
165
|
+
try {
|
|
166
|
+
o = new EventSource(s.toString());
|
|
167
|
+
} catch {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const i = (p) => {
|
|
171
|
+
l();
|
|
172
|
+
const c = p, d = typeof (c == null ? void 0 : c.data) == "string" ? Je(c.data) : null;
|
|
173
|
+
if (!d || !Oe(le.current, d.messageType)) return;
|
|
174
|
+
const f = d.title || "新站内信", y = d.summary || "", M = ge(d.messageType), de = () => {
|
|
175
|
+
me.destroy(), w(!0);
|
|
176
|
+
}, ke = `inbox-badge-${d.messageType || "msg"}-${Date.now()}`;
|
|
177
|
+
me.open({
|
|
178
|
+
key: ke,
|
|
179
|
+
className: S("marsun-inbox-toast", n.toastNotice),
|
|
180
|
+
closable: !0,
|
|
181
|
+
title: /* @__PURE__ */ m("div", { className: n.toastHead, children: [
|
|
182
|
+
/* @__PURE__ */ r("span", { className: n.toastTitle, children: H(f) }),
|
|
183
|
+
M ? /* @__PURE__ */ r(
|
|
184
|
+
F,
|
|
185
|
+
{
|
|
186
|
+
color: q(d.messageType),
|
|
187
|
+
className: n.typeTag,
|
|
188
|
+
children: M
|
|
189
|
+
}
|
|
190
|
+
) : null
|
|
191
|
+
] }),
|
|
192
|
+
message: /* @__PURE__ */ m("div", { className: n.toastHead, children: [
|
|
193
|
+
/* @__PURE__ */ r("span", { className: n.toastTitle, children: H(f) }),
|
|
194
|
+
M ? /* @__PURE__ */ r(
|
|
195
|
+
F,
|
|
196
|
+
{
|
|
197
|
+
color: q(d.messageType),
|
|
198
|
+
className: n.typeTag,
|
|
199
|
+
children: M
|
|
200
|
+
}
|
|
201
|
+
) : null
|
|
202
|
+
] }),
|
|
203
|
+
description: /* @__PURE__ */ m("div", { className: n.toastBody, children: [
|
|
204
|
+
y ? /* @__PURE__ */ r("div", { className: n.toastDesc, children: H(y) }) : null,
|
|
205
|
+
/* @__PURE__ */ r("div", { className: n.toastActions, children: /* @__PURE__ */ r(
|
|
206
|
+
I,
|
|
207
|
+
{
|
|
208
|
+
type: "primary",
|
|
209
|
+
size: "small",
|
|
210
|
+
onClick: (Be) => {
|
|
211
|
+
Be.stopPropagation(), de();
|
|
212
|
+
},
|
|
213
|
+
children: "查看"
|
|
214
|
+
}
|
|
215
|
+
) })
|
|
216
|
+
] }),
|
|
217
|
+
placement: "topRight",
|
|
218
|
+
duration: 6,
|
|
219
|
+
onClick: de
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
return o.addEventListener("badge", i), o.addEventListener("inbox", i), o.onerror = () => {
|
|
223
|
+
o.close();
|
|
224
|
+
}, () => {
|
|
225
|
+
o.removeEventListener("badge", i), o.removeEventListener("inbox", i), o.close();
|
|
226
|
+
};
|
|
227
|
+
}, [U, z, l]), b(() => {
|
|
228
|
+
G && Q();
|
|
229
|
+
}, [G, Q]);
|
|
230
|
+
const Le = fe(
|
|
231
|
+
() => je.map((e) => {
|
|
232
|
+
const t = e.key ? ae[e.key] || 0 : k;
|
|
98
233
|
return {
|
|
99
234
|
key: e.key || "all",
|
|
100
235
|
label: t > 0 ? `${e.label} (${t})` : e.label
|
|
101
236
|
};
|
|
102
237
|
}),
|
|
103
|
-
[
|
|
104
|
-
),
|
|
238
|
+
[ae, k]
|
|
239
|
+
), X = (e, t) => {
|
|
240
|
+
Ne((s) => {
|
|
241
|
+
const o = { ...s, [e]: t };
|
|
242
|
+
return He(o), o;
|
|
243
|
+
});
|
|
244
|
+
}, Y = async (e, t) => {
|
|
105
245
|
if (!e.read)
|
|
106
246
|
try {
|
|
107
|
-
await
|
|
247
|
+
await C(e.id), R((o) => o.map((i) => i.id === e.id ? { ...i, read: !0 } : i)), A((o) => Math.max(0, o - 1));
|
|
108
248
|
} catch (o) {
|
|
109
|
-
|
|
249
|
+
pe.error(o instanceof Error ? o.message : "标记已读失败");
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const s = String(e.href || "").trim();
|
|
253
|
+
if (s) {
|
|
254
|
+
if (L) {
|
|
255
|
+
L(s, e), w(!1);
|
|
110
256
|
return;
|
|
111
257
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
258
|
+
s.startsWith("http://") || s.startsWith("https://") ? window.open(s, "_blank", "noopener,noreferrer") : window.location.assign(s), w(!1);
|
|
259
|
+
}
|
|
260
|
+
}, ce = async (e, t) => {
|
|
261
|
+
if (!t.disabled) {
|
|
262
|
+
if (ee) {
|
|
263
|
+
try {
|
|
264
|
+
await ee(t.kind, e), w(!1), Q(), l();
|
|
265
|
+
} catch (s) {
|
|
266
|
+
pe.error(s instanceof Error ? s.message : "操作失败");
|
|
267
|
+
}
|
|
116
268
|
return;
|
|
117
269
|
}
|
|
118
|
-
|
|
270
|
+
await Y(e);
|
|
119
271
|
}
|
|
120
272
|
};
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
273
|
+
return /* @__PURE__ */ m("div", { className: S(n.bellWrap, he), children: [
|
|
274
|
+
/* @__PURE__ */ r(xe, { count: k, size: "small", overflowCount: 99, offset: [-4, 4], children: /* @__PURE__ */ r(
|
|
275
|
+
I,
|
|
124
276
|
{
|
|
125
277
|
type: "text",
|
|
126
|
-
className:
|
|
127
|
-
icon: /* @__PURE__ */
|
|
128
|
-
"aria-label":
|
|
129
|
-
onClick: () =>
|
|
278
|
+
className: n.bellBtn,
|
|
279
|
+
icon: /* @__PURE__ */ r(Fe, { size: 16, "aria-hidden": !0 }),
|
|
280
|
+
"aria-label": k > 0 ? `站内信,${k} 条未读` : "站内信",
|
|
281
|
+
onClick: () => w(!0)
|
|
130
282
|
}
|
|
131
283
|
) }),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
284
|
+
/* @__PURE__ */ m(
|
|
285
|
+
Ce,
|
|
134
286
|
{
|
|
135
|
-
title:
|
|
136
|
-
open:
|
|
137
|
-
onClose: () =>
|
|
287
|
+
title: ve,
|
|
288
|
+
open: G,
|
|
289
|
+
onClose: () => w(!1),
|
|
138
290
|
size: 420,
|
|
139
291
|
destroyOnClose: !1,
|
|
140
|
-
className:
|
|
292
|
+
className: n.drawer,
|
|
141
293
|
styles: {
|
|
142
294
|
header: { padding: "12px 16px" },
|
|
143
295
|
body: { padding: "12px 16px" }
|
|
144
296
|
},
|
|
145
297
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
|
|
298
|
+
/* @__PURE__ */ r(
|
|
299
|
+
Ue,
|
|
148
300
|
{
|
|
149
|
-
className:
|
|
301
|
+
className: n.typeTabs,
|
|
150
302
|
size: "small",
|
|
151
|
-
activeKey:
|
|
152
|
-
onChange: (e) =>
|
|
153
|
-
stateOption:
|
|
303
|
+
activeKey: j || "all",
|
|
304
|
+
onChange: (e) => Te(e === "all" ? "" : e),
|
|
305
|
+
stateOption: Le,
|
|
154
306
|
isInner: !0
|
|
155
307
|
}
|
|
156
308
|
),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
309
|
+
/* @__PURE__ */ r("div", { className: n.filterRow, children: /* @__PURE__ */ r(
|
|
310
|
+
ze,
|
|
159
311
|
{
|
|
160
312
|
size: "small",
|
|
161
|
-
value:
|
|
162
|
-
onChange: (e) =>
|
|
313
|
+
value: D,
|
|
314
|
+
onChange: (e) => we(e),
|
|
163
315
|
options: [
|
|
164
316
|
{ value: "all", label: "全部" },
|
|
165
317
|
{ value: "unread", label: "未读" },
|
|
@@ -167,41 +319,147 @@ const Ee = J(function({
|
|
|
167
319
|
]
|
|
168
320
|
}
|
|
169
321
|
) }),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
"
|
|
322
|
+
/* @__PURE__ */ m("div", { className: n.toastPrefs, "data-testid": "inbox-toast-prefs", children: [
|
|
323
|
+
/* @__PURE__ */ r("div", { className: n.toastPrefsTitle, children: "消息提示" }),
|
|
324
|
+
/* @__PURE__ */ r("p", { className: n.toastPrefsHint, children: "本机浏览器偏好,非租户策略" }),
|
|
325
|
+
/* @__PURE__ */ m(ue, { size: 12, wrap: !0, children: [
|
|
326
|
+
/* @__PURE__ */ r(
|
|
327
|
+
J,
|
|
328
|
+
{
|
|
329
|
+
checked: B.alert,
|
|
330
|
+
onChange: (e) => X("alert", e.target.checked),
|
|
331
|
+
children: "预警弹出"
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ r(
|
|
335
|
+
J,
|
|
336
|
+
{
|
|
337
|
+
checked: B.action,
|
|
338
|
+
onChange: (e) => X("action", e.target.checked),
|
|
339
|
+
children: "行动弹出"
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
/* @__PURE__ */ r(
|
|
343
|
+
J,
|
|
344
|
+
{
|
|
345
|
+
checked: B.remind,
|
|
346
|
+
onChange: (e) => X("remind", e.target.checked),
|
|
347
|
+
children: "提醒弹出"
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
] })
|
|
351
|
+
] }),
|
|
352
|
+
K ? /* @__PURE__ */ r("p", { className: n.error, children: K }) : null,
|
|
353
|
+
/* @__PURE__ */ r("div", { className: S("inbox-bell-list-pane", n.listPane), children: /* @__PURE__ */ r(Ge, { spinning: te && P.length === 0, children: !te && !K && P.length === 0 ? /* @__PURE__ */ r(Ke, { description: "暂无站内信" }) : P.length === 0 ? null : /* @__PURE__ */ m(
|
|
354
|
+
$e,
|
|
173
355
|
{
|
|
174
|
-
|
|
175
|
-
className:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
(() => {
|
|
180
|
-
const t =
|
|
181
|
-
|
|
356
|
+
wrapperClassName: S("inbox-bell-list-scroll", n.listScroll),
|
|
357
|
+
className: n.listViewport,
|
|
358
|
+
"data-testid": "inbox-bell-list-scroll",
|
|
359
|
+
onScroll: Ee,
|
|
360
|
+
children: [
|
|
361
|
+
/* @__PURE__ */ r("ul", { className: n.list, children: P.map((e) => {
|
|
362
|
+
const t = ge(e.messageType), s = String(e.levelLabel || e.level || "").trim(), o = !!s, i = Ae(e.bodyHtml), p = De(
|
|
363
|
+
_e(e)
|
|
364
|
+
), c = Me(e), d = Xe(e), f = !!p.primary;
|
|
365
|
+
return /* @__PURE__ */ r("li", { children: /* @__PURE__ */ m(
|
|
182
366
|
"div",
|
|
183
367
|
{
|
|
184
|
-
className:
|
|
185
|
-
|
|
368
|
+
className: S(
|
|
369
|
+
n.item,
|
|
370
|
+
!e.read && n.itemUnread,
|
|
371
|
+
c && n.itemStatic
|
|
372
|
+
),
|
|
373
|
+
role: c ? void 0 : "button",
|
|
374
|
+
tabIndex: c ? void 0 : 0,
|
|
375
|
+
onClick: c ? void 0 : () => void Y(e),
|
|
376
|
+
onKeyDown: c ? void 0 : (y) => {
|
|
377
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), Y(e));
|
|
378
|
+
},
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ m("div", { className: n.itemHeader, children: [
|
|
381
|
+
/* @__PURE__ */ m("span", { className: n.itemHeaderLeft, children: [
|
|
382
|
+
/* @__PURE__ */ r("span", { className: n.itemTitle, title: e.title || "(无标题)", children: e.title || "(无标题)" }),
|
|
383
|
+
t ? /* @__PURE__ */ r(
|
|
384
|
+
F,
|
|
385
|
+
{
|
|
386
|
+
color: q(e.messageType),
|
|
387
|
+
className: n.typeTag,
|
|
388
|
+
children: t
|
|
389
|
+
}
|
|
390
|
+
) : null
|
|
391
|
+
] }),
|
|
392
|
+
/* @__PURE__ */ r("span", { className: n.itemTime, children: e.createdAt || "" })
|
|
393
|
+
] }),
|
|
394
|
+
/* @__PURE__ */ r("div", { className: n.itemBody, children: i ? /* @__PURE__ */ r(
|
|
395
|
+
"div",
|
|
396
|
+
{
|
|
397
|
+
className: n.itemBodyHtml,
|
|
398
|
+
dangerouslySetInnerHTML: { __html: i }
|
|
399
|
+
}
|
|
400
|
+
) : e.summary ? /* @__PURE__ */ r("span", { className: n.itemSummary, children: H(e.summary) }) : null }),
|
|
401
|
+
d ? /* @__PURE__ */ r("span", { className: n.itemMeta, children: d }) : null,
|
|
402
|
+
o ? /* @__PURE__ */ r("div", { className: n.itemFooterTags, children: /* @__PURE__ */ r(
|
|
403
|
+
F,
|
|
404
|
+
{
|
|
405
|
+
color: Ye(e.levelColor),
|
|
406
|
+
className: n.typeTag,
|
|
407
|
+
children: s
|
|
408
|
+
}
|
|
409
|
+
) }) : null,
|
|
410
|
+
f && p.primary ? /* @__PURE__ */ r(
|
|
411
|
+
"div",
|
|
412
|
+
{
|
|
413
|
+
className: n.itemActions,
|
|
414
|
+
onClick: (y) => y.stopPropagation(),
|
|
415
|
+
onKeyDown: (y) => y.stopPropagation(),
|
|
416
|
+
children: /* @__PURE__ */ m(ue, { size: 8, wrap: !0, children: [
|
|
417
|
+
/* @__PURE__ */ r(
|
|
418
|
+
I,
|
|
419
|
+
{
|
|
420
|
+
size: "small",
|
|
421
|
+
type: "primary",
|
|
422
|
+
onClick: () => void ce(e, p.primary),
|
|
423
|
+
children: p.primary.label
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
p.secondary ? /* @__PURE__ */ r(
|
|
427
|
+
I,
|
|
428
|
+
{
|
|
429
|
+
size: "small",
|
|
430
|
+
type: "link",
|
|
431
|
+
onClick: () => void ce(e, p.secondary),
|
|
432
|
+
children: p.secondary.label
|
|
433
|
+
}
|
|
434
|
+
) : null
|
|
435
|
+
] })
|
|
436
|
+
}
|
|
437
|
+
) : null
|
|
438
|
+
]
|
|
186
439
|
}
|
|
187
|
-
)
|
|
188
|
-
})
|
|
189
|
-
(()
|
|
190
|
-
|
|
191
|
-
return /* @__PURE__ */ p("span", { className: r.itemMeta, children: [
|
|
192
|
-
t ? /* @__PURE__ */ n(X, { className: r.typeTag, children: t }) : null,
|
|
193
|
-
e.createdAt || (t ? "" : "—")
|
|
194
|
-
] });
|
|
195
|
-
})()
|
|
196
|
-
] })
|
|
440
|
+
) }, e.id);
|
|
441
|
+
}) }),
|
|
442
|
+
Se ? /* @__PURE__ */ r("p", { className: S("inbox-bell-list-footer", n.listFooter), children: "加载中…" }) : null
|
|
443
|
+
]
|
|
197
444
|
}
|
|
198
|
-
) }
|
|
445
|
+
) }) })
|
|
199
446
|
]
|
|
200
447
|
}
|
|
201
448
|
)
|
|
202
449
|
] });
|
|
203
450
|
});
|
|
204
451
|
export {
|
|
205
|
-
|
|
452
|
+
St as DEFAULT_INBOX_TOAST_PREFS,
|
|
453
|
+
yt as default,
|
|
454
|
+
De as filterInboxActionsForHost,
|
|
455
|
+
vt as inboxSceneLabel,
|
|
456
|
+
Me as isInboxButtonDriven,
|
|
457
|
+
bt as isTerminalActionStatus,
|
|
458
|
+
Ie as loadInboxToastPrefs,
|
|
459
|
+
Tt as normalizeInboxActions,
|
|
460
|
+
_e as resolveInboxItemActions,
|
|
461
|
+
wt as resolveInboxSceneKey,
|
|
462
|
+
He as saveInboxToastPrefs,
|
|
463
|
+
Oe as shouldToastForMessageType
|
|
206
464
|
};
|
|
207
465
|
//# sourceMappingURL=InboxBell.js.map
|