@myun/gimi-chat 0.9.22 → 0.9.23
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.js +1 -1
- package/dist/components/ai-chat-dialogue/index copy.d.ts +16 -0
- package/dist/components/ai-chat-dialogue/index copy.js +1062 -0
- package/dist/components/ai-chat-dialogue/index.js +54 -49
- package/dist/components/ai-chat-dialogue/index.module copy.css +230 -0
- package/dist/components/ai-chat-dialogue/index.module.css +78 -136
- package/dist/components/chat-input/index.d.ts +4 -0
- package/dist/components/chat-input/index.js +176 -67
- package/dist/components/chat-input/index.module.css +60 -2
- package/dist/components/file-upload/index.js +120 -34
- package/dist/components/iconfont-com/index.js +1 -1
- package/dist/components/message-list/index.js +2 -1
- package/dist/components/templates/CommonChat.js +24 -5
- package/dist/components/templates/GimiChatComponent.js +4 -0
- package/dist/components/upload-list/CustomFile.d.ts +15 -0
- package/dist/components/upload-list/CustomFile.js +105 -0
- package/dist/components/upload-list/ImageFile.d.ts +18 -0
- package/dist/components/upload-list/ImageFile.js +68 -0
- package/dist/components/upload-list/customFile.module.css +122 -0
- package/dist/components/upload-list/imageFile.module.css +95 -0
- package/dist/components/upload-list/index.d.ts +4 -3
- package/dist/components/upload-list/index.js +95 -84
- package/dist/components/upload-list/index.module.css +68 -99
- package/dist/components/voice-bars/index.js +10 -9
- package/dist/components/voice-check-dialog/index.js +2 -1
- package/dist/components/voice-recording/index.d.ts +1 -1
- package/dist/components/voice-recording/index.js +2 -28
- package/dist/hooks/useChatMessage.d.ts +1 -1
- package/dist/hooks/useChatMessage.js +1 -1
- package/dist/hooks/useCommonChatAPI.js +13 -9
- package/dist/hooks/useFile.js +99 -7
- package/dist/i18n/locales/en-US.d.ts +9 -0
- package/dist/i18n/locales/en-US.js +10 -1
- package/dist/i18n/locales/zh-CN.d.ts +9 -0
- package/dist/i18n/locales/zh-CN.js +10 -1
- package/dist/types/chat.d.ts +2 -0
- package/dist/types/file.d.ts +2 -0
- package/dist/umd/index.min.js +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,6 @@ import LottieImg from "../lottie-img";
|
|
|
24
24
|
import styles from "./index.module.css";
|
|
25
25
|
import classNames from 'classnames';
|
|
26
26
|
import { Toast, Tooltip } from '@douyinfe/semi-ui';
|
|
27
|
-
import Header from "../header";
|
|
28
27
|
import IconFontCom from "../iconfont-com";
|
|
29
28
|
import { debounce } from 'lodash';
|
|
30
29
|
import useScroll from "../../hooks/useScroll";
|
|
@@ -866,6 +865,12 @@ var AiExplain = function AiExplain(_ref) {
|
|
|
866
865
|
setHeaderTitle(finalTitle);
|
|
867
866
|
}
|
|
868
867
|
}, [messageList]);
|
|
868
|
+
useEffect(function () {
|
|
869
|
+
document.body.style.overflow = 'hidden';
|
|
870
|
+
return function () {
|
|
871
|
+
document.body.style.overflow = '';
|
|
872
|
+
};
|
|
873
|
+
}, []);
|
|
869
874
|
|
|
870
875
|
// 初始化语音对话(核心业务入口)
|
|
871
876
|
useEffect(function () {
|
|
@@ -975,35 +980,13 @@ var AiExplain = function AiExplain(_ref) {
|
|
|
975
980
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", {
|
|
976
981
|
className: styles.aiChat
|
|
977
982
|
}, /*#__PURE__*/React.createElement("div", {
|
|
978
|
-
className: styles.bgImg
|
|
979
|
-
}, /*#__PURE__*/React.createElement(LottieImg, {
|
|
980
|
-
name: "aiBg",
|
|
981
|
-
size: ['100%', '100%']
|
|
982
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
983
|
-
className: styles.rightWrap
|
|
984
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
985
|
-
zIndex: 10000,
|
|
986
|
-
placement: "bottom",
|
|
987
|
-
visible: showWordsTooltip,
|
|
988
|
-
onVisibleChange: setShowWordsTooltip,
|
|
989
|
-
content: showCaptions ? t('aiDialogue.closeCaptions') : t('aiDialogue.openCaptions'),
|
|
990
|
-
overlayClassName: "ai-chat-tooltip"
|
|
991
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
992
|
-
className: styles.iconWrap
|
|
993
|
-
}, /*#__PURE__*/React.createElement(IconFontCom, {
|
|
994
|
-
type: !showCaptions ? 'icon-a-tongyong-zhankaibeifen1' : 'icon-tongyong-zhankaibeifen1',
|
|
995
|
-
size: 20,
|
|
996
|
-
extraStyle: {
|
|
997
|
-
cursor: 'pointer'
|
|
998
|
-
},
|
|
999
|
-
onClick: function onClick() {
|
|
1000
|
-
return setShowCaptions(!showCaptions);
|
|
1001
|
-
}
|
|
1002
|
-
})))), /*#__PURE__*/React.createElement("div", {
|
|
1003
983
|
className: classNames(styles.main)
|
|
1004
|
-
}, /*#__PURE__*/React.createElement(
|
|
1005
|
-
|
|
1006
|
-
}
|
|
984
|
+
}, showCaptions && /*#__PURE__*/React.createElement("div", {
|
|
985
|
+
className: styles.title
|
|
986
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
987
|
+
src: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202508/08/f5b48_20250808145334.png",
|
|
988
|
+
alt: ""
|
|
989
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1007
990
|
className: classNames(styles.content, 'scrollBar'),
|
|
1008
991
|
ref: containerRef
|
|
1009
992
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1012,36 +995,43 @@ var AiExplain = function AiExplain(_ref) {
|
|
|
1012
995
|
className: styles.tips
|
|
1013
996
|
}, status === 5 ? t('aiDialogue.pleaseSpeak') : t('aiDialogue.listeningEllipsis')) : /*#__PURE__*/React.createElement("div", null, messageList.map(function (item) {
|
|
1014
997
|
return /*#__PURE__*/React.createElement("div", {
|
|
1015
|
-
className: classNames(styles.item, _defineProperty({}, styles.
|
|
998
|
+
className: classNames(styles.item, _defineProperty({}, styles.question, item.type !== 'answer')),
|
|
1016
999
|
key: item.id
|
|
1017
|
-
},
|
|
1000
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1001
|
+
className: styles.text
|
|
1002
|
+
}, item.content));
|
|
1018
1003
|
}), isTextLoading ? /*#__PURE__*/React.createElement(Spin, null) : null) : /*#__PURE__*/React.createElement("div", {
|
|
1019
1004
|
className: styles.voiceWrap
|
|
1020
|
-
}, /*#__PURE__*/React.createElement(LottieImg, {
|
|
1021
|
-
name: status === 2 ? 'aiOutputStrengthen' : 'aiOutputNormal',
|
|
1022
|
-
size: [242, 235]
|
|
1023
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
1024
|
-
className: styles.bottom
|
|
1025
1005
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1006
|
+
className: styles.avatar
|
|
1007
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
1008
|
+
src: "https://simg01.gaodunwangxiao.com/uploadfiles/tmp/upload/202508/08/f5b48_20250808145334.png",
|
|
1009
|
+
alt: ""
|
|
1010
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1026
1011
|
className: classNames(styles.status, _defineProperty({}, styles.pointer, status === 2)),
|
|
1027
1012
|
onClick: clickInterrupt
|
|
1028
|
-
}, renderStatus), /*#__PURE__*/React.createElement("div", {
|
|
1013
|
+
}, renderStatus)))), /*#__PURE__*/React.createElement("div", {
|
|
1014
|
+
className: styles.bottom
|
|
1015
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1029
1016
|
className: styles.btnWrap
|
|
1030
1017
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
1031
1018
|
zIndex: 10000,
|
|
1032
|
-
placement: "
|
|
1033
|
-
visible:
|
|
1034
|
-
onVisibleChange:
|
|
1035
|
-
content:
|
|
1019
|
+
placement: "bottom",
|
|
1020
|
+
visible: showWordsTooltip,
|
|
1021
|
+
onVisibleChange: setShowWordsTooltip,
|
|
1022
|
+
content: showCaptions ? t('aiDialogue.closeCaptions') : t('aiDialogue.openCaptions'),
|
|
1036
1023
|
overlayClassName: "ai-chat-tooltip"
|
|
1037
1024
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1038
|
-
className:
|
|
1025
|
+
className: styles.btnItem
|
|
1026
|
+
}, /*#__PURE__*/React.createElement(IconFontCom, {
|
|
1027
|
+
type: !showCaptions ? 'icon-a-tongyong-zhankaibeifen1' : 'icon-tongyong-zhankaibeifen1',
|
|
1028
|
+
size: 16,
|
|
1029
|
+
extraStyle: {
|
|
1030
|
+
cursor: 'pointer'
|
|
1031
|
+
},
|
|
1039
1032
|
onClick: function onClick() {
|
|
1040
|
-
return
|
|
1033
|
+
return setShowCaptions(!showCaptions);
|
|
1041
1034
|
}
|
|
1042
|
-
}, /*#__PURE__*/React.createElement(IconFontCom, {
|
|
1043
|
-
type: audioEnabled ? 'icon-voice' : 'icon-a-voice1',
|
|
1044
|
-
size: 34
|
|
1045
1035
|
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
1046
1036
|
zIndex: 10000,
|
|
1047
1037
|
placement: "top",
|
|
@@ -1050,13 +1040,28 @@ var AiExplain = function AiExplain(_ref) {
|
|
|
1050
1040
|
content: t('aiDialogue.hangUp'),
|
|
1051
1041
|
overlayClassName: "ai-chat-tooltip"
|
|
1052
1042
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1053
|
-
className: styles.btnItem,
|
|
1043
|
+
className: classNames(styles.btnItem, styles.hasBorder),
|
|
1054
1044
|
onClick: function onClick() {
|
|
1055
1045
|
return handleBack();
|
|
1056
1046
|
}
|
|
1057
1047
|
}, /*#__PURE__*/React.createElement(IconFontCom, {
|
|
1058
1048
|
type: "icon-a-mti-guaduanshi",
|
|
1059
|
-
size:
|
|
1060
|
-
})))
|
|
1049
|
+
size: 18
|
|
1050
|
+
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
1051
|
+
zIndex: 10000,
|
|
1052
|
+
placement: "top",
|
|
1053
|
+
visible: showMuteTooltip,
|
|
1054
|
+
onVisibleChange: setShowMuteTooltip,
|
|
1055
|
+
content: audioEnabled ? t('aiDialogue.closeMic') : t('aiDialogue.openMic'),
|
|
1056
|
+
overlayClassName: "ai-chat-tooltip"
|
|
1057
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1058
|
+
className: classNames(styles.btnItem, isDisable ? styles.disable : ''),
|
|
1059
|
+
onClick: function onClick() {
|
|
1060
|
+
return handleVoice();
|
|
1061
|
+
}
|
|
1062
|
+
}, /*#__PURE__*/React.createElement(IconFontCom, {
|
|
1063
|
+
type: audioEnabled ? 'icon-voice' : 'icon-a-voice1',
|
|
1064
|
+
size: 18
|
|
1065
|
+
}))))))), document.body);
|
|
1061
1066
|
};
|
|
1062
1067
|
export default AiExplain;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.aiChat {
|
|
3
|
+
z-index: 9999;
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: 0;
|
|
6
|
+
}
|
|
7
|
+
.aiChat .bgImg {
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
}
|
|
14
|
+
.aiChat .back {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 30px;
|
|
17
|
+
left: 20px;
|
|
18
|
+
z-index: 2;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
width: 30px;
|
|
23
|
+
height: 30px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
background: #ffffff;
|
|
26
|
+
box-shadow: 0px 0px 10px 0px rgba(153, 167, 191, 0.2);
|
|
27
|
+
border: 1px solid #ebf2ff;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
.aiChat .rightWrap {
|
|
31
|
+
position: absolute;
|
|
32
|
+
right: 20px;
|
|
33
|
+
top: 30px;
|
|
34
|
+
z-index: 3;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
.aiChat .rightWrap .iconWrap {
|
|
39
|
+
margin-right: 40px;
|
|
40
|
+
}
|
|
41
|
+
.aiChat .introWrap {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 60px;
|
|
44
|
+
right: -420px;
|
|
45
|
+
width: 400px;
|
|
46
|
+
height: calc(100vh - 100px);
|
|
47
|
+
padding: 20px 20px 15px;
|
|
48
|
+
background: #f7faff;
|
|
49
|
+
box-shadow: -6px 2px 20px 0px rgba(153, 167, 191, 0.15);
|
|
50
|
+
border-radius: 12px;
|
|
51
|
+
z-index: 2;
|
|
52
|
+
transition: all 0.3s ease;
|
|
53
|
+
}
|
|
54
|
+
.aiChat .introWrap.block {
|
|
55
|
+
right: 20px;
|
|
56
|
+
}
|
|
57
|
+
.aiChat .introWrap .loading {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
height: 80%;
|
|
62
|
+
text-align: center;
|
|
63
|
+
}
|
|
64
|
+
.aiChat .introWrap .introHeader {
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
align-items: center;
|
|
68
|
+
margin-bottom: 20px;
|
|
69
|
+
}
|
|
70
|
+
.aiChat .introWrap .introHeader .title {
|
|
71
|
+
font-size: 18px;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
}
|
|
74
|
+
.aiChat .introWrap .introContent {
|
|
75
|
+
height: calc(100% - 60px);
|
|
76
|
+
overflow-y: scroll;
|
|
77
|
+
padding-right: 10px;
|
|
78
|
+
}
|
|
79
|
+
.aiChat .main {
|
|
80
|
+
position: relative;
|
|
81
|
+
height: 100%;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
transition: all 0.3s ease;
|
|
85
|
+
}
|
|
86
|
+
.aiChat .main.translate {
|
|
87
|
+
transform: translateX(-160px);
|
|
88
|
+
}
|
|
89
|
+
.aiChat .main .content {
|
|
90
|
+
height: calc(100% - 380px);
|
|
91
|
+
overflow-y: scroll;
|
|
92
|
+
overflow-x: hidden;
|
|
93
|
+
}
|
|
94
|
+
.aiChat .main .content .container {
|
|
95
|
+
width: 800px;
|
|
96
|
+
margin: 0 auto;
|
|
97
|
+
height: 100%;
|
|
98
|
+
}
|
|
99
|
+
.aiChat .main .header {
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
margin-bottom: 30px;
|
|
103
|
+
height: 26px;
|
|
104
|
+
}
|
|
105
|
+
.aiChat .main .header .logo {
|
|
106
|
+
width: 18px;
|
|
107
|
+
height: 18px;
|
|
108
|
+
margin-right: 8px;
|
|
109
|
+
flex-shrink: 0;
|
|
110
|
+
margin-top: 3px;
|
|
111
|
+
}
|
|
112
|
+
.aiChat .main .header .title {
|
|
113
|
+
font-size: 18px;
|
|
114
|
+
text-align: center;
|
|
115
|
+
}
|
|
116
|
+
.aiChat .main .tips {
|
|
117
|
+
font-weight: 400;
|
|
118
|
+
color: #54698c;
|
|
119
|
+
font-size: 17px;
|
|
120
|
+
}
|
|
121
|
+
.aiChat .main .item {
|
|
122
|
+
margin-bottom: 10px;
|
|
123
|
+
font-weight: 400;
|
|
124
|
+
color: #333;
|
|
125
|
+
font-size: 17px;
|
|
126
|
+
line-height: 28px;
|
|
127
|
+
word-break: break-all;
|
|
128
|
+
/* 强制换行 */
|
|
129
|
+
overflow-wrap: break-word;
|
|
130
|
+
/* 在适当位置换行 */
|
|
131
|
+
white-space: pre-wrap;
|
|
132
|
+
}
|
|
133
|
+
.aiChat .main .item.answer {
|
|
134
|
+
font-size: 16;
|
|
135
|
+
color: #b0b0b0;
|
|
136
|
+
}
|
|
137
|
+
.aiChat .main .voiceWrap {
|
|
138
|
+
height: 100%;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
}
|
|
142
|
+
.aiChat .main .bottom {
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
align-items: center;
|
|
146
|
+
position: absolute;
|
|
147
|
+
bottom: 60px;
|
|
148
|
+
left: 50%;
|
|
149
|
+
transform: translateX(-50%);
|
|
150
|
+
text-align: center;
|
|
151
|
+
}
|
|
152
|
+
.aiChat .main .bottom .pointer {
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
}
|
|
155
|
+
.aiChat .main .bottom .status {
|
|
156
|
+
display: flex;
|
|
157
|
+
flex-direction: column;
|
|
158
|
+
width: 220px;
|
|
159
|
+
margin-bottom: 30px;
|
|
160
|
+
}
|
|
161
|
+
.aiChat .main .bottom .status .iconOutside {
|
|
162
|
+
width: 30px;
|
|
163
|
+
height: 30px;
|
|
164
|
+
display: flex;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
align-items: center;
|
|
167
|
+
border: 3px solid #000000;
|
|
168
|
+
border-radius: 50%;
|
|
169
|
+
}
|
|
170
|
+
.aiChat .main .bottom .status .iconInside {
|
|
171
|
+
width: 13px;
|
|
172
|
+
height: 13px;
|
|
173
|
+
background-color: #000000;
|
|
174
|
+
}
|
|
175
|
+
.aiChat .main .bottom .status .statusImg {
|
|
176
|
+
width: 24px;
|
|
177
|
+
height: 24px;
|
|
178
|
+
border-radius: 8px;
|
|
179
|
+
margin: 0 auto;
|
|
180
|
+
margin-bottom: 15px;
|
|
181
|
+
}
|
|
182
|
+
.aiChat .main .bottom .status .statusText {
|
|
183
|
+
font-size: 16px;
|
|
184
|
+
color: #7d91b3;
|
|
185
|
+
}
|
|
186
|
+
.aiChat .main .bottom .status .statusText.danger {
|
|
187
|
+
color: red;
|
|
188
|
+
}
|
|
189
|
+
.aiChat .main .bottom .btnWrap {
|
|
190
|
+
display: flex;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
}
|
|
193
|
+
.aiChat .main .bottom .btnWrap .btnItem {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
width: 76px;
|
|
198
|
+
height: 76px;
|
|
199
|
+
border-radius: 50%;
|
|
200
|
+
margin-right: 118px;
|
|
201
|
+
background: #ffffff;
|
|
202
|
+
box-shadow: 0px 2px 10px 0px rgba(153, 167, 191, 0.1);
|
|
203
|
+
cursor: pointer;
|
|
204
|
+
}
|
|
205
|
+
.aiChat .main .bottom .btnWrap .btnItem.disable {
|
|
206
|
+
pointer-events: none;
|
|
207
|
+
opacity: 0.5;
|
|
208
|
+
cursor: not-allowed;
|
|
209
|
+
}
|
|
210
|
+
.aiChat .main .bottom .btnWrap .btnItem:last-child {
|
|
211
|
+
margin-right: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:global .out-tooltip .ant-tooltip-content .ant-tooltip-arrow {
|
|
215
|
+
left: 55px;
|
|
216
|
+
}
|
|
217
|
+
:global .ai-chat-tooltip {
|
|
218
|
+
z-index: 100000 !important;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:global(.ant-message) {
|
|
222
|
+
position: fixed !important;
|
|
223
|
+
z-index: 99999999 !important;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.disable {
|
|
227
|
+
opacity: 0.4;
|
|
228
|
+
pointer-events: none;
|
|
229
|
+
cursor: not-allowed;
|
|
230
|
+
}
|
|
@@ -3,115 +3,40 @@
|
|
|
3
3
|
z-index: 9999;
|
|
4
4
|
position: fixed;
|
|
5
5
|
inset: 0;
|
|
6
|
+
background: rgba(0, 0, 0, 0.08);
|
|
6
7
|
}
|
|
7
|
-
.aiChat .
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
right: 0;
|
|
12
|
-
bottom: 0;
|
|
13
|
-
}
|
|
14
|
-
.aiChat .back {
|
|
15
|
-
position: absolute;
|
|
16
|
-
top: 30px;
|
|
17
|
-
left: 20px;
|
|
18
|
-
z-index: 2;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
width: 30px;
|
|
23
|
-
height: 30px;
|
|
24
|
-
border-radius: 50%;
|
|
25
|
-
background: #ffffff;
|
|
26
|
-
box-shadow: 0px 0px 10px 0px rgba(153, 167, 191, 0.2);
|
|
27
|
-
border: 1px solid #ebf2ff;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
.aiChat .rightWrap {
|
|
31
|
-
position: absolute;
|
|
32
|
-
right: 20px;
|
|
33
|
-
top: 30px;
|
|
34
|
-
z-index: 3;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
}
|
|
38
|
-
.aiChat .rightWrap .iconWrap {
|
|
39
|
-
margin-right: 40px;
|
|
40
|
-
}
|
|
41
|
-
.aiChat .introWrap {
|
|
8
|
+
.aiChat .main {
|
|
42
9
|
position: absolute;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
width:
|
|
46
|
-
height:
|
|
47
|
-
padding:
|
|
48
|
-
background: #f7faff;
|
|
49
|
-
box-shadow: -6px 2px 20px 0px rgba(153, 167, 191, 0.15);
|
|
50
|
-
border-radius: 12px;
|
|
51
|
-
z-index: 2;
|
|
52
|
-
transition: all 0.3s ease;
|
|
53
|
-
}
|
|
54
|
-
.aiChat .introWrap.block {
|
|
55
|
-
right: 20px;
|
|
56
|
-
}
|
|
57
|
-
.aiChat .introWrap .loading {
|
|
10
|
+
right: 30px;
|
|
11
|
+
top: 80px;
|
|
12
|
+
width: 280px;
|
|
13
|
+
height: 400px;
|
|
14
|
+
padding: 56px 20px 40px;
|
|
58
15
|
display: flex;
|
|
59
16
|
flex-direction: column;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
display: flex;
|
|
66
|
-
justify-content: space-between;
|
|
67
|
-
align-items: center;
|
|
68
|
-
margin-bottom: 20px;
|
|
69
|
-
}
|
|
70
|
-
.aiChat .introWrap .introHeader .title {
|
|
71
|
-
font-size: 18px;
|
|
72
|
-
font-weight: 600;
|
|
17
|
+
border-radius: 16px;
|
|
18
|
+
border: 1px solid #E9EBF2;
|
|
19
|
+
background: #F5F7FA;
|
|
20
|
+
box-shadow: 0 8px 36px 0 rgba(0, 0, 0, 0.1);
|
|
21
|
+
box-sizing: border-box;
|
|
73
22
|
}
|
|
74
|
-
.aiChat .
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
.aiChat .main {
|
|
80
|
-
position: relative;
|
|
81
|
-
height: 100%;
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
transition: all 0.3s ease;
|
|
23
|
+
.aiChat .main .title {
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 16px;
|
|
26
|
+
left: 50%;
|
|
27
|
+
transform: translateX(-50%);
|
|
85
28
|
}
|
|
86
|
-
.aiChat .main.
|
|
87
|
-
|
|
29
|
+
.aiChat .main .title img {
|
|
30
|
+
width: 24px;
|
|
31
|
+
height: 24px;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
object-fit: cover;
|
|
88
34
|
}
|
|
89
35
|
.aiChat .main .content {
|
|
90
|
-
height:
|
|
36
|
+
height: 260px;
|
|
91
37
|
overflow-y: scroll;
|
|
92
38
|
overflow-x: hidden;
|
|
93
|
-
|
|
94
|
-
.aiChat .main .content .container {
|
|
95
|
-
width: 800px;
|
|
96
|
-
margin: 0 auto;
|
|
97
|
-
height: 100%;
|
|
98
|
-
}
|
|
99
|
-
.aiChat .main .header {
|
|
100
|
-
display: flex;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
margin-bottom: 30px;
|
|
103
|
-
height: 26px;
|
|
104
|
-
}
|
|
105
|
-
.aiChat .main .header .logo {
|
|
106
|
-
width: 18px;
|
|
107
|
-
height: 18px;
|
|
108
|
-
margin-right: 8px;
|
|
109
|
-
flex-shrink: 0;
|
|
110
|
-
margin-top: 3px;
|
|
111
|
-
}
|
|
112
|
-
.aiChat .main .header .title {
|
|
113
|
-
font-size: 18px;
|
|
114
|
-
text-align: center;
|
|
39
|
+
padding-bottom: 10px;
|
|
115
40
|
}
|
|
116
41
|
.aiChat .main .tips {
|
|
117
42
|
font-weight: 400;
|
|
@@ -120,45 +45,50 @@
|
|
|
120
45
|
}
|
|
121
46
|
.aiChat .main .item {
|
|
122
47
|
margin-bottom: 10px;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
font-size: 17px;
|
|
126
|
-
line-height: 28px;
|
|
48
|
+
color: #4C5A70;
|
|
49
|
+
font-size: 14px;
|
|
127
50
|
word-break: break-all;
|
|
128
51
|
/* 强制换行 */
|
|
129
52
|
overflow-wrap: break-word;
|
|
130
53
|
/* 在适当位置换行 */
|
|
131
54
|
white-space: pre-wrap;
|
|
132
55
|
}
|
|
133
|
-
.aiChat .main .item.
|
|
134
|
-
|
|
135
|
-
|
|
56
|
+
.aiChat .main .item.question {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
}
|
|
60
|
+
.aiChat .main .item.question .text {
|
|
61
|
+
display: inline-block;
|
|
62
|
+
align-self: flex-end;
|
|
63
|
+
max-width: 220px;
|
|
64
|
+
padding: 10px 16px;
|
|
65
|
+
color: #2E394C;
|
|
66
|
+
border-radius: 12px;
|
|
67
|
+
background: #E9EBF2;
|
|
136
68
|
}
|
|
137
69
|
.aiChat .main .voiceWrap {
|
|
138
70
|
height: 100%;
|
|
139
|
-
display: flex;
|
|
140
|
-
align-items: center;
|
|
141
|
-
}
|
|
142
|
-
.aiChat .main .bottom {
|
|
143
71
|
display: flex;
|
|
144
72
|
flex-direction: column;
|
|
145
73
|
align-items: center;
|
|
146
|
-
|
|
147
|
-
bottom: 60px;
|
|
148
|
-
left: 50%;
|
|
149
|
-
transform: translateX(-50%);
|
|
150
|
-
text-align: center;
|
|
74
|
+
margin-top: 4px;
|
|
151
75
|
}
|
|
152
|
-
.aiChat .main .
|
|
153
|
-
|
|
76
|
+
.aiChat .main .voiceWrap .avatar {
|
|
77
|
+
width: 100px;
|
|
78
|
+
height: 100px;
|
|
79
|
+
margin-bottom: 24px;
|
|
154
80
|
}
|
|
155
|
-
.aiChat .main .
|
|
81
|
+
.aiChat .main .voiceWrap .avatar img {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 100%;
|
|
84
|
+
border-radius: 50%;
|
|
85
|
+
object-fit: cover;
|
|
86
|
+
}
|
|
87
|
+
.aiChat .main .status {
|
|
156
88
|
display: flex;
|
|
157
89
|
flex-direction: column;
|
|
158
|
-
width: 220px;
|
|
159
|
-
margin-bottom: 30px;
|
|
160
90
|
}
|
|
161
|
-
.aiChat .main .
|
|
91
|
+
.aiChat .main .status .iconOutside {
|
|
162
92
|
width: 30px;
|
|
163
93
|
height: 30px;
|
|
164
94
|
display: flex;
|
|
@@ -167,48 +97,60 @@
|
|
|
167
97
|
border: 3px solid #000000;
|
|
168
98
|
border-radius: 50%;
|
|
169
99
|
}
|
|
170
|
-
.aiChat .main .
|
|
100
|
+
.aiChat .main .status .iconInside {
|
|
171
101
|
width: 13px;
|
|
172
102
|
height: 13px;
|
|
173
103
|
background-color: #000000;
|
|
174
104
|
}
|
|
175
|
-
.aiChat .main .
|
|
105
|
+
.aiChat .main .status .statusImg {
|
|
176
106
|
width: 24px;
|
|
177
107
|
height: 24px;
|
|
178
108
|
border-radius: 8px;
|
|
179
109
|
margin: 0 auto;
|
|
180
110
|
margin-bottom: 15px;
|
|
181
111
|
}
|
|
182
|
-
.aiChat .main .
|
|
112
|
+
.aiChat .main .status .statusText {
|
|
183
113
|
font-size: 16px;
|
|
184
114
|
color: #7d91b3;
|
|
185
115
|
}
|
|
186
|
-
.aiChat .main .
|
|
116
|
+
.aiChat .main .status .statusText.danger {
|
|
187
117
|
color: red;
|
|
188
118
|
}
|
|
189
|
-
.aiChat .
|
|
119
|
+
.aiChat .bottom {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
align-items: center;
|
|
123
|
+
position: absolute;
|
|
124
|
+
bottom: 40px;
|
|
125
|
+
left: 50%;
|
|
126
|
+
transform: translateX(-50%);
|
|
127
|
+
text-align: center;
|
|
128
|
+
}
|
|
129
|
+
.aiChat .bottom .pointer {
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
}
|
|
132
|
+
.aiChat .bottom .btnWrap {
|
|
190
133
|
display: flex;
|
|
191
134
|
justify-content: center;
|
|
135
|
+
gap: 36px;
|
|
192
136
|
}
|
|
193
|
-
.aiChat .
|
|
137
|
+
.aiChat .bottom .btnWrap .btnItem {
|
|
194
138
|
display: flex;
|
|
195
139
|
align-items: center;
|
|
196
140
|
justify-content: center;
|
|
197
|
-
width:
|
|
198
|
-
height:
|
|
199
|
-
border-radius: 50%;
|
|
200
|
-
margin-right: 118px;
|
|
201
|
-
background: #ffffff;
|
|
202
|
-
box-shadow: 0px 2px 10px 0px rgba(153, 167, 191, 0.1);
|
|
141
|
+
width: 32px;
|
|
142
|
+
height: 32px;
|
|
203
143
|
cursor: pointer;
|
|
204
144
|
}
|
|
205
|
-
.aiChat .
|
|
145
|
+
.aiChat .bottom .btnWrap .btnItem.disable {
|
|
206
146
|
pointer-events: none;
|
|
207
147
|
opacity: 0.5;
|
|
208
148
|
cursor: not-allowed;
|
|
209
149
|
}
|
|
210
|
-
.aiChat .
|
|
211
|
-
|
|
150
|
+
.aiChat .bottom .btnWrap .btnItem.hasBorder {
|
|
151
|
+
border-radius: 50%;
|
|
152
|
+
background: #ffffff;
|
|
153
|
+
box-shadow: 0px 2px 10px 0px rgba(153, 167, 191, 0.1);
|
|
212
154
|
}
|
|
213
155
|
|
|
214
156
|
:global .out-tooltip .ant-tooltip-content .ant-tooltip-arrow {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FileItem } from "../../types/file";
|
|
3
|
+
import { AgentConfig } from "../../types/chat";
|
|
3
4
|
export interface ChatInputRef {
|
|
4
5
|
getValue: () => string;
|
|
5
6
|
setValue: (value: string) => void;
|
|
@@ -41,6 +42,9 @@ interface IAIInputProps {
|
|
|
41
42
|
};
|
|
42
43
|
onFileUploaded?: (file: FileItem) => void;
|
|
43
44
|
onValueChange?: (value: string) => void;
|
|
45
|
+
renderSendButton?: (defaultBtn: React.ReactNode) => React.ReactNode;
|
|
46
|
+
agentList?: AgentConfig[];
|
|
47
|
+
onAgentChange?: (agentId: number) => void;
|
|
44
48
|
}
|
|
45
49
|
declare const ChatInput: React.ForwardRefExoticComponent<IAIInputProps & React.RefAttributes<ChatInputRef>>;
|
|
46
50
|
export default ChatInput;
|