@bcc-code/vue-bcc-chat-ui 1.0.8 → 1.1.0
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/README.md +63 -8
- package/dist/chat/connection.d.ts +2 -2
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/uiKit.d.ts +0 -1
- package/dist/components/BccChatMessageList.vue.d.ts +17 -9
- package/dist/index.d.ts +3 -3
- package/dist/vue-bcc-chat-ui.js +3640 -3644
- package/package.json +4 -14
- package/src/components/BccChatMessageList.vue +16 -78
- package/dist/App.vue.d.ts +0 -2
- package/dist/vue-bcc-chat-ui.umd.cjs +0 -3615
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@bcc-code/vue-bcc-chat-ui",
|
|
3
3
|
"author": "bcc-code",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"version": "1.0
|
|
5
|
+
"version": "1.1.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"private": false,
|
|
8
8
|
"files": [
|
|
@@ -13,17 +13,8 @@
|
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "git+https://github.com/bcc-code/bcc-chat.git"
|
|
15
15
|
},
|
|
16
|
-
"main": "./dist/vue-bcc-chat-ui.umd.cjs",
|
|
17
16
|
"module": "./dist/vue-bcc-chat-ui.js",
|
|
18
17
|
"types": "./dist/index.d.ts",
|
|
19
|
-
"exports": {
|
|
20
|
-
".": {
|
|
21
|
-
"import": "./dist/vue-bcc-chat-ui.js",
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
|
-
"require": "./dist/vue-bcc-chat-ui.umd.cjs"
|
|
24
|
-
},
|
|
25
|
-
"./style.css": "./dist/style.css"
|
|
26
|
-
},
|
|
27
18
|
"publishConfig": {
|
|
28
19
|
"access": "public"
|
|
29
20
|
},
|
|
@@ -38,18 +29,17 @@
|
|
|
38
29
|
"vite": "^5.0.8",
|
|
39
30
|
"vite-plugin-dts": "^3.7.2",
|
|
40
31
|
"vue": "^3.3.11",
|
|
41
|
-
"
|
|
32
|
+
"sass": "^1.70.0"
|
|
42
33
|
},
|
|
43
34
|
"dependencies": {
|
|
44
35
|
"@cometchat/chat-sdk-javascript": "^4.0.3",
|
|
45
36
|
"@cometchat/chat-uikit-vue": "^4.2.0",
|
|
46
37
|
"@cometchat/uikit-resources": "^4.2.2",
|
|
47
|
-
"@cometchat/uikit-shared": "^4.2.1"
|
|
48
|
-
"sass": "^1.70.0"
|
|
38
|
+
"@cometchat/uikit-shared": "^4.2.1"
|
|
49
39
|
},
|
|
50
40
|
"scripts": {
|
|
51
41
|
"dev": "vite",
|
|
52
|
-
"build": "vite build
|
|
42
|
+
"build": "vite build",
|
|
53
43
|
"preview": "vite preview"
|
|
54
44
|
}
|
|
55
45
|
}
|
|
@@ -1,69 +1,39 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { onUnmounted, ref, watchEffect } from 'vue'
|
|
3
3
|
import chat from '../chat';
|
|
4
|
-
import { watch } from 'vue';
|
|
5
4
|
import { CometChatMessages } from '@cometchat/chat-uikit-vue'
|
|
5
|
+
import { Group } from '@cometchat/chat-sdk-javascript';
|
|
6
6
|
//import { ThreadedMessagesStyle } from '@cometchat/uikit-shared';
|
|
7
7
|
|
|
8
8
|
const props = defineProps({
|
|
9
|
-
accessToken: String,
|
|
10
|
-
chatUid: String,
|
|
11
|
-
active: Boolean
|
|
9
|
+
accessToken: {type: String, required: true},
|
|
10
|
+
chatUid: {type: String, required: true},
|
|
12
11
|
})
|
|
13
12
|
|
|
14
|
-
const accessToken = computed(() => props.accessToken);
|
|
15
|
-
const active = computed(() => props.active);
|
|
16
13
|
const connected = ref(false);
|
|
17
|
-
const chatGroup = ref();
|
|
14
|
+
const chatGroup = ref<Group>();
|
|
18
15
|
const user = ref();
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (props.chatUid){
|
|
26
|
-
chatGroup.value = await chat.data.getGroup(props.chatUid);
|
|
27
|
-
console.log('GROUP', chatGroup.value);
|
|
28
|
-
}
|
|
29
|
-
connected.value = true;
|
|
17
|
+
watchEffect(async () => {
|
|
18
|
+
if (props.accessToken) {
|
|
19
|
+
user.value = await chat.connection.connect(props.accessToken);
|
|
20
|
+
chatGroup.value = await chat.data.getGroup(props.chatUid);
|
|
21
|
+
connected.value = true
|
|
30
22
|
}
|
|
31
|
-
}
|
|
23
|
+
})
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
console.log('Disconnecting');
|
|
25
|
+
onUnmounted(async () => {
|
|
35
26
|
if (connected.value){
|
|
36
27
|
await chat.connection.disconnect();
|
|
37
|
-
console.log('Disconnected');
|
|
38
28
|
connected.value = false;
|
|
39
29
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
watch(accessToken, async (token) => {
|
|
43
|
-
if (token && active){
|
|
44
|
-
await connect();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
watch(active, async (isActive, wasActive) => {
|
|
49
|
-
if (isActive && !wasActive){
|
|
50
|
-
await connect();
|
|
51
|
-
}
|
|
52
|
-
if (!isActive && connected.value){
|
|
53
|
-
await disconnect();
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
onBeforeMount(async() => {
|
|
58
|
-
await connect();
|
|
59
|
-
});
|
|
60
|
-
|
|
30
|
+
})
|
|
61
31
|
|
|
62
32
|
</script>
|
|
63
33
|
|
|
64
34
|
<template>
|
|
65
|
-
<div v-if="connected" class="bcc-chat-message-list">
|
|
66
|
-
|
|
35
|
+
<div v-if="connected" class="bcc-chat-message-list">
|
|
36
|
+
<CometChatMessages :hideMessageHeader="true" :hideMessageComposer="false" :hideDetails="true" :group="chatGroup"></CometChatMessages>
|
|
67
37
|
</div>
|
|
68
38
|
</template>
|
|
69
39
|
|
|
@@ -71,49 +41,18 @@ onBeforeMount(async() => {
|
|
|
71
41
|
|
|
72
42
|
.bcc-chat-message-list {
|
|
73
43
|
height: 100%;
|
|
74
|
-
|
|
75
44
|
/* 1. Wrapper for Messages component */
|
|
76
45
|
.cc-messages-wrapper {
|
|
77
|
-
|
|
78
46
|
/* 1.1 Messages component */
|
|
79
47
|
.cc-messages-wrapper__messages {
|
|
80
|
-
|
|
81
48
|
/* 1.1.1 Wrapper for Messages List */
|
|
82
49
|
.cc-messages-wrapper__messages-list {
|
|
83
|
-
|
|
84
50
|
height: calc(100% - 96px);
|
|
85
|
-
|
|
86
|
-
/* 1.1.1.1 Messages List header view */
|
|
87
|
-
.cc__messagelist__headerview {
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* 1.1.1.2 Messages List messages */
|
|
91
|
-
.cc-messagelist {
|
|
92
|
-
.cc-list__wrapper {
|
|
93
|
-
.cc-list__header {
|
|
94
|
-
}
|
|
95
|
-
.cc-list__list {
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* 1.1.1.3 Message List footer */
|
|
101
|
-
.cc__messagelist__footerview {
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/* 1.1.2 Wrapper for Composer */
|
|
106
|
-
.cc-messages-wrapper__composer {
|
|
107
51
|
}
|
|
108
|
-
|
|
109
|
-
/* 1.1.3 Wrapper for Live Reaction */
|
|
110
|
-
.cc__messages__livereaction {
|
|
111
|
-
}
|
|
112
|
-
|
|
113
52
|
}
|
|
114
|
-
|
|
115
53
|
}
|
|
116
54
|
}
|
|
55
|
+
|
|
117
56
|
.cc-threadedmessages-wrapper__bubbleview::-webkit-scrollbar,
|
|
118
57
|
.cc__message-list::-webkit-scrollbar {
|
|
119
58
|
background: transparent;
|
|
@@ -126,5 +65,4 @@ onBeforeMount(async() => {
|
|
|
126
65
|
border-radius: 8px;
|
|
127
66
|
}
|
|
128
67
|
|
|
129
|
-
|
|
130
68
|
</style>
|
package/dist/App.vue.d.ts
DELETED