@ibiz-template-plugin/ai-chat 0.0.122 → 0.0.124
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 +8687 -8611
- package/dist/index.legacy.js +2 -2
- package/dist/polyfills.legacy.js +1 -1
- package/dist/style.css +2 -2
- package/dist/types/components/chat-net-disk/chat-net-disk.d.ts +5 -0
- package/dist/types/components/chat-net-disk/file-move-panel/file-move-panel.d.ts +2 -2
- package/dist/types/components/common/lazy-level-list/lazy-level-list.d.ts +17 -15
- package/dist/types/components/common/lazy-tree/lazy-tree.d.ts +18 -74
- package/dist/types/controller/file-system/file-system.controller.d.ts +12 -3
- package/dist/types/interface/i-tree-node/i-tree-node.d.ts +54 -0
- package/dist/types/interface/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { FileSystemController } from '../../controller';
|
|
2
2
|
|
|
3
3
|
interface ChatNetDiskProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 控制器
|
|
6
|
+
* @type {FileSystemController}
|
|
7
|
+
* @memberof ChatNetDiskProps
|
|
8
|
+
*/
|
|
4
9
|
controller: FileSystemController;
|
|
5
10
|
}
|
|
6
11
|
export declare const ChatNetDisk: (props: ChatNetDiskProps) => import("preact").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileSystemController } from '../../../controller';
|
|
2
|
-
import {
|
|
2
|
+
import { ITreeNode } from '../../../interface';
|
|
3
3
|
|
|
4
4
|
interface FileMovePanelProps {
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ interface FileMovePanelProps {
|
|
|
7
7
|
* @type {IFile}
|
|
8
8
|
* @memberof FileMovePanelProps
|
|
9
9
|
*/
|
|
10
|
-
data:
|
|
10
|
+
data: ITreeNode;
|
|
11
11
|
/**
|
|
12
12
|
* @description 系统文件控制器
|
|
13
13
|
* @type {FileSystemController}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { INodeEditInfo
|
|
1
|
+
import { INodeEditInfo } from '../lazy-tree/lazy-tree';
|
|
2
2
|
import { IAction } from '../actions/actions';
|
|
3
|
+
import { ITreeNode } from '../../../interface';
|
|
3
4
|
|
|
4
5
|
export type LazyLevelListMode = 'list' | 'card';
|
|
5
6
|
interface LazyLevelListProps {
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* 节点数据
|
|
8
9
|
*/
|
|
9
|
-
nodes:
|
|
10
|
+
nodes: ITreeNode[];
|
|
10
11
|
/**
|
|
11
12
|
* 异步加载子节点方法
|
|
12
13
|
* 返回子节点数组
|
|
13
14
|
*/
|
|
14
|
-
lazyLoad?: (node:
|
|
15
|
+
lazyLoad?: (node: ITreeNode) => Promise<ITreeNode[]>;
|
|
15
16
|
/**
|
|
16
17
|
* 节点选中回调
|
|
17
18
|
*/
|
|
18
|
-
onNodeCheck?: (node:
|
|
19
|
+
onNodeCheck?: (node: ITreeNode, checked: boolean) => void;
|
|
19
20
|
/**
|
|
20
21
|
* 节点点击回调
|
|
21
22
|
*/
|
|
22
|
-
onNodeClick?: (
|
|
23
|
+
onNodeClick?: (event: MouseEvent, node: ITreeNode) => void;
|
|
23
24
|
/**
|
|
24
25
|
* 节点展开回调
|
|
25
26
|
*/
|
|
26
|
-
onNodeExpand?: (node:
|
|
27
|
+
onNodeExpand?: (node: ITreeNode, expanded: boolean) => void;
|
|
27
28
|
/**
|
|
28
29
|
* 路径变化回调,用于父组件同步面包屑
|
|
29
30
|
*/
|
|
30
|
-
onPathChange?: (path:
|
|
31
|
+
onPathChange?: (path: ITreeNode[]) => void;
|
|
31
32
|
/**
|
|
32
33
|
* 受控路径(根 -> 当前层),由父组件传入
|
|
33
34
|
*/
|
|
34
|
-
path?:
|
|
35
|
+
path?: ITreeNode[];
|
|
35
36
|
/**
|
|
36
37
|
* 是否显示搜索框
|
|
37
38
|
* @default true
|
|
@@ -46,11 +47,6 @@ interface LazyLevelListProps {
|
|
|
46
47
|
* @default true
|
|
47
48
|
*/
|
|
48
49
|
highlight?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* 标识分隔符
|
|
51
|
-
* @default '/'
|
|
52
|
-
*/
|
|
53
|
-
separator?: string;
|
|
54
50
|
/**
|
|
55
51
|
* 过滤值
|
|
56
52
|
*/
|
|
@@ -84,6 +80,12 @@ interface LazyLevelListProps {
|
|
|
84
80
|
* @default 'list'
|
|
85
81
|
*/
|
|
86
82
|
mode?: LazyLevelListMode;
|
|
83
|
+
/**
|
|
84
|
+
* 节点过滤
|
|
85
|
+
* @param node
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
filterNodeMethod?: (node: ITreeNode) => boolean;
|
|
87
89
|
}
|
|
88
90
|
export interface LazyLevelListRef {
|
|
89
91
|
/**
|
|
@@ -91,7 +93,7 @@ export interface LazyLevelListRef {
|
|
|
91
93
|
* @param
|
|
92
94
|
* @returns
|
|
93
95
|
*/
|
|
94
|
-
overloadNode: (node:
|
|
96
|
+
overloadNode: (node: ITreeNode) => Promise<void>;
|
|
95
97
|
}
|
|
96
98
|
export declare const LazyLevelList: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<LazyLevelListProps> & {
|
|
97
99
|
ref?: import('preact').Ref<LazyLevelListRef> | undefined;
|
|
@@ -1,64 +1,7 @@
|
|
|
1
1
|
import { VNode } from 'preact';
|
|
2
2
|
import { IAction } from '../actions/actions';
|
|
3
|
+
import { ITreeNode } from '../../../interface';
|
|
3
4
|
|
|
4
|
-
export interface LazyTreeNode {
|
|
5
|
-
/**
|
|
6
|
-
* 节点唯一标识
|
|
7
|
-
*/
|
|
8
|
-
id: string;
|
|
9
|
-
/**
|
|
10
|
-
* 节点显示文本
|
|
11
|
-
*/
|
|
12
|
-
label: string;
|
|
13
|
-
/**
|
|
14
|
-
* 是否叶子节点
|
|
15
|
-
*/
|
|
16
|
-
isLeaf: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 子节点
|
|
19
|
-
*/
|
|
20
|
-
children?: LazyTreeNode[];
|
|
21
|
-
/**
|
|
22
|
-
* 是否已加载子节点
|
|
23
|
-
*/
|
|
24
|
-
loaded?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 是否展开
|
|
27
|
-
*/
|
|
28
|
-
expanded?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* 是否正在加载
|
|
31
|
-
*/
|
|
32
|
-
loading?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* 父节点标识
|
|
35
|
-
*/
|
|
36
|
-
parentId?: string;
|
|
37
|
-
/**
|
|
38
|
-
* 节点深度
|
|
39
|
-
*/
|
|
40
|
-
depth?: number;
|
|
41
|
-
/**
|
|
42
|
-
* 自定义图标
|
|
43
|
-
*/
|
|
44
|
-
icon?: string;
|
|
45
|
-
/**
|
|
46
|
-
* 原始数据
|
|
47
|
-
*/
|
|
48
|
-
data: Record<string, any>;
|
|
49
|
-
/**
|
|
50
|
-
* 根节点标识
|
|
51
|
-
*/
|
|
52
|
-
rootId: string;
|
|
53
|
-
/**
|
|
54
|
-
* 根节点
|
|
55
|
-
*/
|
|
56
|
-
isRoot?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* 是否显示
|
|
59
|
-
*/
|
|
60
|
-
visible?: boolean;
|
|
61
|
-
}
|
|
62
5
|
export interface INodeEditInfo {
|
|
63
6
|
/**
|
|
64
7
|
* @description 图标
|
|
@@ -86,41 +29,41 @@ export interface INodeEditInfo {
|
|
|
86
29
|
type: 'draft' | 'edit';
|
|
87
30
|
/**
|
|
88
31
|
* @description 草稿的父节点 | 编辑节点
|
|
89
|
-
* @type {
|
|
32
|
+
* @type {ITreeNode}
|
|
90
33
|
* @memberof INodeEditInfo
|
|
91
34
|
*/
|
|
92
|
-
node:
|
|
35
|
+
node: ITreeNode;
|
|
93
36
|
}
|
|
94
37
|
interface LazyTreeProps {
|
|
95
38
|
/**
|
|
96
39
|
* 根节点数据
|
|
97
40
|
*/
|
|
98
|
-
nodes:
|
|
41
|
+
nodes: ITreeNode[];
|
|
99
42
|
/**
|
|
100
43
|
* 异步加载子节点方法
|
|
101
44
|
* 返回子节点数组
|
|
102
45
|
*/
|
|
103
|
-
lazyLoad?: (node:
|
|
46
|
+
lazyLoad?: (node: ITreeNode) => Promise<ITreeNode[]>;
|
|
104
47
|
/**
|
|
105
48
|
* 节点点击回调
|
|
106
49
|
*/
|
|
107
|
-
onNodeClick?: (
|
|
50
|
+
onNodeClick?: (event: MouseEvent, node: ITreeNode) => void;
|
|
108
51
|
/**
|
|
109
52
|
* 节点选中回调
|
|
110
53
|
*/
|
|
111
|
-
onNodeCheck?: (node:
|
|
54
|
+
onNodeCheck?: (node: ITreeNode, checked: boolean) => void;
|
|
112
55
|
/**
|
|
113
56
|
* 节点展开回调
|
|
114
57
|
*/
|
|
115
|
-
onNodeExpand?: (node:
|
|
58
|
+
onNodeExpand?: (node: ITreeNode, expanded: boolean) => void;
|
|
116
59
|
/**
|
|
117
60
|
* 当前活动路径变化回调(用户最后点击/展开的路径)
|
|
118
61
|
*/
|
|
119
|
-
onActivePathChange?: (path:
|
|
62
|
+
onActivePathChange?: (path: ITreeNode[]) => void;
|
|
120
63
|
/**
|
|
121
64
|
* 当前激活路径
|
|
122
65
|
*/
|
|
123
|
-
activePath?:
|
|
66
|
+
activePath?: ITreeNode[];
|
|
124
67
|
/**
|
|
125
68
|
* 是否显示搜索框
|
|
126
69
|
* @default true
|
|
@@ -145,11 +88,6 @@ interface LazyTreeProps {
|
|
|
145
88
|
* @default true
|
|
146
89
|
*/
|
|
147
90
|
expandOnClickNode?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* 标识分隔符
|
|
150
|
-
* @default '/'
|
|
151
|
-
*/
|
|
152
|
-
separator?: string;
|
|
153
91
|
/**
|
|
154
92
|
* 过滤值
|
|
155
93
|
*/
|
|
@@ -178,15 +116,21 @@ interface LazyTreeProps {
|
|
|
178
116
|
* @returns
|
|
179
117
|
*/
|
|
180
118
|
onCancel?: () => void;
|
|
119
|
+
/**
|
|
120
|
+
* 节点过滤
|
|
121
|
+
* @param node
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
filterNodeMethod?: (node: ITreeNode) => boolean;
|
|
181
125
|
}
|
|
182
126
|
export interface LazyTreeRef {
|
|
183
127
|
/**
|
|
184
128
|
* @description 重载节点
|
|
185
|
-
* @param {
|
|
129
|
+
* @param {ITreeNode} node 需要重载的节点
|
|
186
130
|
* @param {boolean} isParent 是否重载父节点,默认为false
|
|
187
131
|
* @memberof LazyTreeRef
|
|
188
132
|
*/
|
|
189
|
-
overloadNode: (node:
|
|
133
|
+
overloadNode: (node: ITreeNode, isParent?: boolean) => Promise<void>;
|
|
190
134
|
}
|
|
191
135
|
/**
|
|
192
136
|
* 懒加载树组件
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFile, IFileItem, IMessageUtil, IConfirmUtil, IFileItemParams, IFileUploadPrams, IFileSystemOptions, FileUploaderOptions } from '../../interface';
|
|
1
|
+
import { IFile, IFileItem, ITreeNode, IMessageUtil, IConfirmUtil, IFileItemParams, IFileUploadPrams, IFileSystemOptions, FileUploaderOptions } from '../../interface';
|
|
2
2
|
import { AiChatController } from '../ai-chat/ai-chat.controller';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -9,7 +9,7 @@ import { AiChatController } from '../ai-chat/ai-chat.controller';
|
|
|
9
9
|
export declare class FileSystemController {
|
|
10
10
|
private opts;
|
|
11
11
|
private uploader;
|
|
12
|
-
|
|
12
|
+
aiChat: AiChatController;
|
|
13
13
|
/**
|
|
14
14
|
* Creates an instance of FileSystemController.
|
|
15
15
|
* @param {IFileSystemOptions} opts
|
|
@@ -48,9 +48,10 @@ export declare class FileSystemController {
|
|
|
48
48
|
/**
|
|
49
49
|
* @description 文件预览模式
|
|
50
50
|
* @readonly
|
|
51
|
+
* @type {("DEFAULT" | "CUSTOM" | undefined)}
|
|
51
52
|
* @memberof FileSystemController
|
|
52
53
|
*/
|
|
53
|
-
get filePreviewMode():
|
|
54
|
+
get filePreviewMode(): 'DEFAULT' | 'CUSTOM' | undefined;
|
|
54
55
|
/**
|
|
55
56
|
* @description 绑定函数this指向
|
|
56
57
|
* @private
|
|
@@ -172,4 +173,12 @@ export declare class FileSystemController {
|
|
|
172
173
|
* @memberof FileSystemController
|
|
173
174
|
*/
|
|
174
175
|
uploadFileToSystem(file_path: string, file: File): Promise<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* @description 加载文件树节点
|
|
178
|
+
* @param {ITreeNode} [parent] 父节点
|
|
179
|
+
* @param {IFileItemParams} [params] 参数
|
|
180
|
+
* @returns {*} {Promise<ITreeNode[]>}
|
|
181
|
+
* @memberof FileSystemController
|
|
182
|
+
*/
|
|
183
|
+
loadFileTreeNodes(parent?: ITreeNode, params?: IFileItemParams): Promise<ITreeNode[]>;
|
|
175
184
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface ITreeNode {
|
|
2
|
+
/**
|
|
3
|
+
* 根节点标识
|
|
4
|
+
*/
|
|
5
|
+
rootId: string;
|
|
6
|
+
/**
|
|
7
|
+
* 节点唯一标识
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* 节点显示文本
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* 是否叶子节点
|
|
16
|
+
*/
|
|
17
|
+
isLeaf: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 节点深度
|
|
20
|
+
*/
|
|
21
|
+
depth: number;
|
|
22
|
+
/**
|
|
23
|
+
* 子节点
|
|
24
|
+
*/
|
|
25
|
+
children?: ITreeNode[];
|
|
26
|
+
/**
|
|
27
|
+
* 是否已加载子节点
|
|
28
|
+
*/
|
|
29
|
+
loaded?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 是否展开
|
|
32
|
+
*/
|
|
33
|
+
expanded?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 是否正在加载
|
|
36
|
+
*/
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 父节点标识
|
|
40
|
+
*/
|
|
41
|
+
parentId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* 自定义图标
|
|
44
|
+
*/
|
|
45
|
+
icon?: string;
|
|
46
|
+
/**
|
|
47
|
+
* 原始数据
|
|
48
|
+
*/
|
|
49
|
+
data: Record<string, any>;
|
|
50
|
+
/**
|
|
51
|
+
* 根节点
|
|
52
|
+
*/
|
|
53
|
+
isRoot?: boolean;
|
|
54
|
+
}
|
|
@@ -29,3 +29,4 @@ export type { IFile, IFileItem, IFileItemParams, IFileUploadPrams, } from './i-f
|
|
|
29
29
|
export type { IFileSystemOptions } from './i-file-system-options/i-file-system-options';
|
|
30
30
|
export { TipTapNodeType, type ITipTapDropData, type TipTapNodeConfig, } from './i-tiptap/i-tiptap';
|
|
31
31
|
export * from './deep-research';
|
|
32
|
+
export type { ITreeNode } from './i-tree-node/i-tree-node';
|