@mobilon-dev/chotto 0.3.61 → 0.3.63

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.
@@ -1,7 +1,7 @@
1
1
  import e from "./ReplyStickerMessage.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ o(e, [["__scopeId", "data-v-7fc2ae60"]]);
4
+ const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-292e0810"]]);
5
5
  export {
6
- p as default
6
+ s as default
7
7
  };
@@ -1,16 +1,16 @@
1
- import { defineComponent as T, inject as b, ref as n, watch as k, computed as L, onMounted as M, createElementBlock as a, openBlock as t, Fragment as C, createElementVNode as r, createBlock as v, createCommentVNode as d, toDisplayString as S, Teleport as A, createVNode as F, Transition as N, withCtx as h, unref as y } from "vue";
2
- import B from "../../../node_modules/linkify-string/dist/linkify-string.js";
3
- import V from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
1
+ import { defineComponent as M, inject as S, ref as m, watch as g, computed as w, onMounted as F, createElementBlock as l, openBlock as t, Fragment as A, createElementVNode as u, createBlock as _, createCommentVNode as p, toDisplayString as E, Teleport as I, createVNode as N, Transition as V, withCtx as L, unref as T } from "vue";
2
+ import $ from "../../../node_modules/linkify-string/dist/linkify-string.js";
3
+ import j from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
4
4
  import "../../../hooks/useMessageDraft.js";
5
5
  import "../../../hooks/useSearchModel.js";
6
- import { useTheme as j } from "../../../hooks/useTheme.js";
6
+ import { useTheme as B } from "../../../hooks/useTheme.js";
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  import "../../../node_modules/linkifyjs/dist/linkify.js";
10
10
  import "../../../functions/parseMarkdown.js";
11
11
  import { isAnimatedSticker as D } from "../StickerMessage/utils/stickerUtils.js";
12
12
  import "../StickerMessage/utils/suppress-lit-warning.js";
13
- const E = ["src"], H = ["src", "alt"], I = { class: "sticker-message__text-container" }, O = { key: 0 }, q = ["innerHTML"], G = ["src"], R = ["src", "alt"], se = /* @__PURE__ */ T({
13
+ const H = ["src"], O = ["src"], q = ["src", "alt"], G = { class: "sticker-message__text-container" }, R = { key: 0 }, W = ["innerHTML"], z = ["src"], J = ["src"], K = ["src", "alt"], re = /* @__PURE__ */ M({
14
14
  __name: "ReplyStickerMessage",
15
15
  props: {
16
16
  message: {
@@ -19,12 +19,12 @@ const E = ["src"], H = ["src", "alt"], I = { class: "sticker-message__text-conta
19
19
  }
20
20
  },
21
21
  setup(e) {
22
- const _ = b("chatAppId"), { getTheme: g } = j(_), l = n(!1), c = n(!1);
23
- async function p() {
24
- if (!(l.value || c.value)) {
22
+ const b = S("chatAppId"), { getTheme: v } = B(b), r = m(!1), c = m(!1);
23
+ async function f() {
24
+ if (!(r.value || c.value)) {
25
25
  c.value = !0;
26
26
  try {
27
- await import("../StickerMessage/libs/tgs-player/lottie-player.esm.js"), await import("../StickerMessage/libs/tgs-player/tgs-player.esm.js"), l.value = !0;
27
+ await import("../StickerMessage/libs/tgs-player/lottie-player.esm.js"), await import("../StickerMessage/libs/tgs-player/tgs-player.esm.js"), r.value = !0;
28
28
  } catch (s) {
29
29
  console.error("Failed to load TGS libraries:", s);
30
30
  } finally {
@@ -32,82 +32,112 @@ const E = ["src"], H = ["src", "alt"], I = { class: "sticker-message__text-conta
32
32
  }
33
33
  }
34
34
  }
35
- const i = e, u = n(!1), f = n("");
36
- k(
35
+ const i = e, d = m(!1), k = m("");
36
+ g(
37
37
  () => i.message.text,
38
38
  () => {
39
- i.message.text && (f.value = B(i.message.text));
39
+ i.message.text && (k.value = $(i.message.text));
40
40
  },
41
41
  { immediate: !0 }
42
42
  );
43
- const o = L(() => D(i.message.url, i.message.isAnimated));
44
- k(o, (s) => {
45
- s && !l.value && p();
46
- }, { immediate: !0 }), M(() => {
47
- o.value && !l.value && p();
43
+ const o = w(() => D(i.message.url, i.message.isAnimated)), n = m(!1), y = w(() => {
44
+ if (o.value) return !1;
45
+ const s = String(i.message.url || "").toLowerCase();
46
+ return !/\.(webp|png|jpe?g|gif|bmp|svg)(\?|#|$)/.test(s);
48
47
  });
49
- function w(s) {
48
+ g(
49
+ () => i.message.url,
50
+ () => {
51
+ n.value = !1;
52
+ },
53
+ { immediate: !0 }
54
+ ), g(o, (s) => {
55
+ s && !r.value && f();
56
+ }, { immediate: !0 }), F(() => {
57
+ o.value && !r.value && f();
58
+ });
59
+ function x(s) {
50
60
  s.preventDefault(), s.target.href && window.open(s.target.href, "_blank");
51
61
  }
52
- const x = () => u.value = !1;
53
- return (s, m) => (t(), a(C, null, [
54
- r("div", {
62
+ const C = () => d.value = !1;
63
+ return (s, a) => (t(), l(A, null, [
64
+ u("div", {
55
65
  class: "sticker-message__preview-button",
56
- onClick: m[0] || (m[0] = (W) => u.value = !0)
66
+ onClick: a[1] || (a[1] = (h) => d.value = !0)
57
67
  }, [
58
- o.value && l.value ? (t(), a("tgs-player", {
68
+ o.value && r.value ? (t(), l("tgs-player", {
59
69
  key: 0,
60
70
  class: "sticker-message__preview-image-animated",
61
71
  src: e.message.url,
62
72
  autoplay: "",
63
73
  loop: "",
64
74
  mode: "normal"
65
- }, null, 8, E)) : (t(), a("img", {
75
+ }, null, 8, H)) : y.value && !n.value ? (t(), l("video", {
66
76
  key: 1,
67
77
  class: "sticker-message__preview-image",
68
78
  src: e.message.url,
79
+ autoplay: "",
80
+ loop: "",
81
+ muted: "",
82
+ playsinline: "",
83
+ preload: "metadata",
84
+ onError: a[0] || (a[0] = (h) => n.value = !0)
85
+ }, null, 40, O)) : (t(), l("img", {
86
+ key: 2,
87
+ class: "sticker-message__preview-image",
88
+ src: e.message.url,
69
89
  alt: e.message.alt
70
- }, null, 8, H))
90
+ }, null, 8, q))
71
91
  ]),
72
- r("div", I, [
73
- e.message.header ? (t(), a("p", O, S(e.message.header), 1)) : d("", !0),
74
- m[1] || (m[1] = r("div", { class: "sticker-message__reply-description" }, [
75
- r("span", { class: "pi pi-image" }),
76
- r("p", null, "Стикер")
92
+ u("div", G, [
93
+ e.message.header ? (t(), l("p", R, E(e.message.header), 1)) : p("", !0),
94
+ a[3] || (a[3] = u("div", { class: "sticker-message__reply-description" }, [
95
+ u("span", { class: "pi pi-image" }),
96
+ u("p", null, "Стикер")
77
97
  ], -1)),
78
- e.message.text ? (t(), a("p", {
98
+ e.message.text ? (t(), l("p", {
79
99
  key: 1,
80
100
  class: "sticker-message__text",
81
- onClick: w,
82
- innerHTML: f.value
83
- }, null, 8, q)) : d("", !0)
101
+ onClick: x,
102
+ innerHTML: k.value
103
+ }, null, 8, W)) : p("", !0)
84
104
  ]),
85
- (t(), v(A, { to: "body" }, [
86
- F(N, { name: "modal-fade" }, {
87
- default: h(() => [
88
- u.value ? (t(), v(V, {
105
+ (t(), _(I, { to: "body" }, [
106
+ N(V, { name: "modal-fade" }, {
107
+ default: L(() => [
108
+ d.value ? (t(), _(j, {
89
109
  key: 0,
90
- "data-theme": y(g)().theme ? y(g)().theme : "light",
110
+ "data-theme": T(v)().theme ? T(v)().theme : "light",
91
111
  title: e.message.alt,
92
- onClose: x
112
+ onClose: C
93
113
  }, {
94
- default: h(() => [
95
- o.value && l.value ? (t(), a("tgs-player", {
114
+ default: L(() => [
115
+ o.value && r.value ? (t(), l("tgs-player", {
96
116
  key: 0,
97
117
  class: "sticker-message__modal-image-animated",
98
118
  src: e.message.url,
99
119
  autoplay: "",
100
120
  loop: "",
101
121
  mode: "normal"
102
- }, null, 8, G)) : (t(), a("img", {
122
+ }, null, 8, z)) : y.value && !n.value ? (t(), l("video", {
103
123
  key: 1,
104
124
  class: "sticker-message__modal-image",
105
125
  src: e.message.url,
126
+ autoplay: "",
127
+ loop: "",
128
+ muted: "",
129
+ playsinline: "",
130
+ preload: "metadata",
131
+ onError: a[2] || (a[2] = (h) => n.value = !0)
132
+ }, null, 40, J)) : (t(), l("img", {
133
+ key: 2,
134
+ class: "sticker-message__modal-image",
135
+ src: e.message.url,
106
136
  alt: e.message.alt
107
- }, null, 8, R))
137
+ }, null, 8, K))
108
138
  ]),
109
139
  _: 1
110
- }, 8, ["data-theme", "title"])) : d("", !0)
140
+ }, 8, ["data-theme", "title"])) : p("", !0)
111
141
  ]),
112
142
  _: 1
113
143
  })
@@ -116,5 +146,5 @@ const E = ["src"], H = ["src", "alt"], I = { class: "sticker-message__text-conta
116
146
  }
117
147
  });
118
148
  export {
119
- se as default
149
+ re as default
120
150
  };
@@ -1,7 +1,7 @@
1
- import e from "./StickerMessage.vue2.js";
1
+ import o from "./StickerMessage.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-031e69e9"]]);
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cd90490f"]]);
5
5
  export {
6
6
  a as default
7
7
  };