@myun/gimi-chat 0.9.6 → 0.9.8
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/client/components/history-list/index.js +14 -11
- package/dist/client/components/slider/index.js +5 -2
- package/dist/client/core/index.js +6 -2
- package/dist/components/ai-chat-dialogue/index.js +26 -23
- package/dist/components/ai-loading/index.js +4 -1
- package/dist/components/answer-item/index.js +7 -4
- package/dist/components/ask-card/index.js +5 -2
- package/dist/components/ask-card/index.module.css +8 -1
- package/dist/components/chat-input/index.js +29 -25
- package/dist/components/chat-voice/VoiceCommunication.js +6 -4
- package/dist/components/chat-voice/VoiceRecord.js +6 -3
- package/dist/components/conversation-delete/index.js +5 -2
- package/dist/components/excel-components/ExcelExcuting.js +28 -23
- package/dist/components/excel-components/ExcelFailCard.js +4 -1
- package/dist/components/excel-components/ExcelSuccessCard.js +8 -5
- package/dist/components/excel-components/index.module.css +1 -1
- package/dist/components/file-card/fileCardSidebar.js +7 -2
- package/dist/components/file-card/index.js +10 -5
- package/dist/components/file-card/index.module.css +3 -1
- package/dist/components/file-upload/index.js +15 -7
- package/dist/components/file-upload/uploadV1.js +15 -8
- package/dist/components/knowledge-trace/KnowledgeIconComponent.js +10 -2
- package/dist/components/knowledge-trace/classList.js +11 -4
- package/dist/components/knowledge-trace/documentList.js +11 -4
- package/dist/components/knowledge-trace/index.js +6 -3
- package/dist/components/knowledge-trace/index.module.css +6 -3
- package/dist/components/knowledge-trace/videoList.js +16 -6
- package/dist/components/message-actions/CopyButton.js +4 -1
- package/dist/components/message-actions/LikeButton.js +4 -1
- package/dist/components/message-actions/RegenerateButton.js +5 -2
- package/dist/components/message-actions/UnLikeButton.js +4 -1
- package/dist/components/message-actions/VoicePlay.js +6 -2
- package/dist/components/no-microphone-root/index.js +9 -7
- package/dist/components/no-microphone-root/index.module.css +10 -1
- package/dist/components/product-tag/index.js +10 -7
- package/dist/components/quoted-content/index.js +17 -12
- package/dist/components/reasoning-content/index.js +8 -5
- package/dist/components/reasoning-search/index.d.ts +1 -1
- package/dist/components/reasoning-search/index.js +15 -6
- package/dist/components/reference-content/index.js +10 -3
- package/dist/components/search-course-list/index.js +13 -6
- package/dist/components/search-course-list/index.module.css +6 -3
- package/dist/components/search-course-list/sidebar.js +7 -2
- package/dist/components/templates/GimiChatComponent.js +5 -1
- package/dist/components/unified-sidebar/FileListContent.js +8 -2
- package/dist/components/unified-sidebar/KnowledgeTraceContent.d.ts +1 -0
- package/dist/components/unified-sidebar/KnowledgeTraceContent.js +33 -3
- package/dist/components/unified-sidebar/SearchCourseListContent.js +8 -4
- package/dist/components/unified-sidebar/index.js +14 -8
- package/dist/components/upload-list/index.js +6 -3
- package/dist/components/voice-recording/index.js +10 -7
- package/dist/components/work-flow-content/index.js +7 -1
- package/dist/hooks/useChatActions.js +9 -6
- package/dist/hooks/useChatHistory.js +4 -1
- package/dist/hooks/useChatRecommend.js +7 -4
- package/dist/hooks/useChatStream.js +12 -2
- package/dist/hooks/useChatVoice.js +12 -6
- package/dist/hooks/useCommonChatAPI.js +25 -21
- package/dist/hooks/useFile.js +14 -9
- package/dist/hooks/useLongPoll.js +5 -2
- package/dist/hooks/useSearchCase.js +5 -2
- package/dist/i18n/GimiChatI18nProvider.d.ts +9 -0
- package/dist/i18n/GimiChatI18nProvider.js +25 -0
- package/dist/i18n/core.d.ts +12 -0
- package/dist/i18n/core.js +71 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/locales/en-US.d.ts +216 -0
- package/dist/i18n/locales/en-US.js +242 -0
- package/dist/i18n/locales/zh-CN.d.ts +216 -0
- package/dist/i18n/locales/zh-CN.js +242 -0
- package/dist/i18n/useGimiChatTranslation.d.ts +2 -0
- package/dist/i18n/useGimiChatTranslation.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/chat.d.ts +4 -1
- package/dist/types/modules.d.ts +1 -0
- package/dist/umd/index.min.js +1 -1
- package/dist/utils/tools.d.ts +1 -1
- package/dist/utils/tools.js +5 -5
- package/dist/utils/voice-stream.d.ts +2 -0
- package/dist/utils/voice-stream.js +43 -20
- package/package.json +6 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import styles from "./index.module.css";
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import { documentConstants } from "../../constants";
|
|
@@ -8,6 +9,8 @@ var SUPPORT_PREVIEW_FILE_TYPE = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'];
|
|
|
8
9
|
var FileItem = function FileItem(_ref) {
|
|
9
10
|
var _konwledgeTraceState$;
|
|
10
11
|
var item = _ref.item;
|
|
12
|
+
var _useTranslation = useTranslation(),
|
|
13
|
+
t = _useTranslation.t;
|
|
11
14
|
var konwledgeTraceState = useAppSelector(function (state) {
|
|
12
15
|
return state.gimiMenu.sidebar.knowledgeTrace;
|
|
13
16
|
});
|
|
@@ -19,7 +22,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
19
22
|
})) === null || _konwledgeTraceState$ === void 0 ? void 0 : _konwledgeTraceState$.includes("".concat(item.hostId));
|
|
20
23
|
var handleClick = function handleClick() {
|
|
21
24
|
if (item.isDelete === 1) return;
|
|
22
|
-
if (platform !== 'myun') return Toast.warning('
|
|
25
|
+
if (platform !== 'myun') return Toast.warning(t('trace.jumpUnsupported'));
|
|
23
26
|
var searchParams = "gradeId=".concat(item.gradeId, "&teachModuleId=").concat(item.id, "&outlineId=").concat(item.courseId, "&phaseId=").concat(item.phaseId);
|
|
24
27
|
if (!item.gradeId) {
|
|
25
28
|
if (SUPPORT_PREVIEW_FILE_TYPE.includes(item.suffix)) {
|
|
@@ -44,7 +47,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
44
47
|
className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
|
|
45
48
|
onClick: handleClick
|
|
46
49
|
}, /*#__PURE__*/React.createElement("img", {
|
|
47
|
-
alt:
|
|
50
|
+
alt: t('trace.document.coverAlt'),
|
|
48
51
|
className: styles.img,
|
|
49
52
|
src: documentConstants[item.suffix] || documentConstants.default
|
|
50
53
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -57,15 +60,19 @@ var FileItem = function FileItem(_ref) {
|
|
|
57
60
|
className: styles.timeTrace
|
|
58
61
|
}, "".concat(item.suffix, " | ").concat(item.sizeUnit)), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
|
|
59
62
|
className: styles.knowledge_trace_deactive
|
|
60
|
-
},
|
|
63
|
+
}, t('trace.document.invalid'))));
|
|
61
64
|
};
|
|
62
65
|
var DocumentList = function DocumentList(_ref2) {
|
|
63
66
|
var list = _ref2.list;
|
|
67
|
+
var _useTranslation2 = useTranslation(),
|
|
68
|
+
t = _useTranslation2.t;
|
|
64
69
|
return /*#__PURE__*/React.createElement("div", {
|
|
65
70
|
className: styles.knowledgeList
|
|
66
71
|
}, /*#__PURE__*/React.createElement("span", {
|
|
67
72
|
className: styles.total
|
|
68
|
-
},
|
|
73
|
+
}, t('trace.document.total', {
|
|
74
|
+
count: (list === null || list === void 0 ? void 0 : list.length) || 0
|
|
75
|
+
})), list.map(function (item) {
|
|
69
76
|
return /*#__PURE__*/React.createElement(FileItem, {
|
|
70
77
|
item: item,
|
|
71
78
|
key: item.id
|
|
@@ -5,6 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
8
9
|
import styles from "./index.module.css";
|
|
9
10
|
import { useAppSelector, useAppDispatch } from "../../store/hooks";
|
|
10
11
|
import { setShowKonwledgeTrace, setKonwledgeTraceState } from "../../store/slices/gimiMenuSlice";
|
|
@@ -22,6 +23,8 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
|
22
23
|
className = _ref.className,
|
|
23
24
|
style = _ref.style,
|
|
24
25
|
onCurrentTraceVideoClick = _ref.onCurrentTraceVideoClick;
|
|
26
|
+
var _useTranslation = useTranslation(),
|
|
27
|
+
t = _useTranslation.t;
|
|
25
28
|
var showKonwledgeTrace = useAppSelector(function (state) {
|
|
26
29
|
return state.gimiMenu.showKonwledgeTrace;
|
|
27
30
|
});
|
|
@@ -58,13 +61,13 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
|
58
61
|
setTabList(function () {
|
|
59
62
|
return kowledgeTraceList.map(function (item) {
|
|
60
63
|
return {
|
|
61
|
-
name: item.type === 'document' ? '
|
|
64
|
+
name: item.type === 'document' ? t('knowledgeTrace.type.document') : item.type === 'video' ? t('knowledgeTrace.type.video') : t('knowledgeTrace.type.course'),
|
|
62
65
|
type: item.type
|
|
63
66
|
};
|
|
64
67
|
});
|
|
65
68
|
});
|
|
66
69
|
}
|
|
67
|
-
}, [kowledgeTraceList]);
|
|
70
|
+
}, [kowledgeTraceList, t]);
|
|
68
71
|
var _useKnowledgeService = useKnowledgeService(kowledgeTraceList),
|
|
69
72
|
videoSliceList = _useKnowledgeService.videoSliceList,
|
|
70
73
|
documentList = _useKnowledgeService.documentList,
|
|
@@ -132,7 +135,7 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
|
132
135
|
show: showKonwledgeTrace,
|
|
133
136
|
isOverFlow: isOverFlow,
|
|
134
137
|
ref: tabPaneRef,
|
|
135
|
-
title:
|
|
138
|
+
title: t('trace.title'),
|
|
136
139
|
handleClose: handleClose,
|
|
137
140
|
style: style,
|
|
138
141
|
className: className,
|
|
@@ -157,7 +157,8 @@
|
|
|
157
157
|
line-height: 18px;
|
|
158
158
|
letter-spacing: 0px;
|
|
159
159
|
text-align: center;
|
|
160
|
-
width:
|
|
160
|
+
width: fit-content;
|
|
161
|
+
padding: 0 5px;
|
|
161
162
|
height: 18px;
|
|
162
163
|
border-radius: 4px;
|
|
163
164
|
float: left;
|
|
@@ -172,7 +173,8 @@
|
|
|
172
173
|
line-height: 18px;
|
|
173
174
|
letter-spacing: 0px;
|
|
174
175
|
text-align: center;
|
|
175
|
-
width:
|
|
176
|
+
width: fit-content;
|
|
177
|
+
padding: 0 5px;
|
|
176
178
|
height: 18px;
|
|
177
179
|
border-radius: 4px;
|
|
178
180
|
float: left;
|
|
@@ -187,7 +189,8 @@
|
|
|
187
189
|
line-height: 18px;
|
|
188
190
|
letter-spacing: 0px;
|
|
189
191
|
text-align: center;
|
|
190
|
-
width:
|
|
192
|
+
width: fit-content;
|
|
193
|
+
padding: 0 5px;
|
|
191
194
|
height: 18px;
|
|
192
195
|
border-radius: 4px;
|
|
193
196
|
float: left;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import styles from "./index.module.css";
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import { knowledgeConstants } from "../../constants";
|
|
@@ -8,6 +9,8 @@ var VideoItem = function VideoItem(_ref) {
|
|
|
8
9
|
var _konwledgeTraceState$;
|
|
9
10
|
var item = _ref.item,
|
|
10
11
|
onClick = _ref.onClick;
|
|
12
|
+
var _useTranslation = useTranslation(),
|
|
13
|
+
t = _useTranslation.t;
|
|
11
14
|
var konwledgeTraceState = useAppSelector(function (state) {
|
|
12
15
|
return state.gimiMenu.sidebar.knowledgeTrace;
|
|
13
16
|
});
|
|
@@ -24,7 +27,7 @@ var VideoItem = function VideoItem(_ref) {
|
|
|
24
27
|
teachModelId = _useAppSelector.teachModelId;
|
|
25
28
|
var handleClick = function handleClick() {
|
|
26
29
|
if (item.isDelete === 1) return;
|
|
27
|
-
if (platform !== 'myun') return Toast.warning('
|
|
30
|
+
if (platform !== 'myun') return Toast.warning(t('trace.jumpUnsupported'));
|
|
28
31
|
var searchParams = "gradeId=".concat(item.gradeId, "&teachModuleId=").concat(item.id, "&outlineId=").concat(item.courseId, "&phaseId=").concat(item.phaseId);
|
|
29
32
|
if (item.isJoinClass) {
|
|
30
33
|
// 如果溯源就是当前视频,直接跳转到溯源的进度
|
|
@@ -50,11 +53,11 @@ var VideoItem = function VideoItem(_ref) {
|
|
|
50
53
|
position: 'relative'
|
|
51
54
|
}
|
|
52
55
|
}, /*#__PURE__*/React.createElement("img", {
|
|
53
|
-
alt:
|
|
56
|
+
alt: t('trace.video.coverAlt'),
|
|
54
57
|
className: styles.class_img,
|
|
55
58
|
src: item.coverUrl || knowledgeConstants.VIDEO_DEFAULT_COVER_ADDRESS
|
|
56
59
|
}), /*#__PURE__*/React.createElement("img", {
|
|
57
|
-
alt:
|
|
60
|
+
alt: t('trace.video.playAlt'),
|
|
58
61
|
className: styles.class_img_play,
|
|
59
62
|
src: knowledgeConstants.VIDEO_PLAY_ICON_ADDRESS
|
|
60
63
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -66,18 +69,25 @@ var VideoItem = function VideoItem(_ref) {
|
|
|
66
69
|
className: styles.text
|
|
67
70
|
}, item.name)), /*#__PURE__*/React.createElement("div", {
|
|
68
71
|
className: styles.timeTrace
|
|
69
|
-
},
|
|
72
|
+
}, t('trace.video.segment', {
|
|
73
|
+
start: item.startedAt || "0'0\"",
|
|
74
|
+
end: item.endedAt || "0'0\""
|
|
75
|
+
})), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
|
|
70
76
|
className: styles.knowledge_trace_deactive
|
|
71
|
-
},
|
|
77
|
+
}, t('trace.video.invalid'))));
|
|
72
78
|
};
|
|
73
79
|
var VideoList = function VideoList(_ref2) {
|
|
74
80
|
var list = _ref2.list,
|
|
75
81
|
onCurrentTraceVideoClick = _ref2.onCurrentTraceVideoClick;
|
|
82
|
+
var _useTranslation2 = useTranslation(),
|
|
83
|
+
t = _useTranslation2.t;
|
|
76
84
|
return /*#__PURE__*/React.createElement("div", {
|
|
77
85
|
className: styles.knowledgeList
|
|
78
86
|
}, /*#__PURE__*/React.createElement("span", {
|
|
79
87
|
className: styles.total
|
|
80
|
-
},
|
|
88
|
+
}, t('trace.video.total', {
|
|
89
|
+
count: (list === null || list === void 0 ? void 0 : list.length) || 0
|
|
90
|
+
})), list.map(function (item) {
|
|
81
91
|
return /*#__PURE__*/React.createElement(VideoItem, {
|
|
82
92
|
item: item,
|
|
83
93
|
key: item.id,
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
2
3
|
import { Tooltip } from '@douyinfe/semi-ui';
|
|
3
4
|
import { usePureChatActions } from "../../hooks/useChatActions";
|
|
4
5
|
import copyIcon from "../../assets/image/copyIcon.png";
|
|
5
6
|
var CopyButton = function CopyButton(_ref) {
|
|
6
7
|
var item = _ref.item,
|
|
7
8
|
onCopyCallback = _ref.onCopyCallback;
|
|
9
|
+
var _useTranslation = useTranslation(),
|
|
10
|
+
t = _useTranslation.t;
|
|
8
11
|
var _usePureChatActions = usePureChatActions(),
|
|
9
12
|
copyToClipboard = _usePureChatActions.copyToClipboard;
|
|
10
13
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
11
|
-
content:
|
|
14
|
+
content: t('messageAction.copy')
|
|
12
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
13
16
|
style: {
|
|
14
17
|
display: 'flex',
|
|
@@ -3,13 +3,16 @@ 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 { useTranslation } from 'react-i18next';
|
|
6
7
|
var LikeButton = function LikeButton(_ref) {
|
|
7
8
|
var item = _ref.item,
|
|
8
9
|
onLikeCallback = _ref.onLikeCallback;
|
|
10
|
+
var _useTranslation = useTranslation(),
|
|
11
|
+
t = _useTranslation.t;
|
|
9
12
|
var _usePureChatActions = usePureChatActions(),
|
|
10
13
|
handleUnlove = _usePureChatActions.handleUnlove;
|
|
11
14
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
12
|
-
content: "".concat(item.mark === 2 ? '
|
|
15
|
+
content: "".concat(item.mark === 2 ? t('messageAction.likeDone') : t('messageAction.like'))
|
|
13
16
|
}, /*#__PURE__*/React.createElement("div", {
|
|
14
17
|
style: {
|
|
15
18
|
display: 'flex',
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// import { IChatMessageItem } from '../../interfaces/chatMessage';
|
|
2
2
|
// import useChatActions from '../../hooks/useChatActions';
|
|
3
|
-
import { Tooltip } from '@douyinfe/semi-ui';
|
|
4
3
|
import React from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { Tooltip } from '@douyinfe/semi-ui';
|
|
5
6
|
import { IconRedoStroked } from '@douyinfe/semi-icons';
|
|
6
7
|
var RegenerateButton = function RegenerateButton(_ref) {
|
|
7
8
|
var onRegenerateClick = _ref.onRegenerateClick;
|
|
9
|
+
var _useTranslation = useTranslation(),
|
|
10
|
+
t = _useTranslation.t;
|
|
8
11
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
9
|
-
content:
|
|
12
|
+
content: t('messageAction.regenerate')
|
|
10
13
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11
14
|
style: {
|
|
12
15
|
display: 'flex',
|
|
@@ -3,13 +3,16 @@ 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 { useTranslation } from 'react-i18next';
|
|
6
7
|
var UnLikeButton = function UnLikeButton(_ref) {
|
|
7
8
|
var item = _ref.item,
|
|
8
9
|
onUnLikeCallback = _ref.onUnLikeCallback;
|
|
10
|
+
var _useTranslation = useTranslation(),
|
|
11
|
+
t = _useTranslation.t;
|
|
9
12
|
var _usePureChatActions = usePureChatActions(),
|
|
10
13
|
handleUnlove = _usePureChatActions.handleUnlove;
|
|
11
14
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
12
|
-
content: "".concat(item.mark === 1 ? '
|
|
15
|
+
content: "".concat(item.mark === 1 ? t('messageAction.dislikeDone') : t('messageAction.dislike'))
|
|
13
16
|
}, /*#__PURE__*/React.createElement("div", {
|
|
14
17
|
style: {
|
|
15
18
|
display: 'flex',
|
|
@@ -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 { useTranslation } from 'react-i18next';
|
|
11
12
|
var getCleanReadText = function getCleanReadText(text) {
|
|
12
13
|
// 移除<knowledge>标签及内容
|
|
13
14
|
var newText = text.replace(/<knowledge>.*?<\/knowledge>/g, '').replace(/<excel>.*?<\/excel>/g, '');
|
|
@@ -19,6 +20,8 @@ var VoicePlay = function VoicePlay(props) {
|
|
|
19
20
|
playTTSByText = props.playTTSByText,
|
|
20
21
|
stopTTSByText = props.stopTTSByText,
|
|
21
22
|
isVoicePlaying = props.isVoicePlaying;
|
|
23
|
+
var _useTranslation = useTranslation(),
|
|
24
|
+
t = _useTranslation.t;
|
|
22
25
|
var cleanedText = getCleanReadText(text);
|
|
23
26
|
var currentMessageId = useAppSelector(function (state) {
|
|
24
27
|
return state.gimiMenu.currentMessageId;
|
|
@@ -49,7 +52,7 @@ var VoicePlay = function VoicePlay(props) {
|
|
|
49
52
|
};
|
|
50
53
|
}();
|
|
51
54
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
52
|
-
content: isActive ? '
|
|
55
|
+
content: isActive ? t('voice.pauseReadAloud') : t('voice.readAloud')
|
|
53
56
|
}, /*#__PURE__*/React.createElement("div", {
|
|
54
57
|
style: {
|
|
55
58
|
display: 'flex',
|
|
@@ -68,7 +71,8 @@ var VoicePlay = function VoicePlay(props) {
|
|
|
68
71
|
display: 'flex',
|
|
69
72
|
alignItems: 'center'
|
|
70
73
|
},
|
|
71
|
-
src: soundOutIcon
|
|
74
|
+
src: soundOutIcon,
|
|
75
|
+
alt: t('voice.readAloud')
|
|
72
76
|
})));
|
|
73
77
|
};
|
|
74
78
|
export default VoicePlay;
|
|
@@ -2,20 +2,25 @@ import React from 'react';
|
|
|
2
2
|
import { Button } from '@douyinfe/semi-ui';
|
|
3
3
|
import styles from "./index.module.css";
|
|
4
4
|
import { IconClose, IconMicrophoneOffStroked } from '@douyinfe/semi-icons';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
5
6
|
export default function NoMicrophoneModalContent(_ref) {
|
|
6
7
|
var onOk = _ref.onOk;
|
|
8
|
+
var _useTranslation = useTranslation(),
|
|
9
|
+
t = _useTranslation.t;
|
|
7
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
8
11
|
className: styles.root
|
|
9
12
|
}, /*#__PURE__*/React.createElement("div", {
|
|
10
13
|
className: styles.title
|
|
11
|
-
}, /*#__PURE__*/React.createElement("span",
|
|
14
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
15
|
+
className: styles.titleText
|
|
16
|
+
}, t('voice.micPermissionTitle')), /*#__PURE__*/React.createElement(Button, {
|
|
12
17
|
theme: "borderless",
|
|
13
18
|
size: "small",
|
|
14
19
|
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
|
15
20
|
onClick: onOk
|
|
16
21
|
})), /*#__PURE__*/React.createElement("div", {
|
|
17
22
|
className: styles.desc
|
|
18
|
-
},
|
|
23
|
+
}, t('voice.micPermissionDesc')), /*#__PURE__*/React.createElement("div", {
|
|
19
24
|
className: styles.imgArea
|
|
20
25
|
}, /*#__PURE__*/React.createElement(IconMicrophoneOffStroked, {
|
|
21
26
|
style: {
|
|
@@ -27,10 +32,7 @@ export default function NoMicrophoneModalContent(_ref) {
|
|
|
27
32
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
28
33
|
type: "primary",
|
|
29
34
|
size: "small",
|
|
30
|
-
|
|
31
|
-
borderRadius: '24px',
|
|
32
|
-
padding: '10px'
|
|
33
|
-
},
|
|
35
|
+
className: styles.okBtn,
|
|
34
36
|
onClick: onOk
|
|
35
|
-
},
|
|
37
|
+
}, t('common.gotIt'))));
|
|
36
38
|
}
|
|
@@ -12,12 +12,20 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: space-between;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.titleText {
|
|
19
|
+
flex: 1;
|
|
20
|
+
min-width: 0;
|
|
21
|
+
word-break: break-word;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
.desc {
|
|
18
|
-
width:
|
|
25
|
+
width: 100%;
|
|
19
26
|
font-size: 12px;
|
|
20
27
|
color: rgba(31, 45, 61, 0.55);
|
|
28
|
+
word-break: break-word;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
.imgArea {
|
|
@@ -42,6 +50,7 @@
|
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
.okBtn {
|
|
53
|
+
width: 80px;
|
|
45
54
|
height: 32px;
|
|
46
55
|
padding: 0 18px;
|
|
47
56
|
border-radius: 16px;
|
|
@@ -16,8 +16,11 @@ import { useAppSelector } from "../../store/hooks";
|
|
|
16
16
|
import { useContext } from 'react';
|
|
17
17
|
import ChatContext from "../templates/chatContext";
|
|
18
18
|
import ShadowLoading from "../shadow-loading";
|
|
19
|
+
import { useTranslation } from 'react-i18next';
|
|
19
20
|
var ProductTag = function ProductTag(_ref) {
|
|
20
21
|
var value = _ref.value;
|
|
22
|
+
var _useTranslation = useTranslation(),
|
|
23
|
+
t = _useTranslation.t;
|
|
21
24
|
var platform = useAppSelector(function (state) {
|
|
22
25
|
return state.gimiMenu.platform;
|
|
23
26
|
});
|
|
@@ -39,14 +42,14 @@ var ProductTag = function ProductTag(_ref) {
|
|
|
39
42
|
_context.next = 2;
|
|
40
43
|
break;
|
|
41
44
|
}
|
|
42
|
-
return _context.abrupt("return", Toast.error('
|
|
45
|
+
return _context.abrupt("return", Toast.error(t('course.jumpUnsupported')));
|
|
43
46
|
case 2:
|
|
44
47
|
courseId = Number(value);
|
|
45
48
|
if (!isNaN(courseId)) {
|
|
46
49
|
_context.next = 5;
|
|
47
50
|
break;
|
|
48
51
|
}
|
|
49
|
-
return _context.abrupt("return", Toast.error('
|
|
52
|
+
return _context.abrupt("return", Toast.error(t('course.noValidCourse')));
|
|
50
53
|
case 5:
|
|
51
54
|
productType = 'single'; // 检查课程类型
|
|
52
55
|
_context.prev = 6;
|
|
@@ -63,14 +66,14 @@ var ProductTag = function ProductTag(_ref) {
|
|
|
63
66
|
_context.next = 16;
|
|
64
67
|
break;
|
|
65
68
|
case 15:
|
|
66
|
-
return _context.abrupt("return", Toast.error(res.message || '
|
|
69
|
+
return _context.abrupt("return", Toast.error(res.message || t('course.noValidCourse')));
|
|
67
70
|
case 16:
|
|
68
71
|
_context.next = 21;
|
|
69
72
|
break;
|
|
70
73
|
case 18:
|
|
71
74
|
_context.prev = 18;
|
|
72
75
|
_context.t0 = _context["catch"](6);
|
|
73
|
-
return _context.abrupt("return", Toast.error('
|
|
76
|
+
return _context.abrupt("return", Toast.error(t('course.noValidCourse')));
|
|
74
77
|
case 21:
|
|
75
78
|
_context.prev = 21;
|
|
76
79
|
setChecking(false);
|
|
@@ -103,11 +106,11 @@ var ProductTag = function ProductTag(_ref) {
|
|
|
103
106
|
width: '12px',
|
|
104
107
|
height: '12px'
|
|
105
108
|
},
|
|
106
|
-
alt:
|
|
109
|
+
alt: t('course.viewCourse'),
|
|
107
110
|
src: knowledgeConstants.CLASS_ICON_ADDRESS
|
|
108
|
-
}), /*#__PURE__*/React.createElement("span", null,
|
|
111
|
+
}), /*#__PURE__*/React.createElement("span", null, t('course.viewCourse')), /*#__PURE__*/React.createElement(ShadowLoading, {
|
|
109
112
|
loading: checking,
|
|
110
|
-
text:
|
|
113
|
+
text: t('common.pleaseWait')
|
|
111
114
|
})));
|
|
112
115
|
};
|
|
113
116
|
export default ProductTag;
|
|
@@ -14,9 +14,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
14
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
15
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import { Input, Toast, Table, Popover, Tooltip, Divider } from '@douyinfe/semi-ui';
|
|
17
|
+
import { Input, Toast, Table, Popover, Tooltip, Divider, Empty } from '@douyinfe/semi-ui';
|
|
18
18
|
import styles from "./index.module.css";
|
|
19
19
|
import { useCallback, useRef, useState } from 'react';
|
|
20
|
+
import { useTranslation } from 'react-i18next';
|
|
20
21
|
import IconFontCom from "../iconfont-com";
|
|
21
22
|
import { knowledgeConstants } from "../../constants";
|
|
22
23
|
import useQuotedService from "../../hooks/useQuoted";
|
|
@@ -26,13 +27,12 @@ import { throttle } from 'lodash';
|
|
|
26
27
|
import React from 'react';
|
|
27
28
|
import classNames from 'classnames';
|
|
28
29
|
var DEBOUNCE_MS = 600; // 拉长到 600 ms
|
|
29
|
-
|
|
30
30
|
var tabList = [{
|
|
31
31
|
key: 'current_video',
|
|
32
|
-
displayName: '
|
|
32
|
+
displayName: 'quote.currentCourseVideo'
|
|
33
33
|
}, {
|
|
34
34
|
key: 'video',
|
|
35
|
-
displayName: '
|
|
35
|
+
displayName: 'quote.relatedVideos'
|
|
36
36
|
}
|
|
37
37
|
// { key: 'course', displayName: '课程' },
|
|
38
38
|
];
|
|
@@ -40,6 +40,8 @@ var quotoIcon = 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202601/
|
|
|
40
40
|
var isActiveQuotoIcon = 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202601/30/8e64c_20260130135037.png';
|
|
41
41
|
var QuotedContent = function QuotedContent(_ref) {
|
|
42
42
|
var initQuoteSource = _ref.initQuoteSource;
|
|
43
|
+
var _useTranslation = useTranslation(),
|
|
44
|
+
t = _useTranslation.t;
|
|
43
45
|
var _useState = useState('current_video'),
|
|
44
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
47
|
activeKey = _useState2[0],
|
|
@@ -80,7 +82,7 @@ var QuotedContent = function QuotedContent(_ref) {
|
|
|
80
82
|
isLoading = _useQuotedService.isLoading,
|
|
81
83
|
totalPage = _useQuotedService.totalPage;
|
|
82
84
|
var columns = [{
|
|
83
|
-
title: '
|
|
85
|
+
title: t('quote.name'),
|
|
84
86
|
dataIndex: 'name',
|
|
85
87
|
key: 'name',
|
|
86
88
|
width: '100%',
|
|
@@ -176,7 +178,7 @@ var QuotedContent = function QuotedContent(_ref) {
|
|
|
176
178
|
var handleSelect = function handleSelect(record) {
|
|
177
179
|
//总条数需小于等于十
|
|
178
180
|
if (gimiMenu.quoteTeachModelList.length + gimiMenu.quoteProductList.length >= 10) {
|
|
179
|
-
Toast.warning('
|
|
181
|
+
Toast.warning(t('quote.maxResources'));
|
|
180
182
|
return;
|
|
181
183
|
}
|
|
182
184
|
if (activeKey === 'current_video' || activeKey === 'video') {
|
|
@@ -242,7 +244,7 @@ var QuotedContent = function QuotedContent(_ref) {
|
|
|
242
244
|
onChange: handleChange,
|
|
243
245
|
onCompositionStart: handleCompositionStart,
|
|
244
246
|
onCompositionEnd: handleCompositionEnd,
|
|
245
|
-
placeholder:
|
|
247
|
+
placeholder: t('common.search')
|
|
246
248
|
}), /*#__PURE__*/React.createElement("div", {
|
|
247
249
|
className: styles.content
|
|
248
250
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -254,16 +256,16 @@ var QuotedContent = function QuotedContent(_ref) {
|
|
|
254
256
|
onClick: function onClick() {
|
|
255
257
|
return handleTabChange(tab.key);
|
|
256
258
|
}
|
|
257
|
-
}, tab.displayName);
|
|
259
|
+
}, t(tab.displayName));
|
|
258
260
|
})), initQuoteSource && activeKey === 'current_video' && /*#__PURE__*/React.createElement("div", {
|
|
259
261
|
className: styles.current_video
|
|
260
262
|
}, /*#__PURE__*/React.createElement("span", {
|
|
261
263
|
className: styles.text
|
|
262
|
-
},
|
|
264
|
+
}, t('quote.currentVideo')), /*#__PURE__*/React.createElement("span", {
|
|
263
265
|
className: styles.currentItem,
|
|
264
266
|
onClick: handleCurrentVideoClick
|
|
265
267
|
}, /*#__PURE__*/React.createElement("img", {
|
|
266
|
-
alt:
|
|
268
|
+
alt: t('quote.imageAlt'),
|
|
267
269
|
className: styles.img,
|
|
268
270
|
src: knowledgeConstants.VIDEO_ICON_ADDRESS
|
|
269
271
|
}), /*#__PURE__*/React.createElement("span", {
|
|
@@ -293,7 +295,10 @@ var QuotedContent = function QuotedContent(_ref) {
|
|
|
293
295
|
return handleSelect(record);
|
|
294
296
|
}
|
|
295
297
|
};
|
|
296
|
-
}
|
|
298
|
+
},
|
|
299
|
+
empty: /*#__PURE__*/React.createElement(Empty, {
|
|
300
|
+
description: t('quote.empty')
|
|
301
|
+
})
|
|
297
302
|
})))));
|
|
298
303
|
};
|
|
299
304
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
@@ -310,7 +315,7 @@ var QuotedContent = function QuotedContent(_ref) {
|
|
|
310
315
|
return setShowmodel(true);
|
|
311
316
|
}
|
|
312
317
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
313
|
-
content:
|
|
318
|
+
content: t('quote.courseTooltip'),
|
|
314
319
|
position: "top",
|
|
315
320
|
visible: showmodel ? false : undefined
|
|
316
321
|
}, /*#__PURE__*/React.createElement("img", {
|
|
@@ -12,6 +12,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
14
14
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
15
16
|
import { MMarkdown } from '@myun/gimi-design';
|
|
16
17
|
// import SearchResult from '../search-result';
|
|
17
18
|
import styles from "./index.module.css";
|
|
@@ -26,6 +27,8 @@ import ReasoningSearch from "../reasoning-search";
|
|
|
26
27
|
var ReasoningContent = function ReasoningContent(_ref) {
|
|
27
28
|
var reasoningTitle = _ref.reasoningTitle,
|
|
28
29
|
item = _ref.item;
|
|
30
|
+
var _useTranslation = useTranslation(),
|
|
31
|
+
t = _useTranslation.t;
|
|
29
32
|
var containerRef = useRef(null);
|
|
30
33
|
var _useScroll = useScroll(containerRef),
|
|
31
34
|
_useScroll2 = _slicedToArray(_useScroll, 1),
|
|
@@ -107,11 +110,11 @@ var ReasoningContent = function ReasoningContent(_ref) {
|
|
|
107
110
|
var renderStatusText = function renderStatusText() {
|
|
108
111
|
switch (item.reasoningStatus) {
|
|
109
112
|
case 1:
|
|
110
|
-
return '
|
|
113
|
+
return t('reasoning.status.thinking');
|
|
111
114
|
case 2:
|
|
112
|
-
return '
|
|
115
|
+
return t('reasoning.status.completed');
|
|
113
116
|
default:
|
|
114
|
-
return '
|
|
117
|
+
return t('reasoning.status.stopped');
|
|
115
118
|
}
|
|
116
119
|
};
|
|
117
120
|
// item.expand ? styles.expand : ''
|
|
@@ -135,13 +138,13 @@ var ReasoningContent = function ReasoningContent(_ref) {
|
|
|
135
138
|
style: {
|
|
136
139
|
marginTop: 0
|
|
137
140
|
}
|
|
138
|
-
},
|
|
141
|
+
}, t('reasoning.startAnalysis')), item.query && /*#__PURE__*/React.createElement("div", {
|
|
139
142
|
className: styles.queryTitle
|
|
140
143
|
}, item.query)), /*#__PURE__*/React.createElement("div", {
|
|
141
144
|
className: styles.deepThink
|
|
142
145
|
}, item.query && /*#__PURE__*/React.createElement("div", {
|
|
143
146
|
className: styles.label
|
|
144
|
-
},
|
|
147
|
+
}, t('reasoning.deepThinking')), item.reasoningContent && /*#__PURE__*/React.createElement("div", {
|
|
145
148
|
className: styles.deepThink_content
|
|
146
149
|
}, /*#__PURE__*/React.createElement(MMarkdown, {
|
|
147
150
|
content: processString(item.reasoningContent),
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import styles from "./index.module.css";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { isEqual } from 'lodash';
|
|
5
|
+
import { IconSearchStroked } from '@douyinfe/semi-icons';
|
|
6
|
+
import { useAppDispatch, useAppSelector } from "../../store/hooks";
|
|
7
|
+
import { openSidebar, closeSidebar } from "../../store/slices/gimiMenuSlice";
|
|
6
8
|
var ReasoningSearch = function ReasoningSearch(_ref) {
|
|
7
9
|
var value = _ref.value;
|
|
10
|
+
var _useTranslation = useTranslation(),
|
|
11
|
+
t = _useTranslation.t;
|
|
8
12
|
var dispatch = useAppDispatch();
|
|
13
|
+
var reasoningSearchList = useAppSelector(function (state) {
|
|
14
|
+
return state.gimiMenu.sidebar.reasoningSearchList;
|
|
15
|
+
});
|
|
9
16
|
var searchResult = {};
|
|
10
17
|
try {
|
|
11
18
|
var temp = value;
|
|
@@ -23,6 +30,10 @@ var ReasoningSearch = function ReasoningSearch(_ref) {
|
|
|
23
30
|
var list = (searchResult.results || []).map(function (item) {
|
|
24
31
|
return item['text_card'];
|
|
25
32
|
});
|
|
33
|
+
if (isEqual(reasoningSearchList, list)) {
|
|
34
|
+
dispatch(closeSidebar());
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
26
37
|
if (list.length > 0) {
|
|
27
38
|
dispatch(openSidebar({
|
|
28
39
|
type: 'reasoningSearch',
|
|
@@ -39,8 +50,6 @@ var ReasoningSearch = function ReasoningSearch(_ref) {
|
|
|
39
50
|
className: styles.icon
|
|
40
51
|
}), /*#__PURE__*/React.createElement("span", {
|
|
41
52
|
className: styles.summary
|
|
42
|
-
}, searchResult.summary || '
|
|
43
|
-
className: styles.icon
|
|
44
|
-
}));
|
|
53
|
+
}, searchResult.summary || t('reasoningSearch.summary')));
|
|
45
54
|
};
|
|
46
55
|
export default ReasoningSearch;
|