@incremark/chat-vue 0.4.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/LICENSE +22 -0
  2. package/dist/chunk-X3YI3YOK.js +3809 -0
  3. package/dist/chunk-X3YI3YOK.js.map +1 -0
  4. package/dist/components/base/action-button/action-button.vue.d.ts +28 -0
  5. package/dist/components/base/action-button/index.d.ts +5 -0
  6. package/dist/components/base/action-button/types/index.d.ts +9 -0
  7. package/dist/components/base/im-button/im-button.vue.d.ts +30 -0
  8. package/dist/components/base/im-button/index.d.ts +2 -0
  9. package/dist/components/base/im-button/types/index.d.ts +27 -0
  10. package/dist/components/base/im-dropdown/im-dropdown.vue.d.ts +24 -0
  11. package/dist/components/base/im-dropdown/index.d.ts +5 -0
  12. package/dist/components/base/im-dropdown/types/index.d.ts +27 -0
  13. package/dist/components/base/im-popover/im-popover.vue.d.ts +38 -0
  14. package/dist/components/base/im-popover/index.d.ts +2 -0
  15. package/dist/components/base/im-popover/types/index.d.ts +25 -0
  16. package/dist/components/base/im-tooltip/im-tooltip.vue.d.ts +20 -0
  17. package/dist/components/base/im-tooltip/index.d.ts +2 -0
  18. package/dist/components/base/im-tooltip/types/index.d.ts +12 -0
  19. package/dist/components/base/index.d.ts +8 -0
  20. package/dist/components/chain-of-thought/chain-of-thought-step.vue.d.ts +25 -0
  21. package/dist/components/chain-of-thought/chain-of-thought.vue.d.ts +32 -0
  22. package/dist/components/chain-of-thought/composables/index.d.ts +4 -0
  23. package/dist/components/chain-of-thought/composables/useChainOfThought.d.ts +7 -0
  24. package/dist/components/chain-of-thought/index.d.ts +6 -0
  25. package/dist/components/chain-of-thought/types/index.d.ts +76 -0
  26. package/dist/components/error-message/error-message.vue.d.ts +22 -0
  27. package/dist/components/error-message/index.d.ts +5 -0
  28. package/dist/components/error-message/types/index.d.ts +22 -0
  29. package/dist/components/file-preview/composables/index.d.ts +1 -0
  30. package/dist/components/file-preview/composables/useFileType.d.ts +40 -0
  31. package/dist/components/file-preview/file-preview.vue.d.ts +13 -0
  32. package/dist/components/file-preview/index.d.ts +5 -0
  33. package/dist/components/file-preview/types/index.d.ts +44 -0
  34. package/dist/components/index.d.ts +34 -0
  35. package/dist/components/message-actions/composables/index.d.ts +5 -0
  36. package/dist/components/message-actions/composables/useCopyAction.d.ts +20 -0
  37. package/dist/components/message-actions/index.d.ts +11 -0
  38. package/dist/components/message-actions/message-action-copy.vue.d.ts +7 -0
  39. package/dist/components/message-actions/message-action-feedback.vue.d.ts +14 -0
  40. package/dist/components/message-actions/message-action-more.vue.d.ts +10 -0
  41. package/dist/components/message-actions/message-action.vue.d.ts +21 -0
  42. package/dist/components/message-actions/message-actions.vue.d.ts +23 -0
  43. package/dist/components/message-actions/types/index.d.ts +107 -0
  44. package/dist/components/message-bubble/index.d.ts +2 -0
  45. package/dist/components/message-bubble/message-bubble.vue.d.ts +27 -0
  46. package/dist/components/message-bubble/types/index.d.ts +37 -0
  47. package/dist/components/message-renderer/index.d.ts +6 -0
  48. package/dist/components/message-renderer/part-renderer.vue.d.ts +19 -0
  49. package/dist/components/message-renderer/types/index.d.ts +37 -0
  50. package/dist/components/reasoning-message/index.d.ts +5 -0
  51. package/dist/components/reasoning-message/reasoning-message.vue.d.ts +8 -0
  52. package/dist/components/reasoning-message/types/index.d.ts +38 -0
  53. package/dist/components/sender/components/sender-action-button.vue.d.ts +24 -0
  54. package/dist/components/sender/components/sender-attachments.vue.d.ts +11 -0
  55. package/dist/components/sender/components/sender-file-button.vue.d.ts +11 -0
  56. package/dist/components/sender/components/sender-submit-button.vue.d.ts +21 -0
  57. package/dist/components/sender/composables/index.d.ts +2 -0
  58. package/dist/components/sender/composables/useSender.d.ts +31 -0
  59. package/dist/components/sender/index.d.ts +7 -0
  60. package/dist/components/sender/sender.vue.d.ts +66 -0
  61. package/dist/components/sender/types/index.d.ts +174 -0
  62. package/dist/components/sender-input/index.d.ts +1 -0
  63. package/dist/components/sender-input/sender-input.vue.d.ts +36 -0
  64. package/dist/components/sender-input/types/index.d.ts +24 -0
  65. package/dist/components/source-reference/index.d.ts +5 -0
  66. package/dist/components/source-reference/source-reference.vue.d.ts +20 -0
  67. package/dist/components/source-reference/types/index.d.ts +13 -0
  68. package/dist/components/suggestion/index.d.ts +6 -0
  69. package/dist/components/suggestion/suggestion-item.vue.d.ts +21 -0
  70. package/dist/components/suggestion/suggestion.vue.d.ts +22 -0
  71. package/dist/components/suggestion/types/index.d.ts +27 -0
  72. package/dist/components/svg-icon/index.d.ts +1 -0
  73. package/dist/components/svg-icon/svg-icon.vue.d.ts +13 -0
  74. package/dist/components/text-message/index.d.ts +5 -0
  75. package/dist/components/text-message/text-message.vue.d.ts +6 -0
  76. package/dist/components/text-message/types/index.d.ts +32 -0
  77. package/dist/components/tool-call/index.d.ts +5 -0
  78. package/dist/components/tool-call/tool-call.vue.d.ts +18 -0
  79. package/dist/components/tool-call/types/index.d.ts +81 -0
  80. package/dist/components/welcome/index.d.ts +5 -0
  81. package/dist/components/welcome/types/index.d.ts +19 -0
  82. package/dist/components/welcome/welcome.vue.d.ts +28 -0
  83. package/dist/components.js +3 -0
  84. package/dist/components.js.map +1 -0
  85. package/dist/composables/index.d.ts +2 -0
  86. package/dist/composables/useCollapsible.d.ts +4 -0
  87. package/dist/composables/useUIAdapter.d.ts +14 -0
  88. package/dist/index.d.ts +7 -0
  89. package/dist/index.js +30 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/provider/ChatProvider.vue.d.ts +14 -0
  92. package/dist/provider/index.d.ts +4 -0
  93. package/dist/types/adapter.d.ts +64 -0
  94. package/dist/types/index.d.ts +5 -0
  95. package/dist/types/message.d.ts +5 -0
  96. package/dist/types/parts.d.ts +5 -0
  97. package/package.json +83 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * useCopyAction - 复制操作逻辑
3
+ */
4
+ import { type Ref } from 'vue';
5
+ export interface UseCopyActionOptions {
6
+ /** 复制成功后重置状态的延迟时间 (ms) */
7
+ resetDelay?: number;
8
+ }
9
+ export interface UseCopyActionReturn {
10
+ /** 是否已复制 */
11
+ copied: Ref<boolean>;
12
+ /** 执行复制 */
13
+ copy: () => Promise<void>;
14
+ }
15
+ /**
16
+ * 复制操作 composable
17
+ * @param text 要复制的文本 (响应式)
18
+ * @param options 配置选项
19
+ */
20
+ export declare function useCopyAction(text: Ref<string>, options?: UseCopyActionOptions): UseCopyActionReturn;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * MessageActions 组件导出
3
+ */
4
+ export { default as MessageActions } from './message-actions.vue';
5
+ export { default as MessageAction } from './message-action.vue';
6
+ export { default as MessageActionCopy } from './message-action-copy.vue';
7
+ export { default as MessageActionFeedback } from './message-action-feedback.vue';
8
+ export { default as MessageActionMore } from './message-action-more.vue';
9
+ export type { MessageActionsProps, MessageActionProps, MessageActionCopyProps, MessageActionFeedbackProps, MessageActionMoreProps, MoreActionItem, ActionItem, ActionItemType, FeedbackValue } from './types';
10
+ export { useCopyAction } from './composables';
11
+ export type { UseCopyActionOptions, UseCopyActionReturn } from './composables';
@@ -0,0 +1,7 @@
1
+ import type { MessageActionCopyProps } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<MessageActionCopyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MessageActionCopyProps> & Readonly<{}>, {
3
+ tooltip: string;
4
+ copiedTooltip: string;
5
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import type { MessageActionFeedbackProps, FeedbackValue } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<MessageActionFeedbackProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ change: (value: FeedbackValue) => any;
4
+ "update:value": (value: FeedbackValue) => any;
5
+ }, string, import("vue").PublicProps, Readonly<MessageActionFeedbackProps> & Readonly<{
6
+ onChange?: ((value: FeedbackValue) => any) | undefined;
7
+ "onUpdate:value"?: ((value: FeedbackValue) => any) | undefined;
8
+ }>, {
9
+ value: FeedbackValue;
10
+ likeTooltip: string;
11
+ dislikeTooltip: string;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import type { MessageActionMoreProps, MoreActionItem } from './types';
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ declare const __VLS_export: import("vue").DefineComponent<MessageActionMoreProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ select: (item: MoreActionItem) => any;
6
+ }, string, import("vue").PublicProps, Readonly<MessageActionMoreProps> & Readonly<{
7
+ onSelect?: ((item: MoreActionItem) => any) | undefined;
8
+ }>, {
9
+ tooltip: string;
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,21 @@
1
+ import type { MessageActionProps } from './types';
2
+ declare var __VLS_16: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_16) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<MessageActionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ click: (event: MouseEvent) => any;
8
+ }, string, import("vue").PublicProps, Readonly<MessageActionProps> & Readonly<{
9
+ onClick?: ((event: MouseEvent) => any) | undefined;
10
+ }>, {
11
+ disabled: boolean;
12
+ loading: boolean;
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,23 @@
1
+ import type { MessageActionsProps, ActionItem, FeedbackValue } from './types';
2
+ declare var __VLS_27: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_27) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<MessageActionsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ action: (item: ActionItem) => any;
8
+ "update:feedbackValue": (value: FeedbackValue) => any;
9
+ }, string, import("vue").PublicProps, Readonly<MessageActionsProps> & Readonly<{
10
+ onAction?: ((item: ActionItem) => any) | undefined;
11
+ "onUpdate:feedbackValue"?: ((value: FeedbackValue) => any) | undefined;
12
+ }>, {
13
+ variant: "borderless" | "filled" | "outlined";
14
+ maxVisible: number;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,107 @@
1
+ /**
2
+ * MessageActions 组件类型定义
3
+ */
4
+ import type { Component } from 'vue';
5
+ /**
6
+ * 反馈值类型
7
+ */
8
+ export type FeedbackValue = 'like' | 'dislike' | 'default';
9
+ /**
10
+ * 操作项类型
11
+ */
12
+ export type ActionItemType = 'copy' | 'feedback' | 'custom';
13
+ /**
14
+ * 操作项配置
15
+ */
16
+ export interface ActionItem {
17
+ /** 唯一标识 */
18
+ key: string;
19
+ /** 操作类型 */
20
+ type?: ActionItemType;
21
+ /** 图标组件 */
22
+ icon?: Component;
23
+ /** Tooltip 文本 */
24
+ tooltip?: string;
25
+ /** 显示文本(用于 dropdown) */
26
+ label?: string;
27
+ /** 是否禁用 */
28
+ disabled?: boolean;
29
+ /** 点击处理函数 */
30
+ handler?: () => void;
31
+ /** copy 类型专用:要复制的文本 */
32
+ copyText?: string;
33
+ }
34
+ /**
35
+ * 更多操作项(用于 dropdown)
36
+ */
37
+ export interface MoreActionItem {
38
+ /** 唯一标识 */
39
+ key: string;
40
+ /** 显示文本 */
41
+ label: string;
42
+ /** 图标组件 */
43
+ icon?: Component;
44
+ /** 是否禁用 */
45
+ disabled?: boolean;
46
+ /** 是否为分割线 */
47
+ divider?: boolean;
48
+ }
49
+ /**
50
+ * MessageActions 容器 Props
51
+ */
52
+ export interface MessageActionsProps {
53
+ /** 变体样式 */
54
+ variant?: 'borderless' | 'filled' | 'outlined';
55
+ /** 操作项配置(配置方式) */
56
+ actions?: ActionItem[];
57
+ /** 最大可见数量,超出部分折叠到"更多" */
58
+ maxVisible?: number;
59
+ /** 反馈值(配置方式使用) */
60
+ feedbackValue?: FeedbackValue;
61
+ }
62
+ /**
63
+ * MessageAction 通用按钮 Props
64
+ */
65
+ export interface MessageActionProps {
66
+ /** 图标组件 */
67
+ icon?: Component;
68
+ /** Tooltip 文本 */
69
+ tooltip?: string;
70
+ /** 无障碍标签 */
71
+ label?: string;
72
+ /** 加载状态 */
73
+ loading?: boolean;
74
+ /** 禁用状态 */
75
+ disabled?: boolean;
76
+ }
77
+ /**
78
+ * MessageActionCopy Props
79
+ */
80
+ export interface MessageActionCopyProps {
81
+ /** 要复制的文本 */
82
+ text: string;
83
+ /** 复制成功后的 tooltip */
84
+ copiedTooltip?: string;
85
+ /** 默认 tooltip */
86
+ tooltip?: string;
87
+ }
88
+ /**
89
+ * MessageActionFeedback Props
90
+ */
91
+ export interface MessageActionFeedbackProps {
92
+ /** 当前反馈值 */
93
+ value?: FeedbackValue;
94
+ /** 点赞 tooltip */
95
+ likeTooltip?: string;
96
+ /** 点踩 tooltip */
97
+ dislikeTooltip?: string;
98
+ }
99
+ /**
100
+ * MessageActionMore Props
101
+ */
102
+ export interface MessageActionMoreProps {
103
+ /** 操作项列表 */
104
+ items: MoreActionItem[];
105
+ /** Tooltip 文本 */
106
+ tooltip?: string;
107
+ }
@@ -0,0 +1,2 @@
1
+ export { default as MessageBubble } from './message-bubble.vue';
2
+ export * from './types';
@@ -0,0 +1,27 @@
1
+ import type { MessageBubbleProps } from './types';
2
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
3
+ type __VLS_Slots = {} & {
4
+ avatar?: (props: typeof __VLS_1) => any;
5
+ } & {
6
+ header?: (props: typeof __VLS_3) => any;
7
+ } & {
8
+ default?: (props: typeof __VLS_5) => any;
9
+ } & {
10
+ footer?: (props: typeof __VLS_7) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<MessageBubbleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MessageBubbleProps> & Readonly<{}>, {
13
+ variant: "filled" | "outlined" | "borderless";
14
+ loading: boolean;
15
+ placement: "start" | "end";
16
+ width: "auto" | "block";
17
+ streaming: boolean;
18
+ shape: "default" | "round";
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,37 @@
1
+ export interface MessageBubbleProps {
2
+ /**
3
+ * 气泡位置
4
+ * - start: 左对齐(通常用于 assistant)
5
+ * - end: 右对齐(通常用于 user)
6
+ */
7
+ placement?: 'start' | 'end';
8
+ /**
9
+ * 样式变体
10
+ * - filled: 填充背景
11
+ * - outlined: 边框样式
12
+ * - borderless: 无边框
13
+ */
14
+ variant?: 'filled' | 'outlined' | 'borderless';
15
+ /**
16
+ * 形状
17
+ * - default: 默认圆角
18
+ * - round: 更大圆角
19
+ */
20
+ shape?: 'default' | 'round';
21
+ /**
22
+ * 宽度模式
23
+ * - auto: 宽度自适应内容
24
+ * - block: 占满剩余宽度
25
+ *
26
+ * @default 'block'
27
+ */
28
+ width?: 'auto' | 'block';
29
+ /**
30
+ * 加载状态
31
+ */
32
+ loading?: boolean;
33
+ /**
34
+ * 流式传输状态
35
+ */
36
+ streaming?: boolean;
37
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * PartRenderer 组件导出
3
+ */
4
+ export { default as PartRenderer } from './part-renderer.vue';
5
+ export { default } from './part-renderer.vue';
6
+ export type { PartRendererProps, PartRendererRegistry, CodeBlockConfig } from './types';
@@ -0,0 +1,19 @@
1
+ import type { PartRendererProps } from './types';
2
+ declare var __VLS_2: "source" | "text" | "reasoning" | "tool-call" | "file" | "ui", __VLS_3: {
3
+ part: import("@incremark/chat-core").MessagePart;
4
+ streaming: boolean;
5
+ };
6
+ type __VLS_Slots = {} & {
7
+ [K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<PartRendererProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PartRendererProps> & Readonly<{}>, {
10
+ streaming: boolean;
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * PartRenderer 组件类型定义
3
+ */
4
+ import type { Component } from 'vue';
5
+ import type { MessagePart } from '@incremark/chat-core';
6
+ import type { UseIncremarkOptions } from '@incremark/vue';
7
+ /**
8
+ * 代码块配置
9
+ */
10
+ export interface CodeBlockConfig {
11
+ takeOver?: boolean;
12
+ }
13
+ /**
14
+ * Part 组件注册表
15
+ */
16
+ export type PartRendererRegistry = Record<string, Component>;
17
+ /**
18
+ * PartRenderer 组件 Props
19
+ */
20
+ export interface PartRendererProps {
21
+ /** 消息 Part 数据 */
22
+ part: MessagePart;
23
+ /** 是否流式渲染中 */
24
+ streaming?: boolean;
25
+ /** Incremark 渲染选项 */
26
+ incremarkOptions?: UseIncremarkOptions;
27
+ /** 自定义容器组件映射 */
28
+ customContainers?: Record<string, Component>;
29
+ /** 自定义代码块组件映射 */
30
+ customCodeBlocks?: Record<string, Component>;
31
+ /** 代码块配置映射 */
32
+ codeBlockConfigs?: Record<string, CodeBlockConfig>;
33
+ /** 流式渲染中的 pending 文本的 CSS 类名 */
34
+ pendingClass?: string;
35
+ /** 自定义 Part 组件注册表,key 为 part.type */
36
+ parts?: PartRendererRegistry;
37
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * ReasoningMessage 组件导出
3
+ */
4
+ export { default as ReasoningMessage } from './reasoning-message.vue';
5
+ export type { ReasoningMessageProps } from './types';
@@ -0,0 +1,8 @@
1
+ import type { ReasoningMessageProps } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<ReasoningMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ReasoningMessageProps> & Readonly<{}>, {
3
+ blockquote: boolean;
4
+ streaming: boolean;
5
+ plainText: boolean;
6
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * ReasoningMessage 组件类型定义
3
+ */
4
+ import type { Component } from 'vue';
5
+ import type { UseIncremarkOptions } from '@incremark/vue';
6
+ /**
7
+ * 代码块配置
8
+ */
9
+ export interface CodeBlockConfig {
10
+ /** 是否从一开始就接管渲染,而不是等到 completed 状态 */
11
+ takeOver?: boolean;
12
+ }
13
+ /**
14
+ * ReasoningMessage 组件 Props
15
+ *
16
+ * 只负责渲染推理内容(Markdown),不包含折叠逻辑
17
+ * 折叠功能请使用 ChainOfThought 组件包裹
18
+ */
19
+ export interface ReasoningMessageProps {
20
+ /** 推理内容 */
21
+ content: string;
22
+ /** 是否正在流式渲染 */
23
+ streaming?: boolean;
24
+ /** 纯文本模式,不解析 Markdown */
25
+ plainText?: boolean;
26
+ /** 引用块样式 */
27
+ blockquote?: boolean;
28
+ /** Incremark 渲染选项 */
29
+ incremarkOptions?: UseIncremarkOptions;
30
+ /** 自定义容器组件映射 */
31
+ customContainers?: Record<string, Component>;
32
+ /** 自定义代码块组件映射 */
33
+ customCodeBlocks?: Record<string, Component>;
34
+ /** 代码块配置映射 */
35
+ codeBlockConfigs?: Record<string, CodeBlockConfig>;
36
+ /** 流式渲染中的 pending 文本的 CSS 类名 */
37
+ pendingClass?: string;
38
+ }
@@ -0,0 +1,24 @@
1
+ import type { SenderActionButtonProps } from '../types';
2
+ declare var __VLS_11: {}, __VLS_13: {};
3
+ type __VLS_Slots = {} & {
4
+ icon?: (props: typeof __VLS_11) => any;
5
+ } & {
6
+ default?: (props: typeof __VLS_13) => any;
7
+ };
8
+ declare const __VLS_base: import("vue").DefineComponent<SenderActionButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ click: (event: MouseEvent) => any;
10
+ }, string, import("vue").PublicProps, Readonly<SenderActionButtonProps> & Readonly<{
11
+ onClick?: ((event: MouseEvent) => any) | undefined;
12
+ }>, {
13
+ active: boolean;
14
+ disabled: boolean;
15
+ square: boolean;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,11 @@
1
+ import type { SenderAttachment } from '../types';
2
+ type __VLS_Props = {
3
+ attachments: SenderAttachment[];
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ remove: (id: string) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onRemove?: ((id: string) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ /** 接受的文件类型,覆盖 Sender 的 accept */
3
+ accept?: string;
4
+ /** 是否允许多选 */
5
+ multiple?: boolean;
6
+ /** 无障碍标签 */
7
+ ariaLabel?: string;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import type { SenderSubmitButtonProps } from '../types';
2
+ declare var __VLS_10: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_10) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<SenderSubmitButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ click: (event: MouseEvent) => any;
8
+ }, string, import("vue").PublicProps, Readonly<SenderSubmitButtonProps> & Readonly<{
9
+ onClick?: ((event: MouseEvent) => any) | undefined;
10
+ }>, {
11
+ disabled: boolean;
12
+ loading: boolean;
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,2 @@
1
+ export { useSender } from './useSender';
2
+ export type { UseSenderOptions, UseSenderReturn } from './useSender';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * useSender - Sender 组件核心逻辑
3
+ */
4
+ import { type Ref, type ComputedRef } from 'vue';
5
+ import type { SenderProps, SenderEmits, SenderInputRef, SenderAttachment } from '../types';
6
+ export interface UseSenderOptions {
7
+ props: SenderProps;
8
+ emit: SenderEmits;
9
+ modelValue: Ref<string>;
10
+ attachments: Ref<SenderAttachment[]>;
11
+ inputRef: Ref<SenderInputRef | undefined>;
12
+ }
13
+ export interface UseSenderReturn {
14
+ /** 是否可以提交 */
15
+ canSubmit: ComputedRef<boolean>;
16
+ /** 提交消息 */
17
+ submit: () => void;
18
+ /** 取消发送 */
19
+ cancel: () => void;
20
+ /** 聚焦输入框 */
21
+ focus: () => void;
22
+ /** 失焦输入框 */
23
+ blur: () => void;
24
+ /** 清空输入框 */
25
+ clear: () => void;
26
+ /** 添加文件 */
27
+ addFiles: (files: File[]) => void;
28
+ /** 移除附件 */
29
+ removeAttachment: (id: string) => void;
30
+ }
31
+ export declare function useSender(options: UseSenderOptions): UseSenderReturn;
@@ -0,0 +1,7 @@
1
+ export { default as Sender } from './sender.vue';
2
+ export { default as SenderActionButton } from './components/sender-action-button.vue';
3
+ export { default as SenderSubmitButton } from './components/sender-submit-button.vue';
4
+ export { default as SenderFileButton } from './components/sender-file-button.vue';
5
+ export { default as SenderAttachments } from './components/sender-attachments.vue';
6
+ export * from './types';
7
+ export * from './composables';
@@ -0,0 +1,66 @@
1
+ import type { SenderProps, SenderAttachment } from './types';
2
+ type __VLS_Props = SenderProps;
3
+ type __VLS_ModelProps = {
4
+ 'modelValue'?: string;
5
+ 'attachments'?: SenderAttachment[];
6
+ };
7
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
+ declare var __VLS_1: {}, __VLS_3: {
9
+ attachments: SenderAttachment[];
10
+ remove: (id: string) => void;
11
+ }, __VLS_15: {}, __VLS_17: {}, __VLS_26: {};
12
+ type __VLS_Slots = {} & {
13
+ header?: (props: typeof __VLS_1) => any;
14
+ } & {
15
+ attachments?: (props: typeof __VLS_3) => any;
16
+ } & {
17
+ prefix?: (props: typeof __VLS_15) => any;
18
+ } & {
19
+ suffix?: (props: typeof __VLS_17) => any;
20
+ } & {
21
+ footer?: (props: typeof __VLS_26) => any;
22
+ };
23
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
24
+ focus: () => void;
25
+ blur: () => void;
26
+ clear: () => void;
27
+ submit: () => void;
28
+ addFiles: (files: File[]) => void;
29
+ removeAttachment: (id: string) => void;
30
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
+ "update:modelValue": (value: string) => any;
32
+ "update:attachments": (value: SenderAttachment[]) => any;
33
+ } & {
34
+ submit: (message: import("./types").SenderMessage) => any;
35
+ cancel: () => any;
36
+ fileError: (error: {
37
+ type: "type" | "size" | "count";
38
+ file?: File;
39
+ message: string;
40
+ }) => any;
41
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
42
+ onSubmit?: ((message: import("./types").SenderMessage) => any) | undefined;
43
+ onCancel?: (() => any) | undefined;
44
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
45
+ onFileError?: ((error: {
46
+ type: "type" | "size" | "count";
47
+ file?: File;
48
+ message: string;
49
+ }) => any) | undefined;
50
+ "onUpdate:attachments"?: ((value: SenderAttachment[]) => any) | undefined;
51
+ }>, {
52
+ disabled: boolean;
53
+ loading: boolean;
54
+ placeholder: string;
55
+ bordered: boolean;
56
+ submitType: import("./types").SenderSubmitType;
57
+ clearOnSubmit: boolean;
58
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
59
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
60
+ declare const _default: typeof __VLS_export;
61
+ export default _default;
62
+ type __VLS_WithSlots<T, S> = T & {
63
+ new (): {
64
+ $slots: S;
65
+ };
66
+ };