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