@mobilon-dev/chotto 0.3.58 → 0.3.59
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/FilePreview/FilePreview.vue.js +2 -2
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +14 -13
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +2 -2
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +48 -41
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +1 -1
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +19 -16
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +2 -2
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +29 -27
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +21 -20
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +15 -14
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +8 -7
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +11 -10
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +8 -7
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +2 -1
- package/dist/components/2_modals/ModalFullscreen/ModalFullscreen.vue.js +41 -29
- 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_modals/ModalFullscreen/ModalFullscreen.vue.d.ts +2 -0
- package/dist/types/components/2_modals/ModalFullscreen/stories/ModalFullscreen.stories.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FilePreview.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b83aa92d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as M, inject as P, ref as s, computed as I, onMounted as x, createElementBlock as n, openBlock as o, createElementVNode as i, createBlock as h, withDirectives as k, vShow as g, createCommentVNode as r, toDisplayString as
|
|
1
|
+
import { defineComponent as M, inject as P, ref as s, computed as I, onMounted as x, createElementBlock as n, openBlock as o, createElementVNode as i, createBlock as h, withDirectives as k, vShow as g, createCommentVNode as r, toDisplayString as c, Teleport as A, createVNode as L, Transition as U, withCtx as T, unref as N } from "vue";
|
|
2
2
|
import z from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
|
|
3
3
|
import "../../../hooks/useMessageDraft.js";
|
|
4
4
|
import "../../../hooks/useSearchModel.js";
|
|
@@ -20,7 +20,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
20
20
|
}, Z = {
|
|
21
21
|
key: 2,
|
|
22
22
|
class: "preview__audio-time"
|
|
23
|
-
}, ee = { class: "preview__reset" }, ie = ["src"], te = ["src"],
|
|
23
|
+
}, ee = { class: "preview__reset" }, ie = ["src"], te = ["src"], ce = /* @__PURE__ */ M({
|
|
24
24
|
__name: "FilePreview",
|
|
25
25
|
props: {
|
|
26
26
|
fileInfo: {
|
|
@@ -35,8 +35,8 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
35
35
|
e.value && (u.value ? e.value.pause() : e.value.play(), u.value = !u.value);
|
|
36
36
|
}
|
|
37
37
|
const w = (m) => {
|
|
38
|
-
const l = Math.floor(m / 60),
|
|
39
|
-
return `${l.toString().padStart(2, "0")}:${
|
|
38
|
+
const l = Math.floor(m / 60), f = Math.floor(m % 60);
|
|
39
|
+
return `${l.toString().padStart(2, "0")}:${f.toString().padStart(2, "0")}`;
|
|
40
40
|
}, $ = I(() => e.value ? w(_.value) : "0:00"), y = I(() => e.value || a.value ? w(v.value) : "0:00");
|
|
41
41
|
return x(() => {
|
|
42
42
|
e.value != null && (e.value.addEventListener("loadedmetadata", () => {
|
|
@@ -55,7 +55,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
55
55
|
t.fileInfo.isImage ? (o(), n("div", {
|
|
56
56
|
key: 0,
|
|
57
57
|
style: { position: "relative" },
|
|
58
|
-
onClick: l[0] || (l[0] = (
|
|
58
|
+
onClick: l[0] || (l[0] = (f) => d.value = !0)
|
|
59
59
|
}, [
|
|
60
60
|
i("img", {
|
|
61
61
|
src: t.fileInfo.previewUrl,
|
|
@@ -68,7 +68,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
68
68
|
])) : t.fileInfo.isVideo ? (o(), n("div", {
|
|
69
69
|
key: 1,
|
|
70
70
|
style: { position: "relative" },
|
|
71
|
-
onClick: l[1] || (l[1] = (
|
|
71
|
+
onClick: l[1] || (l[1] = (f) => d.value = !0)
|
|
72
72
|
}, [
|
|
73
73
|
i("video", {
|
|
74
74
|
ref_key: "video",
|
|
@@ -109,15 +109,15 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
109
109
|
]),
|
|
110
110
|
i("div", Q, [
|
|
111
111
|
i("div", R, [
|
|
112
|
-
i("span", W,
|
|
113
|
-
!t.fileInfo.isAudio && !t.fileInfo.isVideo ? (o(), n("span", X,
|
|
114
|
-
t.fileInfo.isAudio ? (o(), n("span", Y,
|
|
115
|
-
t.fileInfo.isVideo ? (o(), n("span", Z,
|
|
112
|
+
i("span", W, c(t.fileInfo.fileName), 1),
|
|
113
|
+
!t.fileInfo.isAudio && !t.fileInfo.isVideo ? (o(), n("span", X, c(t.fileInfo.fileSize), 1)) : r("", !0),
|
|
114
|
+
t.fileInfo.isAudio ? (o(), n("span", Y, c(`${$.value} / ${y.value}`), 1)) : r("", !0),
|
|
115
|
+
t.fileInfo.isVideo ? (o(), n("span", Z, c(y.value), 1)) : r("", !0)
|
|
116
116
|
]),
|
|
117
117
|
i("div", ee, [
|
|
118
118
|
i("span", {
|
|
119
119
|
class: "pi pi-times",
|
|
120
|
-
onClick: l[2] || (l[2] = (
|
|
120
|
+
onClick: l[2] || (l[2] = (f) => E("reset"))
|
|
121
121
|
})
|
|
122
122
|
])
|
|
123
123
|
]),
|
|
@@ -127,6 +127,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
127
127
|
d.value ? (o(), h(z, {
|
|
128
128
|
key: 0,
|
|
129
129
|
theme: N(p)().theme ? N(p)().theme : "",
|
|
130
|
+
title: t.fileInfo.fileName,
|
|
130
131
|
onClose: S
|
|
131
132
|
}, {
|
|
132
133
|
default: T(() => [
|
|
@@ -145,7 +146,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
145
146
|
}, null, 8, te)) : r("", !0)
|
|
146
147
|
]),
|
|
147
148
|
_: 1
|
|
148
|
-
}, 8, ["theme"])) : r("", !0)
|
|
149
|
+
}, 8, ["theme", "title"])) : r("", !0)
|
|
149
150
|
]),
|
|
150
151
|
_: 1
|
|
151
152
|
})
|
|
@@ -154,5 +155,5 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
export {
|
|
157
|
-
|
|
158
|
+
ce as default
|
|
158
159
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FileUploader.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const p = /* @__PURE__ */
|
|
3
|
+
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-eeb89ab4"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as x, ref as n, inject as O, computed as M, watchEffect as P, onMounted as $, onUnmounted as H, createElementBlock as w, openBlock as
|
|
1
|
+
import { defineComponent as x, ref as n, inject as O, computed as M, watchEffect as P, onMounted as $, onUnmounted as H, createElementBlock as w, openBlock as u, Fragment as L, createCommentVNode as _, createElementVNode as p, createBlock as S, normalizeClass as R, createVNode as j, unref as b, Teleport as T } from "vue";
|
|
2
2
|
import q from "../FilePreview/FilePreview.vue.js";
|
|
3
3
|
import { uploadFile as G } from "../../../hooks/uploadFile/uploadFile.js";
|
|
4
4
|
import { useMessageDraft as J } from "../../../hooks/useMessageDraft.js";
|
|
@@ -10,7 +10,13 @@ import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
|
10
10
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
11
11
|
import "../../../functions/parseMarkdown.js";
|
|
12
12
|
import K from "./icons/FileUploaderIcon.vue.js";
|
|
13
|
-
const Q = {
|
|
13
|
+
const Q = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "file-uploader__status file-uploader__status--uploading"
|
|
16
|
+
}, W = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "file-uploader__status file-uploader__status--error"
|
|
19
|
+
}, X = ["disabled"], fe = /* @__PURE__ */ x({
|
|
14
20
|
__name: "FileUploader",
|
|
15
21
|
props: {
|
|
16
22
|
filebumpUrl: {
|
|
@@ -23,49 +29,49 @@ const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
|
|
|
23
29
|
}
|
|
24
30
|
},
|
|
25
31
|
emits: ["fileUploaded"],
|
|
26
|
-
setup(
|
|
27
|
-
const v =
|
|
28
|
-
let
|
|
32
|
+
setup(m, { emit: Y }) {
|
|
33
|
+
const v = m, r = n(""), s = n(), f = n(), B = n(), i = O("chatAppId"), { setMessageFile: V, resetMessageFile: z, getMessage: h, setRecordingMessage: C } = J(i), c = n("#5F5F5F"), d = n("#404040"), g = n(!1);
|
|
34
|
+
let a = null;
|
|
29
35
|
const y = () => {
|
|
30
36
|
if (!i) {
|
|
31
|
-
|
|
37
|
+
c.value = "#5F5F5F", d.value = "#404040";
|
|
32
38
|
return;
|
|
33
39
|
}
|
|
34
40
|
const l = document.getElementById(i);
|
|
35
41
|
if (!l) {
|
|
36
|
-
|
|
42
|
+
c.value = "#5F5F5F", d.value = "#404040";
|
|
37
43
|
return;
|
|
38
44
|
}
|
|
39
45
|
const t = window.getComputedStyle(l), e = t.getPropertyValue("--chotto-fileuploader-trigger-color").trim(), o = t.getPropertyValue("--chotto-fileuploader-trigger-hover-color").trim();
|
|
40
|
-
|
|
41
|
-
}, A = M(() => g.value ?
|
|
46
|
+
c.value = e || "#5F5F5F", d.value = o || "#404040";
|
|
47
|
+
}, A = M(() => g.value ? d.value : c.value);
|
|
42
48
|
P(() => {
|
|
43
49
|
y();
|
|
44
50
|
});
|
|
45
|
-
const F = M(() => !
|
|
51
|
+
const F = M(() => !h().file), I = () => {
|
|
46
52
|
const l = document.getElementById("chat-input-file-line-" + i);
|
|
47
|
-
l && (l.style.display = "none"), z(),
|
|
53
|
+
l && (l.style.display = "none"), z(), f.value = void 0, r.value = "";
|
|
48
54
|
}, N = async () => {
|
|
49
55
|
var l, t;
|
|
50
|
-
|
|
56
|
+
I(), (l = s.value) != null && l.files && k((t = s.value) == null ? void 0 : t.files[0]);
|
|
51
57
|
}, D = () => {
|
|
52
58
|
s.value && F && v.state == "active" && s.value.click();
|
|
53
|
-
},
|
|
59
|
+
}, E = async (l) => {
|
|
54
60
|
var e;
|
|
55
61
|
const t = (e = l.clipboardData) == null ? void 0 : e.items;
|
|
56
62
|
if (t) {
|
|
57
63
|
for (let o of t)
|
|
58
64
|
if (o.type.indexOf("image") !== -1) {
|
|
59
65
|
l.preventDefault();
|
|
60
|
-
const
|
|
61
|
-
|
|
66
|
+
const U = o.getAsFile();
|
|
67
|
+
U && k(U);
|
|
62
68
|
}
|
|
63
69
|
}
|
|
64
|
-
},
|
|
65
|
-
r.value = "uploading",
|
|
70
|
+
}, k = async (l) => {
|
|
71
|
+
r.value = "uploading", C(!0);
|
|
66
72
|
const t = typeof v.filebumpUrl == "string" ? v.filebumpUrl : null;
|
|
67
73
|
await G(t, l).then((e) => {
|
|
68
|
-
if (
|
|
74
|
+
if (C(!1), r.value = e.status, e.status == "success") {
|
|
69
75
|
V({
|
|
70
76
|
url: e.url,
|
|
71
77
|
name: e.name,
|
|
@@ -73,7 +79,7 @@ const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
|
|
|
73
79
|
type: e.type
|
|
74
80
|
});
|
|
75
81
|
const o = document.getElementById("chat-input-file-line-" + i);
|
|
76
|
-
o && (o.style.display = "inherit"), e.preview && (
|
|
82
|
+
o && (o.style.display = "inherit"), e.preview && (f.value = {
|
|
77
83
|
previewUrl: e.preview.previewUrl,
|
|
78
84
|
isImage: e.preview.isImage,
|
|
79
85
|
isVideo: e.preview.isVideo,
|
|
@@ -85,53 +91,54 @@ const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
|
|
|
85
91
|
});
|
|
86
92
|
};
|
|
87
93
|
return $(() => {
|
|
88
|
-
if (window.addEventListener("paste",
|
|
94
|
+
if (window.addEventListener("paste", E), y(), i) {
|
|
89
95
|
const l = document.getElementById(i);
|
|
90
|
-
l && (
|
|
96
|
+
l && (a = new MutationObserver((t) => {
|
|
91
97
|
t.forEach((e) => {
|
|
92
98
|
e.type === "attributes" && e.attributeName === "data-theme" && y();
|
|
93
99
|
});
|
|
94
|
-
}),
|
|
100
|
+
}), a.observe(l, {
|
|
95
101
|
attributes: !0,
|
|
96
102
|
attributeFilter: ["data-theme"]
|
|
97
103
|
}));
|
|
98
104
|
}
|
|
99
105
|
}), H(() => {
|
|
100
|
-
window.removeEventListener("paste",
|
|
101
|
-
}), (l, t) => (
|
|
102
|
-
r.value === "uploading" ? (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
window.removeEventListener("paste", E), a && (a.disconnect(), a = null);
|
|
107
|
+
}), (l, t) => (u(), w(L, null, [
|
|
108
|
+
r.value === "uploading" ? (u(), w("div", Q, [...t[2] || (t[2] = [
|
|
109
|
+
p("span", null, "Загрузка", -1),
|
|
110
|
+
p("span", null, "файла...", -1)
|
|
111
|
+
])])) : r.value === "error" ? (u(), w("div", W, [...t[3] || (t[3] = [
|
|
112
|
+
p("span", null, "Ошибка при загрузке файла.", -1)
|
|
113
|
+
])])) : _("", !0),
|
|
114
|
+
p("span", {
|
|
108
115
|
ref_key: "triggerElement",
|
|
109
116
|
ref: B,
|
|
110
|
-
class: R(["file-uploader__trigger", { "file-uploader__disabled": !F.value ||
|
|
111
|
-
disabled: !F.value ||
|
|
117
|
+
class: R(["file-uploader__trigger", { "file-uploader__disabled": !F.value || m.state == "disabled" }]),
|
|
118
|
+
disabled: !F.value || m.state == "disabled",
|
|
112
119
|
onClick: D,
|
|
113
120
|
onMouseenter: t[0] || (t[0] = (e) => g.value = !0),
|
|
114
121
|
onMouseleave: t[1] || (t[1] = (e) => g.value = !1)
|
|
115
122
|
}, [
|
|
116
|
-
j(
|
|
123
|
+
j(b(K), { fill: A.value }, null, 8, ["fill"])
|
|
117
124
|
], 42, X),
|
|
118
|
-
|
|
125
|
+
p("input", {
|
|
119
126
|
ref_key: "fileInput",
|
|
120
127
|
ref: s,
|
|
121
128
|
style: { display: "none" },
|
|
122
129
|
type: "file",
|
|
123
130
|
onChange: N
|
|
124
131
|
}, null, 544),
|
|
125
|
-
h
|
|
132
|
+
b(h)().file ? (u(), S(T, {
|
|
126
133
|
key: 2,
|
|
127
|
-
to: "#chat-input-file-line-" +
|
|
134
|
+
to: "#chat-input-file-line-" + b(i)
|
|
128
135
|
}, [
|
|
129
|
-
|
|
136
|
+
f.value ? (u(), S(q, {
|
|
130
137
|
key: 0,
|
|
131
|
-
"file-info":
|
|
132
|
-
onReset:
|
|
133
|
-
}, null, 8, ["file-info"])) :
|
|
134
|
-
], 8, ["to"])) :
|
|
138
|
+
"file-info": f.value,
|
|
139
|
+
onReset: I
|
|
140
|
+
}, null, 8, ["file-info"])) : _("", !0)
|
|
141
|
+
], 8, ["to"])) : _("", !0)
|
|
135
142
|
], 64));
|
|
136
143
|
}
|
|
137
144
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AudioRecorder.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8d9aa63f"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|
|
@@ -9,7 +9,10 @@ import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
|
9
9
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
10
10
|
import "../../../functions/parseMarkdown.js";
|
|
11
11
|
import G from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
|
|
12
|
-
const H = { class: "audio-recorder__container" }, J = {
|
|
12
|
+
const H = { class: "audio-recorder__container" }, J = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "audio-recorder__status"
|
|
15
|
+
}, K = {
|
|
13
16
|
key: 1,
|
|
14
17
|
class: "audio-recorder__recording-container"
|
|
15
18
|
}, Q = { class: "audio-recorder__recording-time" }, re = /* @__PURE__ */ D({
|
|
@@ -25,24 +28,24 @@ const H = { class: "audio-recorder__container" }, J = { key: 0 }, K = {
|
|
|
25
28
|
}
|
|
26
29
|
},
|
|
27
30
|
setup(R) {
|
|
28
|
-
const f = N("chatAppId"), { getMessage: n, setMessageFile: U, resetMessageFile: S, setRecordingMessage: k } = q(f), h = o(),
|
|
29
|
-
let
|
|
30
|
-
return
|
|
31
|
-
}), v = o(""), g = o(!1),
|
|
31
|
+
const f = N("chatAppId"), { getMessage: n, setMessageFile: U, resetMessageFile: S, setRecordingMessage: k } = q(f), h = o(), l = o(0), r = o(0), s = o(0), d = o(0), z = T(() => {
|
|
32
|
+
let t = d.value < 10 ? "0" + d.value : d.value, e = s.value < 10 ? "0" + s.value : s.value, i = r.value < 10 ? "0" + r.value : r.value, _ = l.value < 10 ? "00" + l.value : l.value < 100 ? "0" + l.value : l.value;
|
|
33
|
+
return t + ":" + e + ":" + i + ":" + _;
|
|
34
|
+
}), v = o(""), g = o(!1), u = o(), b = o([]), A = o(), p = o(), C = R, B = async () => {
|
|
32
35
|
if (!n().file && C.state == "active") {
|
|
33
|
-
const
|
|
36
|
+
const t = await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 });
|
|
34
37
|
h.value = setInterval(() => {
|
|
35
|
-
|
|
36
|
-
}, 10), k(!0), g.value = !0,
|
|
38
|
+
l.value += 10, l.value == 1e3 && (l.value = 0, r.value++, r.value == 60 && (r.value = 0, s.value++, s.value == 60 && (s.value = 0, d.value++)));
|
|
39
|
+
}, 10), k(!0), g.value = !0, u.value = new MediaRecorder(t), u.value.start(), u.value.ondataavailable = (e) => {
|
|
37
40
|
b.value.push(e.data);
|
|
38
41
|
};
|
|
39
42
|
}
|
|
40
43
|
}, F = () => {
|
|
41
44
|
I(), A.value = void 0;
|
|
42
45
|
}, E = () => {
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
A.value = e, v.value = "uploading", await O(C.filebumpUrl,
|
|
46
|
+
u.value && (u.value.stop(), u.value.onstop = async () => {
|
|
47
|
+
const t = new File(b.value, "voicemessage.mp3", { type: "audio/*" }), e = URL.createObjectURL(t);
|
|
48
|
+
A.value = e, v.value = "uploading", await O(C.filebumpUrl, t).then((i) => {
|
|
46
49
|
if (v.value = i.status, i.status == "success") {
|
|
47
50
|
const _ = document.getElementById("chat-input-file-line-" + f);
|
|
48
51
|
_ && (_.style.display = "inherit"), U({
|
|
@@ -62,19 +65,19 @@ const H = { class: "audio-recorder__container" }, J = { key: 0 }, K = {
|
|
|
62
65
|
});
|
|
63
66
|
}), I();
|
|
64
67
|
}, I = () => {
|
|
65
|
-
clearInterval(h.value),
|
|
68
|
+
clearInterval(h.value), l.value = 0, r.value = 0, s.value = 0, d.value = 0, k(!1), g.value = !1, u.value = void 0, b.value = [];
|
|
66
69
|
}, V = () => {
|
|
67
|
-
const
|
|
68
|
-
|
|
70
|
+
const t = document.getElementById("chat-input-file-line-" + f);
|
|
71
|
+
t && (t.style.display = "none"), S(), p.value = void 0;
|
|
69
72
|
};
|
|
70
73
|
return j(
|
|
71
74
|
() => n().file,
|
|
72
75
|
() => {
|
|
73
76
|
n().file || (p.value = void 0);
|
|
74
77
|
}
|
|
75
|
-
), (
|
|
78
|
+
), (t, e) => (c(), y("div", H, [
|
|
76
79
|
v.value === "uploading" ? (c(), y("div", J, [...e[0] || (e[0] = [
|
|
77
|
-
a("
|
|
80
|
+
a("span", null, "Загрузка файла...", -1)
|
|
78
81
|
])])) : m("", !0),
|
|
79
82
|
g.value && v.value != "uploading" ? (c(), y("div", K, [
|
|
80
83
|
e[3] || (e[3] = a("span", { class: "audio-recorder__recording-icon pi pi-circle-fill" }, null, -1)),
|
|
@@ -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 m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9cc78254"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, inject as R, ref as
|
|
1
|
+
import { defineComponent as F, inject as R, ref as y, watch as V, createElementBlock as d, openBlock as o, Fragment as C, createCommentVNode as n, createBlock as w, unref as p, normalizeClass as I, createElementVNode as c, Teleport as M } from "vue";
|
|
2
2
|
import { uploadFile as z } from "../../../hooks/uploadFile/uploadFile.js";
|
|
3
3
|
import { useMessageDraft as A } from "../../../hooks/useMessageDraft.js";
|
|
4
4
|
import "../../../hooks/useSearchModel.js";
|
|
@@ -28,21 +28,21 @@ const U = {
|
|
|
28
28
|
default: null
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
setup(
|
|
32
|
-
const r = R("chatAppId"), { getMessage: t, setMessageFile:
|
|
33
|
-
if (!t().file &&
|
|
34
|
-
const
|
|
35
|
-
await S(
|
|
36
|
-
i.videoFile && (a.value = "uploading",
|
|
37
|
-
if (
|
|
38
|
-
|
|
31
|
+
setup(m) {
|
|
32
|
+
const r = R("chatAppId"), { getMessage: t, setMessageFile: _, setRecordingMessage: u, resetMessageFile: h } = A(r), { getTheme: f } = B(r), a = y(""), s = y(), v = m, k = async () => {
|
|
33
|
+
if (!t().file && v.state == "active") {
|
|
34
|
+
const l = f().theme ? f().theme : "";
|
|
35
|
+
await S(l).then(async (i) => {
|
|
36
|
+
i.videoFile && (a.value = "uploading", u(!0), await z(v.filebumpUrl, i.videoFile).then((e) => {
|
|
37
|
+
if (u(!1), a.value = e.status, e.status == "success") {
|
|
38
|
+
_({
|
|
39
39
|
url: e.url,
|
|
40
40
|
name: e.name,
|
|
41
41
|
size: e.size,
|
|
42
42
|
type: e.type
|
|
43
43
|
});
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
const g = document.getElementById("chat-input-file-line-" + r);
|
|
45
|
+
g && (g.style.display = "inherit"), e.preview && (s.value = {
|
|
46
46
|
previewUrl: e.preview.previewUrl,
|
|
47
47
|
isImage: e.preview.isImage,
|
|
48
48
|
isVideo: e.preview.isVideo,
|
|
@@ -55,38 +55,40 @@ const U = {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
}, b = () => {
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
58
|
+
h();
|
|
59
|
+
const l = document.getElementById("chat-input-file-line-" + r);
|
|
60
|
+
l && (l.style.display = "none"), s.value = void 0;
|
|
61
61
|
};
|
|
62
62
|
return V(
|
|
63
63
|
() => t().file,
|
|
64
64
|
() => {
|
|
65
|
-
t().file || (
|
|
65
|
+
t().file || (s.value = void 0);
|
|
66
66
|
}
|
|
67
|
-
), (
|
|
68
|
-
p(t)().isRecording ?
|
|
67
|
+
), (l, i) => (o(), d(C, null, [
|
|
68
|
+
p(t)().isRecording ? n("", !0) : (o(), d("div", U, [
|
|
69
69
|
a.value != "uploading" ? (o(), d("button", {
|
|
70
70
|
key: 0,
|
|
71
|
-
class: I(["video-recorder__button", { "video-recorder__button-disabled":
|
|
71
|
+
class: I(["video-recorder__button", { "video-recorder__button-disabled": m.state == "disabled" || p(t)().file }]),
|
|
72
72
|
onClick: k
|
|
73
73
|
}, [...i[0] || (i[0] = [
|
|
74
|
-
|
|
75
|
-
])], 2)) :
|
|
74
|
+
c("span", { class: "pi pi-video" }, null, -1)
|
|
75
|
+
])], 2)) : n("", !0)
|
|
76
76
|
])),
|
|
77
77
|
a.value === "uploading" ? (o(), d("div", N, [...i[1] || (i[1] = [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
c("div", { class: "video-recorder__status" }, [
|
|
79
|
+
c("span", null, "Загрузка файла...")
|
|
80
|
+
], -1)
|
|
81
|
+
])])) : n("", !0),
|
|
82
|
+
p(t)().file ? (o(), w(M, {
|
|
81
83
|
key: 2,
|
|
82
84
|
to: "#chat-input-file-line-" + p(r)
|
|
83
85
|
}, [
|
|
84
|
-
|
|
86
|
+
s.value ? (o(), w(E, {
|
|
85
87
|
key: 0,
|
|
86
|
-
"file-info":
|
|
88
|
+
"file-info": s.value,
|
|
87
89
|
onReset: b
|
|
88
|
-
}, null, 8, ["file-info"])) :
|
|
89
|
-
], 8, ["to"])) :
|
|
90
|
+
}, null, 8, ["file-info"])) : n("", !0)
|
|
91
|
+
], 8, ["to"])) : n("", !0)
|
|
90
92
|
], 64));
|
|
91
93
|
}
|
|
92
94
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ImageMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-435c558d"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as de, inject as fe, ref as f, watch as N, nextTick as A, onMounted as ve, onUnmounted as be, computed as k, createElementBlock as
|
|
1
|
+
import { defineComponent as de, inject as fe, ref as f, watch as N, nextTick as A, onMounted as ve, onUnmounted as be, computed as k, createElementBlock as u, openBlock as i, normalizeStyle as U, normalizeClass as v, unref as a, createCommentVNode as n, createElementVNode as l, createBlock as b, createVNode as r, withCtx as d, createTextVNode as he, toDisplayString as L, Transition as x, withModifiers as D, Teleport as ye } from "vue";
|
|
2
2
|
import we from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
3
|
import pe from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
4
|
import ke from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
@@ -70,32 +70,32 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
70
70
|
clickAction: Q,
|
|
71
71
|
viewsAction: B,
|
|
72
72
|
handleClickReplied: X
|
|
73
|
-
} = Ie(s.message, C), R = f(!1), { linkedHtml: O, inNewWindow: z } = je(() => s.message.text), c = f(null),
|
|
73
|
+
} = Ie(s.message, C), R = f(!1), { linkedHtml: O, inNewWindow: z } = je(() => s.message.text), c = f(null), g = f(null), h = f(0), I = f(0);
|
|
74
74
|
N(
|
|
75
75
|
() => O.value,
|
|
76
76
|
() => {
|
|
77
77
|
y(), A(() => {
|
|
78
|
-
o &&
|
|
78
|
+
o && g.value && o.observe(g.value);
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
const y = () => {
|
|
83
83
|
A(() => {
|
|
84
|
-
c.value && (h.value = c.value.offsetWidth),
|
|
84
|
+
c.value && (h.value = c.value.offsetWidth), g.value && (I.value = g.value.offsetWidth);
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
87
|
let o = null, M = null;
|
|
88
88
|
ve(() => {
|
|
89
89
|
y(), M = () => y(), window.addEventListener("resize", M), typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
|
|
90
90
|
y();
|
|
91
|
-
}), c.value && o.observe(c.value),
|
|
91
|
+
}), c.value && o.observe(c.value), g.value && o.observe(g.value));
|
|
92
92
|
}), be(() => {
|
|
93
93
|
M && window.removeEventListener("resize", M), o && o.disconnect();
|
|
94
94
|
}), N(
|
|
95
95
|
() => [s.message.text, s.message.url],
|
|
96
96
|
() => {
|
|
97
97
|
y(), A(() => {
|
|
98
|
-
o && (o.disconnect(), c.value && o.observe(c.value),
|
|
98
|
+
o && (o.disconnect(), c.value && o.observe(c.value), g.value && o.observe(g.value));
|
|
99
99
|
});
|
|
100
100
|
},
|
|
101
101
|
{ immediate: !0 }
|
|
@@ -119,7 +119,7 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
119
119
|
headers: {
|
|
120
120
|
Accept: "image/*"
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
122
|
+
}), ge = m.headers.get("content-type") || "", ue = await m.blob(), j = ((t = (w = s.message.url.split(".").pop()) == null ? void 0 : w.split("?")[0]) == null ? void 0 : t.toLowerCase()) || "", re = {
|
|
123
123
|
"image/jpeg": "jpg",
|
|
124
124
|
"image/jpg": "jpg",
|
|
125
125
|
"image/png": "png",
|
|
@@ -128,8 +128,8 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
128
128
|
"image/svg+xml": "svg",
|
|
129
129
|
"image/bmp": "bmp"
|
|
130
130
|
};
|
|
131
|
-
let W = j && ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp"].includes(j) ? j : re[
|
|
132
|
-
const ce = s.message.alt ? s.message.alt.includes(".") ? s.message.alt : `${s.message.alt}.${W}` : `image-${s.message.messageId}.${W}`, $ = window.URL.createObjectURL(
|
|
131
|
+
let W = j && ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp"].includes(j) ? j : re[ge] || "jpg";
|
|
132
|
+
const ce = s.message.alt ? s.message.alt.includes(".") ? s.message.alt : `${s.message.alt}.${W}` : `image-${s.message.messageId}.${W}`, $ = window.URL.createObjectURL(ue), p = document.createElement("a");
|
|
133
133
|
p.href = $, p.download = ce, document.body.appendChild(p), p.click(), document.body.removeChild(p), window.URL.revokeObjectURL($);
|
|
134
134
|
} catch (m) {
|
|
135
135
|
console.error("Ошибка при скачивании изображения:", m);
|
|
@@ -138,7 +138,7 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
138
138
|
function me() {
|
|
139
139
|
C("sms-invite", s.message);
|
|
140
140
|
}
|
|
141
|
-
return (w, t) => (i(),
|
|
141
|
+
return (w, t) => (i(), u("div", {
|
|
142
142
|
class: v(["image-message", [
|
|
143
143
|
H(e.message),
|
|
144
144
|
e.applyStyle(e.message)
|
|
@@ -147,14 +147,14 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
147
147
|
style: U(a(se)),
|
|
148
148
|
onMouseleave: V
|
|
149
149
|
}, [
|
|
150
|
-
e.message.avatar && e.isFirstInSeries ? (i(),
|
|
150
|
+
e.message.avatar && e.isFirstInSeries ? (i(), u("img", {
|
|
151
151
|
key: 0,
|
|
152
152
|
class: "image-message__avatar",
|
|
153
153
|
src: e.message.avatar,
|
|
154
154
|
height: "32",
|
|
155
155
|
width: "32"
|
|
156
156
|
}, null, 8, He)) : n("", !0),
|
|
157
|
-
e.message.subText && e.isFirstInSeries ? (i(),
|
|
157
|
+
e.message.subText && e.isFirstInSeries ? (i(), u("p", We, [
|
|
158
158
|
r(Se, {
|
|
159
159
|
text: a(oe),
|
|
160
160
|
position: e.message.position === "left" ? "right" : "left",
|
|
@@ -182,7 +182,7 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
182
182
|
onMouseenter: Y,
|
|
183
183
|
onMouseleave: V
|
|
184
184
|
}, [
|
|
185
|
-
F.value ? (i(),
|
|
185
|
+
F.value ? (i(), u("div", $e, [
|
|
186
186
|
l("img", {
|
|
187
187
|
class: "image-message__blur-left",
|
|
188
188
|
src: e.message.url,
|
|
@@ -204,8 +204,8 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
204
204
|
}, null, 12, De),
|
|
205
205
|
r(x, { name: "modal-fade" }, {
|
|
206
206
|
default: d(() => [
|
|
207
|
-
R.value ? (i(),
|
|
208
|
-
e.message.views ? (i(),
|
|
207
|
+
R.value ? (i(), u("div", Pe, [
|
|
208
|
+
e.message.views ? (i(), u("div", {
|
|
209
209
|
key: 0,
|
|
210
210
|
class: "image-message__views",
|
|
211
211
|
onClick: t[0] || (t[0] = D(
|
|
@@ -231,7 +231,7 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
231
231
|
}),
|
|
232
232
|
r(x, { name: "modal-fade" }, {
|
|
233
233
|
default: d(() => [
|
|
234
|
-
R.value ? (i(),
|
|
234
|
+
R.value ? (i(), u("button", {
|
|
235
235
|
key: 0,
|
|
236
236
|
class: "image-message__download-button",
|
|
237
237
|
onClick: D(ae, ["stop"])
|
|
@@ -244,7 +244,7 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
244
244
|
], 34),
|
|
245
245
|
r(x, { name: "modal-fade" }, {
|
|
246
246
|
default: d(() => [
|
|
247
|
-
a(G) && e.message.actions ? (i(),
|
|
247
|
+
a(G) && e.message.actions ? (i(), u("button", {
|
|
248
248
|
key: 0,
|
|
249
249
|
class: "image-message__menu-button",
|
|
250
250
|
onClick: t[2] || (t[2] = (m) => S.value = !a(S))
|
|
@@ -265,10 +265,10 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
265
265
|
]),
|
|
266
266
|
_: 1
|
|
267
267
|
}),
|
|
268
|
-
e.message.text ? (i(),
|
|
268
|
+
e.message.text ? (i(), u("div", {
|
|
269
269
|
key: 1,
|
|
270
270
|
ref_key: "textRef",
|
|
271
|
-
ref:
|
|
271
|
+
ref: g,
|
|
272
272
|
class: "image-message__text-container"
|
|
273
273
|
}, [
|
|
274
274
|
l("p", {
|
|
@@ -308,6 +308,7 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
308
308
|
T.value ? (i(), b(Re, {
|
|
309
309
|
key: 0,
|
|
310
310
|
"data-theme": a(E)().theme ? a(E)().theme : "light",
|
|
311
|
+
title: e.message.alt,
|
|
311
312
|
onClose: te
|
|
312
313
|
}, {
|
|
313
314
|
default: d(() => [
|
|
@@ -318,7 +319,7 @@ const Ve = ["messageId"], He = ["src"], We = {
|
|
|
318
319
|
}, null, 8, Je)
|
|
319
320
|
]),
|
|
320
321
|
_: 1
|
|
321
|
-
}, 8, ["data-theme"])) : n("", !0)
|
|
322
|
+
}, 8, ["data-theme", "title"])) : n("", !0)
|
|
322
323
|
]),
|
|
323
324
|
_: 1
|
|
324
325
|
})
|