@mobilon-dev/chotto 0.3.91 → 0.3.93
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 +1 -1
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +202 -172
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +216 -196
- package/dist/hooks/useMessageDraft.js +79 -52
- package/dist/index.js +100 -98
- 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 +12 -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,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useImmediateDebouncedRef as
|
|
3
|
-
import { useMessageDraft as
|
|
1
|
+
import { defineComponent as be, inject as we, watch as d, ref as E, computed as _, nextTick as S, unref as u, onMounted as Ce, onUnmounted as Ae, createElementBlock as k, openBlock as F, createElementVNode as h, createVNode as O, normalizeClass as z, createBlock as Ee, createCommentVNode as U, renderSlot as Y, toDisplayString as Fe, withDirectives as Me, withKeys as Re, vModelText as He } from "vue";
|
|
2
|
+
import { useImmediateDebouncedRef as ke } from "../../../hooks/useImmediateDebouncedRef.js";
|
|
3
|
+
import { useMessageDraft as Le, commitChatDraftToList as De } from "../../../hooks/useMessageDraft.js";
|
|
4
4
|
import "../../../hooks/useSearchModel.js";
|
|
5
5
|
import "../../../hooks/useTheme.js";
|
|
6
|
-
import { useEmojiNative as
|
|
6
|
+
import { useEmojiNative as Pe } from "../../../hooks/useEmojiNative.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
|
-
import { t as
|
|
9
|
+
import { t as I } from "../../../locale/useLocale.js";
|
|
10
10
|
/* empty css */
|
|
11
11
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
12
12
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
13
13
|
import "../../../functions/parseMarkdown.js";
|
|
14
|
-
import { textToAppleEmojiHtml as
|
|
15
|
-
import { hideEditPreview as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
const
|
|
14
|
+
import { textToAppleEmojiHtml as We, textContainsEmoji as qe, previousGraphemeIndex as V, nextGraphemeIndex as $, snapIndexToGrapheme as J } from "../../../functions/renderAppleEmojis.js";
|
|
15
|
+
import { hideEditPreview as Be } from "../../../hooks/messages/useStartEdit.js";
|
|
16
|
+
import ze from "./icons/SendIcon.vue.js";
|
|
17
|
+
import Ke from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
|
|
18
|
+
import je from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
|
|
19
|
+
const Ne = { class: "chat-input__container" }, Ge = ["id"], Oe = ["id"], Ue = { class: "chat-input__inline-buttons" }, Ye = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "chat-input__input chat-input__disabled-placeholder"
|
|
22
|
-
},
|
|
22
|
+
}, Ve = {
|
|
23
23
|
key: 1,
|
|
24
24
|
class: "chat-input__input-wrap"
|
|
25
|
-
},
|
|
25
|
+
}, $e = ["innerHTML"], Je = ["disabled", "placeholder"], Qe = ["disabled"], Xe = { class: "" }, Ze = { class: "chat-input__third-line" }, K = 40, xt = /* @__PURE__ */ be({
|
|
26
26
|
__name: "ChatInput",
|
|
27
27
|
props: {
|
|
28
28
|
state: {
|
|
@@ -51,84 +51,92 @@ const Be = { class: "chat-input__container" }, We = ["id"], qe = ["id"], Ke = {
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
emits: ["send", "typing"],
|
|
54
|
-
setup(T, { emit:
|
|
55
|
-
const L =
|
|
54
|
+
setup(T, { emit: Q }) {
|
|
55
|
+
const L = Q, b = we("chatAppId"), { resetMessage: X, getMessage: l, setMessageText: M, setForceSendMessage: Z, resetEdit: ee, resetMessageFile: te } = Le(b), { isNative: ne } = Pe(b);
|
|
56
|
+
let j = l().id;
|
|
57
|
+
d(
|
|
58
|
+
() => l().id,
|
|
59
|
+
(e) => {
|
|
60
|
+
j = e;
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
const n = E(), m = E(), v = E(null), w = E(!1), ie = ke("", 2e3), D = _(() => {
|
|
56
64
|
var e;
|
|
57
|
-
return (e =
|
|
58
|
-
}),
|
|
59
|
-
() =>
|
|
60
|
-
),
|
|
61
|
-
() => !
|
|
62
|
-
),
|
|
63
|
-
if (!
|
|
64
|
-
const e =
|
|
65
|
-
t.style.right =
|
|
65
|
+
return (e = l().file) == null ? void 0 : e.preview;
|
|
66
|
+
}), oe = _(
|
|
67
|
+
() => We(l().text || "", v.value)
|
|
68
|
+
), g = _(
|
|
69
|
+
() => !ne.value && qe(l().text || "")
|
|
70
|
+
), c = () => {
|
|
71
|
+
if (!m.value || !n.value) return;
|
|
72
|
+
const e = n.value, t = m.value, o = Math.max(0, e.offsetWidth - e.clientWidth);
|
|
73
|
+
t.style.right = o > 0 ? `${o}px` : "", t.scrollTop = e.scrollTop;
|
|
66
74
|
};
|
|
67
|
-
let
|
|
68
|
-
function
|
|
69
|
-
|
|
75
|
+
let y = 0;
|
|
76
|
+
function P() {
|
|
77
|
+
v.value = null;
|
|
70
78
|
}
|
|
71
|
-
function
|
|
72
|
-
const t =
|
|
73
|
-
if (!t || !
|
|
74
|
-
const
|
|
75
|
-
(
|
|
79
|
+
function le(e = "nearest") {
|
|
80
|
+
const t = n.value;
|
|
81
|
+
if (!t || !g.value) return;
|
|
82
|
+
const o = t.value, i = J(o, t.selectionStart, e), r = J(o, t.selectionEnd, e);
|
|
83
|
+
(i !== t.selectionStart || r !== t.selectionEnd) && t.setSelectionRange(i, r);
|
|
76
84
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
85
|
+
function W() {
|
|
86
|
+
le("nearest"), f();
|
|
79
87
|
}
|
|
80
|
-
function
|
|
81
|
-
if (!
|
|
82
|
-
const t =
|
|
88
|
+
function se(e) {
|
|
89
|
+
if (!g.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.altKey || e.metaKey || e.ctrlKey) return;
|
|
90
|
+
const t = n.value;
|
|
83
91
|
if (!t) return;
|
|
84
|
-
const
|
|
92
|
+
const o = t.value, i = t.selectionStart !== t.selectionEnd;
|
|
85
93
|
if (e.shiftKey) {
|
|
86
|
-
requestAnimationFrame(() =>
|
|
94
|
+
requestAnimationFrame(() => W());
|
|
87
95
|
return;
|
|
88
96
|
}
|
|
89
|
-
if (
|
|
97
|
+
if (i) {
|
|
90
98
|
e.preventDefault();
|
|
91
|
-
const
|
|
92
|
-
t.setSelectionRange(
|
|
99
|
+
const x = e.key === "ArrowLeft" ? t.selectionStart : t.selectionEnd, A = e.key === "ArrowLeft" ? V(o, x) : $(o, x);
|
|
100
|
+
t.setSelectionRange(A, A), f();
|
|
93
101
|
return;
|
|
94
102
|
}
|
|
95
103
|
e.preventDefault();
|
|
96
|
-
const r = t.selectionStart,
|
|
97
|
-
t.setSelectionRange(
|
|
104
|
+
const r = t.selectionStart, p = e.key === "ArrowLeft" ? V(o, r) : $(o, r);
|
|
105
|
+
t.setSelectionRange(p, p), f();
|
|
98
106
|
}
|
|
99
|
-
function
|
|
100
|
-
if (!
|
|
101
|
-
|
|
107
|
+
function f() {
|
|
108
|
+
if (!g.value) {
|
|
109
|
+
P();
|
|
102
110
|
return;
|
|
103
111
|
}
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
const e =
|
|
112
|
+
y && cancelAnimationFrame(y), y = requestAnimationFrame(() => {
|
|
113
|
+
var p;
|
|
114
|
+
y = 0;
|
|
115
|
+
const e = n.value;
|
|
108
116
|
if (!e) {
|
|
109
|
-
|
|
117
|
+
P();
|
|
110
118
|
return;
|
|
111
119
|
}
|
|
112
|
-
const t = e.selectionStart,
|
|
113
|
-
if (t ===
|
|
114
|
-
|
|
120
|
+
const t = e.selectionStart, o = e.selectionEnd;
|
|
121
|
+
if (t === o) {
|
|
122
|
+
v.value !== null && (v.value = null, S(c));
|
|
115
123
|
return;
|
|
116
124
|
}
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
const r = ((
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
const i = v.value;
|
|
126
|
+
if (i && i.start === t && i.end === o) return;
|
|
127
|
+
const r = ((p = m.value) == null ? void 0 : p.scrollTop) ?? 0;
|
|
128
|
+
v.value = { start: t, end: o }, S(() => {
|
|
129
|
+
m.value && (m.value.scrollTop = r), c();
|
|
122
130
|
});
|
|
123
131
|
});
|
|
124
132
|
}
|
|
125
|
-
function
|
|
126
|
-
e.buttons &&
|
|
133
|
+
function ae(e) {
|
|
134
|
+
e.buttons && f();
|
|
127
135
|
}
|
|
128
|
-
function
|
|
129
|
-
document.activeElement ===
|
|
136
|
+
function N() {
|
|
137
|
+
document.activeElement === n.value && f();
|
|
130
138
|
}
|
|
131
|
-
const a = T,
|
|
139
|
+
const a = T, re = _(() => !!(a.state == "disabled" || l().text == "" && !l().file || l().isRecording)), ue = _(() => {
|
|
132
140
|
var t;
|
|
133
141
|
if (a.inputButtonColor)
|
|
134
142
|
return a.inputButtonColor;
|
|
@@ -136,146 +144,158 @@ const Be = { class: "chat-input__container" }, We = ["id"], qe = ["id"], Ke = {
|
|
|
136
144
|
return "#25D366";
|
|
137
145
|
const e = a.selectedChannel.channelId.toLowerCase();
|
|
138
146
|
return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
|
|
139
|
-
}),
|
|
147
|
+
}), ce = _(() => {
|
|
140
148
|
var t;
|
|
141
149
|
if (!((t = a.selectedChannel) != null && t.channelId))
|
|
142
|
-
return
|
|
150
|
+
return I("component.ChatInput.InputPlaceholder");
|
|
143
151
|
const e = a.selectedChannel.channelId.toLowerCase();
|
|
144
|
-
return e.includes("whatsapp") || e.includes("waba") ?
|
|
152
|
+
return e.includes("whatsapp") || e.includes("waba") ? I("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? I("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? I("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? I("component.ChatInput.MaxInputPlaceholder") : I("component.ChatInput.InputPlaceholder");
|
|
145
153
|
});
|
|
146
|
-
|
|
147
|
-
() =>
|
|
154
|
+
d(
|
|
155
|
+
() => ie.value,
|
|
148
156
|
() => {
|
|
149
157
|
L("typing");
|
|
150
158
|
}
|
|
151
|
-
),
|
|
159
|
+
), d(
|
|
152
160
|
() => {
|
|
153
161
|
var e;
|
|
154
|
-
return (e =
|
|
162
|
+
return (e = l().edit) == null ? void 0 : e.messageId;
|
|
155
163
|
},
|
|
156
164
|
(e, t) => {
|
|
157
|
-
e != null && e !== t && (w.value = !0,
|
|
165
|
+
e != null && e !== t && (w.value = !0, S(() => {
|
|
158
166
|
if (!w.value) return;
|
|
159
|
-
const
|
|
160
|
-
|
|
167
|
+
const o = n.value;
|
|
168
|
+
o && (C(o), w.value = !1, H(o), requestAnimationFrame(() => H(o)));
|
|
161
169
|
}));
|
|
162
170
|
}
|
|
163
|
-
),
|
|
171
|
+
), d(
|
|
164
172
|
() => a.focusOnInputArea,
|
|
165
173
|
() => {
|
|
166
|
-
a.focusOnInputArea &&
|
|
167
|
-
const e =
|
|
174
|
+
a.focusOnInputArea && S(() => {
|
|
175
|
+
const e = u(n);
|
|
168
176
|
e == null || e.focus();
|
|
169
177
|
});
|
|
170
178
|
},
|
|
171
179
|
{ immediate: !0 }
|
|
172
|
-
),
|
|
173
|
-
() =>
|
|
180
|
+
), d(
|
|
181
|
+
() => l().text,
|
|
174
182
|
() => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
e && (F(e), w.value && (w.value = !1, R(e), requestAnimationFrame(() => R(e))));
|
|
178
|
-
});
|
|
183
|
+
const e = n.value;
|
|
184
|
+
e && (C(e), w.value && (w.value = !1, H(e), requestAnimationFrame(() => H(e))));
|
|
179
185
|
},
|
|
180
|
-
{ immediate: !0 }
|
|
181
|
-
),
|
|
182
|
-
() =>
|
|
186
|
+
{ immediate: !0, flush: "post" }
|
|
187
|
+
), d(
|
|
188
|
+
() => l().id,
|
|
183
189
|
() => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
190
|
+
const e = n.value;
|
|
191
|
+
e && (R(e), requestAnimationFrame(() => {
|
|
192
|
+
const t = n.value;
|
|
193
|
+
t && C(t);
|
|
194
|
+
}));
|
|
188
195
|
}
|
|
189
|
-
),
|
|
190
|
-
e &&
|
|
191
|
-
const t =
|
|
196
|
+
), d(g, (e) => {
|
|
197
|
+
e && S(() => {
|
|
198
|
+
const t = n.value;
|
|
192
199
|
if (!t) return;
|
|
193
|
-
const
|
|
194
|
-
|
|
200
|
+
const o = t.scrollTop;
|
|
201
|
+
C(t), t.scrollTop = o, c(), requestAnimationFrame(c);
|
|
195
202
|
});
|
|
196
203
|
});
|
|
197
|
-
function
|
|
198
|
-
const t =
|
|
204
|
+
function R(e) {
|
|
205
|
+
const t = l().inputHeight;
|
|
206
|
+
e.style.height = (t || K) + "px", (!t || t <= K) && (e.style.overflowY = "hidden");
|
|
207
|
+
}
|
|
208
|
+
function de(e) {
|
|
209
|
+
const t = parseFloat(e.style.height);
|
|
210
|
+
Number.isFinite(t) && (l().inputHeight = t);
|
|
211
|
+
}
|
|
212
|
+
function C(e) {
|
|
213
|
+
const t = l().text || "";
|
|
214
|
+
if (e.value !== t || e.clientWidth === 0) {
|
|
215
|
+
R(e);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const o = e.scrollTop;
|
|
199
219
|
e.style.height = "auto";
|
|
200
|
-
const
|
|
220
|
+
const i = getComputedStyle(e), r = parseFloat(i.fontSize) || 16, p = parseFloat(i.lineHeight) || r * 1.4, x = K, A = p * 11, B = e.scrollHeight, ye = t.split(`
|
|
201
221
|
`).length > 1, s = document.createElement("div");
|
|
202
|
-
s.style.position = "absolute", s.style.visibility = "hidden", s.style.whiteSpace = "nowrap", s.style.font =
|
|
203
|
-
const
|
|
222
|
+
s.style.position = "absolute", s.style.visibility = "hidden", s.style.whiteSpace = "nowrap", s.style.font = i.font, s.style.fontSize = i.fontSize, s.style.fontFamily = i.fontFamily, s.style.fontWeight = i.fontWeight, s.style.letterSpacing = i.letterSpacing, s.textContent = t, document.body.appendChild(s);
|
|
223
|
+
const xe = s.offsetWidth;
|
|
204
224
|
document.body.removeChild(s);
|
|
205
|
-
const
|
|
206
|
-
|
|
225
|
+
const _e = parseFloat(i.paddingLeft) || 0, Se = parseFloat(i.paddingRight) || 0, Ie = e.clientWidth - _e - Se, Te = xe > Ie, G = ye || Te;
|
|
226
|
+
if (G && B <= x + 1) {
|
|
227
|
+
R(e);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
t.trim() && G ? B <= A ? (e.style.height = B + "px", e.style.overflowY = "hidden") : (e.style.height = A + "px", e.style.overflowY = "auto", e.scrollTop = o) : (e.style.height = x + "px", e.style.overflowY = "hidden"), de(e), c(), requestAnimationFrame(c);
|
|
207
231
|
}
|
|
208
|
-
function
|
|
209
|
-
if (a.state === "disabled" ||
|
|
232
|
+
function H(e) {
|
|
233
|
+
if (a.state === "disabled" || l().isRecording) return;
|
|
210
234
|
const t = e.value.length;
|
|
211
|
-
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight,
|
|
235
|
+
e.focus(), e.setSelectionRange(t, t), e.scrollTop = e.scrollHeight, c();
|
|
212
236
|
}
|
|
213
|
-
|
|
214
|
-
() =>
|
|
237
|
+
d(
|
|
238
|
+
() => l().forceSend,
|
|
215
239
|
() => {
|
|
216
|
-
|
|
240
|
+
l().forceSend && (q(), Z(!1));
|
|
217
241
|
}
|
|
218
242
|
);
|
|
219
|
-
const
|
|
243
|
+
const fe = (e) => {
|
|
220
244
|
const t = e.target;
|
|
221
|
-
L("typing", t.value),
|
|
222
|
-
}, ae = () => {
|
|
223
|
-
u(() => {
|
|
224
|
-
const e = i.value;
|
|
225
|
-
e && (e.style.height = "40px", e.style.overflowY = "hidden");
|
|
226
|
-
});
|
|
245
|
+
L("typing", t.value), f();
|
|
227
246
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
247
|
+
Ce(() => {
|
|
248
|
+
const e = n.value;
|
|
249
|
+
e && (R(e), C(e)), document.addEventListener("selectionchange", N);
|
|
250
|
+
}), Ae(() => {
|
|
251
|
+
De(j), document.removeEventListener("selectionchange", N), y && cancelAnimationFrame(y);
|
|
232
252
|
});
|
|
233
|
-
const
|
|
253
|
+
const pe = (e) => {
|
|
234
254
|
if (e.shiftKey) {
|
|
235
|
-
if (
|
|
236
|
-
let t =
|
|
237
|
-
t && (
|
|
238
|
-
`, t, t, "end"), M(
|
|
255
|
+
if (n.value instanceof HTMLTextAreaElement) {
|
|
256
|
+
let t = n.value.selectionStart;
|
|
257
|
+
t && (n.value.setRangeText(`
|
|
258
|
+
`, t, t, "end"), M(n.value.value));
|
|
239
259
|
}
|
|
240
260
|
e.preventDefault();
|
|
241
261
|
} else if (e.ctrlKey) {
|
|
242
|
-
if (
|
|
243
|
-
let t =
|
|
244
|
-
t && (
|
|
245
|
-
`, t, t, "end"), M(
|
|
262
|
+
if (n.value instanceof HTMLTextAreaElement) {
|
|
263
|
+
let t = n.value.selectionStart;
|
|
264
|
+
t && (n.value.setRangeText(`
|
|
265
|
+
`, t, t, "end"), M(n.value.value));
|
|
246
266
|
}
|
|
247
267
|
e.preventDefault();
|
|
248
268
|
} else
|
|
249
|
-
e.preventDefault(),
|
|
250
|
-
},
|
|
251
|
-
if (
|
|
252
|
-
const t =
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
M(e.newText),
|
|
256
|
-
|
|
269
|
+
e.preventDefault(), q();
|
|
270
|
+
}, he = (e) => {
|
|
271
|
+
if (n.value) {
|
|
272
|
+
const t = n.value.value;
|
|
273
|
+
n.value.value = e.newText;
|
|
274
|
+
const o = e.newText.length - (t.length - (e.end - e.start)), i = e.start + o;
|
|
275
|
+
M(e.newText), S(() => {
|
|
276
|
+
n.value && (n.value.setSelectionRange(i, i), n.value.focus());
|
|
257
277
|
});
|
|
258
278
|
}
|
|
259
279
|
};
|
|
260
|
-
function
|
|
261
|
-
|
|
280
|
+
function me() {
|
|
281
|
+
te();
|
|
262
282
|
}
|
|
263
|
-
function
|
|
264
|
-
|
|
283
|
+
function ve() {
|
|
284
|
+
ee(), M(""), Be(b), n.value && n.value.focus();
|
|
265
285
|
}
|
|
266
|
-
function
|
|
267
|
-
const e =
|
|
286
|
+
function ge() {
|
|
287
|
+
const e = l();
|
|
268
288
|
return e.edit ? (e.text ?? "").trim() === (e.edit.text ?? "").trim() : !1;
|
|
269
289
|
}
|
|
270
|
-
const
|
|
271
|
-
var t,
|
|
272
|
-
const e =
|
|
273
|
-
if (e.value.edit &&
|
|
274
|
-
|
|
290
|
+
const q = () => {
|
|
291
|
+
var t, o;
|
|
292
|
+
const e = E(l());
|
|
293
|
+
if (e.value.edit && ge()) {
|
|
294
|
+
ve();
|
|
275
295
|
return;
|
|
276
296
|
}
|
|
277
297
|
if (e.value.text != "" || e.value.file) {
|
|
278
|
-
const
|
|
298
|
+
const i = {
|
|
279
299
|
type: "",
|
|
280
300
|
text: "",
|
|
281
301
|
url: "",
|
|
@@ -283,78 +303,78 @@ const Be = { class: "chat-input__container" }, We = ["id"], qe = ["id"], Ke = {
|
|
|
283
303
|
size: "",
|
|
284
304
|
reply: void 0
|
|
285
305
|
};
|
|
286
|
-
e.value.file ? (
|
|
306
|
+
e.value.file ? (i.type = "message." + e.value.file.type, i.url = e.value.file.url, i.filename = e.value.file.name, i.size = (t = e.value.file.size) == null ? void 0 : t.toString(), i.text = (o = e == null ? void 0 : e.value) == null ? void 0 : o.text.trim()) : (i.type = "message.text", i.text = e.value.text.trim()), e.value.reply && (i.reply = e.value.reply), e.value.edit && (i.edit = e.value.edit), L("send", i), X(), n.value && n.value.focus();
|
|
287
307
|
}
|
|
288
308
|
};
|
|
289
|
-
return (e, t) => (
|
|
309
|
+
return (e, t) => (F(), k("div", Ne, [
|
|
290
310
|
h("div", {
|
|
291
|
-
id: "chat-input-reply-line-" +
|
|
311
|
+
id: "chat-input-reply-line-" + u(b),
|
|
292
312
|
class: "chat-input__reply-line"
|
|
293
|
-
}, null, 8,
|
|
313
|
+
}, null, 8, Ge),
|
|
294
314
|
h("div", {
|
|
295
|
-
id: "chat-input-file-line-" +
|
|
296
|
-
class:
|
|
315
|
+
id: "chat-input-file-line-" + u(b),
|
|
316
|
+
class: z(["chat-input__file-line", { "chat-input__file-line--visible": !!D.value }])
|
|
297
317
|
}, [
|
|
298
|
-
|
|
318
|
+
D.value ? (F(), Ee(je, {
|
|
299
319
|
key: 0,
|
|
300
|
-
"file-info":
|
|
301
|
-
onReset:
|
|
302
|
-
}, null, 8, ["file-info"])) :
|
|
303
|
-
], 10,
|
|
304
|
-
h("div",
|
|
305
|
-
|
|
320
|
+
"file-info": D.value,
|
|
321
|
+
onReset: me
|
|
322
|
+
}, null, 8, ["file-info"])) : U("", !0)
|
|
323
|
+
], 10, Oe),
|
|
324
|
+
h("div", Ue, [
|
|
325
|
+
Y(e.$slots, "inline-buttons", {}, void 0, !0)
|
|
306
326
|
]),
|
|
307
|
-
T.disabledPlaceholder && (T.state == "disabled" ||
|
|
308
|
-
|
|
327
|
+
T.disabledPlaceholder && (T.state == "disabled" || u(l)().isRecording) ? (F(), k("div", Ye, Fe(T.disabledPlaceholder), 1)) : (F(), k("div", Ve, [
|
|
328
|
+
g.value ? (F(), k("div", {
|
|
309
329
|
key: 0,
|
|
310
330
|
ref_key: "refMirror",
|
|
311
|
-
ref:
|
|
331
|
+
ref: m,
|
|
312
332
|
class: "chat-input__input-mirror",
|
|
313
333
|
"aria-hidden": "true",
|
|
314
|
-
innerHTML:
|
|
315
|
-
}, null, 8,
|
|
316
|
-
|
|
334
|
+
innerHTML: oe.value
|
|
335
|
+
}, null, 8, $e)) : U("", !0),
|
|
336
|
+
Me(h("textarea", {
|
|
317
337
|
ref_key: "refInput",
|
|
318
|
-
ref:
|
|
319
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
338
|
+
ref: n,
|
|
339
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => u(l)().text = o),
|
|
320
340
|
rows: "1",
|
|
321
|
-
disabled: T.state == "disabled" ||
|
|
322
|
-
class:
|
|
323
|
-
placeholder:
|
|
341
|
+
disabled: T.state == "disabled" || u(l)().isRecording,
|
|
342
|
+
class: z(["chat-input__input", { "chat-input__input--emoji-images": g.value }]),
|
|
343
|
+
placeholder: ce.value,
|
|
324
344
|
onKeydown: [
|
|
325
|
-
|
|
326
|
-
|
|
345
|
+
se,
|
|
346
|
+
Re(pe, ["enter"])
|
|
327
347
|
],
|
|
328
|
-
onInput:
|
|
329
|
-
onScroll:
|
|
330
|
-
onSelect:
|
|
331
|
-
onMouseup:
|
|
332
|
-
onKeyup:
|
|
333
|
-
onMousemove:
|
|
334
|
-
onBlur:
|
|
335
|
-
}, null, 42,
|
|
336
|
-
[
|
|
348
|
+
onInput: fe,
|
|
349
|
+
onScroll: c,
|
|
350
|
+
onSelect: f,
|
|
351
|
+
onMouseup: W,
|
|
352
|
+
onKeyup: W,
|
|
353
|
+
onMousemove: ae,
|
|
354
|
+
onBlur: P
|
|
355
|
+
}, null, 42, Je), [
|
|
356
|
+
[He, u(l)().text]
|
|
337
357
|
])
|
|
338
358
|
])),
|
|
339
|
-
|
|
340
|
-
textarea:
|
|
341
|
-
onFormatApplied:
|
|
359
|
+
O(Ke, {
|
|
360
|
+
textarea: n.value,
|
|
361
|
+
onFormatApplied: he
|
|
342
362
|
}, null, 8, ["textarea"]),
|
|
343
363
|
h("button", {
|
|
344
|
-
class:
|
|
345
|
-
disabled:
|
|
346
|
-
onClick:
|
|
364
|
+
class: z(["chat-input__button", { "chat-input__button-disabled": re.value }]),
|
|
365
|
+
disabled: u(l)().isRecording,
|
|
366
|
+
onClick: q
|
|
347
367
|
}, [
|
|
348
|
-
h("span",
|
|
349
|
-
|
|
368
|
+
h("span", Xe, [
|
|
369
|
+
O(u(ze), { color: ue.value }, null, 8, ["color"])
|
|
350
370
|
])
|
|
351
|
-
], 10,
|
|
352
|
-
h("div",
|
|
353
|
-
|
|
371
|
+
], 10, Qe),
|
|
372
|
+
h("div", Ze, [
|
|
373
|
+
Y(e.$slots, "buttons", {}, void 0, !0)
|
|
354
374
|
])
|
|
355
375
|
]));
|
|
356
376
|
}
|
|
357
377
|
});
|
|
358
378
|
export {
|
|
359
|
-
|
|
379
|
+
xt as default
|
|
360
380
|
};
|