@myun/gimi-chat 0.0.5 → 0.0.6
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 +6 -5
|
@@ -36,7 +36,9 @@ import { createPortal } from 'react-dom';
|
|
|
36
36
|
import { useDispatch } from 'react-redux';
|
|
37
37
|
|
|
38
38
|
// 2. 定义组件完整的 Props 接口
|
|
39
|
-
|
|
39
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
40
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
41
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
40
42
|
var AiExplain = /*#__PURE__*/forwardRef(function (_ref) {
|
|
41
43
|
var paper = _ref.paper,
|
|
42
44
|
setSpeech = _ref.setSpeech,
|
|
@@ -105,59 +107,81 @@ var AiExplain = /*#__PURE__*/forwardRef(function (_ref) {
|
|
|
105
107
|
var unsupportedShownRef = useRef(false);
|
|
106
108
|
var renderStatus = useMemo(function () {
|
|
107
109
|
if (!audioEnabled) {
|
|
108
|
-
if (isThinking) return /*#__PURE__*/
|
|
109
|
-
className: styles.statusText
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
if (isThinking) return /*#__PURE__*/_jsxs("div", {
|
|
111
|
+
className: styles.statusText,
|
|
112
|
+
children: ['你已静音(正在思考中)', " "]
|
|
113
|
+
});
|
|
114
|
+
return /*#__PURE__*/_jsx("div", {
|
|
115
|
+
className: styles.statusText,
|
|
116
|
+
children: '你已静音'
|
|
117
|
+
});
|
|
114
118
|
}
|
|
115
119
|
switch (status) {
|
|
116
120
|
case 0:
|
|
117
|
-
return /*#__PURE__*/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
122
|
+
children: [/*#__PURE__*/_jsx(LottieImg, {
|
|
123
|
+
name: "aiLoading",
|
|
124
|
+
size: [30, 50]
|
|
125
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
126
|
+
className: styles.statusText,
|
|
127
|
+
children: "\u6B63\u5728\u8FDE\u63A5"
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
123
130
|
case 1:
|
|
124
131
|
case 6:
|
|
125
|
-
return /*#__PURE__*/
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
133
|
+
children: [/*#__PURE__*/_jsx(LottieImg, {
|
|
134
|
+
name: "aiOutputLoading",
|
|
135
|
+
size: [34, 60]
|
|
136
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
137
|
+
className: styles.statusText,
|
|
138
|
+
children: "\u6B63\u5728\u8046\u542C"
|
|
139
|
+
})]
|
|
140
|
+
});
|
|
131
141
|
case 2:
|
|
132
|
-
return /*#__PURE__*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
143
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
144
|
+
className: styles.statusImg,
|
|
145
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
146
|
+
className: styles.iconOutside,
|
|
147
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
148
|
+
className: styles.iconInside
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
152
|
+
className: styles.statusText,
|
|
153
|
+
children: "\u8BF4\u8BDD\u6216\u70B9\u51FB\u53EF\u4EE5\u6253\u65AD\u6211"
|
|
154
|
+
})]
|
|
155
|
+
});
|
|
141
156
|
case 4:
|
|
142
157
|
// 网络错误状态打断TextLoading
|
|
143
158
|
setIsTextLoading(false);
|
|
144
|
-
return /*#__PURE__*/
|
|
145
|
-
|
|
146
|
-
|
|
159
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
160
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
161
|
+
className: classNames(styles.statusText, styles.danger, styles.pointer),
|
|
162
|
+
children: "\u70B9\u51FB\u91CD\u65B0\u8FDE\u63A5"
|
|
163
|
+
})
|
|
164
|
+
});
|
|
147
165
|
case 5:
|
|
148
|
-
return /*#__PURE__*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
166
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
167
|
+
children: [/*#__PURE__*/_jsx(LottieImg, {
|
|
168
|
+
name: "aiOutputLoading",
|
|
169
|
+
size: [34, 60]
|
|
170
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
171
|
+
className: styles.statusText,
|
|
172
|
+
children: "\u4F60\u53EF\u4EE5\u5F00\u59CB\u8BF4\u8BDD"
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
154
175
|
case 7:
|
|
155
|
-
return /*#__PURE__*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
176
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
177
|
+
children: [/*#__PURE__*/_jsx(LottieImg, {
|
|
178
|
+
name: "aiOutputLoading",
|
|
179
|
+
size: [34, 60]
|
|
180
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
181
|
+
className: styles.statusText,
|
|
182
|
+
children: "\u6B63\u5728\u601D\u8003"
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
161
185
|
default:
|
|
162
186
|
return null;
|
|
163
187
|
}
|
|
@@ -960,97 +984,119 @@ var AiExplain = /*#__PURE__*/forwardRef(function (_ref) {
|
|
|
960
984
|
clearTimeout(timer.current);
|
|
961
985
|
};
|
|
962
986
|
}, []);
|
|
963
|
-
return /*#__PURE__*/createPortal( /*#__PURE__*/
|
|
964
|
-
className: styles.aiChat
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
987
|
+
return /*#__PURE__*/createPortal( /*#__PURE__*/_jsxs("div", {
|
|
988
|
+
className: styles.aiChat,
|
|
989
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
990
|
+
className: styles.bgImg,
|
|
991
|
+
children: /*#__PURE__*/_jsx(LottieImg, {
|
|
992
|
+
name: "aiBg",
|
|
993
|
+
size: ['100%', '100%']
|
|
994
|
+
})
|
|
995
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
996
|
+
placement: "bottomRight",
|
|
997
|
+
overlayClassName: "out-tooltip ai-chat-tooltip",
|
|
998
|
+
visible: isFirstUse,
|
|
999
|
+
title: showCaptions ? '点击可关闭字幕' : '点击可开启字幕',
|
|
1000
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
1001
|
+
className: styles.rightWrap,
|
|
1002
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
1003
|
+
placement: "bottom",
|
|
1004
|
+
title: showCaptions ? '关闭字幕' : '打开字幕',
|
|
1005
|
+
overlayClassName: "ai-chat-tooltip",
|
|
1006
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
1007
|
+
className: styles.iconWrap,
|
|
1008
|
+
children: /*#__PURE__*/_jsx(IconFontCom, {
|
|
1009
|
+
type: !showCaptions ? 'icon-a-tongyong-zhankaibeifen1' : 'icon-tongyong-zhankaibeifen1',
|
|
1010
|
+
size: 20,
|
|
1011
|
+
extraStyle: {
|
|
1012
|
+
cursor: 'pointer'
|
|
1013
|
+
},
|
|
1014
|
+
onClick: function onClick() {
|
|
1015
|
+
return setShowCaptions(!showCaptions);
|
|
1016
|
+
}
|
|
1017
|
+
})
|
|
1018
|
+
})
|
|
1019
|
+
})
|
|
1020
|
+
})
|
|
1021
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
1022
|
+
className: classNames(styles.main),
|
|
1023
|
+
children: [/*#__PURE__*/_jsx(Header, {
|
|
1024
|
+
title: headerTitle
|
|
1025
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
1026
|
+
className: classNames(styles.content, 'scrollBar'),
|
|
1027
|
+
ref: containerRef,
|
|
1028
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
1029
|
+
className: styles.container,
|
|
1030
|
+
children: showCaptions ? status === 5 || status === 6 ? /*#__PURE__*/_jsx("div", {
|
|
1031
|
+
className: styles.tips,
|
|
1032
|
+
children: status === 5 ? '请说话' : '正在听...'
|
|
1033
|
+
}) : /*#__PURE__*/_jsxs("div", {
|
|
1034
|
+
children: [messageList.map(function (item) {
|
|
1035
|
+
return /*#__PURE__*/_jsx("div", {
|
|
1036
|
+
className: classNames(styles.item, _defineProperty({}, styles.answer, item.type === 'answer')),
|
|
1037
|
+
children: item.content
|
|
1038
|
+
}, item.id);
|
|
1039
|
+
}), isTextLoading ? /*#__PURE__*/_jsx(Spin, {}) : null]
|
|
1040
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
1041
|
+
className: styles.voiceWrap,
|
|
1042
|
+
children: /*#__PURE__*/_jsx(LottieImg, {
|
|
1043
|
+
name: status === 2 ? 'aiOutputStrengthen' : 'aiOutputNormal',
|
|
1044
|
+
size: [242, 235]
|
|
1045
|
+
})
|
|
1046
|
+
})
|
|
1047
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
1048
|
+
className: styles.bottom,
|
|
1049
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
1050
|
+
className: classNames(styles.status, _defineProperty({}, styles.pointer, status === 2)),
|
|
1051
|
+
onClick: clickInterrupt,
|
|
1052
|
+
children: renderStatus
|
|
1053
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
1054
|
+
className: styles.btnWrap,
|
|
1055
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
1056
|
+
placement: "top",
|
|
1057
|
+
visible: isFirstUse,
|
|
1058
|
+
title: audioEnabled ? '关闭麦克风' : '打开麦克风',
|
|
1059
|
+
overlayClassName: "ai-chat-tooltip",
|
|
1060
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
1061
|
+
placement: "top",
|
|
1062
|
+
title: audioEnabled ? '关闭麦克风' : '打开麦克风',
|
|
1063
|
+
overlayClassName: "ai-chat-tooltip",
|
|
1064
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
1065
|
+
className: classNames(styles.btnItem, isDisable ? styles.disable : ''),
|
|
1066
|
+
onClick: function onClick() {
|
|
1067
|
+
return handleVoice();
|
|
1068
|
+
},
|
|
1069
|
+
children: /*#__PURE__*/_jsx(IconFontCom, {
|
|
1070
|
+
type: audioEnabled ? 'icon-voice' : 'icon-a-voice1',
|
|
1071
|
+
size: 34
|
|
1072
|
+
})
|
|
1073
|
+
})
|
|
1074
|
+
})
|
|
1075
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
1076
|
+
placement: "top",
|
|
1077
|
+
visible: isFirstUse,
|
|
1078
|
+
title: '挂断电话',
|
|
1079
|
+
overlayClassName: "ai-chat-tooltip",
|
|
1080
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
1081
|
+
placement: "top",
|
|
1082
|
+
title: '挂断电话',
|
|
1083
|
+
overlayClassName: "ai-chat-tooltip",
|
|
1084
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
1085
|
+
className: styles.btnItem,
|
|
1086
|
+
onClick: function onClick() {
|
|
1087
|
+
return handleBack();
|
|
1088
|
+
},
|
|
1089
|
+
children: /*#__PURE__*/_jsx(IconFontCom, {
|
|
1090
|
+
type: "icon-a-mti-guaduanshi",
|
|
1091
|
+
size: 34
|
|
1092
|
+
})
|
|
1093
|
+
})
|
|
1094
|
+
})
|
|
1095
|
+
})]
|
|
1096
|
+
})]
|
|
1097
|
+
})]
|
|
1098
|
+
})]
|
|
1099
|
+
})]
|
|
1100
|
+
}), document.body);
|
|
1055
1101
|
});
|
|
1056
1102
|
export default AiExplain;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
4
|
var AICorrection = function AICorrection(_ref) {
|
|
3
5
|
var value = _ref.value;
|
|
4
6
|
var data = {
|
|
@@ -12,34 +14,45 @@ var AICorrection = function AICorrection(_ref) {
|
|
|
12
14
|
// console.error(error);
|
|
13
15
|
return null;
|
|
14
16
|
}
|
|
15
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
16
18
|
style: {
|
|
17
19
|
display: 'flex',
|
|
18
20
|
flexDirection: 'column',
|
|
19
21
|
gap: '20px'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
22
|
+
},
|
|
23
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
24
|
+
children: "\u6839\u636E\u8003\u751F\u7684\u56DE\u7B54\uFF0C\u7ED9\u51FA\u4EE5\u4E0B\u5F97\u5206\u53CA\u8BC4\u8BED\uFF1A"
|
|
25
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
26
|
+
style: {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
gap: '10px'
|
|
30
|
+
},
|
|
31
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
32
|
+
style: {
|
|
33
|
+
fontSize: '18px',
|
|
34
|
+
fontWeight: 600
|
|
35
|
+
},
|
|
36
|
+
children: "\u5F97\u5206"
|
|
37
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
38
|
+
children: [data.score, "\u5206"]
|
|
39
|
+
})]
|
|
40
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
41
|
+
style: {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'column',
|
|
44
|
+
gap: '10px'
|
|
45
|
+
},
|
|
46
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
47
|
+
style: {
|
|
48
|
+
fontSize: '18px',
|
|
49
|
+
fontWeight: 600
|
|
50
|
+
},
|
|
51
|
+
children: "\u8BC4\u8BED"
|
|
52
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
53
|
+
children: data.comment
|
|
54
|
+
})]
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
44
57
|
};
|
|
45
58
|
export default AICorrection;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from "./index.module.css";
|
|
3
3
|
import LottieImg from "../lottie-img";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
6
|
var AiLoading = function AiLoading() {
|
|
5
|
-
return /*#__PURE__*/
|
|
6
|
-
className: styles.aiLoading
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
8
|
+
className: styles.aiLoading,
|
|
9
|
+
children: [/*#__PURE__*/_jsx(LottieImg, {
|
|
10
|
+
name: "aiLoading",
|
|
11
|
+
size: [30, 50]
|
|
12
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
13
|
+
className: styles.text,
|
|
14
|
+
children: "\u6570\u636E\u52A0\u8F7D\u4E2D~"
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
13
17
|
};
|
|
14
18
|
export default AiLoading;
|