@ant-design/agentic-ui 2.0.12 → 2.0.14
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 +12 -12
- package/dist/Bubble/AIBubble.js +3 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTab.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroup.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroupStyle.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/ButtonTabStyle.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/CaseReply.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/CaseReplyStyle.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/Title.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/index.js +1 -1
- package/dist/{ChatBoot → ChatBootPage}/style.js +1 -1
- package/dist/MarkdownEditor/editor/Editor.js +34 -2
- package/dist/MarkdownEditor/editor/components/LazyElement/index.d.ts +10 -1
- package/dist/MarkdownEditor/editor/components/LazyElement/index.js +4 -2
- package/dist/MarkdownEditor/types.d.ts +1 -1
- package/dist/{Welcome → WelcomeMessage}/index.d.ts +7 -4
- package/dist/{Welcome → WelcomeMessage}/index.js +3 -3
- package/dist/{Welcome → WelcomeMessage}/style.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTab.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroup.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTabGroupStyle.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/ButtonTabStyle.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/CaseReply.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/CaseReplyStyle.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/Title.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/index.d.ts +0 -0
- /package/dist/{ChatBoot → ChatBootPage}/style.d.ts +0 -0
- /package/dist/{Welcome → WelcomeMessage}/style.d.ts +0 -0
package/README.md
CHANGED
|
@@ -153,12 +153,12 @@ import { MarkdownEditor } from '@ant-design/agentic-ui';
|
|
|
153
153
|
|
|
154
154
|
### 📋 布局与容器组件
|
|
155
155
|
|
|
156
|
-
| 组件
|
|
157
|
-
|
|
|
158
|
-
| `ChatLayout`
|
|
159
|
-
| `History`
|
|
160
|
-
| `
|
|
161
|
-
| `Quote`
|
|
156
|
+
| 组件 | 描述 | 主要功能 |
|
|
157
|
+
| ---------------- | ------------ | ------------------------------------ |
|
|
158
|
+
| `ChatLayout` | 聊天布局容器 | 标准聊天界面布局,支持左右栏、全屏等 |
|
|
159
|
+
| `History` | 历史记录组件 | 会话历史管理,支持搜索、筛选、导出 |
|
|
160
|
+
| `WelcomeMessage` | 欢迎语组件 | 应用启动欢迎语,展示功能介绍 |
|
|
161
|
+
| `Quote` | 引用组件 | 引用消息或内容 |
|
|
162
162
|
|
|
163
163
|
### 🎯 交互与反馈组件
|
|
164
164
|
|
|
@@ -172,12 +172,12 @@ import { MarkdownEditor } from '@ant-design/agentic-ui';
|
|
|
172
172
|
|
|
173
173
|
### 🧠 智能体专属组件
|
|
174
174
|
|
|
175
|
-
| 组件 | 描述
|
|
176
|
-
| ---------------- |
|
|
177
|
-
| `
|
|
178
|
-
| `SchemaEditor` | Schema 编辑器
|
|
179
|
-
| `SchemaForm` | Schema 表单
|
|
180
|
-
| `SchemaRenderer` | Schema 渲染器
|
|
175
|
+
| 组件 | 描述 | 主要功能 |
|
|
176
|
+
| ---------------- | -------------- | ---------------------------- |
|
|
177
|
+
| `ChatBootPage` | 对话启动页组件 | 快速回复、案例推荐等引导功能 |
|
|
178
|
+
| `SchemaEditor` | Schema 编辑器 | 结构化数据编辑 |
|
|
179
|
+
| `SchemaForm` | Schema 表单 | 基于 Schema 自动生成表单 |
|
|
180
|
+
| `SchemaRenderer` | Schema 渲染器 | 渲染结构化数据 |
|
|
181
181
|
|
|
182
182
|
### 🔌 插件组件
|
|
183
183
|
|
package/dist/Bubble/AIBubble.js
CHANGED
|
@@ -167,7 +167,9 @@ var AIBubble = memo((props) => {
|
|
|
167
167
|
{
|
|
168
168
|
style: __spreadValues({
|
|
169
169
|
minWidth: standalone ? "min(296px,100%)" : "0px",
|
|
170
|
-
paddingLeft: 12
|
|
170
|
+
paddingLeft: 12,
|
|
171
|
+
maxWidth: "100%",
|
|
172
|
+
width: "100%"
|
|
171
173
|
}, styles == null ? void 0 : styles.bubbleListItemExtraStyle),
|
|
172
174
|
className: cx(
|
|
173
175
|
`${prefixClass}-bubble-after`,
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
|
-
// src/
|
|
21
|
+
// src/ChatBootPage/ButtonTabGroupStyle.ts
|
|
22
22
|
import {
|
|
23
23
|
useEditorStyleRegister
|
|
24
24
|
} from "../Hooks/useStyle";
|
|
@@ -104,6 +104,23 @@ var SlateMarkdownEditor = (props) => {
|
|
|
104
104
|
readonly,
|
|
105
105
|
setDomRect
|
|
106
106
|
} = useEditorStore();
|
|
107
|
+
const lazyElementIndexRef = useRef(0);
|
|
108
|
+
const hasResetIndexRef = useRef(false);
|
|
109
|
+
const countLazyElements = useCallback((nodes) => {
|
|
110
|
+
let count = 0;
|
|
111
|
+
const traverse = (nodeList) => {
|
|
112
|
+
nodeList.forEach((node) => {
|
|
113
|
+
if (node.type !== "table-cell" && node.type !== "table-row") {
|
|
114
|
+
count++;
|
|
115
|
+
}
|
|
116
|
+
if (node.children && Array.isArray(node.children)) {
|
|
117
|
+
traverse(node.children);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
traverse(nodes);
|
|
122
|
+
return count;
|
|
123
|
+
}, []);
|
|
107
124
|
const changedMark = useRef(false);
|
|
108
125
|
const value = useRef([EditorUtils.p]);
|
|
109
126
|
const nodeRef = useRef();
|
|
@@ -599,6 +616,13 @@ var SlateMarkdownEditor = (props) => {
|
|
|
599
616
|
const elementRenderElement = useCallback(
|
|
600
617
|
(eleProps) => {
|
|
601
618
|
var _a2, _b2, _c2, _d2, _e;
|
|
619
|
+
if (!hasResetIndexRef.current) {
|
|
620
|
+
lazyElementIndexRef.current = 0;
|
|
621
|
+
hasResetIndexRef.current = true;
|
|
622
|
+
Promise.resolve().then(() => {
|
|
623
|
+
hasResetIndexRef.current = false;
|
|
624
|
+
});
|
|
625
|
+
}
|
|
602
626
|
const defaultDom = /* @__PURE__ */ React.createElement(
|
|
603
627
|
ErrorBoundary,
|
|
604
628
|
{
|
|
@@ -634,19 +658,27 @@ var SlateMarkdownEditor = (props) => {
|
|
|
634
658
|
if (eleProps.element.type === "table-cell" || eleProps.element.type === "table-row") {
|
|
635
659
|
return renderedDom;
|
|
636
660
|
}
|
|
661
|
+
const currentIndex = lazyElementIndexRef.current;
|
|
662
|
+
lazyElementIndexRef.current += 1;
|
|
663
|
+
const totalElements = countLazyElements(value.current);
|
|
637
664
|
return /* @__PURE__ */ React.createElement(
|
|
638
665
|
LazyElement,
|
|
639
666
|
{
|
|
640
667
|
placeholderHeight: (_c2 = props.lazy) == null ? void 0 : _c2.placeholderHeight,
|
|
641
668
|
rootMargin: (_d2 = props.lazy) == null ? void 0 : _d2.rootMargin,
|
|
642
|
-
renderPlaceholder: (_e = props.lazy) == null ? void 0 : _e.renderPlaceholder
|
|
669
|
+
renderPlaceholder: (_e = props.lazy) == null ? void 0 : _e.renderPlaceholder,
|
|
670
|
+
elementInfo: {
|
|
671
|
+
type: eleProps.element.type,
|
|
672
|
+
index: currentIndex,
|
|
673
|
+
total: totalElements
|
|
674
|
+
}
|
|
643
675
|
},
|
|
644
676
|
renderedDom
|
|
645
677
|
);
|
|
646
678
|
}
|
|
647
679
|
return renderedDom;
|
|
648
680
|
},
|
|
649
|
-
[props.eleItemRender, props.lazy, plugins, readonly]
|
|
681
|
+
[props.eleItemRender, props.lazy, plugins, readonly, countLazyElements]
|
|
650
682
|
);
|
|
651
683
|
const renderMarkdownLeaf = useRefFunction((leafComponentProps) => {
|
|
652
684
|
const defaultDom = /* @__PURE__ */ React.createElement(
|
|
@@ -3,6 +3,15 @@ import React from 'react';
|
|
|
3
3
|
* LazyElement 组件属性
|
|
4
4
|
*/
|
|
5
5
|
export interface LazyElementProps {
|
|
6
|
+
/** 元素在文档中的位置信息 */
|
|
7
|
+
elementInfo: {
|
|
8
|
+
/** 元素类型 */
|
|
9
|
+
type: string;
|
|
10
|
+
/** 元素在文档中的索引 */
|
|
11
|
+
index: number;
|
|
12
|
+
/** 元素总数量 */
|
|
13
|
+
total: number;
|
|
14
|
+
};
|
|
6
15
|
/** 子元素 */
|
|
7
16
|
children: React.ReactNode;
|
|
8
17
|
/** 占位符高度,默认 100px */
|
|
@@ -20,7 +29,7 @@ export interface LazyElementProps {
|
|
|
20
29
|
/** 元素是否即将进入视口 */
|
|
21
30
|
isIntersecting: boolean;
|
|
22
31
|
/** 元素在文档中的位置信息 */
|
|
23
|
-
elementInfo
|
|
32
|
+
elementInfo: {
|
|
24
33
|
/** 元素类型 */
|
|
25
34
|
type: string;
|
|
26
35
|
/** 元素在文档中的索引 */
|
|
@@ -22,7 +22,8 @@ var LazyElement = ({
|
|
|
22
22
|
placeholderHeight = 25,
|
|
23
23
|
rootMargin = "200px",
|
|
24
24
|
placeholderStyle,
|
|
25
|
-
renderPlaceholder
|
|
25
|
+
renderPlaceholder,
|
|
26
|
+
elementInfo
|
|
26
27
|
}) => {
|
|
27
28
|
const containerRef = useRef(null);
|
|
28
29
|
const [isVisible, setIsVisible] = useState(false);
|
|
@@ -63,7 +64,8 @@ var LazyElement = ({
|
|
|
63
64
|
return /* @__PURE__ */ React.createElement("div", { ref: containerRef, "aria-hidden": "true" }, renderPlaceholder({
|
|
64
65
|
height: placeholderHeight,
|
|
65
66
|
style: computedPlaceholderStyle,
|
|
66
|
-
isIntersecting
|
|
67
|
+
isIntersecting,
|
|
68
|
+
elementInfo
|
|
67
69
|
}));
|
|
68
70
|
}
|
|
69
71
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export interface
|
|
2
|
+
export interface WelcomeMessageProps {
|
|
3
3
|
/** 标题 */
|
|
4
|
-
title
|
|
4
|
+
title?: React.ReactNode;
|
|
5
5
|
/** 描述 */
|
|
6
6
|
description?: React.ReactNode;
|
|
7
7
|
/** 自定义样式类名,用于各个提示项的不同部分 */
|
|
8
|
-
classNames?:
|
|
8
|
+
classNames?: {
|
|
9
|
+
title?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
9
12
|
/** 自定义样式 */
|
|
10
13
|
style?: React.CSSProperties;
|
|
11
14
|
/** 自定义根节点样式类名 */
|
|
12
15
|
rootClassName?: string;
|
|
13
16
|
}
|
|
14
|
-
export declare const
|
|
17
|
+
export declare const WelcomeMessage: React.FC<WelcomeMessageProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/WelcomeMessage/index.tsx
|
|
2
2
|
import { ConfigProvider } from "antd";
|
|
3
3
|
import classnames from "classnames";
|
|
4
4
|
import React, { useContext } from "react";
|
|
5
5
|
import { useStyle } from "./style";
|
|
6
|
-
var
|
|
6
|
+
var WelcomeMessage = ({
|
|
7
7
|
title,
|
|
8
8
|
description,
|
|
9
9
|
classNames,
|
|
@@ -27,5 +27,5 @@ var Welcome = ({
|
|
|
27
27
|
);
|
|
28
28
|
};
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
WelcomeMessage
|
|
31
31
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from './AgentRunBar';
|
|
|
4
4
|
export * from './Bubble';
|
|
5
5
|
export * from './Bubble/List';
|
|
6
6
|
export * from './Bubble/type';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './ChatBootPage';
|
|
8
8
|
export * from './ChatLayout';
|
|
9
9
|
export * from './Components/ActionIconBox';
|
|
10
10
|
export * from './Components/Button';
|
|
@@ -47,7 +47,7 @@ export * from './Schema';
|
|
|
47
47
|
export * from './TaskList';
|
|
48
48
|
export * from './ThoughtChainList';
|
|
49
49
|
export * from './ToolUseBar';
|
|
50
|
-
export * from './
|
|
50
|
+
export * from './WelcomeMessage';
|
|
51
51
|
export * from './Workspace';
|
|
52
52
|
export * from './Components/Robot';
|
|
53
53
|
export { default as Robot } from './Components/Robot';
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export * from "./AgentRunBar";
|
|
|
4
4
|
export * from "./Bubble";
|
|
5
5
|
export * from "./Bubble/List";
|
|
6
6
|
export * from "./Bubble/type";
|
|
7
|
-
export * from "./
|
|
7
|
+
export * from "./ChatBootPage";
|
|
8
8
|
export * from "./ChatLayout";
|
|
9
9
|
export * from "./Components/ActionIconBox";
|
|
10
10
|
export * from "./Components/Button";
|
|
@@ -47,7 +47,7 @@ export * from "./Schema";
|
|
|
47
47
|
export * from "./TaskList";
|
|
48
48
|
export * from "./ThoughtChainList";
|
|
49
49
|
export * from "./ToolUseBar";
|
|
50
|
-
export * from "./
|
|
50
|
+
export * from "./WelcomeMessage";
|
|
51
51
|
export * from "./Workspace";
|
|
52
52
|
export * from "./Components/Robot";
|
|
53
53
|
import { default as default3 } from "./Components/Robot";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|