@agentscope-ai/chat 1.1.40 → 1.1.41-beta.1764749089549

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 (230) hide show
  1. package/components/ImageGenerator/index.tsx +1 -1
  2. package/components/Markdown/Markdown.tsx +105 -0
  3. package/components/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.tsx +1 -1
  4. package/components/Markdown/core/components/Null.tsx +1 -0
  5. package/components/Markdown/core/components/Raw.tsx +18 -0
  6. package/components/Markdown/{Markdown → core}/hooks/useCitationsData.tsx +3 -7
  7. package/components/Markdown/core/hooks/useCursorContent.tsx +15 -0
  8. package/components/Markdown/{Markdown/hooks/useTyping.ts → core/hooks/useTyping.tsx} +4 -1
  9. package/components/Markdown/core/index.tsx +18 -0
  10. package/components/Markdown/{plugins → core/plugins}/citations/CitationComponent.tsx +5 -3
  11. package/components/Markdown/{plugins → core/plugins}/citations/index.tsx +3 -4
  12. package/components/Markdown/{plugins → core/plugins}/cursor/Underline.tsx +1 -1
  13. package/components/Markdown/{plugins → core/plugins}/cursor/index.tsx +8 -8
  14. package/components/Markdown/demo/cursor.tsx +2 -3
  15. package/components/Markdown/index.en-US.md +1 -2
  16. package/components/Markdown/index.tsx +6 -0
  17. package/components/Markdown/index.zh-CN.md +1 -2
  18. package/components/Markdown/{Markdown/style.ts → styles.ts} +12 -21
  19. package/components/Markdown/types.tsx +94 -0
  20. package/components/index.ts +1 -3
  21. package/lib/ImageGenerator/index.js +1 -1
  22. package/lib/Markdown/Markdown.d.ts +4 -0
  23. package/lib/Markdown/Markdown.js +110 -0
  24. package/lib/Markdown/core/components/Null.d.ts +2 -0
  25. package/lib/Markdown/core/components/Null.js +3 -0
  26. package/lib/Markdown/core/components/Raw.d.ts +8 -0
  27. package/lib/Markdown/core/components/Raw.js +13 -0
  28. package/lib/Markdown/core/hooks/useCitationsData.d.ts +6 -0
  29. package/lib/Markdown/{Markdown → core}/hooks/useCitationsData.js +1 -1
  30. package/lib/Markdown/core/hooks/useCursorContent.d.ts +4 -0
  31. package/lib/Markdown/core/hooks/useCursorContent.js +14 -0
  32. package/lib/Markdown/core/hooks/useTyping.d.ts +5 -0
  33. package/lib/Markdown/{Markdown → core}/hooks/useTyping.js +3 -2
  34. package/lib/Markdown/core/index.d.ts +2 -0
  35. package/lib/Markdown/{Markdown/hooks/useAnimation.js → core/index.js} +23 -23
  36. package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.js +5 -5
  37. package/lib/Markdown/{plugins → core/plugins}/citations/index.d.ts +1 -2
  38. package/lib/Markdown/{plugins → core/plugins}/citations/index.js +1 -1
  39. package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.js +1 -1
  40. package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.js +1 -1
  41. package/lib/Markdown/{plugins → core/plugins}/cursor/index.js +4 -4
  42. package/lib/Markdown/index.d.ts +2 -1
  43. package/lib/Markdown/styles.js +32 -0
  44. package/lib/Markdown/types.d.ts +78 -0
  45. package/lib/index.d.ts +0 -2
  46. package/lib/index.js +0 -2
  47. package/package.json +7 -31
  48. package/components/AGUI/components/HelpModal/icons.tsx +0 -68
  49. package/components/AGUI/components/HelpModal/index.tsx +0 -1
  50. package/components/AGUI/components/HelpModal/modal.tsx +0 -101
  51. package/components/AGUI/components/chat/Button.tsx +0 -18
  52. package/components/AGUI/components/chat/Chat.tsx +0 -780
  53. package/components/AGUI/components/chat/ChatContext.tsx +0 -248
  54. package/components/AGUI/components/chat/CodeBlock.tsx +0 -406
  55. package/components/AGUI/components/chat/Header.tsx +0 -22
  56. package/components/AGUI/components/chat/Icons.tsx +0 -237
  57. package/components/AGUI/components/chat/ImageUploadQueue.tsx +0 -77
  58. package/components/AGUI/components/chat/Input.tsx +0 -24
  59. package/components/AGUI/components/chat/Markdown.tsx +0 -134
  60. package/components/AGUI/components/chat/Messages.tsx +0 -259
  61. package/components/AGUI/components/chat/Modal.tsx +0 -133
  62. package/components/AGUI/components/chat/Popup.tsx +0 -57
  63. package/components/AGUI/components/chat/PoweredByTag.tsx +0 -29
  64. package/components/AGUI/components/chat/Sidebar.tsx +0 -74
  65. package/components/AGUI/components/chat/Suggestion.tsx +0 -132
  66. package/components/AGUI/components/chat/Suggestions.tsx +0 -20
  67. package/components/AGUI/components/chat/Textarea.tsx +0 -61
  68. package/components/AGUI/components/chat/Window.tsx +0 -152
  69. package/components/AGUI/components/chat/index.tsx +0 -11
  70. package/components/AGUI/components/chat/messages/AssistantMessage.tsx +0 -69
  71. package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +0 -129
  72. package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +0 -116
  73. package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +0 -64
  74. package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +0 -26
  75. package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +0 -51
  76. package/components/AGUI/components/chat/messages/UserMessage.tsx +0 -10
  77. package/components/AGUI/components/chat/props.ts +0 -186
  78. package/components/AGUI/components/index.ts +0 -1
  79. package/components/AGUI/context/index.ts +0 -1
  80. package/components/AGUI/hooks/index.ts +0 -1
  81. package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +0 -122
  82. package/components/AGUI/hooks/use-copy-to-clipboard.tsx +0 -29
  83. package/components/AGUI/hooks/use-dark-mode.ts +0 -10
  84. package/components/AGUI/hooks/use-push-to-talk.tsx +0 -166
  85. package/components/AGUI/index.tsx +0 -4
  86. package/components/AGUI/lib/utils.test.ts +0 -7
  87. package/components/AGUI/lib/utils.ts +0 -27
  88. package/components/AGUI/styles.css +0 -0
  89. package/components/AGUI/types/css.ts +0 -0
  90. package/components/AGUI/types/index.ts +0 -1
  91. package/components/AGUI/types/suggestions.ts +0 -6
  92. package/components/Markdown/Markdown/AnimationNode.tsx +0 -89
  93. package/components/Markdown/Markdown/Markdown.tsx +0 -61
  94. package/components/Markdown/Markdown/core/Parser.ts +0 -52
  95. package/components/Markdown/Markdown/core/Renderer.ts +0 -121
  96. package/components/Markdown/Markdown/core/index.ts +0 -4
  97. package/components/Markdown/Markdown/hooks/index.ts +0 -4
  98. package/components/Markdown/Markdown/hooks/useAnimation.tsx +0 -27
  99. package/components/Markdown/Markdown/hooks/useStreaming.ts +0 -503
  100. package/components/Markdown/Markdown/index.tsx +0 -198
  101. package/components/Markdown/Markdown/interface.ts +0 -217
  102. package/components/Markdown/demo/typing.tsx +0 -82
  103. package/components/Markdown/index.ts +0 -1
  104. package/components/Markdown/plugins/latex/index.ts +0 -109
  105. package/components/Markdown/plugins/type.ts +0 -71
  106. package/lib/AGUI/components/HelpModal/icons.d.ts +0 -5
  107. package/lib/AGUI/components/HelpModal/icons.js +0 -84
  108. package/lib/AGUI/components/HelpModal/index.d.ts +0 -1
  109. package/lib/AGUI/components/HelpModal/index.js +0 -1
  110. package/lib/AGUI/components/HelpModal/modal.d.ts +0 -1
  111. package/lib/AGUI/components/HelpModal/modal.js +0 -104
  112. package/lib/AGUI/components/chat/Button.d.ts +0 -2
  113. package/lib/AGUI/components/chat/Button.js +0 -27
  114. package/lib/AGUI/components/chat/Chat.d.ts +0 -242
  115. package/lib/AGUI/components/chat/Chat.js +0 -634
  116. package/lib/AGUI/components/chat/ChatContext.d.ts +0 -142
  117. package/lib/AGUI/components/chat/ChatContext.js +0 -75
  118. package/lib/AGUI/components/chat/CodeBlock.d.ts +0 -12
  119. package/lib/AGUI/components/chat/CodeBlock.js +0 -398
  120. package/lib/AGUI/components/chat/Header.d.ts +0 -2
  121. package/lib/AGUI/components/chat/Header.js +0 -28
  122. package/lib/AGUI/components/chat/Icons.d.ts +0 -16
  123. package/lib/AGUI/components/chat/Icons.js +0 -247
  124. package/lib/AGUI/components/chat/ImageUploadQueue.d.ts +0 -11
  125. package/lib/AGUI/components/chat/ImageUploadQueue.js +0 -65
  126. package/lib/AGUI/components/chat/Input.d.ts +0 -2
  127. package/lib/AGUI/components/chat/Input.js +0 -30
  128. package/lib/AGUI/components/chat/Markdown.d.ts +0 -7
  129. package/lib/AGUI/components/chat/Markdown.js +0 -187
  130. package/lib/AGUI/components/chat/Messages.d.ts +0 -7
  131. package/lib/AGUI/components/chat/Messages.js +0 -242
  132. package/lib/AGUI/components/chat/Modal.d.ts +0 -43
  133. package/lib/AGUI/components/chat/Modal.js +0 -113
  134. package/lib/AGUI/components/chat/Popup.d.ts +0 -49
  135. package/lib/AGUI/components/chat/Popup.js +0 -64
  136. package/lib/AGUI/components/chat/PoweredByTag.d.ts +0 -3
  137. package/lib/AGUI/components/chat/PoweredByTag.js +0 -27
  138. package/lib/AGUI/components/chat/Sidebar.d.ts +0 -2
  139. package/lib/AGUI/components/chat/Sidebar.js +0 -85
  140. package/lib/AGUI/components/chat/Suggestion.d.ts +0 -16
  141. package/lib/AGUI/components/chat/Suggestion.js +0 -146
  142. package/lib/AGUI/components/chat/Suggestions.d.ts +0 -2
  143. package/lib/AGUI/components/chat/Suggestions.js +0 -21
  144. package/lib/AGUI/components/chat/Textarea.d.ts +0 -11
  145. package/lib/AGUI/components/chat/Textarea.js +0 -60
  146. package/lib/AGUI/components/chat/Window.d.ts +0 -2
  147. package/lib/AGUI/components/chat/Window.js +0 -115
  148. package/lib/AGUI/components/chat/index.d.ts +0 -11
  149. package/lib/AGUI/components/chat/index.js +0 -11
  150. package/lib/AGUI/components/chat/messages/AssistantMessage.d.ts +0 -2
  151. package/lib/AGUI/components/chat/messages/AssistantMessage.js +0 -56
  152. package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.d.ts +0 -2
  153. package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.js +0 -114
  154. package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.d.ts +0 -2
  155. package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.js +0 -97
  156. package/lib/AGUI/components/chat/messages/RenderImageMessage.d.ts +0 -2
  157. package/lib/AGUI/components/chat/messages/RenderImageMessage.js +0 -61
  158. package/lib/AGUI/components/chat/messages/RenderResultMessage.d.ts +0 -2
  159. package/lib/AGUI/components/chat/messages/RenderResultMessage.js +0 -27
  160. package/lib/AGUI/components/chat/messages/RenderTextMessage.d.ts +0 -2
  161. package/lib/AGUI/components/chat/messages/RenderTextMessage.js +0 -47
  162. package/lib/AGUI/components/chat/messages/UserMessage.d.ts +0 -2
  163. package/lib/AGUI/components/chat/messages/UserMessage.js +0 -9
  164. package/lib/AGUI/components/chat/props.d.ts +0 -157
  165. package/lib/AGUI/components/index.d.ts +0 -1
  166. package/lib/AGUI/components/index.js +0 -1
  167. package/lib/AGUI/context/index.d.ts +0 -1
  168. package/lib/AGUI/context/index.js +0 -1
  169. package/lib/AGUI/hooks/index.d.ts +0 -1
  170. package/lib/AGUI/hooks/index.js +0 -1
  171. package/lib/AGUI/hooks/use-copilot-chat-suggestions.d.ts +0 -87
  172. package/lib/AGUI/hooks/use-copilot-chat-suggestions.js +0 -95
  173. package/lib/AGUI/hooks/use-copy-to-clipboard.d.ts +0 -7
  174. package/lib/AGUI/hooks/use-copy-to-clipboard.js +0 -34
  175. package/lib/AGUI/hooks/use-dark-mode.d.ts +0 -1
  176. package/lib/AGUI/hooks/use-dark-mode.js +0 -4
  177. package/lib/AGUI/hooks/use-push-to-talk.d.ts +0 -16
  178. package/lib/AGUI/hooks/use-push-to-talk.js +0 -260
  179. package/lib/AGUI/index.d.ts +0 -4
  180. package/lib/AGUI/index.js +0 -4
  181. package/lib/AGUI/lib/utils.d.ts +0 -2
  182. package/lib/AGUI/lib/utils.js +0 -52
  183. package/lib/AGUI/styles.css +0 -0
  184. package/lib/AGUI/types/css.d.ts +0 -0
  185. package/lib/AGUI/types/css.js +0 -0
  186. package/lib/AGUI/types/index.d.ts +0 -1
  187. package/lib/AGUI/types/index.js +0 -1
  188. package/lib/AGUI/types/suggestions.d.ts +0 -6
  189. package/lib/AGUI/types/suggestions.js +0 -1
  190. package/lib/Markdown/Markdown/AnimationNode.d.ts +0 -20
  191. package/lib/Markdown/Markdown/AnimationNode.js +0 -84
  192. package/lib/Markdown/Markdown/Markdown.d.ts +0 -4
  193. package/lib/Markdown/Markdown/Markdown.js +0 -58
  194. package/lib/Markdown/Markdown/core/Parser.d.ts +0 -16
  195. package/lib/Markdown/Markdown/core/Parser.js +0 -65
  196. package/lib/Markdown/Markdown/core/Renderer.d.ts +0 -24
  197. package/lib/Markdown/Markdown/core/Renderer.js +0 -137
  198. package/lib/Markdown/Markdown/core/index.d.ts +0 -3
  199. package/lib/Markdown/Markdown/core/index.js +0 -3
  200. package/lib/Markdown/Markdown/hooks/index.d.ts +0 -3
  201. package/lib/Markdown/Markdown/hooks/index.js +0 -3
  202. package/lib/Markdown/Markdown/hooks/useAnimation.d.ts +0 -4
  203. package/lib/Markdown/Markdown/hooks/useCitationsData.d.ts +0 -7
  204. package/lib/Markdown/Markdown/hooks/useStreaming.d.ts +0 -3
  205. package/lib/Markdown/Markdown/hooks/useStreaming.js +0 -521
  206. package/lib/Markdown/Markdown/hooks/useTyping.d.ts +0 -4
  207. package/lib/Markdown/Markdown/index.d.ts +0 -84
  208. package/lib/Markdown/Markdown/index.js +0 -161
  209. package/lib/Markdown/Markdown/interface.d.ts +0 -203
  210. package/lib/Markdown/Markdown/interface.js +0 -1
  211. package/lib/Markdown/Markdown/style.js +0 -32
  212. package/lib/Markdown/plugins/latex/index.d.ts +0 -9
  213. package/lib/Markdown/plugins/latex/index.js +0 -97
  214. package/lib/Markdown/plugins/type.d.ts +0 -60
  215. package/lib/Markdown/plugins/type.js +0 -1
  216. /package/components/Markdown/{Markdown/defaultComponents/DisabledImage.tsx → core/components/DisableImage.tsx} +0 -0
  217. /package/components/Markdown/{Markdown/defaultComponents → core/components}/Media.tsx +0 -0
  218. /package/components/Markdown/{plugins → core/plugins}/cursor/Dot.tsx +0 -0
  219. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.d.ts +0 -0
  220. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/CodeBlock.js +0 -0
  221. /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.d.ts → core/components/DisableImage.d.ts} +0 -0
  222. /package/lib/Markdown/{Markdown/defaultComponents/DisabledImage.js → core/components/DisableImage.js} +0 -0
  223. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.d.ts +0 -0
  224. /package/lib/Markdown/{Markdown/defaultComponents → core/components}/Media.js +0 -0
  225. /package/lib/Markdown/{plugins → core/plugins}/citations/CitationComponent.d.ts +0 -0
  226. /package/lib/Markdown/{plugins → core/plugins}/cursor/Dot.d.ts +0 -0
  227. /package/lib/Markdown/{plugins → core/plugins}/cursor/Underline.d.ts +0 -0
  228. /package/lib/Markdown/{plugins → core/plugins}/cursor/index.d.ts +0 -0
  229. /package/lib/Markdown/{Markdown/style.d.ts → styles.d.ts} +0 -0
  230. /package/lib/{AGUI/components/chat/props.js → Markdown/types.js} +0 -0
@@ -0,0 +1,8 @@
1
+ import { MarkdownProps } from '../../types';
2
+ interface RawProps {
3
+ content: MarkdownProps['content'];
4
+ baseFontSize?: number;
5
+ baseLineHeight?: number;
6
+ }
7
+ export default function Raw(props: RawProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ import { useProviderContext } from "../../..";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export default function Raw(props) {
4
+ var prefixCls = useProviderContext().getPrefixCls('markdown');
5
+ return /*#__PURE__*/_jsx("div", {
6
+ className: prefixCls,
7
+ style: {
8
+ fontSize: props.baseFontSize,
9
+ lineHeight: props.baseLineHeight
10
+ },
11
+ children: props.content
12
+ });
13
+ }
@@ -0,0 +1,6 @@
1
+ import { CitationComponentProps } from '../plugins/citations/CitationComponent';
2
+ export default function useCitationsData(props: any): {
3
+ CitationComponent: (props: CitationComponentProps) => import("react/jsx-runtime").JSX.Element;
4
+ citationsData: any;
5
+ citationsDataCount: number;
6
+ };
@@ -11,7 +11,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { useMemo } from 'react';
14
- import InnerCitationComponent from "../../plugins/citations/CitationComponent";
14
+ import InnerCitationComponent from "../plugins/citations/CitationComponent";
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  var emptyArray = [];
17
17
  var emptyMap = {};
@@ -0,0 +1,4 @@
1
+ export default function useCursorContent({ cursor, content }: {
2
+ cursor: boolean | 'dot' | 'underline';
3
+ content: string;
4
+ }): string;
@@ -0,0 +1,14 @@
1
+ import { useMemo } from "react";
2
+ export default function useCursorContent(_ref) {
3
+ var cursor = _ref.cursor,
4
+ content = _ref.content;
5
+ var cursorContent = useMemo(function () {
6
+ if (cursor) {
7
+ if (cursor === 'dot') return ' :dot:';
8
+ if (cursor === 'underline') return ' :underline:';
9
+ return ' :dot:';
10
+ }
11
+ return '';
12
+ }, [cursor, content]);
13
+ return content + cursorContent;
14
+ }
@@ -0,0 +1,5 @@
1
+ declare const useTyping: ({ content, typing }: {
2
+ content: any;
3
+ typing: any;
4
+ }) => any;
5
+ export default useTyping;
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { useEffect, useRef, useState } from 'react';
8
- export var useTyping = function useTyping(_ref) {
8
+ var useTyping = function useTyping(_ref) {
9
9
  var content = _ref.content,
10
10
  typing = _ref.typing;
11
11
  var _useState = useState(0),
@@ -29,4 +29,5 @@ export var useTyping = function useTyping(_ref) {
29
29
  }, [typing]);
30
30
  if (!typing) return content;
31
31
  return content.slice(0, index);
32
- };
32
+ };
33
+ export default useTyping;
@@ -0,0 +1,2 @@
1
+ import { InnerMarkdownXProps } from '../types';
2
+ export default function (props: InnerMarkdownXProps): import("react/jsx-runtime").JSX.Element;
@@ -1,30 +1,30 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["content", "cursor"];
2
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
5
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
6
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import React, { useMemo } from 'react';
8
- import AnimationNode from "../AnimationNode";
8
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import XMarkdown from '@ant-design/x-markdown';
11
+ import Styles from "../styles";
12
+ import useCursorContent from "./hooks/useCursorContent";
9
13
  import { jsx as _jsx } from "react/jsx-runtime";
10
- var ANIMATION_TAGS = ['div', 'p', 'li', 'h1', 'h2', 'h3', 'h4', 'strong'];
11
- var useAnimation = function useAnimation(streaming) {
12
- var _ref = streaming || {},
13
- _ref$enableAnimation = _ref.enableAnimation,
14
- enableAnimation = _ref$enableAnimation === void 0 ? false : _ref$enableAnimation,
15
- animationConfig = _ref.animationConfig;
16
- var animatedComponents = useMemo(function () {
17
- if (!enableAnimation) return {};
18
- return ANIMATION_TAGS.reduce(function (acc, tag) {
19
- var AnimatedComponent = /*#__PURE__*/React.memo(function (props) {
20
- return /*#__PURE__*/_jsx(AnimationNode, _objectSpread({
21
- nodeTag: tag,
22
- animationConfig: animationConfig
23
- }, props));
24
- });
25
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, tag, AnimatedComponent));
26
- }, {});
27
- }, [enableAnimation, JSON.stringify(animationConfig)]);
28
- return animatedComponents;
29
- };
30
- export default useAnimation;
14
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
+ import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ export default function (props) {
17
+ var originalContent = props.content,
18
+ cursor = props.cursor,
19
+ rest = _objectWithoutProperties(props, _excluded);
20
+ var content = useCursorContent({
21
+ cursor: cursor,
22
+ content: originalContent
23
+ });
24
+ return /*#__PURE__*/_jsxs(_Fragment, {
25
+ children: [/*#__PURE__*/_jsx(Styles, {}), /*#__PURE__*/_jsx(XMarkdown, _objectSpread(_objectSpread({}, rest), {}, {
26
+ content: content
27
+ }))]
28
+ });
29
+ }
30
+ ;
@@ -7,7 +7,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
8
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
9
9
  import { createGlobalStyle } from 'antd-style';
10
- import { useProviderContext } from "../../..";
10
+ import { useProviderContext } from "../../../..";
11
11
  import { Popover } from 'antd';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -29,10 +29,10 @@ function DefaultRender(props) {
29
29
  var _useProviderContext = useProviderContext(),
30
30
  getPrefixCls = _useProviderContext.getPrefixCls;
31
31
  var prefixCls = getPrefixCls('markdown-citation');
32
- var text = props.text,
33
- url = props.url,
34
- title = props.title,
35
- content = props.content;
32
+ var text = props['data-text'];
33
+ var url = props['data-url'];
34
+ var title = props['data-title'];
35
+ var content = props['data-content'];
36
36
  var isTooltip = content || title;
37
37
  var node = /*#__PURE__*/_jsx("sup", {
38
38
  className: prefixCls,
@@ -1,6 +1,5 @@
1
- import { MarkdownProps } from "../../Markdown/interface";
2
1
  export { default as CitationComponent } from './CitationComponent';
3
- export declare function citationsExtension(citationsData: MarkdownProps['citationsMap']): {
2
+ export declare function citationsExtension(citationsData: any): {
4
3
  name: string;
5
4
  level: "inline";
6
5
  tokenizer(src: string): {
@@ -24,7 +24,7 @@ export function citationsExtension(citationsData) {
24
24
  var text = token.text;
25
25
  var citation = citationsData === null || citationsData === void 0 ? void 0 : citationsData[text];
26
26
  if (!citation) return token.raw;
27
- return "<citation text=\"".concat(text, "\" url=\"").concat(citation.url, "\" title=\"").concat(citation.title, "\" content=\"").concat(citation.content, "\"></citation>");
27
+ return "<citation data-text=\"".concat(text, "\" data-url=\"").concat(citation.url, "\" data-title=\"").concat(citation.title, "\" data-content=\"").concat(citation.content, "\"></citation>");
28
28
  }
29
29
  };
30
30
  }
@@ -1,6 +1,6 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { useProviderContext } from "../../..";
3
+ import { useProviderContext } from "../../../..";
4
4
  import { createGlobalStyle } from 'antd-style';
5
5
  import classNames from 'classnames';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
- import { useProviderContext } from "../../..";
3
+ import { useProviderContext } from "../../../..";
4
4
  import classNames from 'classnames';
5
5
  import { createGlobalStyle } from 'antd-style';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,12 +1,12 @@
1
- import React from "react";
2
1
  import Underline from "./Underline";
3
2
  import Dot from "./Dot";
4
3
  import { jsx as _jsx } from "react/jsx-runtime";
5
4
  export var CursorComponent = function CursorComponent(props) {
6
- if (props.type === 'dot') {
5
+ var type = props['data-type'];
6
+ if (type === 'dot') {
7
7
  return /*#__PURE__*/_jsx(Dot, {});
8
8
  }
9
- if (props.type === 'underline') {
9
+ if (type === 'underline') {
10
10
  return /*#__PURE__*/_jsx(Underline, {});
11
11
  }
12
12
  return null;
@@ -48,7 +48,7 @@ export function cursorExtension() {
48
48
  };
49
49
  },
50
50
  renderer: function renderer(token) {
51
- var content = "<cursor type=\"".concat(token.name, "\"></cursor>");
51
+ var content = "<custom-cursor data-type=\"".concat(token.name, "\"></custom-cursor>");
52
52
  return content;
53
53
  }
54
54
  };
@@ -1 +1,2 @@
1
- export { default, type MarkdownProps } from './Markdown';
1
+ export { default } from './Markdown';
2
+ export type { MarkdownProps, } from './types';
@@ -0,0 +1,32 @@
1
+ var _templateObject;
2
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
+ import { createGlobalStyle } from 'antd-style';
4
+ export default createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-markdown {\n color: inherit;\n max-width: 100%;\n\n blockquote {\n padding-inline: 0.6em 0;\n padding-block: 0;\n margin: 1em 0;\n border-inline-start: 4px solid ", ";\n opacity: 0.85;\n }\n\n figure {\n margin: 0;\n }\n\n code {\n font-size: 0.8571428571428571em;\n border: 0;\n margin: 0;\n background-color: ", ";\n color: ", ";\n border-radius: ", "px;\n padding: 2px 6px;\n margin-inline: 3px;\n border: 1px solid ", ";\n }\n\n pre code {\n font-size: 0.8571428571428571em;\n background-color: transparent;\n border: none;\n }\n\n pre {\n background-color: ", ";\n padding: 4px 10px;\n border: 1px solid ", ";\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-top: 0.5714285714285714em;\n margin-bottom: 0.5714285714285714em;\n font-weight: 500;\n line-height: 1.7777;\n color: inherit;\n }\n\n p {\n margin-bottom: 0.5714285714285714em;\n }\n\n h1 {\n font-size: 1.2857142857142858em;\n }\n\n h2 {\n font-size: 1.1428571428571428em;\n }\n\n h3 {\n font-size: 1em;\n }\n\n h4 {\n font-size: 1em;\n }\n\n h5 {\n font-size: 1em;\n }\n\n h6 {\n font-size: 1em;\n }\n\n hr {\n border-color: ", ";\n border-style: solid;\n border-width: 1px 0 0 0;\n margin: 1em 0;\n }\n\n table {\n border-collapse: collapse;\n display: block;\n width: max-content;\n max-width: 100%;\n overflow: auto;\n }\n\n table th {\n background: ", ";\n text-align: left;\n }\n\n table td,\n table th {\n padding: 0.75em 1.5em;\n border: 1px solid ", ";\n white-space: pre;\n }\n\n .", "-image {\n max-width: 480px;\n overflow: hidden;\n }\n\n .", "-markdown-video {\n position: relative;\n \n &-poster {\n display: flex;\n align-items: center;\n justify-content: center;\n max-width: 480px;\n background-color: #000;\n border-radius: 8px;\n padding: 100px 0;\n cursor: pointer;\n }\n\n &-play {\n color: #ccc;\n font-size: 30px;\n }\n }\n}\n\n.", "-markdown.x-markdown {\n img {\n margin: 0;\n }\n}\n"])), function (p) {
5
+ return p.theme.prefixCls;
6
+ }, function (p) {
7
+ return p.theme.colorBorder;
8
+ }, function (p) {
9
+ return p.theme.colorFillQuaternary;
10
+ }, function (p) {
11
+ return p.theme.colorText;
12
+ }, function (p) {
13
+ return p.theme.borderRadiusSM;
14
+ }, function (p) {
15
+ return p.theme.colorBorderSecondary;
16
+ }, function (p) {
17
+ return p.theme.colorFillQuaternary;
18
+ }, function (p) {
19
+ return p.theme.colorBorderSecondary;
20
+ }, function (p) {
21
+ return p.theme.colorBorderSecondary;
22
+ }, function (p) {
23
+ return p.theme.colorFillQuaternary;
24
+ }, function (p) {
25
+ return p.theme.colorBorderSecondary;
26
+ }, function (p) {
27
+ return p.theme.prefixCls;
28
+ }, function (p) {
29
+ return p.theme.prefixCls;
30
+ }, function (p) {
31
+ return p.theme.prefixCls;
32
+ });
@@ -0,0 +1,78 @@
1
+ /// <reference types="react" />
2
+ import { XMarkdownProps } from '@ant-design/x-markdown';
3
+ export interface MarkdownProps {
4
+ /**
5
+ * @description 需要渲染的 Markdown 内容
6
+ * @descriptionEn Markdown content to be rendered
7
+ */
8
+ content?: string;
9
+ /**
10
+ * @description 光标样式类型,支持点状、下划线或布尔值控制
11
+ * @descriptionEn Cursor style type, supports dot, underline, or boolean control
12
+ */
13
+ cursor?: boolean | 'dot' | 'underline';
14
+ /**
15
+ * @description 基础字体大小,影响整个Markdown内容的字体大小
16
+ * @descriptionEn Base font size that affects the font size of the entire Markdown content
17
+ */
18
+ baseFontSize?: number;
19
+ /**
20
+ * @description 基础行高,影响文本的行间距
21
+ * @descriptionEn Base line height that affects text line spacing
22
+ */
23
+ baseLineHeight?: number;
24
+ /**
25
+ * @description 是否允许渲染HTML标签,影响安全性
26
+ * @descriptionEn Whether to allow rendering HTML tags, affects security
27
+ */
28
+ allowHtml?: boolean;
29
+ /**
30
+ * @description 是否禁用图片渲染
31
+ * @descriptionEn Whether to disable image rendering
32
+ */
33
+ disableImage?: boolean;
34
+ /**
35
+ * @description 是否以原始文本形式显示,跳过Markdown解析
36
+ * @descriptionEn Whether to display as raw text, skipping Markdown parsing
37
+ */
38
+ raw?: boolean;
39
+ /**
40
+ * @description 是否启用打字机效果,逐字显示内容
41
+ * @descriptionEn Whether to enable typewriter effect for character-by-character display
42
+ */
43
+ typing?: boolean | number;
44
+ /**
45
+ * @description 组件的CSS类名
46
+ * @descriptionEn CSS class name for the component
47
+ */
48
+ className?: string;
49
+ citations?: {
50
+ title?: string;
51
+ url?: string;
52
+ content?: string;
53
+ render?: (props: {
54
+ text: string;
55
+ url: string;
56
+ title: string;
57
+ content: string;
58
+ }) => React.ReactNode;
59
+ }[];
60
+ citationsMap?: Record<string, {
61
+ title?: string;
62
+ url?: string;
63
+ content?: string;
64
+ render?: (props: {
65
+ text: string;
66
+ url: string;
67
+ title: string;
68
+ content: string;
69
+ }) => React.ReactNode;
70
+ }>;
71
+ }
72
+ export interface InnerMarkdownXProps extends XMarkdownProps {
73
+ /**
74
+ * @description 光标样式类型,支持点状、下划线或布尔值控制
75
+ * @descriptionEn Cursor style type, supports dot, underline, or boolean control
76
+ */
77
+ cursor?: MarkdownProps['cursor'];
78
+ }
package/lib/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  export { ConfigProvider } from 'antd';
2
2
  export { default as version } from './Version';
3
- export * from '@copilotkit/react-core';
4
- export * from './AGUI';
5
3
  export { CustomCardsContext, CustomCardsProvider, default as SparkChatProvider, useCustomCardsContext, useGlobalContext, useProviderContext, } from './Provider';
6
4
  export { default as Stream } from './Stream';
7
5
  export type { StreamOptions as StreamOptions } from './Stream';
package/lib/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  export { ConfigProvider } from 'antd';
2
2
  export { default as version } from "./Version";
3
- export * from '@copilotkit/react-core';
4
- export * from "./AGUI";
5
3
  export { CustomCardsContext, CustomCardsProvider, default as SparkChatProvider, useCustomCardsContext, useGlobalContext, useProviderContext } from "./Provider";
6
4
  export { default as Stream } from "./Stream";
7
5
  export { createCard } from "./Bubble/Cards";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/chat",
3
- "version": "1.1.40",
3
+ "version": "1.1.41-beta.1764749089549",
4
4
  "description": "a free and open-source chat framework for building excellent LLM-powered chat experiences",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": [
@@ -64,48 +64,23 @@
64
64
  "@agentscope-ai/icons-svg-override-antd": "^4.4.2",
65
65
  "@ant-design/cssinjs-utils": "^1.1.3",
66
66
  "@ant-design/icons": "^5.0.1",
67
- "@copilotkit/react-core": "^1.9",
68
- "@copilotkit/react-ui": "^1.9.1",
69
- "@copilotkit/runtime": "^1.9",
70
- "@copilotkit/runtime-client-gql": "^1.9",
71
- "@rc-component/motion": "^1.1.4",
72
- "@react-spring/web": "^10.0.2",
67
+ "@ant-design/x-markdown": "^2.0.0",
73
68
  "ahooks": "^3.8.4",
74
69
  "antd-style": "^3.7.1",
75
- "antd-token-previewer": "^2.0.8",
70
+ "commander": "^12.1.0",
76
71
  "copy-to-clipboard": "^3.3.3",
77
- "cross-fetch": "^4.1.0",
78
72
  "dompurify": "^3.2.6",
79
- "framer-motion": "^12.12.1",
80
- "html-react-parser": "^5.2.7",
81
- "html-tags": "^5.1.0",
82
73
  "immer": "^10.1.1",
83
- "katex": "^0.16.22",
84
74
  "lodash": "^4.17.21",
85
- "marked": "^16.2.1",
86
75
  "mermaid": "^11.6.0",
87
- "pretty-ms": "^9.3.0",
88
76
  "react-error-boundary": "^6.0.0",
89
- "react-infinite-scroll-component": "^6.1.0",
90
- "react-markdown": "^10.1.0",
91
77
  "react-syntax-highlighter": "^15.6.6",
92
78
  "react-transition-group": "^4.4.5",
93
- "recorder-core": "^1.3.25011100",
94
- "rehype-katex": "^7.0.1",
95
- "rehype-raw": "^7.0.0",
96
- "remark-breaks": "^4.0.0",
97
- "remark-gfm": "^4.0.1",
98
- "remark-math": "^6.0.0",
99
- "unified": "^11.0.5",
100
- "unist-util-visit": "^5.0.0",
101
79
  "use-context-selector": "^2.0.0",
102
80
  "use-stick-to-bottom": "^1.1.1",
103
81
  "uuid": "^11.0.5",
104
82
  "xstate": "^5.19.4",
105
- "zustand": "^5.0.3",
106
- "vite": "^5.4.11",
107
- "antd": "^5.18.0",
108
- "commander": "^12.1.0"
83
+ "zustand": "^5.0.3"
109
84
  },
110
85
  "devDependencies": {
111
86
  "@agentscope-ai/dumi-theme-spark": "0.0.98",
@@ -119,11 +94,10 @@
119
94
  "@types/react-dom": "^18.0.0",
120
95
  "@umijs/lint": "^4.0.0",
121
96
  "@umijs/plugins": "^4.4.11",
97
+ "antd": "^5.18.0",
122
98
  "dumi": "^2.4.13",
123
99
  "esbuild": "^0.19.12",
124
100
  "eslint": "^8.23.0",
125
- "react": "^18.0.0",
126
- "react-dom": "^18.0.0",
127
101
  "father": "^4.1.0",
128
102
  "husky": "^8.0.1",
129
103
  "lint-staged": "^13.0.3",
@@ -131,6 +105,8 @@
131
105
  "prettier": "^2.7.1",
132
106
  "prettier-plugin-organize-imports": "^3.0.0",
133
107
  "prettier-plugin-packagejson": "^2.2.18",
108
+ "react": "^18.0.0",
109
+ "react-dom": "^18.0.0",
134
110
  "stylelint": "^14.9.1",
135
111
  "tailwindcss": "^3.4.17",
136
112
  "vaso": "^0.4.0"
@@ -1,68 +0,0 @@
1
- import React from "react";
2
-
3
- export const LifeBuoyIcon = () => (
4
- <svg
5
- xmlns="http://www.w3.org/2000/svg"
6
- width="24"
7
- height="24"
8
- viewBox="0 0 24 24"
9
- fill="none"
10
- stroke="currentColor"
11
- strokeWidth="2"
12
- strokeLinecap="round"
13
- strokeLinejoin="round"
14
- className="icon icon-tabler icons-tabler-outline icon-tabler-lifebuoy"
15
- >
16
- <g transform="translate(0, -1)">
17
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
18
- <path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" />
19
- <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
20
- <path d="M15 15l3.35 3.35" />
21
- <path d="M9 15l-3.35 3.35" />
22
- <path d="M5.65 5.65l3.35 3.35" />
23
- <path d="M18.35 5.65l-3.35 3.35" />
24
- </g>
25
- </svg>
26
- );
27
-
28
- export const CloseIcon = () => (
29
- <svg
30
- xmlns="http://www.w3.org/2000/svg"
31
- fill="none"
32
- viewBox="0 0 24 24"
33
- strokeWidth="1.5"
34
- stroke="currentColor"
35
- width="20"
36
- height="20"
37
- >
38
- <path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
39
- </svg>
40
- );
41
-
42
- export const LoadingSpinnerIcon = ({ color = "rgb(107 114 128)" }: { color?: string }) => (
43
- <svg
44
- style={{
45
- animation: "copilotKitSpinAnimation 1s linear infinite",
46
- color,
47
- }}
48
- width="24"
49
- height="24"
50
- xmlns="http://www.w3.org/2000/svg"
51
- fill="none"
52
- viewBox="0 0 24 24"
53
- >
54
- <circle
55
- style={{ opacity: 0.25 }}
56
- cx="12"
57
- cy="12"
58
- r="10"
59
- stroke="currentColor"
60
- strokeWidth="4"
61
- ></circle>
62
- <path
63
- style={{ opacity: 0.75 }}
64
- fill="currentColor"
65
- d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
66
- ></path>
67
- </svg>
68
- );
@@ -1 +0,0 @@
1
- export { CopilotKitHelpModal } from "./modal";
@@ -1,101 +0,0 @@
1
- import React, { useMemo, useState, useRef, useEffect } from "react";
2
- import { CloseIcon } from "./icons";
3
-
4
- export function CopilotKitHelpModal() {
5
- const [showHelpModal, setShowHelpModal] = useState(false);
6
- const buttonRef = useRef<HTMLButtonElement>(null);
7
- const popoverRef = useRef<HTMLDivElement>(null);
8
-
9
- // Close popover when clicking outside
10
- useEffect(() => {
11
- const handleClickOutside = (event: MouseEvent) => {
12
- if (
13
- popoverRef.current &&
14
- !popoverRef.current.contains(event.target as Node) &&
15
- buttonRef.current &&
16
- !buttonRef.current.contains(event.target as Node)
17
- ) {
18
- setShowHelpModal(false);
19
- }
20
- };
21
-
22
- if (showHelpModal) {
23
- document.addEventListener("mousedown", handleClickOutside);
24
- }
25
-
26
- return () => {
27
- document.removeEventListener("mousedown", handleClickOutside);
28
- };
29
- }, [showHelpModal]);
30
-
31
- const HelpButton = () => (
32
- <button
33
- ref={buttonRef}
34
- onClick={() => setShowHelpModal(!showHelpModal)}
35
- className="copilotKitDebugMenuTriggerButton relative"
36
- aria-label="Open Help"
37
- >
38
- Help
39
- </button>
40
- );
41
-
42
- return (
43
- <div className="relative">
44
- <HelpButton />
45
- {showHelpModal && (
46
- <div
47
- ref={popoverRef}
48
- className="absolute mt-2 z-50"
49
- style={{
50
- top: "100%",
51
- right: "-120px",
52
- width: "380px",
53
- }}
54
- >
55
- <div className="copilotKitHelpModal rounded-lg shadow-xl w-full p-4 flex-col relative">
56
- <button
57
- className="copilotKitHelpModalCloseButton absolute text-gray-400 hover:text-gray-600 focus:outline-none"
58
- style={{ top: "10px", right: "10px" }}
59
- onClick={() => setShowHelpModal(false)}
60
- aria-label="Close"
61
- >
62
- <CloseIcon />
63
- </button>
64
- <div className="w-full flex mb-6 justify-center">
65
- <h2 className="text-2xl font-bold">Help Options</h2>
66
- </div>
67
- <div className="space-y-4 mb-4">
68
- <div className="copilotKitHelpItemButton">
69
- <a
70
- href="https://docs.copilotkit.ai/coagents/troubleshooting/common-issues"
71
- target="_blank"
72
- rel="noopener noreferrer"
73
- >
74
- Visit the Troubleshooting and FAQ section in the docs
75
- </a>
76
- </div>
77
- <div className="copilotKitHelpItemButton">
78
- <a
79
- href="https://go.copilotkit.ai/dev-console-support-discord"
80
- target="_blank"
81
- rel="noopener noreferrer"
82
- >
83
- Go to Discord Support Channel (Community Support)
84
- </a>
85
- </div>
86
- <div className="copilotKitHelpItemButton">
87
- <a
88
- href="https://go.copilotkit.ai/dev-console-support-slack"
89
- target="_blank"
90
- rel="noopener noreferrer"
91
- >
92
- Apply for Priority Direct Slack Support
93
- </a>
94
- </div>
95
- </div>
96
- </div>
97
- </div>
98
- )}
99
- </div>
100
- );
101
- }