@ibiz-template-plugin/ai-chat 0.0.73 → 0.0.75

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.
Files changed (29) hide show
  1. package/dist/index.es.js +17122 -16814
  2. package/dist/index.legacy.js +1 -1
  3. package/dist/style.css +1 -1
  4. package/dist/types/components/chat-message-item/user-message/user-message.d.ts +2 -2
  5. package/dist/types/components/chat-step/chat-step.d.ts +2 -0
  6. package/dist/types/components/chat-step-item/chat-step-item.d.ts +2 -0
  7. package/dist/types/components/chat-think/chat-think.d.ts +5 -0
  8. package/dist/types/components/chat-tool-call/chat-tool-call.d.ts +5 -0
  9. package/dist/types/components/chat-tool-call-item/chat-tool-call-item.d.ts +8 -0
  10. package/dist/types/components/chat-tool-call-item/chunk-tool-call/chunk-tool-call.d.ts +2 -0
  11. package/dist/types/components/chat-tool-call-item/default-tool-call/default-tool-call.d.ts +2 -0
  12. package/dist/types/components/chat-tool-call-item/image-tool-call/image-tool-call.d.ts +2 -0
  13. package/dist/types/components/common/messsage-toolbar/messsage-toolbar.d.ts +5 -0
  14. package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +56 -3
  15. package/dist/types/entity/chat-message/chat-message.d.ts +7 -0
  16. package/dist/types/icons/edit-svg.d.ts +1 -0
  17. package/dist/types/icons/index.d.ts +1 -0
  18. package/dist/types/interface/i-chat-options/i-chat-options.d.ts +9 -0
  19. package/dist/types/interface/i-file-uploader-options/i-file-uploader-options.d.ts +2 -0
  20. package/dist/types/interface/index.d.ts +1 -0
  21. package/dist/types/interface/util/i-confirm-util.d.ts +60 -0
  22. package/dist/types/interface/util/i-message-util.d.ts +76 -0
  23. package/dist/types/interface/util/i-notification-util.d.ts +85 -0
  24. package/dist/types/interface/util/index.d.ts +3 -0
  25. package/dist/types/locale/en/index.d.ts +4 -0
  26. package/dist/types/locale/zh-CN/index.d.ts +4 -0
  27. package/dist/types/utils/index.d.ts +2 -1
  28. package/dist/types/utils/util/util.d.ts +21 -12
  29. package/package.json +1 -1
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @description 消息提示参数接口
3
+ * @export
4
+ * @interface IMessageParams
5
+ */
6
+ export interface IMessageParams {
7
+ /**
8
+ * @description 类型(默认info)
9
+ * @type {('success' | 'info' | 'warning' | 'error')}
10
+ * @memberof IMessageParams
11
+ */
12
+ type?: 'success' | 'info' | 'warning' | 'error';
13
+ /**
14
+ * @description 消息内容
15
+ * @type {string}
16
+ * @memberof IMessageParams
17
+ */
18
+ message: string;
19
+ /**
20
+ * @description 持续时间,单位:秒,默认:1.5
21
+ * @type {number}
22
+ * @memberof IMessageParams
23
+ */
24
+ duration?: number;
25
+ /**
26
+ * @description 显示关闭按钮,默认:false
27
+ * @type {boolean}
28
+ * @memberof IMessageParams
29
+ */
30
+ showClose?: boolean;
31
+ /**
32
+ * @description 预置的样式类型
33
+ * @type {'alert'}
34
+ * @memberof IMessageParams
35
+ */
36
+ styleType?: 'alert';
37
+ }
38
+ /**
39
+ * @description 主动操作后的反馈提示,顶部居中显示,并自动消失
40
+ * @export
41
+ * @interface IMessageUtil
42
+ */
43
+ export interface IMessageUtil {
44
+ /**
45
+ * @description 显示普通提示消息
46
+ * @param {string} msg 消息内容
47
+ * @param {number} [duration] 持续时间,单位:秒,默认:1.5
48
+ * @param {boolean} [closable] 显示关闭按钮,默认:false
49
+ * @memberof IMessageUtil
50
+ */
51
+ info(msg: string, duration?: number, closable?: boolean): void;
52
+ /**
53
+ * @description 显示成功提示消息
54
+ * @param {string} msg 消息内容
55
+ * @param {number} [duration] 持续时间,单位:秒,默认:1.5
56
+ * @param {boolean} [closable] 显示关闭按钮,默认:false
57
+ * @memberof IMessageUtil
58
+ */
59
+ success(msg: string, duration?: number, closable?: boolean): void;
60
+ /**
61
+ * @description 显示警告提示消息
62
+ * @param {string} msg 消息内容
63
+ * @param {number} [duration] 持续时间,单位:秒,默认:1.5
64
+ * @param {boolean} [closable] 显示关闭按钮,默认:false
65
+ * @memberof IMessageUtil
66
+ */
67
+ warning(msg: string, duration?: number, closable?: boolean): void;
68
+ /**
69
+ * @description 显示错误提示消息
70
+ * @param {string} msg 消息内容
71
+ * @param {number} [duration] 持续时间,单位:秒,默认:1.5
72
+ * @param {boolean} [closable] 显示关闭按钮,默认:false
73
+ * @memberof IMessageUtil
74
+ */
75
+ error(msg: string, duration?: number, closable?: boolean): void;
76
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @description 全局通知参数
3
+ * @export
4
+ * @interface INotificationParams
5
+ */
6
+ export interface INotificationParams {
7
+ /**
8
+ * @description 标题
9
+ * @type {string}
10
+ * @memberof INotificationParams
11
+ */
12
+ title?: string;
13
+ /**
14
+ * @description 描述
15
+ * @type {string}
16
+ * @memberof INotificationParams
17
+ */
18
+ desc?: string;
19
+ /**
20
+ * @description 描述是否是html字符串
21
+ * @type {boolean}
22
+ * @memberof INotificationParams
23
+ */
24
+ isHtmlDesc?: boolean;
25
+ /**
26
+ * @description 自动关闭的延时,单位秒,不关闭可以写 0
27
+ * @type {number}
28
+ * @memberof INotificationParams
29
+ */
30
+ duration?: number;
31
+ /**
32
+ * @description 位置
33
+ * @type {('top-right' | 'top-left' | 'bottom-right' | 'bottom-left')}
34
+ * @memberof INotificationParams
35
+ */
36
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
37
+ /**
38
+ * @description 自定义类名
39
+ * @type {string}
40
+ * @memberof INotificationParams
41
+ */
42
+ class?: string;
43
+ /**
44
+ * @description 点击事件回调
45
+ * @memberof INotificationParams
46
+ */
47
+ onClick?: () => void;
48
+ }
49
+ /**
50
+ * @description 悬浮出现在界面右上角,显示全局的通知
51
+ * @export
52
+ * @interface INotificationUtil
53
+ */
54
+ export interface INotificationUtil {
55
+ /**
56
+ * @description 显示默认样式通知
57
+ * @param {INotificationParams} params 通知参数
58
+ * @memberof INotificationUtil
59
+ */
60
+ default(params: INotificationParams): void;
61
+ /**
62
+ * @description 显示普通信息通知
63
+ * @param {INotificationParams} params 通知参数
64
+ * @memberof INotificationUtil
65
+ */
66
+ info(params: INotificationParams): void;
67
+ /**
68
+ * @description 显示成功通知
69
+ * @param {INotificationParams} params 通知参数
70
+ * @memberof INotificationUtil
71
+ */
72
+ success(params: INotificationParams): void;
73
+ /**
74
+ * @description 显示警告通知
75
+ * @param {INotificationParams} params 通知参数
76
+ * @memberof INotificationUtil
77
+ */
78
+ warning(params: INotificationParams): void;
79
+ /**
80
+ * @description 显示失败通知
81
+ * @param {INotificationParams} params 通知参数
82
+ * @memberof INotificationUtil
83
+ */
84
+ error(params: INotificationParams): void;
85
+ }
@@ -0,0 +1,3 @@
1
+ export type { IConfirmUtil, IConfirmParams } from './i-confirm-util';
2
+ export type { IMessageUtil, IMessageParams } from './i-message-util';
3
+ export type { INotificationUtil, INotificationParams, } from './i-notification-util';
@@ -44,6 +44,7 @@ export declare const EN: {
44
44
  stepFoldUp: string;
45
45
  expandAll: string;
46
46
  copy: string;
47
+ copyMarkdown: string;
47
48
  copied: string;
48
49
  used: string;
49
50
  second: string;
@@ -95,4 +96,7 @@ export declare const EN: {
95
96
  chunkEntity: string;
96
97
  extensionToolbarClick: string;
97
98
  temporarySessionFailed: string;
99
+ reedit: string;
100
+ cancel: string;
101
+ send: string;
98
102
  };
@@ -44,6 +44,7 @@ export declare const ZH_CN: {
44
44
  stepFoldUp: string;
45
45
  expandAll: string;
46
46
  copy: string;
47
+ copyMarkdown: string;
47
48
  copied: string;
48
49
  used: string;
49
50
  second: string;
@@ -95,4 +96,7 @@ export declare const ZH_CN: {
95
96
  chunkEntity: string;
96
97
  extensionToolbarClick: string;
97
98
  temporarySessionFailed: string;
99
+ reedit: string;
100
+ cancel: string;
101
+ send: string;
98
102
  };
@@ -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 } from './util/util';
3
+ export { createUUID, isSvg, parsePredefProtocol, html2md, md2html, } 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';
@@ -10,3 +10,4 @@ export { generateHashWithText } from './util/text-hash-util';
10
10
  export { ChatToolCallParser } from './util/chat-tool-call-parser';
11
11
  export { ChatStepParser } from './util/chat-step-parser';
12
12
  export { ChatUIActionParser } from './util/chat-ui-action-parser';
13
+ export { TextUtil } from './util/util';
@@ -50,23 +50,32 @@ export declare function parsePredefProtocol(urlStr: string): {
50
50
  params: any;
51
51
  typeId: string;
52
52
  };
53
+ /**
54
+ * html转md
55
+ * @param html
56
+ * @returns
57
+ */
58
+ export declare function html2md(html: string): string;
59
+ /**
60
+ * md转html
61
+ * @param md
62
+ * @returns
63
+ */
64
+ export declare function md2html(md: string): string;
53
65
  export declare class TextUtil {
54
66
  /**
55
- * input元素,用于存储拷贝的文本
56
- *
57
- * @author zhanghengfeng
58
- * @date 2023-08-31 20:08:06
59
- * @private
60
- * @type {(HTMLInputElement | null)}
67
+ * @description textarea元素,用于存储拷贝的文本
68
+ * @static
69
+ * @type {(HTMLTextAreaElement | null)}
70
+ * @memberof TextUtil
61
71
  */
62
- static inputElement: HTMLInputElement | null;
72
+ static element: HTMLTextAreaElement | null;
63
73
  /**
64
- * 拷贝文本
65
- *
66
- * @author zhanghengfeng
67
- * @date 2023-08-31 11:08:51
74
+ * @description 拷贝文本
75
+ * @static
68
76
  * @param {string} value
69
- * @return {*} {boolean}
77
+ * @returns {*} {boolean}
78
+ * @memberof TextUtil
70
79
  */
71
80
  static copy(value: string): boolean;
72
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template-plugin/ai-chat",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "iBiz AI交互框插件",
5
5
  "type": "module",
6
6
  "main": "dist/index.es.js",