@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.
Files changed (25) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.js +15 -15
  3. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +1 -1
  4. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +79 -65
  5. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +1 -1
  6. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +150 -150
  7. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +2 -2
  8. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +79 -78
  9. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +2 -2
  10. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +42 -42
  11. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
  12. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +68 -68
  13. package/dist/functions/renderAppleEmojis.js +120 -91
  14. package/dist/hooks/messages/useMessageLinks.js +15 -15
  15. package/dist/hooks/useEmojiNative.js +24 -12
  16. package/dist/node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js +581 -555
  17. package/dist/themes/dark.css +1 -1
  18. package/dist/themes/default.css +1 -1
  19. package/dist/themes/glass.css +1 -1
  20. package/dist/themes/green.css +1 -1
  21. package/dist/themes/mobilon1.css +1 -1
  22. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +21 -2
  23. package/dist/types/functions/renderAppleEmojis.d.ts +13 -10
  24. package/dist/types/hooks/useEmojiNative.d.ts +5 -2
  25. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
- import { inject as E, computed as T } from "vue";
2
- import { tokenize as k } from "../../node_modules/linkifyjs/dist/linkify.js";
3
- import w from "../../node_modules/linkify-string/dist/linkify-string.js";
4
- import { parseMarkdown as g } from "../../functions/parseMarkdown.js";
5
- import { replaceEmojisInHtml as C } from "../../functions/renderAppleEmojis.js";
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 = E("chatAppId", ""), { isNative: f } = F(u);
14
- return { linkedHtml: T(() => {
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 h = (o) => {
24
+ const N = (o) => {
25
25
  var p;
26
- const r = o.textContent || "", d = k(r);
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
- }, N = document.createTreeWalker(
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 = N.nextNode(); )
53
+ for (; a = E.nextNode(); )
54
54
  a.nodeType === Node.TEXT_NODE && m.push(a);
55
- m.reverse().forEach(h), e = i.innerHTML;
55
+ m.reverse().forEach(N), e = i.innerHTML;
56
56
  }
57
- return f.value || (e = C(e)), 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 u, computed as n } from "vue";
2
- const t = u([]), c = (v) => {
3
- const a = u(0), i = t.value.find(({ id: e }) => e === v);
4
- return i !== void 0 ? a.value = t.value.indexOf(i) : (t.value.push({
5
- id: v,
6
- native: !0
7
- }), a.value = t.value.length - 1), { isNative: n(() => {
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.value[a.value]) == null ? void 0 : e.native) ?? !0;
10
- }), getNative: () => {
12
+ return ((e = t()) == null ? void 0 : e.native) ?? !0;
13
+ }), v = s(() => {
11
14
  var e;
12
- return ((e = t.value[a.value]) == null ? void 0 : e.native) ?? !0;
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.value[a.value] && (t.value[a.value].native = e);
24
+ t() && (t().native = e);
25
+ }, setEmojiSrc: (e) => {
26
+ t() && (t().emojiSrc = u(e));
15
27
  } };
16
28
  };
17
29
  export {
18
- c as useEmojiNative
30
+ N as useEmojiNative
19
31
  };