@bcc-code/vue-bcc-chat-ui 2.0.0 → 2.0.1
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/style.css +1 -1
- package/dist/vue-bcc-chat-ui.js +244 -221
- package/package.json +1 -1
- package/src/components/BccChatMessageList.vue +81 -45
package/package.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
nextTick,
|
|
4
|
+
onBeforeMount,
|
|
5
|
+
onMounted,
|
|
6
|
+
onUnmounted,
|
|
7
|
+
ref,
|
|
8
|
+
watchEffect,
|
|
9
|
+
} from "vue";
|
|
3
10
|
import chat from "../chat";
|
|
4
11
|
import { connect, disconnect } from "../chat/connection";
|
|
5
12
|
import { loggedIn } from "../chat/login";
|
|
6
13
|
import { CometChatMessages } from "@cometchat/chat-uikit-vue";
|
|
7
14
|
import { Group } from "@cometchat/chat-sdk-javascript";
|
|
8
15
|
import { watchAndApplyStyle } from "../chat/styleFix";
|
|
9
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
messageComposerConfiguration,
|
|
18
|
+
messageListConfiguration,
|
|
19
|
+
} from "../chat/uiKit";
|
|
10
20
|
|
|
11
21
|
const props = defineProps({
|
|
12
22
|
chatUid: { type: String, required: true },
|
|
@@ -18,23 +28,43 @@ const componentId = ref(
|
|
|
18
28
|
const chatGroup = ref<Group>();
|
|
19
29
|
|
|
20
30
|
onMounted(() => {
|
|
21
|
-
watchAndApplyStyle(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
selector: '.cc__imageviewer__close-button',
|
|
31
|
+
watchAndApplyStyle(".bcc-chat-message-list-wrapper", [
|
|
32
|
+
{
|
|
33
|
+
selector: ".cc__imageviewer__close-button",
|
|
25
34
|
style: { "padding-top": "env(safe-area-inset-top)" },
|
|
26
|
-
shadowDomSelector:
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
35
|
+
shadowDomSelector: "cometchat-full-screen-viewer",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
selector: ".cc__text",
|
|
39
|
+
style: { color: "var(--cc__text-color)" },
|
|
40
|
+
shadowDomSelector: "cometchat-text-bubble",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
selector: ".cc__linkpreview-title",
|
|
44
|
+
style: { color: "var(--cc__text-color)" },
|
|
45
|
+
shadowDomSelector: "link-preview",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
selector: ".cc__messageinput",
|
|
49
|
+
style: {
|
|
50
|
+
"border-radius": "8px 8px 0 0",
|
|
51
|
+
"box-shadow":
|
|
52
|
+
"0px -1px 2px 0px rgba(17, 24, 39, 0.05), 1px -1px 3px 0px rgba(17, 24, 39, 0.1)",
|
|
53
|
+
},
|
|
54
|
+
shadowDomSelector: "cometchat-message-input",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
selector: ".cc__messageinput-input",
|
|
58
|
+
style: {
|
|
59
|
+
"font-size": "16px",
|
|
60
|
+
padding: "8px",
|
|
61
|
+
"max-height": "none",
|
|
62
|
+
height: "64px",
|
|
63
|
+
},
|
|
64
|
+
shadowDomSelector: "cometchat-message-input",
|
|
65
|
+
},
|
|
66
|
+
]);
|
|
67
|
+
});
|
|
38
68
|
|
|
39
69
|
onBeforeMount(async () => {
|
|
40
70
|
await connect(componentId.value);
|
|
@@ -46,29 +76,30 @@ onUnmounted(async () => {
|
|
|
46
76
|
|
|
47
77
|
watchEffect(async () => {
|
|
48
78
|
if (loggedIn.value && props.chatUid && chat.initialized.value) {
|
|
49
|
-
chatGroup.value = await chat.getGroup(props.chatUid) ?? undefined;
|
|
50
|
-
await chat.clearGroupChatCount(props.chatUid);
|
|
79
|
+
chatGroup.value = (await chat.getGroup(props.chatUid)) ?? undefined;
|
|
80
|
+
await chat.clearGroupChatCount(props.chatUid);
|
|
51
81
|
} else {
|
|
52
82
|
chatGroup.value = undefined;
|
|
53
83
|
}
|
|
54
|
-
})
|
|
55
|
-
|
|
84
|
+
});
|
|
56
85
|
</script>
|
|
57
86
|
|
|
58
87
|
<template>
|
|
59
88
|
<div class="bcc-chat-message-list-wrapper">
|
|
60
89
|
<div v-if="chatGroup" class="bcc-chat-message-list">
|
|
61
|
-
<CometChatMessages
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
90
|
+
<CometChatMessages
|
|
91
|
+
:hideMessageHeader="true"
|
|
92
|
+
:disableSoundForMessages="true"
|
|
93
|
+
:messageComposerConfiguration="messageComposerConfiguration"
|
|
94
|
+
:messageListConfiguration="messageListConfiguration"
|
|
95
|
+
:hideMessageComposer="false"
|
|
96
|
+
:hideDetails="true"
|
|
97
|
+
:group="chatGroup"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
<div class="bcc-chat-message-list-offline">
|
|
101
|
+
<span>Waiting for connection...</span>
|
|
70
102
|
</div>
|
|
71
|
-
<div class="bcc-chat-message-list-offline"><span>Waiting for connection...</span></div>
|
|
72
103
|
</div>
|
|
73
104
|
</template>
|
|
74
105
|
|
|
@@ -79,7 +110,7 @@ body {
|
|
|
79
110
|
|
|
80
111
|
@media (prefers-color-scheme: dark) {
|
|
81
112
|
background: #000;
|
|
82
|
-
color: #fff;
|
|
113
|
+
color: #fff;
|
|
83
114
|
}
|
|
84
115
|
}
|
|
85
116
|
|
|
@@ -101,37 +132,37 @@ accent900: text in avatar
|
|
|
101
132
|
|
|
102
133
|
.bcc-chat-message-list {
|
|
103
134
|
height: 100%;
|
|
104
|
-
--cc__primary: #
|
|
105
|
-
--cc__background: #
|
|
135
|
+
--cc__primary: #cfeac8;
|
|
136
|
+
--cc__background: #f3faf7;
|
|
106
137
|
--cc__secondary: white;
|
|
107
138
|
--cc__accent: #004e48;
|
|
108
139
|
--cc__accent50: rgba(62, 142, 117, 0.04);
|
|
109
|
-
--cc__accent100: #
|
|
140
|
+
--cc__accent100: #ffffff;
|
|
110
141
|
--cc__accent200: rgba(62, 142, 117, 0.15);
|
|
111
142
|
--cc__accent300: rgba(62, 142, 117, 0.24);
|
|
112
143
|
--cc__accent400: rgba(62, 142, 117, 0.33);
|
|
113
144
|
--cc__accent500: rgba(62, 142, 117, 0.46);
|
|
114
|
-
--cc__accent600: #
|
|
115
|
-
--cc__accent700: #
|
|
145
|
+
--cc__accent600: #004e48;
|
|
146
|
+
--cc__accent700: #254a40;
|
|
116
147
|
--cc__accent800: rgba(62, 142, 117, 0.82);
|
|
117
|
-
--cc__accent900: #
|
|
148
|
+
--cc__accent900: #f3faf7;
|
|
118
149
|
--cc__text-color: #000;
|
|
119
150
|
|
|
120
151
|
@media (prefers-color-scheme: dark) {
|
|
121
|
-
--cc__primary: #
|
|
152
|
+
--cc__primary: #57639e;
|
|
122
153
|
--cc__background: hsl(230, 25%, 15%);
|
|
123
154
|
--cc__secondary: #111827;
|
|
124
|
-
--cc__accent: #
|
|
155
|
+
--cc__accent: #6274ae;
|
|
125
156
|
--cc__accent50: rgba(98, 116, 174, 0.24);
|
|
126
157
|
--cc__accent100: linear-gradient(45deg, #05070b 0%, #0c111c 100%);
|
|
127
158
|
--cc__accent200: rgba(98, 116, 174, 0.35);
|
|
128
159
|
--cc__accent300: rgba(98, 116, 174, 0.44);
|
|
129
160
|
--cc__accent400: rgba(98, 116, 174, 0.53);
|
|
130
161
|
--cc__accent500: rgba(98, 116, 174, 0.66);
|
|
131
|
-
--cc__accent600: #
|
|
132
|
-
--cc__accent700: #
|
|
162
|
+
--cc__accent600: #758abc;
|
|
163
|
+
--cc__accent700: #6274ae;
|
|
133
164
|
--cc__accent800: rgba(98, 116, 174, 0.92);
|
|
134
|
-
--cc__accent900: #
|
|
165
|
+
--cc__accent900: #f3faf7;
|
|
135
166
|
--cc__text-color: #fff;
|
|
136
167
|
}
|
|
137
168
|
|
|
@@ -143,6 +174,11 @@ accent900: text in avatar
|
|
|
143
174
|
.cc-messages-wrapper__messages-list {
|
|
144
175
|
height: calc(100% - 96px);
|
|
145
176
|
}
|
|
177
|
+
|
|
178
|
+
/* 1.1.2 Wrapper for Messages Composer */
|
|
179
|
+
.cc-messagecomposer-wrapper {
|
|
180
|
+
padding: 0;
|
|
181
|
+
}
|
|
146
182
|
}
|
|
147
183
|
}
|
|
148
184
|
|
|
@@ -170,7 +206,7 @@ accent900: text in avatar
|
|
|
170
206
|
display: flex;
|
|
171
207
|
justify-content: center;
|
|
172
208
|
align-items: center;
|
|
173
|
-
background: rgba(255,255,255,0.75);
|
|
209
|
+
background: rgba(255, 255, 255, 0.75);
|
|
174
210
|
border-radius: 12px;
|
|
175
211
|
}
|
|
176
212
|
}
|