@myun/gimi-chat 0.0.4 → 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.
Files changed (98) hide show
  1. package/dist/components/ai-chat-dialogue/index.js +182 -136
  2. package/dist/components/ai-chat-dialogue/index.module.css +230 -0
  3. package/dist/components/ai-correction/index.js +38 -25
  4. package/dist/components/ai-loading/index.js +13 -9
  5. package/dist/components/ai-loading/index.module.css +11 -0
  6. package/dist/components/answer-item/index.js +136 -114
  7. package/dist/components/answer-item/index.module.css +266 -0
  8. package/dist/components/ask-card/index.js +43 -34
  9. package/dist/components/ask-card/index.module.css +122 -0
  10. package/dist/components/chat-input/index.js +136 -115
  11. package/dist/components/chat-input/index.module.css +42 -0
  12. package/dist/components/chat-voice/VoiceCommunication.js +23 -21
  13. package/dist/components/chat-voice/VoiceRecord.js +24 -21
  14. package/dist/components/conversation-delete/index.js +10 -8
  15. package/dist/components/dots-loading/index.js +11 -8
  16. package/dist/components/dots-loading/index.module.css +41 -0
  17. package/dist/components/empty/index.js +13 -8
  18. package/dist/components/empty/index.module.css +24 -0
  19. package/dist/components/excel-components/ExcelCard.js +7 -3
  20. package/dist/components/excel-components/ExcelExcuting.js +61 -44
  21. package/dist/components/excel-components/ExcelFailCard.js +16 -11
  22. package/dist/components/excel-components/ExcelSuccessCard.js +3 -2
  23. package/dist/components/excel-components/index.module.css +212 -0
  24. package/dist/components/excel-components/styles.module.css +178 -0
  25. package/dist/components/file-card/fileCardSidebar.js +24 -17
  26. package/dist/components/file-card/index.js +69 -50
  27. package/dist/components/file-card/index.module.css +139 -0
  28. package/dist/components/file-preview/index.js +39 -34
  29. package/dist/components/file-preview/index.module.css +83 -0
  30. package/dist/components/file-upload/index.js +10 -7
  31. package/dist/components/file-upload/uploadV1.js +33 -27
  32. package/dist/components/gimi-sidebar/index.js +21 -14
  33. package/dist/components/gimi-sidebar/index.module.css +118 -0
  34. package/dist/components/header/index.js +19 -12
  35. package/dist/components/header/index.module.css +19 -0
  36. package/dist/components/iconfont-com/index.js +2 -1
  37. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +29 -23
  38. package/dist/components/knowledge-trace/classList.js +38 -29
  39. package/dist/components/knowledge-trace/documentList.js +37 -28
  40. package/dist/components/knowledge-trace/index.js +29 -22
  41. package/dist/components/knowledge-trace/index.module.css +254 -0
  42. package/dist/components/knowledge-trace/videoList.js +47 -37
  43. package/dist/components/lottie-img/index.js +10 -8
  44. package/dist/components/message-actions/CopyButton.js +25 -22
  45. package/dist/components/message-actions/LikeButton.js +25 -22
  46. package/dist/components/message-actions/RegenerateButton.js +21 -18
  47. package/dist/components/message-actions/UnLikeButton.js +25 -22
  48. package/dist/components/message-actions/VoicePlay.js +25 -22
  49. package/dist/components/message-list/index.js +86 -76
  50. package/dist/components/message-list/index.module.css +261 -0
  51. package/dist/components/no-microphone-root/index.js +40 -30
  52. package/dist/components/no-microphone-root/index.module.css +48 -0
  53. package/dist/components/preset-agent-content/index.js +21 -16
  54. package/dist/components/preset-agent-content/index.module.css +46 -0
  55. package/dist/components/quoted-content/index.module.css +80 -0
  56. package/dist/components/reasoning-content/index.js +56 -43
  57. package/dist/components/reasoning-content/index.module.css +169 -0
  58. package/dist/components/reference-content/index.js +73 -64
  59. package/dist/components/reference-content/index.module.css +84 -0
  60. package/dist/components/templates/CommonChat.js +79 -65
  61. package/dist/components/templates/GimiChatComponent.js +13 -6
  62. package/dist/components/templates/demo/demo.js +104 -103
  63. package/dist/components/templates/index.module.css +109 -0
  64. package/dist/components/upload-list/index.js +57 -42
  65. package/dist/components/upload-list/index.module.css +119 -0
  66. package/dist/components/voice-bars/index.js +22 -19
  67. package/dist/components/voice-check-dialog/index.js +25 -18
  68. package/dist/components/voice-check-dialog/{index.module.scss → index.module.css} +2 -2
  69. package/dist/components/voice-recording/index.js +58 -43
  70. package/dist/components/voice-recording/index.module.css +41 -0
  71. package/dist/components/work-flow-content/demo.js +2 -1
  72. package/dist/components/work-flow-content/index.js +13 -10
  73. package/dist/components/work-flow-content/index.module.css +24 -0
  74. package/package.json +7 -6
  75. package/dist/components/ai-chat-dialogue/index.module.scss +0 -272
  76. package/dist/components/ai-loading/index.module.scss +0 -11
  77. package/dist/components/answer-item/index.module.scss +0 -295
  78. package/dist/components/ask-card/index.module.scss +0 -125
  79. package/dist/components/chat-input/index.module.scss +0 -44
  80. package/dist/components/dots-loading/index.module.scss +0 -45
  81. package/dist/components/empty/index.module.scss +0 -27
  82. package/dist/components/excel-components/index.module.scss +0 -210
  83. package/dist/components/excel-components/styles.module.scss +0 -186
  84. package/dist/components/file-card/index.module.scss +0 -139
  85. package/dist/components/file-preview/index.module.scss +0 -120
  86. package/dist/components/gimi-sidebar/index.module.scss +0 -136
  87. package/dist/components/header/index.module.scss +0 -26
  88. package/dist/components/knowledge-trace/index.module.scss +0 -262
  89. package/dist/components/message-list/index.module.scss +0 -304
  90. package/dist/components/no-microphone-root/index.module.scss +0 -42
  91. package/dist/components/preset-agent-content/index.module.scss +0 -48
  92. package/dist/components/quoted-content/index.module.scss +0 -76
  93. package/dist/components/reasoning-content/index.module.scss +0 -164
  94. package/dist/components/reference-content/index.module.scss +0 -73
  95. package/dist/components/templates/index.module.scss +0 -119
  96. package/dist/components/upload-list/index.module.scss +0 -119
  97. package/dist/components/voice-recording/index.module.scss +0 -41
  98. package/dist/components/work-flow-content/index.module.scss +0 -23
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
- import styles from "./index.module.scss";
2
+ import styles from "./index.module.css";
3
3
  import classNames from 'classnames';
4
4
  import { knowledgeConstants } from "../../constants";
5
5
  import { Toast, Tooltip } from '@douyinfe/semi-ui';
6
6
  import { useAppSelector, useAppDispatch } from "../../store/hooks";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
9
  var VideoItem = function VideoItem(_ref) {
8
10
  var _konwledgeTraceState$;
9
11
  var item = _ref.item;
@@ -47,45 +49,53 @@ var VideoItem = function VideoItem(_ref) {
47
49
  }
48
50
  }
49
51
  };
50
- return /*#__PURE__*/React.createElement("div", {
52
+ return /*#__PURE__*/_jsxs("div", {
51
53
  className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
52
- onClick: handleClick
53
- }, /*#__PURE__*/React.createElement("div", {
54
- style: {
55
- position: 'relative'
56
- }
57
- }, /*#__PURE__*/React.createElement("img", {
58
- alt: "\u89C6\u9891\u5C01\u9762\u56FE\u7247",
59
- className: styles.class_img,
60
- src: item.coverUrl || knowledgeConstants.VIDEO_DEFAULT_COVER_ADDRESS
61
- }), /*#__PURE__*/React.createElement("img", {
62
- alt: "\u64AD\u653E\u6309\u94AE\u56FE\u7247",
63
- className: styles.class_img_play,
64
- src: knowledgeConstants.VIDEO_PLAY_ICON_ADDRESS
65
- })), /*#__PURE__*/React.createElement("div", {
66
- className: styles.class_description
67
- }, /*#__PURE__*/React.createElement(Tooltip, {
68
- placement: "topLeft",
69
- content: item.name
70
- }, /*#__PURE__*/React.createElement("div", {
71
- className: styles.text
72
- }, item.name)), /*#__PURE__*/React.createElement("div", {
73
- className: styles.timeTrace
74
- }, "\u89C6\u9891\u7247\u6BB5: ".concat(item.startedAt || "0'0\"", " - ").concat(item.endedAt || "0'0\"")), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
75
- className: styles.knowledge_trace_deactive
76
- }, "\u89C6\u9891\u5931\u6548")));
54
+ onClick: handleClick,
55
+ children: [/*#__PURE__*/_jsxs("div", {
56
+ style: {
57
+ position: 'relative'
58
+ },
59
+ children: [/*#__PURE__*/_jsx("img", {
60
+ alt: "\u89C6\u9891\u5C01\u9762\u56FE\u7247",
61
+ className: styles.class_img,
62
+ src: item.coverUrl || knowledgeConstants.VIDEO_DEFAULT_COVER_ADDRESS
63
+ }), /*#__PURE__*/_jsx("img", {
64
+ alt: "\u64AD\u653E\u6309\u94AE\u56FE\u7247",
65
+ className: styles.class_img_play,
66
+ src: knowledgeConstants.VIDEO_PLAY_ICON_ADDRESS
67
+ })]
68
+ }), /*#__PURE__*/_jsxs("div", {
69
+ className: styles.class_description,
70
+ children: [/*#__PURE__*/_jsx(Tooltip, {
71
+ placement: "topLeft",
72
+ content: item.name,
73
+ children: /*#__PURE__*/_jsx("div", {
74
+ className: styles.text,
75
+ children: item.name
76
+ })
77
+ }), /*#__PURE__*/_jsx("div", {
78
+ className: styles.timeTrace,
79
+ children: "\u89C6\u9891\u7247\u6BB5: ".concat(item.startedAt || "0'0\"", " - ").concat(item.endedAt || "0'0\"")
80
+ }), item.isDelete === 1 && /*#__PURE__*/_jsx("div", {
81
+ className: styles.knowledge_trace_deactive,
82
+ children: "\u89C6\u9891\u5931\u6548"
83
+ })]
84
+ })]
85
+ });
77
86
  };
78
87
  var VideoList = function VideoList(_ref2) {
79
88
  var list = _ref2.list;
80
- return /*#__PURE__*/React.createElement("div", {
81
- className: styles.knowledgeList
82
- }, /*#__PURE__*/React.createElement("span", {
83
- className: styles.total
84
- }, "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u89C6\u9891")), list.map(function (item) {
85
- return /*#__PURE__*/React.createElement(VideoItem, {
86
- item: item,
87
- key: item.id
88
- });
89
- }));
89
+ return /*#__PURE__*/_jsxs("div", {
90
+ className: styles.knowledgeList,
91
+ children: [/*#__PURE__*/_jsx("span", {
92
+ className: styles.total,
93
+ children: "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u89C6\u9891")
94
+ }), list.map(function (item) {
95
+ return /*#__PURE__*/_jsx(VideoItem, {
96
+ item: item
97
+ }, item.id);
98
+ })]
99
+ });
90
100
  };
91
101
  export default VideoList;
@@ -13,6 +13,7 @@ import * as aiOutputStrengthen from "../../assets/lottie/ai-output-strengthen.js
13
13
  import * as aiOutputLoading from "../../assets/lottie/ai-output-loading.json";
14
14
  import * as aiVoicePlay from "../../assets/lottie/ai-voice-play.json";
15
15
  import React from 'react';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
16
17
  var names = [{
17
18
  name: 'live',
18
19
  value: live
@@ -84,16 +85,17 @@ var LottieImg = function LottieImg(_ref) {
84
85
  pathFillColor: '#ff0000',
85
86
  pathStrokeColor: '#000000'
86
87
  };
87
- return /*#__PURE__*/React.createElement("div", {
88
+ return /*#__PURE__*/_jsx("div", {
88
89
  style: {
89
90
  pointerEvents: 'none',
90
91
  margin: '0 auto'
91
- }
92
- }, /*#__PURE__*/React.createElement(Lottie, {
93
- params: defaultOptions,
94
- width: width,
95
- height: height,
96
- style: _objectSpread({}, style)
97
- }));
92
+ },
93
+ children: /*#__PURE__*/_jsx(Lottie, {
94
+ params: defaultOptions,
95
+ width: width,
96
+ height: height,
97
+ style: _objectSpread({}, style)
98
+ })
99
+ });
98
100
  };
99
101
  export default LottieImg;
@@ -2,32 +2,35 @@ import React from 'react';
2
2
  import { Tooltip } from '@douyinfe/semi-ui';
3
3
  import { usePureChatActions } from "../../hooks/useChatActions";
4
4
  import copyIcon from "../../assets/image/copyIcon.png";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  var CopyButton = function CopyButton(_ref) {
6
7
  var item = _ref.item,
7
8
  onCopyCallback = _ref.onCopyCallback;
8
9
  var _usePureChatActions = usePureChatActions(),
9
10
  copyToClipboard = _usePureChatActions.copyToClipboard;
10
- return /*#__PURE__*/React.createElement(Tooltip, {
11
- content: "\u590D\u5236"
12
- }, /*#__PURE__*/React.createElement("div", {
13
- style: {
14
- display: 'flex',
15
- alignItems: 'center',
16
- justifyContent: 'center',
17
- cursor: 'pointer'
18
- }
19
- }, /*#__PURE__*/React.createElement("img", {
20
- width: 18,
21
- height: 18,
22
- style: {
23
- display: 'flex',
24
- alignItems: 'center'
25
- },
26
- src: copyIcon,
27
- onClick: function onClick() {
28
- copyToClipboard(item);
29
- onCopyCallback === null || onCopyCallback === void 0 || onCopyCallback();
30
- }
31
- })));
11
+ return /*#__PURE__*/_jsx(Tooltip, {
12
+ content: "\u590D\u5236",
13
+ children: /*#__PURE__*/_jsx("div", {
14
+ style: {
15
+ display: 'flex',
16
+ alignItems: 'center',
17
+ justifyContent: 'center',
18
+ cursor: 'pointer'
19
+ },
20
+ children: /*#__PURE__*/_jsx("img", {
21
+ width: 18,
22
+ height: 18,
23
+ style: {
24
+ display: 'flex',
25
+ alignItems: 'center'
26
+ },
27
+ src: copyIcon,
28
+ onClick: function onClick() {
29
+ copyToClipboard(item);
30
+ onCopyCallback === null || onCopyCallback === void 0 || onCopyCallback();
31
+ }
32
+ })
33
+ })
34
+ });
32
35
  };
33
36
  export default CopyButton;
@@ -3,32 +3,35 @@ import likeIcon from "../../assets/image/like_active.png";
3
3
  import love from "../../assets/image/love.png";
4
4
  import { Tooltip } from '@douyinfe/semi-ui';
5
5
  import React from 'react';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
6
7
  var LikeButton = function LikeButton(_ref) {
7
8
  var item = _ref.item,
8
9
  onLikeCallback = _ref.onLikeCallback;
9
10
  var _usePureChatActions = usePureChatActions(),
10
11
  handleUnlove = _usePureChatActions.handleUnlove;
11
- return /*#__PURE__*/React.createElement(Tooltip, {
12
- content: "".concat(item.mark === 2 ? '已点赞' : '点赞')
13
- }, /*#__PURE__*/React.createElement("div", {
14
- style: {
15
- display: 'flex',
16
- alignItems: 'center',
17
- cursor: 'pointer',
18
- userSelect: 'none'
19
- },
20
- onClick: function onClick() {
21
- handleUnlove(item, 'love');
22
- onLikeCallback === null || onLikeCallback === void 0 || onLikeCallback();
23
- }
24
- }, /*#__PURE__*/React.createElement("img", {
25
- width: 18,
26
- height: 18,
27
- style: {
28
- display: 'flex',
29
- alignItems: 'center'
30
- },
31
- src: item.mark === 2 ? likeIcon : love
32
- })));
12
+ return /*#__PURE__*/_jsx(Tooltip, {
13
+ content: "".concat(item.mark === 2 ? '已点赞' : '点赞'),
14
+ children: /*#__PURE__*/_jsx("div", {
15
+ style: {
16
+ display: 'flex',
17
+ alignItems: 'center',
18
+ cursor: 'pointer',
19
+ userSelect: 'none'
20
+ },
21
+ onClick: function onClick() {
22
+ handleUnlove(item, 'love');
23
+ onLikeCallback === null || onLikeCallback === void 0 || onLikeCallback();
24
+ },
25
+ children: /*#__PURE__*/_jsx("img", {
26
+ width: 18,
27
+ height: 18,
28
+ style: {
29
+ display: 'flex',
30
+ alignItems: 'center'
31
+ },
32
+ src: item.mark === 2 ? likeIcon : love
33
+ })
34
+ })
35
+ });
33
36
  };
34
37
  export default LikeButton;
@@ -3,25 +3,28 @@
3
3
  import { Tooltip } from '@douyinfe/semi-ui';
4
4
  import React from 'react';
5
5
  import { IconRedoStroked } from '@douyinfe/semi-icons';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
6
7
  var RegenerateButton = function RegenerateButton(_ref) {
7
8
  var onRegenerateClick = _ref.onRegenerateClick;
8
- return /*#__PURE__*/React.createElement(Tooltip, {
9
- content: "\u91CD\u65B0\u751F\u6210"
10
- }, /*#__PURE__*/React.createElement("div", {
11
- style: {
12
- display: 'flex',
13
- alignItems: 'center',
14
- cursor: 'pointer',
15
- userSelect: 'none'
16
- },
17
- onClick: function onClick() {
18
- onRegenerateClick === null || onRegenerateClick === void 0 || onRegenerateClick();
19
- }
20
- }, /*#__PURE__*/React.createElement(IconRedoStroked, {
21
- style: {
22
- width: 18,
23
- height: 18
24
- }
25
- })));
9
+ return /*#__PURE__*/_jsx(Tooltip, {
10
+ content: "\u91CD\u65B0\u751F\u6210",
11
+ children: /*#__PURE__*/_jsx("div", {
12
+ style: {
13
+ display: 'flex',
14
+ alignItems: 'center',
15
+ cursor: 'pointer',
16
+ userSelect: 'none'
17
+ },
18
+ onClick: function onClick() {
19
+ onRegenerateClick === null || onRegenerateClick === void 0 || onRegenerateClick();
20
+ },
21
+ children: /*#__PURE__*/_jsx(IconRedoStroked, {
22
+ style: {
23
+ width: 18,
24
+ height: 18
25
+ }
26
+ })
27
+ })
28
+ });
26
29
  };
27
30
  export default RegenerateButton;
@@ -3,32 +3,35 @@ import unloveActive from "../../assets/image/unlike_active.png";
3
3
  import unlove from "../../assets/image/unlove.png";
4
4
  import { Tooltip } from '@douyinfe/semi-ui';
5
5
  import React from 'react';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
6
7
  var UnLikeButton = function UnLikeButton(_ref) {
7
8
  var item = _ref.item,
8
9
  onUnLikeCallback = _ref.onUnLikeCallback;
9
10
  var _usePureChatActions = usePureChatActions(),
10
11
  handleUnlove = _usePureChatActions.handleUnlove;
11
- return /*#__PURE__*/React.createElement(Tooltip, {
12
- content: "".concat(item.mark === 1 ? '已点踩' : '点踩')
13
- }, /*#__PURE__*/React.createElement("div", {
14
- style: {
15
- display: 'flex',
16
- alignItems: 'center',
17
- cursor: 'pointer',
18
- userSelect: 'none'
19
- },
20
- onClick: function onClick() {
21
- handleUnlove(item, 'unlove');
22
- onUnLikeCallback === null || onUnLikeCallback === void 0 || onUnLikeCallback();
23
- }
24
- }, /*#__PURE__*/React.createElement("img", {
25
- width: 18,
26
- height: 18,
27
- style: {
28
- display: 'flex',
29
- alignItems: 'center'
30
- },
31
- src: item.mark === 1 ? unloveActive : unlove
32
- })));
12
+ return /*#__PURE__*/_jsx(Tooltip, {
13
+ content: "".concat(item.mark === 1 ? '已点踩' : '点踩'),
14
+ children: /*#__PURE__*/_jsx("div", {
15
+ style: {
16
+ display: 'flex',
17
+ alignItems: 'center',
18
+ cursor: 'pointer',
19
+ userSelect: 'none'
20
+ },
21
+ onClick: function onClick() {
22
+ handleUnlove(item, 'unlove');
23
+ onUnLikeCallback === null || onUnLikeCallback === void 0 || onUnLikeCallback();
24
+ },
25
+ children: /*#__PURE__*/_jsx("img", {
26
+ width: 18,
27
+ height: 18,
28
+ style: {
29
+ display: 'flex',
30
+ alignItems: 'center'
31
+ },
32
+ src: item.mark === 1 ? unloveActive : unlove
33
+ })
34
+ })
35
+ });
33
36
  };
34
37
  export default UnLikeButton;
@@ -8,6 +8,7 @@ import { Tooltip } from '@douyinfe/semi-ui';
8
8
  import { useAppSelector, useAppDispatch } from "../../store/hooks";
9
9
  import { setCurrentMessageId } from "../../store/slices/gimiMenuSlice";
10
10
  import LottieImg from "../lottie-img";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
11
12
  var getCleanReadText = function getCleanReadText(text) {
12
13
  // 移除<knowledge>标签及内容
13
14
  var newText = text.replace(/<knowledge>.*?<\/knowledge>/g, '').replace(/<excel>.*?<\/excel>/g, '');
@@ -48,27 +49,29 @@ var VoicePlay = function VoicePlay(props) {
48
49
  return _ref.apply(this, arguments);
49
50
  };
50
51
  }();
51
- return /*#__PURE__*/React.createElement(Tooltip, {
52
- content: isActive ? '暂停朗读' : '语音朗读'
53
- }, /*#__PURE__*/React.createElement("div", {
54
- style: {
55
- display: 'flex',
56
- alignItems: 'center',
57
- justifyContent: 'center',
58
- cursor: 'pointer'
59
- },
60
- onClick: handleClick
61
- }, isActive ? /*#__PURE__*/React.createElement(LottieImg, {
62
- name: "aiVoicePlay",
63
- size: [30, 20]
64
- }) : /*#__PURE__*/React.createElement("img", {
65
- width: 18,
66
- height: 18,
67
- style: {
68
- display: 'flex',
69
- alignItems: 'center'
70
- },
71
- src: soundOutIcon
72
- })));
52
+ return /*#__PURE__*/_jsx(Tooltip, {
53
+ content: isActive ? '暂停朗读' : '语音朗读',
54
+ children: /*#__PURE__*/_jsx("div", {
55
+ style: {
56
+ display: 'flex',
57
+ alignItems: 'center',
58
+ justifyContent: 'center',
59
+ cursor: 'pointer'
60
+ },
61
+ onClick: handleClick,
62
+ children: isActive ? /*#__PURE__*/_jsx(LottieImg, {
63
+ name: "aiVoicePlay",
64
+ size: [30, 20]
65
+ }) : /*#__PURE__*/_jsx("img", {
66
+ width: 18,
67
+ height: 18,
68
+ style: {
69
+ display: 'flex',
70
+ alignItems: 'center'
71
+ },
72
+ src: soundOutIcon
73
+ })
74
+ })
75
+ });
73
76
  };
74
77
  export default VoicePlay;
@@ -4,7 +4,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
4
4
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import React from 'react';
6
6
  import classNames from 'classnames';
7
- import styles from "./index.module.scss";
7
+ import styles from "./index.module.css";
8
8
  import { Spin } from '@douyinfe/semi-ui';
9
9
  import { References } from "../reference-content";
10
10
  import { replaceBraces } from "../../utils/tools";
@@ -16,6 +16,9 @@ import { useGimiFileUpload } from "../../hooks/useFile";
16
16
  import { FileStatus } from "../../interfaces/fileInterface";
17
17
  import useChatActions from "../../hooks/useChatActions";
18
18
  import CopyButton from "../message-actions/CopyButton";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { Fragment as _Fragment } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
22
  var MessageList = function MessageList(_ref) {
20
23
  var chatList = _ref.chatList,
21
24
  handleSend = _ref.handleSend,
@@ -88,80 +91,87 @@ var MessageList = function MessageList(_ref) {
88
91
  var handleShowCourse = useCallback(function (v) {
89
92
  chatUI.showCourse(v.messageId ? v.messageId : v.chatId, v.videoResourceList);
90
93
  }, [chatUI]);
91
- return /*#__PURE__*/React.createElement("div", {
92
- className: classNames(styles.main)
93
- }, /*#__PURE__*/React.createElement("div", {
94
- className: classNames(model === 'sidebar' ? styles.small_container : styles.container)
95
- }, chatList.length > 0 && /*#__PURE__*/React.createElement("div", {
96
- className: styles.textWrap
97
- }, chatList.map(function (v) {
98
- var _v$quoteTeachModelLis, _v$quoteProductList;
99
- return /*#__PURE__*/React.createElement("div", {
100
- key: v.id
101
- }, v.isSystemAuto !== 1 && /*#__PURE__*/React.createElement("div", {
102
- key: String(v.id),
103
- className: classNames(styles.textItem, _defineProperty({}, styles.question, (v === null || v === void 0 ? void 0 : v.type) === 0)),
104
- onMouseLeave: function onMouseLeave() {
105
- return chatUI.setShowCopyId(0);
106
- },
107
- onMouseEnter: function onMouseEnter() {
108
- if (!v.loading) chatUI.setShowCopyId(v.id);
109
- }
110
- }, (v === null || v === void 0 ? void 0 : v.type) === 0 && /*#__PURE__*/React.createElement(React.Fragment, null, v.status !== 1 && /*#__PURE__*/React.createElement("div", {
111
- className: styles.qusetionOpera
112
- }, v.status === 0 && /*#__PURE__*/React.createElement(Spin, {
113
- size: "small"
114
- })), (((_v$quoteTeachModelLis = v.quoteTeachModelList) === null || _v$quoteTeachModelLis === void 0 ? void 0 : _v$quoteTeachModelLis.length) > 0 || ((_v$quoteProductList = v.quoteProductList) === null || _v$quoteProductList === void 0 ? void 0 : _v$quoteProductList.length) > 0) && /*#__PURE__*/React.createElement(References, {
115
- quoteProductList: v.quoteProductList,
116
- quoteTeachModelList: v.quoteTeachModelList
117
- }), v.content && /*#__PURE__*/React.createElement("div", {
118
- className: styles.title,
119
- dangerouslySetInnerHTML: {
120
- __html: replaceBraces(v.content)
121
- }
122
- }), v.messageFiles &&
123
- /*#__PURE__*/
124
- // 增加fileUrl校验,确保文件已上传
125
- React.createElement("div", {
126
- className: styles.listBox
127
- }, /*#__PURE__*/React.createElement(UploadList, {
128
- file: v.messageFiles,
129
- showDel: false,
130
- handleDelFile: function handleDelFile() {},
131
- handleReTry: handleReTry
132
- })), v.content && /*#__PURE__*/React.createElement("div", {
133
- className: styles.copyBtn
134
- }, /*#__PURE__*/React.createElement(CopyButton, {
135
- item: v,
136
- onCopyCallback: onCopyCallback
137
- }))), (v === null || v === void 0 ? void 0 : v.type) === 1 && /*#__PURE__*/React.createElement(AnswerItem, {
138
- item: v,
139
- showOpera: showOpera,
140
- onSucess: onSucessExcel,
141
- onFailure: onFailureExcel,
142
- onRetry: onRetryExcel,
143
- onCopyCallback: onCopyCallback,
144
- onLikeCallback: onLikeCallback,
145
- onUnLikeCallback: onUnLikeCallback,
146
- showCommend: showCommend,
147
- handleClickPromptWord: handleClickPromptWord,
148
- handleShowCourse: handleShowCourse,
149
- handleClickAskList: handleClickAskList,
150
- playTTSByText: playTTSByText,
151
- stopTTSByText: stopTTSByText,
152
- isVoicePlaying: isPlaying,
153
- onRegenerateClick: onRegenerateClick,
154
- enableCopy: enableCopy,
155
- enableLike: enableLike,
156
- enableUnLike: enableUnLike,
157
- enableRegenerate: enableRegenerate,
158
- enableVoicePlay: enableVoicePlay
159
- })));
160
- }), msgLoading && /*#__PURE__*/React.createElement("div", {
161
- className: styles.answerLoading
162
- }, /*#__PURE__*/React.createElement(LottieImg, {
163
- name: "aiLoading",
164
- size: [20, 40]
165
- })))));
94
+ return /*#__PURE__*/_jsx("div", {
95
+ className: classNames(styles.main),
96
+ children: /*#__PURE__*/_jsx("div", {
97
+ className: classNames(model === 'sidebar' ? styles.small_container : styles.container),
98
+ children: chatList.length > 0 && /*#__PURE__*/_jsxs("div", {
99
+ className: styles.textWrap,
100
+ children: [chatList.map(function (v) {
101
+ var _v$quoteTeachModelLis, _v$quoteProductList;
102
+ return /*#__PURE__*/_jsx("div", {
103
+ children: v.isSystemAuto !== 1 && /*#__PURE__*/_jsxs("div", {
104
+ className: classNames(styles.textItem, _defineProperty({}, styles.question, (v === null || v === void 0 ? void 0 : v.type) === 0)),
105
+ onMouseLeave: function onMouseLeave() {
106
+ return chatUI.setShowCopyId(0);
107
+ },
108
+ onMouseEnter: function onMouseEnter() {
109
+ if (!v.loading) chatUI.setShowCopyId(v.id);
110
+ },
111
+ children: [(v === null || v === void 0 ? void 0 : v.type) === 0 && /*#__PURE__*/_jsxs(_Fragment, {
112
+ children: [v.status !== 1 && /*#__PURE__*/_jsx("div", {
113
+ className: styles.qusetionOpera,
114
+ children: v.status === 0 && /*#__PURE__*/_jsx(Spin, {
115
+ size: "small"
116
+ })
117
+ }), (((_v$quoteTeachModelLis = v.quoteTeachModelList) === null || _v$quoteTeachModelLis === void 0 ? void 0 : _v$quoteTeachModelLis.length) > 0 || ((_v$quoteProductList = v.quoteProductList) === null || _v$quoteProductList === void 0 ? void 0 : _v$quoteProductList.length) > 0) && /*#__PURE__*/_jsx(References, {
118
+ quoteProductList: v.quoteProductList,
119
+ quoteTeachModelList: v.quoteTeachModelList
120
+ }), v.content && /*#__PURE__*/_jsx("div", {
121
+ className: styles.title,
122
+ children: replaceBraces(v.content)
123
+ }), v.messageFiles &&
124
+ /*#__PURE__*/
125
+ // 增加fileUrl校验,确保文件已上传
126
+ _jsx("div", {
127
+ className: styles.listBox,
128
+ children: /*#__PURE__*/_jsx(UploadList, {
129
+ file: v.messageFiles,
130
+ showDel: false,
131
+ handleDelFile: function handleDelFile() {},
132
+ handleReTry: handleReTry
133
+ })
134
+ }), v.content && /*#__PURE__*/_jsx("div", {
135
+ className: styles.copyBtn,
136
+ children: /*#__PURE__*/_jsx(CopyButton, {
137
+ item: v,
138
+ onCopyCallback: onCopyCallback
139
+ })
140
+ })]
141
+ }), (v === null || v === void 0 ? void 0 : v.type) === 1 && /*#__PURE__*/_jsx(AnswerItem, {
142
+ item: v,
143
+ showOpera: showOpera,
144
+ onSucess: onSucessExcel,
145
+ onFailure: onFailureExcel,
146
+ onRetry: onRetryExcel,
147
+ onCopyCallback: onCopyCallback,
148
+ onLikeCallback: onLikeCallback,
149
+ onUnLikeCallback: onUnLikeCallback,
150
+ showCommend: showCommend,
151
+ handleClickPromptWord: handleClickPromptWord,
152
+ handleShowCourse: handleShowCourse,
153
+ handleClickAskList: handleClickAskList,
154
+ playTTSByText: playTTSByText,
155
+ stopTTSByText: stopTTSByText,
156
+ isVoicePlaying: isPlaying,
157
+ onRegenerateClick: onRegenerateClick,
158
+ enableCopy: enableCopy,
159
+ enableLike: enableLike,
160
+ enableUnLike: enableUnLike,
161
+ enableRegenerate: enableRegenerate,
162
+ enableVoicePlay: enableVoicePlay
163
+ })]
164
+ }, String(v.id))
165
+ }, v.id);
166
+ }), msgLoading && /*#__PURE__*/_jsx("div", {
167
+ className: styles.answerLoading,
168
+ children: /*#__PURE__*/_jsx(LottieImg, {
169
+ name: "aiLoading",
170
+ size: [20, 40]
171
+ })
172
+ })]
173
+ })
174
+ })
175
+ });
166
176
  };
167
177
  export default MessageList;