@myun/gimi-chat 0.0.5 → 0.0.7

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 (49) hide show
  1. package/dist/components/ai-chat-dialogue/index.js +181 -135
  2. package/dist/components/ai-correction/index.js +38 -25
  3. package/dist/components/ai-loading/index.js +12 -8
  4. package/dist/components/answer-item/index.js +135 -113
  5. package/dist/components/ask-card/index.js +42 -33
  6. package/dist/components/chat-input/index.js +135 -114
  7. package/dist/components/chat-voice/VoiceCommunication.js +23 -21
  8. package/dist/components/chat-voice/VoiceRecord.js +24 -21
  9. package/dist/components/conversation-delete/index.js +10 -8
  10. package/dist/components/dots-loading/index.js +10 -7
  11. package/dist/components/empty/index.js +12 -7
  12. package/dist/components/excel-components/ExcelCard.js +7 -3
  13. package/dist/components/excel-components/ExcelExcuting.js +60 -43
  14. package/dist/components/excel-components/ExcelFailCard.js +15 -10
  15. package/dist/components/excel-components/ExcelSuccessCard.js +3 -2
  16. package/dist/components/file-card/fileCardSidebar.js +23 -16
  17. package/dist/components/file-card/index.js +68 -49
  18. package/dist/components/file-preview/index.js +36 -29
  19. package/dist/components/file-upload/index.js +10 -7
  20. package/dist/components/file-upload/uploadV1.js +33 -27
  21. package/dist/components/gimi-sidebar/index.js +20 -13
  22. package/dist/components/header/index.js +18 -11
  23. package/dist/components/iconfont-com/index.js +2 -1
  24. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +28 -22
  25. package/dist/components/knowledge-trace/classList.js +37 -28
  26. package/dist/components/knowledge-trace/documentList.js +36 -27
  27. package/dist/components/knowledge-trace/index.js +28 -21
  28. package/dist/components/knowledge-trace/videoList.js +46 -36
  29. package/dist/components/lottie-img/index.js +10 -8
  30. package/dist/components/message-actions/CopyButton.js +25 -22
  31. package/dist/components/message-actions/LikeButton.js +25 -22
  32. package/dist/components/message-actions/RegenerateButton.js +21 -18
  33. package/dist/components/message-actions/UnLikeButton.js +25 -22
  34. package/dist/components/message-actions/VoicePlay.js +25 -22
  35. package/dist/components/message-list/index.js +85 -72
  36. package/dist/components/no-microphone-root/index.js +39 -29
  37. package/dist/components/preset-agent-content/index.js +20 -15
  38. package/dist/components/reasoning-content/index.js +55 -42
  39. package/dist/components/reference-content/index.js +72 -63
  40. package/dist/components/templates/CommonChat.js +78 -64
  41. package/dist/components/templates/GimiChatComponent.js +13 -6
  42. package/dist/components/templates/demo/demo.js +104 -102
  43. package/dist/components/upload-list/index.js +56 -41
  44. package/dist/components/voice-bars/index.js +22 -19
  45. package/dist/components/voice-check-dialog/index.js +24 -17
  46. package/dist/components/voice-recording/index.js +57 -42
  47. package/dist/components/work-flow-content/demo.js +2 -1
  48. package/dist/components/work-flow-content/index.js +12 -9
  49. package/package.json +8 -7
@@ -10,13 +10,16 @@ import ExcelSuccessCard from "../excel-components/ExcelSuccessCard";
10
10
  import AICorrection from "../ai-correction/index";
11
11
  import KnowledgeIconGroup from "../knowledge-trace/KnowledgeIconComponent";
12
12
  import ExcelCard from "../excel-components/ExcelCard";
13
- import { CheckCircleFilled } from '@ant-design/icons';
13
+ import { IconTickCircle } from '@douyinfe/semi-icons';
14
14
  import VoicePlay from "../message-actions/VoicePlay";
15
15
  import { useAppSelector } from "../../store/hooks";
16
16
  import CopyButton from "../message-actions/CopyButton";
17
17
  import LikeButton from "../message-actions/LikeButton";
18
18
  import UnLikeButton from "../message-actions/UnLikeButton";
19
19
  import RegenerateButton from "../message-actions/RegenerateButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { Fragment as _Fragment } from "react/jsx-runtime";
20
23
  var AnswerItem = function AnswerItem(_ref) {
21
24
  var _agentDetail$voiceCon;
22
25
  var item = _ref.item,
@@ -78,117 +81,136 @@ var AnswerItem = function AnswerItem(_ref) {
78
81
  var agentDetail = useAppSelector(function (state) {
79
82
  return state.gimiMenu.agentObj || {};
80
83
  });
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
- }))))));
84
+ return /*#__PURE__*/_jsx("div", {
85
+ className: styles.title,
86
+ children: /*#__PURE__*/_jsxs("div", {
87
+ className: classNames(styles.answer),
88
+ children: [item.mcp && /*#__PURE__*/_jsx(WorkFlowContent, {
89
+ chatItem: item
90
+ }), item.vipLevel === 1 && item.reasoningContent && /*#__PURE__*/_jsx(ReasoningContent, {
91
+ item: item
92
+ }), showTaskSuccess && /*#__PURE__*/_jsxs("div", {
93
+ className: styles.completed,
94
+ children: [/*#__PURE__*/_jsx(IconTickCircle, {
95
+ className: styles.checkIcon
96
+ }), /*#__PURE__*/_jsx("span", {
97
+ className: styles.checkText,
98
+ children: "\u672C\u6B21\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF01"
99
+ })]
100
+ }), showContentFlag && /*#__PURE__*/_jsx(MMarkdown, {
101
+ content: processString(item.content || ''),
102
+ customRender: [{
103
+ type: 'excel',
104
+ component: ExcelSuccessCard
105
+ }, {
106
+ type: 'knowledge',
107
+ component: function component(value) {
108
+ var newVal = {
109
+ content: value.value,
110
+ messageId: item.id
111
+ };
112
+ return /*#__PURE__*/_jsx(KnowledgeIconGroup, {
113
+ value: newVal
114
+ });
115
+ }
116
+ }, {
117
+ type: 'correction',
118
+ component: AICorrection
119
+ }],
120
+ showLoading: item.loading
121
+ }), showAskTag && /*#__PURE__*/_jsx(AskCard, {
122
+ item: item,
123
+ moduleInfo: item.moduleInfo,
124
+ handleClickAskList: handleClickAskList
125
+ }), showSkillTag && /*#__PURE__*/_jsx(ExcelCard, {
126
+ onRetry: onRetry,
127
+ item: item,
128
+ moduleInfo: item.moduleInfo,
129
+ onSucess: onSucess,
130
+ onFailure: onFailure
131
+ }), item.stop === 1 && /*#__PURE__*/_jsx("div", {
132
+ className: styles.stop,
133
+ children: item.vipLevel === 1 && item.reasoningStatus === 3 ? '已停止推理' : '已停止内容输出'
134
+ }), showOperation && /*#__PURE__*/_jsx("div", {
135
+ className: styles.opera,
136
+ children: (showOpera === null || showOpera === void 0 ? void 0 : showOpera(item.id)) && !item.loading && /*#__PURE__*/_jsxs("div", {
137
+ className: styles.opera_item,
138
+ children: [enableCopy && /*#__PURE__*/_jsx(CopyButton, {
139
+ item: item,
140
+ onCopyCallback: onCopyCallback
141
+ }), enableLike && /*#__PURE__*/_jsx(LikeButton, {
142
+ item: item,
143
+ onLikeCallback: onLikeCallback
144
+ }), enableUnLike && /*#__PURE__*/_jsx(UnLikeButton, {
145
+ item: item,
146
+ onUnLikeCallback: onUnLikeCallback
147
+ }), enableVoicePlay && !showAskTag && !showSkillTag && ((_agentDetail$voiceCon = agentDetail.voiceConfigs) === null || _agentDetail$voiceCon === void 0 ? void 0 : _agentDetail$voiceCon.length) > 0 && /*#__PURE__*/_jsx(VoicePlay, {
148
+ playTTSByText: playTTSByText,
149
+ stopTTSByText: stopTTSByText,
150
+ isVoicePlaying: isVoicePlaying,
151
+ text: processString(item.content || ''),
152
+ messageId: item.id
153
+ }), showRegerate && enableRegenerate && /*#__PURE__*/_jsx(RegenerateButton, {
154
+ onRegenerateClick: onRegenerateClick
155
+ })]
156
+ })
157
+ }), (item.relatedResourceList || []).length > 0 && (showCommend === null || showCommend === void 0 ? void 0 : showCommend(item.id)) && /*#__PURE__*/_jsx("div", {
158
+ className: styles.quickInputList,
159
+ children: (item.relatedResourceList || []).map(function (item, index) {
160
+ return /*#__PURE__*/_jsx("div", {
161
+ className: styles.quickInputItem,
162
+ onClick: function onClick() {
163
+ return handleClickPromptWord === null || handleClickPromptWord === void 0 ? void 0 : handleClickPromptWord(item.recommendQuestions);
164
+ },
165
+ children: item.recommendQuestions
166
+ }, index);
167
+ })
168
+ }), (item.relatedCourseRecommendation || []).length > 0 && /*#__PURE__*/_jsx(_Fragment, {
169
+ children: /*#__PURE__*/_jsxs("div", {
170
+ className: styles.course_recommend,
171
+ children: [/*#__PURE__*/_jsxs("div", {
172
+ className: styles.course_recommend_header,
173
+ children: [/*#__PURE__*/_jsx("div", {
174
+ className: styles.course_recommend_header_title,
175
+ children: "\u76F8\u5173\u8BFE\u7A0B\u63A8\u8350"
176
+ }), (item.relatedCourseRecommendation || []).length > 4 && /*#__PURE__*/_jsx("div", {
177
+ className: styles.course_recommend_header_more,
178
+ onClick: function onClick() {
179
+ handleShowCourse(item);
180
+ },
181
+ children: /*#__PURE__*/_jsx("span", {
182
+ className: styles.all,
183
+ children: "\u5168\u90E8\u8BFE\u7A0B"
184
+ })
185
+ })]
186
+ }), /*#__PURE__*/_jsx("div", {
187
+ className: styles.course_recommend_list,
188
+ children: (item.relatedCourseRecommendation || []).map(function (course, i) {
189
+ if (i > 3) return null;
190
+ return /*#__PURE__*/_jsxs("div", {
191
+ className: styles.courseItem,
192
+ onClick: function onClick() {
193
+ return window.open(course.productType === 'project' ? "/project-product/".concat(course.productId || course.id) : "/new-product/".concat(course.productId || course.id));
194
+ },
195
+ children: [/*#__PURE__*/_jsx("div", {
196
+ className: styles.cover,
197
+ children: /*#__PURE__*/_jsx("img", {
198
+ src: course.productUrl,
199
+ alt: ""
200
+ })
201
+ }), /*#__PURE__*/_jsxs("div", {
202
+ className: classNames(styles.courseTitle, 'ellipsis-3'),
203
+ children: [course !== null && course !== void 0 && course.showStyle ? /*#__PURE__*/_jsx("span", {
204
+ className: classNames(styles.newEquityLabel, styles["newEquityLabel-".concat(course.showStyle)]),
205
+ children: course === null || course === void 0 ? void 0 : course.equityLabel
206
+ }) : null, course.name]
207
+ })]
208
+ }, course.id);
209
+ })
210
+ })]
211
+ })
212
+ })]
213
+ })
214
+ });
193
215
  };
194
216
  export default AnswerItem;
@@ -9,6 +9,8 @@ import styles from "./index.module.css";
9
9
  import { MMarkdown } from '@myun/gimi-design';
10
10
  import classNames from 'classnames';
11
11
  import FileUpload from "../file-upload";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
14
  var AskCard = function AskCard(_ref) {
13
15
  var item = _ref.item,
14
16
  moduleInfo = _ref.moduleInfo,
@@ -37,40 +39,47 @@ var AskCard = function AskCard(_ref) {
37
39
  optionsList = _React$useMemo.optionsList,
38
40
  questionContent = _React$useMemo.questionContent;
39
41
  var optionRender = function optionRender(v) {
40
- return /*#__PURE__*/React.createElement("span", null, v.value ? v.value : v.key);
42
+ return /*#__PURE__*/_jsx("span", {
43
+ children: v.value ? v.value : v.key
44
+ });
41
45
  };
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,
46
+ return /*#__PURE__*/_jsxs("div", {
47
+ className: styles.askList,
48
+ children: [/*#__PURE__*/_jsx("div", {
49
+ className: styles.askQuestion,
50
+ style: detailInfo.answerType === 1 || detailInfo.uploadFile ? {
51
+ marginBottom: 12
52
+ } : {
53
+ marginBottom: 0
54
+ },
55
+ children: /*#__PURE__*/_jsx(MMarkdown, {
56
+ content: questionContent,
57
+ id: item.id
58
+ })
59
+ }), detailInfo.answerType === 1 && (optionsList === null || optionsList === void 0 ? void 0 : optionsList.map(function (v) {
60
+ return /*#__PURE__*/_jsx("div", {
61
+ className: classNames(styles.askItem, detailInfo.answerType === 0 || item.selectValue ? styles.disablebox : ''),
62
+ onClick: function onClick() {
63
+ return handleClickAskList(moduleInfo, 'click', v.key, v.value || v.key);
64
+ },
65
+ children: optionRender(v)
66
+ }, v.key);
67
+ })), detailInfo.uploadFile && detailInfo.answerType === 0 && /*#__PURE__*/_jsx("div", {
68
+ className: classNames(styles.showUpload, item.disableUploadFile ? styles.disableFile : ''),
58
69
  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"))));
70
+ return onAskCardCallback === null || onAskCardCallback === void 0 ? void 0 : onAskCardCallback();
71
+ },
72
+ children: /*#__PURE__*/_jsx(FileUpload, {
73
+ disabled: item.disableUploadFile,
74
+ children: /*#__PURE__*/_jsxs("div", {
75
+ className: classNames(styles.uploadIcon),
76
+ children: [/*#__PURE__*/_jsx("img", {
77
+ 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',
78
+ alt: ""
79
+ }), "\u6587\u4EF6\u4E0A\u4F20"]
80
+ })
81
+ })
82
+ })]
83
+ });
75
84
  };
76
85
  export default AskCard;