@myun/gimi-chat 0.0.2 → 0.0.4

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 (206) hide show
  1. package/dist/apis/fetch.d.ts +64 -0
  2. package/dist/apis/fetch.js +512 -0
  3. package/dist/apis/useApi.d.ts +57 -0
  4. package/dist/apis/useApi.js +378 -0
  5. package/dist/assets/image/Subtract.png +0 -0
  6. package/dist/assets/image/ai-logo.png +0 -0
  7. package/dist/assets/image/copyIcon.png +0 -0
  8. package/dist/assets/image/deepthinkActive.png +0 -0
  9. package/dist/assets/image/empty-img-dark.png +0 -0
  10. package/dist/assets/image/empty-img.png +0 -0
  11. package/dist/assets/image/like_active.png +0 -0
  12. package/dist/assets/image/love.png +0 -0
  13. package/dist/assets/image/retry.png +0 -0
  14. package/dist/assets/image/soundOut.png +0 -0
  15. package/dist/assets/image/unlike_active.png +0 -0
  16. package/dist/assets/image/unlove.png +0 -0
  17. package/dist/assets/lottie/ai-bg.json +1704 -0
  18. package/dist/assets/lottie/ai-loading.json +192 -0
  19. package/dist/assets/lottie/ai-output-loading.json +272 -0
  20. package/dist/assets/lottie/ai-output-normal.json +17694 -0
  21. package/dist/assets/lottie/ai-output-strengthen.json +17321 -0
  22. package/dist/assets/lottie/ai-voice-play.json +1 -0
  23. package/dist/assets/lottie/living.json +705 -0
  24. package/dist/assets/lottie/myun-living.json +726 -0
  25. package/dist/assets/lottie/myun-loading.json +530 -0
  26. package/dist/components/ai-chat-dialogue/index.d.ts +16 -0
  27. package/dist/components/ai-chat-dialogue/index.js +1056 -0
  28. package/dist/components/ai-chat-dialogue/index.module.scss +272 -0
  29. package/dist/components/ai-chat-dialogue/message-parser.d.ts +36 -0
  30. package/dist/components/ai-chat-dialogue/message-parser.js +52 -0
  31. package/dist/components/ai-chat-dialogue/tlv.d.ts +7 -0
  32. package/dist/components/ai-chat-dialogue/tlv.js +32 -0
  33. package/dist/components/ai-chat-dialogue/volc-voice-call-client.d.ts +47 -0
  34. package/dist/components/ai-chat-dialogue/volc-voice-call-client.js +246 -0
  35. package/dist/components/ai-correction/index.d.ts +5 -0
  36. package/dist/components/ai-correction/index.js +45 -0
  37. package/dist/components/ai-loading/index.d.ts +3 -0
  38. package/dist/components/ai-loading/index.js +14 -0
  39. package/dist/components/ai-loading/index.module.scss +11 -0
  40. package/dist/components/answer-item/index.d.ts +27 -0
  41. package/dist/components/answer-item/index.js +194 -0
  42. package/dist/components/answer-item/index.module.scss +295 -0
  43. package/dist/components/ask-card/index.d.ts +10 -0
  44. package/dist/components/ask-card/index.js +76 -0
  45. package/dist/components/ask-card/index.module.scss +125 -0
  46. package/dist/components/chat-input/index.d.ts +31 -0
  47. package/dist/components/chat-input/index.js +433 -0
  48. package/dist/components/chat-input/index.module.scss +44 -0
  49. package/dist/components/chat-voice/VoiceCommunication.d.ts +7 -0
  50. package/dist/components/chat-voice/VoiceCommunication.js +69 -0
  51. package/dist/components/chat-voice/VoiceRecord.d.ts +7 -0
  52. package/dist/components/chat-voice/VoiceRecord.js +34 -0
  53. package/dist/components/conversation-delete/index.d.ts +5 -0
  54. package/dist/components/conversation-delete/index.js +24 -0
  55. package/dist/components/dots-loading/index.d.ts +2 -0
  56. package/dist/components/dots-loading/index.js +11 -0
  57. package/dist/components/dots-loading/index.module.scss +45 -0
  58. package/dist/components/empty/index.d.ts +9 -0
  59. package/dist/components/empty/index.js +32 -0
  60. package/dist/components/empty/index.module.scss +27 -0
  61. package/dist/components/excel-components/ExcelCard.d.ts +11 -0
  62. package/dist/components/excel-components/ExcelCard.js +35 -0
  63. package/dist/components/excel-components/ExcelExcuting.d.ts +10 -0
  64. package/dist/components/excel-components/ExcelExcuting.js +263 -0
  65. package/dist/components/excel-components/ExcelFailCard.d.ts +9 -0
  66. package/dist/components/excel-components/ExcelFailCard.js +20 -0
  67. package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -0
  68. package/dist/components/excel-components/ExcelSuccessCard.js +50 -0
  69. package/dist/components/excel-components/index.module.scss +210 -0
  70. package/dist/components/excel-components/styles.module.scss +186 -0
  71. package/dist/components/file-card/fileCardSidebar.d.ts +8 -0
  72. package/dist/components/file-card/fileCardSidebar.js +56 -0
  73. package/dist/components/file-card/index.d.ts +15 -0
  74. package/dist/components/file-card/index.js +97 -0
  75. package/dist/components/file-card/index.module.scss +139 -0
  76. package/dist/components/file-preview/index.d.ts +3 -0
  77. package/dist/components/file-preview/index.js +229 -0
  78. package/dist/components/file-preview/index.module.scss +120 -0
  79. package/dist/components/file-upload/index.d.ts +16 -0
  80. package/dist/components/file-upload/index.js +238 -0
  81. package/dist/components/file-upload/uploadV1.d.ts +16 -0
  82. package/dist/components/file-upload/uploadV1.js +267 -0
  83. package/dist/components/gimi-sidebar/index.d.ts +17 -0
  84. package/dist/components/gimi-sidebar/index.js +41 -0
  85. package/dist/components/gimi-sidebar/index.module.scss +136 -0
  86. package/dist/components/header/index.d.ts +5 -0
  87. package/dist/components/header/index.js +20 -0
  88. package/dist/components/header/index.module.scss +26 -0
  89. package/dist/components/iconfont-com/index.d.ts +11 -0
  90. package/dist/components/iconfont-com/index.js +29 -0
  91. package/dist/components/index.d.ts +1 -0
  92. package/dist/components/index.js +1 -0
  93. package/dist/components/knowledge-trace/KnowledgeIconComponent.d.ts +7 -0
  94. package/dist/components/knowledge-trace/KnowledgeIconComponent.js +101 -0
  95. package/dist/components/knowledge-trace/classList.d.ts +6 -0
  96. package/dist/components/knowledge-trace/classList.js +72 -0
  97. package/dist/components/knowledge-trace/documentList.d.ts +6 -0
  98. package/dist/components/knowledge-trace/documentList.js +75 -0
  99. package/dist/components/knowledge-trace/index.d.ts +18 -0
  100. package/dist/components/knowledge-trace/index.js +155 -0
  101. package/dist/components/knowledge-trace/index.module.scss +262 -0
  102. package/dist/components/knowledge-trace/interfaces.d.ts +166 -0
  103. package/dist/components/knowledge-trace/interfaces.js +1 -0
  104. package/dist/components/knowledge-trace/videoList.d.ts +6 -0
  105. package/dist/components/knowledge-trace/videoList.js +91 -0
  106. package/dist/components/lottie-img/index.d.ts +8 -0
  107. package/dist/components/lottie-img/index.js +99 -0
  108. package/dist/components/message-actions/CopyButton.d.ts +7 -0
  109. package/dist/components/message-actions/CopyButton.js +33 -0
  110. package/dist/components/message-actions/LikeButton.d.ts +7 -0
  111. package/dist/components/message-actions/LikeButton.js +34 -0
  112. package/dist/components/message-actions/RegenerateButton.d.ts +5 -0
  113. package/dist/components/message-actions/RegenerateButton.js +27 -0
  114. package/dist/components/message-actions/UnLikeButton.d.ts +7 -0
  115. package/dist/components/message-actions/UnLikeButton.js +34 -0
  116. package/dist/components/message-actions/VoicePlay.d.ts +10 -0
  117. package/dist/components/message-actions/VoicePlay.js +74 -0
  118. package/dist/components/message-list/index.d.ts +19 -0
  119. package/dist/components/message-list/index.js +167 -0
  120. package/dist/components/message-list/index.module.scss +304 -0
  121. package/dist/components/no-microphone-root/index.d.ts +6 -0
  122. package/dist/components/no-microphone-root/index.js +36 -0
  123. package/dist/components/no-microphone-root/index.module.scss +42 -0
  124. package/dist/components/preset-agent-content/index.d.ts +8 -0
  125. package/dist/components/preset-agent-content/index.js +24 -0
  126. package/dist/components/preset-agent-content/index.module.scss +48 -0
  127. package/dist/components/quoted-content/index.d.ts +0 -0
  128. package/dist/components/quoted-content/index.js +171 -0
  129. package/dist/components/quoted-content/index.module.scss +76 -0
  130. package/dist/components/reasoning-content/index.d.ts +6 -0
  131. package/dist/components/reasoning-content/index.js +116 -0
  132. package/dist/components/reasoning-content/index.module.scss +164 -0
  133. package/dist/components/reference-content/index.d.ts +28 -0
  134. package/dist/components/reference-content/index.js +125 -0
  135. package/dist/components/reference-content/index.module.scss +73 -0
  136. package/dist/components/templates/CommonChat.d.ts +5 -0
  137. package/dist/components/templates/CommonChat.js +218 -0
  138. package/dist/components/templates/GimiChatComponent.d.ts +4 -0
  139. package/dist/components/templates/GimiChatComponent.js +23 -0
  140. package/dist/components/templates/demo/demo.d.ts +2 -0
  141. package/dist/components/templates/demo/demo.js +110 -0
  142. package/dist/components/templates/index.module.scss +119 -0
  143. package/dist/components/upload-list/index.d.ts +15 -0
  144. package/dist/components/upload-list/index.js +90 -0
  145. package/dist/components/upload-list/index.module.scss +119 -0
  146. package/dist/components/voice-bars/index.d.ts +4 -0
  147. package/dist/components/voice-bars/index.js +174 -0
  148. package/dist/components/voice-check-dialog/index.d.ts +8 -0
  149. package/dist/components/voice-check-dialog/index.js +163 -0
  150. package/dist/components/voice-check-dialog/index.module.scss +9 -0
  151. package/dist/components/voice-recording/index.d.ts +9 -0
  152. package/dist/components/voice-recording/index.js +54 -0
  153. package/dist/components/voice-recording/index.module.scss +41 -0
  154. package/dist/components/work-flow-content/demo.d.ts +3 -0
  155. package/dist/components/work-flow-content/demo.js +11 -0
  156. package/dist/components/work-flow-content/index.d.ts +6 -0
  157. package/dist/components/work-flow-content/index.js +55 -0
  158. package/dist/components/work-flow-content/index.module.scss +23 -0
  159. package/dist/constants.d.ts +24 -0
  160. package/dist/constants.js +24 -0
  161. package/dist/hooks/useChatActions.d.ts +12 -0
  162. package/dist/hooks/useChatActions.js +207 -0
  163. package/dist/hooks/useChatHistory.d.ts +8 -0
  164. package/dist/hooks/useChatHistory.js +225 -0
  165. package/dist/hooks/useChatMessage.d.ts +49 -0
  166. package/dist/hooks/useChatMessage.js +87 -0
  167. package/dist/hooks/useChatRecommend.d.ts +8 -0
  168. package/dist/hooks/useChatRecommend.js +126 -0
  169. package/dist/hooks/useChatStream.d.ts +20 -0
  170. package/dist/hooks/useChatStream.js +244 -0
  171. package/dist/hooks/useChatUI.d.ts +32 -0
  172. package/dist/hooks/useChatUI.js +134 -0
  173. package/dist/hooks/useChatVoice.d.ts +11 -0
  174. package/dist/hooks/useChatVoice.js +379 -0
  175. package/dist/hooks/useCommonChatAPI.d.ts +27 -0
  176. package/dist/hooks/useCommonChatAPI.js +1276 -0
  177. package/dist/hooks/useFile.d.ts +13 -0
  178. package/dist/hooks/useFile.js +288 -0
  179. package/dist/hooks/useKnowledgeService.d.ts +17 -0
  180. package/dist/hooks/useKnowledgeService.js +210 -0
  181. package/dist/hooks/useLastEventId.d.ts +8 -0
  182. package/dist/hooks/useLastEventId.js +66 -0
  183. package/dist/hooks/useLongPoll.d.ts +3 -0
  184. package/dist/hooks/useLongPoll.js +111 -0
  185. package/dist/hooks/useScroll.d.ts +4 -0
  186. package/dist/hooks/useScroll.js +172 -0
  187. package/dist/index.d.ts +1 -0
  188. package/dist/index.js +1 -0
  189. package/dist/interfaces/chatMessage.d.ts +139 -0
  190. package/dist/interfaces/fileInterface.d.ts +10 -0
  191. package/dist/interfaces/fileInterface.js +11 -0
  192. package/dist/interfaces/knowledgeTrace.d.ts +177 -0
  193. package/dist/store/hooks.d.ts +4 -0
  194. package/dist/store/hooks.js +3 -0
  195. package/dist/store/index.d.ts +7 -0
  196. package/dist/store/index.js +7 -0
  197. package/dist/store/slices/gimiMenuSlice.d.ts +95 -0
  198. package/dist/store/slices/gimiMenuSlice.js +251 -0
  199. package/dist/utils/chatInputUtil.d.ts +19 -0
  200. package/dist/utils/chatInputUtil.js +45 -0
  201. package/dist/utils/tools.d.ts +50 -0
  202. package/dist/utils/tools.js +474 -0
  203. package/dist/utils/voice-stream.d.ts +119 -0
  204. package/dist/utils/voice-stream.js +1162 -0
  205. package/package.json +2 -3
  206. package/LICENSE +0 -21
@@ -0,0 +1,295 @@
1
+ .title {
2
+ width: 100%;
3
+ display: flex;
4
+ align-items: center;
5
+ position: relative;
6
+ font-size: 16px;
7
+ color: #000000;
8
+ line-height: 24px;
9
+ width: fit-content;
10
+ text-align: left;
11
+ word-break: break-all;
12
+ /* 强制换行 */
13
+ overflow-wrap: break-word;
14
+
15
+ /* 在适当位置换行 */
16
+ .qusetionOpera {
17
+ position: absolute;
18
+ top: 50%;
19
+ left: -30px;
20
+ transform: translateY(-50%);
21
+ }
22
+
23
+ .answer {
24
+ width: 100%;
25
+ display: flex;
26
+ flex-direction: column;
27
+ justify-content: center;
28
+ margin: 10px 0px;
29
+
30
+ .completed {
31
+ display: flex;
32
+ gap: 10px;
33
+ align-items: center;
34
+
35
+ .checkIcon {
36
+ font-size: 16px;
37
+ color: rgba(62, 179, 86, 1);
38
+ }
39
+
40
+ .checkText {
41
+ font-family: PingFang SC;
42
+ font-weight: 600;
43
+ font-style: Semibold;
44
+ font-size: 15px;
45
+ line-height: 180%;
46
+ letter-spacing: 0px;
47
+ color: rgba(46, 57, 76, 1);
48
+ }
49
+ }
50
+
51
+ // margin-bottom: 32px;
52
+ .relevance {
53
+ width: fit-content;
54
+ height: 40px;
55
+ background: #ffffff;
56
+ border-radius: 16px;
57
+ border: 1px solid #cfd7e6;
58
+ display: flex;
59
+ justify-content: center;
60
+ align-items: center;
61
+ margin-bottom: 14px;
62
+
63
+ .icon {
64
+ display: flex;
65
+ align-items: center;
66
+ justify-self: center;
67
+ margin-right: 12px;
68
+ }
69
+
70
+ .search_icon {
71
+ display: flex;
72
+ align-items: center;
73
+ justify-self: center;
74
+ margin-left: 16px;
75
+ }
76
+
77
+ span {
78
+ height: 20px;
79
+ font-family: PingFangSC, PingFang SC;
80
+ font-weight: 400;
81
+ font-size: 14px;
82
+ color: #2e394c;
83
+ line-height: 20px;
84
+ text-align: left;
85
+ font-style: normal;
86
+ margin: 0 2px;
87
+ }
88
+ }
89
+
90
+ .stop {
91
+ width: 100%;
92
+ height: 28px;
93
+ font-family: PingFangSC, PingFang SC;
94
+ font-weight: 400;
95
+ font-size: 15px;
96
+ color: #7d91b3;
97
+ line-height: 28px;
98
+ text-align: left;
99
+ font-style: normal;
100
+ margin-top: 6px;
101
+ }
102
+ }
103
+ }
104
+
105
+ .opera {
106
+ height: 18px;
107
+ margin-top: 12px;
108
+ display: flex;
109
+
110
+ // align-items: center;
111
+ .opera_item {
112
+ display: flex;
113
+ align-items: center;
114
+ gap: 18px;
115
+ .unlove {
116
+ display: flex;
117
+ align-items: center;
118
+ cursor: pointer;
119
+ user-select: none;
120
+ }
121
+ }
122
+ }
123
+
124
+ .operaicon {
125
+ height: 20px;
126
+ margin-top: 12px;
127
+ text-align: end;
128
+ }
129
+
130
+ .chatline {
131
+ width: 100%;
132
+ margin: 40px 0;
133
+ height: 1px;
134
+ background: #dfe8f7;
135
+ }
136
+
137
+ .course_recommend {
138
+ width: 100%;
139
+ margin-top: 20px;
140
+
141
+ .course_recommend_header {
142
+ width: 100%;
143
+ height: 28px;
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: space-between;
147
+
148
+ .course_recommend_header_title {
149
+ font-family: PingFangSC, PingFang SC;
150
+ font-weight: 600;
151
+ font-size: 18px;
152
+ color: #2e394c;
153
+ line-height: 28px;
154
+ text-align: left;
155
+ font-style: normal;
156
+ }
157
+
158
+ .course_recommend_header_more {
159
+ display: flex;
160
+ align-items: center;
161
+
162
+ .all {
163
+ width: 56px;
164
+ height: 20px;
165
+ font-family: PingFangSC, PingFang SC;
166
+ font-weight: 500;
167
+ font-size: 14px;
168
+ color: #2e394c;
169
+ line-height: 20px;
170
+ text-align: left;
171
+ font-style: normal;
172
+ }
173
+ }
174
+ }
175
+
176
+ .course_recommend_list {
177
+ margin-top: 12px;
178
+ // margin-bottom: 30px;
179
+ display: flex;
180
+ flex-wrap: wrap;
181
+ gap: 20px 0;
182
+
183
+ .courseItem {
184
+ flex: 1 1 clamp(180px, 48%, 360px);
185
+ max-width: clamp(180px, 48%, 360px);
186
+ height: 68px;
187
+ display: flex;
188
+ align-items: center;
189
+ justify-content: space-between;
190
+
191
+ .cover {
192
+ border-radius: 4px;
193
+ overflow: hidden;
194
+ width: 120px;
195
+ height: 68px;
196
+ border-radius: 4px;
197
+
198
+ img {
199
+ width: 100%;
200
+ height: 100%;
201
+ object-fit: cover;
202
+ }
203
+ }
204
+
205
+ .courseTitle {
206
+ flex: 1 1 auto;
207
+ height: 68px;
208
+ font-family: PingFangSC, PingFang SC;
209
+ font-weight: 400;
210
+ font-size: 14px;
211
+ color: #2e394c;
212
+ text-align: left;
213
+ font-style: normal;
214
+ display: -webkit-box;
215
+ -webkit-line-clamp: 3;
216
+ /* 限制行数 */
217
+ -webkit-box-orient: vertical;
218
+ overflow: hidden;
219
+ text-overflow: ellipsis;
220
+ margin-left: 20px;
221
+
222
+ .newEquityLabel {
223
+ display: inline-block !important;
224
+ margin-right: 8px;
225
+ padding: 0 4px;
226
+ color: #e68845;
227
+ font-size: 10px;
228
+ font-weight: 600;
229
+ line-height: 18px;
230
+ border-radius: 4px;
231
+ background: #ffecd9;
232
+ position: relative;
233
+ bottom: 2px;
234
+
235
+ &-1 {
236
+ color: #3d996b;
237
+ background: #ccffe6;
238
+ }
239
+
240
+ &-2 {}
241
+
242
+ &-3 {
243
+ color: #fff;
244
+ background: #7d91b3;
245
+ }
246
+ }
247
+ }
248
+ }
249
+
250
+ .courseItem:nth-child(2n) {
251
+ margin-left: 40px;
252
+ }
253
+ }
254
+ }
255
+
256
+ .quickInputList {
257
+ max-width: min(800px, 90vw);
258
+ display: flex;
259
+ gap: 12px;
260
+ flex-wrap: wrap;
261
+ flex-direction: column;
262
+ align-items: flex-start; // 关键:让子项不拉伸
263
+ margin-top: 20px;
264
+
265
+ .quickInputItem {
266
+ padding: 5px 10px;
267
+ font-family: PingFangSC, PingFang SC;
268
+ font-weight: 400;
269
+ font-size: 14px;
270
+ color: rgba(46, 57, 76, 1);
271
+ line-height: 18px;
272
+ text-align: left;
273
+ font-style: normal;
274
+ border-radius: 8px;
275
+ border: 1px solid rgba(217, 220, 229, 1);
276
+ cursor: pointer;
277
+ display: inline;
278
+ white-space: nowrap;
279
+ /* 禁止换行 */
280
+ overflow: hidden;
281
+ /* 隐藏溢出内容 */
282
+ text-overflow: ellipsis;
283
+ /* 显示省略号 */
284
+ /* 如果需要可以添加最大宽度 */
285
+ white-space: normal;
286
+ }
287
+ }
288
+
289
+ .fileBox {
290
+ border-radius: 16px;
291
+ border: 1px solid var(---, #e9ebf2);
292
+ background: linear-gradient(180deg, #f7fff9 0%, #f1fcfe 30%, #fff 100%);
293
+ box-shadow: 0 2px 2px 0 #fff inset;
294
+ padding: 20px;
295
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { IChatMessageItem } from '../../interfaces/chatMessage';
3
+ interface IProps {
4
+ item: IChatMessageItem;
5
+ moduleInfo: any;
6
+ handleClickAskList: (item: any, operation: string, key: string, value?: string) => void;
7
+ onAskCardCallback?: () => void;
8
+ }
9
+ declare const AskCard: ({ item, moduleInfo, handleClickAskList, onAskCardCallback }: IProps) => React.JSX.Element;
10
+ export default AskCard;
@@ -0,0 +1,76 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React from 'react';
8
+ import styles from "./index.module.scss";
9
+ import { MMarkdown } from '@myun/gimi-design';
10
+ import classNames from 'classnames';
11
+ import FileUpload from "../file-upload";
12
+ var AskCard = function AskCard(_ref) {
13
+ var item = _ref.item,
14
+ moduleInfo = _ref.moduleInfo,
15
+ handleClickAskList = _ref.handleClickAskList,
16
+ onAskCardCallback = _ref.onAskCardCallback;
17
+ var _React$useMemo = React.useMemo(function () {
18
+ var _detailInfo$questionC;
19
+ var detailInfo = moduleInfo.data.results.askShowInfo;
20
+ var optionsList = Object.entries(detailInfo.options).map(function (_ref2) {
21
+ var _ref3 = _slicedToArray(_ref2, 2),
22
+ key = _ref3[0],
23
+ value = _ref3[1];
24
+ return {
25
+ key: key,
26
+ value: value
27
+ };
28
+ });
29
+ var questionContent = (_detailInfo$questionC = detailInfo.questionContent) === null || _detailInfo$questionC === void 0 ? void 0 : _detailInfo$questionC.replace(/\n/g, '\n');
30
+ return {
31
+ detailInfo: detailInfo,
32
+ optionsList: optionsList,
33
+ questionContent: questionContent
34
+ };
35
+ }, [moduleInfo, handleClickAskList]),
36
+ detailInfo = _React$useMemo.detailInfo,
37
+ optionsList = _React$useMemo.optionsList,
38
+ questionContent = _React$useMemo.questionContent;
39
+ var optionRender = function optionRender(v) {
40
+ return /*#__PURE__*/React.createElement("span", null, v.value ? v.value : v.key);
41
+ };
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ className: styles.askList
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: styles.askQuestion,
46
+ style: detailInfo.answerType === 1 || detailInfo.uploadFile ? {
47
+ marginBottom: 12
48
+ } : {
49
+ marginBottom: 0
50
+ }
51
+ }, /*#__PURE__*/React.createElement(MMarkdown, {
52
+ content: questionContent,
53
+ id: item.id
54
+ })), detailInfo.answerType === 1 && (optionsList === null || optionsList === void 0 ? void 0 : optionsList.map(function (v) {
55
+ return /*#__PURE__*/React.createElement("div", {
56
+ className: classNames(styles.askItem, detailInfo.answerType === 0 || item.selectValue ? styles.disablebox : ''),
57
+ key: v.key,
58
+ onClick: function onClick() {
59
+ return handleClickAskList(moduleInfo, 'click', v.key, v.value || v.key);
60
+ }
61
+ }, optionRender(v));
62
+ })), detailInfo.uploadFile && detailInfo.answerType === 0 && /*#__PURE__*/React.createElement("div", {
63
+ className: classNames(styles.showUpload, item.disableUploadFile ? styles.disableFile : ''),
64
+ onClick: function onClick() {
65
+ return onAskCardCallback === null || onAskCardCallback === void 0 ? void 0 : onAskCardCallback();
66
+ }
67
+ }, /*#__PURE__*/React.createElement(FileUpload, {
68
+ disabled: item.disableUploadFile
69
+ }, /*#__PURE__*/React.createElement("div", {
70
+ className: classNames(styles.uploadIcon)
71
+ }, /*#__PURE__*/React.createElement("img", {
72
+ src: item.disableUploadFile ? 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/19/b1e04_20250919162201.png' : 'https://simg01.gaodunwangxiao.com/uploadimgs/tmp/upload/202509/11/83ad4_20250911153220.png',
73
+ alt: ""
74
+ }), "\u6587\u4EF6\u4E0A\u4F20"))));
75
+ };
76
+ export default AskCard;
@@ -0,0 +1,125 @@
1
+ .askList {
2
+ width: clamp(380px, 100%, 600px);
3
+ flex-shrink: 0;
4
+ padding: 20px;
5
+ border-radius: 16px;
6
+ border: 1px solid var(---, #e9ebf2);
7
+ background: linear-gradient(180deg, #f9fefe 0%, #fff 100%);
8
+ box-shadow: 0 2px 2px 0 #fff inset;
9
+ margin-top: 12px;
10
+ .askItem {
11
+ width: fit-content;
12
+ flex-shrink: 0;
13
+ padding: 12px 20px;
14
+ border-radius: 22px;
15
+ border: 1px solid var(---, #d9dce5);
16
+ background: #fff;
17
+ color: #000;
18
+ font-family: 'PingFang SC';
19
+ font-size: 14px;
20
+ font-style: normal;
21
+ font-weight: 600;
22
+ line-height: normal;
23
+ margin-bottom: 16px;
24
+ cursor: pointer;
25
+ min-width: clamp(88px, 25%, 100px);
26
+ max-width: 100%;
27
+ display: flex;
28
+ justify-content: center;
29
+ align-items: center;
30
+ line-height: 20px;
31
+ }
32
+ .disablebox {
33
+ border-radius: 22px;
34
+ border: 1px solid var(---, #d9dce5);
35
+ background: #fff;
36
+ color: #ced3d9;
37
+ font-family: 'PingFang SC';
38
+ font-size: 14px;
39
+ font-style: normal;
40
+ font-weight: 600;
41
+ line-height: normal;
42
+ cursor: not-allowed;
43
+ pointer-events: none;
44
+ }
45
+ .selectbox {
46
+ border-radius: 22px;
47
+ background: var(---, #2e394c);
48
+ color: #fff;
49
+ font-family: 'PingFang SC';
50
+ font-size: 14px;
51
+ font-style: normal;
52
+ font-weight: 600;
53
+ line-height: normal;
54
+ cursor: not-allowed;
55
+ pointer-events: none;
56
+ }
57
+ .askQuestion {
58
+ max-width: 100%;
59
+ // white-space: pre-line;
60
+ color: #2e394c;
61
+ font-family: 'PingFang SC';
62
+ font-size: 16px;
63
+ font-style: normal;
64
+ font-weight: 400;
65
+ line-height: 28px; /* 175% */
66
+ margin-bottom: 12px;
67
+ :global(.markdown_container) {
68
+ p {
69
+ margin: 0;
70
+ white-space: pre-wrap;
71
+ }
72
+ li {
73
+ white-space: pre-line;
74
+ }
75
+ }
76
+ }
77
+ .askItem:nth-last-child(1) {
78
+ margin-bottom: 0;
79
+ }
80
+ }
81
+ .showUpload {
82
+ width: 128px;
83
+ height: 44px;
84
+ flex-shrink: 0;
85
+ border-radius: 22px;
86
+ border: 1px solid var(---, #d9dce5);
87
+ background: #fff;
88
+ display: flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ cursor: pointer;
92
+ display: flex;
93
+ align-items: center;
94
+ color: #000;
95
+ font-family: 'PingFang SC';
96
+ font-size: 14px;
97
+ font-style: normal;
98
+ font-weight: 600;
99
+ line-height: normal;
100
+
101
+ :global(.ant-upload) {
102
+ height: 100%;
103
+ }
104
+ .uploadIcon {
105
+ height: 100%;
106
+ display: flex;
107
+ align-items: center;
108
+ }
109
+ .disableFile {
110
+ border-radius: 22px;
111
+ border: 1px solid var(---, #d9dce5);
112
+ background: #fff;
113
+ color: #ced3d9;
114
+ font-family: 'PingFang SC';
115
+ font-size: 14px;
116
+ font-style: normal;
117
+ font-weight: 600;
118
+ line-height: normal;
119
+ }
120
+ img {
121
+ width: 32px;
122
+ height: 32px;
123
+ flex-shrink: 0;
124
+ }
125
+ }
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ export interface ChatInputRef {
3
+ getValue: () => string;
4
+ setValue: (value: string) => void;
5
+ focus: () => void;
6
+ blur: () => void;
7
+ }
8
+ interface IAIInputProps {
9
+ placeholder?: string;
10
+ defaultPrompt?: string;
11
+ disabled?: boolean;
12
+ onSend?: (text: string) => void;
13
+ enableVoiceRecord?: boolean;
14
+ enableVoiceChat?: boolean;
15
+ enableFileUpload?: boolean;
16
+ style?: React.CSSProperties;
17
+ className?: string;
18
+ maxLength?: number;
19
+ onInterrupt?: () => void;
20
+ isRecording?: boolean;
21
+ isVoiceGetting?: boolean;
22
+ recordingCount?: number;
23
+ asrText?: string;
24
+ shortAsrClick: (ignoreMsg?: boolean) => Promise<void>;
25
+ disableVoiceCommunication?: boolean;
26
+ onHistoryReload?: () => void;
27
+ accept?: string[];
28
+ showDefaultPrompt?: boolean;
29
+ }
30
+ declare const ChatInput: React.ForwardRefExoticComponent<IAIInputProps & React.RefAttributes<ChatInputRef>>;
31
+ export default ChatInput;