@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 { inject as
|
|
2
|
-
import { tokenize as
|
|
3
|
-
import
|
|
4
|
-
import { parseMarkdown as
|
|
5
|
-
import { replaceEmojisInHtml as
|
|
1
|
+
import { inject as T, computed as k } from "vue";
|
|
2
|
+
import { tokenize as w } from "../../node_modules/linkifyjs/dist/linkify.js";
|
|
3
|
+
import g from "../../node_modules/linkify-string/dist/linkify-string.js";
|
|
4
|
+
import { parseMarkdown as C } from "../../functions/parseMarkdown.js";
|
|
5
|
+
import { replaceEmojisInHtml as v } from "../../functions/renderAppleEmojis.js";
|
|
6
6
|
import { useEmojiNative as F } from "../useEmojiNative.js";
|
|
7
7
|
function H(t) {
|
|
8
8
|
return t.includes("**") || t.includes("`") || t.includes("~~") || t.includes(`
|
|
@@ -10,20 +10,20 @@ function H(t) {
|
|
|
10
10
|
`) || t.includes(">") && t.trimStart().startsWith(">") || /<\/(u|s|b|i)>|<(u|s|b|i)[\s>]/.test(t);
|
|
11
11
|
}
|
|
12
12
|
const A = (t) => {
|
|
13
|
-
const u =
|
|
14
|
-
return { linkedHtml:
|
|
13
|
+
const u = T("chatAppId", ""), { isNative: f, emojiSrc: h } = F(u);
|
|
14
|
+
return { linkedHtml: k(() => {
|
|
15
15
|
const n = t();
|
|
16
16
|
if (!n) return "";
|
|
17
17
|
let e;
|
|
18
18
|
if (!H(n))
|
|
19
|
-
e = w(n);
|
|
20
|
-
else {
|
|
21
19
|
e = g(n);
|
|
20
|
+
else {
|
|
21
|
+
e = C(n);
|
|
22
22
|
const i = document.createElement("div");
|
|
23
23
|
i.innerHTML = e;
|
|
24
|
-
const
|
|
24
|
+
const N = (o) => {
|
|
25
25
|
var p;
|
|
26
|
-
const r = o.textContent || "", d =
|
|
26
|
+
const r = o.textContent || "", d = w(r);
|
|
27
27
|
if (d.length === 1 && !d[0].isLink)
|
|
28
28
|
return;
|
|
29
29
|
const l = document.createDocumentFragment();
|
|
@@ -34,7 +34,7 @@ const A = (t) => {
|
|
|
34
34
|
} else
|
|
35
35
|
l.appendChild(document.createTextNode(s.toString()));
|
|
36
36
|
}), (p = o.parentNode) == null || p.replaceChild(l, o);
|
|
37
|
-
},
|
|
37
|
+
}, E = document.createTreeWalker(
|
|
38
38
|
i,
|
|
39
39
|
NodeFilter.SHOW_TEXT,
|
|
40
40
|
{
|
|
@@ -50,11 +50,11 @@ const A = (t) => {
|
|
|
50
50
|
}
|
|
51
51
|
), m = [];
|
|
52
52
|
let a;
|
|
53
|
-
for (; a =
|
|
53
|
+
for (; a = E.nextNode(); )
|
|
54
54
|
a.nodeType === Node.TEXT_NODE && m.push(a);
|
|
55
|
-
m.reverse().forEach(
|
|
55
|
+
m.reverse().forEach(N), e = i.innerHTML;
|
|
56
56
|
}
|
|
57
|
-
return f.value || (e =
|
|
57
|
+
return f.value || (e = v(e, h.value)), e;
|
|
58
58
|
}), inNewWindow: (n) => {
|
|
59
59
|
n.preventDefault();
|
|
60
60
|
const e = n.target;
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ref as a, computed as s } from "vue";
|
|
2
|
+
import { APPLE_EMOJI_CDN as c, normalizeEmojiCdn as u } from "../functions/renderAppleEmojis.js";
|
|
3
|
+
const i = a([]), N = (r) => {
|
|
4
|
+
const n = a(0), o = i.value.find(({ id: e }) => e === r);
|
|
5
|
+
o !== void 0 ? (n.value = i.value.indexOf(o), o.emojiSrc || (o.emojiSrc = c)) : (i.value.push({
|
|
6
|
+
id: r,
|
|
7
|
+
native: !0,
|
|
8
|
+
emojiSrc: c
|
|
9
|
+
}), n.value = i.value.length - 1);
|
|
10
|
+
const t = () => i.value[n.value], m = s(() => {
|
|
8
11
|
var e;
|
|
9
|
-
return ((e = t
|
|
10
|
-
}),
|
|
12
|
+
return ((e = t()) == null ? void 0 : e.native) ?? !0;
|
|
13
|
+
}), v = s(() => {
|
|
11
14
|
var e;
|
|
12
|
-
return ((e = t
|
|
15
|
+
return ((e = t()) == null ? void 0 : e.emojiSrc) ?? c;
|
|
16
|
+
});
|
|
17
|
+
return { isNative: m, emojiSrc: v, getNative: () => {
|
|
18
|
+
var e;
|
|
19
|
+
return ((e = t()) == null ? void 0 : e.native) ?? !0;
|
|
20
|
+
}, getEmojiSrc: () => {
|
|
21
|
+
var e;
|
|
22
|
+
return ((e = t()) == null ? void 0 : e.emojiSrc) ?? c;
|
|
13
23
|
}, setNative: (e) => {
|
|
14
|
-
t
|
|
24
|
+
t() && (t().native = e);
|
|
25
|
+
}, setEmojiSrc: (e) => {
|
|
26
|
+
t() && (t().emojiSrc = u(e));
|
|
15
27
|
} };
|
|
16
28
|
};
|
|
17
29
|
export {
|
|
18
|
-
|
|
30
|
+
N as useEmojiNative
|
|
19
31
|
};
|