@hkyhy/marsun-components-core 0.1.11 → 0.1.15
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/README.md +31 -6
- package/dist/components/AgentHub/Chat/Action/CreateButton.js +8 -0
- package/dist/components/AgentHub/Chat/Action/CreateButton.js.map +1 -0
- package/dist/components/AgentHub/Chat/Action/ManageActionButtons.js +20 -0
- package/dist/components/AgentHub/Chat/Action/ManageActionButtons.js.map +1 -0
- package/dist/components/AgentHub/Chat/Action/SessionActionButtons.js +24 -0
- package/dist/components/AgentHub/Chat/Action/SessionActionButtons.js.map +1 -0
- package/dist/components/AgentHub/Chat/Action/handlers.d.ts +0 -5
- package/dist/components/AgentHub/Chat/Detail/ChatInput/index.js +65 -0
- package/dist/components/AgentHub/Chat/Detail/ChatInput/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/ChatInput/style.module.scss.js +12 -0
- package/dist/components/AgentHub/Chat/Detail/ChatInput/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/ChatPanel/index.d.ts +31 -0
- package/dist/components/AgentHub/Chat/Detail/ChatPanel/index.js +85 -0
- package/dist/components/AgentHub/Chat/Detail/ChatPanel/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/ChatPanel/style.module.scss.js +14 -0
- package/dist/components/AgentHub/Chat/Detail/ChatPanel/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/index.d.ts +9 -0
- package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/index.js +22 -0
- package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/style.module.scss.js +8 -0
- package/dist/components/AgentHub/Chat/Detail/ChatSuggestionRow/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationContent/index.js +21 -0
- package/dist/components/AgentHub/Chat/Detail/CitationContent/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationContent/style.module.scss.js +8 -0
- package/dist/components/AgentHub/Chat/Detail/CitationContent/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationInlineBadge/index.js +17 -0
- package/dist/components/AgentHub/Chat/Detail/CitationInlineBadge/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationInlineBadge/style.module.scss.js +7 -0
- package/dist/components/AgentHub/Chat/Detail/CitationInlineBadge/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationMarkdownContent/index.js +68 -0
- package/dist/components/AgentHub/Chat/Detail/CitationMarkdownContent/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationMarkdownContent/style.module.scss.js +7 -0
- package/dist/components/AgentHub/Chat/Detail/CitationMarkdownContent/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationPanel/index.js +247 -0
- package/dist/components/AgentHub/Chat/Detail/CitationPanel/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/CitationPanel/style.module.scss.js +31 -0
- package/dist/components/AgentHub/Chat/Detail/CitationPanel/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MermaidBlock/index.js +43 -0
- package/dist/components/AgentHub/Chat/Detail/MermaidBlock/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MermaidBlock/style.module.scss.js +8 -0
- package/dist/components/AgentHub/Chat/Detail/MermaidBlock/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MessageActions/index.js +103 -0
- package/dist/components/AgentHub/Chat/Detail/MessageActions/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MessageActions/style.module.scss.js +14 -0
- package/dist/components/AgentHub/Chat/Detail/MessageActions/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MessageEditPopover/index.js +58 -0
- package/dist/components/AgentHub/Chat/Detail/MessageEditPopover/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MessageEditPopover/style.module.scss.js +9 -0
- package/dist/components/AgentHub/Chat/Detail/MessageEditPopover/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MessageItem/index.js +309 -0
- package/dist/components/AgentHub/Chat/Detail/MessageItem/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/MessageItem/style.module.scss.js +24 -0
- package/dist/components/AgentHub/Chat/Detail/MessageItem/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/ThinkingSection/index.js +122 -0
- package/dist/components/AgentHub/Chat/Detail/ThinkingSection/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/ThinkingSection/style.module.scss.js +25 -0
- package/dist/components/AgentHub/Chat/Detail/ThinkingSection/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Detail/index.d.ts +12 -0
- package/dist/components/AgentHub/Chat/Form/Form.js +37 -0
- package/dist/components/AgentHub/Chat/Form/Form.js.map +1 -0
- package/dist/components/AgentHub/Chat/List/ChatCard/index.js +86 -0
- package/dist/components/AgentHub/Chat/List/ChatCard/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/List/ChatCard/style.module.scss.js +25 -0
- package/dist/components/AgentHub/Chat/List/ChatCard/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/List/FilterBar.js +17 -0
- package/dist/components/AgentHub/Chat/List/FilterBar.js.map +1 -0
- package/dist/components/AgentHub/Chat/List/SessionSidebar/index.js +156 -0
- package/dist/components/AgentHub/Chat/List/SessionSidebar/index.js.map +1 -0
- package/dist/components/AgentHub/Chat/List/SessionSidebar/style.module.scss.js +28 -0
- package/dist/components/AgentHub/Chat/List/SessionSidebar/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/Chat/Modal/FormModal.js +58 -0
- package/dist/components/AgentHub/Chat/Modal/FormModal.js.map +1 -0
- package/dist/components/AgentHub/Chat/hooks/useAutoScrollToBottom.js +35 -0
- package/dist/components/AgentHub/Chat/hooks/useAutoScrollToBottom.js.map +1 -0
- package/dist/components/AgentHub/Chat/hooks/useChat.js +51 -0
- package/dist/components/AgentHub/Chat/hooks/useChat.js.map +1 -0
- package/dist/components/AgentHub/Chat/hooks/useChatSessions.js +60 -0
- package/dist/components/AgentHub/Chat/hooks/useChatSessions.js.map +1 -0
- package/dist/components/AgentHub/Chat/hooks/useSSECompletion.js +69 -0
- package/dist/components/AgentHub/Chat/hooks/useSSECompletion.js.map +1 -0
- package/dist/components/AgentHub/Chat/hooks/useTypewriter.js +39 -0
- package/dist/components/AgentHub/Chat/hooks/useTypewriter.js.map +1 -0
- package/dist/components/AgentHub/Chat/index.d.ts +1 -0
- package/dist/components/AgentHub/Chat/utils/citationContent.js +169 -0
- package/dist/components/AgentHub/Chat/utils/citationContent.js.map +1 -0
- package/dist/components/AgentHub/Chat/utils/messageContent.js +85 -0
- package/dist/components/AgentHub/Chat/utils/messageContent.js.map +1 -0
- package/dist/components/AgentHub/Chat/utils/sanitizeMermaidChart.js +22 -0
- package/dist/components/AgentHub/Chat/utils/sanitizeMermaidChart.js.map +1 -0
- package/dist/components/AgentHub/Chat/utils/sessionMessages.js +151 -0
- package/dist/components/AgentHub/Chat/utils/sessionMessages.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/CreateButton.js +8 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/CreateButton.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/ManageActionButtons.js +20 -0
- package/dist/components/AgentHub/KnowledgeBase/Action/ManageActionButtons.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/DocumentTable/index.js +110 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/DocumentTable/index.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/DocumentTable/style.module.scss.js +7 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/DocumentTable/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/ParseStatusTag/index.js +18 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/ParseStatusTag/index.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/ParseStatusTag/style.module.scss.js +7 -0
- package/dist/components/AgentHub/KnowledgeBase/Detail/ParseStatusTag/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Form/Form.js +31 -0
- package/dist/components/AgentHub/KnowledgeBase/Form/Form.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/List/FilterBar.js +17 -0
- package/dist/components/AgentHub/KnowledgeBase/List/FilterBar.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/List/KnowledgeCard/index.js +118 -0
- package/dist/components/AgentHub/KnowledgeBase/List/KnowledgeCard/index.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/List/KnowledgeCard/style.module.scss.js +23 -0
- package/dist/components/AgentHub/KnowledgeBase/List/KnowledgeCard/style.module.scss.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/Modal/FormModal.js +47 -0
- package/dist/components/AgentHub/KnowledgeBase/Modal/FormModal.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/constants/types.js +28 -0
- package/dist/components/AgentHub/KnowledgeBase/constants/types.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/hooks/useKBDocuments.js +21 -0
- package/dist/components/AgentHub/KnowledgeBase/hooks/useKBDocuments.js.map +1 -0
- package/dist/components/AgentHub/KnowledgeBase/hooks/useKnowledgeBase.js +32 -0
- package/dist/components/AgentHub/KnowledgeBase/hooks/useKnowledgeBase.js.map +1 -0
- package/dist/components/Filter/FilterDateRange/index.d.ts +2 -0
- package/dist/components/Filter/FilterDateRange/index.js +62 -51
- package/dist/components/Filter/FilterDateRange/index.js.map +1 -1
- package/dist/components/Filter/FilterSelect/index.d.ts +6 -2
- package/dist/components/Filter/FilterSelect/index.js +132 -107
- package/dist/components/Filter/FilterSelect/index.js.map +1 -1
- package/dist/components/Filter/FilterTrigger/index.d.ts +2 -2
- package/dist/components/Filter/FilterTrigger/index.js.map +1 -1
- package/dist/components/Filter/FilterTrigger/style.module.scss.js +4 -4
- package/dist/components/Filter/index.d.ts +1 -1
- package/dist/components/Icons/index.js +153 -145
- package/dist/components/Icons/index.js.map +1 -1
- package/dist/components/LlmFormattedText/LlmFormattedText/index.d.ts +8 -0
- package/dist/components/LlmFormattedText/LlmFormattedText/index.js +42 -0
- package/dist/components/LlmFormattedText/LlmFormattedText/index.js.map +1 -0
- package/dist/components/LlmFormattedText/LlmFormattedText/style.module.scss.js +17 -0
- package/dist/components/LlmFormattedText/LlmFormattedText/style.module.scss.js.map +1 -0
- package/dist/components/LlmFormattedText/index.d.ts +4 -0
- package/dist/components/LlmFormattedText/parseLlmText.d.ts +14 -0
- package/dist/components/LlmFormattedText/parseLlmText.js +77 -0
- package/dist/components/LlmFormattedText/parseLlmText.js.map +1 -0
- package/dist/components/Sparkline/Sparkline/index.d.ts +11 -0
- package/dist/components/Sparkline/Sparkline/index.js +46 -0
- package/dist/components/Sparkline/Sparkline/index.js.map +1 -0
- package/dist/components/Sparkline/Sparkline/style.module.scss.js +8 -0
- package/dist/components/Sparkline/Sparkline/style.module.scss.js.map +1 -0
- package/dist/components/Sparkline/index.d.ts +2 -0
- package/dist/components/TooltipInfo/TooltipInfo.js +29 -20
- package/dist/components/TooltipInfo/TooltipInfo.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +291 -175
- package/dist/index.js.map +1 -1
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/theme/constants.d.ts +47 -1
- package/dist/theme/constants.js +50 -5
- package/dist/theme/constants.js.map +1 -1
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.js +8 -6
- package/dist/theme/theme.d.ts +10 -0
- package/dist/theme/theme.js +24 -34
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/tokens.css +139 -0
- package/package.json +6 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
"llm-formatted-text": "_llm-formatted-text_1mo0r_1",
|
|
3
|
+
"is-loading": "_is-loading_1mo0r_7",
|
|
4
|
+
"ft-spinner": "_ft-spinner_1mo0r_14",
|
|
5
|
+
"llm-ft-spin": "_llm-ft-spin_1mo0r_1",
|
|
6
|
+
"ft-summary": "_ft-summary_1mo0r_28",
|
|
7
|
+
"ft-section": "_ft-section_1mo0r_33",
|
|
8
|
+
"ft-section-title": "_ft-section-title_1mo0r_37",
|
|
9
|
+
"ft-section-icon": "_ft-section-icon_1mo0r_46",
|
|
10
|
+
"ft-list": "_ft-list_1mo0r_50",
|
|
11
|
+
"ft-num": "_ft-num_1mo0r_62",
|
|
12
|
+
"ft-paragraph": "_ft-paragraph_1mo0r_69"
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
t as default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** 将 LLM 纯文本解析为带层级的内容块 */
|
|
2
|
+
export type LlmTextSection = {
|
|
3
|
+
type: string;
|
|
4
|
+
title: string;
|
|
5
|
+
items: string[];
|
|
6
|
+
};
|
|
7
|
+
export type ParsedLlmText = {
|
|
8
|
+
summary: string;
|
|
9
|
+
sections: LlmTextSection[];
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function parseLlmText(text: string): ParsedLlmText;
|
|
13
|
+
/** 供静态 HTML 报告使用的排版 HTML */
|
|
14
|
+
export declare function formatLlmTextToHtml(text: string): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const g = [
|
|
2
|
+
{ type: "causes", titles: ["可能原因", "原因分析", "主要原因", "异常原因"] },
|
|
3
|
+
{ type: "suggestions", titles: ["建议", "改进建议", "处置建议", "应对措施", "整改建议"] },
|
|
4
|
+
{ type: "summary", titles: ["异常说明", "情况说明", "分析结论", "结论"] }
|
|
5
|
+
], d = new RegExp("(?:^|\\s)(?:[((]?\\d+[))]|[①②③④⑤⑥⑦⑧⑨⑩⑪⑫]|(?<!\\d)\\d+[、..])(?=\\s*[^\\d])", "g");
|
|
6
|
+
function h(l) {
|
|
7
|
+
return String(l || "").replace(/\r\n/g, `
|
|
8
|
+
`).replace(/[ \t]+\n/g, `
|
|
9
|
+
`).replace(/\n{3,}/g, `
|
|
10
|
+
|
|
11
|
+
`).trim();
|
|
12
|
+
}
|
|
13
|
+
function x(l) {
|
|
14
|
+
const t = l.trim();
|
|
15
|
+
if (!t) return [];
|
|
16
|
+
const i = t.split(d).map((n) => n.trim()).filter(Boolean);
|
|
17
|
+
if (i.length > 1) return i;
|
|
18
|
+
const e = t.split(/\n+/).map((n) => n.replace(/^[((]?\d+[))]\s*|^[①②③④⑤⑥⑦⑧⑨⑩]\s*|\d+[、..]\s*/, "").trim()).filter(Boolean);
|
|
19
|
+
return e.length > 1 ? e : [t];
|
|
20
|
+
}
|
|
21
|
+
function y(l) {
|
|
22
|
+
const t = h(l);
|
|
23
|
+
if (!t) return { summary: "", sections: [] };
|
|
24
|
+
if (/^(正在|思考中|分析中|加载)/.test(t) && t.length < 40)
|
|
25
|
+
return { summary: t, sections: [], loading: !0 };
|
|
26
|
+
const i = [];
|
|
27
|
+
let e = "";
|
|
28
|
+
const n = [];
|
|
29
|
+
for (const s of g)
|
|
30
|
+
for (const r of s.titles) {
|
|
31
|
+
const p = new RegExp(`(${r})[::\\s]*`, "g");
|
|
32
|
+
let c;
|
|
33
|
+
for (; (c = p.exec(t)) !== null; )
|
|
34
|
+
n.push({ type: s.type, title: r, index: c.index, len: c[0].length });
|
|
35
|
+
}
|
|
36
|
+
if (n.sort((s, r) => s.index - r.index), n.length === 0)
|
|
37
|
+
return { summary: t, sections: [] };
|
|
38
|
+
const a = n[0];
|
|
39
|
+
a.index > 0 && (e = t.slice(0, a.index).replace(/[::\s]+$/, "").trim());
|
|
40
|
+
for (let s = 0; s < n.length; s += 1) {
|
|
41
|
+
const r = n[s], p = r.index + r.len, c = n[s + 1], u = c ? c.index : t.length, m = t.slice(p, u).trim(), f = x(m);
|
|
42
|
+
i.push({
|
|
43
|
+
type: r.type,
|
|
44
|
+
title: r.title,
|
|
45
|
+
items: f.length ? f : [m]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!e && i.length) {
|
|
49
|
+
const s = a.index;
|
|
50
|
+
s > 80 && (e = t.slice(0, s).trim());
|
|
51
|
+
}
|
|
52
|
+
return !e && i.length === 0 && (e = t), { summary: e, sections: i };
|
|
53
|
+
}
|
|
54
|
+
function o(l) {
|
|
55
|
+
return l.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
56
|
+
}
|
|
57
|
+
function $(l) {
|
|
58
|
+
const t = y(l);
|
|
59
|
+
if (t.loading)
|
|
60
|
+
return `<p class="ft-loading">${o(t.summary)}</p>`;
|
|
61
|
+
const i = [];
|
|
62
|
+
t.summary && i.push(`<p class="ft-summary">${o(t.summary)}</p>`);
|
|
63
|
+
for (const e of t.sections) {
|
|
64
|
+
const n = `ft-section ft-${e.type}`, a = e.items.length > 1 ? `<ul class="ft-list">${e.items.map(
|
|
65
|
+
(s, r) => `<li><span class="ft-num">${r + 1}</span><span class="ft-item-text">${o(s)}</span></li>`
|
|
66
|
+
).join("")}</ul>` : `<p class="ft-paragraph">${o(e.items[0] || "")}</p>`;
|
|
67
|
+
i.push(
|
|
68
|
+
`<section class="${n}"><h4 class="ft-section-title">${o(e.title)}</h4>${a}</section>`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
return i.length ? `<div class="formatted-text">${i.join("")}</div>` : `<p class="ft-paragraph">${o(l || "")}</p>`;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
$ as formatLlmTextToHtml,
|
|
75
|
+
y as parseLlmText
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=parseLlmText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseLlmText.js","sources":["../../../src/components/LlmFormattedText/parseLlmText.ts"],"sourcesContent":["/** 将 LLM 纯文本解析为带层级的内容块 */\n\nconst SECTION_RULES = [\n { type: 'causes', titles: ['可能原因', '原因分析', '主要原因', '异常原因'] },\n { type: 'suggestions', titles: ['建议', '改进建议', '处置建议', '应对措施', '整改建议'] },\n { type: 'summary', titles: ['异常说明', '情况说明', '分析结论', '结论'] },\n] as const;\n\nconst LIST_ITEM_RE =\n /(?:^|\\s)(?:[((]?\\d+[))]|[①②③④⑤⑥⑦⑧⑨⑩⑪⑫]|(?<!\\d)\\d+[、..])(?=\\s*[^\\d])/g;\n\nexport type LlmTextSection = {\n type: string;\n title: string;\n items: string[];\n};\n\nexport type ParsedLlmText = {\n summary: string;\n sections: LlmTextSection[];\n loading?: boolean;\n};\n\nfunction normalizeText(text: string) {\n return String(text || '')\n .replace(/\\r\\n/g, '\\n')\n .replace(/[ \\t]+\\n/g, '\\n')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n}\n\nfunction splitListItems(block: string) {\n const trimmed = block.trim();\n if (!trimmed) return [];\n\n const parts = trimmed\n .split(LIST_ITEM_RE)\n .map((s) => s.trim())\n .filter(Boolean);\n if (parts.length > 1) return parts;\n\n const lineParts = trimmed\n .split(/\\n+/)\n .map((s) => s.replace(/^[((]?\\d+[))]\\s*|^[①②③④⑤⑥⑦⑧⑨⑩]\\s*|\\d+[、..]\\s*/, '').trim())\n .filter(Boolean);\n if (lineParts.length > 1) return lineParts;\n\n return [trimmed];\n}\n\nexport function parseLlmText(text: string): ParsedLlmText {\n const raw = normalizeText(text);\n if (!raw) return { summary: '', sections: [] };\n\n if (/^(正在|思考中|分析中|加载)/.test(raw) && raw.length < 40) {\n return { summary: raw, sections: [], loading: true };\n }\n\n const sections: LlmTextSection[] = [];\n let summary = '';\n\n const ordered: { type: string; title: string; index: number; len: number }[] = [];\n for (const rule of SECTION_RULES) {\n for (const title of rule.titles) {\n const re = new RegExp(`(${title})[::\\\\s]*`, 'g');\n let m: RegExpExecArray | null;\n while ((m = re.exec(raw)) !== null) {\n ordered.push({ type: rule.type, title, index: m.index, len: m[0].length });\n }\n }\n }\n ordered.sort((a, b) => a.index - b.index);\n\n if (ordered.length === 0) {\n return { summary: raw, sections: [] };\n }\n\n const first = ordered[0]!;\n if (first.index > 0) {\n summary = raw.slice(0, first.index).replace(/[::\\s]+$/, '').trim();\n }\n\n for (let i = 0; i < ordered.length; i += 1) {\n const cur = ordered[i]!;\n const start = cur.index + cur.len;\n const next = ordered[i + 1];\n const end = next ? next.index : raw.length;\n const body = raw.slice(start, end).trim();\n const items = splitListItems(body);\n sections.push({\n type: cur.type,\n title: cur.title,\n items: items.length ? items : [body],\n });\n }\n\n if (!summary && sections.length) {\n const firstIdx = first.index;\n if (firstIdx > 80) summary = raw.slice(0, firstIdx).trim();\n }\n\n if (!summary && sections.length === 0) summary = raw;\n\n return { summary, sections };\n}\n\nfunction escapeHtml(s: string) {\n return s\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n\n/** 供静态 HTML 报告使用的排版 HTML */\nexport function formatLlmTextToHtml(text: string) {\n const parsed = parseLlmText(text);\n if (parsed.loading) {\n return `<p class=\"ft-loading\">${escapeHtml(parsed.summary)}</p>`;\n }\n\n const parts: string[] = [];\n if (parsed.summary) {\n parts.push(`<p class=\"ft-summary\">${escapeHtml(parsed.summary)}</p>`);\n }\n for (const sec of parsed.sections) {\n const cls = `ft-section ft-${sec.type}`;\n const items =\n sec.items.length > 1\n ? `<ul class=\"ft-list\">${sec.items\n .map(\n (item, i) =>\n `<li><span class=\"ft-num\">${i + 1}</span><span class=\"ft-item-text\">${escapeHtml(item)}</span></li>`,\n )\n .join('')}</ul>`\n : `<p class=\"ft-paragraph\">${escapeHtml(sec.items[0] || '')}</p>`;\n parts.push(\n `<section class=\"${cls}\"><h4 class=\"ft-section-title\">${escapeHtml(sec.title)}</h4>${items}</section>`,\n );\n }\n if (!parts.length) {\n return `<p class=\"ft-paragraph\">${escapeHtml(text || '')}</p>`;\n }\n return `<div class=\"formatted-text\">${parts.join('')}</div>`;\n}\n"],"names":["SECTION_RULES","LIST_ITEM_RE","normalizeText","text","splitListItems","block","trimmed","parts","s","lineParts","parseLlmText","raw","sections","summary","ordered","rule","title","re","m","a","b","first","i","cur","start","next","end","body","items","firstIdx","escapeHtml","formatLlmTextToHtml","parsed","sec","cls","item"],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SparklineProps {
|
|
3
|
+
data?: number[];
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/** 极细 Sparkline — 响应式微型趋势折线 */
|
|
10
|
+
declare const Sparkline: React.FC<SparklineProps>;
|
|
11
|
+
export default Sparkline;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as y, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import g from "classnames";
|
|
3
|
+
import j from "./style.module.scss.js";
|
|
4
|
+
const N = ({
|
|
5
|
+
data: n = [],
|
|
6
|
+
width: o = 200,
|
|
7
|
+
height: e = 28,
|
|
8
|
+
color: r = "#52525b",
|
|
9
|
+
className: c
|
|
10
|
+
}) => {
|
|
11
|
+
if (!n.length) return null;
|
|
12
|
+
const t = Math.min(...n), l = Math.max(...n) - t || 1, s = 2, m = n.map((u, f) => {
|
|
13
|
+
const k = s + f / Math.max(n.length - 1, 1) * (o - s * 2), h = s + (1 - (u - t) / l) * (e - s * 2);
|
|
14
|
+
return `${k},${h}`;
|
|
15
|
+
}).join(" "), p = n[n.length - 1], a = s + (n.length - 1) / Math.max(n.length - 1, 1) * (o - s * 2), x = s + (1 - (p - t) / l) * (e - s * 2);
|
|
16
|
+
return /* @__PURE__ */ y(
|
|
17
|
+
"svg",
|
|
18
|
+
{
|
|
19
|
+
className: g("sparkline", j.sparkline, c),
|
|
20
|
+
width: "100%",
|
|
21
|
+
height: e,
|
|
22
|
+
viewBox: `0 0 ${o} ${e}`,
|
|
23
|
+
preserveAspectRatio: "none",
|
|
24
|
+
"aria-hidden": !0,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ i(
|
|
27
|
+
"polyline",
|
|
28
|
+
{
|
|
29
|
+
fill: "none",
|
|
30
|
+
stroke: r,
|
|
31
|
+
strokeWidth: "1.25",
|
|
32
|
+
strokeLinecap: "round",
|
|
33
|
+
strokeLinejoin: "round",
|
|
34
|
+
points: m,
|
|
35
|
+
opacity: "0.9"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ i("circle", { cx: a, cy: x, r: "2.5", fill: r })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
N as default
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Sparkline/Sparkline/index.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React from 'react';\nimport styles from './style.module.scss';\n\nexport interface SparklineProps {\n data?: number[];\n width?: number;\n height?: number;\n color?: string;\n className?: string;\n}\n\n/** 极细 Sparkline — 响应式微型趋势折线 */\nconst Sparkline: React.FC<SparklineProps> = ({\n data = [],\n width = 200,\n height = 28,\n color = '#52525b',\n className,\n}) => {\n if (!data.length) return null;\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n const pad = 2;\n\n const points = data\n .map((v, i) => {\n const x = pad + (i / Math.max(data.length - 1, 1)) * (width - pad * 2);\n const y = pad + (1 - (v - min) / range) * (height - pad * 2);\n return `${x},${y}`;\n })\n .join(' ');\n\n const last = data[data.length - 1]!;\n const lastX = pad + ((data.length - 1) / Math.max(data.length - 1, 1)) * (width - pad * 2);\n const lastY = pad + (1 - (last - min) / range) * (height - pad * 2);\n\n return (\n <svg\n className={classNames('sparkline', styles.sparkline, className)}\n width=\"100%\"\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"none\"\n aria-hidden\n >\n <polyline\n fill=\"none\"\n stroke={color}\n strokeWidth=\"1.25\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n points={points}\n opacity=\"0.9\"\n />\n <circle cx={lastX} cy={lastY} r=\"2.5\" fill={color} />\n </svg>\n );\n};\n\nexport default Sparkline;\n"],"names":["Sparkline","data","width","height","color","className","min","range","pad","points","v","i","x","y","last","lastX","lastY","jsxs","classNames","styles","jsx"],"mappings":";;;AAaA,MAAMA,IAAsC,CAAC;AAAA,EAC3C,MAAAC,IAAO,CAAA;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,WAAAC;AACF,MAAM;AACJ,MAAI,CAACJ,EAAK,OAAQ,QAAO;AAEzB,QAAMK,IAAM,KAAK,IAAI,GAAGL,CAAI,GAEtBM,IADM,KAAK,IAAI,GAAGN,CAAI,IACRK,KAAO,GACrBE,IAAM,GAENC,IAASR,EACZ,IAAI,CAACS,GAAGC,MAAM;AACb,UAAMC,IAAIJ,IAAOG,IAAI,KAAK,IAAIV,EAAK,SAAS,GAAG,CAAC,KAAMC,IAAQM,IAAM,IAC9DK,IAAIL,KAAO,KAAKE,IAAIJ,KAAOC,MAAUJ,IAASK,IAAM;AAC1D,WAAO,GAAGI,CAAC,IAAIC,CAAC;AAAA,EAClB,CAAC,EACA,KAAK,GAAG,GAELC,IAAOb,EAAKA,EAAK,SAAS,CAAC,GAC3Bc,IAAQP,KAAQP,EAAK,SAAS,KAAK,KAAK,IAAIA,EAAK,SAAS,GAAG,CAAC,KAAMC,IAAQM,IAAM,IAClFQ,IAAQR,KAAO,KAAKM,IAAOR,KAAOC,MAAUJ,IAASK,IAAM;AAEjE,SACE,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAW,aAAaC,EAAO,WAAWd,CAAS;AAAA,MAC9D,OAAM;AAAA,MACN,QAAAF;AAAA,MACA,SAAS,OAAOD,CAAK,IAAIC,CAAM;AAAA,MAC/B,qBAAoB;AAAA,MACpB,eAAW;AAAA,MAEX,UAAA;AAAA,QAAA,gBAAAiB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,QAAQhB;AAAA,YACR,aAAY;AAAA,YACZ,eAAc;AAAA,YACd,gBAAe;AAAA,YACf,QAAAK;AAAA,YACA,SAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAEV,gBAAAW,EAAC,YAAO,IAAIL,GAAO,IAAIC,GAAO,GAAE,OAAM,MAAMZ,EAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGzD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import { Tooltip as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsx as o, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as m } from "antd";
|
|
3
|
+
import x from "../Descriptions/CommonDescriptions.js";
|
|
4
|
+
const b = ({
|
|
5
5
|
content: t,
|
|
6
|
-
children:
|
|
7
|
-
column:
|
|
8
|
-
hidden:
|
|
9
|
-
placement:
|
|
6
|
+
children: r,
|
|
7
|
+
column: i = 1,
|
|
8
|
+
hidden: a = !1,
|
|
9
|
+
placement: e = "top",
|
|
10
10
|
overlayClassName: p,
|
|
11
|
-
overlayStyle:
|
|
12
|
-
mouseEnterDelay:
|
|
13
|
-
...
|
|
14
|
-
}) =>
|
|
15
|
-
|
|
11
|
+
overlayStyle: n,
|
|
12
|
+
mouseEnterDelay: l = 0.3,
|
|
13
|
+
...f
|
|
14
|
+
}) => a || t.length === 0 ? /* @__PURE__ */ o(s, { children: r }) : /* @__PURE__ */ o(
|
|
15
|
+
m,
|
|
16
16
|
{
|
|
17
|
-
placement:
|
|
18
|
-
mouseEnterDelay:
|
|
17
|
+
placement: e,
|
|
18
|
+
mouseEnterDelay: l,
|
|
19
19
|
destroyOnHidden: !0,
|
|
20
20
|
classNames: { root: ["tooltip-info-overlay", p].filter(Boolean).join(" ") },
|
|
21
|
-
styles: {
|
|
21
|
+
styles: {
|
|
22
|
+
container: {
|
|
23
|
+
maxWidth: 360,
|
|
24
|
+
padding: "8px 12px",
|
|
25
|
+
background: "var(--tooltip-info-bg, var(--bg-color-white, #ffffff))",
|
|
26
|
+
color: "var(--tooltip-info-color, var(--font-color, #222222))",
|
|
27
|
+
boxShadow: "0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12)",
|
|
28
|
+
...n
|
|
29
|
+
}
|
|
30
|
+
},
|
|
22
31
|
getPopupContainer: () => document.body,
|
|
23
|
-
title: /* @__PURE__ */ o(
|
|
24
|
-
...
|
|
25
|
-
children:
|
|
32
|
+
title: /* @__PURE__ */ o(x, { content: t, column: i, size: "small" }),
|
|
33
|
+
...f,
|
|
34
|
+
children: r
|
|
26
35
|
}
|
|
27
36
|
);
|
|
28
37
|
export {
|
|
29
|
-
|
|
38
|
+
b as default
|
|
30
39
|
};
|
|
31
40
|
//# sourceMappingURL=TooltipInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipInfo.js","sources":["../../../src/components/TooltipInfo/TooltipInfo.tsx"],"sourcesContent":["import type { TooltipProps } from 'antd';\nimport { Tooltip } from 'antd';\nimport React from 'react';\nimport type { DescriptionItem } from '../Descriptions/CommonDescriptions';\nimport CommonDescriptions from '../Descriptions/CommonDescriptions';\nimport './style.module.scss';\n\nexport interface TooltipInfoProps extends Pick<\n TooltipProps,\n 'placement' | 'mouseEnterDelay' | 'mouseLeaveDelay'\n> {\n /** 详情描述项,内部使用 CommonDescriptions 渲染 */\n content: DescriptionItem[];\n children: React.ReactNode;\n /** CommonDescriptions 列数,默认 1 */\n column?: number;\n /** 为 true 或 content 为空时不展示 Tooltip */\n hidden?: boolean;\n /** @deprecated 使用 classNames.root */\n overlayClassName?: string;\n /** @deprecated 使用 styles.root */\n overlayStyle?: React.CSSProperties;\n}\n\n/** Tooltip 详情展示,内部统一使用 CommonDescriptions */\nconst TooltipInfo: React.FC<TooltipInfoProps> = ({\n content,\n children,\n column = 1,\n hidden = false,\n placement = 'top',\n overlayClassName,\n overlayStyle,\n mouseEnterDelay = 0.3,\n ...rest\n}) => {\n if (hidden || content.length === 0) {\n return <>{children}</>;\n }\n\n return (\n <Tooltip\n placement={placement}\n mouseEnterDelay={mouseEnterDelay}\n destroyOnHidden\n classNames={{ root: ['tooltip-info-overlay', overlayClassName].filter(Boolean).join(' ') }}\n styles={{
|
|
1
|
+
{"version":3,"file":"TooltipInfo.js","sources":["../../../src/components/TooltipInfo/TooltipInfo.tsx"],"sourcesContent":["import type { TooltipProps } from 'antd';\nimport { Tooltip } from 'antd';\nimport React from 'react';\nimport type { DescriptionItem } from '../Descriptions/CommonDescriptions';\nimport CommonDescriptions from '../Descriptions/CommonDescriptions';\nimport './style.module.scss';\n\nexport interface TooltipInfoProps extends Pick<\n TooltipProps,\n 'placement' | 'mouseEnterDelay' | 'mouseLeaveDelay'\n> {\n /** 详情描述项,内部使用 CommonDescriptions 渲染 */\n content: DescriptionItem[];\n children: React.ReactNode;\n /** CommonDescriptions 列数,默认 1 */\n column?: number;\n /** 为 true 或 content 为空时不展示 Tooltip */\n hidden?: boolean;\n /** @deprecated 使用 classNames.root */\n overlayClassName?: string;\n /** @deprecated 使用 styles.root */\n overlayStyle?: React.CSSProperties;\n}\n\n/** Tooltip 详情展示,内部统一使用 CommonDescriptions */\nconst TooltipInfo: React.FC<TooltipInfoProps> = ({\n content,\n children,\n column = 1,\n hidden = false,\n placement = 'top',\n overlayClassName,\n overlayStyle,\n mouseEnterDelay = 0.3,\n ...rest\n}) => {\n if (hidden || content.length === 0) {\n return <>{children}</>;\n }\n\n return (\n <Tooltip\n placement={placement}\n mouseEnterDelay={mouseEnterDelay}\n destroyOnHidden\n classNames={{ root: ['tooltip-info-overlay', overlayClassName].filter(Boolean).join(' ') }}\n styles={{\n container: {\n maxWidth: 360,\n padding: '8px 12px',\n background: 'var(--tooltip-info-bg, var(--bg-color-white, #ffffff))',\n color: 'var(--tooltip-info-color, var(--font-color, #222222))',\n boxShadow:\n '0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12)',\n ...overlayStyle,\n },\n }}\n getPopupContainer={() => document.body}\n title={<CommonDescriptions content={content} column={column} size=\"small\" />}\n {...rest}\n >\n {children}\n </Tooltip>\n );\n};\n\nexport default TooltipInfo;\n"],"names":["TooltipInfo","content","children","column","hidden","placement","overlayClassName","overlayStyle","mouseEnterDelay","rest","jsx","Tooltip","CommonDescriptions"],"mappings":";;;AAyBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,GAAGC;AACL,MACML,KAAUH,EAAQ,WAAW,2BACrB,UAAAC,GAAS,IAInB,gBAAAQ;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAAN;AAAA,IACA,iBAAAG;AAAA,IACA,iBAAe;AAAA,IACf,YAAY,EAAE,MAAM,CAAC,wBAAwBF,CAAgB,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAAA;AAAA,IACvF,QAAQ;AAAA,MACN,WAAW;AAAA,QACT,UAAU;AAAA,QACV,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,WACE;AAAA,QACF,GAAGC;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,mBAAmB,MAAM,SAAS;AAAA,IAClC,OAAO,gBAAAG,EAACE,GAAA,EAAmB,SAAAX,GAAkB,QAAAE,GAAgB,MAAK,SAAQ;AAAA,IACzE,GAAGM;AAAA,IAEH,UAAAP;AAAA,EAAA;AAAA;"}
|
|
@@ -13,3 +13,5 @@ export { default as CommonUpload } from './Upload';
|
|
|
13
13
|
export type { CommonUploadProps, CommonUploadRef, UploadVariant } from './Upload';
|
|
14
14
|
export * from './VirtualScrollbar';
|
|
15
15
|
export * from './Icons';
|
|
16
|
+
export * from './Sparkline';
|
|
17
|
+
export * from './LlmFormattedText';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { MarsunCoreProvider, useMarsunAuth, useMarsunCore, useMarsunFetch } from './provider';
|
|
2
2
|
export type { MarsunCoreProviderProps, MarsunAuthContext, MarsunFetchContext } from './provider';
|
|
3
|
-
export { generateTheme, applyThemeToCssVariables, DEFAULT_PRIMARY_COLOR, PALETTE } from './theme';
|
|
3
|
+
export { generateTheme, applyThemeToCssVariables, applyCssTokenOverrides, DEFAULT_PRIMARY_COLOR, PALETTE, LAYOUT_TOKENS, } from './theme';
|
|
4
4
|
export { useFetchData, fetchWithTimeout } from './hooks/useFetchData';
|
|
5
5
|
export type { FetchDataOptions, FetchDataResult } from './hooks/useFetchData';
|
|
6
6
|
export { resolveMaybeFn, resolveVisible, type MaybeFn, type Visibility, } from './utils/resolveMaybeFn';
|
|
@@ -20,7 +20,11 @@ export { default as CommonUpload } from './components/Upload';
|
|
|
20
20
|
export type { CommonUploadProps, CommonUploadRef, UploadVariant } from './components/Upload';
|
|
21
21
|
export * from './components/VirtualScrollbar';
|
|
22
22
|
export * from './components/Icons';
|
|
23
|
+
export * from './components/Sparkline';
|
|
24
|
+
export * from './components/LlmFormattedText';
|
|
23
25
|
export { default as AgentHubAccessGuard } from './components/AgentHub/AgentHubAccessGuard';
|
|
24
26
|
export { default as AgentHubIndexRedirect } from './components/AgentHub/AgentHubIndexRedirect';
|
|
25
27
|
export { default as AgentHubSessionAccessGuard } from './components/AgentHub/ChatSessionAccessGuard';
|
|
26
28
|
export type * from './components/AgentHub/types';
|
|
29
|
+
export * from './components/AgentHub/Chat';
|
|
30
|
+
export * from './components/AgentHub/KnowledgeBase';
|