@ant-design/agentic-ui 2.29.29 → 2.29.31

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.
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { MarkdownEditorInstance, MarkdownEditorProps } from '../types';
2
3
  /**
3
4
  * Markdown 编辑器组件的属性接口
@@ -66,4 +67,4 @@ export type MEditorProps = {
66
67
  * - 支持错误边界
67
68
  * - 响应式布局
68
69
  */
69
- export declare const SlateMarkdownEditor: (props: MEditorProps) => any;
70
+ export declare const SlateMarkdownEditor: React.MemoExoticComponent<(props: MEditorProps) => any>;
@@ -322,7 +322,7 @@ var defaultAllowedTypes = [
322
322
  * - 提供粘贴处理
323
323
  * - 支持错误边界
324
324
  * - 响应式布局
325
- */ export var SlateMarkdownEditor = function SlateMarkdownEditor(props) {
325
+ */ export var SlateMarkdownEditor = /*#__PURE__*/ React.memo(function(props) {
326
326
  var _markdownEditorRef_current, _props_textAreaProps, _props_comment, _markdownEditorRef_current1;
327
327
  // 所有hooks必须在组件顶部按固定顺序调用
328
328
  var _useEditorStore = useEditorStore(), store = _useEditorStore.store, markdownEditorRef = _useEditorStore.markdownEditorRef, markdownContainerRef = _useEditorStore.markdownContainerRef, readonly = _useEditorStore.readonly, setDomRect = _useEditorStore.setDomRect, jinjaEnabled = _useEditorStore.jinjaEnabled;
@@ -1229,4 +1229,4 @@ var defaultAllowedTypes = [
1229
1229
  renderLeaf: renderMarkdownLeaf,
1230
1230
  onKeyDown: handleKeyDown
1231
1231
  }))));
1232
- };
1232
+ });
@@ -82,7 +82,8 @@ import { AvatarList } from "../../components/ContributorAvatar";
82
82
  var element = param.element, attributes = param.attributes, children = param.children;
83
83
  var _element_otherProps, _element_otherProps_collaborators, _element_otherProps1, _element_otherProps2;
84
84
  var context = useContext(ConfigProvider.ConfigContext);
85
- var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-link-card');
85
+ var contentCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-content');
86
+ var blockCls = contentCls ? "".concat(contentCls, "-link-card") : '';
86
87
  var _useState = _sliced_to_array(useState(false), 2), showAsText = _useState[0], setShowAsText = _useState[1];
87
88
  // 如果 finished 为 false,设置 5 秒超时,超时后显示为文本
88
89
  useEffect(function() {
@@ -123,7 +124,7 @@ import { AvatarList } from "../../components/ContributorAvatar";
123
124
  }), children);
124
125
  }
125
126
  return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
126
- className: classNames(baseCls),
127
+ className: classNames(blockCls),
127
128
  "data-be": "link-card",
128
129
  draggable: false,
129
130
  style: {
@@ -146,12 +147,12 @@ import { AvatarList } from "../../components/ContributorAvatar";
146
147
  if (typeof window === 'undefined') return;
147
148
  window.open(element === null || element === void 0 ? void 0 : element.url);
148
149
  },
149
- className: classNames("".concat(baseCls, "-container"))
150
+ className: classNames("".concat(blockCls, "__container"))
150
151
  }, /*#__PURE__*/ React.createElement("div", {
151
- className: classNames("".concat(baseCls, "-container-content")),
152
+ className: classNames("".concat(blockCls, "__content")),
152
153
  contentEditable: false
153
154
  }, element.icon ? /*#__PURE__*/ React.createElement("img", {
154
- className: classNames("".concat(baseCls, "-container-content-icon")),
155
+ className: classNames("".concat(blockCls, "__icon")),
155
156
  src: element.icon,
156
157
  width: 56
157
158
  }) : null, /*#__PURE__*/ React.createElement("div", {
@@ -161,7 +162,7 @@ import { AvatarList } from "../../components/ContributorAvatar";
161
162
  }
162
163
  }, /*#__PURE__*/ React.createElement("a", {
163
164
  href: element === null || element === void 0 ? void 0 : element.url,
164
- className: classNames("".concat(baseCls, "-container-content-title")),
165
+ className: classNames("".concat(blockCls, "__title")),
165
166
  onClick: function onClick(e) {
166
167
  e.stopPropagation();
167
168
  e.preventDefault();
@@ -170,9 +171,9 @@ import { AvatarList } from "../../components/ContributorAvatar";
170
171
  },
171
172
  download: element.title || element.name || 'no title'
172
173
  }, element.title || element.name || 'no title'), /*#__PURE__*/ React.createElement("div", {
173
- className: classNames("".concat(baseCls, "-container-content-description"))
174
+ className: classNames("".concat(blockCls, "__description"))
174
175
  }, element.description ? element.description : element === null || element === void 0 ? void 0 : element.url), /*#__PURE__*/ React.createElement("div", {
175
- className: classNames("".concat(baseCls, "-container-content-collaborators"))
176
+ className: classNames("".concat(blockCls, "__collaborators"))
176
177
  }, ((_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.collaborators) ? /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(AvatarList, {
177
178
  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) {
178
179
  var _Object_keys, _Object_values;
@@ -182,7 +183,7 @@ import { AvatarList } from "../../components/ContributorAvatar";
182
183
  };
183
184
  }).slice(0, 5)) || []
184
185
  })) : /*#__PURE__*/ React.createElement("div", null), ((_element_otherProps2 = element.otherProps) === null || _element_otherProps2 === void 0 ? void 0 : _element_otherProps2.updateTime) ? /*#__PURE__*/ React.createElement("div", {
185
- className: classNames("".concat(baseCls, "-container-content-updateTime")),
186
+ className: classNames("".concat(blockCls, "__update-time")),
186
187
  style: {
187
188
  color: 'rgba(0,0,0,0.45)',
188
189
  fontSize: 12
@@ -53,7 +53,8 @@ export function LinkCard(param) {
53
53
  var element = param.element, attributes = param.attributes, children = param.children;
54
54
  var _element_otherProps, _element_otherProps_collaborators, _element_otherProps1, _element_otherProps2;
55
55
  var context = useContext(ConfigProvider.ConfigContext);
56
- var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-link-card');
56
+ var contentCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-content');
57
+ var blockCls = contentCls ? "".concat(contentCls, "-link-card") : '';
57
58
  var htmlRef = React.useRef(null);
58
59
  var _useState = _sliced_to_array(useState(false), 2), showAsText = _useState[0], setShowAsText = _useState[1];
59
60
  // 如果 finished 为 false,设置 5 秒超时,超时后显示为文本
@@ -95,7 +96,7 @@ export function LinkCard(param) {
95
96
  }), children);
96
97
  }
97
98
  return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
98
- className: classNames(baseCls),
99
+ className: classNames(blockCls),
99
100
  "data-be": "link-card",
100
101
  "data-drag-el": true,
101
102
  draggable: false,
@@ -126,12 +127,12 @@ export function LinkCard(param) {
126
127
  if (typeof window === 'undefined') return;
127
128
  window.open(element === null || element === void 0 ? void 0 : element.url);
128
129
  },
129
- className: classNames("".concat(baseCls, "-container"))
130
+ className: classNames("".concat(blockCls, "__container"))
130
131
  }, /*#__PURE__*/ React.createElement("div", {
131
- className: classNames("".concat(baseCls, "-container-content")),
132
+ className: classNames("".concat(blockCls, "__content")),
132
133
  contentEditable: false
133
134
  }, element.icon ? /*#__PURE__*/ React.createElement("img", {
134
- className: classNames("".concat(baseCls, "-container-content-icon")),
135
+ className: classNames("".concat(blockCls, "__icon")),
135
136
  src: element.icon,
136
137
  width: 56
137
138
  }) : null, /*#__PURE__*/ React.createElement("div", {
@@ -141,7 +142,7 @@ export function LinkCard(param) {
141
142
  }
142
143
  }, /*#__PURE__*/ React.createElement("a", {
143
144
  href: element === null || element === void 0 ? void 0 : element.url,
144
- className: classNames("".concat(baseCls, "-container-content-title")),
145
+ className: classNames("".concat(blockCls, "__title")),
145
146
  onClick: function onClick(e) {
146
147
  e.stopPropagation();
147
148
  e.preventDefault();
@@ -150,9 +151,9 @@ export function LinkCard(param) {
150
151
  },
151
152
  download: element.title || element.name || 'no title'
152
153
  }, element.title || element.name || 'no title'), /*#__PURE__*/ React.createElement("div", {
153
- className: classNames("".concat(baseCls, "-container-content-description"))
154
+ className: classNames("".concat(blockCls, "__description"))
154
155
  }, element.description ? element.description : element === null || element === void 0 ? void 0 : element.url), /*#__PURE__*/ React.createElement("div", {
155
- className: classNames("".concat(baseCls, "-container-content-collaborators"))
156
+ className: classNames("".concat(blockCls, "__collaborators"))
156
157
  }, ((_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.collaborators) ? /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(AvatarList, {
157
158
  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) {
158
159
  var _Object_keys, _Object_values;
@@ -162,7 +163,7 @@ export function LinkCard(param) {
162
163
  };
163
164
  }).slice(0, 5)) || []
164
165
  })) : /*#__PURE__*/ React.createElement("div", null), ((_element_otherProps2 = element.otherProps) === null || _element_otherProps2 === void 0 ? void 0 : _element_otherProps2.updateTime) ? /*#__PURE__*/ React.createElement("div", {
165
- className: classNames("".concat(baseCls, "-container-content-updateTime")),
166
+ className: classNames("".concat(blockCls, "__update-time")),
166
167
  style: {
167
168
  color: 'rgba(0,0,0,0.45)',
168
169
  fontSize: 12
@@ -171,7 +171,6 @@ export var BackspaceKey = /*#__PURE__*/ function() {
171
171
  var listItem = parent1[0];
172
172
  var firstChild = Element.isElement(listItem) && listItem.children.length > 0 ? listItem.children[0] : null;
173
173
  var isEmptyListItem = firstChild && Element.isElement(firstChild) && firstChild.type === 'paragraph' && Node.string(firstChild).trim() === '' && listItem.children.length === 1; // 只有第一个段落,没有嵌套列表
174
- console.log('isEmptyListItem', isEmptyListItem);
175
174
  // 如果 list-item 为空,优先执行删除逻辑
176
175
  if (isEmptyListItem) {
177
176
  // 使用新的拆分逻辑处理空的list-item
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Editor } from 'slate';
3
3
  export declare class MatchKey {
4
- private readonly editor;
5
- constructor(editor: Editor);
4
+ private readonly editorRef;
5
+ constructor(editorRef: React.MutableRefObject<Editor | null>);
6
6
  private createParams;
7
7
  run(e: React.KeyboardEvent): boolean;
8
8
  }
@@ -84,20 +84,20 @@ import { Editor, Element, Node, Range } from "slate";
84
84
  import { TextMatchNodes } from "../elements";
85
85
  export var MatchKey = /*#__PURE__*/ function() {
86
86
  "use strict";
87
- function MatchKey(editor) {
87
+ function MatchKey(editorRef) {
88
88
  _class_call_check(this, MatchKey);
89
- _define_property(this, "editor", void 0);
90
- this.editor = editor;
89
+ _define_property(this, "editorRef", void 0);
90
+ this.editorRef = editorRef;
91
91
  }
92
92
  _create_class(MatchKey, [
93
93
  {
94
94
  key: "createParams",
95
- value: function createParams(node, match) {
95
+ value: function createParams(editor, node, match) {
96
96
  return {
97
97
  el: node[0],
98
98
  path: node[1],
99
- editor: this.editor,
100
- sel: this.editor.selection,
99
+ editor: editor,
100
+ sel: editor.selection,
101
101
  match: match,
102
102
  startText: match[0]
103
103
  };
@@ -107,7 +107,9 @@ export var MatchKey = /*#__PURE__*/ function() {
107
107
  key: "run",
108
108
  value: function run(e) {
109
109
  var _node_;
110
- var _Editor_nodes = _sliced_to_array(Editor.nodes(this.editor, {
110
+ var editor = this.editorRef.current;
111
+ if (!editor) return false;
112
+ var _Editor_nodes = _sliced_to_array(Editor.nodes(editor, {
111
113
  match: function match(n) {
112
114
  return Element.isElement(n);
113
115
  },
@@ -116,7 +118,7 @@ export var MatchKey = /*#__PURE__*/ function() {
116
118
  if (!node || [
117
119
  'code'
118
120
  ].includes(node === null || node === void 0 ? void 0 : (_node_ = node[0]) === null || _node_ === void 0 ? void 0 : _node_.type)) return false;
119
- var sel = this.editor.selection;
121
+ var sel = editor.selection;
120
122
  if (!sel || !Range.isCollapsed(sel)) return false;
121
123
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
122
124
  try {
@@ -124,14 +126,14 @@ export var MatchKey = /*#__PURE__*/ function() {
124
126
  var n = _step.value;
125
127
  if (_type_of(n.matchKey) === 'object' ? n.matchKey.test(e.key) : n.matchKey === e.key) {
126
128
  if (n.checkAllow && !n.checkAllow({
127
- editor: this.editor,
129
+ editor: editor,
128
130
  node: node,
129
131
  sel: sel
130
132
  })) continue;
131
- var str = Node.string(Node.leaf(this.editor, sel.anchor.path)).slice(0, sel.anchor.offset) + e.key;
133
+ var str = Node.string(Node.leaf(editor, sel.anchor.path)).slice(0, sel.anchor.offset) + e.key;
132
134
  var m = str.match(n.reg);
133
135
  if (m) {
134
- if (n.run(this.createParams(node, m))) {
136
+ if (n.run(this.createParams(editor, node, m))) {
135
137
  e.preventDefault();
136
138
  return true;
137
139
  }
@@ -49,7 +49,7 @@ function _unsupported_iterable_to_array(o, minLen) {
49
49
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
50
50
  }
51
51
  import isHotkey from "is-hotkey";
52
- import { useMemo } from "react";
52
+ import { useRef, useMemo } from "react";
53
53
  import { Editor, Element, Node, Path, Range, Transforms } from "slate";
54
54
  import { EditorUtils } from "../utils/editorUtils";
55
55
  import { BackspaceKey } from "./hotKeyCommands/backspace";
@@ -98,17 +98,21 @@ import { useEditorStore } from "../store";
98
98
  * - 与编辑器状态深度集成,实现上下文相关的行为
99
99
  * - 提供良好的用户体验和 Markdown 编辑效率
100
100
  */ export var useKeyboard = function useKeyboard(store, markdownEditorRef, props) {
101
+ var _props_markdown;
101
102
  var _useEditorStore = useEditorStore(), openInsertCompletion = _useEditorStore.openInsertCompletion, insertCompletionText$ = _useEditorStore.insertCompletionText$, setOpenInsertCompletion = _useEditorStore.setOpenInsertCompletion, openJinjaTemplate = _useEditorStore.openJinjaTemplate, setOpenJinjaTemplate = _useEditorStore.setOpenJinjaTemplate, setJinjaAnchorPath = _useEditorStore.setJinjaAnchorPath, jinjaTemplatePanelEnabled = _useEditorStore.jinjaTemplatePanelEnabled, editorProps = _useEditorStore.editorProps;
102
103
  // 从 editorProps.jinja 读取(BaseMarkdownEditor 已写入 effectiveJinja),支持插件配置的 trigger
103
104
  var effectiveJinja = editorProps === null || editorProps === void 0 ? void 0 : editorProps.jinja;
104
105
  var jinjaTrigger = (effectiveJinja === null || effectiveJinja === void 0 ? void 0 : effectiveJinja.templatePanel) && _type_of(effectiveJinja.templatePanel) === 'object' && effectiveJinja.templatePanel.trigger || '{}';
106
+ var matchKeyRef = useRef(null);
107
+ if (matchKeyRef.current === null) {
108
+ matchKeyRef.current = new MatchKey(markdownEditorRef);
109
+ }
105
110
  return useMemo(function() {
106
111
  var tab = new TabKey(markdownEditorRef.current);
107
112
  var backspace = new BackspaceKey(markdownEditorRef.current);
108
113
  var enter = new EnterKey(store, backspace);
109
- var match = new MatchKey(markdownEditorRef.current);
110
114
  return function(e) {
111
- var _props_markdown, _node_;
115
+ var _props_markdown, _e_nativeEvent, _node_;
112
116
  // 只读模式下跳过所有键盘处理,提升性能
113
117
  if (props.readonly) return;
114
118
  // 处理表格键盘事件
@@ -156,8 +160,10 @@ import { useEditorStore } from "../store";
156
160
  if (isHotkey('mod+shift+s', e)) {
157
161
  e.preventDefault();
158
162
  }
159
- if (props === null || props === void 0 ? void 0 : (_props_markdown = props.markdown) === null || _props_markdown === void 0 ? void 0 : _props_markdown.matchInputToNode) {
160
- if (match.run(e)) return;
163
+ // 仅当显式开启 matchInputToNode 时才执行输入转节点(如 "- " 转列表),默认关闭
164
+ // IME 输入法组合期间不触发,避免输入「-」后按空格选字时误转为列表
165
+ if ((props === null || props === void 0 ? void 0 : (_props_markdown = props.markdown) === null || _props_markdown === void 0 ? void 0 : _props_markdown.matchInputToNode) === true && !((_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.isComposing)) {
166
+ if (matchKeyRef.current.run(e)) return;
161
167
  }
162
168
  if (e.key.toLowerCase().startsWith('arrow')) {
163
169
  if ([
@@ -273,6 +279,7 @@ import { useEditorStore } from "../store";
273
279
  }, [
274
280
  markdownEditorRef.current,
275
281
  props === null || props === void 0 ? void 0 : props.readonly,
282
+ props === null || props === void 0 ? void 0 : (_props_markdown = props.markdown) === null || _props_markdown === void 0 ? void 0 : _props_markdown.matchInputToNode,
276
283
  openInsertCompletion,
277
284
  insertCompletionText$,
278
285
  setOpenInsertCompletion,
@@ -151,10 +151,12 @@ import { Editor, Element, Node, Transforms } from "slate";
151
151
  var child1 = node.children[i];
152
152
  if (Element.isElement(child1)) {
153
153
  if (!isListType(child1)) {
154
- // 如果不是列表类型,且不是第一个块级元素,需要处理
155
- // 如果它是块级元素,应该移到前面或转换为列表
156
154
  if (Editor.isBlock(editor, child1)) {
157
- // 将块级元素包裹为新的 list-item,并创建新的列表
155
+ // paragraph 不处理,直接返回,避免 "-" 等被误转为嵌套列表
156
+ if (child1.type === 'paragraph') return;
157
+ var childPath1 = _to_consumable_array(path).concat([
158
+ i
159
+ ]);
158
160
  var listType = getListType();
159
161
  Transforms.wrapNodes(editor, {
160
162
  type: 'list-item',
@@ -163,17 +165,13 @@ import { Editor, Element, Node, Transforms } from "slate";
163
165
  id: '',
164
166
  children: []
165
167
  }, {
166
- at: _to_consumable_array(path).concat([
167
- i
168
- ])
168
+ at: childPath1
169
169
  });
170
170
  Transforms.wrapNodes(editor, {
171
171
  type: listType,
172
172
  children: []
173
173
  }, {
174
- at: _to_consumable_array(path).concat([
175
- i
176
- ])
174
+ at: childPath1
177
175
  });
178
176
  return;
179
177
  }
@@ -969,7 +969,7 @@ export var InsertAutocomplete = function InsertAutocomplete(props) {
969
969
  openInsertCompletion
970
970
  ]);
971
971
  var context = useContext(ConfigProvider.ConfigContext);
972
- var baseClassName = context === null || context === void 0 ? void 0 : context.getPrefixCls("md-editor-insert-autocomplete");
972
+ var baseClassName = context === null || context === void 0 ? void 0 : context.getPrefixCls("agentic-md-editor-insert-autocomplete");
973
973
  var _useStyle = useStyle(baseClassName), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
974
974
  return /*#__PURE__*/ ReactDOM.createPortal(wrapSSR(/*#__PURE__*/ React.createElement("div", {
975
975
  ref: dom,
@@ -109,7 +109,7 @@ export var JinjaTemplatePanel = function JinjaTemplatePanel() {
109
109
  }), 2), position = _useState3[0], setPosition = _useState3[1];
110
110
  var domRef = useRef(null);
111
111
  var context = React.useContext(ConfigProvider.ConfigContext);
112
- var prefixCls = (_ref3 = context === null || context === void 0 ? void 0 : (_context_getPrefixCls = context.getPrefixCls) === null || _context_getPrefixCls === void 0 ? void 0 : _context_getPrefixCls.call(context, 'md-editor-jinja-panel')) !== null && _ref3 !== void 0 ? _ref3 : JINJA_PANEL_PREFIX_CLS;
112
+ var prefixCls = (_ref3 = context === null || context === void 0 ? void 0 : (_context_getPrefixCls = context.getPrefixCls) === null || _context_getPrefixCls === void 0 ? void 0 : _context_getPrefixCls.call(context, 'agentic-md-editor-jinja-panel')) !== null && _ref3 !== void 0 ? _ref3 : JINJA_PANEL_PREFIX_CLS;
113
113
  var _useJinjaTemplatePanelStyle = useJinjaTemplatePanelStyle(prefixCls), wrapSSR = _useJinjaTemplatePanelStyle.wrapSSR, hashId = _useJinjaTemplatePanelStyle.hashId;
114
114
  var close = useCallback(function() {
115
115
  setOpenJinjaTemplate === null || setOpenJinjaTemplate === void 0 ? void 0 : setOpenJinjaTemplate(false);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const JINJA_PANEL_PREFIX_CLS = "md-editor-jinja-panel";
2
+ export declare const JINJA_PANEL_PREFIX_CLS = "agentic-md-editor-jinja-panel";
3
3
  export declare function useJinjaTemplatePanelStyle(prefixCls?: string): {
4
4
  hashId: string;
5
5
  wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").JSX.Element;
@@ -51,7 +51,7 @@ function _object_spread_props(target, source) {
51
51
  return target;
52
52
  }
53
53
  import { resetComponent, useEditorStyleRegister } from "../../../../Hooks/useStyle";
54
- export var JINJA_PANEL_PREFIX_CLS = 'md-editor-jinja-panel';
54
+ export var JINJA_PANEL_PREFIX_CLS = 'agentic-md-editor-jinja-panel';
55
55
  var genJinjaPanelStyle = function genJinjaPanelStyle(token) {
56
56
  return _define_property({}, token.componentCls, {
57
57
  boxSizing: 'border-box',
@@ -155,7 +155,7 @@ var fileMap = new Map();
155
155
  };
156
156
  }, []);
157
157
  var context = useContext(ConfigProvider.ConfigContext);
158
- var baseClassName = context === null || context === void 0 ? void 0 : context.getPrefixCls("md-editor-float-bar");
158
+ var baseClassName = context === null || context === void 0 ? void 0 : context.getPrefixCls("agentic-md-editor-float-bar");
159
159
  var _useStyle = useStyle(baseClassName), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
160
160
  if (!markdownContainerRef.current) return null;
161
161
  return /*#__PURE__*/ ReactDOM.createPortal(wrapSSR(/*#__PURE__*/ React.createElement("div", {
@@ -182,73 +182,67 @@ var genStyle = function genStyle(token) {
182
182
  }))))), _define_property(_obj, '&[data-task]', {
183
183
  listStyle: 'none !important',
184
184
  paddingLeft: '0'
185
- }), _obj)), // --- LinkCard ---
185
+ }), _obj)), // --- LinkCard (BEM: block__element) ---
186
186
  _define_property(_obj2, "".concat(token.componentCls, "-link-card"), {
187
187
  cursor: 'pointer',
188
188
  position: 'relative',
189
189
  display: 'flex',
190
+ alignItems: 'center'
191
+ }), _define_property(_obj2, "".concat(token.componentCls, "-link-card__container"), {
192
+ padding: 12,
193
+ border: '1px solid #f0f0f0',
194
+ borderRadius: '0.5em',
195
+ margin: '8px 0',
196
+ width: '100%',
197
+ maxHeight: '120px',
198
+ minHeight: 72,
199
+ backgroundImage: 'linear-gradient(rgb(249, 251, 255) 0%, rgb(243, 248, 255) 100%)',
200
+ flex: 1,
201
+ display: 'flex',
190
202
  alignItems: 'center',
191
- '&-container': {
192
- padding: 12,
193
- border: '1px solid #f0f0f0',
194
- borderRadius: '0.5em',
195
- margin: '8px 0',
196
- width: '100%',
197
- maxHeight: '120px',
198
- minHeight: 72,
199
- backgroundImage: 'linear-gradient(rgb(249, 251, 255) 0%, rgb(243, 248, 255) 100%)',
200
- flex: 1,
201
- display: 'flex',
202
- alignItems: 'center',
203
- gap: 12,
204
- color: '#262626',
205
- justifyContent: 'space-between',
206
- '&-content': {
207
- display: 'flex',
208
- alignItems: 'center',
209
- gap: 12,
210
- color: '#262626',
211
- fontSize: 16,
212
- flex: 1,
213
- minWidth: 0,
214
- '& &-title': {
215
- overflow: 'ellipsis',
216
- textOverflow: 'ellipsis',
217
- textWrap: 'nowrap',
218
- textDecoration: 'none',
219
- display: 'block',
220
- color: '#262626'
221
- },
222
- '& &-description': {
223
- flex: 1,
224
- minWidth: 0,
225
- marginTop: 4,
226
- lineHeight: '24px',
227
- display: 'flex',
228
- fontSize: 12,
229
- color: 'rgba(0,0,0,0.45)',
230
- justifyContent: 'space-between'
231
- },
232
- '& &-collaborators': {
233
- flex: 1,
234
- minWidth: 0,
235
- display: 'flex',
236
- justifyContent: 'space-between'
237
- },
238
- '& &-updateTime': {
239
- color: 'rgba(0,0,0,0.45)',
240
- fontSize: 12
241
- }
242
- },
243
- '& [data-icon-box]': {
244
- padding: '0 18px',
245
- color: '#6b7280',
246
- cursor: 'pointer',
247
- '&:hover': {
248
- color: '#1667ff'
249
- }
203
+ gap: 12,
204
+ color: '#262626',
205
+ justifyContent: 'space-between',
206
+ '& [data-icon-box]': {
207
+ padding: '0 18px',
208
+ color: '#6b7280',
209
+ cursor: 'pointer',
210
+ '&:hover': {
211
+ color: '#1667ff'
250
212
  }
251
213
  }
214
+ }), _define_property(_obj2, "".concat(token.componentCls, "-link-card__content"), {
215
+ display: 'flex',
216
+ alignItems: 'center',
217
+ gap: 12,
218
+ color: '#262626',
219
+ fontSize: 16,
220
+ flex: 1,
221
+ minWidth: 0
222
+ }), _define_property(_obj2, "".concat(token.componentCls, "-link-card__title"), {
223
+ overflow: 'ellipsis',
224
+ textOverflow: 'ellipsis',
225
+ textWrap: 'nowrap',
226
+ textDecoration: 'none',
227
+ display: 'block',
228
+ color: '#262626'
229
+ }), _define_property(_obj2, "".concat(token.componentCls, "-link-card__description"), {
230
+ flex: 1,
231
+ minWidth: 0,
232
+ marginTop: 4,
233
+ lineHeight: '24px',
234
+ display: 'flex',
235
+ fontSize: 12,
236
+ color: 'rgba(0,0,0,0.45)',
237
+ justifyContent: 'space-between'
238
+ }), _define_property(_obj2, "".concat(token.componentCls, "-link-card__collaborators"), {
239
+ flex: 1,
240
+ minWidth: 0,
241
+ display: 'flex',
242
+ justifyContent: 'space-between'
243
+ }), _define_property(_obj2, "".concat(token.componentCls, "-link-card__update-time"), {
244
+ color: 'rgba(0,0,0,0.45)',
245
+ fontSize: 12
252
246
  }), // --- TagPopup ---
253
247
  _define_property(_obj2, "".concat(token.componentCls, "-tag-popup"), {
254
248
  position: 'relative',
@@ -645,6 +645,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
645
645
  * - 提供图表属性工具栏
646
646
  * - 使用 React.lazy 和 Suspense 实现代码分割
647
647
  */ export var ChartRender = function ChartRender(props) {
648
+ var _getPrefixCls;
648
649
  var // 对于 rest 对象,使用浅比较
649
650
  _config_rest, _config_rest1, _config_rest2, _config_rest3, _config_rest4, _config_rest5;
650
651
  var _useState = _sliced_to_array(useState(function() {
@@ -652,6 +653,8 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
652
653
  }), 2), chartType = _useState[0], setChartType = _useState[1];
653
654
  var chartData = props.chartData, isChartList = props.isChartList, onColumnLengthChange = props.onColumnLengthChange, columnLength = props.columnLength, title = props.title, dataTime = props.dataTime, groupBy = props.groupBy, filterBy = props.filterBy, colorLegend = props.colorLegend, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading;
654
655
  var i18n = useContext(I18nContext);
656
+ var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
657
+ var prefixCls = getPrefixCls('agentic-plugin-chart');
655
658
  var _useState1 = _sliced_to_array(useState(function() {
656
659
  return props.config;
657
660
  }), 2), config = _useState1[0], setConfig = _useState1[1];
@@ -855,6 +858,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
855
858
  colorLegend,
856
859
  filterBy
857
860
  ]);
861
+ var chartConfigFormPrefixCls = (_getPrefixCls = getPrefixCls('agentic-chart-config-form')) !== null && _getPrefixCls !== void 0 ? _getPrefixCls : 'ant-agentic-chart-config-form';
858
862
  /**
859
863
  * 图表配置
860
864
  */ var toolBar = useMemo(function() {
@@ -939,6 +943,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
939
943
  content: /*#__PURE__*/ React.createElement(ConfigProvider, {
940
944
  componentSize: "small"
941
945
  }, /*#__PURE__*/ React.createElement(ProForm, {
946
+ prefixCls: chartConfigFormPrefixCls,
942
947
  submitter: {
943
948
  searchConfig: {
944
949
  submitText: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale2 = i18n.locale) === null || _i18n_locale2 === void 0 ? void 0 : _i18n_locale2.updateChart) || '更新'
@@ -955,11 +960,13 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
955
960
  });
956
961
  }
957
962
  }, /*#__PURE__*/ React.createElement("div", {
963
+ className: "".concat(chartConfigFormPrefixCls, "__content"),
958
964
  style: {
959
965
  maxHeight: '70vh',
960
966
  overflow: 'auto'
961
967
  }
962
968
  }, /*#__PURE__*/ React.createElement("div", {
969
+ className: "".concat(chartConfigFormPrefixCls, "__fields"),
963
970
  style: {
964
971
  display: 'flex',
965
972
  gap: 8
@@ -1015,7 +1022,8 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
1015
1022
  columnLength,
1016
1023
  onColumnLengthChange,
1017
1024
  config,
1018
- props.config
1025
+ props.config,
1026
+ chartConfigFormPrefixCls
1019
1027
  ]);
1020
1028
  var chartDom = useMemo(function() {
1021
1029
  var _window;
@@ -1026,6 +1034,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
1026
1034
  if (chartType === 'table') {
1027
1035
  return /*#__PURE__*/ React.createElement("div", {
1028
1036
  key: config === null || config === void 0 ? void 0 : config.index,
1037
+ className: "".concat(prefixCls, "__table"),
1029
1038
  contentEditable: false,
1030
1039
  style: {
1031
1040
  margin: 12,
@@ -1050,6 +1059,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
1050
1059
  if (chartType === 'descriptions' || renderDescriptionsFallback) {
1051
1060
  return /*#__PURE__*/ React.createElement("div", {
1052
1061
  key: config === null || config === void 0 ? void 0 : config.index,
1062
+ className: "".concat(prefixCls, "__descriptions"),
1053
1063
  style: {
1054
1064
  display: 'flex',
1055
1065
  flexDirection: 'column',
@@ -1130,6 +1140,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
1130
1140
  ]);
1131
1141
  return /*#__PURE__*/ React.createElement("div", {
1132
1142
  ref: containerRef,
1143
+ className: prefixCls,
1133
1144
  style: {
1134
1145
  width: '100%'
1135
1146
  },
@@ -556,7 +556,6 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
556
556
  };
557
557
  }, [
558
558
  aceLoaded,
559
- element.value,
560
559
  element.language,
561
560
  readonly,
562
561
  editorProps.codeProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.29.29",
3
+ "version": "2.29.31",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",