@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.
- 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/templates/demo/demo.js +109 -103
- 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/demo.js +1 -2
- 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/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
|
@@ -1,111 +1,117 @@
|
|
|
1
1
|
import GimiChatComponent from "../GimiChatComponent";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
3
|
export default function Demo() {
|
|
5
|
-
return /*#__PURE__*/
|
|
4
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6
5
|
style: {
|
|
7
6
|
height: '600px'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
7
|
+
}
|
|
8
|
+
}, /*#__PURE__*/React.createElement(GimiChatComponent, {
|
|
9
|
+
baseUrl: 't-mgateway.gaodunwangxiao.com',
|
|
10
|
+
businessType: "correction",
|
|
11
|
+
token: 'eyJhZ2VuY3kiOjk1NTU1LCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJHYW9kdW4iLCJpYXQiOjE3NjkwNTIxOTIsInN1YiI6IjE1Mjg4NzQiLCJpc3MiOiJHYW9kdW4iLCJleHAiOjE3NzE2NDQxOTJ9.SykzOBvTDbKydD0k7NrWY1G56LfGMWRJN0QrvNTdDTE',
|
|
12
|
+
platform: "myun",
|
|
13
|
+
agentId: 62
|
|
14
|
+
// bussinessParams={
|
|
15
|
+
// {
|
|
16
|
+
// "ANSWER_ID": 19923,
|
|
17
|
+
// "QUESTION_ID": 77595
|
|
18
|
+
// }
|
|
19
|
+
// }
|
|
20
|
+
// agentDetail={{
|
|
21
|
+
// "agentIcon": "https://mstatic.gaodunwangxiao.com/image/2025/09/24/Excel建模-1758706152601.png",
|
|
22
|
+
// "agentId": 65,
|
|
23
|
+
// "agentIntroduce": "帮你智能搭建财务数据表格信息",
|
|
24
|
+
// "agentMode": "workflow",
|
|
25
|
+
// "agentName": "智能Excel建模",
|
|
26
|
+
// "agentState": 1,
|
|
27
|
+
// "agentType": "product",
|
|
28
|
+
// "botId": "BOT1757402118115",
|
|
29
|
+
// "botInstructionId": 0,
|
|
30
|
+
// "characterSetting": null,
|
|
31
|
+
// "conversationType": 2,
|
|
32
|
+
// "customizeInstructContent": null,
|
|
33
|
+
// "defaultPrompt": "我要生成一个{{输入模板名称,如PVM模板}},用于{{输入使用场景,如分析收入增长主要驱动力}}。关键数据:{{输入数据}}",
|
|
34
|
+
// "inputPrompt": "",
|
|
35
|
+
// "isCustomizeInstruct": 0,
|
|
36
|
+
// "isEnableRelated": 1,
|
|
37
|
+
// "isEnableVoiceCall": 0,
|
|
38
|
+
// "maxLength": null,
|
|
39
|
+
// "modeType": null,
|
|
40
|
+
// "openUploadFile": 1,
|
|
41
|
+
// "productId": 36842,
|
|
42
|
+
// "prologue": "帮你智能搭建财务数据表格信息",
|
|
43
|
+
// "questionList": [
|
|
44
|
+
// {
|
|
45
|
+
// "id": 127,
|
|
46
|
+
// "question": "会计是现代社会经济活动开展的重要基础,也是推动国际经贸往来的重要保障"
|
|
47
|
+
// },
|
|
48
|
+
// {
|
|
49
|
+
// "id": 128,
|
|
50
|
+
// "question": "全面预算的执行和监控中可以采用什么方式做好业务支持和预算管控?"
|
|
51
|
+
// }
|
|
52
|
+
// ],
|
|
53
|
+
// "showName": "智能Excel建模",
|
|
54
|
+
// "showNameStatus": 1,
|
|
55
|
+
// "sourceModelId": null,
|
|
56
|
+
// "temperature": null,
|
|
57
|
+
// "voiceConfigs": [
|
|
58
|
+
// {
|
|
59
|
+
// "emotions": [
|
|
60
|
+
// {
|
|
61
|
+
// "name": "悲伤",
|
|
62
|
+
// "param": "sad"
|
|
63
|
+
// },
|
|
64
|
+
// {
|
|
65
|
+
// "name": "恐惧",
|
|
66
|
+
// "param": "fear"
|
|
67
|
+
// },
|
|
68
|
+
// {
|
|
69
|
+
// "name": "厌恶",
|
|
70
|
+
// "param": "hate"
|
|
71
|
+
// },
|
|
72
|
+
// {
|
|
73
|
+
// "name": "中性",
|
|
74
|
+
// "param": "neutral"
|
|
75
|
+
// }
|
|
76
|
+
// ],
|
|
77
|
+
// "gender": "female",
|
|
78
|
+
// "isSupportMix": 0,
|
|
79
|
+
// "languageCode": "zh-CN",
|
|
80
|
+
// "languageId": 1,
|
|
81
|
+
// "languageName": "中文",
|
|
82
|
+
// "scene": "多情感",
|
|
83
|
+
// "toneId": 2,
|
|
84
|
+
// "toneName": "甜心小美(多情感)",
|
|
85
|
+
// "voiceType": "zh_female_tianxinxiaomei_emo_v2_mars_bigtts"
|
|
86
|
+
// }
|
|
87
|
+
// ],
|
|
88
|
+
// "workflowList": [
|
|
89
|
+
// {
|
|
90
|
+
// "botFlowId": "MC-2CDBD8AB38B6410A8C14EE503C9ADBCE",
|
|
91
|
+
// "workflowId": 315,
|
|
92
|
+
// "workflowName": "excel生成926(第3版)"
|
|
93
|
+
// }
|
|
94
|
+
// ]
|
|
95
|
+
// }}
|
|
96
|
+
,
|
|
97
|
+
showPrologue: true,
|
|
98
|
+
model: 'fullscreen'
|
|
99
|
+
// conversationId={7988}
|
|
100
|
+
,
|
|
101
|
+
chatInputConfig: {
|
|
102
|
+
enableFileUpload: true,
|
|
103
|
+
enableVoiceChat: true,
|
|
104
|
+
enableVoiceRecord: true,
|
|
105
|
+
enableSourceQuote: true,
|
|
106
|
+
onBeforeSend: function onBeforeSend(text) {
|
|
107
|
+
console.log('onBeforeSend', text);
|
|
105
108
|
},
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
onConversationCreated: function onConversationCreated(conversationId) {
|
|
110
|
+
console.log('创建会话了', conversationId);
|
|
108
111
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
112
|
+
},
|
|
113
|
+
messageConfig: {
|
|
114
|
+
enableRegenerate: true
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
111
117
|
}
|
|
@@ -3,8 +3,6 @@ import styles from "./index.module.css";
|
|
|
3
3
|
import reTry from "../../assets/image/retry.png";
|
|
4
4
|
import { FileStatus } from "../../interfaces/fileInterface";
|
|
5
5
|
import { formatSizeToKB } from "../../utils/tools";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
6
|
var UploadFile = function UploadFile(_ref) {
|
|
9
7
|
var file = _ref.file,
|
|
10
8
|
handleDelFile = _ref.handleDelFile,
|
|
@@ -47,59 +45,46 @@ var UploadFile = function UploadFile(_ref) {
|
|
|
47
45
|
|
|
48
46
|
var isError = file.status === FileStatus.UPLOAD_FAILED || file.status === FileStatus.ANALYSE_FAILED || file.status === FileStatus.NETWORK_ERROR;
|
|
49
47
|
var isLoading = [FileStatus.PADDING, FileStatus.RETRING, FileStatus.UPLOADING].includes(file.status);
|
|
50
|
-
return /*#__PURE__*/
|
|
51
|
-
className: styles.uploadBox
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
width: 16,
|
|
92
|
-
height: 16
|
|
93
|
-
}
|
|
94
|
-
})]
|
|
95
|
-
}), showDel && /*#__PURE__*/_jsx("div", {
|
|
96
|
-
className: styles.delIcon,
|
|
97
|
-
onClick: handleDeleteClick,
|
|
98
|
-
children: /*#__PURE__*/_jsx("img", {
|
|
99
|
-
src: "https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/12/6fa3e_20250912145501.png",
|
|
100
|
-
alt: "delete"
|
|
101
|
-
})
|
|
102
|
-
})]
|
|
103
|
-
});
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: styles.uploadBox
|
|
50
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: styles.uploadIcon
|
|
52
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
53
|
+
src: fileIcon,
|
|
54
|
+
alt: "file-icon"
|
|
55
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: styles.uploadName
|
|
57
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: styles.uploadfileName
|
|
59
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: styles.fileName
|
|
61
|
+
}, fileName)), (fileSize || isError) && /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: styles.sizeText
|
|
63
|
+
}, fileSize && !isError && /*#__PURE__*/React.createElement("span", {
|
|
64
|
+
className: styles.size
|
|
65
|
+
}, fileSize), isError && /*#__PURE__*/React.createElement("span", {
|
|
66
|
+
className: styles.errorText
|
|
67
|
+
}, file.status === FileStatus.UPLOAD_FAILED ? '上传失败' : file.status === FileStatus.NETWORK_ERROR ? '网络错误' : '解析失败'))), isLoading && /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: styles.uploadLoading
|
|
69
|
+
}, /*#__PURE__*/React.createElement("span", null, file.status === FileStatus.PADDING ? '解析中...' : file.status === FileStatus.UPLOADING ? '上传中...' : '重试中...'), /*#__PURE__*/React.createElement("img", {
|
|
70
|
+
src: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202509/07/0a0fa_20250907093927.gif",
|
|
71
|
+
alt: "loading"
|
|
72
|
+
})), isError && /*#__PURE__*/React.createElement("div", {
|
|
73
|
+
className: styles.uploadError,
|
|
74
|
+
onClick: handleRetryClick
|
|
75
|
+
}, "\u91CD\u8BD5", /*#__PURE__*/React.createElement("img", {
|
|
76
|
+
src: reTry,
|
|
77
|
+
alt: "",
|
|
78
|
+
style: {
|
|
79
|
+
width: 16,
|
|
80
|
+
height: 16
|
|
81
|
+
}
|
|
82
|
+
})), showDel && /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: styles.delIcon,
|
|
84
|
+
onClick: handleDeleteClick
|
|
85
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
86
|
+
src: "https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/12/6fa3e_20250912145501.png",
|
|
87
|
+
alt: "delete"
|
|
88
|
+
})));
|
|
104
89
|
};
|
|
105
90
|
export default UploadFile;
|
|
@@ -9,7 +9,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
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; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
12
|
export default function VoiceBars(_ref) {
|
|
14
13
|
var _ref$parentWidth = _ref.parentWidth,
|
|
15
14
|
parentWidth = _ref$parentWidth === void 0 ? undefined : _ref$parentWidth;
|
|
@@ -152,26 +151,24 @@ export default function VoiceBars(_ref) {
|
|
|
152
151
|
}
|
|
153
152
|
};
|
|
154
153
|
}, []);
|
|
155
|
-
return /*#__PURE__*/
|
|
156
|
-
|
|
154
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
155
|
+
style: {
|
|
156
|
+
display: 'flex',
|
|
157
|
+
alignItems: 'center',
|
|
158
|
+
justifyContent: 'center',
|
|
159
|
+
height: 40,
|
|
160
|
+
gap: 6
|
|
161
|
+
}
|
|
162
|
+
}, volumes.map(function (h, i) {
|
|
163
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
164
|
+
key: i,
|
|
157
165
|
style: {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
style: {
|
|
167
|
-
width: 6,
|
|
168
|
-
height: h,
|
|
169
|
-
background: '#4f8cff',
|
|
170
|
-
borderRadius: 4,
|
|
171
|
-
transition: 'height 0.1s ease-out'
|
|
172
|
-
}
|
|
173
|
-
}, i);
|
|
174
|
-
})
|
|
175
|
-
})
|
|
176
|
-
});
|
|
166
|
+
width: 6,
|
|
167
|
+
height: h,
|
|
168
|
+
background: '#4f8cff',
|
|
169
|
+
borderRadius: 4,
|
|
170
|
+
transition: 'height 0.1s ease-out'
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
})));
|
|
177
174
|
}
|
|
@@ -16,9 +16,6 @@ import styles from "./index.module.css";
|
|
|
16
16
|
import NoMicrophoneModalContent from "../no-microphone-root";
|
|
17
17
|
import { useAppDispatch, useAppSelector } from "../../store/hooks";
|
|
18
18
|
import { setShowMicWarning } from "../../store/slices/gimiMenuSlice";
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
19
|
var VoiceCheckDialog = function VoiceCheckDialog(_ref) {
|
|
23
20
|
var _layout$x, _layout$y;
|
|
24
21
|
var className = _ref.className,
|
|
@@ -145,26 +142,22 @@ var VoiceCheckDialog = function VoiceCheckDialog(_ref) {
|
|
|
145
142
|
showMicWarning: false
|
|
146
143
|
}));
|
|
147
144
|
};
|
|
148
|
-
return /*#__PURE__*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
onOk: onCancel
|
|
166
|
-
})
|
|
167
|
-
})]
|
|
168
|
-
});
|
|
145
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, trigger && /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
ref: triggerRef,
|
|
147
|
+
style: {
|
|
148
|
+
display: 'flex'
|
|
149
|
+
}
|
|
150
|
+
}, trigger), showMicWarning && /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
ref: dialogRef,
|
|
152
|
+
className: classNames(styles['voice-check-dialog'], className),
|
|
153
|
+
style: _objectSpread({
|
|
154
|
+
left: "".concat((_layout$x = layout === null || layout === void 0 ? void 0 : layout.x) !== null && _layout$x !== void 0 ? _layout$x : 0, "px"),
|
|
155
|
+
top: "".concat((_layout$y = layout === null || layout === void 0 ? void 0 : layout.y) !== null && _layout$y !== void 0 ? _layout$y : 0, "px"),
|
|
156
|
+
opacity: layout ? 1 : 0,
|
|
157
|
+
visibility: layout ? 'visible' : 'hidden'
|
|
158
|
+
}, style)
|
|
159
|
+
}, /*#__PURE__*/React.createElement(NoMicrophoneModalContent, {
|
|
160
|
+
onOk: onCancel
|
|
161
|
+
})));
|
|
169
162
|
};
|
|
170
163
|
export default VoiceCheckDialog;
|
|
@@ -2,68 +2,53 @@ import { Tooltip } from '@douyinfe/semi-ui';
|
|
|
2
2
|
import VoiceBars from "../voice-bars";
|
|
3
3
|
import styles from "./index.module.css";
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
5
|
var CHECK_ICON_ADDRESS = 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202601/04/8b0e2_20260104154821.png';
|
|
9
6
|
var CANCEL_ICON_ADDRESS = 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202601/04/94bfe_20260104154857.png';
|
|
10
7
|
var VoiceRecording = function VoiceRecording(_ref) {
|
|
11
8
|
var recordingCount = _ref.recordingCount,
|
|
12
9
|
stopRecording = _ref.stopRecording,
|
|
13
10
|
containerWidth = _ref.containerWidth;
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
-
className: styles.main
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
children: /*#__PURE__*/_jsx("img", {
|
|
57
|
-
className: styles.icon,
|
|
58
|
-
src: CHECK_ICON_ADDRESS,
|
|
59
|
-
alt: "\u5F00\u59CB\u8F6C\u5199",
|
|
60
|
-
onClick: function onClick() {
|
|
61
|
-
stopRecording(true);
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
})]
|
|
65
|
-
})]
|
|
66
|
-
})]
|
|
67
|
-
});
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: styles.main
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: styles.text
|
|
15
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
16
|
+
className: styles.font_weight_600
|
|
17
|
+
}, "\u8BED\u97F3\u8F93\u5165\u4E2D"), recordingCount > 0 && recordingCount <= 10 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
18
|
+
className: styles.font_weight_400
|
|
19
|
+
}, "(\u5012\u8BA1\u65F6"), /*#__PURE__*/React.createElement("span", {
|
|
20
|
+
className: styles.count
|
|
21
|
+
}, recordingCount), /*#__PURE__*/React.createElement("span", {
|
|
22
|
+
className: styles.font_weight_400
|
|
23
|
+
}, "\u79D2)"))), /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: styles.voice_bar
|
|
25
|
+
}, /*#__PURE__*/React.createElement(VoiceBars, {
|
|
26
|
+
parentWidth: containerWidth - 48 * 2 - 20 * 2 - 10
|
|
27
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
style: {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
gap: '10px'
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
33
|
+
content: "\u653E\u5F03\u8F6C\u5199",
|
|
34
|
+
arrowPointAtCenter: true
|
|
35
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
36
|
+
className: styles.icon,
|
|
37
|
+
src: CANCEL_ICON_ADDRESS,
|
|
38
|
+
alt: "\u653E\u5F03\u8F6C\u5199",
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
stopRecording(false);
|
|
41
|
+
}
|
|
42
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
43
|
+
content: "\u5F00\u59CB\u8F6C\u5199",
|
|
44
|
+
arrowPointAtCenter: true
|
|
45
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
46
|
+
className: styles.icon,
|
|
47
|
+
src: CHECK_ICON_ADDRESS,
|
|
48
|
+
alt: "\u5F00\u59CB\u8F6C\u5199",
|
|
49
|
+
onClick: function onClick() {
|
|
50
|
+
stopRecording(true);
|
|
51
|
+
}
|
|
52
|
+
})))));
|
|
68
53
|
};
|
|
69
54
|
export default VoiceRecording;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import WorkFlowContent from "./index";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
3
|
var Demo = function Demo() {
|
|
5
|
-
return /*#__PURE__*/
|
|
4
|
+
return /*#__PURE__*/React.createElement(WorkFlowContent, {
|
|
6
5
|
chatItem: {
|
|
7
6
|
mcp: '这是一条工作流内容',
|
|
8
7
|
status: 'executeWorkflowByDescription'
|
|
@@ -2,15 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
import styles from "./index.module.css";
|
|
3
3
|
import { Spin } from '@douyinfe/semi-ui';
|
|
4
4
|
import { IconSpin, IconInfoCircle } from '@douyinfe/semi-icons';
|
|
5
|
-
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
var antIcon = /*#__PURE__*/_jsx(IconSpin, {
|
|
5
|
+
var antIcon = /*#__PURE__*/React.createElement(IconSpin, {
|
|
8
6
|
style: {
|
|
9
7
|
fontSize: 16
|
|
10
8
|
},
|
|
11
9
|
spin: true
|
|
12
10
|
});
|
|
13
|
-
var warnIcon = /*#__PURE__*/
|
|
11
|
+
var warnIcon = /*#__PURE__*/React.createElement(IconInfoCircle, {
|
|
14
12
|
style: {
|
|
15
13
|
fontSize: 16
|
|
16
14
|
}
|
|
@@ -19,13 +17,12 @@ var WorkFlowContent = function WorkFlowContent(_ref) {
|
|
|
19
17
|
var chatItem = _ref.chatItem;
|
|
20
18
|
// const isExecuting = chatItem.mcps.some((item: MCPItem) => !item.isFinished);
|
|
21
19
|
var mcp = chatItem.mcp;
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
className: styles.layout
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: styles.layout
|
|
22
|
+
}, mcp.status === 'executeWorkflowByDescription' ? '正在查询可用工作流...' : mcp.status === 'interrupt' ? '运行终止' : "\u6B63\u5728\u8C03\u7528 ".concat(mcp.name || '工作流', "..."), mcp.status === 'interrupt' ? warnIcon : /*#__PURE__*/React.createElement(Spin, {
|
|
23
|
+
className: styles.spin,
|
|
24
|
+
indicator: antIcon
|
|
25
|
+
}));
|
|
29
26
|
|
|
30
27
|
// return (
|
|
31
28
|
// <Collapse
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IChatMessageItem } from '../interfaces/chatMessage';
|
|
3
3
|
export declare const usePureChatActions: () => {
|
|
4
|
-
copyToClipboard: (value: IChatMessageItem, replaceTags?: string[]) => Promise<void>;
|
|
4
|
+
copyToClipboard: (value: IChatMessageItem | string, replaceTags?: string[]) => Promise<void>;
|
|
5
5
|
handleUnlove: (item: IChatMessageItem, type: 'love' | 'unlove') => Promise<void>;
|
|
6
6
|
};
|
|
7
7
|
declare const useChatActions: (showCopyId: number | null, inputModelRef: React.MutableRefObject<any>, handleSend: (val: string, agent?: any, isSystemAuto?: boolean) => void) => {
|
|
@@ -58,7 +58,9 @@ export var usePureChatActions = function usePureChatActions() {
|
|
|
58
58
|
while (1) switch (_context.prev = _context.next) {
|
|
59
59
|
case 0:
|
|
60
60
|
replaceTags = _args.length > 1 && _args[1] !== undefined ? _args[1] : ['knowledge', 'excel'];
|
|
61
|
-
if (value
|
|
61
|
+
if (typeof value === 'string') {
|
|
62
|
+
text = value;
|
|
63
|
+
} else if (value.moduleType === 'skill') {
|
|
62
64
|
text = ((_value$moduleInfo = value.moduleInfo) === null || _value$moduleInfo === void 0 ? void 0 : _value$moduleInfo.data.results.skillResult.message) || '';
|
|
63
65
|
} else if (value.moduleType === 'ask') {
|
|
64
66
|
text = ((_value$moduleInfo2 = value.moduleInfo) === null || _value$moduleInfo2 === void 0 ? void 0 : _value$moduleInfo2.data.results.askShowInfo.questionContent) || '';
|