@agentscope-ai/chat 1.1.39 → 1.1.41-beta.1764749089549
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/bin/starter_webui.zip +0 -0
- package/components/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Builder.tsx +8 -4
- package/components/ImageGenerator/index.tsx +1 -1
- package/components/Markdown/Markdown.tsx +105 -0
- package/components/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.tsx +1 -1
- package/components/Markdown/core/components/Null.tsx +1 -0
- package/components/Markdown/core/components/Raw.tsx +18 -0
- package/components/Markdown/{Markdown → core}/hooks/useCitationsData.tsx +3 -7
- package/components/Markdown/core/hooks/useCursorContent.tsx +15 -0
- package/components/Markdown/{Markdown/hooks/useTyping.ts → core/hooks/useTyping.tsx} +4 -1
- package/components/Markdown/core/index.tsx +18 -0
- package/components/Markdown/{plugins → core/plugins}/citations/CitationComponent.tsx +5 -3
- package/components/Markdown/{plugins → core/plugins}/citations/index.tsx +3 -4
- package/components/Markdown/{plugins → core/plugins}/cursor/Underline.tsx +1 -1
- package/components/Markdown/{plugins → core/plugins}/cursor/index.tsx +8 -8
- package/components/Markdown/demo/cursor.tsx +2 -3
- package/components/Markdown/index.en-US.md +1 -2
- package/components/Markdown/index.tsx +6 -0
- package/components/Markdown/index.zh-CN.md +1 -2
- package/components/Markdown/{Markdown/style.ts → styles.ts} +12 -21
- package/components/Markdown/types.tsx +94 -0
- package/components/index.ts +1 -3
- package/lib/AgentScopeRuntimeWebUI/core/AgentScopeRuntime/Response/Builder.js +5 -3
- package/lib/ImageGenerator/index.js +1 -1
- package/lib/Markdown/Markdown.d.ts +4 -0
- package/lib/Markdown/Markdown.js +110 -0
- package/lib/Markdown/core/components/Null.d.ts +2 -0
- package/lib/Markdown/core/components/Null.js +3 -0
- package/lib/Markdown/core/components/Raw.d.ts +8 -0
- package/lib/Markdown/core/components/Raw.js +13 -0
- package/lib/Markdown/core/hooks/useCitationsData.d.ts +6 -0
- package/lib/Markdown/{Markdown → core}/hooks/useCitationsData.js +1 -1
- package/lib/Markdown/core/hooks/useCursorContent.d.ts +4 -0
- package/lib/Markdown/core/hooks/useCursorContent.js +14 -0
- package/lib/Markdown/core/hooks/useTyping.d.ts +5 -0
- package/lib/Markdown/{Markdown → core}/hooks/useTyping.js +3 -2
- package/lib/Markdown/core/index.d.ts +2 -0
- package/lib/Markdown/{Markdown/hooks/useAnimation.js → core/index.js} +23 -23
- package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.js +5 -5
- package/lib/Markdown/{plugins → core/plugins}/citations/index.d.ts +1 -2
- package/lib/Markdown/{plugins → core/plugins}/citations/index.js +1 -1
- package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.js +1 -1
- package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.js +1 -1
- package/lib/Markdown/{plugins → core/plugins}/cursor/index.js +4 -4
- package/lib/Markdown/index.d.ts +2 -1
- package/lib/Markdown/styles.js +32 -0
- package/lib/Markdown/types.d.ts +78 -0
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/package.json +7 -31
- package/components/AGUI/components/HelpModal/icons.tsx +0 -68
- package/components/AGUI/components/HelpModal/index.tsx +0 -1
- package/components/AGUI/components/HelpModal/modal.tsx +0 -101
- package/components/AGUI/components/chat/Button.tsx +0 -18
- package/components/AGUI/components/chat/Chat.tsx +0 -780
- package/components/AGUI/components/chat/ChatContext.tsx +0 -248
- package/components/AGUI/components/chat/CodeBlock.tsx +0 -406
- package/components/AGUI/components/chat/Header.tsx +0 -22
- package/components/AGUI/components/chat/Icons.tsx +0 -237
- package/components/AGUI/components/chat/ImageUploadQueue.tsx +0 -77
- package/components/AGUI/components/chat/Input.tsx +0 -24
- package/components/AGUI/components/chat/Markdown.tsx +0 -134
- package/components/AGUI/components/chat/Messages.tsx +0 -259
- package/components/AGUI/components/chat/Modal.tsx +0 -133
- package/components/AGUI/components/chat/Popup.tsx +0 -57
- package/components/AGUI/components/chat/PoweredByTag.tsx +0 -29
- package/components/AGUI/components/chat/Sidebar.tsx +0 -74
- package/components/AGUI/components/chat/Suggestion.tsx +0 -132
- package/components/AGUI/components/chat/Suggestions.tsx +0 -20
- package/components/AGUI/components/chat/Textarea.tsx +0 -61
- package/components/AGUI/components/chat/Window.tsx +0 -152
- package/components/AGUI/components/chat/index.tsx +0 -11
- package/components/AGUI/components/chat/messages/AssistantMessage.tsx +0 -69
- package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +0 -129
- package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +0 -116
- package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +0 -64
- package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +0 -26
- package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +0 -51
- package/components/AGUI/components/chat/messages/UserMessage.tsx +0 -10
- package/components/AGUI/components/chat/props.ts +0 -186
- package/components/AGUI/components/index.ts +0 -1
- package/components/AGUI/context/index.ts +0 -1
- package/components/AGUI/hooks/index.ts +0 -1
- package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +0 -122
- package/components/AGUI/hooks/use-copy-to-clipboard.tsx +0 -29
- package/components/AGUI/hooks/use-dark-mode.ts +0 -10
- package/components/AGUI/hooks/use-push-to-talk.tsx +0 -166
- package/components/AGUI/index.tsx +0 -4
- package/components/AGUI/lib/utils.test.ts +0 -7
- package/components/AGUI/lib/utils.ts +0 -27
- package/components/AGUI/styles.css +0 -0
- package/components/AGUI/types/css.ts +0 -0
- package/components/AGUI/types/index.ts +0 -1
- package/components/AGUI/types/suggestions.ts +0 -6
- package/components/Markdown/Markdown/AnimationNode.tsx +0 -89
- package/components/Markdown/Markdown/Markdown.tsx +0 -61
- package/components/Markdown/Markdown/core/Parser.ts +0 -52
- package/components/Markdown/Markdown/core/Renderer.ts +0 -121
- package/components/Markdown/Markdown/core/index.ts +0 -4
- package/components/Markdown/Markdown/hooks/index.ts +0 -4
- package/components/Markdown/Markdown/hooks/useAnimation.tsx +0 -27
- package/components/Markdown/Markdown/hooks/useStreaming.ts +0 -503
- package/components/Markdown/Markdown/index.tsx +0 -198
- package/components/Markdown/Markdown/interface.ts +0 -217
- package/components/Markdown/demo/typing.tsx +0 -82
- package/components/Markdown/index.ts +0 -1
- package/components/Markdown/plugins/latex/index.ts +0 -109
- package/components/Markdown/plugins/type.ts +0 -71
- package/lib/AGUI/components/HelpModal/icons.d.ts +0 -5
- package/lib/AGUI/components/HelpModal/icons.js +0 -84
- package/lib/AGUI/components/HelpModal/index.d.ts +0 -1
- package/lib/AGUI/components/HelpModal/index.js +0 -1
- package/lib/AGUI/components/HelpModal/modal.d.ts +0 -1
- package/lib/AGUI/components/HelpModal/modal.js +0 -104
- package/lib/AGUI/components/chat/Button.d.ts +0 -2
- package/lib/AGUI/components/chat/Button.js +0 -27
- package/lib/AGUI/components/chat/Chat.d.ts +0 -242
- package/lib/AGUI/components/chat/Chat.js +0 -634
- package/lib/AGUI/components/chat/ChatContext.d.ts +0 -142
- package/lib/AGUI/components/chat/ChatContext.js +0 -75
- package/lib/AGUI/components/chat/CodeBlock.d.ts +0 -12
- package/lib/AGUI/components/chat/CodeBlock.js +0 -398
- package/lib/AGUI/components/chat/Header.d.ts +0 -2
- package/lib/AGUI/components/chat/Header.js +0 -28
- package/lib/AGUI/components/chat/Icons.d.ts +0 -16
- package/lib/AGUI/components/chat/Icons.js +0 -247
- package/lib/AGUI/components/chat/ImageUploadQueue.d.ts +0 -11
- package/lib/AGUI/components/chat/ImageUploadQueue.js +0 -65
- package/lib/AGUI/components/chat/Input.d.ts +0 -2
- package/lib/AGUI/components/chat/Input.js +0 -30
- package/lib/AGUI/components/chat/Markdown.d.ts +0 -7
- package/lib/AGUI/components/chat/Markdown.js +0 -187
- package/lib/AGUI/components/chat/Messages.d.ts +0 -7
- package/lib/AGUI/components/chat/Messages.js +0 -242
- package/lib/AGUI/components/chat/Modal.d.ts +0 -43
- package/lib/AGUI/components/chat/Modal.js +0 -113
- package/lib/AGUI/components/chat/Popup.d.ts +0 -49
- package/lib/AGUI/components/chat/Popup.js +0 -64
- package/lib/AGUI/components/chat/PoweredByTag.d.ts +0 -3
- package/lib/AGUI/components/chat/PoweredByTag.js +0 -27
- package/lib/AGUI/components/chat/Sidebar.d.ts +0 -2
- package/lib/AGUI/components/chat/Sidebar.js +0 -85
- package/lib/AGUI/components/chat/Suggestion.d.ts +0 -16
- package/lib/AGUI/components/chat/Suggestion.js +0 -146
- package/lib/AGUI/components/chat/Suggestions.d.ts +0 -2
- package/lib/AGUI/components/chat/Suggestions.js +0 -21
- package/lib/AGUI/components/chat/Textarea.d.ts +0 -11
- package/lib/AGUI/components/chat/Textarea.js +0 -60
- package/lib/AGUI/components/chat/Window.d.ts +0 -2
- package/lib/AGUI/components/chat/Window.js +0 -115
- package/lib/AGUI/components/chat/index.d.ts +0 -11
- package/lib/AGUI/components/chat/index.js +0 -11
- package/lib/AGUI/components/chat/messages/AssistantMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/AssistantMessage.js +0 -56
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.js +0 -114
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.js +0 -97
- package/lib/AGUI/components/chat/messages/RenderImageMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderImageMessage.js +0 -61
- package/lib/AGUI/components/chat/messages/RenderResultMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderResultMessage.js +0 -27
- package/lib/AGUI/components/chat/messages/RenderTextMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/RenderTextMessage.js +0 -47
- package/lib/AGUI/components/chat/messages/UserMessage.d.ts +0 -2
- package/lib/AGUI/components/chat/messages/UserMessage.js +0 -9
- package/lib/AGUI/components/chat/props.d.ts +0 -157
- package/lib/AGUI/components/index.d.ts +0 -1
- package/lib/AGUI/components/index.js +0 -1
- package/lib/AGUI/context/index.d.ts +0 -1
- package/lib/AGUI/context/index.js +0 -1
- package/lib/AGUI/hooks/index.d.ts +0 -1
- package/lib/AGUI/hooks/index.js +0 -1
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.d.ts +0 -87
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.js +0 -95
- package/lib/AGUI/hooks/use-copy-to-clipboard.d.ts +0 -7
- package/lib/AGUI/hooks/use-copy-to-clipboard.js +0 -34
- package/lib/AGUI/hooks/use-dark-mode.d.ts +0 -1
- package/lib/AGUI/hooks/use-dark-mode.js +0 -4
- package/lib/AGUI/hooks/use-push-to-talk.d.ts +0 -16
- package/lib/AGUI/hooks/use-push-to-talk.js +0 -260
- package/lib/AGUI/index.d.ts +0 -4
- package/lib/AGUI/index.js +0 -4
- package/lib/AGUI/lib/utils.d.ts +0 -2
- package/lib/AGUI/lib/utils.js +0 -52
- package/lib/AGUI/styles.css +0 -0
- package/lib/AGUI/types/css.d.ts +0 -0
- package/lib/AGUI/types/css.js +0 -0
- package/lib/AGUI/types/index.d.ts +0 -1
- package/lib/AGUI/types/index.js +0 -1
- package/lib/AGUI/types/suggestions.d.ts +0 -6
- package/lib/AGUI/types/suggestions.js +0 -1
- package/lib/Markdown/Markdown/AnimationNode.d.ts +0 -20
- package/lib/Markdown/Markdown/AnimationNode.js +0 -84
- package/lib/Markdown/Markdown/Markdown.d.ts +0 -4
- package/lib/Markdown/Markdown/Markdown.js +0 -58
- package/lib/Markdown/Markdown/core/Parser.d.ts +0 -16
- package/lib/Markdown/Markdown/core/Parser.js +0 -65
- package/lib/Markdown/Markdown/core/Renderer.d.ts +0 -24
- package/lib/Markdown/Markdown/core/Renderer.js +0 -137
- package/lib/Markdown/Markdown/core/index.d.ts +0 -3
- package/lib/Markdown/Markdown/core/index.js +0 -3
- package/lib/Markdown/Markdown/hooks/index.d.ts +0 -3
- package/lib/Markdown/Markdown/hooks/index.js +0 -3
- package/lib/Markdown/Markdown/hooks/useAnimation.d.ts +0 -4
- package/lib/Markdown/Markdown/hooks/useCitationsData.d.ts +0 -7
- package/lib/Markdown/Markdown/hooks/useStreaming.d.ts +0 -3
- package/lib/Markdown/Markdown/hooks/useStreaming.js +0 -521
- package/lib/Markdown/Markdown/hooks/useTyping.d.ts +0 -4
- package/lib/Markdown/Markdown/index.d.ts +0 -84
- package/lib/Markdown/Markdown/index.js +0 -161
- package/lib/Markdown/Markdown/interface.d.ts +0 -203
- package/lib/Markdown/Markdown/interface.js +0 -1
- package/lib/Markdown/Markdown/style.js +0 -32
- package/lib/Markdown/plugins/latex/index.d.ts +0 -9
- package/lib/Markdown/plugins/latex/index.js +0 -97
- package/lib/Markdown/plugins/type.d.ts +0 -60
- package/lib/Markdown/plugins/type.js +0 -1
- /package/components/Markdown/{Markdown/defaultComponents/DisabledImage.tsx → core/components/DisableImage.tsx} +0 -0
- /package/components/Markdown/{Markdown/defaultComponents → core/components}/Media.tsx +0 -0
- /package/components/Markdown/{plugins → core/plugins}/cursor/Dot.tsx +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.d.ts +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.js +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.d.ts → core/components/DisableImage.d.ts} +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.js → core/components/DisableImage.js} +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.d.ts +0 -0
- /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.js +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.d.ts +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.d.ts +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.d.ts +0 -0
- /package/lib/Markdown/{plugins → core/plugins}/cursor/index.d.ts +0 -0
- /package/lib/Markdown/{Markdown/style.d.ts → styles.d.ts} +0 -0
- /package/lib/{AGUI/components/chat/props.js → Markdown/types.js} +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { memo, useMemo } from 'react';
|
|
2
|
+
import MarkdownX from "./core";
|
|
3
|
+
import useTyping from "./core/hooks/useTyping";
|
|
4
|
+
import { useProviderContext } from "./..";
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import Null from "./core/components/Null";
|
|
7
|
+
import CodeBlock from "./core/components/CodeBlock";
|
|
8
|
+
import DisabledImage from "./core/components/DisableImage";
|
|
9
|
+
import Media from "./core/components/Media";
|
|
10
|
+
import Raw from "./core/components/Raw";
|
|
11
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
12
|
+
import useCitationsData from "./core/hooks/useCitationsData";
|
|
13
|
+
import Latex from '@ant-design/x-markdown/plugins/Latex';
|
|
14
|
+
import { citationsExtension } from "./core/plugins/citations";
|
|
15
|
+
import { CursorComponent, cursorExtension } from "./core/plugins/cursor";
|
|
16
|
+
|
|
17
|
+
// 缓存不变的 dompurify 配置
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
var EMPTY_DOMPURIFY_CONFIG = {
|
|
20
|
+
ALLOWED_TAGS: []
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 检测浏览器是否支持正则表达式的 lookbehind assertions
|
|
25
|
+
* iOS Safari < 16.4 不支持此特性
|
|
26
|
+
*/
|
|
27
|
+
function supportsLookbehindAssertions() {
|
|
28
|
+
try {
|
|
29
|
+
// 尝试创建包含正向后行断言的正则表达式
|
|
30
|
+
new RegExp('(?<=a)b');
|
|
31
|
+
return true;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
var isSupportsLookbehindAssertions = supportsLookbehindAssertions();
|
|
37
|
+
export default /*#__PURE__*/memo(function (props) {
|
|
38
|
+
var baseFontSize = props.baseFontSize || 14;
|
|
39
|
+
var baseLineHeight = props.baseLineHeight || 1.7;
|
|
40
|
+
var content = useTyping({
|
|
41
|
+
content: props.content,
|
|
42
|
+
typing: props.typing
|
|
43
|
+
});
|
|
44
|
+
var prefixCls = useProviderContext().getPrefixCls('markdown');
|
|
45
|
+
var _props$raw = props.raw,
|
|
46
|
+
raw = _props$raw === void 0 ? false : _props$raw,
|
|
47
|
+
_props$allowHtml = props.allowHtml,
|
|
48
|
+
allowHtml = _props$allowHtml === void 0 ? true : _props$allowHtml;
|
|
49
|
+
var _useCitationsData = useCitationsData({
|
|
50
|
+
citations: props.citations,
|
|
51
|
+
citationsMap: props.citationsMap
|
|
52
|
+
}),
|
|
53
|
+
citationsData = _useCitationsData.citationsData,
|
|
54
|
+
citationsDataCount = _useCitationsData.citationsDataCount,
|
|
55
|
+
CitationComponent = _useCitationsData.CitationComponent;
|
|
56
|
+
var components = useMemo(function () {
|
|
57
|
+
return {
|
|
58
|
+
pre: CodeBlock,
|
|
59
|
+
style: Null,
|
|
60
|
+
script: Null,
|
|
61
|
+
img: props.disableImage ? DisabledImage : Media,
|
|
62
|
+
citation: CitationComponent,
|
|
63
|
+
'custom-cursor': CursorComponent
|
|
64
|
+
};
|
|
65
|
+
}, [props.disableImage, CitationComponent]);
|
|
66
|
+
var dompurifyConfig = useMemo(function () {
|
|
67
|
+
return allowHtml ? {
|
|
68
|
+
ADD_TAGS: ['custom-cursor', 'citation']
|
|
69
|
+
} : EMPTY_DOMPURIFY_CONFIG;
|
|
70
|
+
}, [allowHtml]);
|
|
71
|
+
|
|
72
|
+
// 使用 useMemo 缓存 extensions 配置
|
|
73
|
+
var extensions = useMemo(function () {
|
|
74
|
+
var exts = Latex();
|
|
75
|
+
exts.push(cursorExtension());
|
|
76
|
+
if (citationsDataCount > 0) exts.push(citationsExtension(citationsData));
|
|
77
|
+
return exts;
|
|
78
|
+
}, [citationsDataCount, citationsData]);
|
|
79
|
+
|
|
80
|
+
// // 使用 useMemo 缓存 config 对象
|
|
81
|
+
var config = useMemo(function () {
|
|
82
|
+
return {
|
|
83
|
+
extensions: extensions
|
|
84
|
+
};
|
|
85
|
+
}, [extensions]);
|
|
86
|
+
var fallback = /*#__PURE__*/_jsx(Raw, {
|
|
87
|
+
content: content,
|
|
88
|
+
baseFontSize: baseFontSize,
|
|
89
|
+
baseLineHeight: baseLineHeight
|
|
90
|
+
});
|
|
91
|
+
if (raw || !isSupportsLookbehindAssertions) return fallback;
|
|
92
|
+
return /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
93
|
+
fallback: fallback,
|
|
94
|
+
children: /*#__PURE__*/_jsx(MarkdownX, {
|
|
95
|
+
dompurifyConfig: dompurifyConfig,
|
|
96
|
+
cursor: props.cursor
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
,
|
|
99
|
+
components: components,
|
|
100
|
+
style: {
|
|
101
|
+
fontSize: baseFontSize,
|
|
102
|
+
lineHeight: baseLineHeight
|
|
103
|
+
},
|
|
104
|
+
openLinksInNewTab: true,
|
|
105
|
+
className: classNames(prefixCls, props.className),
|
|
106
|
+
content: content,
|
|
107
|
+
config: config
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useProviderContext } from "../../..";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export default function Raw(props) {
|
|
4
|
+
var prefixCls = useProviderContext().getPrefixCls('markdown');
|
|
5
|
+
return /*#__PURE__*/_jsx("div", {
|
|
6
|
+
className: prefixCls,
|
|
7
|
+
style: {
|
|
8
|
+
fontSize: props.baseFontSize,
|
|
9
|
+
lineHeight: props.baseLineHeight
|
|
10
|
+
},
|
|
11
|
+
children: props.content
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CitationComponentProps } from '../plugins/citations/CitationComponent';
|
|
2
|
+
export default function useCitationsData(props: any): {
|
|
3
|
+
CitationComponent: (props: CitationComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
citationsData: any;
|
|
5
|
+
citationsDataCount: number;
|
|
6
|
+
};
|
|
@@ -11,7 +11,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { useMemo } from 'react';
|
|
14
|
-
import InnerCitationComponent from "
|
|
14
|
+
import InnerCitationComponent from "../plugins/citations/CitationComponent";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
var emptyArray = [];
|
|
17
17
|
var emptyMap = {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
export default function useCursorContent(_ref) {
|
|
3
|
+
var cursor = _ref.cursor,
|
|
4
|
+
content = _ref.content;
|
|
5
|
+
var cursorContent = useMemo(function () {
|
|
6
|
+
if (cursor) {
|
|
7
|
+
if (cursor === 'dot') return ' :dot:';
|
|
8
|
+
if (cursor === 'underline') return ' :underline:';
|
|
9
|
+
return ' :dot:';
|
|
10
|
+
}
|
|
11
|
+
return '';
|
|
12
|
+
}, [cursor, content]);
|
|
13
|
+
return content + cursorContent;
|
|
14
|
+
}
|
|
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useEffect, useRef, useState } from 'react';
|
|
8
|
-
|
|
8
|
+
var useTyping = function useTyping(_ref) {
|
|
9
9
|
var content = _ref.content,
|
|
10
10
|
typing = _ref.typing;
|
|
11
11
|
var _useState = useState(0),
|
|
@@ -29,4 +29,5 @@ export var useTyping = function useTyping(_ref) {
|
|
|
29
29
|
}, [typing]);
|
|
30
30
|
if (!typing) return content;
|
|
31
31
|
return content.slice(0, index);
|
|
32
|
-
};
|
|
32
|
+
};
|
|
33
|
+
export default useTyping;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["content", "cursor"];
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import XMarkdown from '@ant-design/x-markdown';
|
|
11
|
+
import Styles from "../styles";
|
|
12
|
+
import useCursorContent from "./hooks/useCursorContent";
|
|
9
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [enableAnimation, JSON.stringify(animationConfig)]);
|
|
28
|
-
return animatedComponents;
|
|
29
|
-
};
|
|
30
|
-
export default useAnimation;
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
export default function (props) {
|
|
17
|
+
var originalContent = props.content,
|
|
18
|
+
cursor = props.cursor,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
20
|
+
var content = useCursorContent({
|
|
21
|
+
cursor: cursor,
|
|
22
|
+
content: originalContent
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
25
|
+
children: [/*#__PURE__*/_jsx(Styles, {}), /*#__PURE__*/_jsx(XMarkdown, _objectSpread(_objectSpread({}, rest), {}, {
|
|
26
|
+
content: content
|
|
27
|
+
}))]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
;
|
|
@@ -7,7 +7,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
9
9
|
import { createGlobalStyle } from 'antd-style';
|
|
10
|
-
import { useProviderContext } from "
|
|
10
|
+
import { useProviderContext } from "../../../..";
|
|
11
11
|
import { Popover } from 'antd';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -29,10 +29,10 @@ function DefaultRender(props) {
|
|
|
29
29
|
var _useProviderContext = useProviderContext(),
|
|
30
30
|
getPrefixCls = _useProviderContext.getPrefixCls;
|
|
31
31
|
var prefixCls = getPrefixCls('markdown-citation');
|
|
32
|
-
var text = props
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
var text = props['data-text'];
|
|
33
|
+
var url = props['data-url'];
|
|
34
|
+
var title = props['data-title'];
|
|
35
|
+
var content = props['data-content'];
|
|
36
36
|
var isTooltip = content || title;
|
|
37
37
|
var node = /*#__PURE__*/_jsx("sup", {
|
|
38
38
|
className: prefixCls,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { MarkdownProps } from "../../Markdown/interface";
|
|
2
1
|
export { default as CitationComponent } from './CitationComponent';
|
|
3
|
-
export declare function citationsExtension(citationsData:
|
|
2
|
+
export declare function citationsExtension(citationsData: any): {
|
|
4
3
|
name: string;
|
|
5
4
|
level: "inline";
|
|
6
5
|
tokenizer(src: string): {
|
|
@@ -24,7 +24,7 @@ export function citationsExtension(citationsData) {
|
|
|
24
24
|
var text = token.text;
|
|
25
25
|
var citation = citationsData === null || citationsData === void 0 ? void 0 : citationsData[text];
|
|
26
26
|
if (!citation) return token.raw;
|
|
27
|
-
return "<citation text=\"".concat(text, "\" url=\"").concat(citation.url, "\" title=\"").concat(citation.title, "\" content=\"").concat(citation.content, "\"></citation>");
|
|
27
|
+
return "<citation data-text=\"".concat(text, "\" data-url=\"").concat(citation.url, "\" data-title=\"").concat(citation.title, "\" data-content=\"").concat(citation.content, "\"></citation>");
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _templateObject;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import { useProviderContext } from "
|
|
3
|
+
import { useProviderContext } from "../../../..";
|
|
4
4
|
import { createGlobalStyle } from 'antd-style';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _templateObject;
|
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
-
import { useProviderContext } from "
|
|
3
|
+
import { useProviderContext } from "../../../..";
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { createGlobalStyle } from 'antd-style';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import Underline from "./Underline";
|
|
3
2
|
import Dot from "./Dot";
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
4
|
export var CursorComponent = function CursorComponent(props) {
|
|
6
|
-
|
|
5
|
+
var type = props['data-type'];
|
|
6
|
+
if (type === 'dot') {
|
|
7
7
|
return /*#__PURE__*/_jsx(Dot, {});
|
|
8
8
|
}
|
|
9
|
-
if (
|
|
9
|
+
if (type === 'underline') {
|
|
10
10
|
return /*#__PURE__*/_jsx(Underline, {});
|
|
11
11
|
}
|
|
12
12
|
return null;
|
|
@@ -48,7 +48,7 @@ export function cursorExtension() {
|
|
|
48
48
|
};
|
|
49
49
|
},
|
|
50
50
|
renderer: function renderer(token) {
|
|
51
|
-
var content = "<cursor type=\"".concat(token.name, "\"></cursor>");
|
|
51
|
+
var content = "<custom-cursor data-type=\"".concat(token.name, "\"></custom-cursor>");
|
|
52
52
|
return content;
|
|
53
53
|
}
|
|
54
54
|
};
|
package/lib/Markdown/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from './Markdown';
|
|
2
|
+
export type { MarkdownProps, } from './types';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { createGlobalStyle } from 'antd-style';
|
|
4
|
+
export default createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-markdown {\n color: inherit;\n max-width: 100%;\n\n blockquote {\n padding-inline: 0.6em 0;\n padding-block: 0;\n margin: 1em 0;\n border-inline-start: 4px solid ", ";\n opacity: 0.85;\n }\n\n figure {\n margin: 0;\n }\n\n code {\n font-size: 0.8571428571428571em;\n border: 0;\n margin: 0;\n background-color: ", ";\n color: ", ";\n border-radius: ", "px;\n padding: 2px 6px;\n margin-inline: 3px;\n border: 1px solid ", ";\n }\n\n pre code {\n font-size: 0.8571428571428571em;\n background-color: transparent;\n border: none;\n }\n\n pre {\n background-color: ", ";\n padding: 4px 10px;\n border: 1px solid ", ";\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-top: 0.5714285714285714em;\n margin-bottom: 0.5714285714285714em;\n font-weight: 500;\n line-height: 1.7777;\n color: inherit;\n }\n\n p {\n margin-bottom: 0.5714285714285714em;\n }\n\n h1 {\n font-size: 1.2857142857142858em;\n }\n\n h2 {\n font-size: 1.1428571428571428em;\n }\n\n h3 {\n font-size: 1em;\n }\n\n h4 {\n font-size: 1em;\n }\n\n h5 {\n font-size: 1em;\n }\n\n h6 {\n font-size: 1em;\n }\n\n hr {\n border-color: ", ";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin: 1em 0;\n }\n\n table {\n border-collapse: collapse;\n display: block;\n width: max-content;\n max-width: 100%;\n overflow: auto;\n }\n\n table th {\n background: ", ";\n text-align: left;\n }\n\n table td,\n table th {\n padding: 0.75em 1.5em;\n border: 1px solid ", ";\n white-space: pre;\n }\n\n .", "-image {\n max-width: 480px;\n overflow: hidden;\n }\n\n .", "-markdown-video {\n position: relative;\n \n &-poster {\n display: flex;\n align-items: center;\n justify-content: center;\n max-width: 480px;\n background-color: #000;\n border-radius: 8px;\n padding: 100px 0;\n cursor: pointer;\n }\n\n &-play {\n color: #ccc;\n font-size: 30px;\n }\n }\n}\n\n.", "-markdown.x-markdown {\n img {\n margin: 0;\n }\n}\n"])), function (p) {
|
|
5
|
+
return p.theme.prefixCls;
|
|
6
|
+
}, function (p) {
|
|
7
|
+
return p.theme.colorBorder;
|
|
8
|
+
}, function (p) {
|
|
9
|
+
return p.theme.colorFillQuaternary;
|
|
10
|
+
}, function (p) {
|
|
11
|
+
return p.theme.colorText;
|
|
12
|
+
}, function (p) {
|
|
13
|
+
return p.theme.borderRadiusSM;
|
|
14
|
+
}, function (p) {
|
|
15
|
+
return p.theme.colorBorderSecondary;
|
|
16
|
+
}, function (p) {
|
|
17
|
+
return p.theme.colorFillQuaternary;
|
|
18
|
+
}, function (p) {
|
|
19
|
+
return p.theme.colorBorderSecondary;
|
|
20
|
+
}, function (p) {
|
|
21
|
+
return p.theme.colorBorderSecondary;
|
|
22
|
+
}, function (p) {
|
|
23
|
+
return p.theme.colorFillQuaternary;
|
|
24
|
+
}, function (p) {
|
|
25
|
+
return p.theme.colorBorderSecondary;
|
|
26
|
+
}, function (p) {
|
|
27
|
+
return p.theme.prefixCls;
|
|
28
|
+
}, function (p) {
|
|
29
|
+
return p.theme.prefixCls;
|
|
30
|
+
}, function (p) {
|
|
31
|
+
return p.theme.prefixCls;
|
|
32
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { XMarkdownProps } from '@ant-design/x-markdown';
|
|
3
|
+
export interface MarkdownProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 需要渲染的 Markdown 内容
|
|
6
|
+
* @descriptionEn Markdown content to be rendered
|
|
7
|
+
*/
|
|
8
|
+
content?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @description 光标样式类型,支持点状、下划线或布尔值控制
|
|
11
|
+
* @descriptionEn Cursor style type, supports dot, underline, or boolean control
|
|
12
|
+
*/
|
|
13
|
+
cursor?: boolean | 'dot' | 'underline';
|
|
14
|
+
/**
|
|
15
|
+
* @description 基础字体大小,影响整个Markdown内容的字体大小
|
|
16
|
+
* @descriptionEn Base font size that affects the font size of the entire Markdown content
|
|
17
|
+
*/
|
|
18
|
+
baseFontSize?: number;
|
|
19
|
+
/**
|
|
20
|
+
* @description 基础行高,影响文本的行间距
|
|
21
|
+
* @descriptionEn Base line height that affects text line spacing
|
|
22
|
+
*/
|
|
23
|
+
baseLineHeight?: number;
|
|
24
|
+
/**
|
|
25
|
+
* @description 是否允许渲染HTML标签,影响安全性
|
|
26
|
+
* @descriptionEn Whether to allow rendering HTML tags, affects security
|
|
27
|
+
*/
|
|
28
|
+
allowHtml?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* @description 是否禁用图片渲染
|
|
31
|
+
* @descriptionEn Whether to disable image rendering
|
|
32
|
+
*/
|
|
33
|
+
disableImage?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @description 是否以原始文本形式显示,跳过Markdown解析
|
|
36
|
+
* @descriptionEn Whether to display as raw text, skipping Markdown parsing
|
|
37
|
+
*/
|
|
38
|
+
raw?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @description 是否启用打字机效果,逐字显示内容
|
|
41
|
+
* @descriptionEn Whether to enable typewriter effect for character-by-character display
|
|
42
|
+
*/
|
|
43
|
+
typing?: boolean | number;
|
|
44
|
+
/**
|
|
45
|
+
* @description 组件的CSS类名
|
|
46
|
+
* @descriptionEn CSS class name for the component
|
|
47
|
+
*/
|
|
48
|
+
className?: string;
|
|
49
|
+
citations?: {
|
|
50
|
+
title?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
content?: string;
|
|
53
|
+
render?: (props: {
|
|
54
|
+
text: string;
|
|
55
|
+
url: string;
|
|
56
|
+
title: string;
|
|
57
|
+
content: string;
|
|
58
|
+
}) => React.ReactNode;
|
|
59
|
+
}[];
|
|
60
|
+
citationsMap?: Record<string, {
|
|
61
|
+
title?: string;
|
|
62
|
+
url?: string;
|
|
63
|
+
content?: string;
|
|
64
|
+
render?: (props: {
|
|
65
|
+
text: string;
|
|
66
|
+
url: string;
|
|
67
|
+
title: string;
|
|
68
|
+
content: string;
|
|
69
|
+
}) => React.ReactNode;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
export interface InnerMarkdownXProps extends XMarkdownProps {
|
|
73
|
+
/**
|
|
74
|
+
* @description 光标样式类型,支持点状、下划线或布尔值控制
|
|
75
|
+
* @descriptionEn Cursor style type, supports dot, underline, or boolean control
|
|
76
|
+
*/
|
|
77
|
+
cursor?: MarkdownProps['cursor'];
|
|
78
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { ConfigProvider } from 'antd';
|
|
2
2
|
export { default as version } from './Version';
|
|
3
|
-
export * from '@copilotkit/react-core';
|
|
4
|
-
export * from './AGUI';
|
|
5
3
|
export { CustomCardsContext, CustomCardsProvider, default as SparkChatProvider, useCustomCardsContext, useGlobalContext, useProviderContext, } from './Provider';
|
|
6
4
|
export { default as Stream } from './Stream';
|
|
7
5
|
export type { StreamOptions as StreamOptions } from './Stream';
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { ConfigProvider } from 'antd';
|
|
2
2
|
export { default as version } from "./Version";
|
|
3
|
-
export * from '@copilotkit/react-core';
|
|
4
|
-
export * from "./AGUI";
|
|
5
3
|
export { CustomCardsContext, CustomCardsProvider, default as SparkChatProvider, useCustomCardsContext, useGlobalContext, useProviderContext } from "./Provider";
|
|
6
4
|
export { default as Stream } from "./Stream";
|
|
7
5
|
export { createCard } from "./Bubble/Cards";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentscope-ai/chat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.41-beta.1764749089549",
|
|
4
4
|
"description": "a free and open-source chat framework for building excellent LLM-powered chat experiences",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": [
|
|
@@ -64,48 +64,23 @@
|
|
|
64
64
|
"@agentscope-ai/icons-svg-override-antd": "^4.4.2",
|
|
65
65
|
"@ant-design/cssinjs-utils": "^1.1.3",
|
|
66
66
|
"@ant-design/icons": "^5.0.1",
|
|
67
|
-
"@
|
|
68
|
-
"@copilotkit/react-ui": "^1.9.1",
|
|
69
|
-
"@copilotkit/runtime": "^1.9",
|
|
70
|
-
"@copilotkit/runtime-client-gql": "^1.9",
|
|
71
|
-
"@rc-component/motion": "^1.1.4",
|
|
72
|
-
"@react-spring/web": "^10.0.2",
|
|
67
|
+
"@ant-design/x-markdown": "^2.0.0",
|
|
73
68
|
"ahooks": "^3.8.4",
|
|
74
69
|
"antd-style": "^3.7.1",
|
|
75
|
-
"
|
|
70
|
+
"commander": "^12.1.0",
|
|
76
71
|
"copy-to-clipboard": "^3.3.3",
|
|
77
|
-
"cross-fetch": "^4.1.0",
|
|
78
72
|
"dompurify": "^3.2.6",
|
|
79
|
-
"framer-motion": "^12.12.1",
|
|
80
|
-
"html-react-parser": "^5.2.7",
|
|
81
|
-
"html-tags": "^5.1.0",
|
|
82
73
|
"immer": "^10.1.1",
|
|
83
|
-
"katex": "^0.16.22",
|
|
84
74
|
"lodash": "^4.17.21",
|
|
85
|
-
"marked": "^16.2.1",
|
|
86
75
|
"mermaid": "^11.6.0",
|
|
87
|
-
"pretty-ms": "^9.3.0",
|
|
88
76
|
"react-error-boundary": "^6.0.0",
|
|
89
|
-
"react-infinite-scroll-component": "^6.1.0",
|
|
90
|
-
"react-markdown": "^10.1.0",
|
|
91
77
|
"react-syntax-highlighter": "^15.6.6",
|
|
92
78
|
"react-transition-group": "^4.4.5",
|
|
93
|
-
"recorder-core": "^1.3.25011100",
|
|
94
|
-
"rehype-katex": "^7.0.1",
|
|
95
|
-
"rehype-raw": "^7.0.0",
|
|
96
|
-
"remark-breaks": "^4.0.0",
|
|
97
|
-
"remark-gfm": "^4.0.1",
|
|
98
|
-
"remark-math": "^6.0.0",
|
|
99
|
-
"unified": "^11.0.5",
|
|
100
|
-
"unist-util-visit": "^5.0.0",
|
|
101
79
|
"use-context-selector": "^2.0.0",
|
|
102
80
|
"use-stick-to-bottom": "^1.1.1",
|
|
103
81
|
"uuid": "^11.0.5",
|
|
104
82
|
"xstate": "^5.19.4",
|
|
105
|
-
"zustand": "^5.0.3"
|
|
106
|
-
"vite": "^5.4.11",
|
|
107
|
-
"antd": "^5.18.0",
|
|
108
|
-
"commander": "^12.1.0"
|
|
83
|
+
"zustand": "^5.0.3"
|
|
109
84
|
},
|
|
110
85
|
"devDependencies": {
|
|
111
86
|
"@agentscope-ai/dumi-theme-spark": "0.0.98",
|
|
@@ -119,11 +94,10 @@
|
|
|
119
94
|
"@types/react-dom": "^18.0.0",
|
|
120
95
|
"@umijs/lint": "^4.0.0",
|
|
121
96
|
"@umijs/plugins": "^4.4.11",
|
|
97
|
+
"antd": "^5.18.0",
|
|
122
98
|
"dumi": "^2.4.13",
|
|
123
99
|
"esbuild": "^0.19.12",
|
|
124
100
|
"eslint": "^8.23.0",
|
|
125
|
-
"react": "^18.0.0",
|
|
126
|
-
"react-dom": "^18.0.0",
|
|
127
101
|
"father": "^4.1.0",
|
|
128
102
|
"husky": "^8.0.1",
|
|
129
103
|
"lint-staged": "^13.0.3",
|
|
@@ -131,6 +105,8 @@
|
|
|
131
105
|
"prettier": "^2.7.1",
|
|
132
106
|
"prettier-plugin-organize-imports": "^3.0.0",
|
|
133
107
|
"prettier-plugin-packagejson": "^2.2.18",
|
|
108
|
+
"react": "^18.0.0",
|
|
109
|
+
"react-dom": "^18.0.0",
|
|
134
110
|
"stylelint": "^14.9.1",
|
|
135
111
|
"tailwindcss": "^3.4.17",
|
|
136
112
|
"vaso": "^0.4.0"
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export const LifeBuoyIcon = () => (
|
|
4
|
-
<svg
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
width="24"
|
|
7
|
-
height="24"
|
|
8
|
-
viewBox="0 0 24 24"
|
|
9
|
-
fill="none"
|
|
10
|
-
stroke="currentColor"
|
|
11
|
-
strokeWidth="2"
|
|
12
|
-
strokeLinecap="round"
|
|
13
|
-
strokeLinejoin="round"
|
|
14
|
-
className="icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy"
|
|
15
|
-
>
|
|
16
|
-
<g transform="translate(0, -1)">
|
|
17
|
-
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
18
|
-
<path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" />
|
|
19
|
-
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
|
|
20
|
-
<path d="M15 15l3.35 3.35" />
|
|
21
|
-
<path d="M9 15l-3.35 3.35" />
|
|
22
|
-
<path d="M5.65 5.65l3.35 3.35" />
|
|
23
|
-
<path d="M18.35 5.65l-3.35 3.35" />
|
|
24
|
-
</g>
|
|
25
|
-
</svg>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export const CloseIcon = () => (
|
|
29
|
-
<svg
|
|
30
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
-
fill="none"
|
|
32
|
-
viewBox="0 0 24 24"
|
|
33
|
-
strokeWidth="1.5"
|
|
34
|
-
stroke="currentColor"
|
|
35
|
-
width="20"
|
|
36
|
-
height="20"
|
|
37
|
-
>
|
|
38
|
-
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
39
|
-
</svg>
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
export const LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }: { color?: string }) => (
|
|
43
|
-
<svg
|
|
44
|
-
style={{
|
|
45
|
-
animation: "copilotKitSpinAnimation 1s linear infinite",
|
|
46
|
-
color,
|
|
47
|
-
}}
|
|
48
|
-
width="24"
|
|
49
|
-
height="24"
|
|
50
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
-
fill="none"
|
|
52
|
-
viewBox="0 0 24 24"
|
|
53
|
-
>
|
|
54
|
-
<circle
|
|
55
|
-
style={{ opacity: 0.25 }}
|
|
56
|
-
cx="12"
|
|
57
|
-
cy="12"
|
|
58
|
-
r="10"
|
|
59
|
-
stroke="currentColor"
|
|
60
|
-
strokeWidth="4"
|
|
61
|
-
></circle>
|
|
62
|
-
<path
|
|
63
|
-
style={{ opacity: 0.75 }}
|
|
64
|
-
fill="currentColor"
|
|
65
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
66
|
-
></path>
|
|
67
|
-
</svg>
|
|
68
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CopilotKitHelpModal } from "./modal";
|