@mobilon-dev/chotto 0.3.125 → 0.3.127

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 (28) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +51 -51
  3. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +52 -50
  4. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue.js +2 -2
  5. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +41 -31
  6. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +2 -2
  7. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +51 -30
  8. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +2 -2
  9. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +286 -270
  10. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +3 -3
  11. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +40 -34
  12. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
  13. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +282 -259
  14. package/dist/components/3_compounds/Feed/composables/useFeedScroll.js +79 -59
  15. package/dist/functions/parseMarkdown.js +7 -6
  16. package/dist/hooks/messages/useImageFeedSrc.js +50 -0
  17. package/dist/index.js +118 -113
  18. package/dist/themes/dark.css +1 -1
  19. package/dist/themes/default.css +1 -1
  20. package/dist/themes/glass.css +1 -1
  21. package/dist/themes/green.css +1 -1
  22. package/dist/themes/mobilon1.css +1 -1
  23. package/dist/types/src/components/2_feed_elements/ImageMessage/stories/ImageMessage.stories.d.ts +2 -0
  24. package/dist/types/src/components/3_compounds/Feed/composables/useFeedScroll.d.ts +3 -0
  25. package/dist/types/src/components/4_layouts/ChatWrapper/styles/types.d.ts +4 -0
  26. package/dist/types/src/hooks/messages/index.d.ts +1 -0
  27. package/dist/types/src/hooks/messages/useImageFeedSrc.d.ts +29 -0
  28. package/package.json +1 -1
@@ -1,11 +1,19 @@
1
- import { defineComponent as h, computed as a, createElementBlock as r, openBlock as n, normalizeClass as y, createCommentVNode as c, createElementVNode as k, toDisplayString as d } from "vue";
2
- const w = ["src"], C = { class: "feed-reply-quote__content" }, E = {
1
+ import { defineComponent as k, computed as a, createElementBlock as o, openBlock as n, normalizeClass as w, createCommentVNode as m, createElementVNode as C, unref as g, toDisplayString as p } from "vue";
2
+ import "../../../locale/useLocale.js";
3
+ /* empty css */
4
+ import "../../../node_modules/linkifyjs/dist/linkify.js";
5
+ import "../../../node_modules/linkify-string/dist/linkify-string.js";
6
+ import "../../../functions/parseMarkdown.js";
7
+ /* empty css */
8
+ /* empty css */
9
+ import { useImageFeedSrc as I } from "../../../hooks/messages/useImageFeedSrc.js";
10
+ const S = ["src"], q = { class: "feed-reply-quote__content" }, x = {
3
11
  key: 0,
4
12
  class: "feed-reply-quote__heading"
5
- }, q = {
13
+ }, P = {
6
14
  key: 1,
7
15
  class: "feed-reply-quote__body"
8
- }, I = /* @__PURE__ */ h({
16
+ }, R = /* @__PURE__ */ k({
9
17
  __name: "FeedReplyQuote",
10
18
  props: {
11
19
  message: {
@@ -14,21 +22,32 @@ const w = ["src"], C = { class: "feed-reply-quote__content" }, E = {
14
22
  }
15
23
  },
16
24
  emits: ["reply"],
17
- setup(m, { emit: g }) {
18
- const _ = g, t = m, p = /* @__PURE__ */ new Set(["message.image", "message.sticker"]), o = a(() => {
19
- const e = t.message;
25
+ setup(_, { emit: f }) {
26
+ const v = f, s = _, i = /* @__PURE__ */ new Set(["message.image", "message.sticker"]), { displaySrc: y, onImageError: u } = I(
27
+ () => {
28
+ const e = s.message;
29
+ if (i.has((e == null ? void 0 : e.type) || ""))
30
+ return e.imagePreviewUrl;
31
+ },
32
+ () => {
33
+ const e = s.message;
34
+ if (i.has((e == null ? void 0 : e.type) || ""))
35
+ return e.url;
36
+ }
37
+ ), c = a(() => {
38
+ const e = s.message;
20
39
  if ((e == null ? void 0 : e.type) === "message.video") return e.coverUrl || "";
21
- if (!p.has((e == null ? void 0 : e.type) || "")) return "";
22
- const s = e.imagePreviewUrl || e.url;
23
- return !s || s.endsWith(".tgs") ? "" : s;
24
- }), i = a(() => {
25
- var s;
26
- const e = (s = t.message) == null ? void 0 : s.header;
40
+ if (!i.has((e == null ? void 0 : e.type) || "")) return "";
41
+ const t = y.value;
42
+ return !t || t.endsWith(".tgs") ? "" : t;
43
+ }), d = a(() => {
44
+ var t;
45
+ const e = (t = s.message) == null ? void 0 : t.header;
27
46
  return e ? `В ответ ${e}` : "";
28
47
  }), l = a(() => {
29
- var u;
30
- const e = t.message, s = (u = e == null ? void 0 : e.text) == null ? void 0 : u.replace(/\s+/g, " ").trim();
31
- if (s) return s;
48
+ var r;
49
+ const e = s.message, t = (r = e == null ? void 0 : e.text) == null ? void 0 : r.replace(/\s+/g, " ").trim();
50
+ if (t) return t;
32
51
  switch (e == null ? void 0 : e.type) {
33
52
  case "message.image":
34
53
  return "Фотография";
@@ -45,33 +64,35 @@ const w = ["src"], C = { class: "feed-reply-quote__content" }, E = {
45
64
  default:
46
65
  return "";
47
66
  }
48
- }), f = a(() => o.value ? "grid" : "");
49
- function v() {
67
+ }), h = a(() => c.value ? "grid" : "");
68
+ function E() {
50
69
  var e;
51
- (e = t.message) != null && e.messageId && _("reply", t.message.messageId);
70
+ (e = s.message) != null && e.messageId && v("reply", s.message.messageId);
52
71
  }
53
- return (e, s) => (n(), r("div", {
54
- class: y(["reply__container", f.value]),
72
+ return (e, t) => (n(), o("div", {
73
+ class: w(["reply__container", h.value]),
55
74
  "data-testid": "feed-reply-quote",
56
- onClick: v
75
+ onClick: E
57
76
  }, [
58
- o.value ? (n(), r("img", {
77
+ c.value ? (n(), o("img", {
59
78
  key: 0,
60
79
  class: "feed-reply-quote__preview",
61
- src: o.value,
80
+ src: c.value,
62
81
  alt: "",
63
82
  width: "40",
64
83
  height: "40",
65
84
  loading: "lazy",
66
- decoding: "async"
67
- }, null, 8, w)) : c("", !0),
68
- k("div", C, [
69
- i.value ? (n(), r("p", E, d(i.value), 1)) : c("", !0),
70
- l.value ? (n(), r("p", q, d(l.value), 1)) : c("", !0)
85
+ decoding: "async",
86
+ onError: t[0] || (t[0] = //@ts-ignore
87
+ (...r) => g(u) && g(u)(...r))
88
+ }, null, 40, S)) : m("", !0),
89
+ C("div", q, [
90
+ d.value ? (n(), o("p", x, p(d.value), 1)) : m("", !0),
91
+ l.value ? (n(), o("p", P, p(l.value), 1)) : m("", !0)
71
92
  ])
72
93
  ], 2));
73
94
  }
74
95
  });
75
96
  export {
76
- I as default
97
+ R as default
77
98
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ImageMessage.vue2.js";
2
2
  /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-54182b88"]]);
3
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-99e09d5d"]]);
5
5
  export {
6
6
  r as default
7
7
  };