@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.
- package/dist/components/ai-chat-dialogue/index.js +181 -135
- package/dist/components/ai-correction/index.js +38 -25
- package/dist/components/ai-loading/index.js +12 -8
- package/dist/components/answer-item/index.js +135 -113
- package/dist/components/ask-card/index.js +42 -33
- package/dist/components/chat-input/index.js +135 -114
- package/dist/components/chat-voice/VoiceCommunication.js +23 -21
- package/dist/components/chat-voice/VoiceRecord.js +24 -21
- package/dist/components/conversation-delete/index.js +10 -8
- package/dist/components/dots-loading/index.js +10 -7
- package/dist/components/empty/index.js +12 -7
- package/dist/components/excel-components/ExcelCard.js +7 -3
- package/dist/components/excel-components/ExcelExcuting.js +60 -43
- package/dist/components/excel-components/ExcelFailCard.js +15 -10
- package/dist/components/excel-components/ExcelSuccessCard.js +3 -2
- package/dist/components/file-card/fileCardSidebar.js +23 -16
- package/dist/components/file-card/index.js +68 -49
- package/dist/components/file-preview/index.js +36 -29
- package/dist/components/file-upload/index.js +10 -7
- package/dist/components/file-upload/uploadV1.js +33 -27
- package/dist/components/gimi-sidebar/index.js +20 -13
- package/dist/components/header/index.js +18 -11
- package/dist/components/iconfont-com/index.js +2 -1
- package/dist/components/knowledge-trace/KnowledgeIconComponent.js +28 -22
- package/dist/components/knowledge-trace/classList.js +37 -28
- package/dist/components/knowledge-trace/documentList.js +36 -27
- package/dist/components/knowledge-trace/index.js +28 -21
- package/dist/components/knowledge-trace/videoList.js +46 -36
- package/dist/components/lottie-img/index.js +10 -8
- package/dist/components/message-actions/CopyButton.js +25 -22
- package/dist/components/message-actions/LikeButton.js +25 -22
- package/dist/components/message-actions/RegenerateButton.js +21 -18
- package/dist/components/message-actions/UnLikeButton.js +25 -22
- package/dist/components/message-actions/VoicePlay.js +25 -22
- package/dist/components/message-list/index.js +85 -72
- package/dist/components/no-microphone-root/index.js +39 -29
- package/dist/components/preset-agent-content/index.js +20 -15
- package/dist/components/reasoning-content/index.js +55 -42
- package/dist/components/reference-content/index.js +72 -63
- package/dist/components/templates/CommonChat.js +78 -64
- package/dist/components/templates/GimiChatComponent.js +13 -6
- package/dist/components/templates/demo/demo.js +104 -102
- package/dist/components/upload-list/index.js +56 -41
- package/dist/components/voice-bars/index.js +22 -19
- package/dist/components/voice-check-dialog/index.js +24 -17
- package/dist/components/voice-recording/index.js +57 -42
- package/dist/components/work-flow-content/demo.js +2 -1
- package/dist/components/work-flow-content/index.js +12 -9
- 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 {
|
|
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__*/
|
|
82
|
-
className: styles.title
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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__*/
|
|
42
|
+
return /*#__PURE__*/_jsx("span", {
|
|
43
|
+
children: v.value ? v.value : v.key
|
|
44
|
+
});
|
|
41
45
|
};
|
|
42
|
-
return /*#__PURE__*/
|
|
43
|
-
className: styles.askList
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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;
|