@ibiz-template-plugin/ai-chat 0.0.116 → 0.0.118
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 +20814 -15578
- 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-back-bottom/chat-back-bottom.d.ts +5 -3
- package/dist/types/components/chat-container/chat-container.d.ts +25 -24
- package/dist/types/components/chat-file-preview/components/custom-chat-file-preview/custom-chat-file-preview.d.ts +19 -0
- package/dist/types/components/chat-file-preview/components/default-chat-file-preview/default-chat-file-preview.d.ts +19 -0
- package/dist/types/components/chat-group-topics/components/selected-mode-topic/selected-mode-topic.d.ts +21 -0
- package/dist/types/components/chat-group-topics/components/show-hidden-setting/show-hidden-setting.d.ts +17 -0
- package/dist/types/components/chat-group-topics/components/topic-batch-action/topic-batch-action.d.ts +21 -0
- package/dist/types/components/chat-messages/chat-messages.d.ts +10 -9
- package/dist/types/components/chat-messages/use-message-renderer.d.ts +89 -0
- package/dist/types/components/chat-net-disk/file-move-panel/file-move-panel.d.ts +27 -0
- package/dist/types/components/common/actions/actions.d.ts +29 -0
- package/dist/types/components/common/context-menu/context-menu.d.ts +34 -0
- package/dist/types/components/common/drawer/drawer.d.ts +6 -1
- package/dist/types/components/common/index.d.ts +9 -0
- package/dist/types/components/common/inline-editor/inline-editor.d.ts +13 -0
- package/dist/types/components/common/lazy-list-tree/lazy-list-tree.d.ts +31 -3
- package/dist/types/components/common/lazy-tree/lazy-tree.d.ts +46 -5
- package/dist/types/components/common/modal/modal.d.ts +37 -0
- package/dist/types/components/flat-chat-container/flat-chat-container.d.ts +5 -1
- package/dist/types/components/popup/popup.d.ts +2 -1
- package/dist/types/constants/index.d.ts +4 -0
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +12 -0
- package/dist/types/controller/ai-topic/ai-topic.controller.d.ts +83 -5
- package/dist/types/controller/file-system/file-system.controller.d.ts +68 -1
- package/dist/types/controller/index.d.ts +1 -0
- package/dist/types/controller/overlay/drawer-overlay.controller.d.ts +9 -0
- package/dist/types/controller/overlay/index.d.ts +1 -0
- package/dist/types/controller/overlay/modal-overlay.controller.d.ts +47 -0
- package/dist/types/controller/overlay/overlay.controller.d.ts +7 -1
- package/dist/types/controller/tiptap/config/file-node-config.d.ts +3 -0
- package/dist/types/controller/tiptap/tiptap.controller.d.ts +50 -0
- package/dist/types/entity/chart-topic/chart-topic.d.ts +1 -0
- package/dist/types/entity/chat-message/chat-message.d.ts +1 -0
- package/dist/types/icons/eye-svg.d.ts +1 -0
- package/dist/types/icons/index.d.ts +3 -0
- package/dist/types/icons/move-file-svg.d.ts +1 -0
- package/dist/types/icons/new-folder-svg.d.ts +2 -0
- package/dist/types/icons/system-file/archive.d.ts +8 -0
- package/dist/types/icons/system-file/audio.d.ts +6 -0
- package/dist/types/icons/system-file/excel.d.ts +4 -0
- package/dist/types/icons/system-file/image.d.ts +8 -0
- package/dist/types/icons/system-file/index.d.ts +10 -0
- package/dist/types/icons/system-file/other.d.ts +2 -0
- package/dist/types/icons/system-file/ppt.d.ts +4 -0
- package/dist/types/icons/system-file/program.d.ts +18 -0
- package/dist/types/icons/system-file/text.d.ts +21 -0
- package/dist/types/icons/system-file/video.d.ts +11 -0
- package/dist/types/icons/system-file/word.d.ts +8 -0
- package/dist/types/interface/i-chat-container/i-chat-container.d.ts +6 -0
- package/dist/types/interface/i-chat-message/i-chat-message.d.ts +6 -0
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +6 -0
- package/dist/types/interface/i-file-system-options/i-file-system-options.d.ts +156 -3
- package/dist/types/interface/i-remote-resource/i-remote-resource.d.ts +6 -0
- package/dist/types/interface/i-tiptap/i-tiptap.d.ts +51 -0
- package/dist/types/interface/i-topic-options/i-topic-options.d.ts +50 -5
- package/dist/types/interface/index.d.ts +2 -1
- package/dist/types/locale/en/index.d.ts +18 -1
- package/dist/types/locale/zh-CN/index.d.ts +18 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/util/system-file.d.ts +12 -0
- package/dist/types/utils/util/util.d.ts +2 -1
- package/package.json +2 -2
- package/dist/types/components/chat-editor/node/mention-node.d.ts +0 -3
- package/dist/types/components/chat-messages/use-virtual-list.d.ts +0 -156
- package/dist/types/components/chat-scrollbar/chat-scrollbar.d.ts +0 -102
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RefObject } from 'preact';
|
|
1
2
|
|
|
2
3
|
export interface ChatBackBottomProps {
|
|
3
4
|
/**
|
|
@@ -13,11 +14,12 @@ export interface ChatBackBottomProps {
|
|
|
13
14
|
*/
|
|
14
15
|
bottom: number;
|
|
15
16
|
/**
|
|
16
|
-
* @description
|
|
17
|
-
*
|
|
17
|
+
* @description 滚动目标(元素 ref 或选择器;多实例场景应传 ref,
|
|
18
|
+
* 选择器经 document.querySelector 只会命中首个匹配实例)
|
|
19
|
+
* @type {RefObject<HTMLElement> | string}
|
|
18
20
|
* @memberof ChatBackBottomProps
|
|
19
21
|
*/
|
|
20
|
-
target: string;
|
|
22
|
+
target: RefObject<HTMLElement> | string;
|
|
21
23
|
/**
|
|
22
24
|
* @description 滚动高度达到此参数值才出现
|
|
23
25
|
* @type {number}
|
|
@@ -210,7 +210,6 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
|
|
|
210
210
|
fitPanelToViewport(panel: AiActionPanelController): void;
|
|
211
211
|
ns: Namespace;
|
|
212
212
|
containerRef: import('preact').RefObject<HTMLDivElement>;
|
|
213
|
-
dragHandle: import('preact').RefObject<HTMLDivElement>;
|
|
214
213
|
/**
|
|
215
214
|
* 输入区容器(用于高度分隔条)
|
|
216
215
|
*/
|
|
@@ -237,13 +236,6 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
|
|
|
237
236
|
minHeight: number;
|
|
238
237
|
showMode: string;
|
|
239
238
|
};
|
|
240
|
-
/**
|
|
241
|
-
* 是否禁止拖动
|
|
242
|
-
* - 拖拽边时应禁止拖动
|
|
243
|
-
* @type {boolean}
|
|
244
|
-
* @memberof ChatContainer
|
|
245
|
-
*/
|
|
246
|
-
disabled: boolean;
|
|
247
239
|
/**
|
|
248
240
|
* 最小化是否在拖拽中
|
|
249
241
|
* - 在拖拽时不应触发点击事件
|
|
@@ -255,13 +247,6 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
|
|
|
255
247
|
* 侧栏宽度拖动起始值(px)
|
|
256
248
|
*/
|
|
257
249
|
sidebarDragStartWidth: number;
|
|
258
|
-
/**
|
|
259
|
-
* 拖拽容器边框时的方向标记(左右=宽、上下=高)
|
|
260
|
-
*/
|
|
261
|
-
resizing: {
|
|
262
|
-
width: boolean;
|
|
263
|
-
height: boolean;
|
|
264
|
-
};
|
|
265
250
|
/**
|
|
266
251
|
* 输入区高度拖动起始值(px)
|
|
267
252
|
*/
|
|
@@ -333,18 +318,12 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
|
|
|
333
318
|
* @memberof ChatContainer
|
|
334
319
|
*/
|
|
335
320
|
snapToEdge(): void;
|
|
336
|
-
/**
|
|
337
|
-
* 注册对话框拖拽
|
|
338
|
-
*
|
|
339
|
-
* @memberof ChatContainer
|
|
340
|
-
*/
|
|
341
|
-
registerDragDialog(): void;
|
|
342
321
|
/**
|
|
343
322
|
* 注册对话框边界拖拽
|
|
344
323
|
*
|
|
345
324
|
* @memberof ChatContainer
|
|
346
325
|
*/
|
|
347
|
-
|
|
326
|
+
registerDrag(): void;
|
|
348
327
|
/**
|
|
349
328
|
* 处理全屏改变
|
|
350
329
|
*
|
|
@@ -401,6 +380,24 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
|
|
|
401
380
|
* 右侧聊天区宽度
|
|
402
381
|
*/
|
|
403
382
|
getRightWidth(): string;
|
|
383
|
+
/**
|
|
384
|
+
* @description 获取宽度
|
|
385
|
+
* @returns {*} {{
|
|
386
|
+
* centreMinWidth: number;
|
|
387
|
+
* leftWidth: number;
|
|
388
|
+
* rightWidth: number;
|
|
389
|
+
* leftMinWidth: number;
|
|
390
|
+
* rightMinWidth: number;
|
|
391
|
+
* }}
|
|
392
|
+
* @memberof ChatContainer
|
|
393
|
+
*/
|
|
394
|
+
getWidth(): {
|
|
395
|
+
centreMinWidth: number;
|
|
396
|
+
leftWidth: number;
|
|
397
|
+
rightWidth: number;
|
|
398
|
+
leftMinWidth: number;
|
|
399
|
+
rightMinWidth: number;
|
|
400
|
+
};
|
|
404
401
|
/**
|
|
405
402
|
* 侧栏宽度拖动开始
|
|
406
403
|
*/
|
|
@@ -418,9 +415,13 @@ export declare class ChatContainer extends Component<ChatContainerProps, ChatCon
|
|
|
418
415
|
*/
|
|
419
416
|
clampSidebarWidth(width: number): number;
|
|
420
417
|
/**
|
|
421
|
-
* 拖动容器左右边框时实时校正侧栏宽度
|
|
418
|
+
* @description 拖动容器左右边框时实时校正侧栏宽度
|
|
419
|
+
* - 中间宽度已到最小宽度时缩小对应边的侧边栏
|
|
420
|
+
* @param {('left' | 'right')} direction
|
|
421
|
+
* @param {number} width
|
|
422
|
+
* @memberof ChatContainer
|
|
422
423
|
*/
|
|
423
|
-
syncSidebarWidth: () => void;
|
|
424
|
+
syncSidebarWidth: (direction: "left" | "right", width: number) => void;
|
|
424
425
|
/**
|
|
425
426
|
* 拖动容器左右边框结束后提交侧栏宽度
|
|
426
427
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FileSystemController } from '../../../../controller';
|
|
2
|
+
import { IFile } from '../../../../interface';
|
|
3
|
+
|
|
4
|
+
interface CustomChatFilePreviewProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 文件
|
|
7
|
+
* @type {IFile}
|
|
8
|
+
* @memberof CustomChatFilePreviewProps
|
|
9
|
+
*/
|
|
10
|
+
file?: IFile;
|
|
11
|
+
/**
|
|
12
|
+
* @description 系统文件控制器
|
|
13
|
+
* @type {FileSystemController}
|
|
14
|
+
* @memberof CustomChatFilePreviewProps
|
|
15
|
+
*/
|
|
16
|
+
controller: FileSystemController;
|
|
17
|
+
}
|
|
18
|
+
export declare const CustomChatFilePreview: (props: CustomChatFilePreviewProps) => import("preact").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FileSystemController } from '../../../../controller';
|
|
2
|
+
import { IFile } from '../../../../interface';
|
|
3
|
+
|
|
4
|
+
interface DefaultChatFilePreviewProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 文件
|
|
7
|
+
* @type {IFile}
|
|
8
|
+
* @memberof DefaultChatFilePreviewProps
|
|
9
|
+
*/
|
|
10
|
+
file?: IFile;
|
|
11
|
+
/**
|
|
12
|
+
* @description 系统文件控制器
|
|
13
|
+
* @type {FileSystemController}
|
|
14
|
+
* @memberof DefaultChatFilePreviewProps
|
|
15
|
+
*/
|
|
16
|
+
controller: FileSystemController;
|
|
17
|
+
}
|
|
18
|
+
export declare const DefaultChatFilePreview: (props: DefaultChatFilePreviewProps) => import("preact").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AiTopicController } from '../../../../controller';
|
|
2
|
+
|
|
3
|
+
export interface SelectedModeTopicProps {
|
|
4
|
+
/**
|
|
5
|
+
* 话题控制器
|
|
6
|
+
*
|
|
7
|
+
* @author tony001
|
|
8
|
+
* @date 2025-02-20 17:02:49
|
|
9
|
+
* @type {AiTopicController}
|
|
10
|
+
*/
|
|
11
|
+
controller: AiTopicController;
|
|
12
|
+
/**
|
|
13
|
+
* 进入多选模式时默认选中的话题id
|
|
14
|
+
*/
|
|
15
|
+
defaultSelectedTopicId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 抽屉关闭回调(由 Drawer 自动注入)
|
|
18
|
+
*/
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const SelectedModeTopic: (props: SelectedModeTopicProps) => import("preact").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AiTopicController } from '../../../../controller';
|
|
2
|
+
|
|
3
|
+
export interface ShowHiddenSettingProps {
|
|
4
|
+
/**
|
|
5
|
+
* 话题控制器
|
|
6
|
+
*
|
|
7
|
+
* @author tony001
|
|
8
|
+
* @date 2025-02-20 17:02:49
|
|
9
|
+
* @type {AiTopicController}
|
|
10
|
+
*/
|
|
11
|
+
controller: AiTopicController;
|
|
12
|
+
/**
|
|
13
|
+
* 抽屉关闭回调(由 Drawer 自动注入)
|
|
14
|
+
*/
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const ShowHiddenSetting: (props: ShowHiddenSettingProps) => import("preact").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AiTopicController } from '../../../../controller';
|
|
2
|
+
|
|
3
|
+
export interface TopicBatchActionProps {
|
|
4
|
+
/**
|
|
5
|
+
* 话题控制器
|
|
6
|
+
*
|
|
7
|
+
* @author tony001
|
|
8
|
+
* @date 2025-02-20 17:02:49
|
|
9
|
+
* @type {AiTopicController}
|
|
10
|
+
*/
|
|
11
|
+
controller: AiTopicController;
|
|
12
|
+
/**
|
|
13
|
+
* 进入批量管理时默认选中的目录key
|
|
14
|
+
*/
|
|
15
|
+
defaultSelectedScopeKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 抽屉关闭回调(由 Drawer 自动注入)
|
|
18
|
+
*/
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const TopicBatchAction: (props: TopicBatchActionProps) => import("preact").JSX.Element;
|
|
@@ -26,15 +26,16 @@ export interface ChatMessageProps {
|
|
|
26
26
|
/**
|
|
27
27
|
* 聊天消息列表组件
|
|
28
28
|
*
|
|
29
|
-
* ##
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* ## 整体思路(真实绘制 + 按需扩展)
|
|
30
|
+
* 弃用虚拟列表(绝对定位 + spacer 存在滚动条抖动),所有消息按普通文档流真实渲染:
|
|
31
|
+
* 1. 初始只真实绘制最新的 20 条,更早的消息不进 DOM(无占位);
|
|
32
|
+
* 2. 滚动到顶部附近时向前扩展一批(每批 10 条)真实绘制,绘制过的消息永久保留真实渲染;
|
|
33
|
+
* 3. 绘制触达已加载数据头部且服务端仍有更早历史时,才触发 loadHistoryMore 网络加载,
|
|
34
|
+
* 与「绘制扩展」(纯前端)严格分开。
|
|
32
35
|
*
|
|
33
|
-
* ##
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* 3. 非贴底 + 数据变化(前插历史、删除)→ 按锚点恢复位置,避免画面跳动;
|
|
38
|
-
* 纯「测量回填」(totalSize 变但消息引用没变)不干预 scrollTop,避免打断手动拖动。
|
|
36
|
+
* ## 滚动位置维护
|
|
37
|
+
* - 贴底跟随由数据变化布局修正驱动:消息更新、绘制范围变化后处于贴底模式时自动贴底;
|
|
38
|
+
* - 末尾追加用户消息 → 强制贴底;前插更早历史 → 依赖浏览器 scroll anchoring 保持视口;
|
|
39
|
+
* - keep-alive 失活再激活 → 恢复失活前滚动位置。
|
|
39
40
|
*/
|
|
40
41
|
export declare const ChatMessages: (props: ChatMessageProps) => import("preact").JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { RefObject } from 'preact';
|
|
2
|
+
import { Signal } from '@preact/signals';
|
|
3
|
+
import { IChatMessage } from '../../interface';
|
|
4
|
+
|
|
5
|
+
export declare const INITIAL_BATCH_SIZE = 20;
|
|
6
|
+
export declare const EXPAND_BATCH_SIZE = 10;
|
|
7
|
+
export interface UseMessageRenderOptions {
|
|
8
|
+
/**
|
|
9
|
+
* 消息数组信号(内容/数量变化都会触发组件重渲染)
|
|
10
|
+
*
|
|
11
|
+
* @type {Signal<IChatMessage[]>}
|
|
12
|
+
*/
|
|
13
|
+
messages: Signal<IChatMessage[]>;
|
|
14
|
+
/**
|
|
15
|
+
* 是否还有更早历史可加载(绘制触达数据头部时用于触发数据加载)
|
|
16
|
+
*
|
|
17
|
+
* @type {Signal<boolean>}
|
|
18
|
+
*/
|
|
19
|
+
hasMoreHistory: Signal<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* 是否正在加载更早历史
|
|
22
|
+
*
|
|
23
|
+
* @type {Signal<boolean>}
|
|
24
|
+
*/
|
|
25
|
+
isLoadingHistory: Signal<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* 加载更早历史(数据层,网络请求)
|
|
28
|
+
*
|
|
29
|
+
* @type {() => void}
|
|
30
|
+
*/
|
|
31
|
+
loadHistoryMore: () => void;
|
|
32
|
+
}
|
|
33
|
+
export interface UseMessageRenderResult {
|
|
34
|
+
/**
|
|
35
|
+
* 挂到滚动容器上的 ref
|
|
36
|
+
*
|
|
37
|
+
* @type {RefObject<HTMLDivElement>}
|
|
38
|
+
*/
|
|
39
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
40
|
+
/**
|
|
41
|
+
* 已绘制覆盖的头部索引(实际值):[renderStartIndex, messages.length) 为真实绘制区,
|
|
42
|
+
* [0, renderStartIndex) 的消息不进 DOM。由 rAF 循环逐帧逼近目标值
|
|
43
|
+
*
|
|
44
|
+
* @type {Signal<number>}
|
|
45
|
+
*/
|
|
46
|
+
renderStartIndex: Signal<number>;
|
|
47
|
+
/**
|
|
48
|
+
* 滚动事件中调用:滚动到顶部附近时向前扩展一批绘制(EXPAND_BATCH_SIZE 条),
|
|
49
|
+
* 绘制触达数据头部且仍有更早历史时触发 loadHistoryMore
|
|
50
|
+
*
|
|
51
|
+
* @type {() => void}
|
|
52
|
+
*/
|
|
53
|
+
checkExpand: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* 设置绘制范围目标索引,rAF 循环逐帧逼近(初始加载/前插共用)
|
|
56
|
+
*
|
|
57
|
+
* @type {(index: number) => void}
|
|
58
|
+
*/
|
|
59
|
+
setRenderTarget: (index: number) => void;
|
|
60
|
+
/**
|
|
61
|
+
* 头部前插历史数据后调用:前插的消息纳入绘制范围(用户在顶部看历史)
|
|
62
|
+
*
|
|
63
|
+
* @type {(prependedCount: number) => void}
|
|
64
|
+
*/
|
|
65
|
+
adjustForPrepend: (prependedCount: number) => void;
|
|
66
|
+
/**
|
|
67
|
+
* 恢复滚动条位置(keep-alive 激活时使用)
|
|
68
|
+
*
|
|
69
|
+
* @type {() => void}
|
|
70
|
+
*/
|
|
71
|
+
restoreScrollPosition: () => void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 消息渐进真实绘制 Hook
|
|
75
|
+
*
|
|
76
|
+
* ## 核心思路(真实绘制 + 按需扩展 + 渲染切片,弃用虚拟列表)
|
|
77
|
+
* 不做视口裁剪、不做占位:消息按普通文档流真实渲染,分批绘制——
|
|
78
|
+
* 1. 初始只绘制最新的 20 条,更早的消息不进 DOM;
|
|
79
|
+
* 2. 滚动到顶部附近时向前扩展一批(EXPAND_BATCH_SIZE 条),绘制过的消息永久真实渲染;
|
|
80
|
+
* 3. 批次扩展不一次性放行:renderStartIndex 由 rAF 循环每帧向目标值推进
|
|
81
|
+
* ITEMS_PER_FRAME 条,把每条消息的 Cherry 初始化/解析分摊到多帧,
|
|
82
|
+
* 避免一批消息同帧挂载导致主线程阻塞数秒。
|
|
83
|
+
*
|
|
84
|
+
* ## 与数据加载的边界
|
|
85
|
+
* 绘制扩展是纯前端行为(不动数据);只有绘制需求触达已加载数据头部
|
|
86
|
+
* (renderTargetIndex === 0)且服务端还有更早历史时,才触发 loadHistoryMore 网络加载。
|
|
87
|
+
*
|
|
88
|
+
*/
|
|
89
|
+
export declare const useMessageRender: (options: UseMessageRenderOptions) => UseMessageRenderResult;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FileSystemController } from '../../../controller';
|
|
2
|
+
import { LazyTreeNode } from '../../common';
|
|
3
|
+
|
|
4
|
+
interface FileMovePanelProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 当前文件数据
|
|
7
|
+
* @type {IFile}
|
|
8
|
+
* @memberof FileMovePanelProps
|
|
9
|
+
*/
|
|
10
|
+
data: LazyTreeNode;
|
|
11
|
+
/**
|
|
12
|
+
* @description 系统文件控制器
|
|
13
|
+
* @type {FileSystemController}
|
|
14
|
+
* @memberof FileMovePanelProps
|
|
15
|
+
*/
|
|
16
|
+
controller: FileSystemController;
|
|
17
|
+
/**
|
|
18
|
+
* @description 关闭
|
|
19
|
+
* @memberof FileMovePanelProps
|
|
20
|
+
*/
|
|
21
|
+
onClose?: (params?: {
|
|
22
|
+
ok: boolean;
|
|
23
|
+
data: any;
|
|
24
|
+
}) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const FileMovePanel: (props: FileMovePanelProps) => import("preact").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { VNode } from 'preact';
|
|
2
|
+
|
|
3
|
+
export interface IAction {
|
|
4
|
+
id: string;
|
|
5
|
+
icon: VNode;
|
|
6
|
+
caption: string;
|
|
7
|
+
visible?: (data?: any) => boolean | boolean;
|
|
8
|
+
onClick?: (event: MouseEvent, data?: any) => void;
|
|
9
|
+
}
|
|
10
|
+
interface ActionsProps {
|
|
11
|
+
/**
|
|
12
|
+
* 平铺项
|
|
13
|
+
*/
|
|
14
|
+
flattenCount?: number;
|
|
15
|
+
/**
|
|
16
|
+
* 自定义类名
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 行为项数据
|
|
21
|
+
*/
|
|
22
|
+
actions: IAction[];
|
|
23
|
+
/**
|
|
24
|
+
* 行为项数据
|
|
25
|
+
*/
|
|
26
|
+
data?: any;
|
|
27
|
+
}
|
|
28
|
+
export declare const Actions: (props: ActionsProps) => import("preact").JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IAction } from '../actions/actions';
|
|
2
|
+
|
|
3
|
+
export interface IContextMenuAction extends IAction {
|
|
4
|
+
clickClose?: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface ContextMenuProps {
|
|
7
|
+
/**
|
|
8
|
+
* 行为数据
|
|
9
|
+
*/
|
|
10
|
+
data?: any;
|
|
11
|
+
/**
|
|
12
|
+
* 显示状态
|
|
13
|
+
*/
|
|
14
|
+
visible: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 菜单项
|
|
17
|
+
*/
|
|
18
|
+
actions: IContextMenuAction[];
|
|
19
|
+
/**
|
|
20
|
+
* 菜单出现位置(视口坐标,与 MouseEvent.clientX/clientY 一致)
|
|
21
|
+
*/
|
|
22
|
+
position: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* 切换显示
|
|
28
|
+
* @param state
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
onToggleVisible: (state: boolean) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const ContextMenu: (props: ContextMenuProps) => import("preact").JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -11,8 +11,13 @@ interface DrawerProps {
|
|
|
11
11
|
size?: number | string;
|
|
12
12
|
/** 指定容器(DOM 元素),不传则默认 body */
|
|
13
13
|
container?: HTMLElement;
|
|
14
|
+
/** 是否按 Esc 关闭,默认 true */
|
|
15
|
+
escClosable?: boolean;
|
|
14
16
|
/** 关闭回调(由 DrawerManager 注入) */
|
|
15
|
-
onClose?: (
|
|
17
|
+
onClose?: (params?: {
|
|
18
|
+
ok: boolean;
|
|
19
|
+
data: any;
|
|
20
|
+
}) => void;
|
|
16
21
|
/** 是否显示遮罩,默认 true */
|
|
17
22
|
mask?: boolean;
|
|
18
23
|
/** 是否显示右上角关闭按钮,默认 true */
|
|
@@ -3,3 +3,12 @@ export { MultipleSelect } from './multiple-select/multiple-select';
|
|
|
3
3
|
export { MessageToolbar } from './messsage-toolbar/messsage-toolbar';
|
|
4
4
|
export { Slider } from './slider/slider';
|
|
5
5
|
export { Switch } from './switch/switch';
|
|
6
|
+
export { Actions, type IAction } from './actions/actions';
|
|
7
|
+
export { Breadcrumb } from './breadcrumb/breadcrumb';
|
|
8
|
+
export { LazyListTree, type LazyListTreeRef, } from './lazy-list-tree/lazy-list-tree';
|
|
9
|
+
export { ContextMenu, type IContextMenuAction, } from './context-menu/context-menu';
|
|
10
|
+
export { Drawer } from './drawer/drawer';
|
|
11
|
+
export { LazyTree, type LazyTreeRef, type LazyTreeNode, } from './lazy-tree/lazy-tree';
|
|
12
|
+
export { Loading } from './loading/loading';
|
|
13
|
+
export { InlineEditor } from './inline-editor/inline-editor';
|
|
14
|
+
export { Modal } from './modal/modal';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
interface InlineEditorProps {
|
|
3
|
+
/** 初始值 */
|
|
4
|
+
value?: string;
|
|
5
|
+
/** 占位提示 */
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
/** 回车/失焦确认,校验是否成功 */
|
|
8
|
+
onConfirm: (value: string) => Promise<void> | void;
|
|
9
|
+
/** Esc 或空值失焦取消 */
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const InlineEditor: (props: InlineEditorProps) => import("preact").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LazyTreeNode } from '../lazy-tree/lazy-tree';
|
|
2
|
+
import { IAction } from '../actions/actions';
|
|
2
3
|
|
|
3
4
|
interface LazyListTreeProps {
|
|
4
5
|
/**
|
|
@@ -54,14 +55,41 @@ interface LazyListTreeProps {
|
|
|
54
55
|
* 是否可拖拽
|
|
55
56
|
*/
|
|
56
57
|
draggable?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 行为集合
|
|
60
|
+
*/
|
|
61
|
+
actions?: IAction[];
|
|
62
|
+
/**
|
|
63
|
+
* 新建草稿:type=file/folder;null 表示无草稿
|
|
64
|
+
*/
|
|
65
|
+
draft?: {
|
|
66
|
+
type: 'file' | 'folder';
|
|
67
|
+
parent: LazyTreeNode;
|
|
68
|
+
} | null;
|
|
69
|
+
/**
|
|
70
|
+
* 确认
|
|
71
|
+
* @param name
|
|
72
|
+
* @param node
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
onConfirm?: (name: string, node?: LazyTreeNode) => Promise<void> | void;
|
|
76
|
+
/**
|
|
77
|
+
* 取消
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
80
|
+
onCancel?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* 编辑的节点 id
|
|
83
|
+
*/
|
|
84
|
+
editNodeId?: string | null;
|
|
57
85
|
}
|
|
58
86
|
export interface LazyListTreeRef {
|
|
59
87
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @param
|
|
88
|
+
* 重载
|
|
89
|
+
* @param
|
|
62
90
|
* @returns
|
|
63
91
|
*/
|
|
64
|
-
overloadNode: (
|
|
92
|
+
overloadNode: () => Promise<void>;
|
|
65
93
|
}
|
|
66
94
|
export declare const LazyListTree: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<LazyListTreeProps> & {
|
|
67
95
|
ref?: import('preact').Ref<LazyListTreeRef> | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IAction } from '../actions/actions';
|
|
1
2
|
|
|
2
3
|
export interface LazyTreeNode {
|
|
3
4
|
/**
|
|
@@ -31,7 +32,7 @@ export interface LazyTreeNode {
|
|
|
31
32
|
/**
|
|
32
33
|
* 父节点标识
|
|
33
34
|
*/
|
|
34
|
-
parentId?: string
|
|
35
|
+
parentId?: string;
|
|
35
36
|
/**
|
|
36
37
|
* 节点深度
|
|
37
38
|
*/
|
|
@@ -45,11 +46,13 @@ export interface LazyTreeNode {
|
|
|
45
46
|
*/
|
|
46
47
|
data: Record<string, any>;
|
|
47
48
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @type {string}
|
|
50
|
-
* @memberof LazyTreeNode
|
|
49
|
+
* 根节点标识
|
|
51
50
|
*/
|
|
52
51
|
rootId: string;
|
|
52
|
+
/**
|
|
53
|
+
* 根节点
|
|
54
|
+
*/
|
|
55
|
+
isRoot?: boolean;
|
|
53
56
|
}
|
|
54
57
|
interface LazyTreeProps {
|
|
55
58
|
/**
|
|
@@ -113,11 +116,49 @@ interface LazyTreeProps {
|
|
|
113
116
|
* 是否可拖拽
|
|
114
117
|
*/
|
|
115
118
|
draggable?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* 行为集合
|
|
121
|
+
*/
|
|
122
|
+
actions?: IAction[];
|
|
123
|
+
/**
|
|
124
|
+
* 新建草稿:type=file/folder;null 表示无草稿
|
|
125
|
+
*/
|
|
126
|
+
draft?: {
|
|
127
|
+
type: 'file' | 'folder';
|
|
128
|
+
parent: LazyTreeNode;
|
|
129
|
+
} | null;
|
|
130
|
+
/**
|
|
131
|
+
* 确认
|
|
132
|
+
* @param name
|
|
133
|
+
* @param node
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
136
|
+
onConfirm?: (name: string, node?: LazyTreeNode) => Promise<void> | void;
|
|
137
|
+
/**
|
|
138
|
+
* 取消
|
|
139
|
+
* @returns
|
|
140
|
+
*/
|
|
141
|
+
onCancel?: () => void;
|
|
142
|
+
/**
|
|
143
|
+
* 编辑的节点 id
|
|
144
|
+
*/
|
|
145
|
+
editNodeId?: string | null;
|
|
146
|
+
}
|
|
147
|
+
export interface LazyTreeRef {
|
|
148
|
+
/**
|
|
149
|
+
* @description 重载节点
|
|
150
|
+
* @param {LazyTreeNode} node 需要重载的节点
|
|
151
|
+
* @param {boolean} isParent 是否重载父节点,默认为false
|
|
152
|
+
* @memberof LazyTreeRef
|
|
153
|
+
*/
|
|
154
|
+
overloadNode: (node: LazyTreeNode, isParent?: boolean) => Promise<void>;
|
|
116
155
|
}
|
|
117
156
|
/**
|
|
118
157
|
* 懒加载树组件
|
|
119
158
|
*
|
|
120
159
|
* 具有懒加载、搜索、展开折叠等功能
|
|
121
160
|
*/
|
|
122
|
-
export declare const LazyTree: (
|
|
161
|
+
export declare const LazyTree: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<LazyTreeProps> & {
|
|
162
|
+
ref?: import('preact').Ref<LazyTreeRef> | undefined;
|
|
163
|
+
}>;
|
|
123
164
|
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VNode, h } from 'preact';
|
|
2
|
+
|
|
3
|
+
interface ModalProps {
|
|
4
|
+
/** 头部图标 */
|
|
5
|
+
icon?: VNode;
|
|
6
|
+
/** 内容组件 */
|
|
7
|
+
content: any;
|
|
8
|
+
/** 传递给内容组件的参数(onClose 会被自动注入) */
|
|
9
|
+
contentProps?: Record<string, any>;
|
|
10
|
+
/** 指定容器,不传默认 body */
|
|
11
|
+
container?: HTMLElement;
|
|
12
|
+
/** 关闭回调(由 ModalManager 注入) */
|
|
13
|
+
onClose?: (params?: {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
data: any;
|
|
16
|
+
}) => void;
|
|
17
|
+
/** 是否显示遮罩,默认 true */
|
|
18
|
+
mask?: boolean;
|
|
19
|
+
/** 是否显示右上角关闭按钮,默认 true */
|
|
20
|
+
showClose?: boolean;
|
|
21
|
+
/** 点击遮罩是否关闭,默认 true */
|
|
22
|
+
maskClosable?: boolean;
|
|
23
|
+
/** 是否按 Esc 关闭,默认 true */
|
|
24
|
+
escClosable?: boolean;
|
|
25
|
+
/** 外部扩展类名 */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** 标题 */
|
|
28
|
+
title?: string;
|
|
29
|
+
/** 宽度:number(px) / 字符串('50%' / '600px'),不传默认 80% */
|
|
30
|
+
width?: number | string;
|
|
31
|
+
/** 高度:number(px) / 字符串('50%' / '600px'),不传默认 80% */
|
|
32
|
+
height?: number | string;
|
|
33
|
+
/** 垂直居中,默认 true */
|
|
34
|
+
centered?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare const Modal: (props: ModalProps) => h.JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -49,6 +49,10 @@ export interface FlatChatContainerProps {
|
|
|
49
49
|
* 是否加载中
|
|
50
50
|
*/
|
|
51
51
|
isLoading: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 是否隐藏嵌入AI聊天框头部区域,仅嵌入AI聊天框生效
|
|
54
|
+
*/
|
|
55
|
+
isEmbedAiHeaderHidden: boolean;
|
|
52
56
|
/**
|
|
53
57
|
* @description 扩展
|
|
54
58
|
* @type {IExtensionOptions}
|
|
@@ -222,7 +226,7 @@ export declare class FlatChatContainer extends Component<FlatChatContainerProps>
|
|
|
222
226
|
* @description 绘制头部
|
|
223
227
|
* @memberof FlatChatContainer
|
|
224
228
|
*/
|
|
225
|
-
renderHeader(): JSX.Element;
|
|
229
|
+
renderHeader(): JSX.Element | null;
|
|
226
230
|
/**
|
|
227
231
|
* @description 绘制右侧操作区(含分隔条)
|
|
228
232
|
* - DOM 常驻,宽度随 visible 切换由 CSS 过渡展开/收起
|