@myun/gimi-chat 0.0.8 → 0.1.0
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/apis/useApi.d.ts +2 -0
- package/dist/apis/useApi.js +50 -2
- package/dist/components/ai-chat-dialogue/index.js +135 -181
- package/dist/components/ai-correction/index.js +25 -38
- package/dist/components/ai-loading/index.js +8 -12
- package/dist/components/answer-item/index.d.ts +3 -0
- package/dist/components/answer-item/index.js +126 -135
- package/dist/components/ask-card/index.js +33 -42
- package/dist/components/chat-input/extension/index.d.ts +2 -0
- package/dist/components/chat-input/extension/index.js +2 -0
- package/dist/components/chat-input/extension/keydown/index.d.ts +3 -0
- package/dist/components/chat-input/extension/keydown/index.js +37 -0
- package/dist/components/chat-input/extension/title-slot/Component.d.ts +4 -0
- package/dist/components/chat-input/extension/title-slot/Component.js +18 -0
- package/dist/components/chat-input/extension/title-slot/index.d.ts +3 -0
- package/dist/components/chat-input/extension/title-slot/index.js +47 -0
- package/dist/components/chat-input/extension/title-slot/index.less +22 -0
- package/dist/components/chat-input/index.d.ts +4 -0
- package/dist/components/chat-input/index.js +144 -145
- package/dist/components/chat-input/index.module.css +7 -0
- package/dist/components/chat-voice/VoiceCommunication.js +21 -23
- package/dist/components/chat-voice/VoiceRecord.js +21 -24
- package/dist/components/conversation-delete/index.js +8 -10
- package/dist/components/dots-loading/index.js +7 -10
- package/dist/components/empty/index.js +7 -12
- package/dist/components/excel-components/ExcelCard.js +3 -7
- package/dist/components/excel-components/ExcelExcuting.js +43 -60
- package/dist/components/excel-components/ExcelFailCard.js +10 -15
- package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -1
- package/dist/components/excel-components/ExcelSuccessCard.js +13 -6
- package/dist/components/file-card/fileCardSidebar.js +17 -23
- package/dist/components/file-card/index.d.ts +3 -0
- package/dist/components/file-card/index.js +59 -69
- package/dist/components/file-card/index.module.css +1 -1
- package/dist/components/file-preview/index.js +62 -37
- package/dist/components/file-preview/index.module.css +33 -0
- package/dist/components/file-upload/index.js +7 -10
- package/dist/components/file-upload/uploadV1.js +27 -33
- package/dist/components/gimi-sidebar/index.js +13 -20
- package/dist/components/header/index.js +11 -18
- package/dist/components/iconfont-com/index.js +33 -12
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/knowledge-trace/KnowledgeIconComponent.js +22 -28
- package/dist/components/knowledge-trace/classList.js +28 -37
- package/dist/components/knowledge-trace/documentList.js +27 -36
- package/dist/components/knowledge-trace/index.js +21 -28
- package/dist/components/knowledge-trace/videoList.js +36 -46
- package/dist/components/lottie-img/index.js +8 -10
- package/dist/components/message-actions/CopyButton.d.ts +1 -1
- package/dist/components/message-actions/CopyButton.js +22 -25
- package/dist/components/message-actions/LikeButton.js +22 -25
- package/dist/components/message-actions/RegenerateButton.js +18 -21
- package/dist/components/message-actions/UnLikeButton.js +22 -25
- package/dist/components/message-actions/VoicePlay.js +22 -25
- package/dist/components/message-list/index.js +83 -87
- package/dist/components/no-microphone-root/index.js +29 -39
- package/dist/components/preset-agent-content/index.d.ts +1 -0
- package/dist/components/preset-agent-content/index.js +27 -20
- package/dist/components/quoted-content/index.d.ts +3 -0
- package/dist/components/quoted-content/index.js +271 -163
- package/dist/components/quoted-content/index.module.css +20 -0
- package/dist/components/reasoning-content/index.d.ts +3 -2
- package/dist/components/reasoning-content/index.js +50 -61
- package/dist/components/reference-content/index.js +62 -71
- package/dist/components/reference-content/index.module.css +1 -0
- package/dist/components/search-result/index.d.ts +7 -0
- package/dist/components/search-result/index.js +182 -0
- package/dist/components/search-result/index.module.css +235 -0
- package/dist/components/templates/CommonChat.js +75 -79
- package/dist/components/templates/GimiChatComponent.js +6 -13
- package/dist/components/upload-list/index.js +41 -56
- package/dist/components/voice-bars/index.js +19 -22
- package/dist/components/voice-check-dialog/index.js +17 -24
- package/dist/components/voice-recording/index.js +42 -57
- package/dist/components/work-flow-content/index.js +8 -11
- package/dist/hooks/useChatActions.d.ts +1 -1
- package/dist/hooks/useChatActions.js +3 -1
- package/dist/hooks/useCommonChatAPI.d.ts +2 -1
- package/dist/hooks/useCommonChatAPI.js +10 -8
- package/dist/hooks/useQuoted.d.ts +12 -0
- package/dist/hooks/useQuoted.js +202 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/index.js +3 -0
- package/dist/types/answer.d.ts +16 -0
- package/dist/types/chat.d.ts +124 -0
- package/dist/types/file.d.ts +20 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/modules.d.ts +36 -0
- package/dist/utils/aes.d.ts +21 -0
- package/dist/utils/aes.js +61 -0
- package/dist/utils/chatInputUtil.d.ts +1 -1
- package/dist/utils/chatInputUtil.js +4 -3
- package/package.json +1 -1
- package/dist/components/templates/demo/demo.d.ts +0 -2
- package/dist/components/templates/demo/demo.js +0 -111
- package/dist/components/work-flow-content/demo.d.ts +0 -3
- package/dist/components/work-flow-content/demo.js +0 -12
|
@@ -77,6 +77,39 @@
|
|
|
77
77
|
border: none;
|
|
78
78
|
display: block;
|
|
79
79
|
}
|
|
80
|
+
.iframeContainer .empty {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
height: 100%;
|
|
86
|
+
background-color: #ffffff;
|
|
87
|
+
}
|
|
88
|
+
.iframeContainer .empty .emptyImage {
|
|
89
|
+
width: 122px;
|
|
90
|
+
}
|
|
91
|
+
.iframeContainer .empty p {
|
|
92
|
+
color: #9aa7b7;
|
|
93
|
+
}
|
|
94
|
+
.iframeContainer .empty .retryButton {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
margin-top: 20px;
|
|
98
|
+
border-radius: 22px;
|
|
99
|
+
width: 88px;
|
|
100
|
+
height: 40px;
|
|
101
|
+
background-color: #ffffff;
|
|
102
|
+
padding: 10px 20px;
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
border: #e9ebf2 1px solid;
|
|
105
|
+
box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.0588235294);
|
|
106
|
+
}
|
|
107
|
+
.iframeContainer .empty .retryButton .replayIcon {
|
|
108
|
+
padding: 2px;
|
|
109
|
+
}
|
|
110
|
+
.iframeContainer .empty .retryButton:hover {
|
|
111
|
+
color: #4086ff;
|
|
112
|
+
}
|
|
80
113
|
|
|
81
114
|
.mainHidden {
|
|
82
115
|
display: none;
|
|
@@ -9,7 +9,6 @@ import { useAppDispatch, useAppSelector } from "../../store/hooks";
|
|
|
9
9
|
import { setFileList } from "../../store/slices/gimiMenuSlice";
|
|
10
10
|
import { FileStatus } from "../../interfaces/fileInterface";
|
|
11
11
|
import { useGimiFileUpload } from "../../hooks/useFile";
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
12
|
var DEFAULT_ACCEPT = '.xlsx,.txt';
|
|
14
13
|
var MAX_RETRY_COUNT = 3;
|
|
15
14
|
/** Redux FileItem → Semi Upload FileItem */
|
|
@@ -220,12 +219,11 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
220
219
|
retryUpload: retryUpload
|
|
221
220
|
};
|
|
222
221
|
});
|
|
223
|
-
var trigger = /*#__PURE__*/
|
|
224
|
-
icon: /*#__PURE__*/
|
|
225
|
-
type: "tertiary"
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return /*#__PURE__*/_jsx(Upload, {
|
|
222
|
+
var trigger = /*#__PURE__*/React.createElement(Button, {
|
|
223
|
+
icon: /*#__PURE__*/React.createElement(IconPaperclip, null),
|
|
224
|
+
type: "tertiary"
|
|
225
|
+
}, "\u70B9\u51FB\u4E0A\u4F20");
|
|
226
|
+
return /*#__PURE__*/React.createElement(Upload, {
|
|
229
227
|
customRequest: customRequest,
|
|
230
228
|
action: "",
|
|
231
229
|
limit: limit,
|
|
@@ -234,8 +232,7 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
234
232
|
maxSize: maxSize * 1024,
|
|
235
233
|
disabled: disabled,
|
|
236
234
|
showUploadList: false,
|
|
237
|
-
fileList: transformFileItem(fileList || [])
|
|
238
|
-
|
|
239
|
-
});
|
|
235
|
+
fileList: transformFileItem(fileList || [])
|
|
236
|
+
}, children || trigger);
|
|
240
237
|
});
|
|
241
238
|
export default FileUpload;
|
|
@@ -14,8 +14,6 @@ import { FileStatus } from "../../interfaces/fileInterface";
|
|
|
14
14
|
import { useAppDispatch, useAppSelector } from "../../store/hooks";
|
|
15
15
|
import { setFileList } from "../../store/slices/gimiMenuSlice";
|
|
16
16
|
import { useGimiFileUpload } from "../../hooks/useFile";
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
17
|
var defaultFileLimit = '.xlsx,.txt';
|
|
20
18
|
var transformFileItem = function transformFileItem(item) {
|
|
21
19
|
return item.map(function (file) {
|
|
@@ -140,11 +138,10 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
140
138
|
abortSSE();
|
|
141
139
|
};
|
|
142
140
|
}, [abortSSE]);
|
|
143
|
-
var defailtTrigger = /*#__PURE__*/
|
|
144
|
-
icon: /*#__PURE__*/
|
|
145
|
-
type: "tertiary"
|
|
146
|
-
|
|
147
|
-
});
|
|
141
|
+
var defailtTrigger = /*#__PURE__*/React.createElement(Button, {
|
|
142
|
+
icon: /*#__PURE__*/React.createElement(IconPaperclip, null),
|
|
143
|
+
type: "tertiary"
|
|
144
|
+
}, "\u70B9\u51FB\u4E0A\u4F20");
|
|
148
145
|
var customRequest = /*#__PURE__*/function () {
|
|
149
146
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
150
147
|
var file, onSuccess, onError, controller, formData, rawFile, _response$result2, response, responseObj;
|
|
@@ -243,31 +240,28 @@ var FileUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
243
240
|
return _ref.apply(this, arguments);
|
|
244
241
|
};
|
|
245
242
|
}();
|
|
246
|
-
return /*#__PURE__*/
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
children: children || defailtTrigger
|
|
270
|
-
})
|
|
271
|
-
});
|
|
243
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Upload, {
|
|
244
|
+
customRequest: customRequest,
|
|
245
|
+
headers: {
|
|
246
|
+
'Authorization': 'Bearer ' + token
|
|
247
|
+
},
|
|
248
|
+
maxSize: maxSize || 10 * 1024,
|
|
249
|
+
limit: limit || 1,
|
|
250
|
+
multiple: (limit || 1) > 1,
|
|
251
|
+
onExceed: function onExceed() {
|
|
252
|
+
return Toast.warning("\u5355\u6B21\u4EC5\u652F\u6301\u4E0A\u4F20".concat(limit || 1, "\u4E2A\u6587\u4EF6"));
|
|
253
|
+
},
|
|
254
|
+
onSizeError: function onSizeError() {
|
|
255
|
+
return Toast.warning("\u6587\u4EF6\u5927\u5C0F\u8D85\u51FA\u9650\u5236");
|
|
256
|
+
},
|
|
257
|
+
onAcceptInvalid: function onAcceptInvalid() {
|
|
258
|
+
return Toast.warning("\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u7C7B\u578B");
|
|
259
|
+
},
|
|
260
|
+
accept: (accept === null || accept === void 0 ? void 0 : accept.join(',')) || defaultFileLimit,
|
|
261
|
+
fileList: transformFileItem(fileList || []),
|
|
262
|
+
disabled: disabled,
|
|
263
|
+
showUploadList: false,
|
|
264
|
+
onChange: onChange
|
|
265
|
+
}, children || defailtTrigger));
|
|
272
266
|
});
|
|
273
267
|
export default FileUpload;
|
|
@@ -4,8 +4,6 @@ import React from 'react';
|
|
|
4
4
|
import { IconClose } from "@douyinfe/semi-icons";
|
|
5
5
|
import { Button } from "@douyinfe/semi-ui";
|
|
6
6
|
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
7
|
var GimiSideBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
8
|
var show = _ref.show,
|
|
11
9
|
handleClose = _ref.handleClose,
|
|
@@ -24,25 +22,20 @@ var GimiSideBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24
22
|
contentRef: contentRef
|
|
25
23
|
};
|
|
26
24
|
}, [sideBarRef]);
|
|
27
|
-
return /*#__PURE__*/
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
26
|
className: classNames(show ? isOverFlow ? styles.overflow_layout : styles.main : styles.closed, className),
|
|
29
27
|
ref: sideBarRef,
|
|
30
|
-
style: style
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
className: styles.content,
|
|
43
|
-
ref: contentRef,
|
|
44
|
-
children: [render === null || render === void 0 ? void 0 : render(), children]
|
|
45
|
-
})]
|
|
46
|
-
});
|
|
28
|
+
style: style
|
|
29
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: styles.header
|
|
31
|
+
}, /*#__PURE__*/React.createElement("span", null, title), /*#__PURE__*/React.createElement(Button, {
|
|
32
|
+
size: "small",
|
|
33
|
+
theme: "borderless",
|
|
34
|
+
icon: /*#__PURE__*/React.createElement(IconClose, null),
|
|
35
|
+
onClick: handleClose
|
|
36
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: styles.content,
|
|
38
|
+
ref: contentRef
|
|
39
|
+
}, render === null || render === void 0 ? void 0 : render(), children));
|
|
47
40
|
});
|
|
48
41
|
export default GimiSideBar;
|
|
@@ -2,26 +2,19 @@ import classNames from 'classnames';
|
|
|
2
2
|
import styles from "./index.module.css";
|
|
3
3
|
import aiLogo from "../../assets/image/ai-logo.png";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
5
|
var Header = function Header(_ref) {
|
|
8
6
|
var _ref$title = _ref.title,
|
|
9
7
|
title = _ref$title === void 0 ? '' : _ref$title;
|
|
10
|
-
return /*#__PURE__*/
|
|
11
|
-
className: styles.header
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
children: title
|
|
22
|
-
})
|
|
23
|
-
})]
|
|
24
|
-
})
|
|
25
|
-
});
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: styles.header
|
|
10
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: styles.container
|
|
12
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
13
|
+
className: styles.logo,
|
|
14
|
+
src: aiLogo,
|
|
15
|
+
alt: ""
|
|
16
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: classNames(styles.title, 'ellipse')
|
|
18
|
+
}, /*#__PURE__*/React.createElement("span", null, title))));
|
|
26
19
|
};
|
|
27
20
|
export default Header;
|
|
@@ -11,20 +11,41 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
11
11
|
* @Description:阿里图标库组件-learn-platform
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
import Icon from '@douyinfe/semi-icons';
|
|
15
|
+
var scriptUrl = '//at.alicdn.com/t/c/font_3429456_0fjwg76h4xco.js';
|
|
16
|
+
|
|
17
|
+
// Load iconfont script
|
|
18
|
+
if (typeof document !== 'undefined' && scriptUrl) {
|
|
19
|
+
var existingScript = document.querySelector("script[src=\"".concat(scriptUrl, "\"]"));
|
|
20
|
+
if (!existingScript) {
|
|
21
|
+
var script = document.createElement('script');
|
|
22
|
+
script.src = scriptUrl;
|
|
23
|
+
script.setAttribute('data-namespace', scriptUrl);
|
|
24
|
+
document.body.appendChild(script);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
19
27
|
var IconFontCom = function IconFontCom(props) {
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
var type = props.type,
|
|
29
|
+
size = props.size,
|
|
30
|
+
color = props.color,
|
|
31
|
+
extraStyle = props.extraStyle,
|
|
32
|
+
className = props.className,
|
|
33
|
+
onClick = props.onClick;
|
|
34
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
35
|
+
type: type,
|
|
36
|
+
className: className,
|
|
37
|
+
onClick: onClick,
|
|
22
38
|
style: _objectSpread({
|
|
23
|
-
fontSize:
|
|
24
|
-
color:
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
fontSize: size || 12,
|
|
40
|
+
color: color
|
|
41
|
+
}, extraStyle),
|
|
42
|
+
svg: /*#__PURE__*/React.createElement("svg", {
|
|
43
|
+
width: "1em",
|
|
44
|
+
height: "1em",
|
|
45
|
+
fill: "currentColor"
|
|
46
|
+
}, /*#__PURE__*/React.createElement("use", {
|
|
47
|
+
xlinkHref: "#".concat(type)
|
|
48
|
+
}))
|
|
28
49
|
});
|
|
29
50
|
};
|
|
30
51
|
export default IconFontCom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as GimiChatComponent } from './templates/GimiChatComponent';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { default as GimiChatComponent } from "./templates/GimiChatComponent";
|
|
@@ -9,11 +9,9 @@ import { knowledgeConstants } from "../../constants";
|
|
|
9
9
|
import { useAppDispatch, useAppSelector } from "../../store/hooks";
|
|
10
10
|
import { setShowKonwledgeTrace, setKonwledgeTraceState } from "../../store/slices/gimiMenuSlice";
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
12
|
var KnowledgeIcon = function KnowledgeIcon(_ref) {
|
|
15
13
|
var url = _ref.url;
|
|
16
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
17
15
|
style: {
|
|
18
16
|
width: '12px',
|
|
19
17
|
height: '12px'
|
|
@@ -45,15 +43,12 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
|
|
|
45
43
|
showKonwledgeTrace: true
|
|
46
44
|
}));
|
|
47
45
|
};
|
|
48
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
47
|
className: styles.icon_btn,
|
|
50
|
-
onClick: handleIconClick
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
children: "".concat(resources === null || resources === void 0 ? void 0 : resources.length, "\u4E2A").concat(type === 'video' ? '视频' : type === 'product' ? '课程' : '文档')
|
|
55
|
-
})]
|
|
56
|
-
});
|
|
48
|
+
onClick: handleIconClick
|
|
49
|
+
}, /*#__PURE__*/React.createElement(KnowledgeIcon, {
|
|
50
|
+
url: iconUrl
|
|
51
|
+
}), /*#__PURE__*/React.createElement("span", null, "".concat(resources === null || resources === void 0 ? void 0 : resources.length, "\u4E2A").concat(type === 'video' ? '视频' : type === 'product' ? '课程' : '文档')));
|
|
57
52
|
};
|
|
58
53
|
var KnowledgeIconGroup = function KnowledgeIconGroup(_ref3) {
|
|
59
54
|
var value = _ref3.value;
|
|
@@ -84,24 +79,23 @@ var KnowledgeIconGroup = function KnowledgeIconGroup(_ref3) {
|
|
|
84
79
|
}
|
|
85
80
|
}, [value.content]);
|
|
86
81
|
var renderList = knowledgeMap.keys().toArray() || [];
|
|
87
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
88
83
|
style: {
|
|
89
84
|
display: 'inline-block'
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
85
|
+
}
|
|
86
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
style: {
|
|
88
|
+
display: 'flex',
|
|
89
|
+
gap: '5px',
|
|
90
|
+
flexWrap: 'wrap'
|
|
91
|
+
}
|
|
92
|
+
}, renderList.map(function (item) {
|
|
93
|
+
return /*#__PURE__*/React.createElement(KnowledgeIconComponent, {
|
|
94
|
+
type: item,
|
|
95
|
+
resources: knowledgeMap.get(item) || [],
|
|
96
|
+
key: item,
|
|
97
|
+
messageId: value.messageId
|
|
98
|
+
});
|
|
99
|
+
})));
|
|
106
100
|
};
|
|
107
101
|
export default KnowledgeIconGroup;
|
|
@@ -3,8 +3,6 @@ import classNames from 'classnames';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Toast, Tooltip } from '@douyinfe/semi-ui';
|
|
5
5
|
import { useAppSelector } from "../../store/hooks";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
6
|
var ClassItem = function ClassItem(_ref) {
|
|
9
7
|
var _konwledgeTraceState$, _item$name;
|
|
10
8
|
var item = _ref.item;
|
|
@@ -20,10 +18,9 @@ var ClassItem = function ClassItem(_ref) {
|
|
|
20
18
|
var tagContent = React.useMemo(function () {
|
|
21
19
|
if (item.showStyle === 0) return null;
|
|
22
20
|
var classes = item.showStyle === 1 ? styles.tag_badge_green : item.showStyle === 2 ? styles.tag_badge_warning : styles.tag_badge_default;
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
className: classes
|
|
25
|
-
|
|
26
|
-
});
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: classes
|
|
23
|
+
}, item.equityLabel);
|
|
27
24
|
}, [item.showStyle, item.equityLabel]);
|
|
28
25
|
var handleClick = function handleClick() {
|
|
29
26
|
if (item.isDelete === 1) return;
|
|
@@ -42,40 +39,34 @@ var ClassItem = function ClassItem(_ref) {
|
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
};
|
|
45
|
-
return /*#__PURE__*/
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
43
|
className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
|
|
47
|
-
onClick: handleClick
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className: styles.knowledge_trace_deactive,
|
|
62
|
-
children: "\u8BFE\u7A0B\u5931\u6548"
|
|
63
|
-
})]
|
|
64
|
-
})]
|
|
65
|
-
});
|
|
44
|
+
onClick: handleClick
|
|
45
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
46
|
+
alt: "\u8BFE\u7A0B\u5C01\u9762",
|
|
47
|
+
className: styles.class_img,
|
|
48
|
+
src: item.productUrl
|
|
49
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: styles.class_description
|
|
51
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: styles.text
|
|
53
|
+
}, tagContent, /*#__PURE__*/React.createElement(Tooltip, {
|
|
54
|
+
content: item.name
|
|
55
|
+
}, ((_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.length) > 33 ? "".concat(item.name.substring(0, 33), "...") : item.name || '')), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: styles.knowledge_trace_deactive
|
|
57
|
+
}, "\u8BFE\u7A0B\u5931\u6548")));
|
|
66
58
|
};
|
|
67
59
|
var ClassList = function ClassList(_ref2) {
|
|
68
60
|
var list = _ref2.list;
|
|
69
|
-
return /*#__PURE__*/
|
|
70
|
-
className: styles.knowledgeList
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: styles.knowledgeList
|
|
63
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
64
|
+
className: styles.total
|
|
65
|
+
}, "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u8BFE\u7A0B")), list.map(function (item) {
|
|
66
|
+
return /*#__PURE__*/React.createElement(ClassItem, {
|
|
67
|
+
item: item,
|
|
68
|
+
key: item.id
|
|
69
|
+
});
|
|
70
|
+
}));
|
|
80
71
|
};
|
|
81
72
|
export default ClassList;
|
|
@@ -4,8 +4,6 @@ import classNames from 'classnames';
|
|
|
4
4
|
import { documentConstants } from "../../constants";
|
|
5
5
|
import { Toast, Tooltip } from '@douyinfe/semi-ui';
|
|
6
6
|
import { useAppSelector } from "../../store/hooks";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
7
|
var SUPPORT_PREVIEW_FILE_TYPE = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'];
|
|
10
8
|
var FileItem = function FileItem(_ref) {
|
|
11
9
|
var _konwledgeTraceState$;
|
|
@@ -42,43 +40,36 @@ var FileItem = function FileItem(_ref) {
|
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
};
|
|
45
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
46
44
|
className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
|
|
47
|
-
onClick: handleClick
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}), item.isDelete === 1 && /*#__PURE__*/_jsx("div", {
|
|
64
|
-
className: styles.knowledge_trace_deactive,
|
|
65
|
-
children: "\u6587\u6863\u5931\u6548"
|
|
66
|
-
})]
|
|
67
|
-
})]
|
|
68
|
-
});
|
|
45
|
+
onClick: handleClick
|
|
46
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
47
|
+
alt: "\u6587\u6863\u56FE\u7247",
|
|
48
|
+
className: styles.img,
|
|
49
|
+
src: documentConstants[item.suffix] || documentConstants.default
|
|
50
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: styles.description
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
53
|
+
content: item.name
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: styles.text
|
|
56
|
+
}, item.name)), /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: styles.timeTrace
|
|
58
|
+
}, "".concat(item.suffix, " | ").concat(item.sizeUnit)), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: styles.knowledge_trace_deactive
|
|
60
|
+
}, "\u6587\u6863\u5931\u6548")));
|
|
69
61
|
};
|
|
70
62
|
var DocumentList = function DocumentList(_ref2) {
|
|
71
63
|
var list = _ref2.list;
|
|
72
|
-
return /*#__PURE__*/
|
|
73
|
-
className: styles.knowledgeList
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: styles.knowledgeList
|
|
66
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
className: styles.total
|
|
68
|
+
}, "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u6587\u6863")), list.map(function (item) {
|
|
69
|
+
return /*#__PURE__*/React.createElement(FileItem, {
|
|
70
|
+
item: item,
|
|
71
|
+
key: item.id
|
|
72
|
+
});
|
|
73
|
+
}));
|
|
83
74
|
};
|
|
84
75
|
export default DocumentList;
|
|
@@ -17,8 +17,6 @@ import useKnowledgeService from "../../hooks/useKnowledgeService";
|
|
|
17
17
|
import AiLoading from "../ai-loading";
|
|
18
18
|
import ReactDOM from 'react-dom';
|
|
19
19
|
import GimiSideBar from "../gimi-sidebar";
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
20
|
var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
23
21
|
var targetElement = _ref.targetElement,
|
|
24
22
|
chatList = _ref.chatList,
|
|
@@ -105,18 +103,18 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
|
105
103
|
setActiveKey(activeKey);
|
|
106
104
|
};
|
|
107
105
|
var tabContent = React.useMemo(function () {
|
|
108
|
-
if (isLoading) return /*#__PURE__*/
|
|
106
|
+
if (isLoading) return /*#__PURE__*/React.createElement(AiLoading, null);
|
|
109
107
|
switch (activeKey) {
|
|
110
108
|
case 'video':
|
|
111
|
-
return /*#__PURE__*/
|
|
109
|
+
return /*#__PURE__*/React.createElement(VideoList, {
|
|
112
110
|
list: videoSliceList
|
|
113
111
|
});
|
|
114
112
|
case 'product':
|
|
115
|
-
return /*#__PURE__*/
|
|
113
|
+
return /*#__PURE__*/React.createElement(ClassList, {
|
|
116
114
|
list: productList
|
|
117
115
|
});
|
|
118
116
|
case 'document':
|
|
119
|
-
return /*#__PURE__*/
|
|
117
|
+
return /*#__PURE__*/React.createElement(DocumentList, {
|
|
120
118
|
list: documentList
|
|
121
119
|
});
|
|
122
120
|
default:
|
|
@@ -124,39 +122,34 @@ var KonwledgeTrace = function KonwledgeTrace(_ref) {
|
|
|
124
122
|
}
|
|
125
123
|
}, [activeKey, videoSliceList, productList, documentList, isLoading]);
|
|
126
124
|
var renderContent = function renderContent() {
|
|
127
|
-
return /*#__PURE__*/
|
|
125
|
+
return /*#__PURE__*/React.createElement(GimiSideBar, {
|
|
128
126
|
show: showKonwledgeTrace,
|
|
129
127
|
isOverFlow: isOverFlow,
|
|
130
128
|
ref: tabPaneRef,
|
|
131
129
|
title: "\u5F15\u7528\u6765\u6E90",
|
|
132
130
|
handleClose: handleClose,
|
|
133
131
|
style: style,
|
|
134
|
-
className: className
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}) : tabContent
|
|
150
|
-
})
|
|
151
|
-
});
|
|
132
|
+
className: className
|
|
133
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: styles.tabs
|
|
135
|
+
}, (tabList === null || tabList === void 0 ? void 0 : tabList.length) > 1 ? /*#__PURE__*/React.createElement(Tabs, {
|
|
136
|
+
type: "button",
|
|
137
|
+
size: "small",
|
|
138
|
+
activeKey: activeKey,
|
|
139
|
+
onChange: handleTabChange
|
|
140
|
+
}, tabList.map(function (tab) {
|
|
141
|
+
return /*#__PURE__*/React.createElement(TabPane, {
|
|
142
|
+
tab: tab.name,
|
|
143
|
+
itemKey: tab.type,
|
|
144
|
+
key: tab.type
|
|
145
|
+
}, tabContent);
|
|
146
|
+
})) : tabContent));
|
|
152
147
|
};
|
|
153
148
|
if (isOverFlow && (kowledgeTraceList === null || kowledgeTraceList === void 0 ? void 0 : kowledgeTraceList.length) > 0) {
|
|
154
149
|
var targetElm = targetElement || document.getElementById('myun_gimi_design_chat');
|
|
155
150
|
if (!targetElm) return null;
|
|
156
151
|
return /*#__PURE__*/ReactDOM.createPortal(renderContent(), targetElm);
|
|
157
152
|
}
|
|
158
|
-
return /*#__PURE__*/
|
|
159
|
-
children: (kowledgeTraceList === null || kowledgeTraceList === void 0 ? void 0 : kowledgeTraceList.length) > 0 ? renderContent() : null
|
|
160
|
-
});
|
|
153
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (kowledgeTraceList === null || kowledgeTraceList === void 0 ? void 0 : kowledgeTraceList.length) > 0 ? renderContent() : null);
|
|
161
154
|
};
|
|
162
155
|
export default KonwledgeTrace;
|