@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 +1 -1
- package/src/css/main.css +4 -0
- package/src/index.ts +1 -0
- package/src/ui/chat-footer/modules/user-input/components/actions/attach-files-action.vue +9 -8
- package/src/ui/chat-footer/modules/user-input/components/actions/send-message-action.vue +9 -7
- package/src/ui/messaging/modules/message/components/details/chat-message-image.vue +11 -12
- package/src/ui/messaging/modules/message/components/details/chat-message-player.vue +3 -14
- package/src/ui/messaging/modules/message/composables/useChatMessageFile.ts +2 -2
- package/types/index.d.ts +1 -0
- package/types/ui/messaging/modules/message/components/details/chat-message-image.vue.d.ts +1 -1
- package/types/ui/messaging/modules/message/composables/useChatMessageFile.d.ts +8 -1
package/package.json
CHANGED
package/src/css/main.css
ADDED
package/src/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wt-
|
|
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 {
|
|
21
|
-
import { ComponentSize } from
|
|
22
|
-
import { inject, useTemplateRef } from
|
|
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
|
|
25
|
+
import { ChatAction } from '../../enums/ChatAction.enum';
|
|
25
26
|
|
|
26
|
-
const size = inject<ComponentSize>(
|
|
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(
|
|
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-
|
|
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 {
|
|
14
|
-
import {
|
|
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
|
|
18
|
+
import { ChatAction } from '../../enums/ChatAction.enum';
|
|
17
19
|
|
|
18
|
-
const size = inject<ComponentSize>(
|
|
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
|
|
20
|
+
import { defineEmits, defineProps } from 'vue';
|
|
21
21
|
|
|
22
|
-
import type { ChatMessageFile } from
|
|
22
|
+
import type { ChatMessageFile } from '../../../../types/ChatMessage.types';
|
|
23
23
|
|
|
24
24
|
const props = defineProps<{
|
|
25
|
-
|
|
25
|
+
file: ChatMessageFile;
|
|
26
26
|
}>();
|
|
27
27
|
const emit = defineEmits<{
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
29
|
-
|
|
28
|
+
(isMediaType(fileType.value) || isMediaType(fileSrc.value)) &&
|
|
29
|
+
fileRef.value
|
|
30
30
|
);
|
|
31
31
|
});
|
|
32
32
|
|
package/types/index.d.ts
CHANGED
|
@@ -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<
|
|
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;
|