@mobilon-dev/chotto 0.3.88 → 0.3.90

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 (24) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +2 -2
  3. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +41 -33
  4. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +2 -2
  5. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +15 -15
  6. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +4 -4
  7. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +52 -16
  8. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
  9. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +165 -96
  10. package/dist/components/3_compounds/Feed/composables/useFeedScrollTo.js +38 -13
  11. package/dist/functions/renderAppleEmojis.js +24 -20
  12. package/dist/hooks/messages/useStartEdit.js +1 -1
  13. package/dist/themes/dark.css +1 -1
  14. package/dist/themes/default.css +1 -1
  15. package/dist/themes/glass.css +1 -1
  16. package/dist/themes/green.css +1 -1
  17. package/dist/themes/mobilon1.css +1 -1
  18. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +15 -0
  19. package/dist/types/components/2_feed_elements/BaseReplyMessage/styles/types.d.ts +6 -0
  20. package/dist/types/components/2_feed_elements/ReplyTextMessage/stories/ReplyTextMessage.stories.d.ts +1 -0
  21. package/dist/types/components/2_feed_elements/ReplyTextMessage/styles/types.d.ts +22 -0
  22. package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +18 -0
  23. package/dist/types/functions/renderAppleEmojis.d.ts +1 -0
  24. package/package.json +1 -1
@@ -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 c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e67f8c2a"]]);
4
+ const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1b5902eb"]]);
5
5
  export {
6
- c as default
6
+ i as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as D, ref as r, inject as W, watch as z, computed as R, 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 b, normalizeClass as K, createElementVNode as B, Transition as Q, withCtx as X, withDirectives as Y, vShow as Z } from "vue";
1
+ import { defineComponent as D, ref as l, 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
2
  import ee from "../../../node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js";
3
3
  /* empty css */
4
4
  import { useMessageDraft as te } from "../../../hooks/useMessageDraft.js";
@@ -13,7 +13,7 @@ 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
15
  import ne from "./icons/SmilesIcon.vue.js";
16
- const be = /* @__PURE__ */ D({
16
+ const ye = /* @__PURE__ */ D({
17
17
  __name: "ButtonEmojiPicker",
18
18
  props: {
19
19
  state: {
@@ -24,7 +24,7 @@ const be = /* @__PURE__ */ D({
24
24
  type: String,
25
25
  default: "click",
26
26
  // или 'hover'
27
- validator: (l) => ["click", "hover"].includes(l)
27
+ validator: (a) => ["click", "hover"].includes(a)
28
28
  },
29
29
  /**
30
30
  * true — системные эмодзи; false — 3D (Apple) в пикере, инпуте и ленте.
@@ -33,17 +33,24 @@ const be = /* @__PURE__ */ D({
33
33
  native: {
34
34
  type: Boolean,
35
35
  default: !0
36
+ },
37
+ /**
38
+ * Показывать группу недавно использованных эмодзи.
39
+ */
40
+ displayRecent: {
41
+ type: Boolean,
42
+ default: !0
36
43
  }
37
44
  },
38
- setup(l) {
39
- const t = l, v = r(null), f = r(null), o = r(!1), E = r("light"), i = W("chatAppId"), { setMessageText: P, getMessage: M } = te(i), { setNative: w } = oe(i);
40
- z(
45
+ setup(a) {
46
+ const t = a, v = l(null), f = l(null), o = l(!1), b = l("light"), i = R("chatAppId"), { setMessageText: P, getMessage: E } = te(i), { setNative: w } = oe(i);
47
+ W(
41
48
  () => t.native,
42
49
  (e) => w(e),
43
50
  { immediate: !0 }
44
51
  );
45
- const c = r("#5F5F5F"), s = r("#404040"), p = r(!1);
46
- let a = null;
52
+ const c = l("#5F5F5F"), s = l("#404040"), p = l(!1);
53
+ let r = null;
47
54
  const h = () => {
48
55
  if (!i) {
49
56
  c.value = "#5F5F5F", s.value = "#404040";
@@ -56,7 +63,7 @@ const be = /* @__PURE__ */ D({
56
63
  }
57
64
  const n = window.getComputedStyle(e), d = n.getPropertyValue("--chotto-buttonemojipicker-button-span-color").trim(), A = n.getPropertyValue("--chotto-buttonemojipicker-button-span-hover-color").trim();
58
65
  c.value = d || "#5F5F5F", s.value = A || "#404040";
59
- }, I = R(() => p.value ? s.value : c.value);
66
+ }, I = z(() => p.value ? s.value : c.value);
60
67
  U(() => {
61
68
  h();
62
69
  });
@@ -66,24 +73,24 @@ const be = /* @__PURE__ */ D({
66
73
  const e = document.getElementById(i);
67
74
  return (n = e == null ? void 0 : e.getAttribute("data-theme")) != null && n.includes("dark") ? "dark" : "light";
68
75
  }, S = (e) => {
69
- P(M().text + e.i), t.mode === "click" && (o.value = !1);
70
- }, y = () => {
71
- t.state === "active" && (E.value = N(), o.value = !0);
76
+ P(E().text + e.i), t.mode === "click" && (o.value = !1);
77
+ }, M = () => {
78
+ t.state === "active" && (b.value = N(), o.value = !0);
72
79
  }, k = () => {
73
80
  o.value = !1;
74
- }, _ = () => {
75
- t.mode === "click" && (o.value = !o.value, o.value && y());
76
81
  }, T = () => {
77
- t.mode === "hover" && (u = !0, y());
82
+ t.mode === "click" && (o.value = !o.value, o.value && M());
78
83
  }, V = () => {
84
+ t.mode === "hover" && (u = !0, M());
85
+ }, x = () => {
79
86
  t.mode === "hover" && (u = !1, setTimeout(() => {
80
87
  !m && !u && k();
81
88
  }, 150));
82
- }, x = () => {
83
- p.value = !0, T();
84
89
  }, L = () => {
85
- p.value = !1, V();
90
+ p.value = !0, V();
86
91
  }, O = () => {
92
+ p.value = !1, x();
93
+ }, _ = () => {
87
94
  t.mode === "hover" && (m = !0);
88
95
  }, H = () => {
89
96
  t.mode === "hover" && (m = !1, setTimeout(() => {
@@ -95,29 +102,29 @@ const be = /* @__PURE__ */ D({
95
102
  return $(() => {
96
103
  if (document.addEventListener("click", F), h(), i) {
97
104
  const e = document.getElementById(i);
98
- e && (a = new MutationObserver((n) => {
105
+ e && (r = new MutationObserver((n) => {
99
106
  n.forEach((d) => {
100
107
  d.type === "attributes" && d.attributeName === "data-theme" && h();
101
108
  });
102
- }), a.observe(e, {
109
+ }), r.observe(e, {
103
110
  attributes: !0,
104
111
  attributeFilter: ["data-theme"]
105
112
  }));
106
113
  }
107
114
  }), q(() => {
108
- document.removeEventListener("click", F), a && (a.disconnect(), a = null);
115
+ document.removeEventListener("click", F), r && (r.disconnect(), r = null);
109
116
  }), (e, n) => (C(), j(G, null, [
110
- b(M)().isRecording ? J("", !0) : (C(), j("button", {
117
+ y(E)().isRecording ? J("", !0) : (C(), j("button", {
111
118
  key: 0,
112
119
  ref_key: "emojiButton",
113
120
  ref: f,
114
- class: K(["button", { "button-disabled": l.state === "disabled" }]),
115
- onClick: _,
116
- onMouseenter: x,
117
- onMouseleave: L
121
+ class: K(["button", { "button-disabled": a.state === "disabled" }]),
122
+ onClick: T,
123
+ onMouseenter: L,
124
+ onMouseleave: O
118
125
  }, [
119
126
  B("span", null, [
120
- g(b(ne), { fill: I.value }, null, 8, ["fill"])
127
+ g(y(ne), { fill: I.value }, null, 8, ["fill"])
121
128
  ])
122
129
  ], 34)),
123
130
  g(Q, null, {
@@ -126,15 +133,16 @@ const be = /* @__PURE__ */ D({
126
133
  ref_key: "emoji",
127
134
  ref: v,
128
135
  class: "emoji",
129
- onMouseenter: O,
136
+ onMouseenter: _,
130
137
  onMouseleave: H
131
138
  }, [
132
- g(b(ee), {
133
- native: l.native,
134
- theme: E.value,
139
+ g(y(ee), {
140
+ native: a.native,
141
+ theme: b.value,
142
+ "display-recent": a.displayRecent,
135
143
  "picker-type": "",
136
144
  onSelect: S
137
- }, null, 8, ["native", "theme"])
145
+ }, null, 8, ["native", "theme", "display-recent"])
138
146
  ], 544), [
139
147
  [Z, o.value]
140
148
  ])
@@ -145,5 +153,5 @@ const be = /* @__PURE__ */ D({
145
153
  }
146
154
  });
147
155
  export {
148
- be as default
156
+ ye as default
149
157
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./MessageReactions.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-44eccc7b"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-64bc224b"]]);
5
5
  export {
6
- a as default
6
+ r as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as Ce, inject as E, ref as M, computed as c, unref as i, onMounted as _e, onUnmounted as Ne, watch as Se, createElementBlock as d, openBlock as l, normalizeClass as K, createBlock as Q, Fragment as A, renderList as F, withCtx as C, createElementVNode as g, createCommentVNode as _, createVNode as u, toDisplayString as Ue, Teleport as je, Transition as D, withDirectives as V, normalizeStyle as $, withModifiers as y, vShow as z } from "vue";
1
+ import { defineComponent as Ce, inject as E, ref as M, computed as c, unref as i, onMounted as _e, onUnmounted as Ne, watch as Se, createElementBlock as d, openBlock as l, normalizeClass as K, createBlock as Q, Fragment as A, renderList as F, withCtx as C, createElementVNode as p, createCommentVNode as _, createVNode as u, toDisplayString as Ue, Teleport as je, Transition as D, withDirectives as V, normalizeStyle as $, withModifiers as y, vShow as z } from "vue";
2
2
  import Pe from "../../../node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js";
3
3
  /* empty css */
4
4
  import "../../../hooks/useMessageDraft.js";
@@ -82,7 +82,7 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
82
82
  },
83
83
  emits: ["toggle-reaction", "add-reaction", "remove-reaction", "menu"],
84
84
  setup(s, { emit: J }) {
85
- const n = s, a = J, v = E("chatAppId"), G = E("currentUserId", void 0), W = E("reactionUserNames", void 0), { startReply: X } = Be(v || ""), m = M(null), f = M(null), N = M("light"), { isNative: Y } = Le(v || ""), S = c(() => Qe), Z = c(() => n.mode), k = c(() => n.currentUserId ?? i(G)), U = c(() => n.reactionUserNames ?? i(W)), ee = c(() => {
85
+ const n = s, a = J, g = E("chatAppId"), G = E("currentUserId", void 0), W = E("reactionUserNames", void 0), { startReply: X } = Be(g || ""), m = M(null), f = M(null), N = M("light"), { isNative: Y } = Le(g || ""), S = c(() => Qe), Z = c(() => n.mode), k = c(() => n.currentUserId ?? i(G)), U = c(() => n.reactionUserNames ?? i(W)), ee = c(() => {
86
86
  var t, r;
87
87
  const e = (t = n.currentUserName) == null ? void 0 : t.trim();
88
88
  if (e) return e;
@@ -105,7 +105,7 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
105
105
  quickReactionsRef: ue,
106
106
  quickPanelStyle: de,
107
107
  pickerStyle: me,
108
- closeQuickPanel: p,
108
+ closeQuickPanel: v,
109
109
  handleMessageMouseEnter: fe,
110
110
  handleMessageMouseLeave: pe,
111
111
  openFullPicker: ge,
@@ -117,8 +117,8 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
117
117
  handleClickOutside: O
118
118
  } = re, ve = c(() => m.value ? Te(m.value) : !1), ye = () => {
119
119
  var o;
120
- if (!v) return "light";
121
- const e = document.getElementById(v);
120
+ if (!g) return "light";
121
+ const e = document.getElementById(g);
122
122
  return (o = e == null ? void 0 : e.getAttribute("data-theme")) != null && o.includes("dark") ? "dark" : "light";
123
123
  };
124
124
  function I() {
@@ -156,11 +156,11 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
156
156
  const o = h(e);
157
157
  o && a("remove-reaction", { messageId: n.messageId, key: o }), a("add-reaction", { messageId: n.messageId, key: e });
158
158
  }
159
- p();
159
+ v();
160
160
  }
161
161
  }
162
162
  function be() {
163
- n.readonly || !n.enabled || !n.reply || (X(n.reply), p());
163
+ n.readonly || !n.enabled || !n.reply || (X(n.reply), v());
164
164
  }
165
165
  function Re(e) {
166
166
  if (n.readonly || !n.enabled || !n.menuEnabled) return;
@@ -168,13 +168,13 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
168
168
  const r = o.getBoundingClientRect();
169
169
  return { top: r.top, right: r.right, bottom: r.bottom, left: r.left, width: r.width, height: r.height };
170
170
  })() : void 0;
171
- p(), a("menu", { messageId: n.messageId, triggerRect: t, event: e });
171
+ a("menu", { messageId: n.messageId, triggerRect: t, event: e });
172
172
  }
173
173
  async function Ee() {
174
174
  n.readonly || !n.enabled || (N.value = ye(), await ge());
175
175
  }
176
176
  function Me(e) {
177
- if (T(), p(), !I()) return;
177
+ if (T(), v(), !I()) return;
178
178
  const o = e.i;
179
179
  if (L(o))
180
180
  return;
@@ -190,7 +190,7 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
190
190
  }), Se(
191
191
  () => [n.enabled, n.readonly],
192
192
  ([e, o]) => {
193
- (!e || o) && (p(), T());
193
+ (!e || o) && (v(), T());
194
194
  }
195
195
  ), (e, o) => (l(), d("div", {
196
196
  ref_key: "reactionsContainerRef",
@@ -207,11 +207,11 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
207
207
  delay: 400
208
208
  }, {
209
209
  default: C(() => [
210
- g("button", {
210
+ p("button", {
211
211
  class: K(["message-reactions__chip", { "is-active": t.reactedByMe && t.count === 1 }]),
212
212
  onClick: (r) => ke(t.key)
213
213
  }, [
214
- g("span", $e, [
214
+ p("span", $e, [
215
215
  u(H, {
216
216
  emoji: t.key
217
217
  }, null, 8, ["emoji"])
@@ -224,7 +224,7 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
224
224
  (l(), Q(je, { to: "body" }, [
225
225
  u(D, { name: "message-reactions-popover" }, {
226
226
  default: C(() => [
227
- V(g("div", {
227
+ V(p("div", {
228
228
  ref_key: "quickReactionsRef",
229
229
  ref: ue,
230
230
  class: "message-reactions__quick-panel",
@@ -242,7 +242,7 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
242
242
  }, [
243
243
  u(H, { emoji: t }, null, 8, ["emoji"])
244
244
  ], 8, He))), 128)),
245
- g("button", {
245
+ p("button", {
246
246
  class: "message-reactions__expand",
247
247
  title: "Развернуть",
248
248
  onClick: y(Ee, ["stop"])
@@ -273,7 +273,7 @@ const Ve = ["onClick"], $e = { class: "message-reactions__emoji" }, ze = {
273
273
  }),
274
274
  u(D, { name: "message-reactions-popover" }, {
275
275
  default: C(() => [
276
- V(g("div", {
276
+ V(p("div", {
277
277
  ref_key: "pickerRef",
278
278
  ref: ce,
279
279
  class: "message-reactions__picker",
@@ -1,7 +1,7 @@
1
- import o from "./ReplyTextMessage.vue2.js";
1
+ import e from "./ReplyTextMessage.vue2.js";
2
2
  /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-646d5d7c"]]);
3
+ import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ o(e, [["__scopeId", "data-v-31ae85ec"]]);
5
5
  export {
6
- s as default
6
+ r as default
7
7
  };
@@ -1,15 +1,16 @@
1
- import { defineComponent as a, createElementBlock as r, openBlock as s, createCommentVNode as c, createElementVNode as l, toDisplayString as d, unref as t } from "vue";
1
+ import { defineComponent as x, computed as f, createElementBlock as r, openBlock as o, createBlock as h, withCtx as g, createElementVNode as s, createCommentVNode as p, toDisplayString as d, unref as u } from "vue";
2
+ import k from "../../1_atoms/Tooltip/Tooltip.vue.js";
2
3
  import "../../../locale/useLocale.js";
3
4
  /* empty css */
4
5
  import "../../../hooks/useTheme.js";
5
- import { useMessageLinks as u } from "../../../hooks/messages/useMessageLinks.js";
6
+ import { useMessageLinks as _ } from "../../../hooks/messages/useMessageLinks.js";
6
7
  import "../../../functions/parseMarkdown.js";
7
8
  import "../../../hooks/useMessageDraft.js";
8
9
  import "../../../hooks/useSearchModel.js";
9
10
  import "../../../hooks/useEmojiNative.js";
10
11
  /* empty css */
11
12
  /* empty css */
12
- const g = { class: "container" }, x = ["textContent"], f = ["innerHTML"], E = /* @__PURE__ */ a({
13
+ const C = { class: "reply-text-message__wrapper" }, y = ["textContent"], T = ["innerHTML"], M = ["textContent"], H = ["innerHTML"], A = /* @__PURE__ */ x({
13
14
  __name: "ReplyTextMessage",
14
15
  props: {
15
16
  message: {
@@ -17,22 +18,57 @@ const g = { class: "container" }, x = ["textContent"], f = ["innerHTML"], E = /*
17
18
  required: !0
18
19
  }
19
20
  },
20
- setup(e) {
21
- const i = e, { linkedHtml: m, inNewWindow: o } = u(() => i.message.text);
22
- return (k, n) => (s(), r("div", g, [
23
- e.message.header ? (s(), r("p", {
21
+ setup(t) {
22
+ const i = t, { linkedHtml: a } = _(() => i.message.text), c = f(() => {
23
+ var e;
24
+ return ((e = i.message.text) == null ? void 0 : e.trim()) || "";
25
+ }), l = (e) => {
26
+ var m;
27
+ const n = (m = e.target) == null ? void 0 : m.closest("a");
28
+ n instanceof HTMLAnchorElement && n.href && (e.preventDefault(), e.stopPropagation(), window.open(n.href, "_blank", "noopener,noreferrer"));
29
+ };
30
+ return (e, n) => (o(), r("div", C, [
31
+ c.value ? (o(), h(k, {
24
32
  key: 0,
25
- textContent: d(`В ответ ${e.message.header}`)
26
- }, null, 8, x)) : c("", !0),
27
- l("p", {
28
- class: "text",
29
- onClick: n[0] || (n[0] = //@ts-ignore
30
- (...p) => t(o) && t(o)(...p)),
31
- innerHTML: t(m)
32
- }, null, 8, f)
33
+ position: "top",
34
+ offset: 8,
35
+ delay: 1e3,
36
+ "max-width": "25rem",
37
+ text: c.value
38
+ }, {
39
+ default: g(() => [
40
+ s("div", {
41
+ class: "container",
42
+ onClick: l
43
+ }, [
44
+ t.message.header ? (o(), r("p", {
45
+ key: 0,
46
+ textContent: d(`В ответ ${t.message.header}`)
47
+ }, null, 8, y)) : p("", !0),
48
+ s("p", {
49
+ class: "text",
50
+ innerHTML: u(a)
51
+ }, null, 8, T)
52
+ ])
53
+ ]),
54
+ _: 1
55
+ }, 8, ["text"])) : (o(), r("div", {
56
+ key: 1,
57
+ class: "container",
58
+ onClick: l
59
+ }, [
60
+ t.message.header ? (o(), r("p", {
61
+ key: 0,
62
+ textContent: d(`В ответ ${t.message.header}`)
63
+ }, null, 8, M)) : p("", !0),
64
+ s("p", {
65
+ class: "text",
66
+ innerHTML: u(a)
67
+ }, null, 8, H)
68
+ ]))
33
69
  ]));
34
70
  }
35
71
  });
36
72
  export {
37
- E as default
73
+ A as default
38
74
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./ChatInput.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-ab7a7750"]]);
4
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-edf490bf"]]);
5
5
  export {
6
- m as default
6
+ a as default
7
7
  };