@myun/gimi-chat 0.0.7 → 0.0.9

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 (89) hide show
  1. package/dist/apis/useApi.d.ts +2 -0
  2. package/dist/apis/useApi.js +50 -2
  3. package/dist/components/ai-chat-dialogue/index.js +135 -181
  4. package/dist/components/ai-correction/index.js +25 -38
  5. package/dist/components/ai-loading/index.js +8 -12
  6. package/dist/components/answer-item/index.d.ts +3 -0
  7. package/dist/components/answer-item/index.js +126 -135
  8. package/dist/components/ask-card/index.js +33 -42
  9. package/dist/components/chat-input/extension/index.d.ts +2 -0
  10. package/dist/components/chat-input/extension/index.js +2 -0
  11. package/dist/components/chat-input/extension/keydown/index.d.ts +3 -0
  12. package/dist/components/chat-input/extension/keydown/index.js +37 -0
  13. package/dist/components/chat-input/extension/title-slot/Component.d.ts +4 -0
  14. package/dist/components/chat-input/extension/title-slot/Component.js +18 -0
  15. package/dist/components/chat-input/extension/title-slot/index.d.ts +3 -0
  16. package/dist/components/chat-input/extension/title-slot/index.js +47 -0
  17. package/dist/components/chat-input/extension/title-slot/index.less +22 -0
  18. package/dist/components/chat-input/index.d.ts +4 -0
  19. package/dist/components/chat-input/index.js +144 -145
  20. package/dist/components/chat-input/index.module.css +7 -0
  21. package/dist/components/chat-voice/VoiceCommunication.js +21 -23
  22. package/dist/components/chat-voice/VoiceRecord.js +21 -24
  23. package/dist/components/conversation-delete/index.js +8 -10
  24. package/dist/components/dots-loading/index.js +7 -10
  25. package/dist/components/empty/index.js +7 -12
  26. package/dist/components/excel-components/ExcelCard.js +3 -7
  27. package/dist/components/excel-components/ExcelExcuting.js +43 -60
  28. package/dist/components/excel-components/ExcelFailCard.js +10 -15
  29. package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -1
  30. package/dist/components/excel-components/ExcelSuccessCard.js +13 -6
  31. package/dist/components/file-card/fileCardSidebar.js +17 -23
  32. package/dist/components/file-card/index.d.ts +3 -0
  33. package/dist/components/file-card/index.js +59 -69
  34. package/dist/components/file-card/index.module.css +1 -1
  35. package/dist/components/file-preview/index.js +62 -37
  36. package/dist/components/file-preview/index.module.css +33 -0
  37. package/dist/components/file-upload/index.js +7 -10
  38. package/dist/components/file-upload/uploadV1.js +27 -33
  39. package/dist/components/gimi-sidebar/index.js +13 -20
  40. package/dist/components/header/index.js +11 -18
  41. package/dist/components/iconfont-com/index.js +33 -12
  42. package/dist/components/index.d.ts +1 -1
  43. package/dist/components/index.js +1 -1
  44. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +22 -28
  45. package/dist/components/knowledge-trace/classList.js +28 -37
  46. package/dist/components/knowledge-trace/documentList.js +27 -36
  47. package/dist/components/knowledge-trace/index.js +21 -28
  48. package/dist/components/knowledge-trace/videoList.js +36 -46
  49. package/dist/components/lottie-img/index.js +8 -10
  50. package/dist/components/message-actions/CopyButton.d.ts +1 -1
  51. package/dist/components/message-actions/CopyButton.js +22 -25
  52. package/dist/components/message-actions/LikeButton.js +22 -25
  53. package/dist/components/message-actions/RegenerateButton.js +18 -21
  54. package/dist/components/message-actions/UnLikeButton.js +22 -25
  55. package/dist/components/message-actions/VoicePlay.js +22 -25
  56. package/dist/components/message-list/index.js +83 -87
  57. package/dist/components/no-microphone-root/index.js +29 -39
  58. package/dist/components/preset-agent-content/index.d.ts +1 -0
  59. package/dist/components/preset-agent-content/index.js +27 -20
  60. package/dist/components/quoted-content/index.d.ts +3 -0
  61. package/dist/components/quoted-content/index.js +271 -163
  62. package/dist/components/quoted-content/index.module.css +20 -0
  63. package/dist/components/reasoning-content/index.d.ts +3 -2
  64. package/dist/components/reasoning-content/index.js +50 -61
  65. package/dist/components/reference-content/index.js +62 -71
  66. package/dist/components/reference-content/index.module.css +1 -0
  67. package/dist/components/search-result/index.d.ts +7 -0
  68. package/dist/components/search-result/index.js +182 -0
  69. package/dist/components/search-result/index.module.css +235 -0
  70. package/dist/components/templates/CommonChat.js +75 -79
  71. package/dist/components/templates/GimiChatComponent.js +6 -13
  72. package/dist/components/templates/demo/demo.js +109 -103
  73. package/dist/components/upload-list/index.js +41 -56
  74. package/dist/components/voice-bars/index.js +19 -22
  75. package/dist/components/voice-check-dialog/index.js +17 -24
  76. package/dist/components/voice-recording/index.js +42 -57
  77. package/dist/components/work-flow-content/demo.js +1 -2
  78. package/dist/components/work-flow-content/index.js +8 -11
  79. package/dist/hooks/useChatActions.d.ts +1 -1
  80. package/dist/hooks/useChatActions.js +3 -1
  81. package/dist/hooks/useCommonChatAPI.d.ts +2 -1
  82. package/dist/hooks/useCommonChatAPI.js +10 -8
  83. package/dist/hooks/useQuoted.d.ts +12 -0
  84. package/dist/hooks/useQuoted.js +202 -0
  85. package/dist/utils/aes.d.ts +21 -0
  86. package/dist/utils/aes.js +61 -0
  87. package/dist/utils/chatInputUtil.d.ts +1 -1
  88. package/dist/utils/chatInputUtil.js +4 -3
  89. package/package.json +6 -2
@@ -53,5 +53,7 @@ declare const useApi: () => {
53
53
  answerId: number;
54
54
  questionId: number;
55
55
  }) => Promise<FetchResponse<any>>;
56
+ getReferenceVideoList: (params: any) => Promise<FetchResponse<any>>;
57
+ getReferenceCourseList: (params: any) => Promise<FetchResponse<any>>;
56
58
  };
57
59
  export default useApi;
@@ -48,6 +48,8 @@ var useApi = function useApi() {
48
48
  return _ref.apply(this, arguments);
49
49
  };
50
50
  }();
51
+
52
+ // 删除会话
51
53
  var deleteConversationById = /*#__PURE__*/function () {
52
54
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(conversationId) {
53
55
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -68,6 +70,8 @@ var useApi = function useApi() {
68
70
  return _ref2.apply(this, arguments);
69
71
  };
70
72
  }();
73
+
74
+ // 获取智能体详情
71
75
  var getAgentDetail = /*#__PURE__*/function () {
72
76
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(agentId) {
73
77
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -88,6 +92,8 @@ var useApi = function useApi() {
88
92
  return _ref3.apply(this, arguments);
89
93
  };
90
94
  }();
95
+
96
+ // 点赞/点踩
91
97
  var handleMark = /*#__PURE__*/function () {
92
98
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
93
99
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -104,6 +110,8 @@ var useApi = function useApi() {
104
110
  return _ref4.apply(this, arguments);
105
111
  };
106
112
  }();
113
+
114
+ // 停止流式输出
107
115
  var stopStreamOut = /*#__PURE__*/function () {
108
116
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
109
117
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
@@ -122,6 +130,8 @@ var useApi = function useApi() {
122
130
  return _ref5.apply(this, arguments);
123
131
  };
124
132
  }();
133
+
134
+ // 获取历史会话消息列表
125
135
  var getMessageList = /*#__PURE__*/function () {
126
136
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
127
137
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
@@ -235,7 +245,7 @@ var useApi = function useApi() {
235
245
  };
236
246
  }();
237
247
 
238
- // 知识库溯源 - 视频切片
248
+ // 搜索 - 视频切片
239
249
  var getVideoSliceList = /*#__PURE__*/function () {
240
250
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(params) {
241
251
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
@@ -355,6 +365,42 @@ var useApi = function useApi() {
355
365
  return _ref18.apply(this, arguments);
356
366
  };
357
367
  }();
368
+
369
+ // 搜索 - 视频引用列表
370
+ var getReferenceVideoList = /*#__PURE__*/function () {
371
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params) {
372
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
373
+ while (1) switch (_context18.prev = _context18.next) {
374
+ case 0:
375
+ return _context18.abrupt("return", apiRef.current.post('/mcourse/web/wisdomClass/quote/getVideoList', params));
376
+ case 1:
377
+ case "end":
378
+ return _context18.stop();
379
+ }
380
+ }, _callee18);
381
+ }));
382
+ return function getReferenceVideoList(_x17) {
383
+ return _ref19.apply(this, arguments);
384
+ };
385
+ }();
386
+
387
+ // 搜索 - 课程引用列表
388
+ var getReferenceCourseList = /*#__PURE__*/function () {
389
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
390
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
391
+ while (1) switch (_context19.prev = _context19.next) {
392
+ case 0:
393
+ return _context19.abrupt("return", apiRef.current.post('/mcourse/web/wisdomClass/quote/getProductList', params));
394
+ case 1:
395
+ case "end":
396
+ return _context19.stop();
397
+ }
398
+ }, _callee19);
399
+ }));
400
+ return function getReferenceCourseList(_x18) {
401
+ return _ref20.apply(this, arguments);
402
+ };
403
+ }();
358
404
  return {
359
405
  getSkillData: getSkillData,
360
406
  getProductList: getProductList,
@@ -372,7 +418,9 @@ var useApi = function useApi() {
372
418
  handleMark: handleMark,
373
419
  getAgentDetail: getAgentDetail,
374
420
  deleteConversationById: deleteConversationById,
375
- getAiCorrection: getAiCorrection
421
+ getAiCorrection: getAiCorrection,
422
+ getReferenceVideoList: getReferenceVideoList,
423
+ getReferenceCourseList: getReferenceCourseList
376
424
  };
377
425
  };
378
426
  export default useApi;
@@ -36,9 +36,7 @@ import { createPortal } from 'react-dom';
36
36
  import { useDispatch } from 'react-redux';
37
37
 
38
38
  // 2. 定义组件完整的 Props 接口
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";
39
+
42
40
  var AiExplain = /*#__PURE__*/forwardRef(function (_ref) {
43
41
  var paper = _ref.paper,
44
42
  setSpeech = _ref.setSpeech,
@@ -107,81 +105,59 @@ var AiExplain = /*#__PURE__*/forwardRef(function (_ref) {
107
105
  var unsupportedShownRef = useRef(false);
108
106
  var renderStatus = useMemo(function () {
109
107
  if (!audioEnabled) {
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
- });
108
+ if (isThinking) return /*#__PURE__*/React.createElement("div", {
109
+ className: styles.statusText
110
+ }, '你已静音(正在思考中)', " ");
111
+ return /*#__PURE__*/React.createElement("div", {
112
+ className: styles.statusText
113
+ }, '你已静音');
118
114
  }
119
115
  switch (status) {
120
116
  case 0:
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
- });
117
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LottieImg, {
118
+ name: "aiLoading",
119
+ size: [30, 50]
120
+ }), /*#__PURE__*/React.createElement("div", {
121
+ className: styles.statusText
122
+ }, "\u6B63\u5728\u8FDE\u63A5"));
130
123
  case 1:
131
124
  case 6:
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
- });
125
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LottieImg, {
126
+ name: "aiOutputLoading",
127
+ size: [34, 60]
128
+ }), /*#__PURE__*/React.createElement("div", {
129
+ className: styles.statusText
130
+ }, "\u6B63\u5728\u8046\u542C"));
141
131
  case 2:
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
- });
132
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
133
+ className: styles.statusImg
134
+ }, /*#__PURE__*/React.createElement("div", {
135
+ className: styles.iconOutside
136
+ }, /*#__PURE__*/React.createElement("div", {
137
+ className: styles.iconInside
138
+ }))), /*#__PURE__*/React.createElement("div", {
139
+ className: styles.statusText
140
+ }, "\u8BF4\u8BDD\u6216\u70B9\u51FB\u53EF\u4EE5\u6253\u65AD\u6211"));
156
141
  case 4:
157
142
  // 网络错误状态打断TextLoading
158
143
  setIsTextLoading(false);
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
- });
144
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
145
+ className: classNames(styles.statusText, styles.danger, styles.pointer)
146
+ }, "\u70B9\u51FB\u91CD\u65B0\u8FDE\u63A5"));
165
147
  case 5:
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
- });
148
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LottieImg, {
149
+ name: "aiOutputLoading",
150
+ size: [34, 60]
151
+ }), /*#__PURE__*/React.createElement("div", {
152
+ className: styles.statusText
153
+ }, "\u4F60\u53EF\u4EE5\u5F00\u59CB\u8BF4\u8BDD"));
175
154
  case 7:
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
- });
155
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LottieImg, {
156
+ name: "aiOutputLoading",
157
+ size: [34, 60]
158
+ }), /*#__PURE__*/React.createElement("div", {
159
+ className: styles.statusText
160
+ }, "\u6B63\u5728\u601D\u8003"));
185
161
  default:
186
162
  return null;
187
163
  }
@@ -984,119 +960,97 @@ var AiExplain = /*#__PURE__*/forwardRef(function (_ref) {
984
960
  clearTimeout(timer.current);
985
961
  };
986
962
  }, []);
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);
963
+ return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", {
964
+ className: styles.aiChat
965
+ }, /*#__PURE__*/React.createElement("div", {
966
+ className: styles.bgImg
967
+ }, /*#__PURE__*/React.createElement(LottieImg, {
968
+ name: "aiBg",
969
+ size: ['100%', '100%']
970
+ })), /*#__PURE__*/React.createElement(Tooltip, {
971
+ placement: "bottomRight",
972
+ overlayClassName: "out-tooltip ai-chat-tooltip",
973
+ visible: isFirstUse,
974
+ title: showCaptions ? '点击可关闭字幕' : '点击可开启字幕'
975
+ }, /*#__PURE__*/React.createElement("div", {
976
+ className: styles.rightWrap
977
+ }, /*#__PURE__*/React.createElement(Tooltip, {
978
+ placement: "bottom",
979
+ title: showCaptions ? '关闭字幕' : '打开字幕',
980
+ overlayClassName: "ai-chat-tooltip"
981
+ }, /*#__PURE__*/React.createElement("div", {
982
+ className: styles.iconWrap
983
+ }, /*#__PURE__*/React.createElement(IconFontCom, {
984
+ type: !showCaptions ? 'icon-a-tongyong-zhankaibeifen1' : 'icon-tongyong-zhankaibeifen1',
985
+ size: 20,
986
+ extraStyle: {
987
+ cursor: 'pointer'
988
+ },
989
+ onClick: function onClick() {
990
+ return setShowCaptions(!showCaptions);
991
+ }
992
+ }))))), /*#__PURE__*/React.createElement("div", {
993
+ className: classNames(styles.main)
994
+ }, /*#__PURE__*/React.createElement(Header, {
995
+ title: headerTitle
996
+ }), /*#__PURE__*/React.createElement("div", {
997
+ className: classNames(styles.content, 'scrollBar'),
998
+ ref: containerRef
999
+ }, /*#__PURE__*/React.createElement("div", {
1000
+ className: styles.container
1001
+ }, showCaptions ? status === 5 || status === 6 ? /*#__PURE__*/React.createElement("div", {
1002
+ className: styles.tips
1003
+ }, status === 5 ? '请说话' : '正在听...') : /*#__PURE__*/React.createElement("div", null, messageList.map(function (item) {
1004
+ return /*#__PURE__*/React.createElement("div", {
1005
+ className: classNames(styles.item, _defineProperty({}, styles.answer, item.type === 'answer')),
1006
+ key: item.id
1007
+ }, item.content);
1008
+ }), isTextLoading ? /*#__PURE__*/React.createElement(Spin, null) : null) : /*#__PURE__*/React.createElement("div", {
1009
+ className: styles.voiceWrap
1010
+ }, /*#__PURE__*/React.createElement(LottieImg, {
1011
+ name: status === 2 ? 'aiOutputStrengthen' : 'aiOutputNormal',
1012
+ size: [242, 235]
1013
+ }))), /*#__PURE__*/React.createElement("div", {
1014
+ className: styles.bottom
1015
+ }, /*#__PURE__*/React.createElement("div", {
1016
+ className: classNames(styles.status, _defineProperty({}, styles.pointer, status === 2)),
1017
+ onClick: clickInterrupt
1018
+ }, renderStatus), /*#__PURE__*/React.createElement("div", {
1019
+ className: styles.btnWrap
1020
+ }, /*#__PURE__*/React.createElement(Tooltip, {
1021
+ placement: "top",
1022
+ visible: isFirstUse,
1023
+ title: audioEnabled ? '关闭麦克风' : '打开麦克风',
1024
+ overlayClassName: "ai-chat-tooltip"
1025
+ }, /*#__PURE__*/React.createElement(Tooltip, {
1026
+ placement: "top",
1027
+ title: audioEnabled ? '关闭麦克风' : '打开麦克风',
1028
+ overlayClassName: "ai-chat-tooltip"
1029
+ }, /*#__PURE__*/React.createElement("div", {
1030
+ className: classNames(styles.btnItem, isDisable ? styles.disable : ''),
1031
+ onClick: function onClick() {
1032
+ return handleVoice();
1033
+ }
1034
+ }, /*#__PURE__*/React.createElement(IconFontCom, {
1035
+ type: audioEnabled ? 'icon-voice' : 'icon-a-voice1',
1036
+ size: 34
1037
+ })))), /*#__PURE__*/React.createElement(Tooltip, {
1038
+ placement: "top",
1039
+ visible: isFirstUse,
1040
+ title: '挂断电话',
1041
+ overlayClassName: "ai-chat-tooltip"
1042
+ }, /*#__PURE__*/React.createElement(Tooltip, {
1043
+ placement: "top",
1044
+ title: '挂断电话',
1045
+ overlayClassName: "ai-chat-tooltip"
1046
+ }, /*#__PURE__*/React.createElement("div", {
1047
+ className: styles.btnItem,
1048
+ onClick: function onClick() {
1049
+ return handleBack();
1050
+ }
1051
+ }, /*#__PURE__*/React.createElement(IconFontCom, {
1052
+ type: "icon-a-mti-guaduanshi",
1053
+ size: 34
1054
+ }))))))))), document.body);
1101
1055
  });
1102
1056
  export default AiExplain;
@@ -1,6 +1,4 @@
1
1
  import React from "react";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { jsxs as _jsxs } from "react/jsx-runtime";
4
2
  var AICorrection = function AICorrection(_ref) {
5
3
  var value = _ref.value;
6
4
  var data = {
@@ -14,45 +12,34 @@ var AICorrection = function AICorrection(_ref) {
14
12
  // console.error(error);
15
13
  return null;
16
14
  }
17
- return /*#__PURE__*/_jsxs("div", {
15
+ return /*#__PURE__*/React.createElement("div", {
18
16
  style: {
19
17
  display: 'flex',
20
18
  flexDirection: 'column',
21
19
  gap: '20px'
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
- });
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)));
57
44
  };
58
45
  export default AICorrection;
@@ -1,18 +1,14 @@
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";
6
4
  var AiLoading = function AiLoading() {
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
- });
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~"));
17
13
  };
18
14
  export default AiLoading;
@@ -22,6 +22,9 @@ interface AnswerItemProps {
22
22
  enableUnLike?: boolean;
23
23
  enableRegenerate?: boolean;
24
24
  enableVoicePlay?: boolean;
25
+ onDownloadCallback?: () => void;
26
+ reasoningTitle?: string;
27
+ model: 'fullscreen' | 'sidebar';
25
28
  }
26
29
  declare const AnswerItem: React.FC<AnswerItemProps>;
27
30
  export default AnswerItem;