@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.
- package/dist/apis/useApi.d.ts +2 -0
- package/dist/apis/useApi.js +50 -2
- package/dist/components/ai-chat-dialogue/index.js +135 -181
- package/dist/components/ai-correction/index.js +25 -38
- package/dist/components/ai-loading/index.js +8 -12
- package/dist/components/answer-item/index.d.ts +3 -0
- package/dist/components/answer-item/index.js +126 -135
- package/dist/components/ask-card/index.js +33 -42
- package/dist/components/chat-input/extension/index.d.ts +2 -0
- package/dist/components/chat-input/extension/index.js +2 -0
- package/dist/components/chat-input/extension/keydown/index.d.ts +3 -0
- package/dist/components/chat-input/extension/keydown/index.js +37 -0
- package/dist/components/chat-input/extension/title-slot/Component.d.ts +4 -0
- package/dist/components/chat-input/extension/title-slot/Component.js +18 -0
- package/dist/components/chat-input/extension/title-slot/index.d.ts +3 -0
- package/dist/components/chat-input/extension/title-slot/index.js +47 -0
- package/dist/components/chat-input/extension/title-slot/index.less +22 -0
- package/dist/components/chat-input/index.d.ts +4 -0
- package/dist/components/chat-input/index.js +144 -145
- package/dist/components/chat-input/index.module.css +7 -0
- package/dist/components/chat-voice/VoiceCommunication.js +21 -23
- package/dist/components/chat-voice/VoiceRecord.js +21 -24
- package/dist/components/conversation-delete/index.js +8 -10
- package/dist/components/dots-loading/index.js +7 -10
- package/dist/components/empty/index.js +7 -12
- package/dist/components/excel-components/ExcelCard.js +3 -7
- package/dist/components/excel-components/ExcelExcuting.js +43 -60
- package/dist/components/excel-components/ExcelFailCard.js +10 -15
- package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -1
- package/dist/components/excel-components/ExcelSuccessCard.js +13 -6
- package/dist/components/file-card/fileCardSidebar.js +17 -23
- package/dist/components/file-card/index.d.ts +3 -0
- package/dist/components/file-card/index.js +59 -69
- package/dist/components/file-card/index.module.css +1 -1
- package/dist/components/file-preview/index.js +62 -37
- package/dist/components/file-preview/index.module.css +33 -0
- package/dist/components/file-upload/index.js +7 -10
- package/dist/components/file-upload/uploadV1.js +27 -33
- package/dist/components/gimi-sidebar/index.js +13 -20
- package/dist/components/header/index.js +11 -18
- package/dist/components/iconfont-com/index.js +33 -12
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/knowledge-trace/KnowledgeIconComponent.js +22 -28
- package/dist/components/knowledge-trace/classList.js +28 -37
- package/dist/components/knowledge-trace/documentList.js +27 -36
- package/dist/components/knowledge-trace/index.js +21 -28
- package/dist/components/knowledge-trace/videoList.js +36 -46
- package/dist/components/lottie-img/index.js +8 -10
- package/dist/components/message-actions/CopyButton.d.ts +1 -1
- package/dist/components/message-actions/CopyButton.js +22 -25
- package/dist/components/message-actions/LikeButton.js +22 -25
- package/dist/components/message-actions/RegenerateButton.js +18 -21
- package/dist/components/message-actions/UnLikeButton.js +22 -25
- package/dist/components/message-actions/VoicePlay.js +22 -25
- package/dist/components/message-list/index.js +83 -87
- package/dist/components/no-microphone-root/index.js +29 -39
- package/dist/components/preset-agent-content/index.d.ts +1 -0
- package/dist/components/preset-agent-content/index.js +27 -20
- package/dist/components/quoted-content/index.d.ts +3 -0
- package/dist/components/quoted-content/index.js +271 -163
- package/dist/components/quoted-content/index.module.css +20 -0
- package/dist/components/reasoning-content/index.d.ts +3 -2
- package/dist/components/reasoning-content/index.js +50 -61
- package/dist/components/reference-content/index.js +62 -71
- package/dist/components/reference-content/index.module.css +1 -0
- package/dist/components/search-result/index.d.ts +7 -0
- package/dist/components/search-result/index.js +182 -0
- package/dist/components/search-result/index.module.css +235 -0
- package/dist/components/templates/CommonChat.js +75 -79
- package/dist/components/templates/GimiChatComponent.js +6 -13
- package/dist/components/templates/demo/demo.js +109 -103
- package/dist/components/upload-list/index.js +41 -56
- package/dist/components/voice-bars/index.js +19 -22
- package/dist/components/voice-check-dialog/index.js +17 -24
- package/dist/components/voice-recording/index.js +42 -57
- package/dist/components/work-flow-content/demo.js +1 -2
- package/dist/components/work-flow-content/index.js +8 -11
- package/dist/hooks/useChatActions.d.ts +1 -1
- package/dist/hooks/useChatActions.js +3 -1
- package/dist/hooks/useCommonChatAPI.d.ts +2 -1
- package/dist/hooks/useCommonChatAPI.js +10 -8
- package/dist/hooks/useQuoted.d.ts +12 -0
- package/dist/hooks/useQuoted.js +202 -0
- package/dist/utils/aes.d.ts +21 -0
- package/dist/utils/aes.js +61 -0
- package/dist/utils/chatInputUtil.d.ts +1 -1
- package/dist/utils/chatInputUtil.js +4 -3
- package/package.json +6 -2
|
@@ -4,8 +4,6 @@ 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";
|
|
9
7
|
var VideoItem = function VideoItem(_ref) {
|
|
10
8
|
var _konwledgeTraceState$;
|
|
11
9
|
var item = _ref.item;
|
|
@@ -49,53 +47,45 @@ var VideoItem = function VideoItem(_ref) {
|
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
53
51
|
className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
|
|
54
|
-
onClick: handleClick
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
});
|
|
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")));
|
|
86
77
|
};
|
|
87
78
|
var VideoList = function VideoList(_ref2) {
|
|
88
79
|
var list = _ref2.list;
|
|
89
|
-
return /*#__PURE__*/
|
|
90
|
-
className: styles.knowledgeList
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
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
|
+
}));
|
|
100
90
|
};
|
|
101
91
|
export default VideoList;
|
|
@@ -13,7 +13,6 @@ 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";
|
|
17
16
|
var names = [{
|
|
18
17
|
name: 'live',
|
|
19
18
|
value: live
|
|
@@ -85,17 +84,16 @@ var LottieImg = function LottieImg(_ref) {
|
|
|
85
84
|
pathFillColor: '#ff0000',
|
|
86
85
|
pathStrokeColor: '#000000'
|
|
87
86
|
};
|
|
88
|
-
return /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
89
88
|
style: {
|
|
90
89
|
pointerEvents: 'none',
|
|
91
90
|
margin: '0 auto'
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
91
|
+
}
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Lottie, {
|
|
93
|
+
params: defaultOptions,
|
|
94
|
+
width: width,
|
|
95
|
+
height: height,
|
|
96
|
+
style: _objectSpread({}, style)
|
|
97
|
+
}));
|
|
100
98
|
};
|
|
101
99
|
export default LottieImg;
|
|
@@ -2,35 +2,32 @@ 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";
|
|
6
5
|
var CopyButton = function CopyButton(_ref) {
|
|
7
6
|
var item = _ref.item,
|
|
8
7
|
onCopyCallback = _ref.onCopyCallback;
|
|
9
8
|
var _usePureChatActions = usePureChatActions(),
|
|
10
9
|
copyToClipboard = _usePureChatActions.copyToClipboard;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
content: "\u590D\u5236"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
});
|
|
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
|
+
})));
|
|
35
32
|
};
|
|
36
33
|
export default CopyButton;
|
|
@@ -3,35 +3,32 @@ 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";
|
|
7
6
|
var LikeButton = function LikeButton(_ref) {
|
|
8
7
|
var item = _ref.item,
|
|
9
8
|
onLikeCallback = _ref.onLikeCallback;
|
|
10
9
|
var _usePureChatActions = usePureChatActions(),
|
|
11
10
|
handleUnlove = _usePureChatActions.handleUnlove;
|
|
12
|
-
return /*#__PURE__*/
|
|
13
|
-
content: "".concat(item.mark === 2 ? '已点赞' : '点赞')
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
});
|
|
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
|
+
})));
|
|
36
33
|
};
|
|
37
34
|
export default LikeButton;
|
|
@@ -3,28 +3,25 @@
|
|
|
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";
|
|
7
6
|
var RegenerateButton = function RegenerateButton(_ref) {
|
|
8
7
|
var onRegenerateClick = _ref.onRegenerateClick;
|
|
9
|
-
return /*#__PURE__*/
|
|
10
|
-
content: "\u91CD\u65B0\u751F\u6210"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
});
|
|
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
|
+
})));
|
|
29
26
|
};
|
|
30
27
|
export default RegenerateButton;
|
|
@@ -3,35 +3,32 @@ 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";
|
|
7
6
|
var UnLikeButton = function UnLikeButton(_ref) {
|
|
8
7
|
var item = _ref.item,
|
|
9
8
|
onUnLikeCallback = _ref.onUnLikeCallback;
|
|
10
9
|
var _usePureChatActions = usePureChatActions(),
|
|
11
10
|
handleUnlove = _usePureChatActions.handleUnlove;
|
|
12
|
-
return /*#__PURE__*/
|
|
13
|
-
content: "".concat(item.mark === 1 ? '已点踩' : '点踩')
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
});
|
|
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
|
+
})));
|
|
36
33
|
};
|
|
37
34
|
export default UnLikeButton;
|
|
@@ -8,7 +8,6 @@ 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";
|
|
12
11
|
var getCleanReadText = function getCleanReadText(text) {
|
|
13
12
|
// 移除<knowledge>标签及内容
|
|
14
13
|
var newText = text.replace(/<knowledge>.*?<\/knowledge>/g, '').replace(/<excel>.*?<\/excel>/g, '');
|
|
@@ -49,29 +48,27 @@ var VoicePlay = function VoicePlay(props) {
|
|
|
49
48
|
return _ref.apply(this, arguments);
|
|
50
49
|
};
|
|
51
50
|
}();
|
|
52
|
-
return /*#__PURE__*/
|
|
53
|
-
content: isActive ? '暂停朗读' : '语音朗读'
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
})
|
|
75
|
-
});
|
|
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
|
+
})));
|
|
76
73
|
};
|
|
77
74
|
export default VoicePlay;
|
|
@@ -16,9 +16,6 @@ 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";
|
|
22
19
|
var MessageList = function MessageList(_ref) {
|
|
23
20
|
var chatList = _ref.chatList,
|
|
24
21
|
handleSend = _ref.handleSend,
|
|
@@ -36,11 +33,14 @@ var MessageList = function MessageList(_ref) {
|
|
|
36
33
|
enableUnLike = _ref.enableUnLike,
|
|
37
34
|
enableRegenerate = _ref.enableRegenerate,
|
|
38
35
|
enableVoicePlay = _ref.enableVoicePlay,
|
|
39
|
-
model = _ref.model,
|
|
36
|
+
_ref$model = _ref.model,
|
|
37
|
+
model = _ref$model === void 0 ? 'fullscreen' : _ref$model,
|
|
40
38
|
onRegenerateClick = _ref.onRegenerateClick,
|
|
41
39
|
onCopyCallback = _ref.onCopyCallback,
|
|
42
40
|
onLikeCallback = _ref.onLikeCallback,
|
|
43
|
-
onUnLikeCallback = _ref.onUnLikeCallback
|
|
41
|
+
onUnLikeCallback = _ref.onUnLikeCallback,
|
|
42
|
+
onDownloadCallback = _ref.onDownloadCallback,
|
|
43
|
+
reasoningTitle = _ref.reasoningTitle;
|
|
44
44
|
var _useGimiFileUpload = useGimiFileUpload(),
|
|
45
45
|
handleSSEFileAnalyize = _useGimiFileUpload.handleSSEFileAnalyize,
|
|
46
46
|
fileUpload = _useGimiFileUpload.fileUpload;
|
|
@@ -91,87 +91,83 @@ var MessageList = function MessageList(_ref) {
|
|
|
91
91
|
var handleShowCourse = useCallback(function (v) {
|
|
92
92
|
chatUI.showCourse(v.messageId ? v.messageId : v.chatId, v.videoResourceList);
|
|
93
93
|
}, [chatUI]);
|
|
94
|
-
return /*#__PURE__*/
|
|
95
|
-
className: classNames(styles.main)
|
|
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
|
-
});
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: classNames(styles.main)
|
|
96
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: classNames(model === 'sidebar' ? styles.small_container : styles.container)
|
|
98
|
+
}, chatList.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: styles.textWrap
|
|
100
|
+
}, chatList.map(function (v) {
|
|
101
|
+
var _v$quoteTeachModelLis, _v$quoteProductList;
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
key: v.id
|
|
104
|
+
}, v.isSystemAuto !== 1 && /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
key: String(v.id),
|
|
106
|
+
className: classNames(styles.textItem, _defineProperty({}, styles.question, (v === null || v === void 0 ? void 0 : v.type) === 0)),
|
|
107
|
+
onMouseLeave: function onMouseLeave() {
|
|
108
|
+
return chatUI.setShowCopyId(0);
|
|
109
|
+
},
|
|
110
|
+
onMouseEnter: function onMouseEnter() {
|
|
111
|
+
if (!v.loading) chatUI.setShowCopyId(v.id);
|
|
112
|
+
}
|
|
113
|
+
}, (v === null || v === void 0 ? void 0 : v.type) === 0 && /*#__PURE__*/React.createElement(React.Fragment, null, v.status !== 1 && /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: styles.qusetionOpera
|
|
115
|
+
}, v.status === 0 && /*#__PURE__*/React.createElement(Spin, {
|
|
116
|
+
size: "small"
|
|
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__*/React.createElement(References, {
|
|
118
|
+
quoteProductList: v.quoteProductList,
|
|
119
|
+
quoteTeachModelList: v.quoteTeachModelList
|
|
120
|
+
}), v.content && /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
className: styles.title
|
|
122
|
+
}, replaceBraces(v.content)), 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
|
+
style: {
|
|
135
|
+
opacity: showOpera(v.id) ? 1 : 0
|
|
136
|
+
}
|
|
137
|
+
}, /*#__PURE__*/React.createElement(CopyButton, {
|
|
138
|
+
item: replaceBraces(v.content),
|
|
139
|
+
onCopyCallback: onCopyCallback
|
|
140
|
+
}))), (v === null || v === void 0 ? void 0 : v.type) === 1 && /*#__PURE__*/React.createElement(AnswerItem, {
|
|
141
|
+
item: v,
|
|
142
|
+
showOpera: showOpera,
|
|
143
|
+
onSucess: onSucessExcel,
|
|
144
|
+
onFailure: onFailureExcel,
|
|
145
|
+
onRetry: onRetryExcel,
|
|
146
|
+
onCopyCallback: onCopyCallback,
|
|
147
|
+
onLikeCallback: onLikeCallback,
|
|
148
|
+
onUnLikeCallback: onUnLikeCallback,
|
|
149
|
+
showCommend: showCommend,
|
|
150
|
+
handleClickPromptWord: handleClickPromptWord,
|
|
151
|
+
handleShowCourse: handleShowCourse,
|
|
152
|
+
handleClickAskList: handleClickAskList,
|
|
153
|
+
playTTSByText: playTTSByText,
|
|
154
|
+
stopTTSByText: stopTTSByText,
|
|
155
|
+
isVoicePlaying: isPlaying,
|
|
156
|
+
onRegenerateClick: onRegenerateClick,
|
|
157
|
+
enableCopy: enableCopy,
|
|
158
|
+
enableLike: enableLike,
|
|
159
|
+
enableUnLike: enableUnLike,
|
|
160
|
+
enableRegenerate: enableRegenerate,
|
|
161
|
+
enableVoicePlay: enableVoicePlay,
|
|
162
|
+
onDownloadCallback: onDownloadCallback,
|
|
163
|
+
reasoningTitle: reasoningTitle,
|
|
164
|
+
model: model
|
|
165
|
+
})));
|
|
166
|
+
}), msgLoading && /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
className: styles.answerLoading
|
|
168
|
+
}, /*#__PURE__*/React.createElement(LottieImg, {
|
|
169
|
+
name: "aiLoading",
|
|
170
|
+
size: [20, 40]
|
|
171
|
+
})))));
|
|
176
172
|
};
|
|
177
173
|
export default MessageList;
|