@hkyhy/marsun-components-core 0.1.124 → 0.1.125
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 +43 -3
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.js +345 -130
- 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 +37 -0
- package/dist/components/Tools/Inbox/InboxBell/inboxItemActions.js +97 -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 +58 -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 +223 -216
- package/dist/index.js.map +1 -1
- 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
package/dist/_virtual/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as o } from "../node_modules/pdfast/src/index.js";
|
|
3
|
+
var t = o();
|
|
4
|
+
const s = /* @__PURE__ */ r(t);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs as
|
|
2
|
-
import { __require as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { getDefaultExportFromCjs as t } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as e } from "../node_modules/eventemitter3/index2.js";
|
|
3
|
+
var r = e();
|
|
4
|
+
const i = /* @__PURE__ */ t(r);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index2.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InboxItemActionKind } from './inboxItemActions';
|
|
1
2
|
export type InboxBellMessageType = 'alert' | 'action' | 'remind' | string;
|
|
2
3
|
export type InboxBellItem = {
|
|
3
4
|
id: string;
|
|
@@ -11,6 +12,28 @@ export type InboxBellItem = {
|
|
|
11
12
|
href?: string;
|
|
12
13
|
createdAt?: string;
|
|
13
14
|
level?: string;
|
|
15
|
+
/** 级别展示名(业务仓从已有维表/工具函数填;空则回落 level) */
|
|
16
|
+
levelLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 级别 Tag 色:业务仓传入预警级别设置色(如 QA `ALERT_LEVEL_COLORS.*.accent`)。
|
|
19
|
+
* 支持 SemanticColor 键或 `#hex`;core 不自造级别色表。
|
|
20
|
+
*/
|
|
21
|
+
levelColor?: string;
|
|
22
|
+
category?: string;
|
|
23
|
+
scene?: string;
|
|
24
|
+
eventKey?: string;
|
|
25
|
+
categoryLabel?: string;
|
|
26
|
+
alertId?: string | null;
|
|
27
|
+
actionId?: string | null;
|
|
28
|
+
claimed?: boolean;
|
|
29
|
+
started?: boolean;
|
|
30
|
+
/** 行动当前状态(enrich / contextJson);终态时底栏只保留查看任务 */
|
|
31
|
+
actionStatus?: string;
|
|
32
|
+
factory?: string;
|
|
33
|
+
variety?: string;
|
|
34
|
+
metric?: string;
|
|
35
|
+
/** 业务日/月份(如 2026-07-31);预警深链 date 用 */
|
|
36
|
+
month?: string;
|
|
14
37
|
};
|
|
15
38
|
export type InboxBellListResult = {
|
|
16
39
|
itemList: InboxBellItem[];
|
|
@@ -46,14 +69,31 @@ export type InboxBellProps = {
|
|
|
46
69
|
className?: string;
|
|
47
70
|
/** Drawer 标题 */
|
|
48
71
|
title?: string;
|
|
72
|
+
/**
|
|
73
|
+
* 同源 SSE 路径(默认 `/api/v1/msg-center/inbox/stream`)。
|
|
74
|
+
* 传 `false` 关闭。须配合 `getAccessToken`(EventSource 用 `access_token` 查询参数传 JWT)。
|
|
75
|
+
* 失败回落写后刷新 / 焦点刷新,不定时轮询冒充。
|
|
76
|
+
*/
|
|
77
|
+
streamPath?: string | false;
|
|
78
|
+
/** 返回当前 JWT;空则不开 SSE */
|
|
79
|
+
getAccessToken?: () => string | null | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* 卡片底栏动作(认领/去执行等)。不传则底栏按钮一律走 onNavigate / href。
|
|
82
|
+
* 业务仓拦截 claim_alert / start_action / create_task。
|
|
83
|
+
*/
|
|
84
|
+
onItemAction?: (kind: InboxItemActionKind, item: InboxBellItem) => void | Promise<void>;
|
|
49
85
|
};
|
|
50
86
|
export type InboxBellHandle = {
|
|
51
87
|
refreshBadge: () => Promise<void>;
|
|
52
88
|
};
|
|
53
89
|
/**
|
|
54
|
-
* 通用站内信铃铛:列表 / 已读 / Tab /
|
|
55
|
-
*
|
|
56
|
-
* 默认不定时轮询;有消息侧靠业务回调 / 路由 /
|
|
90
|
+
* 通用站内信铃铛:列表 / 已读 / Tab / 角标 / 卡片底栏动作 / 可选 SSE toast。
|
|
91
|
+
* 认领、去执行等业务动作由 `onItemAction` 注入;默认底栏按钮走 onNavigate / href。
|
|
92
|
+
* 默认不定时轮询;有消息侧靠业务回调 / 路由 / 焦点 / 可选 SSE 再拉角标。
|
|
57
93
|
*/
|
|
58
94
|
declare const InboxBell: import('react').ForwardRefExoticComponent<InboxBellProps & import('react').RefAttributes<InboxBellHandle>>;
|
|
59
95
|
export default InboxBell;
|
|
96
|
+
export { DEFAULT_INBOX_TOAST_PREFS, loadInboxToastPrefs, saveInboxToastPrefs, shouldToastForMessageType, } from './toastPrefs';
|
|
97
|
+
export type { InboxToastPrefs } from './toastPrefs';
|
|
98
|
+
export { resolveInboxItemActions, filterInboxActionsForHost, normalizeInboxActions, inboxSceneLabel, isInboxButtonDriven, isTerminalActionStatus, } from './inboxItemActions';
|
|
99
|
+
export type { InboxItemActionKind, InboxItemQuickAction, InboxItemActionsResolved, } from './inboxItemActions';
|
|
@@ -1,165 +1,286 @@
|
|
|
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 t } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as Te, Button as B, Drawer as be, Space as ae, Checkbox as $, notification as oe, message as se } from "antd";
|
|
3
|
+
import j from "classnames";
|
|
4
|
+
import { forwardRef as we, useState as y, useRef as G, useCallback as ie, useImperativeHandle as Ne, useEffect as g, useMemo as Se } from "react";
|
|
5
|
+
import { sanitizeInboxHtml as Ee } from "../sanitizeInboxHtml.js";
|
|
6
|
+
import { INBOX_BADGE_REFRESH_EVENT as le } from "../requestInboxBadgeRefresh.js";
|
|
7
|
+
import { emphasizeQuoted as C } from "./emphasizeQuoted.js";
|
|
8
|
+
import { filterInboxActionsForHost as ke, resolveInboxItemActions as Le, isInboxButtonDriven as xe } from "./inboxItemActions.js";
|
|
9
|
+
import { inboxSceneLabel as it, isTerminalActionStatus as lt, normalizeInboxActions as ct } from "./inboxItemActions.js";
|
|
10
|
+
import { loadInboxToastPrefs as Be, shouldToastForMessageType as Ce, saveInboxToastPrefs as Pe } from "./toastPrefs.js";
|
|
11
|
+
import { DEFAULT_INBOX_TOAST_PREFS as mt } from "./toastPrefs.js";
|
|
12
|
+
import n from "./style.module.scss.js";
|
|
13
|
+
import { Bell as Ie } from "../../../Icons/Bell.js";
|
|
14
|
+
import Re from "../../../StateBar/StateBar.js";
|
|
15
|
+
import Ae from "../../../SegmentedRadio/SegmentedRadio.js";
|
|
16
|
+
import De from "../../../Layout/PageSpin/index.js";
|
|
17
|
+
import _e from "../../../Empty/Empty.js";
|
|
18
|
+
import P, { SEMANTIC_COLORS as S } from "../../../Tag/SemanticTag.js";
|
|
19
|
+
const Oe = [
|
|
14
20
|
{ key: "", label: "全部" },
|
|
15
21
|
{ key: "alert", label: "预警" },
|
|
16
22
|
{ key: "action", label: "行动" },
|
|
17
23
|
{ key: "remind", label: "提醒" }
|
|
18
|
-
],
|
|
24
|
+
], ze = {
|
|
19
25
|
alert: "预警",
|
|
20
26
|
action: "行动",
|
|
21
27
|
remind: "提醒"
|
|
22
|
-
},
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
return
|
|
28
|
+
}, He = 300;
|
|
29
|
+
function ce(l) {
|
|
30
|
+
const r = String(l || "").trim().toLowerCase();
|
|
31
|
+
return r ? ze[r] || r : "";
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
function K(l) {
|
|
34
|
+
const r = String(l || "").trim().toLowerCase();
|
|
35
|
+
return r === "alert" ? S.DANGER : r === "action" ? S.PRIMARY : r === "remind" ? S.WARNING : S.DEFAULT;
|
|
36
|
+
}
|
|
37
|
+
function Fe(l) {
|
|
38
|
+
return [l.factory, l.variety, l.metric].map((r) => String(r || "").trim()).filter(Boolean).join(" · ");
|
|
39
|
+
}
|
|
40
|
+
function Me(l) {
|
|
41
|
+
return String(l || "").trim() || S.DEFAULT;
|
|
42
|
+
}
|
|
43
|
+
function Ue(l) {
|
|
44
|
+
try {
|
|
45
|
+
const r = JSON.parse(l);
|
|
46
|
+
if (!r || typeof r != "object") return null;
|
|
47
|
+
const E = String(r.messageType || r.message_type || "").trim(), T = String(r.title || "").trim(), h = String(r.summary || "").trim();
|
|
48
|
+
return !E && !T && !h ? null : {
|
|
49
|
+
messageType: E || void 0,
|
|
50
|
+
title: T || void 0,
|
|
51
|
+
summary: h || void 0
|
|
52
|
+
};
|
|
53
|
+
} catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const at = we(function({
|
|
58
|
+
fetchInbox: r,
|
|
59
|
+
markRead: E,
|
|
60
|
+
onNavigate: T,
|
|
61
|
+
pollMs: h = 0,
|
|
62
|
+
locationKey: W,
|
|
63
|
+
pageSize: Y = 50,
|
|
64
|
+
className: de,
|
|
65
|
+
title: me = "站内信",
|
|
66
|
+
streamPath: I = "/api/v1/msg-center/inbox/stream",
|
|
67
|
+
getAccessToken: R,
|
|
68
|
+
onItemAction: A
|
|
69
|
+
}, ue) {
|
|
70
|
+
const [D, b] = y(!1), [Q, V] = y(!1), [_, X] = y(""), [J, O] = y([]), [w, z] = y(0), [q, Z] = y({}), [H, pe] = y(""), [k, fe] = y("all"), [N, ye] = y(() => Be()), v = G(null), ee = G(!1), te = G(N);
|
|
71
|
+
te.current = N;
|
|
72
|
+
const F = ie(async () => {
|
|
73
|
+
V(!0), X("");
|
|
39
74
|
try {
|
|
40
|
-
const e = await
|
|
75
|
+
const e = await r({
|
|
41
76
|
currentPage: 1,
|
|
42
|
-
pageSize:
|
|
43
|
-
messageType:
|
|
44
|
-
unreadOnly:
|
|
45
|
-
readOnly:
|
|
77
|
+
pageSize: Y,
|
|
78
|
+
messageType: H || void 0,
|
|
79
|
+
unreadOnly: k === "unread" || void 0,
|
|
80
|
+
readOnly: k === "read" || void 0
|
|
46
81
|
});
|
|
47
|
-
|
|
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) || {});
|
|
48
83
|
} catch (e) {
|
|
49
|
-
|
|
84
|
+
O([]), X(e instanceof Error ? e.message : String(e));
|
|
50
85
|
} finally {
|
|
51
|
-
|
|
86
|
+
V(!1);
|
|
52
87
|
}
|
|
53
|
-
}, [
|
|
88
|
+
}, [r, H, Y, k]), i = ie(async () => {
|
|
54
89
|
try {
|
|
55
|
-
const e = await
|
|
56
|
-
|
|
90
|
+
const e = await r({ currentPage: 1, pageSize: 1 });
|
|
91
|
+
z(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), Z((e == null ? void 0 : e.unreadByMessageType) || {});
|
|
57
92
|
} catch {
|
|
58
93
|
}
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
if (
|
|
64
|
-
if (!
|
|
65
|
-
|
|
94
|
+
}, [r]);
|
|
95
|
+
Ne(ue, () => ({ refreshBadge: i }), [i]), g(() => {
|
|
96
|
+
i();
|
|
97
|
+
}, [i]), g(() => {
|
|
98
|
+
if (W !== void 0) {
|
|
99
|
+
if (!ee.current) {
|
|
100
|
+
ee.current = !0;
|
|
66
101
|
return;
|
|
67
102
|
}
|
|
68
|
-
|
|
103
|
+
i();
|
|
69
104
|
}
|
|
70
|
-
}, [
|
|
71
|
-
if (
|
|
105
|
+
}, [W, i]), g(() => {
|
|
106
|
+
if (h <= 0) return;
|
|
72
107
|
const e = window.setInterval(() => {
|
|
73
|
-
|
|
74
|
-
},
|
|
108
|
+
i();
|
|
109
|
+
}, h);
|
|
75
110
|
return () => window.clearInterval(e);
|
|
76
|
-
}, [
|
|
111
|
+
}, [h, i]), g(() => {
|
|
77
112
|
const e = () => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
},
|
|
113
|
+
v.current != null && window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
114
|
+
v.current = null, i();
|
|
115
|
+
}, He);
|
|
116
|
+
}, s = () => {
|
|
82
117
|
document.visibilityState === "visible" && e();
|
|
83
118
|
};
|
|
84
|
-
return window.addEventListener("focus", e), document.addEventListener("visibilitychange",
|
|
85
|
-
window.removeEventListener("focus", e), document.removeEventListener("visibilitychange",
|
|
119
|
+
return window.addEventListener("focus", e), document.addEventListener("visibilitychange", s), () => {
|
|
120
|
+
window.removeEventListener("focus", e), document.removeEventListener("visibilitychange", s), v.current != null && (window.clearTimeout(v.current), v.current = null);
|
|
86
121
|
};
|
|
87
|
-
}, [
|
|
122
|
+
}, [i]), g(() => {
|
|
88
123
|
const e = () => {
|
|
89
|
-
|
|
124
|
+
i();
|
|
125
|
+
};
|
|
126
|
+
return window.addEventListener(le, e), () => window.removeEventListener(le, e);
|
|
127
|
+
}, [i]), g(() => {
|
|
128
|
+
if (I === !1 || typeof R != "function" || typeof window > "u" || typeof EventSource > "u") return;
|
|
129
|
+
const e = String(R() || "").trim();
|
|
130
|
+
if (!e) return;
|
|
131
|
+
const s = String(I || "/api/v1/msg-center/inbox/stream").trim(), o = new URL(s, window.location.origin);
|
|
132
|
+
o.searchParams.set("access_token", e);
|
|
133
|
+
let a;
|
|
134
|
+
try {
|
|
135
|
+
a = new EventSource(o.toString());
|
|
136
|
+
} catch {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const c = (f) => {
|
|
140
|
+
i();
|
|
141
|
+
const u = f, d = typeof (u == null ? void 0 : u.data) == "string" ? Ue(u.data) : null;
|
|
142
|
+
if (!d || !Ce(te.current, d.messageType)) return;
|
|
143
|
+
const L = d.title || "新站内信", p = d.summary || "", x = ce(d.messageType), re = () => {
|
|
144
|
+
oe.destroy(), b(!0);
|
|
145
|
+
}, ge = `inbox-badge-${d.messageType || "msg"}-${Date.now()}`;
|
|
146
|
+
oe.open({
|
|
147
|
+
key: ge,
|
|
148
|
+
className: j("marsun-inbox-toast", n.toastNotice),
|
|
149
|
+
closable: !0,
|
|
150
|
+
title: /* @__PURE__ */ m("div", { className: n.toastHead, children: [
|
|
151
|
+
/* @__PURE__ */ t("span", { className: n.toastTitle, children: C(L) }),
|
|
152
|
+
x ? /* @__PURE__ */ t(
|
|
153
|
+
P,
|
|
154
|
+
{
|
|
155
|
+
color: K(d.messageType),
|
|
156
|
+
className: n.typeTag,
|
|
157
|
+
children: x
|
|
158
|
+
}
|
|
159
|
+
) : null
|
|
160
|
+
] }),
|
|
161
|
+
message: /* @__PURE__ */ m("div", { className: n.toastHead, children: [
|
|
162
|
+
/* @__PURE__ */ t("span", { className: n.toastTitle, children: C(L) }),
|
|
163
|
+
x ? /* @__PURE__ */ t(
|
|
164
|
+
P,
|
|
165
|
+
{
|
|
166
|
+
color: K(d.messageType),
|
|
167
|
+
className: n.typeTag,
|
|
168
|
+
children: x
|
|
169
|
+
}
|
|
170
|
+
) : null
|
|
171
|
+
] }),
|
|
172
|
+
description: /* @__PURE__ */ m("div", { className: n.toastBody, children: [
|
|
173
|
+
p ? /* @__PURE__ */ t("div", { className: n.toastDesc, children: C(p) }) : null,
|
|
174
|
+
/* @__PURE__ */ t("div", { className: n.toastActions, children: /* @__PURE__ */ t(
|
|
175
|
+
B,
|
|
176
|
+
{
|
|
177
|
+
type: "primary",
|
|
178
|
+
size: "small",
|
|
179
|
+
onClick: (he) => {
|
|
180
|
+
he.stopPropagation(), re();
|
|
181
|
+
},
|
|
182
|
+
children: "查看"
|
|
183
|
+
}
|
|
184
|
+
) })
|
|
185
|
+
] }),
|
|
186
|
+
placement: "topRight",
|
|
187
|
+
duration: 6,
|
|
188
|
+
onClick: re
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
return a.addEventListener("badge", c), a.addEventListener("inbox", c), a.onerror = () => {
|
|
192
|
+
a.close();
|
|
193
|
+
}, () => {
|
|
194
|
+
a.removeEventListener("badge", c), a.removeEventListener("inbox", c), a.close();
|
|
90
195
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const t = e.key ? _[e.key] || 0 : c;
|
|
196
|
+
}, [I, R, i]), g(() => {
|
|
197
|
+
D && F();
|
|
198
|
+
}, [D, F]);
|
|
199
|
+
const ve = Se(
|
|
200
|
+
() => Oe.map((e) => {
|
|
201
|
+
const s = e.key ? q[e.key] || 0 : w;
|
|
98
202
|
return {
|
|
99
203
|
key: e.key || "all",
|
|
100
|
-
label:
|
|
204
|
+
label: s > 0 ? `${e.label} (${s})` : e.label
|
|
101
205
|
};
|
|
102
206
|
}),
|
|
103
|
-
[
|
|
104
|
-
),
|
|
207
|
+
[q, w]
|
|
208
|
+
), M = (e, s) => {
|
|
209
|
+
ye((o) => {
|
|
210
|
+
const a = { ...o, [e]: s };
|
|
211
|
+
return Pe(a), a;
|
|
212
|
+
});
|
|
213
|
+
}, U = async (e, s) => {
|
|
105
214
|
if (!e.read)
|
|
106
215
|
try {
|
|
107
|
-
await
|
|
108
|
-
} catch (
|
|
109
|
-
|
|
216
|
+
await E(e.id), O((a) => a.map((c) => c.id === e.id ? { ...c, read: !0 } : c)), z((a) => Math.max(0, a - 1));
|
|
217
|
+
} catch (a) {
|
|
218
|
+
se.error(a instanceof Error ? a.message : "标记已读失败");
|
|
110
219
|
return;
|
|
111
220
|
}
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
115
|
-
|
|
221
|
+
const o = String(e.href || "").trim();
|
|
222
|
+
if (o) {
|
|
223
|
+
if (T) {
|
|
224
|
+
T(o, e), b(!1);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
o.startsWith("http://") || o.startsWith("https://") ? window.open(o, "_blank", "noopener,noreferrer") : window.location.assign(o), b(!1);
|
|
228
|
+
}
|
|
229
|
+
}, ne = async (e, s) => {
|
|
230
|
+
if (!s.disabled) {
|
|
231
|
+
if (A) {
|
|
232
|
+
try {
|
|
233
|
+
await A(s.kind, e), F(), i();
|
|
234
|
+
} catch (o) {
|
|
235
|
+
se.error(o instanceof Error ? o.message : "操作失败");
|
|
236
|
+
}
|
|
116
237
|
return;
|
|
117
238
|
}
|
|
118
|
-
|
|
239
|
+
await U(e);
|
|
119
240
|
}
|
|
120
241
|
};
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
242
|
+
return /* @__PURE__ */ m("div", { className: j(n.bellWrap, de), children: [
|
|
243
|
+
/* @__PURE__ */ t(Te, { count: w, size: "small", overflowCount: 99, offset: [-4, 4], children: /* @__PURE__ */ t(
|
|
244
|
+
B,
|
|
124
245
|
{
|
|
125
246
|
type: "text",
|
|
126
|
-
className:
|
|
127
|
-
icon: /* @__PURE__ */
|
|
128
|
-
"aria-label":
|
|
129
|
-
onClick: () =>
|
|
247
|
+
className: n.bellBtn,
|
|
248
|
+
icon: /* @__PURE__ */ t(Ie, { size: 16, "aria-hidden": !0 }),
|
|
249
|
+
"aria-label": w > 0 ? `站内信,${w} 条未读` : "站内信",
|
|
250
|
+
onClick: () => b(!0)
|
|
130
251
|
}
|
|
131
252
|
) }),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
253
|
+
/* @__PURE__ */ m(
|
|
254
|
+
be,
|
|
134
255
|
{
|
|
135
|
-
title:
|
|
136
|
-
open:
|
|
137
|
-
onClose: () =>
|
|
256
|
+
title: me,
|
|
257
|
+
open: D,
|
|
258
|
+
onClose: () => b(!1),
|
|
138
259
|
size: 420,
|
|
139
260
|
destroyOnClose: !1,
|
|
140
|
-
className:
|
|
261
|
+
className: n.drawer,
|
|
141
262
|
styles: {
|
|
142
263
|
header: { padding: "12px 16px" },
|
|
143
264
|
body: { padding: "12px 16px" }
|
|
144
265
|
},
|
|
145
266
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
|
|
267
|
+
/* @__PURE__ */ t(
|
|
268
|
+
Re,
|
|
148
269
|
{
|
|
149
|
-
className:
|
|
270
|
+
className: n.typeTabs,
|
|
150
271
|
size: "small",
|
|
151
|
-
activeKey:
|
|
152
|
-
onChange: (e) =>
|
|
153
|
-
stateOption:
|
|
272
|
+
activeKey: H || "all",
|
|
273
|
+
onChange: (e) => pe(e === "all" ? "" : e),
|
|
274
|
+
stateOption: ve,
|
|
154
275
|
isInner: !0
|
|
155
276
|
}
|
|
156
277
|
),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
278
|
+
/* @__PURE__ */ t("div", { className: n.filterRow, children: /* @__PURE__ */ t(
|
|
279
|
+
Ae,
|
|
159
280
|
{
|
|
160
281
|
size: "small",
|
|
161
|
-
value:
|
|
162
|
-
onChange: (e) =>
|
|
282
|
+
value: k,
|
|
283
|
+
onChange: (e) => fe(e),
|
|
163
284
|
options: [
|
|
164
285
|
{ value: "all", label: "全部" },
|
|
165
286
|
{ value: "unread", label: "未读" },
|
|
@@ -167,41 +288,135 @@ const Ee = J(function({
|
|
|
167
288
|
]
|
|
168
289
|
}
|
|
169
290
|
) }),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
"
|
|
173
|
-
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
291
|
+
/* @__PURE__ */ m("div", { className: n.toastPrefs, "data-testid": "inbox-toast-prefs", children: [
|
|
292
|
+
/* @__PURE__ */ t("div", { className: n.toastPrefsTitle, children: "消息提示" }),
|
|
293
|
+
/* @__PURE__ */ t("p", { className: n.toastPrefsHint, children: "本机浏览器偏好,非租户策略" }),
|
|
294
|
+
/* @__PURE__ */ m(ae, { size: 12, wrap: !0, children: [
|
|
295
|
+
/* @__PURE__ */ t(
|
|
296
|
+
$,
|
|
297
|
+
{
|
|
298
|
+
checked: N.alert,
|
|
299
|
+
onChange: (e) => M("alert", e.target.checked),
|
|
300
|
+
children: "预警弹出"
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
/* @__PURE__ */ t(
|
|
304
|
+
$,
|
|
305
|
+
{
|
|
306
|
+
checked: N.action,
|
|
307
|
+
onChange: (e) => M("action", e.target.checked),
|
|
308
|
+
children: "行动弹出"
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
/* @__PURE__ */ t(
|
|
312
|
+
$,
|
|
313
|
+
{
|
|
314
|
+
checked: N.remind,
|
|
315
|
+
onChange: (e) => M("remind", e.target.checked),
|
|
316
|
+
children: "提醒弹出"
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
] })
|
|
320
|
+
] }),
|
|
321
|
+
_ ? /* @__PURE__ */ t("p", { className: n.error, children: _ }) : null,
|
|
322
|
+
/* @__PURE__ */ t(De, { spinning: Q, children: !Q && !_ && J.length === 0 ? /* @__PURE__ */ t(_e, { description: "暂无站内信" }) : /* @__PURE__ */ t("ul", { className: n.list, children: J.map((e) => {
|
|
323
|
+
const s = ce(e.messageType), o = String(e.levelLabel || e.level || "").trim(), a = !!o, c = Ee(e.bodyHtml), f = ke(
|
|
324
|
+
Le(e),
|
|
325
|
+
!!A
|
|
326
|
+
), u = xe(e), d = Fe(e), L = !!f.primary;
|
|
327
|
+
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ m(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
className: j(
|
|
331
|
+
n.item,
|
|
332
|
+
!e.read && n.itemUnread,
|
|
333
|
+
u && n.itemStatic
|
|
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(
|
|
182
357
|
"div",
|
|
183
358
|
{
|
|
184
|
-
className:
|
|
185
|
-
dangerouslySetInnerHTML: { __html:
|
|
359
|
+
className: n.itemBodyHtml,
|
|
360
|
+
dangerouslySetInnerHTML: { __html: c }
|
|
186
361
|
}
|
|
187
|
-
) : e.summary ? /* @__PURE__ */
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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(
|
|
373
|
+
"div",
|
|
374
|
+
{
|
|
375
|
+
className: n.itemActions,
|
|
376
|
+
onClick: (p) => p.stopPropagation(),
|
|
377
|
+
onKeyDown: (p) => p.stopPropagation(),
|
|
378
|
+
children: /* @__PURE__ */ m(ae, { size: 8, wrap: !0, children: [
|
|
379
|
+
/* @__PURE__ */ t(
|
|
380
|
+
B,
|
|
381
|
+
{
|
|
382
|
+
size: "small",
|
|
383
|
+
type: "primary",
|
|
384
|
+
onClick: () => void ne(e, f.primary),
|
|
385
|
+
children: f.primary.label
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
f.secondary ? /* @__PURE__ */ t(
|
|
389
|
+
B,
|
|
390
|
+
{
|
|
391
|
+
size: "small",
|
|
392
|
+
type: "link",
|
|
393
|
+
onClick: () => void ne(e, f.secondary),
|
|
394
|
+
children: f.secondary.label
|
|
395
|
+
}
|
|
396
|
+
) : null
|
|
397
|
+
] })
|
|
398
|
+
}
|
|
399
|
+
) : null
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
) }, e.id);
|
|
403
|
+
}) }) })
|
|
199
404
|
]
|
|
200
405
|
}
|
|
201
406
|
)
|
|
202
407
|
] });
|
|
203
408
|
});
|
|
204
409
|
export {
|
|
205
|
-
|
|
410
|
+
mt as DEFAULT_INBOX_TOAST_PREFS,
|
|
411
|
+
at as default,
|
|
412
|
+
ke as filterInboxActionsForHost,
|
|
413
|
+
it as inboxSceneLabel,
|
|
414
|
+
xe as isInboxButtonDriven,
|
|
415
|
+
lt as isTerminalActionStatus,
|
|
416
|
+
Be as loadInboxToastPrefs,
|
|
417
|
+
ct as normalizeInboxActions,
|
|
418
|
+
Le as resolveInboxItemActions,
|
|
419
|
+
Pe as saveInboxToastPrefs,
|
|
420
|
+
Ce as shouldToastForMessageType
|
|
206
421
|
};
|
|
207
422
|
//# sourceMappingURL=InboxBell.js.map
|