@mobilon-dev/chotto 0.3.89 → 0.3.91
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_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +2 -2
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +41 -33
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +3 -3
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +87 -103
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +1 -1
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +171 -152
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +2 -2
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +52 -79
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +2 -2
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +35 -64
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +4 -0
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +4 -0
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +33 -29
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +62 -58
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +27 -23
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +49 -41
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +105 -101
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +223 -149
- package/dist/components/3_compounds/ChatList/composables/useChatListFilter.js +18 -13
- package/dist/functions/renderAppleEmojis.js +127 -70
- package/dist/hooks/uploadFile/generatePreview.js +23 -11
- package/dist/hooks/useMessageDraft.js +61 -32
- package/dist/index.js +113 -112
- 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/apps/data/messages.d.ts +52 -0
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -2
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -2
- package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +15 -0
- package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +34 -0
- package/dist/types/components/2_feed_elements/CallMessage/styles/types.d.ts +26 -0
- package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +30 -0
- package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +34 -0
- package/dist/types/components/2_feed_elements/StickerMessage/styles/types.d.ts +4 -0
- package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +38 -2
- package/dist/types/components/2_feed_elements/TypingMessage/styles/types.d.ts +2 -0
- package/dist/types/components/2_feed_elements/VideoMessage/styles/types.d.ts +34 -0
- package/dist/types/components/3_compounds/ChatInput/ChatInput.vue.d.ts +3 -3
- package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
- package/dist/types/components/3_compounds/Feed/composables/useFeedReply.d.ts +1 -27
- package/dist/types/functions/renderAppleEmojis.d.ts +17 -2
- package/dist/types/hooks/uploadFile/generatePreview.d.ts +2 -0
- package/dist/types/hooks/uploadFile/uploadFile.d.ts +9 -17
- package/dist/types/hooks/useMessageDraft.d.ts +27 -29
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as z, inject as D, ref as t, computed as j, createElementBlock as v, openBlock as p, createCommentVNode as _, createElementVNode as l, toDisplayString as x, unref as A, normalizeClass as B } from "vue";
|
|
2
|
+
import { buildFilePreview as E } from "../../../hooks/uploadFile/generatePreview.js";
|
|
3
|
+
import { uploadFile as L } from "../../../hooks/uploadFile/uploadFile.js";
|
|
4
|
+
import { useMessageDraft as N } from "../../../hooks/useMessageDraft.js";
|
|
4
5
|
import "../../../hooks/useSearchModel.js";
|
|
5
6
|
import "../../../hooks/useTheme.js";
|
|
6
7
|
import "../../../hooks/useEmojiNative.js";
|
|
@@ -11,14 +12,13 @@ import "../../../locale/useLocale.js";
|
|
|
11
12
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
12
13
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
13
14
|
import "../../../functions/parseMarkdown.js";
|
|
14
|
-
|
|
15
|
-
const H = { class: "audio-recorder__container" }, J = {
|
|
15
|
+
const T = { class: "audio-recorder__container" }, V = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "audio-recorder__status"
|
|
18
|
-
},
|
|
18
|
+
}, O = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "audio-recorder__recording-container"
|
|
21
|
-
},
|
|
21
|
+
}, P = { class: "audio-recorder__recording-time" }, ae = /* @__PURE__ */ z({
|
|
22
22
|
__name: "AudioRecorder",
|
|
23
23
|
props: {
|
|
24
24
|
state: {
|
|
@@ -30,94 +30,67 @@ const H = { class: "audio-recorder__container" }, J = {
|
|
|
30
30
|
default: null
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
35
|
-
let
|
|
36
|
-
return
|
|
37
|
-
}),
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, 10),
|
|
43
|
-
|
|
33
|
+
setup(g) {
|
|
34
|
+
const C = D("chatAppId"), { getMessage: m, setMessageFile: M, setRecordingMessage: b } = N(C), y = t(), a = t(0), r = t(0), u = t(0), n = t(0), U = j(() => {
|
|
35
|
+
let s = n.value < 10 ? "0" + n.value : n.value, e = u.value < 10 ? "0" + u.value : u.value, o = r.value < 10 ? "0" + r.value : r.value, S = a.value < 10 ? "00" + a.value : a.value < 100 ? "0" + a.value : a.value;
|
|
36
|
+
return s + ":" + e + ":" + o + ":" + S;
|
|
37
|
+
}), c = t(""), d = t(!1), i = t(), f = t([]), R = t(), k = g, h = async () => {
|
|
38
|
+
if (!m().file && k.state == "active") {
|
|
39
|
+
const s = await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 });
|
|
40
|
+
y.value = setInterval(() => {
|
|
41
|
+
a.value += 10, a.value == 1e3 && (a.value = 0, r.value++, r.value == 60 && (r.value = 0, u.value++, u.value == 60 && (u.value = 0, n.value++)));
|
|
42
|
+
}, 10), b(!0), d.value = !0, i.value = new MediaRecorder(s), i.value.start(), i.value.ondataavailable = (e) => {
|
|
43
|
+
f.value.push(e.data);
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
}, F = () => {
|
|
47
|
-
|
|
48
|
-
}, E = () => {
|
|
49
|
-
u.value && (u.value.stop(), u.value.onstop = async () => {
|
|
50
|
-
const t = new File(b.value, "voicemessage.mp3", { type: "audio/*" }), e = URL.createObjectURL(t);
|
|
51
|
-
A.value = e, v.value = "uploading", await O(C.filebumpUrl, t).then((i) => {
|
|
52
|
-
if (v.value = i.status, i.status == "success") {
|
|
53
|
-
const _ = document.getElementById("chat-input-file-line-" + f);
|
|
54
|
-
_ && (_.style.display = "inherit"), U({
|
|
55
|
-
url: i.url,
|
|
56
|
-
name: i.name,
|
|
57
|
-
size: i.size,
|
|
58
|
-
type: i.type
|
|
59
|
-
}), i.preview && (p.value = {
|
|
60
|
-
previewUrl: i.preview.previewUrl,
|
|
61
|
-
isImage: i.preview.isImage,
|
|
62
|
-
isVideo: i.preview.isVideo,
|
|
63
|
-
isAudio: i.preview.isAudio,
|
|
64
|
-
fileName: i.name,
|
|
65
|
-
fileSize: i.preview.fileSize
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}), I();
|
|
47
|
+
w(), R.value = void 0;
|
|
70
48
|
}, I = () => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
49
|
+
i.value && (i.value.stop(), i.value.onstop = async () => {
|
|
50
|
+
const s = new File(f.value, "voicemessage.mp3", { type: "audio/*" }), e = URL.createObjectURL(s);
|
|
51
|
+
R.value = e, c.value = "uploading", await L(k.filebumpUrl, s).then((o) => {
|
|
52
|
+
c.value = o.status, o.status == "success" && M({
|
|
53
|
+
url: o.url,
|
|
54
|
+
name: o.name,
|
|
55
|
+
size: o.size,
|
|
56
|
+
type: o.type,
|
|
57
|
+
preview: E(o.name, o.preview)
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}), w();
|
|
61
|
+
}, w = () => {
|
|
62
|
+
clearInterval(y.value), a.value = 0, r.value = 0, u.value = 0, n.value = 0, b(!1), d.value = !1, i.value = void 0, f.value = [];
|
|
75
63
|
};
|
|
76
|
-
return
|
|
77
|
-
()
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
a("span", null, "Загрузка файла...", -1)
|
|
84
|
-
])])) : m("", !0),
|
|
85
|
-
g.value && v.value != "uploading" ? (c(), y("div", K, [
|
|
86
|
-
e[3] || (e[3] = a("span", { class: "audio-recorder__recording-icon pi pi-circle-fill" }, null, -1)),
|
|
87
|
-
a("button", {
|
|
64
|
+
return (s, e) => (p(), v("div", T, [
|
|
65
|
+
c.value === "uploading" ? (p(), v("div", V, [...e[0] || (e[0] = [
|
|
66
|
+
l("span", null, "Загрузка файла...", -1)
|
|
67
|
+
])])) : _("", !0),
|
|
68
|
+
d.value && c.value != "uploading" ? (p(), v("div", O, [
|
|
69
|
+
e[3] || (e[3] = l("span", { class: "audio-recorder__recording-icon pi pi-circle-fill" }, null, -1)),
|
|
70
|
+
l("button", {
|
|
88
71
|
class: "audio-recorder__button audio-recorder__button-record",
|
|
89
72
|
onClick: F
|
|
90
73
|
}, [...e[1] || (e[1] = [
|
|
91
|
-
|
|
74
|
+
l("span", { class: "pi pi-trash" }, null, -1)
|
|
92
75
|
])]),
|
|
93
|
-
|
|
76
|
+
l("button", {
|
|
94
77
|
class: "audio-recorder__button audio-recorder__button-record",
|
|
95
|
-
onClick:
|
|
78
|
+
onClick: I
|
|
96
79
|
}, [...e[2] || (e[2] = [
|
|
97
|
-
|
|
80
|
+
l("div", { class: "audio-recorder__stop" }, null, -1)
|
|
98
81
|
])]),
|
|
99
|
-
|
|
100
|
-
])) :
|
|
101
|
-
!
|
|
82
|
+
l("span", P, x(U.value), 1)
|
|
83
|
+
])) : _("", !0),
|
|
84
|
+
!d.value && c.value != "uploading" && !A(m)().isRecording ? (p(), v("button", {
|
|
102
85
|
key: 2,
|
|
103
|
-
class:
|
|
104
|
-
onClick:
|
|
86
|
+
class: B(["audio-recorder__button", { "audio-recorder__button-disabled": g.state == "disabled" || A(m)().file }]),
|
|
87
|
+
onClick: h
|
|
105
88
|
}, [...e[4] || (e[4] = [
|
|
106
|
-
|
|
107
|
-
])], 2)) :
|
|
108
|
-
w(n)().file ? (c(), M(P, {
|
|
109
|
-
key: 3,
|
|
110
|
-
to: "#chat-input-file-line-" + w(f)
|
|
111
|
-
}, [
|
|
112
|
-
p.value ? (c(), M(G, {
|
|
113
|
-
key: 0,
|
|
114
|
-
"file-info": p.value,
|
|
115
|
-
onReset: V
|
|
116
|
-
}, null, 8, ["file-info"])) : m("", !0)
|
|
117
|
-
], 8, ["to"])) : m("", !0)
|
|
89
|
+
l("span", { class: "pi pi-microphone" }, null, -1)
|
|
90
|
+
])], 2)) : _("", !0)
|
|
118
91
|
]));
|
|
119
92
|
}
|
|
120
93
|
});
|
|
121
94
|
export {
|
|
122
|
-
|
|
95
|
+
ae as default
|
|
123
96
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./VideoRecorder.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d1f2b0be"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as _, inject as y, ref as b, createElementBlock as r, openBlock as i, Fragment as h, createCommentVNode as a, unref as f, normalizeClass as k, createElementVNode as n } from "vue";
|
|
2
|
+
import { buildFilePreview as F } from "../../../hooks/uploadFile/generatePreview.js";
|
|
3
|
+
import { uploadFile as w } from "../../../hooks/uploadFile/uploadFile.js";
|
|
4
|
+
import { useMessageDraft as M } from "../../../hooks/useMessageDraft.js";
|
|
4
5
|
import "../../../hooks/useSearchModel.js";
|
|
5
|
-
import { useTheme as
|
|
6
|
+
import { useTheme as R } from "../../../hooks/useTheme.js";
|
|
6
7
|
import "../../../hooks/useEmojiNative.js";
|
|
7
8
|
/* empty css */
|
|
8
9
|
/* empty css */
|
|
9
10
|
import "../../../locale/useLocale.js";
|
|
10
11
|
/* empty css */
|
|
11
|
-
import { useModalVideoRecorder as
|
|
12
|
+
import { useModalVideoRecorder as V } from "../../../hooks/modals/useVideoRecorder.js";
|
|
12
13
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
13
14
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
14
15
|
import "../../../functions/parseMarkdown.js";
|
|
15
|
-
|
|
16
|
-
const U = {
|
|
16
|
+
const C = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "video-recorder__container"
|
|
19
|
-
},
|
|
19
|
+
}, z = {
|
|
20
20
|
key: 1,
|
|
21
21
|
class: "video-recorder__container"
|
|
22
|
-
},
|
|
22
|
+
}, J = /* @__PURE__ */ _({
|
|
23
23
|
__name: "VideoRecorder",
|
|
24
24
|
props: {
|
|
25
25
|
state: {
|
|
@@ -31,70 +31,41 @@ const U = {
|
|
|
31
31
|
default: null
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
38
|
-
await
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const g = document.getElementById("chat-input-file-line-" + r);
|
|
48
|
-
g && (g.style.display = "inherit"), e.preview && (s.value = {
|
|
49
|
-
previewUrl: e.preview.previewUrl,
|
|
50
|
-
isImage: e.preview.isImage,
|
|
51
|
-
isVideo: e.preview.isVideo,
|
|
52
|
-
isAudio: e.preview.isAudio,
|
|
53
|
-
fileName: e.name,
|
|
54
|
-
fileSize: e.preview.fileSize
|
|
55
|
-
});
|
|
56
|
-
}
|
|
34
|
+
setup(l) {
|
|
35
|
+
const d = y("chatAppId"), { getMessage: s, setMessageFile: v, setRecordingMessage: p } = M(d), { getTheme: m } = R(d), o = b(""), c = l, g = async () => {
|
|
36
|
+
if (!s().file && c.state == "active") {
|
|
37
|
+
const u = m().theme ? m().theme : "";
|
|
38
|
+
await V(u).then(async (t) => {
|
|
39
|
+
t.videoFile && (o.value = "uploading", p(!0), await w(c.filebumpUrl, t.videoFile).then((e) => {
|
|
40
|
+
p(!1), o.value = e.status, e.status == "success" && v({
|
|
41
|
+
url: e.url,
|
|
42
|
+
name: e.name,
|
|
43
|
+
size: e.size,
|
|
44
|
+
type: e.type,
|
|
45
|
+
preview: F(e.name, e.preview)
|
|
46
|
+
});
|
|
57
47
|
}));
|
|
58
48
|
});
|
|
59
49
|
}
|
|
60
|
-
}, b = () => {
|
|
61
|
-
h();
|
|
62
|
-
const l = document.getElementById("chat-input-file-line-" + r);
|
|
63
|
-
l && (l.style.display = "none"), s.value = void 0;
|
|
64
50
|
};
|
|
65
|
-
return
|
|
66
|
-
()
|
|
67
|
-
|
|
68
|
-
t().file || (s.value = void 0);
|
|
69
|
-
}
|
|
70
|
-
), (l, i) => (o(), d(C, null, [
|
|
71
|
-
p(t)().isRecording ? n("", !0) : (o(), d("div", U, [
|
|
72
|
-
a.value != "uploading" ? (o(), d("button", {
|
|
51
|
+
return (u, t) => (i(), r(h, null, [
|
|
52
|
+
f(s)().isRecording ? a("", !0) : (i(), r("div", C, [
|
|
53
|
+
o.value != "uploading" ? (i(), r("button", {
|
|
73
54
|
key: 0,
|
|
74
|
-
class:
|
|
75
|
-
onClick:
|
|
76
|
-
}, [...
|
|
77
|
-
|
|
78
|
-
])], 2)) :
|
|
55
|
+
class: k(["video-recorder__button", { "video-recorder__button-disabled": l.state == "disabled" || f(s)().file }]),
|
|
56
|
+
onClick: g
|
|
57
|
+
}, [...t[0] || (t[0] = [
|
|
58
|
+
n("span", { class: "pi pi-video" }, null, -1)
|
|
59
|
+
])], 2)) : a("", !0)
|
|
79
60
|
])),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
61
|
+
o.value === "uploading" ? (i(), r("div", z, [...t[1] || (t[1] = [
|
|
62
|
+
n("div", { class: "video-recorder__status" }, [
|
|
63
|
+
n("span", null, "Загрузка файла...")
|
|
83
64
|
], -1)
|
|
84
|
-
])])) :
|
|
85
|
-
p(t)().file ? (o(), w(M, {
|
|
86
|
-
key: 2,
|
|
87
|
-
to: "#chat-input-file-line-" + p(r)
|
|
88
|
-
}, [
|
|
89
|
-
s.value ? (o(), w(E, {
|
|
90
|
-
key: 0,
|
|
91
|
-
"file-info": s.value,
|
|
92
|
-
onReset: b
|
|
93
|
-
}, null, 8, ["file-info"])) : n("", !0)
|
|
94
|
-
], 8, ["to"])) : n("", !0)
|
|
65
|
+
])])) : a("", !0)
|
|
95
66
|
], 64));
|
|
96
67
|
}
|
|
97
68
|
});
|
|
98
69
|
export {
|
|
99
|
-
|
|
70
|
+
J as default
|
|
100
71
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AudioMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-06981a56"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -349,6 +349,10 @@ const Mt = ["messageId"], kt = ["src"], Rt = {
|
|
|
349
349
|
onMouseenter: t[7] || (t[7] = //@ts-ignore
|
|
350
350
|
(...n) => i(J) && i(J)(...n))
|
|
351
351
|
}, [
|
|
352
|
+
t[13] || (t[13] = o("div", {
|
|
353
|
+
class: "audio-message__bottom-shadow",
|
|
354
|
+
"aria-hidden": "true"
|
|
355
|
+
}, null, -1)),
|
|
352
356
|
s.message.deleted ? (u(), r(q, { key: 0 }, [
|
|
353
357
|
b(dt),
|
|
354
358
|
o("div", Tt, [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CallMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-93cf25f4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -365,6 +365,10 @@ const pt = ["messageId"], _t = ["src"], ft = {
|
|
|
365
365
|
}, 8, ["text", "position"])
|
|
366
366
|
])) : p("", !0),
|
|
367
367
|
o("div", gt, [
|
|
368
|
+
t[10] || (t[10] = o("div", {
|
|
369
|
+
class: "call-message__bottom-shadow",
|
|
370
|
+
"aria-hidden": "true"
|
|
371
|
+
}, null, -1)),
|
|
368
372
|
a(s).deleted ? (n(), u(y, { key: 0 }, [
|
|
369
373
|
P(dt),
|
|
370
374
|
o("div", yt, [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FileMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ec2a2790"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -2,8 +2,8 @@ import { defineComponent as te, inject as ae, computed as w, createElementBlock
|
|
|
2
2
|
import me from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
3
|
import re from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
4
|
import ue from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import ge from "../BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
6
|
+
import ce from "../MessageReactions/MessageReactions.vue.js";
|
|
7
7
|
import L from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
|
|
8
8
|
import de from "../MessageSmsInvite/MessageSmsInvite.vue.js";
|
|
9
9
|
import fe from "../DeletedMessageContent/DeletedMessageContent.vue.js";
|
|
@@ -81,7 +81,7 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
81
81
|
},
|
|
82
82
|
emits: ["action", "reply", "sms-invite"],
|
|
83
83
|
setup(e, { emit: F }) {
|
|
84
|
-
const
|
|
84
|
+
const a = e, h = F, { linkedHtml: N, inNewWindow: M } = he(() => a.message.text), { menuActions: b } = ve(() => a.message), O = ae("chatAppId"), { startReply: B } = Me(O || ""), {
|
|
85
85
|
isOpenMenu: j,
|
|
86
86
|
buttonMenuVisible: P,
|
|
87
87
|
menuAnchorRef: V,
|
|
@@ -97,37 +97,37 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
97
97
|
clickAction: G,
|
|
98
98
|
viewsAction: T,
|
|
99
99
|
handleClickReplied: J
|
|
100
|
-
} = be(
|
|
101
|
-
onReply: () => B(U(
|
|
102
|
-
}), x = w(() => Re(
|
|
103
|
-
w(() =>
|
|
100
|
+
} = be(a.message, h, {
|
|
101
|
+
onReply: () => B(U(a.message, "message.file"))
|
|
102
|
+
}), x = w(() => Re(a.message.status)), I = w(() => Se(a.message.status, a.message.statusMsg)), { bubbleStyle: K } = ke(
|
|
103
|
+
w(() => a.message),
|
|
104
104
|
{ cssVariable: "--chotto-filemessage-right-bg", position: "right" }
|
|
105
105
|
);
|
|
106
106
|
function k(r) {
|
|
107
107
|
return Ce(r.position, "file-message");
|
|
108
108
|
}
|
|
109
109
|
const { onToggleReaction: Q, onAddReaction: X, onRemoveReaction: Y } = Te(h), Z = async () => {
|
|
110
|
-
if (
|
|
110
|
+
if (a.message.url)
|
|
111
111
|
try {
|
|
112
|
-
const r = new URL(
|
|
112
|
+
const r = new URL(a.message.url, window.location.href);
|
|
113
113
|
if (r.origin === window.location.origin) {
|
|
114
|
-
const
|
|
115
|
-
|
|
114
|
+
const c = document.createElement("a");
|
|
115
|
+
c.href = r.toString(), c.download = a.message.filename || `file-${a.message.messageId}`, document.body.appendChild(c), c.click(), document.body.removeChild(c);
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
const o = await fetch(
|
|
118
|
+
const o = await fetch(a.message.url);
|
|
119
119
|
if (!o.ok)
|
|
120
120
|
throw new Error(`HTTP error! status: ${o.status}`);
|
|
121
|
-
const se = await o.blob(), p = window.URL.createObjectURL(se),
|
|
122
|
-
|
|
121
|
+
const se = await o.blob(), p = window.URL.createObjectURL(se), g = document.createElement("a");
|
|
122
|
+
g.href = p, g.download = a.message.filename || `file-${a.message.messageId}`, document.body.appendChild(g), g.click(), document.body.removeChild(g), window.URL.revokeObjectURL(p);
|
|
123
123
|
} catch (r) {
|
|
124
|
-
console.error("Ошибка при скачивании файла:", r), window.open(
|
|
124
|
+
console.error("Ошибка при скачивании файла:", r), window.open(a.message.url, "_blank");
|
|
125
125
|
}
|
|
126
|
-
}, _ = we(() =>
|
|
126
|
+
}, _ = we(() => a.message, () => a.subtextTooltipData);
|
|
127
127
|
function ee() {
|
|
128
|
-
h("sms-invite",
|
|
128
|
+
h("sms-invite", a.message);
|
|
129
129
|
}
|
|
130
|
-
return (r,
|
|
130
|
+
return (r, t) => (i(), m("div", {
|
|
131
131
|
ref_key: "menuAnchorRef",
|
|
132
132
|
ref: V,
|
|
133
133
|
class: d(["file-message", [
|
|
@@ -136,7 +136,7 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
136
136
|
]]),
|
|
137
137
|
messageId: e.message.messageId,
|
|
138
138
|
style: v(s(K)),
|
|
139
|
-
onMouseleave:
|
|
139
|
+
onMouseleave: t[4] || (t[4] = //@ts-ignore
|
|
140
140
|
(...o) => s(S) && s(S)(...o))
|
|
141
141
|
}, [
|
|
142
142
|
e.message.avatar && e.isFirstInSeries ? (i(), m("img", {
|
|
@@ -162,9 +162,13 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
162
162
|
n("div", {
|
|
163
163
|
class: d(["file-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar }]),
|
|
164
164
|
style: v({ gridRow: e.message.subText ? "2" : "1" }),
|
|
165
|
-
onMouseenter:
|
|
165
|
+
onMouseenter: t[3] || (t[3] = //@ts-ignore
|
|
166
166
|
(...o) => s(R) && s(R)(...o))
|
|
167
167
|
}, [
|
|
168
|
+
t[9] || (t[9] = n("div", {
|
|
169
|
+
class: "file-message__bottom-shadow",
|
|
170
|
+
"aria-hidden": "true"
|
|
171
|
+
}, null, -1)),
|
|
168
172
|
e.message.deleted ? (i(), m(E, { key: 0 }, [
|
|
169
173
|
u(fe),
|
|
170
174
|
n("div", Ae, [
|
|
@@ -180,7 +184,7 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
180
184
|
])
|
|
181
185
|
])
|
|
182
186
|
], 64)) : (i(), m(E, { key: 1 }, [
|
|
183
|
-
e.message.reply ? (i(), y(
|
|
187
|
+
e.message.reply ? (i(), y(ge, {
|
|
184
188
|
key: 0,
|
|
185
189
|
message: e.message.reply,
|
|
186
190
|
class: d(e.message.position),
|
|
@@ -191,15 +195,15 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
191
195
|
href: e.message.url,
|
|
192
196
|
onClick: ie(Z, ["prevent"])
|
|
193
197
|
}, [
|
|
194
|
-
|
|
198
|
+
t[5] || (t[5] = n("span", { class: "pi pi-file" }, null, -1)),
|
|
195
199
|
n("p", Fe, f(e.message.filename), 1),
|
|
196
|
-
|
|
200
|
+
t[6] || (t[6] = n("div", { class: "file-message__download-button" }, [
|
|
197
201
|
n("span", { class: "pi pi-download" })
|
|
198
202
|
], -1))
|
|
199
203
|
], 8, Ue),
|
|
200
204
|
e.message.text ? (i(), m("div", Ne, [
|
|
201
205
|
n("p", {
|
|
202
|
-
onClick:
|
|
206
|
+
onClick: t[0] || (t[0] = //@ts-ignore
|
|
203
207
|
(...o) => s(M) && s(M)(...o)),
|
|
204
208
|
innerHTML: s(N)
|
|
205
209
|
}, null, 8, Oe)
|
|
@@ -215,7 +219,7 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
215
219
|
embed: e.message.embed
|
|
216
220
|
}, null, 8, ["class", "embed"])) : l("", !0),
|
|
217
221
|
n("div", Be, [
|
|
218
|
-
u(
|
|
222
|
+
u(ce, {
|
|
219
223
|
reactions: e.message.reactions,
|
|
220
224
|
"message-id": e.message.messageId,
|
|
221
225
|
reply: s(U)(e.message, "message.file"),
|
|
@@ -233,10 +237,10 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
233
237
|
e.message.views ? (i(), m("div", {
|
|
234
238
|
key: 0,
|
|
235
239
|
class: "file-message__views",
|
|
236
|
-
onClick:
|
|
240
|
+
onClick: t[1] || (t[1] = //@ts-ignore
|
|
237
241
|
(...o) => s(T) && s(T)(...o))
|
|
238
242
|
}, [
|
|
239
|
-
|
|
243
|
+
t[7] || (t[7] = n("span", { class: "pi pi-eye" }, null, -1)),
|
|
240
244
|
n("p", null, f(e.message.views), 1)
|
|
241
245
|
])) : l("", !0),
|
|
242
246
|
n("span", Pe, f(e.message.time), 1),
|
|
@@ -258,9 +262,9 @@ const xe = ["messageId"], Ie = ["src"], pe = {
|
|
|
258
262
|
s(P) && s(b).length && !e.reactionsEnabled ? (i(), m("button", {
|
|
259
263
|
key: 4,
|
|
260
264
|
class: "file-message__menu-button",
|
|
261
|
-
onClick:
|
|
265
|
+
onClick: t[2] || (t[2] = //@ts-ignore
|
|
262
266
|
(...o) => s(C) && s(C)(...o))
|
|
263
|
-
}, [...
|
|
267
|
+
}, [...t[8] || (t[8] = [
|
|
264
268
|
n("span", { class: "pi pi-ellipsis-h" }, null, -1)
|
|
265
269
|
])])) : l("", !0),
|
|
266
270
|
(i(), y(oe, { to: "body" }, [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./ImageMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ o(
|
|
4
|
+
const r = /* @__PURE__ */ o(a, [["__scopeId", "data-v-7b3f2aad"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|