@webitel/ui-chats 0.1.1 → 0.1.3
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 +5 -1
- package/src/config/config.ts +22 -0
- package/src/index.ts +1 -0
- package/src/locale/en/en.ts +2 -1
- package/src/locale/es/es.ts +10 -0
- package/src/locale/index.ts +23 -0
- package/src/locale/kz/kz.ts +10 -0
- package/src/locale/pl/pl.ts +10 -0
- package/src/locale/ro/ro.ts +10 -0
- package/src/locale/ru/ru.ts +10 -0
- package/src/locale/uk/uk.ts +10 -0
- package/src/locale/uz/uz.ts +10 -0
- package/src/locale/vi/vi.ts +10 -0
- package/src/ui/chat-footer/modules/user-input/components/chat-text-field.vue +4 -0
- package/src/ui/messaging/modules/message/components/details/chat-message-blocked-error.vue +0 -2
- package/types/config/config.d.ts +6 -0
- package/types/index.d.ts +1 -1
- package/types/locale/en/en.d.ts +1 -0
- package/types/locale/es/es.d.ts +11 -0
- package/types/locale/index.d.ts +102 -0
- package/types/locale/kz/kz.d.ts +11 -0
- package/types/locale/pl/pl.d.ts +11 -0
- package/types/locale/ro/ro.d.ts +11 -0
- package/types/locale/ru/ru.d.ts +11 -0
- package/types/locale/uk/uk.d.ts +11 -0
- package/types/locale/uz/uz.d.ts +11 -0
- package/types/locale/vi/vi.d.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-chats",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Reusable Webitel Frontend Code for Chats UI",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"../../",
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
"CHANGELOG.md"
|
|
50
50
|
],
|
|
51
51
|
"exports": {
|
|
52
|
+
".": {
|
|
53
|
+
"types": "./types/index.d.ts",
|
|
54
|
+
"import": "./src/index.ts"
|
|
55
|
+
},
|
|
52
56
|
"./ui": {
|
|
53
57
|
"types": "./types/ui/index.d.ts",
|
|
54
58
|
"import": "./src/ui/index.ts"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { I18n } from 'vue-i18n';
|
|
2
|
+
import { messages } from '../locale';
|
|
3
|
+
|
|
4
|
+
export type UiChatsConfig = {
|
|
5
|
+
i18n?: I18n;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const defaultConfig: UiChatsConfig = {
|
|
9
|
+
i18n: null,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const setConfig = (conf: UiChatsConfig) => {
|
|
13
|
+
Object.assign(defaultConfig, conf);
|
|
14
|
+
|
|
15
|
+
if (!conf.i18n?.global) {
|
|
16
|
+
throw new Error('i18n is required');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Object.entries(messages).forEach(([locale, localeMessages]) => {
|
|
20
|
+
conf.i18n.global.mergeLocaleMessage(locale, localeMessages);
|
|
21
|
+
});
|
|
22
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setConfig } from './config/config';
|
package/src/locale/en/en.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import en from './en/en';
|
|
2
|
+
import uk from './uk/uk';
|
|
3
|
+
import ru from './ru/ru';
|
|
4
|
+
import es from './es/es';
|
|
5
|
+
import kz from './kz/kz';
|
|
6
|
+
import pl from './pl/pl';
|
|
7
|
+
import ro from './ro/ro';
|
|
8
|
+
import uz from './uz/uz';
|
|
9
|
+
import vi from './vi/vi';
|
|
10
|
+
|
|
11
|
+
export const messages = {
|
|
12
|
+
en,
|
|
13
|
+
uk,
|
|
14
|
+
ru,
|
|
15
|
+
es,
|
|
16
|
+
kz,
|
|
17
|
+
pl,
|
|
18
|
+
ro,
|
|
19
|
+
uz,
|
|
20
|
+
vi,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { en, uk, ru, es, kz, pl, ro, uz, vi };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
ref="chatTextFieldInput"
|
|
4
4
|
class="chat-text-field"
|
|
5
5
|
:model-value="textModel"
|
|
6
|
+
:placeholder="t('@webitel/ui-chats.ui.messaging.textAreaPlaceholder')"
|
|
6
7
|
:size="size"
|
|
7
8
|
autoresize
|
|
8
9
|
@update:model-value="send"
|
|
@@ -16,9 +17,12 @@ import { ComponentSize } from "@webitel/ui-sdk/enums";
|
|
|
16
17
|
import insertTextAtCursor from "insert-text-at-cursor";
|
|
17
18
|
import type { Emitter } from "mitt";
|
|
18
19
|
import { computed, inject, type MaybeRef, useTemplateRef } from "vue";
|
|
20
|
+
import { useI18n } from "vue-i18n";
|
|
19
21
|
|
|
20
22
|
import type { UiChatsEmitterEvents } from "../../../../utils/emitter";
|
|
21
23
|
|
|
24
|
+
const { t } = useI18n();
|
|
25
|
+
|
|
22
26
|
const textModel = defineModel<MaybeRef<string>>("text", {
|
|
23
27
|
required: true,
|
|
24
28
|
});
|
package/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { setConfig } from './config/config';
|
package/types/locale/en/en.d.ts
CHANGED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import en from './en/en';
|
|
2
|
+
import uk from './uk/uk';
|
|
3
|
+
import ru from './ru/ru';
|
|
4
|
+
import es from './es/es';
|
|
5
|
+
import kz from './kz/kz';
|
|
6
|
+
import pl from './pl/pl';
|
|
7
|
+
import ro from './ro/ro';
|
|
8
|
+
import uz from './uz/uz';
|
|
9
|
+
import vi from './vi/vi';
|
|
10
|
+
export declare const messages: {
|
|
11
|
+
en: {
|
|
12
|
+
"@webitel/ui-chats": {
|
|
13
|
+
ui: {
|
|
14
|
+
messaging: {
|
|
15
|
+
chatsFileBlocked: string;
|
|
16
|
+
textAreaPlaceholder: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
uk: {
|
|
22
|
+
"@webitel/ui-chats": {
|
|
23
|
+
ui: {
|
|
24
|
+
messaging: {
|
|
25
|
+
chatsFileBlocked: string;
|
|
26
|
+
textAreaPlaceholder: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
ru: {
|
|
32
|
+
"@webitel/ui-chats": {
|
|
33
|
+
ui: {
|
|
34
|
+
messaging: {
|
|
35
|
+
chatsFileBlocked: string;
|
|
36
|
+
textAreaPlaceholder: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
es: {
|
|
42
|
+
"@webitel/ui-chats": {
|
|
43
|
+
ui: {
|
|
44
|
+
messaging: {
|
|
45
|
+
chatsFileBlocked: string;
|
|
46
|
+
textAreaPlaceholder: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
kz: {
|
|
52
|
+
"@webitel/ui-chats": {
|
|
53
|
+
ui: {
|
|
54
|
+
messaging: {
|
|
55
|
+
chatsFileBlocked: string;
|
|
56
|
+
textAreaPlaceholder: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
pl: {
|
|
62
|
+
"@webitel/ui-chats": {
|
|
63
|
+
ui: {
|
|
64
|
+
messaging: {
|
|
65
|
+
chatsFileBlocked: string;
|
|
66
|
+
textAreaPlaceholder: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
ro: {
|
|
72
|
+
"@webitel/ui-chats": {
|
|
73
|
+
ui: {
|
|
74
|
+
messaging: {
|
|
75
|
+
chatsFileBlocked: string;
|
|
76
|
+
textAreaPlaceholder: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
uz: {
|
|
82
|
+
"@webitel/ui-chats": {
|
|
83
|
+
ui: {
|
|
84
|
+
messaging: {
|
|
85
|
+
chatsFileBlocked: string;
|
|
86
|
+
textAreaPlaceholder: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
vi: {
|
|
92
|
+
"@webitel/ui-chats": {
|
|
93
|
+
ui: {
|
|
94
|
+
messaging: {
|
|
95
|
+
chatsFileBlocked: string;
|
|
96
|
+
textAreaPlaceholder: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export { en, uk, ru, es, kz, pl, ro, uz, vi };
|