@mobilon-dev/chotto 0.3.124 → 0.3.126

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 (26) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue.js +2 -2
  3. package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +41 -31
  4. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +2 -2
  5. package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +51 -30
  6. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +2 -2
  7. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +286 -270
  8. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +3 -3
  9. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +40 -34
  10. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
  11. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +282 -259
  12. package/dist/components/3_compounds/Feed/composables/useFeedScroll.js +79 -59
  13. package/dist/functions/parseMarkdown.js +7 -6
  14. package/dist/hooks/messages/useImageFeedSrc.js +50 -0
  15. package/dist/index.js +118 -113
  16. package/dist/themes/dark.css +1 -1
  17. package/dist/themes/default.css +1 -1
  18. package/dist/themes/glass.css +1 -1
  19. package/dist/themes/green.css +1 -1
  20. package/dist/themes/mobilon1.css +1 -1
  21. package/dist/types/src/components/2_feed_elements/ImageMessage/stories/ImageMessage.stories.d.ts +2 -0
  22. package/dist/types/src/components/3_compounds/Feed/composables/useFeedScroll.d.ts +3 -0
  23. package/dist/types/src/components/4_layouts/ChatWrapper/styles/types.d.ts +4 -0
  24. package/dist/types/src/hooks/messages/index.d.ts +1 -0
  25. package/dist/types/src/hooks/messages/useImageFeedSrc.d.ts +29 -0
  26. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import o from "./FeedFoundItem.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-ead1327f"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b8456345"]]);
5
5
  export {
6
- a as default
6
+ p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as u, computed as l, createElementBlock as o, openBlock as s, normalizeClass as r, createElementVNode as i, toDisplayString as c, createCommentVNode as m } from "vue";
1
+ import { defineComponent as h, computed as l, createElementBlock as r, openBlock as s, normalizeClass as u, createElementVNode as i, toDisplayString as n, createCommentVNode as p, unref as f } from "vue";
2
2
  import "../../../locale/useLocale.js";
3
3
  /* empty css */
4
4
  import "../../../node_modules/linkifyjs/dist/linkify.js";
@@ -6,11 +6,12 @@ import "../../../node_modules/linkify-string/dist/linkify-string.js";
6
6
  import "../../../functions/parseMarkdown.js";
7
7
  /* empty css */
8
8
  /* empty css */
9
- import { getPrimaryImageItem as f } from "../../../hooks/messages/getImageMessageItems.js";
10
- const p = { class: "feed-found-item__avatar-container" }, _ = ["src"], g = {
9
+ import { getPrimaryImageItem as g } from "../../../hooks/messages/getImageMessageItems.js";
10
+ import { useImageFeedSrc as y } from "../../../hooks/messages/useImageFeedSrc.js";
11
+ const b = { class: "feed-found-item__avatar-container" }, j = ["src"], x = {
11
12
  key: 1,
12
13
  class: "pi pi-user"
13
- }, h = { class: "feed-found-item__info" }, v = { class: "feed-found-item__first-line" }, b = { class: "feed-found-item__name" }, j = { class: "feed-found-item__time" }, y = { class: "feed-found-item__second-line" }, x = ["src"], S = /* @__PURE__ */ u({
14
+ }, k = { class: "feed-found-item__info" }, w = { class: "feed-found-item__first-line" }, I = { class: "feed-found-item__name" }, E = { class: "feed-found-item__time" }, P = { class: "feed-found-item__second-line" }, S = ["src"], A = /* @__PURE__ */ h({
14
15
  __name: "FeedFoundItem",
15
16
  props: {
16
17
  object: {
@@ -22,52 +23,61 @@ const p = { class: "feed-found-item__avatar-container" }, _ = ["src"], g = {
22
23
  default: !1
23
24
  }
24
25
  },
25
- setup(t) {
26
- const n = t, a = l(() => {
27
- if (n.object.type !== "message.image") return "";
28
- const e = f(n.object);
29
- return (e == null ? void 0 : e.imagePreviewUrl) || (e == null ? void 0 : e.url) || "";
30
- }), d = l(() => ({
26
+ setup(e) {
27
+ const o = e, { displaySrc: _, onImageError: a } = y(
28
+ () => {
29
+ var t;
30
+ if (o.object.type === "message.image")
31
+ return (t = g(o.object)) == null ? void 0 : t.imagePreviewUrl;
32
+ },
33
+ () => {
34
+ var t;
35
+ if (o.object.type === "message.image")
36
+ return (t = g(o.object)) == null ? void 0 : t.url;
37
+ }
38
+ ), c = l(() => o.object.type !== "message.image" ? "" : _.value), m = l(() => ({
31
39
  "message.file": "pi pi-file",
32
40
  "message.audio": "pi pi-volume-up",
33
41
  "message.video": "pi pi-video",
34
42
  "message.call": "pi pi-phone"
35
- })[n.object.type] || null);
36
- return (e, k) => (s(), o("div", {
37
- class: r(["feed-found-item__container", { "feed-found-item__selected-container": t.selected }])
43
+ })[o.object.type] || null);
44
+ return (t, d) => (s(), r("div", {
45
+ class: u(["feed-found-item__container", { "feed-found-item__selected-container": e.selected }])
38
46
  }, [
39
- i("div", p, [
40
- t.object.avatar ? (s(), o("img", {
47
+ i("div", b, [
48
+ e.object.avatar ? (s(), r("img", {
41
49
  key: 0,
42
- src: t.object.avatar,
50
+ src: e.object.avatar,
43
51
  width: "48",
44
52
  height: "48"
45
- }, null, 8, _)) : (s(), o("span", g))
53
+ }, null, 8, j)) : (s(), r("span", x))
46
54
  ]),
47
- i("div", h, [
48
- i("div", v, [
49
- i("p", b, c(t.object.subtext), 1),
50
- i("p", j, c(t.object.time), 1)
55
+ i("div", k, [
56
+ i("div", w, [
57
+ i("p", I, n(e.object.subtext), 1),
58
+ i("p", E, n(e.object.time), 1)
51
59
  ]),
52
- i("div", y, [
53
- a.value ? (s(), o("img", {
60
+ i("div", P, [
61
+ c.value ? (s(), r("img", {
54
62
  key: 0,
55
- src: a.value,
63
+ src: c.value,
56
64
  style: { "margin-right": "3px" },
57
65
  width: "24",
58
- height: "24"
59
- }, null, 8, x)) : m("", !0),
60
- d.value ? (s(), o("span", {
66
+ height: "24",
67
+ onError: d[0] || (d[0] = //@ts-ignore
68
+ (...v) => f(a) && f(a)(...v))
69
+ }, null, 40, S)) : p("", !0),
70
+ m.value ? (s(), r("span", {
61
71
  key: 1,
62
- class: r(d.value),
72
+ class: u(m.value),
63
73
  style: { "margin-right": "3px", "font-size": "20px" }
64
- }, null, 2)) : m("", !0),
65
- i("p", null, c(t.object.text), 1)
74
+ }, null, 2)) : p("", !0),
75
+ i("p", null, n(e.object.text), 1)
66
76
  ])
67
77
  ])
68
78
  ], 2));
69
79
  }
70
80
  });
71
81
  export {
72
- S as default
82
+ A as default
73
83
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FeedReplyQuote.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d0442c76"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-70906f41"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -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
  };