@myun/gimi-chat 0.3.8 → 0.3.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.
@@ -14,5 +14,6 @@ declare const KonwledgeTrace: React.FC<{
14
14
  isOverFlow: boolean;
15
15
  className?: string;
16
16
  style?: React.CSSProperties;
17
+ onCurrentTraceVideoClick?: (time?: string) => void;
17
18
  }>;
18
19
  export default KonwledgeTrace;
@@ -22,7 +22,8 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
22
22
  chatList = _ref.chatList,
23
23
  isOverFlow = _ref.isOverFlow,
24
24
  className = _ref.className,
25
- style = _ref.style;
25
+ style = _ref.style,
26
+ onCurrentTraceVideoClick = _ref.onCurrentTraceVideoClick;
26
27
  var showKonwledgeTrace = useAppSelector(function (state) {
27
28
  return state.gimiMenu.showKonwledgeTrace;
28
29
  });
@@ -107,7 +108,8 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
107
108
  switch (activeKey) {
108
109
  case 'video':
109
110
  return /*#__PURE__*/React.createElement(VideoList, {
110
- list: videoSliceList
111
+ list: videoSliceList,
112
+ onCurrentTraceVideoClick: onCurrentTraceVideoClick
111
113
  });
112
114
  case 'product':
113
115
  return /*#__PURE__*/React.createElement(ClassList, {
@@ -2,5 +2,6 @@ import React from 'react';
2
2
  import type { IVideoResource } from './interfaces';
3
3
  declare const VideoList: React.FC<{
4
4
  list: IVideoResource[];
5
+ onCurrentTraceVideoClick?: (time?: string) => void;
5
6
  }>;
6
7
  export default VideoList;
@@ -3,10 +3,11 @@ 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
- import { useAppSelector, useAppDispatch } from "../../store/hooks";
6
+ import { useAppSelector } from "../../store/hooks";
7
7
  var VideoItem = function VideoItem(_ref) {
8
8
  var _konwledgeTraceState$;
9
- var item = _ref.item;
9
+ var item = _ref.item,
10
+ onClick = _ref.onClick;
10
11
  var konwledgeTraceState = useAppSelector(function (state) {
11
12
  return state.gimiMenu.konwledgeTraceState;
12
13
  });
@@ -21,7 +22,6 @@ var VideoItem = function VideoItem(_ref) {
21
22
  }),
22
23
  gradeId = _useAppSelector.gradeId,
23
24
  teachModuleId = _useAppSelector.teachModuleId;
24
- var dispatch = useAppDispatch();
25
25
  var handleClick = function handleClick() {
26
26
  if (item.isDelete === 1) return;
27
27
  if (platform !== 'myun') return Toast.warning('当前平台不支持溯源跳转');
@@ -29,12 +29,7 @@ var VideoItem = function VideoItem(_ref) {
29
29
  if (item.isJoinClass) {
30
30
  // 如果溯源就是当前视频,直接跳转到溯源的进度
31
31
  if (gradeId === item.gradeId && teachModuleId === item.id) {
32
- dispatch({
33
- type: 'smartClassState/setTimeFromSider',
34
- payload: {
35
- timeFromSider: item.startedAtSecond
36
- }
37
- });
32
+ onClick === null || onClick === void 0 || onClick(item.startedAtSecond);
38
33
  } else {
39
34
  // 如果不是当前视频,新开一个学习页面
40
35
  window.open("/learningPage?".concat(searchParams, "&startedAt=").concat(item.startedAtSecond));
@@ -76,7 +71,8 @@ var VideoItem = function VideoItem(_ref) {
76
71
  }, "\u89C6\u9891\u5931\u6548")));
77
72
  };
78
73
  var VideoList = function VideoList(_ref2) {
79
- var list = _ref2.list;
74
+ var list = _ref2.list,
75
+ onCurrentTraceVideoClick = _ref2.onCurrentTraceVideoClick;
80
76
  return /*#__PURE__*/React.createElement("div", {
81
77
  className: styles.knowledgeList
82
78
  }, /*#__PURE__*/React.createElement("span", {
@@ -84,7 +80,8 @@ var VideoList = function VideoList(_ref2) {
84
80
  }, "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u89C6\u9891")), list.map(function (item) {
85
81
  return /*#__PURE__*/React.createElement(VideoItem, {
86
82
  item: item,
87
- key: item.id
83
+ key: item.id,
84
+ onClick: onCurrentTraceVideoClick
88
85
  });
89
86
  }));
90
87
  };
@@ -4,7 +4,6 @@
4
4
  height: 100%;
5
5
  display: flex;
6
6
  gap: 20px;
7
- overflow: hidden;
8
7
  position: relative;
9
8
  }
10
9
 
@@ -133,6 +133,7 @@ export interface CommonChatProps {
133
133
  model?: 'sidebar' | 'fullscreen';
134
134
  sidebarConfig?: {
135
135
  sidebarTargetElm?: HTMLElement;
136
+ onCurrentTraceVideoClick?: (time?: string) => void;
136
137
  className?: string;
137
138
  style?: React.CSSProperties;
138
139
  }