@mobilon-dev/chotto 0.3.80 → 0.3.82
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_icons/MessageStatus/ErrorStatusIcon.vue.js +7 -0
- package/dist/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/ErrorStatusIcon.vue2.js +5 -5
- package/dist/components/1_icons/MessageStatus/PendingStatusIcon.vue.js +7 -0
- package/dist/components/1_icons/MessageStatus/ReadStatusIcon.vue.js +7 -0
- package/dist/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/ReadStatusIcon.vue2.js +1 -1
- package/dist/components/1_icons/MessageStatus/ReceivedStatusIcon.vue.js +7 -0
- package/dist/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/ReceivedStatusIcon.vue2.js +9 -9
- package/dist/components/1_icons/MessageStatus/SentStatusIcon.vue.js +7 -0
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +1 -1
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +39 -38
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +2 -2
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +123 -122
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +132 -139
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.js +2 -2
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue2.js +5 -5
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +78 -77
- package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue.js +2 -2
- package/dist/components/2_modals/ModalVideoRecorder/ModalVideoRecorder.vue2.js +58 -58
- package/dist/functions/playNotificationAudio.js +4 -3
- package/dist/functions/safeMediaPlay.js +17 -0
- package/dist/index.js +234 -221
- 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 +2 -4
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/functions/index.d.ts +1 -0
- package/dist/types/functions/safeMediaPlay.d.ts +3 -0
- package/package.json +1 -1
- package/dist/components/2_feed_elements/MessageStatusIndicator/icons/ErrorStatusIcon.vue.js +0 -7
- package/dist/components/2_feed_elements/MessageStatusIndicator/icons/PendingStatusIcon.vue.js +0 -7
- package/dist/components/2_feed_elements/MessageStatusIndicator/icons/ReadStatusIcon.vue.js +0 -7
- package/dist/components/2_feed_elements/MessageStatusIndicator/icons/ReceivedStatusIcon.vue.js +0 -7
- package/dist/components/2_feed_elements/MessageStatusIndicator/icons/SentStatusIcon.vue.js +0 -7
- /package/dist/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/PendingStatusIcon.vue2.js +0 -0
- /package/dist/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/SentStatusIcon.vue2.js +0 -0
- /package/dist/types/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/ErrorStatusIcon.vue.d.ts +0 -0
- /package/dist/types/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/PendingStatusIcon.vue.d.ts +0 -0
- /package/dist/types/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/ReadStatusIcon.vue.d.ts +0 -0
- /package/dist/types/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/ReceivedStatusIcon.vue.d.ts +0 -0
- /package/dist/types/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/SentStatusIcon.vue.d.ts +0 -0
- /package/dist/types/components/{2_feed_elements/MessageStatusIndicator/icons → 1_icons/MessageStatus}/index.d.ts +0 -0
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { defineComponent as ie, inject as le, ref as w, computed as p, watch as me, createElementBlock as r, openBlock as o, Fragment as re, createElementVNode as l, createBlock as c, unref as a, normalizeStyle as F, normalizeClass as y, createCommentVNode as i, createVNode as m, withCtx as d, createTextVNode as ue, toDisplayString as T, Transition as b, withModifiers as P, Teleport as de } from "vue";
|
|
2
|
+
import ce from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
|
+
import ge from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
|
+
import ve from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
5
|
+
import fe from "../BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
6
|
+
import ye from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
|
|
7
|
+
import be from "../MessageReactions/MessageReactions.vue.js";
|
|
8
|
+
import ke from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
|
|
9
|
+
import we from "../MessageSmsInvite/MessageSmsInvite.vue.js";
|
|
10
10
|
import pe from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
11
|
-
import { useMessageActions as
|
|
12
|
-
import { useMessageLinks as
|
|
13
|
-
import { useChannelAccentColor as
|
|
14
|
-
import { useSubtextTooltip as
|
|
15
|
-
import { getStatus as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
11
|
+
import { useMessageActions as he } from "../../../hooks/messages/useMessageActions.js";
|
|
12
|
+
import { useMessageLinks as xe } from "../../../hooks/messages/useMessageLinks.js";
|
|
13
|
+
import { useChannelAccentColor as Me } from "../../../hooks/messages/useChannelAccentColor.js";
|
|
14
|
+
import { useSubtextTooltip as Te } from "../../../hooks/messages/useSubtextTooltip.js";
|
|
15
|
+
import { getStatus as Re, getStatusTitle as Ce } from "../../../functions/getStatusMessage.js";
|
|
16
|
+
import { safeMediaPlayVoid as $ } from "../../../functions/safeMediaPlay.js";
|
|
17
|
+
import { getMessageClass as Se } from "../../../functions/getMessageClass.js";
|
|
18
|
+
import { createReactionHandlers as Ie } from "../../../functions/createReactionHandlers.js";
|
|
18
19
|
import "../../../functions/parseMarkdown.js";
|
|
19
20
|
import "../../../hooks/useMessageDraft.js";
|
|
20
21
|
import "../../../hooks/useSearchModel.js";
|
|
21
|
-
import { useTheme as
|
|
22
|
+
import { useTheme as Ae } from "../../../hooks/useTheme.js";
|
|
22
23
|
/* empty css */
|
|
23
24
|
/* empty css */
|
|
24
|
-
const
|
|
25
|
+
const Ee = ["messageId"], Le = ["src"], Be = {
|
|
25
26
|
key: 1,
|
|
26
27
|
class: "video-message__subtext"
|
|
27
|
-
},
|
|
28
|
+
}, Fe = ["src"], Pe = {
|
|
28
29
|
key: 0,
|
|
29
30
|
class: "video-message__info-container"
|
|
30
|
-
}, $e = { class: "video-message__time" },
|
|
31
|
+
}, $e = { class: "video-message__time" }, Oe = {
|
|
31
32
|
key: 1,
|
|
32
33
|
class: "video-message__text-container"
|
|
33
|
-
},
|
|
34
|
+
}, je = ["innerHTML"], He = ["src", "alt"], us = /* @__PURE__ */ ie({
|
|
34
35
|
inheritAttrs: !1,
|
|
35
36
|
__name: "VideoMessage",
|
|
36
37
|
props: {
|
|
@@ -62,31 +63,31 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
emits: ["action", "reply", "sms-invite"],
|
|
65
|
-
setup(e, { emit:
|
|
66
|
-
const
|
|
66
|
+
setup(e, { emit: O }) {
|
|
67
|
+
const j = le("chatAppId"), { getTheme: R } = Ae(j), t = e, h = O;
|
|
67
68
|
function C(u) {
|
|
68
|
-
return
|
|
69
|
+
return Se(u.position, "video-message");
|
|
69
70
|
}
|
|
70
|
-
const S =
|
|
71
|
+
const S = w(), g = w(), x = w(!1), v = w(!1), { linkedHtml: H, inNewWindow: I } = xe(() => t.message.text), {
|
|
71
72
|
isOpenMenu: M,
|
|
72
|
-
buttonMenuVisible:
|
|
73
|
-
showMenu:
|
|
73
|
+
buttonMenuVisible: N,
|
|
74
|
+
showMenu: V,
|
|
74
75
|
hideMenu: A,
|
|
75
76
|
clickAction: q,
|
|
76
77
|
viewsAction: E,
|
|
77
78
|
handleClickReplied: D
|
|
78
|
-
} =
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
79
|
+
} = he(t.message, h), U = () => {
|
|
80
|
+
V(), v.value = !0;
|
|
81
|
+
}, z = p(() => Re(t.message.status)), W = p(() => Ce(t.message.status, t.message.statusMsg)), { bubbleStyle: G } = Me(
|
|
82
|
+
p(() => t.message),
|
|
82
83
|
{ cssVariable: "--chotto-videomessage-right-bg", position: "right" }
|
|
83
|
-
),
|
|
84
|
-
g.value && (g.value.currentTime = 0, g.value
|
|
84
|
+
), J = () => {
|
|
85
|
+
g.value && (g.value.currentTime = 0, $(g.value));
|
|
85
86
|
};
|
|
86
|
-
|
|
87
|
-
u ? s && (s.pause(), s.currentTime = 0) : s && (s.
|
|
87
|
+
me([S, g], ([u, s]) => {
|
|
88
|
+
u ? s && (s.pause(), s.currentTime = 0) : s && (s.currentTime = 0, $(s));
|
|
88
89
|
});
|
|
89
|
-
const
|
|
90
|
+
const K = p(() => t.message.reply && t.message.text ? "0" : t.message.text ? "5px 5px 0 0" : t.message.reply ? "0 0 5px 5px" : "8px"), Q = () => x.value = !1, { onToggleReaction: X, onAddReaction: Y, onRemoveReaction: Z } = Ie(h), _ = async () => {
|
|
90
91
|
var u, s;
|
|
91
92
|
if (t.message.url)
|
|
92
93
|
try {
|
|
@@ -97,7 +98,7 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
97
98
|
});
|
|
98
99
|
if (!n.ok)
|
|
99
100
|
throw new Error(`HTTP error! status: ${n.status}`);
|
|
100
|
-
const
|
|
101
|
+
const te = n.headers.get("content-type") || "", ae = await n.blob(), k = ((s = (u = t.message.url.split(".").pop()) == null ? void 0 : u.split("?")[0]) == null ? void 0 : s.toLowerCase()) || "", ne = {
|
|
101
102
|
"video/mp4": "mp4",
|
|
102
103
|
"video/webm": "webm",
|
|
103
104
|
"video/ogg": "ogv",
|
|
@@ -105,24 +106,24 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
105
106
|
"video/x-matroska": "mkv",
|
|
106
107
|
"application/octet-stream": k || "mp4"
|
|
107
108
|
};
|
|
108
|
-
let L = k && ["mp4", "mov", "webm", "ogv", "mkv"].includes(k) ? k :
|
|
109
|
-
const
|
|
110
|
-
f.href = B, f.download =
|
|
109
|
+
let L = k && ["mp4", "mov", "webm", "ogv", "mkv"].includes(k) ? k : ne[te] || "mp4";
|
|
110
|
+
const oe = t.message.alt ? t.message.alt.includes(".") ? t.message.alt : `${t.message.alt}.${L}` : `video-${t.message.messageId}.${L}`, B = window.URL.createObjectURL(ae), f = document.createElement("a");
|
|
111
|
+
f.href = B, f.download = oe, document.body.appendChild(f), f.click(), document.body.removeChild(f), window.URL.revokeObjectURL(B);
|
|
111
112
|
} catch (n) {
|
|
112
113
|
console.error("Ошибка при скачивании видео:", n), window.open(t.message.url, "_blank");
|
|
113
114
|
}
|
|
114
|
-
},
|
|
115
|
-
function
|
|
115
|
+
}, ee = Te(() => t.message, () => t.subtextTooltipData);
|
|
116
|
+
function se() {
|
|
116
117
|
h("sms-invite", t.message);
|
|
117
118
|
}
|
|
118
|
-
return (u, s) => (o(), r(
|
|
119
|
+
return (u, s) => (o(), r(re, null, [
|
|
119
120
|
l("div", {
|
|
120
121
|
class: y(["video-message", [
|
|
121
122
|
C(e.message),
|
|
122
123
|
e.applyStyle(e.message)
|
|
123
124
|
]]),
|
|
124
125
|
messageId: e.message.messageId,
|
|
125
|
-
style: F(a(
|
|
126
|
+
style: F(a(G)),
|
|
126
127
|
onMouseleave: s[5] || (s[5] = //@ts-ignore
|
|
127
128
|
(...n) => a(A) && a(A)(...n))
|
|
128
129
|
}, [
|
|
@@ -132,15 +133,15 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
132
133
|
src: e.message.avatar,
|
|
133
134
|
height: "32",
|
|
134
135
|
width: "32"
|
|
135
|
-
}, null, 8,
|
|
136
|
-
e.message.subText && e.isFirstInSeries ? (o(), r("p",
|
|
136
|
+
}, null, 8, Le)) : i("", !0),
|
|
137
|
+
e.message.subText && e.isFirstInSeries ? (o(), r("p", Be, [
|
|
137
138
|
m(pe, {
|
|
138
|
-
text: a(
|
|
139
|
+
text: a(ee),
|
|
139
140
|
position: e.message.position === "left" ? "right" : "left",
|
|
140
141
|
offset: 8
|
|
141
142
|
}, {
|
|
142
143
|
default: d(() => [
|
|
143
|
-
|
|
144
|
+
ue(T(e.message.subText), 1)
|
|
144
145
|
]),
|
|
145
146
|
_: 1
|
|
146
147
|
}, 8, ["text", "position"])
|
|
@@ -148,7 +149,7 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
148
149
|
l("div", {
|
|
149
150
|
class: y(["video-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar }])
|
|
150
151
|
}, [
|
|
151
|
-
e.message.reply ? (o(), c(
|
|
152
|
+
e.message.reply ? (o(), c(fe, {
|
|
152
153
|
key: 0,
|
|
153
154
|
style: { margin: "10px 10px 4px 16px" },
|
|
154
155
|
class: y(e.message.position),
|
|
@@ -165,19 +166,19 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
165
166
|
ref_key: "previewPlayer",
|
|
166
167
|
ref: g,
|
|
167
168
|
class: "video-message__video",
|
|
168
|
-
style: F({ borderRadius:
|
|
169
|
+
style: F({ borderRadius: K.value }),
|
|
169
170
|
src: e.message.url,
|
|
170
171
|
muted: !0,
|
|
171
172
|
autoplay: "",
|
|
172
|
-
onEnded:
|
|
173
|
-
}, null, 44,
|
|
173
|
+
onEnded: J
|
|
174
|
+
}, null, 44, Fe),
|
|
174
175
|
m(b, { name: "modal-fade" }, {
|
|
175
176
|
default: d(() => [
|
|
176
|
-
v.value ? (o(), r("div",
|
|
177
|
+
v.value ? (o(), r("div", Pe, [
|
|
177
178
|
e.message.views ? (o(), r("div", {
|
|
178
179
|
key: 0,
|
|
179
180
|
class: "video-message__views",
|
|
180
|
-
onClick: s[0] || (s[0] =
|
|
181
|
+
onClick: s[0] || (s[0] = P(
|
|
181
182
|
//@ts-ignore
|
|
182
183
|
(...n) => a(E) && a(E)(...n),
|
|
183
184
|
["stop"]
|
|
@@ -187,12 +188,12 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
187
188
|
l("p", null, T(e.message.views), 1)
|
|
188
189
|
])) : i("", !0),
|
|
189
190
|
l("span", $e, T(e.message.time), 1),
|
|
190
|
-
m(
|
|
191
|
+
m(ke, {
|
|
191
192
|
"base-class": "video-message",
|
|
192
193
|
"message-class": C(e.message),
|
|
193
194
|
"message-status": e.message.status,
|
|
194
|
-
"status-class":
|
|
195
|
-
"status-title":
|
|
195
|
+
"status-class": z.value,
|
|
196
|
+
"status-title": W.value
|
|
196
197
|
}, null, 8, ["message-class", "message-status", "status-class", "status-title"])
|
|
197
198
|
])) : i("", !0)
|
|
198
199
|
]),
|
|
@@ -204,7 +205,7 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
204
205
|
key: 0,
|
|
205
206
|
class: "video-message__download-button",
|
|
206
207
|
type: "button",
|
|
207
|
-
onClick:
|
|
208
|
+
onClick: P(_, ["stop"])
|
|
208
209
|
}, [...s[7] || (s[7] = [
|
|
209
210
|
l("span", { class: "pi pi-download" }, null, -1)
|
|
210
211
|
])])) : i("", !0)
|
|
@@ -214,7 +215,7 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
214
215
|
], 32),
|
|
215
216
|
m(b, { name: "modal-fade" }, {
|
|
216
217
|
default: d(() => [
|
|
217
|
-
a(
|
|
218
|
+
a(N) && e.message.actions ? (o(), r("button", {
|
|
218
219
|
key: 0,
|
|
219
220
|
class: "video-message__menu-button",
|
|
220
221
|
onClick: s[3] || (s[3] = (n) => M.value = !a(M))
|
|
@@ -226,7 +227,7 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
226
227
|
}),
|
|
227
228
|
m(b, { name: "context-menu" }, {
|
|
228
229
|
default: d(() => [
|
|
229
|
-
a(M) && e.message.actions ? (o(), c(
|
|
230
|
+
a(M) && e.message.actions ? (o(), c(ce, {
|
|
230
231
|
key: 0,
|
|
231
232
|
class: "video-message__context-menu",
|
|
232
233
|
actions: e.message.actions,
|
|
@@ -235,47 +236,47 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
235
236
|
]),
|
|
236
237
|
_: 1
|
|
237
238
|
}),
|
|
238
|
-
e.message.text ? (o(), r("div",
|
|
239
|
+
e.message.text ? (o(), r("div", Oe, [
|
|
239
240
|
l("p", {
|
|
240
241
|
onClick: s[4] || (s[4] = //@ts-ignore
|
|
241
242
|
(...n) => a(I) && a(I)(...n)),
|
|
242
|
-
innerHTML: a(
|
|
243
|
-
}, null, 8,
|
|
243
|
+
innerHTML: a(H)
|
|
244
|
+
}, null, 8, je)
|
|
244
245
|
])) : i("", !0),
|
|
245
|
-
m(
|
|
246
|
+
m(we, {
|
|
246
247
|
status: e.message.status,
|
|
247
248
|
"has-messenger-account": e.message.hasMessengerAccount,
|
|
248
249
|
channel: e.channel,
|
|
249
|
-
onSmsInvite:
|
|
250
|
+
onSmsInvite: se
|
|
250
251
|
}, null, 8, ["status", "has-messenger-account", "channel"]),
|
|
251
|
-
e.message.linkPreview ? (o(), c(
|
|
252
|
+
e.message.linkPreview ? (o(), c(ge, {
|
|
252
253
|
key: 2,
|
|
253
254
|
class: y(["video-message__link-preview", e.message.position]),
|
|
254
255
|
"link-preview": e.message.linkPreview
|
|
255
256
|
}, null, 8, ["class", "link-preview"])) : i("", !0),
|
|
256
|
-
e.message.embed ? (o(), c(
|
|
257
|
+
e.message.embed ? (o(), c(ve, {
|
|
257
258
|
key: 3,
|
|
258
259
|
class: y(e.message.position),
|
|
259
260
|
embed: e.message.embed
|
|
260
261
|
}, null, 8, ["class", "embed"])) : i("", !0),
|
|
261
|
-
m(
|
|
262
|
+
m(be, {
|
|
262
263
|
reactions: e.message.reactions,
|
|
263
264
|
"message-id": e.message.messageId,
|
|
264
265
|
enabled: e.reactionsEnabled,
|
|
265
|
-
onToggleReaction: a(
|
|
266
|
-
onAddReaction: a(
|
|
267
|
-
onRemoveReaction: a(
|
|
266
|
+
onToggleReaction: a(X),
|
|
267
|
+
onAddReaction: a(Y),
|
|
268
|
+
onRemoveReaction: a(Z)
|
|
268
269
|
}, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"])
|
|
269
270
|
], 2)
|
|
270
|
-
], 46,
|
|
271
|
-
(o(), c(
|
|
271
|
+
], 46, Ee),
|
|
272
|
+
(o(), c(de, { to: "body" }, [
|
|
272
273
|
m(b, { name: "modal-fade" }, {
|
|
273
274
|
default: d(() => [
|
|
274
|
-
x.value ? (o(), c(
|
|
275
|
+
x.value ? (o(), c(ye, {
|
|
275
276
|
key: 0,
|
|
276
277
|
"data-theme": a(R)().theme ? a(R)().theme : "light",
|
|
277
278
|
title: e.message.alt,
|
|
278
|
-
onClose:
|
|
279
|
+
onClose: Q
|
|
279
280
|
}, {
|
|
280
281
|
default: d(() => [
|
|
281
282
|
l("video", {
|
|
@@ -286,7 +287,7 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
286
287
|
alt: e.message.alt,
|
|
287
288
|
controls: "",
|
|
288
289
|
autoplay: ""
|
|
289
|
-
}, null, 8,
|
|
290
|
+
}, null, 8, He)
|
|
290
291
|
]),
|
|
291
292
|
_: 1
|
|
292
293
|
}, 8, ["data-theme", "title"])) : i("", !0)
|
|
@@ -298,5 +299,5 @@ const Ae = ["messageId"], Ee = ["src"], Le = {
|
|
|
298
299
|
}
|
|
299
300
|
});
|
|
300
301
|
export {
|
|
301
|
-
|
|
302
|
+
us as default
|
|
302
303
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ModalVideoRecorder.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-dd94f275"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as z, ref as l, computed as P, onMounted as $, createElementBlock as _, openBlock as f, Fragment as q, createElementVNode as o, withDirectives as D, vShow as E, createCommentVNode as b, normalizeClass as g, toDisplayString as A, nextTick as G, unref as y } from "vue";
|
|
2
|
+
import { safeMediaPlayVoid as L } from "../../../functions/safeMediaPlay.js";
|
|
3
|
+
import "../../../functions/parseMarkdown.js";
|
|
4
|
+
const H = { class: "video-recorder__header" }, J = { class: "video-recorder__controls" }, K = { class: "video-recorder__recording-container" }, Q = { class: "video-recorder__recording-time" }, ee = /* @__PURE__ */ z({
|
|
3
5
|
__name: "ModalVideoRecorder",
|
|
4
6
|
emits: ["change", "submit", "close"],
|
|
5
|
-
setup(
|
|
6
|
-
const
|
|
7
|
-
let a = d.value < 10 ? "0" + d.value : d.value, e = u.value < 10 ? "0" + u.value : u.value,
|
|
8
|
-
return
|
|
9
|
-
}),
|
|
10
|
-
c.value == "camera" ? (c.value = "screen", B()) : c.value == "screen" && (
|
|
7
|
+
setup(W, { emit: F }) {
|
|
8
|
+
const M = l(), r = l(0), n = l(0), u = l(0), d = l(0), I = P(() => {
|
|
9
|
+
let a = d.value < 10 ? "0" + d.value : d.value, e = u.value < 10 ? "0" + u.value : u.value, i = n.value < 10 ? "0" + n.value : n.value, N = r.value < 10 ? "00" + r.value : r.value < 100 ? "0" + r.value : r.value;
|
|
10
|
+
return t.value ? a + ":" + e + ":" + i + ":" + N : " ";
|
|
11
|
+
}), m = l(), k = l(), t = l(!1), v = l(), p = l(), R = l([]), s = l(), V = l(), c = l("camera"), O = () => {
|
|
12
|
+
c.value == "camera" ? (c.value = "screen", B()) : c.value == "screen" && (w(), c.value = "camera", h());
|
|
11
13
|
}, T = async () => {
|
|
12
|
-
!
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
!t.value && p.value instanceof MediaStream && (v.value = new MediaRecorder(p.value), v.value.start(), v.value.ondataavailable = (a) => {
|
|
15
|
+
R.value.push(a.data);
|
|
16
|
+
}, t.value = !0, M.value = setInterval(() => {
|
|
17
|
+
r.value += 10, r.value == 1e3 && (r.value = 0, n.value++, n.value == 60 && (n.value = 0, u.value++, u.value == 60 && (u.value = 0, d.value++)));
|
|
16
18
|
}, 10));
|
|
17
19
|
}, U = async () => {
|
|
18
|
-
|
|
20
|
+
S(), w(), s.value && (s.value = void 0, await h());
|
|
19
21
|
}, j = () => {
|
|
20
22
|
v.value && (v.value.stop(), v.value.onstop = async () => {
|
|
21
|
-
V.value = new File(
|
|
23
|
+
V.value = new File(R.value, "videomessage.mp4", { type: "video/*" });
|
|
22
24
|
const a = URL.createObjectURL(V.value);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
s.value = a, G(() => {
|
|
26
|
+
k.value && (k.value.src = a);
|
|
25
27
|
});
|
|
26
|
-
}),
|
|
28
|
+
}), S(), w();
|
|
27
29
|
};
|
|
28
|
-
function
|
|
30
|
+
function w() {
|
|
29
31
|
var e;
|
|
30
|
-
let a = (e =
|
|
31
|
-
a == null || a.forEach((
|
|
32
|
+
let a = (e = p.value) == null ? void 0 : e.getTracks();
|
|
33
|
+
a == null || a.forEach((i) => i.stop());
|
|
32
34
|
}
|
|
33
|
-
const
|
|
34
|
-
clearInterval(
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
},
|
|
35
|
+
const S = () => {
|
|
36
|
+
clearInterval(M.value), r.value = 0, n.value = 0, u.value = 0, d.value = 0, t.value = !1, v.value = void 0, R.value = [];
|
|
37
|
+
}, C = F, x = () => {
|
|
38
|
+
C("change", { videoFile: V.value }), C("submit");
|
|
39
|
+
}, h = async () => {
|
|
38
40
|
await navigator.mediaDevices.getUserMedia({ audio: !0, video: !0 }).then((a) => {
|
|
39
|
-
const e =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
(t = k(p.value)) == null || t.play();
|
|
41
|
+
const e = y(m.value);
|
|
42
|
+
p.value = a, e.srcObject = a, e.addEventListener("loadedmetadata", () => {
|
|
43
|
+
L(y(m.value));
|
|
43
44
|
}), e.muted = !0;
|
|
44
45
|
});
|
|
45
46
|
}, B = async () => {
|
|
@@ -50,84 +51,83 @@ const H = { class: "video-recorder__header" }, J = { class: "video-recorder__con
|
|
|
50
51
|
audio: !1
|
|
51
52
|
};
|
|
52
53
|
await navigator.mediaDevices.getDisplayMedia(a).then((e) => {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}), t.muted = !0;
|
|
54
|
+
const i = y(m.value);
|
|
55
|
+
p.value = e, i.srcObject = e, i.addEventListener("loadedmetadata", () => {
|
|
56
|
+
L(y(m.value));
|
|
57
|
+
}), i.muted = !0;
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
return $(async () => {
|
|
61
|
-
await
|
|
62
|
-
}), (a, e) => (f(),
|
|
61
|
+
await h();
|
|
62
|
+
}), (a, e) => (f(), _(q, null, [
|
|
63
63
|
o("div", H, [
|
|
64
64
|
o("button", {
|
|
65
65
|
class: "video-recorder__button video-recorder__button-close",
|
|
66
|
-
onClick: e[0] || (e[0] = (
|
|
66
|
+
onClick: e[0] || (e[0] = (i) => C("close"))
|
|
67
67
|
}, [...e[1] || (e[1] = [
|
|
68
68
|
o("span", { class: "pi pi-times" }, null, -1)
|
|
69
69
|
])])
|
|
70
70
|
]),
|
|
71
71
|
o("div", null, [
|
|
72
|
-
|
|
72
|
+
D(o("video", {
|
|
73
73
|
ref_key: "refVideo",
|
|
74
|
-
ref:
|
|
74
|
+
ref: m,
|
|
75
75
|
class: "video-recorder__view-area"
|
|
76
76
|
}, null, 512), [
|
|
77
|
-
[
|
|
77
|
+
[E, !s.value]
|
|
78
78
|
]),
|
|
79
|
-
|
|
79
|
+
D(o("video", {
|
|
80
80
|
ref_key: "refRecord",
|
|
81
|
-
ref:
|
|
81
|
+
ref: k,
|
|
82
82
|
class: "video-recorder__view-area",
|
|
83
83
|
controls: ""
|
|
84
84
|
}, null, 512), [
|
|
85
|
-
[
|
|
85
|
+
[E, s.value]
|
|
86
86
|
]),
|
|
87
87
|
o("div", J, [
|
|
88
88
|
o("div", K, [
|
|
89
|
-
!
|
|
89
|
+
!t.value && !s.value ? (f(), _("button", {
|
|
90
90
|
key: 0,
|
|
91
91
|
class: "video-recorder__button",
|
|
92
92
|
onClick: O
|
|
93
93
|
}, [
|
|
94
94
|
o("span", {
|
|
95
|
-
class:
|
|
95
|
+
class: g({
|
|
96
96
|
"pi pi-desktop": c.value == "camera",
|
|
97
97
|
"pi pi-camera": c.value == "screen"
|
|
98
98
|
})
|
|
99
99
|
}, null, 2)
|
|
100
|
-
])) :
|
|
101
|
-
|
|
100
|
+
])) : b("", !0),
|
|
101
|
+
s.value ? b("", !0) : (f(), _("button", {
|
|
102
102
|
key: 1,
|
|
103
|
-
class:
|
|
103
|
+
class: g(["video-recorder__button", { "video-recorder__recording-button": t.value }]),
|
|
104
104
|
onClick: T
|
|
105
105
|
}, [
|
|
106
106
|
o("span", {
|
|
107
|
-
class:
|
|
108
|
-
"pi-circle-fill video-recorder__recording-icon":
|
|
109
|
-
"pi-video": !
|
|
107
|
+
class: g(["pi", {
|
|
108
|
+
"pi-circle-fill video-recorder__recording-icon": t.value,
|
|
109
|
+
"pi-video": !t.value
|
|
110
110
|
}])
|
|
111
111
|
}, null, 2)
|
|
112
112
|
], 2)),
|
|
113
|
-
!
|
|
113
|
+
!t.value && s.value ? (f(), _("button", {
|
|
114
114
|
key: 2,
|
|
115
115
|
class: "video-recorder__button",
|
|
116
116
|
onClick: U
|
|
117
117
|
}, [...e[2] || (e[2] = [
|
|
118
118
|
o("span", { class: "pi pi-trash" }, null, -1)
|
|
119
|
-
])])) :
|
|
120
|
-
|
|
119
|
+
])])) : b("", !0),
|
|
120
|
+
t.value ? (f(), _("button", {
|
|
121
121
|
key: 3,
|
|
122
122
|
class: "video-recorder__button",
|
|
123
123
|
onClick: j
|
|
124
124
|
}, [...e[3] || (e[3] = [
|
|
125
125
|
o("div", { class: "video-recorder__stop" }, null, -1)
|
|
126
|
-
])])) :
|
|
127
|
-
o("span",
|
|
126
|
+
])])) : b("", !0),
|
|
127
|
+
o("span", Q, A(I.value), 1)
|
|
128
128
|
]),
|
|
129
129
|
o("button", {
|
|
130
|
-
class:
|
|
130
|
+
class: g(["video-recorder__button", { "video-recorder__button-disabled": !s.value }]),
|
|
131
131
|
onClick: x
|
|
132
132
|
}, [...e[4] || (e[4] = [
|
|
133
133
|
o("span", { class: "video-recorder__save-button" }, " Прикрепить видео ", -1)
|
|
@@ -138,5 +138,5 @@ const H = { class: "video-recorder__header" }, J = { class: "video-recorder__con
|
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
export {
|
|
141
|
-
|
|
141
|
+
ee as default
|
|
142
142
|
};
|