@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 { defineComponent as f, inject as j, computed as m, createElementBlock as c, unref as g, openBlock as p, toDisplayString as d } from "vue";
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 h } from "../../../hooks/useEmojiNative.js";
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 { getAppleEmojiUrl as k, getAppleEmojiFallbackUrl as E } from "../../../functions/renderAppleEmojis.js";
14
- const _ = ["src", "alt"], y = { key: 1 }, G = /* @__PURE__ */ f({
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(t) {
23
- const r = t, n = j("chatAppId", ""), { isNative: a } = h(n), s = m(() => k(r.emoji)), l = m(() => E(r.emoji));
24
- function u(i) {
25
- const o = i.target, e = l.value;
26
- e && o.src !== e && (o.src = e);
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 (i, o) => g(a) ? (p(), c("span", y, d(t.emoji), 1)) : (p(), c("img", {
28
+ return (a, r) => !h(n) && s.value ? (p(), c("img", {
29
29
  key: 0,
30
30
  class: "chotto-emoji",
31
- src: s.value,
32
- alt: t.emoji,
31
+ src: u.value,
32
+ alt: o.emoji,
33
33
  draggable: "false",
34
- onError: u
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
- G as default
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-4bf1f08f"]]);
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 D, ref as r, inject as R, watch as W, computed as z, watchEffect as U, onMounted as $, onUnmounted as q, createElementBlock as j, openBlock as C, Fragment as G, createCommentVNode as J, createVNode as g, unref as y, normalizeClass as K, createElementVNode as B, Transition as Q, withCtx as X, withDirectives as Y, vShow as Z } from "vue";
2
- import ee from "../../../node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js";
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 te } from "../../../hooks/useMessageDraft.js";
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 oe } from "../../../hooks/useEmojiNative.js";
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 ne from "./icons/SmilesIcon.vue.js";
16
- const ye = /* @__PURE__ */ D({
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: (l) => ["click", "hover"].includes(l)
27
+ validator: (n) => ["click", "hover"].includes(n)
28
28
  },
29
29
  /**
30
- * true — системные эмодзи; false — 3D (Apple) в пикере, инпуте и ленте.
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(l) {
46
- const t = l, v = r(null), f = r(null), n = r(!1), b = r("light"), i = R("chatAppId"), { setMessageText: P, getMessage: E } = te(i), { setNative: w } = oe(i);
47
- W(
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 = r("#5F5F5F"), s = r("#404040"), p = r(!1);
53
- let a = null;
65
+ const c = a("#5F5F5F"), s = a("#404040"), p = a(!1);
66
+ let l = null;
54
67
  const h = () => {
55
- if (!i) {
68
+ if (!r) {
56
69
  c.value = "#5F5F5F", s.value = "#404040";
57
70
  return;
58
71
  }
59
- const e = document.getElementById(i);
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(), A = o.getPropertyValue("--chotto-buttonemojipicker-button-span-hover-color").trim();
65
- c.value = d || "#5F5F5F", s.value = A || "#404040";
66
- }, I = z(() => p.value ? s.value : c.value);
67
- U(() => {
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 N = () => {
84
+ const T = () => {
72
85
  var o;
73
- const e = document.getElementById(i);
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
- }, S = (e) => {
76
- P(E().text + e.i);
77
- }, M = () => {
78
- t.state === "active" && (b.value = N(), n.value = !0);
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
- n.value = !1;
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
- }, F = (e) => {
100
- t.mode === "click" && n.value && f.value && v.value && e.target instanceof Node && !f.value.contains(e.target) && !v.value.contains(e.target) && k();
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", F), h(), i) {
104
- const e = document.getElementById(i);
105
- e && (a = new MutationObserver((o) => {
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
- }), a.observe(e, {
122
+ }), l.observe(e, {
110
123
  attributes: !0,
111
124
  attributeFilter: ["data-theme"]
112
125
  }));
113
126
  }
114
- }), q(() => {
115
- document.removeEventListener("click", F), a && (a.disconnect(), a = null);
116
- }), (e, o) => (C(), j(G, null, [
117
- y(E)().isRecording ? J("", !0) : (C(), j("button", {
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: K(["button", { "button-disabled": l.state === "disabled" }]),
122
- onClick: T,
123
- onMouseenter: L,
124
- onMouseleave: O
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(ne), { fill: I.value }, null, 8, ["fill"])
140
+ g(y(ie), { fill: N.value }, null, 8, ["fill"])
128
141
  ])
129
142
  ], 34)),
130
- g(Q, null, {
131
- default: X(() => [
132
- Y(B("div", {
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: H
149
+ onMouseenter: D,
150
+ onMouseleave: R
138
151
  }, [
139
- g(y(ee), {
140
- native: l.native,
141
- theme: b.value,
142
- "display-recent": l.displayRecent,
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: S
145
- }, null, 8, ["native", "theme", "display-recent"])
158
+ onSelect: V
159
+ }, null, 8, ["native", "theme", "display-recent", "emoji-src"])
146
160
  ], 544), [
147
- [Z, n.value]
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
- ye as default
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-50654e81"]]);
4
+ const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-83011e3a"]]);
5
5
  export {
6
6
  e as default
7
7
  };