@mobilon-dev/chotto 0.3.57 → 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/1_atoms/Tooltip/Tooltip.vue.js +1 -1
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +41 -39
- 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/DelimiterMessage/DelimiterMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +11 -11
- 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_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +2 -2
- 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 "./Tooltip.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a2bb5769"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as k, inject as N, ref as
|
|
1
|
+
import { defineComponent as k, inject as N, ref as n, computed as A, onUnmounted as D, createElementBlock as T, openBlock as s, Fragment as R, createElementVNode as V, createBlock as E, renderSlot as I, Teleport as L, createVNode as M, Transition as $, withCtx as j, createCommentVNode as q, normalizeClass as z, unref as g, toDisplayString as F, nextTick as v } from "vue";
|
|
2
2
|
import "../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../hooks/useSearchModel.js";
|
|
4
4
|
import { useTheme as P } from "../../../hooks/useTheme.js";
|
|
@@ -36,72 +36,74 @@ const U = ["data-theme"], Z = /* @__PURE__ */ k({
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
setup(w, { expose: d }) {
|
|
39
|
-
const x = N("chatAppId"), { getTheme: y } = P(x),
|
|
39
|
+
const x = N("chatAppId"), { getTheme: y } = P(x), a = n(), p = n(), c = n(!1), u = n(null), r = n(null), o = w, _ = A(() => ({
|
|
40
40
|
tooltip__text: !0,
|
|
41
|
-
[`tooltip--${
|
|
41
|
+
[`tooltip--${o.position}`]: !0
|
|
42
42
|
})), B = () => {
|
|
43
|
-
|
|
44
|
-
c.value = !0,
|
|
45
|
-
if (
|
|
46
|
-
const f =
|
|
47
|
-
left: { top: t.top - (
|
|
48
|
-
right: { top: t.top - (
|
|
49
|
-
bottom: { top: (t == null ? void 0 : t.bottom) - i +
|
|
50
|
-
"bottom-center": { top: (t == null ? void 0 : t.bottom) - i +
|
|
51
|
-
top: { top: t.top -
|
|
52
|
-
"
|
|
43
|
+
o.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), r.value = setTimeout(() => {
|
|
44
|
+
c.value = !0, v(() => {
|
|
45
|
+
if (a.value && p.value) {
|
|
46
|
+
const f = p.value, t = a.value.getBoundingClientRect(), e = p.value.getBoundingClientRect(), l = e.left < 0 ? e.left : 0, i = e.top < 0 ? e.top : 0, h = {
|
|
47
|
+
left: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - e.width - l - o.offset },
|
|
48
|
+
right: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + o.offset },
|
|
49
|
+
bottom: { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) - l },
|
|
50
|
+
"bottom-center": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
|
|
51
|
+
top: { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) - l },
|
|
52
|
+
"top-center": { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
|
|
53
|
+
"bottom-left": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width - e.width - l }
|
|
53
54
|
};
|
|
54
|
-
f.style.top =
|
|
55
|
+
f.style.top = h[o.position].top + "px", f.style.left = h[o.position].left + "px";
|
|
55
56
|
}
|
|
56
57
|
}), r.value = null;
|
|
57
|
-
},
|
|
58
|
+
}, o.delay));
|
|
58
59
|
}, C = () => {
|
|
59
|
-
|
|
60
|
-
const f =
|
|
60
|
+
o.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), c.value = !1, v(() => {
|
|
61
|
+
const f = g(p);
|
|
61
62
|
f && (f.style.top = "0", f.style.left = "0");
|
|
62
63
|
}));
|
|
63
64
|
}, S = () => {
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
const f =
|
|
67
|
-
left: { top: t.top - (
|
|
68
|
-
right: { top: t.top - (
|
|
69
|
-
bottom: { top: (t == null ? void 0 : t.bottom) - i +
|
|
70
|
-
"bottom-center": { top: (t == null ? void 0 : t.bottom) - i +
|
|
71
|
-
top: { top: t.top -
|
|
72
|
-
"
|
|
65
|
+
m(), c.value = !0, v(() => {
|
|
66
|
+
if (a.value && p.value) {
|
|
67
|
+
const f = p.value, t = a.value.getBoundingClientRect(), e = p.value.getBoundingClientRect(), l = e.left < 0 ? e.left : 0, i = e.top < 0 ? e.top : 0, h = {
|
|
68
|
+
left: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - e.width - l - o.offset },
|
|
69
|
+
right: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + o.offset },
|
|
70
|
+
bottom: { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) - l },
|
|
71
|
+
"bottom-center": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
|
|
72
|
+
top: { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) - l },
|
|
73
|
+
"top-center": { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
|
|
74
|
+
"bottom-left": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width - e.width - l }
|
|
73
75
|
};
|
|
74
|
-
f.style.top =
|
|
76
|
+
f.style.top = h[o.position].top + "px", f.style.left = h[o.position].left + "px";
|
|
75
77
|
}
|
|
76
|
-
}),
|
|
78
|
+
}), o.autoShowDuration > 0 && (u.value = setTimeout(() => {
|
|
77
79
|
c.value = !1;
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
|
|
80
|
+
}, o.autoShowDuration));
|
|
81
|
+
}, m = () => {
|
|
82
|
+
u.value && (clearTimeout(u.value), u.value = null);
|
|
81
83
|
};
|
|
82
84
|
return D(() => {
|
|
83
|
-
r.value && clearTimeout(r.value),
|
|
85
|
+
r.value && clearTimeout(r.value), m();
|
|
84
86
|
}), d({
|
|
85
87
|
startAutoShow: S,
|
|
86
|
-
clearAutoTimer:
|
|
87
|
-
}), (f, t) => (
|
|
88
|
+
clearAutoTimer: m
|
|
89
|
+
}), (f, t) => (s(), T(R, null, [
|
|
88
90
|
V("div", {
|
|
89
91
|
ref_key: "container",
|
|
90
|
-
ref:
|
|
92
|
+
ref: a,
|
|
91
93
|
class: "tooltip-wrapper",
|
|
92
94
|
onMouseover: B,
|
|
93
95
|
onMouseout: C
|
|
94
96
|
}, [
|
|
95
97
|
I(f.$slots, "default", {}, void 0, !0)
|
|
96
98
|
], 544),
|
|
97
|
-
(
|
|
99
|
+
(s(), E(L, { to: "body" }, [
|
|
98
100
|
M($, null, {
|
|
99
101
|
default: j(() => [
|
|
100
|
-
c.value ? (
|
|
102
|
+
c.value ? (s(), T("span", {
|
|
101
103
|
key: 0,
|
|
102
104
|
ref_key: "tooltip",
|
|
103
|
-
ref:
|
|
104
|
-
"data-theme":
|
|
105
|
+
ref: p,
|
|
106
|
+
"data-theme": g(y)().theme ? g(y)().theme : "light",
|
|
105
107
|
class: z(_.value)
|
|
106
108
|
}, F(w.text), 11, U)) : q("", !0)
|
|
107
109
|
]),
|
|
@@ -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 e from "./DelimiterMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ o(e, [["__scopeId", "data-v-75a5769e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|