vue-chat-kit 0.3.10 → 0.3.11

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 (79) hide show
  1. package/dist/vue-chat-kit.css +1 -1
  2. package/dist/vue-chat-kit.es.js +4426 -2819
  3. package/dist/vue-chat-kit.umd.js +1 -1
  4. package/package.json +1 -1
  5. package/src/components/AvatarCrop.vue +16 -127
  6. package/src/components/ChatPanel.vue +491 -2675
  7. package/src/components/EmojiPicker.vue +2 -73
  8. package/src/components/chat/ChatWindow.vue +177 -0
  9. package/src/components/chat/ContentList.vue +300 -0
  10. package/src/components/chat/ContextMenu.vue +32 -0
  11. package/src/components/chat/GroupSidebar.vue +284 -0
  12. package/src/components/chat/MainArea.vue +87 -0
  13. package/src/components/chat/Sidebar.vue +52 -0
  14. package/src/components/chat/dialogs/AddFriendDialog.vue +62 -0
  15. package/src/components/chat/dialogs/CreateGroupDialog.vue +86 -0
  16. package/src/components/chat/dialogs/GroupDetailDialog.vue +132 -0
  17. package/src/components/ui/Button.vue +190 -0
  18. package/src/components/ui/Dialog.vue +194 -0
  19. package/src/components/ui/Empty.vue +66 -0
  20. package/src/components/ui/Input.vue +166 -0
  21. package/src/components/ui/Message.vue +186 -0
  22. package/src/components/ui/MessageBox.vue +143 -0
  23. package/src/components/ui/MessageManager.vue +92 -0
  24. package/src/components/ui/Switch.vue +65 -0
  25. package/src/components/ui/Tag.vue +68 -0
  26. package/src/components/ui/icons/ArrowDown.vue +5 -0
  27. package/src/components/ui/icons/ArrowRight.vue +5 -0
  28. package/src/components/ui/icons/Bell.vue +6 -0
  29. package/src/components/ui/icons/Camera.vue +6 -0
  30. package/src/components/ui/icons/ChatDotRound.vue +5 -0
  31. package/src/components/ui/icons/Check.vue +5 -0
  32. package/src/components/ui/icons/CircleCheck.vue +6 -0
  33. package/src/components/ui/icons/Clock.vue +6 -0
  34. package/src/components/ui/icons/Close.vue +5 -0
  35. package/src/components/ui/icons/Delete.vue +8 -0
  36. package/src/components/ui/icons/Edit.vue +6 -0
  37. package/src/components/ui/icons/Folder.vue +5 -0
  38. package/src/components/ui/icons/Minus.vue +5 -0
  39. package/src/components/ui/icons/Monitor.vue +7 -0
  40. package/src/components/ui/icons/Moon.vue +5 -0
  41. package/src/components/ui/icons/Picture.vue +7 -0
  42. package/src/components/ui/icons/Plus.vue +5 -0
  43. package/src/components/ui/icons/Search.vue +6 -0
  44. package/src/components/ui/icons/Setting.vue +6 -0
  45. package/src/components/ui/icons/Sunny.vue +6 -0
  46. package/src/components/ui/icons/User.vue +6 -0
  47. package/src/components/ui/icons/UserFilled.vue +6 -0
  48. package/src/components/ui/icons/Warning.vue +5 -0
  49. package/src/components/ui/icons/index.js +24 -0
  50. package/src/components/ui/index.js +10 -0
  51. package/src/composables/useFriendChat.js +10 -14
  52. package/src/composables/useGroupChat.js +140 -48
  53. package/src/composables/useMessage.js +21 -0
  54. package/src/composables/useMessageBox.js +98 -0
  55. package/src/composables/useTheme.js +140 -0
  56. package/src/config/index.js +1 -0
  57. package/src/const/index.js +1 -0
  58. package/src/const/theme.js +19 -0
  59. package/src/core/api.js +13 -2
  60. package/src/index.js +5 -5
  61. package/src/styles/_base.scss +38 -0
  62. package/src/styles/_variables.scss +43 -0
  63. package/src/styles/components/_add-friend-dialog.scss +45 -0
  64. package/src/styles/components/_avatar-crop.scss +120 -0
  65. package/src/styles/components/_chat-panel.scss +546 -0
  66. package/src/styles/components/_chat-window.scss +239 -0
  67. package/src/styles/components/_content-list.scss +260 -0
  68. package/src/styles/components/_context-menu.scss +35 -0
  69. package/src/styles/components/_create-group-dialog.scss +78 -0
  70. package/src/styles/components/_dialogs.scss +226 -0
  71. package/src/styles/components/_emoji-picker.scss +74 -0
  72. package/src/styles/components/_group-detail-dialog.scss +110 -0
  73. package/src/styles/components/_group-sidebar.scss +278 -0
  74. package/src/styles/components/_main-area.scss +94 -0
  75. package/src/styles/components/_sidebar.scss +83 -0
  76. package/src/styles/index.scss +18 -0
  77. package/src/styles/themes/_dark.scss +68 -0
  78. package/src/styles/themes/_index.scss +7 -0
  79. package/src/styles/themes/_light.scss +69 -0
@@ -0,0 +1,546 @@
1
+ // ==========================================
2
+ // ChatPanel 组件样式
3
+ // ==========================================
4
+
5
+ .chat-panel {
6
+ position: relative;
7
+ display: flex;
8
+ height: 680px;
9
+ background: var(--vck-bg);
10
+ overflow: hidden;
11
+ border-radius: var(--vck-radius-xl);
12
+ box-shadow: var(--vck-shadow);
13
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
14
+ transition: var(--vck-transition);
15
+ }
16
+
17
+ // 输入区域额外样式
18
+ .pending-files-area {
19
+ padding: var(--vck-space-sm) var(--vck-space);
20
+ border-bottom: 1px solid var(--vck-border-light);
21
+ display: flex;
22
+ flex-wrap: wrap;
23
+ gap: var(--vck-space-sm);
24
+ }
25
+
26
+ .pending-file-item {
27
+ position: relative;
28
+ }
29
+
30
+ .pending-image-wrapper {
31
+ position: relative;
32
+ width: 80px;
33
+ height: 80px;
34
+ border-radius: var(--vck-radius);
35
+ overflow: hidden;
36
+ border: 1px solid var(--vck-border);
37
+ }
38
+
39
+ .pending-image {
40
+ width: 100%;
41
+ height: 100%;
42
+ object-fit: cover;
43
+ }
44
+
45
+ .pending-file-wrapper {
46
+ position: relative;
47
+ width: 96px;
48
+ height: 80px;
49
+ border-radius: var(--vck-radius);
50
+ border: 1px solid var(--vck-border);
51
+ background-color: var(--vck-bg-panel);
52
+ display: flex;
53
+ flex-direction: column;
54
+ align-items: center;
55
+ justify-content: center;
56
+ padding: var(--vck-space-xs);
57
+ }
58
+
59
+ .pending-file-icon {
60
+ color: var(--vck-text-muted);
61
+ font-size: 28px;
62
+ margin-bottom: var(--vck-space-xs);
63
+ }
64
+
65
+ .pending-file-name {
66
+ font-size: 10px;
67
+ color: var(--vck-text-secondary);
68
+ overflow: hidden;
69
+ text-overflow: ellipsis;
70
+ white-space: nowrap;
71
+ width: 100%;
72
+ text-align: center;
73
+ padding: 0 var(--vck-space-xs);
74
+ }
75
+
76
+ .pending-file-remove-btn {
77
+ position: absolute;
78
+ top: var(--vck-space-xs);
79
+ right: var(--vck-space-xs);
80
+ width: 20px;
81
+ height: 20px;
82
+ background-color: rgba(0, 0, 0, 0.5);
83
+ color: white;
84
+ border-radius: 50%;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: center;
88
+ cursor: pointer;
89
+ transition: var(--vck-transition-fast);
90
+ font-size: 14px;
91
+ border: none;
92
+
93
+ &:hover {
94
+ background-color: rgba(0, 0, 0, 0.7);
95
+ }
96
+ }
97
+
98
+ .input-toolbar {
99
+ display: flex;
100
+ align-items: center;
101
+ padding: var(--vck-space);
102
+ gap: var(--vck-space-sm);
103
+ }
104
+
105
+ .input-toolbar-icon {
106
+ color: var(--vck-text-secondary);
107
+ cursor: pointer;
108
+ font-size: 20px;
109
+ transition: var(--vck-transition-fast);
110
+
111
+ &:hover {
112
+ color: var(--vck-text-primary);
113
+ }
114
+ }
115
+
116
+ .emoji-button-wrapper {
117
+ position: relative;
118
+ display: inline-block;
119
+ }
120
+
121
+ .input-textarea-wrapper {
122
+ padding: 0 var(--vck-space) var(--vck-space);
123
+ }
124
+
125
+ .message-input-textarea {
126
+ width: 100%;
127
+ resize: none;
128
+ border: none;
129
+ outline: none;
130
+ font-size: 14px;
131
+ height: 80px;
132
+ font-family: inherit;
133
+ background: transparent;
134
+ color: var(--vck-text-primary);
135
+ }
136
+
137
+ .input-send-wrapper {
138
+ display: flex;
139
+ justify-content: flex-end;
140
+ padding: 0 var(--vck-space) var(--vck-space);
141
+ }
142
+
143
+ .send-message-btn {
144
+ background-color: var(--vck-primary);
145
+ border: none;
146
+ font-size: 14px;
147
+ padding: var(--vck-space-xs) var(--vck-space-md);
148
+ transition: var(--vck-transition-fast);
149
+
150
+ &:hover {
151
+ background-color: var(--vck-primary-hover);
152
+ }
153
+ }
154
+
155
+ .hidden-file-input {
156
+ display: none;
157
+ }
158
+
159
+ // 右侧详情面板
160
+ .chat-detail-panel {
161
+ width: 256px;
162
+ background: var(--vck-bg-panel);
163
+ border-left: 1px solid var(--vck-border);
164
+ display: flex;
165
+ flex-direction: column;
166
+ }
167
+
168
+ .chat-detail-header {
169
+ height: 56px;
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: center;
173
+ border-bottom: 1px solid var(--vck-border);
174
+ font-weight: 500;
175
+ color: var(--vck-text-primary);
176
+ font-size: 14px;
177
+ }
178
+
179
+ .chat-detail-content {
180
+ flex: 1;
181
+ padding: var(--vck-space-md);
182
+ }
183
+
184
+ .chat-detail-profile {
185
+ display: flex;
186
+ flex-direction: column;
187
+ align-items: center;
188
+ }
189
+
190
+ .chat-detail-avatar {
191
+ width: 80px;
192
+ height: 80px;
193
+ border-radius: 50%;
194
+ object-fit: cover;
195
+ }
196
+
197
+ .chat-detail-name {
198
+ margin-top: var(--vck-space);
199
+ font-weight: 500;
200
+ color: var(--vck-text-primary);
201
+ font-size: 18px;
202
+ }
203
+
204
+ .chat-detail-actions {
205
+ margin-top: var(--vck-space-lg);
206
+ width: 100%;
207
+ }
208
+
209
+ .chat-detail-action-item {
210
+ padding: var(--vck-space);
211
+ border-bottom: 1px solid var(--vck-border-light);
212
+ cursor: pointer;
213
+ background-color: var(--vck-bg);
214
+ font-size: 14px;
215
+ color: var(--vck-text-primary);
216
+ transition: var(--vck-transition-fast);
217
+
218
+ &:hover {
219
+ background-color: var(--vck-bg-hover);
220
+ }
221
+
222
+ &:first-child {
223
+ border-radius: var(--vck-radius) var(--vck-radius) 0 0;
224
+ }
225
+
226
+ &:last-child {
227
+ border-bottom: none;
228
+ border-radius: 0 0 var(--vck-radius) var(--vck-radius);
229
+ }
230
+ }
231
+
232
+ // 设置弹窗
233
+ .chat-settings-dialog {
234
+ :deep(.el-dialog) {
235
+ border-radius: var(--vck-radius-lg);
236
+ overflow: hidden;
237
+ }
238
+
239
+ :deep(.el-dialog__header) {
240
+ padding: var(--vck-space-lg) var(--vck-space-lg) 0;
241
+ margin: 0;
242
+ }
243
+
244
+ :deep(.el-dialog__title) {
245
+ font-size: 20px;
246
+ font-weight: 600;
247
+ color: var(--vck-text-primary);
248
+ }
249
+ }
250
+
251
+ .chat-settings-container {
252
+ display: flex;
253
+ flex-direction: column;
254
+ }
255
+
256
+ .chat-settings-avatar-section {
257
+ display: flex;
258
+ flex-direction: column;
259
+ align-items: center;
260
+ margin-bottom: var(--vck-space-lg);
261
+ padding-bottom: var(--vck-space-md);
262
+ border-bottom: 1px solid var(--vck-border-light);
263
+ }
264
+
265
+ .chat-settings-avatar-wrapper {
266
+ position: relative;
267
+ margin-bottom: var(--vck-space);
268
+ }
269
+
270
+ .chat-settings-avatar {
271
+ width: 112px;
272
+ height: 112px;
273
+ border-radius: 50%;
274
+ object-fit: cover;
275
+ border: 4px solid var(--vck-bg);
276
+ box-shadow: var(--vck-shadow-sm);
277
+ }
278
+
279
+ .chat-settings-avatar-edit {
280
+ position: absolute;
281
+ bottom: -4px;
282
+ right: -4px;
283
+ width: 40px;
284
+ height: 40px;
285
+ background-color: var(--vck-primary);
286
+ border-radius: 50%;
287
+ display: flex;
288
+ align-items: center;
289
+ justify-content: center;
290
+ cursor: pointer;
291
+ transition: var(--vck-transition-fast);
292
+ box-shadow: var(--vck-shadow-sm);
293
+
294
+ &:hover {
295
+ background-color: var(--vck-primary-hover);
296
+ }
297
+ }
298
+
299
+ .chat-settings-avatar-icon {
300
+ color: var(--vck-text-white);
301
+ }
302
+
303
+ .hidden-avatar-input {
304
+ display: none;
305
+ }
306
+
307
+ .chat-settings-user-display {
308
+ text-align: center;
309
+ }
310
+
311
+ .chat-settings-nickname {
312
+ font-weight: 600;
313
+ color: var(--vck-text-primary);
314
+ font-size: 20px;
315
+ }
316
+
317
+ .chat-settings-username {
318
+ font-size: 14px;
319
+ color: var(--vck-text-muted);
320
+ margin-top: var(--vck-space-xs);
321
+ }
322
+
323
+ .chat-settings-form-section {
324
+ gap: var(--vck-space-lg);
325
+ }
326
+
327
+ .chat-settings-form-header {
328
+ display: flex;
329
+ align-items: center;
330
+ justify-content: space-between;
331
+ margin-bottom: var(--vck-space-xs);
332
+ }
333
+
334
+ .chat-settings-form-title {
335
+ color: var(--vck-text-primary);
336
+ font-weight: 600;
337
+ display: flex;
338
+ align-items: center;
339
+ gap: var(--vck-space-xs);
340
+ font-size: 14px;
341
+ }
342
+
343
+ .chat-settings-edit-btn {
344
+ border-radius: var(--vck-radius-full);
345
+ }
346
+
347
+ .chat-settings-form {
348
+ background-color: var(--vck-bg-panel);
349
+ border-radius: var(--vck-radius-lg);
350
+ padding: var(--vck-space-lg);
351
+ gap: var(--vck-space-lg);
352
+ display: flex;
353
+ flex-direction: column;
354
+ }
355
+
356
+ .chat-settings-form-item {
357
+ display: flex;
358
+ flex-direction: column;
359
+ }
360
+
361
+ .chat-settings-form-label {
362
+ display: block;
363
+ font-size: 14px;
364
+ color: var(--vck-text-secondary);
365
+ margin-bottom: var(--vck-space-xs);
366
+ font-weight: 500;
367
+ }
368
+
369
+ .chat-settings-form-value {
370
+ color: var(--vck-text-primary);
371
+ background-color: var(--vck-bg);
372
+ border-radius: var(--vck-radius);
373
+ padding: var(--vck-space) var(--vck-space-md);
374
+ border: 1px solid var(--vck-border);
375
+ font-size: 14px;
376
+
377
+ &.bio-value {
378
+ min-height: 80px;
379
+ }
380
+ }
381
+
382
+ .chat-settings-form-actions {
383
+ display: flex;
384
+ gap: var(--vck-space);
385
+ justify-content: flex-end;
386
+ padding-top: var(--vck-space-xs);
387
+ }
388
+
389
+ // 消息已读成员弹窗样式
390
+ .msg-read-users-content {
391
+ display: flex;
392
+ flex-direction: column;
393
+ gap: var(--vck-space-lg);
394
+ }
395
+
396
+ .read-users-section,
397
+ .unread-users-section {
398
+ display: flex;
399
+ flex-direction: column;
400
+ gap: var(--vck-space);
401
+ }
402
+
403
+ .section-title {
404
+ display: flex;
405
+ align-items: center;
406
+ gap: var(--vck-space-xs);
407
+ font-size: 14px;
408
+ font-weight: 500;
409
+ color: var(--vck-text-primary);
410
+ }
411
+
412
+ .users-list {
413
+ display: flex;
414
+ flex-direction: column;
415
+ gap: var(--vck-space-xs);
416
+ }
417
+
418
+ .users-tag-list {
419
+ display: flex;
420
+ flex-wrap: wrap;
421
+ gap: var(--vck-space-xs);
422
+ }
423
+
424
+ .user-tag {
425
+ padding: var(--vck-space-xs) var(--vck-space);
426
+ background-color: var(--vck-border-light);
427
+ border-radius: var(--vck-radius-full);
428
+ font-size: 13px;
429
+ color: var(--vck-text-primary);
430
+ }
431
+
432
+ .member-list {
433
+ display: grid;
434
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
435
+ gap: var(--vck-space);
436
+ }
437
+
438
+ .member-item {
439
+ display: flex;
440
+ align-items: center;
441
+ gap: var(--vck-space-xs);
442
+ padding: var(--vck-space-xs) var(--vck-space);
443
+ border-radius: var(--vck-radius);
444
+ cursor: pointer;
445
+ transition: var(--vck-transition-fast);
446
+ border: 2px solid transparent;
447
+ background-color: var(--vck-bg);
448
+
449
+ &:hover {
450
+ background-color: var(--vck-bg-hover);
451
+ }
452
+
453
+ &.member-selected {
454
+ background-color: var(--vck-bg-active);
455
+ border-color: var(--vck-primary);
456
+ }
457
+ }
458
+
459
+ .member-avatar {
460
+ width: 40px;
461
+ height: 40px;
462
+ border-radius: 50%;
463
+ object-fit: cover;
464
+ }
465
+
466
+ .member-name {
467
+ flex: 1;
468
+ font-size: 14px;
469
+ color: var(--vck-text-primary);
470
+ overflow: hidden;
471
+ text-overflow: ellipsis;
472
+ white-space: nowrap;
473
+ }
474
+
475
+ .member-check {
476
+ color: var(--vck-primary);
477
+ font-size: 20px;
478
+ }
479
+
480
+ .invite-member-content {
481
+ display: flex;
482
+ flex-direction: column;
483
+ gap: var(--vck-space-md);
484
+ }
485
+
486
+ .context-menu-item {
487
+ padding: var(--vck-space-xs) var(--vck-space);
488
+ color: var(--vck-text-primary);
489
+ transition: var(--vck-transition-fast);
490
+
491
+ &:hover {
492
+ background-color: var(--vck-bg-hover);
493
+ cursor: pointer;
494
+ }
495
+
496
+ &.danger {
497
+ color: var(--vck-danger);
498
+ }
499
+ }
500
+
501
+ // 主题选项样式
502
+ .theme-options {
503
+ display: flex;
504
+ flex-direction: column;
505
+ gap: var(--vck-space-xs);
506
+ }
507
+
508
+ .theme-option {
509
+ display: flex;
510
+ align-items: center;
511
+ gap: var(--vck-space);
512
+ padding: var(--vck-space) var(--vck-space-md);
513
+ border-radius: var(--vck-radius);
514
+ cursor: pointer;
515
+ transition: var(--vck-transition-fast);
516
+ background-color: var(--vck-bg);
517
+ border: 2px solid transparent;
518
+
519
+ &:hover {
520
+ background-color: var(--vck-bg-hover);
521
+ }
522
+
523
+ &.theme-option-active {
524
+ background-color: var(--vck-bg-active);
525
+ border-color: var(--vck-primary);
526
+ }
527
+ }
528
+
529
+ .theme-option-icon {
530
+ color: var(--vck-text-secondary);
531
+ }
532
+
533
+ .theme-option-active .theme-option-icon {
534
+ color: var(--vck-primary);
535
+ }
536
+
537
+ .theme-option-label {
538
+ flex: 1;
539
+ font-size: 14px;
540
+ color: var(--vck-text-primary);
541
+ }
542
+
543
+ .theme-option-check {
544
+ color: var(--vck-primary);
545
+ font-size: 20px;
546
+ }