@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.
@@ -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,9 +12,32 @@ 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
- itemList: InboxBellItem[];
39
+ /** 分页列表(Marsun list-api 唯一数组名) */
40
+ pageData: InboxBellItem[];
17
41
  total?: number;
18
42
  unreadTotal?: number;
19
43
  unreadByMessageType?: Partial<Record<string, number>>;
@@ -46,14 +70,31 @@ export type InboxBellProps = {
46
70
  className?: string;
47
71
  /** Drawer 标题 */
48
72
  title?: string;
73
+ /**
74
+ * 同源 SSE 路径(默认 `/api/v1/msg-center/inbox/stream`)。
75
+ * 传 `false` 关闭。须配合 `getAccessToken`(EventSource 用 `access_token` 查询参数传 JWT)。
76
+ * 失败回落写后刷新 / 焦点刷新,不定时轮询冒充。
77
+ */
78
+ streamPath?: string | false;
79
+ /** 返回当前 JWT;空则不开 SSE */
80
+ getAccessToken?: () => string | null | undefined;
81
+ /**
82
+ * 卡片底栏动作(认领/去执行/查看等)。不传则底栏按钮一律走 onNavigate / href。
83
+ * 业务仓拦截 claim_alert / start_action;铃铛不解析新建任务。
84
+ */
85
+ onItemAction?: (kind: InboxItemActionKind, item: InboxBellItem) => void | Promise<void>;
49
86
  };
50
87
  export type InboxBellHandle = {
51
88
  refreshBadge: () => Promise<void>;
52
89
  };
53
90
  /**
54
- * 通用站内信铃铛:列表 / 已读 / Tab / 角标。
55
- * 不含认领、行动等业务动作;由注入的 fetchInbox / markRead / onNavigate 对接消息服务。
56
- * 默认不定时轮询;有消息侧靠业务回调 / 路由 / 焦点再拉角标(真·SSE push 他窗)。
91
+ * 通用站内信铃铛:列表 / 已读 / Tab / 角标 / 卡片底栏动作 / 可选 SSE toast。
92
+ * 认领、去执行等业务动作由 `onItemAction` 注入;默认底栏按钮走 onNavigate / href。
93
+ * 默认不定时轮询;有消息侧靠业务回调 / 路由 / 焦点 / 可选 SSE 再拉角标。
57
94
  */
58
95
  declare const InboxBell: import('react').ForwardRefExoticComponent<InboxBellProps & import('react').RefAttributes<InboxBellHandle>>;
59
96
  export default InboxBell;
97
+ export { DEFAULT_INBOX_TOAST_PREFS, loadInboxToastPrefs, saveInboxToastPrefs, shouldToastForMessageType, } from './toastPrefs';
98
+ export type { InboxToastPrefs } from './toastPrefs';
99
+ export { resolveInboxItemActions, resolveInboxSceneKey, filterInboxActionsForHost, normalizeInboxActions, inboxSceneLabel, isInboxButtonDriven, isTerminalActionStatus, } from './inboxItemActions';
100
+ export type { InboxItemActionKind, InboxItemQuickAction, InboxItemActionsResolved, } from './inboxItemActions';