@ibiz-template-plugin/ai-chat 0.0.117 → 0.0.119
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 +17565 -14324
- package/dist/index.legacy.js +2 -2
- 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-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-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/chat-net-disk/file-new-panel/file-new-panel.d.ts +27 -0
- package/dist/types/components/chat-search/chat-search.d.ts +4 -0
- package/dist/types/components/common/actions/actions.d.ts +29 -0
- package/dist/types/components/common/breadcrumb/breadcrumb.d.ts +1 -8
- 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 +34 -4
- package/dist/types/components/common/lazy-tree/lazy-tree.d.ts +77 -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/controller/file-system/file-system.controller.d.ts +68 -1
- package/dist/types/controller/overlay/drawer-overlay.controller.d.ts +7 -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/icons/index.d.ts +2 -1
- package/dist/types/icons/move-file-svg.d.ts +2 -0
- package/dist/types/icons/new-folder-svg.d.ts +1 -0
- package/dist/types/icons/system-file/archive.d.ts +7 -0
- package/dist/types/icons/system-file/audio.d.ts +5 -0
- package/dist/types/icons/system-file/excel.d.ts +1 -1
- package/dist/types/icons/system-file/image.d.ts +7 -0
- package/dist/types/icons/system-file/ppt.d.ts +0 -1
- package/dist/types/icons/system-file/program.d.ts +17 -0
- package/dist/types/icons/system-file/text.d.ts +4 -0
- package/dist/types/icons/system-file/video.d.ts +6 -0
- package/dist/types/icons/system-file/word.d.ts +7 -0
- package/dist/types/interface/i-chat-container/i-chat-container.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 +20 -0
- package/dist/types/locale/en/index.d.ts +16 -1
- package/dist/types/locale/zh-CN/index.d.ts +16 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/util/system-file.d.ts +2 -0
- package/package.json +2 -2
- 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}
|
|
@@ -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 {};
|
|
@@ -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,27 @@
|
|
|
1
|
+
import { FileSystemController } from '../../../controller';
|
|
2
|
+
import { LazyTreeNode } from '../../common';
|
|
3
|
+
|
|
4
|
+
interface FileNewPanelProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 父数据
|
|
7
|
+
* @type {IFile}
|
|
8
|
+
* @memberof FileNewPanelProps
|
|
9
|
+
*/
|
|
10
|
+
parent: LazyTreeNode;
|
|
11
|
+
/**
|
|
12
|
+
* @description 系统文件控制器
|
|
13
|
+
* @type {FileSystemController}
|
|
14
|
+
* @memberof FileNewPanelProps
|
|
15
|
+
*/
|
|
16
|
+
controller: FileSystemController;
|
|
17
|
+
/**
|
|
18
|
+
* @description 关闭
|
|
19
|
+
* @memberof FileNewPanelProps
|
|
20
|
+
*/
|
|
21
|
+
onClose?: (params?: {
|
|
22
|
+
ok: boolean;
|
|
23
|
+
data: LazyTreeNode;
|
|
24
|
+
}) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const FileNewPanel: (props: FileNewPanelProps) => 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, type LazyListTreeMode, } 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, type INodeEditInfo, } 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,5 +1,7 @@
|
|
|
1
|
-
import { LazyTreeNode } from '../lazy-tree/lazy-tree';
|
|
1
|
+
import { INodeEditInfo, LazyTreeNode } from '../lazy-tree/lazy-tree';
|
|
2
|
+
import { IAction } from '../actions/actions';
|
|
2
3
|
|
|
4
|
+
export type LazyListTreeMode = 'list' | 'card';
|
|
3
5
|
interface LazyListTreeProps {
|
|
4
6
|
/**
|
|
5
7
|
* 根节点数据
|
|
@@ -32,6 +34,7 @@ interface LazyListTreeProps {
|
|
|
32
34
|
path?: LazyTreeNode[];
|
|
33
35
|
/**
|
|
34
36
|
* 是否显示搜索框
|
|
37
|
+
* @default true
|
|
35
38
|
*/
|
|
36
39
|
showSearch?: boolean;
|
|
37
40
|
/**
|
|
@@ -40,10 +43,12 @@ interface LazyListTreeProps {
|
|
|
40
43
|
defaultCheckedKeys?: string[];
|
|
41
44
|
/**
|
|
42
45
|
* 高亮选中
|
|
46
|
+
* @default true
|
|
43
47
|
*/
|
|
44
48
|
highlight?: boolean;
|
|
45
49
|
/**
|
|
46
50
|
* 标识分隔符
|
|
51
|
+
* @default '/'
|
|
47
52
|
*/
|
|
48
53
|
separator?: string;
|
|
49
54
|
/**
|
|
@@ -52,16 +57,41 @@ interface LazyListTreeProps {
|
|
|
52
57
|
filter?: string;
|
|
53
58
|
/**
|
|
54
59
|
* 是否可拖拽
|
|
60
|
+
* @default false
|
|
55
61
|
*/
|
|
56
62
|
draggable?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 行为集合
|
|
65
|
+
*/
|
|
66
|
+
actions?: IAction[];
|
|
67
|
+
/**
|
|
68
|
+
* 节点编辑信息
|
|
69
|
+
*/
|
|
70
|
+
nodeEditInfo?: INodeEditInfo;
|
|
71
|
+
/**
|
|
72
|
+
* 确认
|
|
73
|
+
* @param name
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
onConfirm?: (name: string) => Promise<void> | void;
|
|
77
|
+
/**
|
|
78
|
+
* 取消
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
onCancel?: () => void;
|
|
82
|
+
/**
|
|
83
|
+
* 展示模式
|
|
84
|
+
* @default 'list'
|
|
85
|
+
*/
|
|
86
|
+
mode?: LazyListTreeMode;
|
|
57
87
|
}
|
|
58
88
|
export interface LazyListTreeRef {
|
|
59
89
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @param
|
|
90
|
+
* 重载
|
|
91
|
+
* @param
|
|
62
92
|
* @returns
|
|
63
93
|
*/
|
|
64
|
-
overloadNode: (
|
|
94
|
+
overloadNode: () => Promise<void>;
|
|
65
95
|
}
|
|
66
96
|
export declare const LazyListTree: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<LazyListTreeProps> & {
|
|
67
97
|
ref?: import('preact').Ref<LazyListTreeRef> | undefined;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { VNode } from 'preact';
|
|
2
|
+
import { IAction } from '../actions/actions';
|
|
1
3
|
|
|
2
4
|
export interface LazyTreeNode {
|
|
3
5
|
/**
|
|
@@ -31,7 +33,7 @@ export interface LazyTreeNode {
|
|
|
31
33
|
/**
|
|
32
34
|
* 父节点标识
|
|
33
35
|
*/
|
|
34
|
-
parentId?: string
|
|
36
|
+
parentId?: string;
|
|
35
37
|
/**
|
|
36
38
|
* 节点深度
|
|
37
39
|
*/
|
|
@@ -45,11 +47,45 @@ export interface LazyTreeNode {
|
|
|
45
47
|
*/
|
|
46
48
|
data: Record<string, any>;
|
|
47
49
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @type {string}
|
|
50
|
-
* @memberof LazyTreeNode
|
|
50
|
+
* 根节点标识
|
|
51
51
|
*/
|
|
52
52
|
rootId: string;
|
|
53
|
+
/**
|
|
54
|
+
* 根节点
|
|
55
|
+
*/
|
|
56
|
+
isRoot?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface INodeEditInfo {
|
|
59
|
+
/**
|
|
60
|
+
* @description 图标
|
|
61
|
+
* @type {VNode}
|
|
62
|
+
* @memberof INodeEditInfo
|
|
63
|
+
*/
|
|
64
|
+
icon?: VNode;
|
|
65
|
+
/**
|
|
66
|
+
* @description 默认值
|
|
67
|
+
* @type {string}
|
|
68
|
+
* @memberof INodeEditInfo
|
|
69
|
+
*/
|
|
70
|
+
value?: string;
|
|
71
|
+
/**
|
|
72
|
+
* @description 占位提示
|
|
73
|
+
* @type {string}
|
|
74
|
+
* @memberof INodeEditInfo
|
|
75
|
+
*/
|
|
76
|
+
placeholder?: string;
|
|
77
|
+
/**
|
|
78
|
+
* @description 类型
|
|
79
|
+
* @type {('draft' | 'edit')} 草稿节点 | 节点编辑
|
|
80
|
+
* @memberof INodeEditInfo
|
|
81
|
+
*/
|
|
82
|
+
type: 'draft' | 'edit';
|
|
83
|
+
/**
|
|
84
|
+
* @description 草稿的父节点 | 编辑节点
|
|
85
|
+
* @type {LazyTreeNode}
|
|
86
|
+
* @memberof INodeEditInfo
|
|
87
|
+
*/
|
|
88
|
+
node: LazyTreeNode;
|
|
53
89
|
}
|
|
54
90
|
interface LazyTreeProps {
|
|
55
91
|
/**
|
|
@@ -83,6 +119,7 @@ interface LazyTreeProps {
|
|
|
83
119
|
activePath?: LazyTreeNode[];
|
|
84
120
|
/**
|
|
85
121
|
* 是否显示搜索框
|
|
122
|
+
* @default true
|
|
86
123
|
*/
|
|
87
124
|
showSearch?: boolean;
|
|
88
125
|
/**
|
|
@@ -91,18 +128,22 @@ interface LazyTreeProps {
|
|
|
91
128
|
defaultCheckedKeys?: string[];
|
|
92
129
|
/**
|
|
93
130
|
* 高亮选中
|
|
131
|
+
* @default true
|
|
94
132
|
*/
|
|
95
133
|
highlight?: boolean;
|
|
96
134
|
/**
|
|
97
135
|
* 高亮选中父节点
|
|
136
|
+
* @default true
|
|
98
137
|
*/
|
|
99
138
|
highlightParent?: boolean;
|
|
100
139
|
/**
|
|
101
140
|
* 是否在点击节点的时候展开或者收缩节点
|
|
141
|
+
* @default true
|
|
102
142
|
*/
|
|
103
143
|
expandOnClickNode?: boolean;
|
|
104
144
|
/**
|
|
105
145
|
* 标识分隔符
|
|
146
|
+
* @default '/'
|
|
106
147
|
*/
|
|
107
148
|
separator?: string;
|
|
108
149
|
/**
|
|
@@ -111,13 +152,44 @@ interface LazyTreeProps {
|
|
|
111
152
|
filter?: string;
|
|
112
153
|
/**
|
|
113
154
|
* 是否可拖拽
|
|
155
|
+
* @default false
|
|
114
156
|
*/
|
|
115
157
|
draggable?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* 行为集合
|
|
160
|
+
*/
|
|
161
|
+
actions?: IAction[];
|
|
162
|
+
/**
|
|
163
|
+
* 节点编辑信息
|
|
164
|
+
*/
|
|
165
|
+
nodeEditInfo?: INodeEditInfo;
|
|
166
|
+
/**
|
|
167
|
+
* 确认
|
|
168
|
+
* @param name
|
|
169
|
+
* @returns
|
|
170
|
+
*/
|
|
171
|
+
onConfirm?: (name: string) => Promise<void> | void;
|
|
172
|
+
/**
|
|
173
|
+
* 取消
|
|
174
|
+
* @returns
|
|
175
|
+
*/
|
|
176
|
+
onCancel?: () => void;
|
|
177
|
+
}
|
|
178
|
+
export interface LazyTreeRef {
|
|
179
|
+
/**
|
|
180
|
+
* @description 重载节点
|
|
181
|
+
* @param {LazyTreeNode} node 需要重载的节点
|
|
182
|
+
* @param {boolean} isParent 是否重载父节点,默认为false
|
|
183
|
+
* @memberof LazyTreeRef
|
|
184
|
+
*/
|
|
185
|
+
overloadNode: (node: LazyTreeNode, isParent?: boolean) => Promise<void>;
|
|
116
186
|
}
|
|
117
187
|
/**
|
|
118
188
|
* 懒加载树组件
|
|
119
189
|
*
|
|
120
190
|
* 具有懒加载、搜索、展开折叠等功能
|
|
121
191
|
*/
|
|
122
|
-
export declare const LazyTree: (
|
|
192
|
+
export declare const LazyTree: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<LazyTreeProps> & {
|
|
193
|
+
ref?: import('preact').Ref<LazyTreeRef> | undefined;
|
|
194
|
+
}>;
|
|
123
195
|
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 过渡展开/收起
|
|
@@ -6,13 +6,14 @@ interface ActionItem {
|
|
|
6
6
|
caption: string;
|
|
7
7
|
icon?: VNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const Popup: ({ triggerMode, children, actions, content, position, isOpen: isOpenProp, onToggleOpen, onAction, }: {
|
|
9
|
+
export declare const Popup: ({ triggerMode, children, actions, content, position, isOpen: isOpenProp, onToggleOpen, popupClassName, onAction, }: {
|
|
10
10
|
triggerMode: "click" | "hover";
|
|
11
11
|
children: import('preact').ComponentChildren;
|
|
12
12
|
actions?: ActionItem[];
|
|
13
13
|
content?: import('preact').ComponentChildren;
|
|
14
14
|
position?: Position;
|
|
15
15
|
isOpen?: boolean;
|
|
16
|
+
popupClassName?: string;
|
|
16
17
|
onToggleOpen?: (isOpen: boolean) => void;
|
|
17
18
|
onAction?: (actionId: string, event: MouseEvent) => void;
|
|
18
19
|
}) => import("preact").JSX.Element;
|