@myun/gimi-chat 0.9.37 → 0.9.39

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.
@@ -223,7 +223,9 @@ var useApi = function useApi(baseUrl, authToken) {
223
223
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
224
224
  while (1) switch (_context11.prev = _context11.next) {
225
225
  case 0:
226
- return _context11.abrupt("return", fetchService.post('/mcourse/web/trace/resource', params));
226
+ return _context11.abrupt("return", fetchService.post('/mcourse/web/trace/resource', params, {
227
+ timeout: 60000
228
+ }));
227
229
  case 1:
228
230
  case "end":
229
231
  return _context11.stop();
@@ -26,6 +26,7 @@ interface AnswerItemProps {
26
26
  reasoningTitle?: string;
27
27
  model: 'fullscreen' | 'sidebar';
28
28
  onCurrentTraceVideoClick?: (time?: string) => void;
29
+ curPlayer?: any;
29
30
  }
30
31
  declare const AnswerItem: React.FC<AnswerItemProps>;
31
32
  export default AnswerItem;
@@ -50,7 +50,8 @@ var AnswerItem = function AnswerItem(_ref) {
50
50
  enableVoicePlay = _ref$enableVoicePlay === void 0 ? true : _ref$enableVoicePlay,
51
51
  reasoningTitle = _ref.reasoningTitle,
52
52
  model = _ref.model,
53
- onCurrentTraceVideoClick = _ref.onCurrentTraceVideoClick;
53
+ onCurrentTraceVideoClick = _ref.onCurrentTraceVideoClick,
54
+ curPlayer = _ref.curPlayer;
54
55
  var _useTranslation = useTranslation(),
55
56
  t = _useTranslation.t;
56
57
  var isMsgRecieving = useAppSelector(function (state) {
@@ -131,7 +132,8 @@ var AnswerItem = function AnswerItem(_ref) {
131
132
  return /*#__PURE__*/React.createElement(KnowledgeIconGroup, {
132
133
  content: value.value,
133
134
  messageId: item.id,
134
- onCurrentTraceVideoClick: onCurrentTraceVideoClick
135
+ onCurrentTraceVideoClick: onCurrentTraceVideoClick,
136
+ curPlayer: curPlayer
135
137
  });
136
138
  }
137
139
  }, {
@@ -140,7 +142,8 @@ var AnswerItem = function AnswerItem(_ref) {
140
142
  return /*#__PURE__*/React.createElement(KnowledgeIconGroup, {
141
143
  content: value.value,
142
144
  messageId: item.id,
143
- onCurrentTraceVideoClick: onCurrentTraceVideoClick
145
+ onCurrentTraceVideoClick: onCurrentTraceVideoClick,
146
+ curPlayer: curPlayer
144
147
  });
145
148
  }
146
149
  }, {
@@ -2,10 +2,12 @@ import type { KonwledgeTraceState } from '.';
2
2
  import React from 'react';
3
3
  export declare const KnowledgeIconComponent: React.FC<KonwledgeTraceState & {
4
4
  onCurrentTraceVideoClick?: (time?: string) => void;
5
+ curPlayer?: any;
5
6
  }>;
6
- declare const _default: React.MemoExoticComponent<({ content, messageId, onCurrentTraceVideoClick }: {
7
+ declare const _default: React.MemoExoticComponent<({ content, messageId, onCurrentTraceVideoClick, curPlayer }: {
7
8
  content: string;
8
9
  messageId: number;
9
10
  onCurrentTraceVideoClick?: ((time?: string | undefined) => void) | undefined;
11
+ curPlayer?: any;
10
12
  }) => React.JSX.Element>;
11
13
  export default _default;
@@ -46,7 +46,8 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
46
46
  var type = _ref2.type,
47
47
  resources = _ref2.resources,
48
48
  messageId = _ref2.messageId,
49
- onCurrentTraceVideoClick = _ref2.onCurrentTraceVideoClick;
49
+ onCurrentTraceVideoClick = _ref2.onCurrentTraceVideoClick,
50
+ curPlayer = _ref2.curPlayer;
50
51
  var _useState = useState(false),
51
52
  _useState2 = _slicedToArray(_useState, 2),
52
53
  showPanel = _useState2[0],
@@ -86,7 +87,10 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
86
87
  informationList = _useKnowledgeService.informationList,
87
88
  isLoading = _useKnowledgeService.isLoading;
88
89
  var handleCurrentTrace = React.useCallback(function (trace) {
89
- if (trace.isDelete === 1) return;
90
+ if (trace.isDelete === 1 || trace.isDeleted === 1) return;
91
+ if (type === 'video' && curPlayer) {
92
+ curPlayer === null || curPlayer === void 0 || curPlayer.pause();
93
+ }
90
94
  setShowPanel(false);
91
95
  setCurTrace(trace);
92
96
  setTryWatchVisible(true);
@@ -102,8 +106,7 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
102
106
  return videoSliceList !== null && videoSliceList !== void 0 && videoSliceList.length ? /*#__PURE__*/React.createElement(VideoList, {
103
107
  list: videoSliceList,
104
108
  hiddenTitle: true,
105
- handleCurrentTrace: handleCurrentTrace,
106
- onCurrentTraceVideoClick: onCurrentTraceVideoClick
109
+ handleCurrentTrace: handleCurrentTrace
107
110
  }) : /*#__PURE__*/React.createElement(Empty, null);
108
111
  case 'product':
109
112
  return productList !== null && productList !== void 0 && productList.length ? /*#__PURE__*/React.createElement(ClassList, {
@@ -168,7 +171,8 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
168
171
  var KnowledgeIconGroup = function KnowledgeIconGroup(_ref3) {
169
172
  var content = _ref3.content,
170
173
  messageId = _ref3.messageId,
171
- onCurrentTraceVideoClick = _ref3.onCurrentTraceVideoClick;
174
+ onCurrentTraceVideoClick = _ref3.onCurrentTraceVideoClick,
175
+ curPlayer = _ref3.curPlayer;
172
176
  var parseArr = [];
173
177
  var knowledgeMap = React.useMemo(function () {
174
178
  var returnMap = new Map();
@@ -213,7 +217,8 @@ var KnowledgeIconGroup = function KnowledgeIconGroup(_ref3) {
213
217
  resources: knowledgeMap.get(item) || [],
214
218
  key: item,
215
219
  messageId: messageId,
216
- onCurrentTraceVideoClick: onCurrentTraceVideoClick
220
+ onCurrentTraceVideoClick: onCurrentTraceVideoClick,
221
+ curPlayer: curPlayer
217
222
  });
218
223
  })));
219
224
  };
@@ -474,6 +474,7 @@
474
474
  justify-content: center;
475
475
  border-radius: 4px;
476
476
  gap: 5px;
477
+ margin-right: 4px;
477
478
  border: 1px solid var(--theme-softNeutral, #D9DCE5);
478
479
  background-color: var(--theme-subtleNeutral, #F5F7FA);
479
480
  cursor: pointer;
@@ -1,25 +1,33 @@
1
1
  import React from 'react';
2
2
  import styles from "./index.module.css";
3
3
  import { knowledgeConstants } from "../../constants";
4
+ // import { Tooltip } from '@douyinfe/semi-ui';
5
+
6
+ import { useTranslation } from 'react-i18next';
7
+ import classNames from 'classnames';
4
8
  var InformationList = function InformationList(_ref) {
5
9
  var list = _ref.list,
6
10
  handleCurrentTrace = _ref.handleCurrentTrace;
11
+ var _useTranslation = useTranslation(),
12
+ t = _useTranslation.t;
7
13
  return /*#__PURE__*/React.createElement("div", {
8
14
  className: styles.knowledgeList
9
15
  }, list.map(function (item) {
10
16
  return /*#__PURE__*/React.createElement("div", {
11
- className: styles.knowledge,
17
+ className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : ''),
12
18
  onClick: function onClick() {
13
19
  return handleCurrentTrace === null || handleCurrentTrace === void 0 ? void 0 : handleCurrentTrace(item);
14
20
  }
15
21
  }, /*#__PURE__*/React.createElement("img", {
16
22
  className: styles.img,
17
- src: knowledgeConstants.INFORMATION_ICON_ADRESS
23
+ src: knowledgeConstants.INFORMATION_ICON_COVER_ADDRESS
18
24
  }), /*#__PURE__*/React.createElement("div", {
19
25
  className: styles.description
20
26
  }, /*#__PURE__*/React.createElement("div", {
21
27
  className: styles.text
22
- }, item.title)));
28
+ }, item.title), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
29
+ className: styles.knowledge_trace_deactive
30
+ }, t('trace.information.invalid'))));
23
31
  }));
24
32
  };
25
33
  export default InformationList;
@@ -88,7 +88,7 @@ var VideoPlayer = function VideoPlayer(_ref2) {
88
88
  // @ts-ignore
89
89
  window.Hls = null; // 重置hls,g1和g2会冲突
90
90
  playerRef.current = new GdPlayer({
91
- container: document.getElementById('player-box'),
91
+ container: document.getElementById('player-box1'),
92
92
  protype: 'b',
93
93
  video: {},
94
94
  env: 't-',
@@ -136,14 +136,14 @@ var VideoPlayer = function VideoPlayer(_ref2) {
136
136
  });
137
137
  }
138
138
  return /*#__PURE__*/React.createElement("div", {
139
- id: "player-box-wrap",
139
+ id: "player-box-wrap1",
140
140
  className: styles.playerWrap
141
141
  }, /*#__PURE__*/React.createElement(Spin, {
142
142
  spinning: loading,
143
143
  size: "large",
144
144
  wrapperClassName: styles.spinWrap
145
145
  }), /*#__PURE__*/React.createElement("div", {
146
- id: "player-box",
146
+ id: "player-box1",
147
147
  className: styles.playerBox
148
148
  }));
149
149
  };
@@ -154,7 +154,8 @@ var DocumentPlayer = function DocumentPlayer(_ref5) {
154
154
  t = _useTranslation2.t;
155
155
 
156
156
  // Office 文档与 Web 可预览类型(pdf/svg/图片)支持试看
157
- var canPreview = SUPPORT_PREVIEW_FILE_TYPE.includes(item.suffix) || SUPPORT_WEB_PREVIEW.includes(item.suffix);
157
+ // const canPreview = SUPPORT_PREVIEW_FILE_TYPE.includes(item.suffix) || SUPPORT_WEB_PREVIEW.includes(item.suffix);
158
+ var canPreview = SUPPORT_WEB_PREVIEW.includes(item.suffix);
158
159
 
159
160
  // 不支持预览的类型:直接提示并下载
160
161
  if (!canPreview) {
@@ -245,7 +246,7 @@ var TryWatch = function TryWatch(_ref7) {
245
246
  var _useTranslation4 = useTranslation(),
246
247
  t = _useTranslation4.t;
247
248
  var handleFull = function handleFull() {
248
- if (item.isDelete === 1) return;
249
+ if (item.isDelete === 1 || item.isDeleted === 1) return;
249
250
  if (platform !== 'myun') return Toast.warning(t('trace.jumpUnsupported'));
250
251
  if (type === 'information') {
251
252
  handleInformation();
@@ -4,6 +4,5 @@ declare const VideoList: React.FC<{
4
4
  list: IVideoResource[];
5
5
  hiddenTitle?: boolean;
6
6
  handleCurrentTrace?: (trace: IVideoResource) => void;
7
- onCurrentTraceVideoClick?: (time?: string) => void;
8
7
  }>;
9
8
  export default VideoList;
@@ -48,7 +48,6 @@ var VideoItem = function VideoItem(_ref) {
48
48
  };
49
49
  var VideoList = function VideoList(_ref2) {
50
50
  var list = _ref2.list,
51
- onCurrentTraceVideoClick = _ref2.onCurrentTraceVideoClick,
52
51
  _ref2$hiddenTitle = _ref2.hiddenTitle,
53
52
  hiddenTitle = _ref2$hiddenTitle === void 0 ? false : _ref2$hiddenTitle,
54
53
  handleCurrentTrace = _ref2.handleCurrentTrace;
@@ -17,6 +17,7 @@ interface Iprops {
17
17
  containerRef: React.RefObject<HTMLDivElement>;
18
18
  platform: string;
19
19
  onCurrentTraceVideoClick?: (time?: string) => void;
20
+ curPlayer?: any;
20
21
  }
21
22
  declare const MessageList: React.FC<Iprops & MessageConfig>;
22
23
  export default MessageList;
@@ -53,7 +53,8 @@ var MessageItem = /*#__PURE__*/React.memo(function (props) {
53
53
  onDownloadCallback = props.onDownloadCallback,
54
54
  reasoningTitle = props.reasoningTitle,
55
55
  model = props.model,
56
- onCurrentTraceVideoClick = props.onCurrentTraceVideoClick;
56
+ onCurrentTraceVideoClick = props.onCurrentTraceVideoClick,
57
+ curPlayer = props.curPlayer;
57
58
  if (!v) return null;
58
59
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
59
60
  className: classNames(styles.textItem, _defineProperty({}, styles.question, (v === null || v === void 0 ? void 0 : v.type) === 0)),
@@ -113,7 +114,8 @@ var MessageItem = /*#__PURE__*/React.memo(function (props) {
113
114
  onDownloadCallback: onDownloadCallback,
114
115
  reasoningTitle: reasoningTitle,
115
116
  model: model,
116
- onCurrentTraceVideoClick: onCurrentTraceVideoClick
117
+ onCurrentTraceVideoClick: onCurrentTraceVideoClick,
118
+ curPlayer: curPlayer
117
119
  })));
118
120
  });
119
121
  var MessageList = function MessageList(_ref) {
@@ -149,7 +151,8 @@ var MessageList = function MessageList(_ref) {
149
151
  messageStyle = _ref$messageStyle === void 0 ? {} : _ref$messageStyle,
150
152
  containerRef = _ref.containerRef,
151
153
  platform = _ref.platform,
152
- onCurrentTraceVideoClick = _ref.onCurrentTraceVideoClick;
154
+ onCurrentTraceVideoClick = _ref.onCurrentTraceVideoClick,
155
+ curPlayer = _ref.curPlayer;
153
156
  var _useGimiFileUpload = useGimiFileUpload(),
154
157
  handleSSEFileAnalyize = _useGimiFileUpload.handleSSEFileAnalyize,
155
158
  fileUpload = _useGimiFileUpload.fileUpload;
@@ -288,7 +291,8 @@ var MessageList = function MessageList(_ref) {
288
291
  onDownloadCallback: onDownloadCallback,
289
292
  reasoningTitle: reasoningTitle,
290
293
  model: model,
291
- onCurrentTraceVideoClick: onCurrentTraceVideoClick
294
+ onCurrentTraceVideoClick: onCurrentTraceVideoClick,
295
+ curPlayer: curPlayer
292
296
  });
293
297
  }, [chatUI, hideUserMessage, showOpera, onCopyCallback, onSucessExcel, onFailureExcel, onRetryExcel, showCommend, handleClickPromptWord, handleShowCourse, handleClickAskList, playTTSByText, stopTTSByText, isPlaying, onRegenerateClick, enableCopy, enableLike, enableUnLike, enableRegenerate, enableVoicePlay, onDownloadCallback, reasoningTitle, model, handleReTry, onLikeCallback, onUnLikeCallback]);
294
298
  return /*#__PURE__*/React.createElement("div", {
@@ -10,6 +10,7 @@ export declare const knowledgeConstants: {
10
10
  VIDEO_PLAY_ICON_ADDRESS: string;
11
11
  VIDEO_DEFAULT_COVER_ADDRESS: string;
12
12
  INFORMATION_ICON_ADRESS: string;
13
+ INFORMATION_ICON_COVER_ADDRESS: string;
13
14
  };
14
15
  export declare const documentConstants: {
15
16
  txt: string;
package/dist/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export var knowledgeConstants = {
2
2
  VIDEO_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/28/19116_20251128152844.png',
3
3
  VIDEO_ICON_KNOWLADGE_TRACE_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202512/05/5dda1_20251205145434.png',
4
- DOCUMENT_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/1c1a5_20251110100244.png',
4
+ DOCUMENT_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202607/24/86526_20260724172428.png',
5
5
  CLASS_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/3c093_20251110102706.png',
6
6
  CLASS_ICON_BIG_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/28/7c759_20251128153111.png',
7
7
  VIDEO_ICON_WHITE_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/77cdc_20251110132223.png',
@@ -9,7 +9,8 @@ export var knowledgeConstants = {
9
9
  CLASS_ICON_WHITE_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/10/61fdf_20251110132334.png',
10
10
  VIDEO_PLAY_ICON_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/19/1f688_20251119160747.png',
11
11
  VIDEO_DEFAULT_COVER_ADDRESS: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202511/19/7a643_20251119160927.png',
12
- INFORMATION_ICON_ADRESS: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202607/22/b834d_20260722090057.png"
12
+ INFORMATION_ICON_ADRESS: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202607/22/b834d_20260722090057.png",
13
+ INFORMATION_ICON_COVER_ADDRESS: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202607/24/ecafd_20260724172758.png"
13
14
  };
14
15
  export var documentConstants = {
15
16
  txt: 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/17/b46c7_20250917144926.png',
@@ -40,6 +40,7 @@ declare const enUS: {
40
40
  'trace.course.total': string;
41
41
  'trace.document.coverAlt': string;
42
42
  'trace.document.invalid': string;
43
+ 'trace.information.invalid': string;
43
44
  'trace.document.total': string;
44
45
  'trace.document.unsupported': string;
45
46
  'trace.document.unsupportedTips': string;
@@ -40,6 +40,7 @@ var enUS = {
40
40
  'trace.course.total': '{{count}} courses in this conversation',
41
41
  'trace.document.coverAlt': 'Document image',
42
42
  'trace.document.invalid': 'Document invalid',
43
+ 'trace.information.invalid': 'Information invalid',
43
44
  'trace.document.total': '{{count}} documents in this conversation',
44
45
  'trace.document.unsupported': 'This file type cannot be previewed',
45
46
  'trace.document.unsupportedTips': 'This file format does not support trial preview. You can download it and view it with other software.\nTo view the full document, click the "View" button.',
@@ -40,6 +40,7 @@ declare const zhCN: {
40
40
  'trace.course.total': string;
41
41
  'trace.document.coverAlt': string;
42
42
  'trace.document.invalid': string;
43
+ 'trace.information.invalid': string;
43
44
  'trace.document.total': string;
44
45
  'trace.document.unsupported': string;
45
46
  'trace.document.unsupportedTips': string;
@@ -40,9 +40,10 @@ var zhCN = {
40
40
  'trace.course.total': '本对话共{{count}}个课程',
41
41
  'trace.document.coverAlt': '文档图片',
42
42
  'trace.document.invalid': '文档失效',
43
+ 'trace.information.invalid': '资讯失效',
43
44
  'trace.document.total': '本对话共{{count}}个文档',
44
45
  'trace.document.unsupported': '当前文件不支持预览',
45
- 'trace.document.unsupportedTips': '文件格式不支持试看,您可以下载后用其他软件查看。\n如需查看完整文档,请点击“去查看”按钮。',
46
+ 'trace.document.unsupportedTips': '文件格式不支持在线试看,您可以下载后用其他软件查看。\n如需查看完整文档,请点击“去查看”按钮。',
46
47
  'trace.video.unsupportedTips': '该视频暂不支持试看,\n如需查看完整视频,请点击“去查看”按钮。',
47
48
  'trace.information.unsupportedTips': '以下内容暂不可试看',
48
49
  'trace.notPermission': '暂无权益',
@@ -243,5 +243,6 @@ export interface IInformation {
243
243
 
244
244
  isActive?: boolean; // 是否高亮
245
245
  packageId?: number; // 资源包ID
246
+ isDelete?: number; // 资源是否已删除 (1:删除 0 :未删除)
246
247
 
247
248
  }
@@ -144,6 +144,7 @@ export interface CommonChatProps {
144
144
  onCurrentTraceVideoClick?: (time?: string) => void;
145
145
  className?: string;
146
146
  style?: React.CSSProperties;
147
+ curPlayer?: any;
147
148
  }
148
149
  conversationId?: number;
149
150
  messageConfig?: MessageConfig;