@myun/gimi-chat 0.9.75 → 0.9.76
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/components/knowledge-trace/KnowledgeIconComponent.js +36 -24
- package/dist/components/knowledge-trace/documentList.js +5 -3
- package/dist/components/knowledge-trace/index.module.css +2 -2
- package/dist/components/knowledge-trace/information.js +3 -1
- package/dist/components/knowledge-trace/videoList.js +5 -3
- package/dist/components/product-tag/index.js +7 -4
- package/dist/i18n/locales/en-US.d.ts +3 -0
- package/dist/i18n/locales/en-US.js +3 -0
- package/dist/i18n/locales/zh-CN.d.ts +3 -0
- package/dist/i18n/locales/zh-CN.js +3 -0
- package/dist/umd/index.min.js +1 -1
- package/package.json +2 -2
|
@@ -21,18 +21,22 @@ import DocumentList from "./documentList";
|
|
|
21
21
|
import AiLoading from "../ai-loading";
|
|
22
22
|
import TryWatch from "./tryWatch";
|
|
23
23
|
import InformationList from "./information";
|
|
24
|
-
var Empty = function Empty() {
|
|
24
|
+
var Empty = function Empty(_ref) {
|
|
25
|
+
var type = _ref.type;
|
|
26
|
+
var _useTranslation = useTranslation(),
|
|
27
|
+
t = _useTranslation.t;
|
|
25
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
29
|
style: {
|
|
27
|
-
margin: '
|
|
30
|
+
margin: '20px auto',
|
|
31
|
+
paddingBottom: 16,
|
|
28
32
|
textAlign: 'center'
|
|
29
33
|
}
|
|
30
|
-
},
|
|
34
|
+
}, type === 'information' ? t('trace.information.empty') : t('trace.empty.noReference'));
|
|
31
35
|
};
|
|
32
|
-
var KnowledgeIcon = function KnowledgeIcon(
|
|
33
|
-
var url =
|
|
34
|
-
var
|
|
35
|
-
t =
|
|
36
|
+
var KnowledgeIcon = function KnowledgeIcon(_ref2) {
|
|
37
|
+
var url = _ref2.url;
|
|
38
|
+
var _useTranslation2 = useTranslation(),
|
|
39
|
+
t = _useTranslation2.t;
|
|
36
40
|
return /*#__PURE__*/React.createElement("img", {
|
|
37
41
|
style: {
|
|
38
42
|
width: '12px',
|
|
@@ -42,12 +46,12 @@ var KnowledgeIcon = function KnowledgeIcon(_ref) {
|
|
|
42
46
|
src: url
|
|
43
47
|
});
|
|
44
48
|
};
|
|
45
|
-
export var KnowledgeIconComponent = function KnowledgeIconComponent(
|
|
46
|
-
var type =
|
|
47
|
-
resources =
|
|
48
|
-
messageId =
|
|
49
|
-
onCurrentTraceVideoClick =
|
|
50
|
-
curPlayer =
|
|
49
|
+
export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref3) {
|
|
50
|
+
var type = _ref3.type,
|
|
51
|
+
resources = _ref3.resources,
|
|
52
|
+
messageId = _ref3.messageId,
|
|
53
|
+
onCurrentTraceVideoClick = _ref3.onCurrentTraceVideoClick,
|
|
54
|
+
curPlayer = _ref3.curPlayer;
|
|
51
55
|
var _useState = useState(false),
|
|
52
56
|
_useState2 = _slicedToArray(_useState, 2),
|
|
53
57
|
showPanel = _useState2[0],
|
|
@@ -60,8 +64,8 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
|
|
|
60
64
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
61
65
|
curTrace = _useState6[0],
|
|
62
66
|
setCurTrace = _useState6[1];
|
|
63
|
-
var
|
|
64
|
-
t =
|
|
67
|
+
var _useTranslation3 = useTranslation(),
|
|
68
|
+
t = _useTranslation3.t;
|
|
65
69
|
var dispatch = useAppDispatch();
|
|
66
70
|
var lastMessageId = useAppSelector(function (state) {
|
|
67
71
|
var list = state.gimiMenu.messageList;
|
|
@@ -119,23 +123,31 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
|
|
|
119
123
|
list: videoSliceList,
|
|
120
124
|
hiddenTitle: true,
|
|
121
125
|
handleCurrentTrace: handleCurrentTrace
|
|
122
|
-
}) : /*#__PURE__*/React.createElement(Empty,
|
|
126
|
+
}) : /*#__PURE__*/React.createElement(Empty, {
|
|
127
|
+
type: type
|
|
128
|
+
});
|
|
123
129
|
case 'product':
|
|
124
130
|
return productList !== null && productList !== void 0 && productList.length ? /*#__PURE__*/React.createElement(ClassList, {
|
|
125
131
|
list: productList,
|
|
126
132
|
hiddenTitle: true
|
|
127
|
-
}) : /*#__PURE__*/React.createElement(Empty,
|
|
133
|
+
}) : /*#__PURE__*/React.createElement(Empty, {
|
|
134
|
+
type: type
|
|
135
|
+
});
|
|
128
136
|
case 'document':
|
|
129
137
|
return documentList !== null && documentList !== void 0 && documentList.length ? /*#__PURE__*/React.createElement(DocumentList, {
|
|
130
138
|
list: documentList,
|
|
131
139
|
hiddenTitle: true,
|
|
132
140
|
handleCurrentTrace: handleCurrentTrace
|
|
133
|
-
}) : /*#__PURE__*/React.createElement(Empty,
|
|
141
|
+
}) : /*#__PURE__*/React.createElement(Empty, {
|
|
142
|
+
type: type
|
|
143
|
+
});
|
|
134
144
|
case "information":
|
|
135
145
|
return informationList !== null && informationList !== void 0 && informationList.length ? /*#__PURE__*/React.createElement(InformationList, {
|
|
136
146
|
list: informationList,
|
|
137
147
|
handleCurrentTrace: handleCurrentTrace
|
|
138
|
-
}) : /*#__PURE__*/React.createElement(Empty,
|
|
148
|
+
}) : /*#__PURE__*/React.createElement(Empty, {
|
|
149
|
+
type: type
|
|
150
|
+
});
|
|
139
151
|
default:
|
|
140
152
|
return null;
|
|
141
153
|
}
|
|
@@ -182,11 +194,11 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
|
|
|
182
194
|
onCurrentTraceVideoClick: onCurrentTraceVideoClick
|
|
183
195
|
}));
|
|
184
196
|
};
|
|
185
|
-
var KnowledgeIconGroup = function KnowledgeIconGroup(
|
|
186
|
-
var content =
|
|
187
|
-
messageId =
|
|
188
|
-
onCurrentTraceVideoClick =
|
|
189
|
-
curPlayer =
|
|
197
|
+
var KnowledgeIconGroup = function KnowledgeIconGroup(_ref4) {
|
|
198
|
+
var content = _ref4.content,
|
|
199
|
+
messageId = _ref4.messageId,
|
|
200
|
+
onCurrentTraceVideoClick = _ref4.onCurrentTraceVideoClick,
|
|
201
|
+
curPlayer = _ref4.curPlayer;
|
|
190
202
|
var parseArr = [];
|
|
191
203
|
var knowledgeMap = React.useMemo(function () {
|
|
192
204
|
var returnMap = new Map();
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { documentConstants } from "../../constants";
|
|
6
6
|
import { useAppSelector } from "../../store/hooks";
|
|
7
7
|
var FileItem = function FileItem(_ref) {
|
|
8
|
-
var _konwledgeTraceState
|
|
8
|
+
var _konwledgeTraceState$, _item$name;
|
|
9
9
|
var item = _ref.item,
|
|
10
10
|
handleCurrentTrace = _ref.handleCurrentTrace;
|
|
11
11
|
var _useTranslation = useTranslation(),
|
|
@@ -16,6 +16,8 @@ var FileItem = function FileItem(_ref) {
|
|
|
16
16
|
var isActive = (_konwledgeTraceState$ = konwledgeTraceState.resources) === null || _konwledgeTraceState$ === void 0 || (_konwledgeTraceState$ = _konwledgeTraceState$.map(function (item) {
|
|
17
17
|
return item.id;
|
|
18
18
|
})) === null || _konwledgeTraceState$ === void 0 ? void 0 : _konwledgeTraceState$.includes("".concat(item.hostId));
|
|
19
|
+
var title = (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.trim();
|
|
20
|
+
var subInfo = [item.suffix, item.sizeUnit].filter(Boolean).join(' | ');
|
|
19
21
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
22
|
className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
|
|
21
23
|
onClick: function onClick() {
|
|
@@ -29,9 +31,9 @@ var FileItem = function FileItem(_ref) {
|
|
|
29
31
|
className: styles.description
|
|
30
32
|
}, /*#__PURE__*/React.createElement("div", {
|
|
31
33
|
className: styles.text
|
|
32
|
-
},
|
|
34
|
+
}, title || t('trace.card.noTitle')), subInfo && /*#__PURE__*/React.createElement("div", {
|
|
33
35
|
className: styles.timeTrace
|
|
34
|
-
},
|
|
36
|
+
}, subInfo), item.isDelete === 1 && title && /*#__PURE__*/React.createElement("div", {
|
|
35
37
|
className: styles.knowledge_trace_deactive
|
|
36
38
|
}, t('trace.document.invalid'))));
|
|
37
39
|
};
|
|
@@ -354,6 +354,7 @@
|
|
|
354
354
|
.knowledgeList .knowledge .description {
|
|
355
355
|
display: flex;
|
|
356
356
|
flex-direction: column;
|
|
357
|
+
justify-content: center;
|
|
357
358
|
gap: 5px;
|
|
358
359
|
}
|
|
359
360
|
.knowledgeList .knowledge .description .text {
|
|
@@ -436,7 +437,6 @@
|
|
|
436
437
|
-webkit-line-clamp: 2;
|
|
437
438
|
-webkit-box-orient: vertical;
|
|
438
439
|
overflow: hidden;
|
|
439
|
-
width: 170px;
|
|
440
440
|
max-height: 63px;
|
|
441
441
|
overflow: hidden;
|
|
442
442
|
font-family: "PingFang SC";
|
|
@@ -453,12 +453,12 @@
|
|
|
453
453
|
-webkit-box-orient: vertical;
|
|
454
454
|
overflow: hidden;
|
|
455
455
|
color: var(--theme-dustyNeutral, #717F94);
|
|
456
|
-
width: 150px;
|
|
457
456
|
font-family: "PingFang SC";
|
|
458
457
|
font-weight: 400;
|
|
459
458
|
font-size: 12px;
|
|
460
459
|
line-height: 150%;
|
|
461
460
|
letter-spacing: 0px;
|
|
461
|
+
margin-top: 8px;
|
|
462
462
|
}
|
|
463
463
|
.knowledgeList .active {
|
|
464
464
|
border: 1px solid #0073e6;
|
|
@@ -13,6 +13,8 @@ var InformationList = function InformationList(_ref) {
|
|
|
13
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
14
|
className: styles.knowledgeList
|
|
15
15
|
}, list.map(function (item) {
|
|
16
|
+
var _item$title;
|
|
17
|
+
var title = (_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.trim();
|
|
16
18
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
19
|
className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : ''),
|
|
18
20
|
onClick: function onClick() {
|
|
@@ -25,7 +27,7 @@ var InformationList = function InformationList(_ref) {
|
|
|
25
27
|
className: styles.description
|
|
26
28
|
}, /*#__PURE__*/React.createElement("div", {
|
|
27
29
|
className: styles.text
|
|
28
|
-
},
|
|
30
|
+
}, title || t('trace.card.noTitle')), item.isDelete === 1 && title && /*#__PURE__*/React.createElement("div", {
|
|
29
31
|
className: styles.knowledge_trace_deactive
|
|
30
32
|
}, t('trace.information.invalid'))));
|
|
31
33
|
}));
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { knowledgeConstants } from "../../constants";
|
|
6
6
|
import { useAppSelector } from "../../store/hooks";
|
|
7
7
|
var VideoItem = function VideoItem(_ref) {
|
|
8
|
-
var _konwledgeTraceState
|
|
8
|
+
var _konwledgeTraceState$, _item$name;
|
|
9
9
|
var item = _ref.item,
|
|
10
10
|
_onClick = _ref.onClick;
|
|
11
11
|
var _useTranslation = useTranslation(),
|
|
@@ -16,6 +16,8 @@ var VideoItem = function VideoItem(_ref) {
|
|
|
16
16
|
var isActive = (_konwledgeTraceState$ = konwledgeTraceState.resources) === null || _konwledgeTraceState$ === void 0 || (_konwledgeTraceState$ = _konwledgeTraceState$.map(function (item) {
|
|
17
17
|
return item.id;
|
|
18
18
|
})) === null || _konwledgeTraceState$ === void 0 ? void 0 : _konwledgeTraceState$.includes("".concat(item.sliceId));
|
|
19
|
+
var title = (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.trim();
|
|
20
|
+
var hasSegment = !!(item.startedAt || item.endedAt);
|
|
19
21
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
22
|
className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
|
|
21
23
|
onClick: function onClick() {
|
|
@@ -37,12 +39,12 @@ var VideoItem = function VideoItem(_ref) {
|
|
|
37
39
|
className: styles.class_description
|
|
38
40
|
}, /*#__PURE__*/React.createElement("div", {
|
|
39
41
|
className: styles.text
|
|
40
|
-
},
|
|
42
|
+
}, title || t('trace.card.noTitle')), hasSegment && /*#__PURE__*/React.createElement("div", {
|
|
41
43
|
className: styles.timeTrace
|
|
42
44
|
}, t('trace.video.segment', {
|
|
43
45
|
start: item.startedAt || "0'0\"",
|
|
44
46
|
end: item.endedAt || "0'0\""
|
|
45
|
-
})), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
})), item.isDelete === 1 && title && /*#__PURE__*/React.createElement("div", {
|
|
46
48
|
className: styles.knowledge_trace_deactive
|
|
47
49
|
}, t('trace.video.invalid'))));
|
|
48
50
|
};
|
|
@@ -21,17 +21,20 @@ import ClassList from "../knowledge-trace/classList";
|
|
|
21
21
|
import AiLoading from "../ai-loading";
|
|
22
22
|
import ShadowLoading from "../shadow-loading";
|
|
23
23
|
var Empty = function Empty() {
|
|
24
|
+
var _useTranslation = useTranslation(),
|
|
25
|
+
t = _useTranslation.t;
|
|
24
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
27
|
style: {
|
|
26
|
-
margin: '
|
|
28
|
+
margin: '20px auto',
|
|
29
|
+
paddingBottom: 16,
|
|
27
30
|
textAlign: 'center'
|
|
28
31
|
}
|
|
29
|
-
},
|
|
32
|
+
}, t('trace.empty.noReference'));
|
|
30
33
|
};
|
|
31
34
|
var ProductTag = function ProductTag(_ref) {
|
|
32
35
|
var value = _ref.value;
|
|
33
|
-
var
|
|
34
|
-
t =
|
|
36
|
+
var _useTranslation2 = useTranslation(),
|
|
37
|
+
t = _useTranslation2.t;
|
|
35
38
|
var _useState = useState(false),
|
|
36
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
40
|
showPanel = _useState2[0],
|
|
@@ -42,6 +42,9 @@ declare const enUS: {
|
|
|
42
42
|
'trace.document.coverAlt': string;
|
|
43
43
|
'trace.document.invalid': string;
|
|
44
44
|
'trace.information.invalid': string;
|
|
45
|
+
'trace.information.empty': string;
|
|
46
|
+
'trace.empty.noReference': string;
|
|
47
|
+
'trace.card.noTitle': string;
|
|
45
48
|
'trace.document.total': string;
|
|
46
49
|
'trace.document.unsupported': string;
|
|
47
50
|
'trace.document.unsupportedTips': string;
|
|
@@ -42,6 +42,9 @@ var enUS = {
|
|
|
42
42
|
'trace.document.coverAlt': 'Document image',
|
|
43
43
|
'trace.document.invalid': 'Invalid',
|
|
44
44
|
'trace.information.invalid': 'Invalid',
|
|
45
|
+
'trace.information.empty': 'This article is no longer available',
|
|
46
|
+
'trace.empty.noReference': 'The original reference is currently unavailable. Please search again for related content.',
|
|
47
|
+
'trace.card.noTitle': 'Unable to view this reference. Please search again for related content.',
|
|
45
48
|
'trace.document.total': '{{count}} documents in this conversation',
|
|
46
49
|
'trace.document.unsupported': 'This file type cannot be previewed',
|
|
47
50
|
'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.',
|
|
@@ -42,6 +42,9 @@ declare const zhCN: {
|
|
|
42
42
|
'trace.document.coverAlt': string;
|
|
43
43
|
'trace.document.invalid': string;
|
|
44
44
|
'trace.information.invalid': string;
|
|
45
|
+
'trace.information.empty': string;
|
|
46
|
+
'trace.empty.noReference': string;
|
|
47
|
+
'trace.card.noTitle': string;
|
|
45
48
|
'trace.document.total': string;
|
|
46
49
|
'trace.document.unsupported': string;
|
|
47
50
|
'trace.document.unsupportedTips': string;
|
|
@@ -42,6 +42,9 @@ var zhCN = {
|
|
|
42
42
|
'trace.document.coverAlt': '文档图片',
|
|
43
43
|
'trace.document.invalid': '已失效',
|
|
44
44
|
'trace.information.invalid': '已失效',
|
|
45
|
+
'trace.information.empty': '该资讯已失效',
|
|
46
|
+
'trace.empty.noReference': '当前无法查看原引用片段,可重新检索相关内容。',
|
|
47
|
+
'trace.card.noTitle': '无法查看该引用片段,可重新检索相关内容。',
|
|
45
48
|
'trace.document.total': '本对话共{{count}}个文档',
|
|
46
49
|
'trace.document.unsupported': '当前文件不支持预览',
|
|
47
50
|
'trace.document.unsupportedTips': '文件格式不支持在线试看,您可以下载后用其他软件查看。\n如需查看完整文档,请点击“去查看”按钮。',
|