@ai-group/chat-sdk 3.6.9 → 3.6.11
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/cjs/client/base.d.ts +1 -2
- package/dist/cjs/client/base.js.map +1 -1
- package/dist/cjs/components/XAdkChatbot/components/ThinkRender/index.d.ts +1 -1
- package/dist/cjs/components/XAdkChatbot/components/ThinkRender/index.js.map +1 -1
- package/dist/cjs/components/XAdkProvider/compound/Sender.js +2 -2
- package/dist/cjs/components/XAdkProvider/compound/Sender.js.map +2 -2
- package/dist/cjs/components/XAdkProvider/compound/Sidebar.js.map +1 -1
- package/dist/cjs/components/XAdkProvider/context/ChatSenderStateContext.d.ts +12 -0
- package/dist/cjs/components/XAdkProvider/context/ChatSenderStateContext.js +40 -0
- package/dist/cjs/components/XAdkProvider/context/ChatSenderStateContext.js.map +7 -0
- package/dist/cjs/components/XAdkProvider/context/index.d.ts +1 -0
- package/dist/cjs/components/XAdkProvider/context/index.js +3 -1
- package/dist/cjs/components/XAdkProvider/context/index.js.map +2 -2
- package/dist/cjs/components/XAdkProvider/index.js +10 -2
- package/dist/cjs/components/XAdkProvider/index.js.map +2 -2
- package/dist/cjs/components/XAiChatbot/index.js.map +1 -1
- package/dist/cjs/components/XAiProvider/index.js.map +1 -1
- package/dist/cjs/components/XAiSender/index.js.map +1 -1
- package/dist/cjs/hooks/useADKChat.js +14 -2
- package/dist/cjs/hooks/useADKChat.js.map +2 -2
- package/dist/cjs/types/XAiChatbot.d.ts +1 -1
- package/dist/cjs/types/XAiChatbot.js.map +1 -1
- package/dist/cjs/types/XAiConversations.d.ts +1 -1
- package/dist/cjs/types/XAiConversations.js.map +1 -1
- package/dist/cjs/types/XAiMessage.d.ts +1 -1
- package/dist/cjs/types/XAiMessage.js.map +1 -1
- package/dist/cjs/types/XAiSender.d.ts +1 -2
- package/dist/cjs/types/XAiSender.js.map +1 -1
- package/dist/cjs/types/antdx.d.ts +146 -0
- package/dist/cjs/types/antdx.js +18 -0
- package/dist/cjs/types/antdx.js.map +7 -0
- package/dist/esm/client/base.d.ts +1 -2
- package/dist/esm/client/base.js.map +1 -1
- package/dist/esm/components/XAdkChatbot/components/ThinkRender/index.d.ts +1 -1
- package/dist/esm/components/XAdkChatbot/components/ThinkRender/index.js.map +1 -1
- package/dist/esm/components/XAdkProvider/compound/Sender.js +4 -4
- package/dist/esm/components/XAdkProvider/compound/Sender.js.map +1 -1
- package/dist/esm/components/XAdkProvider/compound/Sidebar.js.map +1 -1
- package/dist/esm/components/XAdkProvider/context/ChatSenderStateContext.d.ts +12 -0
- package/dist/esm/components/XAdkProvider/context/ChatSenderStateContext.js +16 -0
- package/dist/esm/components/XAdkProvider/context/ChatSenderStateContext.js.map +1 -0
- package/dist/esm/components/XAdkProvider/context/index.d.ts +1 -0
- package/dist/esm/components/XAdkProvider/context/index.js +1 -0
- package/dist/esm/components/XAdkProvider/context/index.js.map +1 -1
- package/dist/esm/components/XAdkProvider/index.js +20 -8
- package/dist/esm/components/XAdkProvider/index.js.map +1 -1
- package/dist/esm/components/XAiChatbot/index.js.map +1 -1
- package/dist/esm/components/XAiProvider/index.js.map +1 -1
- package/dist/esm/components/XAiSender/index.js.map +1 -1
- package/dist/esm/hooks/useADKChat.js +20 -3
- package/dist/esm/hooks/useADKChat.js.map +1 -1
- package/dist/esm/types/XAiChatbot.d.ts +1 -1
- package/dist/esm/types/XAiChatbot.js.map +1 -1
- package/dist/esm/types/XAiConversations.d.ts +1 -1
- package/dist/esm/types/XAiConversations.js.map +1 -1
- package/dist/esm/types/XAiMessage.d.ts +1 -1
- package/dist/esm/types/XAiMessage.js.map +1 -1
- package/dist/esm/types/XAiSender.d.ts +1 -2
- package/dist/esm/types/XAiSender.js.map +1 -1
- package/dist/esm/types/antdx.d.ts +146 -0
- package/dist/esm/types/antdx.js +2 -0
- package/dist/esm/types/antdx.js.map +1 -0
- package/dist/umd/chat-sdk.min.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ConversationsProps, type ConversationItemType } from "
|
|
1
|
+
import { type ConversationsProps, type ConversationItemType } from "./antdx";
|
|
2
2
|
import React from "react";
|
|
3
3
|
type OmitItems = Omit<ConversationsProps, "items" | "style">;
|
|
4
4
|
export interface SessionData extends ConversationItemType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/XAiConversations.ts"],"sourcesContent":["import {\n type ConversationsProps,\n type ConversationItemType,\n} from \"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/XAiConversations.ts"],"sourcesContent":["import {\n type ConversationsProps,\n type ConversationItemType,\n} from \"./antdx\";\nimport React from \"react\";\n\ntype OmitItems = Omit<ConversationsProps, \"items\" | \"style\">;\n\nexport interface SessionData extends ConversationItemType {\n meta?: any;\n}\n\nexport interface XAiConversationsProps extends OmitItems {\n /** 配色 */\n color?: string;\n /** 侧边栏展示形式,若为 true 则为抽屉式展示 */\n isNarrow?: boolean;\n /** 会话列表,替换原来的 items 字段 */\n sessionList?: SessionData[];\n /** session总数,当设置该值时,会增加自动加载逻辑 */\n sessionTotal?: number;\n /** 加载更多函数 */\n loadMoreSession?: () => void;\n /** 点击生成新对话回调 */\n onNewChat?: () => void;\n style?: React.CSSProperties;\n}\n"],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PromptsProps } from '
|
|
1
|
+
import type { PromptsProps } from './antdx';
|
|
2
2
|
export type MessageType = 'TextMessage' | 'ActionExecutionMessage' | 'ResultMessage' | 'AgentStateMessage' | 'SuggestionMessage';
|
|
3
3
|
export declare enum MessageRole {
|
|
4
4
|
user = "user",// 用户
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MessageRole","MessageStatus","ActionAvailability"],"sources":["../../../src/types/XAiMessage.ts"],"sourcesContent":["import type { PromptsProps } from '
|
|
1
|
+
{"version":3,"names":["MessageRole","MessageStatus","ActionAvailability"],"sources":["../../../src/types/XAiMessage.ts"],"sourcesContent":["import type { PromptsProps } from './antdx';\n\nexport type MessageType =\n| 'TextMessage'\n| 'ActionExecutionMessage'\n| 'ResultMessage'\n| 'AgentStateMessage'\n| 'SuggestionMessage';\n\nexport enum MessageRole {\n user = 'user', // 用户\n assistant = 'assistant', // AI助手\n suggestion = 'suggestion', // 建议\n system = 'system', // 工具\n}\n\nexport enum MessageStatus {\n init = 'init',\n pending = 'pending', // 生成中/接收中\n done = 'done', // 已完成\n failed = 'failed', // 失败\n recalled = 'recalled', // 已撤回\n deleted = 'deleted', // 已删除\n}\n\n/**\n * 阶段性回答内容\n */\nexport interface Steps {\n id: string; // 阶段性回答ID\n content: any; // 文本内容\n}\n\n/**\n* 所有消息的基础结构\n*/\nexport interface BaseMessage {\n id: string; // 消息唯一ID\n type: MessageType; // 消息类型\n createdAt: Date; // 创建时间\n status?: MessageStatus; // 内容是否生成中\n execute?: ActionExecutionMessage[]; // 智能体执行过程\n stepContent?: Steps[]; // 阶段性回答内容\n thinks?: string ; // 思考过程\n extra?: any; // 额外消息\n isLike?: 0 | 1 | -1; // 是否喜欢\n raw?: any; // 原始消息\n}\n\nexport interface FileMessage {\n fileId?: string | number; // 文件ID\n fileName?: string; // 文件名\n fileSize?: number | string; // 文件大小(字节)\n fileType?: string; // 文件类型(MIME类型)\n fileUrl?: string; // 文件URL(可选,用于展示/下载)\n}\n\n/**\n* 文本消息\n*/\nexport interface TextMessage extends BaseMessage {\n type: 'TextMessage';\n role: MessageRole; // 发送者角色\n content: {\n text?: string; // 文本内容\n files?: FileMessage[]; // 文件列表\n };\n parentMessageId?: string; // 父消息ID(可选)\n}\n\n/**\n* 工具/动作执行消息\n*/\nexport interface ActionExecutionMessage extends BaseMessage {\n type: 'ActionExecutionMessage';\n name: string; // 动作/工具名称\n arguments?: Record<string, any>; // 执行参数\n parentMessageId?: string;\n extra?: any; // 额外信息\n}\n\n/**\n* 工具/动作执行结果消息\n*/\nexport interface ResultMessage extends BaseMessage {\n type: 'ResultMessage';\n actionExecutionId: string; // 执行ID\n actionName: string; // 动作/工具名称\n result: string; // 执行结果\n}\n\n/**\n* 智能体状态消息\n*/\nexport interface AgentStateMessage extends BaseMessage {\n type: 'AgentStateMessage';\n threadId: string; // 线程ID\n agentName: string; // agent名称\n nodeName: string; // 节点名称\n runId: string; // 运行ID\n active: boolean; // 是否激活\n role: MessageRole; // 角色\n state: any; // 状态内容\n running: boolean; // 是否运行中\n}\n\n/**\n * 提示消息\n */\nexport interface SuggestionMessage extends BaseMessage {\n type: 'SuggestionMessage';\n content: PromptsProps['items'];\n role: MessageRole;\n}\n\n/**\n* 消息输入类型(用于前端输入/组装)\n* 可选地包含不同类型的消息体\n*/\nexport interface MessageInput extends BaseMessage {\n textMessage?: Omit<TextMessage, 'id' | 'createdAt' | 'type'>;\n actionExecutionMessage?: Omit<ActionExecutionMessage, 'id' | 'createdAt' | 'type'>;\n resultMessage?: Omit<ResultMessage, 'id' | 'createdAt' | 'type'>;\n agentStateMessage?: Omit<AgentStateMessage, 'id' | 'createdAt' | 'type'>;\n}\n\n/**\n* 消息列表中消息格式\n*/\nexport type Messages = TextMessage | SuggestionMessage;\n\nexport enum ActionAvailability {\n disabled = 'disabled', // 不可用\n enabled = 'enabled', // 可用\n remote = 'remote', // 远程可用\n}\n\n/**\n* 工具/动作定义\n*/\nexport interface Action {\n name: string; // 名称\n description: string; // 描述\n jsonSchema: string; // 参数JSON Schema\n available?: ActionAvailability; // 可用性\n}\n"],"mappings":"AASA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA,OAIG;AAG1B,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA,OAMF;;AAGvB;AACA;AACA;;AAMA;AACA;AACA;;AAsBA;AACA;AACA;;AAWA;AACA;AACA;;AASA;AACA;AACA;;AAQA;AACA;AACA;;AAaA;AACA;AACA;;AAOA;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,WAAYC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA,OAGL;;AAGzB;AACA;AACA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { SenderProps } from '
|
|
2
|
-
import type { Attachment } from '@ant-design/x/es/attachments';
|
|
1
|
+
import type { SenderProps, Attachment } from './antdx';
|
|
3
2
|
import { UploadProps } from 'antd';
|
|
4
3
|
import { FunctionResponse } from './XAdkChatbot';
|
|
5
4
|
export interface SendContent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/XAiSender.ts"],"sourcesContent":["import type { SenderProps
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/XAiSender.ts"],"sourcesContent":["import type { SenderProps, Attachment } from './antdx';\nimport { UploadProps } from 'antd';\nimport { FunctionResponse } from './XAdkChatbot';\n\nexport interface SendContent {\n text?: string;\n files?: Attachment[] | any[];\n functionResponse?: FunctionResponse;\n}\n\nexport interface XAiSenderProps extends Omit<SenderProps, 'onSubmit' | 'onCancel'> {\n /** 是否展示清空按钮 */\n clearBtnShow? : boolean;\n /** 底部文案 */\n footerTips?: string;\n /** 清空对话框按钮回调 */\n onClear?: () => void;\n /** 加载中,点击停止生成按钮回调 */\n onStop?: () => void;\n /** 点击发送按钮的回调 */\n onSubmit?: (content: SendContent) => void;\n /** 显示上传按钮 */\n enableUpload?: boolean;\n /** 文件列表 */\n files?: Attachment[];\n /** 文件列表变化 */\n onChangeFiles?: (files: Attachment[]) => void;\n /** 文件上传 */\n uploadRequest?: UploadProps['customRequest'];\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ant-design/x 类型本地声明
|
|
3
|
+
* 从 @ant-design/x 源码提取的公共 API 类型,减少外部依赖
|
|
4
|
+
*/
|
|
5
|
+
import type React from 'react';
|
|
6
|
+
import type { UploadFile, MenuProps } from 'antd';
|
|
7
|
+
export interface ConversationItemType extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {
|
|
8
|
+
key: string;
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
group?: string;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface DividerItemType {
|
|
16
|
+
type: 'divider';
|
|
17
|
+
key?: string;
|
|
18
|
+
dashed?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export type ItemType = ConversationItemType | DividerItemType;
|
|
21
|
+
type ConversationsSemanticType = 'root' | 'creation' | 'group' | 'item';
|
|
22
|
+
export interface ConversationsProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
23
|
+
items?: ItemType[];
|
|
24
|
+
activeKey?: ConversationItemType['key'];
|
|
25
|
+
defaultActiveKey?: ConversationItemType['key'];
|
|
26
|
+
onActiveChange?: (value: ConversationItemType['key'], item?: ItemType) => void;
|
|
27
|
+
menu?: (MenuProps & {
|
|
28
|
+
trigger?: React.ReactNode | ((conversation: ConversationItemType, info: {
|
|
29
|
+
originNode: React.ReactNode;
|
|
30
|
+
}) => React.ReactNode);
|
|
31
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
32
|
+
}) | ((value: ConversationItemType) => MenuProps & {
|
|
33
|
+
trigger?: React.ReactNode | ((conversation: ConversationItemType, info: {
|
|
34
|
+
originNode: React.ReactNode;
|
|
35
|
+
}) => React.ReactNode);
|
|
36
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
37
|
+
});
|
|
38
|
+
groupable?: boolean | Record<string, any>;
|
|
39
|
+
styles?: Partial<Record<ConversationsSemanticType, React.CSSProperties>>;
|
|
40
|
+
classNames?: Partial<Record<ConversationsSemanticType, string>>;
|
|
41
|
+
prefixCls?: string;
|
|
42
|
+
rootClassName?: string;
|
|
43
|
+
}
|
|
44
|
+
type TextareaProps = React.ComponentProps<typeof import('antd').Input.TextArea>;
|
|
45
|
+
type SubmitType = 'enter' | 'shiftEnter';
|
|
46
|
+
type SenderSemanticType = 'root' | 'prefix' | 'input' | 'suffix' | 'footer' | 'switch' | 'content';
|
|
47
|
+
export interface SenderComponents {
|
|
48
|
+
input?: React.ComponentType<any>;
|
|
49
|
+
}
|
|
50
|
+
export type ActionsComponents = {
|
|
51
|
+
SendButton: React.ComponentType<any>;
|
|
52
|
+
ClearButton: React.ComponentType<any>;
|
|
53
|
+
LoadingButton: React.ComponentType<any>;
|
|
54
|
+
SpeechButton: React.ComponentType<any>;
|
|
55
|
+
};
|
|
56
|
+
export type BaseNode = React.ReactNode | false;
|
|
57
|
+
export type NodeRender = (oriNode: React.ReactNode, info: {
|
|
58
|
+
components: ActionsComponents;
|
|
59
|
+
}) => BaseNode;
|
|
60
|
+
export interface SenderProps extends Partial<Pick<TextareaProps, 'placeholder' | 'onKeyUp' | 'onFocus' | 'onBlur'>> {
|
|
61
|
+
prefixCls?: string;
|
|
62
|
+
defaultValue?: string;
|
|
63
|
+
value?: string;
|
|
64
|
+
loading?: boolean;
|
|
65
|
+
readOnly?: boolean;
|
|
66
|
+
submitType?: SubmitType;
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
onSubmit?: (message: string, ...args: any[]) => void;
|
|
69
|
+
onChange?: (value: string, ...args: any[]) => void;
|
|
70
|
+
onCancel?: VoidFunction;
|
|
71
|
+
onKeyDown?: (event: React.KeyboardEvent) => void | false;
|
|
72
|
+
onPaste?: React.ClipboardEventHandler<HTMLElement>;
|
|
73
|
+
onPasteFile?: (files: FileList) => void;
|
|
74
|
+
components?: SenderComponents;
|
|
75
|
+
classNames?: Partial<Record<SenderSemanticType, string>>;
|
|
76
|
+
styles?: Partial<Record<SenderSemanticType, React.CSSProperties>>;
|
|
77
|
+
rootClassName?: string;
|
|
78
|
+
style?: React.CSSProperties;
|
|
79
|
+
className?: string;
|
|
80
|
+
allowSpeech?: any;
|
|
81
|
+
prefix?: BaseNode | NodeRender;
|
|
82
|
+
footer?: BaseNode | NodeRender;
|
|
83
|
+
suffix?: BaseNode | NodeRender;
|
|
84
|
+
header?: BaseNode | NodeRender;
|
|
85
|
+
autoSize?: boolean | {
|
|
86
|
+
minRows?: number;
|
|
87
|
+
maxRows?: number;
|
|
88
|
+
};
|
|
89
|
+
slotConfig?: Readonly<any[]>;
|
|
90
|
+
skill?: any;
|
|
91
|
+
}
|
|
92
|
+
export interface BasePromptsItemType {
|
|
93
|
+
key: string;
|
|
94
|
+
icon?: React.ReactNode;
|
|
95
|
+
label?: React.ReactNode;
|
|
96
|
+
description?: React.ReactNode;
|
|
97
|
+
disabled?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface PromptsItemType extends BasePromptsItemType {
|
|
100
|
+
children?: BasePromptsItemType[];
|
|
101
|
+
}
|
|
102
|
+
type PromptsSemanticType = 'root' | 'list' | 'item' | 'itemContent' | 'title' | 'subList' | 'subItem';
|
|
103
|
+
export interface PromptsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick' | 'title'> {
|
|
104
|
+
items?: PromptsItemType[];
|
|
105
|
+
title?: React.ReactNode;
|
|
106
|
+
onClick?: (info: {
|
|
107
|
+
data: PromptsItemType;
|
|
108
|
+
}) => void;
|
|
109
|
+
styles?: Partial<Record<PromptsSemanticType, React.CSSProperties>>;
|
|
110
|
+
classNames?: Partial<Record<PromptsSemanticType, string>>;
|
|
111
|
+
prefixCls?: string;
|
|
112
|
+
rootClassName?: string;
|
|
113
|
+
vertical?: boolean;
|
|
114
|
+
wrap?: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface Attachment<T = any> extends UploadFile<T> {
|
|
117
|
+
description?: React.ReactNode;
|
|
118
|
+
cardType?: 'audio' | 'video' | 'image' | 'file';
|
|
119
|
+
}
|
|
120
|
+
export interface AttachmentsRef {
|
|
121
|
+
nativeElement?: HTMLDivElement | null;
|
|
122
|
+
fileNativeElement?: HTMLInputElement | null;
|
|
123
|
+
upload: (file: File) => void;
|
|
124
|
+
select: (options?: {
|
|
125
|
+
accept?: string;
|
|
126
|
+
multiple?: boolean;
|
|
127
|
+
}) => void;
|
|
128
|
+
}
|
|
129
|
+
type ThinkSemanticType = 'root' | 'header' | 'content' | 'icon';
|
|
130
|
+
export interface ThinkProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
131
|
+
prefixCls?: string;
|
|
132
|
+
style?: React.CSSProperties;
|
|
133
|
+
styles?: Partial<Record<ThinkSemanticType, React.CSSProperties>>;
|
|
134
|
+
className?: string;
|
|
135
|
+
classNames?: Partial<Record<ThinkSemanticType, string>>;
|
|
136
|
+
rootClassName?: string;
|
|
137
|
+
title?: React.ReactNode;
|
|
138
|
+
icon?: React.ReactNode;
|
|
139
|
+
loading?: boolean | React.ReactNode;
|
|
140
|
+
defaultExpanded?: boolean;
|
|
141
|
+
expanded?: boolean;
|
|
142
|
+
onExpand?: (expand: boolean) => void;
|
|
143
|
+
blink?: boolean;
|
|
144
|
+
destroyOnHidden?: boolean;
|
|
145
|
+
}
|
|
146
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/antdx.ts"],"sourcesContent":["/**\n * @ant-design/x 类型本地声明\n * 从 @ant-design/x 源码提取的公共 API 类型,减少外部依赖\n */\nimport type React from 'react';\nimport type { UploadFile, MenuProps } from 'antd';\n\n// ==================== Conversations ====================\n\nexport interface ConversationItemType\n extends Omit<React.HTMLAttributes<HTMLLIElement>, 'onClick'> {\n key: string;\n label?: React.ReactNode;\n group?: string;\n icon?: React.ReactNode;\n disabled?: boolean;\n [key: string]: any;\n}\n\nexport interface DividerItemType {\n type: 'divider';\n key?: string;\n dashed?: boolean;\n}\n\nexport type ItemType = ConversationItemType | DividerItemType;\n\ntype ConversationsSemanticType = 'root' | 'creation' | 'group' | 'item';\n\nexport interface ConversationsProps extends React.HTMLAttributes<HTMLUListElement> {\n items?: ItemType[];\n activeKey?: ConversationItemType['key'];\n defaultActiveKey?: ConversationItemType['key'];\n onActiveChange?: (value: ConversationItemType['key'], item?: ItemType) => void;\n menu?:\n | (MenuProps & {\n trigger?:\n | React.ReactNode\n | ((\n conversation: ConversationItemType,\n info: { originNode: React.ReactNode },\n ) => React.ReactNode);\n getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;\n })\n | ((\n value: ConversationItemType,\n ) => MenuProps & {\n trigger?:\n | React.ReactNode\n | ((\n conversation: ConversationItemType,\n info: { originNode: React.ReactNode },\n ) => React.ReactNode);\n getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;\n });\n groupable?: boolean | Record<string, any>;\n styles?: Partial<Record<ConversationsSemanticType, React.CSSProperties>>;\n classNames?: Partial<Record<ConversationsSemanticType, string>>;\n prefixCls?: string;\n rootClassName?: string;\n}\n\n// ==================== Sender ====================\n\ntype TextareaProps = React.ComponentProps<typeof import('antd').Input.TextArea>;\n\ntype SubmitType = 'enter' | 'shiftEnter';\n\ntype SenderSemanticType = 'root' | 'prefix' | 'input' | 'suffix' | 'footer' | 'switch' | 'content';\n\nexport interface SenderComponents {\n input?: React.ComponentType<any>;\n}\n\nexport type ActionsComponents = {\n SendButton: React.ComponentType<any>;\n ClearButton: React.ComponentType<any>;\n LoadingButton: React.ComponentType<any>;\n SpeechButton: React.ComponentType<any>;\n};\n\nexport type BaseNode = React.ReactNode | false;\nexport type NodeRender = (\n oriNode: React.ReactNode,\n info: { components: ActionsComponents },\n) => BaseNode;\n\nexport interface SenderProps\n extends Partial<Pick<TextareaProps, 'placeholder' | 'onKeyUp' | 'onFocus' | 'onBlur'>> {\n prefixCls?: string;\n defaultValue?: string;\n value?: string;\n loading?: boolean;\n readOnly?: boolean;\n submitType?: SubmitType;\n disabled?: boolean;\n onSubmit?: (message: string, ...args: any[]) => void;\n onChange?: (value: string, ...args: any[]) => void;\n onCancel?: VoidFunction;\n onKeyDown?: (event: React.KeyboardEvent) => void | false;\n onPaste?: React.ClipboardEventHandler<HTMLElement>;\n onPasteFile?: (files: FileList) => void;\n components?: SenderComponents;\n classNames?: Partial<Record<SenderSemanticType, string>>;\n styles?: Partial<Record<SenderSemanticType, React.CSSProperties>>;\n rootClassName?: string;\n style?: React.CSSProperties;\n className?: string;\n allowSpeech?: any;\n prefix?: BaseNode | NodeRender;\n footer?: BaseNode | NodeRender;\n suffix?: BaseNode | NodeRender;\n header?: BaseNode | NodeRender;\n autoSize?: boolean | { minRows?: number; maxRows?: number };\n slotConfig?: Readonly<any[]>;\n skill?: any;\n}\n\n// ==================== Prompts ====================\n\nexport interface BasePromptsItemType {\n key: string;\n icon?: React.ReactNode;\n label?: React.ReactNode;\n description?: React.ReactNode;\n disabled?: boolean;\n}\n\nexport interface PromptsItemType extends BasePromptsItemType {\n children?: BasePromptsItemType[];\n}\n\ntype PromptsSemanticType =\n | 'root'\n | 'list'\n | 'item'\n | 'itemContent'\n | 'title'\n | 'subList'\n | 'subItem';\n\nexport interface PromptsProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick' | 'title'> {\n items?: PromptsItemType[];\n title?: React.ReactNode;\n onClick?: (info: { data: PromptsItemType }) => void;\n styles?: Partial<Record<PromptsSemanticType, React.CSSProperties>>;\n classNames?: Partial<Record<PromptsSemanticType, string>>;\n prefixCls?: string;\n rootClassName?: string;\n vertical?: boolean;\n wrap?: boolean;\n}\n\n// ==================== Attachments ====================\n\nexport interface Attachment<T = any>\n extends UploadFile<T> {\n description?: React.ReactNode;\n cardType?: 'audio' | 'video' | 'image' | 'file';\n}\n\nexport interface AttachmentsRef {\n nativeElement?: HTMLDivElement | null;\n fileNativeElement?: HTMLInputElement | null;\n upload: (file: File) => void;\n select: (options?: { accept?: string; multiple?: boolean }) => void;\n}\n\n// ==================== Think ====================\n\ntype ThinkSemanticType = 'root' | 'header' | 'content' | 'icon';\n\nexport interface ThinkProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n prefixCls?: string;\n style?: React.CSSProperties;\n styles?: Partial<Record<ThinkSemanticType, React.CSSProperties>>;\n className?: string;\n classNames?: Partial<Record<ThinkSemanticType, string>>;\n rootClassName?: string;\n title?: React.ReactNode;\n icon?: React.ReactNode;\n loading?: boolean | React.ReactNode;\n defaultExpanded?: boolean;\n expanded?: boolean;\n onExpand?: (expand: boolean) => void;\n blink?: boolean;\n destroyOnHidden?: boolean;\n}\n"],"mappings":""}
|