@bcc-code/vue-bcc-chat-ui 1.6.1 → 1.6.3

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/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.6.1",
5
+ "version": "1.6.3",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { onBeforeMount, onMounted, onUnmounted, ref, nextTick, watch, Ref } from "vue";
3
3
  import chat from "../chat";
4
- import { connect, disconnect } from "../chat/connection";
4
+ import { connect, disconnect, connected } from "../chat/connection";
5
5
  import { loggedIn } from "../chat/login";
6
6
 
7
7
  import {
@@ -61,18 +61,17 @@ onUnmounted(async () => {
61
61
  });
62
62
 
63
63
  watch(
64
- [loggedIn, chat.connection.connected, chat.initialized, () => props.chatUid],
64
+ [loggedIn, connected, chat.initialized, () => props.chatUid],
65
65
  () => {
66
66
  loadData();
67
67
  }
68
68
  );
69
69
 
70
- // Loads data if chat is connected
70
+ // Loads data if logged in
71
71
  const loadData = async () => {
72
72
  if (
73
73
  loggedIn.value &&
74
- chat.initialized.value &&
75
- chat.connection.connected.value
74
+ chat.initialized.value
76
75
  ) {
77
76
  initTemplates();
78
77
  if (props.chatUid) {
@@ -101,7 +100,7 @@ const messageListConfiguration: Ref<any> = ref(null);
101
100
 
102
101
  // Templates cannot be initialized before CometChat is initiazlied
103
102
  // CometChatUIKit.getDataSource().getAllMessageTemplates() will return null before cometchat is initialized
104
- // So we postpone overriding the templates until cometchat is connected
103
+ // So we postpone overriding the templates until cometchat is logged in
105
104
  let templatesInitialized = false;
106
105
  const initTemplates = () => {
107
106
  if (templatesInitialized) {
@@ -192,7 +191,11 @@ function getMessageListConfiguration(): MessageListConfiguration {
192
191
  :hideDetails="true"
193
192
  :group="chatGroup"
194
193
  />
194
+ <div v-if="!connected" class="bcc-chat-message-composer-offline">
195
+ <span>Offline</span>
196
+ </div>
195
197
  </div>
198
+ <div class="bcc-chat-message-list-offline"><span>Waiting for connection...</span></div>
196
199
  </template>
197
200
 
198
201
  <style lang="scss">
@@ -219,7 +222,7 @@ accent900: text in avatar
219
222
 
220
223
  .bcc-chat-message-list {
221
224
  height: 100%;
222
- --cc__primary: linear-gradient(45deg, #CFEAC8 0%, #E7F5E3 100%);
225
+ --cc__primary: #CFEAC8;
223
226
  --cc__background: #F3FAF7;
224
227
  --cc__secondary: white;
225
228
  --cc__accent: #004e48;
@@ -236,15 +239,12 @@ accent900: text in avatar
236
239
  --cc__text-color: #000;
237
240
 
238
241
  @media (prefers-color-scheme: dark) {
239
- --cc__primary: linear-gradient(45deg, #3F4669 0%, #57639E 100%);
240
- --cc__background: linear-gradient(45deg, transparent 0%, rgba(63,70,105,0.8) 100%),
241
- linear-gradient(315deg, transparent 0%, #020A0B 100%),
242
- linear-gradient(135deg, transparent 0%, #020A0B 100%),
243
- #020A0B;
242
+ --cc__primary: #57639E;
243
+ --cc__background: hsl(230, 25%, 15%);
244
244
  --cc__secondary: #111827;
245
245
  --cc__accent: #6274AE;
246
246
  --cc__accent50: rgba(98, 116, 174, 0.24);
247
- --cc__accent100: linear-gradient(45deg, hsl(221, 39%, 6%) 0%, #111827 100%);
247
+ --cc__accent100: linear-gradient(45deg, #05070b 0%, #0c111c 100%);
248
248
  --cc__accent200: rgba(98, 116, 174, 0.35);
249
249
  --cc__accent300: rgba(98, 116, 174, 0.44);
250
250
  --cc__accent400: rgba(98, 116, 174, 0.53);
@@ -273,6 +273,42 @@ accent900: text in avatar
273
273
  border: 1px var(--cc__secondary) solid !important;
274
274
  }
275
275
  }
276
+ /* 2. Message for Messages Composer when offline */
277
+ .bcc-chat-message-composer-offline {
278
+ position: relative;
279
+ top: -96px;
280
+ height: 96px;
281
+ width: 100%;
282
+ box-sizing: border-box;
283
+ padding: 16px 14px;
284
+ color: rgb(176, 176, 176);
285
+ font: 700 1rem sans-serif;
286
+
287
+ /* 2.1 Text of Messages Composer offline view */
288
+ span {
289
+ width: 100%;
290
+ height: 100%;
291
+ display: flex;
292
+ justify-content: center;
293
+ align-items: center;
294
+ background: rgba(255,255,255,0.75);
295
+ border-radius: 12px;
296
+ }
297
+ }
298
+ }
299
+
300
+ .bcc-chat-message-list-offline {
301
+ position: absolute;
302
+ top: 0;
303
+ bottom: 0;
304
+ left: 0;
305
+ right: 0;
306
+ display: flex;
307
+ justify-content: center;
308
+ align-items: center;
309
+ font: 700 22px sans-serif;
310
+ color: #bcbcbc;
311
+ z-index: -1;
276
312
  }
277
313
 
278
314
  .cc-messagecomposer__emojikeyboard {