@mxmweb/rtext 1.3.9 → 1.4.2
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/adopters/ChatMessageAdapter.d.ts +34 -0
- package/assets/style.css +1 -1
- package/containers/KnowledgeBaseDocumentList.d.ts +9 -0
- package/containers/ThoughtChainContainer.d.ts +12 -0
- package/elements/ThoughtChainSection.d.ts +14 -0
- package/examples/thoughtChainDemo/index.d.ts +3 -0
- package/index.js +10583 -10016
- package/knowledge_base_types.d.ts +71 -0
- package/lib_enter.d.ts +2 -0
- package/mockserverdata.d.ts +111 -2
- package/package.json +1 -1
- package/stats.html +1 -1
- package/thought_chain_types.d.ts +64 -0
- package/utils/thought_chain_mapper.d.ts +38 -0
- package/examples/sseDemo/index.d.ts +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 知识库文档列表相关的类型定义
|
|
4
|
+
* 2025-12-19 新增: 根据UI设计图定义知识库文档列表的数据结构
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 知识库文档分类项
|
|
8
|
+
* 用于展示按目录分类的文档列表
|
|
9
|
+
*/
|
|
10
|
+
export interface KnowledgeBaseCategory {
|
|
11
|
+
/** 分类唯一标识 */
|
|
12
|
+
id: string | number;
|
|
13
|
+
/** 分类名称,例如:"信贷制度"、"风控规范"等 */
|
|
14
|
+
name: string;
|
|
15
|
+
/** 该分类下的文档数量 */
|
|
16
|
+
documentCount: number;
|
|
17
|
+
/** 分类图标URL或图标组件标识(可选,默认使用黄色文件夹图标) */
|
|
18
|
+
icon?: string | React.ReactNode;
|
|
19
|
+
/** 分类描述(可选) */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** 分类路径或路由(可选,用于点击跳转) */
|
|
22
|
+
path?: string;
|
|
23
|
+
/** 是否显示(可选,用于控制某些分类的显示/隐藏) */
|
|
24
|
+
visible?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 知识库文档列表数据
|
|
28
|
+
* 包含标题、分类列表和总文档数等信息
|
|
29
|
+
*/
|
|
30
|
+
export interface KnowledgeBaseDocumentList {
|
|
31
|
+
/** 列表标题,例如:"知识库文档列表" */
|
|
32
|
+
title: string;
|
|
33
|
+
/** 副标题文本,例如:"按目录分类" */
|
|
34
|
+
subtitle?: string;
|
|
35
|
+
/** 总文档数量 */
|
|
36
|
+
totalCount: number;
|
|
37
|
+
/** 分类列表 */
|
|
38
|
+
categories: KnowledgeBaseCategory[];
|
|
39
|
+
/** 是否显示"查看全部"链接 */
|
|
40
|
+
showViewAll?: boolean;
|
|
41
|
+
/** "查看全部"链接的文本,默认为"查看全部>>" */
|
|
42
|
+
viewAllText?: string;
|
|
43
|
+
/** "查看全部"链接的路径或回调函数 */
|
|
44
|
+
viewAllPath?: string | (() => void);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 知识库文档列表组件的Props
|
|
48
|
+
* 用于渲染知识库文档列表UI组件
|
|
49
|
+
*/
|
|
50
|
+
export interface KnowledgeBaseDocumentListProps {
|
|
51
|
+
/** 文档列表数据 */
|
|
52
|
+
data: KnowledgeBaseDocumentList;
|
|
53
|
+
/** 主题样式 */
|
|
54
|
+
styles?: {
|
|
55
|
+
theme?: any;
|
|
56
|
+
mode?: 'light' | 'dark';
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
};
|
|
59
|
+
/** 分类项点击回调 */
|
|
60
|
+
onCategoryClick?: (category: KnowledgeBaseCategory) => void;
|
|
61
|
+
/** "查看全部"点击回调 */
|
|
62
|
+
onViewAllClick?: () => void;
|
|
63
|
+
/** 自定义样式类名 */
|
|
64
|
+
className?: string;
|
|
65
|
+
/** 自定义样式对象 */
|
|
66
|
+
style?: React.CSSProperties;
|
|
67
|
+
/** 是否显示分类图标 */
|
|
68
|
+
showCategoryIcon?: boolean;
|
|
69
|
+
/** 自定义分类图标渲染函数 */
|
|
70
|
+
renderCategoryIcon?: (category: KnowledgeBaseCategory) => React.ReactNode;
|
|
71
|
+
}
|
package/lib_enter.d.ts
CHANGED
|
@@ -7,3 +7,5 @@ export { default as ChatMessageAdapter } from './adopters/ChatMessageAdapter';
|
|
|
7
7
|
export { default as Markdownit } from './adopters/Markdownit';
|
|
8
8
|
export { default as PromptTempDesigner } from './adopters/PromptTempDesigner';
|
|
9
9
|
export type { SegmentData, MarkdownitProps } from './adopters/Markdownit';
|
|
10
|
+
export { mergeLiveChunkToNodes, mapReplyChainToNodes } from './utils/thought_chain_mapper';
|
|
11
|
+
export type { ThoughtNode, ThoughtBusinessType, ThoughtNodeStatus, ThoughtChainRenderMode, ThoughtChainVersionMode } from './thought_chain_types';
|
package/mockserverdata.d.ts
CHANGED
|
@@ -12,7 +12,114 @@ export declare const mockServerData: {
|
|
|
12
12
|
filePath: string;
|
|
13
13
|
configId: number;
|
|
14
14
|
kbId: null;
|
|
15
|
-
queryReplyPairList: {
|
|
15
|
+
queryReplyPairList: ({
|
|
16
|
+
query: {
|
|
17
|
+
id: string;
|
|
18
|
+
gmtCreate: number;
|
|
19
|
+
content: string;
|
|
20
|
+
type: string;
|
|
21
|
+
queryId: string;
|
|
22
|
+
audioUrl: string;
|
|
23
|
+
filePaths: null;
|
|
24
|
+
currentFiles: null;
|
|
25
|
+
};
|
|
26
|
+
reply: {
|
|
27
|
+
id: string;
|
|
28
|
+
gmtCreate: number;
|
|
29
|
+
content: string;
|
|
30
|
+
type: string;
|
|
31
|
+
reference: string;
|
|
32
|
+
webReference: string;
|
|
33
|
+
queryId: string;
|
|
34
|
+
feedbackResult: null;
|
|
35
|
+
feedbackId: null;
|
|
36
|
+
parsedFilePaths: null;
|
|
37
|
+
recommendQuestion: string;
|
|
38
|
+
llmType: number;
|
|
39
|
+
resultType: number;
|
|
40
|
+
respTime: number;
|
|
41
|
+
databaseReference: null;
|
|
42
|
+
chain: {
|
|
43
|
+
sessionId: null;
|
|
44
|
+
queryId: null;
|
|
45
|
+
lastDate: null;
|
|
46
|
+
status: number;
|
|
47
|
+
reply: {
|
|
48
|
+
content: null;
|
|
49
|
+
type: string;
|
|
50
|
+
errorMsg: null;
|
|
51
|
+
errorCode: null;
|
|
52
|
+
};
|
|
53
|
+
reference: null;
|
|
54
|
+
webReference: null;
|
|
55
|
+
databaseReference: null;
|
|
56
|
+
docsTree: null;
|
|
57
|
+
resultType: null;
|
|
58
|
+
filePaths: null;
|
|
59
|
+
respTime: null;
|
|
60
|
+
tokens: number;
|
|
61
|
+
promptContent: null;
|
|
62
|
+
llmType: number;
|
|
63
|
+
businessType: string;
|
|
64
|
+
nodeStatus: number;
|
|
65
|
+
}[];
|
|
66
|
+
tokens: number;
|
|
67
|
+
knowledgeBases?: undefined;
|
|
68
|
+
};
|
|
69
|
+
} | {
|
|
70
|
+
query: {
|
|
71
|
+
id: string;
|
|
72
|
+
gmtCreate: number;
|
|
73
|
+
content: string;
|
|
74
|
+
type: string;
|
|
75
|
+
queryId: string;
|
|
76
|
+
audioUrl: string;
|
|
77
|
+
filePaths: null;
|
|
78
|
+
currentFiles: null;
|
|
79
|
+
};
|
|
80
|
+
reply: {
|
|
81
|
+
id: string;
|
|
82
|
+
gmtCreate: number;
|
|
83
|
+
content: string;
|
|
84
|
+
type: string;
|
|
85
|
+
chain: {
|
|
86
|
+
businessType: string;
|
|
87
|
+
nodeStatus: number;
|
|
88
|
+
content: string;
|
|
89
|
+
type: string;
|
|
90
|
+
}[];
|
|
91
|
+
reference: string;
|
|
92
|
+
webReference: string;
|
|
93
|
+
queryId: string;
|
|
94
|
+
knowledgeBases: {
|
|
95
|
+
knowledgeBaseName: string;
|
|
96
|
+
treeData: ({
|
|
97
|
+
name: string;
|
|
98
|
+
type: string;
|
|
99
|
+
fileCount: number;
|
|
100
|
+
fileType?: undefined;
|
|
101
|
+
fetchUrl?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
name: string;
|
|
104
|
+
type: string;
|
|
105
|
+
fileType: string;
|
|
106
|
+
fetchUrl: string;
|
|
107
|
+
fileCount?: undefined;
|
|
108
|
+
})[];
|
|
109
|
+
totalFileCount: number;
|
|
110
|
+
fetchUrl: string;
|
|
111
|
+
}[];
|
|
112
|
+
feedbackResult: null;
|
|
113
|
+
feedbackId: null;
|
|
114
|
+
parsedFilePaths: null;
|
|
115
|
+
recommendQuestion: string;
|
|
116
|
+
llmType: number;
|
|
117
|
+
resultType: number;
|
|
118
|
+
respTime: number;
|
|
119
|
+
databaseReference: null;
|
|
120
|
+
tokens: number;
|
|
121
|
+
};
|
|
122
|
+
} | {
|
|
16
123
|
query: {
|
|
17
124
|
id: number;
|
|
18
125
|
gmtCreate: string;
|
|
@@ -40,8 +147,10 @@ export declare const mockServerData: {
|
|
|
40
147
|
respTime: number;
|
|
41
148
|
databaseReference: null;
|
|
42
149
|
tokens: number;
|
|
150
|
+
chain?: undefined;
|
|
151
|
+
knowledgeBases?: undefined;
|
|
43
152
|
};
|
|
44
|
-
}[];
|
|
153
|
+
})[];
|
|
45
154
|
searchConfigDTO: {
|
|
46
155
|
id: number;
|
|
47
156
|
status: number;
|