@mobilon-dev/chotto 0.3.36 → 0.3.38
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/1_atoms/ContactContextMenu/ContactContextMenu.vue.js +2 -2
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +1 -1
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +2 -2
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +181 -208
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +29 -29
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +2 -2
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.js +1 -1
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +71 -65
- package/dist/components/3_compounds/ChatList/composables/useChatListFilter.js +14 -17
- package/dist/locale/en.js +4 -0
- package/dist/locale/ru.js +6 -2
- 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 +8 -0
- package/dist/types/components/3_compounds/ChatList/composables/useChatListFilter.d.ts +3 -3
- package/dist/types/locale/en.d.ts +4 -0
- package/dist/types/locale/ru.d.ts +4 -0
- package/package.json +16 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as pe, inject as we, ref as d, computed as w, watch as Ce, onMounted as ye, createElementBlock as c, openBlock as l, unref as
|
|
1
|
+
import { defineComponent as pe, inject as we, ref as d, computed as w, watch as Ce, onMounted as ye, createElementBlock as c, openBlock as l, unref as i, normalizeStyle as W, normalizeClass as b, createCommentVNode as m, createElementVNode as a, createVNode as h, withCtx as L, createTextVNode as be, toDisplayString as g, createBlock as k, withDirectives as N, vShow as G, vModelText as he, Transition as J, Teleport as ke } from "vue";
|
|
2
2
|
import xe from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
3
|
import Te from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
4
|
import Me from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
@@ -55,7 +55,7 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
55
55
|
},
|
|
56
56
|
emits: ["action", "reply"],
|
|
57
57
|
setup(e, { emit: K }) {
|
|
58
|
-
const Q = we("chatAppId"), { getTheme: A } = De(Q),
|
|
58
|
+
const Q = we("chatAppId"), { getTheme: A } = De(Q), n = e, R = d([
|
|
59
59
|
{
|
|
60
60
|
text: "1.0x",
|
|
61
61
|
speed: 1
|
|
@@ -82,18 +82,18 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
82
82
|
clickAction: _,
|
|
83
83
|
viewsAction: B,
|
|
84
84
|
handleClickReplied: ee
|
|
85
|
-
} = Ee(
|
|
85
|
+
} = Ee(n.message, $), x = d(!1), se = async () => {
|
|
86
86
|
var u, s, v;
|
|
87
|
-
if (
|
|
87
|
+
if (n.message.url)
|
|
88
88
|
try {
|
|
89
|
-
const o = await fetch(
|
|
89
|
+
const o = await fetch(n.message.url, {
|
|
90
90
|
headers: {
|
|
91
91
|
Accept: "audio/*"
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
if (!o.ok)
|
|
95
95
|
throw new Error(`HTTP error! status: ${o.status}`);
|
|
96
|
-
const H = o.headers.get("content-type") || "", ge = await o.blob(), T = ((s = (u =
|
|
96
|
+
const H = o.headers.get("content-type") || "", ge = await o.blob(), T = ((s = (u = n.message.url.split(".").pop()) == null ? void 0 : u.split("?")[0]) == null ? void 0 : s.toLowerCase()) || "", ve = {
|
|
97
97
|
"audio/mpeg": "mp3",
|
|
98
98
|
"audio/mp3": "mp3",
|
|
99
99
|
"audio/wav": "wav",
|
|
@@ -105,15 +105,15 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
105
105
|
"audio/m4a": "m4a",
|
|
106
106
|
"audio/x-m4a": "m4a",
|
|
107
107
|
"application/octet-stream": T || "mp3"
|
|
108
|
-
}, O = T && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes(T) ? T : ve[H] || "mp3", q =
|
|
108
|
+
}, O = T && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes(T) ? T : ve[H] || "mp3", q = n.message.url.split("/"), M = decodeURIComponent(((v = q[q.length - 1]) == null ? void 0 : v.split("?")[0]) || ""), fe = M ? M.includes(".") ? M : `${M}.${O}` : `audio-${n.message.messageId}.${O}`, z = window.URL.createObjectURL(ge), y = document.createElement("a");
|
|
109
109
|
y.href = z, y.download = fe, document.body.appendChild(y), y.click(), document.body.removeChild(y), window.URL.revokeObjectURL(z);
|
|
110
110
|
} catch (o) {
|
|
111
|
-
console.error("Ошибка при скачивании аудио:", o), window.open(
|
|
111
|
+
console.error("Ошибка при скачивании аудио:", o), window.open(n.message.url, "_blank");
|
|
112
112
|
}
|
|
113
113
|
}, te = (u) => {
|
|
114
114
|
u.action === "download" ? (se(), E()) : _(u);
|
|
115
|
-
}, { linkedHtml: ae, inNewWindow: P } = Le(() =>
|
|
116
|
-
w(() =>
|
|
115
|
+
}, { linkedHtml: ae, inNewWindow: P } = Le(() => n.message.text), oe = w(() => $e(n.message.status)), ie = w(() => Ve(n.message.status, n.message.statusMsg)), { bubbleStyle: ne } = Ne(
|
|
116
|
+
w(() => n.message),
|
|
117
117
|
{ cssVariable: "--chotto-audiomessage-right-background-color", position: "right" }
|
|
118
118
|
);
|
|
119
119
|
function D() {
|
|
@@ -135,7 +135,7 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
135
135
|
function j(u) {
|
|
136
136
|
return Be(u.position, "audio-message");
|
|
137
137
|
}
|
|
138
|
-
const { onToggleReaction: me, onAddReaction: re, onRemoveReaction: de } = Pe($), ce = Ae(() =>
|
|
138
|
+
const { onToggleReaction: me, onAddReaction: re, onRemoveReaction: de } = Pe($), ce = Ae(() => n.message, () => n.subtextTooltipData);
|
|
139
139
|
return ye(() => {
|
|
140
140
|
t.value != null && (t.value.playbackRate = I.value.speed, t.value.addEventListener("loadedmetadata", () => {
|
|
141
141
|
t.value != null && (t.value.duration == 1 / 0 || Number.isNaN(t.value.duration)) && (t.value.currentTime = 1e101, t.value.addEventListener("timeupdate", () => {
|
|
@@ -152,9 +152,9 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
152
152
|
e.applyStyle(e.message)
|
|
153
153
|
]]),
|
|
154
154
|
messageId: e.message.messageId,
|
|
155
|
-
style: W(
|
|
155
|
+
style: W(i(ne)),
|
|
156
156
|
onMouseleave: s[9] || (s[9] = //@ts-ignore
|
|
157
|
-
(...o) =>
|
|
157
|
+
(...o) => i(E) && i(E)(...o))
|
|
158
158
|
}, [
|
|
159
159
|
e.message.avatar && e.isFirstInSeries ? (l(), c("img", {
|
|
160
160
|
key: 0,
|
|
@@ -166,7 +166,7 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
166
166
|
}, null, 12, Ze)) : m("", !0),
|
|
167
167
|
e.message.subText && e.isFirstInSeries ? (l(), c("p", je, [
|
|
168
168
|
h(Fe, {
|
|
169
|
-
text:
|
|
169
|
+
text: i(ce),
|
|
170
170
|
position: e.message.position === "left" ? "right" : "left",
|
|
171
171
|
offset: 8
|
|
172
172
|
}, {
|
|
@@ -179,14 +179,14 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
179
179
|
a("div", {
|
|
180
180
|
class: b(["audio-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar }]),
|
|
181
181
|
onMouseenter: s[8] || (s[8] = //@ts-ignore
|
|
182
|
-
(...o) =>
|
|
182
|
+
(...o) => i(V) && i(V)(...o))
|
|
183
183
|
}, [
|
|
184
184
|
e.message.reply ? (l(), k(Re, {
|
|
185
185
|
key: 0,
|
|
186
186
|
style: { "grid-column": "1/3" },
|
|
187
187
|
message: e.message.reply,
|
|
188
188
|
class: b(e.message.position),
|
|
189
|
-
onReply:
|
|
189
|
+
onReply: i(ee)
|
|
190
190
|
}, null, 8, ["message", "class", "onReply"])) : m("", !0),
|
|
191
191
|
a("div", He, [
|
|
192
192
|
a("audio", {
|
|
@@ -247,8 +247,8 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
247
247
|
step: "0.1",
|
|
248
248
|
onMousedown: s[1] || (s[1] = (o) => p.value = !0),
|
|
249
249
|
onMouseup: Z,
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
onTouchstartPassive: s[2] || (s[2] = (o) => p.value = !0),
|
|
251
|
+
onTouchendPassive: Z
|
|
252
252
|
}, null, 40, ze), [
|
|
253
253
|
[he, r.value]
|
|
254
254
|
]),
|
|
@@ -273,8 +273,8 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
273
273
|
e.message.text ? (l(), c("div", Xe, [
|
|
274
274
|
a("p", {
|
|
275
275
|
onClick: s[4] || (s[4] = //@ts-ignore
|
|
276
|
-
(...o) =>
|
|
277
|
-
innerHTML:
|
|
276
|
+
(...o) => i(P) && i(P)(...o)),
|
|
277
|
+
innerHTML: i(ae)
|
|
278
278
|
}, null, 8, Ye)
|
|
279
279
|
])) : m("", !0),
|
|
280
280
|
e.message.linkPreview ? (l(), k(Te, {
|
|
@@ -291,16 +291,16 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
291
291
|
reactions: e.message.reactions,
|
|
292
292
|
"message-id": e.message.messageId,
|
|
293
293
|
enabled: e.reactionsEnabled,
|
|
294
|
-
onToggleReaction:
|
|
295
|
-
onAddReaction:
|
|
296
|
-
onRemoveReaction:
|
|
294
|
+
onToggleReaction: i(me),
|
|
295
|
+
onAddReaction: i(re),
|
|
296
|
+
onRemoveReaction: i(de)
|
|
297
297
|
}, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"]),
|
|
298
298
|
a("div", _e, [
|
|
299
299
|
e.message.views ? (l(), c("div", {
|
|
300
300
|
key: 0,
|
|
301
301
|
class: "audio-message__views",
|
|
302
302
|
onClick: s[5] || (s[5] = //@ts-ignore
|
|
303
|
-
(...o) =>
|
|
303
|
+
(...o) => i(B) && i(B)(...o))
|
|
304
304
|
}, [
|
|
305
305
|
s[12] || (s[12] = a("span", { class: "pi pi-eye" }, null, -1)),
|
|
306
306
|
a("p", null, g(e.message.views), 1)
|
|
@@ -311,13 +311,13 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
311
311
|
"message-class": j(e.message),
|
|
312
312
|
"message-status": e.message.status,
|
|
313
313
|
"status-class": oe.value,
|
|
314
|
-
"status-title":
|
|
314
|
+
"status-title": ie.value
|
|
315
315
|
}, null, 8, ["message-class", "message-status", "status-class", "status-title"])
|
|
316
316
|
]),
|
|
317
|
-
|
|
317
|
+
i(Y) && e.message.actions ? (l(), c("button", {
|
|
318
318
|
key: 5,
|
|
319
319
|
class: "audio-message__menu-button",
|
|
320
|
-
onClick: s[6] || (s[6] = (o) => F.value = !
|
|
320
|
+
onClick: s[6] || (s[6] = (o) => F.value = !i(F))
|
|
321
321
|
}, [...s[13] || (s[13] = [
|
|
322
322
|
a("svg", {
|
|
323
323
|
width: "4",
|
|
@@ -334,7 +334,7 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
334
334
|
])])) : m("", !0),
|
|
335
335
|
h(J, null, {
|
|
336
336
|
default: L(() => [
|
|
337
|
-
|
|
337
|
+
i(F) && e.message.actions ? (l(), k(xe, {
|
|
338
338
|
key: 0,
|
|
339
339
|
class: "audio-message__context-menu",
|
|
340
340
|
actions: e.message.actions,
|
|
@@ -351,7 +351,7 @@ const Ue = ["messageId"], Ze = ["src"], je = {
|
|
|
351
351
|
x.value ? (l(), c("div", {
|
|
352
352
|
key: 0,
|
|
353
353
|
class: "audio-message__modal-overlay",
|
|
354
|
-
"data-theme":
|
|
354
|
+
"data-theme": i(A)().theme ? i(A)().theme : null
|
|
355
355
|
}, [
|
|
356
356
|
a("div", ts, [
|
|
357
357
|
a("button", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CallMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1df0ddd1"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -371,8 +371,8 @@ const Be = ["messageId"], Ue = ["src"], Oe = {
|
|
|
371
371
|
step: "0.1",
|
|
372
372
|
onMousedown: e[1] || (e[1] = (u) => h.value = !0),
|
|
373
373
|
onMouseup: H,
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
onTouchstartPassive: e[2] || (e[2] = (u) => h.value = !0),
|
|
375
|
+
onTouchendPassive: H
|
|
376
376
|
}, null, 40, ot), [
|
|
377
377
|
[De, p.value]
|
|
378
378
|
]),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./ChatInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-efefc137"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useImmediateDebouncedRef as
|
|
3
|
-
import { useMessageDraft as
|
|
1
|
+
import { defineComponent as N, inject as G, ref as y, computed as x, watch as p, nextTick as f, unref as r, onMounted as U, createElementBlock as _, openBlock as b, createElementVNode as u, withDirectives as J, createVNode as w, renderSlot as T, toDisplayString as Q, withKeys as X, vModelText as Z, normalizeClass as ee } from "vue";
|
|
2
|
+
import { useImmediateDebouncedRef as te } from "../../../hooks/useImmediateDebouncedRef.js";
|
|
3
|
+
import { useMessageDraft as ne } from "../../../hooks/useMessageDraft.js";
|
|
4
4
|
import "../../../hooks/useSearchModel.js";
|
|
5
5
|
import "../../../hooks/useTheme.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
9
9
|
import "../../../functions/parseMarkdown.js";
|
|
10
|
-
import { t as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
10
|
+
import { t as c } from "../../../locale/useLocale.js";
|
|
11
|
+
import le from "./icons/SendIcon.vue.js";
|
|
12
|
+
import ie from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
|
|
13
|
+
const se = { class: "chat-input__container" }, oe = ["id"], ae = ["id"], re = { class: "chat-input__inline-buttons" }, ue = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "chat-input__input chat-input__disabled-placeholder"
|
|
16
|
-
},
|
|
16
|
+
}, ce = ["disabled", "placeholder"], de = ["disabled"], pe = { class: "" }, fe = { class: "chat-input__third-line" }, Ae = /* @__PURE__ */ N({
|
|
17
17
|
__name: "ChatInput",
|
|
18
18
|
props: {
|
|
19
19
|
state: {
|
|
@@ -42,64 +42,70 @@ const ie = { class: "chat-input__container" }, se = ["id"], oe = ["id"], ae = {
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
emits: ["send", "typing"],
|
|
45
|
-
setup(
|
|
46
|
-
const
|
|
45
|
+
setup(d, { emit: A }) {
|
|
46
|
+
const h = A, m = G("chatAppId"), { resetMessage: D, getMessage: i, setMessageText: v, setForceSendMessage: F } = ne(m), n = y(), E = te("", 2e3), M = y(), a = d, P = x(() => !!(a.state == "disabled" || i().text == "" && !i().file || i().isRecording)), R = x(() => {
|
|
47
47
|
var t;
|
|
48
|
-
if (
|
|
49
|
-
return
|
|
50
|
-
if (!((t =
|
|
48
|
+
if (a.inputButtonColor)
|
|
49
|
+
return a.inputButtonColor;
|
|
50
|
+
if (!((t = a.selectedChannel) != null && t.channelId))
|
|
51
51
|
return "#25D366";
|
|
52
|
-
const e =
|
|
52
|
+
const e = a.selectedChannel.channelId.toLowerCase();
|
|
53
53
|
return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
|
|
54
|
+
}), k = x(() => {
|
|
55
|
+
var t;
|
|
56
|
+
if (!((t = a.selectedChannel) != null && t.channelId))
|
|
57
|
+
return c("component.ChatInput.InputPlaceholder");
|
|
58
|
+
const e = a.selectedChannel.channelId.toLowerCase();
|
|
59
|
+
return e.includes("whatsapp") || e.includes("waba") ? c("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? c("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? c("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? c("component.ChatInput.MaxInputPlaceholder") : c("component.ChatInput.InputPlaceholder");
|
|
54
60
|
});
|
|
55
|
-
|
|
56
|
-
() =>
|
|
61
|
+
p(
|
|
62
|
+
() => E.value,
|
|
57
63
|
() => {
|
|
58
|
-
|
|
64
|
+
h("typing");
|
|
59
65
|
}
|
|
60
|
-
),
|
|
61
|
-
() =>
|
|
66
|
+
), p(
|
|
67
|
+
() => a.focusOnInputArea,
|
|
62
68
|
() => {
|
|
63
|
-
|
|
64
|
-
const e =
|
|
69
|
+
a.focusOnInputArea && f(() => {
|
|
70
|
+
const e = r(n);
|
|
65
71
|
e == null || e.focus();
|
|
66
72
|
});
|
|
67
73
|
},
|
|
68
74
|
{ immediate: !0 }
|
|
69
|
-
),
|
|
75
|
+
), p(
|
|
70
76
|
() => i().text,
|
|
71
77
|
() => {
|
|
72
|
-
|
|
78
|
+
f(() => {
|
|
73
79
|
const e = n.value;
|
|
74
80
|
if (!e) return;
|
|
75
81
|
const t = e.scrollTop;
|
|
76
82
|
e.style.height = "auto";
|
|
77
|
-
const l = getComputedStyle(e), s = parseFloat(l.fontSize) || 16,
|
|
83
|
+
const l = getComputedStyle(e), s = parseFloat(l.fontSize) || 16, W = parseFloat(l.lineHeight) || s * 1.4, I = 40, C = W * 11, S = e.scrollHeight, O = i().text.split(`
|
|
78
84
|
`).length > 1, o = document.createElement("div");
|
|
79
85
|
o.style.position = "absolute", o.style.visibility = "hidden", o.style.whiteSpace = "nowrap", o.style.font = l.font, o.style.fontSize = l.fontSize, o.style.fontFamily = l.fontFamily, o.style.fontWeight = l.fontWeight, o.style.letterSpacing = l.letterSpacing, o.textContent = i().text, document.body.appendChild(o);
|
|
80
|
-
const
|
|
86
|
+
const Y = o.offsetWidth;
|
|
81
87
|
document.body.removeChild(o);
|
|
82
|
-
const
|
|
83
|
-
i().text.trim() &&
|
|
88
|
+
const q = parseFloat(l.paddingLeft) || 0, K = parseFloat(l.paddingRight) || 0, j = e.clientWidth - q - K, V = Y > j, $ = O || V;
|
|
89
|
+
i().text.trim() && $ ? S <= C ? (e.style.height = S + "px", e.style.overflowY = "hidden") : (e.style.height = C + "px", e.style.overflowY = "auto", e.scrollTop = t) : (e.style.height = I + "px", e.style.overflowY = "hidden");
|
|
84
90
|
});
|
|
85
91
|
},
|
|
86
92
|
{ immediate: !0 }
|
|
87
|
-
),
|
|
93
|
+
), p(
|
|
88
94
|
() => i().forceSend,
|
|
89
95
|
() => {
|
|
90
|
-
i().forceSend && (
|
|
96
|
+
i().forceSend && (g(), F(!1));
|
|
91
97
|
}
|
|
92
98
|
);
|
|
93
99
|
const z = (e) => {
|
|
94
100
|
const t = e.target;
|
|
95
|
-
|
|
101
|
+
h("typing", t.value);
|
|
96
102
|
}, B = () => {
|
|
97
|
-
|
|
103
|
+
f(() => {
|
|
98
104
|
const e = n.value;
|
|
99
105
|
e && (e.style.height = "40px", e.style.overflowY = "hidden");
|
|
100
106
|
});
|
|
101
107
|
};
|
|
102
|
-
|
|
108
|
+
U(() => {
|
|
103
109
|
B();
|
|
104
110
|
});
|
|
105
111
|
const H = (e) => {
|
|
@@ -107,30 +113,30 @@ const ie = { class: "chat-input__container" }, se = ["id"], oe = ["id"], ae = {
|
|
|
107
113
|
if (n.value instanceof HTMLTextAreaElement) {
|
|
108
114
|
let t = n.value.selectionStart;
|
|
109
115
|
t && (n.value.setRangeText(`
|
|
110
|
-
`, t, t, "end"),
|
|
116
|
+
`, t, t, "end"), v(n.value.value));
|
|
111
117
|
}
|
|
112
118
|
e.preventDefault();
|
|
113
119
|
} else if (e.ctrlKey) {
|
|
114
120
|
if (n.value instanceof HTMLTextAreaElement) {
|
|
115
121
|
let t = n.value.selectionStart;
|
|
116
122
|
t && (n.value.setRangeText(`
|
|
117
|
-
`, t, t, "end"),
|
|
123
|
+
`, t, t, "end"), v(n.value.value));
|
|
118
124
|
}
|
|
119
125
|
e.preventDefault();
|
|
120
126
|
} else
|
|
121
|
-
e.preventDefault(),
|
|
122
|
-
},
|
|
127
|
+
e.preventDefault(), g();
|
|
128
|
+
}, L = (e) => {
|
|
123
129
|
if (n.value) {
|
|
124
130
|
const t = n.value.value;
|
|
125
131
|
n.value.value = e.newText;
|
|
126
132
|
const l = e.newText.length - (t.length - (e.end - e.start)), s = e.start + l;
|
|
127
|
-
|
|
133
|
+
v(e.newText), f(() => {
|
|
128
134
|
n.value && (n.value.setSelectionRange(s, s), n.value.focus());
|
|
129
135
|
});
|
|
130
136
|
}
|
|
131
|
-
},
|
|
137
|
+
}, g = () => {
|
|
132
138
|
var t, l;
|
|
133
|
-
const e =
|
|
139
|
+
const e = y(i());
|
|
134
140
|
if (e.value.text != "" || e.value.file) {
|
|
135
141
|
const s = {
|
|
136
142
|
type: "",
|
|
@@ -140,53 +146,53 @@ const ie = { class: "chat-input__container" }, se = ["id"], oe = ["id"], ae = {
|
|
|
140
146
|
size: "",
|
|
141
147
|
reply: void 0
|
|
142
148
|
};
|
|
143
|
-
e.value.file ? (s.type = "message." + e.value.file.type, s.url = e.value.file.url, s.filename = e.value.file.name, s.size = (t = e.value.file.size) == null ? void 0 : t.toString(), s.text = (l = e == null ? void 0 : e.value) == null ? void 0 : l.text.trim()) : (s.type = "message.text", s.text = e.value.text.trim()), e.value.reply && (s.reply = e.value.reply),
|
|
149
|
+
e.value.file ? (s.type = "message." + e.value.file.type, s.url = e.value.file.url, s.filename = e.value.file.name, s.size = (t = e.value.file.size) == null ? void 0 : t.toString(), s.text = (l = e == null ? void 0 : e.value) == null ? void 0 : l.text.trim()) : (s.type = "message.text", s.text = e.value.text.trim()), e.value.reply && (s.reply = e.value.reply), h("send", s), D(), M.value = void 0, n.value && n.value.focus();
|
|
144
150
|
}
|
|
145
151
|
};
|
|
146
|
-
return (e, t) => (
|
|
152
|
+
return (e, t) => (b(), _("div", se, [
|
|
147
153
|
u("div", {
|
|
148
|
-
id: "chat-input-reply-line-" +
|
|
154
|
+
id: "chat-input-reply-line-" + r(m),
|
|
149
155
|
class: "chat-input__reply-line"
|
|
150
|
-
}, null, 8,
|
|
156
|
+
}, null, 8, oe),
|
|
151
157
|
u("div", {
|
|
152
|
-
id: "chat-input-file-line-" +
|
|
158
|
+
id: "chat-input-file-line-" + r(m),
|
|
153
159
|
class: "chat-input__file-line"
|
|
154
|
-
}, null, 8,
|
|
155
|
-
u("div",
|
|
156
|
-
|
|
160
|
+
}, null, 8, ae),
|
|
161
|
+
u("div", re, [
|
|
162
|
+
T(e.$slots, "inline-buttons", {}, void 0, !0)
|
|
157
163
|
]),
|
|
158
|
-
|
|
164
|
+
d.disabledPlaceholder && (d.state == "disabled" || r(i)().isRecording) ? (b(), _("div", ue, Q(d.disabledPlaceholder), 1)) : J((b(), _("textarea", {
|
|
159
165
|
key: 1,
|
|
160
166
|
ref_key: "refInput",
|
|
161
167
|
ref: n,
|
|
162
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) =>
|
|
163
|
-
disabled:
|
|
168
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => r(i)().text = l),
|
|
169
|
+
disabled: d.state == "disabled" || r(i)().isRecording,
|
|
164
170
|
class: "chat-input__input",
|
|
165
|
-
placeholder:
|
|
166
|
-
onKeydown:
|
|
171
|
+
placeholder: k.value,
|
|
172
|
+
onKeydown: X(H, ["enter"]),
|
|
167
173
|
onInput: z
|
|
168
|
-
}, null, 40,
|
|
169
|
-
[
|
|
174
|
+
}, null, 40, ce)), [
|
|
175
|
+
[Z, r(i)().text]
|
|
170
176
|
]),
|
|
171
|
-
|
|
177
|
+
w(ie, {
|
|
172
178
|
textarea: n.value,
|
|
173
|
-
onFormatApplied:
|
|
179
|
+
onFormatApplied: L
|
|
174
180
|
}, null, 8, ["textarea"]),
|
|
175
181
|
u("button", {
|
|
176
|
-
class:
|
|
177
|
-
disabled:
|
|
178
|
-
onClick:
|
|
182
|
+
class: ee(["chat-input__button", { "chat-input__button-disabled": P.value }]),
|
|
183
|
+
disabled: r(i)().isRecording,
|
|
184
|
+
onClick: g
|
|
179
185
|
}, [
|
|
180
|
-
u("span",
|
|
181
|
-
|
|
186
|
+
u("span", pe, [
|
|
187
|
+
w(r(le), { color: R.value }, null, 8, ["color"])
|
|
182
188
|
])
|
|
183
|
-
], 10,
|
|
184
|
-
u("div",
|
|
185
|
-
|
|
189
|
+
], 10, de),
|
|
190
|
+
u("div", fe, [
|
|
191
|
+
T(e.$slots, "buttons", {}, void 0, !0)
|
|
186
192
|
])
|
|
187
193
|
]));
|
|
188
194
|
}
|
|
189
195
|
});
|
|
190
196
|
export {
|
|
191
|
-
|
|
197
|
+
Ae as default
|
|
192
198
|
};
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
1
|
+
import { ref as u } from "vue";
|
|
2
|
+
function h({ props: e, emit: l }) {
|
|
3
|
+
const r = u("");
|
|
4
4
|
return {
|
|
5
|
-
filter:
|
|
6
|
-
getSortedAndFilteredChats: () => !e.chats || e.chats.length === 0 ? [] : e.chats.slice().
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const r = e.activeTabId || "all";
|
|
12
|
-
if (r !== "all") {
|
|
13
|
-
if (r === "countUnread") {
|
|
5
|
+
filter: r,
|
|
6
|
+
getSortedAndFilteredChats: () => !e.chats || e.chats.length === 0 ? [] : e.chats.slice().filter((t) => {
|
|
7
|
+
var n;
|
|
8
|
+
const i = e.activeTabId || "all";
|
|
9
|
+
if (i !== "all") {
|
|
10
|
+
if (i === "countUnread") {
|
|
14
11
|
if (t.countUnread <= 0) return !1;
|
|
15
|
-
} else if (
|
|
12
|
+
} else if (i.startsWith("tag_") && (!((n = t.contact) != null && n.tags) || !t.contact.tags.some((s) => s.tagId === i)))
|
|
16
13
|
return !1;
|
|
17
14
|
}
|
|
18
|
-
return e.searchQuery && e.searchQuery.trim() !== "" ? !0 : e.filterQuery ? t.name.includes(e.filterQuery) || t.metadata.includes(e.filterQuery) : t.name.includes(
|
|
15
|
+
return e.searchQuery && e.searchQuery.trim() !== "" ? !0 : e.filterQuery ? t.name.includes(e.filterQuery) || t.metadata.includes(e.filterQuery) : t.name.includes(r.value) || t.metadata.includes(r.value);
|
|
19
16
|
}),
|
|
20
|
-
getFilter: (
|
|
21
|
-
|
|
17
|
+
getFilter: (a) => {
|
|
18
|
+
r.value = a, a.trim() !== "" ? l("search", a) : l("clear-search");
|
|
22
19
|
}
|
|
23
20
|
};
|
|
24
21
|
}
|
|
25
22
|
export {
|
|
26
|
-
|
|
23
|
+
h as useChatListFilter
|
|
27
24
|
};
|
package/dist/locale/en.js
CHANGED
|
@@ -4,6 +4,10 @@ const e = {
|
|
|
4
4
|
"layout.ChatWrapper.noSelectedChat": "Choose contact to start conversation",
|
|
5
5
|
"component.ChatItem.typing": "typing",
|
|
6
6
|
"component.ChatInput.InputPlaceholder": "Type a message...",
|
|
7
|
+
"component.ChatInput.TelegramInputPlaceholder": "Type a message Telegram or change channel",
|
|
8
|
+
"component.ChatInput.WhatsappInputPlaceholder": "Type a message WhatsApp or change channel",
|
|
9
|
+
"component.ChatInput.SmsInputPlaceholder": "Type a message SMS or change channel",
|
|
10
|
+
"component.ChatInput.MaxInputPlaceholder": "Type a message Max or change channel",
|
|
7
11
|
"component.FeedFoundObjects.results": "Search results",
|
|
8
12
|
"component.FeedFoundObjects.notFound": "Messages not found",
|
|
9
13
|
"component.FeedFoundObjects.notSearched": "Message search in chat",
|
package/dist/locale/ru.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
2
|
"component.ChatList.Title": "Mobilon One",
|
|
3
3
|
"component.ChatFilter.InputPlaceholder": "Поиск чата",
|
|
4
4
|
"layout.ChatWrapper.noSelectedChat": "Выберите контакт для начала общения",
|
|
5
5
|
"component.ChatItem.typing": "печатает",
|
|
6
6
|
"component.ChatInput.InputPlaceholder": "Введите сообщение",
|
|
7
|
+
"component.ChatInput.WhatsappInputPlaceholder": "Введите сообщение WhatsApp или смените канал",
|
|
8
|
+
"component.ChatInput.TelegramInputPlaceholder": "Введите сообщение Telegram или смените канал",
|
|
9
|
+
"component.ChatInput.SmsInputPlaceholder": "Введите сообщение SMS или смените канал",
|
|
10
|
+
"component.ChatInput.MaxInputPlaceholder": "Введите сообщение Max или смените канал",
|
|
7
11
|
"component.FeedFoundObjects.results": "Результаты поиска",
|
|
8
12
|
"component.FeedFoundObjects.notFound": "Сообщения не найдены",
|
|
9
13
|
"component.FeedFoundObjects.notSearched": "Поиск по сообщениям в чате",
|
|
@@ -18,5 +22,5 @@ const o = {
|
|
|
18
22
|
"component.TextFormatToolbar.Quote": "Цитата"
|
|
19
23
|
};
|
|
20
24
|
export {
|
|
21
|
-
|
|
25
|
+
e as ru
|
|
22
26
|
};
|