rt-chat-messages 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.
@@ -0,0 +1,11 @@
1
+ interface AgentStep {
2
+ name: string;
3
+ displayName: string;
4
+ status: "running" | "completed" | "error";
5
+ startTime?: number;
6
+ }
7
+ type __VLS_Props = {
8
+ steps: AgentStep[];
9
+ };
10
+ declare const _default: 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>;
11
+ export default _default;
@@ -0,0 +1,72 @@
1
+ interface ChatMessage {
2
+ id?: string;
3
+ role: string;
4
+ content: string;
5
+ metadata?: string | any;
6
+ attachments?: any[];
7
+ create_time?: string;
8
+ [key: string]: any;
9
+ }
10
+ interface AgentStep {
11
+ name: string;
12
+ displayName: string;
13
+ status: "running" | "completed" | "error";
14
+ startTime?: number;
15
+ }
16
+ interface Props {
17
+ messages: ChatMessage[];
18
+ isStreaming?: boolean;
19
+ isTyping?: boolean;
20
+ showWelcome?: boolean;
21
+ appName?: string;
22
+ appLogo?: string;
23
+ agentSteps?: AgentStep[];
24
+ showAgentSteps?: boolean;
25
+ autoScroll?: boolean;
26
+ contentPaddingTop?: string;
27
+ contentPaddingBottom?: string;
28
+ showBackground?: boolean;
29
+ }
30
+ declare function __VLS_template(): {
31
+ attrs: Partial<{}>;
32
+ slots: {
33
+ welcome?(_: {}): any;
34
+ };
35
+ refs: {
36
+ containerRef: HTMLDivElement;
37
+ };
38
+ rootEl: HTMLDivElement;
39
+ };
40
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
41
+ declare const __VLS_component: import('vue').DefineComponent<Props, {
42
+ scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
43
+ containerRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
44
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
45
+ copy: (...args: any[]) => void;
46
+ scroll: (...args: any[]) => void;
47
+ "scroll-bottom": (...args: any[]) => void;
48
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
49
+ onCopy?: ((...args: any[]) => any) | undefined;
50
+ onScroll?: ((...args: any[]) => any) | undefined;
51
+ "onScroll-bottom"?: ((...args: any[]) => any) | undefined;
52
+ }>, {
53
+ isStreaming: boolean;
54
+ messages: ChatMessage[];
55
+ isTyping: boolean;
56
+ showWelcome: boolean;
57
+ appName: string;
58
+ showAgentSteps: boolean;
59
+ autoScroll: boolean;
60
+ contentPaddingTop: string;
61
+ contentPaddingBottom: string;
62
+ showBackground: boolean;
63
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
64
+ containerRef: HTMLDivElement;
65
+ }, HTMLDivElement>;
66
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
67
+ export default _default;
68
+ type __VLS_WithTemplateSlots<T, S> = T & {
69
+ new (): {
70
+ $slots: S;
71
+ };
72
+ };
@@ -0,0 +1,11 @@
1
+ interface Props {
2
+ content: string;
3
+ isStreaming?: boolean;
4
+ }
5
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
6
+ isStreaming: boolean;
7
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
8
+ markdownContainer: HTMLDivElement;
9
+ markdownContent: HTMLDivElement;
10
+ }, HTMLDivElement>;
11
+ export default _default;
@@ -0,0 +1,25 @@
1
+ interface FileAttachment {
2
+ name: string;
3
+ size: number;
4
+ type: string;
5
+ fileType?: string;
6
+ }
7
+ interface MultimodalMessageData {
8
+ id?: string;
9
+ content?: string;
10
+ metadata?: string;
11
+ role?: string;
12
+ content_type?: string;
13
+ create_time?: string;
14
+ attachments?: FileAttachment[];
15
+ }
16
+ interface Props {
17
+ message: MultimodalMessageData;
18
+ isUser?: boolean;
19
+ isStreaming?: boolean;
20
+ }
21
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
22
+ isStreaming: boolean;
23
+ isUser: boolean;
24
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
25
+ export default _default;
@@ -0,0 +1,34 @@
1
+ interface Props {
2
+ type?: "primary" | "default" | "danger" | "text";
3
+ size?: "small" | "default" | "large";
4
+ circle?: boolean;
5
+ disabled?: boolean;
6
+ loading?: boolean;
7
+ }
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ default?(_: {}): any;
12
+ };
13
+ refs: {};
14
+ rootEl: HTMLButtonElement;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ click: (...args: any[]) => void;
19
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
20
+ onClick?: ((...args: any[]) => any) | undefined;
21
+ }>, {
22
+ type: "primary" | "default" | "danger" | "text";
23
+ disabled: boolean;
24
+ circle: boolean;
25
+ size: "small" | "default" | "large";
26
+ loading: boolean;
27
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
28
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
29
+ export default _default;
30
+ type __VLS_WithTemplateSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,38 @@
1
+ interface Props {
2
+ visible?: boolean;
3
+ width?: string;
4
+ fullscreen?: boolean;
5
+ showClose?: boolean;
6
+ closeOnClickModal?: boolean;
7
+ appendToBody?: boolean;
8
+ }
9
+ declare function __VLS_template(): {
10
+ attrs: Partial<{}>;
11
+ slots: {
12
+ default?(_: {}): any;
13
+ };
14
+ refs: {};
15
+ rootEl: any;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
+ "update:visible": (...args: any[]) => void;
20
+ close: (...args: any[]) => void;
21
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
22
+ "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
23
+ onClose?: ((...args: any[]) => any) | undefined;
24
+ }>, {
25
+ visible: boolean;
26
+ width: string;
27
+ fullscreen: boolean;
28
+ showClose: boolean;
29
+ closeOnClickModal: boolean;
30
+ appendToBody: boolean;
31
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
33
+ export default _default;
34
+ type __VLS_WithTemplateSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
@@ -0,0 +1,14 @@
1
+ import { Component } from 'vue';
2
+ export declare const Close: Component;
3
+ export declare const ZoomIn: Component;
4
+ export declare const ZoomOut: Component;
5
+ export declare const Document: Component;
6
+ export declare const Download: Component;
7
+ export declare const VideoPlay: Component;
8
+ export declare const VideoPause: Component;
9
+ export declare const ArrowLeft: Component;
10
+ export declare const ArrowRight: Component;
11
+ export declare const Spinner: Component;
12
+ export declare const Check: Component;
13
+ export declare const ChevronUp: Component;
14
+ export declare const ChevronDown: Component;
@@ -0,0 +1,11 @@
1
+ import { default as ChatMessageList } from './components/ChatMessageList.vue';
2
+ import { default as MultimodalMessage } from './components/MultimodalMessage.vue';
3
+ import { default as MarkdownMessage } from './components/MarkdownMessage.vue';
4
+ import { default as AgentSteps } from './components/AgentSteps.vue';
5
+ import { App } from 'vue';
6
+ export { ChatMessageList, MultimodalMessage, MarkdownMessage, AgentSteps };
7
+ export type { ChatMessage, AgentStep, FileAttachment } from './types';
8
+ declare const _default: {
9
+ install(app: App): void;
10
+ };
11
+ export default _default;
@@ -0,0 +1,21 @@
1
+ export interface FileAttachment {
2
+ name: string;
3
+ size: number;
4
+ type: string;
5
+ fileType?: string;
6
+ }
7
+ export interface ChatMessage {
8
+ id?: string;
9
+ role: "user" | "assistant" | "system" | string;
10
+ content: string;
11
+ metadata?: string | any;
12
+ attachments?: FileAttachment[];
13
+ create_time?: string;
14
+ [key: string]: any;
15
+ }
16
+ export interface AgentStep {
17
+ name: string;
18
+ displayName: string;
19
+ status: "running" | "completed" | "error";
20
+ startTime?: number;
21
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "rt-chat-messages",
3
+ "version": "1.0.0",
4
+ "description": "AI对话消息展示组件,开箱即用,支持Markdown、Mermaid、多模态内容",
5
+ "type": "module",
6
+ "main": "./dist/chat-messages.umd.js",
7
+ "module": "./dist/chat-messages.es.js",
8
+ "types": "./dist/types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "import": "./dist/chat-messages.es.js",
13
+ "require": "./dist/chat-messages.umd.js"
14
+ },
15
+ "./style.css": "./dist/style.css"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "dev": "vite",
22
+ "build": "vue-tsc --noEmit && vite build",
23
+ "preview": "vite preview"
24
+ },
25
+ "dependencies": {
26
+ "markdown-it": "^14.0.0",
27
+ "@vscode/markdown-it-katex": "^1.0.0",
28
+ "mermaid": "^10.0.0",
29
+ "katex": "^0.16.0"
30
+ },
31
+ "peerDependencies": {
32
+ "vue": "^3.3.0"
33
+ },
34
+ "devDependencies": {
35
+ "@vitejs/plugin-vue": "^5.2.1",
36
+ "typescript": "~5.6.2",
37
+ "vite": "^6.0.5",
38
+ "vite-plugin-dts": "^4.4.0",
39
+ "vue": "^3.5.13",
40
+ "vue-tsc": "^2.2.0",
41
+ "@types/markdown-it": "^14.0.0"
42
+ },
43
+ "keywords": [
44
+ "vue",
45
+ "chat",
46
+ "message",
47
+ "markdown",
48
+ "mermaid",
49
+ "ai"
50
+ ],
51
+ "license": "MIT"
52
+ }