@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,262 @@
1
+ // Variables
2
+ $font-family: 'PingFang SC';
3
+
4
+ // Mixins
5
+ @mixin text-ellipsis($lines: 2) {
6
+ text-overflow: ellipsis;
7
+ display: -webkit-box;
8
+ -webkit-line-clamp: $lines;
9
+ -webkit-box-orient: vertical;
10
+ overflow: hidden;
11
+ }
12
+
13
+ @mixin tag-badge-base {
14
+ font-family: $font-family;
15
+ font-weight: 600;
16
+ font-size: 10px;
17
+ line-height: 18px;
18
+ letter-spacing: 0px;
19
+ text-align: center;
20
+ width: 48px;
21
+ height: 18px;
22
+ border-radius: 4px;
23
+ float: left;
24
+ margin-right: 5px;
25
+ }
26
+
27
+ .wisdom_layout {
28
+ position: absolute;
29
+ right: 0;
30
+ z-index: 3;
31
+ height: calc(100vh - 70px) !important;
32
+ box-shadow: -1px 0 10px 0 rgba(233, 235, 242, 1);
33
+ }
34
+
35
+ .tabs {
36
+ .tab_content {
37
+
38
+ /**重写tab样式 start*/
39
+ :global(.ant-tabs-nav::before) {
40
+ border-bottom: none !important;
41
+ }
42
+
43
+ :global(.ant-tabs-ink-bar) {
44
+ display: none !important;
45
+ }
46
+
47
+ :global(.ant-tabs-tab) {
48
+ margin: 0;
49
+ padding: 5px 10px;
50
+ border-radius: 8px;
51
+ }
52
+
53
+ :global(.ant-tabs-tab-active) {
54
+ background-color: #F1F7FF;
55
+ text-decoration: none;
56
+ }
57
+
58
+ :global(.ant-tabs-nav) {
59
+ margin: 0;
60
+ }
61
+
62
+ :global(.ant-tabs-content-holder) {
63
+ flex: 1;
64
+ display: flex;
65
+ }
66
+
67
+ :global(.ant-tabs-content) {
68
+ flex: 1;
69
+ display: flex;
70
+ }
71
+
72
+ :global(.ant-tabs-tabpane) {
73
+ margin-top: 10px;
74
+ flex: 1;
75
+ width: 100%;
76
+ overflow-y: auto;
77
+ overflow-x: hidden;
78
+ }
79
+
80
+ /**重写tab样式 end*/
81
+ }
82
+ }
83
+
84
+ .closed {
85
+ display: none;
86
+ }
87
+
88
+ .knowledgeList {
89
+ display: flex;
90
+ flex-direction: column;
91
+ gap: 10px;
92
+ padding-bottom: 10px;
93
+
94
+ .total {
95
+ font-family: $font-family;
96
+ font-weight: 400;
97
+ font-size: 14px;
98
+ line-height: 150%;
99
+ letter-spacing: 0px;
100
+ color: #4c5a70;
101
+ }
102
+
103
+ .resource_deactive {
104
+ cursor: not-allowed !important;
105
+
106
+ &::after {
107
+ content: "";
108
+ position: absolute;
109
+ inset: 0;
110
+ background: rgba(255, 255, 255, 0.5);
111
+ border-radius: 12px;
112
+ pointer-events: none;
113
+ z-index: 2;
114
+ }
115
+ }
116
+
117
+ .knowledge {
118
+ background-color: #f7f8fa;
119
+ border-radius: 12px;
120
+ display: flex;
121
+ align-items: center;
122
+ gap: 10px;
123
+ padding: 10px;
124
+ position: relative;
125
+
126
+ &:hover {
127
+ cursor: pointer;
128
+ }
129
+
130
+ .img {
131
+ height: 36px;
132
+ width: 36px;
133
+ }
134
+
135
+ .class_img {
136
+ width: 90px;
137
+ height: 50px;
138
+ border-radius: 8px;
139
+ }
140
+
141
+ .class_img_play {
142
+ position: absolute;
143
+ left: 24px;
144
+ top: 3px;
145
+ width: 45px;
146
+ height: 45px;
147
+ }
148
+
149
+ .knowledge_trace_deactive {
150
+ position: relative;
151
+ font-family: $font-family;
152
+ font-weight: 500;
153
+ font-size: 12px;
154
+ color: rgba(76, 90, 112, 1);
155
+ z-index: 3;
156
+ }
157
+
158
+ .description {
159
+ display: flex;
160
+ flex-direction: column;
161
+ gap: 5px;
162
+
163
+ .text {
164
+ @include text-ellipsis(2);
165
+ width: 200px;
166
+ font-family: $font-family;
167
+ font-weight: 500;
168
+ font-size: 14px;
169
+ line-height: 150%;
170
+ letter-spacing: 0px;
171
+ color: #2e394c;
172
+ }
173
+
174
+ .timeTrace {
175
+ @include text-ellipsis(2);
176
+ color: #717f94;
177
+ width: 200px;
178
+ font-family: $font-family;
179
+ font-weight: 400;
180
+ font-style: Regular;
181
+ font-size: 12px;
182
+ line-height: 150%;
183
+ letter-spacing: 0px;
184
+ }
185
+ }
186
+
187
+ .class_description {
188
+ position: relative;
189
+
190
+ .tag_badge_green {
191
+ @include tag-badge-base;
192
+ background-color: #ccffe5;
193
+ color: #3d996b;
194
+ }
195
+
196
+ .tag_badge_warning {
197
+ @include tag-badge-base;
198
+ background-color: #ffecd9;
199
+ color: #e58845;
200
+ }
201
+
202
+ .tag_badge_default {
203
+ @include tag-badge-base;
204
+ background-color: #7d91b3;
205
+ color: #ffffff;
206
+ }
207
+
208
+ .text {
209
+ @include text-ellipsis(2);
210
+ width: 150px;
211
+ max-height: 63px;
212
+ overflow: hidden;
213
+ font-family: $font-family;
214
+ font-weight: 500;
215
+ font-size: 14px;
216
+ line-height: 150%;
217
+ letter-spacing: 0px;
218
+ color: #2e394c;
219
+ }
220
+
221
+ .timeTrace {
222
+ @include text-ellipsis(2);
223
+ color: #717f94;
224
+ width: 150px;
225
+ font-family: $font-family;
226
+ font-weight: 400;
227
+ font-size: 12px;
228
+ line-height: 150%;
229
+ letter-spacing: 0px;
230
+ }
231
+ }
232
+ }
233
+
234
+ .active {
235
+ border: 1px solid #0073e6;
236
+ }
237
+ }
238
+
239
+ .icon_btn {
240
+ width: fit-content;
241
+ height: 22px;
242
+ font-size: 12px;
243
+ padding: 0px 5px;
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: center;
247
+ border-radius: 4px;
248
+ gap: 5px;
249
+ border: 0;
250
+ background-color: #f1f7ff;
251
+
252
+ &:hover {
253
+ cursor: pointer;
254
+ background-color: #FFFFFF;
255
+ color: #4086FF;
256
+ }
257
+ }
258
+
259
+ .icon_btn_active {
260
+ background-color: #4086ff;
261
+ color: #ffffff;
262
+ }
@@ -0,0 +1,166 @@
1
+ /**
2
+ * 产品信息接口
3
+ */
4
+ export interface IProduct {
5
+ /** 产品ID(必选) */
6
+ id: number;
7
+ /** 产品名称(必选) */
8
+ name: string;
9
+ /** 产品包别名(可选) */
10
+ nickName?: string;
11
+ /**
12
+ * 产品类型(必选)
13
+ * - single: 单个产品
14
+ * - resource: 资源产品包
15
+ * - vip: 会员产品包
16
+ */
17
+ productType: 'single' | 'product';
18
+ /** 产品封面URL(可选) */
19
+ productUrl?: string;
20
+ /** 产品封面Token(可选) */
21
+ productToken?: string;
22
+ /** 产品介绍(可选) */
23
+ intro?: string;
24
+ /** 产品详细介绍(可选) */
25
+ details?: string;
26
+ /** 产品分类ID(可选) */
27
+ categoryId?: number;
28
+ /** 产品分类名称(可选) */
29
+ categoryName?: string;
30
+ /** 课程模块数(可选,注意:字段类型为String,按原始定义保留) */
31
+ courseNum?: string;
32
+ /** 教学模块数(可选,注意:字段类型为String,按原始定义保留) */
33
+ modelNum?: string;
34
+ /**
35
+ * 是否发布(必选)
36
+ * - 1: 是
37
+ * - 0: 否
38
+ */
39
+ state: 1 | 0;
40
+ /**
41
+ * 是否公开(必选,推测值为 1:是 / 0:否,与state保持一致格式)
42
+ */
43
+ publiced: 1 | 0;
44
+ /** 更新时间(可选,格式建议为 ISO 8601 字符串,如:2025-11-10T10:00:00Z) */
45
+ updatedAt?: string;
46
+ /** 机构ID(可选) */
47
+ agencyId?: number;
48
+ /** 系列ID(可选) */
49
+ seriesId?: number;
50
+ /** 系列名称(可选) */
51
+ seriesName?: string;
52
+ /**
53
+ * 产品资源类型(可选)
54
+ * - course: 课程
55
+ * - special: 专题
56
+ */
57
+ resourceType?: 'course' | 'special';
58
+ /** 授课形式(可选) */
59
+ teachingType?: string;
60
+ /** 标签(可选,若为多个标签建议改为 string[],此处按原始定义保留) */
61
+ label?: string;
62
+ /** 权益标签(可选,若为多个标签建议改为 string[],此处按原始定义保留) */
63
+ equityLabel?: string;
64
+ /** 权益类型名称列表(可选) */
65
+ benefitTypeNames?: string[];
66
+ /**
67
+ * 展示样式(可选)
68
+ * - 0: 不展示
69
+ * - 1: 免费畅看
70
+ * - 2: 计次计费单课
71
+ * - 3: 暂无权益
72
+ */
73
+ showStyle?: 0 | 1 | 2 | 3;
74
+ /**
75
+ * 是否过期(可选,推测值为 1:是 / 0:否,与state保持一致格式)
76
+ */
77
+ isExpired?: 1 | 0;
78
+ /**
79
+ * 是否被选中(可选)
80
+ * - 1: 是
81
+ * - 0: 否
82
+ */
83
+ isChecked?: 1 | 0;
84
+ /** 课堂ID(必选,关联所属课堂) */
85
+ gradeId: number;
86
+ isJoinClass: number;
87
+ isDelete: number;
88
+ isActive?: boolean;
89
+ }
90
+ /**
91
+ * 教学模块资源信息接口
92
+ */
93
+ export interface ITeachingModuleResource {
94
+ /** 教学模块ID(可选,允许为null) */
95
+ id?: number | null;
96
+ /** 教学模块名称(可选,允许为null) */
97
+ name?: string | null;
98
+ /** 资源类型(必选) */
99
+ teachingModuleType: string;
100
+ /** 资源ID(必选) */
101
+ hostId: number;
102
+ /** 资源访问Token(必选) */
103
+ fileToken: string;
104
+ /** 视频类型(如mp4、avi等,必选) */
105
+ suffix: string;
106
+ /** 资源URL地址(必选) */
107
+ url: string;
108
+ /** 资源来源(必选,如:upload-用户上传、system-系统内置等) */
109
+ origin: string;
110
+ /** 资源大小(单位:字节,必选,对应后端Long类型,前端用number兼容) */
111
+ size: number;
112
+ /** 资料大小(已做单位转换,如:10MB、200KB等,必选) */
113
+ sizeUnit: string;
114
+ /** 课程模块ID(必选) */
115
+ courseId: number;
116
+ /** 阶段ID(必选,如课程的章节/阶段划分) */
117
+ phaseId: number;
118
+ /** 产品ID(必选,关联所属产品) */
119
+ productId: number;
120
+ /**
121
+ * 产品类型(必选)
122
+ * - single: 单个产品
123
+ * - resource: 资源产品包
124
+ * - vip: 会员产品包
125
+ */
126
+ productType: 'single' | 'product';
127
+ /** 课堂ID(必选,关联所属课堂) */
128
+ gradeId: number;
129
+ /**是否加入班级,1:是;0:否 */
130
+ isJoinClass: number;
131
+ isDelete: number;
132
+ isActive?: boolean;
133
+ }
134
+ export interface IVideoResource {
135
+ id?: number;
136
+ name?: string;
137
+ teachingModuleType: string;
138
+ hostId: number;
139
+ duration: number;
140
+ fileToken: string;
141
+ suffix: string;
142
+ url: string;
143
+ origin: string;
144
+ size: number;
145
+ durationToHms: string;
146
+ durationSecond: number;
147
+ sizeUnit: string;
148
+ coverUrl: string;
149
+ startedAt?: string;
150
+ endedAt?: string;
151
+ startedAtSecond?: string;
152
+ courseId: number;
153
+ phaseId: number;
154
+ productId: number;
155
+ gradeId: number;
156
+ isJoinClass: number;
157
+ isDelete: number;
158
+ sliceId: string;
159
+ /**
160
+ * 产品类型(必选)
161
+ * - single: 单个产品
162
+ * - resource: 资源产品包
163
+ * - vip: 会员产品包
164
+ */
165
+ productType: 'single' | 'product';
166
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { IVideoResource } from './interfaces';
3
+ declare const VideoList: React.FC<{
4
+ list: IVideoResource[];
5
+ }>;
6
+ export default VideoList;
@@ -0,0 +1,91 @@
1
+ import React from 'react';
2
+ import styles from "./index.module.scss";
3
+ import classNames from 'classnames';
4
+ import { knowledgeConstants } from "../../constants";
5
+ import { Toast, Tooltip } from '@douyinfe/semi-ui';
6
+ import { useAppSelector, useAppDispatch } from "../../store/hooks";
7
+ var VideoItem = function VideoItem(_ref) {
8
+ var _konwledgeTraceState$;
9
+ var item = _ref.item;
10
+ var konwledgeTraceState = useAppSelector(function (state) {
11
+ return state.gimiMenu.konwledgeTraceState;
12
+ });
13
+ var platform = useAppSelector(function (state) {
14
+ return state.gimiMenu.platform;
15
+ });
16
+ var isActive = (_konwledgeTraceState$ = konwledgeTraceState.resources) === null || _konwledgeTraceState$ === void 0 || (_konwledgeTraceState$ = _konwledgeTraceState$.map(function (item) {
17
+ return item.id;
18
+ })) === null || _konwledgeTraceState$ === void 0 ? void 0 : _konwledgeTraceState$.includes("".concat(item.sliceId));
19
+ var _useAppSelector = useAppSelector(function (state) {
20
+ return state.gimiMenu.bussinessParams;
21
+ }),
22
+ gradeId = _useAppSelector.gradeId,
23
+ teachModuleId = _useAppSelector.teachModuleId;
24
+ var dispatch = useAppDispatch();
25
+ var handleClick = function handleClick() {
26
+ if (item.isDelete === 1) return;
27
+ if (platform !== 'myun') return Toast.warning('当前平台不支持溯源跳转');
28
+ var searchParams = "gradeId=".concat(item.gradeId, "&teachModuleId=").concat(item.id, "&outlineId=").concat(item.courseId, "&phaseId=").concat(item.phaseId);
29
+ if (item.isJoinClass) {
30
+ // 如果溯源就是当前视频,直接跳转到溯源的进度
31
+ if (gradeId === item.gradeId && teachModuleId === item.id) {
32
+ dispatch({
33
+ type: 'smartClassState/setTimeFromSider',
34
+ payload: {
35
+ timeFromSider: item.startedAtSecond
36
+ }
37
+ });
38
+ } else {
39
+ // 如果不是当前视频,新开一个学习页面
40
+ window.open("/learningPage?".concat(searchParams, "&startedAt=").concat(item.startedAtSecond));
41
+ }
42
+ } else {
43
+ if (item.productType === 'single') {
44
+ window.open("/new-product/".concat(item.productId, "?").concat(searchParams));
45
+ } else {
46
+ window.open("/project-product/".concat(item.productId, "?").concat(searchParams));
47
+ }
48
+ }
49
+ };
50
+ return /*#__PURE__*/React.createElement("div", {
51
+ className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
52
+ onClick: handleClick
53
+ }, /*#__PURE__*/React.createElement("div", {
54
+ style: {
55
+ position: 'relative'
56
+ }
57
+ }, /*#__PURE__*/React.createElement("img", {
58
+ alt: "\u89C6\u9891\u5C01\u9762\u56FE\u7247",
59
+ className: styles.class_img,
60
+ src: item.coverUrl || knowledgeConstants.VIDEO_DEFAULT_COVER_ADDRESS
61
+ }), /*#__PURE__*/React.createElement("img", {
62
+ alt: "\u64AD\u653E\u6309\u94AE\u56FE\u7247",
63
+ className: styles.class_img_play,
64
+ src: knowledgeConstants.VIDEO_PLAY_ICON_ADDRESS
65
+ })), /*#__PURE__*/React.createElement("div", {
66
+ className: styles.class_description
67
+ }, /*#__PURE__*/React.createElement(Tooltip, {
68
+ placement: "topLeft",
69
+ content: item.name
70
+ }, /*#__PURE__*/React.createElement("div", {
71
+ className: styles.text
72
+ }, item.name)), /*#__PURE__*/React.createElement("div", {
73
+ className: styles.timeTrace
74
+ }, "\u89C6\u9891\u7247\u6BB5: ".concat(item.startedAt || "0'0\"", " - ").concat(item.endedAt || "0'0\"")), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
75
+ className: styles.knowledge_trace_deactive
76
+ }, "\u89C6\u9891\u5931\u6548")));
77
+ };
78
+ var VideoList = function VideoList(_ref2) {
79
+ var list = _ref2.list;
80
+ return /*#__PURE__*/React.createElement("div", {
81
+ className: styles.knowledgeList
82
+ }, /*#__PURE__*/React.createElement("span", {
83
+ className: styles.total
84
+ }, "\u672C\u5BF9\u8BDD\u5171".concat((list === null || list === void 0 ? void 0 : list.length) || 0, "\u4E2A\u89C6\u9891")), list.map(function (item) {
85
+ return /*#__PURE__*/React.createElement(VideoItem, {
86
+ item: item,
87
+ key: item.id
88
+ });
89
+ }));
90
+ };
91
+ export default VideoList;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ILottieImg {
3
+ name: string;
4
+ size?: number[] | number | string[] | string;
5
+ style?: React.CSSProperties;
6
+ }
7
+ declare const LottieImg: React.FC<ILottieImg>;
8
+ export default LottieImg;
@@ -0,0 +1,99 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { Lottie } from '@douyinfe/semi-ui';
8
+ import * as live from "../../assets/lottie/living.json";
9
+ import * as aiBg from "../../assets/lottie/ai-bg.json";
10
+ import * as aiLoading from "../../assets/lottie/ai-loading.json";
11
+ import * as aiOutputNormal from "../../assets/lottie/ai-output-normal.json";
12
+ import * as aiOutputStrengthen from "../../assets/lottie/ai-output-strengthen.json";
13
+ import * as aiOutputLoading from "../../assets/lottie/ai-output-loading.json";
14
+ import * as aiVoicePlay from "../../assets/lottie/ai-voice-play.json";
15
+ import React from 'react';
16
+ var names = [{
17
+ name: 'live',
18
+ value: live
19
+ }, {
20
+ name: 'aiBg',
21
+ value: aiBg
22
+ }, {
23
+ name: 'aiLoading',
24
+ value: aiLoading
25
+ }, {
26
+ name: 'aiOutputNormal',
27
+ value: aiOutputNormal
28
+ }, {
29
+ name: 'aiOutputStrengthen',
30
+ value: aiOutputStrengthen
31
+ }, {
32
+ name: 'aiOutputLoading',
33
+ value: aiOutputLoading
34
+ }, {
35
+ name: 'aiVoicePlay',
36
+ value: aiVoicePlay
37
+ }];
38
+ var formatSize = function formatSize(size) {
39
+ if (Array.isArray(size)) {
40
+ if (typeof size[0] === 'number') {
41
+ return {
42
+ height: "".concat(size[0], "px"),
43
+ width: "".concat(size[1], "px")
44
+ };
45
+ }
46
+ return {
47
+ height: size[0],
48
+ width: size[1]
49
+ };
50
+ }
51
+ if (typeof size === 'number') {
52
+ return {
53
+ height: "".concat(size, "px"),
54
+ width: "".concat(size, "px")
55
+ };
56
+ }
57
+ return {
58
+ height: size,
59
+ width: size
60
+ };
61
+ };
62
+ var LottieImg = function LottieImg(_ref) {
63
+ var name = _ref.name,
64
+ _ref$size = _ref.size,
65
+ size = _ref$size === void 0 ? 12 : _ref$size,
66
+ _ref$style = _ref.style,
67
+ style = _ref$style === void 0 ? {} : _ref$style;
68
+ var _formatSize = formatSize(size),
69
+ height = _formatSize.height,
70
+ width = _formatSize.width;
71
+ var defaultOptions = {
72
+ loop: true,
73
+ autoplay: true,
74
+ isClickToPauseDisabled: true,
75
+ isPaused: false,
76
+ isStopped: false,
77
+ // @ts-ignore
78
+ animationData: names.find(function (v) {
79
+ return v.name === name;
80
+ }).value.default,
81
+ rendererSettings: {
82
+ preserveAspectRatio: 'xMidYMid slice'
83
+ },
84
+ pathFillColor: '#ff0000',
85
+ pathStrokeColor: '#000000'
86
+ };
87
+ return /*#__PURE__*/React.createElement("div", {
88
+ style: {
89
+ pointerEvents: 'none',
90
+ margin: '0 auto'
91
+ }
92
+ }, /*#__PURE__*/React.createElement(Lottie, {
93
+ params: defaultOptions,
94
+ width: width,
95
+ height: height,
96
+ style: _objectSpread({}, style)
97
+ }));
98
+ };
99
+ export default LottieImg;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { IChatMessageItem } from '../../interfaces/chatMessage';
3
+ declare const CopyButton: React.FC<{
4
+ item: IChatMessageItem;
5
+ onCopyCallback?: () => void;
6
+ }>;
7
+ export default CopyButton;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { Tooltip } from '@douyinfe/semi-ui';
3
+ import { usePureChatActions } from "../../hooks/useChatActions";
4
+ import copyIcon from "../../assets/image/copyIcon.png";
5
+ var CopyButton = function CopyButton(_ref) {
6
+ var item = _ref.item,
7
+ onCopyCallback = _ref.onCopyCallback;
8
+ var _usePureChatActions = usePureChatActions(),
9
+ copyToClipboard = _usePureChatActions.copyToClipboard;
10
+ return /*#__PURE__*/React.createElement(Tooltip, {
11
+ content: "\u590D\u5236"
12
+ }, /*#__PURE__*/React.createElement("div", {
13
+ style: {
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ justifyContent: 'center',
17
+ cursor: 'pointer'
18
+ }
19
+ }, /*#__PURE__*/React.createElement("img", {
20
+ width: 18,
21
+ height: 18,
22
+ style: {
23
+ display: 'flex',
24
+ alignItems: 'center'
25
+ },
26
+ src: copyIcon,
27
+ onClick: function onClick() {
28
+ copyToClipboard(item);
29
+ onCopyCallback === null || onCopyCallback === void 0 || onCopyCallback();
30
+ }
31
+ })));
32
+ };
33
+ export default CopyButton;
@@ -0,0 +1,7 @@
1
+ import { IChatMessageItem } from '../../interfaces/chatMessage';
2
+ import React from 'react';
3
+ declare const LikeButton: React.FC<{
4
+ item: IChatMessageItem;
5
+ onLikeCallback?: () => void;
6
+ }>;
7
+ export default LikeButton;