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