@myun/gimi-chat 0.0.3 → 0.0.5

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 (206) hide show
  1. package/dist/apis/fetch.d.ts +64 -0
  2. package/dist/apis/fetch.js +512 -0
  3. package/dist/apis/useApi.d.ts +57 -0
  4. package/dist/apis/useApi.js +378 -0
  5. package/dist/assets/image/Subtract.png +0 -0
  6. package/dist/assets/image/ai-logo.png +0 -0
  7. package/dist/assets/image/copyIcon.png +0 -0
  8. package/dist/assets/image/deepthinkActive.png +0 -0
  9. package/dist/assets/image/empty-img-dark.png +0 -0
  10. package/dist/assets/image/empty-img.png +0 -0
  11. package/dist/assets/image/like_active.png +0 -0
  12. package/dist/assets/image/love.png +0 -0
  13. package/dist/assets/image/retry.png +0 -0
  14. package/dist/assets/image/soundOut.png +0 -0
  15. package/dist/assets/image/unlike_active.png +0 -0
  16. package/dist/assets/image/unlove.png +0 -0
  17. package/dist/assets/lottie/ai-bg.json +1704 -0
  18. package/dist/assets/lottie/ai-loading.json +192 -0
  19. package/dist/assets/lottie/ai-output-loading.json +272 -0
  20. package/dist/assets/lottie/ai-output-normal.json +17694 -0
  21. package/dist/assets/lottie/ai-output-strengthen.json +17321 -0
  22. package/dist/assets/lottie/ai-voice-play.json +1 -0
  23. package/dist/assets/lottie/living.json +705 -0
  24. package/dist/assets/lottie/myun-living.json +726 -0
  25. package/dist/assets/lottie/myun-loading.json +530 -0
  26. package/dist/components/ai-chat-dialogue/index.d.ts +16 -0
  27. package/dist/components/ai-chat-dialogue/index.js +1056 -0
  28. package/dist/components/ai-chat-dialogue/index.module.css +230 -0
  29. package/dist/components/ai-chat-dialogue/message-parser.d.ts +36 -0
  30. package/dist/components/ai-chat-dialogue/message-parser.js +52 -0
  31. package/dist/components/ai-chat-dialogue/tlv.d.ts +7 -0
  32. package/dist/components/ai-chat-dialogue/tlv.js +32 -0
  33. package/dist/components/ai-chat-dialogue/volc-voice-call-client.d.ts +47 -0
  34. package/dist/components/ai-chat-dialogue/volc-voice-call-client.js +246 -0
  35. package/dist/components/ai-correction/index.d.ts +5 -0
  36. package/dist/components/ai-correction/index.js +45 -0
  37. package/dist/components/ai-loading/index.d.ts +3 -0
  38. package/dist/components/ai-loading/index.js +14 -0
  39. package/dist/components/ai-loading/index.module.css +11 -0
  40. package/dist/components/answer-item/index.d.ts +27 -0
  41. package/dist/components/answer-item/index.js +194 -0
  42. package/dist/components/answer-item/index.module.css +266 -0
  43. package/dist/components/ask-card/index.d.ts +10 -0
  44. package/dist/components/ask-card/index.js +76 -0
  45. package/dist/components/ask-card/index.module.css +122 -0
  46. package/dist/components/chat-input/index.d.ts +31 -0
  47. package/dist/components/chat-input/index.js +433 -0
  48. package/dist/components/chat-input/index.module.css +42 -0
  49. package/dist/components/chat-voice/VoiceCommunication.d.ts +7 -0
  50. package/dist/components/chat-voice/VoiceCommunication.js +69 -0
  51. package/dist/components/chat-voice/VoiceRecord.d.ts +7 -0
  52. package/dist/components/chat-voice/VoiceRecord.js +34 -0
  53. package/dist/components/conversation-delete/index.d.ts +5 -0
  54. package/dist/components/conversation-delete/index.js +24 -0
  55. package/dist/components/dots-loading/index.d.ts +2 -0
  56. package/dist/components/dots-loading/index.js +11 -0
  57. package/dist/components/dots-loading/index.module.css +41 -0
  58. package/dist/components/empty/index.d.ts +9 -0
  59. package/dist/components/empty/index.js +32 -0
  60. package/dist/components/empty/index.module.css +24 -0
  61. package/dist/components/excel-components/ExcelCard.d.ts +11 -0
  62. package/dist/components/excel-components/ExcelCard.js +35 -0
  63. package/dist/components/excel-components/ExcelExcuting.d.ts +10 -0
  64. package/dist/components/excel-components/ExcelExcuting.js +263 -0
  65. package/dist/components/excel-components/ExcelFailCard.d.ts +9 -0
  66. package/dist/components/excel-components/ExcelFailCard.js +20 -0
  67. package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -0
  68. package/dist/components/excel-components/ExcelSuccessCard.js +50 -0
  69. package/dist/components/excel-components/index.module.css +212 -0
  70. package/dist/components/excel-components/styles.module.css +178 -0
  71. package/dist/components/file-card/fileCardSidebar.d.ts +8 -0
  72. package/dist/components/file-card/fileCardSidebar.js +56 -0
  73. package/dist/components/file-card/index.d.ts +15 -0
  74. package/dist/components/file-card/index.js +97 -0
  75. package/dist/components/file-card/index.module.css +139 -0
  76. package/dist/components/file-preview/index.d.ts +3 -0
  77. package/dist/components/file-preview/index.js +227 -0
  78. package/dist/components/file-preview/index.module.css +83 -0
  79. package/dist/components/file-upload/index.d.ts +16 -0
  80. package/dist/components/file-upload/index.js +238 -0
  81. package/dist/components/file-upload/uploadV1.d.ts +16 -0
  82. package/dist/components/file-upload/uploadV1.js +267 -0
  83. package/dist/components/gimi-sidebar/index.d.ts +17 -0
  84. package/dist/components/gimi-sidebar/index.js +41 -0
  85. package/dist/components/gimi-sidebar/index.module.css +118 -0
  86. package/dist/components/header/index.d.ts +5 -0
  87. package/dist/components/header/index.js +20 -0
  88. package/dist/components/header/index.module.css +19 -0
  89. package/dist/components/iconfont-com/index.d.ts +11 -0
  90. package/dist/components/iconfont-com/index.js +29 -0
  91. package/dist/components/index.d.ts +1 -0
  92. package/dist/components/index.js +1 -0
  93. package/dist/components/knowledge-trace/KnowledgeIconComponent.d.ts +7 -0
  94. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +101 -0
  95. package/dist/components/knowledge-trace/classList.d.ts +6 -0
  96. package/dist/components/knowledge-trace/classList.js +72 -0
  97. package/dist/components/knowledge-trace/documentList.d.ts +6 -0
  98. package/dist/components/knowledge-trace/documentList.js +75 -0
  99. package/dist/components/knowledge-trace/index.d.ts +18 -0
  100. package/dist/components/knowledge-trace/index.js +155 -0
  101. package/dist/components/knowledge-trace/index.module.css +254 -0
  102. package/dist/components/knowledge-trace/interfaces.d.ts +166 -0
  103. package/dist/components/knowledge-trace/interfaces.js +1 -0
  104. package/dist/components/knowledge-trace/videoList.d.ts +6 -0
  105. package/dist/components/knowledge-trace/videoList.js +91 -0
  106. package/dist/components/lottie-img/index.d.ts +8 -0
  107. package/dist/components/lottie-img/index.js +99 -0
  108. package/dist/components/message-actions/CopyButton.d.ts +7 -0
  109. package/dist/components/message-actions/CopyButton.js +33 -0
  110. package/dist/components/message-actions/LikeButton.d.ts +7 -0
  111. package/dist/components/message-actions/LikeButton.js +34 -0
  112. package/dist/components/message-actions/RegenerateButton.d.ts +5 -0
  113. package/dist/components/message-actions/RegenerateButton.js +27 -0
  114. package/dist/components/message-actions/UnLikeButton.d.ts +7 -0
  115. package/dist/components/message-actions/UnLikeButton.js +34 -0
  116. package/dist/components/message-actions/VoicePlay.d.ts +10 -0
  117. package/dist/components/message-actions/VoicePlay.js +74 -0
  118. package/dist/components/message-list/index.d.ts +19 -0
  119. package/dist/components/message-list/index.js +164 -0
  120. package/dist/components/message-list/index.module.css +261 -0
  121. package/dist/components/no-microphone-root/index.d.ts +6 -0
  122. package/dist/components/no-microphone-root/index.js +36 -0
  123. package/dist/components/no-microphone-root/index.module.css +48 -0
  124. package/dist/components/preset-agent-content/index.d.ts +8 -0
  125. package/dist/components/preset-agent-content/index.js +24 -0
  126. package/dist/components/preset-agent-content/index.module.css +46 -0
  127. package/dist/components/quoted-content/index.d.ts +0 -0
  128. package/dist/components/quoted-content/index.js +171 -0
  129. package/dist/components/quoted-content/index.module.css +80 -0
  130. package/dist/components/reasoning-content/index.d.ts +6 -0
  131. package/dist/components/reasoning-content/index.js +116 -0
  132. package/dist/components/reasoning-content/index.module.css +169 -0
  133. package/dist/components/reference-content/index.d.ts +28 -0
  134. package/dist/components/reference-content/index.js +125 -0
  135. package/dist/components/reference-content/index.module.css +84 -0
  136. package/dist/components/templates/CommonChat.d.ts +5 -0
  137. package/dist/components/templates/CommonChat.js +218 -0
  138. package/dist/components/templates/GimiChatComponent.d.ts +4 -0
  139. package/dist/components/templates/GimiChatComponent.js +23 -0
  140. package/dist/components/templates/demo/demo.d.ts +2 -0
  141. package/dist/components/templates/demo/demo.js +109 -0
  142. package/dist/components/templates/index.module.css +109 -0
  143. package/dist/components/upload-list/index.d.ts +15 -0
  144. package/dist/components/upload-list/index.js +90 -0
  145. package/dist/components/upload-list/index.module.css +119 -0
  146. package/dist/components/voice-bars/index.d.ts +4 -0
  147. package/dist/components/voice-bars/index.js +174 -0
  148. package/dist/components/voice-check-dialog/index.d.ts +8 -0
  149. package/dist/components/voice-check-dialog/index.js +163 -0
  150. package/dist/components/voice-check-dialog/index.module.css +9 -0
  151. package/dist/components/voice-recording/index.d.ts +9 -0
  152. package/dist/components/voice-recording/index.js +54 -0
  153. package/dist/components/voice-recording/index.module.css +41 -0
  154. package/dist/components/work-flow-content/demo.d.ts +3 -0
  155. package/dist/components/work-flow-content/demo.js +11 -0
  156. package/dist/components/work-flow-content/index.d.ts +6 -0
  157. package/dist/components/work-flow-content/index.js +55 -0
  158. package/dist/components/work-flow-content/index.module.css +24 -0
  159. package/dist/constants.d.ts +24 -0
  160. package/dist/constants.js +24 -0
  161. package/dist/hooks/useChatActions.d.ts +12 -0
  162. package/dist/hooks/useChatActions.js +207 -0
  163. package/dist/hooks/useChatHistory.d.ts +8 -0
  164. package/dist/hooks/useChatHistory.js +225 -0
  165. package/dist/hooks/useChatMessage.d.ts +49 -0
  166. package/dist/hooks/useChatMessage.js +87 -0
  167. package/dist/hooks/useChatRecommend.d.ts +8 -0
  168. package/dist/hooks/useChatRecommend.js +126 -0
  169. package/dist/hooks/useChatStream.d.ts +20 -0
  170. package/dist/hooks/useChatStream.js +244 -0
  171. package/dist/hooks/useChatUI.d.ts +32 -0
  172. package/dist/hooks/useChatUI.js +134 -0
  173. package/dist/hooks/useChatVoice.d.ts +11 -0
  174. package/dist/hooks/useChatVoice.js +379 -0
  175. package/dist/hooks/useCommonChatAPI.d.ts +27 -0
  176. package/dist/hooks/useCommonChatAPI.js +1276 -0
  177. package/dist/hooks/useFile.d.ts +13 -0
  178. package/dist/hooks/useFile.js +288 -0
  179. package/dist/hooks/useKnowledgeService.d.ts +17 -0
  180. package/dist/hooks/useKnowledgeService.js +210 -0
  181. package/dist/hooks/useLastEventId.d.ts +8 -0
  182. package/dist/hooks/useLastEventId.js +66 -0
  183. package/dist/hooks/useLongPoll.d.ts +3 -0
  184. package/dist/hooks/useLongPoll.js +111 -0
  185. package/dist/hooks/useScroll.d.ts +4 -0
  186. package/dist/hooks/useScroll.js +172 -0
  187. package/dist/index.d.ts +1 -0
  188. package/dist/index.js +1 -0
  189. package/dist/interfaces/chatMessage.d.ts +139 -0
  190. package/dist/interfaces/fileInterface.d.ts +10 -0
  191. package/dist/interfaces/fileInterface.js +11 -0
  192. package/dist/interfaces/knowledgeTrace.d.ts +177 -0
  193. package/dist/store/hooks.d.ts +4 -0
  194. package/dist/store/hooks.js +3 -0
  195. package/dist/store/index.d.ts +7 -0
  196. package/dist/store/index.js +7 -0
  197. package/dist/store/slices/gimiMenuSlice.d.ts +95 -0
  198. package/dist/store/slices/gimiMenuSlice.js +251 -0
  199. package/dist/utils/chatInputUtil.d.ts +19 -0
  200. package/dist/utils/chatInputUtil.js +45 -0
  201. package/dist/utils/tools.d.ts +50 -0
  202. package/dist/utils/tools.js +474 -0
  203. package/dist/utils/voice-stream.d.ts +119 -0
  204. package/dist/utils/voice-stream.js +1162 -0
  205. package/package.json +5 -6
  206. package/LICENSE +0 -21
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ var AICorrection = function AICorrection(_ref) {
3
+ var value = _ref.value;
4
+ var data = {
5
+ score: '',
6
+ comment: ''
7
+ };
8
+ try {
9
+ var jsonObj = JSON.parse(value);
10
+ data = jsonObj.result;
11
+ } catch (error) {
12
+ // console.error(error);
13
+ return null;
14
+ }
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ style: {
17
+ display: 'flex',
18
+ flexDirection: 'column',
19
+ gap: '20px'
20
+ }
21
+ }, /*#__PURE__*/React.createElement("span", null, "\u6839\u636E\u8003\u751F\u7684\u56DE\u7B54\uFF0C\u7ED9\u51FA\u4EE5\u4E0B\u5F97\u5206\u53CA\u8BC4\u8BED\uFF1A"), /*#__PURE__*/React.createElement("div", {
22
+ style: {
23
+ display: 'flex',
24
+ flexDirection: 'column',
25
+ gap: '10px'
26
+ }
27
+ }, /*#__PURE__*/React.createElement("span", {
28
+ style: {
29
+ fontSize: '18px',
30
+ fontWeight: 600
31
+ }
32
+ }, "\u5F97\u5206"), /*#__PURE__*/React.createElement("span", null, data.score, "\u5206")), /*#__PURE__*/React.createElement("div", {
33
+ style: {
34
+ display: 'flex',
35
+ flexDirection: 'column',
36
+ gap: '10px'
37
+ }
38
+ }, /*#__PURE__*/React.createElement("span", {
39
+ style: {
40
+ fontSize: '18px',
41
+ fontWeight: 600
42
+ }
43
+ }, "\u8BC4\u8BED"), /*#__PURE__*/React.createElement("span", null, data.comment)));
44
+ };
45
+ export default AICorrection;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const AiLoading: () => React.JSX.Element;
3
+ export default AiLoading;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import styles from "./index.module.css";
3
+ import LottieImg from "../lottie-img";
4
+ var AiLoading = function AiLoading() {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: styles.aiLoading
7
+ }, /*#__PURE__*/React.createElement(LottieImg, {
8
+ name: "aiLoading",
9
+ size: [30, 50]
10
+ }), /*#__PURE__*/React.createElement("div", {
11
+ className: styles.text
12
+ }, "\u6570\u636E\u52A0\u8F7D\u4E2D~"));
13
+ };
14
+ export default AiLoading;
@@ -0,0 +1,11 @@
1
+ .aiLoading {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ height: 100%;
7
+ }
8
+ .aiLoading .text {
9
+ margin-top: 4px;
10
+ text-align: center;
11
+ }
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { IChatMessageItem } from '../../interfaces/chatMessage';
3
+ interface AnswerItemProps {
4
+ item: IChatMessageItem;
5
+ onSucess: (pollResult: any, messageId: number) => void;
6
+ onFailure: (pollResult: any, messageId: number) => void;
7
+ onRetry: (pollResult: any, messageId: number) => void;
8
+ showCommend?: (id: number) => boolean;
9
+ showOpera?: (id: number) => boolean;
10
+ handleShowCourse: (v: any) => void;
11
+ handleClickPromptWord?: (prompt: string) => void;
12
+ handleClickAskList: (item: any, operation: string, key: string, value?: string) => void;
13
+ playTTSByText: (text: string) => void;
14
+ stopTTSByText: () => void;
15
+ isVoicePlaying: boolean;
16
+ onCopyCallback?: () => void;
17
+ onLikeCallback?: () => void;
18
+ onUnLikeCallback?: () => void;
19
+ onRegenerateClick?: () => void;
20
+ enableCopy?: boolean;
21
+ enableLike?: boolean;
22
+ enableUnLike?: boolean;
23
+ enableRegenerate?: boolean;
24
+ enableVoicePlay?: boolean;
25
+ }
26
+ declare const AnswerItem: React.FC<AnswerItemProps>;
27
+ export default AnswerItem;
@@ -0,0 +1,194 @@
1
+ import React from 'react';
2
+ import styles from "./index.module.css";
3
+ import classNames from 'classnames';
4
+ import ReasoningContent from "../reasoning-content/index";
5
+ import { processString } from "../../utils/tools";
6
+ import { MMarkdown } from '@myun/gimi-design';
7
+ import AskCard from "../ask-card";
8
+ import WorkFlowContent from "../work-flow-content";
9
+ import ExcelSuccessCard from "../excel-components/ExcelSuccessCard";
10
+ import AICorrection from "../ai-correction/index";
11
+ import KnowledgeIconGroup from "../knowledge-trace/KnowledgeIconComponent";
12
+ import ExcelCard from "../excel-components/ExcelCard";
13
+ import { CheckCircleFilled } from '@ant-design/icons';
14
+ import VoicePlay from "../message-actions/VoicePlay";
15
+ import { useAppSelector } from "../../store/hooks";
16
+ import CopyButton from "../message-actions/CopyButton";
17
+ import LikeButton from "../message-actions/LikeButton";
18
+ import UnLikeButton from "../message-actions/UnLikeButton";
19
+ import RegenerateButton from "../message-actions/RegenerateButton";
20
+ var AnswerItem = function AnswerItem(_ref) {
21
+ var _agentDetail$voiceCon;
22
+ var item = _ref.item,
23
+ onSucess = _ref.onSucess,
24
+ onFailure = _ref.onFailure,
25
+ onRetry = _ref.onRetry,
26
+ showOpera = _ref.showOpera,
27
+ showCommend = _ref.showCommend,
28
+ handleShowCourse = _ref.handleShowCourse,
29
+ handleClickPromptWord = _ref.handleClickPromptWord,
30
+ handleClickAskList = _ref.handleClickAskList,
31
+ playTTSByText = _ref.playTTSByText,
32
+ stopTTSByText = _ref.stopTTSByText,
33
+ isVoicePlaying = _ref.isVoicePlaying,
34
+ onCopyCallback = _ref.onCopyCallback,
35
+ onLikeCallback = _ref.onLikeCallback,
36
+ onUnLikeCallback = _ref.onUnLikeCallback,
37
+ onRegenerateClick = _ref.onRegenerateClick,
38
+ _ref$enableCopy = _ref.enableCopy,
39
+ enableCopy = _ref$enableCopy === void 0 ? true : _ref$enableCopy,
40
+ _ref$enableLike = _ref.enableLike,
41
+ enableLike = _ref$enableLike === void 0 ? true : _ref$enableLike,
42
+ _ref$enableUnLike = _ref.enableUnLike,
43
+ enableUnLike = _ref$enableUnLike === void 0 ? true : _ref$enableUnLike,
44
+ _ref$enableRegenerate = _ref.enableRegenerate,
45
+ enableRegenerate = _ref$enableRegenerate === void 0 ? true : _ref$enableRegenerate,
46
+ _ref$enableVoicePlay = _ref.enableVoicePlay,
47
+ enableVoicePlay = _ref$enableVoicePlay === void 0 ? true : _ref$enableVoicePlay;
48
+ var isMsgRecieving = useAppSelector(function (state) {
49
+ return state.gimiMenu.isMsgRecieving;
50
+ });
51
+ var messageList = useAppSelector(function (state) {
52
+ return state.gimiMenu.messageList || [];
53
+ });
54
+ var _React$useMemo = React.useMemo(function () {
55
+ var _item$moduleInfo, _item$moduleInfo2, _messageList;
56
+ var contentStr = item.content && processString(item.content) || '';
57
+ var showContentFlag = Boolean(contentStr);
58
+ var showAskTag = item.moduleType === 'ask' || ((_item$moduleInfo = item.moduleInfo) === null || _item$moduleInfo === void 0 ? void 0 : _item$moduleInfo.moduleType) === 'ask';
59
+ var showSkillTag = item.moduleType === 'skill' || ((_item$moduleInfo2 = item.moduleInfo) === null || _item$moduleInfo2 === void 0 ? void 0 : _item$moduleInfo2.moduleType) === 'skill';
60
+ var showOperation = (showContentFlag || showSkillTag) && !showAskTag && !isMsgRecieving;
61
+ var showTaskSuccess = (contentStr === null || contentStr === void 0 ? void 0 : contentStr.indexOf('<excel>')) > -1 && !isMsgRecieving;
62
+ var showRegerate = item.id === ((_messageList = messageList[messageList.length - 1]) === null || _messageList === void 0 ? void 0 : _messageList.id);
63
+ return {
64
+ showContentFlag: showContentFlag,
65
+ showAskTag: showAskTag,
66
+ showSkillTag: showSkillTag,
67
+ showOperation: showOperation,
68
+ showTaskSuccess: showTaskSuccess,
69
+ showRegerate: showRegerate
70
+ };
71
+ }, [item.content, item.moduleType, item.moduleInfo, isMsgRecieving, messageList]),
72
+ showContentFlag = _React$useMemo.showContentFlag,
73
+ showAskTag = _React$useMemo.showAskTag,
74
+ showSkillTag = _React$useMemo.showSkillTag,
75
+ showOperation = _React$useMemo.showOperation,
76
+ showTaskSuccess = _React$useMemo.showTaskSuccess,
77
+ showRegerate = _React$useMemo.showRegerate;
78
+ var agentDetail = useAppSelector(function (state) {
79
+ return state.gimiMenu.agentObj || {};
80
+ });
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ className: styles.title
83
+ }, /*#__PURE__*/React.createElement("div", {
84
+ className: classNames(styles.answer)
85
+ }, item.mcp && /*#__PURE__*/React.createElement(WorkFlowContent, {
86
+ chatItem: item
87
+ }), item.vipLevel === 1 && item.reasoningContent && /*#__PURE__*/React.createElement(ReasoningContent, {
88
+ item: item
89
+ }), showTaskSuccess && /*#__PURE__*/React.createElement("div", {
90
+ className: styles.completed
91
+ }, /*#__PURE__*/React.createElement(CheckCircleFilled, {
92
+ className: styles.checkIcon
93
+ }), /*#__PURE__*/React.createElement("span", {
94
+ className: styles.checkText
95
+ }, "\u672C\u6B21\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF01")), showContentFlag && /*#__PURE__*/React.createElement(MMarkdown, {
96
+ content: processString(item.content || ''),
97
+ customRender: [{
98
+ type: 'excel',
99
+ component: ExcelSuccessCard
100
+ }, {
101
+ type: 'knowledge',
102
+ component: function component(value) {
103
+ var newVal = {
104
+ content: value.value,
105
+ messageId: item.id
106
+ };
107
+ return /*#__PURE__*/React.createElement(KnowledgeIconGroup, {
108
+ value: newVal
109
+ });
110
+ }
111
+ }, {
112
+ type: 'correction',
113
+ component: AICorrection
114
+ }],
115
+ showLoading: item.loading
116
+ }), showAskTag && /*#__PURE__*/React.createElement(AskCard, {
117
+ item: item,
118
+ moduleInfo: item.moduleInfo,
119
+ handleClickAskList: handleClickAskList
120
+ }), showSkillTag && /*#__PURE__*/React.createElement(ExcelCard, {
121
+ onRetry: onRetry,
122
+ item: item,
123
+ moduleInfo: item.moduleInfo,
124
+ onSucess: onSucess,
125
+ onFailure: onFailure
126
+ }), item.stop === 1 && /*#__PURE__*/React.createElement("div", {
127
+ className: styles.stop
128
+ }, item.vipLevel === 1 && item.reasoningStatus === 3 ? '已停止推理' : '已停止内容输出'), showOperation && /*#__PURE__*/React.createElement("div", {
129
+ className: styles.opera
130
+ }, (showOpera === null || showOpera === void 0 ? void 0 : showOpera(item.id)) && !item.loading && /*#__PURE__*/React.createElement("div", {
131
+ className: styles.opera_item
132
+ }, enableCopy && /*#__PURE__*/React.createElement(CopyButton, {
133
+ item: item,
134
+ onCopyCallback: onCopyCallback
135
+ }), enableLike && /*#__PURE__*/React.createElement(LikeButton, {
136
+ item: item,
137
+ onLikeCallback: onLikeCallback
138
+ }), enableUnLike && /*#__PURE__*/React.createElement(UnLikeButton, {
139
+ item: item,
140
+ onUnLikeCallback: onUnLikeCallback
141
+ }), enableVoicePlay && !showAskTag && !showSkillTag && ((_agentDetail$voiceCon = agentDetail.voiceConfigs) === null || _agentDetail$voiceCon === void 0 ? void 0 : _agentDetail$voiceCon.length) > 0 && /*#__PURE__*/React.createElement(VoicePlay, {
142
+ playTTSByText: playTTSByText,
143
+ stopTTSByText: stopTTSByText,
144
+ isVoicePlaying: isVoicePlaying,
145
+ text: processString(item.content || ''),
146
+ messageId: item.id
147
+ }), showRegerate && enableRegenerate && /*#__PURE__*/React.createElement(RegenerateButton, {
148
+ onRegenerateClick: onRegenerateClick
149
+ }))), (item.relatedResourceList || []).length > 0 && (showCommend === null || showCommend === void 0 ? void 0 : showCommend(item.id)) && /*#__PURE__*/React.createElement("div", {
150
+ className: styles.quickInputList
151
+ }, (item.relatedResourceList || []).map(function (item, index) {
152
+ return /*#__PURE__*/React.createElement("div", {
153
+ className: styles.quickInputItem,
154
+ key: index,
155
+ onClick: function onClick() {
156
+ return handleClickPromptWord === null || handleClickPromptWord === void 0 ? void 0 : handleClickPromptWord(item.recommendQuestions);
157
+ }
158
+ }, item.recommendQuestions);
159
+ })), (item.relatedCourseRecommendation || []).length > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
160
+ className: styles.course_recommend
161
+ }, /*#__PURE__*/React.createElement("div", {
162
+ className: styles.course_recommend_header
163
+ }, /*#__PURE__*/React.createElement("div", {
164
+ className: styles.course_recommend_header_title
165
+ }, "\u76F8\u5173\u8BFE\u7A0B\u63A8\u8350"), (item.relatedCourseRecommendation || []).length > 4 && /*#__PURE__*/React.createElement("div", {
166
+ className: styles.course_recommend_header_more,
167
+ onClick: function onClick() {
168
+ handleShowCourse(item);
169
+ }
170
+ }, /*#__PURE__*/React.createElement("span", {
171
+ className: styles.all
172
+ }, "\u5168\u90E8\u8BFE\u7A0B"))), /*#__PURE__*/React.createElement("div", {
173
+ className: styles.course_recommend_list
174
+ }, (item.relatedCourseRecommendation || []).map(function (course, i) {
175
+ if (i > 3) return null;
176
+ return /*#__PURE__*/React.createElement("div", {
177
+ className: styles.courseItem,
178
+ key: course.id,
179
+ onClick: function onClick() {
180
+ return window.open(course.productType === 'project' ? "/project-product/".concat(course.productId || course.id) : "/new-product/".concat(course.productId || course.id));
181
+ }
182
+ }, /*#__PURE__*/React.createElement("div", {
183
+ className: styles.cover
184
+ }, /*#__PURE__*/React.createElement("img", {
185
+ src: course.productUrl,
186
+ alt: ""
187
+ })), /*#__PURE__*/React.createElement("div", {
188
+ className: classNames(styles.courseTitle, 'ellipsis-3')
189
+ }, course !== null && course !== void 0 && course.showStyle ? /*#__PURE__*/React.createElement("span", {
190
+ className: classNames(styles.newEquityLabel, styles["newEquityLabel-".concat(course.showStyle)])
191
+ }, course === null || course === void 0 ? void 0 : course.equityLabel) : null, course.name));
192
+ }))))));
193
+ };
194
+ export default AnswerItem;
@@ -0,0 +1,266 @@
1
+ @charset "UTF-8";
2
+ .title {
3
+ width: 100%;
4
+ display: flex;
5
+ align-items: center;
6
+ position: relative;
7
+ font-size: 16px;
8
+ color: #000000;
9
+ line-height: 24px;
10
+ width: fit-content;
11
+ text-align: left;
12
+ word-break: break-all;
13
+ /* 强制换行 */
14
+ overflow-wrap: break-word;
15
+ /* 在适当位置换行 */
16
+ }
17
+ .title .qusetionOpera {
18
+ position: absolute;
19
+ top: 50%;
20
+ left: -30px;
21
+ transform: translateY(-50%);
22
+ }
23
+ .title .answer {
24
+ width: 100%;
25
+ display: flex;
26
+ flex-direction: column;
27
+ justify-content: center;
28
+ margin: 10px 0px;
29
+ }
30
+ .title .answer .completed {
31
+ display: flex;
32
+ gap: 10px;
33
+ align-items: center;
34
+ }
35
+ .title .answer .completed .checkIcon {
36
+ font-size: 16px;
37
+ color: rgb(62, 179, 86);
38
+ }
39
+ .title .answer .completed .checkText {
40
+ font-family: PingFang SC;
41
+ font-weight: 600;
42
+ font-style: Semibold;
43
+ font-size: 15px;
44
+ line-height: 180%;
45
+ letter-spacing: 0px;
46
+ color: rgb(46, 57, 76);
47
+ }
48
+ .title .answer .relevance {
49
+ width: fit-content;
50
+ height: 40px;
51
+ background: #ffffff;
52
+ border-radius: 16px;
53
+ border: 1px solid #cfd7e6;
54
+ display: flex;
55
+ justify-content: center;
56
+ align-items: center;
57
+ margin-bottom: 14px;
58
+ }
59
+ .title .answer .relevance .icon {
60
+ display: flex;
61
+ align-items: center;
62
+ justify-self: center;
63
+ margin-right: 12px;
64
+ }
65
+ .title .answer .relevance .search_icon {
66
+ display: flex;
67
+ align-items: center;
68
+ justify-self: center;
69
+ margin-left: 16px;
70
+ }
71
+ .title .answer .relevance span {
72
+ height: 20px;
73
+ font-family: PingFangSC, PingFang SC;
74
+ font-weight: 400;
75
+ font-size: 14px;
76
+ color: #2e394c;
77
+ line-height: 20px;
78
+ text-align: left;
79
+ font-style: normal;
80
+ margin: 0 2px;
81
+ }
82
+ .title .answer .stop {
83
+ width: 100%;
84
+ height: 28px;
85
+ font-family: PingFangSC, PingFang SC;
86
+ font-weight: 400;
87
+ font-size: 15px;
88
+ color: #7d91b3;
89
+ line-height: 28px;
90
+ text-align: left;
91
+ font-style: normal;
92
+ margin-top: 6px;
93
+ }
94
+
95
+ .opera {
96
+ height: 18px;
97
+ margin-top: 12px;
98
+ display: flex;
99
+ }
100
+ .opera .opera_item {
101
+ display: flex;
102
+ align-items: center;
103
+ gap: 18px;
104
+ }
105
+ .opera .opera_item .unlove {
106
+ display: flex;
107
+ align-items: center;
108
+ cursor: pointer;
109
+ user-select: none;
110
+ }
111
+
112
+ .operaicon {
113
+ height: 20px;
114
+ margin-top: 12px;
115
+ text-align: end;
116
+ }
117
+
118
+ .chatline {
119
+ width: 100%;
120
+ margin: 40px 0;
121
+ height: 1px;
122
+ background: #dfe8f7;
123
+ }
124
+
125
+ .course_recommend {
126
+ width: 100%;
127
+ margin-top: 20px;
128
+ }
129
+ .course_recommend .course_recommend_header {
130
+ width: 100%;
131
+ height: 28px;
132
+ display: flex;
133
+ align-items: center;
134
+ justify-content: space-between;
135
+ }
136
+ .course_recommend .course_recommend_header .course_recommend_header_title {
137
+ font-family: PingFangSC, PingFang SC;
138
+ font-weight: 600;
139
+ font-size: 18px;
140
+ color: #2e394c;
141
+ line-height: 28px;
142
+ text-align: left;
143
+ font-style: normal;
144
+ }
145
+ .course_recommend .course_recommend_header .course_recommend_header_more {
146
+ display: flex;
147
+ align-items: center;
148
+ }
149
+ .course_recommend .course_recommend_header .course_recommend_header_more .all {
150
+ width: 56px;
151
+ height: 20px;
152
+ font-family: PingFangSC, PingFang SC;
153
+ font-weight: 500;
154
+ font-size: 14px;
155
+ color: #2e394c;
156
+ line-height: 20px;
157
+ text-align: left;
158
+ font-style: normal;
159
+ }
160
+ .course_recommend .course_recommend_list {
161
+ margin-top: 12px;
162
+ display: flex;
163
+ flex-wrap: wrap;
164
+ gap: 20px 0;
165
+ }
166
+ .course_recommend .course_recommend_list .courseItem {
167
+ flex: 1 1 clamp(180px, 48%, 360px);
168
+ max-width: clamp(180px, 48%, 360px);
169
+ height: 68px;
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: space-between;
173
+ }
174
+ .course_recommend .course_recommend_list .courseItem .cover {
175
+ border-radius: 4px;
176
+ overflow: hidden;
177
+ width: 120px;
178
+ height: 68px;
179
+ border-radius: 4px;
180
+ }
181
+ .course_recommend .course_recommend_list .courseItem .cover img {
182
+ width: 100%;
183
+ height: 100%;
184
+ object-fit: cover;
185
+ }
186
+ .course_recommend .course_recommend_list .courseItem .courseTitle {
187
+ flex: 1 1 auto;
188
+ height: 68px;
189
+ font-family: PingFangSC, PingFang SC;
190
+ font-weight: 400;
191
+ font-size: 14px;
192
+ color: #2e394c;
193
+ text-align: left;
194
+ font-style: normal;
195
+ display: -webkit-box;
196
+ -webkit-line-clamp: 3;
197
+ /* 限制行数 */
198
+ -webkit-box-orient: vertical;
199
+ overflow: hidden;
200
+ text-overflow: ellipsis;
201
+ margin-left: 20px;
202
+ }
203
+ .course_recommend .course_recommend_list .courseItem .courseTitle .newEquityLabel {
204
+ display: inline-block !important;
205
+ margin-right: 8px;
206
+ padding: 0 4px;
207
+ color: #e68845;
208
+ font-size: 10px;
209
+ font-weight: 600;
210
+ line-height: 18px;
211
+ border-radius: 4px;
212
+ background: #ffecd9;
213
+ position: relative;
214
+ bottom: 2px;
215
+ }
216
+ .course_recommend .course_recommend_list .courseItem .courseTitle .newEquityLabel-1 {
217
+ color: #3d996b;
218
+ background: #ccffe6;
219
+ }
220
+ .course_recommend .course_recommend_list .courseItem .courseTitle .newEquityLabel-3 {
221
+ color: #fff;
222
+ background: #7d91b3;
223
+ }
224
+ .course_recommend .course_recommend_list .courseItem:nth-child(2n) {
225
+ margin-left: 40px;
226
+ }
227
+
228
+ .quickInputList {
229
+ max-width: min(800px, 90vw);
230
+ display: flex;
231
+ gap: 12px;
232
+ flex-wrap: wrap;
233
+ flex-direction: column;
234
+ align-items: flex-start;
235
+ margin-top: 20px;
236
+ }
237
+ .quickInputList .quickInputItem {
238
+ padding: 5px 10px;
239
+ font-family: PingFangSC, PingFang SC;
240
+ font-weight: 400;
241
+ font-size: 14px;
242
+ color: rgb(46, 57, 76);
243
+ line-height: 18px;
244
+ text-align: left;
245
+ font-style: normal;
246
+ border-radius: 8px;
247
+ border: 1px solid rgb(217, 220, 229);
248
+ cursor: pointer;
249
+ display: inline;
250
+ white-space: nowrap;
251
+ /* 禁止换行 */
252
+ overflow: hidden;
253
+ /* 隐藏溢出内容 */
254
+ text-overflow: ellipsis;
255
+ /* 显示省略号 */
256
+ /* 如果需要可以添加最大宽度 */
257
+ white-space: normal;
258
+ }
259
+
260
+ .fileBox {
261
+ border-radius: 16px;
262
+ border: 1px solid var(---, #e9ebf2);
263
+ background: linear-gradient(180deg, #f7fff9 0%, #f1fcfe 30%, #fff 100%);
264
+ box-shadow: 0 2px 2px 0 #fff inset;
265
+ padding: 20px;
266
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IChatMessageItem } from '../../interfaces/chatMessage';
3
+ interface IProps {
4
+ item: IChatMessageItem;
5
+ moduleInfo: any;
6
+ handleClickAskList: (item: any, operation: string, key: string, value?: string) => void;
7
+ onAskCardCallback?: () => void;
8
+ }
9
+ declare const AskCard: ({ item, moduleInfo, handleClickAskList, onAskCardCallback }: IProps) => React.JSX.Element;
10
+ export default AskCard;
@@ -0,0 +1,76 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React from 'react';
8
+ import styles from "./index.module.css";
9
+ import { MMarkdown } from '@myun/gimi-design';
10
+ import classNames from 'classnames';
11
+ import FileUpload from "../file-upload";
12
+ var AskCard = function AskCard(_ref) {
13
+ var item = _ref.item,
14
+ moduleInfo = _ref.moduleInfo,
15
+ handleClickAskList = _ref.handleClickAskList,
16
+ onAskCardCallback = _ref.onAskCardCallback;
17
+ var _React$useMemo = React.useMemo(function () {
18
+ var _detailInfo$questionC;
19
+ var detailInfo = moduleInfo.data.results.askShowInfo;
20
+ var optionsList = Object.entries(detailInfo.options).map(function (_ref2) {
21
+ var _ref3 = _slicedToArray(_ref2, 2),
22
+ key = _ref3[0],
23
+ value = _ref3[1];
24
+ return {
25
+ key: key,
26
+ value: value
27
+ };
28
+ });
29
+ var questionContent = (_detailInfo$questionC = detailInfo.questionContent) === null || _detailInfo$questionC === void 0 ? void 0 : _detailInfo$questionC.replace(/\n/g, '\n');
30
+ return {
31
+ detailInfo: detailInfo,
32
+ optionsList: optionsList,
33
+ questionContent: questionContent
34
+ };
35
+ }, [moduleInfo, handleClickAskList]),
36
+ detailInfo = _React$useMemo.detailInfo,
37
+ optionsList = _React$useMemo.optionsList,
38
+ questionContent = _React$useMemo.questionContent;
39
+ var optionRender = function optionRender(v) {
40
+ return /*#__PURE__*/React.createElement("span", null, v.value ? v.value : v.key);
41
+ };
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ className: styles.askList
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: styles.askQuestion,
46
+ style: detailInfo.answerType === 1 || detailInfo.uploadFile ? {
47
+ marginBottom: 12
48
+ } : {
49
+ marginBottom: 0
50
+ }
51
+ }, /*#__PURE__*/React.createElement(MMarkdown, {
52
+ content: questionContent,
53
+ id: item.id
54
+ })), detailInfo.answerType === 1 && (optionsList === null || optionsList === void 0 ? void 0 : optionsList.map(function (v) {
55
+ return /*#__PURE__*/React.createElement("div", {
56
+ className: classNames(styles.askItem, detailInfo.answerType === 0 || item.selectValue ? styles.disablebox : ''),
57
+ key: v.key,
58
+ onClick: function onClick() {
59
+ return handleClickAskList(moduleInfo, 'click', v.key, v.value || v.key);
60
+ }
61
+ }, optionRender(v));
62
+ })), detailInfo.uploadFile && detailInfo.answerType === 0 && /*#__PURE__*/React.createElement("div", {
63
+ className: classNames(styles.showUpload, item.disableUploadFile ? styles.disableFile : ''),
64
+ onClick: function onClick() {
65
+ return onAskCardCallback === null || onAskCardCallback === void 0 ? void 0 : onAskCardCallback();
66
+ }
67
+ }, /*#__PURE__*/React.createElement(FileUpload, {
68
+ disabled: item.disableUploadFile
69
+ }, /*#__PURE__*/React.createElement("div", {
70
+ className: classNames(styles.uploadIcon)
71
+ }, /*#__PURE__*/React.createElement("img", {
72
+ src: item.disableUploadFile ? 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/19/b1e04_20250919162201.png' : 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/11/83ad4_20250911153220.png',
73
+ alt: ""
74
+ }), "\u6587\u4EF6\u4E0A\u4F20"))));
75
+ };
76
+ export default AskCard;