@ant-design/agentic-ui 2.0.21 → 2.0.23

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.
Files changed (47) hide show
  1. package/dist/Bubble/FileView.js +27 -31
  2. package/dist/Bubble/MessagesContent/VoiceButton/style.js +6 -3
  3. package/dist/ChatBootPage/ButtonTabStyle.js +2 -0
  4. package/dist/ChatBootPage/CaseReply.d.ts +0 -3
  5. package/dist/ChatBootPage/CaseReplyStyle.js +3 -4
  6. package/dist/Components/ActionIconBox/style.js +3 -1
  7. package/dist/Components/GradientText/index.d.ts +2 -1
  8. package/dist/Components/GradientText/index.js +3 -2
  9. package/dist/Components/GradientText/style.js +3 -8
  10. package/dist/Components/TextAnimate/index.d.ts +1 -0
  11. package/dist/Components/TextAnimate/index.js +27 -16
  12. package/dist/Components/TypingAnimation/index.d.ts +1 -1
  13. package/dist/Components/TypingAnimation/index.js +9 -9
  14. package/dist/Components/lotties/LoadingLottie/loading.json +1989 -1
  15. package/dist/Components/lotties/{ShinyText → TextLoading}/index.d.ts +9 -9
  16. package/dist/Components/lotties/{ShinyText → TextLoading}/index.js +7 -7
  17. package/dist/Components/lotties/{ShinyText → TextLoading}/style.js +4 -4
  18. package/dist/Components/lotties/index.d.ts +1 -1
  19. package/dist/Components/lotties/index.js +1 -1
  20. package/dist/History/components/HistoryItem.js +14 -6
  21. package/dist/History/types/HistoryData.d.ts +2 -0
  22. package/dist/MarkdownEditor/editor/components/ContributorAvatar/index.js +1 -1
  23. package/dist/MarkdownEditor/editor/components/LazyElement/index.js +36 -4
  24. package/dist/MarkdownEditor/editor/elements/Table/TableRowIndex/index.js +3 -1
  25. package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +6 -3
  26. package/dist/MarkdownEditor/editor/elements/TagPopup/style.js +5 -1
  27. package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.d.ts +4 -0
  28. package/dist/MarkdownEditor/editor/parser/parserMarkdownToSlateNode.js +245 -344
  29. package/dist/MarkdownEditor/editor/parser/parserSlateNodeToMarkdown.js +74 -56
  30. package/dist/MarkdownEditor/editor/store.d.ts +36 -0
  31. package/dist/MarkdownEditor/editor/store.js +208 -76
  32. package/dist/MarkdownInputField/AttachmentButton/style.js +1 -1
  33. package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +2 -1
  34. package/dist/MarkdownInputField/MarkdownInputField.js +1 -1
  35. package/dist/MarkdownInputField/VoiceInput/style.js +1 -1
  36. package/dist/MarkdownInputField/style.js +2 -8
  37. package/dist/Plugins/chart/DonutChart/style.js +1 -0
  38. package/dist/Plugins/chart/LineChart/index.js +66 -55
  39. package/dist/Plugins/chart/LineChart/style.js +8 -0
  40. package/dist/Schema/SchemaRenderer/index.js +81 -56
  41. package/dist/Utils/proxySandbox/ProxySandbox.d.ts +32 -0
  42. package/dist/Utils/proxySandbox/ProxySandbox.js +176 -128
  43. package/dist/WelcomeMessage/index.d.ts +2 -2
  44. package/dist/WelcomeMessage/index.js +8 -5
  45. package/dist/WelcomeMessage/style.js +0 -1
  46. package/package.json +1 -1
  47. /package/dist/Components/lotties/{ShinyText → TextLoading}/style.d.ts +0 -0
@@ -4,9 +4,9 @@ import { FileMapView } from "../MarkdownInputField/FileMapView";
4
4
  var DEFAULT_DOWNLOAD_FILENAME = "download";
5
5
  var openFileInNewWindow = (file) => {
6
6
  const url = (file == null ? void 0 : file.previewUrl) || (file == null ? void 0 : file.url);
7
- if (url && typeof window !== "undefined") {
8
- window.open(url, "_blank");
9
- }
7
+ if (!url || typeof window === "undefined")
8
+ return;
9
+ window.open(url, "_blank");
10
10
  };
11
11
  var downloadFile = (file) => {
12
12
  const url = (file == null ? void 0 : file.url) || (file == null ? void 0 : file.previewUrl);
@@ -28,49 +28,45 @@ var defaultHandlers = {
28
28
  var renderMoreAction = (cfg, file) => {
29
29
  if (!cfg)
30
30
  return void 0;
31
- if (React.isValidElement(cfg) || typeof cfg !== "function") {
31
+ if (React.isValidElement(cfg))
32
+ return cfg;
33
+ if (typeof cfg !== "function")
32
34
  return cfg;
33
- }
34
35
  try {
35
- if (cfg.length === 0) {
36
- const result = cfg();
37
- return typeof result === "function" ? result(file) : result;
38
- }
39
- return cfg(file);
36
+ const result = cfg.length === 0 ? cfg() : cfg(file);
37
+ return typeof result === "function" ? result(file) : result;
40
38
  } catch (e) {
41
39
  return void 0;
42
40
  }
43
41
  };
44
- var createEventHandler = (handler) => {
45
- return handler ? (...args) => handler(...args) : void 0;
42
+ var createViewAllHandler = (handler) => {
43
+ if (!handler)
44
+ return void 0;
45
+ return (files) => {
46
+ handler(files);
47
+ return false;
48
+ };
46
49
  };
47
50
  var BubbleFileView = ({
48
51
  bubble,
49
52
  placement
50
53
  }) => {
51
- const { originData, fileViewEvents, fileViewConfig } = bubble;
52
- if (!(originData == null ? void 0 : originData.fileMap) || originData.fileMap.size === 0) {
54
+ const { originData, fileViewEvents, fileViewConfig = {} } = bubble;
55
+ if (!(originData == null ? void 0 : originData.fileMap) || originData.fileMap.size === 0)
53
56
  return null;
54
- }
55
- const allFiles = Array.from(originData.fileMap.values());
56
- const eventOverrides = (fileViewEvents == null ? void 0 : fileViewEvents(defaultHandlers)) || {};
57
- const config = fileViewConfig || {};
57
+ const events = (fileViewEvents == null ? void 0 : fileViewEvents(defaultHandlers)) || {};
58
58
  return /* @__PURE__ */ React.createElement(
59
59
  FileMapView,
60
60
  {
61
- className: config.className,
62
- style: config.style,
63
- maxDisplayCount: config.maxDisplayCount,
64
- showMoreButton: config.showMoreButton,
65
- onPreview: createEventHandler(eventOverrides.onPreview),
66
- onDownload: createEventHandler(eventOverrides.onDownload),
67
- onViewAll: eventOverrides.onViewAll ? (files) => {
68
- var _a;
69
- (_a = eventOverrides.onViewAll) == null ? void 0 : _a.call(eventOverrides, files);
70
- return false;
71
- } : void 0,
72
- renderMoreAction: config.renderFileMoreAction ? (file) => renderMoreAction(config.renderFileMoreAction, file) : void 0,
73
- customSlot: config.customSlot,
61
+ className: fileViewConfig.className,
62
+ style: fileViewConfig.style,
63
+ maxDisplayCount: fileViewConfig.maxDisplayCount,
64
+ showMoreButton: fileViewConfig.showMoreButton,
65
+ onPreview: events.onPreview,
66
+ onDownload: events.onDownload,
67
+ onViewAll: createViewAllHandler(events.onViewAll),
68
+ renderMoreAction: fileViewConfig.renderFileMoreAction ? (file) => renderMoreAction(fileViewConfig.renderFileMoreAction, file) : void 0,
69
+ customSlot: fileViewConfig.customSlot,
74
70
  placement,
75
71
  fileMap: originData.fileMap,
76
72
  "data-testid": "file-item"
@@ -43,7 +43,10 @@ var genStyle = (token) => {
43
43
  boxSizing: "border-box"
44
44
  },
45
45
  "&-playBox:hover": {
46
- background: "rgba(0, 28, 57, 0.0353)"
46
+ background: "var(--color-gray-control-fill-hover)",
47
+ borderRadius: "var(--radius-control-base)",
48
+ backdropFilter: "blur(20px)",
49
+ boxSizing: "border-box"
47
50
  },
48
51
  "&-playingWrap": {
49
52
  display: "flex",
@@ -68,7 +71,7 @@ var genStyle = (token) => {
68
71
  cursor: "pointer"
69
72
  },
70
73
  "&-playingBox:hover": {
71
- background: "rgba(0, 28, 57, 0.0353)"
74
+ background: "var(--color-gray-control-fill-hover)"
72
75
  },
73
76
  "&-rateBox": {
74
77
  display: "flex",
@@ -83,7 +86,7 @@ var genStyle = (token) => {
83
86
  borderRadius: 6
84
87
  },
85
88
  "&-rateBox:hover": {
86
- background: "rgba(0, 28, 57, 0.0353)"
89
+ background: "var(--color-gray-control-fill-hover)"
87
90
  },
88
91
  "&-rateItem": {
89
92
  display: "flex",
@@ -43,6 +43,8 @@ var genStyle = (token) => {
43
43
  color: "var(--color-gray-text-secondary)",
44
44
  outline: "none",
45
45
  userSelect: "none",
46
+ whiteSpace: "nowrap",
47
+ flexShrink: 0,
46
48
  "&:hover": {
47
49
  // borderColor: 'rgba(0, 0, 0, 0.3)',
48
50
  // color: 'rgba(0, 0, 0, 0.85)',
@@ -24,9 +24,6 @@ export interface CaseReplyProps {
24
24
  * 按钮文本(悬停时显示的按钮文字)
25
25
  */
26
26
  buttonText?: string;
27
- /**
28
- * 自定义按钮栏内容(优先于 buttonText)
29
- */
30
27
  buttonBar?: React.ReactNode;
31
28
  /**
32
29
  * 按钮点击事件
@@ -48,14 +48,13 @@ var genStyle = (token) => {
48
48
  width: "100%",
49
49
  height: 166,
50
50
  display: "flex",
51
- alignItems: "center",
52
51
  justifyContent: "center"
53
52
  },
54
53
  // coverContent 白色子卡片
55
54
  "&-cover-content": {
56
55
  width: "80%",
57
56
  marginTop: "32px",
58
- height: 124,
57
+ height: 144,
59
58
  borderRadius: "var(--radius-modal-base)",
60
59
  boxShadow: "0px 0px 1px 0px rgba(71, 98, 234, 0.05), 0px 6px 16px 0px rgba(71, 98, 234, 0.12)",
61
60
  background: "#ffffff",
@@ -100,7 +99,7 @@ var genStyle = (token) => {
100
99
  "&-title": {
101
100
  fontSize: "16px",
102
101
  fontWeight: 600,
103
- lineHeight: "24px",
102
+ lineHeight: "26px",
104
103
  color: "var(--color-gray-text-default)",
105
104
  marginTop: 0,
106
105
  marginBottom: "4px"
@@ -109,7 +108,7 @@ var genStyle = (token) => {
109
108
  "&-description": {
110
109
  fontSize: "13px",
111
110
  fontWeight: 400,
112
- lineHeight: "20px",
111
+ lineHeight: "22px",
113
112
  color: "var(--color-gray-text-secondary)",
114
113
  overflow: "hidden",
115
114
  textOverflow: "ellipsis",
@@ -46,7 +46,9 @@ var genStyle = (token) => {
46
46
  },
47
47
  "&-light": {
48
48
  "&:hover": {
49
- background: "var(--color-gray-control-fill-active)",
49
+ borderRadius: "var(--radius-control-base)",
50
+ background: "var(--color-gray-control-fill-hover)",
51
+ backdropFilter: "blur(20px)",
50
52
  boxSizing: "border-box"
51
53
  }
52
54
  },
@@ -4,5 +4,6 @@ export interface GradientTextProps {
4
4
  className?: string;
5
5
  colors?: string[];
6
6
  animationSpeed?: number;
7
+ style?: React.CSSProperties;
7
8
  }
8
- export declare function GradientText({ children, className, colors, animationSpeed, }: GradientTextProps): React.JSX.Element;
9
+ export declare function GradientText({ children, className, colors, animationSpeed, style, }: GradientTextProps): React.JSX.Element;
@@ -7,7 +7,8 @@ function GradientText({
7
7
  children,
8
8
  className = "",
9
9
  colors = ["#40ffaa", "#4079ff", "#40ffaa", "#4079ff", "#40ffaa"],
10
- animationSpeed = 8
10
+ animationSpeed = 8,
11
+ style
11
12
  }) {
12
13
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
13
14
  const prefixCls = getPrefixCls("gradient-text");
@@ -17,7 +18,7 @@ function GradientText({
17
18
  animationDuration: `${animationSpeed}s`
18
19
  };
19
20
  return wrapSSR(
20
- /* @__PURE__ */ React.createElement("div", { className: classNames(prefixCls, hashId, className) }, /* @__PURE__ */ React.createElement(
21
+ /* @__PURE__ */ React.createElement("div", { className: classNames(prefixCls, hashId, className), style }, /* @__PURE__ */ React.createElement(
21
22
  "div",
22
23
  {
23
24
  className: classNames(`${prefixCls}-text-content`, hashId),
@@ -25,13 +25,10 @@ import {
25
25
  } from "../../Hooks/useStyle";
26
26
  var animateGradientText = new Keyframes("animateGradientText", {
27
27
  "0%": {
28
- backgroundPosition: "0% 50%"
29
- },
30
- "50%": {
31
- backgroundPosition: "100% 50%"
28
+ backgroundPosition: "100%"
32
29
  },
33
30
  "100%": {
34
- backgroundPosition: "0% 50%"
31
+ backgroundPosition: "-100%"
35
32
  }
36
33
  });
37
34
  var genStyle = (token) => {
@@ -45,14 +42,12 @@ var genStyle = (token) => {
45
42
  alignItems: "center",
46
43
  justifyContent: "center",
47
44
  fontWeight: 500,
48
- backdropFilter: "blur(10px)",
49
- transition: "box-shadow 0.5s ease-out",
50
45
  overflow: "hidden",
51
46
  ["&-text-content"]: {
52
47
  display: "inline-block",
53
48
  position: "relative",
54
49
  zIndex: 2,
55
- backgroundSize: "300% 100%",
50
+ backgroundSize: "200% 100%",
56
51
  backgroundClip: "text",
57
52
  WebkitBackgroundClip: "text",
58
53
  color: "transparent",
@@ -52,5 +52,6 @@ export interface TextAnimateProps extends MotionProps {
52
52
  */
53
53
  accessible?: boolean;
54
54
  }
55
+ export declare const resolveSegments: (children: React.ReactNode, by: AnimationType) => React.ReactNode[];
55
56
  export declare const TextAnimate: React.MemoExoticComponent<({ children, delay, duration, variants, className, segmentClassName, as: Component, startOnView, once, by, animation, accessible, ...props }: TextAnimateProps) => React.JSX.Element>;
56
57
  export {};
@@ -34,7 +34,7 @@ var __objRest = (source, exclude) => {
34
34
  import { ConfigProvider } from "antd";
35
35
  import classNames from "classnames";
36
36
  import { AnimatePresence, motion } from "framer-motion";
37
- import { isString } from "lodash";
37
+ import { isNumber, isObject, isString } from "lodash";
38
38
  import toArray from "rc-util/lib/Children/toArray";
39
39
  import React, { memo, useContext } from "react";
40
40
  import { useTextAnimateStyle } from "./style";
@@ -266,19 +266,29 @@ var defaultItemAnimationVariants = {
266
266
  }
267
267
  };
268
268
  var resolveSegments = (children, by) => {
269
- if (!isString(children))
270
- return toArray(children);
271
- switch (by) {
272
- case "word":
273
- return children.split(/(\s+)/);
274
- case "character":
275
- return children.split("");
276
- case "line":
277
- return children.split("\n");
278
- case "text":
279
- default:
280
- return [children];
281
- }
269
+ const result = [];
270
+ toArray(children).forEach((item) => {
271
+ if (isString(item) || isNumber(item)) {
272
+ const itemString = item.toString();
273
+ switch (by) {
274
+ case "word":
275
+ result.push(...itemString.split(/(\s+)/));
276
+ break;
277
+ case "character":
278
+ result.push(...itemString.split(""));
279
+ break;
280
+ case "line":
281
+ result.push(...itemString.split("\n"));
282
+ break;
283
+ case "text":
284
+ default:
285
+ result.push(itemString);
286
+ }
287
+ } else {
288
+ result.push(item);
289
+ }
290
+ });
291
+ return result;
282
292
  };
283
293
  var TextAnimateBase = (_a) => {
284
294
  var _b = _a, {
@@ -367,7 +377,7 @@ var TextAnimateBase = (_a) => {
367
377
  segments.map((segment, i) => /* @__PURE__ */ React.createElement(
368
378
  motion.span,
369
379
  {
370
- key: `${by}-${isString(segment) ? segment : segment == null ? void 0 : segment.key}-${i}`,
380
+ key: `${by}-${isObject(segment) ? segment.key : segment}-${i}`,
371
381
  variants: finalVariants.item,
372
382
  custom: i * staggerTimings[by],
373
383
  className: classNames(
@@ -384,5 +394,6 @@ var TextAnimateBase = (_a) => {
384
394
  };
385
395
  var TextAnimate = memo(TextAnimateBase);
386
396
  export {
387
- TextAnimate
397
+ TextAnimate,
398
+ resolveSegments
388
399
  };
@@ -1,7 +1,7 @@
1
1
  import { MotionProps } from 'framer-motion';
2
2
  import React from 'react';
3
3
  export interface TypingAnimationProps extends MotionProps {
4
- children?: string;
4
+ children?: React.ReactNode;
5
5
  words?: string[];
6
6
  className?: string;
7
7
  duration?: number;
@@ -31,7 +31,9 @@ var __objRest = (source, exclude) => {
31
31
  import { ConfigProvider } from "antd";
32
32
  import classNames from "classnames";
33
33
  import { motion, useInView } from "framer-motion";
34
+ import { isString } from "lodash";
34
35
  import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
36
+ import { resolveSegments } from "../TextAnimate";
35
37
  import { useTypingAnimationStyle } from "./style";
36
38
  function TypingAnimation(_a) {
37
39
  var _b = _a, {
@@ -71,7 +73,7 @@ function TypingAnimation(_a) {
71
73
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
72
74
  const prefixCls = getPrefixCls("typing-animation");
73
75
  const { wrapSSR, hashId } = useTypingAnimationStyle(prefixCls);
74
- const [displayedText, setDisplayedText] = useState("");
76
+ const [displayedText, setDisplayedText] = useState([]);
75
77
  const [currentWordIndex, setCurrentWordIndex] = useState(0);
76
78
  const [currentCharIndex, setCurrentCharIndex] = useState(0);
77
79
  const [phase, setPhase] = useState("typing");
@@ -81,7 +83,7 @@ function TypingAnimation(_a) {
81
83
  once: true
82
84
  });
83
85
  const wordsToAnimate = useMemo(
84
- () => words || (children ? [children] : []),
86
+ () => words || [resolveSegments(children, "character")],
85
87
  [words, children]
86
88
  );
87
89
  const hasMultipleWords = wordsToAnimate.length > 1;
@@ -91,14 +93,14 @@ function TypingAnimation(_a) {
91
93
  useEffect(() => {
92
94
  if (!shouldStart || wordsToAnimate.length === 0)
93
95
  return;
94
- const timeoutDelay = delay > 0 && displayedText === "" ? delay : phase === "typing" ? typingSpeed : phase === "deleting" ? deletingSpeed : pauseDelay;
96
+ const timeoutDelay = delay > 0 && displayedText.length === 0 ? delay : phase === "typing" ? typingSpeed : phase === "deleting" ? deletingSpeed : pauseDelay;
95
97
  const timeout = setTimeout(() => {
96
98
  const currentWord = wordsToAnimate[currentWordIndex] || "";
97
- const graphemes = Array.from(currentWord);
99
+ const graphemes = isString(currentWord) ? Array.from(currentWord) : currentWord;
98
100
  switch (phase) {
99
101
  case "typing":
100
102
  if (currentCharIndex < graphemes.length) {
101
- setDisplayedText(graphemes.slice(0, currentCharIndex + 1).join(""));
103
+ setDisplayedText(graphemes.slice(0, currentCharIndex + 1));
102
104
  setCurrentCharIndex(currentCharIndex + 1);
103
105
  } else {
104
106
  if (hasMultipleWords || loop) {
@@ -114,7 +116,7 @@ function TypingAnimation(_a) {
114
116
  break;
115
117
  case "deleting":
116
118
  if (currentCharIndex > 0) {
117
- setDisplayedText(graphemes.slice(0, currentCharIndex - 1).join(""));
119
+ setDisplayedText(graphemes.slice(0, currentCharIndex - 1));
118
120
  setCurrentCharIndex(currentCharIndex - 1);
119
121
  } else {
120
122
  const nextIndex = (currentWordIndex + 1) % wordsToAnimate.length;
@@ -139,9 +141,7 @@ function TypingAnimation(_a) {
139
141
  pauseDelay,
140
142
  delay
141
143
  ]);
142
- const currentWordGraphemes = Array.from(
143
- wordsToAnimate[currentWordIndex] || ""
144
- );
144
+ const currentWordGraphemes = isString(wordsToAnimate[currentWordIndex]) ? Array.from(wordsToAnimate[currentWordIndex]) : [wordsToAnimate[currentWordIndex]];
145
145
  const isComplete = !loop && currentWordIndex === wordsToAnimate.length - 1 && currentCharIndex >= currentWordGraphemes.length && phase !== "deleting";
146
146
  const shouldShowCursor = showCursor && !isComplete && (hasMultipleWords || loop || currentCharIndex < currentWordGraphemes.length);
147
147
  const getCursorChar = () => {