@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.
- package/LICENSE +22 -0
- package/dist/chunk-X3YI3YOK.js +3809 -0
- package/dist/chunk-X3YI3YOK.js.map +1 -0
- package/dist/components/base/action-button/action-button.vue.d.ts +28 -0
- package/dist/components/base/action-button/index.d.ts +5 -0
- package/dist/components/base/action-button/types/index.d.ts +9 -0
- package/dist/components/base/im-button/im-button.vue.d.ts +30 -0
- package/dist/components/base/im-button/index.d.ts +2 -0
- package/dist/components/base/im-button/types/index.d.ts +27 -0
- package/dist/components/base/im-dropdown/im-dropdown.vue.d.ts +24 -0
- package/dist/components/base/im-dropdown/index.d.ts +5 -0
- package/dist/components/base/im-dropdown/types/index.d.ts +27 -0
- package/dist/components/base/im-popover/im-popover.vue.d.ts +38 -0
- package/dist/components/base/im-popover/index.d.ts +2 -0
- package/dist/components/base/im-popover/types/index.d.ts +25 -0
- package/dist/components/base/im-tooltip/im-tooltip.vue.d.ts +20 -0
- package/dist/components/base/im-tooltip/index.d.ts +2 -0
- package/dist/components/base/im-tooltip/types/index.d.ts +12 -0
- package/dist/components/base/index.d.ts +8 -0
- package/dist/components/chain-of-thought/chain-of-thought-step.vue.d.ts +25 -0
- package/dist/components/chain-of-thought/chain-of-thought.vue.d.ts +32 -0
- package/dist/components/chain-of-thought/composables/index.d.ts +4 -0
- package/dist/components/chain-of-thought/composables/useChainOfThought.d.ts +7 -0
- package/dist/components/chain-of-thought/index.d.ts +6 -0
- package/dist/components/chain-of-thought/types/index.d.ts +76 -0
- package/dist/components/error-message/error-message.vue.d.ts +22 -0
- package/dist/components/error-message/index.d.ts +5 -0
- package/dist/components/error-message/types/index.d.ts +22 -0
- package/dist/components/file-preview/composables/index.d.ts +1 -0
- package/dist/components/file-preview/composables/useFileType.d.ts +40 -0
- package/dist/components/file-preview/file-preview.vue.d.ts +13 -0
- package/dist/components/file-preview/index.d.ts +5 -0
- package/dist/components/file-preview/types/index.d.ts +44 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/message-actions/composables/index.d.ts +5 -0
- package/dist/components/message-actions/composables/useCopyAction.d.ts +20 -0
- package/dist/components/message-actions/index.d.ts +11 -0
- package/dist/components/message-actions/message-action-copy.vue.d.ts +7 -0
- package/dist/components/message-actions/message-action-feedback.vue.d.ts +14 -0
- package/dist/components/message-actions/message-action-more.vue.d.ts +10 -0
- package/dist/components/message-actions/message-action.vue.d.ts +21 -0
- package/dist/components/message-actions/message-actions.vue.d.ts +23 -0
- package/dist/components/message-actions/types/index.d.ts +107 -0
- package/dist/components/message-bubble/index.d.ts +2 -0
- package/dist/components/message-bubble/message-bubble.vue.d.ts +27 -0
- package/dist/components/message-bubble/types/index.d.ts +37 -0
- package/dist/components/message-renderer/index.d.ts +6 -0
- package/dist/components/message-renderer/part-renderer.vue.d.ts +19 -0
- package/dist/components/message-renderer/types/index.d.ts +37 -0
- package/dist/components/reasoning-message/index.d.ts +5 -0
- package/dist/components/reasoning-message/reasoning-message.vue.d.ts +8 -0
- package/dist/components/reasoning-message/types/index.d.ts +38 -0
- package/dist/components/sender/components/sender-action-button.vue.d.ts +24 -0
- package/dist/components/sender/components/sender-attachments.vue.d.ts +11 -0
- package/dist/components/sender/components/sender-file-button.vue.d.ts +11 -0
- package/dist/components/sender/components/sender-submit-button.vue.d.ts +21 -0
- package/dist/components/sender/composables/index.d.ts +2 -0
- package/dist/components/sender/composables/useSender.d.ts +31 -0
- package/dist/components/sender/index.d.ts +7 -0
- package/dist/components/sender/sender.vue.d.ts +66 -0
- package/dist/components/sender/types/index.d.ts +174 -0
- package/dist/components/sender-input/index.d.ts +1 -0
- package/dist/components/sender-input/sender-input.vue.d.ts +36 -0
- package/dist/components/sender-input/types/index.d.ts +24 -0
- package/dist/components/source-reference/index.d.ts +5 -0
- package/dist/components/source-reference/source-reference.vue.d.ts +20 -0
- package/dist/components/source-reference/types/index.d.ts +13 -0
- package/dist/components/suggestion/index.d.ts +6 -0
- package/dist/components/suggestion/suggestion-item.vue.d.ts +21 -0
- package/dist/components/suggestion/suggestion.vue.d.ts +22 -0
- package/dist/components/suggestion/types/index.d.ts +27 -0
- package/dist/components/svg-icon/index.d.ts +1 -0
- package/dist/components/svg-icon/svg-icon.vue.d.ts +13 -0
- package/dist/components/text-message/index.d.ts +5 -0
- package/dist/components/text-message/text-message.vue.d.ts +6 -0
- package/dist/components/text-message/types/index.d.ts +32 -0
- package/dist/components/tool-call/index.d.ts +5 -0
- package/dist/components/tool-call/tool-call.vue.d.ts +18 -0
- package/dist/components/tool-call/types/index.d.ts +81 -0
- package/dist/components/welcome/index.d.ts +5 -0
- package/dist/components/welcome/types/index.d.ts +19 -0
- package/dist/components/welcome/welcome.vue.d.ts +28 -0
- package/dist/components.js +3 -0
- package/dist/components.js.map +1 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/useCollapsible.d.ts +4 -0
- package/dist/composables/useUIAdapter.d.ts +14 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/provider/ChatProvider.vue.d.ts +14 -0
- package/dist/provider/index.d.ts +4 -0
- package/dist/types/adapter.d.ts +64 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/message.d.ts +5 -0
- package/dist/types/parts.d.ts +5 -0
- package/package.json +83 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ActionButtonProps } 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<ActionButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
click: (event: MouseEvent) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<ActionButtonProps> & Readonly<{
|
|
11
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
circle: boolean;
|
|
14
|
+
active: boolean;
|
|
15
|
+
size: import("../../../types/adapter").ButtonSize;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
square: boolean;
|
|
19
|
+
intent: import("../../../types/adapter").ButtonIntent;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ImButtonProps } from './types';
|
|
2
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
icon?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
default?: (props: typeof __VLS_3) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<ImButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
click: (event: MouseEvent) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<ImButtonProps> & Readonly<{
|
|
11
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
circle: boolean;
|
|
14
|
+
active: boolean;
|
|
15
|
+
variant: import("./types").ButtonVariant;
|
|
16
|
+
color: import("./types").ButtonColor;
|
|
17
|
+
size: import("./types").ButtonSize;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
loading: boolean;
|
|
20
|
+
block: boolean;
|
|
21
|
+
square: boolean;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Button 变体 */
|
|
2
|
+
export type ButtonVariant = 'solid' | 'outline' | 'soft' | 'subtle' | 'ghost' | 'link';
|
|
3
|
+
/** Button 颜色 */
|
|
4
|
+
export type ButtonColor = 'primary' | 'neutral' | 'success' | 'warning' | 'error';
|
|
5
|
+
/** Button 尺寸 */
|
|
6
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
/** Button 组件 Props */
|
|
8
|
+
export interface ImButtonProps {
|
|
9
|
+
/** 变体样式 */
|
|
10
|
+
variant?: ButtonVariant;
|
|
11
|
+
/** 颜色主题 */
|
|
12
|
+
color?: ButtonColor;
|
|
13
|
+
/** 尺寸 */
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
/** 禁用状态 */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** 加载状态 */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
/** 块级按钮(占满宽度) */
|
|
20
|
+
block?: boolean;
|
|
21
|
+
/** 方形按钮(等宽高) */
|
|
22
|
+
square?: boolean;
|
|
23
|
+
/** 圆形按钮 */
|
|
24
|
+
circle?: boolean;
|
|
25
|
+
/** 激活/选中状态 */
|
|
26
|
+
active?: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ImDropdownProps, DropdownItem } from './types';
|
|
2
|
+
declare var __VLS_8: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_8) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<ImDropdownProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
select: (item: DropdownItem) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<ImDropdownProps> & Readonly<{
|
|
9
|
+
onSelect?: ((item: DropdownItem) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
placement: import("@floating-ui/vue").Placement;
|
|
13
|
+
offset: number;
|
|
14
|
+
to: string | HTMLElement | (() => HTMLElement);
|
|
15
|
+
teleportDisabled: 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,27 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/vue';
|
|
2
|
+
import type { TeleportProps } from '../../im-popover';
|
|
3
|
+
import type { Component } from 'vue';
|
|
4
|
+
/** 下拉菜单项 */
|
|
5
|
+
export interface DropdownItem {
|
|
6
|
+
/** 唯一标识 */
|
|
7
|
+
key: string;
|
|
8
|
+
/** 显示文本 */
|
|
9
|
+
label: string;
|
|
10
|
+
/** 图标(可选)- Vue 组件 */
|
|
11
|
+
icon?: Component;
|
|
12
|
+
/** 是否禁用 */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** 是否为分割线 */
|
|
15
|
+
divider?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Dropdown 组件 Props */
|
|
18
|
+
export interface ImDropdownProps extends TeleportProps {
|
|
19
|
+
/** 菜单项列表 */
|
|
20
|
+
items: DropdownItem[];
|
|
21
|
+
/** 位置 */
|
|
22
|
+
placement?: Placement;
|
|
23
|
+
/** 偏移量 */
|
|
24
|
+
offset?: number;
|
|
25
|
+
/** 是否禁用 */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ImPopoverProps } from './types';
|
|
2
|
+
type __VLS_Props = ImPopoverProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
'visible'?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare var __VLS_1: {}, __VLS_15: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
} & {
|
|
11
|
+
content?: (props: typeof __VLS_15) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
14
|
+
show: () => void;
|
|
15
|
+
hide: () => void;
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:visible": (value: boolean) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
trigger: import("./types").PopoverTrigger;
|
|
24
|
+
placement: import("@floating-ui/vue").Placement;
|
|
25
|
+
offset: number;
|
|
26
|
+
arrow: boolean;
|
|
27
|
+
strategy: "absolute" | "fixed";
|
|
28
|
+
to: string | HTMLElement | (() => HTMLElement);
|
|
29
|
+
teleportDisabled: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/vue';
|
|
2
|
+
/** 通用 Teleport 配置 */
|
|
3
|
+
export interface TeleportProps {
|
|
4
|
+
/** Teleport 目标,默认 'body' */
|
|
5
|
+
to?: string | HTMLElement | (() => HTMLElement);
|
|
6
|
+
/** 是否禁用 Teleport(SSR 时设为 true) */
|
|
7
|
+
teleportDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Popover 触发方式 */
|
|
10
|
+
export type PopoverTrigger = 'hover' | 'click' | 'focus' | 'manual';
|
|
11
|
+
/** Popover 组件 Props */
|
|
12
|
+
export interface ImPopoverProps extends TeleportProps {
|
|
13
|
+
/** 触发方式 */
|
|
14
|
+
trigger?: PopoverTrigger;
|
|
15
|
+
/** 位置 */
|
|
16
|
+
placement?: Placement;
|
|
17
|
+
/** 偏移量 */
|
|
18
|
+
offset?: number;
|
|
19
|
+
/** 是否显示箭头 */
|
|
20
|
+
arrow?: boolean;
|
|
21
|
+
/** 是否禁用 */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** 定位策略 */
|
|
24
|
+
strategy?: 'absolute' | 'fixed';
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ImTooltipProps } from './types';
|
|
2
|
+
declare var __VLS_8: {}, __VLS_11: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_8) => any;
|
|
5
|
+
} & {
|
|
6
|
+
default?: (props: typeof __VLS_11) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<ImTooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImTooltipProps> & Readonly<{}>, {
|
|
9
|
+
placement: import("@floating-ui/vue").Placement;
|
|
10
|
+
to: string | HTMLElement | (() => HTMLElement);
|
|
11
|
+
teleportDisabled: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/vue';
|
|
2
|
+
/** Tooltip 组件 Props */
|
|
3
|
+
export interface ImTooltipProps {
|
|
4
|
+
/** 提示内容 */
|
|
5
|
+
content?: string;
|
|
6
|
+
/** 位置 */
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
/** Teleport 目标,默认 'body' */
|
|
9
|
+
to?: string | HTMLElement | (() => HTMLElement);
|
|
10
|
+
/** 是否禁用 Teleport(SSR 时设为 true) */
|
|
11
|
+
teleportDisabled?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 基础组件导出
|
|
3
|
+
*/
|
|
4
|
+
export { ImButton, type ImButtonProps } from './im-button';
|
|
5
|
+
export { ImPopover, type ImPopoverProps, type PopoverTrigger, type TeleportProps } from './im-popover';
|
|
6
|
+
export { ImTooltip, type ImTooltipProps } from './im-tooltip';
|
|
7
|
+
export { ImDropdown, type ImDropdownProps, type DropdownItem } from './im-dropdown';
|
|
8
|
+
export { ActionButton, type ActionButtonProps, type ActionButtonOptions } from './action-button';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ChainOfThoughtStepProps } from './types';
|
|
2
|
+
declare var __VLS_7: {}, __VLS_29: {}, __VLS_42: {}, __VLS_44: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
icon?: (props: typeof __VLS_7) => any;
|
|
5
|
+
} & {
|
|
6
|
+
header?: (props: typeof __VLS_29) => any;
|
|
7
|
+
} & {
|
|
8
|
+
default?: (props: typeof __VLS_42) => any;
|
|
9
|
+
} & {
|
|
10
|
+
footer?: (props: typeof __VLS_44) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<ChainOfThoughtStepProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChainOfThoughtStepProps> & Readonly<{}>, {
|
|
13
|
+
status: import("./types").StepStatus;
|
|
14
|
+
showDivider: boolean;
|
|
15
|
+
collapsible: boolean;
|
|
16
|
+
defaultExpanded: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ChainOfThoughtProps } from './types';
|
|
2
|
+
type __VLS_Props = ChainOfThoughtProps;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
'expanded'?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare var __VLS_7: {}, __VLS_20: {}, __VLS_50: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
'loading-icon'?: (props: typeof __VLS_7) => any;
|
|
10
|
+
} & {
|
|
11
|
+
icon?: (props: typeof __VLS_20) => any;
|
|
12
|
+
} & {
|
|
13
|
+
default?: (props: typeof __VLS_50) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:expanded": (value: boolean) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
+
"onUpdate:expanded"?: ((value: boolean) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
title: string;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
loadingAnimation: import("./types").LoadingAnimation;
|
|
23
|
+
locale: string;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChainOfThought 组件导出
|
|
3
|
+
*/
|
|
4
|
+
export { default as ChainOfThought } from './chain-of-thought.vue';
|
|
5
|
+
export { default as ChainOfThoughtStep } from './chain-of-thought-step.vue';
|
|
6
|
+
export type { ChainOfThoughtProps, ChainOfThoughtStepProps, StepStatus, StepData, ComponentRegistry, } from './types';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChainOfThought 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
import type { Component } from 'vue';
|
|
5
|
+
/**
|
|
6
|
+
* 步骤状态 - 控制图标颜色
|
|
7
|
+
*/
|
|
8
|
+
export type StepStatus = 'pending' | 'active' | 'complete' | 'error';
|
|
9
|
+
/**
|
|
10
|
+
* Loading 动画类型
|
|
11
|
+
*/
|
|
12
|
+
export type LoadingAnimation = 'pulse' | 'spin';
|
|
13
|
+
/**
|
|
14
|
+
* ChainOfThoughtStep Props
|
|
15
|
+
* 纯壳子组件,只负责布局和竖线
|
|
16
|
+
*/
|
|
17
|
+
export interface ChainOfThoughtStepProps {
|
|
18
|
+
/** 步骤标题/标签 */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** 步骤状态,控制图标颜色 */
|
|
21
|
+
status?: StepStatus;
|
|
22
|
+
/** 是否显示连接下一步的竖线 */
|
|
23
|
+
showDivider?: boolean;
|
|
24
|
+
/** 是否可折叠 */
|
|
25
|
+
collapsible?: boolean;
|
|
26
|
+
/** 默认是否展开(仅 collapsible 为 true 时有效) */
|
|
27
|
+
defaultExpanded?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Step 数据结构(用于 steps prop)
|
|
31
|
+
*/
|
|
32
|
+
export interface StepData<T = unknown> {
|
|
33
|
+
/** 步骤类型,用于匹配注册的组件 */
|
|
34
|
+
type: string;
|
|
35
|
+
/** 步骤标题/标签 */
|
|
36
|
+
label?: string;
|
|
37
|
+
/** 步骤状态 */
|
|
38
|
+
status?: StepStatus;
|
|
39
|
+
/** 是否显示竖线 */
|
|
40
|
+
showDivider?: boolean;
|
|
41
|
+
/** 是否可折叠 */
|
|
42
|
+
collapsible?: boolean;
|
|
43
|
+
/** 默认是否展开 */
|
|
44
|
+
defaultExpanded?: boolean;
|
|
45
|
+
/** 自定义图标组件 */
|
|
46
|
+
icon?: Component;
|
|
47
|
+
/** 传递给步骤组件的数据 */
|
|
48
|
+
data?: T;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 组件注册表类型
|
|
52
|
+
*/
|
|
53
|
+
export type ComponentRegistry = Record<string, Component>;
|
|
54
|
+
/**
|
|
55
|
+
* ChainOfThought 容器 Props
|
|
56
|
+
*/
|
|
57
|
+
export interface ChainOfThoughtProps {
|
|
58
|
+
/** 标题 */
|
|
59
|
+
title?: string;
|
|
60
|
+
/** 是否显示加载状态图标 */
|
|
61
|
+
loading?: boolean;
|
|
62
|
+
/** Loading 动画类型 */
|
|
63
|
+
loadingAnimation?: LoadingAnimation;
|
|
64
|
+
/** 思考开始时间(毫秒时间戳) */
|
|
65
|
+
startTime?: number;
|
|
66
|
+
/** 思考结束时间(毫秒时间戳) */
|
|
67
|
+
endTime?: number;
|
|
68
|
+
/** 语言环境,用于时长格式化 */
|
|
69
|
+
locale?: string;
|
|
70
|
+
/** 步骤数据数组(可选,与 slot 二选一) */
|
|
71
|
+
steps?: StepData[];
|
|
72
|
+
/** 组件注册表,将 type 映射到组件 */
|
|
73
|
+
components?: ComponentRegistry;
|
|
74
|
+
/** 内容区域最大高度,超出时滚动 */
|
|
75
|
+
maxHeight?: string | number;
|
|
76
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ErrorMessageProps, ErrorType } from './types';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
icon?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<ErrorMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
retry: () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<ErrorMessageProps> & Readonly<{
|
|
9
|
+
onRetry?: (() => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
type: ErrorType;
|
|
12
|
+
retryable: boolean;
|
|
13
|
+
retryText: string;
|
|
14
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ErrorMessage 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 错误类型
|
|
6
|
+
*/
|
|
7
|
+
export type ErrorType = 'network' | 'rate-limit' | 'server' | 'auth' | 'unknown';
|
|
8
|
+
/**
|
|
9
|
+
* ErrorMessage 组件 Props
|
|
10
|
+
*/
|
|
11
|
+
export interface ErrorMessageProps {
|
|
12
|
+
/** 错误标题 */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** 错误消息 */
|
|
15
|
+
message: string;
|
|
16
|
+
/** 错误类型 */
|
|
17
|
+
type?: ErrorType;
|
|
18
|
+
/** 是否显示重试按钮 */
|
|
19
|
+
retryable?: boolean;
|
|
20
|
+
/** 重试按钮文本 */
|
|
21
|
+
retryText?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useFileType';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文件类型判断和图标映射 composable
|
|
3
|
+
*/
|
|
4
|
+
import { type Ref } from 'vue';
|
|
5
|
+
import type { FileCategory } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* 文件类型配置
|
|
8
|
+
*/
|
|
9
|
+
export interface FileTypeConfig {
|
|
10
|
+
/** 文件分类 */
|
|
11
|
+
category: FileCategory;
|
|
12
|
+
/** 图标名称(Iconify) */
|
|
13
|
+
icon: string;
|
|
14
|
+
/** 主题颜色 */
|
|
15
|
+
color: string;
|
|
16
|
+
/** 背景颜色 */
|
|
17
|
+
bgColor: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 判断文件分类
|
|
21
|
+
*/
|
|
22
|
+
export declare function getFileCategory(mimeType?: string, filename?: string): FileCategory;
|
|
23
|
+
/**
|
|
24
|
+
* 获取文件类型配置
|
|
25
|
+
*/
|
|
26
|
+
export declare function getFileTypeConfig(mimeType?: string, filename?: string): FileTypeConfig;
|
|
27
|
+
/**
|
|
28
|
+
* 文件类型 composable
|
|
29
|
+
*/
|
|
30
|
+
export declare function useFileType(mimeType: Ref<string | undefined>, filename: Ref<string | undefined>): {
|
|
31
|
+
config: import("vue").ComputedRef<FileTypeConfig>;
|
|
32
|
+
category: import("vue").ComputedRef<FileCategory>;
|
|
33
|
+
icon: import("vue").ComputedRef<string>;
|
|
34
|
+
color: import("vue").ComputedRef<string>;
|
|
35
|
+
bgColor: import("vue").ComputedRef<string>;
|
|
36
|
+
isImage: import("vue").ComputedRef<boolean>;
|
|
37
|
+
isVideo: import("vue").ComputedRef<boolean>;
|
|
38
|
+
isAudio: import("vue").ComputedRef<boolean>;
|
|
39
|
+
isPreviewable: import("vue").ComputedRef<boolean>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FilePreviewProps } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<FilePreviewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
remove: () => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<FilePreviewProps> & Readonly<{
|
|
5
|
+
onRemove?: (() => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
maxHeight: number;
|
|
8
|
+
maxWidth: number;
|
|
9
|
+
compact: boolean;
|
|
10
|
+
removable: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FilePreview 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
import type { FilePart } from '@incremark/chat-core';
|
|
5
|
+
/**
|
|
6
|
+
* 文件类型分类
|
|
7
|
+
*/
|
|
8
|
+
export type FileCategory = 'image' | 'video' | 'audio' | 'pdf' | 'word' | 'excel' | 'ppt' | 'archive' | 'code' | 'text' | 'unknown';
|
|
9
|
+
/**
|
|
10
|
+
* 文件信息(用于 SenderAttachment 等场景)
|
|
11
|
+
*/
|
|
12
|
+
export interface FileInfo {
|
|
13
|
+
/** 文件名 */
|
|
14
|
+
name: string;
|
|
15
|
+
/** MIME 类型 */
|
|
16
|
+
type?: string;
|
|
17
|
+
/** 文件大小(字节) */
|
|
18
|
+
size?: number;
|
|
19
|
+
/** 预览 URL(图片/视频等) */
|
|
20
|
+
url?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* FilePreview 组件 Props
|
|
24
|
+
*/
|
|
25
|
+
export interface FilePreviewProps {
|
|
26
|
+
/** 文件 Part 数据(消息渲染场景) */
|
|
27
|
+
part?: FilePart;
|
|
28
|
+
/** 文件信息(附件预览场景) */
|
|
29
|
+
file?: FileInfo;
|
|
30
|
+
/** 最大预览宽度 */
|
|
31
|
+
maxWidth?: number;
|
|
32
|
+
/** 最大预览高度 */
|
|
33
|
+
maxHeight?: number;
|
|
34
|
+
/** 紧凑模式(用于附件列表) */
|
|
35
|
+
compact?: boolean;
|
|
36
|
+
/** 是否可删除 */
|
|
37
|
+
removable?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* FilePreview 组件 Emits
|
|
41
|
+
*/
|
|
42
|
+
export interface FilePreviewEmits {
|
|
43
|
+
(e: 'remove'): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组件导出入口
|
|
3
|
+
*/
|
|
4
|
+
export { SvgIcon } from './svg-icon';
|
|
5
|
+
export { ChainOfThought, ChainOfThoughtStep } from './chain-of-thought';
|
|
6
|
+
export type { ChainOfThoughtProps, ChainOfThoughtStepProps, StepStatus } from './chain-of-thought';
|
|
7
|
+
export { TextMessage } from './text-message';
|
|
8
|
+
export type { TextMessageProps } from './text-message';
|
|
9
|
+
export { ReasoningMessage } from './reasoning-message';
|
|
10
|
+
export type { ReasoningMessageProps } from './reasoning-message';
|
|
11
|
+
export { PartRenderer } from './message-renderer';
|
|
12
|
+
export type { PartRendererProps, PartRendererRegistry, CodeBlockConfig } from './message-renderer';
|
|
13
|
+
export { ToolCall } from './tool-call';
|
|
14
|
+
export type { ToolCallProps, ToolRendererProps, ToolRendererRegistry, OutputRendererProps, OutputRendererRegistry, StateLabels, StateCategories } from './tool-call';
|
|
15
|
+
export { SourceReference } from './source-reference';
|
|
16
|
+
export type { SourceReferenceProps } from './source-reference';
|
|
17
|
+
export { FilePreview } from './file-preview';
|
|
18
|
+
export type { FilePreviewProps } from './file-preview';
|
|
19
|
+
export { MessageBubble } from './message-bubble';
|
|
20
|
+
export type { MessageBubbleProps } from './message-bubble';
|
|
21
|
+
export { MessageActions, MessageAction, MessageActionCopy, MessageActionFeedback, useCopyAction } from './message-actions';
|
|
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';
|
|
26
|
+
export type { SenderProps, SenderEmits, SenderMessage, SenderAttachment, SenderContext, SenderSubmitButtonProps, SenderActionButtonProps } from './sender';
|
|
27
|
+
export { SenderInput } from './sender-input';
|
|
28
|
+
export type { SenderInputProps, SenderInputEmits, SenderSubmitType } from './sender-input/types';
|
|
29
|
+
export { Suggestion, SuggestionItem } from './suggestion';
|
|
30
|
+
export type { SuggestionProps, SuggestionItem as SuggestionItemType } from './suggestion';
|
|
31
|
+
export { ErrorMessage } from './error-message';
|
|
32
|
+
export type { ErrorMessageProps, ErrorType } from './error-message';
|
|
33
|
+
export { Welcome } from './welcome';
|
|
34
|
+
export type { WelcomeProps } from './welcome';
|