@myun/gimi-chat 0.0.8 → 0.0.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.
Files changed (89) hide show
  1. package/dist/apis/useApi.d.ts +2 -0
  2. package/dist/apis/useApi.js +50 -2
  3. package/dist/components/ai-chat-dialogue/index.js +135 -181
  4. package/dist/components/ai-correction/index.js +25 -38
  5. package/dist/components/ai-loading/index.js +8 -12
  6. package/dist/components/answer-item/index.d.ts +3 -0
  7. package/dist/components/answer-item/index.js +126 -135
  8. package/dist/components/ask-card/index.js +33 -42
  9. package/dist/components/chat-input/extension/index.d.ts +2 -0
  10. package/dist/components/chat-input/extension/index.js +2 -0
  11. package/dist/components/chat-input/extension/keydown/index.d.ts +3 -0
  12. package/dist/components/chat-input/extension/keydown/index.js +37 -0
  13. package/dist/components/chat-input/extension/title-slot/Component.d.ts +4 -0
  14. package/dist/components/chat-input/extension/title-slot/Component.js +18 -0
  15. package/dist/components/chat-input/extension/title-slot/index.d.ts +3 -0
  16. package/dist/components/chat-input/extension/title-slot/index.js +47 -0
  17. package/dist/components/chat-input/extension/title-slot/index.less +22 -0
  18. package/dist/components/chat-input/index.d.ts +4 -0
  19. package/dist/components/chat-input/index.js +144 -145
  20. package/dist/components/chat-input/index.module.css +7 -0
  21. package/dist/components/chat-voice/VoiceCommunication.js +21 -23
  22. package/dist/components/chat-voice/VoiceRecord.js +21 -24
  23. package/dist/components/conversation-delete/index.js +8 -10
  24. package/dist/components/dots-loading/index.js +7 -10
  25. package/dist/components/empty/index.js +7 -12
  26. package/dist/components/excel-components/ExcelCard.js +3 -7
  27. package/dist/components/excel-components/ExcelExcuting.js +43 -60
  28. package/dist/components/excel-components/ExcelFailCard.js +10 -15
  29. package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -1
  30. package/dist/components/excel-components/ExcelSuccessCard.js +13 -6
  31. package/dist/components/file-card/fileCardSidebar.js +17 -23
  32. package/dist/components/file-card/index.d.ts +3 -0
  33. package/dist/components/file-card/index.js +59 -69
  34. package/dist/components/file-card/index.module.css +1 -1
  35. package/dist/components/file-preview/index.js +62 -37
  36. package/dist/components/file-preview/index.module.css +33 -0
  37. package/dist/components/file-upload/index.js +7 -10
  38. package/dist/components/file-upload/uploadV1.js +27 -33
  39. package/dist/components/gimi-sidebar/index.js +13 -20
  40. package/dist/components/header/index.js +11 -18
  41. package/dist/components/iconfont-com/index.js +33 -12
  42. package/dist/components/index.d.ts +1 -1
  43. package/dist/components/index.js +1 -1
  44. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +22 -28
  45. package/dist/components/knowledge-trace/classList.js +28 -37
  46. package/dist/components/knowledge-trace/documentList.js +27 -36
  47. package/dist/components/knowledge-trace/index.js +21 -28
  48. package/dist/components/knowledge-trace/videoList.js +36 -46
  49. package/dist/components/lottie-img/index.js +8 -10
  50. package/dist/components/message-actions/CopyButton.d.ts +1 -1
  51. package/dist/components/message-actions/CopyButton.js +22 -25
  52. package/dist/components/message-actions/LikeButton.js +22 -25
  53. package/dist/components/message-actions/RegenerateButton.js +18 -21
  54. package/dist/components/message-actions/UnLikeButton.js +22 -25
  55. package/dist/components/message-actions/VoicePlay.js +22 -25
  56. package/dist/components/message-list/index.js +83 -87
  57. package/dist/components/no-microphone-root/index.js +29 -39
  58. package/dist/components/preset-agent-content/index.d.ts +1 -0
  59. package/dist/components/preset-agent-content/index.js +27 -20
  60. package/dist/components/quoted-content/index.d.ts +3 -0
  61. package/dist/components/quoted-content/index.js +271 -163
  62. package/dist/components/quoted-content/index.module.css +20 -0
  63. package/dist/components/reasoning-content/index.d.ts +3 -2
  64. package/dist/components/reasoning-content/index.js +50 -61
  65. package/dist/components/reference-content/index.js +62 -71
  66. package/dist/components/reference-content/index.module.css +1 -0
  67. package/dist/components/search-result/index.d.ts +7 -0
  68. package/dist/components/search-result/index.js +182 -0
  69. package/dist/components/search-result/index.module.css +235 -0
  70. package/dist/components/templates/CommonChat.js +75 -79
  71. package/dist/components/templates/GimiChatComponent.js +6 -13
  72. package/dist/components/templates/demo/demo.js +109 -103
  73. package/dist/components/upload-list/index.js +41 -56
  74. package/dist/components/voice-bars/index.js +19 -22
  75. package/dist/components/voice-check-dialog/index.js +17 -24
  76. package/dist/components/voice-recording/index.js +42 -57
  77. package/dist/components/work-flow-content/demo.js +1 -2
  78. package/dist/components/work-flow-content/index.js +8 -11
  79. package/dist/hooks/useChatActions.d.ts +1 -1
  80. package/dist/hooks/useChatActions.js +3 -1
  81. package/dist/hooks/useCommonChatAPI.d.ts +2 -1
  82. package/dist/hooks/useCommonChatAPI.js +10 -8
  83. package/dist/hooks/useQuoted.d.ts +12 -0
  84. package/dist/hooks/useQuoted.js +202 -0
  85. package/dist/utils/aes.d.ts +21 -0
  86. package/dist/utils/aes.js +61 -0
  87. package/dist/utils/chatInputUtil.d.ts +1 -1
  88. package/dist/utils/chatInputUtil.js +4 -3
  89. package/package.json +1 -1
@@ -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__*/_jsx(Button, {
224
- icon: /*#__PURE__*/_jsx(IconPaperclip, {}),
225
- type: "tertiary",
226
- children: "\u70B9\u51FB\u4E0A\u4F20"
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
- children: children || trigger
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__*/_jsx(Button, {
144
- icon: /*#__PURE__*/_jsx(IconPaperclip, {}),
145
- type: "tertiary",
146
- children: "\u70B9\u51FB\u4E0A\u4F20"
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__*/_jsx(_Fragment, {
247
- children: /*#__PURE__*/_jsx(Upload, {
248
- customRequest: customRequest,
249
- headers: {
250
- 'Authorization': 'Bearer ' + token
251
- },
252
- maxSize: maxSize || 10 * 1024,
253
- limit: limit || 1,
254
- multiple: (limit || 1) > 1,
255
- onExceed: function onExceed() {
256
- return Toast.warning("\u5355\u6B21\u4EC5\u652F\u6301\u4E0A\u4F20".concat(limit || 1, "\u4E2A\u6587\u4EF6"));
257
- },
258
- onSizeError: function onSizeError() {
259
- return Toast.warning("\u6587\u4EF6\u5927\u5C0F\u8D85\u51FA\u9650\u5236");
260
- },
261
- onAcceptInvalid: function onAcceptInvalid() {
262
- return Toast.warning("\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u7C7B\u578B");
263
- },
264
- accept: (accept === null || accept === void 0 ? void 0 : accept.join(',')) || defaultFileLimit,
265
- fileList: transformFileItem(fileList || []),
266
- disabled: disabled,
267
- showUploadList: false,
268
- onChange: onChange,
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__*/_jsxs("div", {
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
- children: [/*#__PURE__*/_jsxs("div", {
32
- className: styles.header,
33
- children: [/*#__PURE__*/_jsx("span", {
34
- children: title
35
- }), /*#__PURE__*/_jsx(Button, {
36
- size: "small",
37
- theme: "borderless",
38
- icon: /*#__PURE__*/_jsx(IconClose, {}),
39
- onClick: handleClose
40
- })]
41
- }), /*#__PURE__*/_jsxs("div", {
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__*/_jsx("div", {
11
- className: styles.header,
12
- children: /*#__PURE__*/_jsxs("div", {
13
- className: styles.container,
14
- children: [/*#__PURE__*/_jsx("img", {
15
- className: styles.logo,
16
- src: aiLogo,
17
- alt: ""
18
- }), /*#__PURE__*/_jsx("div", {
19
- className: classNames(styles.title, 'ellipse'),
20
- children: /*#__PURE__*/_jsx("span", {
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 { createFromIconfontCN } from '@ant-design/icons';
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
- var IconFont = createFromIconfontCN({
17
- scriptUrl: '//at.alicdn.com/t/c/font_3429456_0fjwg76h4xco.js'
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
- return /*#__PURE__*/_jsx(IconFont, {
21
- type: props.type,
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: (props === null || props === void 0 ? void 0 : props.size) || 12,
24
- color: props === null || props === void 0 ? void 0 : props.color
25
- }, props.extraStyle),
26
- className: props.className,
27
- onClick: props === null || props === void 0 ? void 0 : props.onClick
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 * from './templates/GimiChatComponent';
1
+ export { default as GimiChatComponent } from './templates/GimiChatComponent';
@@ -1 +1 @@
1
- export * from "./templates/GimiChatComponent";
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__*/_jsx("img", {
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__*/_jsxs("div", {
46
+ return /*#__PURE__*/React.createElement("div", {
49
47
  className: styles.icon_btn,
50
- onClick: handleIconClick,
51
- children: [/*#__PURE__*/_jsx(KnowledgeIcon, {
52
- url: iconUrl
53
- }), /*#__PURE__*/_jsx("span", {
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__*/_jsx("div", {
82
+ return /*#__PURE__*/React.createElement("div", {
88
83
  style: {
89
84
  display: 'inline-block'
90
- },
91
- children: /*#__PURE__*/_jsx("div", {
92
- style: {
93
- display: 'flex',
94
- gap: '5px',
95
- flexWrap: 'wrap'
96
- },
97
- children: renderList.map(function (item) {
98
- return /*#__PURE__*/_jsx(KnowledgeIconComponent, {
99
- type: item,
100
- resources: knowledgeMap.get(item) || [],
101
- messageId: value.messageId
102
- }, item);
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__*/_jsx("div", {
24
- className: classes,
25
- children: item.equityLabel
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__*/_jsxs("div", {
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
- children: [/*#__PURE__*/_jsx("img", {
49
- alt: "\u8BFE\u7A0B\u5C01\u9762",
50
- className: styles.class_img,
51
- src: item.productUrl
52
- }), /*#__PURE__*/_jsxs("div", {
53
- className: styles.class_description,
54
- children: [/*#__PURE__*/_jsxs("div", {
55
- className: styles.text,
56
- children: [tagContent, /*#__PURE__*/_jsx(Tooltip, {
57
- content: item.name,
58
- children: ((_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.length) > 33 ? "".concat(item.name.substring(0, 33), "...") : item.name || ''
59
- })]
60
- }), item.isDelete === 1 && /*#__PURE__*/_jsx("div", {
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__*/_jsxs("div", {
70
- className: styles.knowledgeList,
71
- children: [/*#__PURE__*/_jsx("span", {
72
- className: styles.total,
73
- children: "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u8BFE\u7A0B")
74
- }), list.map(function (item) {
75
- return /*#__PURE__*/_jsx(ClassItem, {
76
- item: item
77
- }, item.id);
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__*/_jsxs("div", {
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
- children: [/*#__PURE__*/_jsx("img", {
49
- alt: "\u6587\u6863\u56FE\u7247",
50
- className: styles.img,
51
- src: documentConstants[item.suffix] || documentConstants.default
52
- }), /*#__PURE__*/_jsxs("div", {
53
- className: styles.description,
54
- children: [/*#__PURE__*/_jsx(Tooltip, {
55
- content: item.name,
56
- children: /*#__PURE__*/_jsx("div", {
57
- className: styles.text,
58
- children: item.name
59
- })
60
- }), /*#__PURE__*/_jsx("div", {
61
- className: styles.timeTrace,
62
- children: "".concat(item.suffix, " | ").concat(item.sizeUnit)
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__*/_jsxs("div", {
73
- className: styles.knowledgeList,
74
- children: [/*#__PURE__*/_jsx("span", {
75
- className: styles.total,
76
- children: "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u6587\u6863")
77
- }), list.map(function (item) {
78
- return /*#__PURE__*/_jsx(FileItem, {
79
- item: item
80
- }, item.id);
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__*/_jsx(AiLoading, {});
106
+ if (isLoading) return /*#__PURE__*/React.createElement(AiLoading, null);
109
107
  switch (activeKey) {
110
108
  case 'video':
111
- return /*#__PURE__*/_jsx(VideoList, {
109
+ return /*#__PURE__*/React.createElement(VideoList, {
112
110
  list: videoSliceList
113
111
  });
114
112
  case 'product':
115
- return /*#__PURE__*/_jsx(ClassList, {
113
+ return /*#__PURE__*/React.createElement(ClassList, {
116
114
  list: productList
117
115
  });
118
116
  case 'document':
119
- return /*#__PURE__*/_jsx(DocumentList, {
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__*/_jsx(GimiSideBar, {
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
- children: /*#__PURE__*/_jsx("div", {
136
- className: styles.tabs,
137
- children: (tabList === null || tabList === void 0 ? void 0 : tabList.length) > 1 ? /*#__PURE__*/_jsx(Tabs, {
138
- type: "button",
139
- size: "small",
140
- activeKey: activeKey,
141
- onChange: handleTabChange,
142
- children: tabList.map(function (tab) {
143
- return /*#__PURE__*/_jsx(TabPane, {
144
- tab: tab.name,
145
- itemKey: tab.type,
146
- children: tabContent
147
- }, tab.type);
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__*/_jsx(_Fragment, {
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;