bhd-components 0.10.12 → 0.10.14
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 +1 -1
- package/dist/index.esm.es5.development.css +768 -0
- package/dist/index.esm.es5.development.js +3133 -159
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +2515 -1100
- package/dist/vendor.esm.es5.production.js +136 -136
- package/es2017/AIMessageList/components/content/index.d.ts +4 -0
- package/es2017/AIMessageList/components/content/index.js +29 -0
- package/es2017/AIMessageList/components/content/index.module.less +8 -0
- package/es2017/AIMessageList/components/copyIcon/index.d.ts +7 -0
- package/es2017/AIMessageList/components/copyIcon/index.js +73 -0
- package/es2017/AIMessageList/components/copyIcon/index.module.less +23 -0
- package/es2017/AIMessageList/components/errorCallback/index.d.ts +3 -0
- package/es2017/AIMessageList/components/errorCallback/index.js +6 -0
- package/es2017/AIMessageList/components/fileList/fileIcon.d.ts +3 -0
- package/es2017/AIMessageList/components/fileList/fileIcon.js +970 -0
- package/es2017/AIMessageList/components/fileList/index.d.ts +4 -0
- package/es2017/AIMessageList/components/fileList/index.js +315 -0
- package/es2017/AIMessageList/components/fileList/index.module.less +95 -0
- package/es2017/AIMessageList/components/footer/index.d.ts +10 -0
- package/es2017/AIMessageList/components/footer/index.js +402 -0
- package/es2017/AIMessageList/components/footer/index.module.less +51 -0
- package/es2017/AIMessageList/components/header/index.d.ts +9 -0
- package/es2017/AIMessageList/components/header/index.js +94 -0
- package/es2017/AIMessageList/components/header/index.module.less +31 -0
- package/es2017/AIMessageList/components/referencesIcon/index.d.ts +9 -0
- package/es2017/AIMessageList/components/referencesIcon/index.js +63 -0
- package/es2017/AIMessageList/components/referencesIcon/index.module.less +14 -0
- package/es2017/AIMessageList/components/refreshBtn/index.d.ts +4 -0
- package/es2017/AIMessageList/components/refreshBtn/index.js +29 -0
- package/es2017/AIMessageList/components/refreshBtn/index.module.less +12 -0
- package/es2017/AIMessageList/components/remarkBtn/index.d.ts +4 -0
- package/es2017/AIMessageList/components/remarkBtn/index.js +51 -0
- package/es2017/AIMessageList/components/remarkBtn/index.module.less +13 -0
- package/es2017/AIMessageList/components/renderReferrnce/index.d.ts +10 -0
- package/es2017/AIMessageList/components/renderReferrnce/index.js +68 -0
- package/es2017/AIMessageList/components/renderReferrnce/index.module.less +64 -0
- package/es2017/AIMessageList/components/sendBtn/index.d.ts +4 -0
- package/es2017/AIMessageList/components/sendBtn/index.js +51 -0
- package/es2017/AIMessageList/components/sendBtn/index.module.less +25 -0
- package/es2017/AIMessageList/components/uplodaFileBtn/index.d.ts +4 -0
- package/es2017/AIMessageList/components/uplodaFileBtn/index.js +33 -0
- package/es2017/AIMessageList/components/uplodaFileBtn/index.module.less +5 -0
- package/es2017/AIMessageList/components/virtuosoList/index.d.ts +5 -0
- package/es2017/AIMessageList/components/virtuosoList/index.js +696 -0
- package/es2017/AIMessageList/components/virtuosoList/index.module.less +467 -0
- package/es2017/AIMessageList/index.d.ts +4 -0
- package/es2017/AIMessageList/index.js +58 -0
- package/es2017/AIMessageList/index.module.less +20 -0
- package/es2017/AIMessageList/type.d.ts +307 -0
- package/es2017/customerService/index.js +1 -0
- package/es2017/images/loading2.js +2 -0
- package/es2017/index.d.ts +1 -0
- package/es2017/index.js +1 -0
- package/es2017/utils/Date.d.ts +2 -1
- package/es2017/utils/Date.js +2 -1
- package/es2017/utils/dom.d.ts +4 -1
- package/es2017/utils/dom.js +44 -1
- package/es2017/utils/number.d.ts +1 -0
- package/es2017/utils/number.js +9 -0
- package/esm/AIMessageList/components/content/index.d.ts +4 -0
- package/esm/AIMessageList/components/content/index.js +29 -0
- package/esm/AIMessageList/components/content/index.module.less +8 -0
- package/esm/AIMessageList/components/copyIcon/index.d.ts +7 -0
- package/esm/AIMessageList/components/copyIcon/index.js +76 -0
- package/esm/AIMessageList/components/copyIcon/index.module.less +23 -0
- package/esm/AIMessageList/components/errorCallback/index.d.ts +3 -0
- package/esm/AIMessageList/components/errorCallback/index.js +6 -0
- package/esm/AIMessageList/components/fileList/fileIcon.d.ts +3 -0
- package/esm/AIMessageList/components/fileList/fileIcon.js +970 -0
- package/esm/AIMessageList/components/fileList/index.d.ts +4 -0
- package/esm/AIMessageList/components/fileList/index.js +337 -0
- package/esm/AIMessageList/components/fileList/index.module.less +95 -0
- package/esm/AIMessageList/components/footer/index.d.ts +10 -0
- package/esm/AIMessageList/components/footer/index.js +418 -0
- package/esm/AIMessageList/components/footer/index.module.less +51 -0
- package/esm/AIMessageList/components/header/index.d.ts +9 -0
- package/esm/AIMessageList/components/header/index.js +96 -0
- package/esm/AIMessageList/components/header/index.module.less +31 -0
- package/esm/AIMessageList/components/referencesIcon/index.d.ts +9 -0
- package/esm/AIMessageList/components/referencesIcon/index.js +65 -0
- package/esm/AIMessageList/components/referencesIcon/index.module.less +14 -0
- package/esm/AIMessageList/components/refreshBtn/index.d.ts +4 -0
- package/esm/AIMessageList/components/refreshBtn/index.js +31 -0
- package/esm/AIMessageList/components/refreshBtn/index.module.less +12 -0
- package/esm/AIMessageList/components/remarkBtn/index.d.ts +4 -0
- package/esm/AIMessageList/components/remarkBtn/index.js +51 -0
- package/esm/AIMessageList/components/remarkBtn/index.module.less +13 -0
- package/esm/AIMessageList/components/renderReferrnce/index.d.ts +10 -0
- package/esm/AIMessageList/components/renderReferrnce/index.js +72 -0
- package/esm/AIMessageList/components/renderReferrnce/index.module.less +64 -0
- package/esm/AIMessageList/components/sendBtn/index.d.ts +4 -0
- package/esm/AIMessageList/components/sendBtn/index.js +53 -0
- package/esm/AIMessageList/components/sendBtn/index.module.less +25 -0
- package/esm/AIMessageList/components/uplodaFileBtn/index.d.ts +4 -0
- package/esm/AIMessageList/components/uplodaFileBtn/index.js +33 -0
- package/esm/AIMessageList/components/uplodaFileBtn/index.module.less +5 -0
- package/esm/AIMessageList/components/virtuosoList/index.d.ts +5 -0
- package/esm/AIMessageList/components/virtuosoList/index.js +673 -0
- package/esm/AIMessageList/components/virtuosoList/index.module.less +467 -0
- package/esm/AIMessageList/index.d.ts +4 -0
- package/esm/AIMessageList/index.js +58 -0
- package/esm/AIMessageList/index.module.less +20 -0
- package/esm/AIMessageList/type.d.ts +307 -0
- package/esm/customerService/index.js +1 -0
- package/esm/images/loading2.js +2 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/utils/Date.d.ts +2 -1
- package/esm/utils/Date.js +2 -1
- package/esm/utils/dom.d.ts +4 -1
- package/esm/utils/dom.js +45 -1
- package/esm/utils/number.d.ts +1 -0
- package/esm/utils/number.js +9 -0
- package/package.json +2 -1
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
export interface AIMessageListProps {
|
|
2
|
+
prefix?: string; // 类名前缀 默认为 "bhd-AIMessageList"
|
|
3
|
+
className?: string; //全局的className
|
|
4
|
+
headerConfig: headerConfigProps;
|
|
5
|
+
footerConfig: footerConfigProps;
|
|
6
|
+
contentConfig: contentConfigProps;
|
|
7
|
+
errorCallback?: (error: errorMessageProps) => void;
|
|
8
|
+
|
|
9
|
+
// sendMsgAjax: () => any; //发送消息
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AIMessageListRefProps {
|
|
13
|
+
footerApi: footerRefProps;
|
|
14
|
+
contentApi: contentRefProps;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// header Props
|
|
18
|
+
|
|
19
|
+
export interface headerConfigProps {
|
|
20
|
+
icon?: React.ReactNode; // 不传存在默认图标
|
|
21
|
+
title: React.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
renderRightHead?: () => React.ReactNode; // 右侧区域的自定义渲染
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface msgActionProps {
|
|
27
|
+
renderLeft?: (
|
|
28
|
+
copyNode: React.ReactNode,
|
|
29
|
+
referencesNode: React.ReactNode,
|
|
30
|
+
upVoteNode: React.ReactNode,
|
|
31
|
+
downVoteNode: React.ReactNode,
|
|
32
|
+
refreshNode:React.ReactNode,
|
|
33
|
+
) => React.ReactNode;
|
|
34
|
+
renderRight?: (
|
|
35
|
+
copyNode: React.ReactNode,
|
|
36
|
+
referencesNode: React.ReactNode,
|
|
37
|
+
upVoteNode: React.ReactNode,
|
|
38
|
+
downVoteNode: React.ReactNode,
|
|
39
|
+
refreshNode:React.ReactNode,
|
|
40
|
+
) => React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface contentConfigProps {
|
|
44
|
+
className?: string;
|
|
45
|
+
msgAction?: string[] | msgActionProps;
|
|
46
|
+
// transformItem:(item: any) => dataItemType;
|
|
47
|
+
getList: (
|
|
48
|
+
page: number,
|
|
49
|
+
pageSize: number
|
|
50
|
+
) => Promise<{
|
|
51
|
+
total: number;
|
|
52
|
+
dataSource: dataItemType[];
|
|
53
|
+
}>; // 列表数据
|
|
54
|
+
loadMore?: boolean; // 是否开启加载更多 // 默认为true
|
|
55
|
+
helloMsg?: string; //欢迎语
|
|
56
|
+
pageSize?: number; //每页数量 默认为30
|
|
57
|
+
coverRenderText?: (item, html) => React.ReactNode; // 覆盖文本内容
|
|
58
|
+
coverRenderReferences?: (
|
|
59
|
+
item: dataItemType,
|
|
60
|
+
referenceNode: React.ReactNode
|
|
61
|
+
) => React.ReactNode; //覆盖引用内容
|
|
62
|
+
onRecordMessage?: (item: dataItemType) => void; // 发送和接收的消息记录
|
|
63
|
+
onVoteChange?: (type:string,item: dataItemType) => void; // 点赞 或踩
|
|
64
|
+
onRefresh?: (item:dataItemType) => void;// 刷新
|
|
65
|
+
fileCustomRender?: {// 文件对象的自定义渲染
|
|
66
|
+
iconFileRender?: (suffix: string) => React.ReactNode; // 文件上传的 icon。参数 文件对象file 返回值为图标
|
|
67
|
+
fileTitleRender?: (item: dataItemType) => React.ReactNode;
|
|
68
|
+
fileBottomRender?: (item: dataItemType) => React.ReactNode;
|
|
69
|
+
fileRender?: (item: dataItemType) => React.ReactNode;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// content props
|
|
74
|
+
|
|
75
|
+
export interface contentProps {
|
|
76
|
+
prefix: string;
|
|
77
|
+
contentConfig: contentConfigProps;
|
|
78
|
+
apiRef: AIMessageListRefProps;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// footer Props
|
|
82
|
+
|
|
83
|
+
export interface footerConfigProps {
|
|
84
|
+
placeholder?: string; // placeholder 默认值为“请输入内容”
|
|
85
|
+
className?: string;
|
|
86
|
+
maxLength?: number | ((value: string) => boolean); //字符长度 默认500
|
|
87
|
+
renderAction?: (
|
|
88
|
+
sendBtn: React.ReactNode,
|
|
89
|
+
uploadFileBtn: React.ReactNode
|
|
90
|
+
) => React.ReactNode; // 自定义渲染操作栏
|
|
91
|
+
fileUpload?: boolean | fileUploadProps; // 默认为false
|
|
92
|
+
sendMsgAjaxParams: sendMsgAjaxParams;
|
|
93
|
+
onClickStop?: () => void;
|
|
94
|
+
conversionContent?:(content:string)=>string
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface onOpenProps {
|
|
98
|
+
retryFetch: () => void; // 重试
|
|
99
|
+
stopMessage: () => void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface sendMsgAjaxParams {
|
|
103
|
+
url: string;
|
|
104
|
+
method?: string;
|
|
105
|
+
headers?: () => object;
|
|
106
|
+
params: (
|
|
107
|
+
value: string,
|
|
108
|
+
refereces: referenceType,
|
|
109
|
+
fileList: fileCustomProps[],
|
|
110
|
+
beforeInfo: any
|
|
111
|
+
) => string;
|
|
112
|
+
onOpen?: (res: Response, onOpenProps: onOpenProps) => void;
|
|
113
|
+
onMessage?: (ev: EventSourceMessage,closeCallback:()=>void) => { id: string; content: string };
|
|
114
|
+
onClose?: () => void;
|
|
115
|
+
onError?: (err: any) => void;
|
|
116
|
+
coverProps?: object;
|
|
117
|
+
beforeSendMsg: (
|
|
118
|
+
value: string,
|
|
119
|
+
refereces: referenceType,
|
|
120
|
+
fileList: fileCustomProps[]
|
|
121
|
+
) => Promise<any>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// footer file Props
|
|
125
|
+
// 文件上传(需覆盖两种场景:存在解析和不存在解析的场景) flase 则不显示文件上传的 icon
|
|
126
|
+
export interface fileUploadProps {
|
|
127
|
+
accept?: string; //文件类型 默认值 ".pdf,.ppt,.pptx,.doc,.docx,.xls,.xlsx,.txt,.text,.png,.jpg,.jpeg,.gif,.webp"
|
|
128
|
+
maxCount?: number; // 上传文件数量限制 -1为不限制 默认为10
|
|
129
|
+
maxSize?: number; // 默认为50Mb 目前不考虑切片上传 业务上不要设置太大
|
|
130
|
+
multiple?: boolean; // 是否允许多选
|
|
131
|
+
customRequest: (file: File) => Promise<{
|
|
132
|
+
url: string;
|
|
133
|
+
fileId: string;
|
|
134
|
+
source: File;
|
|
135
|
+
status: fileStatus;
|
|
136
|
+
}>; // 自定义上传方法
|
|
137
|
+
mapUploadCount?: number; // 并发上传的数量 默认为1
|
|
138
|
+
deleteFileAjax?: (
|
|
139
|
+
fileId: string,
|
|
140
|
+
file: fileCustomProps
|
|
141
|
+
) => Promise<{ fileId: string }>; // 删除文件的ajax 返回删除文件的fileId
|
|
142
|
+
statusText?: (status: fileStatus) => React.ReactNode; // 自定义状态显示
|
|
143
|
+
parseFileAjax?: (fileId: string) => { status: fileStatus; fileId; string }; //文件解析的 ajax 请求 如不存在解析过程,可在此函数内直接返回上传成功的状态
|
|
144
|
+
iconFileRender?: (suffix: string) => React.ReactNode; // 文件上传的 icon。参数 文件对象file 返回值为图标
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// file status 文件状态
|
|
148
|
+
// 等待上传/上传中/上传失败/等待解析/解析中/解析成功/解析失败/上传成功
|
|
149
|
+
export type fileStatus =
|
|
150
|
+
| "waiting"
|
|
151
|
+
| "uploading"
|
|
152
|
+
| "uploadError"
|
|
153
|
+
| "waitParse"
|
|
154
|
+
| "parsing"
|
|
155
|
+
| "parsingError"
|
|
156
|
+
| "success";
|
|
157
|
+
|
|
158
|
+
// footer Ref Props
|
|
159
|
+
|
|
160
|
+
export interface footerRefProps {
|
|
161
|
+
setTextValue: (value: string) => void; // 设置输入框的值
|
|
162
|
+
sendMsg: (value: string) => void; // 发送消息
|
|
163
|
+
refreshSendMsg:(msgId:string,value:string,reference?:any,fileList?:any)=>void;// 刷新消息
|
|
164
|
+
clearText: () => void; // 清空输入框
|
|
165
|
+
getCanSendMsg: () => boolean; //获取当前是否允许发送消息的状态
|
|
166
|
+
stopMessage: () => void; //停止发送消息
|
|
167
|
+
setReferences: (reference: referenceType) => void; // 添加引用
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// sendBtn Props
|
|
171
|
+
|
|
172
|
+
export interface sendBtnProps {
|
|
173
|
+
prefix: string;
|
|
174
|
+
canSendMsg: boolean;
|
|
175
|
+
sending: boolean;
|
|
176
|
+
stopMessage: () => void;
|
|
177
|
+
clickFn?: () => void;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// uploadFileBtn Props
|
|
181
|
+
export interface uploadFileBtnProps {
|
|
182
|
+
prefix: string;
|
|
183
|
+
fileUpload: fileUploadProps;
|
|
184
|
+
customRequest: (options: any) => void;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface VoteBtnProps {
|
|
188
|
+
prefix: string;
|
|
189
|
+
clickFn: () => void;
|
|
190
|
+
isActive: boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface refreshBtnProps{
|
|
194
|
+
prefix:string;
|
|
195
|
+
clickFn:()=>void;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// fileList Props
|
|
199
|
+
|
|
200
|
+
export interface fileListProps {
|
|
201
|
+
prefix: string;
|
|
202
|
+
fileUpload: fileUploadProps;
|
|
203
|
+
errorCallback: (error: errorMessageProps) => void;
|
|
204
|
+
changeFileCanSending: (flag: boolean) => void;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// file 自定义对象
|
|
208
|
+
|
|
209
|
+
export interface fileCustomProps {
|
|
210
|
+
name: string;
|
|
211
|
+
suffix: string;
|
|
212
|
+
fileId: string;
|
|
213
|
+
url: string;
|
|
214
|
+
status: fileStatus | undefined;
|
|
215
|
+
source: File | undefined;
|
|
216
|
+
size:number
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// FileList 组件 ref props
|
|
220
|
+
|
|
221
|
+
export interface FileListRefProps {
|
|
222
|
+
addFile: (file: File) => void;
|
|
223
|
+
changePage: (page: number) => void;
|
|
224
|
+
deleteFile: (fileId: string) => void;
|
|
225
|
+
updateFile: (fileId: string, status: fileStatus) => void;
|
|
226
|
+
getFileList: () => fileCustomProps[];
|
|
227
|
+
vaildFile: (file: File, fileId?: string) => boolean; // 校验文件是否合规
|
|
228
|
+
fileToCustomFile: (file: File, params: any) => fileCustomProps;
|
|
229
|
+
clearFileList: () => void;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// error Message
|
|
233
|
+
|
|
234
|
+
export interface errorMessageProps {
|
|
235
|
+
type: errorMessageType;
|
|
236
|
+
message: string;
|
|
237
|
+
}
|
|
238
|
+
/*
|
|
239
|
+
fileAcceptError 文件类型错误
|
|
240
|
+
fileSizeEmpty 文件大小为空
|
|
241
|
+
fileSizeOver 文件大小超出限制
|
|
242
|
+
fileCountOver 文件数量超出限制
|
|
243
|
+
fileNameExist 文件名称已存在
|
|
244
|
+
*/
|
|
245
|
+
export type errorMessageType =
|
|
246
|
+
| "fileAcceptError"
|
|
247
|
+
| "fileSizeEmpty"
|
|
248
|
+
| "fileSizeOver"
|
|
249
|
+
| "fileCountOver"
|
|
250
|
+
| "fileNameExist";
|
|
251
|
+
|
|
252
|
+
// 引用数据类型
|
|
253
|
+
|
|
254
|
+
export type referenceType = referenceTypeText | referenceTypeFile;
|
|
255
|
+
|
|
256
|
+
export type referenceTypeText = {
|
|
257
|
+
type: "text";
|
|
258
|
+
value: string;
|
|
259
|
+
source:any;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export type referenceTypeFile = {
|
|
263
|
+
type: "file";
|
|
264
|
+
value: fileCustomProps;
|
|
265
|
+
source:any;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export interface VirtuosoListProps {
|
|
269
|
+
prefix: string;
|
|
270
|
+
contentConfig: contentConfigProps;
|
|
271
|
+
apiRef: AIMessageListRefProps;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface VirtuosoListRefProps {
|
|
275
|
+
addMsg: (msg: dataItemType) => void;
|
|
276
|
+
updateMsg: (id: string, obj: any) => void;
|
|
277
|
+
clearInputing: () => void; //清楚正在输入的inputing
|
|
278
|
+
recordMsg: (item: dataItemType) => void;
|
|
279
|
+
getDataSource: () => dataItemType[];
|
|
280
|
+
upateDataSource:(id:string,obj:dataItemType)=>void;
|
|
281
|
+
changeDataSource:(list:dataItemType[])=>void;
|
|
282
|
+
scrollToBottom: () => void;
|
|
283
|
+
setSendingId:(id:string)=>void;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface contentRefProps extends VirtuosoListRefProps {}
|
|
287
|
+
|
|
288
|
+
export interface EventSourceMessage {
|
|
289
|
+
id: string;
|
|
290
|
+
event: string;
|
|
291
|
+
data: string;
|
|
292
|
+
retry?: number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface dataItemType {
|
|
296
|
+
id: string; // 唯一id
|
|
297
|
+
createTime: string | number; //创建时间
|
|
298
|
+
content: string; //消息内容
|
|
299
|
+
location: "left" | "right"; // 消息显示在左边还是右边
|
|
300
|
+
reference: referenceType | null; // 引用数据
|
|
301
|
+
source: any; //原消息对象
|
|
302
|
+
vote?:string;// "up":点赞。"down":踩
|
|
303
|
+
type?:"file"|"text",
|
|
304
|
+
suffix?:string;
|
|
305
|
+
fileTitle?:string;
|
|
306
|
+
fileList?:fileCustomProps[];
|
|
307
|
+
}
|
|
@@ -478,6 +478,7 @@ var CustomerService = function(props) {
|
|
|
478
478
|
message.replaceAll(new RegExp(/```(?:.|\n)*?```/, "ig"), function(con) {
|
|
479
479
|
i++;
|
|
480
480
|
if (i == position) {
|
|
481
|
+
con = con.replace(/^```[\s\S]*?\n/, "").replace(/\n```$/, "");
|
|
481
482
|
codeConment = con;
|
|
482
483
|
return con;
|
|
483
484
|
} else {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var loading2 = "data:image/gif;base64,R0lGODlhgACAAKIEAN3d3bu7u////5mZmf///wAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NENGQTg4RUY0MTQwMTFFOEEzQjg5QjE4RTZFRjE2NTUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NENG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qEAL6AHpYABuuw5fSty0i7YeyFe84qVeZ0VMiCz0/7flCAb3+DZVuGh1aJZoWMiI+Qg1tygJSVeJdthJqbX52goaKjpKWmp6ipOgGsra6vsK8wsbS1rii2ubUnur2yI77BAbzCvbjFtrPIsarNzs/Q0dLT1M8D1wOj2Nug297Zl9/elOLfVuXiUOjpTevmSu7j8PHY6vTX7ffg8/RT91v9AK7ThC7UO1HcrCQAADs=";
|
|
2
|
+
export default loading2;
|
package/esm/index.d.ts
CHANGED
|
@@ -83,3 +83,4 @@ export { default as CustomerService } from "./customerService";
|
|
|
83
83
|
export { default as BhdDatePicker } from "./bhdDatePicker";
|
|
84
84
|
export { default as BhdEnterInput } from "./bhdEnterInput";
|
|
85
85
|
export { default as BhdModalCropper } from "./bhdModalCropper";
|
|
86
|
+
export { default as AIMessageList } from "./AIMessageList";
|
package/esm/index.js
CHANGED
|
@@ -88,3 +88,4 @@ export { default as CustomerService } from "./customerService"; //封装 智能
|
|
|
88
88
|
export { default as BhdDatePicker } from "./bhdDatePicker"; //封装 日历组件
|
|
89
89
|
export { default as BhdEnterInput } from "./bhdEnterInput"; //封装 Input
|
|
90
90
|
export { default as BhdModalCropper } from "./bhdModalCropper"; //裁剪头像
|
|
91
|
+
export { default as AIMessageList } from "./AIMessageList"; //AI 对话列表
|
package/esm/utils/Date.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
declare const parseDate: (dateStr: string) => {
|
|
1
|
+
declare const parseDate: (dateStr: string | number) => {
|
|
2
2
|
year: string;
|
|
3
3
|
month: string;
|
|
4
4
|
day: string;
|
|
5
5
|
hours: string;
|
|
6
6
|
minutes: string;
|
|
7
7
|
seconds: string;
|
|
8
|
+
timestamp: number;
|
|
8
9
|
};
|
|
9
10
|
export { parseDate };
|
package/esm/utils/Date.js
CHANGED
package/esm/utils/dom.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
declare var getStyle: (dom: any, key: any) => number;
|
|
2
|
-
|
|
2
|
+
declare const delegate: (element: any, eventType: string, selector: string, callback: any) => () => void;
|
|
3
|
+
declare const findParent: (e: any, className: string) => any;
|
|
4
|
+
declare const copyText: (text: string) => boolean;
|
|
5
|
+
export { getStyle, copyText, findParent, delegate };
|
package/esm/utils/dom.js
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
//获取css样式
|
|
2
|
+
import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
|
|
2
3
|
var getStyle = function getStyle(dom, key) {
|
|
3
4
|
return dom.currentStyle ? parseFloat(dom.currentStyle[key]) : parseFloat(document.defaultView.getComputedStyle(dom)[key]);
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
+
// 事件委托函数封装
|
|
7
|
+
var delegate = function(element, eventType, selector, callback) {
|
|
8
|
+
if (!_instanceof(element, HTMLElement)) {
|
|
9
|
+
throw new Error("第一个参数必须是一个HTMLElement");
|
|
10
|
+
}
|
|
11
|
+
if (typeof eventType !== "string") {
|
|
12
|
+
throw new Error("第二个参数必须是字符串");
|
|
13
|
+
}
|
|
14
|
+
if (typeof selector !== "string") {
|
|
15
|
+
throw new Error("第三个参数必须是字符串");
|
|
16
|
+
}
|
|
17
|
+
if (typeof callback !== "function") {
|
|
18
|
+
throw new Error("第四个参数必须是一个函数");
|
|
19
|
+
}
|
|
20
|
+
var fn = function(event) {
|
|
21
|
+
var possibleTargets = element.querySelectorAll(selector);
|
|
22
|
+
for(var i = 0; i < possibleTargets.length; i++){
|
|
23
|
+
if (possibleTargets[i] === event.target || possibleTargets[i].contains(event.target)) {
|
|
24
|
+
callback.call(possibleTargets[i], event, possibleTargets[i]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
element.addEventListener(eventType, fn);
|
|
29
|
+
return function() {
|
|
30
|
+
element.removeEventListener(eventType, fn);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
var findParent = function(e, className) {
|
|
34
|
+
while(e && !e.classList.contains(className)){
|
|
35
|
+
e = e.parentElement;
|
|
36
|
+
}
|
|
37
|
+
return e;
|
|
38
|
+
};
|
|
39
|
+
//复制内容
|
|
40
|
+
var copyText = function(text) {
|
|
41
|
+
var tempInput = document.createElement("textarea");
|
|
42
|
+
document.body.appendChild(tempInput);
|
|
43
|
+
tempInput.value = text;
|
|
44
|
+
tempInput.select();
|
|
45
|
+
document.execCommand("copy");
|
|
46
|
+
document.body.removeChild(tempInput);
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
export { getStyle, copyText, findParent, delegate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const guidGenerator: () => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var guidGenerator = function() {
|
|
2
|
+
var d = new Date().getTime();
|
|
3
|
+
var uuid = "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
4
|
+
var r = (d + Math.random() * 16) % 16 | 0;
|
|
5
|
+
d = Math.floor(d / 16);
|
|
6
|
+
return (c == "x" ? r : r & 3 | 8).toString(16);
|
|
7
|
+
});
|
|
8
|
+
return uuid;
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bhd-components",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.14",
|
|
4
4
|
"description": "组件功能描述",
|
|
5
5
|
"config": {
|
|
6
6
|
"commitizen": {
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"raw-loader": "^4.0.2",
|
|
80
80
|
"react-cropper": "^2.3.3",
|
|
81
81
|
"react-image-crop": "^11.0.5",
|
|
82
|
+
"react-virtuoso": "^3.1.5",
|
|
82
83
|
"remarkable": "^2.0.1"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|