@incremark/chat-vue 0.4.0-alpha.1 → 1.0.0

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.
@@ -20,15 +20,19 @@ export { MessageBubble } from './message-bubble';
20
20
  export type { MessageBubbleProps } from './message-bubble';
21
21
  export { MessageActions, MessageAction, MessageActionCopy, MessageActionFeedback, useCopyAction } from './message-actions';
22
22
  export type { MessageActionsProps, MessageActionProps, MessageActionCopyProps, MessageActionFeedbackProps, FeedbackValue, UseCopyActionOptions, UseCopyActionReturn } from './message-actions';
23
- export { ImButton, ImTooltip } from './base';
24
- export type { ImButtonProps, ImTooltipProps } from './base';
25
- export { Sender, SenderActionButton, SenderSubmitButton, useSender } from './sender';
23
+ export { ImButton, ImTooltip, ImDropdown } from './base';
24
+ export type { ImButtonProps, ImTooltipProps, ImDropdownProps, DropdownItem } from './base';
25
+ export { Sender, SenderActionButton, SenderSubmitButton, SenderFileButton, SenderAttachments, useSender } from './sender';
26
26
  export type { SenderProps, SenderEmits, SenderMessage, SenderAttachment, SenderContext, SenderSubmitButtonProps, SenderActionButtonProps } from './sender';
27
27
  export { SenderInput } from './sender-input';
28
28
  export type { SenderInputProps, SenderInputEmits, SenderSubmitType } from './sender-input/types';
29
29
  export { Suggestion, SuggestionItem } from './suggestion';
30
- export type { SuggestionProps, SuggestionItem as SuggestionItemType } from './suggestion';
30
+ export type { SuggestionProps, SuggestionItem as SuggestionItemData } from './suggestion';
31
31
  export { ErrorMessage } from './error-message';
32
32
  export type { ErrorMessageProps, ErrorType } from './error-message';
33
33
  export { Welcome } from './welcome';
34
34
  export type { WelcomeProps } from './welcome';
35
+ export { MessageList } from './message-list';
36
+ export type { MessageListProps, MessageListExposed } from './message-list';
37
+ export { IncremarkCode, IncremarkContent } from '@incremark/vue';
38
+ export type { ComponentMap, IncremarkContentProps } from '@incremark/vue';
@@ -16,6 +16,7 @@ declare const __VLS_base: import("vue").DefineComponent<MessageBubbleProps, {},
16
16
  width: "auto" | "block";
17
17
  streaming: boolean;
18
18
  shape: "default" | "round";
19
+ fillTheme: "default" | "primary";
19
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
21
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
22
  declare const _default: typeof __VLS_export;
@@ -26,6 +26,14 @@ export interface MessageBubbleProps {
26
26
  * @default 'block'
27
27
  */
28
28
  width?: 'auto' | 'block';
29
+ /**
30
+ * 填充主题(仅 variant="filled" 时生效)
31
+ * - default: 默认灰色背景
32
+ * - primary: 品牌主色背景 + 反色文字
33
+ *
34
+ * @default 'default'
35
+ */
36
+ fillTheme?: 'default' | 'primary';
29
37
  /**
30
38
  * 加载状态
31
39
  */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MessageList 组件导出
3
+ */
4
+ export { default as MessageList } from './message-list.vue';
5
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ import type { MessageListProps, MessageListExposed } from './types';
2
+ declare var __VLS_9: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_9) => any;
5
+ };
6
+ declare const __VLS_base: import("vue").DefineComponent<MessageListProps, MessageListExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MessageListProps> & Readonly<{}>, {
7
+ autoScroll: boolean;
8
+ autoScrollThreshold: number;
9
+ scrollBehavior: ScrollBehavior;
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * MessageList 组件类型定义
3
+ */
4
+ /**
5
+ * MessageList 组件 Props
6
+ *
7
+ * 纯滚动容器,封装 AutoScrollContainer,向外暴露 auto-scroll 相关 props 和 scrollToBottom 方法。
8
+ */
9
+ export interface MessageListProps {
10
+ /** 是否启用自动滚动(默认 true) */
11
+ autoScroll?: boolean;
12
+ /** 触发自动滚动的底部阈值(像素,默认 50) */
13
+ autoScrollThreshold?: number;
14
+ /** 滚动行为 */
15
+ scrollBehavior?: ScrollBehavior;
16
+ }
17
+ /**
18
+ * MessageList 暴露的方法
19
+ */
20
+ export interface MessageListExposed {
21
+ /** 强制滚动到底部 */
22
+ scrollToBottom: () => void;
23
+ /** 是否用户手动向上滚动了 */
24
+ isUserScrolledUp: () => boolean;
25
+ }
@@ -27,6 +27,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
27
27
  submit: () => void;
28
28
  addFiles: (files: File[]) => void;
29
29
  removeAttachment: (id: string) => void;
30
+ getEditor: () => import("@tiptap/vue-3").Editor | undefined;
30
31
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
32
  "update:modelValue": (value: string) => any;
32
33
  "update:attachments": (value: SenderAttachment[]) => any;
@@ -2,6 +2,7 @@
2
2
  * Sender 组件类型定义
3
3
  */
4
4
  import type { Ref } from 'vue';
5
+ import type { Editor, AnyExtension } from '@tiptap/vue-3';
5
6
  /**
6
7
  * 提交类型
7
8
  * - enter: 按 Enter 发送,Shift+Enter 换行
@@ -34,6 +35,8 @@ export interface SenderMessage {
34
35
  content: string;
35
36
  /** 附件列表 */
36
37
  attachments?: SenderAttachment[];
38
+ /** 元数据(如 mention 引用的档案数据等) */
39
+ metadata?: Record<string, unknown>;
37
40
  }
38
41
  /**
39
42
  * Sender 组件 Props
@@ -55,6 +58,8 @@ export interface SenderProps {
55
58
  maxHeight?: string | number;
56
59
  /** 提交方式 */
57
60
  submitType?: SenderSubmitType;
61
+ /** 额外的 TipTap 扩展,透传给 SenderInput */
62
+ extensions?: AnyExtension[];
58
63
  /** 是否在发送后清空输入框 */
59
64
  clearOnSubmit?: boolean;
60
65
  /** 接受的文件类型,如 'image/*,.pdf' */
@@ -125,6 +130,8 @@ export interface SenderInputProps {
125
130
  maxHeight?: string | number;
126
131
  /** 提交方式 */
127
132
  submitType?: SenderSubmitType;
133
+ /** 额外的 TipTap 扩展 */
134
+ extensions?: AnyExtension[];
128
135
  }
129
136
  /**
130
137
  * SenderInput Emits
@@ -171,4 +178,6 @@ export interface SenderInputRef {
171
178
  clear: () => void;
172
179
  /** 插入文本 */
173
180
  insert: (text: string) => void;
181
+ /** 获取 TipTap Editor 实例 */
182
+ getEditor: () => Editor | undefined;
174
183
  }
@@ -9,6 +9,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
9
9
  blur: () => void;
10
10
  clear: () => void;
11
11
  insert: (text: string) => void;
12
+ getEditor: () => import("@tiptap/vue-3").Editor | undefined;
12
13
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
14
  "update:modelValue": (value: string) => any;
14
15
  } & {
@@ -28,6 +29,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
28
29
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
29
30
  }>, {
30
31
  disabled: boolean;
32
+ extensions: import("@tiptap/core").AnyExtension[];
31
33
  placeholder: string;
32
34
  bordered: boolean;
33
35
  submitType: import("./types").SenderSubmitType;
@@ -1,3 +1,4 @@
1
+ import type { AnyExtension } from '@tiptap/vue-3';
1
2
  /**
2
3
  * 提交类型
3
4
  * - enter: 按 Enter 发送,Shift+Enter 换行
@@ -12,6 +13,8 @@ export interface SenderInputProps {
12
13
  maxHeight?: string | number;
13
14
  /** 提交方式 */
14
15
  submitType?: SenderSubmitType;
16
+ /** 额外的 TipTap 扩展,会与内置扩展合并 */
17
+ extensions?: AnyExtension[];
15
18
  }
16
19
  export interface SenderInputEmits {
17
20
  (e: 'focus', event: FocusEvent): void;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { Component } from 'vue';
5
5
  import type { TextPart } from '@incremark/chat-core';
6
- import type { UseIncremarkOptions } from '@incremark/vue';
6
+ import type { UseIncremarkOptions, ComponentMap } from '@incremark/vue';
7
7
  /**
8
8
  * 代码块配置
9
9
  */
@@ -21,6 +21,8 @@ export interface TextMessageProps {
21
21
  streaming?: boolean;
22
22
  /** Incremark 渲染选项 */
23
23
  incremarkOptions?: UseIncremarkOptions;
24
+ /** 覆盖 Incremark 默认的节点类型渲染组件 */
25
+ components?: ComponentMap;
24
26
  /** 自定义容器组件映射 */
25
27
  customContainers?: Record<string, Component>;
26
28
  /** 自定义代码块组件映射 */