@kweaver-ai/chatkit 0.1.1 → 0.1.3
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/README.md +3 -3
- package/dist/chatkit.cjs.js +377 -22
- package/dist/chatkit.es.js +72685 -2011
- package/dist/components/Avatar/Avatar-1.d.ts +6 -0
- package/dist/components/Avatar/Avatar-10.d.ts +6 -0
- package/dist/components/Avatar/Avatar-2.d.ts +6 -0
- package/dist/components/Avatar/Avatar-3.d.ts +6 -0
- package/dist/components/Avatar/Avatar-4.d.ts +6 -0
- package/dist/components/Avatar/Avatar-5.d.ts +6 -0
- package/dist/components/Avatar/Avatar-6.d.ts +6 -0
- package/dist/components/Avatar/Avatar-7.d.ts +6 -0
- package/dist/components/Avatar/Avatar-8.d.ts +6 -0
- package/dist/components/Avatar/Avatar-9.d.ts +6 -0
- package/dist/components/Avatar/index.d.ts +38 -0
- package/dist/components/base/ChatKitBase.d.ts +17 -2
- package/dist/components/base/assistant/AssistantBase.d.ts +47 -4
- package/dist/components/base/assistant/ConversationHistory.d.ts +26 -0
- package/dist/components/base/assistant/MessageItem.d.ts +4 -0
- package/dist/components/base/assistant/MessageList.d.ts +4 -0
- package/dist/components/base/assistant/Prologue.d.ts +2 -0
- package/dist/components/base/assistant/blocks/CodeViewTool/CodeViewTool.d.ts +22 -0
- package/dist/components/base/assistant/blocks/CodeViewTool/SqlFormatter.d.ts +24 -0
- package/dist/components/base/assistant/blocks/CodeViewTool/index.d.ts +4 -0
- package/dist/components/base/assistant/blocks/Json2PlotBlock/EChartsView.d.ts +25 -0
- package/dist/components/base/assistant/blocks/Json2PlotBlock/Json2PlotContentView.d.ts +21 -0
- package/dist/components/base/assistant/blocks/Json2PlotBlock/Json2PlotModal.d.ts +21 -0
- package/dist/components/base/assistant/blocks/Json2PlotBlock/TableView.d.ts +21 -0
- package/dist/components/base/assistant/blocks/Json2PlotBlock/index.d.ts +9 -0
- package/dist/components/base/assistant/blocks/Json2PlotBlock/utils.d.ts +14 -0
- package/dist/components/base/assistant/blocks/Json2PlotBlock.d.ts +20 -0
- package/dist/components/base/assistant/blocks/MarkdownBlock.d.ts +4 -0
- package/dist/components/base/assistant/blocks/index.d.ts +3 -0
- package/dist/components/base/copilot/MessageItem.d.ts +2 -0
- package/dist/components/base/copilot/MessageList.d.ts +2 -0
- package/dist/components/base/copilot/blocks/MarkdownBlock.d.ts +4 -0
- package/dist/components/dip/DIPBase.d.ts +73 -35
- package/dist/components/icons/AssistantIcon.d.ts +6 -0
- package/dist/components/icons/ColumnIcon.d.ts +6 -0
- package/dist/components/icons/ExpandIcon.d.ts +6 -0
- package/dist/components/icons/JsonPlotIcon.d.ts +6 -0
- package/dist/components/icons/LineIcon.d.ts +6 -0
- package/dist/components/icons/MoreIcon.d.ts +6 -0
- package/dist/components/icons/NewIcon.d.ts +6 -0
- package/dist/components/icons/PieIcon.d.ts +6 -0
- package/dist/components/icons/TableIcon.d.ts +6 -0
- package/dist/components/icons/Text2SqlIcon.d.ts +6 -0
- package/dist/components/icons/index.d.ts +10 -0
- package/dist/types/index.d.ts +86 -3
- package/package.json +3 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Avatar1 } from './Avatar-1';
|
|
3
|
+
import { Avatar2 } from './Avatar-2';
|
|
4
|
+
import { Avatar3 } from './Avatar-3';
|
|
5
|
+
import { Avatar4 } from './Avatar-4';
|
|
6
|
+
import { Avatar5 } from './Avatar-5';
|
|
7
|
+
import { Avatar6 } from './Avatar-6';
|
|
8
|
+
import { Avatar7 } from './Avatar-7';
|
|
9
|
+
import { Avatar8 } from './Avatar-8';
|
|
10
|
+
import { Avatar9 } from './Avatar-9';
|
|
11
|
+
import { Avatar10 } from './Avatar-10';
|
|
12
|
+
/**
|
|
13
|
+
* Avatar 组件属性接口
|
|
14
|
+
*/
|
|
15
|
+
export interface AvatarProps extends React.SVGProps<SVGSVGElement> {
|
|
16
|
+
/** SVG 名称,支持 '1' 到 '10' */
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Avatar 组件
|
|
21
|
+
* 根据传入的 name 参数渲染对应的 Avatar 图标
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Avatar name="1" width={48} height={48} />
|
|
26
|
+
* <Avatar name="10" className="avatar-icon" />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const Avatar: React.FC<AvatarProps>;
|
|
30
|
+
/**
|
|
31
|
+
* 根据名称获取 Avatar 组件
|
|
32
|
+
*
|
|
33
|
+
* @param name - SVG 名称,支持 '1' 到 '10'
|
|
34
|
+
* @returns 对应的 Avatar 组件,如果不存在则返回 null
|
|
35
|
+
*/
|
|
36
|
+
export declare const getAvatarByName: (name: string) => React.FC<React.SVGProps<SVGSVGElement>> | null;
|
|
37
|
+
export { Avatar1, Avatar2, Avatar3, Avatar4, Avatar5, Avatar6, Avatar7, Avatar8, Avatar9, Avatar10 };
|
|
38
|
+
export default Avatar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import { ChatMessage, ApplicationContext, ChatKitInterface, OnboardingInfo, WebSearchQuery, ExecuteCodeResult } from '../../types';
|
|
2
|
+
import { ChatMessage, ApplicationContext, ChatKitInterface, OnboardingInfo, WebSearchQuery, ExecuteCodeResult, Text2SqlResult, ChartDataSchema } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* ChatKitBase 组件的属性接口
|
|
5
5
|
*/
|
|
@@ -93,9 +93,10 @@ export declare abstract class ChatKitBase<P extends ChatKitBaseProps = ChatKitBa
|
|
|
93
93
|
* 该方法需要由开发者实现,以适配扣子、Dify 等 LLMOps 平台的接口
|
|
94
94
|
* 成功返回会话 ID
|
|
95
95
|
* 注意:该方法是一个无状态无副作用的函数,不允许修改 state
|
|
96
|
+
* @param title 会话标题,通常是用户发送的第一条消息内容
|
|
96
97
|
* @returns 返回新创建的会话 ID
|
|
97
98
|
*/
|
|
98
|
-
abstract generateConversation(): Promise<string>;
|
|
99
|
+
abstract generateConversation(title?: string): Promise<string>;
|
|
99
100
|
/**
|
|
100
101
|
* 向后端发送消息 (抽象方法,由子类实现)
|
|
101
102
|
* 该方法需要由开发者实现,以适配扣子、Dify等 LLMOps 平台的接口
|
|
@@ -197,6 +198,20 @@ export declare abstract class ChatKitBase<P extends ChatKitBaseProps = ChatKitBa
|
|
|
197
198
|
* @param result 代码执行的输入和输出结果
|
|
198
199
|
*/
|
|
199
200
|
protected appendExecuteCodeBlock(messageId: string, result: ExecuteCodeResult): void;
|
|
201
|
+
/**
|
|
202
|
+
* 添加 Text2SQL 工具类型的消息块
|
|
203
|
+
* 该方法由子类调用,用于在消息中添加 Text2SQL 查询结果
|
|
204
|
+
* @param messageId 消息 ID
|
|
205
|
+
* @param result Text2SQL 的输入和输出结果
|
|
206
|
+
*/
|
|
207
|
+
protected appendText2SqlBlock(messageId: string, result: Text2SqlResult): void;
|
|
208
|
+
/**
|
|
209
|
+
* 添加 JSON2Plot 图表类型的消息块
|
|
210
|
+
* 该方法由子类调用,用于在消息中添加 JSON2Plot 图表数据
|
|
211
|
+
* @param messageId 消息 ID
|
|
212
|
+
* @param chartData 图表数据 Schema
|
|
213
|
+
*/
|
|
214
|
+
protected appendJson2PlotBlock(messageId: string, chartData: ChartDataSchema): void;
|
|
200
215
|
/**
|
|
201
216
|
* 创建新的会话
|
|
202
217
|
* 内部会调用子类实现的 generateConversation() 和 getOnboardingInfo() 方法
|
|
@@ -1,13 +1,56 @@
|
|
|
1
|
-
import { ChatKitBase, ChatKitBaseProps } from '../ChatKitBase';
|
|
1
|
+
import { ChatKitBase, ChatKitBaseProps, ChatKitBaseState } from '../ChatKitBase';
|
|
2
|
+
/**
|
|
3
|
+
* AssistantBase 组件的属性接口
|
|
4
|
+
* 扩展 ChatKitBaseProps,添加历史对话相关配置
|
|
5
|
+
*/
|
|
6
|
+
export interface AssistantBaseProps extends ChatKitBaseProps {
|
|
7
|
+
/** 是否启用历史对话功能,默认为 true */
|
|
8
|
+
enableHistory?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AssistantBase 组件的状态接口
|
|
12
|
+
* 扩展 ChatKitBaseState,添加历史对话显示状态
|
|
13
|
+
*/
|
|
14
|
+
export interface AssistantBaseState extends ChatKitBaseState {
|
|
15
|
+
showHistory: boolean;
|
|
16
|
+
}
|
|
2
17
|
/**
|
|
3
18
|
* AssistantBase 基础组件
|
|
4
19
|
* 作为主交互入口,是应用的主体
|
|
5
20
|
*
|
|
6
21
|
* 该类继承自 ChatKitBase,实现了 Assistant 模式的交互界面和交互逻辑
|
|
7
|
-
* 区别于 CopilotBase,AssistantBase
|
|
8
|
-
* Header(历史对话、新对话等按钮)应由外部应用的侧边栏提供
|
|
22
|
+
* 区别于 CopilotBase,AssistantBase 是全屏主对话界面,包含 Header 和历史对话功能
|
|
9
23
|
*/
|
|
10
|
-
export declare abstract class AssistantBase<P extends
|
|
24
|
+
export declare abstract class AssistantBase<P extends AssistantBaseProps = AssistantBaseProps> extends ChatKitBase<P> {
|
|
25
|
+
/**
|
|
26
|
+
* 组件状态,包含历史对话显示状态
|
|
27
|
+
*/
|
|
28
|
+
state: AssistantBaseState;
|
|
29
|
+
constructor(props: P);
|
|
30
|
+
/**
|
|
31
|
+
* 处理查看历史对话
|
|
32
|
+
*/
|
|
33
|
+
handleHistory: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* 处理关闭历史对话列表
|
|
36
|
+
*/
|
|
37
|
+
handleCloseHistory: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* 处理新建对话
|
|
40
|
+
*/
|
|
41
|
+
handleNewChat: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* 处理加载指定会话
|
|
44
|
+
*/
|
|
45
|
+
handleLoadConversation: (conversationId: string) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* 处理删除指定会话
|
|
48
|
+
*/
|
|
49
|
+
handleDeleteConversation: (conversationId: string) => Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* 处理获取历史会话列表
|
|
52
|
+
*/
|
|
53
|
+
handleGetConversations: (page?: number, size?: number) => Promise<import("../../..").ConversationHistory[]>;
|
|
11
54
|
/**
|
|
12
55
|
* 实现 React.Component.render() 方法
|
|
13
56
|
* 渲染 Assistant 模式的界面
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConversationHistory as ConversationHistoryType } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* 历史会话列表组件的属性接口
|
|
5
|
+
*/
|
|
6
|
+
interface ConversationHistoryProps {
|
|
7
|
+
/** 是否显示历史会话列表 */
|
|
8
|
+
visible: boolean;
|
|
9
|
+
/** 关闭历史会话列表的回调函数 */
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** 获取历史会话列表的函数 */
|
|
12
|
+
onGetConversations: (page?: number, size?: number) => Promise<ConversationHistoryType[]>;
|
|
13
|
+
/** 加载指定会话的回调函数 */
|
|
14
|
+
onLoadConversation: (conversationId: string) => void;
|
|
15
|
+
/** 删除指定会话的回调函数 */
|
|
16
|
+
onDeleteConversation: (conversationId: string) => Promise<void>;
|
|
17
|
+
/** Agent Name (agent 名称) */
|
|
18
|
+
agentInfo?: any;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 历史会话列表组件
|
|
22
|
+
* 右侧滑出面板,展示用户的历史会话记录,支持加载和删除操作
|
|
23
|
+
* 设计参考:https://www.figma.com/design/AnGlsx50RkpJgY9irtMtwr/chatkit-max?node-id=14-1901
|
|
24
|
+
*/
|
|
25
|
+
export declare const ConversationHistory: React.FC<ConversationHistoryProps>;
|
|
26
|
+
export default ConversationHistory;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* CodeViewTool 组件的属性接口
|
|
4
|
+
*/
|
|
5
|
+
export interface CodeViewToolProps {
|
|
6
|
+
/** 代码内容 */
|
|
7
|
+
code: string;
|
|
8
|
+
/** 代码语言类型(python、sql、javascript等) */
|
|
9
|
+
language?: string;
|
|
10
|
+
/** 编辑器宽度 */
|
|
11
|
+
width?: string | number;
|
|
12
|
+
/** 编辑器高度 */
|
|
13
|
+
height?: string | number;
|
|
14
|
+
/** 自定义样式类名 */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* CodeViewTool 组件
|
|
19
|
+
* 用于在 ToolDrawer 中展示代码(Python、SQL等)的代码查看组件
|
|
20
|
+
*/
|
|
21
|
+
declare const CodeViewTool: React.FC<CodeViewToolProps>;
|
|
22
|
+
export default CodeViewTool;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL 格式化选项
|
|
3
|
+
*/
|
|
4
|
+
export interface SqlFormatOptions {
|
|
5
|
+
/** 缩进字符,默认为2个空格 */
|
|
6
|
+
indent?: string;
|
|
7
|
+
/** 是否大写关键字,默认为true */
|
|
8
|
+
uppercase?: boolean;
|
|
9
|
+
/** SQL 语言类型,默认为 'sql' */
|
|
10
|
+
language?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 格式化 SQL 代码
|
|
14
|
+
*
|
|
15
|
+
* @param sql - 需要格式化的 SQL 代码
|
|
16
|
+
* @param options - 格式化选项
|
|
17
|
+
* @returns 格式化后的 SQL 代码,格式化失败时返回原始代码
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const formatted = formatSql('SELECT * FROM users WHERE id=1');
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const formatSql: (sql: string, options?: SqlFormatOptions) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChartDataSchema, ChartType } from '../../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* EChartsView 组件的属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface EChartsViewProps {
|
|
7
|
+
/** 图表数据 Schema */
|
|
8
|
+
data: ChartDataSchema;
|
|
9
|
+
/** 图表类型 */
|
|
10
|
+
chartType: ChartType;
|
|
11
|
+
/** 图表宽度 */
|
|
12
|
+
width?: string | number;
|
|
13
|
+
/** 图表高度 */
|
|
14
|
+
height?: string | number;
|
|
15
|
+
/** 是否可点击(用于打开弹窗) */
|
|
16
|
+
clickable?: boolean;
|
|
17
|
+
/** 点击回调 */
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* EChartsView 组件
|
|
22
|
+
* 纯图表渲染组件,负责使用 ECharts 渲染图表
|
|
23
|
+
*/
|
|
24
|
+
declare const EChartsView: React.FC<EChartsViewProps>;
|
|
25
|
+
export default EChartsView;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChartDataSchema } from '../../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Json2PlotContentView 组件的属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface Json2PlotContentViewProps {
|
|
7
|
+
/** 图表数据 Schema */
|
|
8
|
+
data: ChartDataSchema;
|
|
9
|
+
/** 图表宽度 */
|
|
10
|
+
width?: string | number;
|
|
11
|
+
/** 图表高度 */
|
|
12
|
+
height?: string | number;
|
|
13
|
+
/** 点击图表回调(用于打开弹窗) */
|
|
14
|
+
onChartClick?: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Json2PlotContentView 组件
|
|
18
|
+
* 包含标题栏和内容区域,整合 EChartsView 和 TableView
|
|
19
|
+
*/
|
|
20
|
+
declare const Json2PlotContentView: React.FC<Json2PlotContentViewProps>;
|
|
21
|
+
export default Json2PlotContentView;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChartDataSchema, ChartType } from '../../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Json2PlotModal 组件的属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface Json2PlotModalProps {
|
|
7
|
+
/** 是否显示弹窗 */
|
|
8
|
+
open: boolean;
|
|
9
|
+
/** 关闭弹窗回调 */
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
/** 图表数据 Schema */
|
|
12
|
+
data: ChartDataSchema;
|
|
13
|
+
/** 初始视图类型:'table' 或图表类型 */
|
|
14
|
+
initialViewType?: 'table' | ChartType;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Json2PlotModal 组件
|
|
18
|
+
* 弹窗组件,包含菜单栏和内容区域,整合 EChartsView 和 TableView
|
|
19
|
+
*/
|
|
20
|
+
declare const Json2PlotModal: React.FC<Json2PlotModalProps>;
|
|
21
|
+
export default Json2PlotModal;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChartDataSchema } from '../../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* TableView 组件的属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface TableViewProps {
|
|
7
|
+
/** 图表数据 Schema */
|
|
8
|
+
data: ChartDataSchema;
|
|
9
|
+
/** 表格最大高度 */
|
|
10
|
+
maxHeight?: string | number;
|
|
11
|
+
/** 是否启用分页,默认 false */
|
|
12
|
+
pagination?: boolean;
|
|
13
|
+
/** 每页显示条数,默认 10 */
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* TableView 组件
|
|
18
|
+
* 纯表格渲染组件,负责渲染数据表格
|
|
19
|
+
*/
|
|
20
|
+
declare const TableView: React.FC<TableViewProps>;
|
|
21
|
+
export default TableView;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Json2PlotBlock 组件导出文件
|
|
3
|
+
*/
|
|
4
|
+
export { default as EChartsView } from './EChartsView';
|
|
5
|
+
export { default as TableView } from './TableView';
|
|
6
|
+
export { default as Json2PlotModal } from './Json2PlotModal';
|
|
7
|
+
export type { EChartsViewProps } from './EChartsView';
|
|
8
|
+
export type { TableViewProps } from './TableView';
|
|
9
|
+
export type { Json2PlotModalProps } from './Json2PlotModal';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EChartsOption } from 'echarts';
|
|
2
|
+
import { ChartDataSchema, ChartType } from '../../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* 格式化日期
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatDate(value: any): string;
|
|
7
|
+
/**
|
|
8
|
+
* 验证数据是否可以转换为指定图表类型
|
|
9
|
+
*/
|
|
10
|
+
export declare function validateChartType(data: ChartDataSchema, targetType: ChartType): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* 转换 ChartDataSchema 到 ECharts Option
|
|
13
|
+
*/
|
|
14
|
+
export declare function convertToEChartsOption(data: ChartDataSchema, chartType: ChartType): EChartsOption | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Json2PlotBlock as Json2PlotBlockType } from '../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Json2PlotBlock 组件的属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface Json2PlotBlockProps {
|
|
7
|
+
/** JSON2Plot 图表块数据 */
|
|
8
|
+
block: Json2PlotBlockType;
|
|
9
|
+
/** 图表宽度 */
|
|
10
|
+
width?: string | number;
|
|
11
|
+
/** 图表高度 */
|
|
12
|
+
height?: string | number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Json2PlotBlock 组件
|
|
16
|
+
* 主组件,包含标题栏和菜单栏,整合 EChartsView 和 TableView
|
|
17
|
+
*/
|
|
18
|
+
declare const Json2PlotBlock: React.FC<Json2PlotBlockProps>;
|
|
19
|
+
export default Json2PlotBlock;
|
|
20
|
+
export { Json2PlotBlock };
|
|
@@ -6,6 +6,10 @@ import { MarkdownBlock as MarkdownBlockType } from '../../../../types';
|
|
|
6
6
|
export interface MarkdownBlockProps {
|
|
7
7
|
/** Markdown 块数据 */
|
|
8
8
|
block: MarkdownBlockType;
|
|
9
|
+
/** 基础字号,单位 px,默认为 14 */
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
/** 基础字体颜色,默认为 rgba(0, 0, 0, 0.85) */
|
|
12
|
+
fontColor?: string;
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
11
15
|
* MarkdownBlock 组件
|
|
@@ -7,3 +7,6 @@ export { default as MarkdownBlock } from './MarkdownBlock';
|
|
|
7
7
|
export { default as WebSearchBlock } from './WebSearchBlock';
|
|
8
8
|
export { default as ToolBlock } from './ToolBlock';
|
|
9
9
|
export { default as ToolDrawer } from './ToolDrawer';
|
|
10
|
+
export { default as Json2PlotBlock } from './Json2PlotBlock';
|
|
11
|
+
export { CodeViewTool } from './CodeViewTool';
|
|
12
|
+
export type { CodeViewToolProps } from './CodeViewTool';
|
|
@@ -6,6 +6,10 @@ import { MarkdownBlock as MarkdownBlockType } from '../../../../types';
|
|
|
6
6
|
export interface MarkdownBlockProps {
|
|
7
7
|
/** Markdown 块数据 */
|
|
8
8
|
block: MarkdownBlockType;
|
|
9
|
+
/** 基础字号,单位 px,默认为 14 */
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
/** 基础字体颜色,默认为 rgba(0, 0, 0, 0.85) */
|
|
12
|
+
fontColor?: string;
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
11
15
|
* MarkdownBlock 组件
|