@myun/gimi-chat 0.3.7 → 0.3.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/components/chat-input/index.js +8 -2
- package/dist/components/chat-input/index.module.css +42 -0
- package/dist/components/file-card/fileCardSidebar.d.ts +1 -1
- package/dist/components/file-card/fileCardSidebar.js +2 -2
- package/dist/components/gimi-sidebar/index.module.css +1 -0
- package/dist/components/knowledge-trace/index.d.ts +1 -1
- package/dist/components/knowledge-trace/index.js +2 -2
- package/dist/components/quoted-content/index.js +15 -11
- package/dist/components/quoted-content/index.module.css +23 -6
- package/dist/umd/index.min.js +1 -1
- package/package.json +1 -1
|
@@ -296,6 +296,12 @@ var ChatInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
296
296
|
}))
|
|
297
297
|
});
|
|
298
298
|
}, [props.enableVoiceChat, props.enableVoiceRecord, props.disabled, props.disableVoiceCommunication, props.isVoiceGetting, isMsgRecieving, openChatCommunication, props.shortAsrClick, agentObj === null || agentObj === void 0 ? void 0 : agentObj.isEnableVoiceCall]);
|
|
299
|
+
var renderQuotedContent = React.useMemo(function () {
|
|
300
|
+
if (!props.enableSourceQuote) {
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
return /*#__PURE__*/React.createElement(QuotedContent, null);
|
|
304
|
+
}, [props.enableSourceQuote]);
|
|
299
305
|
var renderActionArea = React.useCallback(function (renderProps) {
|
|
300
306
|
return /*#__PURE__*/React.createElement("div", {
|
|
301
307
|
className: renderProps.className,
|
|
@@ -305,13 +311,13 @@ var ChatInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
305
311
|
display: 'flex',
|
|
306
312
|
alignItems: 'center'
|
|
307
313
|
}
|
|
308
|
-
},
|
|
314
|
+
}, renderQuotedContent, VoiceTools, UploadFileTool, /*#__PURE__*/React.createElement(Divider, {
|
|
309
315
|
layout: "vertical",
|
|
310
316
|
style: {
|
|
311
317
|
marginLeft: 8
|
|
312
318
|
}
|
|
313
319
|
})), renderProps.menuItem);
|
|
314
|
-
}, [VoiceTools, UploadFileTool,
|
|
320
|
+
}, [VoiceTools, UploadFileTool, renderQuotedContent]);
|
|
315
321
|
var onMessageSend = React.useCallback(function (content) {
|
|
316
322
|
var _props$onSend;
|
|
317
323
|
var inputContents = content.inputContents || [];
|
|
@@ -48,4 +48,46 @@
|
|
|
48
48
|
margin: 0px 10px 10px 10px;
|
|
49
49
|
padding: 16px;
|
|
50
50
|
max-width: 800px;
|
|
51
|
+
max-height: 400px;
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
scrollbar-width: thin;
|
|
54
|
+
scrollbar-color: #d1d1d1 transparent;
|
|
55
|
+
}
|
|
56
|
+
.chatInput::-webkit-scrollbar {
|
|
57
|
+
width: 4px;
|
|
58
|
+
}
|
|
59
|
+
.chatInput::-webkit-scrollbar-thumb {
|
|
60
|
+
background-color: #d1d1d1;
|
|
61
|
+
border-radius: 2px;
|
|
62
|
+
border: none;
|
|
63
|
+
}
|
|
64
|
+
.chatInput::-webkit-scrollbar-track {
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
border: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.reference {
|
|
70
|
+
max-height: 180px;
|
|
71
|
+
overflow: auto;
|
|
72
|
+
flex: 1;
|
|
73
|
+
scrollbar-width: thin;
|
|
74
|
+
scrollbar-color: #d1d1d1 transparent;
|
|
75
|
+
}
|
|
76
|
+
.reference::-webkit-scrollbar {
|
|
77
|
+
width: 4px;
|
|
78
|
+
}
|
|
79
|
+
.reference::-webkit-scrollbar-thumb {
|
|
80
|
+
background-color: #d1d1d1;
|
|
81
|
+
border-radius: 2px;
|
|
82
|
+
border: none;
|
|
83
|
+
}
|
|
84
|
+
.reference::-webkit-scrollbar-track {
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
border: none;
|
|
87
|
+
}
|
|
88
|
+
.reference .references {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-wrap: wrap;
|
|
91
|
+
align-items: center;
|
|
92
|
+
padding-top: 5px;
|
|
51
93
|
}
|
|
@@ -7,7 +7,7 @@ import ReactDOM from 'react-dom';
|
|
|
7
7
|
import styles from "./index.module.css";
|
|
8
8
|
import { FileCard } from ".";
|
|
9
9
|
var FileCardSideBar = function FileCardSideBar(props) {
|
|
10
|
-
var
|
|
10
|
+
var sidebarTargetElm = props.sidebarTargetElm,
|
|
11
11
|
isOverFlow = props.isOverFlow,
|
|
12
12
|
className = props.className,
|
|
13
13
|
style = props.style;
|
|
@@ -48,7 +48,7 @@ var FileCardSideBar = function FileCardSideBar(props) {
|
|
|
48
48
|
})));
|
|
49
49
|
};
|
|
50
50
|
if (isOverFlow) {
|
|
51
|
-
var targetElm =
|
|
51
|
+
var targetElm = sidebarTargetElm || document.getElementById('myun_gimi_design_chat');
|
|
52
52
|
if (!targetElm) return null;
|
|
53
53
|
return /*#__PURE__*/ReactDOM.createPortal(renderContent(), targetElm);
|
|
54
54
|
}
|
|
@@ -18,7 +18,7 @@ import AiLoading from "../ai-loading";
|
|
|
18
18
|
import ReactDOM from 'react-dom';
|
|
19
19
|
import GimiSideBar from "../gimi-sidebar";
|
|
20
20
|
var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
21
|
-
var
|
|
21
|
+
var sidebarTargetElm = _ref.sidebarTargetElm,
|
|
22
22
|
chatList = _ref.chatList,
|
|
23
23
|
isOverFlow = _ref.isOverFlow,
|
|
24
24
|
className = _ref.className,
|
|
@@ -146,7 +146,7 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
|
146
146
|
})) : tabContent));
|
|
147
147
|
};
|
|
148
148
|
if (isOverFlow && (kowledgeTraceList === null || kowledgeTraceList === void 0 ? void 0 : kowledgeTraceList.length) > 0) {
|
|
149
|
-
var targetElm =
|
|
149
|
+
var targetElm = sidebarTargetElm || document.getElementById('myun_gimi_design_chat');
|
|
150
150
|
if (!targetElm) return null;
|
|
151
151
|
return /*#__PURE__*/ReactDOM.createPortal(renderContent(), targetElm);
|
|
152
152
|
}
|
|
@@ -14,7 +14,7 @@ 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,
|
|
17
|
+
import { Input, Toast, Table, Popover, Tooltip } from '@douyinfe/semi-ui';
|
|
18
18
|
import styles from "./index.module.css";
|
|
19
19
|
import { useCallback, useRef, useState } from 'react';
|
|
20
20
|
import IconFontCom from "../iconfont-com";
|
|
@@ -74,6 +74,7 @@ var QuotedContent = function QuotedContent() {
|
|
|
74
74
|
title: '名称',
|
|
75
75
|
dataIndex: 'name',
|
|
76
76
|
key: 'name',
|
|
77
|
+
width: '100%',
|
|
77
78
|
render: function render(text) {
|
|
78
79
|
return /*#__PURE__*/React.createElement("span", {
|
|
79
80
|
className: styles.listItem
|
|
@@ -82,7 +83,8 @@ var QuotedContent = function QuotedContent() {
|
|
|
82
83
|
className: styles.img,
|
|
83
84
|
src: activeKey === 'video' ? knowledgeConstants.VIDEO_ICON_ADDRESS : knowledgeConstants.CLASS_ICON_BIG_ADDRESS
|
|
84
85
|
}), /*#__PURE__*/React.createElement("span", {
|
|
85
|
-
className: styles.text
|
|
86
|
+
className: styles.text,
|
|
87
|
+
title: text
|
|
86
88
|
}, text));
|
|
87
89
|
}
|
|
88
90
|
}];
|
|
@@ -206,12 +208,8 @@ var QuotedContent = function QuotedContent() {
|
|
|
206
208
|
return /*#__PURE__*/React.createElement("div", {
|
|
207
209
|
style: {
|
|
208
210
|
padding: 12,
|
|
209
|
-
width:
|
|
210
|
-
|
|
211
|
-
}, /*#__PURE__*/React.createElement(Space, {
|
|
212
|
-
style: {
|
|
213
|
-
width: '100%',
|
|
214
|
-
height: '100%'
|
|
211
|
+
width: 380,
|
|
212
|
+
position: 'relative'
|
|
215
213
|
}
|
|
216
214
|
}, /*#__PURE__*/React.createElement("div", {
|
|
217
215
|
className: styles.quotedContent
|
|
@@ -260,22 +258,28 @@ var QuotedContent = function QuotedContent() {
|
|
|
260
258
|
}
|
|
261
259
|
};
|
|
262
260
|
}
|
|
263
|
-
})))))
|
|
261
|
+
})))));
|
|
264
262
|
};
|
|
265
263
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
266
264
|
visible: showmodel,
|
|
267
265
|
content: renderContent,
|
|
268
266
|
trigger: "custom",
|
|
269
267
|
stopPropagation: true,
|
|
270
|
-
onClickOutSide: handleClose
|
|
268
|
+
onClickOutSide: handleClose,
|
|
269
|
+
position: "bottomLeft",
|
|
270
|
+
spacing: 6
|
|
271
271
|
}, /*#__PURE__*/React.createElement("div", {
|
|
272
272
|
className: "".concat(styles.quotationIcon, " ").concat(showmodel && styles.isActive),
|
|
273
273
|
onClick: function onClick() {
|
|
274
274
|
return setShowmodel(true);
|
|
275
275
|
}
|
|
276
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
277
|
+
content: "\u5F15\u7528\u8BFE\u7A0B",
|
|
278
|
+
position: "top",
|
|
279
|
+
visible: showmodel ? false : undefined
|
|
276
280
|
}, /*#__PURE__*/React.createElement("img", {
|
|
277
281
|
src: showmodel ? isActiveQuotoIcon : quotoIcon,
|
|
278
282
|
alt: ""
|
|
279
|
-
})));
|
|
283
|
+
}))));
|
|
280
284
|
};
|
|
281
285
|
export default QuotedContent;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
overflow: hidden;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
.searchInput {
|
|
@@ -11,6 +13,7 @@
|
|
|
11
13
|
font-size: 12px;
|
|
12
14
|
padding: 0 10px;
|
|
13
15
|
border-radius: 8px;
|
|
16
|
+
width: 100%;
|
|
14
17
|
}
|
|
15
18
|
.searchInput input::placeholder {
|
|
16
19
|
color: #7d91b3;
|
|
@@ -18,18 +21,25 @@
|
|
|
18
21
|
|
|
19
22
|
.content {
|
|
20
23
|
padding-top: 10px;
|
|
24
|
+
width: 100%;
|
|
25
|
+
overflow: hidden;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
.newtab {
|
|
24
29
|
padding-bottom: 10px;
|
|
30
|
+
width: 100%;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: nowrap;
|
|
33
|
+
overflow-x: auto;
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
.tabItem {
|
|
28
37
|
font-size: 14px;
|
|
29
38
|
padding: 5px 10px;
|
|
30
|
-
margin:
|
|
39
|
+
margin-right: 16px;
|
|
31
40
|
border-radius: 8px;
|
|
32
41
|
cursor: pointer;
|
|
42
|
+
flex-shrink: 0;
|
|
33
43
|
}
|
|
34
44
|
.tabItem:hover {
|
|
35
45
|
background-color: #f7f7fc;
|
|
@@ -45,29 +55,35 @@
|
|
|
45
55
|
.tabContent {
|
|
46
56
|
overflow: auto;
|
|
47
57
|
height: 200px;
|
|
58
|
+
width: 100%;
|
|
48
59
|
}
|
|
49
60
|
.tabContent .table {
|
|
50
61
|
table-layout: fixed;
|
|
51
|
-
|
|
52
|
-
.tabContent .table :global(.semi-table-row-cell) span {
|
|
53
|
-
width: 270px;
|
|
62
|
+
width: 100%;
|
|
54
63
|
}
|
|
55
64
|
.tabContent .table :global(.semi-table-row-cell) {
|
|
56
65
|
font-size: 12px;
|
|
57
66
|
border: none !important;
|
|
58
|
-
|
|
67
|
+
padding: 8px 0;
|
|
59
68
|
overflow: hidden;
|
|
60
69
|
text-overflow: ellipsis;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
max-width: 0;
|
|
72
|
+
}
|
|
73
|
+
.tabContent .table :global(.semi-table-tbody .semi-table-row) {
|
|
74
|
+
width: 100%;
|
|
61
75
|
}
|
|
62
76
|
.tabContent .table .listItem {
|
|
63
77
|
display: flex;
|
|
64
78
|
align-items: center;
|
|
65
79
|
cursor: pointer;
|
|
66
80
|
width: 100%;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
min-width: 0;
|
|
67
83
|
}
|
|
68
84
|
.tabContent .table .listItem .img {
|
|
69
85
|
width: 16px;
|
|
70
|
-
margin-right:
|
|
86
|
+
margin-right: 8px;
|
|
71
87
|
flex-shrink: 0;
|
|
72
88
|
}
|
|
73
89
|
.tabContent .table .listItem .text {
|
|
@@ -75,6 +91,7 @@
|
|
|
75
91
|
overflow: hidden;
|
|
76
92
|
text-overflow: ellipsis;
|
|
77
93
|
white-space: nowrap;
|
|
94
|
+
min-width: 0;
|
|
78
95
|
}
|
|
79
96
|
|
|
80
97
|
.tabContent::-webkit-scrollbar {
|