vue-chat-kit 0.3.9 → 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.
- package/dist/vue-chat-kit.css +1 -1
- package/dist/vue-chat-kit.es.js +4420 -2877
- package/dist/vue-chat-kit.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/AvatarCrop.vue +16 -127
- package/src/components/ChatPanel.vue +503 -2818
- package/src/components/EmojiPicker.vue +2 -73
- package/src/components/chat/ChatWindow.vue +177 -0
- package/src/components/chat/ContentList.vue +300 -0
- package/src/components/chat/ContextMenu.vue +32 -0
- package/src/components/chat/GroupSidebar.vue +284 -0
- package/src/components/chat/MainArea.vue +87 -0
- package/src/components/chat/Sidebar.vue +52 -0
- package/src/components/chat/dialogs/AddFriendDialog.vue +62 -0
- package/src/components/chat/dialogs/CreateGroupDialog.vue +86 -0
- package/src/components/chat/dialogs/GroupDetailDialog.vue +132 -0
- package/src/components/ui/Button.vue +190 -0
- package/src/components/ui/Dialog.vue +194 -0
- package/src/components/ui/Empty.vue +66 -0
- package/src/components/ui/Input.vue +166 -0
- package/src/components/ui/Message.vue +186 -0
- package/src/components/ui/MessageBox.vue +143 -0
- package/src/components/ui/MessageManager.vue +92 -0
- package/src/components/ui/Switch.vue +65 -0
- package/src/components/ui/Tag.vue +68 -0
- package/src/components/ui/icons/ArrowDown.vue +5 -0
- package/src/components/ui/icons/ArrowRight.vue +5 -0
- package/src/components/ui/icons/Bell.vue +6 -0
- package/src/components/ui/icons/Camera.vue +6 -0
- package/src/components/ui/icons/ChatDotRound.vue +5 -0
- package/src/components/ui/icons/Check.vue +5 -0
- package/src/components/ui/icons/CircleCheck.vue +6 -0
- package/src/components/ui/icons/Clock.vue +6 -0
- package/src/components/ui/icons/Close.vue +5 -0
- package/src/components/ui/icons/Delete.vue +8 -0
- package/src/components/ui/icons/Edit.vue +6 -0
- package/src/components/ui/icons/Folder.vue +5 -0
- package/src/components/ui/icons/Minus.vue +5 -0
- package/src/components/ui/icons/Monitor.vue +7 -0
- package/src/components/ui/icons/Moon.vue +5 -0
- package/src/components/ui/icons/Picture.vue +7 -0
- package/src/components/ui/icons/Plus.vue +5 -0
- package/src/components/ui/icons/Search.vue +6 -0
- package/src/components/ui/icons/Setting.vue +6 -0
- package/src/components/ui/icons/Sunny.vue +6 -0
- package/src/components/ui/icons/User.vue +6 -0
- package/src/components/ui/icons/UserFilled.vue +6 -0
- package/src/components/ui/icons/Warning.vue +5 -0
- package/src/components/ui/icons/index.js +24 -0
- package/src/components/ui/index.js +10 -0
- package/src/composables/useFriendChat.js +10 -14
- package/src/composables/useGroupChat.js +140 -48
- package/src/composables/useMessage.js +21 -0
- package/src/composables/useMessageBox.js +98 -0
- package/src/composables/useTheme.js +140 -0
- package/src/config/index.js +1 -0
- package/src/const/index.js +1 -0
- package/src/const/theme.js +19 -0
- package/src/core/api.js +13 -2
- package/src/index.js +5 -5
- package/src/styles/_base.scss +38 -0
- package/src/styles/_variables.scss +43 -0
- package/src/styles/components/_add-friend-dialog.scss +45 -0
- package/src/styles/components/_avatar-crop.scss +120 -0
- package/src/styles/components/_chat-panel.scss +546 -0
- package/src/styles/components/_chat-window.scss +239 -0
- package/src/styles/components/_content-list.scss +260 -0
- package/src/styles/components/_context-menu.scss +35 -0
- package/src/styles/components/_create-group-dialog.scss +78 -0
- package/src/styles/components/_dialogs.scss +226 -0
- package/src/styles/components/_emoji-picker.scss +74 -0
- package/src/styles/components/_group-detail-dialog.scss +110 -0
- package/src/styles/components/_group-sidebar.scss +278 -0
- package/src/styles/components/_main-area.scss +94 -0
- package/src/styles/components/_sidebar.scss +83 -0
- package/src/styles/index.scss +18 -0
- package/src/styles/themes/_dark.scss +68 -0
- package/src/styles/themes/_index.scss +7 -0
- package/src/styles/themes/_light.scss +69 -0
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
2
|
+
<Dialog
|
|
3
|
+
:model-value="visible"
|
|
4
|
+
@update:model-value="val => visible = val"
|
|
4
5
|
title="调整头像"
|
|
5
6
|
:width="dialogWidth"
|
|
6
7
|
:close-on-click-modal="false"
|
|
7
|
-
:append-to-body="appendToBody"
|
|
8
8
|
@closed="handleClosed"
|
|
9
9
|
>
|
|
10
10
|
<div class="avatar-crop-container">
|
|
@@ -44,22 +44,22 @@
|
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
|
-
<
|
|
47
|
+
<Empty v-else description="请上传图片" />
|
|
48
48
|
</div>
|
|
49
49
|
<template #footer>
|
|
50
50
|
<div class="dialog-footer">
|
|
51
|
-
<
|
|
52
|
-
<
|
|
51
|
+
<Button @click="handleCancel">取消</Button>
|
|
52
|
+
<Button type="primary" :loading="loading" :disabled="!imageSrc" @click="handleConfirm">
|
|
53
53
|
确认
|
|
54
|
-
</
|
|
54
|
+
</Button>
|
|
55
55
|
</div>
|
|
56
56
|
</template>
|
|
57
|
-
</
|
|
57
|
+
</Dialog>
|
|
58
58
|
</template>
|
|
59
59
|
|
|
60
60
|
<script setup>
|
|
61
61
|
import { ref, computed, nextTick, watch } from "vue";
|
|
62
|
-
import {
|
|
62
|
+
import { Dialog, Button, Empty } from './ui/index.js';
|
|
63
63
|
|
|
64
64
|
const props = defineProps({
|
|
65
65
|
modelValue: Boolean,
|
|
@@ -70,11 +70,15 @@ const props = defineProps({
|
|
|
70
70
|
outputSize: { type: Number, default: 400 },
|
|
71
71
|
outputType: { type: String, default: "image/jpeg" },
|
|
72
72
|
outputQuality: { type: Number, default: 0.9 },
|
|
73
|
-
appendToBody: { type: Boolean, default: true },
|
|
74
73
|
aspectRatio: { type: Number, default: 1 },
|
|
75
74
|
minSize: { type: Number, default: 50 },
|
|
76
75
|
});
|
|
77
76
|
|
|
77
|
+
// 简单的消息提示函数
|
|
78
|
+
const ElMessage = {
|
|
79
|
+
error: (msg) => console.error(msg)
|
|
80
|
+
};
|
|
81
|
+
|
|
78
82
|
const emit = defineEmits(["update:modelValue", "confirm", "cancel", "closed"]);
|
|
79
83
|
|
|
80
84
|
const visible = computed({
|
|
@@ -414,121 +418,6 @@ defineExpose({
|
|
|
414
418
|
});
|
|
415
419
|
</script>
|
|
416
420
|
|
|
417
|
-
<style scoped>
|
|
418
|
-
|
|
419
|
-
min-height: 200px;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
.crop-wrapper {
|
|
423
|
-
display: flex;
|
|
424
|
-
flex-direction: column;
|
|
425
|
-
gap: 16px;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.crop-area {
|
|
429
|
-
position: relative;
|
|
430
|
-
overflow: hidden;
|
|
431
|
-
background: #f5f7fa;
|
|
432
|
-
border-radius: 12px;
|
|
433
|
-
display: flex;
|
|
434
|
-
align-items: center;
|
|
435
|
-
justify-content: center;
|
|
436
|
-
border: 1px solid #e4e7ed;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.crop-box {
|
|
440
|
-
position: absolute;
|
|
441
|
-
border: 2px solid #409eff;
|
|
442
|
-
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
|
|
443
|
-
cursor: move;
|
|
444
|
-
box-sizing: border-box;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
.crop-handle {
|
|
448
|
-
position: absolute;
|
|
449
|
-
width: 14px;
|
|
450
|
-
height: 14px;
|
|
451
|
-
background: #409eff;
|
|
452
|
-
border: 3px solid #fff;
|
|
453
|
-
border-radius: 50%;
|
|
454
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
.crop-handle.nw {
|
|
458
|
-
top: -7px;
|
|
459
|
-
left: -7px;
|
|
460
|
-
cursor: nw-resize;
|
|
461
|
-
}
|
|
462
|
-
.crop-handle.n {
|
|
463
|
-
top: -7px;
|
|
464
|
-
left: 50%;
|
|
465
|
-
transform: translateX(-50%);
|
|
466
|
-
cursor: n-resize;
|
|
467
|
-
}
|
|
468
|
-
.crop-handle.ne {
|
|
469
|
-
top: -7px;
|
|
470
|
-
right: -7px;
|
|
471
|
-
cursor: ne-resize;
|
|
472
|
-
}
|
|
473
|
-
.crop-handle.e {
|
|
474
|
-
right: -7px;
|
|
475
|
-
top: 50%;
|
|
476
|
-
transform: translateY(-50%);
|
|
477
|
-
cursor: e-resize;
|
|
478
|
-
}
|
|
479
|
-
.crop-handle.se {
|
|
480
|
-
bottom: -7px;
|
|
481
|
-
right: -7px;
|
|
482
|
-
cursor: se-resize;
|
|
483
|
-
}
|
|
484
|
-
.crop-handle.s {
|
|
485
|
-
bottom: -7px;
|
|
486
|
-
left: 50%;
|
|
487
|
-
transform: translateX(-50%);
|
|
488
|
-
cursor: s-resize;
|
|
489
|
-
}
|
|
490
|
-
.crop-handle.sw {
|
|
491
|
-
bottom: -7px;
|
|
492
|
-
left: -7px;
|
|
493
|
-
cursor: sw-resize;
|
|
494
|
-
}
|
|
495
|
-
.crop-handle.w {
|
|
496
|
-
left: -7px;
|
|
497
|
-
top: 50%;
|
|
498
|
-
transform: translateY(-50%);
|
|
499
|
-
cursor: w-resize;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.preview-wrapper {
|
|
503
|
-
display: flex;
|
|
504
|
-
align-items: center;
|
|
505
|
-
justify-content: center;
|
|
506
|
-
gap: 16px;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
.preview-label {
|
|
510
|
-
font-size: 14px;
|
|
511
|
-
color: #606266;
|
|
512
|
-
font-weight: 500;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
.preview-box {
|
|
516
|
-
border-radius: 50%;
|
|
517
|
-
overflow: hidden;
|
|
518
|
-
border: 3px solid #e4e7ed;
|
|
519
|
-
background: #fff;
|
|
520
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
.preview-canvas {
|
|
524
|
-
display: block;
|
|
525
|
-
width: 100%;
|
|
526
|
-
height: 100%;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
.dialog-footer {
|
|
530
|
-
display: flex;
|
|
531
|
-
justify-content: center;
|
|
532
|
-
gap: 12px;
|
|
533
|
-
}
|
|
421
|
+
<style scoped lang="scss">
|
|
422
|
+
@use '../styles/components/avatar-crop';
|
|
534
423
|
</style>
|