@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,304 @@
1
+ .main {
2
+ position: relative;
3
+ // min-height: 100%;
4
+ width: 100%;
5
+ transition: all 0.3s ease;
6
+ flex: 1;
7
+ padding: 20px 0 0;
8
+
9
+ &.translate {
10
+ transform: translateX(-320px);
11
+ }
12
+
13
+ .container {
14
+ width: 100%;
15
+ max-width: var(--container-max);
16
+ margin: 0 auto;
17
+ box-sizing: border-box;
18
+ padding: 0 10px;
19
+ // height: fit-content;
20
+ }
21
+
22
+ .small_container {
23
+ width: min(100%, var(--container-max));
24
+ max-width: var(--container-max);
25
+ margin: 0 auto;
26
+ box-sizing: border-box;
27
+ padding: 0 16px;
28
+ }
29
+
30
+ // }
31
+
32
+ .textWrap {
33
+ padding-bottom: 40px;
34
+
35
+ .textItem {
36
+ width: 100%;
37
+ // padding-bottom: 24px;
38
+ // margin-bottom: 16px;
39
+ position: relative;
40
+
41
+ &.question {
42
+ width: 100%;
43
+ display: flex;
44
+ flex-direction: column;
45
+ margin-top: 22px;
46
+
47
+ .title {
48
+ font-size: 15px;
49
+ line-height: 1.8;
50
+ display: inline-block;
51
+ max-width: 680px;
52
+ padding: 12px 16px;
53
+ background: #ebf2ff;
54
+ border-radius: 16px;
55
+ white-space: pre-wrap;
56
+ word-break: break-word;
57
+ align-self: flex-end;
58
+ overflow-x: auto;
59
+ }
60
+
61
+ .listBox {
62
+ display: flex;
63
+ flex-direction: row-reverse;
64
+ margin-top: 16px;
65
+ }
66
+
67
+ .opera {
68
+ left: unset;
69
+ right: 0;
70
+ }
71
+ }
72
+
73
+ &.question:first-child {
74
+ margin-top: 0;
75
+ }
76
+
77
+ &:last-child {
78
+ margin-bottom: 0;
79
+ }
80
+
81
+ .title {
82
+ width: 100%;
83
+ display: flex;
84
+ align-items: center;
85
+ position: relative;
86
+ font-size: 16px;
87
+ color: #000000;
88
+ line-height: 24px;
89
+ width: fit-content;
90
+ text-align: left;
91
+ word-break: break-all;
92
+ /* 强制换行 */
93
+ overflow-wrap: break-word;
94
+
95
+ /* 在适当位置换行 */
96
+ .qusetionOpera {
97
+ position: absolute;
98
+ top: 50%;
99
+ left: -30px;
100
+ transform: translateY(-50%);
101
+ }
102
+
103
+ .answer {
104
+ width: 100%;
105
+ display: flex;
106
+ flex-direction: column;
107
+ justify-content: center;
108
+ margin-bottom: 20px;
109
+
110
+ .relevance {
111
+ width: fit-content;
112
+ height: 40px;
113
+ background: #ffffff;
114
+ border-radius: 16px;
115
+ border: 1px solid #cfd7e6;
116
+ display: flex;
117
+ justify-content: center;
118
+ align-items: center;
119
+ margin-bottom: 14px;
120
+
121
+ .icon {
122
+ display: flex;
123
+ align-items: center;
124
+ justify-self: center;
125
+ margin-right: 12px;
126
+ }
127
+
128
+ .search_icon {
129
+ display: flex;
130
+ align-items: center;
131
+ justify-self: center;
132
+ margin-left: 16px;
133
+ }
134
+
135
+ span {
136
+ height: 20px;
137
+ font-family: PingFangSC, PingFang SC;
138
+ font-weight: 400;
139
+ font-size: 14px;
140
+ color: #2e394c;
141
+ line-height: 20px;
142
+ text-align: left;
143
+ font-style: normal;
144
+ margin: 0 2px;
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ .opera {
151
+ width: 100%;
152
+ height: 20px;
153
+ margin-top: 12px;
154
+ display: flex;
155
+ align-items: center;
156
+
157
+ .opera_item {
158
+ display: flex;
159
+ align-items: center;
160
+
161
+ .unlove {
162
+ margin-left: 18px;
163
+ display: flex;
164
+ align-items: center;
165
+ cursor: pointer;
166
+ }
167
+ }
168
+ }
169
+
170
+ .operaicon {
171
+ height: 20px;
172
+ margin-top: 12px;
173
+ text-align: end;
174
+ }
175
+
176
+ .chatline {
177
+ margin: 40px 0;
178
+ width: 100%;
179
+ height: 1px;
180
+ background: #dfe8f7;
181
+ }
182
+
183
+ .course_recommend {
184
+ .course_recommend_header {
185
+ width: 100%;
186
+ height: 28px;
187
+ display: flex;
188
+ align-items: center;
189
+ justify-content: space-between;
190
+
191
+ .course_recommend_header_title {
192
+ font-family: PingFangSC, PingFang SC;
193
+ font-weight: 600;
194
+ font-size: 18px;
195
+ color: #2e394c;
196
+ line-height: 28px;
197
+ text-align: left;
198
+ font-style: normal;
199
+ }
200
+
201
+ .course_recommend_header_more {
202
+ display: flex;
203
+ align-items: center;
204
+
205
+ .all {
206
+ width: 56px;
207
+ height: 20px;
208
+ font-family: PingFangSC, PingFang SC;
209
+ font-weight: 500;
210
+ font-size: 14px;
211
+ color: #2e394c;
212
+ line-height: 20px;
213
+ text-align: left;
214
+ font-style: normal;
215
+ }
216
+ }
217
+ }
218
+
219
+ .course_recommend_list {
220
+ margin-top: 12px;
221
+ margin-bottom: 30px;
222
+ display: flex;
223
+ flex-wrap: wrap;
224
+ gap: 20px;
225
+
226
+ .courseItem {
227
+ width: 360px;
228
+ height: 68px;
229
+ display: flex;
230
+ align-items: center;
231
+ justify-content: space-between;
232
+ gap: 20;
233
+
234
+ .cover {
235
+ border-radius: 4px;
236
+ overflow: hidden;
237
+ width: 120px;
238
+ height: 68px;
239
+ border-radius: 4px;
240
+
241
+ img {
242
+ width: 100%;
243
+ height: 100%;
244
+ object-fit: cover;
245
+ }
246
+ }
247
+
248
+ .courseTitle {
249
+ width: 228px;
250
+ height: 68px;
251
+ font-family: PingFangSC, PingFang SC;
252
+ font-weight: 400;
253
+ font-size: 14px;
254
+ color: #2e394c;
255
+ line-height: 20px;
256
+ text-align: left;
257
+ font-style: normal;
258
+ display: -webkit-box;
259
+ -webkit-line-clamp: 3;
260
+ /* 限制行数 */
261
+ -webkit-box-orient: vertical;
262
+ overflow: hidden;
263
+ text-overflow: ellipsis;
264
+ }
265
+ }
266
+ }
267
+ }
268
+ }
269
+
270
+ .answerLoading {
271
+ width: 40px;
272
+ margin-top: 20px;
273
+ }
274
+ }
275
+
276
+ .emptyWrap {
277
+ text-align: center;
278
+ height: 100%;
279
+ display: flex;
280
+ flex-direction: column;
281
+ justify-content: center;
282
+
283
+ .title {
284
+ font-weight: 600;
285
+ font-size: 20px;
286
+ color: #2e394c;
287
+ line-height: 28px;
288
+ margin-bottom: 12px;
289
+ }
290
+
291
+ .tips {
292
+ font-size: 16px;
293
+ color: #54698c;
294
+ }
295
+ }
296
+ }
297
+
298
+ .copyBtn {
299
+ width: fit-content;
300
+ display: flex;
301
+ gap: 10px;
302
+ margin-left: auto;
303
+ margin-top: 10px;
304
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare type Props = {
3
+ onOk: () => void;
4
+ };
5
+ export default function NoMicrophoneModalContent({ onOk }: Props): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { Button } from '@douyinfe/semi-ui';
3
+ import styles from "./index.module.scss";
4
+ import { IconClose, IconMicrophoneOffStroked } from '@douyinfe/semi-icons';
5
+ export default function NoMicrophoneModalContent(_ref) {
6
+ var onOk = _ref.onOk;
7
+ return /*#__PURE__*/React.createElement("div", {
8
+ className: styles.root
9
+ }, /*#__PURE__*/React.createElement("div", {
10
+ className: styles.title
11
+ }, /*#__PURE__*/React.createElement("span", null, "\u5C1A\u672A\u83B7\u5F97\u9EA6\u514B\u98CE\u6743\u9650"), /*#__PURE__*/React.createElement(Button, {
12
+ theme: "borderless",
13
+ size: "small",
14
+ icon: /*#__PURE__*/React.createElement(IconClose, null),
15
+ onClick: onOk
16
+ })), /*#__PURE__*/React.createElement("div", {
17
+ className: styles.desc
18
+ }, "\u8BED\u97F3\u901A\u8BDD\u9700\u8981\u5F00\u542F\u6D4F\u89C8\u5668\u7684\u9EA6\u514B\u98CE\u6743\u9650\uFF0C\u8BF7\u70B9\u51FB\u524D\u5F80\u8BBE\u7F6E\u8FDB\u884C\u5F00\u542F"), /*#__PURE__*/React.createElement("div", {
19
+ className: styles.imgArea
20
+ }, /*#__PURE__*/React.createElement(IconMicrophoneOffStroked, {
21
+ style: {
22
+ fontSize: 40,
23
+ color: '#1478ddff'
24
+ }
25
+ })), /*#__PURE__*/React.createElement("div", {
26
+ className: styles.footer
27
+ }, /*#__PURE__*/React.createElement(Button, {
28
+ type: "primary",
29
+ size: "small",
30
+ style: {
31
+ borderRadius: '24px',
32
+ padding: '10px'
33
+ },
34
+ onClick: onOk
35
+ }, "\u6211\u77E5\u9053\u4E86")));
36
+ }
@@ -0,0 +1,42 @@
1
+ .root {
2
+ width: 240px;
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 12px;
6
+ }
7
+ .title {
8
+ font-size: 15px;
9
+ font-weight: 600;
10
+ color: #1f2d3d;
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: space-between;
14
+ }
15
+ .desc {
16
+ width: 240px;
17
+ font-size: 12px;
18
+ color: rgba(31, 45, 61, 0.55);
19
+ }
20
+ .imgArea {
21
+ height: 100px;
22
+ border-radius: 12px;
23
+ background: linear-gradient(90deg, #e9f0ff 0%, #d7f1ff 100%);
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ }
28
+ .micIcon {
29
+ width: 56px;
30
+ height: 56px;
31
+ display: block;
32
+ }
33
+ .footer {
34
+ display: flex;
35
+ width: 100%;
36
+ justify-content: flex-end;
37
+ }
38
+ .okBtn {
39
+ height: 32px;
40
+ padding: 0 18px;
41
+ border-radius: 16px;
42
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ prologue: string;
4
+ questionList: any[];
5
+ setInputValue: (value: string) => void;
6
+ }
7
+ declare const PresetAgentContent: React.FC<IProps>;
8
+ export default PresetAgentContent;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import styles from "./index.module.scss";
3
+ var PresetAgentContent = function PresetAgentContent(_ref) {
4
+ var prologue = _ref.prologue,
5
+ questionList = _ref.questionList,
6
+ setInputValue = _ref.setInputValue;
7
+ if (!questionList || questionList.length === 0) return null;
8
+ return /*#__PURE__*/React.createElement("div", {
9
+ className: styles.container
10
+ }, prologue && /*#__PURE__*/React.createElement("div", {
11
+ className: styles.prologue
12
+ }, prologue), /*#__PURE__*/React.createElement("div", {
13
+ className: styles.quickInputList
14
+ }, questionList.map(function (item, index) {
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ className: styles.quickInputItem,
17
+ key: index,
18
+ onClick: function onClick() {
19
+ return setInputValue(item.question);
20
+ }
21
+ }, item.question);
22
+ })));
23
+ };
24
+ export default PresetAgentContent;
@@ -0,0 +1,48 @@
1
+ .container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: start;
5
+ padding: 14px 0px 20px 16px;
6
+ width: 100%;
7
+
8
+ .prologue {
9
+ font-family: PingFang SC;
10
+ font-weight: 400;
11
+ font-size: 16px;
12
+ line-height: 28px;
13
+ letter-spacing: 0px;
14
+ color: rgba(46, 57, 76, 1);
15
+ }
16
+
17
+ .quickInputList {
18
+ width: 314px;
19
+ display: flex;
20
+ flex-direction: column;
21
+ gap: 10px;
22
+ flex-wrap: wrap;
23
+ margin-top: 10px;
24
+
25
+ .quickInputItem {
26
+ width: fit-content;
27
+ max-width: 314px;
28
+ padding: 5px 10px;
29
+ font-family: PingFangSC;
30
+ font-weight: 400;
31
+ font-size: 14px;
32
+ color: rgba(46, 57, 76, 1);
33
+ line-height: 18px;
34
+ text-align: left;
35
+ font-style: normal;
36
+ border-radius: 8px;
37
+ border: 1px solid rgba(217, 220, 229, 1);
38
+ flex-shrink: 0;
39
+ white-space: nowrap;
40
+ /* 禁止换行 */
41
+ overflow: hidden;
42
+ /* 隐藏溢出内容 */
43
+ text-overflow: ellipsis;
44
+ /* 显示省略号 */
45
+ cursor: pointer;
46
+ }
47
+ }
48
+ }
File without changes
@@ -0,0 +1,171 @@
1
+ // import { Input, message, Table } from 'antd';
2
+ // import styles from './index.module.scss';
3
+ // import { useEffect, useRef, useState } from 'react';
4
+ // import IconFontCom from '@/components/iconfont-com';
5
+ // import { knowledgeConstants } from '../../constants';
6
+ // import useQuotedService from '../../hooks/useQuoted';
7
+ // import { useDispatch, useSelector } from 'react-redux';
8
+ // import type { RootState } from '@/module';
9
+ // import { throttle } from 'lodash';
10
+
11
+ // const DEBOUNCE_MS = 600; // 拉长到 600 ms
12
+
13
+ // const tabList: any[] = [
14
+ // { key: 'video', displayName: '视频' },
15
+ // // { key: 'course', displayName: '课程' },
16
+ // ];
17
+
18
+ // interface Iprops {
19
+ // close: () => void;
20
+ // }
21
+
22
+ // export const QuotedContent: React.FC<Iprops> = ({ close }) => {
23
+ // const [activeKey, setActiveKey] = useState('video');
24
+ // const [searchValue, setSearchValue] = useState({ pageSize: 20, pageIndex: 1, inputValue: '' });
25
+ // const [inputValue, setInputValue] = useState('');
26
+ // const inputRef = useRef<any>(null);
27
+ // const timeoutRef = useRef<NodeJS.Timeout | null>(null);
28
+ // const composingRef = useRef(false); // 标记是否正在拼写中文
29
+ // const tabContentRef = useRef<HTMLDivElement>(null);
30
+ // const gimiMenu = useSelector((state: RootState) => state.gimiMenu);
31
+ // const dispatch = useDispatch();
32
+ // const { resource, isLoading, totalPage } = useQuotedService({ props: { type: activeKey, searchValue } });
33
+
34
+ // const columns = [
35
+ // {
36
+ // title: '名称',
37
+ // dataIndex: 'name',
38
+ // key: 'name',
39
+ // render: (text: string) => {
40
+ // return (
41
+ // <span className={styles.listItem}>
42
+ // <img alt="资料引用图片" className={styles.img} src={activeKey === 'video' ? knowledgeConstants.VIDEO_ICON_ADDRESS : knowledgeConstants.CLASS_ICON_BIG_ADDRESS} />
43
+ // {text}
44
+ // </span>
45
+ // );
46
+ // },
47
+ // },
48
+ // ];
49
+
50
+ // const handleTabChange = (key: string) => {
51
+ // if (activeKey === key) return;
52
+ // setActiveKey(key);
53
+ // setSearchValue({ pageSize: 20, pageIndex: 1, inputValue: inputValue });
54
+ // //滚动条置顶
55
+ // tabContentRef.current.scrollTop = 0;
56
+ // };
57
+
58
+ // // 触发搜索的函数
59
+ // const doSearch = (val: string) => {
60
+ // setSearchValue({ pageSize: 20, pageIndex: 1, inputValue: val });
61
+ // };
62
+
63
+ // // 中文输入开始
64
+ // const handleCompositionStart = () => {
65
+ // composingRef.current = true;
66
+ // };
67
+
68
+ // // 中文输入结束
69
+ // const handleCompositionEnd = (e: React.CompositionEvent<HTMLInputElement>) => {
70
+ // composingRef.current = false;
71
+ // const val = e.currentTarget.value;
72
+ // setInputValue(val);
73
+ // // 拼完中文再“延迟”一次,避免和下面的 debounce 冲突
74
+ // if (timeoutRef.current) clearTimeout(timeoutRef.current);
75
+ // timeoutRef.current = setTimeout(() => doSearch(val), DEBOUNCE_MS);
76
+ // };
77
+
78
+ // // 普通输入
79
+ // const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
80
+ // const val = e.target.value;
81
+ // setInputValue(val);
82
+ // if (composingRef.current) return; // 中文拼写过程中不处理
83
+ // if (timeoutRef.current) clearTimeout(timeoutRef.current);
84
+ // timeoutRef.current = setTimeout(() => doSearch(val), DEBOUNCE_MS);
85
+ // };
86
+
87
+ // //抽出共同逻辑
88
+ // const addIfAbsent = (list, key, newItem) => {
89
+ // if (list.some((it) => it[key] === newItem[key])) return;
90
+ // dispatch({
91
+ // type: `gimiMenu/set${key === 'teachModelId' ? 'QuoteTeachModelList' : 'QuoteProductList'}`,
92
+ // payload: { [`quote${key === 'teachModelId' ? 'TeachModel' : 'Product'}List`]: [...list, newItem] },
93
+ // });
94
+ // };
95
+
96
+ // //选择资源
97
+ // const handleSelect = (record: any) => {
98
+ // //总条数需小于等于十
99
+ // if (gimiMenu.quoteTeachModelList.length + gimiMenu.quoteProductList.length >= 10) {
100
+ // message.warning('最多添加10个资源');
101
+ // return;
102
+ // }
103
+ // if (activeKey === 'video') {
104
+ // addIfAbsent(gimiMenu.quoteTeachModelList, 'teachModelId', { teachModelId: record.id, teachModelName: record.name, duration: record.duration });
105
+ // } else {
106
+ // addIfAbsent(gimiMenu.quoteProductList, 'productId', { productId: record.productId, productName: record.productName });
107
+ // }
108
+ // close();
109
+ // };
110
+
111
+ // useEffect(() => {
112
+ // const formCard = tabContentRef.current;
113
+ // if (!formCard) return;
114
+ // //增加throttle
115
+ // const handleScroll = throttle(() => {
116
+ // const { scrollTop, scrollHeight, clientHeight } = formCard;
117
+ // const isNearBottom = scrollHeight - scrollTop - clientHeight < 2;
118
+ // if (searchValue.pageIndex < totalPage && isNearBottom) {
119
+ // setSearchValue((prev) => ({
120
+ // ...prev,
121
+ // pageIndex: prev.pageIndex ? prev.pageIndex + 1 : 1,
122
+ // }));
123
+ // }
124
+ // }, 100);
125
+ // formCard.addEventListener('scroll', handleScroll);
126
+
127
+ // return () => formCard.removeEventListener('scroll', handleScroll);
128
+ // }, [totalPage, activeKey, searchValue]);
129
+
130
+ // return (
131
+ // <div className={styles.quotedContent}>
132
+ // <Input
133
+ // value={inputValue}
134
+ // allowClear
135
+ // className={styles.searchInput}
136
+ // ref={inputRef}
137
+ // prefix={<IconFontCom type="icon-search1" color="#7D91B3" size={16} />}
138
+ // onChange={handleChange}
139
+ // onCompositionStart={handleCompositionStart}
140
+ // onCompositionEnd={handleCompositionEnd}
141
+ // placeholder="搜索"
142
+ // />
143
+ // <div className={styles.content}>
144
+ // <div className={styles.newtab}>
145
+ // {tabList.map((tab) => {
146
+ // return (
147
+ // <span className={`${styles.tabItem} ${tab.key === activeKey ? styles.active : ''}`} key={tab.key} onClick={() => handleTabChange(tab.key)}>
148
+ // {tab.displayName}
149
+ // </span>
150
+ // );
151
+ // })}
152
+ // </div>
153
+ // <div className={styles.tabContent} ref={tabContentRef}>
154
+ // <Table
155
+ // dataSource={resource}
156
+ // showHeader={false}
157
+ // size="small"
158
+ // columns={columns}
159
+ // pagination={false}
160
+ // className={styles.table}
161
+ // key="id"
162
+ // loading={isLoading}
163
+ // onRow={(record: any) => {
164
+ // return { onClick: () => handleSelect(record) };
165
+ // }}
166
+ // />
167
+ // </div>
168
+ // </div>
169
+ // </div>
170
+ // );
171
+ // };