diff --git a/db/TDesign.db b/db/TDesign.db index 5c298a546..38231b750 100644 Binary files a/db/TDesign.db and b/db/TDesign.db differ diff --git a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.en-US.md b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.en-US.md index 6312cd2bf..5e93569aa 100644 --- a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.en-US.md +++ b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.en-US.md @@ -8,5 +8,5 @@ name | type | default | description | required -- | -- | -- | -- | -- style | Object | - | CSS(Cascading Style Sheets) | N custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -animation | String | moving | options: skeleton/moving/gradient/dot | N +animation | String | moving | options: skeleton/moving/gradient/dots | N text | String | - | text of chat loading | N diff --git a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.md b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.md index eacef09be..475d22fdf 100644 --- a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.md +++ b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/README.md @@ -8,5 +8,5 @@ -- | -- | -- | -- | -- style | Object | - | 样式 | N custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -animation | String | moving | 加载的状态形式。可选项:skeleton/moving/gradient/dot | N +animation | String | moving | 加载的状态形式。可选项:skeleton/moving/gradient/dots | N text | String | - | 加载过程展示的文字内容 | N diff --git a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/type.ts b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/type.ts index cb2264b93..1bcda16d7 100644 --- a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/type.ts +++ b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-loading/type.ts @@ -11,7 +11,7 @@ export interface TdChatLoadingProps { */ animation?: { type: StringConstructor; - value?: 'skeleton' | 'moving' | 'gradient' | 'dot'; + value?: 'skeleton' | 'moving' | 'gradient' | 'dots'; }; /** * 加载过程展示的文字内容 diff --git a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.en-US.md b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.en-US.md index bbcbeb2e6..3c6ed6504 100644 --- a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.en-US.md +++ b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.en-US.md @@ -8,7 +8,7 @@ name | type | default | description | required -- | -- | -- | -- | -- style | Object | - | CSS(Cascading Style Sheets) | N custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N -animation | String | moving | options: skeleton/moving/gradient/dot | N +animation | String | moving | options: skeleton/moving/gradient/dots | N collapsed | Boolean | false | \- | N content | Object | - | required。Typescript: `{ text?: string; title?: string }` | Y layout | String | block | options: block/border | N @@ -19,4 +19,10 @@ status | String | pending | required。options: complete/stop/error/pending | Y name | params | description -- | -- | -- -collapsed-change | `(value: Boolean)` | \- +collapsed-change | `(value: boolean)` | \- + +### ChatThinking Slots + +name | Description +-- | -- +content | \- diff --git a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.md b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.md index c69f9fd52..234ab2ba4 100644 --- a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.md +++ b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/README.md @@ -8,7 +8,7 @@ -- | -- | -- | -- | -- style | Object | - | 样式 | N custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N -animation | String | moving | 内容区域最大高度,超出会自动滚动。可选项:skeleton/moving/gradient/dot | N +animation | String | moving | 加载动画类型。可选项:skeleton/moving/gradient/dots | N collapsed | Boolean | false | 是否折叠 | N content | Object | - | 必需。思考内容对象。TS 类型:`{ text?: string; title?: string }` | Y layout | String | block | 布局方式。可选项:block/border | N @@ -19,4 +19,10 @@ status | String | pending | 必需。思考状态。可选项:complete/stop/er 名称 | 参数 | 描述 -- | -- | -- -collapsed-change | `(value: Boolean)` | 切换折叠面板时触发 +collapsed-change | `(value: boolean)` | 切换折叠面板时触发 + +### ChatThinking Slots + +名称 | 描述 +-- | -- +content | 自定义 `content` 显示内容 diff --git a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/props.ts b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/props.ts index 1a89c66cf..452e1edbd 100644 --- a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/props.ts +++ b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/props.ts @@ -6,7 +6,7 @@ import { TdChatThinkingProps } from './type'; const props: TdChatThinkingProps = { - /** 内容区域最大高度,超出会自动滚动 */ + /** 加载动画类型 */ animation: { type: String, value: 'moving', diff --git a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/type.ts b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/type.ts index 70c80319b..7fbf8ec12 100644 --- a/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/type.ts +++ b/packages/products/tdesign-miniprogram/packages/pro-components/chat/chat-thinking/type.ts @@ -6,12 +6,12 @@ export interface TdChatThinkingProps { /** - * 内容区域最大高度,超出会自动滚动 + * 加载动画类型 * @default moving */ animation?: { type: StringConstructor; - value?: 'skeleton' | 'moving' | 'gradient' | 'dot'; + value?: 'skeleton' | 'moving' | 'gradient' | 'dots'; }; /** * 是否折叠 diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.en-US.md b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.en-US.md index 44a2abff7..561db405f 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.en-US.md +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.en-US.md @@ -7,4 +7,5 @@ name | type | default | description | required -- | -- | -- | -- | -- custom-style | Object | - | CSS(Cascading Style Sheets) | N -animation | String | moving | options: skeleton/moving/gradient/dot | N +animation | String | moving | options: skeleton/moving/gradient/dots | N +text | String | - | text of chat loading | N diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.md b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.md index dd544c1c5..4ee446105 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.md +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/README.md @@ -7,4 +7,5 @@ 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- custom-style | Object | - | 自定义样式 | N -animation | String | moving | 加载的状态形式。可选项:skeleton/moving/gradient/dot | N +animation | String | moving | 加载的状态形式。可选项:skeleton/moving/gradient/dots | N +text | String | - | 加载过程展示的文字内容 | N diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/props.ts b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/props.ts index 592c8f021..80f156ce0 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/props.ts +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/props.ts @@ -12,7 +12,12 @@ export default { default: 'moving' as TdChatLoadingProps['animation'], validator(val: TdChatLoadingProps['animation']): boolean { if (!val) return true; - return ['skeleton', 'moving', 'gradient', 'dot'].includes(val); + return ['skeleton', 'moving', 'gradient', 'dots'].includes(val); }, }, + /** 加载过程展示的文字内容 */ + text: { + type: String, + default: '', + }, }; diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/type.ts b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/type.ts index 3409ca123..329fb336e 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/type.ts +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-loading/type.ts @@ -9,5 +9,10 @@ export interface TdChatLoadingProps { * 加载的状态形式 * @default moving */ - animation?: 'skeleton' | 'moving' | 'gradient' | 'dot'; + animation?: 'skeleton' | 'moving' | 'gradient' | 'dots'; + /** + * 加载过程展示的文字内容 + * @default '' + */ + text?: string; } diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.en-US.md b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.en-US.md index 6f6a16689..135d64415 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.en-US.md +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.en-US.md @@ -7,7 +7,7 @@ name | type | default | description | required -- | -- | -- | -- | -- custom-style | Object | - | CSS(Cascading Style Sheets) | N -animation | String | moving | options: skeleton/moving/gradient/dot | N +animation | String | moving | options: skeleton/moving/gradient/dots | N collapsed | Boolean | false | \- | N content | Object | - | required。Typescript: `{ text?: string; title?: string }` | Y layout | String | block | options: block/border | N @@ -18,4 +18,10 @@ status | String | pending | required。options: complete/stop/error/pending | Y name | params | description -- | -- | -- -collapsed-change | `(value: Boolean)` | \- +collapsed-change | `(value: boolean)` | \- + +### ChatThinking Slots + +name | Description +-- | -- +content | \- diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.md b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.md index 2e1af0ddc..39c90301e 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.md +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/README.md @@ -7,7 +7,7 @@ 名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- custom-style | Object | - | 自定义样式 | N -animation | String | moving | 内容区域最大高度,超出会自动滚动。可选项:skeleton/moving/gradient/dot | N +animation | String | moving | 加载动画类型。可选项:skeleton/moving/gradient/dots | N collapsed | Boolean | false | 是否折叠 | N content | Object | - | 必需。思考内容对象。TS 类型:`{ text?: string; title?: string }` | Y layout | String | block | 布局方式。可选项:block/border | N @@ -18,4 +18,10 @@ status | String | pending | 必需。思考状态。可选项:complete/stop/er 名称 | 参数 | 描述 -- | -- | -- -collapsed-change | `(value: Boolean)` | 切换折叠面板时触发 +collapsed-change | `(value: boolean)` | 切换折叠面板时触发 + +### ChatThinking Slots + +名称 | 描述 +-- | -- +content | 自定义 `content` 显示内容 diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/props.ts b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/props.ts index e40e185ae..952391a20 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/props.ts +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/props.ts @@ -6,13 +6,13 @@ import type { TdChatThinkingProps } from './type'; export default { - /** 内容区域最大高度,超出会自动滚动 */ + /** 加载动画类型 */ animation: { type: String, default: 'moving' as TdChatThinkingProps['animation'], validator(val: TdChatThinkingProps['animation']): boolean { if (!val) return true; - return ['skeleton', 'moving', 'gradient', 'dot'].includes(val); + return ['skeleton', 'moving', 'gradient', 'dots'].includes(val); }, }, /** 是否折叠 */ diff --git a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/type.ts b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/type.ts index 3c83fefee..f0dbd2d04 100644 --- a/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/type.ts +++ b/packages/products/tdesign-miniprogram/packages/uniapp-pro-components/chat/chat-thinking/type.ts @@ -6,10 +6,10 @@ export interface TdChatThinkingProps { /** - * 内容区域最大高度,超出会自动滚动 + * 加载动画类型 * @default moving */ - animation?: 'skeleton' | 'moving' | 'gradient' | 'dot'; + animation?: 'skeleton' | 'moving' | 'gradient' | 'dots'; /** * 是否折叠 * @default false @@ -36,5 +36,5 @@ export interface TdChatThinkingProps { /** * 切换折叠面板时触发 */ - onCollapsedChange?: (value: Boolean) => void; + onCollapsedChange?: (value: boolean) => void; } diff --git a/packages/products/tdesign-react/packages/components/chat/chat.en-US.md b/packages/products/tdesign-react/packages/components/chat/chat.en-US.md deleted file mode 100644 index 4523f93ce..000000000 --- a/packages/products/tdesign-react/packages/components/chat/chat.en-US.md +++ /dev/null @@ -1,141 +0,0 @@ -:: BASE_DOC :: - -## API - -### Chat Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -actions | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | options: skeleton/moving/gradient | N -avatar | TElement | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -clearHistory | Boolean | true | \- | N -content | TElement | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -data | Array | - | Typescript:`Array` ` interface TdChatItemMeta { avatar?: string; name?:string; role?:string; datetime?: string; content?: string; reasoning?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -datetime | TElement | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -isStreamLoad | Boolean | false | \- | N -layout | String | both | options: both/single | N -name | TElement | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -reasoning | TElement | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -reverse | Boolean | true | \- | N -textLoading | Boolean | false | \- | N -onClear | Function | | Typescript:`(context: { e: MouseEvent }) => void`
Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -onScroll | Function | | Typescript:`(context: { e: MouseEvent }) => void`
Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N - -### ChatInstanceFunctions 组件实例方法 - -name | params | return | description --- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -scrollToBottom | `(params: ScrollToBottomParams)` | \- | [see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts)。
` type ScrollToBottomParams = { behavior: 'auto' \| 'smooth'} `
- - -### ChatLoading Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -animation | String | gradient | options: moving/gradient | N -text | String | - | text of chat loading | N - - -### ChatItem Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -actions | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | options: skeleton/moving/gradient | N -avatar | TNode | - | Typescript:`String \| AvatarProps \| TNode `,[Avatar API Documents](./avatar?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -content | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -datetime | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -name | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -reasoning | String / Boolean / Object | false | Typescript:`boolean \| TdChatReasoning ` ` interface TdChatReasoning { expandIconPlacement?: 'left' \| 'right';onExpandChange?: (isExpand: boolean) => void; collapsePanelProps?: Object } `。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -role | String | - | options: user/assistant/error/model-change/system | N -textLoading | Boolean | false | \- | N -variant | String | text | options: base/outline/text | N - - -### ChatContent Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -content | String | - | \- | N -role | String | - | options: user/assistant/error/model-change/system | N - - -### ChatAction Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -content | String | - | \- | N -disabled | Boolean | false | \- | N -isBad | Boolean | false | \- | N -isGood | Boolean | false | \- | N -operationBtn | Array | ["replay", "copy", "good", "bad"] | Typescript:`Array<'replay'\|'copy'\|'good'\|'bad'>` | N -onOperation | Function | | Typescript:`(value:string, context: { e: MouseEvent }) => void`
| N - - -### ChatInput Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -autofocus | Boolean | false | \- | N -autosize | Boolean / Object | { minRows: 1, maxRows: 5 } | Typescript:`boolean \| { minRows?: number; maxRows?: number }` | N -disabled | Boolean | false | \- | N -placeholder | String | - | \- | N -stopDisabled | Boolean | false | \- | N -suffixIcon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -value | String | - | input value | N -defaultValue | String | - | input value。uncontrolled property | N -onBlur | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onChange | Function | | Typescript:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
| N -onFocus | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onSend | Function | | Typescript:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
| N -onStop | Function | | Typescript:`(value:string, context: { e: MouseEvent }) => void`
| N - - -### ChatSender Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -disabled | Boolean | false | \- | N -placeholder | String | - | \- | N -prefix | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -stopDisabled | Boolean | false | \- | N -suffix | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -textareaProps | Object | - | Typescript:`TextareaProps`,[Textarea API Documents](./textarea?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -value | String | - | input value | N -defaultValue | String | - | input value。uncontrolled property | N -onBlur | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onChange | Function | | Typescript:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
| N -onFocus | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onSend | Function | | Typescript:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
| N -onStop | Function | | Typescript:`(value:string, context: { e: MouseEvent }) => void`
| N - - -### ChatReasoning Props - -name | type | default | description | required --- | -- | -- | -- | -- -className | String | - | className of component | N -style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N -collapsePanelProps | Object | { destroyOnCollapse: false } | Typescript:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -expandIcon | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -expandIconPlacement | String | right | options: left/right | N -header | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -headerRightContent | TElement | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -onExpandChange | Function | | Typescript:`(value: CollapseValue) => void`
Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts)。
`import { CollapseValue } from '@Collapse'`
| N diff --git a/packages/products/tdesign-react/packages/components/chat/chat.md b/packages/products/tdesign-react/packages/components/chat/chat.md deleted file mode 100644 index b2ccd7f75..000000000 --- a/packages/products/tdesign-react/packages/components/chat/chat.md +++ /dev/null @@ -1,141 +0,0 @@ -:: BASE_DOC :: - -## API - -### Chat Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -actions | TElement | - | 自定义操作按钮的插槽。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种。可选项:skeleton/moving/gradient | N -avatar | TElement | - | 自定义每个对话单元的头像插槽。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -clearHistory | Boolean | true | 是否显示清空历史 | N -content | TElement | - | 自定义每个对话单独的聊天内容。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -data | Array | - | 对话列表的数据。TS 类型:`Array` ` interface TdChatItemMeta { avatar?: string; name?:string; role?:string; datetime?: string; content?: string; reasoning?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -datetime | TElement | - | 自定义每个对话单元的时间。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -isStreamLoad | Boolean | false | 流式加载是否结束 | N -layout | String | both | 对话布局形式,支持两侧对齐与左对齐。可选项:both/single | N -name | TElement | - | 自定义每个对话单元的昵称。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -reasoning | TElement | - | 自定义每个对话单元的思考过程的插槽。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -reverse | Boolean | true | 是否表现为倒序 | N -textLoading | Boolean | false | 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false | N -onClear | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
点击清空历史按钮回调。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -onScroll | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
滚动事件的回调。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N - -### ChatInstanceFunctions 组件实例方法 - -名称 | 参数 | 返回值 | 描述 --- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -scrollToBottom | `(params: ScrollToBottomParams)` | \- | 对话列表过长时,支持对话列表重新滚动回底部的方法。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts)。
` type ScrollToBottomParams = { behavior: 'auto' \| 'smooth'} `
- - -### ChatLoading Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -animation | String | gradient | 加载的状态形式。可选项:moving/gradient | N -text | String | - | 加载过程展示的文字内容 | N - - -### ChatItem Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -actions | TNode | - | 自定义的操作内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种。可选项:skeleton/moving/gradient | N -avatar | TNode | - | 自定义的头像配置。TS 类型:`String \| AvatarProps \| TNode `,[Avatar API Documents](./avatar?tab=api)。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -content | TNode | - | 对话单元的内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -datetime | TNode | - | 对话单元的时间配置。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -name | TNode | - | 自定义的昵称。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -reasoning | String / Boolean / Object | false | 值为false不显示思维链,为string则显示内置推理内容交互,为对象则单独配置推理内容。TS 类型:`boolean \| TdChatReasoning ` ` interface TdChatReasoning { expandIconPlacement?: 'left' \| 'right';onExpandChange?: (isExpand: boolean) => void; collapsePanelProps?: Object } `。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -role | String | - | 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息。可选项:user/assistant/error/model-change/system | N -textLoading | Boolean | false | 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false | N -variant | String | text | 气泡框样式,支持基础、线框、文字三种类型。可选项:base/outline/text | N - - -### ChatContent Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -content | String | - | 聊天内容,支持 markdown 格式 | N -role | String | - | 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息。可选项:user/assistant/error/model-change/system | N - - -### ChatAction Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -content | String | - | 被复制的内容 | N -disabled | Boolean | false | 操作按钮是否可点击 | N -isBad | Boolean | false | 是否点踩 | N -isGood | Boolean | false | 是否点赞 | N -operationBtn | Array | ["replay", "copy", "good", "bad"] | 操作按钮配置项,可配置操作按钮选项和顺序。TS 类型:`Array<'replay'\|'copy'\|'good'\|'bad'>` | N -onOperation | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击点赞,点踩,复制,重新生成按钮时触发 | N - - -### ChatInput Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -autofocus | Boolean | false | 输入框是否自动聚焦 | N -autosize | Boolean / Object | { minRows: 1, maxRows: 5 } | 高度自动撑开。 autosize = true 表示组件高度自动撑开,同时,依旧允许手动拖高度。如果设置了 autosize.maxRows 或者 autosize.minRows 则不允许手动调整高度。TS 类型:`boolean \| { minRows?: number; maxRows?: number }` | N -disabled | Boolean | false | 是否禁用输入框 | N -placeholder | String | - | 输入框默认文案 | N -stopDisabled | Boolean | false | 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 | N -suffixIcon | TElement | - | 发送按钮的自定义扩展。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -value | String | - | 输入框的值 | N -defaultValue | String | - | 输入框的值。非受控属性 | N -onBlur | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onChange | Function | | TS 类型:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
输入框值发生变化时触发 | N -onFocus | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onSend | Function | | TS 类型:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
点击消息发送的回调方法 | N -onStop | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击消息终止的回调方法 | N - - -### ChatSender Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -disabled | Boolean | false | 是否禁用输入框 | N -placeholder | String | - | 输入框默认文案 | N -prefix | TNode | - | 输入框左下角区域扩展。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -stopDisabled | Boolean | false | 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 | N -suffix | TNode | - | 输入框右下角区域扩展。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -textareaProps | Object | - | 透传给 Textarea 组件的全部属性。TS 类型:`TextareaProps`,[Textarea API Documents](./textarea?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -value | String | - | 输入框的值 | N -defaultValue | String | - | 输入框的值。非受控属性 | N -onBlur | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onChange | Function | | TS 类型:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
输入框值发生变化时触发 | N -onFocus | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onSend | Function | | TS 类型:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
点击消息发送的回调方法 | N -onStop | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击消息终止的回调方法 | N - - -### ChatReasoning Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -className | String | - | 类名 | N -style | Object | - | 样式,TS 类型:`React.CSSProperties` | N -collapsePanelProps | Object | { destroyOnCollapse: false } | 透传给 CollapsePanel 组件的全部属性。TS 类型:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts) | N -expandIcon | TElement | - | 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -expandIconPlacement | String | right | 展开图标位置,可选项:left/right。可选项:left/right | N -header | TElement | - | 折叠面板头内容。优先级低于collapsePanelProps.header。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -headerRightContent | TElement | - | 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N -onExpandChange | Function | | TS 类型:`(value: CollapseValue) => void`
展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/chat/type.ts)。
`import { CollapseValue } from '@Collapse'`
| N diff --git a/packages/products/tdesign-react/packages/components/chat/defaultProps.ts b/packages/products/tdesign-react/packages/components/chat/defaultProps.ts deleted file mode 100644 index 963b43bb7..000000000 --- a/packages/products/tdesign-react/packages/components/chat/defaultProps.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { - TdChatProps, - TdChatLoadingProps, - TdChatItemProps, - TdChatActionProps, - TdChatInputProps, - TdChatSenderProps, - TdChatReasoningProps, -} from './type'; - -export const chatDefaultProps: TdChatProps = { - animation: 'skeleton', - clearHistory: true, - isStreamLoad: false, - layout: 'both', - reverse: true, - textLoading: false, -}; - -export const chatLoadingDefaultProps: TdChatLoadingProps = { animation: 'gradient' }; - -export const chatItemDefaultProps: TdChatItemProps = { - animation: 'skeleton', - reasoning: false, - textLoading: false, - variant: 'text', -}; - -export const chatActionDefaultProps: TdChatActionProps = { - disabled: false, - isBad: false, - isGood: false, - operationBtn: ['replay', 'copy', 'good', 'bad'], -}; - -export const chatInputDefaultProps: TdChatInputProps = { - autofocus: false, - autosize: '{ minRows: 1, maxRows: 5 }', - disabled: false, - stopDisabled: false, -}; - -export const chatSenderDefaultProps: TdChatSenderProps = { disabled: false, stopDisabled: false }; - -export const chatReasoningDefaultProps: TdChatReasoningProps = { - collapsePanelProps: '{ destroyOnCollapse: false }', - expandIconPlacement: 'right', -}; diff --git a/packages/products/tdesign-react/packages/components/chat/type.ts b/packages/products/tdesign-react/packages/components/chat/type.ts deleted file mode 100644 index 5469185b2..000000000 --- a/packages/products/tdesign-react/packages/components/chat/type.ts +++ /dev/null @@ -1,367 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { AvatarProps } from '../avatar'; -import { TextareaProps } from '../textarea'; -import { CollapsePanelProps } from '../collapse'; -import { CollapseValue } from '../collapse'; -import { TNode, TElement } from '../common'; -import { MouseEvent, KeyboardEvent, FocusEvent, FormEvent } from 'react'; - -export interface TdChatProps { - /** - * 自定义操作按钮的插槽 - */ - actions?: TElement; - /** - * 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种 - * @default skeleton - */ - animation?: 'skeleton' | 'moving' | 'gradient'; - /** - * 自定义每个对话单元的头像插槽 - */ - avatar?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 是否显示清空历史 - * @default true - */ - clearHistory?: boolean; - /** - * 自定义每个对话单独的聊天内容 - */ - content?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 对话列表的数据 - */ - data?: Array; - /** - * 自定义每个对话单元的时间 - */ - datetime?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 流式加载是否结束 - * @default false - */ - isStreamLoad?: boolean; - /** - * 对话布局形式,支持两侧对齐与左对齐 - * @default both - */ - layout?: 'both' | 'single'; - /** - * 自定义每个对话单元的昵称 - */ - name?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 自定义每个对话单元的思考过程的插槽 - */ - reasoning?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 是否表现为倒序 - * @default true - */ - reverse?: boolean; - /** - * 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false - * @default false - */ - textLoading?: boolean; - /** - * 点击清空历史按钮回调 - */ - onClear?: (context: { e: MouseEvent }) => void; - /** - * 滚动事件的回调 - */ - onScroll?: (context: { e: MouseEvent }) => void; -} - -/** 组件实例方法 */ -export interface ChatInstanceFunctions { - /** - * 对话列表过长时,支持对话列表重新滚动回底部的方法 - */ - scrollToBottom?: (params: ScrollToBottomParams) => void; -} - -export interface TdChatLoadingProps { - /** - * 加载的状态形式 - * @default gradient - */ - animation?: 'moving' | 'gradient'; - /** - * 加载过程展示的文字内容 - * @default '' - */ - text?: string; -} - -export interface TdChatItemProps { - /** - * 自定义的操作内容 - */ - actions?: TNode; - /** - * 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种 - * @default skeleton - */ - animation?: 'skeleton' | 'moving' | 'gradient'; - /** - * 自定义的头像配置 - */ - avatar?: String | AvatarProps | TNode; - /** - * 对话单元的内容 - */ - content?: TNode; - /** - * 对话单元的时间配置 - */ - datetime?: TNode; - /** - * 自定义的昵称 - */ - name?: TNode; - /** - * 值为false不显示思维链,为string则显示内置推理内容交互,为对象则单独配置推理内容 - * @default false - */ - reasoning?: boolean | TdChatReasoning; - /** - * 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 - */ - role?: 'user' | 'assistant' | 'error' | 'model-change' | 'system'; - /** - * 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false - * @default false - */ - textLoading?: boolean; - /** - * 气泡框样式,支持基础、线框、文字三种类型 - * @default text - */ - variant?: 'base' | 'outline' | 'text'; -} - -export interface TdChatContentProps { - /** - * 聊天内容,支持 markdown 格式 - * @default '' - */ - content?: string; - /** - * 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 - */ - role?: 'user' | 'assistant' | 'error' | 'model-change' | 'system'; -} - -export interface TdChatActionProps { - /** - * 被复制的内容 - * @default '' - */ - content?: string; - /** - * 操作按钮是否可点击 - * @default false - */ - disabled?: boolean; - /** - * 是否点踩 - * @default false - */ - isBad?: boolean; - /** - * 是否点赞 - * @default false - */ - isGood?: boolean; - /** - * 操作按钮配置项,可配置操作按钮选项和顺序 - * @default ["replay", "copy", "good", "bad"] - */ - operationBtn?: Array<'replay' | 'copy' | 'good' | 'bad'>; - /** - * 点击点赞,点踩,复制,重新生成按钮时触发 - */ - onOperation?: (value: string, context: { e: MouseEvent }) => void; -} - -export interface TdChatInputProps { - /** - * 输入框是否自动聚焦 - * @default false - */ - autofocus?: boolean; - /** - * 高度自动撑开。 autosize = true 表示组件高度自动撑开,同时,依旧允许手动拖高度。如果设置了 autosize.maxRows 或者 autosize.minRows 则不允许手动调整高度 - * @default { minRows: 1, maxRows: 5 } - */ - autosize?: boolean | { minRows?: number; maxRows?: number }; - /** - * 是否禁用输入框 - * @default false - */ - disabled?: boolean; - /** - * 输入框默认文案 - * @default '' - */ - placeholder?: string; - /** - * 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 - * @default false - */ - stopDisabled?: boolean; - /** - * 发送按钮的自定义扩展 - */ - suffixIcon?: TElement; - /** - * 输入框的值 - * @default '' - */ - value?: string; - /** - * 输入框的值,非受控属性 - * @default '' - */ - defaultValue?: string; - /** - * 输入框聚焦时触发 - */ - onBlur?: (value: string, context: { e: FocusEvent }) => void; - /** - * 输入框值发生变化时触发 - */ - onChange?: ( - value: string, - context: { e: FormEvent | MouseEvent | KeyboardEvent }, - ) => void; - /** - * 输入框聚焦时触发 - */ - onFocus?: (value: string, context: { e: FocusEvent }) => void; - /** - * 点击消息发送的回调方法 - */ - onSend?: (value: string, context: { e: MouseEvent | KeyboardEvent }) => void; - /** - * 点击消息终止的回调方法 - */ - onStop?: (value: string, context: { e: MouseEvent }) => void; -} - -export interface TdChatSenderProps { - /** - * 是否禁用输入框 - * @default false - */ - disabled?: boolean; - /** - * 输入框默认文案 - * @default '' - */ - placeholder?: string; - /** - * 输入框左下角区域扩展 - */ - prefix?: TNode; - /** - * 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 - * @default false - */ - stopDisabled?: boolean; - /** - * 输入框右下角区域扩展 - */ - suffix?: TNode; - /** - * 透传给 Textarea 组件的全部属性 - */ - textareaProps?: TextareaProps; - /** - * 输入框的值 - * @default '' - */ - value?: string; - /** - * 输入框的值,非受控属性 - * @default '' - */ - defaultValue?: string; - /** - * 输入框聚焦时触发 - */ - onBlur?: (value: string, context: { e: FocusEvent }) => void; - /** - * 输入框值发生变化时触发 - */ - onChange?: ( - value: string, - context: { e: FormEvent | MouseEvent | KeyboardEvent }, - ) => void; - /** - * 输入框聚焦时触发 - */ - onFocus?: (value: string, context: { e: FocusEvent }) => void; - /** - * 点击消息发送的回调方法 - */ - onSend?: (value: string, context: { e: MouseEvent | KeyboardEvent }) => void; - /** - * 点击消息终止的回调方法 - */ - onStop?: (value: string, context: { e: MouseEvent }) => void; -} - -export interface TdChatReasoningProps { - /** - * 透传给 CollapsePanel 组件的全部属性 - * @default { destroyOnCollapse: false } - */ - collapsePanelProps?: CollapsePanelProps; - /** - * 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon - */ - expandIcon?: TElement; - /** - * 展开图标位置,可选项:left/right - * @default right - */ - expandIconPlacement?: 'left' | 'right'; - /** - * 折叠面板头内容。优先级低于collapsePanelProps.header - */ - header?: TElement; - /** - * 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent - */ - headerRightContent?: TElement; - /** - * 展开图标点击事件 - */ - onExpandChange?: (value: CollapseValue) => void; -} - -export interface TdChatItemMeta { - avatar?: string; - name?: string; - role?: string; - datetime?: string; - content?: string; - reasoning?: string; -} - -export type ScrollToBottomParams = { behavior: 'auto' | 'smooth' }; - -export interface TdChatReasoning { - expandIconPlacement?: 'left' | 'right'; - onExpandChange?: (isExpand: boolean) => void; - collapsePanelProps?: Object; -} diff --git a/packages/products/tdesign-react/packages/pro-components/chat/attachments/attachments.en-US.md b/packages/products/tdesign-react/packages/pro-components/chat/attachments/attachments.en-US.md new file mode 100644 index 000000000..8b895c61a --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/attachments/attachments.en-US.md @@ -0,0 +1,16 @@ +:: BASE_DOC :: + +## API + +### Attachments Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +imageViewer | Boolean | true | \- | N +items | Array | - | Typescript: `TdAttachmentItem` `import { TdAttachmentItem } from 'tdesign-web-components'`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/attachments/type.ts) | N +overflow | String | wrap | options: scrollX/scrollY/wrap | N +removable | Boolean | true | \- | N +onFileClick | Function | | Typescript: `(item: TdAttachmentItem) => void`
| N +onRemove | Function | | Typescript: `(item: TdAttachmentItem, index: number) => void`
| N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/attachments/attachments.md b/packages/products/tdesign-react/packages/pro-components/chat/attachments/attachments.md new file mode 100644 index 000000000..8dd2c03fc --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/attachments/attachments.md @@ -0,0 +1,16 @@ +:: BASE_DOC :: + +## API + +### Attachments Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +imageViewer | Boolean | true | 是否启用图片预览功能 | N +items | Array | - | 附件列表。TS 类型:`TdAttachmentItem` `import { TdAttachmentItem } from 'tdesign-web-components'`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/attachments/type.ts) | N +overflow | String | wrap | 是否显示删除按钮。可选项:scrollX/scrollY/wrap | N +removable | Boolean | true | 是否显示删除按钮 | N +onFileClick | Function | | TS 类型:`(item: TdAttachmentItem) => void`
点击文件时触发 | N +onRemove | Function | | TS 类型:`(item: TdAttachmentItem, index: number) => void`
点击删除按钮时触发 | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/attachments/defaultProps.ts b/packages/products/tdesign-react/packages/pro-components/chat/attachments/defaultProps.ts new file mode 100644 index 000000000..bcf8feb9f --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/attachments/defaultProps.ts @@ -0,0 +1,7 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdAttachmentsProps } from './type'; + +export const attachmentsDefaultProps: TdAttachmentsProps = { imageViewer: true, overflow: 'wrap', removable: true }; diff --git a/packages/products/tdesign-react/packages/pro-components/chat/attachments/type.ts b/packages/products/tdesign-react/packages/pro-components/chat/attachments/type.ts new file mode 100644 index 000000000..9e79df728 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/attachments/type.ts @@ -0,0 +1,39 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdAttachmentItem } from 'tdesign-web-components'; + +export interface TdAttachmentsProps { + /** + * 是否启用图片预览功能 + * @default true + */ + imageViewer?: boolean; + /** + * 附件列表 + */ + items?: TdAttachmentItem; + /** + * 是否显示删除按钮 + * @default wrap + */ + overflow?: 'scrollX' | 'scrollY' | 'wrap'; + /** + * 是否显示删除按钮 + * @default true + */ + removable?: boolean; + /** + * 点击文件时触发 + * @default '' + */ + onFileClick?: (item: TdAttachmentItem) => void; + /** + * 点击删除按钮时触发 + * @default '' + */ + onRemove?: (item: TdAttachmentItem, index: number) => void; +} diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/chat-actionbar.en-US.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/chat-actionbar.en-US.md new file mode 100644 index 000000000..cf039e025 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/chat-actionbar.en-US.md @@ -0,0 +1,14 @@ +:: BASE_DOC :: + +## API + +### ChatActionbar Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +actionBar | Array | ['replay','copy','good','bad','share'] | Typescript: `Array<'replay'\|'copy'\|'good'\|'bad'\|'share'>` | N +comment | String | - | options: good/bad | N +content | String | - | \- | N +onActions | Function | | Typescript: `(value:string, context: { e: MouseEvent }) => void`
| N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/chat-actionbar.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/chat-actionbar.md new file mode 100644 index 000000000..331df49a4 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/chat-actionbar.md @@ -0,0 +1,14 @@ +:: BASE_DOC :: + +## API + +### ChatActionbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +actionBar | Array | ['replay','copy','good','bad','share'] | 操作栏配置。TS 类型:`Array<'replay'\|'copy'\|'good'\|'bad'\|'share'>` | N +comment | String | - | 评价类型, 可选 'good'(点赞) 或者 'bad'(点踩), 默认为空。可选项:good/bad | N +content | String | - | 被复制的内容 | N +onActions | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击点赞,点踩,复制,分享,重新生成按钮时触发发 | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/defaultProps.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/defaultProps.ts new file mode 100644 index 000000000..673e58f18 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/defaultProps.ts @@ -0,0 +1,7 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatActionbarProps } from './type'; + +export const chatActionbarDefaultProps: TdChatActionbarProps = {actionBar: '['replay','copy','good','bad','share']',}; \ No newline at end of file diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/type.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/type.ts new file mode 100644 index 000000000..7b2e99967 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-actionbar/type.ts @@ -0,0 +1,28 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import type { MouseEvent } from 'react'; + +export interface TdChatActionbarProps { + /** + * 操作栏配置 + * @default ['replay','copy','good','bad','share'] + */ + actionBar?: Array<'replay' | 'copy' | 'good' | 'bad' | 'share'>; + /** + * 评价类型, 可选 'good'(点赞) 或者 'bad'(点踩), 默认为空 + */ + comment?: 'good' | 'bad'; + /** + * 被复制的内容 + * @default '' + */ + content?: string; + /** + * 点击点赞,点踩,复制,分享,重新生成按钮时触发发 + */ + onActions?: (value: string, context: { e: MouseEvent }) => void; +} diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-content/chat-content.en-US.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-content/chat-content.en-US.md new file mode 100644 index 000000000..f83c86182 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-content/chat-content.en-US.md @@ -0,0 +1,14 @@ +:: BASE_DOC :: + +## API + +### ChatContent Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +content | String / Object | - | Typescript: `string \| ChatContentData` `interface ChatContentData { type: 'text' \| 'markdown'; data: any; }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +markdownProps | Object | - | Typescript: `{ engine: 'cherry-markdown' \| 'marked', options: ChatMarkdownProps }`,[ChatMarkdown API Documents](./chat-markdown?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +role | String | - | options: user/assistant/error/model-change/system | N +status | String | - | options: error / '' | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-content/chat-content.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-content/chat-content.md new file mode 100644 index 000000000..561644798 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-content/chat-content.md @@ -0,0 +1,14 @@ +:: BASE_DOC :: + +## API + +### ChatContent Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +content | String / Object | - | 聊天内容,支持多种内容类型。可以是字符串或结构化对象。TS 类型:`string \| ChatContentData` `interface ChatContentData { type: 'text' \| 'markdown'; data: any; }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +markdownProps | Object | - | engine可选项:cherry-markdown/marked,options是透传给 ChatMarkdown 组件的全部属性。TS 类型:`{ engine: 'cherry-markdown' \| 'marked', options: ChatMarkdownProps }`,[ChatMarkdown API Documents](./chat-markdown?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +role | String | - | 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息。可选项:user/assistant/error/model-change/system | N +status | String | - | 正文状态。可选项:error / '' | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-content/type.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-content/type.ts new file mode 100644 index 000000000..586d8b19c --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-content/type.ts @@ -0,0 +1,31 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { ChatMarkdownProps } from '../chat-markdown'; + +export interface TdChatContentProps { + /** + * 聊天内容,支持多种内容类型。可以是字符串或结构化对象 + */ + content?: string | ChatContentData; + /** + * engine可选项:cherry-markdown/marked,options是透传给 ChatMarkdown 组件的全部属性 + */ + markdownProps?: { engine: 'cherry-markdown' | 'marked'; options: ChatMarkdownProps }; + /** + * 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 + */ + role?: 'user' | 'assistant' | 'error' | 'model-change' | 'system'; + /** + * 正文状态 + */ + status?: 'error' | ''; +} + +export interface ChatContentData { + type: 'text' | 'markdown'; + data: any; +} diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/chat-loading.en-US.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/chat-loading.en-US.md new file mode 100644 index 000000000..6c0d9f8fe --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/chat-loading.en-US.md @@ -0,0 +1,12 @@ +:: BASE_DOC :: + +## API + +### ChatLoading Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +animation | String | moving | options: skeleton/moving/gradient/dots/circle | N +text | String | - | text of chat loading | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/chat-loading.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/chat-loading.md new file mode 100644 index 000000000..345f4f87a --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/chat-loading.md @@ -0,0 +1,12 @@ +:: BASE_DOC :: + +## API + +### ChatLoading Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +animation | String | moving | 加载的状态形式。可选项:skeleton/moving/gradient/dots/circle | N +text | String | - | 加载过程展示的文字内容 | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/defaultProps.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/defaultProps.ts new file mode 100644 index 000000000..0614504c0 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/defaultProps.ts @@ -0,0 +1,7 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatLoadingProps } from './type'; + +export const chatLoadingDefaultProps: TdChatLoadingProps = { animation: 'moving' }; diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/type.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/type.ts new file mode 100644 index 000000000..2c3bd3ceb --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-loading/type.ts @@ -0,0 +1,18 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdChatLoadingProps { + /** + * 加载的状态形式 + * @default moving + */ + animation?: 'skeleton' | 'moving' | 'gradient' | 'dots' | 'circle'; + /** + * 加载过程展示的文字内容 + * @default '' + */ + text?: string; +} diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/chat-markdown.en-US.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/chat-markdown.en-US.md new file mode 100644 index 000000000..b8d5419a2 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/chat-markdown.en-US.md @@ -0,0 +1,12 @@ +:: BASE_DOC :: + +## API + +### ChatMarkdown Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +content | String | - | \- | N +options | Object | - | Typescript: `TdChatContentMDOptions` ` import type { TdChatContentMDOptions } from 'tdesign-web-components/chat-message/content/markdown-content' `。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chat-markdown/type.ts) | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/chat-markdown.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/chat-markdown.md new file mode 100644 index 000000000..8e92c6d68 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/chat-markdown.md @@ -0,0 +1,12 @@ +:: BASE_DOC :: + +## API + +### ChatMarkdown Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +content | String | - | markdown 内容文本 | N +options | Object | - | Markdown 解析器基础配置。TS 类型:`TdChatContentMDOptions` ` import type { TdChatContentMDOptions } from 'tdesign-web-components/chat-message/content/markdown-content' `。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chat-markdown/type.ts) | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/type.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/type.ts new file mode 100644 index 000000000..df12ea39d --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-markdown/type.ts @@ -0,0 +1,19 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import type { TdChatContentMDOptions } from 'tdesign-web-components/chat-message/content/markdown-content'; + +export interface TdChatMarkdownProps { + /** + * markdown 内容文本 + * @default '' + */ + content?: string; + /** + * Markdown 解析器基础配置 + */ + options?: TdChatContentMDOptions; +} diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/chat-thinking.en-US.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/chat-thinking.en-US.md new file mode 100644 index 000000000..a4274ed0f --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/chat-thinking.en-US.md @@ -0,0 +1,16 @@ +:: BASE_DOC :: + +## API + +### ChatThinking Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +animation | String | circle | options: circle/moving/gradient | N +collapsed | Boolean | false | \- | N +content | Object | - | required。Typescript: `{ text?: string; title?: string }` | Y +layout | String | block | options: block/border | N +maxHeight | Number | - | \- | N +status | String | pending | required。options: complete/stop/error/pending | Y diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/chat-thinking.md b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/chat-thinking.md new file mode 100644 index 000000000..8cdc2d632 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/chat-thinking.md @@ -0,0 +1,16 @@ +:: BASE_DOC :: + +## API + +### ChatThinking Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +animation | String | circle | 加载动画类型。可选项:circle/moving/gradient | N +collapsed | Boolean | false | 是否折叠 | N +content | Object | - | 必需。思考内容对象。TS 类型:`{ text?: string; title?: string }` | Y +layout | String | block | 布局方式。可选项:block/border | N +maxHeight | Number | - | 内容区域最大高度,超出会自动滚动 | N +status | String | pending | 必需。思考状态。可选项:complete/stop/error/pending | Y diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/defaultProps.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/defaultProps.ts new file mode 100644 index 000000000..877716042 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/defaultProps.ts @@ -0,0 +1,12 @@ +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatThinkingProps } from './type'; + +export const chatThinkingDefaultProps: TdChatThinkingProps = { + animation: 'circle', + collapsed: false, + layout: 'block', + status: 'pending', +}; diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/type.ts b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/type.ts new file mode 100644 index 000000000..39d295dd3 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chat-thinking/type.ts @@ -0,0 +1,36 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdChatThinkingProps { + /** + * 加载动画类型 + * @default circle + */ + animation?: 'circle' | 'moving' | 'gradient'; + /** + * 是否折叠 + * @default false + */ + collapsed?: boolean; + /** + * 思考内容对象 + */ + content: { text?: string; title?: string }; + /** + * 布局方式 + * @default block + */ + layout?: 'block' | 'border'; + /** + * 内容区域最大高度,超出会自动滚动 + */ + maxHeight?: number; + /** + * 思考状态 + * @default pending + */ + status: 'complete' | 'stop' | 'error' | 'pending'; +} diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chatbot/chatbot.en-US.md b/packages/products/tdesign-react/packages/pro-components/chat/chatbot/chatbot.en-US.md new file mode 100644 index 000000000..3b10bf196 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chatbot/chatbot.en-US.md @@ -0,0 +1,11 @@ +:: BASE_DOC :: + +## API + +### Chatbot Props + +name | type | default | description | required +-- | -- | -- | -- | -- +className | String | - | className of component | N +style | Object | - | CSS(Cascading Style Sheets),Typescript: `React.CSSProperties` | N +defaultMessages | Array | - | Typescript: `Array` `import type { ChatMessagesData } from 'tdesign-web-components/lib/chat-engine/type'`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chatbot/type.ts) | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chatbot/chatbot.md b/packages/products/tdesign-react/packages/pro-components/chat/chatbot/chatbot.md new file mode 100644 index 000000000..8fbc1f1a0 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chatbot/chatbot.md @@ -0,0 +1,11 @@ +:: BASE_DOC :: + +## API + +### Chatbot Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +className | String | - | 类名 | N +style | Object | - | 样式,TS 类型:`React.CSSProperties` | N +defaultMessages | Array | - | 初始消息数据列表。TS 类型:`Array` `import type { ChatMessagesData } from 'tdesign-web-components/lib/chat-engine/type'`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/pro-components/chat/chatbot/type.ts) | N diff --git a/packages/products/tdesign-react/packages/pro-components/chat/chatbot/type.ts b/packages/products/tdesign-react/packages/pro-components/chat/chatbot/type.ts new file mode 100644 index 000000000..2c1cdbfb3 --- /dev/null +++ b/packages/products/tdesign-react/packages/pro-components/chat/chatbot/type.ts @@ -0,0 +1,14 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import type { ChatMessagesData } from 'tdesign-web-components/lib/chat-engine/type'; + +export interface TdChatbotProps { + /** + * 初始消息数据列表 + */ + defaultMessages?: Array; +} diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat-action-props.ts b/packages/products/tdesign-vue-next/packages/components/chat/chat-action-props.ts deleted file mode 100644 index 38f9f4ac7..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat-action-props.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { TdChatActionProps } from '../chat/type'; -import { PropType } from 'vue'; - -export default { - /** 被复制的内容 */ - content: { - type: String, - default: '', - }, - /** 操作按钮是否可点击 */ - disabled: Boolean, - /** 是否点踩 */ - isBad: Boolean, - /** 是否点赞 */ - isGood: Boolean, - /** 操作按钮配置项,可配置操作按钮选项和顺序 */ - operationBtn: { - type: Array as PropType, - default: (): TdChatActionProps['operationBtn'] => ["replay", "copy", "good", "bad"], - }, - /** 点击点赞,点踩,复制,重新生成按钮时触发 */ - onOperation: Function as PropType, -}; diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat-content-props.ts b/packages/products/tdesign-vue-next/packages/components/chat/chat-content-props.ts deleted file mode 100644 index 53282e6b2..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat-content-props.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { TdChatContentProps } from '../chat/type'; -import { PropType } from 'vue'; - -export default { - /** 聊天内容,支持 markdown 格式 */ - content: { - type: String, - default: '', - }, - /** 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 */ - role: { - type: String as PropType, - validator(val: TdChatContentProps['role']): boolean { - if (!val) return true; - return ['user', 'assistant', 'error', 'model-change', 'system'].includes(val); - }, - }, -}; diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat-input-props.ts b/packages/products/tdesign-vue-next/packages/components/chat/chat-input-props.ts deleted file mode 100644 index b6a20b96b..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat-input-props.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { TdChatInputProps } from '../chat/type'; -import { PropType } from 'vue'; - -export default { - /** 输入框是否自动聚焦 */ - autofocus: Boolean, - /** 高度自动撑开。 autosize = true 表示组件高度自动撑开,同时,依旧允许手动拖高度。如果设置了 autosize.maxRows 或者 autosize.minRows 则不允许手动调整高度 */ - autosize: { - type: [Boolean, Object] as PropType, - default: { minRows: 1, maxRows: 5 } as TdChatInputProps['autosize'], - }, - /** 是否禁用输入框 */ - disabled: Boolean, - /** 输入框默认文案 */ - placeholder: { - type: String, - default: '', - }, - /** 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 */ - stopDisabled: Boolean, - /** 发送按钮的自定义扩展 */ - suffixIcon: { - type: Function as PropType, - }, - /** 输入框的值 */ - value: { - type: String, - default: undefined, - }, - modelValue: { - type: String, - default: undefined, - }, - /** 输入框的值,非受控属性 */ - defaultValue: { - type: String, - default: '', - }, - /** 输入框聚焦时触发 */ - onBlur: Function as PropType, - /** 输入框值发生变化时触发 */ - onChange: Function as PropType, - /** 输入框聚焦时触发 */ - onFocus: Function as PropType, - /** 点击消息发送的回调方法 */ - onSend: Function as PropType, - /** 点击消息终止的回调方法 */ - onStop: Function as PropType, -}; diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat-item-props.ts b/packages/products/tdesign-vue-next/packages/components/chat/chat-item-props.ts deleted file mode 100644 index 6ccf25336..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat-item-props.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { TdChatItemProps } from '../chat/type'; -import { PropType } from 'vue'; - -export default { - /** 自定义的操作内容 */ - actions: { - type: [String, Function] as PropType, - }, - /** 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种 */ - animation: { - type: String as PropType, - default: 'skeleton' as TdChatItemProps['animation'], - validator(val: TdChatItemProps['animation']): boolean { - if (!val) return true; - return ['skeleton', 'moving', 'gradient'].includes(val); - }, - }, - /** 自定义的头像配置 */ - avatar: { - type: [String, Object, Function] as PropType, - }, - /** 对话单元的内容 */ - content: { - type: [String, Function] as PropType, - }, - /** 对话单元的时间配置 */ - datetime: { - type: [String, Function] as PropType, - }, - /** 自定义的昵称 */ - name: { - type: [String, Function] as PropType, - }, - /** 值为false不显示思维链,为string则显示内置推理内容交互,为对象则单独配置推理内容 */ - reasoning: { - type: [String, Boolean, Object] as PropType, - default: false as TdChatItemProps['reasoning'], - }, - /** 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 */ - role: { - type: String as PropType, - validator(val: TdChatItemProps['role']): boolean { - if (!val) return true; - return ['user', 'assistant', 'error', 'model-change', 'system'].includes(val); - }, - }, - /** 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false */ - textLoading: Boolean, - /** 气泡框样式,支持基础、线框、文字三种类型 */ - variant: { - type: String as PropType, - default: 'text' as TdChatItemProps['variant'], - validator(val: TdChatItemProps['variant']): boolean { - if (!val) return true; - return ['base', 'outline', 'text'].includes(val); - }, - }, -}; diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat-reasoning-props.ts b/packages/products/tdesign-vue-next/packages/components/chat/chat-reasoning-props.ts deleted file mode 100644 index b4951a86f..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat-reasoning-props.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { TdChatReasoningProps } from '../chat/type'; -import { PropType } from 'vue'; - -export default { - /** 透传给 CollapsePanel 组件的全部属性 */ - collapsePanelProps: { - type: Object as PropType, - default: { destroyOnCollapse: false }, - }, - /** 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon */ - expandIcon: { - type: Function as PropType, - }, - /** 展开图标位置,可选项:left/right */ - expandIconPlacement: { - type: String as PropType, - default: 'right' as TdChatReasoningProps['expandIconPlacement'], - validator(val: TdChatReasoningProps['expandIconPlacement']): boolean { - if (!val) return true; - return ['left', 'right'].includes(val); - }, - }, - /** 折叠面板头内容。优先级低于collapsePanelProps.header */ - header: { - type: Function as PropType, - }, - /** 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent */ - headerRightContent: { - type: Function as PropType, - }, - /** 展开图标点击事件 */ - onExpandChange: Function as PropType, -}; diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat-sender-props.ts b/packages/products/tdesign-vue-next/packages/components/chat/chat-sender-props.ts deleted file mode 100644 index d579f8fb8..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat-sender-props.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { TdChatSenderProps } from '../chat/type'; -import { PropType } from 'vue'; - -export default { - /** 是否禁用输入框 */ - disabled: Boolean, - /** 输入框默认文案 */ - placeholder: { - type: String, - default: '', - }, - /** 输入框左下角区域扩展 */ - prefix: { - type: [String, Function] as PropType, - }, - /** 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 */ - stopDisabled: Boolean, - /** 输入框右下角区域扩展 */ - suffix: { - type: [String, Function] as PropType, - }, - /** 透传给 Textarea 组件的全部属性 */ - textareaProps: { - type: Object as PropType, - }, - /** 输入框的值 */ - value: { - type: String, - default: undefined, - }, - modelValue: { - type: String, - default: undefined, - }, - /** 输入框的值,非受控属性 */ - defaultValue: { - type: String, - default: '', - }, - /** 输入框聚焦时触发 */ - onBlur: Function as PropType, - /** 输入框值发生变化时触发 */ - onChange: Function as PropType, - /** 输入框聚焦时触发 */ - onFocus: Function as PropType, - /** 点击消息发送的回调方法 */ - onSend: Function as PropType, - /** 点击消息终止的回调方法 */ - onStop: Function as PropType, -}; diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat.en-US.md b/packages/products/tdesign-vue-next/packages/components/chat/chat.en-US.md deleted file mode 100644 index de35baa0a..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat.en-US.md +++ /dev/null @@ -1,162 +0,0 @@ -:: BASE_DOC :: - -## API - -### Chat Props - -name | type | default | description | required --- | -- | -- | -- | -- -actions | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | options: skeleton/moving/gradient | N -avatar | Slot / Function | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -clearHistory | Boolean | true | \- | N -content | Slot / Function | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -data | Array | - | Typescript:`Array` ` interface TdChatItemMeta { avatar?: string; name?:string; role?:string; datetime?: string; content?: string; reasoning?: string }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -datetime | Slot / Function | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -isStreamLoad | Boolean | false | \- | N -layout | String | both | options: both/single | N -name | Slot / Function | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -reasoning | Slot / Function | - | Typescript:`TNode<{ item: TdChatItemProps, index: number }>`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -reverse | Boolean | true | \- | N -textLoading | Boolean | false | \- | N -onClear | Function | | Typescript:`(context: { e: MouseEvent }) => void`
Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -onScroll | Function | | Typescript:`(context: { e: MouseEvent }) => void`
Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N - -### Chat Events - -name | params | description --- | -- | -- -clear | `(context: { e: MouseEvent })` | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) -scroll | `(context: { e: MouseEvent })` | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) - -### ChatInstanceFunctions 组件实例方法 - -name | params | return | description --- | -- | -- | -- -scrollToBottom | `(params: ScrollToBottomParams)` | \- | [see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。
` type ScrollToBottomParams = { behavior: 'auto' \| 'smooth'} `
- - -### ChatLoading Props - -name | type | default | description | required --- | -- | -- | -- | -- -animation | String | gradient | options: moving/gradient | N -text | String | - | text of chat loading | N - - -### ChatItem Props - -name | type | default | description | required --- | -- | -- | -- | -- -actions | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | options: skeleton/moving/gradient | N -avatar | String / Object / Slot / Function | - | Typescript:`String \| AvatarProps \| TNode `,[Avatar API Documents](./avatar?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -content | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -datetime | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -name | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -reasoning | String / Boolean / Object | false | Typescript:`boolean \| TdChatReasoning ` ` interface TdChatReasoning { expandIconPlacement?: 'left' \| 'right';onExpandChange?: (isExpand: boolean) => void; collapsePanelProps?: Object } `。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -role | String | - | options: user/assistant/error/model-change/system | N -textLoading | Boolean | false | \- | N -variant | String | text | options: base/outline/text | N - - -### ChatContent Props - -name | type | default | description | required --- | -- | -- | -- | -- -content | String | - | \- | N -role | String | - | options: user/assistant/error/model-change/system | N - - -### ChatAction Props - -name | type | default | description | required --- | -- | -- | -- | -- -content | String | - | \- | N -disabled | Boolean | false | \- | N -isBad | Boolean | false | \- | N -isGood | Boolean | false | \- | N -operationBtn | Array | ["replay", "copy", "good", "bad"] | Typescript:`Array<'replay'\|'copy'\|'good'\|'bad'>` | N -onOperation | Function | | Typescript:`(value:string, context: { e: MouseEvent }) => void`
| N - -### ChatAction Events - -name | params | description --- | -- | -- -operation | `(value:string, context: { e: MouseEvent })` | \- - - -### ChatInput Props - -name | type | default | description | required --- | -- | -- | -- | -- -autofocus | Boolean | false | \- | N -autosize | Boolean / Object | { minRows: 1, maxRows: 5 } | Typescript:`boolean \| { minRows?: number; maxRows?: number }` | N -disabled | Boolean | false | \- | N -placeholder | String | - | \- | N -stopDisabled | Boolean | false | \- | N -suffixIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -value | String | - | input value。`v-model` and `v-model:value` is supported | N -defaultValue | String | - | input value。uncontrolled property | N -onBlur | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onChange | Function | | Typescript:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
| N -onFocus | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onSend | Function | | Typescript:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
| N -onStop | Function | | Typescript:`(value:string, context: { e: MouseEvent }) => void`
| N - -### ChatInput Events - -name | params | description --- | -- | -- -blur | `(value:string, context: { e: FocusEvent })` | \- -change | `(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | \- -focus | `(value:string, context: { e: FocusEvent }) ` | \- -send | `(value:string, context: { e: MouseEvent \| KeyboardEvent })` | \- -stop | `(value:string, context: { e: MouseEvent })` | \- - - -### ChatSender Props - -name | type | default | description | required --- | -- | -- | -- | -- -disabled | Boolean | false | \- | N -placeholder | String | - | \- | N -prefix | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -stopDisabled | Boolean | false | \- | N -suffix | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -textareaProps | Object | - | Typescript:`TextareaProps`,[Textarea API Documents](./textarea?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -value | String | - | input value。`v-model` and `v-model:value` is supported | N -defaultValue | String | - | input value。uncontrolled property | N -onBlur | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onChange | Function | | Typescript:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
| N -onFocus | Function | | Typescript:`(value:string, context: { e: FocusEvent }) => void`
| N -onSend | Function | | Typescript:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
| N -onStop | Function | | Typescript:`(value:string, context: { e: MouseEvent }) => void`
| N - -### ChatSender Events - -name | params | description --- | -- | -- -blur | `(value:string, context: { e: FocusEvent })` | \- -change | `(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | \- -focus | `(value:string, context: { e: FocusEvent }) ` | \- -send | `(value:string, context: { e: MouseEvent \| KeyboardEvent })` | \- -stop | `(value:string, context: { e: MouseEvent })` | \- - - -### ChatReasoning Props - -name | type | default | description | required --- | -- | -- | -- | -- -collapsePanelProps | Object | { destroyOnCollapse: false } | Typescript:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -expandIcon | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -expandIconPlacement | String | right | options: left/right | N -header | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -headerRightContent | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -onExpandChange | Function | | Typescript:`(value: CollapseValue) => void`
Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。
`import { CollapseValue } from '@Collapse'`
| N - -### ChatReasoning Events - -name | params | description --- | -- | -- -expand-change | `(value: CollapseValue)` | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。
`import { CollapseValue } from '@Collapse'`
diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat.md b/packages/products/tdesign-vue-next/packages/components/chat/chat.md deleted file mode 100644 index 73e74adcd..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat.md +++ /dev/null @@ -1,162 +0,0 @@ -:: BASE_DOC :: - -## API - -### Chat Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -actions | Slot / Function | - | 自定义操作按钮的插槽。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种。可选项:skeleton/moving/gradient | N -avatar | Slot / Function | - | 自定义每个对话单元的头像插槽。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -clearHistory | Boolean | true | 是否显示清空历史 | N -content | Slot / Function | - | 自定义每个对话单独的聊天内容。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -data | Array | - | 对话列表的数据。TS 类型:`Array` ` interface TdChatItemMeta { avatar?: string; name?:string; role?:string; datetime?: string; content?: string; reasoning?: string }`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -datetime | Slot / Function | - | 自定义每个对话单元的时间。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -isStreamLoad | Boolean | false | 流式加载是否结束 | N -layout | String | both | 对话布局形式,支持两侧对齐与左对齐。可选项:both/single | N -name | Slot / Function | - | 自定义每个对话单元的昵称。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -reasoning | Slot / Function | - | 自定义每个对话单元的思考过程的插槽。TS 类型:`TNode<{ item: TdChatItemProps, index: number }>`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -reverse | Boolean | true | 是否表现为倒序 | N -textLoading | Boolean | false | 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false | N -onClear | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
点击清空历史按钮回调。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -onScroll | Function | | TS 类型:`(context: { e: MouseEvent }) => void`
滚动事件的回调。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N - -### Chat Events - -名称 | 参数 | 描述 --- | -- | -- -clear | `(context: { e: MouseEvent })` | 点击清空历史按钮回调。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) -scroll | `(context: { e: MouseEvent })` | 滚动事件的回调。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) - -### ChatInstanceFunctions 组件实例方法 - -名称 | 参数 | 返回值 | 描述 --- | -- | -- | -- -scrollToBottom | `(params: ScrollToBottomParams)` | \- | 对话列表过长时,支持对话列表重新滚动回底部的方法。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。
` type ScrollToBottomParams = { behavior: 'auto' \| 'smooth'} `
- - -### ChatLoading Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -animation | String | gradient | 加载的状态形式。可选项:moving/gradient | N -text | String | - | 加载过程展示的文字内容 | N - - -### ChatItem Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -actions | String / Slot / Function | - | 自定义的操作内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -animation | String | skeleton | 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种。可选项:skeleton/moving/gradient | N -avatar | String / Object / Slot / Function | - | 自定义的头像配置。TS 类型:`String \| AvatarProps \| TNode `,[Avatar API Documents](./avatar?tab=api)。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -content | String / Slot / Function | - | 对话单元的内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -datetime | String / Slot / Function | - | 对话单元的时间配置。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -name | String / Slot / Function | - | 自定义的昵称。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -reasoning | String / Boolean / Object | false | 值为false不显示思维链,为string则显示内置推理内容交互,为对象则单独配置推理内容。TS 类型:`boolean \| TdChatReasoning ` ` interface TdChatReasoning { expandIconPlacement?: 'left' \| 'right';onExpandChange?: (isExpand: boolean) => void; collapsePanelProps?: Object } `。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -role | String | - | 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息。可选项:user/assistant/error/model-change/system | N -textLoading | Boolean | false | 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false | N -variant | String | text | 气泡框样式,支持基础、线框、文字三种类型。可选项:base/outline/text | N - - -### ChatContent Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -content | String | - | 聊天内容,支持 markdown 格式 | N -role | String | - | 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息。可选项:user/assistant/error/model-change/system | N - - -### ChatAction Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -content | String | - | 被复制的内容 | N -disabled | Boolean | false | 操作按钮是否可点击 | N -isBad | Boolean | false | 是否点踩 | N -isGood | Boolean | false | 是否点赞 | N -operationBtn | Array | ["replay", "copy", "good", "bad"] | 操作按钮配置项,可配置操作按钮选项和顺序。TS 类型:`Array<'replay'\|'copy'\|'good'\|'bad'>` | N -onOperation | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击点赞,点踩,复制,重新生成按钮时触发 | N - -### ChatAction Events - -名称 | 参数 | 描述 --- | -- | -- -operation | `(value:string, context: { e: MouseEvent })` | 点击点赞,点踩,复制,重新生成按钮时触发 - - -### ChatInput Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -autofocus | Boolean | false | 输入框是否自动聚焦 | N -autosize | Boolean / Object | { minRows: 1, maxRows: 5 } | 高度自动撑开。 autosize = true 表示组件高度自动撑开,同时,依旧允许手动拖高度。如果设置了 autosize.maxRows 或者 autosize.minRows 则不允许手动调整高度。TS 类型:`boolean \| { minRows?: number; maxRows?: number }` | N -disabled | Boolean | false | 是否禁用输入框 | N -placeholder | String | - | 输入框默认文案 | N -stopDisabled | Boolean | false | 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 | N -suffixIcon | Slot / Function | - | 发送按钮的自定义扩展。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -value | String | - | 输入框的值。支持语法糖 `v-model` 或 `v-model:value` | N -defaultValue | String | - | 输入框的值。非受控属性 | N -onBlur | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onChange | Function | | TS 类型:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
输入框值发生变化时触发 | N -onFocus | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onSend | Function | | TS 类型:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
点击消息发送的回调方法 | N -onStop | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击消息终止的回调方法 | N - -### ChatInput Events - -名称 | 参数 | 描述 --- | -- | -- -blur | `(value:string, context: { e: FocusEvent })` | 输入框聚焦时触发 -change | `(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | 输入框值发生变化时触发 -focus | `(value:string, context: { e: FocusEvent }) ` | 输入框聚焦时触发 -send | `(value:string, context: { e: MouseEvent \| KeyboardEvent })` | 点击消息发送的回调方法 -stop | `(value:string, context: { e: MouseEvent })` | 点击消息终止的回调方法 - - -### ChatSender Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -disabled | Boolean | false | 是否禁用输入框 | N -placeholder | String | - | 输入框默认文案 | N -prefix | String / Slot / Function | - | 输入框左下角区域扩展。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -stopDisabled | Boolean | false | 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 | N -suffix | String / Slot / Function | - | 输入框右下角区域扩展。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -textareaProps | Object | - | 透传给 Textarea 组件的全部属性。TS 类型:`TextareaProps`,[Textarea API Documents](./textarea?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -value | String | - | 输入框的值。支持语法糖 `v-model` 或 `v-model:value` | N -defaultValue | String | - | 输入框的值。非受控属性 | N -onBlur | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onChange | Function | | TS 类型:`(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent }) => void`
输入框值发生变化时触发 | N -onFocus | Function | | TS 类型:`(value:string, context: { e: FocusEvent }) => void`
输入框聚焦时触发 | N -onSend | Function | | TS 类型:`(value:string, context: { e: MouseEvent \| KeyboardEvent }) => void`
点击消息发送的回调方法 | N -onStop | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击消息终止的回调方法 | N - -### ChatSender Events - -名称 | 参数 | 描述 --- | -- | -- -blur | `(value:string, context: { e: FocusEvent })` | 输入框聚焦时触发 -change | `(value:string, context: { e: InputEvent \| MouseEvent \| KeyboardEvent })` | 输入框值发生变化时触发 -focus | `(value:string, context: { e: FocusEvent }) ` | 输入框聚焦时触发 -send | `(value:string, context: { e: MouseEvent \| KeyboardEvent })` | 点击消息发送的回调方法 -stop | `(value:string, context: { e: MouseEvent })` | 点击消息终止的回调方法 - - -### ChatReasoning Props - -名称 | 类型 | 默认值 | 描述 | 必传 --- | -- | -- | -- | -- -collapsePanelProps | Object | { destroyOnCollapse: false } | 透传给 CollapsePanel 组件的全部属性。TS 类型:`CollapsePanelProps`,[Collapse API Documents](./collapse?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts) | N -expandIcon | Slot / Function | - | 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -expandIconPlacement | String | right | 展开图标位置,可选项:left/right。可选项:left/right | N -header | Slot / Function | - | 折叠面板头内容。优先级低于collapsePanelProps.header。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -headerRightContent | Slot / Function | - | 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N -onExpandChange | Function | | TS 类型:`(value: CollapseValue) => void`
展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。
`import { CollapseValue } from '@Collapse'`
| N - -### ChatReasoning Events - -名称 | 参数 | 描述 --- | -- | -- -expand-change | `(value: CollapseValue)` | 展开图标点击事件。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/chat/type.ts)。
`import { CollapseValue } from '@Collapse'`
diff --git a/packages/products/tdesign-vue-next/packages/components/chat/props.ts b/packages/products/tdesign-vue-next/packages/components/chat/props.ts deleted file mode 100644 index b269207a5..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/props.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { TdChatProps } from './type'; -import { PropType } from 'vue'; - -export default { - /** 自定义操作按钮的插槽 */ - actions: { - type: Function as PropType, - }, - /** 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种 */ - animation: { - type: String as PropType, - default: 'skeleton' as TdChatProps['animation'], - validator(val: TdChatProps['animation']): boolean { - if (!val) return true; - return ['skeleton', 'moving', 'gradient'].includes(val); - }, - }, - /** 自定义每个对话单元的头像插槽 */ - avatar: { - type: Function as PropType, - }, - /** 是否显示清空历史 */ - clearHistory: { - type: Boolean, - default: true, - }, - /** 自定义每个对话单独的聊天内容 */ - content: { - type: Function as PropType, - }, - /** 对话列表的数据 */ - data: { - type: Array as PropType, - }, - /** 自定义每个对话单元的时间 */ - datetime: { - type: Function as PropType, - }, - /** 流式加载是否结束 */ - isStreamLoad: Boolean, - /** 对话布局形式,支持两侧对齐与左对齐 */ - layout: { - type: String as PropType, - default: 'both' as TdChatProps['layout'], - validator(val: TdChatProps['layout']): boolean { - if (!val) return true; - return ['both', 'single'].includes(val); - }, - }, - /** 自定义每个对话单元的昵称 */ - name: { - type: Function as PropType, - }, - /** 自定义每个对话单元的思考过程的插槽 */ - reasoning: { - type: Function as PropType, - }, - /** 是否表现为倒序 */ - reverse: { - type: Boolean, - default: true, - }, - /** 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false */ - textLoading: Boolean, - /** 点击清空历史按钮回调 */ - onClear: Function as PropType, - /** 滚动事件的回调 */ - onScroll: Function as PropType, -}; diff --git a/packages/products/tdesign-vue-next/packages/components/chat/type.ts b/packages/products/tdesign-vue-next/packages/components/chat/type.ts deleted file mode 100644 index 9b95775c3..000000000 --- a/packages/products/tdesign-vue-next/packages/components/chat/type.ts +++ /dev/null @@ -1,370 +0,0 @@ -/* eslint-disable */ - -/** - * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC - * */ - -import { AvatarProps } from '../avatar'; -import { TextareaProps } from '../textarea'; -import { CollapsePanelProps } from '../collapse'; -import { CollapseValue } from '../collapse'; -import { TNode } from '../common'; - -export interface TdChatProps { - /** - * 自定义操作按钮的插槽 - */ - actions?: TNode; - /** - * 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种 - * @default skeleton - */ - animation?: 'skeleton' | 'moving' | 'gradient'; - /** - * 自定义每个对话单元的头像插槽 - */ - avatar?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 是否显示清空历史 - * @default true - */ - clearHistory?: boolean; - /** - * 自定义每个对话单独的聊天内容 - */ - content?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 对话列表的数据 - */ - data?: Array; - /** - * 自定义每个对话单元的时间 - */ - datetime?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 流式加载是否结束 - * @default false - */ - isStreamLoad?: boolean; - /** - * 对话布局形式,支持两侧对齐与左对齐 - * @default both - */ - layout?: 'both' | 'single'; - /** - * 自定义每个对话单元的昵称 - */ - name?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 自定义每个对话单元的思考过程的插槽 - */ - reasoning?: TNode<{ item: TdChatItemProps; index: number }>; - /** - * 是否表现为倒序 - * @default true - */ - reverse?: boolean; - /** - * 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false - * @default false - */ - textLoading?: boolean; - /** - * 点击清空历史按钮回调 - */ - onClear?: (context: { e: MouseEvent }) => void; - /** - * 滚动事件的回调 - */ - onScroll?: (context: { e: MouseEvent }) => void; -} - -/** 组件实例方法 */ -export interface ChatInstanceFunctions { - /** - * 对话列表过长时,支持对话列表重新滚动回底部的方法 - */ - scrollToBottom?: (params: ScrollToBottomParams) => void; -} - -export interface TdChatLoadingProps { - /** - * 加载的状态形式 - * @default gradient - */ - animation?: 'moving' | 'gradient'; - /** - * 加载过程展示的文字内容 - * @default '' - */ - text?: string; -} - -export interface TdChatItemProps { - /** - * 自定义的操作内容 - */ - actions?: string | TNode; - /** - * 动画效果,支持「渐变加载动画」,「闪烁加载动画」, 「骨架屏」三种 - * @default skeleton - */ - animation?: 'skeleton' | 'moving' | 'gradient'; - /** - * 自定义的头像配置 - */ - avatar?: String | AvatarProps | TNode; - /** - * 对话单元的内容 - */ - content?: string | TNode; - /** - * 对话单元的时间配置 - */ - datetime?: string | TNode; - /** - * 自定义的昵称 - */ - name?: string | TNode; - /** - * 值为false不显示思维链,为string则显示内置推理内容交互,为对象则单独配置推理内容 - * @default false - */ - reasoning?: boolean | TdChatReasoning; - /** - * 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 - */ - role?: 'user' | 'assistant' | 'error' | 'model-change' | 'system'; - /** - * 新消息是否处于加载状态,加载状态默认显示骨架屏,接口请求返回数据时请将新消息加载状态置为false - * @default false - */ - textLoading?: boolean; - /** - * 气泡框样式,支持基础、线框、文字三种类型 - * @default text - */ - variant?: 'base' | 'outline' | 'text'; -} - -export interface TdChatContentProps { - /** - * 聊天内容,支持 markdown 格式 - * @default '' - */ - content?: string; - /** - * 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 - */ - role?: 'user' | 'assistant' | 'error' | 'model-change' | 'system'; -} - -export interface TdChatActionProps { - /** - * 被复制的内容 - * @default '' - */ - content?: string; - /** - * 操作按钮是否可点击 - * @default false - */ - disabled?: boolean; - /** - * 是否点踩 - * @default false - */ - isBad?: boolean; - /** - * 是否点赞 - * @default false - */ - isGood?: boolean; - /** - * 操作按钮配置项,可配置操作按钮选项和顺序 - * @default ["replay", "copy", "good", "bad"] - */ - operationBtn?: Array<'replay' | 'copy' | 'good' | 'bad'>; - /** - * 点击点赞,点踩,复制,重新生成按钮时触发 - */ - onOperation?: (value: string, context: { e: MouseEvent }) => void; -} - -export interface TdChatInputProps { - /** - * 输入框是否自动聚焦 - * @default false - */ - autofocus?: boolean; - /** - * 高度自动撑开。 autosize = true 表示组件高度自动撑开,同时,依旧允许手动拖高度。如果设置了 autosize.maxRows 或者 autosize.minRows 则不允许手动调整高度 - * @default { minRows: 1, maxRows: 5 } - */ - autosize?: boolean | { minRows?: number; maxRows?: number }; - /** - * 是否禁用输入框 - * @default false - */ - disabled?: boolean; - /** - * 输入框默认文案 - * @default '' - */ - placeholder?: string; - /** - * 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 - * @default false - */ - stopDisabled?: boolean; - /** - * 发送按钮的自定义扩展 - */ - suffixIcon?: TNode; - /** - * 输入框的值 - * @default '' - */ - value?: string; - /** - * 输入框的值,非受控属性 - * @default '' - */ - defaultValue?: string; - /** - * 输入框的值 - * @default '' - */ - modelValue?: string; - /** - * 输入框聚焦时触发 - */ - onBlur?: (value: string, context: { e: FocusEvent }) => void; - /** - * 输入框值发生变化时触发 - */ - onChange?: (value: string, context: { e: InputEvent | MouseEvent | KeyboardEvent }) => void; - /** - * 输入框聚焦时触发 - */ - onFocus?: (value: string, context: { e: FocusEvent }) => void; - /** - * 点击消息发送的回调方法 - */ - onSend?: (value: string, context: { e: MouseEvent | KeyboardEvent }) => void; - /** - * 点击消息终止的回调方法 - */ - onStop?: (value: string, context: { e: MouseEvent }) => void; -} - -export interface TdChatSenderProps { - /** - * 是否禁用输入框 - * @default false - */ - disabled?: boolean; - /** - * 输入框默认文案 - * @default '' - */ - placeholder?: string; - /** - * 输入框左下角区域扩展 - */ - prefix?: string | TNode; - /** - * 中止按钮是否可点击。等流式数据全部返回结束置为false,注意跟textLoading的控制时机不是同一个 - * @default false - */ - stopDisabled?: boolean; - /** - * 输入框右下角区域扩展 - */ - suffix?: string | TNode; - /** - * 透传给 Textarea 组件的全部属性 - */ - textareaProps?: TextareaProps; - /** - * 输入框的值 - * @default '' - */ - value?: string; - /** - * 输入框的值,非受控属性 - * @default '' - */ - defaultValue?: string; - /** - * 输入框的值 - * @default '' - */ - modelValue?: string; - /** - * 输入框聚焦时触发 - */ - onBlur?: (value: string, context: { e: FocusEvent }) => void; - /** - * 输入框值发生变化时触发 - */ - onChange?: (value: string, context: { e: InputEvent | MouseEvent | KeyboardEvent }) => void; - /** - * 输入框聚焦时触发 - */ - onFocus?: (value: string, context: { e: FocusEvent }) => void; - /** - * 点击消息发送的回调方法 - */ - onSend?: (value: string, context: { e: MouseEvent | KeyboardEvent }) => void; - /** - * 点击消息终止的回调方法 - */ - onStop?: (value: string, context: { e: MouseEvent }) => void; -} - -export interface TdChatReasoningProps { - /** - * 透传给 CollapsePanel 组件的全部属性 - * @default { destroyOnCollapse: false } - */ - collapsePanelProps?: CollapsePanelProps; - /** - * 当前折叠面板展开图标。优先级低于collapsePanelProps.expandIcon - */ - expandIcon?: TNode; - /** - * 展开图标位置,可选项:left/right - * @default right - */ - expandIconPlacement?: 'left' | 'right'; - /** - * 折叠面板头内容。优先级低于collapsePanelProps.header - */ - header?: TNode; - /** - * 折叠面板尾内容。优先级低于collapsePanelProps.headerRightContent - */ - headerRightContent?: TNode; - /** - * 展开图标点击事件 - */ - onExpandChange?: (value: CollapseValue) => void; -} - -export interface TdChatItemMeta { - avatar?: string; - name?: string; - role?: string; - datetime?: string; - content?: string; - reasoning?: string; -} - -export type ScrollToBottomParams = { behavior: 'auto' | 'smooth' }; - -export interface TdChatReasoning { - expandIconPlacement?: 'left' | 'right'; - onExpandChange?: (isExpand: boolean) => void; - collapsePanelProps?: Object; -} diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/attachments.en-US.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/attachments.en-US.md new file mode 100644 index 000000000..a091e7087 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/attachments.en-US.md @@ -0,0 +1,21 @@ +:: BASE_DOC :: + +## API + +### Attachments Props + +name | type | default | description | required +-- | -- | -- | -- | -- +imageViewer | Boolean | true | \- | N +items | Array | - | Typescript: `TdAttachmentItem` `import { TdAttachmentItem } from 'tdesign-web-components'`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/attachments/type.ts) | N +overflow | String | wrap | options: scrollX/scrollY/wrap | N +removable | Boolean | true | \- | N +onFileClick | Function | | Typescript: `(item: TdAttachmentItem) => void`
| N +onRemove | Function | | Typescript: `(item: TdAttachmentItem, index: number) => void`
| N + +### Attachments Events + +name | params | description +-- | -- | -- +file-click | `(item: TdAttachmentItem)` | \- +remove | `(item: TdAttachmentItem, index: number)` | \- diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/attachments.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/attachments.md new file mode 100644 index 000000000..b9440356c --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/attachments.md @@ -0,0 +1,21 @@ +:: BASE_DOC :: + +## API + +### Attachments Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +imageViewer | Boolean | true | 是否启用图片预览功能 | N +items | Array | - | 附件列表。TS 类型:`TdAttachmentItem` `import { TdAttachmentItem } from 'tdesign-web-components'`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/attachments/type.ts) | N +overflow | String | wrap | 是否显示删除按钮。可选项:scrollX/scrollY/wrap | N +removable | Boolean | true | 是否显示删除按钮 | N +onFileClick | Function | | TS 类型:`(item: TdAttachmentItem) => void`
点击文件时触发 | N +onRemove | Function | | TS 类型:`(item: TdAttachmentItem, index: number) => void`
点击删除按钮时触发 | N + +### Attachments Events + +名称 | 参数 | 描述 +-- | -- | -- +file-click | `(item: TdAttachmentItem)` | 点击文件时触发 +remove | `(item: TdAttachmentItem, index: number)` | 点击删除按钮时触发 diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/props.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/props.ts new file mode 100644 index 000000000..df18f7b6a --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/props.ts @@ -0,0 +1,38 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdAttachmentsProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 是否启用图片预览功能 */ + imageViewer: { + type: Boolean, + default: true, + }, + /** 附件列表 */ + items: { + type: Array as PropType, + }, + /** 是否显示删除按钮 */ + overflow: { + type: String as PropType, + default: 'wrap' as TdAttachmentsProps['overflow'], + validator(val: TdAttachmentsProps['overflow']): boolean { + if (!val) return true; + return ['scrollX', 'scrollY', 'wrap'].includes(val); + }, + }, + /** 是否显示删除按钮 */ + removable: { + type: Boolean, + default: true, + }, + /** 点击文件时触发 */ + onFileClick: Function as PropType, + /** 点击删除按钮时触发 */ + onRemove: Function as PropType, +}; diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/type.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/type.ts new file mode 100644 index 000000000..9e79df728 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/attachments/type.ts @@ -0,0 +1,39 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdAttachmentItem } from 'tdesign-web-components'; + +export interface TdAttachmentsProps { + /** + * 是否启用图片预览功能 + * @default true + */ + imageViewer?: boolean; + /** + * 附件列表 + */ + items?: TdAttachmentItem; + /** + * 是否显示删除按钮 + * @default wrap + */ + overflow?: 'scrollX' | 'scrollY' | 'wrap'; + /** + * 是否显示删除按钮 + * @default true + */ + removable?: boolean; + /** + * 点击文件时触发 + * @default '' + */ + onFileClick?: (item: TdAttachmentItem) => void; + /** + * 点击删除按钮时触发 + * @default '' + */ + onRemove?: (item: TdAttachmentItem, index: number) => void; +} diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/chat-actionbar.en-US.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/chat-actionbar.en-US.md new file mode 100644 index 000000000..eab6bb678 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/chat-actionbar.en-US.md @@ -0,0 +1,18 @@ +:: BASE_DOC :: + +## API + +### ChatActionbar Props + +name | type | default | description | required +-- | -- | -- | -- | -- +actionBar | Array | ['replay','copy','good','bad','share'] | Typescript: `Array<'replay'\|'copy'\|'good'\|'bad'\|'share'>` | N +comment | String | - | options: good/bad | N +content | String | - | \- | N +onActions | Function | | Typescript: `(value:string, context: { e: MouseEvent }) => void`
| N + +### ChatActionbar Events + +name | params | description +-- | -- | -- +actions | `(value:string, context: { e: MouseEvent })` | \- diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/chat-actionbar.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/chat-actionbar.md new file mode 100644 index 000000000..1293aa377 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/chat-actionbar.md @@ -0,0 +1,18 @@ +:: BASE_DOC :: + +## API + +### ChatActionbar Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +actionBar | Array | ['replay','copy','good','bad','share'] | 操作栏配置。TS 类型:`Array<'replay'\|'copy'\|'good'\|'bad'\|'share'>` | N +comment | String | - | 评价类型, 可选 'good'(点赞) 或者 'bad'(点踩), 默认为空。可选项:good/bad | N +content | String | - | 被复制的内容 | N +onActions | Function | | TS 类型:`(value:string, context: { e: MouseEvent }) => void`
点击点赞,点踩,复制,分享,重新生成按钮时触发发 | N + +### ChatActionbar Events + +名称 | 参数 | 描述 +-- | -- | -- +actions | `(value:string, context: { e: MouseEvent })` | 点击点赞,点踩,复制,分享,重新生成按钮时触发发 diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/props.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/props.ts new file mode 100644 index 000000000..26f42a137 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/props.ts @@ -0,0 +1,31 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatActionbarProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 操作栏配置 */ + actionBar: { + type: Array as PropType, + default: ['replay','copy','good','bad','share'], + }, + /** 评价类型, 可选 'good'(点赞) 或者 'bad'(点踩), 默认为空 */ + comment: { + type: String as PropType, + validator(val: TdChatActionbarProps['comment']): boolean { + if (!val) return true; + return ['good', 'bad'].includes(val); + }, + }, + /** 被复制的内容 */ + content: { + type: String, + default: '', + }, + /** 点击点赞,点踩,复制,分享,重新生成按钮时触发发 */ + onActions: Function as PropType, +}; diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/type.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/type.ts new file mode 100644 index 000000000..268a0a3c3 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-actionbar/type.ts @@ -0,0 +1,26 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdChatActionbarProps { + /** + * 操作栏配置 + * @default ['replay','copy','good','bad','share'] + */ + actionBar?: Array<'replay' | 'copy' | 'good' | 'bad' | 'share'>; + /** + * 评价类型, 可选 'good'(点赞) 或者 'bad'(点踩), 默认为空 + */ + comment?: 'good' | 'bad'; + /** + * 被复制的内容 + * @default '' + */ + content?: string; + /** + * 点击点赞,点踩,复制,分享,重新生成按钮时触发发 + */ + onActions?: (value: string, context: { e: MouseEvent }) => void; +} diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/chat-content.en-US.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/chat-content.en-US.md new file mode 100644 index 000000000..fcabee245 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/chat-content.en-US.md @@ -0,0 +1,12 @@ +:: BASE_DOC :: + +## API + +### ChatContent Props + +name | type | default | description | required +-- | -- | -- | -- | -- +content | String / Object | - | Typescript: `string \| ChatContentData` `interface ChatContentData { type: 'text' \| 'markdown'; data: any; }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +markdownProps | Object | - | Typescript: `{ engine: 'cherry-markdown' \| 'marked', options: ChatMarkdownProps }`,[ChatMarkdown API Documents](./chat-markdown?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +role | String | - | options: user/assistant/error/model-change/system | N +status | String | - | options: error / '' | N diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/chat-content.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/chat-content.md new file mode 100644 index 000000000..b1a244cb8 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/chat-content.md @@ -0,0 +1,12 @@ +:: BASE_DOC :: + +## API + +### ChatContent Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +content | String / Object | - | 聊天内容,支持多种内容类型。可以是字符串或结构化对象。TS 类型:`string \| ChatContentData` `interface ChatContentData { type: 'text' \| 'markdown'; data: any; }`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +markdownProps | Object | - | engine可选项:cherry-markdown/marked,options是透传给 ChatMarkdown 组件的全部属性。TS 类型:`{ engine: 'cherry-markdown' \| 'marked', options: ChatMarkdownProps }`,[ChatMarkdown API Documents](./chat-markdown?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chat-content/type.ts) | N +role | String | - | 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息。可选项:user/assistant/error/model-change/system | N +status | String | - | 正文状态。可选项:error / '' | N diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/props.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/props.ts new file mode 100644 index 000000000..7b0dd25b8 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/props.ts @@ -0,0 +1,35 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatContentProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 聊天内容,支持多种内容类型。可以是字符串或结构化对象 */ + content: { + type: [String, Object] as PropType, + }, + /** engine可选项:cherry-markdown/marked,options是透传给 ChatMarkdown 组件的全部属性 */ + markdownProps: { + type: Object as PropType, + }, + /** 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 */ + role: { + type: String as PropType, + validator(val: TdChatContentProps['role']): boolean { + if (!val) return true; + return ['user', 'assistant', 'error', 'model-change', 'system'].includes(val); + }, + }, + /** 正文状态 */ + status: { + type: String as PropType, + validator(val: TdChatContentProps['status']): boolean { + if (!val) return true; + return ['error', ''].includes(val); + }, + }, +}; diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/type.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/type.ts new file mode 100644 index 000000000..586d8b19c --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-content/type.ts @@ -0,0 +1,31 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { ChatMarkdownProps } from '../chat-markdown'; + +export interface TdChatContentProps { + /** + * 聊天内容,支持多种内容类型。可以是字符串或结构化对象 + */ + content?: string | ChatContentData; + /** + * engine可选项:cherry-markdown/marked,options是透传给 ChatMarkdown 组件的全部属性 + */ + markdownProps?: { engine: 'cherry-markdown' | 'marked'; options: ChatMarkdownProps }; + /** + * 角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息 + */ + role?: 'user' | 'assistant' | 'error' | 'model-change' | 'system'; + /** + * 正文状态 + */ + status?: 'error' | ''; +} + +export interface ChatContentData { + type: 'text' | 'markdown'; + data: any; +} diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/chat-loading.en-US.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/chat-loading.en-US.md new file mode 100644 index 000000000..0b4e9c572 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/chat-loading.en-US.md @@ -0,0 +1,10 @@ +:: BASE_DOC :: + +## API + +### ChatLoading Props + +name | type | default | description | required +-- | -- | -- | -- | -- +animation | String | moving | options: skeleton/moving/gradient/dots/circle | N +text | String | - | text of chat loading | N diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/chat-loading.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/chat-loading.md new file mode 100644 index 000000000..0dcfbd93c --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/chat-loading.md @@ -0,0 +1,10 @@ +:: BASE_DOC :: + +## API + +### ChatLoading Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +animation | String | moving | 加载的状态形式。可选项:skeleton/moving/gradient/dots/circle | N +text | String | - | 加载过程展示的文字内容 | N diff --git a/packages/products/tdesign-vue-next/packages/components/chat/chat-loading-props.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/props.ts similarity index 72% rename from packages/products/tdesign-vue-next/packages/components/chat/chat-loading-props.ts rename to packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/props.ts index fee979daa..1f6a85fd5 100644 --- a/packages/products/tdesign-vue-next/packages/components/chat/chat-loading-props.ts +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/props.ts @@ -4,17 +4,17 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ -import { TdChatLoadingProps } from '../chat/type'; +import { TdChatLoadingProps } from './type'; import { PropType } from 'vue'; export default { /** 加载的状态形式 */ animation: { type: String as PropType, - default: 'gradient' as TdChatLoadingProps['animation'], + default: 'moving' as TdChatLoadingProps['animation'], validator(val: TdChatLoadingProps['animation']): boolean { if (!val) return true; - return ['moving', 'gradient'].includes(val); + return ['skeleton', 'moving', 'gradient', 'dots', 'circle'].includes(val); }, }, /** 加载过程展示的文字内容 */ diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/type.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/type.ts new file mode 100644 index 000000000..2c3bd3ceb --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-loading/type.ts @@ -0,0 +1,18 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdChatLoadingProps { + /** + * 加载的状态形式 + * @default moving + */ + animation?: 'skeleton' | 'moving' | 'gradient' | 'dots' | 'circle'; + /** + * 加载过程展示的文字内容 + * @default '' + */ + text?: string; +} diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/chat-markdown.en-US.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/chat-markdown.en-US.md new file mode 100644 index 000000000..6d3935abf --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/chat-markdown.en-US.md @@ -0,0 +1,10 @@ +:: BASE_DOC :: + +## API + +### ChatMarkdown Props + +name | type | default | description | required +-- | -- | -- | -- | -- +content | String | - | \- | N +options | Object | - | Typescript: `TdChatContentMDOptions` ` import type { TdChatContentMDOptions } from 'tdesign-web-components/chat-message/content/markdown-content' `。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chat-markdown/type.ts) | N diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/chat-markdown.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/chat-markdown.md new file mode 100644 index 000000000..f3f59f79a --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/chat-markdown.md @@ -0,0 +1,10 @@ +:: BASE_DOC :: + +## API + +### ChatMarkdown Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +content | String | - | markdown 内容文本 | N +options | Object | - | Markdown 解析器基础配置。TS 类型:`TdChatContentMDOptions` ` import type { TdChatContentMDOptions } from 'tdesign-web-components/chat-message/content/markdown-content' `。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chat-markdown/type.ts) | N diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/props.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/props.ts new file mode 100644 index 000000000..7ef376551 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/props.ts @@ -0,0 +1,20 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatMarkdownProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** markdown 内容文本 */ + content: { + type: String, + default: '', + }, + /** Markdown 解析器基础配置 */ + options: { + type: Object as PropType, + }, +}; diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/type.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/type.ts new file mode 100644 index 000000000..df12ea39d --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-markdown/type.ts @@ -0,0 +1,19 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import type { TdChatContentMDOptions } from 'tdesign-web-components/chat-message/content/markdown-content'; + +export interface TdChatMarkdownProps { + /** + * markdown 内容文本 + * @default '' + */ + content?: string; + /** + * Markdown 解析器基础配置 + */ + options?: TdChatContentMDOptions; +} diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/chat-thinking.en-US.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/chat-thinking.en-US.md new file mode 100644 index 000000000..9cadcb4d3 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/chat-thinking.en-US.md @@ -0,0 +1,14 @@ +:: BASE_DOC :: + +## API + +### ChatThinking Props + +name | type | default | description | required +-- | -- | -- | -- | -- +animation | String | circle | options: circle/moving/gradient | N +collapsed | Boolean | false | \- | N +content | Object | - | required。Typescript: `{ text?: string; title?: string }` | Y +layout | String | block | options: block/border | N +maxHeight | Number | - | \- | N +status | String | pending | required。options: complete/stop/error/pending | Y diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/chat-thinking.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/chat-thinking.md new file mode 100644 index 000000000..370ed4f27 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/chat-thinking.md @@ -0,0 +1,14 @@ +:: BASE_DOC :: + +## API + +### ChatThinking Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +animation | String | circle | 加载动画类型。可选项:circle/moving/gradient | N +collapsed | Boolean | false | 是否折叠 | N +content | Object | - | 必需。思考内容对象。TS 类型:`{ text?: string; title?: string }` | Y +layout | String | block | 布局方式。可选项:block/border | N +maxHeight | Number | - | 内容区域最大高度,超出会自动滚动 | N +status | String | pending | 必需。思考状态。可选项:complete/stop/error/pending | Y diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/props.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/props.ts new file mode 100644 index 000000000..fb63bbf09 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/props.ts @@ -0,0 +1,49 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatThinkingProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 加载动画类型 */ + animation: { + type: String as PropType, + default: 'circle' as TdChatThinkingProps['animation'], + validator(val: TdChatThinkingProps['animation']): boolean { + if (!val) return true; + return ['circle', 'moving', 'gradient'].includes(val); + }, + }, + /** 是否折叠 */ + collapsed: Boolean, + /** 思考内容对象 */ + content: { + type: Object as PropType, + required: true, + }, + /** 布局方式 */ + layout: { + type: String as PropType, + default: 'block' as TdChatThinkingProps['layout'], + validator(val: TdChatThinkingProps['layout']): boolean { + if (!val) return true; + return ['block', 'border'].includes(val); + }, + }, + /** 内容区域最大高度,超出会自动滚动 */ + maxHeight: { + type: Number, + }, + /** 思考状态 */ + status: { + type: String as PropType, + default: 'pending' as TdChatThinkingProps['status'], + required: true, + validator(val: TdChatThinkingProps['status']): boolean { + return ['complete', 'stop', 'error', 'pending'].includes(val); + }, + }, +}; diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/type.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/type.ts new file mode 100644 index 000000000..39d295dd3 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chat-thinking/type.ts @@ -0,0 +1,36 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +export interface TdChatThinkingProps { + /** + * 加载动画类型 + * @default circle + */ + animation?: 'circle' | 'moving' | 'gradient'; + /** + * 是否折叠 + * @default false + */ + collapsed?: boolean; + /** + * 思考内容对象 + */ + content: { text?: string; title?: string }; + /** + * 布局方式 + * @default block + */ + layout?: 'block' | 'border'; + /** + * 内容区域最大高度,超出会自动滚动 + */ + maxHeight?: number; + /** + * 思考状态 + * @default pending + */ + status: 'complete' | 'stop' | 'error' | 'pending'; +} diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/chatbot.en-US.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/chatbot.en-US.md new file mode 100644 index 000000000..f35711195 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/chatbot.en-US.md @@ -0,0 +1,9 @@ +:: BASE_DOC :: + +## API + +### Chatbot Props + +name | type | default | description | required +-- | -- | -- | -- | -- +defaultMessages | Array | - | Typescript: `Array` `import type { ChatMessagesData } from 'tdesign-web-components/lib/chat-engine/type'`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chatbot/type.ts) | N diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/chatbot.md b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/chatbot.md new file mode 100644 index 000000000..c2e8125c1 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/chatbot.md @@ -0,0 +1,9 @@ +:: BASE_DOC :: + +## API + +### Chatbot Props + +名称 | 类型 | 默认值 | 描述 | 必传 +-- | -- | -- | -- | -- +defaultMessages | Array | - | 初始消息数据列表。TS 类型:`Array` `import type { ChatMessagesData } from 'tdesign-web-components/lib/chat-engine/type'`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/chatbot/type.ts) | N diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/props.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/props.ts new file mode 100644 index 000000000..80b8067ee --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/props.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import { TdChatbotProps } from './type'; +import { PropType } from 'vue'; + +export default { + /** 初始消息数据列表 */ + defaultMessages: { + type: Array as PropType, + }, +}; diff --git a/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/type.ts b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/type.ts new file mode 100644 index 000000000..2c1cdbfb3 --- /dev/null +++ b/packages/products/tdesign-vue-next/packages/pro-components/chat/chatbot/type.ts @@ -0,0 +1,14 @@ +/* eslint-disable */ + +/** + * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC + * */ + +import type { ChatMessagesData } from 'tdesign-web-components/lib/chat-engine/type'; + +export interface TdChatbotProps { + /** + * 初始消息数据列表 + */ + defaultMessages?: Array; +} diff --git a/packages/scripts/api.json b/packages/scripts/api.json index 260525c05..96d27e270 100644 --- a/packages/scripts/api.json +++ b/packages/scripts/api.json @@ -5143,6 +5143,8 @@ { "id": 1762421222, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -5172,6 +5174,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -5218,9 +5222,89 @@ "Array" ] }, + { + "id": 1775925316, + "platform_framework": [ + "1", + "2" + ], + "component": "Attachments", + "field_category": 1, + "field_name": "items", + "field_type": [ + "16" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "附件列表", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-11 16:35:16", + "update_time": "2026-04-11 16:35:16", + "event_output": null, + "custom_field_type": "TdAttachmentItem【import { TdAttachmentItem } from 'tdesign-web-components'】", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Array" + ] + }, + { + "id": 1775924583, + "platform_framework": [ + "1", + "2" + ], + "component": "Attachments", + "field_category": 1, + "field_name": "overflow", + "field_type": [ + "1" + ], + "field_default_value": "wrap", + "field_enum": "scrollX/scrollY/wrap", + "field_desc_zh": "是否显示删除按钮", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-11 16:23:03", + "update_time": "2026-04-11 16:23:03", + "event_output": null, + "custom_field_type": "", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, { "id": 1762421201, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -5250,6 +5334,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -5335,6 +5421,45 @@ "String" ] }, + { + "id": 1775925436, + "platform_framework": [ + "1", + "2" + ], + "component": "Attachments", + "field_category": 2, + "field_name": "fileClick", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "点击文件时触发", + "field_desc_en": null, + "field_required": 0, + "event_input": "(item: TdAttachmentItem)", + "create_time": "2026-04-11 16:37:16", + "update_time": "2026-04-11 16:37:16", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, { "id": 1762421355, "platform_framework": [ @@ -5374,6 +5499,45 @@ "String" ] }, + { + "id": 1775925452, + "platform_framework": [ + "1", + "2" + ], + "component": "Attachments", + "field_category": 2, + "field_name": "remove", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "点击删除按钮时触发", + "field_desc_en": null, + "field_required": 0, + "event_input": "(item: TdAttachmentItem, index: number)", + "create_time": "2026-04-11 16:37:32", + "update_time": "2026-04-11 16:37:32", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, { "id": 1772102998, "platform_framework": [ @@ -27362,6 +27526,45 @@ "Array" ] }, + { + "id": 1775980547, + "platform_framework": [ + "1", + "2" + ], + "component": "ChatActionbar", + "field_category": 1, + "field_name": "actionBar", + "field_type": [ + "16" + ], + "field_default_value": "['replay','copy','good','bad','share']", + "field_enum": "", + "field_desc_zh": "操作栏配置", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-12 07:55:47", + "update_time": "2026-04-12 07:55:47", + "event_output": null, + "custom_field_type": "Array<'replay'|'copy'|'good'|'bad'|'share'>", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Array" + ] + }, { "id": 1762424897, "platform_framework": [ @@ -27404,6 +27607,8 @@ { "id": 1762424950, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -27433,6 +27638,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -27443,6 +27650,8 @@ { "id": 1762425190, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -27472,6 +27681,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -27670,6 +27881,41 @@ ], "field_type_text": [] }, + { + "id": 1775980747, + "platform_framework": [ + "1", + "2" + ], + "component": "ChatActionbar", + "field_category": 2, + "field_name": "actions", + "field_type": [], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "点击点赞,点踩,复制,分享,重新生成按钮时触发发", + "field_desc_en": null, + "field_required": 0, + "event_input": "(value:string, context: { e: MouseEvent })", + "create_time": "2026-04-12 07:59:07", + "update_time": "2026-04-12 07:59:07", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Events", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [] + }, { "id": 1772103301, "platform_framework": [ @@ -27719,18 +27965,19 @@ "field_category": 1, "field_name": "content", "field_type": [ - "1" + "1", + "8" ], "field_default_value": "", "field_enum": "", - "field_desc_zh": "聊天内容,支持 markdown 格式", + "field_desc_zh": "聊天内容,支持多种内容类型。可以是字符串或结构化对象", "field_desc_en": null, "field_required": 0, "event_input": "", "create_time": "2025-03-25 06:19:35", "update_time": "2025-03-25 06:19:35", "event_output": null, - "custom_field_type": null, + "custom_field_type": "string | ChatContentData【interface ChatContentData { type: 'text' | 'markdown'; data: any; }】", "syntactic_sugar": null, "readonly": 1, "html_attribute": 0, @@ -27745,7 +27992,8 @@ "React(PC)" ], "field_type_text": [ - "String" + "String", + "Object" ] }, { @@ -27826,6 +28074,45 @@ "Object" ] }, + { + "id": 1775927916, + "platform_framework": [ + "1", + "2" + ], + "component": "ChatContent", + "field_category": 1, + "field_name": "markdownProps", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "engine可选项:cherry-markdown/marked,options是透传给 ChatMarkdown 组件的全部属性", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-11 17:18:36", + "update_time": "2026-04-11 17:18:36", + "event_output": null, + "custom_field_type": "{ engine: 'cherry-markdown' | 'marked', options: ChatMarkdownProps }【import { ChatMarkdownProps } from '@ChatMarkdown'】", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, { "id": 1742883540, "platform_framework": [ @@ -27907,6 +28194,8 @@ { "id": 1762418206, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -27936,6 +28225,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -29076,8 +29367,8 @@ "field_type": [ "1" ], - "field_default_value": "gradient", - "field_enum": "moving/gradient", + "field_default_value": "moving", + "field_enum": "skeleton/moving/gradient/dots/circle", "field_desc_zh": "加载的状态形式", "field_desc_en": null, "field_required": 0, @@ -29116,7 +29407,7 @@ "1" ], "field_default_value": "moving", - "field_enum": "skeleton/moving/gradient/dot", + "field_enum": "skeleton/moving/gradient/dots", "field_desc_zh": "加载的状态形式", "field_desc_en": null, "field_required": 0, @@ -29147,7 +29438,8 @@ "platform_framework": [ "1", "2", - "64" + "64", + "128" ], "component": "ChatLoading", "field_category": 1, @@ -29177,7 +29469,8 @@ "platform_framework_text": [ "Vue(PC)", "React(PC)", - "Miniprogram" + "Miniprogram", + "UniApp" ], "field_type_text": [ "String" @@ -29222,6 +29515,45 @@ "String" ] }, + { + "id": 1775926784, + "platform_framework": [ + "1", + "2" + ], + "component": "ChatMarkdown", + "field_category": 1, + "field_name": "content", + "field_type": [ + "1" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "markdown 内容文本", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-11 16:59:44", + "update_time": "2026-04-11 16:59:44", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, { "id": 1762423331, "platform_framework": [ @@ -29261,6 +29593,45 @@ "Object" ] }, + { + "id": 1775926603, + "platform_framework": [ + "1", + "2" + ], + "component": "ChatMarkdown", + "field_category": 1, + "field_name": "options", + "field_type": [ + "8" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "Markdown 解析器基础配置", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-11 16:56:43", + "update_time": "2026-04-11 16:56:43", + "event_output": null, + "custom_field_type": "TdChatContentMDOptions【 import type { TdChatContentMDOptions } from 'tdesign-web-components/chat-message/content/markdown-content' 】", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Object" + ] + }, { "id": 1762423469, "platform_framework": [ @@ -31315,8 +31686,8 @@ "1" ], "field_default_value": "moving", - "field_enum": "skeleton/moving/gradient/dot", - "field_desc_zh": "内容区域最大高度,超出会自动滚动", + "field_enum": "skeleton/moving/gradient/dots", + "field_desc_zh": "加载动画类型", "field_desc_en": null, "field_required": 0, "event_input": "", @@ -31341,9 +31712,50 @@ "String" ] }, + { + "id": 1775920275, + "platform_framework": [ + "1", + "2" + ], + "component": "ChatThinking", + "field_category": 1, + "field_name": "animation", + "field_type": [ + "1" + ], + "field_default_value": "circle", + "field_enum": "circle/moving/gradient", + "field_desc_zh": "加载动画类型", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-11 15:11:15", + "update_time": "2026-04-11 15:11:15", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "String" + ] + }, { "id": 1762424304, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -31373,6 +31785,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -31383,6 +31797,8 @@ { "id": 1762423978, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -31412,6 +31828,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -31422,6 +31840,8 @@ { "id": 1762424182, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -31451,6 +31871,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -31461,6 +31883,8 @@ { "id": 1762424258, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -31490,6 +31914,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -31500,6 +31926,8 @@ { "id": 1762424242, "platform_framework": [ + "1", + "2", "64", "128" ], @@ -31529,6 +31957,8 @@ "support_default_value": 0, "field_category_text": "Props", "platform_framework_text": [ + "Vue(PC)", + "React(PC)", "Miniprogram", "UniApp" ], @@ -31551,7 +31981,7 @@ "field_desc_zh": "切换折叠面板时触发", "field_desc_en": null, "field_required": 0, - "event_input": "(value: Boolean)", + "event_input": "(value: boolean)", "create_time": "2025-11-06 10:19:12", "update_time": "2025-11-06 10:19:12", "event_output": null, @@ -31571,6 +32001,41 @@ ], "field_type_text": [] }, + { + "id": 1776042504, + "platform_framework": [ + "64", + "128" + ], + "component": "ChatThinking", + "field_category": 512, + "field_name": "content", + "field_type": [], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "自定义 `content` 显示内容", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-13 01:08:24", + "update_time": "2026-04-13 01:08:24", + "event_output": null, + "custom_field_type": null, + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Slots", + "platform_framework_text": [ + "Miniprogram", + "UniApp" + ], + "field_type_text": [] + }, { "id": 1772103456, "platform_framework": [ @@ -31610,6 +32075,45 @@ "Object" ] }, + { + "id": 1776073254, + "platform_framework": [ + "1", + "2" + ], + "component": "Chatbot", + "field_category": 1, + "field_name": "defaultMessages", + "field_type": [ + "16" + ], + "field_default_value": "", + "field_enum": "", + "field_desc_zh": "初始消息数据列表", + "field_desc_en": null, + "field_required": 0, + "event_input": "", + "create_time": "2026-04-13 09:40:54", + "update_time": "2026-04-13 09:40:54", + "event_output": null, + "custom_field_type": "Array【import type { ChatMessagesData } from 'tdesign-web-components/lib/chat-engine/type'】", + "syntactic_sugar": null, + "readonly": 1, + "html_attribute": 0, + "trigger_elements": "", + "deprecated": 0, + "version": "", + "test_description": null, + "support_default_value": 0, + "field_category_text": "Props", + "platform_framework_text": [ + "Vue(PC)", + "React(PC)" + ], + "field_type_text": [ + "Array" + ] + }, { "id": 418, "platform_framework": [ diff --git a/packages/scripts/config/files-combine.js b/packages/scripts/config/files-combine.js index 214fcaf87..58fbdf339 100644 --- a/packages/scripts/config/files-combine.js +++ b/packages/scripts/config/files-combine.js @@ -209,16 +209,16 @@ const COMPONENT_API_MD_MAP = { includes: ['Vue(Mobile)', 'React(Mobile)'], }, // 高阶组件 - Chat: [ - 'Chat', - 'ChatLoading', - 'ChatItem', - 'ChatContent', - 'ChatAction', - 'ChatInput', - 'ChatSender', - 'ChatReasoning', - ], + // Chat: [ + // 'Chat', + // 'ChatLoading', + // 'ChatItem', + // 'ChatContent', + // 'ChatAction', + // 'ChatInput', + // 'ChatSender', + // 'ChatReasoning', + // ], ColorPicker: { list: ['ColorPicker', 'ColorPickerPanel'], includes: ['Vue(PC)', 'VueNext(PC)', 'React(PC)', 'Angular(PC)'], diff --git a/packages/scripts/map.json b/packages/scripts/map.json index acf25eb6b..d33137ffb 100644 --- a/packages/scripts/map.json +++ b/packages/scripts/map.json @@ -397,6 +397,10 @@ "value": "ChatActionbar", "label": "对话操作" }, + { + "value": "Chatbot", + "label": "智能对话" + }, { "value": "ChatContent", "label": "对话正文" diff --git a/packages/scripts/types/react-default-props.js b/packages/scripts/types/react-default-props.js index 1227f6b80..4ec13d160 100644 --- a/packages/scripts/types/react-default-props.js +++ b/packages/scripts/types/react-default-props.js @@ -15,6 +15,7 @@ const { getFolderName, getCmpTypeCombineMap, } = require('../common'); +const { getComponentBasePath } = require('../utils'); const CONFIG = reactDefaultValuePropsConfig; @@ -136,7 +137,7 @@ function generateReactDefaultProps(baseData, framework) { console.warn(e); } - const basePath = FRAMEWORK_MAP[framework].propsBasePath; + const basePath = getComponentBasePath(parentCmp,FRAMEWORK_MAP[framework].propsBasePath); const folder = path.resolve(basePath, getFolderName(parentCmp)); fs.mkdir(folder, { recursive: true }, (err) => { if (err) { diff --git a/packages/server/controllers/ComponentApi/const.ts b/packages/server/controllers/ComponentApi/const.ts index 8992d9e96..7dca2b2f1 100644 --- a/packages/server/controllers/ComponentApi/const.ts +++ b/packages/server/controllers/ComponentApi/const.ts @@ -245,6 +245,7 @@ export const COMPONENTS_PC: Array = [ { value: 'CalendarCell', label: '日历项参数', type: 'TS' }, { value: 'Cascader', label: '级联选择' }, { value: 'Chat', label: '对话' }, + { value: 'Chatbot', label: '智能对话' }, { value: 'ChatAction', label: '对话操作' }, { value: 'ChatItem', label: '对话单元' }, { value: 'ChatInput', label: '对话输入框' },