@ant-design/agentic-ui 2.29.24 → 2.29.26
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/dist/AILabel/index.js +1 -1
- package/dist/AgentRunBar/Robot.js +1 -1
- package/dist/AgentRunBar/index.js +1 -1
- package/dist/AgenticLayout/index.js +1 -1
- package/dist/AnswerAlert/index.js +1 -1
- package/dist/BackTo/ScrollVisibleButton.js +1 -1
- package/dist/Bubble/AIBubble.js +1 -1
- package/dist/Bubble/Avatar/index.js +1 -1
- package/dist/Bubble/BubbleConfigProvide.d.ts +3 -2
- package/dist/Bubble/BubbleConfigProvide.js +1 -2
- package/dist/Bubble/List/PureBubbleList.d.ts +4 -4
- package/dist/Bubble/List/PureBubbleList.js +1 -1
- package/dist/Bubble/List/index.d.ts +5 -5
- package/dist/Bubble/List/index.js +1 -1
- package/dist/Bubble/MessagesContent/BubbleExtra.js +27 -32
- package/dist/Bubble/MessagesContent/CopyButton/index.js +5 -4
- package/dist/Bubble/MessagesContent/DocInfo.js +1 -1
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +4 -1
- package/dist/Bubble/MessagesContent/VoiceButton/index.js +1 -1
- package/dist/Bubble/MessagesContent/index.js +1 -1
- package/dist/Bubble/PureBubble.js +1 -1
- package/dist/Bubble/Title.js +1 -1
- package/dist/Bubble/UserBubble.js +1 -1
- package/dist/Bubble/type.d.ts +96 -8
- package/dist/Bubble/types/BubbleExtra.d.ts +6 -4
- package/dist/ChatBootPage/ButtonTab.js +1 -1
- package/dist/ChatBootPage/CaseReply.js +1 -1
- package/dist/ChatBootPage/Title.js +1 -1
- package/dist/ChatLayout/index.js +1 -1
- package/dist/Components/ActionIconBox/index.d.ts +1 -1
- package/dist/Components/ActionIconBox/index.js +2 -2
- package/dist/Components/ActionItemBox/ActionItemBox.js +1 -1
- package/dist/Components/Button/IconButton/index.d.ts +1 -1
- package/dist/Components/Button/IconButton/index.js +1 -1
- package/dist/Components/Button/SwitchButton/index.js +1 -1
- package/dist/Components/Button/ToggleButton/index.js +1 -1
- package/dist/Components/GradientText/index.js +1 -1
- package/dist/Components/LayoutHeader/index.js +1 -1
- package/dist/Components/Loading/Loading.js +2 -2
- package/dist/Components/Robot/index.js +1 -1
- package/dist/Components/SuggestionList/index.js +1 -1
- package/dist/Components/TextAnimate/index.js +2 -2
- package/dist/Components/TypingAnimation/index.js +2 -2
- package/dist/Components/VisualList/index.d.ts +1 -1
- package/dist/Components/VisualList/index.js +1 -1
- package/dist/Components/lotties/TextLoading/index.js +1 -1
- package/dist/Components/lotties/bubble-actions/Abstract/index.js +1 -1
- package/dist/History/components/NewChatComponent.d.ts +1 -1
- package/dist/History/components/NewChatComponent.js +1 -1
- package/dist/History/components/SearchComponent.d.ts +1 -1
- package/dist/History/components/SearchComponent.js +1 -1
- package/dist/History/index.js +3 -3
- package/dist/History/menu.js +1 -1
- package/dist/History/types/index.d.ts +5 -5
- package/dist/History/types/index.js +1 -1
- package/dist/Hooks/useLanguage.d.ts +16 -0
- package/dist/I18n/index.d.ts +10 -0
- package/dist/I18n/index.js +46 -0
- package/dist/I18n/locales.d.ts +16 -0
- package/dist/I18n/locales.js +43 -5
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +1 -1
- package/dist/MarkdownEditor/editor/Editor.js +1 -1
- package/dist/MarkdownEditor/editor/components/CommentList/index.js +6 -4
- package/dist/MarkdownEditor/editor/components/ContributorAvatar/index.js +1 -1
- package/dist/MarkdownEditor/editor/components/fntTag/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Comment/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/FncLeaf/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Head/ReadonlyHead.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Head/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/LinkCard/ReadonlyLinkCard.js +1 -1
- package/dist/MarkdownEditor/editor/elements/LinkCard/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/List/List.js +1 -1
- package/dist/MarkdownEditor/editor/elements/List/ListItem.js +1 -1
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyList.js +1 -1
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyListItem.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Mermaid/ReadonlyMermaid.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Mermaid/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Paragraph/ReadonlyParagraph.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/ReadonlyTableComponent.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/SimpleTable.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndex/index.js +7 -5
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndexSpacer/index.js +7 -5
- package/dist/MarkdownEditor/editor/elements/Table/TableRowIndex/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/Table/Td/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/index.js +1 -1
- package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +1 -1
- package/dist/MarkdownEditor/editor/tools/DragHandle.js +4 -2
- package/dist/MarkdownEditor/editor/tools/InsertAutocomplete.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/BaseBar.js +3 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/FloatBar.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/ReadonlyBaseBar.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/ToolBar.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/ClearFormatButton.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/ColorPickerButton.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/FormatButton.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/FormattingTools.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/HeadingDropdown.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/LinkButton.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/UndoRedoButtons.js +1 -1
- package/dist/MarkdownEditor/el.d.ts +1 -1
- package/dist/MarkdownEditor/types.d.ts +103 -3
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +10 -7
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/index.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/index.js +1 -1
- package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +1 -1
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +2 -2
- package/dist/MarkdownInputField/FileMapView/index.js +1 -1
- package/dist/MarkdownInputField/MarkdownInputField.js +1 -1
- package/dist/MarkdownInputField/QuickActions/index.js +1 -1
- package/dist/MarkdownInputField/SendActions/index.js +1 -1
- package/dist/MarkdownInputField/SendButton/index.js +1 -1
- package/dist/MarkdownInputField/SkillModeBar/index.js +1 -1
- package/dist/MarkdownInputField/TopOperatingArea/index.js +1 -1
- package/dist/MarkdownInputField/VoiceInput/index.js +1 -1
- package/dist/Plugins/chart/AreaChart/index.js +1 -1
- package/dist/Plugins/chart/BarChart/index.js +1 -1
- package/dist/Plugins/chart/DonutChart/index.js +1 -1
- package/dist/Plugins/chart/FunnelChart/index.js +1 -1
- package/dist/Plugins/chart/LineChart/index.js +1 -1
- package/dist/Plugins/chart/RadarChart/index.js +1 -1
- package/dist/Plugins/chart/ScatterChart/index.js +1 -1
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +1 -1
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +736 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.js +23 -5
- package/dist/Plugins/code/CodeUI/Katex/Katex.js +1 -1
- package/dist/Plugins/code/components/CodeContainer.js +1 -1
- package/dist/Plugins/katex/InlineKatex.js +1 -1
- package/dist/Plugins/katex/Katex.js +1 -1
- package/dist/Plugins/mermaid/MermaidFallback.js +1 -1
- package/dist/Plugins/mermaid/MermaidRendererImpl.js +1 -1
- package/dist/Plugins/mermaid/index.js +3 -2
- package/dist/Quote/index.js +1 -1
- package/dist/Schema/SchemaEditor/index.js +1 -1
- package/dist/Schema/SchemaForm/index.js +2 -2
- package/dist/TaskList/index.d.ts +6 -2
- package/dist/TaskList/index.js +1 -1
- package/dist/ThoughtChainList/DeepThink.d.ts +1 -1
- package/dist/ThoughtChainList/DotAni/index.js +1 -1
- package/dist/ThoughtChainList/FlipText/index.js +1 -1
- package/dist/ThoughtChainList/TableSql.d.ts +1 -1
- package/dist/ThoughtChainList/ThoughtChainListItem.js +1 -1
- package/dist/ThoughtChainList/TitleInfo.js +1 -1
- package/dist/ThoughtChainList/ToolCall.d.ts +1 -1
- package/dist/ThoughtChainList/WebSearch.d.ts +1 -1
- package/dist/ThoughtChainList/index.js +7 -18
- package/dist/ThoughtChainList/style.js +11 -0
- package/dist/ThoughtChainList/types.d.ts +11 -1
- package/dist/ToolUseBar/BarItem/Content.js +1 -1
- package/dist/ToolUseBar/BarItem/index.js +1 -1
- package/dist/ToolUseBar/index.js +1 -1
- package/dist/ToolUseBarThink/index.js +1 -1
- package/dist/Types/message.d.ts +12 -3
- package/dist/WelcomeMessage/index.js +1 -1
- package/dist/Workspace/Browser/index.js +1 -1
- package/dist/Workspace/File/FileComponent.d.ts +1 -1
- package/dist/Workspace/File/FileComponent.js +1 -1
- package/dist/Workspace/File/PreviewComponent.js +2 -2
- package/dist/Workspace/HtmlPreview/index.js +1 -1
- package/dist/Workspace/RealtimeFollow/index.js +1 -1
- package/dist/Workspace/Task/index.js +1 -1
- package/dist/Workspace/index.js +1 -1
- package/dist/Workspace/types.d.ts +2 -2
- package/dist/index.d.ts +68 -62
- package/dist/index.js +84 -79
- package/package.json +2 -7
package/dist/AILabel/index.js
CHANGED
|
@@ -133,7 +133,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
133
133
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
134
134
|
}
|
|
135
135
|
import { ConfigProvider, Tooltip } from "antd";
|
|
136
|
-
import classNames from "
|
|
136
|
+
import classNames from "clsx";
|
|
137
137
|
import React, { memo, useContext, useMemo, useState } from "react";
|
|
138
138
|
import { AIGraphic } from "./AIGraphic";
|
|
139
139
|
import { AIGraphicDisabled } from "./AIGraphicDisabled";
|
|
@@ -13,7 +13,7 @@ function _define_property(obj, key, value) {
|
|
|
13
13
|
}
|
|
14
14
|
import { PlusOutlined } from "@ant-design/icons";
|
|
15
15
|
import { Button, ConfigProvider, Tooltip, Typography } from "antd";
|
|
16
|
-
import classNames from "
|
|
16
|
+
import classNames from "clsx";
|
|
17
17
|
import { motion } from "framer-motion";
|
|
18
18
|
import React, { memo, useContext, useMemo } from "react";
|
|
19
19
|
import { I18nContext } from "../I18n";
|
|
@@ -97,7 +97,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
97
97
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
98
98
|
}
|
|
99
99
|
import { ConfigProvider } from "antd";
|
|
100
|
-
import classNames from "
|
|
100
|
+
import classNames from "clsx";
|
|
101
101
|
import React, { memo, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
102
102
|
import { LayoutHeader } from "../Components/LayoutHeader";
|
|
103
103
|
import { useAgenticLayoutStyle } from "./style";
|
|
@@ -58,7 +58,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
58
58
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
59
59
|
}
|
|
60
60
|
import { ConfigProvider } from "antd";
|
|
61
|
-
import classNames from "
|
|
61
|
+
import classNames from "clsx";
|
|
62
62
|
import React, { isValidElement, memo, useCallback, useContext, useState } from "react";
|
|
63
63
|
import { CloseIcon } from "./components/CloseIcon";
|
|
64
64
|
import { ErrorIcon } from "./components/ErrorIcon";
|
|
@@ -115,7 +115,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
115
115
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
116
116
|
}
|
|
117
117
|
import { ConfigProvider, Tooltip } from "antd";
|
|
118
|
-
import classNames from "
|
|
118
|
+
import classNames from "clsx";
|
|
119
119
|
import { AnimatePresence, motion } from "framer-motion";
|
|
120
120
|
import { isObject } from "lodash-es";
|
|
121
121
|
import React, { forwardRef, isValidElement, useContext, useImperativeHandle } from "react";
|
package/dist/Bubble/AIBubble.js
CHANGED
|
@@ -214,7 +214,7 @@ function _ts_generator(thisArg, body) {
|
|
|
214
214
|
}
|
|
215
215
|
import { memo, useContext } from "react";
|
|
216
216
|
import { ConfigProvider, Flex } from "antd";
|
|
217
|
-
import cx from "
|
|
217
|
+
import cx from "clsx";
|
|
218
218
|
import React from "react";
|
|
219
219
|
import { BubbleAvatar } from "./Avatar";
|
|
220
220
|
import { BubbleBeforeNode } from "./BubbleBeforeNode";
|
|
@@ -87,7 +87,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
87
87
|
return target;
|
|
88
88
|
}
|
|
89
89
|
import { Avatar, theme } from "antd";
|
|
90
|
-
import cx from "
|
|
90
|
+
import cx from "clsx";
|
|
91
91
|
import React from "react";
|
|
92
92
|
import { isEmoji } from "./isEmoji";
|
|
93
93
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { LocalKeys } from '../I18n';
|
|
3
3
|
import { ThoughtChainListProps } from '../ThoughtChainList/types';
|
|
4
4
|
import { BubbleProps } from './type';
|
|
5
5
|
export type ChatConfigType = {
|
|
@@ -18,7 +18,8 @@ export type ChatConfigType = {
|
|
|
18
18
|
*/
|
|
19
19
|
enable: boolean;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
/** 可选覆盖,与 I18nContext 合并时优先生效,国际化主数据源为 I18nContext */
|
|
22
|
+
locale?: Partial<LocalKeys>;
|
|
22
23
|
bubble?: BubbleProps<{
|
|
23
24
|
/**
|
|
24
25
|
* 聊天内容
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
import type { BubbleMetaData, BubbleProps, MessageBubbleData } from '../type';
|
|
2
|
+
import type { BubbleImperativeHandle, BubbleMetaData, BubbleProps, MessageBubbleData } from '../type';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
export interface PureBubbleListProps {
|
|
5
5
|
bubbleList: MessageBubbleData[];
|
|
6
6
|
readonly?: boolean;
|
|
7
7
|
bubbleListRef?: MutableRefObject<HTMLDivElement | null>;
|
|
8
|
-
bubbleRef?: MutableRefObject<
|
|
8
|
+
bubbleRef?: MutableRefObject<BubbleImperativeHandle | null | undefined>;
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
className?: string;
|
|
11
11
|
bubbleRenderConfig?: BubbleProps['bubbleRenderConfig'];
|
|
@@ -17,14 +17,14 @@ export interface PureBubbleListProps {
|
|
|
17
17
|
markdownRenderConfig?: BubbleProps['markdownRenderConfig'];
|
|
18
18
|
docListProps?: BubbleProps['docListProps'];
|
|
19
19
|
/**
|
|
20
|
-
* @deprecated 请使用 onDislike 替代(符合命名规范)
|
|
20
|
+
* @deprecated @since 2.29.0 请使用 onDislike 替代(符合命名规范)
|
|
21
21
|
*/
|
|
22
22
|
onDisLike?: BubbleProps['onDisLike'];
|
|
23
23
|
/** 不喜欢回调 */
|
|
24
24
|
onDislike?: BubbleProps['onDislike'];
|
|
25
25
|
onLike?: BubbleProps['onLike'];
|
|
26
26
|
/**
|
|
27
|
-
* @deprecated 请使用 onLikeCancel 替代(符合命名规范)
|
|
27
|
+
* @deprecated @since 2.29.0 请使用 onLikeCancel 替代(符合命名规范)
|
|
28
28
|
*/
|
|
29
29
|
onCancelLike?: BubbleProps['onCancelLike'];
|
|
30
30
|
/** Like 子组件取消事件 */
|
|
@@ -53,7 +53,7 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
import SkeletonList from "./SkeletonList";
|
|
54
54
|
import { useContext, useMemo, useRef } from "react";
|
|
55
55
|
import { ConfigProvider } from "antd";
|
|
56
|
-
import cx from "
|
|
56
|
+
import cx from "clsx";
|
|
57
57
|
import { nanoid } from "nanoid";
|
|
58
58
|
import React from "react";
|
|
59
59
|
import { LazyElement } from "../../MarkdownEditor/editor/components/LazyElement";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PureBubbleList } from './PureBubbleList';
|
|
2
2
|
import { MutableRefObject } from 'react';
|
|
3
|
-
import type { BubbleMetaData, BubbleProps, MessageBubbleData } from '../type';
|
|
3
|
+
import type { BubbleImperativeHandle, BubbleMetaData, BubbleProps, MessageBubbleData } from '../type';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
export type BubbleListProps = {
|
|
6
6
|
/**
|
|
@@ -12,9 +12,9 @@ export type BubbleListProps = {
|
|
|
12
12
|
* 聊天列表的引用
|
|
13
13
|
*/
|
|
14
14
|
bubbleListRef?: MutableRefObject<HTMLDivElement | null>;
|
|
15
|
-
bubbleRef?: MutableRefObject<
|
|
15
|
+
bubbleRef?: MutableRefObject<BubbleImperativeHandle | null | undefined>;
|
|
16
16
|
/**
|
|
17
|
-
* @deprecated 请使用 isLoading 代替
|
|
17
|
+
* @deprecated @since 2.29.0 请使用 isLoading 代替
|
|
18
18
|
* @description 已废弃,将在未来版本移除
|
|
19
19
|
*/
|
|
20
20
|
loading?: boolean;
|
|
@@ -148,14 +148,14 @@ export type BubbleListProps = {
|
|
|
148
148
|
bubbleListItemAvatarClassName?: string;
|
|
149
149
|
};
|
|
150
150
|
/**
|
|
151
|
-
* @deprecated 请使用 onDislike 替代(符合命名规范)
|
|
151
|
+
* @deprecated @since 2.29.0 请使用 onDislike 替代(符合命名规范)
|
|
152
152
|
*/
|
|
153
153
|
onDisLike?: BubbleProps['onDisLike'];
|
|
154
154
|
/** 不喜欢回调 */
|
|
155
155
|
onDislike?: BubbleProps['onDislike'];
|
|
156
156
|
onLike?: BubbleProps['onLike'];
|
|
157
157
|
/**
|
|
158
|
-
* @deprecated 请使用 onLikeCancel 替代(符合命名规范)
|
|
158
|
+
* @deprecated @since 2.29.0 请使用 onLikeCancel 替代(符合命名规范)
|
|
159
159
|
*/
|
|
160
160
|
onCancelLike?: BubbleProps['onCancelLike'];
|
|
161
161
|
/** Like 子组件取消事件 */
|
|
@@ -54,7 +54,7 @@ import SkeletonList from "./SkeletonList";
|
|
|
54
54
|
export { PureBubbleList } from "./PureBubbleList";
|
|
55
55
|
import { useContext, useMemo, useRef } from "react";
|
|
56
56
|
import { ConfigProvider } from "antd";
|
|
57
|
-
import cx from "
|
|
57
|
+
import cx from "clsx";
|
|
58
58
|
import { nanoid } from "nanoid";
|
|
59
59
|
import React from "react";
|
|
60
60
|
import { LazyElement } from "../../MarkdownEditor/editor/components/LazyElement";
|
|
@@ -263,12 +263,13 @@ function _ts_generator(thisArg, body) {
|
|
|
263
263
|
import { CopyLottie, DislikeLottie, LikeLottie, RefreshLottie } from "../..";
|
|
264
264
|
import { DislikeFilled, LikeFilled } from "@ant-design/icons";
|
|
265
265
|
import { ConfigProvider, Divider } from "antd";
|
|
266
|
-
import classNames from "
|
|
266
|
+
import classNames from "clsx";
|
|
267
267
|
import copy from "copy-to-clipboard";
|
|
268
268
|
import { motion } from "framer-motion";
|
|
269
269
|
import React, { useContext, useEffect, useMemo, useState } from "react";
|
|
270
270
|
import { ActionIconBox } from "../../Components/ActionIconBox";
|
|
271
271
|
import { Loading } from "../../Components/Loading";
|
|
272
|
+
import { useMergedLocale } from "../../I18n";
|
|
272
273
|
import { BubbleConfigContext } from "../BubbleConfigProvide";
|
|
273
274
|
import { CopyButton } from "./CopyButton";
|
|
274
275
|
import { VoiceButton } from "./VoiceButton";
|
|
@@ -303,9 +304,10 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
303
304
|
"pure",
|
|
304
305
|
"placement"
|
|
305
306
|
]);
|
|
306
|
-
var _originalData_extra, _originalData_extra1, _originalData_extra2, _originalData_extra3, _bubble_originData, _bubble_originData1, _props_rightRender
|
|
307
|
+
var _originalData_extra, _originalData_extra1, _originalData_extra2, _originalData_extra3, _bubble_originData, _bubble_originData1, _props_rightRender;
|
|
307
308
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
308
309
|
var context = useContext(BubbleConfigContext);
|
|
310
|
+
var locale = useMergedLocale(context === null || context === void 0 ? void 0 : context.locale);
|
|
309
311
|
var _useState = _sliced_to_array(useState(false), 2), feedbackLoading = _useState[0], setFeedbackLoading = _useState[1];
|
|
310
312
|
// 获取聊天项的原始数据
|
|
311
313
|
var originalData = bubble === null || bubble === void 0 ? void 0 : bubble.originData;
|
|
@@ -325,35 +327,30 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
325
327
|
if (alreadyFeedback && (originalData === null || originalData === void 0 ? void 0 : originalData.feedback) === 'thumbsUp') {
|
|
326
328
|
// 已经点赞的情况
|
|
327
329
|
if (props.onLikeCancel || props.onCancelLike) {
|
|
328
|
-
|
|
329
|
-
return (context === null || context === void 0 ? void 0 : (_context_locale = context.locale) === null || _context_locale === void 0 ? void 0 : _context_locale['chat.message.cancel-like']) || '取消点赞';
|
|
330
|
+
return (locale === null || locale === void 0 ? void 0 : locale['chat.message.cancel-like']) || '取消点赞';
|
|
330
331
|
} else {
|
|
331
|
-
|
|
332
|
-
return (context === null || context === void 0 ? void 0 : (_context_locale1 = context.locale) === null || _context_locale1 === void 0 ? void 0 : _context_locale1['chat.message.feedback-success']) || '已经反馈过了哦';
|
|
332
|
+
return (locale === null || locale === void 0 ? void 0 : locale['chat.message.feedback-success']) || '已经反馈过了哦';
|
|
333
333
|
}
|
|
334
334
|
} else {
|
|
335
|
-
var _context_locale2;
|
|
336
335
|
// 未点赞的情况
|
|
337
|
-
return (
|
|
336
|
+
return (locale === null || locale === void 0 ? void 0 : locale['chat.message.like']) || '喜欢';
|
|
338
337
|
}
|
|
339
338
|
}, [
|
|
340
339
|
alreadyFeedback,
|
|
341
340
|
originalData === null || originalData === void 0 ? void 0 : originalData.feedback,
|
|
342
341
|
!!(props.onLikeCancel || props.onCancelLike),
|
|
343
|
-
|
|
342
|
+
locale
|
|
344
343
|
]);
|
|
345
344
|
// 获取点踩按钮的标题文本
|
|
346
345
|
var getDislikeButtonTitle = useMemo(function() {
|
|
347
346
|
if (alreadyFeedback) {
|
|
348
|
-
|
|
349
|
-
return (context === null || context === void 0 ? void 0 : (_context_locale = context.locale) === null || _context_locale === void 0 ? void 0 : _context_locale['chat.message.feedback-success']) || '已经反馈过了哦';
|
|
347
|
+
return (locale === null || locale === void 0 ? void 0 : locale['chat.message.feedback-success']) || '已经反馈过了哦';
|
|
350
348
|
} else {
|
|
351
|
-
|
|
352
|
-
return (context === null || context === void 0 ? void 0 : (_context_locale1 = context.locale) === null || _context_locale1 === void 0 ? void 0 : _context_locale1['chat.message.dislike']) || '不喜欢';
|
|
349
|
+
return (locale === null || locale === void 0 ? void 0 : locale['chat.message.dislike']) || '不喜欢';
|
|
353
350
|
}
|
|
354
351
|
}, [
|
|
355
352
|
alreadyFeedback,
|
|
356
|
-
|
|
353
|
+
locale
|
|
357
354
|
]);
|
|
358
355
|
var typing = (originalData === null || originalData === void 0 ? void 0 : originalData.isAborted) !== true && (originalData === null || originalData === void 0 ? void 0 : originalData.isFinished) === false && (originalData === null || originalData === void 0 ? void 0 : (_originalData_extra2 = originalData.extra) === null || _originalData_extra2 === void 0 ? void 0 : _originalData_extra2.isHistory) === undefined && (originalData === null || originalData === void 0 ? void 0 : originalData.isFinished) !== undefined;
|
|
359
356
|
var like = useMemo(function() {
|
|
@@ -551,8 +548,8 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
551
548
|
* @constant
|
|
552
549
|
* @type {boolean}
|
|
553
550
|
*/ var shouldShowCopy = useMemo(function() {
|
|
554
|
-
var _originalData_extra
|
|
555
|
-
var defaultConditions = (originalData === null || originalData === void 0 ? void 0 : originalData.content) && !(originalData === null || originalData === void 0 ? void 0 : (_originalData_extra = originalData.extra) === null || _originalData_extra === void 0 ? void 0 : _originalData_extra.answerStatus) && (originalData === null || originalData === void 0 ? void 0 : originalData.content) !== ((
|
|
551
|
+
var _originalData_extra;
|
|
552
|
+
var defaultConditions = (originalData === null || originalData === void 0 ? void 0 : originalData.content) && !(originalData === null || originalData === void 0 ? void 0 : (_originalData_extra = originalData.extra) === null || _originalData_extra === void 0 ? void 0 : _originalData_extra.answerStatus) && (originalData === null || originalData === void 0 ? void 0 : originalData.content) !== ((locale === null || locale === void 0 ? void 0 : locale['chat.message.aborted']) || '回答已停止生成');
|
|
556
553
|
if (!defaultConditions) {
|
|
557
554
|
return false;
|
|
558
555
|
}
|
|
@@ -567,13 +564,12 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
567
564
|
bubble,
|
|
568
565
|
originalData === null || originalData === void 0 ? void 0 : originalData.content,
|
|
569
566
|
originalData === null || originalData === void 0 ? void 0 : (_originalData_extra3 = originalData.extra) === null || _originalData_extra3 === void 0 ? void 0 : _originalData_extra3.answerStatus,
|
|
570
|
-
|
|
567
|
+
locale
|
|
571
568
|
]);
|
|
572
569
|
var copyDom = useMemo(function() {
|
|
573
|
-
var _context_locale;
|
|
574
570
|
return shouldShowCopy ? /*#__PURE__*/ React.createElement(CopyButton, {
|
|
575
571
|
"data-testid": "chat-item-copy-button",
|
|
576
|
-
title: (
|
|
572
|
+
title: (locale === null || locale === void 0 ? void 0 : locale['chat.message.copy']) || '复制',
|
|
577
573
|
onClick: function onClick() {
|
|
578
574
|
try {
|
|
579
575
|
var _bubble_originData;
|
|
@@ -591,11 +587,11 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
591
587
|
}) : null;
|
|
592
588
|
}, [
|
|
593
589
|
shouldShowCopy,
|
|
594
|
-
|
|
590
|
+
locale,
|
|
595
591
|
(_bubble_originData = bubble.originData) === null || _bubble_originData === void 0 ? void 0 : _bubble_originData.content
|
|
596
592
|
]);
|
|
597
593
|
var voiceDom = useMemo(function() {
|
|
598
|
-
var _originalData_extra,
|
|
594
|
+
var _originalData_extra, _bubble_originData;
|
|
599
595
|
/**
|
|
600
596
|
* 判断是否应该显示语音选项。
|
|
601
597
|
*
|
|
@@ -604,7 +600,7 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
604
600
|
* - 聊天项的原始数据包含内容
|
|
605
601
|
* - 聊天项的原始数据在额外字段中没有回答状态
|
|
606
602
|
* - 聊天项的内容不等于本地化的 'chat.message.aborted' 消息或其默认值 '回答已停止生成'
|
|
607
|
-
* */ var defaultShow = !!(originalData === null || originalData === void 0 ? void 0 : originalData.content) && !(originalData === null || originalData === void 0 ? void 0 : (_originalData_extra = originalData.extra) === null || _originalData_extra === void 0 ? void 0 : _originalData_extra.answerStatus) && !typing && (originalData === null || originalData === void 0 ? void 0 : originalData.content) !== ((
|
|
603
|
+
* */ var defaultShow = !!(originalData === null || originalData === void 0 ? void 0 : originalData.content) && !(originalData === null || originalData === void 0 ? void 0 : (_originalData_extra = originalData.extra) === null || _originalData_extra === void 0 ? void 0 : _originalData_extra.answerStatus) && !typing && (originalData === null || originalData === void 0 ? void 0 : originalData.content) !== ((locale === null || locale === void 0 ? void 0 : locale['chat.message.aborted']) || '回答已停止生成');
|
|
608
604
|
if (!props.shouldShowVoice || !defaultShow) return null;
|
|
609
605
|
return /*#__PURE__*/ React.createElement(VoiceButton, {
|
|
610
606
|
text: ((_bubble_originData = bubble.originData) === null || _bubble_originData === void 0 ? void 0 : _bubble_originData.content) || '',
|
|
@@ -663,11 +659,10 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
663
659
|
prefixCls
|
|
664
660
|
]);
|
|
665
661
|
var reSend = useMemo(function() {
|
|
666
|
-
var _originalData_extra_preMessage, _originalData_extra
|
|
662
|
+
var _originalData_extra_preMessage, _originalData_extra;
|
|
667
663
|
console.log('originalData?.isAborted', originalData, typing);
|
|
668
664
|
if ((originalData === null || originalData === void 0 ? void 0 : originalData.isAborted) && !originalData.isFinished) {
|
|
669
|
-
|
|
670
|
-
return /*#__PURE__*/ React.createElement("span", null, (context === null || context === void 0 ? void 0 : (_context_locale1 = context.locale) === null || _context_locale1 === void 0 ? void 0 : _context_locale1['chat.message.aborted']) || '回答已停止生成');
|
|
665
|
+
return /*#__PURE__*/ React.createElement("span", null, (locale === null || locale === void 0 ? void 0 : locale['chat.message.aborted']) || '回答已停止生成');
|
|
671
666
|
}
|
|
672
667
|
if (!(originalData === null || originalData === void 0 ? void 0 : (_originalData_extra = originalData.extra) === null || _originalData_extra === void 0 ? void 0 : (_originalData_extra_preMessage = _originalData_extra.preMessage) === null || _originalData_extra_preMessage === void 0 ? void 0 : _originalData_extra_preMessage.content)) return null;
|
|
673
668
|
if (typing) return null;
|
|
@@ -676,29 +671,29 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
676
671
|
borderLess: true,
|
|
677
672
|
onClick: function onClick() {
|
|
678
673
|
return _async_to_generator(function() {
|
|
679
|
-
var _bubble_originData_extra_preMessage, _bubble_originData_extra, _bubble_originData
|
|
674
|
+
var _bubble_originData_extra_preMessage, _bubble_originData_extra, _bubble_originData;
|
|
680
675
|
return _ts_generator(this, function(_state) {
|
|
681
|
-
onReply === null || onReply === void 0 ? void 0 : onReply(((_bubble_originData = bubble.originData) === null || _bubble_originData === void 0 ? void 0 : (_bubble_originData_extra = _bubble_originData.extra) === null || _bubble_originData_extra === void 0 ? void 0 : (_bubble_originData_extra_preMessage = _bubble_originData_extra.preMessage) === null || _bubble_originData_extra_preMessage === void 0 ? void 0 : _bubble_originData_extra_preMessage.content) || (
|
|
676
|
+
onReply === null || onReply === void 0 ? void 0 : onReply(((_bubble_originData = bubble.originData) === null || _bubble_originData === void 0 ? void 0 : (_bubble_originData_extra = _bubble_originData.extra) === null || _bubble_originData_extra === void 0 ? void 0 : (_bubble_originData_extra_preMessage = _bubble_originData_extra.preMessage) === null || _bubble_originData_extra_preMessage === void 0 ? void 0 : _bubble_originData_extra_preMessage.content) || (locale === null || locale === void 0 ? void 0 : locale['chat.message.retrySend']) || '重新生成');
|
|
682
677
|
return [
|
|
683
678
|
2
|
|
684
679
|
];
|
|
685
680
|
});
|
|
686
681
|
})();
|
|
687
682
|
},
|
|
688
|
-
title: (
|
|
683
|
+
title: (locale === null || locale === void 0 ? void 0 : locale['chat.message.retrySend']) || '重新生成'
|
|
689
684
|
}, function(isHovered) {
|
|
690
|
-
var _context_locale;
|
|
691
685
|
return /*#__PURE__*/ React.createElement("div", {
|
|
692
686
|
className: classNames("".concat(chatCls, "-messages-content-retry")),
|
|
693
687
|
"data-messages-content-retry": true
|
|
694
688
|
}, /*#__PURE__*/ React.createElement(RefreshLottie, {
|
|
695
689
|
active: isHovered
|
|
696
|
-
}), /*#__PURE__*/ React.createElement("span", null, (
|
|
690
|
+
}), /*#__PURE__*/ React.createElement("span", null, (locale === null || locale === void 0 ? void 0 : locale['chat.message.retrySend']) || '重新生成'));
|
|
697
691
|
});
|
|
698
692
|
}, [
|
|
699
693
|
originalData === null || originalData === void 0 ? void 0 : originalData.isAborted,
|
|
700
694
|
typing,
|
|
701
|
-
originalData === null || originalData === void 0 ? void 0 : originalData.isFinished
|
|
695
|
+
originalData === null || originalData === void 0 ? void 0 : originalData.isFinished,
|
|
696
|
+
locale
|
|
702
697
|
]);
|
|
703
698
|
useEffect(function() {
|
|
704
699
|
var _props_onRenderExtraNull;
|
|
@@ -758,5 +753,5 @@ import { VoiceButton } from "./VoiceButton";
|
|
|
758
753
|
style: {
|
|
759
754
|
fontSize: (context === null || context === void 0 ? void 0 : context.compact) ? 20 : 16
|
|
760
755
|
}
|
|
761
|
-
}), /*#__PURE__*/ React.createElement("span", null, (
|
|
756
|
+
}), /*#__PURE__*/ React.createElement("span", null, (locale === null || locale === void 0 ? void 0 : locale['chat.message.generating']) || '')) : null, reSend || null, (originalData === null || originalData === void 0 ? void 0 : originalData.isAborted) ? copyDom : rightDom);
|
|
762
757
|
};
|
|
@@ -216,10 +216,11 @@ function _ts_generator(thisArg, body) {
|
|
|
216
216
|
}
|
|
217
217
|
import { memo, useContext } from "react";
|
|
218
218
|
import { CheckCircleFilled } from "@ant-design/icons";
|
|
219
|
-
import { isFunction } from "lodash";
|
|
219
|
+
import { isFunction } from "lodash-es";
|
|
220
220
|
import React from "react";
|
|
221
221
|
import { ActionIconBox } from "../../../Components/ActionIconBox";
|
|
222
222
|
import { useCopied } from "../../../Hooks/useCopied";
|
|
223
|
+
import { useMergedLocale } from "../../../I18n";
|
|
223
224
|
import { BubbleConfigContext } from "../../BubbleConfigProvide";
|
|
224
225
|
/**
|
|
225
226
|
* CopyIcon 组件 - 复制图标组件
|
|
@@ -309,10 +310,10 @@ import { BubbleConfigContext } from "../../BubbleConfigProvide";
|
|
|
309
310
|
"onClick",
|
|
310
311
|
'data-testid'
|
|
311
312
|
]);
|
|
312
|
-
var
|
|
313
|
+
var _useContext;
|
|
313
314
|
var _useCopied = useCopied(), copied = _useCopied.copied, setCopied = _useCopied.setCopied;
|
|
314
|
-
var
|
|
315
|
-
var copySuccessText = (
|
|
315
|
+
var locale = useMergedLocale((_useContext = useContext(BubbleConfigContext)) === null || _useContext === void 0 ? void 0 : _useContext.locale);
|
|
316
|
+
var copySuccessText = (locale === null || locale === void 0 ? void 0 : locale['chat.message.copy.success']) || '复制成功';
|
|
316
317
|
return /*#__PURE__*/ React.createElement(ActionIconBox, _object_spread_props(_object_spread({
|
|
317
318
|
onClick: function onClick1(e) {
|
|
318
319
|
return _async_to_generator(function() {
|
|
@@ -95,7 +95,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
95
95
|
}
|
|
96
96
|
import { ExportOutlined, RightOutlined } from "@ant-design/icons";
|
|
97
97
|
import { ConfigProvider, Descriptions, Drawer, Popover } from "antd";
|
|
98
|
-
import classNames from "
|
|
98
|
+
import classNames from "clsx";
|
|
99
99
|
import dayjs from "dayjs";
|
|
100
100
|
import { motion } from "framer-motion";
|
|
101
101
|
import React, { useContext } from "react";
|
|
@@ -54,6 +54,7 @@ import { Popover, theme } from "antd";
|
|
|
54
54
|
import React, { useContext, useEffect, useMemo } from "react";
|
|
55
55
|
import { ErrorBoundary } from "react-error-boundary";
|
|
56
56
|
import { MarkdownEditor, parserMdToSchema } from "../..";
|
|
57
|
+
import { useMergedLocale } from "../../I18n";
|
|
57
58
|
import { BubbleConfigContext } from "../BubbleConfigProvide";
|
|
58
59
|
import { MessagesContext } from "./BubbleContext";
|
|
59
60
|
/**
|
|
@@ -96,7 +97,9 @@ import { MessagesContext } from "./BubbleContext";
|
|
|
96
97
|
var content = props.content, extra = props.extra, typing = props.typing, htmlRef = props.htmlRef, fncProps = props.fncProps, docListNode = props.docListNode, beforeContent = props.beforeContent, afterContent = props.afterContent;
|
|
97
98
|
var MarkdownEditorRef = React.useRef(undefined);
|
|
98
99
|
var hidePadding = (useContext(MessagesContext) || {}).hidePadding;
|
|
99
|
-
var
|
|
100
|
+
var config = useContext(BubbleConfigContext);
|
|
101
|
+
var locale = useMergedLocale(config === null || config === void 0 ? void 0 : config.locale);
|
|
102
|
+
var standalone = config === null || config === void 0 ? void 0 : config.standalone;
|
|
100
103
|
var token = theme.useToken().token;
|
|
101
104
|
var isPaddingHidden = useMemo(function() {
|
|
102
105
|
return !!extra;
|
|
@@ -59,7 +59,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
59
59
|
import { PlayLottie } from "../../..";
|
|
60
60
|
import { ChevronDown, Pause } from "@sofa-design/icons";
|
|
61
61
|
import { ConfigProvider, Dropdown, Flex, Tooltip } from "antd";
|
|
62
|
-
import classNames from "
|
|
62
|
+
import classNames from "clsx";
|
|
63
63
|
import React, { useMemo, useState } from "react";
|
|
64
64
|
import { useSpeechSynthesis } from "../../../Hooks/useSpeechSynthesis";
|
|
65
65
|
import VoicingLottie from "../../../Icons/animated/VoicingLottie";
|
|
@@ -262,7 +262,7 @@ function _ts_generator(thisArg, body) {
|
|
|
262
262
|
}
|
|
263
263
|
import { ExportOutlined } from "@ant-design/icons";
|
|
264
264
|
import { ConfigProvider, Popover, Tooltip, Typography } from "antd";
|
|
265
|
-
import classNames from "
|
|
265
|
+
import classNames from "clsx";
|
|
266
266
|
import React, { useContext, useMemo } from "react";
|
|
267
267
|
import { ActionIconBox } from "../../Components/ActionIconBox";
|
|
268
268
|
import { I18nContext } from "../../I18n";
|
|
@@ -262,7 +262,7 @@ function _ts_generator(thisArg, body) {
|
|
|
262
262
|
}
|
|
263
263
|
import { memo, useContext } from "react";
|
|
264
264
|
import { ConfigProvider, Flex } from "antd";
|
|
265
|
-
import cx from "
|
|
265
|
+
import cx from "clsx";
|
|
266
266
|
import React from "react";
|
|
267
267
|
import { BaseMarkdownEditor } from "../MarkdownEditor/BaseMarkdownEditor";
|
|
268
268
|
import { runRender } from "./AIBubble";
|
package/dist/Bubble/Title.js
CHANGED
|
@@ -51,7 +51,7 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
53
|
import { Flex } from "antd";
|
|
54
|
-
import cx from "
|
|
54
|
+
import cx from "clsx";
|
|
55
55
|
import React from "react";
|
|
56
56
|
import { resetComponent, useEditorStyleRegister } from "../Hooks/useStyle";
|
|
57
57
|
import { formatTime } from "../Utils/formatTime";
|
|
@@ -74,7 +74,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
74
74
|
}
|
|
75
75
|
import { memo, useContext } from "react";
|
|
76
76
|
import { ConfigProvider, Flex } from "antd";
|
|
77
|
-
import cx from "
|
|
77
|
+
import cx from "clsx";
|
|
78
78
|
import React from "react";
|
|
79
79
|
import { Quote } from "../Quote";
|
|
80
80
|
import { BubbleConfigContext } from "./BubbleConfigProvide";
|