@ant-design/agentic-ui 2.27.0 → 2.27.1

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.
@@ -276,6 +276,7 @@ import { getMediaType } from "../../utils/dom";
276
276
  var _editorProps_image;
277
277
  var editorProps = useEditorStore().editorProps;
278
278
  var _React_useState = _sliced_to_array(React.useState(false), 2), error = _React_useState[0], setError = _React_useState[1];
279
+ console.log(editorProps);
279
280
  // 图片加载失败时显示为链接
280
281
  if (error) {
281
282
  return /*#__PURE__*/ React.createElement("a", {
@@ -345,6 +346,7 @@ import { getMediaType } from "../../utils/dom";
345
346
  "selected",
346
347
  "defaultSize"
347
348
  ]);
349
+ var editorProps = useEditorStore().editorProps;
348
350
  var _React_useState = _sliced_to_array(React.useState(true), 2), loading = _React_useState[0], setLoading = _React_useState[1];
349
351
  var _React_useState1 = _sliced_to_array(React.useState(false), 2), error = _React_useState1[0], setError = _React_useState1[1];
350
352
  var radio = useRef(1);
@@ -366,9 +368,19 @@ import { getMediaType } from "../../utils/dom";
366
368
  // 如果图片加载失败,显示为链接
367
369
  if (error) {
368
370
  return /*#__PURE__*/ React.createElement("a", {
369
- href: props.src,
370
371
  target: "_blank",
371
372
  rel: "noopener noreferrer",
373
+ onClick: function(e) {
374
+ var _editorProps_linkConfig, _editorProps_linkConfig1;
375
+ e.stopPropagation();
376
+ e.preventDefault();
377
+ if ((_editorProps_linkConfig = editorProps.linkConfig) === null || _editorProps_linkConfig === void 0 ? void 0 : _editorProps_linkConfig.onClick) {
378
+ if (editorProps.linkConfig.onClick(props.src || '') === false) {
379
+ return;
380
+ }
381
+ }
382
+ window.open(props.src, (editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_linkConfig1 = editorProps.linkConfig) === null || _editorProps_linkConfig1 === void 0 ? void 0 : _editorProps_linkConfig1.openInNewTab) ? '_blank' : '_self');
383
+ },
372
384
  style: {
373
385
  color: '#1890ff',
374
386
  textDecoration: 'underline',
@@ -387,6 +387,7 @@ export function Media(param) {
387
387
  var locale = useContext(I18nContext).locale;
388
388
  var htmlRef = React.useRef(null);
389
389
  var _useState = _sliced_to_array(useState(false), 2), showAsText = _useState[0], setShowAsText = _useState[1];
390
+ console.log(editorProps);
390
391
  var _useGetSetState = _sliced_to_array(useGetSetState({
391
392
  height: element.height,
392
393
  dragging: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.27.0",
3
+ "version": "2.27.1",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",