@mobilon-dev/chotto 0.3.91 → 0.3.92
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/dist/chotto.css +1 -1
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +196 -179
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +199 -187
- package/dist/hooks/useMessageDraft.js +54 -49
- package/dist/index.js +91 -90
- package/dist/locale/en.js +1 -0
- package/dist/locale/ru.js +1 -0
- package/dist/node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js +106 -106
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/components/2_chatlist_elements/ChatItem/styles/types.d.ts +6 -0
- package/dist/types/hooks/useMessageDraft.d.ts +3 -0
- package/dist/types/locale/en.d.ts +1 -0
- package/dist/types/locale/ru.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,44 +1,48 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
function E(
|
|
1
|
+
import { ref as x, getCurrentInstance as R, inject as h, computed as S, unref as D, watch as C } from "vue";
|
|
2
|
+
const o = x([]);
|
|
3
|
+
function E(s) {
|
|
4
4
|
return {
|
|
5
|
-
id:
|
|
5
|
+
id: s,
|
|
6
6
|
text: "",
|
|
7
7
|
file: void 0,
|
|
8
8
|
forceSend: !1,
|
|
9
9
|
isRecording: !1
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
return
|
|
12
|
+
function u(s) {
|
|
13
|
+
const t = o.value.find((a) => a.id === s);
|
|
14
|
+
if (t) return t;
|
|
15
|
+
const i = E(s);
|
|
16
|
+
return o.value.push(i), i;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function j(s, t) {
|
|
19
|
+
if (!(t == null || t === ""))
|
|
20
|
+
return o.value.find((i) => i.id === `${s}:${t}`);
|
|
21
|
+
}
|
|
22
|
+
function F(s, t) {
|
|
19
23
|
if (typeof document > "u") return;
|
|
20
|
-
const
|
|
21
|
-
|
|
24
|
+
const i = document.getElementById("chat-input-reply-line-" + s);
|
|
25
|
+
i && (i.style.display = t.reply || t.edit ? "inherit" : "none");
|
|
22
26
|
}
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const e =
|
|
26
|
-
return
|
|
27
|
+
const B = (s) => {
|
|
28
|
+
const t = R() ? h("selectedChat", void 0) : void 0, i = S(() => {
|
|
29
|
+
const e = t ? D(t) : void 0, n = e == null ? void 0 : e.chatId;
|
|
30
|
+
return n == null || n === "" ? s : `${s}:${n}`;
|
|
27
31
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(e,
|
|
31
|
-
const
|
|
32
|
-
|
|
32
|
+
C(
|
|
33
|
+
i,
|
|
34
|
+
(e, n) => {
|
|
35
|
+
const c = u(e);
|
|
36
|
+
n !== void 0 && n !== e && F(s, c);
|
|
33
37
|
},
|
|
34
38
|
{ immediate: !0 }
|
|
35
39
|
);
|
|
36
40
|
const a = () => {
|
|
37
|
-
const e =
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
const e =
|
|
41
|
-
|
|
41
|
+
const e = i.value, n = o.value.findIndex((c) => c.id === e);
|
|
42
|
+
return n !== -1 ? n : (u(e), o.value.findIndex((c) => c.id === e));
|
|
43
|
+
}, f = () => {
|
|
44
|
+
const e = d();
|
|
45
|
+
o.value[a()] = {
|
|
42
46
|
id: e.id,
|
|
43
47
|
text: "",
|
|
44
48
|
file: void 0,
|
|
@@ -47,50 +51,51 @@ const j = (n) => {
|
|
|
47
51
|
forceSend: !1,
|
|
48
52
|
isRecording: e.isRecording
|
|
49
53
|
};
|
|
50
|
-
},
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
...
|
|
54
|
+
}, r = (e) => {
|
|
55
|
+
const n = d();
|
|
56
|
+
o.value[a()] = {
|
|
57
|
+
...n,
|
|
54
58
|
forceSend: !1,
|
|
55
59
|
...e,
|
|
56
|
-
id:
|
|
60
|
+
id: n.id
|
|
57
61
|
};
|
|
58
62
|
}, l = (e) => {
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
63
|
+
r({ text: e });
|
|
64
|
+
}, v = (e) => {
|
|
65
|
+
r({ file: e });
|
|
66
|
+
}, g = () => {
|
|
67
|
+
r({ file: void 0 });
|
|
64
68
|
}, p = (e) => {
|
|
65
|
-
|
|
69
|
+
r({ reply: e, edit: void 0 });
|
|
66
70
|
}, y = () => {
|
|
67
|
-
|
|
71
|
+
r({ reply: void 0 });
|
|
68
72
|
}, M = (e) => {
|
|
69
|
-
|
|
73
|
+
r({ edit: e, reply: void 0 });
|
|
70
74
|
}, m = () => {
|
|
71
|
-
|
|
75
|
+
r({ edit: void 0 });
|
|
72
76
|
};
|
|
73
|
-
function
|
|
74
|
-
return
|
|
77
|
+
function d() {
|
|
78
|
+
return u(i.value);
|
|
75
79
|
}
|
|
76
80
|
return {
|
|
77
|
-
getMessage:
|
|
78
|
-
resetMessage:
|
|
79
|
-
setMessageFile:
|
|
80
|
-
resetMessageFile:
|
|
81
|
+
getMessage: d,
|
|
82
|
+
resetMessage: f,
|
|
83
|
+
setMessageFile: v,
|
|
84
|
+
resetMessageFile: g,
|
|
81
85
|
setMessageText: l,
|
|
82
86
|
setReply: p,
|
|
83
87
|
resetReply: y,
|
|
84
88
|
setEdit: M,
|
|
85
89
|
resetEdit: m,
|
|
86
90
|
setForceSendMessage: (e) => {
|
|
87
|
-
|
|
91
|
+
d().forceSend = e;
|
|
88
92
|
},
|
|
89
93
|
setRecordingMessage: (e) => {
|
|
90
|
-
|
|
94
|
+
d().isRecording = e;
|
|
91
95
|
}
|
|
92
96
|
};
|
|
93
97
|
};
|
|
94
98
|
export {
|
|
95
|
-
j as
|
|
99
|
+
j as getChatDraft,
|
|
100
|
+
B as useMessageDraft
|
|
96
101
|
};
|
package/dist/index.js
CHANGED
|
@@ -100,45 +100,45 @@ import { getTypeFileByMime as Lo } from "./hooks/uploadFile/getTypeFileByMime.js
|
|
|
100
100
|
import { uploadFile as Uo } from "./hooks/uploadFile/uploadFile.js";
|
|
101
101
|
import { useDelayDebouncedRef as No } from "./hooks/useDelayDebouncedRef.js";
|
|
102
102
|
import { useImmediateDebouncedRef as Ko } from "./hooks/useImmediateDebouncedRef.js";
|
|
103
|
-
import {
|
|
104
|
-
import { useSearchModel as
|
|
105
|
-
import { useTheme as
|
|
106
|
-
import { useEmojiNative as
|
|
107
|
-
import { useModalCreateChat as
|
|
108
|
-
import { useModalCreateChat2 as
|
|
109
|
-
import { useModalCreateDialog as
|
|
110
|
-
import { useConfirmDeleteMessage as
|
|
111
|
-
import { useModalSelectUser2 as
|
|
112
|
-
import { useModalVideoRecorder as
|
|
113
|
-
import { getValidationReport as
|
|
114
|
-
import { useChatValidator as
|
|
115
|
-
import { getMessageValidationReport as
|
|
116
|
-
import { useMessageValidator as
|
|
117
|
-
import { getSidebarValidationReport as
|
|
118
|
-
import { useSidebarValidator as
|
|
119
|
-
import { useValidation as
|
|
120
|
-
import { useMessageActions as
|
|
121
|
-
import { calculateMessageMenuPosition as
|
|
122
|
-
import { useMessageMenuActions as
|
|
123
|
-
import { useMessageLinks as
|
|
124
|
-
import { useChannelAccentColor as
|
|
125
|
-
import { useSubtextTooltip as
|
|
126
|
-
import { hideReplyPreview as
|
|
127
|
-
import { hideEditPreview as
|
|
128
|
-
import { buildReplyPayload as
|
|
129
|
-
import { buildEditPayload as
|
|
130
|
-
import { getEditTooltipLines as
|
|
131
|
-
import { getDeletedOriginalText as
|
|
132
|
-
import { getStatus as
|
|
133
|
-
import { formatTimestamp as
|
|
134
|
-
import { playNotificationAudio as
|
|
135
|
-
import { insertDaySeparators as
|
|
136
|
-
import { sortByTimestamp as
|
|
137
|
-
import { getMessageClass as
|
|
138
|
-
import { createReactionHandlers as
|
|
139
|
-
import { getChannelAccentColor as
|
|
140
|
-
import { parseMarkdown as
|
|
141
|
-
import { safeMediaPlay as
|
|
103
|
+
import { getChatDraft as Qo, useMessageDraft as qo } from "./hooks/useMessageDraft.js";
|
|
104
|
+
import { useSearchModel as Go } from "./hooks/useSearchModel.js";
|
|
105
|
+
import { useTheme as Xo } from "./hooks/useTheme.js";
|
|
106
|
+
import { useEmojiNative as Zo } from "./hooks/useEmojiNative.js";
|
|
107
|
+
import { useModalCreateChat as $o } from "./hooks/modals/useCreateChat.js";
|
|
108
|
+
import { useModalCreateChat2 as ta } from "./hooks/modals/useCreateChat2.js";
|
|
109
|
+
import { useModalCreateDialog as aa } from "./hooks/modals/useCreateDialog.js";
|
|
110
|
+
import { useConfirmDeleteMessage as sa } from "./hooks/modals/useConfirmDeleteMessage.js";
|
|
111
|
+
import { useModalSelectUser2 as la } from "./hooks/modals/useModalSelectUser2.js";
|
|
112
|
+
import { useModalVideoRecorder as da } from "./hooks/modals/useVideoRecorder.js";
|
|
113
|
+
import { getValidationReport as ua, validateChats as xa } from "./hooks/validators/chats/chatValidator.js";
|
|
114
|
+
import { useChatValidator as na } from "./hooks/validators/chats/useChatValidator.js";
|
|
115
|
+
import { getMessageValidationReport as Ma, validateMessages as ga } from "./hooks/validators/messages/messageValidator.js";
|
|
116
|
+
import { useMessageValidator as Sa } from "./hooks/validators/messages/useMessageValidator.js";
|
|
117
|
+
import { getSidebarValidationReport as ha, validateSidebarItems as Ra } from "./hooks/validators/sidebar/sidebarValidator.js";
|
|
118
|
+
import { useSidebarValidator as Ta } from "./hooks/validators/sidebar/useSidebarValidator.js";
|
|
119
|
+
import { useValidation as Pa } from "./hooks/validators/useValidation.js";
|
|
120
|
+
import { useMessageActions as Fa } from "./hooks/messages/useMessageActions.js";
|
|
121
|
+
import { calculateMessageMenuPosition as va, findAppBoundsRect as Da } from "./hooks/messages/calculateMessageMenuPosition.js";
|
|
122
|
+
import { useMessageMenuActions as ka } from "./hooks/messages/useMessageMenuActions.js";
|
|
123
|
+
import { useMessageLinks as Va } from "./hooks/messages/useMessageLinks.js";
|
|
124
|
+
import { useChannelAccentColor as Wa } from "./hooks/messages/useChannelAccentColor.js";
|
|
125
|
+
import { useSubtextTooltip as ja } from "./hooks/messages/useSubtextTooltip.js";
|
|
126
|
+
import { hideReplyPreview as Ha, showReplyPreview as Ka, useStartReply as Oa } from "./hooks/messages/useStartReply.js";
|
|
127
|
+
import { hideEditPreview as qa, showEditPreview as za, useStartEdit as Ga } from "./hooks/messages/useStartEdit.js";
|
|
128
|
+
import { buildReplyPayload as Xa } from "./hooks/messages/buildReplyPayload.js";
|
|
129
|
+
import { buildEditPayload as Za } from "./hooks/messages/buildEditPayload.js";
|
|
130
|
+
import { getEditTooltipLines as $a } from "./hooks/messages/getEditTooltipLines.js";
|
|
131
|
+
import { getDeletedOriginalText as tr, getDeletedTooltipLines as or } from "./hooks/messages/getDeletedOriginalText.js";
|
|
132
|
+
import { getStatus as rr, getStatusTitle as sr, statuses as fr } from "./functions/getStatusMessage.js";
|
|
133
|
+
import { formatTimestamp as pr } from "./functions/formatTimestamp.js";
|
|
134
|
+
import { playNotificationAudio as mr } from "./functions/playNotificationAudio.js";
|
|
135
|
+
import { insertDaySeparators as xr } from "./functions/insertDaySeparators.js";
|
|
136
|
+
import { sortByTimestamp as nr } from "./functions/sortByTimestamp.js";
|
|
137
|
+
import { getMessageClass as Mr } from "./functions/getMessageClass.js";
|
|
138
|
+
import { createReactionHandlers as Cr } from "./functions/createReactionHandlers.js";
|
|
139
|
+
import { getChannelAccentColor as yr } from "./functions/getChannelAccentColor.js";
|
|
140
|
+
import { parseMarkdown as Rr } from "./functions/parseMarkdown.js";
|
|
141
|
+
import { safeMediaPlay as Tr, safeMediaPlayVoid as Ar } from "./functions/safeMediaPlay.js";
|
|
142
142
|
export {
|
|
143
143
|
Io as AdaptiveExtendedLayout,
|
|
144
144
|
Je as AudioMessage,
|
|
@@ -235,61 +235,62 @@ export {
|
|
|
235
235
|
Re as WABASeparatedQuickButtons,
|
|
236
236
|
Te as WABATemplateSelector,
|
|
237
237
|
E as WhatsAppIcon,
|
|
238
|
-
|
|
238
|
+
Za as buildEditPayload,
|
|
239
239
|
ko as buildFilePreview,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
Xa as buildReplyPayload,
|
|
241
|
+
va as calculateMessageMenuPosition,
|
|
242
|
+
Cr as createReactionHandlers,
|
|
243
|
+
Da as findAppBoundsRect,
|
|
244
|
+
pr as formatTimestamp,
|
|
245
245
|
wo as generatePreview,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
tr as
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
rr as
|
|
246
|
+
yr as getChannelAccentColor,
|
|
247
|
+
Qo as getChatDraft,
|
|
248
|
+
tr as getDeletedOriginalText,
|
|
249
|
+
or as getDeletedTooltipLines,
|
|
250
|
+
$a as getEditTooltipLines,
|
|
251
|
+
Mr as getMessageClass,
|
|
252
|
+
Ma as getMessageValidationReport,
|
|
253
|
+
ha as getSidebarValidationReport,
|
|
254
|
+
rr as getStatus,
|
|
255
|
+
sr as getStatusTitle,
|
|
255
256
|
Lo as getTypeFileByMime,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
257
|
+
ua as getValidationReport,
|
|
258
|
+
qa as hideEditPreview,
|
|
259
|
+
Ha as hideReplyPreview,
|
|
260
|
+
xr as insertDaySeparators,
|
|
261
|
+
Rr as parseMarkdown,
|
|
262
|
+
mr as playNotificationAudio,
|
|
263
|
+
Tr as safeMediaPlay,
|
|
264
|
+
Ar as safeMediaPlayVoid,
|
|
265
|
+
za as showEditPreview,
|
|
266
|
+
Ka as showReplyPreview,
|
|
267
|
+
nr as sortByTimestamp,
|
|
268
|
+
fr as statuses,
|
|
268
269
|
Uo as uploadFile,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
Wa as useChannelAccentColor,
|
|
271
|
+
na as useChatValidator,
|
|
272
|
+
sa as useConfirmDeleteMessage,
|
|
272
273
|
No as useDelayDebouncedRef,
|
|
273
|
-
|
|
274
|
+
Zo as useEmojiNative,
|
|
274
275
|
Ko as useImmediateDebouncedRef,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
276
|
+
Fa as useMessageActions,
|
|
277
|
+
qo as useMessageDraft,
|
|
278
|
+
Va as useMessageLinks,
|
|
279
|
+
ka as useMessageMenuActions,
|
|
280
|
+
Sa as useMessageValidator,
|
|
281
|
+
$o as useModalCreateChat,
|
|
282
|
+
ta as useModalCreateChat2,
|
|
283
|
+
aa as useModalCreateDialog,
|
|
284
|
+
la as useModalSelectUser2,
|
|
285
|
+
da as useModalVideoRecorder,
|
|
286
|
+
Go as useSearchModel,
|
|
287
|
+
Ta as useSidebarValidator,
|
|
288
|
+
Ga as useStartEdit,
|
|
289
|
+
Oa as useStartReply,
|
|
290
|
+
ja as useSubtextTooltip,
|
|
291
|
+
Xo as useTheme,
|
|
292
|
+
Pa as useValidation,
|
|
293
|
+
xa as validateChats,
|
|
294
|
+
ga as validateMessages,
|
|
295
|
+
Ra as validateSidebarItems
|
|
295
296
|
};
|
package/dist/locale/en.js
CHANGED
|
@@ -3,6 +3,7 @@ const e = {
|
|
|
3
3
|
"component.ChatFilter.InputPlaceholder": "Chat search",
|
|
4
4
|
"layout.ChatWrapper.noSelectedChat": "Choose contact to start conversation",
|
|
5
5
|
"component.ChatItem.typing": "typing",
|
|
6
|
+
"component.ChatItem.draft": "Draft:",
|
|
6
7
|
"component.ChatInput.InputPlaceholder": "Type a message...",
|
|
7
8
|
"component.ChatInput.TelegramInputPlaceholder": "Type a message Telegram or change channel",
|
|
8
9
|
"component.ChatInput.WhatsappInputPlaceholder": "Type a message WhatsApp or change channel",
|
package/dist/locale/ru.js
CHANGED
|
@@ -3,6 +3,7 @@ const e = {
|
|
|
3
3
|
"component.ChatFilter.InputPlaceholder": "Поиск чата",
|
|
4
4
|
"layout.ChatWrapper.noSelectedChat": "Выберите контакт для начала общения",
|
|
5
5
|
"component.ChatItem.typing": "печатает",
|
|
6
|
+
"component.ChatItem.draft": "Черновик:",
|
|
6
7
|
"component.ChatInput.InputPlaceholder": "Введите сообщение",
|
|
7
8
|
"component.ChatInput.WhatsappInputPlaceholder": "Введите сообщение WhatsApp или смените канал",
|
|
8
9
|
"component.ChatInput.TelegramInputPlaceholder": "Введите сообщение Telegram или смените канал",
|