@ant-design/agentic-ui 2.29.12 → 2.29.13
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/style.d.ts +3 -0
- package/dist/AgentRunBar/style.d.ts +3 -0
- package/dist/AgenticLayout/style.d.ts +3 -0
- package/dist/AnswerAlert/style.d.ts +3 -0
- package/dist/BackTo/style.d.ts +3 -0
- package/dist/Bubble/List/style.d.ts +3 -0
- package/dist/Bubble/MessagesContent/VoiceButton/style.d.ts +3 -0
- package/dist/Bubble/MessagesContent/docInfoStyle.d.ts +3 -0
- package/dist/Bubble/MessagesContent/style.d.ts +3 -0
- package/dist/Bubble/style.d.ts +3 -0
- package/dist/ChatBootPage/ButtonTabGroupStyle.d.ts +3 -0
- package/dist/ChatBootPage/ButtonTabStyle.d.ts +6 -0
- package/dist/ChatBootPage/CaseReplyStyle.d.ts +3 -0
- package/dist/ChatBootPage/style.d.ts +3 -0
- package/dist/ChatLayout/style.d.ts +3 -0
- package/dist/Components/ActionIconBox/style.d.ts +3 -0
- package/dist/Components/ActionItemBox/ActionItemBox.d.ts +1 -1
- package/dist/Components/ActionItemBox/style.d.ts +3 -0
- package/dist/Components/Button/IconButton/style.d.ts +3 -0
- package/dist/Components/Button/SwitchButton/style.d.ts +3 -0
- package/dist/Components/Button/ToggleButton/style.d.ts +3 -0
- package/dist/Components/GradientText/index.d.ts +1 -1
- package/dist/Components/GradientText/style.d.ts +3 -0
- package/dist/Components/LayoutHeader/style.d.ts +3 -0
- package/dist/Components/Loading/Loading.d.ts +1 -1
- package/dist/Components/Loading/style.d.ts +3 -0
- package/dist/Components/SuggestionList/style.d.ts +3 -0
- package/dist/Components/TextAnimate/index.d.ts +1 -1
- package/dist/Components/TextAnimate/style.d.ts +3 -0
- package/dist/Components/TypingAnimation/index.d.ts +1 -1
- package/dist/Components/TypingAnimation/style.d.ts +3 -0
- package/dist/Components/VisualList/style.d.ts +3 -0
- package/dist/Components/lotties/TextLoading/style.d.ts +3 -0
- package/dist/Components/lotties/bubble-actions/Abstract/style.d.ts +3 -0
- package/dist/History/components/HistoryItem.js +3 -0
- package/dist/History/components/NewChatComponent.style.d.ts +3 -0
- package/dist/History/style.d.ts +3 -0
- package/dist/History/style.js +2 -2
- package/dist/Hooks/useLanguage.d.ts +1 -0
- package/dist/Hooks/useStyle/index.d.ts +3 -0
- package/dist/Hooks/useStyle/index.js +7 -4
- package/dist/I18n/locales.d.ts +1 -0
- package/dist/I18n/locales.js +2 -0
- package/dist/MarkdownEditor/editor/Editor.d.ts +1 -2
- package/dist/MarkdownEditor/editor/Editor.js +16 -5
- package/dist/MarkdownEditor/editor/components/CommentList/style.d.ts +3 -0
- package/dist/MarkdownEditor/editor/components/ContributorAvatar/style.d.ts +3 -0
- package/dist/MarkdownEditor/editor/components/LazyElement/style.d.ts +3 -0
- package/dist/MarkdownEditor/editor/components/fntTag/index.d.ts +1 -1
- package/dist/MarkdownEditor/editor/components/fntTag/style.d.ts +3 -0
- package/dist/MarkdownEditor/editor/elements/Blockquote/ReadonlyBlockquote.js +0 -5
- package/dist/MarkdownEditor/editor/elements/Blockquote/index.js +0 -10
- package/dist/MarkdownEditor/editor/elements/Break/ReadonlyBreak.js +0 -2
- package/dist/MarkdownEditor/editor/elements/Break/index.js +0 -2
- package/dist/MarkdownEditor/editor/elements/Card/ReadonlyCard.js +0 -6
- package/dist/MarkdownEditor/editor/elements/Card/index.js +0 -11
- package/dist/MarkdownEditor/editor/elements/Code/ReadonlyCode.js +4 -9
- package/dist/MarkdownEditor/editor/elements/Code/index.js +4 -9
- package/dist/MarkdownEditor/editor/elements/Comment/index.d.ts +0 -2
- package/dist/MarkdownEditor/editor/elements/Comment/index.js +1 -1
- package/dist/MarkdownEditor/editor/elements/CommentLeaf/index.d.ts +1 -2
- package/dist/MarkdownEditor/editor/elements/CommentLeaf/index.js +3 -9
- package/dist/MarkdownEditor/editor/elements/FncLeaf/index.d.ts +1 -2
- package/dist/MarkdownEditor/editor/elements/FncLeaf/index.js +2 -32
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition/ReadonlyFootnoteDefinition.js +0 -7
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition/index.js +0 -1
- package/dist/MarkdownEditor/editor/elements/FootnoteReference/ReadonlyFootnoteReference.js +0 -3
- package/dist/MarkdownEditor/editor/elements/FootnoteReference/index.js +0 -1
- package/dist/MarkdownEditor/editor/elements/Head/ReadonlyHead.js +0 -4
- package/dist/MarkdownEditor/editor/elements/Head/index.js +0 -9
- package/dist/MarkdownEditor/editor/elements/Hr/ReadonlyHr.js +0 -2
- package/dist/MarkdownEditor/editor/elements/Hr/index.js +0 -2
- package/dist/MarkdownEditor/editor/elements/Image/index.js +2 -31
- package/dist/MarkdownEditor/editor/elements/InlineKatex/ReadonlyInlineKatex.js +0 -5
- package/dist/MarkdownEditor/editor/elements/LinkCard/ReadonlyLinkCard.js +11 -25
- package/dist/MarkdownEditor/editor/elements/LinkCard/index.js +11 -25
- package/dist/MarkdownEditor/editor/elements/List/List.d.ts +0 -3
- package/dist/MarkdownEditor/editor/elements/List/List.js +5 -36
- package/dist/MarkdownEditor/editor/elements/List/ListItem.js +4 -18
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyList.js +4 -21
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyListItem.js +3 -14
- package/dist/MarkdownEditor/editor/elements/Mermaid/ReadonlyMermaid.js +5 -12
- package/dist/MarkdownEditor/editor/elements/Mermaid/index.js +5 -12
- package/dist/MarkdownEditor/editor/elements/Paragraph/ReadonlyParagraph.js +0 -9
- package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +0 -1
- package/dist/MarkdownEditor/editor/elements/Schema/ReadonlySchema.js +0 -13
- package/dist/MarkdownEditor/editor/elements/Schema/index.js +0 -3
- package/dist/MarkdownEditor/editor/elements/Table/ReadonlyTableComponent.d.ts +0 -1
- package/dist/MarkdownEditor/editor/elements/Table/ReadonlyTableComponent.js +9 -7
- package/dist/MarkdownEditor/editor/elements/Table/SimpleTable.js +3 -48
- package/dist/MarkdownEditor/editor/elements/Table/Table.d.ts +1 -2
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +8 -7
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndex/index.js +7 -9
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndexSpacer/index.js +7 -9
- package/dist/MarkdownEditor/editor/elements/Table/TableRowIndex/index.js +3 -5
- package/dist/MarkdownEditor/editor/elements/Table/Td/index.js +6 -8
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +8 -10
- package/dist/MarkdownEditor/editor/elements/index.d.ts +1 -1
- package/dist/MarkdownEditor/editor/elements/index.js +83 -105
- package/dist/MarkdownEditor/editor/parser/parse/parseTable.d.ts +3 -2
- package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +14 -3
- package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +12 -2
- package/dist/MarkdownEditor/editor/plugins/useKeyboard.js +4 -1
- package/dist/MarkdownEditor/editor/plugins/useOnchange.js +9 -2
- package/dist/MarkdownEditor/editor/style.d.ts +3 -0
- package/dist/MarkdownEditor/editor/tools/ToolBar/FloatBar.js +1 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/ReadonlyBaseBar.d.ts +0 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/ReadonlyBaseBar.js +3 -4
- package/dist/MarkdownEditor/editor/tools/ToolBar/floatBarStyle.d.ts +3 -0
- package/dist/MarkdownEditor/editor/tools/ToolBar/toolBarStyle.d.ts +3 -0
- package/dist/MarkdownEditor/editor/tools/insertAutocompleteStyle.d.ts +3 -0
- package/dist/MarkdownEditor/style.d.ts +3 -0
- package/dist/MarkdownEditor/style.js +575 -3
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.d.ts +3 -0
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +47 -10
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.d.ts +3 -0
- package/dist/MarkdownInputField/AttachmentButton/index.d.ts +4 -0
- package/dist/MarkdownInputField/AttachmentButton/index.js +5 -3
- package/dist/MarkdownInputField/AttachmentButton/style.d.ts +3 -0
- package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.d.ts +1 -1
- package/dist/MarkdownInputField/BorderBeamAnimation.js +47 -25
- package/dist/MarkdownInputField/FileMapView/style.d.ts +3 -0
- package/dist/MarkdownInputField/RefinePromptButton/style.d.ts +3 -0
- package/dist/MarkdownInputField/SendButton/style.d.ts +3 -0
- package/dist/MarkdownInputField/SkillModeBar/style.d.ts +3 -0
- package/dist/MarkdownInputField/TopOperatingArea/style.d.ts +3 -0
- package/dist/MarkdownInputField/VoiceInput/style.d.ts +3 -0
- package/dist/MarkdownInputField/style.d.ts +3 -0
- package/dist/Plugins/chart/AreaChart/style.d.ts +3 -0
- package/dist/Plugins/chart/BarChart/style.d.ts +3 -0
- package/dist/Plugins/chart/ChartAttrToolBar/ChartAttrToolBarStyle.d.ts +3 -0
- package/dist/Plugins/chart/ChartStatistic/style.d.ts +3 -0
- package/dist/Plugins/chart/DonutChart/style.d.ts +3 -0
- package/dist/Plugins/chart/FunnelChart/style.d.ts +3 -0
- package/dist/Plugins/chart/LineChart/style.d.ts +3 -0
- package/dist/Plugins/chart/RadarChart/style.d.ts +3 -0
- package/dist/Plugins/chart/ScatterChart/style.d.ts +3 -0
- package/dist/Plugins/chart/components/ChartContainer/style.d.ts +3 -0
- package/dist/Plugins/chart/components/ChartFilter/style.d.ts +3 -0
- package/dist/Plugins/chart/components/ChartToolBar/style.d.ts +3 -0
- package/dist/Plugins/mermaid/MermaidFallback.d.ts +1 -2
- package/dist/Plugins/mermaid/MermaidRendererImpl.d.ts +1 -2
- package/dist/Plugins/mermaid/style.d.ts +3 -0
- package/dist/Plugins/mermaid/style.js +5 -2
- package/dist/Plugins/mermaid/utils.js +1 -1
- package/dist/Quote/style.d.ts +3 -0
- package/dist/Schema/SchemaEditor/style.d.ts +3 -0
- package/dist/TaskList/index.d.ts +1 -1
- package/dist/TaskList/style.d.ts +3 -0
- package/dist/ThoughtChainList/DotAni/index.d.ts +1 -2
- package/dist/ThoughtChainList/DotAni/style.d.ts +3 -0
- package/dist/ThoughtChainList/style.d.ts +3 -0
- package/dist/ToolUseBar/style.d.ts +3 -0
- package/dist/ToolUseBarThink/style.d.ts +3 -0
- package/dist/WelcomeMessage/style.d.ts +3 -0
- package/dist/Workspace/Browser/style.d.ts +3 -0
- package/dist/Workspace/File/style.d.ts +3 -0
- package/dist/Workspace/HtmlPreview/style.d.ts +3 -0
- package/dist/Workspace/RealtimeFollow/style.d.ts +3 -0
- package/dist/Workspace/Task/style.d.ts +3 -0
- package/dist/Workspace/style.d.ts +3 -0
- package/package.json +1 -2
- package/dist/MarkdownEditor/editor/elements/LinkCard/style.d.ts +0 -10
- package/dist/MarkdownEditor/editor/elements/LinkCard/style.js +0 -136
- package/dist/MarkdownEditor/editor/elements/List/style.d.ts +0 -10
- package/dist/MarkdownEditor/editor/elements/List/style.js +0 -139
- package/dist/MarkdownEditor/editor/elements/Mermaid/style.d.ts +0 -10
- package/dist/MarkdownEditor/editor/elements/Mermaid/style.js +0 -144
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndex/style.d.ts +0 -10
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndex/style.js +0 -131
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndexSpacer/style.d.ts +0 -10
- package/dist/MarkdownEditor/editor/elements/Table/TableCellIndexSpacer/style.js +0 -125
- package/dist/MarkdownEditor/editor/elements/Table/TableRowIndex/style.d.ts +0 -10
- package/dist/MarkdownEditor/editor/elements/Table/TableRowIndex/style.js +0 -74
- package/dist/MarkdownEditor/editor/elements/Table/Td/style.d.ts +0 -10
- package/dist/MarkdownEditor/editor/elements/Table/Td/style.js +0 -93
- package/dist/MarkdownEditor/editor/elements/Table/style.d.ts +0 -11
- package/dist/MarkdownEditor/editor/elements/Table/style.js +0 -255
- package/dist/MarkdownEditor/editor/elements/TagPopup/style.d.ts +0 -5
- package/dist/MarkdownEditor/editor/elements/TagPopup/style.js +0 -111
|
@@ -47,9 +47,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
47
47
|
import { ConfigProvider, Skeleton } from "antd";
|
|
48
48
|
import classNames from "classnames";
|
|
49
49
|
import React, { useContext, useEffect, useState } from "react";
|
|
50
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
51
50
|
import { AvatarList } from "../../components/ContributorAvatar";
|
|
52
|
-
import { useStyle } from "./style";
|
|
53
51
|
/**
|
|
54
52
|
* ReadonlyLinkCard 组件 - 只读链接卡片预览组件
|
|
55
53
|
*
|
|
@@ -82,24 +80,15 @@ import { useStyle } from "./style";
|
|
|
82
80
|
* - 保持预览模式的视觉效果
|
|
83
81
|
*/ export var ReadonlyLinkCard = /*#__PURE__*/ React.memo(function(param) {
|
|
84
82
|
var element = param.element, attributes = param.attributes, children = param.children;
|
|
85
|
-
var
|
|
86
|
-
debugInfo('ReadonlyLinkCard - 渲染只读链接卡片', {
|
|
87
|
-
url: element === null || element === void 0 ? void 0 : (_element_url = element.url) === null || _element_url === void 0 ? void 0 : _element_url.substring(0, 100),
|
|
88
|
-
title: element === null || element === void 0 ? void 0 : element.title,
|
|
89
|
-
name: element === null || element === void 0 ? void 0 : element.name,
|
|
90
|
-
finished: element === null || element === void 0 ? void 0 : element.finished
|
|
91
|
-
});
|
|
83
|
+
var _element_otherProps, _element_otherProps_collaborators, _element_otherProps1, _element_otherProps2;
|
|
92
84
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
93
85
|
var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-link-card');
|
|
94
|
-
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
95
86
|
var _useState = _sliced_to_array(useState(false), 2), showAsText = _useState[0], setShowAsText = _useState[1];
|
|
96
87
|
// 如果 finished 为 false,设置 5 秒超时,超时后显示为文本
|
|
97
88
|
useEffect(function() {
|
|
98
89
|
if (element.finished === false) {
|
|
99
|
-
debugInfo('ReadonlyLinkCard - 设置超时显示文本');
|
|
100
90
|
setShowAsText(false);
|
|
101
91
|
var timer = setTimeout(function() {
|
|
102
|
-
debugInfo('ReadonlyLinkCard - 超时,显示为文本');
|
|
103
92
|
setShowAsText(true);
|
|
104
93
|
}, 5000);
|
|
105
94
|
return function() {
|
|
@@ -115,7 +104,6 @@ import { useStyle } from "./style";
|
|
|
115
104
|
if (element.finished === false) {
|
|
116
105
|
// 如果 5 秒后仍未完成,显示为文本
|
|
117
106
|
if (showAsText) {
|
|
118
|
-
debugInfo('ReadonlyLinkCard - 显示为文本');
|
|
119
107
|
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
|
|
120
108
|
style: {
|
|
121
109
|
padding: '8px 12px',
|
|
@@ -127,7 +115,6 @@ import { useStyle } from "./style";
|
|
|
127
115
|
}, element.url || element.title || element.name || '链接卡片'), children);
|
|
128
116
|
}
|
|
129
117
|
// 5 秒内显示加载骨架屏
|
|
130
|
-
debugInfo('ReadonlyLinkCard - 显示加载骨架屏');
|
|
131
118
|
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement(Skeleton, {
|
|
132
119
|
active: true,
|
|
133
120
|
paragraph: {
|
|
@@ -135,9 +122,8 @@ import { useStyle } from "./style";
|
|
|
135
122
|
}
|
|
136
123
|
}), children);
|
|
137
124
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
className: classNames(baseCls, hashId),
|
|
125
|
+
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
|
|
126
|
+
className: classNames(baseCls),
|
|
141
127
|
"data-be": "link-card",
|
|
142
128
|
draggable: false,
|
|
143
129
|
style: {
|
|
@@ -160,12 +146,12 @@ import { useStyle } from "./style";
|
|
|
160
146
|
if (typeof window === 'undefined') return;
|
|
161
147
|
window.open(element === null || element === void 0 ? void 0 : element.url);
|
|
162
148
|
},
|
|
163
|
-
className: classNames("".concat(baseCls, "-container")
|
|
149
|
+
className: classNames("".concat(baseCls, "-container"))
|
|
164
150
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
165
|
-
className: classNames("".concat(baseCls, "-container-content")
|
|
151
|
+
className: classNames("".concat(baseCls, "-container-content")),
|
|
166
152
|
contentEditable: false
|
|
167
153
|
}, element.icon ? /*#__PURE__*/ React.createElement("img", {
|
|
168
|
-
className: classNames("".concat(baseCls, "-container-content-icon")
|
|
154
|
+
className: classNames("".concat(baseCls, "-container-content-icon")),
|
|
169
155
|
src: element.icon,
|
|
170
156
|
width: 56
|
|
171
157
|
}) : null, /*#__PURE__*/ React.createElement("div", {
|
|
@@ -175,7 +161,7 @@ import { useStyle } from "./style";
|
|
|
175
161
|
}
|
|
176
162
|
}, /*#__PURE__*/ React.createElement("a", {
|
|
177
163
|
href: element === null || element === void 0 ? void 0 : element.url,
|
|
178
|
-
className: classNames("".concat(baseCls, "-container-content-title")
|
|
164
|
+
className: classNames("".concat(baseCls, "-container-content-title")),
|
|
179
165
|
onClick: function(e) {
|
|
180
166
|
e.stopPropagation();
|
|
181
167
|
e.preventDefault();
|
|
@@ -184,9 +170,9 @@ import { useStyle } from "./style";
|
|
|
184
170
|
},
|
|
185
171
|
download: element.title || element.name || 'no title'
|
|
186
172
|
}, element.title || element.name || 'no title'), /*#__PURE__*/ React.createElement("div", {
|
|
187
|
-
className: classNames("".concat(baseCls, "-container-content-description")
|
|
173
|
+
className: classNames("".concat(baseCls, "-container-content-description"))
|
|
188
174
|
}, element.description ? element.description : element === null || element === void 0 ? void 0 : element.url), /*#__PURE__*/ React.createElement("div", {
|
|
189
|
-
className: classNames("".concat(baseCls, "-container-content-collaborators")
|
|
175
|
+
className: classNames("".concat(baseCls, "-container-content-collaborators"))
|
|
190
176
|
}, ((_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.collaborators) ? /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(AvatarList, {
|
|
191
177
|
displayList: ((_element_otherProps1 = element.otherProps) === null || _element_otherProps1 === void 0 ? void 0 : (_element_otherProps_collaborators = _element_otherProps1.collaborators) === null || _element_otherProps_collaborators === void 0 ? void 0 : _element_otherProps_collaborators.map(function(item) {
|
|
192
178
|
var _Object_keys, _Object_values;
|
|
@@ -196,7 +182,7 @@ import { useStyle } from "./style";
|
|
|
196
182
|
};
|
|
197
183
|
}).slice(0, 5)) || []
|
|
198
184
|
})) : /*#__PURE__*/ React.createElement("div", null), ((_element_otherProps2 = element.otherProps) === null || _element_otherProps2 === void 0 ? void 0 : _element_otherProps2.updateTime) ? /*#__PURE__*/ React.createElement("div", {
|
|
199
|
-
className: classNames("".concat(baseCls, "-container-content-updateTime")
|
|
185
|
+
className: classNames("".concat(baseCls, "-container-content-updateTime")),
|
|
200
186
|
style: {
|
|
201
187
|
color: 'rgba(0,0,0,0.45)',
|
|
202
188
|
fontSize: 12
|
|
@@ -210,6 +196,6 @@ import { useStyle } from "./style";
|
|
|
210
196
|
fontSize: 60,
|
|
211
197
|
lineHeight: '100px'
|
|
212
198
|
}
|
|
213
|
-
}, children.at(-1))))
|
|
199
|
+
}, children.at(-1))));
|
|
214
200
|
});
|
|
215
201
|
ReadonlyLinkCard.displayName = 'ReadonlyLinkCard';
|
|
@@ -47,31 +47,20 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
47
47
|
import { ConfigProvider, Skeleton } from "antd";
|
|
48
48
|
import classNames from "classnames";
|
|
49
49
|
import React, { useContext, useEffect, useState } from "react";
|
|
50
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
51
50
|
import { AvatarList } from "../../components/ContributorAvatar";
|
|
52
51
|
import { DragHandle } from "../../tools/DragHandle";
|
|
53
|
-
import { useStyle } from "./style";
|
|
54
52
|
export function LinkCard(param) {
|
|
55
53
|
var element = param.element, attributes = param.attributes, children = param.children;
|
|
56
|
-
var
|
|
57
|
-
debugInfo('LinkCard - 渲染链接卡片', {
|
|
58
|
-
url: element === null || element === void 0 ? void 0 : (_element_url = element.url) === null || _element_url === void 0 ? void 0 : _element_url.substring(0, 100),
|
|
59
|
-
title: element === null || element === void 0 ? void 0 : element.title,
|
|
60
|
-
name: element === null || element === void 0 ? void 0 : element.name,
|
|
61
|
-
finished: element === null || element === void 0 ? void 0 : element.finished
|
|
62
|
-
});
|
|
54
|
+
var _element_otherProps, _element_otherProps_collaborators, _element_otherProps1, _element_otherProps2;
|
|
63
55
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
64
56
|
var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-link-card');
|
|
65
|
-
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
66
57
|
var htmlRef = React.useRef(null);
|
|
67
58
|
var _useState = _sliced_to_array(useState(false), 2), showAsText = _useState[0], setShowAsText = _useState[1];
|
|
68
59
|
// 如果 finished 为 false,设置 5 秒超时,超时后显示为文本
|
|
69
60
|
useEffect(function() {
|
|
70
61
|
if (element.finished === false) {
|
|
71
|
-
debugInfo('LinkCard - 设置超时显示文本');
|
|
72
62
|
setShowAsText(false);
|
|
73
63
|
var timer = setTimeout(function() {
|
|
74
|
-
debugInfo('LinkCard - 超时,显示为文本');
|
|
75
64
|
setShowAsText(true);
|
|
76
65
|
}, 5000);
|
|
77
66
|
return function() {
|
|
@@ -87,7 +76,6 @@ export function LinkCard(param) {
|
|
|
87
76
|
if (element.finished === false) {
|
|
88
77
|
// 如果 5 秒后仍未完成,显示为文本
|
|
89
78
|
if (showAsText) {
|
|
90
|
-
debugInfo('LinkCard - 显示为文本');
|
|
91
79
|
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
|
|
92
80
|
style: {
|
|
93
81
|
padding: '8px 12px',
|
|
@@ -99,7 +87,6 @@ export function LinkCard(param) {
|
|
|
99
87
|
}, element.url || element.title || element.name || '链接卡片'), children);
|
|
100
88
|
}
|
|
101
89
|
// 5 秒内显示加载骨架屏
|
|
102
|
-
debugInfo('LinkCard - 显示加载骨架屏');
|
|
103
90
|
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement(Skeleton, {
|
|
104
91
|
active: true,
|
|
105
92
|
paragraph: {
|
|
@@ -107,9 +94,8 @@ export function LinkCard(param) {
|
|
|
107
94
|
}
|
|
108
95
|
}), children);
|
|
109
96
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
className: classNames(baseCls, hashId),
|
|
97
|
+
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
|
|
98
|
+
className: classNames(baseCls),
|
|
113
99
|
"data-be": "link-card",
|
|
114
100
|
"data-drag-el": true,
|
|
115
101
|
draggable: false,
|
|
@@ -140,12 +126,12 @@ export function LinkCard(param) {
|
|
|
140
126
|
if (typeof window === 'undefined') return;
|
|
141
127
|
window.open(element === null || element === void 0 ? void 0 : element.url);
|
|
142
128
|
},
|
|
143
|
-
className: classNames("".concat(baseCls, "-container")
|
|
129
|
+
className: classNames("".concat(baseCls, "-container"))
|
|
144
130
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
145
|
-
className: classNames("".concat(baseCls, "-container-content")
|
|
131
|
+
className: classNames("".concat(baseCls, "-container-content")),
|
|
146
132
|
contentEditable: false
|
|
147
133
|
}, element.icon ? /*#__PURE__*/ React.createElement("img", {
|
|
148
|
-
className: classNames("".concat(baseCls, "-container-content-icon")
|
|
134
|
+
className: classNames("".concat(baseCls, "-container-content-icon")),
|
|
149
135
|
src: element.icon,
|
|
150
136
|
width: 56
|
|
151
137
|
}) : null, /*#__PURE__*/ React.createElement("div", {
|
|
@@ -155,7 +141,7 @@ export function LinkCard(param) {
|
|
|
155
141
|
}
|
|
156
142
|
}, /*#__PURE__*/ React.createElement("a", {
|
|
157
143
|
href: element === null || element === void 0 ? void 0 : element.url,
|
|
158
|
-
className: classNames("".concat(baseCls, "-container-content-title")
|
|
144
|
+
className: classNames("".concat(baseCls, "-container-content-title")),
|
|
159
145
|
onClick: function(e) {
|
|
160
146
|
e.stopPropagation();
|
|
161
147
|
e.preventDefault();
|
|
@@ -164,9 +150,9 @@ export function LinkCard(param) {
|
|
|
164
150
|
},
|
|
165
151
|
download: element.title || element.name || 'no title'
|
|
166
152
|
}, element.title || element.name || 'no title'), /*#__PURE__*/ React.createElement("div", {
|
|
167
|
-
className: classNames("".concat(baseCls, "-container-content-description")
|
|
153
|
+
className: classNames("".concat(baseCls, "-container-content-description"))
|
|
168
154
|
}, element.description ? element.description : element === null || element === void 0 ? void 0 : element.url), /*#__PURE__*/ React.createElement("div", {
|
|
169
|
-
className: classNames("".concat(baseCls, "-container-content-collaborators")
|
|
155
|
+
className: classNames("".concat(baseCls, "-container-content-collaborators"))
|
|
170
156
|
}, ((_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.collaborators) ? /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(AvatarList, {
|
|
171
157
|
displayList: ((_element_otherProps1 = element.otherProps) === null || _element_otherProps1 === void 0 ? void 0 : (_element_otherProps_collaborators = _element_otherProps1.collaborators) === null || _element_otherProps_collaborators === void 0 ? void 0 : _element_otherProps_collaborators.map(function(item) {
|
|
172
158
|
var _Object_keys, _Object_values;
|
|
@@ -176,7 +162,7 @@ export function LinkCard(param) {
|
|
|
176
162
|
};
|
|
177
163
|
}).slice(0, 5)) || []
|
|
178
164
|
})) : /*#__PURE__*/ React.createElement("div", null), ((_element_otherProps2 = element.otherProps) === null || _element_otherProps2 === void 0 ? void 0 : _element_otherProps2.updateTime) ? /*#__PURE__*/ React.createElement("div", {
|
|
179
|
-
className: classNames("".concat(baseCls, "-container-content-updateTime")
|
|
165
|
+
className: classNames("".concat(baseCls, "-container-content-updateTime")),
|
|
180
166
|
style: {
|
|
181
167
|
color: 'rgba(0,0,0,0.45)',
|
|
182
168
|
fontSize: 12
|
|
@@ -190,5 +176,5 @@ export function LinkCard(param) {
|
|
|
190
176
|
fontSize: 60,
|
|
191
177
|
lineHeight: '100px'
|
|
192
178
|
}
|
|
193
|
-
}, children.at(-1))))
|
|
179
|
+
}, children.at(-1))));
|
|
194
180
|
}
|
|
@@ -53,10 +53,7 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
import { ConfigProvider } from "antd";
|
|
54
54
|
import classNames from "classnames";
|
|
55
55
|
import React, { createElement, useContext } from "react";
|
|
56
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
57
56
|
import { useEditorStore } from "../../store";
|
|
58
|
-
import { useStyle } from "./style";
|
|
59
|
-
export var ListContext = /*#__PURE__*/ React.createContext(null);
|
|
60
57
|
/**
|
|
61
58
|
* 列表组件,用于渲染有序或无序列表。
|
|
62
59
|
*
|
|
@@ -74,55 +71,29 @@ export var ListContext = /*#__PURE__*/ React.createContext(null);
|
|
|
74
71
|
* ```
|
|
75
72
|
*/ export var List = function(param) {
|
|
76
73
|
var element = param.element, attributes = param.attributes, children = param.children;
|
|
77
|
-
var _element_children;
|
|
78
|
-
// 支持新的列表类型和向后兼容
|
|
79
|
-
// 新格式:numbered-list 或 bulleted-list
|
|
80
|
-
// 旧格式:list 类型,通过 order 属性判断
|
|
81
|
-
var isOrdered = element.type === 'numbered-list' || element.type === 'list' && element.order === true;
|
|
82
|
-
// 获取 task 属性(支持旧格式和新格式)
|
|
83
|
-
var task = element.task;
|
|
84
|
-
debugInfo('List - 渲染列表', {
|
|
85
|
-
type: element.type,
|
|
86
|
-
isOrdered: isOrdered,
|
|
87
|
-
task: task,
|
|
88
|
-
start: isOrdered ? element.start : undefined,
|
|
89
|
-
childrenCount: (_element_children = element.children) === null || _element_children === void 0 ? void 0 : _element_children.length
|
|
90
|
-
});
|
|
91
74
|
var _useEditorStore = useEditorStore(), store = _useEditorStore.store, markdownContainerRef = _useEditorStore.markdownContainerRef;
|
|
92
75
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
93
76
|
var baseCls = context.getPrefixCls('agentic-md-editor-list');
|
|
94
|
-
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
95
77
|
var listContent = React.useMemo(function() {
|
|
96
78
|
// 支持新的列表类型和向后兼容
|
|
97
79
|
var isOrdered = element.type === 'numbered-list' || element.type === 'list' && element.order === true;
|
|
98
80
|
var task = element.task;
|
|
99
81
|
var start = isOrdered ? element.start : undefined;
|
|
100
82
|
var tag = isOrdered ? 'ol' : 'ul';
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
type: element.type,
|
|
104
|
-
start: start,
|
|
105
|
-
task: task
|
|
106
|
-
});
|
|
107
|
-
return wrapSSR(/*#__PURE__*/ React.createElement(ListContext.Provider, {
|
|
108
|
-
value: {
|
|
109
|
-
hashId: hashId
|
|
110
|
-
}
|
|
111
|
-
}, /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({
|
|
112
|
-
className: classNames("".concat(baseCls, "-container"), hashId, 'relative'),
|
|
83
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({
|
|
84
|
+
className: classNames("".concat(baseCls, "-container"), 'relative'),
|
|
113
85
|
"data-be": 'list'
|
|
114
86
|
}, attributes), {
|
|
115
87
|
onDragStart: function(e) {
|
|
116
|
-
debugInfo('List - 拖拽开始');
|
|
117
88
|
store.dragStart(e, markdownContainerRef.current);
|
|
118
89
|
}
|
|
119
90
|
}), /*#__PURE__*/ createElement(tag, _object_spread({
|
|
120
|
-
className: classNames(baseCls,
|
|
91
|
+
className: classNames(baseCls, isOrdered ? 'ol' : 'ul')
|
|
121
92
|
}, start !== undefined && {
|
|
122
93
|
start: start
|
|
123
94
|
}, task && {
|
|
124
95
|
'data-task': 'true'
|
|
125
|
-
}), children))
|
|
96
|
+
}), children));
|
|
126
97
|
}, [
|
|
127
98
|
element.type,
|
|
128
99
|
element.order,
|
|
@@ -130,12 +101,10 @@ export var ListContext = /*#__PURE__*/ React.createContext(null);
|
|
|
130
101
|
element.start,
|
|
131
102
|
element.children,
|
|
132
103
|
baseCls,
|
|
133
|
-
hashId,
|
|
134
104
|
attributes,
|
|
135
105
|
children,
|
|
136
106
|
store,
|
|
137
|
-
markdownContainerRef
|
|
138
|
-
wrapSSR
|
|
107
|
+
markdownContainerRef
|
|
139
108
|
]);
|
|
140
109
|
return listContent;
|
|
141
110
|
};
|
|
@@ -205,10 +205,8 @@ import { useMountMergeState } from "@ant-design/pro-components";
|
|
|
205
205
|
import { Checkbox, ConfigProvider, Dropdown, Space } from "antd";
|
|
206
206
|
import classNames from "classnames";
|
|
207
207
|
import React, { useContext, useEffect, useMemo } from "react";
|
|
208
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
209
208
|
import { useMEditor } from "../../../hooks/editor";
|
|
210
209
|
import { useEditorStore } from "../../store";
|
|
211
|
-
import { ListContext } from "./List";
|
|
212
210
|
var MentionsUser = function(props) {
|
|
213
211
|
var _editorProps_comment, _editorProps_comment1, _editorProps_comment2;
|
|
214
212
|
var _React_useState = _sliced_to_array(React.useState(false), 2), loading = _React_useState[0], setLoading = _React_useState[1];
|
|
@@ -371,32 +369,22 @@ var MentionsUser = function(props) {
|
|
|
371
369
|
* - 如果是任务列表项,会渲染一个不可编辑的复选框。
|
|
372
370
|
*/ export var ListItem = function(param) {
|
|
373
371
|
var element = param.element, children = param.children, attributes = param.attributes;
|
|
374
|
-
var
|
|
375
|
-
debugInfo('ListItem - 渲染列表项', {
|
|
376
|
-
checked: element.checked,
|
|
377
|
-
isTask: typeof element.checked === 'boolean',
|
|
378
|
-
mentionsCount: (_element_mentions = element.mentions) === null || _element_mentions === void 0 ? void 0 : _element_mentions.length,
|
|
379
|
-
childrenCount: (_element_children = element.children) === null || _element_children === void 0 ? void 0 : _element_children.length
|
|
380
|
-
});
|
|
372
|
+
var _editorProps_comment;
|
|
381
373
|
var _useMEditor = _sliced_to_array(useMEditor(element), 2), update = _useMEditor[1];
|
|
382
374
|
var _useEditorStore = useEditorStore(), store = _useEditorStore.store, editorProps = _useEditorStore.editorProps, markdownContainerRef = _useEditorStore.markdownContainerRef;
|
|
383
375
|
var isTask = typeof element.checked === 'boolean';
|
|
384
376
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
385
377
|
var listItemRender = editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_comment = editorProps.comment) === null || _editorProps_comment === void 0 ? void 0 : _editorProps_comment.listItemRender;
|
|
386
|
-
var _ref = useContext(ListContext) || {}, _ref_hashId = _ref.hashId, hashId = _ref_hashId === void 0 ? '' : _ref_hashId;
|
|
387
378
|
var baseCls = context.getPrefixCls('agentic-md-editor-list');
|
|
388
379
|
var checkbox = React.useMemo(function() {
|
|
389
380
|
if (!isTask) return null;
|
|
390
381
|
return /*#__PURE__*/ React.createElement("span", {
|
|
391
382
|
contentEditable: false,
|
|
392
383
|
"data-check-item": true,
|
|
393
|
-
className: classNames("".concat(baseCls, "-check-item")
|
|
384
|
+
className: classNames("".concat(baseCls, "-check-item"))
|
|
394
385
|
}, /*#__PURE__*/ React.createElement(Checkbox, {
|
|
395
386
|
checked: element.checked,
|
|
396
387
|
onChange: function(e) {
|
|
397
|
-
debugInfo('ListItem - 复选框状态改变', {
|
|
398
|
-
checked: e.target.checked
|
|
399
|
-
});
|
|
400
388
|
update({
|
|
401
389
|
checked: e.target.checked
|
|
402
390
|
});
|
|
@@ -427,10 +415,9 @@ var MentionsUser = function(props) {
|
|
|
427
415
|
children: children
|
|
428
416
|
};
|
|
429
417
|
return /*#__PURE__*/ React.createElement("li", _object_spread({
|
|
430
|
-
className: classNames("".concat(baseCls, "-item"),
|
|
418
|
+
className: classNames("".concat(baseCls, "-item"), _define_property({}, "".concat(baseCls, "-task"), isTask)),
|
|
431
419
|
"data-be": 'list-item',
|
|
432
420
|
onDragStart: function(e) {
|
|
433
|
-
debugInfo('ListItem - 拖拽开始');
|
|
434
421
|
store.dragStart(e, markdownContainerRef.current);
|
|
435
422
|
}
|
|
436
423
|
}, attributes), listItemRender(props, {
|
|
@@ -440,10 +427,9 @@ var MentionsUser = function(props) {
|
|
|
440
427
|
}));
|
|
441
428
|
}
|
|
442
429
|
return /*#__PURE__*/ React.createElement("li", _object_spread({
|
|
443
|
-
className: classNames("".concat(baseCls, "-item"),
|
|
430
|
+
className: classNames("".concat(baseCls, "-item"), _define_property({}, "".concat(baseCls, "-task"), isTask)),
|
|
444
431
|
"data-be": 'list-item',
|
|
445
432
|
onDragStart: function(e) {
|
|
446
|
-
debugInfo('ListItem - 拖拽开始');
|
|
447
433
|
store.dragStart(e, markdownContainerRef.current);
|
|
448
434
|
}
|
|
449
435
|
}, attributes), checkbox, mentionsUser, children);
|
|
@@ -29,8 +29,6 @@ function _object_spread(target) {
|
|
|
29
29
|
import { ConfigProvider } from "antd";
|
|
30
30
|
import classNames from "classnames";
|
|
31
31
|
import React, { createElement, useContext } from "react";
|
|
32
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
33
|
-
import { useStyle } from "./style";
|
|
34
32
|
/**
|
|
35
33
|
* ReadonlyList 组件 - 只读列表预览组件
|
|
36
34
|
*
|
|
@@ -62,32 +60,17 @@ import { useStyle } from "./style";
|
|
|
62
60
|
* - 保持预览模式的视觉效果
|
|
63
61
|
*/ export var ReadonlyList = /*#__PURE__*/ React.memo(function(param) {
|
|
64
62
|
var element = param.element, attributes = param.attributes, children = param.children;
|
|
65
|
-
var _element_children;
|
|
66
63
|
var isOrdered = element.type === 'numbered-list';
|
|
67
64
|
var isBulleted = element.type === 'bulleted-list';
|
|
68
|
-
debugInfo('ReadonlyList - 渲染只读列表', {
|
|
69
|
-
type: element.type,
|
|
70
|
-
isOrdered: isOrdered,
|
|
71
|
-
task: isBulleted ? element.task : undefined,
|
|
72
|
-
start: isOrdered ? element.start : undefined,
|
|
73
|
-
childrenCount: (_element_children = element.children) === null || _element_children === void 0 ? void 0 : _element_children.length
|
|
74
|
-
});
|
|
75
65
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
76
66
|
var baseCls = context.getPrefixCls('agentic-md-editor-list');
|
|
77
|
-
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
78
67
|
var tag = isOrdered ? 'ol' : 'ul';
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
type: element.type,
|
|
82
|
-
start: isOrdered ? element.start : undefined,
|
|
83
|
-
task: isBulleted ? element.task : undefined
|
|
84
|
-
});
|
|
85
|
-
return wrapSSR(/*#__PURE__*/ React.createElement("div", _object_spread({
|
|
86
|
-
className: classNames("".concat(baseCls, "-container"), hashId, 'relative'),
|
|
68
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread({
|
|
69
|
+
className: classNames("".concat(baseCls, "-container"), 'relative'),
|
|
87
70
|
"data-be": 'list'
|
|
88
71
|
}, attributes), /*#__PURE__*/ createElement(tag, _define_property({
|
|
89
|
-
className: classNames(baseCls,
|
|
72
|
+
className: classNames(baseCls, isOrdered ? 'ol' : 'ul'),
|
|
90
73
|
start: isOrdered ? element.start : undefined
|
|
91
|
-
}, 'data-task', isBulleted && element.task ? 'true' : undefined), children))
|
|
74
|
+
}, 'data-task', isBulleted && element.task ? 'true' : undefined), children));
|
|
92
75
|
});
|
|
93
76
|
ReadonlyList.displayName = 'ReadonlyList';
|
|
@@ -29,8 +29,6 @@ function _object_spread(target) {
|
|
|
29
29
|
import { Checkbox, ConfigProvider } from "antd";
|
|
30
30
|
import classNames from "classnames";
|
|
31
31
|
import React, { useContext, useMemo } from "react";
|
|
32
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
33
|
-
import { ListContext } from "./List";
|
|
34
32
|
/**
|
|
35
33
|
* ReadonlyListItem 组件 - 只读列表项预览组件
|
|
36
34
|
*
|
|
@@ -64,16 +62,8 @@ import { ListContext } from "./List";
|
|
|
64
62
|
* - 保持预览模式的视觉效果
|
|
65
63
|
*/ export var ReadonlyListItem = /*#__PURE__*/ React.memo(function(param) {
|
|
66
64
|
var element = param.element, children = param.children, attributes = param.attributes;
|
|
67
|
-
var _element_mentions, _element_children;
|
|
68
|
-
debugInfo('ReadonlyListItem - 渲染只读列表项', {
|
|
69
|
-
checked: element.checked,
|
|
70
|
-
isTask: typeof element.checked === 'boolean',
|
|
71
|
-
mentionsCount: (_element_mentions = element.mentions) === null || _element_mentions === void 0 ? void 0 : _element_mentions.length,
|
|
72
|
-
childrenCount: (_element_children = element.children) === null || _element_children === void 0 ? void 0 : _element_children.length
|
|
73
|
-
});
|
|
74
65
|
var isTask = typeof element.checked === 'boolean';
|
|
75
66
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
76
|
-
var _ref = useContext(ListContext) || {}, _ref_hashId = _ref.hashId, hashId = _ref_hashId === void 0 ? '' : _ref_hashId;
|
|
77
67
|
var baseCls = context.getPrefixCls('agentic-md-editor-list');
|
|
78
68
|
// 任务列表的复选框(只读模式)
|
|
79
69
|
var checkbox = useMemo(function() {
|
|
@@ -81,7 +71,7 @@ import { ListContext } from "./List";
|
|
|
81
71
|
return /*#__PURE__*/ React.createElement("span", {
|
|
82
72
|
contentEditable: false,
|
|
83
73
|
"data-check-item": true,
|
|
84
|
-
className: classNames("".concat(baseCls, "-check-item")
|
|
74
|
+
className: classNames("".concat(baseCls, "-check-item"))
|
|
85
75
|
}, /*#__PURE__*/ React.createElement(Checkbox, {
|
|
86
76
|
checked: element.checked,
|
|
87
77
|
disabled: true
|
|
@@ -89,8 +79,7 @@ import { ListContext } from "./List";
|
|
|
89
79
|
}, [
|
|
90
80
|
element.checked,
|
|
91
81
|
isTask,
|
|
92
|
-
baseCls
|
|
93
|
-
hashId
|
|
82
|
+
baseCls
|
|
94
83
|
]);
|
|
95
84
|
// 提及用户显示(只读模式,只显示不编辑)
|
|
96
85
|
var mentionsUser = useMemo(function() {
|
|
@@ -131,7 +120,7 @@ import { ListContext } from "./List";
|
|
|
131
120
|
isTask
|
|
132
121
|
]);
|
|
133
122
|
return /*#__PURE__*/ React.createElement("li", _object_spread({
|
|
134
|
-
className: classNames("".concat(baseCls, "-item"),
|
|
123
|
+
className: classNames("".concat(baseCls, "-item"), _define_property({}, "".concat(baseCls, "-task"), isTask)),
|
|
135
124
|
"data-be": 'list-item'
|
|
136
125
|
}, attributes), checkbox, mentionsUser, children);
|
|
137
126
|
});
|
|
@@ -53,8 +53,6 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
import { ConfigProvider } from "antd";
|
|
54
54
|
import classNames from "classnames";
|
|
55
55
|
import React, { useContext } from "react";
|
|
56
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
57
|
-
import { useStyle } from "./style";
|
|
58
56
|
/**
|
|
59
57
|
* ReadonlyMermaid 组件 - 只读 Mermaid 图表预览组件
|
|
60
58
|
*
|
|
@@ -85,17 +83,12 @@ import { useStyle } from "./style";
|
|
|
85
83
|
* - 保持预览模式的视觉效果
|
|
86
84
|
*/ export var ReadonlyMermaid = /*#__PURE__*/ React.memo(function(param) {
|
|
87
85
|
var attributes = param.attributes, children = param.children, element = param.element;
|
|
88
|
-
var _element_otherProps
|
|
89
|
-
debugInfo('ReadonlyMermaid - 渲染只读 Mermaid 图表', {
|
|
90
|
-
hasError: (element === null || element === void 0 ? void 0 : (_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.error) === true,
|
|
91
|
-
valueLength: element === null || element === void 0 ? void 0 : (_element_value = element.value) === null || _element_value === void 0 ? void 0 : _element_value.length
|
|
92
|
-
});
|
|
86
|
+
var _element_otherProps;
|
|
93
87
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
94
88
|
var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-mermaid');
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}), /*#__PURE__*/ React.createElement("code", null, children)));
|
|
89
|
+
var hasError = (element === null || element === void 0 ? void 0 : (_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.error) === true;
|
|
90
|
+
return /*#__PURE__*/ React.createElement("pre", _object_spread_props(_object_spread({}, attributes), {
|
|
91
|
+
className: classNames(baseCls, _define_property({}, "".concat(baseCls, "-error"), hasError))
|
|
92
|
+
}), /*#__PURE__*/ React.createElement("code", null, children));
|
|
100
93
|
});
|
|
101
94
|
ReadonlyMermaid.displayName = 'ReadonlyMermaid';
|
|
@@ -53,20 +53,13 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
import { ConfigProvider } from "antd";
|
|
54
54
|
import classNames from "classnames";
|
|
55
55
|
import React, { useContext } from "react";
|
|
56
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
57
|
-
import { useStyle } from "./style";
|
|
58
56
|
export var Mermaid = function(param) {
|
|
59
57
|
var attributes = param.attributes, children = param.children, element = param.element;
|
|
60
|
-
var _element_otherProps
|
|
61
|
-
debugInfo('Mermaid - 渲染 Mermaid 图表', {
|
|
62
|
-
hasError: (element === null || element === void 0 ? void 0 : (_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.error) === true,
|
|
63
|
-
valueLength: element === null || element === void 0 ? void 0 : (_element_value = element.value) === null || _element_value === void 0 ? void 0 : _element_value.length
|
|
64
|
-
});
|
|
58
|
+
var _element_otherProps;
|
|
65
59
|
var context = useContext(ConfigProvider.ConfigContext);
|
|
66
60
|
var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-mermaid');
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}), /*#__PURE__*/ React.createElement("code", null, children)));
|
|
61
|
+
var hasError = (element === null || element === void 0 ? void 0 : (_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.error) === true;
|
|
62
|
+
return /*#__PURE__*/ React.createElement("pre", _object_spread_props(_object_spread({}, attributes), {
|
|
63
|
+
className: classNames(baseCls, _define_property({}, "".concat(baseCls, "-error"), hasError))
|
|
64
|
+
}), /*#__PURE__*/ React.createElement("code", null, children));
|
|
72
65
|
};
|
|
@@ -53,7 +53,6 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
import classNames from "classnames";
|
|
54
54
|
import React from "react";
|
|
55
55
|
import { Node } from "slate";
|
|
56
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
57
56
|
/**
|
|
58
57
|
* ReadonlyParagraph 组件 - 只读段落预览组件
|
|
59
58
|
*
|
|
@@ -87,15 +86,7 @@ import { debugInfo } from "../../../../Utils/debugUtils";
|
|
|
87
86
|
* - 保持预览模式的视觉效果
|
|
88
87
|
*/ export var ReadonlyParagraph = /*#__PURE__*/ React.memo(function(props) {
|
|
89
88
|
var _props_children;
|
|
90
|
-
debugInfo('ReadonlyParagraph - 渲染只读段落', {
|
|
91
|
-
align: props.element.align,
|
|
92
|
-
children: props.element.children
|
|
93
|
-
});
|
|
94
89
|
var str = Node.string(props.element).trim();
|
|
95
|
-
debugInfo('ReadonlyParagraph - useMemo 渲染', {
|
|
96
|
-
strLength: str.length,
|
|
97
|
-
align: props.element.align
|
|
98
|
-
});
|
|
99
90
|
return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({}, props.attributes), {
|
|
100
91
|
"data-be": 'paragraph',
|
|
101
92
|
className: classNames({}),
|
|
@@ -140,7 +140,6 @@ export var Paragraph = function(props) {
|
|
|
140
140
|
"data-align": props.element.align,
|
|
141
141
|
"data-slate-placeholder": isEmpty ? editorProps.titlePlaceholderContent || (locale === null || locale === void 0 ? void 0 : locale.inputPlaceholder) || '请输入内容...' : undefined,
|
|
142
142
|
onDragStart: function(e) {
|
|
143
|
-
debugInfo('Paragraph - 拖拽开始');
|
|
144
143
|
store.dragStart(e, markdownContainerRef.current);
|
|
145
144
|
},
|
|
146
145
|
"data-empty": isEmpty,
|
|
@@ -50,14 +50,9 @@ function _object_spread_props(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
function _type_of(obj) {
|
|
54
|
-
"@swc/helpers - typeof";
|
|
55
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
56
|
-
}
|
|
57
53
|
import React, { useContext } from "react";
|
|
58
54
|
import { BubbleConfigContext } from "../../../../Bubble/BubbleConfigProvide";
|
|
59
55
|
import { SchemaRenderer } from "../../../../Schema";
|
|
60
|
-
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
61
56
|
import { useEditorStore } from "../../store";
|
|
62
57
|
/**
|
|
63
58
|
* ReadonlySchema 组件 - 只读模式渲染组件
|
|
@@ -89,17 +84,11 @@ import { useEditorStore } from "../../store";
|
|
|
89
84
|
* - 使用 React.memo 优化性能
|
|
90
85
|
* - 保持预览模式的视觉效果
|
|
91
86
|
*/ export var ReadonlySchema = /*#__PURE__*/ React.memo(function(props) {
|
|
92
|
-
debugInfo('ReadonlySchema - 渲染只读 Schema', {
|
|
93
|
-
language: props.element.language,
|
|
94
|
-
valueType: _type_of(props.element.value),
|
|
95
|
-
hasApaasify: !!props.element.apaasify
|
|
96
|
-
});
|
|
97
87
|
var node = props.element;
|
|
98
88
|
var editorProps = useEditorStore().editorProps;
|
|
99
89
|
var apaasify = (editorProps === null || editorProps === void 0 ? void 0 : editorProps.apaasify) || (editorProps === null || editorProps === void 0 ? void 0 : editorProps.apassify);
|
|
100
90
|
var bubble = (useContext(BubbleConfigContext) || {}).bubble;
|
|
101
91
|
if ((apaasify === null || apaasify === void 0 ? void 0 : apaasify.enable) && apaasify.render) {
|
|
102
|
-
debugInfo('ReadonlySchema - 使用自定义 apaasify 渲染');
|
|
103
92
|
var renderedContent = apaasify.render(props, bubble === null || bubble === void 0 ? void 0 : bubble.originData);
|
|
104
93
|
return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({}, node.attributes), {
|
|
105
94
|
"data-testid": "schema-container",
|
|
@@ -123,7 +112,6 @@ import { useEditorStore } from "../../store";
|
|
|
123
112
|
}
|
|
124
113
|
if (node.language === 'agentar-card') {
|
|
125
114
|
var _props_element_value;
|
|
126
|
-
debugInfo('ReadonlySchema - 使用 AgentAR 卡片渲染');
|
|
127
115
|
return /*#__PURE__*/ React.createElement("div", {
|
|
128
116
|
"data-testid": "agentar-card-container",
|
|
129
117
|
style: {
|
|
@@ -138,7 +126,6 @@ import { useEditorStore } from "../../store";
|
|
|
138
126
|
fallbackContent: null
|
|
139
127
|
}));
|
|
140
128
|
}
|
|
141
|
-
debugInfo('ReadonlySchema - 使用默认 JSON 渲染');
|
|
142
129
|
return /*#__PURE__*/ React.createElement("pre", _object_spread_props(_object_spread({}, props.attributes), {
|
|
143
130
|
style: {
|
|
144
131
|
background: 'rgb(242, 241, 241)',
|