@mobilon-dev/chotto 0.3.81 → 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/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_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 +23 -20
- package/dist/types/functions/index.d.ts +1 -0
- package/dist/types/functions/safeMediaPlay.d.ts +3 -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 i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-94cf2f67"]]);
|
|
5
5
|
export {
|
|
6
6
|
i as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as V, inject as $, 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";
|
|
@@ -8,19 +8,20 @@ import { useTheme as B } from "../../../hooks/useTheme.js";
|
|
|
8
8
|
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 { safeMediaPlay as D } from "../../../functions/safeMediaPlay.js";
|
|
12
|
+
const j = { class: "preview__container" }, F = { class: "preview__block" }, O = ["src"], q = ["src"], G = {
|
|
12
13
|
key: 2,
|
|
13
14
|
style: { display: "flex", gap: "5px" }
|
|
14
|
-
},
|
|
15
|
+
}, H = ["src"], J = { class: "pi pi-play" }, K = { class: "pi pi-pause" }, Q = { key: 3 }, R = { class: "preview__control-block" }, W = { class: "preview__information" }, X = { class: "preview__name" }, Y = {
|
|
15
16
|
key: 0,
|
|
16
17
|
class: "preview__size"
|
|
17
|
-
},
|
|
18
|
+
}, Z = {
|
|
18
19
|
key: 1,
|
|
19
20
|
class: "preview__audio-time"
|
|
20
|
-
},
|
|
21
|
+
}, ee = {
|
|
21
22
|
key: 2,
|
|
22
23
|
class: "preview__audio-time"
|
|
23
|
-
},
|
|
24
|
+
}, ie = { class: "preview__reset" }, te = ["src"], le = ["src"], pe = /* @__PURE__ */ V({
|
|
24
25
|
__name: "FilePreview",
|
|
25
26
|
props: {
|
|
26
27
|
fileInfo: {
|
|
@@ -30,56 +31,56 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
30
31
|
},
|
|
31
32
|
emits: ["reset"],
|
|
32
33
|
setup(t, { emit: C }) {
|
|
33
|
-
const b =
|
|
34
|
-
function
|
|
35
|
-
e.value && (u.value ? e.value.pause() : e.value
|
|
34
|
+
const b = $("chatAppId"), { getTheme: p } = B(b), E = C, e = s(), a = s(), u = s(!1), d = s(0), _ = s(0), v = s(!1), M = () => v.value = !1;
|
|
35
|
+
function P() {
|
|
36
|
+
e.value && (u.value ? e.value.pause() : D(e.value), u.value = !u.value);
|
|
36
37
|
}
|
|
37
38
|
const w = (m) => {
|
|
38
39
|
const l = Math.floor(m / 60), f = Math.floor(m % 60);
|
|
39
40
|
return `${l.toString().padStart(2, "0")}:${f.toString().padStart(2, "0")}`;
|
|
40
|
-
},
|
|
41
|
+
}, S = I(() => e.value ? w(_.value) : "0:00"), y = I(() => e.value || a.value ? w(d.value) : "0:00");
|
|
41
42
|
return x(() => {
|
|
42
43
|
e.value != null && (e.value.addEventListener("loadedmetadata", () => {
|
|
43
44
|
e.value != null && (e.value.duration == 1 / 0 || Number.isNaN(e.value.duration)) && (e.value.currentTime = 1e101, e.value.addEventListener("timeupdate", () => {
|
|
44
|
-
e.value && (e.value.currentTime = 0,
|
|
45
|
-
}, { once: !0 })),
|
|
45
|
+
e.value && (e.value.currentTime = 0, d.value = e.value.duration);
|
|
46
|
+
}, { once: !0 })), d.value = e.value != null ? e.value.duration : 0;
|
|
46
47
|
}), e.value.addEventListener("timeupdate", () => {
|
|
47
48
|
_.value = e.value != null ? e.value.currentTime : 0;
|
|
48
49
|
})), a.value && a.value.addEventListener("loadedmetadata", () => {
|
|
49
|
-
a.value && (
|
|
50
|
-
a.value && (a.value.currentTime = 0,
|
|
50
|
+
a.value && (d.value = a.value.duration, (a.value.duration == 1 / 0 || Number.isNaN(a.value.duration)) && (a.value.currentTime = 1e101, a.value.addEventListener("timeupdate", () => {
|
|
51
|
+
a.value && (a.value.currentTime = 0, d.value = a.value.duration);
|
|
51
52
|
}, { once: !0 })));
|
|
52
53
|
});
|
|
53
|
-
}), (m, l) => (o(), n("div",
|
|
54
|
-
i("div",
|
|
54
|
+
}), (m, l) => (o(), n("div", j, [
|
|
55
|
+
i("div", F, [
|
|
55
56
|
t.fileInfo.isImage ? (o(), n("div", {
|
|
56
57
|
key: 0,
|
|
57
58
|
style: { position: "relative" },
|
|
58
|
-
onClick: l[0] || (l[0] = (f) =>
|
|
59
|
+
onClick: l[0] || (l[0] = (f) => v.value = !0)
|
|
59
60
|
}, [
|
|
60
61
|
i("img", {
|
|
61
62
|
src: t.fileInfo.previewUrl,
|
|
62
63
|
alt: "Image Preview",
|
|
63
64
|
class: "preview__image"
|
|
64
|
-
}, null, 8,
|
|
65
|
+
}, null, 8, O),
|
|
65
66
|
l[3] || (l[3] = i("div", { class: "preview__shadow" }, [
|
|
66
67
|
i("span", { class: "pi pi-plus-circle" })
|
|
67
68
|
], -1))
|
|
68
69
|
])) : t.fileInfo.isVideo ? (o(), n("div", {
|
|
69
70
|
key: 1,
|
|
70
71
|
style: { position: "relative" },
|
|
71
|
-
onClick: l[1] || (l[1] = (f) =>
|
|
72
|
+
onClick: l[1] || (l[1] = (f) => v.value = !0)
|
|
72
73
|
}, [
|
|
73
74
|
i("video", {
|
|
74
75
|
ref_key: "video",
|
|
75
76
|
ref: a,
|
|
76
77
|
src: t.fileInfo.previewUrl,
|
|
77
78
|
class: "preview__video"
|
|
78
|
-
}, null, 8,
|
|
79
|
+
}, null, 8, q),
|
|
79
80
|
l[4] || (l[4] = i("div", { class: "preview__shadow" }, [
|
|
80
81
|
i("span", { class: "pi pi-play" })
|
|
81
82
|
], -1))
|
|
82
|
-
])) : t.fileInfo.isAudio ? (o(), n("div",
|
|
83
|
+
])) : t.fileInfo.isAudio ? (o(), n("div", G, [
|
|
83
84
|
l[5] || (l[5] = i("span", {
|
|
84
85
|
class: "pi pi-headphones",
|
|
85
86
|
style: { "font-size": "1rem", margin: "auto" }
|
|
@@ -88,33 +89,33 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
88
89
|
ref_key: "audio",
|
|
89
90
|
ref: e,
|
|
90
91
|
src: t.fileInfo.previewUrl
|
|
91
|
-
}, null, 8,
|
|
92
|
+
}, null, 8, H),
|
|
92
93
|
i("button", {
|
|
93
94
|
class: "preview__audio-control",
|
|
94
|
-
onClick:
|
|
95
|
+
onClick: P
|
|
95
96
|
}, [
|
|
96
|
-
k(i("span",
|
|
97
|
+
k(i("span", J, null, 512), [
|
|
97
98
|
[g, !u.value]
|
|
98
99
|
]),
|
|
99
|
-
k(i("span",
|
|
100
|
+
k(i("span", K, null, 512), [
|
|
100
101
|
[g, u.value]
|
|
101
102
|
])
|
|
102
103
|
])
|
|
103
|
-
])) : (o(), n("div",
|
|
104
|
+
])) : (o(), n("div", Q, [...l[6] || (l[6] = [
|
|
104
105
|
i("span", {
|
|
105
106
|
class: "pi pi-file",
|
|
106
107
|
style: { "font-size": "2.5rem" }
|
|
107
108
|
}, null, -1)
|
|
108
109
|
])]))
|
|
109
110
|
]),
|
|
110
|
-
i("div",
|
|
111
|
-
i("div",
|
|
112
|
-
i("span",
|
|
113
|
-
!t.fileInfo.isAudio && !t.fileInfo.isVideo ? (o(), n("span",
|
|
114
|
-
t.fileInfo.isAudio ? (o(), n("span",
|
|
115
|
-
t.fileInfo.isVideo ? (o(), n("span",
|
|
111
|
+
i("div", R, [
|
|
112
|
+
i("div", W, [
|
|
113
|
+
i("span", X, c(t.fileInfo.fileName), 1),
|
|
114
|
+
!t.fileInfo.isAudio && !t.fileInfo.isVideo ? (o(), n("span", Y, c(t.fileInfo.fileSize), 1)) : r("", !0),
|
|
115
|
+
t.fileInfo.isAudio ? (o(), n("span", Z, c(`${S.value} / ${y.value}`), 1)) : r("", !0),
|
|
116
|
+
t.fileInfo.isVideo ? (o(), n("span", ee, c(y.value), 1)) : r("", !0)
|
|
116
117
|
]),
|
|
117
|
-
i("div",
|
|
118
|
+
i("div", ie, [
|
|
118
119
|
i("span", {
|
|
119
120
|
class: "pi pi-times",
|
|
120
121
|
onClick: l[2] || (l[2] = (f) => E("reset"))
|
|
@@ -124,11 +125,11 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
124
125
|
(o(), h(A, { to: "body" }, [
|
|
125
126
|
L(U, { name: "modal-fade" }, {
|
|
126
127
|
default: T(() => [
|
|
127
|
-
|
|
128
|
+
v.value ? (o(), h(z, {
|
|
128
129
|
key: 0,
|
|
129
130
|
theme: N(p)().theme ? N(p)().theme : "",
|
|
130
131
|
title: t.fileInfo.fileName,
|
|
131
|
-
onClose:
|
|
132
|
+
onClose: M
|
|
132
133
|
}, {
|
|
133
134
|
default: T(() => [
|
|
134
135
|
t.fileInfo.isVideo ? (o(), n("video", {
|
|
@@ -137,13 +138,13 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
137
138
|
src: t.fileInfo.previewUrl,
|
|
138
139
|
controls: "",
|
|
139
140
|
autoplay: ""
|
|
140
|
-
}, null, 8,
|
|
141
|
+
}, null, 8, te)) : r("", !0),
|
|
141
142
|
t.fileInfo.isImage ? (o(), n("img", {
|
|
142
143
|
key: 1,
|
|
143
144
|
class: "preview__modal-image",
|
|
144
145
|
src: t.fileInfo.previewUrl,
|
|
145
146
|
alt: "Image Preview"
|
|
146
|
-
}, null, 8,
|
|
147
|
+
}, null, 8, le)) : r("", !0)
|
|
147
148
|
]),
|
|
148
149
|
_: 1
|
|
149
150
|
}, 8, ["theme", "title"])) : r("", !0)
|
|
@@ -155,5 +156,5 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
|
|
|
155
156
|
}
|
|
156
157
|
});
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
pe as default
|
|
159
160
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./StickerPicker.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-bbb6923b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useMessageDraft as
|
|
1
|
+
import { defineComponent as Ee, ref as i, inject as Fe, computed as p, watchEffect as Le, watch as z, onMounted as Ue, onUnmounted as $e, createElementBlock as a, openBlock as o, Fragment as X, createCommentVNode as C, createVNode as P, unref as E, normalizeClass as Z, createElementVNode as F, Transition as x, withCtx as ee, withDirectives as Oe, renderList as te, toDisplayString as se, vShow as Ae, normalizeStyle as Be } from "vue";
|
|
2
|
+
import { useMessageDraft as De } from "../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../hooks/useSearchModel.js";
|
|
4
4
|
import "../../../hooks/useTheme.js";
|
|
5
5
|
/* empty css */
|
|
@@ -7,22 +7,22 @@ import "../../../hooks/useTheme.js";
|
|
|
7
7
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
8
8
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
9
9
|
import "../../../functions/parseMarkdown.js";
|
|
10
|
-
import
|
|
10
|
+
import re from "./icons/StickerIcon.vue.js";
|
|
11
11
|
import { isAnimatedSticker as L } from "../../2_feed_elements/StickerMessage/utils/stickerUtils.js";
|
|
12
12
|
import "../../2_feed_elements/StickerMessage/utils/suppress-lit-warning.js";
|
|
13
|
-
const
|
|
13
|
+
const We = { class: "sticker-picker__container" }, Ne = ["onClick", "onMouseenter", "onMouseleave"], Ve = ["src"], Re = ["src", "alt"], He = {
|
|
14
14
|
key: 2,
|
|
15
15
|
class: "sticker-picker__tab-icon-placeholder"
|
|
16
|
-
},
|
|
16
|
+
}, Ie = { class: "sticker-picker__content" }, je = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "sticker-picker__empty"
|
|
19
|
-
},
|
|
19
|
+
}, ze = {
|
|
20
20
|
key: 1,
|
|
21
21
|
class: "sticker-picker__grid"
|
|
22
|
-
},
|
|
22
|
+
}, Xe = ["onClick", "onMouseenter"], Ye = ["src"], Ge = ["src", "alt"], Ke = ["src"], qe = ["src", "alt"], Je = {
|
|
23
23
|
key: 2,
|
|
24
24
|
class: "sticker-picker__preview-label"
|
|
25
|
-
},
|
|
25
|
+
}, Qe = 700, ut = /* @__PURE__ */ Ee({
|
|
26
26
|
__name: "StickerPicker",
|
|
27
27
|
props: {
|
|
28
28
|
state: { default: "active" },
|
|
@@ -31,7 +31,7 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
31
31
|
emptyText: { default: "Нет доступных стикеров" }
|
|
32
32
|
},
|
|
33
33
|
setup(U) {
|
|
34
|
-
const l = U, $ = i(null), O = i(null), A = i(null), B = i(null), u = i(!1),
|
|
34
|
+
const l = U, $ = i(null), O = i(null), A = i(null), B = i(null), u = i(!1), d = i(0), m = Fe("chatAppId"), { getMessage: le, setMessageFile: ae, setForceSendMessage: oe } = De(m), y = i("#5F5F5F"), b = i("#404040"), D = i(!1);
|
|
35
35
|
let h = null;
|
|
36
36
|
const W = () => {
|
|
37
37
|
if (!m) {
|
|
@@ -43,10 +43,10 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
43
43
|
y.value = "#5F5F5F", b.value = "#404040";
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
const t = window.getComputedStyle(e),
|
|
47
|
-
y.value =
|
|
48
|
-
},
|
|
49
|
-
|
|
46
|
+
const t = window.getComputedStyle(e), r = t.getPropertyValue("--chotto-stickerpicker-button-span-color").trim(), s = t.getPropertyValue("--chotto-stickerpicker-button-span-hover-color").trim();
|
|
47
|
+
y.value = r || "#5F5F5F", b.value = s || "#404040";
|
|
48
|
+
}, ie = p(() => D.value ? b.value : y.value);
|
|
49
|
+
Le(() => {
|
|
50
50
|
W();
|
|
51
51
|
});
|
|
52
52
|
const n = i(null), N = i({}), w = i(null), v = i(/* @__PURE__ */ new Map()), k = i(/* @__PURE__ */ new Map());
|
|
@@ -64,25 +64,25 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const ce = () => {
|
|
68
68
|
if (!l.stickers || !Array.isArray(l.stickers) || l.stickers.length === 0)
|
|
69
69
|
return { hasTabs: !1, tabs: [] };
|
|
70
|
-
const e = l.stickers[0], t = Array.isArray(e),
|
|
70
|
+
const e = l.stickers[0], t = Array.isArray(e), r = e && typeof e == "object" && "stickers" in e;
|
|
71
71
|
return t ? {
|
|
72
72
|
hasTabs: !0,
|
|
73
|
-
tabs: l.stickers.map((
|
|
73
|
+
tabs: l.stickers.map((s, c) => ({
|
|
74
74
|
id: `tab-${c}`,
|
|
75
75
|
label: `Set ${c + 1}`,
|
|
76
|
-
stickers:
|
|
77
|
-
iconUrl:
|
|
76
|
+
stickers: s,
|
|
77
|
+
iconUrl: s && s.length > 0 ? s[0].url : null
|
|
78
78
|
}))
|
|
79
|
-
} :
|
|
79
|
+
} : r && "stickers" in e ? {
|
|
80
80
|
hasTabs: !0,
|
|
81
|
-
tabs: l.stickers.map((
|
|
82
|
-
id:
|
|
83
|
-
label:
|
|
84
|
-
stickers:
|
|
85
|
-
iconUrl:
|
|
81
|
+
tabs: l.stickers.map((s, c) => ({
|
|
82
|
+
id: s.id || `tab-${c}`,
|
|
83
|
+
label: s.label || `Set ${c + 1}`,
|
|
84
|
+
stickers: s.stickers || [],
|
|
85
|
+
iconUrl: s.iconUrl || (s.stickers && s.stickers.length > 0 ? s.stickers[0].url : null)
|
|
86
86
|
}))
|
|
87
87
|
} : {
|
|
88
88
|
hasTabs: !0,
|
|
@@ -93,61 +93,62 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
93
93
|
iconUrl: l.stickers.length > 0 ? l.stickers[0].url : null
|
|
94
94
|
}]
|
|
95
95
|
};
|
|
96
|
-
}, R =
|
|
96
|
+
}, R = p(() => ce()), ne = p(() => R.value.hasTabs && R.value.tabs.length > 0), _ = p(() => R.value.tabs), H = p(() => {
|
|
97
97
|
var e;
|
|
98
|
-
return _.value.length === 0 ? [] : ((e = _.value[
|
|
99
|
-
}), G =
|
|
100
|
-
const e = H.value.some((
|
|
98
|
+
return _.value.length === 0 ? [] : ((e = _.value[d.value]) == null ? void 0 : e.stickers) || [];
|
|
99
|
+
}), G = p(() => {
|
|
100
|
+
const e = H.value.some((r) => L(r.url)), t = _.value.some((r) => r.iconUrl && L(r.iconUrl));
|
|
101
101
|
return e || t;
|
|
102
102
|
});
|
|
103
103
|
z(G, (e) => {
|
|
104
104
|
e && !f.value && Y();
|
|
105
105
|
}, { immediate: !0 });
|
|
106
|
-
const I = (e) => L(e.url),
|
|
106
|
+
const I = (e) => L(e.url), ue = (e, t) => {
|
|
107
107
|
t ? v.value.set(e, t) : v.value.delete(e);
|
|
108
|
-
},
|
|
108
|
+
}, ve = (e, t) => {
|
|
109
109
|
t ? k.value.set(e, t) : k.value.delete(e);
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
}, K = (e) => {
|
|
111
|
+
if (!(!e || typeof e.play != "function"))
|
|
112
|
+
try {
|
|
113
|
+
e.play();
|
|
114
|
+
} catch {
|
|
115
|
+
}
|
|
113
116
|
}, fe = (e) => {
|
|
117
|
+
K(k.value.get(e));
|
|
118
|
+
}, ke = (e) => {
|
|
114
119
|
const t = k.value.get(e);
|
|
115
120
|
t && typeof t.pause == "function" && t.pause();
|
|
116
121
|
};
|
|
117
|
-
z(
|
|
122
|
+
z(d, () => {
|
|
118
123
|
v.value.clear();
|
|
119
124
|
}), z(() => l.stickers, () => {
|
|
120
|
-
|
|
125
|
+
d.value >= _.value.length && (d.value = 0);
|
|
121
126
|
}, { deep: !0 });
|
|
122
|
-
const
|
|
127
|
+
const de = (e) => {
|
|
123
128
|
if (!e) return "image";
|
|
124
129
|
const t = e.toLowerCase();
|
|
125
130
|
return t.endsWith(".tgs") || t.endsWith(".webp") ? "sticker" : "image";
|
|
126
|
-
},
|
|
131
|
+
}, q = (e) => {
|
|
127
132
|
if (l.state === "disabled") return;
|
|
128
|
-
const t =
|
|
129
|
-
|
|
133
|
+
const t = de(e.url);
|
|
134
|
+
ae({
|
|
130
135
|
url: e.url,
|
|
131
136
|
name: e.alt || `sticker.${t === "sticker" ? e.url.toLowerCase().endsWith(".tgs") ? "tgs" : "webp" : "png"}`,
|
|
132
137
|
type: t
|
|
133
|
-
}),
|
|
138
|
+
}), oe(!0), l.mode === "click" && (u.value = !1);
|
|
134
139
|
}, pe = (e, t) => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
S(), w.value = setTimeout(() => {
|
|
140
|
-
he(e);
|
|
141
|
-
}, Je);
|
|
142
|
-
}, de = () => {
|
|
140
|
+
I(e) && f.value && K(v.value.get(t)), S(), w.value = setTimeout(() => {
|
|
141
|
+
_e(e);
|
|
142
|
+
}, Qe);
|
|
143
|
+
}, me = () => {
|
|
143
144
|
v.value.forEach((e) => {
|
|
144
145
|
e && typeof e.pause == "function" && e.pause();
|
|
145
146
|
}), S(), g();
|
|
146
|
-
},
|
|
147
|
-
S(), g(),
|
|
147
|
+
}, he = (e) => {
|
|
148
|
+
S(), g(), q(e);
|
|
148
149
|
}, S = () => {
|
|
149
150
|
w.value && (clearTimeout(w.value), w.value = null);
|
|
150
|
-
},
|
|
151
|
+
}, _e = (e) => {
|
|
151
152
|
n.value = e, N.value = {
|
|
152
153
|
left: "50%",
|
|
153
154
|
top: "50%",
|
|
@@ -155,9 +156,9 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
155
156
|
};
|
|
156
157
|
}, g = () => {
|
|
157
158
|
n.value = null, N.value = {};
|
|
158
|
-
},
|
|
159
|
-
n.value && (
|
|
160
|
-
},
|
|
159
|
+
}, ge = () => {
|
|
160
|
+
n.value && (q(n.value), g());
|
|
161
|
+
}, J = () => {
|
|
161
162
|
l.state === "active" && (u.value = !0);
|
|
162
163
|
}, j = () => {
|
|
163
164
|
v.value.forEach((e) => {
|
|
@@ -165,37 +166,37 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
165
166
|
}), k.value.forEach((e) => {
|
|
166
167
|
e && typeof e.pause == "function" && e.pause();
|
|
167
168
|
}), u.value = !1;
|
|
168
|
-
}, ge = () => {
|
|
169
|
-
l.mode === "click" && (u.value = !u.value, u.value && q());
|
|
170
169
|
}, ye = () => {
|
|
171
|
-
l.mode === "
|
|
170
|
+
l.mode === "click" && (u.value = !u.value, u.value && J());
|
|
172
171
|
}, be = () => {
|
|
172
|
+
l.mode === "hover" && (T = !0, J());
|
|
173
|
+
}, we = () => {
|
|
173
174
|
l.mode === "hover" && (T = !1, setTimeout(() => {
|
|
174
175
|
!M && !T && j();
|
|
175
176
|
}, 150));
|
|
176
|
-
}, we = () => {
|
|
177
|
-
D.value = !0, ye();
|
|
178
177
|
}, Te = () => {
|
|
179
|
-
D.value = !
|
|
178
|
+
D.value = !0, be();
|
|
180
179
|
}, Me = () => {
|
|
181
|
-
|
|
180
|
+
D.value = !1, we();
|
|
182
181
|
}, Se = () => {
|
|
182
|
+
l.mode === "hover" && (M = !0);
|
|
183
|
+
}, Ce = () => {
|
|
183
184
|
l.mode === "hover" && (M = !1, setTimeout(() => {
|
|
184
185
|
!T && !M && j();
|
|
185
186
|
}, 150));
|
|
186
|
-
},
|
|
187
|
+
}, Pe = (e) => {
|
|
187
188
|
if (!A.value) return;
|
|
188
189
|
const t = e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY;
|
|
189
190
|
A.value.scrollLeft += t;
|
|
190
|
-
},
|
|
191
|
+
}, Q = (e) => {
|
|
191
192
|
l.mode === "click" && u.value && O.value && $.value && e.target instanceof Node && !O.value.contains(e.target) && !$.value.contains(e.target) && j(), n.value && B.value && e.target instanceof Node && !B.value.contains(e.target) && g();
|
|
192
193
|
};
|
|
193
|
-
return
|
|
194
|
-
if (document.addEventListener("click",
|
|
194
|
+
return Ue(() => {
|
|
195
|
+
if (document.addEventListener("click", Q), W(), m) {
|
|
195
196
|
const e = document.getElementById(m);
|
|
196
197
|
e && (h = new MutationObserver((t) => {
|
|
197
|
-
t.forEach((
|
|
198
|
-
|
|
198
|
+
t.forEach((r) => {
|
|
199
|
+
r.type === "attributes" && r.attributeName === "data-theme" && W();
|
|
199
200
|
});
|
|
200
201
|
}), h.observe(e, {
|
|
201
202
|
attributes: !0,
|
|
@@ -203,110 +204,110 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
203
204
|
}));
|
|
204
205
|
}
|
|
205
206
|
G.value && !f.value && Y();
|
|
206
|
-
}),
|
|
207
|
-
document.removeEventListener("click",
|
|
207
|
+
}), $e(() => {
|
|
208
|
+
document.removeEventListener("click", Q), S(), g(), h && (h.disconnect(), h = null), v.value.forEach((e) => {
|
|
208
209
|
e && typeof e.pause == "function" && e.pause();
|
|
209
210
|
}), v.value.clear(), k.value.forEach((e) => {
|
|
210
211
|
e && typeof e.pause == "function" && e.pause();
|
|
211
212
|
}), k.value.clear();
|
|
212
213
|
}), (e, t) => (o(), a(X, null, [
|
|
213
|
-
E(
|
|
214
|
+
E(le)().isRecording ? C("", !0) : (o(), a("button", {
|
|
214
215
|
key: 0,
|
|
215
216
|
ref_key: "stickerButton",
|
|
216
217
|
ref: O,
|
|
217
|
-
class:
|
|
218
|
-
onClick:
|
|
219
|
-
onMouseenter:
|
|
220
|
-
onMouseleave:
|
|
218
|
+
class: Z(["button", { "button-disabled": U.state === "disabled" }]),
|
|
219
|
+
onClick: ye,
|
|
220
|
+
onMouseenter: Te,
|
|
221
|
+
onMouseleave: Me
|
|
221
222
|
}, [
|
|
222
223
|
F("span", null, [
|
|
223
|
-
P(E(
|
|
224
|
+
P(E(re), { fill: ie.value }, null, 8, ["fill"])
|
|
224
225
|
])
|
|
225
226
|
], 34)),
|
|
226
|
-
P(
|
|
227
|
-
default:
|
|
228
|
-
|
|
227
|
+
P(x, null, {
|
|
228
|
+
default: ee(() => [
|
|
229
|
+
Oe(F("div", {
|
|
229
230
|
ref_key: "stickerPicker",
|
|
230
231
|
ref: $,
|
|
231
232
|
class: "sticker-picker",
|
|
232
|
-
onMouseenter:
|
|
233
|
-
onMouseleave:
|
|
233
|
+
onMouseenter: Se,
|
|
234
|
+
onMouseleave: Ce
|
|
234
235
|
}, [
|
|
235
|
-
F("div",
|
|
236
|
-
|
|
236
|
+
F("div", We, [
|
|
237
|
+
ne.value ? (o(), a("div", {
|
|
237
238
|
key: 0,
|
|
238
239
|
ref_key: "tabsContainer",
|
|
239
240
|
ref: A,
|
|
240
241
|
class: "sticker-picker__tabs",
|
|
241
|
-
onWheelPassive:
|
|
242
|
+
onWheelPassive: Pe
|
|
242
243
|
}, [
|
|
243
|
-
(o(!0), a(X, null,
|
|
244
|
-
key:
|
|
245
|
-
class:
|
|
246
|
-
onClick: (c) =>
|
|
247
|
-
onMouseenter: (c) =>
|
|
248
|
-
onMouseleave: (c) =>
|
|
244
|
+
(o(!0), a(X, null, te(_.value, (r, s) => (o(), a("button", {
|
|
245
|
+
key: s,
|
|
246
|
+
class: Z(["sticker-picker__tab", { "sticker-picker__tab--active": d.value === s }]),
|
|
247
|
+
onClick: (c) => d.value = s,
|
|
248
|
+
onMouseenter: (c) => fe(s),
|
|
249
|
+
onMouseleave: (c) => ke(s)
|
|
249
250
|
}, [
|
|
250
|
-
|
|
251
|
+
r.iconUrl && E(L)(r.iconUrl) && f.value ? (o(), a("tgs-player", {
|
|
251
252
|
key: 0,
|
|
252
253
|
ref_for: !0,
|
|
253
|
-
ref: (c) =>
|
|
254
|
-
src:
|
|
254
|
+
ref: (c) => ve(s, c),
|
|
255
|
+
src: r.iconUrl,
|
|
255
256
|
class: "sticker-picker__tab-icon sticker-picker__tab-icon-animated",
|
|
256
257
|
loop: "",
|
|
257
258
|
mode: "normal"
|
|
258
|
-
}, null, 8,
|
|
259
|
+
}, null, 8, Ve)) : r.iconUrl ? (o(), a("img", {
|
|
259
260
|
key: 1,
|
|
260
|
-
src:
|
|
261
|
-
alt:
|
|
261
|
+
src: r.iconUrl,
|
|
262
|
+
alt: r.label || `Tab ${s + 1}`,
|
|
262
263
|
class: "sticker-picker__tab-icon"
|
|
263
|
-
}, null, 8,
|
|
264
|
-
P(E(
|
|
264
|
+
}, null, 8, Re)) : (o(), a("span", He, [
|
|
265
|
+
P(E(re))
|
|
265
266
|
]))
|
|
266
|
-
], 42,
|
|
267
|
+
], 42, Ne))), 128))
|
|
267
268
|
], 544)) : C("", !0),
|
|
268
|
-
F("div",
|
|
269
|
-
H.value.length === 0 ? (o(), a("div",
|
|
270
|
-
(o(!0), a(X, null,
|
|
271
|
-
key:
|
|
269
|
+
F("div", Ie, [
|
|
270
|
+
H.value.length === 0 ? (o(), a("div", je, se(U.emptyText), 1)) : (o(), a("div", ze, [
|
|
271
|
+
(o(!0), a(X, null, te(H.value, (r, s) => (o(), a("button", {
|
|
272
|
+
key: s,
|
|
272
273
|
class: "sticker-picker__item",
|
|
273
|
-
onClick: (c) =>
|
|
274
|
-
onMouseenter: (c) => pe(
|
|
275
|
-
onMouseleave:
|
|
274
|
+
onClick: (c) => he(r),
|
|
275
|
+
onMouseenter: (c) => pe(r, s),
|
|
276
|
+
onMouseleave: me
|
|
276
277
|
}, [
|
|
277
|
-
I(
|
|
278
|
+
I(r) && f.value ? (o(), a("tgs-player", {
|
|
278
279
|
key: 0,
|
|
279
280
|
ref_for: !0,
|
|
280
|
-
ref: (c) =>
|
|
281
|
-
src:
|
|
281
|
+
ref: (c) => ue(s, c),
|
|
282
|
+
src: r.url,
|
|
282
283
|
class: "sticker-picker__image sticker-picker__image-animated",
|
|
283
284
|
loop: "",
|
|
284
285
|
mode: "normal"
|
|
285
|
-
}, null, 8,
|
|
286
|
+
}, null, 8, Ye)) : (o(), a("img", {
|
|
286
287
|
key: 1,
|
|
287
|
-
src:
|
|
288
|
-
alt:
|
|
288
|
+
src: r.url,
|
|
289
|
+
alt: r.alt || `Sticker ${s + 1}`,
|
|
289
290
|
class: "sticker-picker__image"
|
|
290
|
-
}, null, 8,
|
|
291
|
-
], 40,
|
|
291
|
+
}, null, 8, Ge))
|
|
292
|
+
], 40, Xe))), 128))
|
|
292
293
|
]))
|
|
293
294
|
])
|
|
294
295
|
])
|
|
295
296
|
], 544), [
|
|
296
|
-
[
|
|
297
|
+
[Ae, u.value]
|
|
297
298
|
])
|
|
298
299
|
]),
|
|
299
300
|
_: 1
|
|
300
301
|
}),
|
|
301
|
-
P(
|
|
302
|
-
default:
|
|
302
|
+
P(x, { name: "preview" }, {
|
|
303
|
+
default: ee(() => [
|
|
303
304
|
n.value ? (o(), a("div", {
|
|
304
305
|
key: 0,
|
|
305
306
|
ref_key: "previewElement",
|
|
306
307
|
ref: B,
|
|
307
308
|
class: "sticker-picker__preview",
|
|
308
|
-
style:
|
|
309
|
-
onClick:
|
|
309
|
+
style: Be(N.value),
|
|
310
|
+
onClick: ge
|
|
310
311
|
}, [
|
|
311
312
|
I(n.value) && f.value ? (o(), a("tgs-player", {
|
|
312
313
|
key: 0,
|
|
@@ -315,13 +316,13 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
315
316
|
autoplay: "",
|
|
316
317
|
loop: "",
|
|
317
318
|
mode: "normal"
|
|
318
|
-
}, null, 8,
|
|
319
|
+
}, null, 8, Ke)) : (o(), a("img", {
|
|
319
320
|
key: 1,
|
|
320
321
|
src: n.value.url,
|
|
321
322
|
alt: n.value.alt || "Preview",
|
|
322
323
|
class: "sticker-picker__preview-image"
|
|
323
|
-
}, null, 8,
|
|
324
|
-
n.value.alt ? (o(), a("div",
|
|
324
|
+
}, null, 8, qe)),
|
|
325
|
+
n.value.alt ? (o(), a("div", Je, se(n.value.alt), 1)) : C("", !0)
|
|
325
326
|
], 4)) : C("", !0)
|
|
326
327
|
]),
|
|
327
328
|
_: 1
|
|
@@ -330,5 +331,5 @@ const De = { class: "sticker-picker__container" }, We = ["onClick", "onMouseente
|
|
|
330
331
|
}
|
|
331
332
|
});
|
|
332
333
|
export {
|
|
333
|
-
|
|
334
|
+
ut as default
|
|
334
335
|
};
|