@ant-design/agentic-ui 2.29.24 → 2.29.25
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/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 +1 -1
- package/dist/Bubble/MessagesContent/CopyButton/index.js +1 -1
- package/dist/Bubble/MessagesContent/DocInfo.js +1 -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 +1 -1
- 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/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/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 -6
|
@@ -51,7 +51,7 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
53
|
import { ConfigProvider } from "antd";
|
|
54
|
-
import classNames from "
|
|
54
|
+
import classNames from "clsx";
|
|
55
55
|
import React, { useContext, useRef } from "react";
|
|
56
56
|
import { useSlateSelection } from "slate-react";
|
|
57
57
|
/**
|
|
@@ -227,7 +227,7 @@ function _ts_generator(thisArg, body) {
|
|
|
227
227
|
import { runFunction } from "@ant-design/pro-components";
|
|
228
228
|
import { ChevronDown } from "@sofa-design/icons";
|
|
229
229
|
import { ConfigProvider, Dropdown } from "antd";
|
|
230
|
-
import classNames from "
|
|
230
|
+
import classNames from "clsx";
|
|
231
231
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
232
232
|
import { ReactEditor, useSlate } from "slate-react";
|
|
233
233
|
import { SuggestionConnext } from "../../../../MarkdownInputField/Suggestion";
|
|
@@ -87,7 +87,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
87
87
|
return target;
|
|
88
88
|
}
|
|
89
89
|
import { ConfigProvider } from "antd";
|
|
90
|
-
import classNames from "
|
|
90
|
+
import classNames from "clsx";
|
|
91
91
|
import React, { useContext } from "react";
|
|
92
92
|
import { Editor, Path, Transforms } from "slate";
|
|
93
93
|
import { ReactEditor } from "slate-react";
|
|
@@ -250,7 +250,7 @@ var myRemark = {
|
|
|
250
250
|
// 获取 chartType,支持多种配置格式
|
|
251
251
|
var getChartType = function getChartType() {
|
|
252
252
|
var _chartConfig_, _config_at, _config_at1;
|
|
253
|
-
return (chartConfig === null || chartConfig === void 0 ? void 0 : chartConfig.chartType) || Array.isArray(chartConfig)
|
|
253
|
+
return (chartConfig === null || chartConfig === void 0 ? void 0 : chartConfig.chartType) || (Array.isArray(chartConfig) ? chartConfig === null || chartConfig === void 0 ? void 0 : (_chartConfig_ = chartConfig[0]) === null || _chartConfig_ === void 0 ? void 0 : _chartConfig_.chartType : undefined) || (config === null || config === void 0 ? void 0 : config.chartType) || (Array.isArray(config) ? config === null || config === void 0 ? void 0 : (_config_at1 = config.at) === null || _config_at1 === void 0 ? void 0 : (_config_at = _config_at1.call(config, 0)) === null || _config_at === void 0 ? void 0 : _config_at.chartType : undefined);
|
|
254
254
|
};
|
|
255
255
|
var chartType = getChartType();
|
|
256
256
|
// 如果 chartType 为 "table",将其视为不存在,按普通表格处理
|
|
@@ -28,17 +28,19 @@ function _object_spread(target) {
|
|
|
28
28
|
}
|
|
29
29
|
import { HolderOutlined } from "@ant-design/icons";
|
|
30
30
|
import { Tooltip } from "antd";
|
|
31
|
-
import React from "react";
|
|
31
|
+
import React, { useContext } from "react";
|
|
32
|
+
import { I18nContext } from "../../../I18n";
|
|
32
33
|
import { useEditorStore } from "../store";
|
|
33
34
|
export var DragHandle = function DragHandle(props) {
|
|
34
35
|
var _editorProps_drag;
|
|
35
36
|
var ref = React.useRef(null);
|
|
36
37
|
var _useEditorStore = useEditorStore(), store = _useEditorStore.store, editorProps = _useEditorStore.editorProps, readonly = _useEditorStore.readonly;
|
|
38
|
+
var locale = useContext(I18nContext).locale;
|
|
37
39
|
if (!store) return null;
|
|
38
40
|
if (readonly === true) return null;
|
|
39
41
|
if ((editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_drag = editorProps.drag) === null || _editorProps_drag === void 0 ? void 0 : _editorProps_drag.enable) !== true) return null;
|
|
40
42
|
return /*#__PURE__*/ React.createElement(Tooltip, {
|
|
41
|
-
title:
|
|
43
|
+
title: (locale === null || locale === void 0 ? void 0 : locale.dragToMove) || '拖拽移动'
|
|
42
44
|
}, /*#__PURE__*/ React.createElement("span", {
|
|
43
45
|
"data-drag-handle": true,
|
|
44
46
|
"data-testid": "drag-handle",
|
|
@@ -238,7 +238,7 @@ function _ts_generator(thisArg, body) {
|
|
|
238
238
|
}
|
|
239
239
|
import { CheckSquareOutlined, CodeOutlined, FontSizeOutlined, OrderedListOutlined, PlayCircleOutlined, TableOutlined, UnorderedListOutlined } from "@ant-design/icons";
|
|
240
240
|
import { Button, ConfigProvider, Input, Menu, Tabs } from "antd";
|
|
241
|
-
import classNames from "
|
|
241
|
+
import classNames from "clsx";
|
|
242
242
|
import isHotkey from "is-hotkey";
|
|
243
243
|
import React, { useCallback, useContext, useEffect, useMemo, useRef } from "react";
|
|
244
244
|
import ReactDOM from "react-dom";
|
|
@@ -53,7 +53,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
53
53
|
}
|
|
54
54
|
import { Plus } from "@sofa-design/icons";
|
|
55
55
|
import { Divider, Dropdown } from "antd";
|
|
56
|
-
import classnames from "
|
|
56
|
+
import classnames from "clsx";
|
|
57
57
|
import React, { useContext, useMemo } from "react";
|
|
58
58
|
import { I18nContext } from "../../../../I18n";
|
|
59
59
|
import { useEditorStore } from "../../store";
|
|
@@ -310,6 +310,7 @@ var isNodeInTable = function isNodeInTable(currentNode, markdownEditorRef) {
|
|
|
310
310
|
]);
|
|
311
311
|
// 渲染精简工具栏
|
|
312
312
|
var renderMinToolbar = useMemo(function() {
|
|
313
|
+
var _i18n_locale;
|
|
313
314
|
if (!props.min) return null;
|
|
314
315
|
// 如果在表格内,精简工具栏也要相应调整
|
|
315
316
|
if (showConditions.isInTable) {
|
|
@@ -347,7 +348,7 @@ var isNodeInTable = function isNodeInTable(currentNode, markdownEditorRef) {
|
|
|
347
348
|
};
|
|
348
349
|
});
|
|
349
350
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ToolBarItem, {
|
|
350
|
-
title:
|
|
351
|
+
title: ((_i18n_locale = i18n.locale) === null || _i18n_locale === void 0 ? void 0 : _i18n_locale.moreActions) || '更多操作',
|
|
351
352
|
icon: /*#__PURE__*/ React.createElement(Plus, null),
|
|
352
353
|
className: classnames("".concat(baseClassName, "-item"), "".concat(baseClassName, "-item-min-plus-icon"), hashId),
|
|
353
354
|
tabIndex: -1
|
|
@@ -45,7 +45,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
45
45
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
46
|
}
|
|
47
47
|
import { ConfigProvider } from "antd";
|
|
48
|
-
import classNames from "
|
|
48
|
+
import classNames from "clsx";
|
|
49
49
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
50
50
|
import ReactDOM from "react-dom";
|
|
51
51
|
import { Editor, Range, Transforms } from "slate";
|
|
@@ -174,7 +174,7 @@ function _ts_generator(thisArg, body) {
|
|
|
174
174
|
}
|
|
175
175
|
import { CommentOutlined, CopyFilled, HighlightFilled } from "@ant-design/icons";
|
|
176
176
|
import { Input, message, Modal } from "antd";
|
|
177
|
-
import classnames from "
|
|
177
|
+
import classnames from "clsx";
|
|
178
178
|
import copy from "copy-to-clipboard";
|
|
179
179
|
import React, { useContext, useEffect, useMemo } from "react";
|
|
180
180
|
import { Editor, Element, Node, Point, Transforms } from "slate";
|
|
@@ -27,7 +27,7 @@ function _object_spread(target) {
|
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
29
|
import { ConfigProvider } from "antd";
|
|
30
|
-
import classNames from "
|
|
30
|
+
import classNames from "clsx";
|
|
31
31
|
import React, { useContext } from "react";
|
|
32
32
|
import { BaseToolBar } from "./BaseBar";
|
|
33
33
|
import { useStyle } from "./toolBarStyle";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormatPainterOutlined } from "@ant-design/icons";
|
|
2
|
-
import classnames from "
|
|
2
|
+
import classnames from "clsx";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { ToolBarItem } from "./ToolBarItem";
|
|
5
5
|
export var FormatButton = /*#__PURE__*/ React.memo(function(param) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RedoOutlined, UndoOutlined } from "@ant-design/icons";
|
|
2
|
-
import classnames from "
|
|
2
|
+
import classnames from "clsx";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { ToolBarItem } from "./ToolBarItem";
|
|
5
5
|
export var UndoRedoButtons = /*#__PURE__*/ React.memo(function(param) {
|
|
@@ -436,7 +436,7 @@ export type MarkdownEditorProps = {
|
|
|
436
436
|
/**
|
|
437
437
|
* Apassify 自定义渲染配置(兼容旧版本)
|
|
438
438
|
* @description 与 apaasify 功能相同,用于向后兼容
|
|
439
|
-
* @deprecated 请使用 apaasify 代替
|
|
439
|
+
* @deprecated @since 2.29.0 请使用 apaasify 代替
|
|
440
440
|
*/
|
|
441
441
|
apassify?: {
|
|
442
442
|
enable?: boolean;
|
|
@@ -444,7 +444,107 @@ export type MarkdownEditorProps = {
|
|
|
444
444
|
};
|
|
445
445
|
children?: React.ReactNode;
|
|
446
446
|
/**
|
|
447
|
-
*
|
|
447
|
+
* 编辑器实例引用
|
|
448
|
+
* @description 用于获取编辑器实例,可调用 store、exportHtml 等方法
|
|
448
449
|
*/
|
|
449
|
-
|
|
450
|
+
editorRef?: React.Ref<MarkdownEditorInstance | undefined>;
|
|
451
|
+
/**
|
|
452
|
+
* 报告模式
|
|
453
|
+
* @description 启用后将使用报告模式样式
|
|
454
|
+
*/
|
|
455
|
+
reportMode?: boolean;
|
|
456
|
+
/**
|
|
457
|
+
* 是否显示目录
|
|
458
|
+
* @default false
|
|
459
|
+
*/
|
|
460
|
+
toc?: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* 工具栏配置
|
|
463
|
+
* @description 配置编辑器顶部的工具栏
|
|
464
|
+
*/
|
|
465
|
+
toolBar?: {
|
|
466
|
+
enable?: boolean;
|
|
467
|
+
min?: boolean;
|
|
468
|
+
hideTools?: ('bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'heading' | 'link' | 'color' | 'clearFormat' | 'undo' | 'redo' | string)[];
|
|
469
|
+
extra?: React.ReactNode[];
|
|
470
|
+
};
|
|
471
|
+
/**
|
|
472
|
+
* 编辑器唯一标识
|
|
473
|
+
*/
|
|
474
|
+
id?: string;
|
|
475
|
+
/**
|
|
476
|
+
* 初始 Schema 值
|
|
477
|
+
* @description 直接传入 Slate schema 格式的数据,优先级高于 initValue
|
|
478
|
+
*/
|
|
479
|
+
initSchemaValue?: Elements[];
|
|
480
|
+
/**
|
|
481
|
+
* 自定义叶子节点渲染函数
|
|
482
|
+
* @description 用于自定义文本节点的渲染方式
|
|
483
|
+
* @param props - 叶子节点属性
|
|
484
|
+
* @param defaultDom - 默认渲染 DOM
|
|
485
|
+
* @returns 自定义渲染结果
|
|
486
|
+
*/
|
|
487
|
+
leafRender?: (props: Record<string, any> & {
|
|
488
|
+
children: React.ReactNode;
|
|
489
|
+
}, defaultDom: React.ReactNode) => React.ReactNode;
|
|
490
|
+
/**
|
|
491
|
+
* 打字机效果
|
|
492
|
+
* @description 启用后编辑器将具有打字机效果的滚动行为
|
|
493
|
+
*/
|
|
494
|
+
typewriter?: boolean;
|
|
495
|
+
/**
|
|
496
|
+
* 根容器引用
|
|
497
|
+
* @description 编辑器根容器的 DOM 引用
|
|
498
|
+
*/
|
|
499
|
+
rootContainer?: React.MutableRefObject<HTMLDivElement | undefined>;
|
|
500
|
+
/**
|
|
501
|
+
* 幻灯片模式
|
|
502
|
+
* @description 启用后编辑器将使用幻灯片模式样式
|
|
503
|
+
*/
|
|
504
|
+
slideMode?: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* 容器自定义类名
|
|
507
|
+
* @description 编辑器内容容器的类名
|
|
508
|
+
*/
|
|
509
|
+
containerClassName?: string;
|
|
510
|
+
/**
|
|
511
|
+
* 浮动工具栏配置
|
|
512
|
+
*/
|
|
513
|
+
floatBar?: {
|
|
514
|
+
enable?: boolean;
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
517
|
+
* 文本区域配置
|
|
518
|
+
*/
|
|
519
|
+
textAreaProps?: {
|
|
520
|
+
enable?: boolean;
|
|
521
|
+
placeholder?: string;
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* 标题占位符文本
|
|
525
|
+
*/
|
|
526
|
+
titlePlaceholderContent?: string;
|
|
527
|
+
/**
|
|
528
|
+
* Markdown 输入配置
|
|
529
|
+
*/
|
|
530
|
+
markdown?: {
|
|
531
|
+
matchLeaf?: boolean;
|
|
532
|
+
matchInputToNode?: boolean;
|
|
533
|
+
};
|
|
534
|
+
/**
|
|
535
|
+
* 拖拽配置
|
|
536
|
+
*/
|
|
537
|
+
drag?: {
|
|
538
|
+
enable?: boolean;
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* 紧凑模式
|
|
542
|
+
* @description 启用后编辑器将使用更紧凑的间距
|
|
543
|
+
*/
|
|
544
|
+
compact?: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* 附件配置
|
|
547
|
+
* @description 配置附件上传功能
|
|
548
|
+
*/
|
|
549
|
+
attachment?: Record<string, unknown>;
|
|
450
550
|
};
|
package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js
CHANGED
|
@@ -25,9 +25,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
25
25
|
}
|
|
26
26
|
import { FileFailed, FileUploadingSpin, X } from "@sofa-design/icons";
|
|
27
27
|
import { Tooltip } from "antd";
|
|
28
|
-
import classNames from "
|
|
28
|
+
import classNames from "clsx";
|
|
29
29
|
import { motion } from "framer-motion";
|
|
30
|
-
import React from "react";
|
|
30
|
+
import React, { useContext } from "react";
|
|
31
|
+
import { I18nContext } from "../../../I18n";
|
|
31
32
|
import { kbToSize } from "../utils";
|
|
32
33
|
import { AttachmentFileIcon } from "./AttachmentFileIcon";
|
|
33
34
|
var getFileNameWithoutExtension = function getFileNameWithoutExtension(fileName) {
|
|
@@ -62,14 +63,14 @@ var FileIcon = function FileIcon(param) {
|
|
|
62
63
|
}, iconMap[status]);
|
|
63
64
|
};
|
|
64
65
|
var FileSizeInfo = function FileSizeInfo(param) {
|
|
65
|
-
var file = param.file, prefixCls = param.prefixCls, hashId = param.hashId;
|
|
66
|
+
var file = param.file, prefixCls = param.prefixCls, hashId = param.hashId, locale = param.locale;
|
|
66
67
|
var status = file.status || 'done';
|
|
67
68
|
var baseClassName = buildClassName("".concat(prefixCls, "-file-size"), hashId);
|
|
68
69
|
var statusContentMap = {
|
|
69
|
-
uploading: '上传中...',
|
|
70
|
+
uploading: (locale === null || locale === void 0 ? void 0 : locale.uploading) || '上传中...',
|
|
70
71
|
error: /*#__PURE__*/ React.createElement("div", {
|
|
71
72
|
className: buildClassName(baseClassName, "".concat(prefixCls, "-file-size-error"))
|
|
72
|
-
},
|
|
73
|
+
}, (locale === null || locale === void 0 ? void 0 : locale.uploadFailed) || '上传失败'),
|
|
73
74
|
done: function() {
|
|
74
75
|
var fileExtension = getFileExtension(file.name);
|
|
75
76
|
var fileSize = file.size ? kbToSize(file.size / 1024) : '';
|
|
@@ -119,6 +120,7 @@ var ANIMATION_VARIANTS = {
|
|
|
119
120
|
};
|
|
120
121
|
export var AttachmentFileListItem = function AttachmentFileListItem(param) {
|
|
121
122
|
var file = param.file, prefixCls = param.prefixCls, hashId = param.hashId, onPreview = param.onPreview, onRetry = param.onRetry, onDelete = param.onDelete, className = param.className;
|
|
123
|
+
var locale = useContext(I18nContext).locale;
|
|
122
124
|
var isErrorStatus = file.status === 'error';
|
|
123
125
|
var isDoneStatus = file.status === 'done';
|
|
124
126
|
var canDelete = file.status !== 'uploading';
|
|
@@ -135,7 +137,7 @@ export var AttachmentFileListItem = function AttachmentFileListItem(param) {
|
|
|
135
137
|
onDelete === null || onDelete === void 0 ? void 0 : onDelete();
|
|
136
138
|
};
|
|
137
139
|
return /*#__PURE__*/ React.createElement(Tooltip, {
|
|
138
|
-
title:
|
|
140
|
+
title: (locale === null || locale === void 0 ? void 0 : locale.clickToRetry) || '点击重试',
|
|
139
141
|
open: isErrorStatus ? undefined : false
|
|
140
142
|
}, /*#__PURE__*/ React.createElement(motion.div, {
|
|
141
143
|
variants: ANIMATION_VARIANTS,
|
|
@@ -156,7 +158,8 @@ export var AttachmentFileListItem = function AttachmentFileListItem(param) {
|
|
|
156
158
|
}, getFileNameWithoutExtension(file.name))), /*#__PURE__*/ React.createElement(FileSizeInfo, {
|
|
157
159
|
file: file,
|
|
158
160
|
prefixCls: prefixCls,
|
|
159
|
-
hashId: hashId
|
|
161
|
+
hashId: hashId,
|
|
162
|
+
locale: locale
|
|
160
163
|
})), /*#__PURE__*/ React.createElement(DeleteButton, {
|
|
161
164
|
isVisible: canDelete,
|
|
162
165
|
onClick: handleDeleteClick,
|
|
@@ -59,7 +59,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
59
59
|
}
|
|
60
60
|
import { X } from "@sofa-design/icons";
|
|
61
61
|
import { ConfigProvider, Image } from "antd";
|
|
62
|
-
import classNames from "
|
|
62
|
+
import classNames from "clsx";
|
|
63
63
|
import { AnimatePresence, motion } from "framer-motion";
|
|
64
64
|
import React, { useContext } from "react";
|
|
65
65
|
import { ActionIconBox } from "../../../Components/ActionIconBox";
|
|
@@ -148,7 +148,7 @@ function _ts_generator(thisArg, body) {
|
|
|
148
148
|
}
|
|
149
149
|
import { Paperclip } from "@sofa-design/icons";
|
|
150
150
|
import { ConfigProvider, message } from "antd";
|
|
151
|
-
import classNames from "
|
|
151
|
+
import classNames from "clsx";
|
|
152
152
|
import React, { useContext } from "react";
|
|
153
153
|
import { compileTemplate } from "../../I18n";
|
|
154
154
|
import AttachmentButtonPopover, { SupportedFileFormats } from "./AttachmentButtonPopover";
|
|
@@ -81,7 +81,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
81
81
|
}
|
|
82
82
|
import { GripVertical, Menu } from "@sofa-design/icons";
|
|
83
83
|
import { ConfigProvider, Popover } from "antd";
|
|
84
|
-
import classNames from "
|
|
84
|
+
import classNames from "clsx";
|
|
85
85
|
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
86
86
|
import { useStyle } from "../../Components/ActionItemBox";
|
|
87
87
|
import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
@@ -46,7 +46,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
46
46
|
}
|
|
47
47
|
import { Download, EllipsisVertical, Eye } from "@sofa-design/icons";
|
|
48
48
|
import { Tooltip } from "antd";
|
|
49
|
-
import classNames from "
|
|
49
|
+
import classNames from "clsx";
|
|
50
50
|
import dayjs from "dayjs";
|
|
51
51
|
import { motion } from "framer-motion";
|
|
52
52
|
import React, { useContext } from "react";
|
|
@@ -199,7 +199,7 @@ import { kbToSize } from "../AttachmentButton/utils";
|
|
|
199
199
|
}, /*#__PURE__*/ React.createElement(Download, {
|
|
200
200
|
color: "var(--color-gray-text-secondary)"
|
|
201
201
|
})), props.renderMoreAction && /*#__PURE__*/ React.createElement(ActionIconBox, {
|
|
202
|
-
title:
|
|
202
|
+
title: (locale === null || locale === void 0 ? void 0 : locale.moreActions) || '更多操作',
|
|
203
203
|
onClick: function onClick(e) {
|
|
204
204
|
e.stopPropagation();
|
|
205
205
|
},
|
|
@@ -187,7 +187,7 @@ function _ts_generator(thisArg, body) {
|
|
|
187
187
|
}
|
|
188
188
|
import { FileSearch } from "@sofa-design/icons";
|
|
189
189
|
import { ConfigProvider, Image } from "antd";
|
|
190
|
-
import classNames from "
|
|
190
|
+
import classNames from "clsx";
|
|
191
191
|
import { motion } from "framer-motion";
|
|
192
192
|
import React, { useContext, useMemo, useState } from "react";
|
|
193
193
|
import { isImageFile } from "../AttachmentButton/utils";
|
|
@@ -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 } from "antd";
|
|
136
|
-
import classNames from "
|
|
136
|
+
import classNames from "clsx";
|
|
137
137
|
import React, { memo, useContext, useState } from "react";
|
|
138
138
|
import { BaseMarkdownEditor } from "../MarkdownEditor";
|
|
139
139
|
import { BorderBeamAnimation } from "./BorderBeamAnimation";
|
|
@@ -197,7 +197,7 @@ function _ts_generator(thisArg, body) {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
import classNames from "
|
|
200
|
+
import classNames from "clsx";
|
|
201
201
|
import RcResizeObserver from "rc-resize-observer";
|
|
202
202
|
import React, { useState } from "react";
|
|
203
203
|
import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
@@ -52,7 +52,7 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
import { EllipsisVertical } from "@sofa-design/icons";
|
|
54
54
|
import { Popover } from "antd";
|
|
55
|
-
import classNames from "
|
|
55
|
+
import classNames from "clsx";
|
|
56
56
|
import RcResizeObserver from "rc-resize-observer";
|
|
57
57
|
import React, { useContext, useMemo } from "react";
|
|
58
58
|
import { ActionIconBox } from "../../Components/ActionIconBox";
|
|
@@ -63,7 +63,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
63
63
|
return target;
|
|
64
64
|
}
|
|
65
65
|
import { ConfigProvider, Tooltip } from "antd";
|
|
66
|
-
import classNames from "
|
|
66
|
+
import classNames from "clsx";
|
|
67
67
|
import { motion } from "framer-motion";
|
|
68
68
|
import React, { useContext, useEffect } from "react";
|
|
69
69
|
import { ErrorBoundary } from "react-error-boundary";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloseOutlined } from "@ant-design/icons";
|
|
2
2
|
import { ConfigProvider, Divider, Flex } from "antd";
|
|
3
|
-
import classNames from "
|
|
3
|
+
import classNames from "clsx";
|
|
4
4
|
import { AnimatePresence, motion } from "framer-motion";
|
|
5
5
|
import React, { useContext } from "react";
|
|
6
6
|
import { useSkillModeState } from "./hooks";
|
|
@@ -141,7 +141,7 @@ function _ts_generator(thisArg, body) {
|
|
|
141
141
|
}
|
|
142
142
|
import { Mic } from "@sofa-design/icons";
|
|
143
143
|
import { ConfigProvider, Tooltip } from "antd";
|
|
144
|
-
import classNames from "
|
|
144
|
+
import classNames from "clsx";
|
|
145
145
|
import React, { useContext } from "react";
|
|
146
146
|
import { ErrorBoundary } from "react-error-boundary";
|
|
147
147
|
import { I18nContext } from "../../I18n";
|
|
@@ -76,7 +76,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
76
76
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
77
77
|
}
|
|
78
78
|
import { ConfigProvider } from "antd";
|
|
79
|
-
import classNames from "
|
|
79
|
+
import classNames from "clsx";
|
|
80
80
|
import React, { useContext, useMemo, useRef } from "react";
|
|
81
81
|
import { Line } from "react-chartjs-2";
|
|
82
82
|
import { ChartContainer, ChartFilter, ChartStatistic, ChartToolBar, downloadChart } from "../components";
|
|
@@ -115,7 +115,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
115
115
|
import { ConfigProvider } from "antd";
|
|
116
116
|
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Tooltip } from "chart.js";
|
|
117
117
|
import ChartDataLabels from "chartjs-plugin-datalabels";
|
|
118
|
-
import classNamesLib from "
|
|
118
|
+
import classNamesLib from "clsx";
|
|
119
119
|
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
120
120
|
import { Bar } from "react-chartjs-2";
|
|
121
121
|
import { ChartContainer, ChartFilter, ChartStatistic, ChartToolBar, downloadChart } from "../components";
|
|
@@ -146,7 +146,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
146
146
|
}
|
|
147
147
|
import { ConfigProvider } from "antd";
|
|
148
148
|
import { ArcElement, Chart as ChartJS, Legend, Tooltip } from "chart.js";
|
|
149
|
-
import classNames from "
|
|
149
|
+
import classNames from "clsx";
|
|
150
150
|
import React, { useContext, useMemo, useRef, useState } from "react";
|
|
151
151
|
import { Doughnut } from "react-chartjs-2";
|
|
152
152
|
import { ChartContainer, ChartFilter, ChartStatistic, ChartToolBar, downloadChart } from "../components";
|
|
@@ -146,7 +146,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
146
146
|
}
|
|
147
147
|
import { ConfigProvider } from "antd";
|
|
148
148
|
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Tooltip } from "chart.js";
|
|
149
|
-
import classNames from "
|
|
149
|
+
import classNames from "clsx";
|
|
150
150
|
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
151
151
|
import { Bar } from "react-chartjs-2";
|
|
152
152
|
import ChartStatistic from "../ChartStatistic";
|
|
@@ -112,7 +112,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
112
112
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
113
113
|
}
|
|
114
114
|
import { ConfigProvider } from "antd";
|
|
115
|
-
import classNames from "
|
|
115
|
+
import classNames from "clsx";
|
|
116
116
|
import React, { useContext, useMemo, useRef } from "react";
|
|
117
117
|
import { Line } from "react-chartjs-2";
|
|
118
118
|
import { ChartContainer, ChartFilter, ChartStatistic, ChartToolBar, downloadChart } from "../components";
|
|
@@ -138,7 +138,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
138
138
|
}
|
|
139
139
|
import { ConfigProvider } from "antd";
|
|
140
140
|
import { Chart as ChartJS, Filler, Legend, LineElement, PointElement, RadialLinearScale, Tooltip } from "chart.js";
|
|
141
|
-
import classNames from "
|
|
141
|
+
import classNames from "clsx";
|
|
142
142
|
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
143
143
|
import { Radar } from "react-chartjs-2";
|
|
144
144
|
import ChartStatistic from "../ChartStatistic";
|
|
@@ -138,7 +138,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
138
138
|
}
|
|
139
139
|
import { ConfigProvider } from "antd";
|
|
140
140
|
import { Chart as ChartJS, Legend, LinearScale, LineElement, PointElement, Tooltip } from "chart.js";
|
|
141
|
-
import classNames from "
|
|
141
|
+
import classNames from "clsx";
|
|
142
142
|
import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
143
143
|
import { Scatter } from "react-chartjs-2";
|
|
144
144
|
import ChartStatistic from "../ChartStatistic";
|
|
@@ -62,7 +62,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
62
62
|
}
|
|
63
63
|
return target;
|
|
64
64
|
}
|
|
65
|
-
import classNames from "
|
|
65
|
+
import classNames from "clsx";
|
|
66
66
|
import React from "react";
|
|
67
67
|
import ChartErrorBoundary from "./ChartErrorBoundary";
|
|
68
68
|
import { useStyle } from "./style";
|