@mobilon-dev/chotto 0.3.99 → 0.3.100
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/EmojiGlyph/EmojiGlyph.vue.js +15 -15
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +1 -1
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +79 -65
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +1 -1
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +150 -150
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +2 -2
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +79 -78
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +42 -42
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +68 -68
- package/dist/functions/renderAppleEmojis.js +120 -91
- package/dist/hooks/messages/useMessageLinks.js +15 -15
- package/dist/hooks/useEmojiNative.js +24 -12
- package/dist/node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js +581 -555
- 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_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +21 -2
- package/dist/types/functions/renderAppleEmojis.d.ts +13 -10
- package/dist/types/hooks/useEmojiNative.d.ts +5 -2
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as g, inject as d, computed as m, createElementBlock as c, unref as h, openBlock as p, toDisplayString as v } from "vue";
|
|
2
2
|
import "../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../hooks/useSearchModel.js";
|
|
4
4
|
import "../../../hooks/useTheme.js";
|
|
5
|
-
import { useEmojiNative as
|
|
5
|
+
import { useEmojiNative as E } from "../../../hooks/useEmojiNative.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "../../../locale/useLocale.js";
|
|
@@ -10,8 +10,8 @@ import "../../../locale/useLocale.js";
|
|
|
10
10
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
11
11
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
12
12
|
import "../../../functions/parseMarkdown.js";
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
13
|
+
import { hasAppleEmojiImage as k, getAppleEmojiUrl as _, getAppleEmojiFallbackUrl as y } from "../../../functions/renderAppleEmojis.js";
|
|
14
|
+
const A = ["src", "alt"], I = { key: 1 }, H = /* @__PURE__ */ g({
|
|
15
15
|
__name: "EmojiGlyph",
|
|
16
16
|
props: {
|
|
17
17
|
emoji: {
|
|
@@ -19,22 +19,22 @@ const _ = ["src", "alt"], y = { key: 1 }, G = /* @__PURE__ */ f({
|
|
|
19
19
|
required: !0
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
|
|
22
|
+
setup(o) {
|
|
23
|
+
const t = o, l = d("chatAppId", ""), { isNative: n, emojiSrc: e } = E(l), s = m(() => k(t.emoji, e.value)), u = m(() => _(t.emoji, e.value)), j = m(() => y(t.emoji, e.value));
|
|
24
|
+
function f(a) {
|
|
25
|
+
const r = a.target, i = j.value;
|
|
26
|
+
i && r.src !== i && (r.src = i);
|
|
27
27
|
}
|
|
28
|
-
return (
|
|
28
|
+
return (a, r) => !h(n) && s.value ? (p(), c("img", {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: "chotto-emoji",
|
|
31
|
-
src:
|
|
32
|
-
alt:
|
|
31
|
+
src: u.value,
|
|
32
|
+
alt: o.emoji,
|
|
33
33
|
draggable: "false",
|
|
34
|
-
onError:
|
|
35
|
-
}, null, 40,
|
|
34
|
+
onError: f
|
|
35
|
+
}, null, 40, A)) : (p(), c("span", I, v(o.emoji), 1));
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
H as default
|
|
40
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ButtonEmojiPicker.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-50c1b8d3"]]);
|
|
5
5
|
export {
|
|
6
6
|
i as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as W, ref as a, inject as z, watch as F, computed as U, watchEffect as $, onMounted as q, onUnmounted as G, createElementBlock as C, openBlock as S, Fragment as J, createCommentVNode as K, createVNode as g, unref as y, normalizeClass as Q, createElementVNode as B, Transition as X, withCtx as Y, withDirectives as Z, vShow as ee } from "vue";
|
|
2
|
+
import te from "../../../node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { useMessageDraft as
|
|
4
|
+
import { useMessageDraft as oe } from "../../../hooks/useMessageDraft.js";
|
|
5
5
|
import "../../../hooks/useSearchModel.js";
|
|
6
6
|
import "../../../hooks/useTheme.js";
|
|
7
|
-
import { useEmojiNative as
|
|
7
|
+
import { useEmojiNative as ne } from "../../../hooks/useEmojiNative.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
10
|
import "../../../locale/useLocale.js";
|
|
@@ -12,8 +12,8 @@ import "../../../locale/useLocale.js";
|
|
|
12
12
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
13
13
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
14
14
|
import "../../../functions/parseMarkdown.js";
|
|
15
|
-
import
|
|
16
|
-
const
|
|
15
|
+
import ie from "./icons/SmilesIcon.vue.js";
|
|
16
|
+
const je = /* @__PURE__ */ W({
|
|
17
17
|
__name: "ButtonEmojiPicker",
|
|
18
18
|
props: {
|
|
19
19
|
state: {
|
|
@@ -24,10 +24,10 @@ const ye = /* @__PURE__ */ D({
|
|
|
24
24
|
type: String,
|
|
25
25
|
default: "click",
|
|
26
26
|
// или 'hover'
|
|
27
|
-
validator: (
|
|
27
|
+
validator: (n) => ["click", "hover"].includes(n)
|
|
28
28
|
},
|
|
29
29
|
/**
|
|
30
|
-
* true — системные эмодзи; false —
|
|
30
|
+
* true — системные эмодзи; false — картинки в пикере, зеркале ввода и ленте.
|
|
31
31
|
* Значение пишется в общий store чата (useEmojiNative).
|
|
32
32
|
*/
|
|
33
33
|
native: {
|
|
@@ -40,111 +40,125 @@ const ye = /* @__PURE__ */ D({
|
|
|
40
40
|
displayRecent: {
|
|
41
41
|
type: Boolean,
|
|
42
42
|
default: !0
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Базовый URL PNG-картинок эмодзи (без слэша в конце).
|
|
46
|
+
* При native=false используется пикером, зеркалом ввода, лентой и реакциями.
|
|
47
|
+
* Пустая строка — Apple CDN по умолчанию.
|
|
48
|
+
*/
|
|
49
|
+
emojiSrc: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
43
52
|
}
|
|
44
53
|
},
|
|
45
|
-
setup(
|
|
46
|
-
const t =
|
|
47
|
-
|
|
54
|
+
setup(n) {
|
|
55
|
+
const t = n, v = a(null), f = a(null), i = a(!1), j = a("light"), r = z("chatAppId"), { setMessageText: P, getMessage: b } = oe(r), { setNative: w, setEmojiSrc: I } = ne(r);
|
|
56
|
+
F(
|
|
48
57
|
() => t.native,
|
|
49
58
|
(e) => w(e),
|
|
50
59
|
{ immediate: !0 }
|
|
60
|
+
), F(
|
|
61
|
+
() => t.emojiSrc,
|
|
62
|
+
(e) => I(e),
|
|
63
|
+
{ immediate: !0 }
|
|
51
64
|
);
|
|
52
|
-
const c =
|
|
53
|
-
let
|
|
65
|
+
const c = a("#5F5F5F"), s = a("#404040"), p = a(!1);
|
|
66
|
+
let l = null;
|
|
54
67
|
const h = () => {
|
|
55
|
-
if (!
|
|
68
|
+
if (!r) {
|
|
56
69
|
c.value = "#5F5F5F", s.value = "#404040";
|
|
57
70
|
return;
|
|
58
71
|
}
|
|
59
|
-
const e = document.getElementById(
|
|
72
|
+
const e = document.getElementById(r);
|
|
60
73
|
if (!e) {
|
|
61
74
|
c.value = "#5F5F5F", s.value = "#404040";
|
|
62
75
|
return;
|
|
63
76
|
}
|
|
64
|
-
const o = window.getComputedStyle(e), d = o.getPropertyValue("--chotto-buttonemojipicker-button-span-color").trim(),
|
|
65
|
-
c.value = d || "#5F5F5F", s.value =
|
|
66
|
-
},
|
|
67
|
-
|
|
77
|
+
const o = window.getComputedStyle(e), d = o.getPropertyValue("--chotto-buttonemojipicker-button-span-color").trim(), _ = o.getPropertyValue("--chotto-buttonemojipicker-button-span-hover-color").trim();
|
|
78
|
+
c.value = d || "#5F5F5F", s.value = _ || "#404040";
|
|
79
|
+
}, N = U(() => p.value ? s.value : c.value);
|
|
80
|
+
$(() => {
|
|
68
81
|
h();
|
|
69
82
|
});
|
|
70
83
|
let u = !1, m = !1;
|
|
71
|
-
const
|
|
84
|
+
const T = () => {
|
|
72
85
|
var o;
|
|
73
|
-
const e = document.getElementById(
|
|
86
|
+
const e = document.getElementById(r);
|
|
74
87
|
return (o = e == null ? void 0 : e.getAttribute("data-theme")) != null && o.includes("dark") ? "dark" : "light";
|
|
75
|
-
},
|
|
76
|
-
P(
|
|
77
|
-
},
|
|
78
|
-
t.state === "active" && (
|
|
88
|
+
}, V = (e) => {
|
|
89
|
+
P(b().text + e.i);
|
|
90
|
+
}, E = () => {
|
|
91
|
+
t.state === "active" && (j.value = T(), i.value = !0);
|
|
79
92
|
}, k = () => {
|
|
80
|
-
|
|
81
|
-
}, T = () => {
|
|
82
|
-
t.mode === "click" && (n.value = !n.value, n.value && M());
|
|
83
|
-
}, V = () => {
|
|
84
|
-
t.mode === "hover" && (u = !0, M());
|
|
93
|
+
i.value = !1;
|
|
85
94
|
}, x = () => {
|
|
95
|
+
t.mode === "click" && (i.value = !i.value, i.value && E());
|
|
96
|
+
}, L = () => {
|
|
97
|
+
t.mode === "hover" && (u = !0, E());
|
|
98
|
+
}, O = () => {
|
|
86
99
|
t.mode === "hover" && (u = !1, setTimeout(() => {
|
|
87
100
|
!m && !u && k();
|
|
88
101
|
}, 150));
|
|
89
|
-
}, L = () => {
|
|
90
|
-
p.value = !0, V();
|
|
91
|
-
}, O = () => {
|
|
92
|
-
p.value = !1, x();
|
|
93
|
-
}, _ = () => {
|
|
94
|
-
t.mode === "hover" && (m = !0);
|
|
95
102
|
}, H = () => {
|
|
103
|
+
p.value = !0, L();
|
|
104
|
+
}, A = () => {
|
|
105
|
+
p.value = !1, O();
|
|
106
|
+
}, D = () => {
|
|
107
|
+
t.mode === "hover" && (m = !0);
|
|
108
|
+
}, R = () => {
|
|
96
109
|
t.mode === "hover" && (m = !1, setTimeout(() => {
|
|
97
110
|
!u && !m && k();
|
|
98
111
|
}, 150));
|
|
99
|
-
},
|
|
100
|
-
t.mode === "click" &&
|
|
112
|
+
}, M = (e) => {
|
|
113
|
+
t.mode === "click" && i.value && f.value && v.value && e.target instanceof Node && !f.value.contains(e.target) && !v.value.contains(e.target) && k();
|
|
101
114
|
};
|
|
102
|
-
return
|
|
103
|
-
if (document.addEventListener("click",
|
|
104
|
-
const e = document.getElementById(
|
|
105
|
-
e && (
|
|
115
|
+
return q(() => {
|
|
116
|
+
if (document.addEventListener("click", M), h(), r) {
|
|
117
|
+
const e = document.getElementById(r);
|
|
118
|
+
e && (l = new MutationObserver((o) => {
|
|
106
119
|
o.forEach((d) => {
|
|
107
120
|
d.type === "attributes" && d.attributeName === "data-theme" && h();
|
|
108
121
|
});
|
|
109
|
-
}),
|
|
122
|
+
}), l.observe(e, {
|
|
110
123
|
attributes: !0,
|
|
111
124
|
attributeFilter: ["data-theme"]
|
|
112
125
|
}));
|
|
113
126
|
}
|
|
114
|
-
}),
|
|
115
|
-
document.removeEventListener("click",
|
|
116
|
-
}), (e, o) => (
|
|
117
|
-
y(
|
|
127
|
+
}), G(() => {
|
|
128
|
+
document.removeEventListener("click", M), l && (l.disconnect(), l = null);
|
|
129
|
+
}), (e, o) => (S(), C(J, null, [
|
|
130
|
+
y(b)().isRecording ? K("", !0) : (S(), C("button", {
|
|
118
131
|
key: 0,
|
|
119
132
|
ref_key: "emojiButton",
|
|
120
133
|
ref: f,
|
|
121
|
-
class:
|
|
122
|
-
onClick:
|
|
123
|
-
onMouseenter:
|
|
124
|
-
onMouseleave:
|
|
134
|
+
class: Q(["button", { "button-disabled": n.state === "disabled" }]),
|
|
135
|
+
onClick: x,
|
|
136
|
+
onMouseenter: H,
|
|
137
|
+
onMouseleave: A
|
|
125
138
|
}, [
|
|
126
139
|
B("span", null, [
|
|
127
|
-
g(y(
|
|
140
|
+
g(y(ie), { fill: N.value }, null, 8, ["fill"])
|
|
128
141
|
])
|
|
129
142
|
], 34)),
|
|
130
|
-
g(
|
|
131
|
-
default:
|
|
132
|
-
|
|
143
|
+
g(X, null, {
|
|
144
|
+
default: Y(() => [
|
|
145
|
+
Z(B("div", {
|
|
133
146
|
ref_key: "emoji",
|
|
134
147
|
ref: v,
|
|
135
148
|
class: "emoji",
|
|
136
|
-
onMouseenter:
|
|
137
|
-
onMouseleave:
|
|
149
|
+
onMouseenter: D,
|
|
150
|
+
onMouseleave: R
|
|
138
151
|
}, [
|
|
139
|
-
g(y(
|
|
140
|
-
native:
|
|
141
|
-
theme:
|
|
142
|
-
"display-recent":
|
|
152
|
+
g(y(te), {
|
|
153
|
+
native: n.native,
|
|
154
|
+
theme: j.value,
|
|
155
|
+
"display-recent": n.displayRecent,
|
|
156
|
+
"emoji-src": n.emojiSrc,
|
|
143
157
|
"picker-type": "",
|
|
144
|
-
onSelect:
|
|
145
|
-
}, null, 8, ["native", "theme", "display-recent"])
|
|
158
|
+
onSelect: V
|
|
159
|
+
}, null, 8, ["native", "theme", "display-recent", "emoji-src"])
|
|
146
160
|
], 544), [
|
|
147
|
-
[
|
|
161
|
+
[ee, i.value]
|
|
148
162
|
])
|
|
149
163
|
]),
|
|
150
164
|
_: 1
|
|
@@ -153,5 +167,5 @@ const ye = /* @__PURE__ */ D({
|
|
|
153
167
|
}
|
|
154
168
|
});
|
|
155
169
|
export {
|
|
156
|
-
|
|
170
|
+
je as default
|
|
157
171
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./ChatItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-83011e3a"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|