@ibiz-template-plugin/ai-chat 0.0.105 → 0.0.107
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/dist/index.es.js +3915 -3669
- package/dist/index.legacy.js +1 -1
- package/dist/polyfills.legacy.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/components/chat-back-bottom/chat-back-bottom.d.ts +0 -1
- package/dist/types/components/chat-container/chat-container.d.ts +12 -6
- package/dist/types/components/chat-messages/chat-messages.d.ts +13 -0
- package/dist/types/components/chat-messages/use-virtual-list.d.ts +120 -0
- package/dist/types/components/flat-chat-container/flat-chat-container.d.ts +1 -1
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +53 -0
- package/dist/types/interface/i-resource-options/i-resource-options.d.ts +4 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/util/util.d.ts +1 -0
- package/package.json +1 -1
|
@@ -31,6 +31,22 @@ export declare class AiChatController {
|
|
|
31
31
|
* @type {Signal<ChatMessage[]>}
|
|
32
32
|
*/
|
|
33
33
|
readonly messages: Signal<ChatMessage[]>;
|
|
34
|
+
/**
|
|
35
|
+
* 是否正在加载更早历史(供浮层 Spinner 与防重复触发)
|
|
36
|
+
*/
|
|
37
|
+
readonly isLoadingHistory: Signal<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* 是否还有更早历史可加载
|
|
40
|
+
*/
|
|
41
|
+
readonly hasMoreHistory: Signal<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* 已加载的历史消息总数(与 total 比较判断是否还有更早历史,由 fetchRemoteHistoryPage 维护)
|
|
44
|
+
*/
|
|
45
|
+
private loadedHistoryCount;
|
|
46
|
+
/**
|
|
47
|
+
* 下一次要加载的页码(由 fetchRemoteHistoryPage 维护)
|
|
48
|
+
*/
|
|
49
|
+
private nextHistoryPage;
|
|
34
50
|
/**
|
|
35
51
|
* 素材列表
|
|
36
52
|
*
|
|
@@ -212,6 +228,13 @@ export declare class AiChatController {
|
|
|
212
228
|
enable: boolean;
|
|
213
229
|
message: string;
|
|
214
230
|
}>;
|
|
231
|
+
/**
|
|
232
|
+
* @description 当前正在处理的异步作业标识
|
|
233
|
+
* @private
|
|
234
|
+
* @type {string}
|
|
235
|
+
* @memberof AiChatController
|
|
236
|
+
*/
|
|
237
|
+
private activeAsyncacitonid;
|
|
215
238
|
/**
|
|
216
239
|
* AI资源模式
|
|
217
240
|
*/
|
|
@@ -299,6 +322,24 @@ export declare class AiChatController {
|
|
|
299
322
|
* @return {*} {Promise<boolean>}
|
|
300
323
|
*/
|
|
301
324
|
fecthHistory(): Promise<boolean>;
|
|
325
|
+
/**
|
|
326
|
+
* 拉取远程历史消息并维护分页状态(游标、进度、是否还有更多)
|
|
327
|
+
*
|
|
328
|
+
* @param reset 是否重置分页游标(初始加载传 true,加载更早传 false)
|
|
329
|
+
* @returns 转换后的消息列表(旧→新正序)
|
|
330
|
+
*/
|
|
331
|
+
private fetchRemoteHistoryPage;
|
|
332
|
+
/**
|
|
333
|
+
* 组装历史消息字段
|
|
334
|
+
*
|
|
335
|
+
* @param item 远程消息转换后的消息
|
|
336
|
+
* @returns 用于 addMessage / ChatMessage 构造的消息对象
|
|
337
|
+
*/
|
|
338
|
+
private buildHistoryMessage;
|
|
339
|
+
/**
|
|
340
|
+
* 加载更早的历史消息(滚动到列表顶部时调用)
|
|
341
|
+
*/
|
|
342
|
+
loadHistoryMore(): Promise<void>;
|
|
302
343
|
/**
|
|
303
344
|
* 获取历史记录后续处理
|
|
304
345
|
*/
|
|
@@ -628,4 +669,16 @@ export declare class AiChatController {
|
|
|
628
669
|
* @memberof AiChatController
|
|
629
670
|
*/
|
|
630
671
|
destroyed(): Promise<void>;
|
|
672
|
+
/**
|
|
673
|
+
* @description 设置当前正在处理的异步作业标识
|
|
674
|
+
* @return {*} {string}
|
|
675
|
+
* @memberof AiChatController
|
|
676
|
+
*/
|
|
677
|
+
setActiveAsyncacitonId(asyncacitonid: string): void;
|
|
678
|
+
/**
|
|
679
|
+
* @description 获取当前正在处理的异步作业标识
|
|
680
|
+
* @return {*} {string}
|
|
681
|
+
* @memberof AiChatController
|
|
682
|
+
*/
|
|
683
|
+
getActiveAsyncacitonId(): string;
|
|
631
684
|
}
|
|
@@ -26,7 +26,10 @@ export interface IResourceOptions {
|
|
|
26
26
|
/**
|
|
27
27
|
* 获取指定会话消息清单
|
|
28
28
|
*/
|
|
29
|
-
getMessages(args: Record<string, any>): Promise<
|
|
29
|
+
getMessages(args: Record<string, any>): Promise<{
|
|
30
|
+
total: number;
|
|
31
|
+
data: Record<string, any>[];
|
|
32
|
+
}>;
|
|
30
33
|
/**
|
|
31
34
|
* 删除消息(多个以逗号分割)
|
|
32
35
|
* @param messageID
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Namespace } from '@ibiz-template/scss-utils';
|
|
2
2
|
export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
|
|
3
|
-
export { createUUID, isSvg, parsePredefProtocol, html2md, md2html, parseJavaToString, } from './util/util';
|
|
3
|
+
export { createUUID, isSvg, parsePredefProtocol, html2md, md2html, parseJavaToString, throttle, } from './util/util';
|
|
4
4
|
export { IndexedDBUtil } from './util/indexdb-util';
|
|
5
5
|
export { FileUploader } from './util/file-uploader';
|
|
6
6
|
export { MaterialResourceParser } from './util/material-resource-parser';
|
|
@@ -73,6 +73,7 @@ export declare function md2html(md: string): string;
|
|
|
73
73
|
* @returns 解析后的 JavaScript 对象,格式非法时返回空对象
|
|
74
74
|
*/
|
|
75
75
|
export declare function parseJavaToString(str: string): Record<string, any>;
|
|
76
|
+
export declare function throttle(fn: (...args: unknown[]) => void | Promise<void>, wait: number): (...args: unknown[]) => void;
|
|
76
77
|
export declare class TextUtil {
|
|
77
78
|
/**
|
|
78
79
|
* @description textarea元素,用于存储拷贝的文本
|