@mxmweb/rtext 1.0.9 → 1.0.19
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/StreamTest.d.ts +1 -0
- package/adopters/ChatMessageAdapter.d.ts +73 -0
- package/adopters/PromptTempDesigner.d.ts +2 -0
- package/assets/style.css +1 -1
- package/core/UnifiedRichText.d.ts +8 -0
- package/core/converters/deserializers.d.ts +4 -5
- package/core/richElements/RetrieveSqlDataElement.d.ts +22 -0
- package/core/richElements/ThinkElement.d.ts +8 -0
- package/core/types.d.ts +16 -1
- package/examples/gientechChat/index.d.ts +1 -0
- package/examples/templateInput/index.d.ts +1 -0
- package/index.js +40340 -8111
- package/mockdataType.d.ts +1 -0
- package/mockserverdata.d.ts +204 -0
- package/package.json +1 -1
- package/Demo_ChatMessage.d.ts +0 -1
- package/TestTemplateLeaf.d.ts +0 -3
- package/adopters/PromptTempDesignerLeaf.d.ts +0 -54
- package/core/richElements/TemplateLeaf.d.ts +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
export declare const mockServerData: {
|
|
2
|
+
data: {
|
|
3
|
+
label: string;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
gmtCreate: string;
|
|
6
|
+
gmtModified: string;
|
|
7
|
+
createBy: string;
|
|
8
|
+
updateBy: string;
|
|
9
|
+
filePath: string;
|
|
10
|
+
configId: number;
|
|
11
|
+
kbId: null;
|
|
12
|
+
queryReplyPairList: ({
|
|
13
|
+
query: {
|
|
14
|
+
id: number;
|
|
15
|
+
gmtCreate: string;
|
|
16
|
+
content: string;
|
|
17
|
+
type: string;
|
|
18
|
+
queryId: string;
|
|
19
|
+
audioUrl: string;
|
|
20
|
+
filePaths: null;
|
|
21
|
+
currentFiles: null;
|
|
22
|
+
};
|
|
23
|
+
reply: {
|
|
24
|
+
id: number;
|
|
25
|
+
gmtCreate: string;
|
|
26
|
+
content: string;
|
|
27
|
+
type: string;
|
|
28
|
+
reference: string;
|
|
29
|
+
webReference: string;
|
|
30
|
+
queryId: string;
|
|
31
|
+
feedbackResult: null;
|
|
32
|
+
feedbackId: null;
|
|
33
|
+
parsedFilePaths: null;
|
|
34
|
+
recommendQuestion: string;
|
|
35
|
+
llmType: number;
|
|
36
|
+
resultType: number;
|
|
37
|
+
respTime: number;
|
|
38
|
+
tokens: number;
|
|
39
|
+
databaseReference?: undefined;
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
query: {
|
|
43
|
+
id: number;
|
|
44
|
+
gmtCreate: string;
|
|
45
|
+
content: string;
|
|
46
|
+
type: string;
|
|
47
|
+
queryId: string;
|
|
48
|
+
audioUrl: string;
|
|
49
|
+
filePaths: null;
|
|
50
|
+
currentFiles: null;
|
|
51
|
+
};
|
|
52
|
+
reply: {
|
|
53
|
+
id: number;
|
|
54
|
+
gmtCreate: string;
|
|
55
|
+
content: string;
|
|
56
|
+
type: string;
|
|
57
|
+
reference: string;
|
|
58
|
+
webReference: string;
|
|
59
|
+
queryId: string;
|
|
60
|
+
feedbackResult: null;
|
|
61
|
+
feedbackId: null;
|
|
62
|
+
parsedFilePaths: null;
|
|
63
|
+
recommendQuestion: null;
|
|
64
|
+
llmType: number;
|
|
65
|
+
resultType: number;
|
|
66
|
+
respTime: number;
|
|
67
|
+
tokens: number;
|
|
68
|
+
databaseReference?: undefined;
|
|
69
|
+
};
|
|
70
|
+
} | {
|
|
71
|
+
query: {
|
|
72
|
+
id: number;
|
|
73
|
+
gmtCreate: string;
|
|
74
|
+
content: string;
|
|
75
|
+
type: string;
|
|
76
|
+
queryId: string;
|
|
77
|
+
audioUrl: string;
|
|
78
|
+
filePaths: null;
|
|
79
|
+
currentFiles: null;
|
|
80
|
+
};
|
|
81
|
+
reply: {
|
|
82
|
+
id: number;
|
|
83
|
+
gmtCreate: string;
|
|
84
|
+
content: string;
|
|
85
|
+
type: string;
|
|
86
|
+
reference: string;
|
|
87
|
+
webReference: string;
|
|
88
|
+
queryId: string;
|
|
89
|
+
feedbackResult: number;
|
|
90
|
+
feedbackId: number;
|
|
91
|
+
parsedFilePaths: null;
|
|
92
|
+
recommendQuestion: string;
|
|
93
|
+
llmType: number;
|
|
94
|
+
resultType: number;
|
|
95
|
+
respTime: number;
|
|
96
|
+
tokens: number;
|
|
97
|
+
databaseReference?: undefined;
|
|
98
|
+
};
|
|
99
|
+
} | {
|
|
100
|
+
query: {
|
|
101
|
+
id: number;
|
|
102
|
+
gmtCreate: string;
|
|
103
|
+
content: string;
|
|
104
|
+
type: string;
|
|
105
|
+
queryId: string;
|
|
106
|
+
audioUrl: string;
|
|
107
|
+
filePaths: null;
|
|
108
|
+
currentFiles: null;
|
|
109
|
+
};
|
|
110
|
+
reply: {
|
|
111
|
+
id: number;
|
|
112
|
+
gmtCreate: string;
|
|
113
|
+
content: string;
|
|
114
|
+
type: string;
|
|
115
|
+
reference: string;
|
|
116
|
+
webReference: string;
|
|
117
|
+
databaseReference: {
|
|
118
|
+
dataFetchUrl: string;
|
|
119
|
+
databaseName: string;
|
|
120
|
+
preData: {
|
|
121
|
+
columns: ({
|
|
122
|
+
key: string;
|
|
123
|
+
title: string;
|
|
124
|
+
dataIndex: string;
|
|
125
|
+
width: number;
|
|
126
|
+
align: string;
|
|
127
|
+
} | {
|
|
128
|
+
key: string;
|
|
129
|
+
title: string;
|
|
130
|
+
dataIndex: string;
|
|
131
|
+
width: number;
|
|
132
|
+
align?: undefined;
|
|
133
|
+
})[];
|
|
134
|
+
rows: {
|
|
135
|
+
id: number;
|
|
136
|
+
name: string;
|
|
137
|
+
age: number;
|
|
138
|
+
city: string;
|
|
139
|
+
}[];
|
|
140
|
+
};
|
|
141
|
+
source: string;
|
|
142
|
+
tableName: string;
|
|
143
|
+
total: number;
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
queryId: string;
|
|
147
|
+
feedbackResult: null;
|
|
148
|
+
feedbackId: null;
|
|
149
|
+
parsedFilePaths: null;
|
|
150
|
+
recommendQuestion: null;
|
|
151
|
+
llmType: number;
|
|
152
|
+
resultType: number;
|
|
153
|
+
respTime: number;
|
|
154
|
+
tokens: number;
|
|
155
|
+
};
|
|
156
|
+
} | {
|
|
157
|
+
query: {
|
|
158
|
+
id: number;
|
|
159
|
+
gmtCreate: string;
|
|
160
|
+
content: string;
|
|
161
|
+
type: string;
|
|
162
|
+
queryId: string;
|
|
163
|
+
audioUrl: string;
|
|
164
|
+
filePaths: null;
|
|
165
|
+
currentFiles: null;
|
|
166
|
+
};
|
|
167
|
+
reply: {
|
|
168
|
+
id: number;
|
|
169
|
+
gmtCreate: string;
|
|
170
|
+
content: string;
|
|
171
|
+
type: string;
|
|
172
|
+
reference: string;
|
|
173
|
+
webReference: string;
|
|
174
|
+
databaseReference: string;
|
|
175
|
+
queryId: string;
|
|
176
|
+
feedbackResult: null;
|
|
177
|
+
feedbackId: null;
|
|
178
|
+
parsedFilePaths: null;
|
|
179
|
+
recommendQuestion: string;
|
|
180
|
+
llmType: number;
|
|
181
|
+
resultType: number;
|
|
182
|
+
respTime: number;
|
|
183
|
+
tokens: number;
|
|
184
|
+
};
|
|
185
|
+
})[];
|
|
186
|
+
searchConfigDTO: {
|
|
187
|
+
id: number;
|
|
188
|
+
status: number;
|
|
189
|
+
isDefault: number;
|
|
190
|
+
configJson: string;
|
|
191
|
+
name: string;
|
|
192
|
+
des: null;
|
|
193
|
+
createBy: string;
|
|
194
|
+
gmtCreate: string;
|
|
195
|
+
permission: null;
|
|
196
|
+
sensitiveWordIds: string;
|
|
197
|
+
defaultAnswer: string;
|
|
198
|
+
model: boolean;
|
|
199
|
+
enabledFaq: number;
|
|
200
|
+
dependOnKb: number;
|
|
201
|
+
isDel: number;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
};
|
package/package.json
CHANGED
package/Demo_ChatMessage.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Demo_ChatMessage(): import("react/jsx-runtime").JSX.Element;
|
package/TestTemplateLeaf.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
interface PromptTempDesignerLeafProps {
|
|
3
|
-
/** 包含template标签的原始数据 */
|
|
4
|
-
data: string;
|
|
5
|
-
/** 模版内容变化回调 */
|
|
6
|
-
onChange?: (template: string) => void;
|
|
7
|
-
/** 主题样式 */
|
|
8
|
-
theme?: {
|
|
9
|
-
primaryColor?: string;
|
|
10
|
-
secondaryColor?: string;
|
|
11
|
-
backgroundColor?: string;
|
|
12
|
-
textColor?: string;
|
|
13
|
-
borderColor?: string;
|
|
14
|
-
borderRadius?: string;
|
|
15
|
-
padding?: string;
|
|
16
|
-
margin?: string;
|
|
17
|
-
};
|
|
18
|
-
/** 样式配置 */
|
|
19
|
-
styles?: {
|
|
20
|
-
/** 字间距 */
|
|
21
|
-
letterSpacing?: string;
|
|
22
|
-
/** 行间距 */
|
|
23
|
-
lineHeight?: string;
|
|
24
|
-
/** 蓝框背景样式 */
|
|
25
|
-
templateField?: {
|
|
26
|
-
backgroundColor?: string;
|
|
27
|
-
borderColor?: string;
|
|
28
|
-
borderRadius?: string;
|
|
29
|
-
padding?: string;
|
|
30
|
-
margin?: string;
|
|
31
|
-
fontSize?: string;
|
|
32
|
-
fontWeight?: string;
|
|
33
|
-
minWidth?: string;
|
|
34
|
-
/** 文字颜色 */
|
|
35
|
-
textColor?: string;
|
|
36
|
-
};
|
|
37
|
-
/** 文本样式 */
|
|
38
|
-
text?: {
|
|
39
|
-
fontSize?: string;
|
|
40
|
-
lineHeight?: string;
|
|
41
|
-
color?: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
/** 获取数据的回调函数 */
|
|
45
|
-
onGetData?: (getData: (format: 'pure_string' | 'string' | 'markdown' | 'html') => string) => void;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* 模版设计器组件(Leaf方案)
|
|
49
|
-
* 基于UnifiedRichText核心组件实现可编辑的模版字段
|
|
50
|
-
* 支持解析包含<template>标签的字符串数据
|
|
51
|
-
* 使用Leaf方案,更好的背景色和宽度控制
|
|
52
|
-
*/
|
|
53
|
-
declare const PromptTempDesignerLeaf: React.FC<PromptTempDesignerLeafProps>;
|
|
54
|
-
export default PromptTempDesignerLeaf;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
interface TemplateLeaf {
|
|
3
|
-
type: 'template';
|
|
4
|
-
id: string;
|
|
5
|
-
placeholder: string;
|
|
6
|
-
value: string;
|
|
7
|
-
style?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const TemplateLeaf: React.ForwardRefExoticComponent<{
|
|
10
|
-
leaf: TemplateLeaf;
|
|
11
|
-
attributes: any;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
styles?: any;
|
|
14
|
-
onTemplateChange?: (id: string, value: string) => void;
|
|
15
|
-
} & React.RefAttributes<HTMLSpanElement>>;
|
|
16
|
-
export default TemplateLeaf;
|