@webitel/ui-chats 0.1.24 → 0.1.26

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.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Reusable Webitel Frontend Code for Chats UI",
5
5
  "workspaces": [
6
6
  "../../",
@@ -2,6 +2,7 @@
2
2
  <wt-chat-emoji
3
3
  class="emoji-picker-action"
4
4
  :size="size"
5
+ popup-teleport-to=".chat-footer-wrapper"
5
6
  @insert-emoji="uiChatsEmitter!.emit('insertAtCursor', { text: $event })"
6
7
  />
7
8
  </template>
@@ -16,18 +17,4 @@ import type { UiChatsEmitterEvents } from '../../../../../utils/emitter';
16
17
 
17
18
  const size = inject<ComponentSize>('size');
18
19
  const uiChatsEmitter = inject<Emitter<UiChatsEmitterEvents>>('uiChatsEmitter');
19
- </script>
20
-
21
- <style lang="scss" scoped>
22
- $input-height: 48px; // https://webitel.atlassian.net/browse/WTEL-6149 (comments)
23
-
24
- .emoji-picker-action {
25
- ::v-deep emoji-picker {
26
- position: absolute;
27
- z-index: calc(var(--popup-wrapper-z-index) - 1);
28
- bottom: calc(100% + $input-height);
29
- left: 100%;
30
- transform: translateX(-50%);
31
- }
32
- }
33
- </style>
20
+ </script>
@@ -19,6 +19,7 @@
19
19
  v-for="(message, index) of props.messages"
20
20
  :key="message.id"
21
21
  :message="message"
22
+ :agent-name="props.agentName"
22
23
  :show-avatar="showAvatar(index)"
23
24
  :without-avatars="props.withoutAvatars"
24
25
  @[MessageAction.ClickOnImage]="clickOnImage(message)"
@@ -72,6 +73,7 @@ const props = withDefaults(
72
73
  next?: boolean;
73
74
  isLoading?: boolean;
74
75
  withoutAvatars?: boolean;
76
+ agentName?: string;
75
77
  }>(),
76
78
  {
77
79
  next: false,
@@ -15,7 +15,7 @@
15
15
  >
16
16
  <wt-avatar
17
17
  v-if="props.showAvatar"
18
- :username="username"
18
+ :username="getClientUsername"
19
19
  :size="ComponentSize.SM || size"
20
20
  :bot="isBot"
21
21
  />
@@ -80,6 +80,7 @@ const props = withDefaults(
80
80
  showAvatar?: boolean;
81
81
  withoutAvatars?: boolean;
82
82
  username?: string;
83
+ agentName?: string;
83
84
  }>(),
84
85
  {
85
86
  showAvatar: false,
@@ -106,6 +107,10 @@ const isSelfSide = computed<boolean>(
106
107
  );
107
108
  const isBot = computed<boolean>(() => props.message.member?.type === 'bot');
108
109
 
110
+ const getClientUsername = computed<string>(() => {
111
+ return isSelfSide.value ? props?.agentName : props.username;
112
+ });
113
+
109
114
  function handlePlayerInitialize(player) {
110
115
  emit(MessageAction.InitializedPlayer, {
111
116
  player,
@@ -16,6 +16,7 @@
16
16
  :next="props.canLoadNextMessages"
17
17
  :is-loading="props.isNextMessagesLoading"
18
18
  :without-avatars="props.withoutAvatars"
19
+ :agent-name="props.agentName"
19
20
  @[ChatAction.LoadNextMessages]="emit(ChatAction.LoadNextMessages)"
20
21
  />
21
22
  </slot>
@@ -79,6 +80,7 @@ const props = withDefaults(
79
80
  isNextMessagesLoading?: boolean;
80
81
  withoutAvatars?: boolean;
81
82
  readonly?: boolean; // hide chat footer with textarea and action-buttons
83
+ agentName?: string;
82
84
  }>(),
83
85
  {
84
86
  size: ComponentSize.MD,
@@ -4,6 +4,7 @@ type __VLS_Props = {
4
4
  next?: boolean;
5
5
  isLoading?: boolean;
6
6
  withoutAvatars?: boolean;
7
+ agentName?: string;
7
8
  };
8
9
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
10
  loadNextMessages: () => any;
@@ -4,6 +4,7 @@ type __VLS_Props = {
4
4
  showAvatar?: boolean;
5
5
  withoutAvatars?: boolean;
6
6
  username?: string;
7
+ agentName?: string;
7
8
  };
8
9
  declare var __VLS_1: {}, __VLS_52: {};
9
10
  type __VLS_Slots = {} & {