@myun/gimi-chat 0.6.9 → 0.7.1

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.
@@ -51,8 +51,10 @@ var AnswerItem = function AnswerItem(_ref) {
51
51
  var isMsgRecieving = useAppSelector(function (state) {
52
52
  return state.gimiMenu.isMsgRecieving;
53
53
  });
54
- var messageList = useAppSelector(function (state) {
55
- return state.gimiMenu.messageList || [];
54
+ var lastMessageId = useAppSelector(function (state) {
55
+ var list = state.gimiMenu.messageList || [];
56
+ if (!list.length) return undefined;
57
+ return list[list.length - 1].id;
56
58
  });
57
59
  var platform = useAppSelector(function (state) {
58
60
  return state.gimiMenu.platform;
@@ -67,14 +69,14 @@ var AnswerItem = function AnswerItem(_ref) {
67
69
  }
68
70
  }, [platform]);
69
71
  var _React$useMemo = React.useMemo(function () {
70
- var _item$moduleInfo, _item$moduleInfo2, _messageList;
72
+ var _item$moduleInfo, _item$moduleInfo2;
71
73
  var contentStr = item.content && processString(item.content) || '';
72
74
  var showContentFlag = Boolean(contentStr);
73
75
  var showAskTag = item.moduleType === 'ask' || ((_item$moduleInfo = item.moduleInfo) === null || _item$moduleInfo === void 0 ? void 0 : _item$moduleInfo.moduleType) === 'ask';
74
76
  var showSkillTag = item.moduleType === 'skill' || ((_item$moduleInfo2 = item.moduleInfo) === null || _item$moduleInfo2 === void 0 ? void 0 : _item$moduleInfo2.moduleType) === 'skill';
75
77
  var showOperation = (showContentFlag || showSkillTag) && !showAskTag && !isMsgRecieving;
76
78
  var showTaskSuccess = (contentStr === null || contentStr === void 0 ? void 0 : contentStr.indexOf('<excel>')) > -1 && !isMsgRecieving;
77
- var showRegerate = item.id === ((_messageList = messageList[messageList.length - 1]) === null || _messageList === void 0 ? void 0 : _messageList.id);
79
+ var showRegerate = lastMessageId !== undefined && item.id === lastMessageId;
78
80
  return {
79
81
  showContentFlag: showContentFlag,
80
82
  showAskTag: showAskTag,
@@ -83,7 +85,7 @@ var AnswerItem = function AnswerItem(_ref) {
83
85
  showTaskSuccess: showTaskSuccess,
84
86
  showRegerate: showRegerate
85
87
  };
86
- }, [item.id, item.content, item.moduleType, item.moduleInfo, isMsgRecieving, messageList]),
88
+ }, [item.id, item.content, item.moduleType, item.moduleInfo, isMsgRecieving, lastMessageId]),
87
89
  showContentFlag = _React$useMemo.showContentFlag,
88
90
  showAskTag = _React$useMemo.showAskTag,
89
91
  showSkillTag = _React$useMemo.showSkillTag,
@@ -25,12 +25,15 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
25
25
  resources = _ref2.resources,
26
26
  messageId = _ref2.messageId;
27
27
  var dispatch = useAppDispatch();
28
- var _useAppSelector = useAppSelector(function (state) {
29
- return state.gimiMenu;
30
- }),
31
- messageList = _useAppSelector.messageList,
32
- isMsgRecieving = _useAppSelector.isMsgRecieving;
33
- var isLastMessage = (messageList === null || messageList === void 0 ? void 0 : messageList.length) > 0 && messageList[messageList.length - 1].id === messageId;
28
+ var lastMessageId = useAppSelector(function (state) {
29
+ var list = state.gimiMenu.messageList;
30
+ if (!list || list.length === 0) return undefined;
31
+ return list[list.length - 1].id;
32
+ });
33
+ var isMsgRecieving = useAppSelector(function (state) {
34
+ return state.gimiMenu.isMsgRecieving;
35
+ });
36
+ var isLastMessage = lastMessageId !== undefined && lastMessageId === messageId;
34
37
  var iconUrl = type === 'video' ? knowledgeConstants.VIDEO_ICON_KNOWLADGE_TRACE_ADDRESS : type === 'document' ? knowledgeConstants.DOCUMENT_ICON_ADDRESS : knowledgeConstants.CLASS_ICON_ADDRESS;
35
38
  var handleIconClick = function handleIconClick() {
36
39
  if (isMsgRecieving && isLastMessage) return; // 最新一条正在流式输出的消息,不打开溯源面板
@@ -241,9 +241,12 @@
241
241
  gap: 5px;
242
242
  border: 0;
243
243
  background-color: #f1f7ff;
244
+ cursor: pointer;
245
+ }
246
+ .icon_btn span {
247
+ white-space: nowrap;
244
248
  }
245
249
  .icon_btn:hover {
246
- cursor: pointer;
247
250
  background-color: #FFFFFF;
248
251
  color: #4086FF;
249
252
  }
@@ -30,6 +30,7 @@
30
30
  }
31
31
  .main .textWrap .textItem {
32
32
  width: 100%;
33
+ cursor: default;
33
34
  position: relative;
34
35
  }
35
36
  .main .textWrap .textItem.question {
@@ -11,6 +11,9 @@
11
11
  border: 0;
12
12
  background-color: #f1f7ff;
13
13
  }
14
+ .icon_btn span {
15
+ white-space: nowrap;
16
+ }
14
17
  .icon_btn:hover {
15
18
  cursor: pointer;
16
19
  background-color: #FFFFFF;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  declare const ReasoningSearch: ({ value }: {
3
3
  value: any;
4
- }) => string | React.JSX.Element;
4
+ }) => "" | React.JSX.Element;
5
5
  export default ReasoningSearch;
@@ -10,7 +10,7 @@ var ReasoningSearch = function ReasoningSearch(_ref) {
10
10
  try {
11
11
  searchResult = typeof value === 'string' ? JSON.parse(value) : value;
12
12
  } catch (error) {
13
- return "".concat(searchResult);
13
+ return '';
14
14
  }
15
15
  var openSidebar = function openSidebar() {
16
16
  var list = (searchResult.results || []).map(function (item) {
@@ -106,4 +106,8 @@
106
106
  position: absolute;
107
107
  top: 100%;
108
108
  left: 1px;
109
+ }
110
+
111
+ :global(.markdown_container) pre {
112
+ white-space: break-spaces;
109
113
  }