@webitel/ui-chats 0.1.20 → 0.1.22
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 +8 -3
- package/src/index.ts +1 -0
- package/src/locale/en/en.ts +4 -3
- package/src/locale/es/es.ts +4 -3
- package/src/locale/index.ts +3 -3
- package/src/locale/kz/kz.ts +4 -3
- package/src/locale/pl/pl.ts +4 -3
- package/src/locale/ro/ro.ts +4 -3
- package/src/locale/ru/ru.ts +4 -3
- package/src/locale/uk/uk.ts +4 -3
- package/src/locale/uz/uz.ts +4 -3
- package/src/locale/vi/vi.ts +4 -3
- package/src/ui/chat-footer/components/chat-footer-wrapper.vue +1 -1
- package/src/ui/chat-footer/modules/user-input/components/actions/emoji-picker-action.vue +7 -7
- package/src/ui/chat-footer/modules/user-input/components/chat-input-actions-bar.vue +7 -7
- package/src/ui/chat-footer/modules/user-input/components/chat-text-field.vue +20 -16
- package/src/ui/chat-footer/modules/user-input/enums/ChatAction.enum.ts +6 -6
- package/src/ui/index.ts +2 -2
- package/src/ui/messaging/components/chat-date-divider.vue +8 -8
- package/src/ui/messaging/components/chat-observer.vue +1 -1
- package/src/ui/messaging/components/scroll-to-bottom-btn.vue +1 -1
- package/src/ui/messaging/components/the-messages-container.vue +37 -37
- package/src/ui/messaging/composables/useChatScroll.ts +7 -7
- package/src/ui/messaging/composables/useDropzoneHandlers.ts +1 -1
- package/src/ui/messaging/modules/message/components/chat-message.vue +11 -1
- package/src/ui/messaging/modules/message/components/details/chat-message-blocked-error.vue +1 -1
- package/src/ui/messaging/modules/message/components/details/chat-message-document.vue +6 -6
- package/src/ui/messaging/modules/message/components/details/chat-message-player.vue +2 -2
- package/src/ui/messaging/modules/message/components/details/chat-message-size-exceeded-error.vue +50 -0
- package/src/ui/messaging/modules/message/components/details/chat-message-text.vue +10 -10
- package/src/ui/messaging/modules/message/components/details/chat-message-time.vue +8 -8
- package/src/ui/messaging/modules/message/composables/useChatMessage.ts +4 -4
- package/src/ui/messaging/modules/message/enums/MessageAction.enum.ts +2 -2
- package/src/ui/the-chat-container.vue +2 -2
- package/src/ui/utils/ResultCallbacks.types.ts +1 -1
- package/src/ui/utils/emitter.ts +2 -2
- package/types/locale/en/en.d.ts +2 -1
- package/types/locale/es/es.d.ts +2 -1
- package/types/locale/index.d.ts +21 -12
- package/types/locale/kz/kz.d.ts +2 -1
- package/types/locale/pl/pl.d.ts +2 -1
- package/types/locale/ro/ro.d.ts +2 -1
- package/types/locale/ru/ru.d.ts +2 -1
- package/types/locale/uk/uk.d.ts +2 -1
- package/types/locale/uz/uz.d.ts +2 -1
- package/types/locale/vi/vi.d.ts +2 -1
- package/types/ui/chat-footer/components/chat-footer-wrapper.vue.d.ts +1 -1
- package/types/ui/chat-footer/modules/user-input/components/chat-input-actions-bar.vue.d.ts +1 -1
- package/types/ui/chat-footer/modules/user-input/components/chat-text-field.vue.d.ts +2 -2
- package/types/ui/messaging/components/the-messages-container.vue.d.ts +1 -1
- package/types/ui/messaging/composables/useChatScroll.d.ts +2 -2
- package/types/ui/messaging/composables/useDropzoneHandlers.d.ts +1 -1
- package/types/ui/messaging/modules/message/components/chat-message.vue.d.ts +2 -2
- package/types/ui/messaging/modules/message/components/details/chat-message-document.vue.d.ts +1 -1
- package/types/ui/messaging/modules/message/components/details/chat-message-size-exceeded-error.vue.d.ts +8 -0
- package/types/ui/messaging/modules/message/composables/useChatMessage.d.ts +2 -2
- package/types/ui/utils/emitter.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-chats",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Reusable Webitel Frontend Code for Chats UI",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"../../",
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
"make-all": "npm version patch --git-tag-version false && (npm run lint:biome || true) && (npm run build:types || true) && npm run utils:publish",
|
|
13
13
|
"build": "(npm run build:types || true)",
|
|
14
14
|
"build:types": "vue-tsc -p ./tsconfig.build.json",
|
|
15
|
-
"
|
|
15
|
+
"biome:ci:gh": "biome ci ./src --reporter=github",
|
|
16
|
+
"test:unit": "node -e \"process.exit(0)\"",
|
|
17
|
+
"lint": "biome ci ./src",
|
|
18
|
+
"test": "npm run test:unit",
|
|
19
|
+
"ci:check": "npm run biome:ci:gh && npm run test:unit",
|
|
20
|
+
"lint:biome": "biome check --write ./src",
|
|
16
21
|
"utils:publish": "npm publish --access public --tag ${NPM_TAG:-latest}"
|
|
17
22
|
},
|
|
18
23
|
"dependencies": {
|
|
@@ -20,7 +25,7 @@
|
|
|
20
25
|
"insert-text-at-cursor": "^0.3.0"
|
|
21
26
|
},
|
|
22
27
|
"devDependencies": {
|
|
23
|
-
"@biomejs/biome": "2.
|
|
28
|
+
"@biomejs/biome": "2.4.10",
|
|
24
29
|
"@types/node": "^24.10.0",
|
|
25
30
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
26
31
|
"@vue/tsconfig": "^0.8.1",
|
package/src/index.ts
CHANGED
package/src/locale/en/en.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'File quarantined or blocked',
|
|
6
|
+
chatsIncorrectFileSize: 'Incorrect file size',
|
|
7
|
+
textAreaPlaceholder: 'Write a message...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/es/es.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Archivo en cuarentena o bloqueado',
|
|
6
|
+
chatsIncorrectFileSize: 'Tamaño de archivo incorrecto',
|
|
7
|
+
textAreaPlaceholder: 'Escribe un mensaje...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import en from './en/en';
|
|
2
|
-
import uk from './uk/uk';
|
|
3
|
-
import ru from './ru/ru';
|
|
4
2
|
import es from './es/es';
|
|
5
3
|
import kz from './kz/kz';
|
|
6
4
|
import pl from './pl/pl';
|
|
7
5
|
import ro from './ro/ro';
|
|
6
|
+
import ru from './ru/ru';
|
|
7
|
+
import uk from './uk/uk';
|
|
8
8
|
import uz from './uz/uz';
|
|
9
9
|
import vi from './vi/vi';
|
|
10
10
|
|
|
@@ -20,4 +20,4 @@ export const messages = {
|
|
|
20
20
|
vi,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
export { en,
|
|
23
|
+
export { en, es, kz, pl, ro, ru, uk, uz, vi };
|
package/src/locale/kz/kz.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Файл карантинде немесе бұғатталған',
|
|
6
|
+
chatsIncorrectFileSize: 'Файл өлшемі қате',
|
|
7
|
+
textAreaPlaceholder: 'Хабарлама жаз...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/pl/pl.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Plik w kwarantannie lub zablokowany',
|
|
6
|
+
chatsIncorrectFileSize: 'Nieprawidłowy rozmiar pliku',
|
|
7
|
+
textAreaPlaceholder: 'Napisz wiadomość...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/ro/ro.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Fişier în carantină sau blocat',
|
|
6
|
+
chatsIncorrectFileSize: 'Dimensiune fișier incorectă',
|
|
7
|
+
textAreaPlaceholder: 'Scrie un mesaj...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/ru/ru.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Файл в карантине или заблокирован',
|
|
6
|
+
chatsIncorrectFileSize: 'Неверный размер файла',
|
|
7
|
+
textAreaPlaceholder: 'Напишите сообщение...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/uk/uk.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Файл в карантині чи заблокований',
|
|
6
|
+
chatsIncorrectFileSize: 'Неправильний розмір файлу',
|
|
7
|
+
textAreaPlaceholder: 'Напишіть повідомлення...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/uz/uz.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Fayl karantinda yoki bloklangan',
|
|
6
|
+
chatsIncorrectFileSize: "Fayl hajmi noto'g'ri",
|
|
7
|
+
textAreaPlaceholder: 'Xabar yozing...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
package/src/locale/vi/vi.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
'@webitel/ui-chats': {
|
|
3
3
|
ui: {
|
|
4
4
|
messaging: {
|
|
5
|
-
chatsFileBlocked:
|
|
6
|
-
|
|
5
|
+
chatsFileBlocked: 'Tệp bị cách ly hoặc bị chặn',
|
|
6
|
+
chatsIncorrectFileSize: 'Kích thước tệp không hợp lệ',
|
|
7
|
+
textAreaPlaceholder: 'Viết tin nhắn...',
|
|
7
8
|
},
|
|
8
9
|
},
|
|
9
10
|
},
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script setup lang="ts">
|
|
10
|
-
import { WtChatEmoji } from
|
|
11
|
-
import { ComponentSize } from
|
|
12
|
-
import type { Emitter } from
|
|
13
|
-
import { inject } from
|
|
10
|
+
import { WtChatEmoji } from '@webitel/ui-sdk/components';
|
|
11
|
+
import { ComponentSize } from '@webitel/ui-sdk/enums';
|
|
12
|
+
import type { Emitter } from 'mitt';
|
|
13
|
+
import { inject } from 'vue';
|
|
14
14
|
|
|
15
|
-
import type { UiChatsEmitterEvents } from
|
|
15
|
+
import type { UiChatsEmitterEvents } from '../../../../../utils/emitter';
|
|
16
16
|
|
|
17
|
-
const size = inject<ComponentSize>(
|
|
18
|
-
const uiChatsEmitter = inject<Emitter<UiChatsEmitterEvents>>(
|
|
17
|
+
const size = inject<ComponentSize>('size');
|
|
18
|
+
const uiChatsEmitter = inject<Emitter<UiChatsEmitterEvents>>('uiChatsEmitter');
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<style lang="scss" scoped>
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup lang="ts">
|
|
20
|
-
import { ComponentSize } from
|
|
21
|
-
import { computed, inject } from
|
|
20
|
+
import { ComponentSize } from '@webitel/ui-sdk/enums';
|
|
21
|
+
import { computed, inject } from 'vue';
|
|
22
22
|
|
|
23
|
-
import { ChatAction, type SharedActionSlots } from
|
|
24
|
-
import AttachFilesAction from
|
|
25
|
-
import EmojiPickerAction from
|
|
26
|
-
import SendMessageAction from
|
|
23
|
+
import { ChatAction, type SharedActionSlots } from '../enums/ChatAction.enum';
|
|
24
|
+
import AttachFilesAction from './actions/attach-files-action.vue';
|
|
25
|
+
import EmojiPickerAction from './actions/emoji-picker-action.vue';
|
|
26
|
+
import SendMessageAction from './actions/send-message-action.vue';
|
|
27
27
|
|
|
28
|
-
const size = inject<ComponentSize>(
|
|
28
|
+
const size = inject<ComponentSize>('size');
|
|
29
29
|
|
|
30
30
|
const props = defineProps<{
|
|
31
31
|
actions: ChatAction[];
|
|
@@ -12,36 +12,38 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup lang="ts">
|
|
15
|
-
import { WtTextarea } from
|
|
16
|
-
import { ComponentSize } from
|
|
17
|
-
import insertTextAtCursor from
|
|
18
|
-
import type { Emitter } from
|
|
19
|
-
import { computed, inject, type MaybeRef, useTemplateRef } from
|
|
20
|
-
import { useI18n } from
|
|
15
|
+
import { WtTextarea } from '@webitel/ui-sdk/components';
|
|
16
|
+
import { ComponentSize } from '@webitel/ui-sdk/enums';
|
|
17
|
+
import insertTextAtCursor from 'insert-text-at-cursor';
|
|
18
|
+
import type { Emitter } from 'mitt';
|
|
19
|
+
import { computed, inject, type MaybeRef, useTemplateRef } from 'vue';
|
|
20
|
+
import { useI18n } from 'vue-i18n';
|
|
21
21
|
|
|
22
|
-
import type { UiChatsEmitterEvents } from
|
|
22
|
+
import type { UiChatsEmitterEvents } from '../../../../utils/emitter';
|
|
23
23
|
|
|
24
24
|
const { t } = useI18n();
|
|
25
25
|
|
|
26
|
-
const textModel = defineModel<MaybeRef<string>>(
|
|
26
|
+
const textModel = defineModel<MaybeRef<string>>('text', {
|
|
27
27
|
required: true,
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
const size = inject<ComponentSize>(
|
|
31
|
-
const uiChatsEmitter = inject<Emitter<UiChatsEmitterEvents>>(
|
|
30
|
+
const size = inject<ComponentSize>('size');
|
|
31
|
+
const uiChatsEmitter = inject<Emitter<UiChatsEmitterEvents>>('uiChatsEmitter');
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
uiChatsEmitter
|
|
33
|
+
if (uiChatsEmitter) {
|
|
34
|
+
uiChatsEmitter.on('insertAtCursor', ({ text }) => insertAtCursor(text));
|
|
35
|
+
uiChatsEmitter.on('focusOnTextField', focus);
|
|
36
|
+
}
|
|
35
37
|
|
|
36
38
|
const emit = defineEmits<{
|
|
37
39
|
enter: [];
|
|
38
40
|
}>();
|
|
39
41
|
|
|
40
42
|
const chatTextFieldInputRef =
|
|
41
|
-
useTemplateRef<typeof WtTextarea>(
|
|
43
|
+
useTemplateRef<typeof WtTextarea>('chatTextFieldInput');
|
|
42
44
|
|
|
43
45
|
const textareaEl = computed(() =>
|
|
44
|
-
chatTextFieldInputRef.value?.$el.querySelector(
|
|
46
|
+
chatTextFieldInputRef.value?.$el.querySelector('textarea'),
|
|
45
47
|
);
|
|
46
48
|
|
|
47
49
|
function send(text: string) {
|
|
@@ -49,12 +51,14 @@ function send(text: string) {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
function focus() {
|
|
52
|
-
textareaEl.value
|
|
54
|
+
textareaEl.value?.focus();
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
function insertAtCursor(text: string) {
|
|
56
58
|
focus();
|
|
57
|
-
|
|
59
|
+
const textarea = textareaEl.value;
|
|
60
|
+
if (!textarea) return;
|
|
61
|
+
insertTextAtCursor(textarea, text);
|
|
58
62
|
}
|
|
59
63
|
</script>
|
|
60
64
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export const ChatAction = {
|
|
2
|
-
SendMessage:
|
|
3
|
-
AttachFiles:
|
|
4
|
-
EmojiPicker:
|
|
5
|
-
QuickReplies:
|
|
6
|
-
LoadNextMessages:
|
|
2
|
+
SendMessage: 'sendMessage',
|
|
3
|
+
AttachFiles: 'attachFiles',
|
|
4
|
+
EmojiPicker: 'emojiPicker',
|
|
5
|
+
QuickReplies: 'quickReplies',
|
|
6
|
+
LoadNextMessages: 'loadNextMessages',
|
|
7
7
|
} as const;
|
|
8
8
|
|
|
9
9
|
export type ChatAction = (typeof ChatAction)[keyof typeof ChatAction];
|
|
10
10
|
|
|
11
11
|
export type SharedActionSlots = {
|
|
12
|
-
[key in `action:${ChatAction}`]?: () =>
|
|
12
|
+
[key in `action:${ChatAction}`]?: () => unknown;
|
|
13
13
|
};
|
package/src/ui/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { ChatAction } from './chat-footer/modules/user-input/enums/ChatAction.enum';
|
|
2
|
+
export { useChatMessageFile } from './messaging/modules/message/composables/useChatMessageFile';
|
|
2
3
|
export { MessageAction } from './messaging/modules/message/enums/MessageAction.enum';
|
|
3
4
|
export type {
|
|
4
|
-
ChatMessageType,
|
|
5
5
|
ChatMessageFile,
|
|
6
|
+
ChatMessageType,
|
|
6
7
|
} from './messaging/types/ChatMessage.types';
|
|
7
8
|
export { default as ChatContainer } from './the-chat-container.vue';
|
|
8
|
-
export { useChatMessageFile } from './messaging/modules/message/composables/useChatMessageFile';
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
setup
|
|
9
9
|
lang="ts"
|
|
10
10
|
>
|
|
11
|
-
import { FormatDateMode } from
|
|
12
|
-
import { formatDate } from
|
|
13
|
-
import { computed } from
|
|
14
|
-
import { useI18n } from
|
|
11
|
+
import { FormatDateMode } from '@webitel/ui-sdk/enums';
|
|
12
|
+
import { formatDate } from '@webitel/ui-sdk/utils';
|
|
13
|
+
import { computed } from 'vue';
|
|
14
|
+
import { useI18n } from 'vue-i18n';
|
|
15
15
|
|
|
16
16
|
const props = defineProps<{
|
|
17
|
-
|
|
17
|
+
date: number | string;
|
|
18
18
|
}>();
|
|
19
19
|
|
|
20
20
|
const { t } = useI18n();
|
|
21
21
|
|
|
22
22
|
const formattedDate = computed<Date>(() => {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const chatDate = formatDate(+props.date, FormatDateMode.DATE);
|
|
24
|
+
const today = formatDate(Date.now(), FormatDateMode.DATE);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
return chatDate === today ? t('reusable.today') : chatDate;
|
|
27
27
|
});
|
|
28
28
|
</script>
|
|
29
29
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
|
-
import { ChatAction } from
|
|
12
|
+
import { ChatAction } from '../../chat-footer/modules/user-input/enums/ChatAction.enum';
|
|
13
13
|
|
|
14
14
|
const props = withDefaults(
|
|
15
15
|
defineProps<{
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
setup
|
|
44
44
|
lang="ts"
|
|
45
45
|
>
|
|
46
|
-
import type { Emitter } from
|
|
46
|
+
import type { Emitter } from 'mitt';
|
|
47
47
|
import {
|
|
48
48
|
computed,
|
|
49
49
|
defineProps,
|
|
@@ -51,68 +51,68 @@ import {
|
|
|
51
51
|
nextTick,
|
|
52
52
|
onMounted,
|
|
53
53
|
useTemplateRef,
|
|
54
|
-
} from
|
|
54
|
+
} from 'vue';
|
|
55
55
|
|
|
56
|
-
import { ChatAction } from
|
|
57
|
-
import type { UiChatsEmitterEvents } from
|
|
58
|
-
import { useChatScroll } from
|
|
59
|
-
import ChatMessage from
|
|
60
|
-
import { useChatMessages } from
|
|
61
|
-
import { MessageAction } from
|
|
62
|
-
import type { ChatMessageType } from
|
|
63
|
-
import ChatDateDivider from
|
|
64
|
-
import ChatObserver from
|
|
65
|
-
import ScrollToBottomBtn from
|
|
56
|
+
import { ChatAction } from '../../chat-footer/modules/user-input/enums/ChatAction.enum';
|
|
57
|
+
import type { UiChatsEmitterEvents } from '../../utils/emitter';
|
|
58
|
+
import { useChatScroll } from '../composables/useChatScroll';
|
|
59
|
+
import ChatMessage from '../modules/message/components/chat-message.vue';
|
|
60
|
+
import { useChatMessages } from '../modules/message/composables/useChatMessage';
|
|
61
|
+
import { MessageAction } from '../modules/message/enums/MessageAction.enum';
|
|
62
|
+
import type { ChatMessageType } from '../types/ChatMessage.types';
|
|
63
|
+
import ChatDateDivider from './chat-date-divider.vue';
|
|
64
|
+
import ChatObserver from './chat-observer.vue';
|
|
65
|
+
import ScrollToBottomBtn from './scroll-to-bottom-btn.vue';
|
|
66
66
|
|
|
67
|
-
const uiChatsEmitter = inject<Emitter<UiChatsEmitterEvents>>(
|
|
67
|
+
const uiChatsEmitter = inject<Emitter<UiChatsEmitterEvents>>('uiChatsEmitter');
|
|
68
68
|
|
|
69
69
|
const props = withDefaults(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
defineProps<{
|
|
71
|
+
messages: ChatMessageType[];
|
|
72
|
+
next?: boolean;
|
|
73
|
+
isLoading?: boolean;
|
|
74
|
+
withoutAvatars?: boolean;
|
|
75
|
+
}>(),
|
|
76
|
+
{
|
|
77
|
+
next: false,
|
|
78
|
+
isLoading: false,
|
|
79
|
+
withoutAvatars: false,
|
|
80
|
+
},
|
|
81
81
|
);
|
|
82
82
|
|
|
83
83
|
const emit = defineEmits<(e: typeof ChatAction.LoadNextMessages) => void>();
|
|
84
84
|
|
|
85
|
-
const messagesContainer = useTemplateRef(
|
|
85
|
+
const messagesContainer = useTemplateRef('messages-container');
|
|
86
86
|
|
|
87
87
|
const { showAvatar, showChatDate } = useChatMessages(
|
|
88
88
|
computed(() => props.messages),
|
|
89
89
|
); // props values reactivity https://stackoverflow.com/questions/72408463/use-props-in-composables-vue3 @author ye.pohranichna
|
|
90
90
|
|
|
91
91
|
const {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
showScrollToBottomBtn,
|
|
93
|
+
newUnseenMessagesCount,
|
|
94
|
+
scrollToBottom,
|
|
95
|
+
handleChatScroll,
|
|
96
|
+
handleChatResize,
|
|
97
97
|
} = useChatScroll(
|
|
98
98
|
messagesContainer,
|
|
99
99
|
computed(() => props.messages), // props values reactivity https://stackoverflow.com/questions/72408463/use-props-in-composables-vue3 @author ye.pohranichna
|
|
100
100
|
);
|
|
101
101
|
|
|
102
102
|
function focusOnInput() {
|
|
103
|
-
|
|
103
|
+
uiChatsEmitter?.on('focusOnTextField', focus);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
function clickOnImage(message: ChatMessageType) {
|
|
107
|
-
|
|
107
|
+
uiChatsEmitter?.emit('clickChatMessageImage', message);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
onMounted(async () => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
/* TODO: add loader on all chat(in the-chat-container?) and remove timeout after that */
|
|
112
|
+
await nextTick();
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
scrollToBottom();
|
|
115
|
+
}, 500);
|
|
116
116
|
});
|
|
117
117
|
</script>
|
|
118
118
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useScroll } from
|
|
2
|
-
import { type ComputedRef, computed, type Ref, ref, watch } from
|
|
1
|
+
import { useScroll } from '@vueuse/core';
|
|
2
|
+
import { type ComputedRef, computed, type Ref, ref, watch } from 'vue';
|
|
3
3
|
|
|
4
|
-
import type { ChatMessageType } from
|
|
4
|
+
import type { ChatMessageType } from '../types/ChatMessage.types';
|
|
5
5
|
|
|
6
6
|
export const useChatScroll = (
|
|
7
7
|
element: Ref<HTMLElement | null> = null,
|
|
@@ -64,16 +64,16 @@ export const useChatScroll = (
|
|
|
64
64
|
|
|
65
65
|
const handleBtnAfterNewMessage = () => {
|
|
66
66
|
if (arrivedState.bottom || isLastMessageIsMy.value) {
|
|
67
|
-
scrollToBottom(
|
|
67
|
+
scrollToBottom('smooth');
|
|
68
68
|
} else {
|
|
69
69
|
newUnseenMessagesCount.value += 1;
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const scrollToBottom = (behavior: ScrollBehavior =
|
|
73
|
+
const scrollToBottom = (behavior: ScrollBehavior = 'instant') => {
|
|
74
74
|
element?.value.scrollTo({
|
|
75
75
|
top: element?.value.scrollHeight,
|
|
76
|
-
behavior: behavior ===
|
|
76
|
+
behavior: behavior === 'instant' ? 'auto' : behavior,
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
newUnseenMessagesCount.value = 0;
|
|
@@ -87,7 +87,7 @@ export const useChatScroll = (
|
|
|
87
87
|
if (newMessageReceived) handleBtnAfterNewMessage();
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
|
-
flush:
|
|
90
|
+
flush: 'post',
|
|
91
91
|
},
|
|
92
92
|
);
|
|
93
93
|
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
<!-- click.stop prevents focus on textarea and allows to select the message-new text -->
|
|
25
25
|
<message-blocked-error v-if="message.file?.malware" @click.stop />
|
|
26
|
+
<message-size-exceeded-error
|
|
27
|
+
v-else-if="isFileSizeExceeded"
|
|
28
|
+
:self-side="isSelfSide"
|
|
29
|
+
@click.stop
|
|
30
|
+
/>
|
|
26
31
|
<div v-else @click.stop>
|
|
27
32
|
<message-player
|
|
28
33
|
v-if="media"
|
|
@@ -66,6 +71,7 @@ import MessageBlockedError from './details/chat-message-blocked-error.vue';
|
|
|
66
71
|
import MessageDocument from './details/chat-message-document.vue';
|
|
67
72
|
import MessageImage from './details/chat-message-image.vue';
|
|
68
73
|
import MessagePlayer from './details/chat-message-player.vue';
|
|
74
|
+
import MessageSizeExceededError from './details/chat-message-size-exceeded-error.vue';
|
|
69
75
|
import MessageText from './details/chat-message-text.vue';
|
|
70
76
|
import MessageTime from './details/chat-message-time.vue';
|
|
71
77
|
|
|
@@ -92,6 +98,10 @@ const size = inject<ComponentSize>('size');
|
|
|
92
98
|
|
|
93
99
|
const { image, media, document } = useChatMessageFile(props.message.file);
|
|
94
100
|
|
|
101
|
+
const isFileSizeExceeded = computed<boolean>(
|
|
102
|
+
() => !!props.message.file && !props.message.file?.size,
|
|
103
|
+
);
|
|
104
|
+
|
|
95
105
|
const isSelfSide = computed<boolean>(
|
|
96
106
|
() => props.message.member?.self || props.message.member?.type === 'webitel',
|
|
97
107
|
);
|
|
@@ -135,7 +145,7 @@ function handlePlayerInitialize(player) {
|
|
|
135
145
|
.chat-message__avatar-wrapper {
|
|
136
146
|
flex: 0 0 var(--spacing-lg);
|
|
137
147
|
width: var(--wt-avatar-size--size-sm);
|
|
138
|
-
pointer-events: none;
|
|
148
|
+
pointer-events: none; /* prevents dragging to upload file area */
|
|
139
149
|
}
|
|
140
150
|
|
|
141
151
|
.chat-message--right .chat-message__content {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script setup lang="ts">
|
|
22
|
-
import { prettifyFileSize } from
|
|
23
|
-
import { computed, defineProps } from
|
|
22
|
+
import { prettifyFileSize } from '@webitel/ui-sdk/scripts';
|
|
23
|
+
import { computed, defineProps } from 'vue';
|
|
24
24
|
|
|
25
|
-
import type { ChatMessageFile } from
|
|
25
|
+
import type { ChatMessageFile } from '../../../../types/ChatMessage.types';
|
|
26
26
|
|
|
27
27
|
const props = withDefaults(
|
|
28
28
|
defineProps<{
|
|
@@ -34,15 +34,15 @@ const props = withDefaults(
|
|
|
34
34
|
},
|
|
35
35
|
);
|
|
36
36
|
const documentSize = computed(() => {
|
|
37
|
-
if (!props.file) return
|
|
37
|
+
if (!props.file) return '';
|
|
38
38
|
return prettifyFileSize(props.file.size);
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
function downloadDocument() {
|
|
42
42
|
if (!props.file) return;
|
|
43
|
-
const a = document.createElement(
|
|
43
|
+
const a = document.createElement('a');
|
|
44
44
|
a.href = props.file.url;
|
|
45
|
-
a.target =
|
|
45
|
+
a.target = '_blank';
|
|
46
46
|
a.download = props.file.name;
|
|
47
47
|
a.click();
|
|
48
48
|
}
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup lang="ts">
|
|
29
|
-
import {
|
|
30
|
-
import { WtVidstackPlayer, WtPlayer } from '@webitel/ui-sdk/components';
|
|
29
|
+
import { WtPlayer, WtVidstackPlayer } from '@webitel/ui-sdk/components';
|
|
31
30
|
import { ComponentSize } from '@webitel/ui-sdk/enums';
|
|
31
|
+
import { computed, defineEmits, defineProps } from 'vue';
|
|
32
32
|
|
|
33
33
|
import type { ChatMessageFile } from '../../../../types/ChatMessage.types';
|
|
34
34
|
|
package/src/ui/messaging/modules/message/components/details/chat-message-size-exceeded-error.vue
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="chat-message-size-exceeded-error typo-body-1"
|
|
4
|
+
:class="{
|
|
5
|
+
'chat-message-size-exceeded-error--right': selfSide,
|
|
6
|
+
}"
|
|
7
|
+
>
|
|
8
|
+
<wt-icon
|
|
9
|
+
icon="violation"
|
|
10
|
+
color="error"
|
|
11
|
+
/>
|
|
12
|
+
<p>
|
|
13
|
+
{{ t('@webitel/ui-chats.ui.messaging.chatsIncorrectFileSize') }}
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { useI18n } from 'vue-i18n';
|
|
20
|
+
|
|
21
|
+
const { t } = useI18n();
|
|
22
|
+
|
|
23
|
+
interface IChatMessageSizeExceededErrorProps {
|
|
24
|
+
selfSide?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const props = withDefaults(defineProps<IChatMessageSizeExceededErrorProps>(), {
|
|
28
|
+
selfSide: false,
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style scoped lang="scss">
|
|
33
|
+
.chat-message-size-exceeded-error {
|
|
34
|
+
background: var(--primary-light-color);
|
|
35
|
+
border-radius: var(--spacing-xs);
|
|
36
|
+
padding: var(--spacing-xs);
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: var(--spacing-xs);
|
|
41
|
+
white-space: pre-line;
|
|
42
|
+
text-align: center;
|
|
43
|
+
|
|
44
|
+
&--right {
|
|
45
|
+
background: var(--secondary-light-color);
|
|
46
|
+
color: var(--secondary-on-color);
|
|
47
|
+
place-self: flex-end;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
setup
|
|
10
10
|
lang="ts"
|
|
11
11
|
>
|
|
12
|
-
import Autolinker from
|
|
13
|
-
import { computed, defineProps } from
|
|
12
|
+
import Autolinker from 'autolinker';
|
|
13
|
+
import { computed, defineProps } from 'vue';
|
|
14
14
|
|
|
15
15
|
const props = defineProps<{
|
|
16
|
-
|
|
16
|
+
text: string;
|
|
17
17
|
}>();
|
|
18
18
|
|
|
19
19
|
const text = computed(() => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
// ATTENTION: not all libs are suitable for this case, because we want to preserve "<" signs
|
|
21
|
+
// https://my.webitel.com/browse/DEV-2848
|
|
22
|
+
return Autolinker.link(props.text, {
|
|
23
|
+
newWindow: true,
|
|
24
|
+
sanitizeHtml: true, // DONT FORGET TO SANITIZE, OR USE DOM PURIFY
|
|
25
|
+
className: 'chat-message-new-text__link',
|
|
26
|
+
});
|
|
27
27
|
});
|
|
28
28
|
</script>
|
|
29
29
|
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
setup
|
|
12
12
|
lang="ts"
|
|
13
13
|
>
|
|
14
|
-
import { prettifyTime } from
|
|
15
|
-
import { computed, defineProps } from
|
|
14
|
+
import { prettifyTime } from '@webitel/ui-sdk/scripts';
|
|
15
|
+
import { computed, defineProps } from 'vue';
|
|
16
16
|
|
|
17
17
|
const props = withDefaults(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
defineProps<{
|
|
19
|
+
date?: string | number; // timestamp
|
|
20
|
+
}>(),
|
|
21
|
+
{
|
|
22
|
+
date: '',
|
|
23
|
+
},
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
const time = computed(() => prettifyTime(props.date));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FormatDateMode } from
|
|
2
|
-
import { formatDate } from
|
|
3
|
-
import {
|
|
1
|
+
import { FormatDateMode } from '@webitel/ui-sdk/enums';
|
|
2
|
+
import { formatDate } from '@webitel/ui-sdk/utils';
|
|
3
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
4
4
|
|
|
5
|
-
import type { ChatMessageType } from
|
|
5
|
+
import type { ChatMessageType } from '../../../types/ChatMessage.types';
|
|
6
6
|
|
|
7
7
|
interface GetMessageResult {
|
|
8
8
|
prevMessage?: ChatMessageType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const MessageAction = {
|
|
2
|
-
ClickOnImage:
|
|
3
|
-
InitializedPlayer:
|
|
2
|
+
ClickOnImage: 'clickOnImage',
|
|
3
|
+
InitializedPlayer: 'initializedPlayer',
|
|
4
4
|
} as const;
|
|
5
5
|
|
|
6
6
|
export type MessageAction = (typeof MessageAction)[keyof typeof MessageAction];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ResultCallbacks } from
|
|
1
|
+
export { ResultCallbacks } from '@webitel/ui-sdk/src/types';
|
package/src/ui/utils/emitter.ts
CHANGED
package/types/locale/en/en.d.ts
CHANGED
package/types/locale/es/es.d.ts
CHANGED
package/types/locale/index.d.ts
CHANGED
|
@@ -1,102 +1,111 @@
|
|
|
1
1
|
import en from './en/en';
|
|
2
|
-
import uk from './uk/uk';
|
|
3
|
-
import ru from './ru/ru';
|
|
4
2
|
import es from './es/es';
|
|
5
3
|
import kz from './kz/kz';
|
|
6
4
|
import pl from './pl/pl';
|
|
7
5
|
import ro from './ro/ro';
|
|
6
|
+
import ru from './ru/ru';
|
|
7
|
+
import uk from './uk/uk';
|
|
8
8
|
import uz from './uz/uz';
|
|
9
9
|
import vi from './vi/vi';
|
|
10
10
|
export declare const messages: {
|
|
11
11
|
en: {
|
|
12
|
-
|
|
12
|
+
'@webitel/ui-chats': {
|
|
13
13
|
ui: {
|
|
14
14
|
messaging: {
|
|
15
15
|
chatsFileBlocked: string;
|
|
16
|
+
chatsIncorrectFileSize: string;
|
|
16
17
|
textAreaPlaceholder: string;
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
22
|
uk: {
|
|
22
|
-
|
|
23
|
+
'@webitel/ui-chats': {
|
|
23
24
|
ui: {
|
|
24
25
|
messaging: {
|
|
25
26
|
chatsFileBlocked: string;
|
|
27
|
+
chatsIncorrectFileSize: string;
|
|
26
28
|
textAreaPlaceholder: string;
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
33
|
ru: {
|
|
32
|
-
|
|
34
|
+
'@webitel/ui-chats': {
|
|
33
35
|
ui: {
|
|
34
36
|
messaging: {
|
|
35
37
|
chatsFileBlocked: string;
|
|
38
|
+
chatsIncorrectFileSize: string;
|
|
36
39
|
textAreaPlaceholder: string;
|
|
37
40
|
};
|
|
38
41
|
};
|
|
39
42
|
};
|
|
40
43
|
};
|
|
41
44
|
es: {
|
|
42
|
-
|
|
45
|
+
'@webitel/ui-chats': {
|
|
43
46
|
ui: {
|
|
44
47
|
messaging: {
|
|
45
48
|
chatsFileBlocked: string;
|
|
49
|
+
chatsIncorrectFileSize: string;
|
|
46
50
|
textAreaPlaceholder: string;
|
|
47
51
|
};
|
|
48
52
|
};
|
|
49
53
|
};
|
|
50
54
|
};
|
|
51
55
|
kz: {
|
|
52
|
-
|
|
56
|
+
'@webitel/ui-chats': {
|
|
53
57
|
ui: {
|
|
54
58
|
messaging: {
|
|
55
59
|
chatsFileBlocked: string;
|
|
60
|
+
chatsIncorrectFileSize: string;
|
|
56
61
|
textAreaPlaceholder: string;
|
|
57
62
|
};
|
|
58
63
|
};
|
|
59
64
|
};
|
|
60
65
|
};
|
|
61
66
|
pl: {
|
|
62
|
-
|
|
67
|
+
'@webitel/ui-chats': {
|
|
63
68
|
ui: {
|
|
64
69
|
messaging: {
|
|
65
70
|
chatsFileBlocked: string;
|
|
71
|
+
chatsIncorrectFileSize: string;
|
|
66
72
|
textAreaPlaceholder: string;
|
|
67
73
|
};
|
|
68
74
|
};
|
|
69
75
|
};
|
|
70
76
|
};
|
|
71
77
|
ro: {
|
|
72
|
-
|
|
78
|
+
'@webitel/ui-chats': {
|
|
73
79
|
ui: {
|
|
74
80
|
messaging: {
|
|
75
81
|
chatsFileBlocked: string;
|
|
82
|
+
chatsIncorrectFileSize: string;
|
|
76
83
|
textAreaPlaceholder: string;
|
|
77
84
|
};
|
|
78
85
|
};
|
|
79
86
|
};
|
|
80
87
|
};
|
|
81
88
|
uz: {
|
|
82
|
-
|
|
89
|
+
'@webitel/ui-chats': {
|
|
83
90
|
ui: {
|
|
84
91
|
messaging: {
|
|
85
92
|
chatsFileBlocked: string;
|
|
93
|
+
chatsIncorrectFileSize: string;
|
|
86
94
|
textAreaPlaceholder: string;
|
|
87
95
|
};
|
|
88
96
|
};
|
|
89
97
|
};
|
|
90
98
|
};
|
|
91
99
|
vi: {
|
|
92
|
-
|
|
100
|
+
'@webitel/ui-chats': {
|
|
93
101
|
ui: {
|
|
94
102
|
messaging: {
|
|
95
103
|
chatsFileBlocked: string;
|
|
104
|
+
chatsIncorrectFileSize: string;
|
|
96
105
|
textAreaPlaceholder: string;
|
|
97
106
|
};
|
|
98
107
|
};
|
|
99
108
|
};
|
|
100
109
|
};
|
|
101
110
|
};
|
|
102
|
-
export { en,
|
|
111
|
+
export { en, es, kz, pl, ro, ru, uk, uz, vi };
|
package/types/locale/kz/kz.d.ts
CHANGED
package/types/locale/pl/pl.d.ts
CHANGED
package/types/locale/ro/ro.d.ts
CHANGED
package/types/locale/ru/ru.d.ts
CHANGED
package/types/locale/uk/uk.d.ts
CHANGED
package/types/locale/uz/uz.d.ts
CHANGED
package/types/locale/vi/vi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type __VLS_Slots = {
|
|
2
|
-
default: () =>
|
|
2
|
+
default: () => unknown;
|
|
3
3
|
};
|
|
4
4
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
5
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type MaybeRef } from
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
2
|
type __VLS_ModelProps = {
|
|
3
|
-
|
|
3
|
+
'text': MaybeRef<string>;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
6
|
enter: () => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ComputedRef, type Ref } from
|
|
2
|
-
import type { ChatMessageType } from
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { ChatMessageType } from '../types/ChatMessage.types';
|
|
3
3
|
export declare const useChatScroll: (element: Ref<HTMLElement | null>, messages: Ref<ChatMessageType[]> | ComputedRef<ChatMessageType[]>) => {
|
|
4
4
|
showScrollToBottomBtn: Ref<boolean, boolean>;
|
|
5
5
|
newUnseenMessagesCount: Ref<number, number>;
|
|
@@ -5,11 +5,11 @@ type __VLS_Props = {
|
|
|
5
5
|
withoutAvatars?: boolean;
|
|
6
6
|
username?: string;
|
|
7
7
|
};
|
|
8
|
-
declare var __VLS_1: {},
|
|
8
|
+
declare var __VLS_1: {}, __VLS_52: {};
|
|
9
9
|
type __VLS_Slots = {} & {
|
|
10
10
|
'before-message'?: (props: typeof __VLS_1) => any;
|
|
11
11
|
} & {
|
|
12
|
-
'after-message'?: (props: typeof
|
|
12
|
+
'after-message'?: (props: typeof __VLS_52) => any;
|
|
13
13
|
};
|
|
14
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
15
|
clickOnImage: () => any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface IChatMessageSizeExceededErrorProps {
|
|
2
|
+
selfSide?: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<IChatMessageSizeExceededErrorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IChatMessageSizeExceededErrorProps> & Readonly<{}>, {
|
|
5
|
+
selfSide: boolean;
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ChatMessageType } from
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type { ChatMessageType } from '../../../types/ChatMessage.types';
|
|
3
3
|
interface GetMessageResult {
|
|
4
4
|
prevMessage?: ChatMessageType;
|
|
5
5
|
message?: ChatMessageType;
|