@webitel/ui-chats 0.1.12 → 0.1.14

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.12",
3
+ "version": "0.1.14",
4
4
  "description": "Reusable Webitel Frontend Code for Chats UI",
5
5
  "workspaces": [
6
6
  "../../",
@@ -0,0 +1,4 @@
1
+ #app {
2
+ --chat-file-max-height: 280px;
3
+ --chat-file-max-width: 280px;
4
+ }
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
+ import './css/main.css';
1
2
  export { setConfig } from './config/config';
@@ -1,8 +1,9 @@
1
1
  <template>
2
- <wt-rounded-action
2
+ <wt-button
3
+ :size="size"
3
4
  icon="attach"
5
+ variant="outlined"
4
6
  color="secondary"
5
- :size="size"
6
7
  rounded
7
8
  wide
8
9
  @click="attachFilesInputRef!.click()"
@@ -17,18 +18,18 @@
17
18
  </template>
18
19
 
19
20
  <script setup lang="ts">
20
- import { WtRoundedAction } from "@webitel/ui-sdk/components";
21
- import { ComponentSize } from "@webitel/ui-sdk/enums";
22
- import { inject, useTemplateRef } from "vue";
21
+ import { WtButton } from '@webitel/ui-sdk/components';
22
+ import { ComponentSize } from '@webitel/ui-sdk/enums';
23
+ import { inject, useTemplateRef } from 'vue';
23
24
 
24
- import { ChatAction } from "../../enums/ChatAction.enum";
25
+ import { ChatAction } from '../../enums/ChatAction.enum';
25
26
 
26
- const size = inject<ComponentSize>("size");
27
+ const size = inject<ComponentSize>('size');
27
28
 
28
29
  const emit =
29
30
  defineEmits<(e: typeof ChatAction.AttachFiles, files: File[]) => void>();
30
31
 
31
- const attachFilesInputRef = useTemplateRef("attachFilesInput");
32
+ const attachFilesInputRef = useTemplateRef('attachFilesInput');
32
33
 
33
34
  const handleAttachmentInputChange = (event: Event) => {
34
35
  const files = (event.target as HTMLInputElement).files;
@@ -1,8 +1,9 @@
1
1
  <template>
2
- <wt-rounded-action
3
- icon="chat-send"
4
- color="accent"
2
+ <wt-button
5
3
  :size="size"
4
+ icon="chat-send"
5
+ color="secondary"
6
+ variant="outlined"
6
7
  rounded
7
8
  wide
8
9
  @click="emit(ChatAction.SendMessage)"
@@ -10,12 +11,13 @@
10
11
  </template>
11
12
 
12
13
  <script setup lang="ts">
13
- import { ComponentSize } from "@webitel/ui-sdk/enums";
14
- import { inject } from "vue";
14
+ import { WtButton } from '@webitel/ui-sdk/components';
15
+ import { ComponentSize } from '@webitel/ui-sdk/enums';
16
+ import { inject } from 'vue';
15
17
 
16
- import { ChatAction } from "../../enums/ChatAction.enum";
18
+ import { ChatAction } from '../../enums/ChatAction.enum';
17
19
 
18
- const size = inject<ComponentSize>("size");
20
+ const size = inject<ComponentSize>('size');
19
21
 
20
22
  const emit = defineEmits<(e: typeof ChatAction.SendMessage) => void>();
21
23
  </script>
@@ -17,32 +17,31 @@
17
17
  setup
18
18
  lang="ts"
19
19
  >
20
- import { defineEmits, defineProps } from "vue";
20
+ import { defineEmits, defineProps } from 'vue';
21
21
 
22
- import type { ChatMessageFile } from "../../../../types/ChatMessage.types";
22
+ import type { ChatMessageFile } from '../../../../types/ChatMessage.types';
23
23
 
24
24
  const props = defineProps<{
25
- file: ChatMessageFile;
25
+ file: ChatMessageFile;
26
26
  }>();
27
27
  const emit = defineEmits<{
28
- open: [
29
- ChatMessageFile,
30
- ];
28
+ open: [
29
+ ChatMessageFile,
30
+ ];
31
31
  }>();
32
32
  </script>
33
33
 
34
34
 
35
35
  <style
36
- lang="scss"
37
36
  scoped
38
37
  >
39
38
  .chat-message-image {
40
39
  cursor: pointer;
40
+ }
41
41
 
42
- &__img {
43
- max-height: var(--chat-file-max-height);
44
- max-width: var(--chat-file-max-width);
45
- width: 100%;
46
- }
42
+ .chat-message-image__img {
43
+ max-height: var(--chat-file-max-height);
44
+ max-width: var(--chat-file-max-width);
45
+ width: 100%;
47
46
  }
48
47
  </style>
@@ -60,19 +60,8 @@ function handlePlayerInitialize(player) {
60
60
  </script>
61
61
 
62
62
  <style lang="scss" scoped>
63
- $chat-file-max-width: 280px;
64
- $chat-file-max-height: 280px;
65
- .chat-message-player {
66
- .wt-player :deep(.plyr) {
67
- .wt-player__close-icon,
68
- .plyr__volume {
69
- display: none;
70
- }
71
-
72
- &.plyr--video {
73
- max-height: $chat-file-max-height;
74
- max-width: $chat-file-max-width;
75
- }
76
- }
63
+ .chat-message-player :deep(.wt-vidstack-player) {
64
+ max-height: var(--chat-file-max-height);
65
+ max-width: var(--chat-file-max-width);
77
66
  }
78
67
  </style>
@@ -25,8 +25,8 @@ export function useChatMessageFile(
25
25
  });
26
26
  const media = computed(() => {
27
27
  return (
28
- fileRef.value &&
29
- (isMediaType(fileType.value) || isMediaType(fileSrc.value))
28
+ (isMediaType(fileType.value) || isMediaType(fileSrc.value)) &&
29
+ fileRef.value
30
30
  );
31
31
  });
32
32
 
package/types/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ import './css/main.css';
1
2
  export { setConfig } from './config/config';
@@ -1,4 +1,4 @@
1
- import type { ChatMessageFile } from "../../../../types/ChatMessage.types";
1
+ import type { ChatMessageFile } from '../../../../types/ChatMessage.types';
2
2
  type __VLS_Props = {
3
3
  file: ChatMessageFile;
4
4
  };
@@ -2,7 +2,14 @@ import { type Ref } from 'vue';
2
2
  import type { ChatMessageFile } from '../../../types/ChatMessage.types';
3
3
  export declare function useChatMessageFile(file: ChatMessageFile | Ref<ChatMessageFile>): {
4
4
  image: import("vue").ComputedRef<ChatMessageFile>;
5
- media: import("vue").ComputedRef<boolean>;
5
+ media: import("vue").ComputedRef<ChatMessageFile | {
6
+ id?: string;
7
+ name?: string;
8
+ size?: string;
9
+ mime?: string;
10
+ url?: string;
11
+ streamUrl?: string;
12
+ }>;
6
13
  document: import("vue").ComputedRef<ChatMessageFile | {
7
14
  id?: string;
8
15
  name?: string;