@webitel/ui-chats 0.0.19 → 0.0.21

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-chats",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Reusable Webitel Frontend Code for Chats UI",
5
5
  "workspaces": [
6
6
  "../../",
@@ -13,7 +13,7 @@
13
13
  v-if="props.next"
14
14
  :next="props.next"
15
15
  :loading="props.isLoading"
16
- @next="emit(ChatAction.LoadNextMessages)"
16
+ @[ChatAction.LoadNextMessages]="emit(ChatAction.LoadNextMessages)"
17
17
  />
18
18
  <chat-message
19
19
  v-for="(message, index) of props.messages"
@@ -95,10 +95,12 @@ function clickOnImage(message: ChatMessageType) {
95
95
  uiChatsEmitter!.emit("clickChatMessageImage", message);
96
96
  }
97
97
 
98
- onMounted(() => {
99
- nextTick(() => {
98
+ onMounted(async () => {
99
+ /* TODO: add loader on all chat(in the-chat-container?) and remove timeout after that */
100
+ await nextTick();
101
+ setTimeout(() => {
100
102
  scrollToBottom();
101
- });
103
+ }, 500);
102
104
  });
103
105
  </script>
104
106
 
@@ -90,18 +90,15 @@ const size = inject<ComponentSize>("size");
90
90
 
91
91
  const { image, media, document } = useChatMessageFile(props.message.file);
92
92
 
93
- const isSelfMessage = computed<boolean>(
93
+ const isSelfSide = computed<boolean>(
94
94
  () => props.message.member?.self || props.message.member?.type === "webitel",
95
95
  );
96
-
97
96
  const isBot = computed<boolean>(
98
97
  () =>
99
98
  props.message.member?.type === "bot" ||
100
99
  (!props.message.member?.type && !props.message.channelId),
101
100
  );
102
101
 
103
- const isSelfSide = computed<boolean>(() => isSelfMessage.value || isBot.value);
104
-
105
102
  const getClientUsername = computed<string>(() => {
106
103
  return !isSelfSide.value ? props.username : ""; // need to show username avatar only for client
107
104
  });
@@ -10,7 +10,7 @@
10
10
  @dragleave.prevent="handleDragLeave"
11
11
  @drop="sendFile"
12
12
  />
13
- <chat-messages-container
13
+ <messages-container
14
14
  :messages="props.messages"
15
15
  :next="props.canLoadNextMessages"
16
16
  :is-loading="props.isNextMessagesLoading"
@@ -59,7 +59,7 @@ import {
59
59
  type SharedActionSlots,
60
60
  } from "./chat-footer/modules/user-input/enums/ChatAction.enum";
61
61
  import Dropzone from "./messaging/components/dropzone.vue";
62
- import ChatMessagesContainer from "./messaging/components/the-chat-messages-container.vue";
62
+ import MessagesContainer from "./messaging/components/the-messages-container.vue";
63
63
  import { useDropzoneHandlers } from "./messaging/composables/useDropzoneHandlers";
64
64
  import { MessageAction } from "./messaging/modules/message/enums/MessageAction.enum";
65
65
  import type { ChatMessageType } from "./messaging/types/ChatMessage.types";
@@ -1,18 +1,40 @@
1
1
  import type { ChatMessageType } from "../types/ChatMessage.types";
2
2
  type __VLS_Props = {
3
- messages: ChatMessageType[];
4
- next?: boolean;
5
- isLoading?: boolean;
6
- withoutAvatars?: boolean;
3
+ messages: ChatMessageType[];
4
+ next?: boolean;
5
+ isLoading?: boolean;
6
+ withoutAvatars?: boolean;
7
7
  };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
- loadNextMessages: () => any;
10
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- onLoadNextMessages?: () => any;
12
- }>, {
13
- withoutAvatars: boolean;
14
- next: boolean;
15
- isLoading: boolean;
16
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const __VLS_export: import("vue").DefineComponent<
9
+ __VLS_Props,
10
+ {},
11
+ {},
12
+ {},
13
+ {},
14
+ import("vue").ComponentOptionsMixin,
15
+ import("vue").ComponentOptionsMixin,
16
+ {} & {
17
+ loadNextMessages: () => any;
18
+ },
19
+ string,
20
+ import("vue").PublicProps,
21
+ Readonly<__VLS_Props> &
22
+ Readonly<{
23
+ onLoadNextMessages?: () => any;
24
+ }>,
25
+ {
26
+ withoutAvatars: boolean;
27
+ next: boolean;
28
+ isLoading: boolean;
29
+ },
30
+ {},
31
+ {},
32
+ {},
33
+ string,
34
+ import("vue").ComponentProvideOptions,
35
+ false,
36
+ {},
37
+ any
38
+ >;
17
39
  declare const _default: typeof __VLS_export;
18
40
  export default _default;
@@ -0,0 +1,18 @@
1
+ import type { ChatMessageType } from "../types/ChatMessage.types";
2
+ type __VLS_Props = {
3
+ messages: ChatMessageType[];
4
+ next?: boolean;
5
+ isLoading?: boolean;
6
+ withoutAvatars?: boolean;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ loadNextMessages: () => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onLoadNextMessages?: () => any;
12
+ }>, {
13
+ withoutAvatars: boolean;
14
+ next: boolean;
15
+ isLoading: boolean;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;