@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-chats",
3
- "version": "0.1.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';
@@ -2,7 +2,8 @@ export default {
2
2
  "@webitel/ui-chats": {
3
3
  ui: {
4
4
  messaging: {
5
- chatsFileBlocked: "TODO",
5
+ chatsFileBlocked: "File quarantined or blocked",
6
+ textAreaPlaceholder: "Write a message...",
6
7
  },
7
8
  },
8
9
  },
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Archivo en cuarentena o bloqueado",
6
+ textAreaPlaceholder: "Escribe un mensaje...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -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 };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Файл карантинде немесе бұғатталған",
6
+ textAreaPlaceholder: "Хабарлама жаз...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Plik w kwarantannie lub zablokowany",
6
+ textAreaPlaceholder: "Napisz wiadomość...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Fişier în carantină sau blocat",
6
+ textAreaPlaceholder: "Scrie un mesaj...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Файл в карантине или заблокирован",
6
+ textAreaPlaceholder: "Напишите сообщение...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Файл в карантині чи заблокований",
6
+ textAreaPlaceholder: "Напишіть повідомлення...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Fayl karantinda yoki bloklangan",
6
+ textAreaPlaceholder: "Xabar yozing...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: "Tệp bị cách ly hoặc bị chặn",
6
+ textAreaPlaceholder: "Viết tin nhắn...",
7
+ },
8
+ },
9
+ },
10
+ };
@@ -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
  });
@@ -4,9 +4,7 @@
4
4
  icon="protection-error"
5
5
  color="error"
6
6
  />
7
- <!-- TODO: move chat locales from cc-workspaces to this pkg -->
8
7
  <p>
9
- <!-- {{ t('workspaceSec.chat.chatsFileBlocked') }} -->
10
8
  {{ t('@webitel/ui-chats.ui.messaging.chatsFileBlocked') }}
11
9
  </p>
12
10
  </div>
@@ -0,0 +1,6 @@
1
+ import type { I18n } from 'vue-i18n';
2
+ export type UiChatsConfig = {
3
+ i18n?: I18n;
4
+ };
5
+ export declare const defaultConfig: UiChatsConfig;
6
+ export declare const setConfig: (conf: UiChatsConfig) => void;
package/types/index.d.ts CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export { setConfig } from './config/config';
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  ui: {
4
4
  messaging: {
5
5
  chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
6
7
  };
7
8
  };
8
9
  };
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;
@@ -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 };
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "@webitel/ui-chats": {
3
+ ui: {
4
+ messaging: {
5
+ chatsFileBlocked: string;
6
+ textAreaPlaceholder: string;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export default _default;