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,94 @@
1
+ // ==========================================
2
+ // MainArea 组件样式
3
+ // ==========================================
4
+
5
+ .chat-main-area {
6
+ flex: 1;
7
+ display: flex;
8
+ flex-direction: column;
9
+ background-color: var(--vck-bg);
10
+ min-width: 0;
11
+ height: 100%;
12
+ }
13
+
14
+ .friend-profile-area {
15
+ flex: 1;
16
+ display: flex;
17
+ flex-direction: column;
18
+ align-items: center;
19
+ justify-content: center;
20
+ padding: var(--vck-space-lg);
21
+ }
22
+
23
+ .profile-avatar {
24
+ width: 120px;
25
+ height: 120px;
26
+ border-radius: 50%;
27
+ margin-bottom: var(--vck-space-lg);
28
+ box-shadow: var(--vck-shadow-sm);
29
+ }
30
+
31
+ .profile-name {
32
+ font-size: 24px;
33
+ font-weight: 600;
34
+ color: var(--vck-text-primary);
35
+ margin-bottom: var(--vck-space-md);
36
+ }
37
+
38
+ .profile-status {
39
+ display: flex;
40
+ align-items: center;
41
+ gap: var(--vck-space-sm);
42
+ font-size: 14px;
43
+ color: var(--vck-text-secondary);
44
+ margin-bottom: var(--vck-space-lg);
45
+ }
46
+
47
+ .profile-status-dot {
48
+ width: 10px;
49
+ height: 10px;
50
+ border-radius: 50%;
51
+ }
52
+
53
+ .profile-status-online {
54
+ background-color: var(--vck-success);
55
+ }
56
+
57
+ .profile-status-offline {
58
+ background-color: var(--vck-text-muted);
59
+ }
60
+
61
+ .profile-start-chat-btn {
62
+ padding: var(--vck-space) var(--vck-space-lg);
63
+ font-size: 16px;
64
+ border-radius: var(--vck-radius-full);
65
+ display: flex;
66
+ align-items: center;
67
+ gap: var(--vck-space-sm);
68
+ }
69
+
70
+ .chat-window-area {
71
+ flex: 1;
72
+ display: flex;
73
+ flex-direction: column;
74
+ min-height: 0;
75
+ }
76
+
77
+ .chat-empty-state {
78
+ flex: 1;
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+ flex-direction: column;
83
+ background-color: var(--vck-bg-panel);
84
+ }
85
+
86
+ .empty-state-icon {
87
+ color: var(--vck-border-strong);
88
+ margin-bottom: var(--vck-space-md);
89
+ }
90
+
91
+ .empty-state-text {
92
+ color: var(--vck-text-muted);
93
+ font-size: 14px;
94
+ }
@@ -0,0 +1,83 @@
1
+ // ==========================================
2
+ // Sidebar 组件样式
3
+ // ==========================================
4
+
5
+ .chat-sidebar {
6
+ width: 60px;
7
+ background: var(--vck-bg-sidebar);
8
+ display: flex;
9
+ flex-direction: column;
10
+ align-items: center;
11
+ padding: var(--vck-space-md) 0;
12
+ flex-shrink: 0;
13
+ border-right: 1px solid var(--vck-border);
14
+ }
15
+
16
+ .sidebar-avatar {
17
+ width: 44px;
18
+ height: 44px;
19
+ border-radius: var(--vck-radius-md);
20
+ overflow: hidden;
21
+ cursor: pointer;
22
+ margin-bottom: var(--vck-space);
23
+ border: 2px solid var(--vck-avatar-border);
24
+ transition: var(--vck-transition-fast);
25
+
26
+ &:hover {
27
+ transform: scale(1.05);
28
+ border-color: var(--vck-primary);
29
+ }
30
+ }
31
+
32
+ .sidebar-avatar-img {
33
+ width: 100%;
34
+ height: 100%;
35
+ object-fit: cover;
36
+ }
37
+
38
+ .sidebar-nav-item {
39
+ width: 44px;
40
+ height: 44px;
41
+ border-radius: var(--vck-radius-md);
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ cursor: pointer;
46
+ transition: var(--vck-transition-fast);
47
+ margin-bottom: var(--vck-space-sm);
48
+ position: relative;
49
+ }
50
+
51
+ .sidebar-nav-item-active {
52
+ background: var(--vck-bg-active);
53
+
54
+ .el-icon {
55
+ color: var(--vck-primary);
56
+ }
57
+ }
58
+
59
+ .sidebar-nav-item-inactive {
60
+ color: var(--vck-text-secondary);
61
+
62
+ &:hover {
63
+ background: var(--vck-bg-hover);
64
+ }
65
+ }
66
+
67
+ .sidebar-nav-badge {
68
+ position: absolute;
69
+ top: 4px;
70
+ right: 0;
71
+ background: var(--vck-danger);
72
+ color: var(--vck-text-white);
73
+ font-size: 10px;
74
+ padding: 2px 6px;
75
+ border-radius: 10px;
76
+ line-height: 1;
77
+ min-width: 18px;
78
+ text-align: center;
79
+ }
80
+
81
+ .sidebar-spacer {
82
+ flex: 1;
83
+ }
@@ -0,0 +1,18 @@
1
+ // ==================== 主样式入口 ====================
2
+ // 引入变量和基础样式
3
+ @use './base';
4
+
5
+ // 引入组件样式
6
+ @use './components/chat-panel';
7
+ @use './components/sidebar';
8
+ @use './components/content-list';
9
+ @use './components/chat-window';
10
+ @use './components/group-sidebar';
11
+ @use './components/main-area';
12
+ @use './components/dialogs';
13
+ @use './components/avatar-crop';
14
+ @use './components/emoji-picker';
15
+ @use './components/context-menu';
16
+ @use './components/add-friend-dialog';
17
+ @use './components/create-group-dialog';
18
+ @use './components/group-detail-dialog';
@@ -0,0 +1,68 @@
1
+ // ==========================================
2
+ // 深色主题(参照微信深色模式配色)
3
+ // ==========================================
4
+
5
+ [data-theme="dark"] {
6
+ // 主要颜色
7
+ --vck-primary: #07c160;
8
+ --vck-primary-hover: #06ad56;
9
+ --vck-success: #10b981;
10
+ --vck-success-hover: #059669;
11
+ --vck-warning: #f59e0b;
12
+ --vck-warning-hover: #d97706;
13
+ --vck-danger: #ef4444;
14
+ --vck-danger-hover: #dc2626;
15
+ --vck-info: #3b82f6;
16
+
17
+ // 背景色
18
+ --vck-bg: #1a1a1a;
19
+ --vck-bg-panel: #262626;
20
+ --vck-bg-sidebar: #191919;
21
+ --vck-bg-chat: #141414;
22
+ --vck-bg-bubble-self: #06ad56;
23
+ --vck-bg-bubble-other: #262626;
24
+ --vck-bg-hover: rgba(255, 255, 255, 0.08);
25
+ --vck-bg-active: rgba(7, 193, 96, 0.18);
26
+ --vck-bg-input: #202020;
27
+
28
+ // 文字颜色
29
+ --vck-text-primary: #f2f2f2;
30
+ --vck-text-secondary: #9e9e9e;
31
+ --vck-text-muted: #6b6b6b;
32
+ --vck-text-white: #ffffff;
33
+ --vck-text-placeholder: #6b6b6b;
34
+
35
+ // 边框
36
+ --vck-border: #2e2e2e;
37
+ --vck-border-light: #232323;
38
+ --vck-border-strong: #383838;
39
+
40
+ // 阴影
41
+ --vck-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.25);
42
+ --vck-shadow-light: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
43
+ --vck-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
44
+
45
+ // 其他
46
+ --vck-avatar-border: #2e2e2e;
47
+ --vck-scrollbar: #4d4d4d;
48
+ --vck-scrollbar-hover: #666666;
49
+
50
+ // 圆角(继承自浅色主题)
51
+ --vck-radius-sm: 4px;
52
+ --vck-radius: 6px;
53
+ --vck-radius-md: 8px;
54
+ --vck-radius-lg: 12px;
55
+ --vck-radius-xl: 16px;
56
+ --vck-radius-full: 9999px;
57
+
58
+ // 间距(继承自浅色主题)
59
+ --vck-space-xs: 4px;
60
+ --vck-space-sm: 8px;
61
+ --vck-space: 12px;
62
+ --vck-space-md: 16px;
63
+ --vck-space-lg: 24px;
64
+
65
+ // 过渡(继承自浅色主题)
66
+ --vck-transition: all 0.3s ease;
67
+ --vck-transition-fast: all 0.2s ease;
68
+ }
@@ -0,0 +1,7 @@
1
+ // ==========================================
2
+ // 主题系统入口
3
+ // ==========================================
4
+
5
+ // 引入各个主题
6
+ @use './light';
7
+ @use './dark';
@@ -0,0 +1,69 @@
1
+ // ==========================================
2
+ // 浅色主题(参照微信配色)
3
+ // ==========================================
4
+
5
+ :root,
6
+ [data-theme="light"] {
7
+ // 主要颜色
8
+ --vck-primary: #07c160;
9
+ --vck-primary-hover: #06ad56;
10
+ --vck-success: #10b981;
11
+ --vck-success-hover: #059669;
12
+ --vck-warning: #f59e0b;
13
+ --vck-warning-hover: #d97706;
14
+ --vck-danger: #ef4444;
15
+ --vck-danger-hover: #dc2626;
16
+ --vck-info: #3b82f6;
17
+
18
+ // 背景色
19
+ --vck-bg: #ffffff;
20
+ --vck-bg-panel: #f5f5f5;
21
+ --vck-bg-sidebar: #ededed;
22
+ --vck-bg-chat: #f2f2f2;
23
+ --vck-bg-bubble-self: #95ec69;
24
+ --vck-bg-bubble-other: #ffffff;
25
+ --vck-bg-hover: rgba(0, 0, 0, 0.06);
26
+ --vck-bg-active: rgba(7, 193, 96, 0.12);
27
+ --vck-bg-input: #ffffff;
28
+
29
+ // 文字颜色
30
+ --vck-text-primary: #181818;
31
+ --vck-text-secondary: #868686;
32
+ --vck-text-muted: #b2b2b2;
33
+ --vck-text-white: #ffffff;
34
+ --vck-text-placeholder: #b2b2b2;
35
+
36
+ // 边框
37
+ --vck-border: #e5e5e5;
38
+ --vck-border-light: #f0f0f0;
39
+ --vck-border-strong: #dcdcdc;
40
+
41
+ // 阴影
42
+ --vck-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
43
+ --vck-shadow-light: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
44
+ --vck-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
45
+
46
+ // 其他
47
+ --vck-avatar-border: #e5e5e5;
48
+ --vck-scrollbar: #c8c8c8;
49
+ --vck-scrollbar-hover: #999999;
50
+
51
+ // 圆角
52
+ --vck-radius-sm: 4px;
53
+ --vck-radius: 6px;
54
+ --vck-radius-md: 8px;
55
+ --vck-radius-lg: 12px;
56
+ --vck-radius-xl: 16px;
57
+ --vck-radius-full: 9999px;
58
+
59
+ // 间距
60
+ --vck-space-xs: 4px;
61
+ --vck-space-sm: 8px;
62
+ --vck-space: 12px;
63
+ --vck-space-md: 16px;
64
+ --vck-space-lg: 24px;
65
+
66
+ // 过渡
67
+ --vck-transition: all 0.3s ease;
68
+ --vck-transition-fast: all 0.2s ease;
69
+ }