@mobilon-dev/chotto 0.3.58 → 0.3.59

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 (30) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +2 -2
  3. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +14 -13
  4. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +2 -2
  5. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +48 -41
  6. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +1 -1
  7. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +19 -16
  8. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +2 -2
  9. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +29 -27
  10. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
  11. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +21 -20
  12. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +3 -3
  13. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +15 -14
  14. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +2 -2
  15. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +8 -7
  16. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +2 -2
  17. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +11 -10
  18. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -4
  19. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +8 -7
  20. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +1 -1
  21. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +2 -1
  22. package/dist/components/2_modals/ModalFullscreen/ModalFullscreen.vue.js +41 -29
  23. package/dist/themes/dark.css +1 -1
  24. package/dist/themes/default.css +1 -1
  25. package/dist/themes/glass.css +1 -1
  26. package/dist/themes/green.css +1 -1
  27. package/dist/themes/mobilon1.css +1 -1
  28. package/dist/types/components/2_modals/ModalFullscreen/ModalFullscreen.vue.d.ts +2 -0
  29. package/dist/types/components/2_modals/ModalFullscreen/stories/ModalFullscreen.stories.d.ts +6 -0
  30. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import o from "./FilePreview.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4d0cb6d1"]]);
4
+ const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b83aa92d"]]);
5
5
  export {
6
- m as default
6
+ i as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as M, inject as P, ref as s, computed as I, onMounted as x, createElementBlock as n, openBlock as o, createElementVNode as i, createBlock as h, withDirectives as k, vShow as g, createCommentVNode as r, toDisplayString as f, Teleport as A, createVNode as L, Transition as U, withCtx as T, unref as N } from "vue";
1
+ import { defineComponent as M, inject as P, ref as s, computed as I, onMounted as x, createElementBlock as n, openBlock as o, createElementVNode as i, createBlock as h, withDirectives as k, vShow as g, createCommentVNode as r, toDisplayString as c, Teleport as A, createVNode as L, Transition as U, withCtx as T, unref as N } from "vue";
2
2
  import z from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
3
3
  import "../../../hooks/useMessageDraft.js";
4
4
  import "../../../hooks/useSearchModel.js";
@@ -20,7 +20,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
20
20
  }, Z = {
21
21
  key: 2,
22
22
  class: "preview__audio-time"
23
- }, ee = { class: "preview__reset" }, ie = ["src"], te = ["src"], fe = /* @__PURE__ */ M({
23
+ }, ee = { class: "preview__reset" }, ie = ["src"], te = ["src"], ce = /* @__PURE__ */ M({
24
24
  __name: "FilePreview",
25
25
  props: {
26
26
  fileInfo: {
@@ -35,8 +35,8 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
35
35
  e.value && (u.value ? e.value.pause() : e.value.play(), u.value = !u.value);
36
36
  }
37
37
  const w = (m) => {
38
- const l = Math.floor(m / 60), c = Math.floor(m % 60);
39
- return `${l.toString().padStart(2, "0")}:${c.toString().padStart(2, "0")}`;
38
+ const l = Math.floor(m / 60), f = Math.floor(m % 60);
39
+ return `${l.toString().padStart(2, "0")}:${f.toString().padStart(2, "0")}`;
40
40
  }, $ = I(() => e.value ? w(_.value) : "0:00"), y = I(() => e.value || a.value ? w(v.value) : "0:00");
41
41
  return x(() => {
42
42
  e.value != null && (e.value.addEventListener("loadedmetadata", () => {
@@ -55,7 +55,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
55
55
  t.fileInfo.isImage ? (o(), n("div", {
56
56
  key: 0,
57
57
  style: { position: "relative" },
58
- onClick: l[0] || (l[0] = (c) => d.value = !0)
58
+ onClick: l[0] || (l[0] = (f) => d.value = !0)
59
59
  }, [
60
60
  i("img", {
61
61
  src: t.fileInfo.previewUrl,
@@ -68,7 +68,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
68
68
  ])) : t.fileInfo.isVideo ? (o(), n("div", {
69
69
  key: 1,
70
70
  style: { position: "relative" },
71
- onClick: l[1] || (l[1] = (c) => d.value = !0)
71
+ onClick: l[1] || (l[1] = (f) => d.value = !0)
72
72
  }, [
73
73
  i("video", {
74
74
  ref_key: "video",
@@ -109,15 +109,15 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
109
109
  ]),
110
110
  i("div", Q, [
111
111
  i("div", R, [
112
- i("span", W, f(t.fileInfo.fileName), 1),
113
- !t.fileInfo.isAudio && !t.fileInfo.isVideo ? (o(), n("span", X, f(t.fileInfo.fileSize), 1)) : r("", !0),
114
- t.fileInfo.isAudio ? (o(), n("span", Y, f(`${$.value} / ${y.value}`), 1)) : r("", !0),
115
- t.fileInfo.isVideo ? (o(), n("span", Z, f(y.value), 1)) : r("", !0)
112
+ i("span", W, c(t.fileInfo.fileName), 1),
113
+ !t.fileInfo.isAudio && !t.fileInfo.isVideo ? (o(), n("span", X, c(t.fileInfo.fileSize), 1)) : r("", !0),
114
+ t.fileInfo.isAudio ? (o(), n("span", Y, c(`${$.value} / ${y.value}`), 1)) : r("", !0),
115
+ t.fileInfo.isVideo ? (o(), n("span", Z, c(y.value), 1)) : r("", !0)
116
116
  ]),
117
117
  i("div", ee, [
118
118
  i("span", {
119
119
  class: "pi pi-times",
120
- onClick: l[2] || (l[2] = (c) => E("reset"))
120
+ onClick: l[2] || (l[2] = (f) => E("reset"))
121
121
  })
122
122
  ])
123
123
  ]),
@@ -127,6 +127,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
127
127
  d.value ? (o(), h(z, {
128
128
  key: 0,
129
129
  theme: N(p)().theme ? N(p)().theme : "",
130
+ title: t.fileInfo.fileName,
130
131
  onClose: S
131
132
  }, {
132
133
  default: T(() => [
@@ -145,7 +146,7 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
145
146
  }, null, 8, te)) : r("", !0)
146
147
  ]),
147
148
  _: 1
148
- }, 8, ["theme"])) : r("", !0)
149
+ }, 8, ["theme", "title"])) : r("", !0)
149
150
  ]),
150
151
  _: 1
151
152
  })
@@ -154,5 +155,5 @@ const D = { class: "preview__container" }, j = { class: "preview__block" }, F =
154
155
  }
155
156
  });
156
157
  export {
157
- fe as default
158
+ ce as default
158
159
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FileUploader.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-85a6ae46"]]);
3
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-eeb89ab4"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as x, ref as n, inject as O, computed as M, watchEffect as P, onMounted as $, onUnmounted as H, createElementBlock as w, openBlock as a, Fragment as L, createCommentVNode as b, createElementVNode as m, createBlock as S, normalizeClass as R, createVNode as j, unref as h, Teleport as T } from "vue";
1
+ import { defineComponent as x, ref as n, inject as O, computed as M, watchEffect as P, onMounted as $, onUnmounted as H, createElementBlock as w, openBlock as u, Fragment as L, createCommentVNode as _, createElementVNode as p, createBlock as S, normalizeClass as R, createVNode as j, unref as b, Teleport as T } from "vue";
2
2
  import q from "../FilePreview/FilePreview.vue.js";
3
3
  import { uploadFile as G } from "../../../hooks/uploadFile/uploadFile.js";
4
4
  import { useMessageDraft as J } from "../../../hooks/useMessageDraft.js";
@@ -10,7 +10,13 @@ import "../../../node_modules/linkifyjs/dist/linkify.js";
10
10
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
11
11
  import "../../../functions/parseMarkdown.js";
12
12
  import K from "./icons/FileUploaderIcon.vue.js";
13
- const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
13
+ const Q = {
14
+ key: 0,
15
+ class: "file-uploader__status file-uploader__status--uploading"
16
+ }, W = {
17
+ key: 1,
18
+ class: "file-uploader__status file-uploader__status--error"
19
+ }, X = ["disabled"], fe = /* @__PURE__ */ x({
14
20
  __name: "FileUploader",
15
21
  props: {
16
22
  filebumpUrl: {
@@ -23,49 +29,49 @@ const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
23
29
  }
24
30
  },
25
31
  emits: ["fileUploaded"],
26
- setup(d, { emit: Y }) {
27
- const v = d, r = n(""), s = n(), p = n(), B = n(), i = O("chatAppId"), { setMessageFile: V, resetMessageFile: z, getMessage: C, setRecordingMessage: I } = J(i), f = n("#5F5F5F"), c = n("#404040"), g = n(!1);
28
- let u = null;
32
+ setup(m, { emit: Y }) {
33
+ const v = m, r = n(""), s = n(), f = n(), B = n(), i = O("chatAppId"), { setMessageFile: V, resetMessageFile: z, getMessage: h, setRecordingMessage: C } = J(i), c = n("#5F5F5F"), d = n("#404040"), g = n(!1);
34
+ let a = null;
29
35
  const y = () => {
30
36
  if (!i) {
31
- f.value = "#5F5F5F", c.value = "#404040";
37
+ c.value = "#5F5F5F", d.value = "#404040";
32
38
  return;
33
39
  }
34
40
  const l = document.getElementById(i);
35
41
  if (!l) {
36
- f.value = "#5F5F5F", c.value = "#404040";
42
+ c.value = "#5F5F5F", d.value = "#404040";
37
43
  return;
38
44
  }
39
45
  const t = window.getComputedStyle(l), e = t.getPropertyValue("--chotto-fileuploader-trigger-color").trim(), o = t.getPropertyValue("--chotto-fileuploader-trigger-hover-color").trim();
40
- f.value = e || "#5F5F5F", c.value = o || "#404040";
41
- }, A = M(() => g.value ? c.value : f.value);
46
+ c.value = e || "#5F5F5F", d.value = o || "#404040";
47
+ }, A = M(() => g.value ? d.value : c.value);
42
48
  P(() => {
43
49
  y();
44
50
  });
45
- const F = M(() => !C().file), E = () => {
51
+ const F = M(() => !h().file), I = () => {
46
52
  const l = document.getElementById("chat-input-file-line-" + i);
47
- l && (l.style.display = "none"), z(), p.value = void 0, r.value = "";
53
+ l && (l.style.display = "none"), z(), f.value = void 0, r.value = "";
48
54
  }, N = async () => {
49
55
  var l, t;
50
- E(), (l = s.value) != null && l.files && U((t = s.value) == null ? void 0 : t.files[0]);
56
+ I(), (l = s.value) != null && l.files && k((t = s.value) == null ? void 0 : t.files[0]);
51
57
  }, D = () => {
52
58
  s.value && F && v.state == "active" && s.value.click();
53
- }, k = async (l) => {
59
+ }, E = async (l) => {
54
60
  var e;
55
61
  const t = (e = l.clipboardData) == null ? void 0 : e.items;
56
62
  if (t) {
57
63
  for (let o of t)
58
64
  if (o.type.indexOf("image") !== -1) {
59
65
  l.preventDefault();
60
- const _ = o.getAsFile();
61
- _ && U(_);
66
+ const U = o.getAsFile();
67
+ U && k(U);
62
68
  }
63
69
  }
64
- }, U = async (l) => {
65
- r.value = "uploading", I(!0);
70
+ }, k = async (l) => {
71
+ r.value = "uploading", C(!0);
66
72
  const t = typeof v.filebumpUrl == "string" ? v.filebumpUrl : null;
67
73
  await G(t, l).then((e) => {
68
- if (I(!1), r.value = e.status, e.status == "success") {
74
+ if (C(!1), r.value = e.status, e.status == "success") {
69
75
  V({
70
76
  url: e.url,
71
77
  name: e.name,
@@ -73,7 +79,7 @@ const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
73
79
  type: e.type
74
80
  });
75
81
  const o = document.getElementById("chat-input-file-line-" + i);
76
- o && (o.style.display = "inherit"), e.preview && (p.value = {
82
+ o && (o.style.display = "inherit"), e.preview && (f.value = {
77
83
  previewUrl: e.preview.previewUrl,
78
84
  isImage: e.preview.isImage,
79
85
  isVideo: e.preview.isVideo,
@@ -85,53 +91,54 @@ const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
85
91
  });
86
92
  };
87
93
  return $(() => {
88
- if (window.addEventListener("paste", k), y(), i) {
94
+ if (window.addEventListener("paste", E), y(), i) {
89
95
  const l = document.getElementById(i);
90
- l && (u = new MutationObserver((t) => {
96
+ l && (a = new MutationObserver((t) => {
91
97
  t.forEach((e) => {
92
98
  e.type === "attributes" && e.attributeName === "data-theme" && y();
93
99
  });
94
- }), u.observe(l, {
100
+ }), a.observe(l, {
95
101
  attributes: !0,
96
102
  attributeFilter: ["data-theme"]
97
103
  }));
98
104
  }
99
105
  }), H(() => {
100
- window.removeEventListener("paste", k), u && (u.disconnect(), u = null);
101
- }), (l, t) => (a(), w(L, null, [
102
- r.value === "uploading" ? (a(), w("div", Q, [...t[2] || (t[2] = [
103
- m("p", null, "Загрузка файла...", -1)
104
- ])])) : r.value === "error" ? (a(), w("div", W, [...t[3] || (t[3] = [
105
- m("p", null, "Ошибка при загрузке файла.", -1)
106
- ])])) : b("", !0),
107
- m("span", {
106
+ window.removeEventListener("paste", E), a && (a.disconnect(), a = null);
107
+ }), (l, t) => (u(), w(L, null, [
108
+ r.value === "uploading" ? (u(), w("div", Q, [...t[2] || (t[2] = [
109
+ p("span", null, "Загрузка", -1),
110
+ p("span", null, "файла...", -1)
111
+ ])])) : r.value === "error" ? (u(), w("div", W, [...t[3] || (t[3] = [
112
+ p("span", null, "Ошибка при загрузке файла.", -1)
113
+ ])])) : _("", !0),
114
+ p("span", {
108
115
  ref_key: "triggerElement",
109
116
  ref: B,
110
- class: R(["file-uploader__trigger", { "file-uploader__disabled": !F.value || d.state == "disabled" }]),
111
- disabled: !F.value || d.state == "disabled",
117
+ class: R(["file-uploader__trigger", { "file-uploader__disabled": !F.value || m.state == "disabled" }]),
118
+ disabled: !F.value || m.state == "disabled",
112
119
  onClick: D,
113
120
  onMouseenter: t[0] || (t[0] = (e) => g.value = !0),
114
121
  onMouseleave: t[1] || (t[1] = (e) => g.value = !1)
115
122
  }, [
116
- j(h(K), { fill: A.value }, null, 8, ["fill"])
123
+ j(b(K), { fill: A.value }, null, 8, ["fill"])
117
124
  ], 42, X),
118
- m("input", {
125
+ p("input", {
119
126
  ref_key: "fileInput",
120
127
  ref: s,
121
128
  style: { display: "none" },
122
129
  type: "file",
123
130
  onChange: N
124
131
  }, null, 544),
125
- h(C)().file ? (a(), S(T, {
132
+ b(h)().file ? (u(), S(T, {
126
133
  key: 2,
127
- to: "#chat-input-file-line-" + h(i)
134
+ to: "#chat-input-file-line-" + b(i)
128
135
  }, [
129
- p.value ? (a(), S(q, {
136
+ f.value ? (u(), S(q, {
130
137
  key: 0,
131
- "file-info": p.value,
132
- onReset: E
133
- }, null, 8, ["file-info"])) : b("", !0)
134
- ], 8, ["to"])) : b("", !0)
138
+ "file-info": f.value,
139
+ onReset: I
140
+ }, null, 8, ["file-info"])) : _("", !0)
141
+ ], 8, ["to"])) : _("", !0)
135
142
  ], 64));
136
143
  }
137
144
  });
@@ -1,7 +1,7 @@
1
1
  import o from "./AudioRecorder.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-dd12b32c"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8d9aa63f"]]);
5
5
  export {
6
6
  e as default
7
7
  };
@@ -9,7 +9,10 @@ import "../../../node_modules/linkifyjs/dist/linkify.js";
9
9
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
10
10
  import "../../../functions/parseMarkdown.js";
11
11
  import G from "../../2_chatinput_elements/FilePreview/FilePreview.vue.js";
12
- const H = { class: "audio-recorder__container" }, J = { key: 0 }, K = {
12
+ const H = { class: "audio-recorder__container" }, J = {
13
+ key: 0,
14
+ class: "audio-recorder__status"
15
+ }, K = {
13
16
  key: 1,
14
17
  class: "audio-recorder__recording-container"
15
18
  }, Q = { class: "audio-recorder__recording-time" }, re = /* @__PURE__ */ D({
@@ -25,24 +28,24 @@ const H = { class: "audio-recorder__container" }, J = { key: 0 }, K = {
25
28
  }
26
29
  },
27
30
  setup(R) {
28
- const f = N("chatAppId"), { getMessage: n, setMessageFile: U, resetMessageFile: S, setRecordingMessage: k } = q(f), h = o(), t = o(0), r = o(0), u = o(0), d = o(0), z = T(() => {
29
- let l = d.value < 10 ? "0" + d.value : d.value, e = u.value < 10 ? "0" + u.value : u.value, i = r.value < 10 ? "0" + r.value : r.value, _ = t.value < 10 ? "00" + t.value : t.value < 100 ? "0" + t.value : t.value;
30
- return l + ":" + e + ":" + i + ":" + _;
31
- }), v = o(""), g = o(!1), s = o(), b = o([]), A = o(), p = o(), C = R, B = async () => {
31
+ const f = N("chatAppId"), { getMessage: n, setMessageFile: U, resetMessageFile: S, setRecordingMessage: k } = q(f), h = o(), l = o(0), r = o(0), s = o(0), d = o(0), z = T(() => {
32
+ let t = d.value < 10 ? "0" + d.value : d.value, e = s.value < 10 ? "0" + s.value : s.value, i = r.value < 10 ? "0" + r.value : r.value, _ = l.value < 10 ? "00" + l.value : l.value < 100 ? "0" + l.value : l.value;
33
+ return t + ":" + e + ":" + i + ":" + _;
34
+ }), v = o(""), g = o(!1), u = o(), b = o([]), A = o(), p = o(), C = R, B = async () => {
32
35
  if (!n().file && C.state == "active") {
33
- const l = await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 });
36
+ const t = await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 });
34
37
  h.value = setInterval(() => {
35
- t.value += 10, t.value == 1e3 && (t.value = 0, r.value++, r.value == 60 && (r.value = 0, u.value++, u.value == 60 && (u.value = 0, d.value++)));
36
- }, 10), k(!0), g.value = !0, s.value = new MediaRecorder(l), s.value.start(), s.value.ondataavailable = (e) => {
38
+ l.value += 10, l.value == 1e3 && (l.value = 0, r.value++, r.value == 60 && (r.value = 0, s.value++, s.value == 60 && (s.value = 0, d.value++)));
39
+ }, 10), k(!0), g.value = !0, u.value = new MediaRecorder(t), u.value.start(), u.value.ondataavailable = (e) => {
37
40
  b.value.push(e.data);
38
41
  };
39
42
  }
40
43
  }, F = () => {
41
44
  I(), A.value = void 0;
42
45
  }, E = () => {
43
- s.value && (s.value.stop(), s.value.onstop = async () => {
44
- const l = new File(b.value, "voicemessage.mp3", { type: "audio/*" }), e = URL.createObjectURL(l);
45
- A.value = e, v.value = "uploading", await O(C.filebumpUrl, l).then((i) => {
46
+ u.value && (u.value.stop(), u.value.onstop = async () => {
47
+ const t = new File(b.value, "voicemessage.mp3", { type: "audio/*" }), e = URL.createObjectURL(t);
48
+ A.value = e, v.value = "uploading", await O(C.filebumpUrl, t).then((i) => {
46
49
  if (v.value = i.status, i.status == "success") {
47
50
  const _ = document.getElementById("chat-input-file-line-" + f);
48
51
  _ && (_.style.display = "inherit"), U({
@@ -62,19 +65,19 @@ const H = { class: "audio-recorder__container" }, J = { key: 0 }, K = {
62
65
  });
63
66
  }), I();
64
67
  }, I = () => {
65
- clearInterval(h.value), t.value = 0, r.value = 0, u.value = 0, d.value = 0, k(!1), g.value = !1, s.value = void 0, b.value = [];
68
+ clearInterval(h.value), l.value = 0, r.value = 0, s.value = 0, d.value = 0, k(!1), g.value = !1, u.value = void 0, b.value = [];
66
69
  }, V = () => {
67
- const l = document.getElementById("chat-input-file-line-" + f);
68
- l && (l.style.display = "none"), S(), p.value = void 0;
70
+ const t = document.getElementById("chat-input-file-line-" + f);
71
+ t && (t.style.display = "none"), S(), p.value = void 0;
69
72
  };
70
73
  return j(
71
74
  () => n().file,
72
75
  () => {
73
76
  n().file || (p.value = void 0);
74
77
  }
75
- ), (l, e) => (c(), y("div", H, [
78
+ ), (t, e) => (c(), y("div", H, [
76
79
  v.value === "uploading" ? (c(), y("div", J, [...e[0] || (e[0] = [
77
- a("p", null, "Загрузка файла...", -1)
80
+ a("span", null, "Загрузка файла...", -1)
78
81
  ])])) : m("", !0),
79
82
  g.value && v.value != "uploading" ? (c(), y("div", K, [
80
83
  e[3] || (e[3] = a("span", { class: "audio-recorder__recording-icon pi pi-circle-fill" }, null, -1)),
@@ -1,7 +1,7 @@
1
1
  import o from "./VideoRecorder.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-93c4aad3"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9cc78254"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as F, inject as R, ref as g, watch as V, createElementBlock as d, openBlock as o, Fragment as C, createCommentVNode as s, createBlock as y, unref as p, normalizeClass as I, createElementVNode as w, Teleport as M } from "vue";
1
+ import { defineComponent as F, inject as R, ref as y, watch as V, createElementBlock as d, openBlock as o, Fragment as C, createCommentVNode as n, createBlock as w, unref as p, normalizeClass as I, createElementVNode as c, Teleport as M } from "vue";
2
2
  import { uploadFile as z } from "../../../hooks/uploadFile/uploadFile.js";
3
3
  import { useMessageDraft as A } from "../../../hooks/useMessageDraft.js";
4
4
  import "../../../hooks/useSearchModel.js";
@@ -28,21 +28,21 @@ const U = {
28
28
  default: null
29
29
  }
30
30
  },
31
- setup(c) {
32
- const r = R("chatAppId"), { getMessage: t, setMessageFile: h, setRecordingMessage: m, resetMessageFile: _ } = A(r), { getTheme: u } = B(r), a = g(""), l = g(), f = c, k = async () => {
33
- if (!t().file && f.state == "active") {
34
- const n = u().theme ? u().theme : "";
35
- await S(n).then(async (i) => {
36
- i.videoFile && (a.value = "uploading", m(!0), await z(f.filebumpUrl, i.videoFile).then((e) => {
37
- if (m(!1), a.value = e.status, e.status == "success") {
38
- h({
31
+ setup(m) {
32
+ const r = R("chatAppId"), { getMessage: t, setMessageFile: _, setRecordingMessage: u, resetMessageFile: h } = A(r), { getTheme: f } = B(r), a = y(""), s = y(), v = m, k = async () => {
33
+ if (!t().file && v.state == "active") {
34
+ const l = f().theme ? f().theme : "";
35
+ await S(l).then(async (i) => {
36
+ i.videoFile && (a.value = "uploading", u(!0), await z(v.filebumpUrl, i.videoFile).then((e) => {
37
+ if (u(!1), a.value = e.status, e.status == "success") {
38
+ _({
39
39
  url: e.url,
40
40
  name: e.name,
41
41
  size: e.size,
42
42
  type: e.type
43
43
  });
44
- const v = document.getElementById("chat-input-file-line-" + r);
45
- v && (v.style.display = "inherit"), e.preview && (l.value = {
44
+ const g = document.getElementById("chat-input-file-line-" + r);
45
+ g && (g.style.display = "inherit"), e.preview && (s.value = {
46
46
  previewUrl: e.preview.previewUrl,
47
47
  isImage: e.preview.isImage,
48
48
  isVideo: e.preview.isVideo,
@@ -55,38 +55,40 @@ const U = {
55
55
  });
56
56
  }
57
57
  }, b = () => {
58
- _();
59
- const n = document.getElementById("chat-input-file-line-" + r);
60
- n && (n.style.display = "none"), l.value = void 0;
58
+ h();
59
+ const l = document.getElementById("chat-input-file-line-" + r);
60
+ l && (l.style.display = "none"), s.value = void 0;
61
61
  };
62
62
  return V(
63
63
  () => t().file,
64
64
  () => {
65
- t().file || (l.value = void 0);
65
+ t().file || (s.value = void 0);
66
66
  }
67
- ), (n, i) => (o(), d(C, null, [
68
- p(t)().isRecording ? s("", !0) : (o(), d("div", U, [
67
+ ), (l, i) => (o(), d(C, null, [
68
+ p(t)().isRecording ? n("", !0) : (o(), d("div", U, [
69
69
  a.value != "uploading" ? (o(), d("button", {
70
70
  key: 0,
71
- class: I(["video-recorder__button", { "video-recorder__button-disabled": c.state == "disabled" || p(t)().file }]),
71
+ class: I(["video-recorder__button", { "video-recorder__button-disabled": m.state == "disabled" || p(t)().file }]),
72
72
  onClick: k
73
73
  }, [...i[0] || (i[0] = [
74
- w("span", { class: "pi pi-video" }, null, -1)
75
- ])], 2)) : s("", !0)
74
+ c("span", { class: "pi pi-video" }, null, -1)
75
+ ])], 2)) : n("", !0)
76
76
  ])),
77
77
  a.value === "uploading" ? (o(), d("div", N, [...i[1] || (i[1] = [
78
- w("p", null, "Загрузка файла...", -1)
79
- ])])) : s("", !0),
80
- p(t)().file ? (o(), y(M, {
78
+ c("div", { class: "video-recorder__status" }, [
79
+ c("span", null, "Загрузка файла...")
80
+ ], -1)
81
+ ])])) : n("", !0),
82
+ p(t)().file ? (o(), w(M, {
81
83
  key: 2,
82
84
  to: "#chat-input-file-line-" + p(r)
83
85
  }, [
84
- l.value ? (o(), y(E, {
86
+ s.value ? (o(), w(E, {
85
87
  key: 0,
86
- "file-info": l.value,
88
+ "file-info": s.value,
87
89
  onReset: b
88
- }, null, 8, ["file-info"])) : s("", !0)
89
- ], 8, ["to"])) : s("", !0)
90
+ }, null, 8, ["file-info"])) : n("", !0)
91
+ ], 8, ["to"])) : n("", !0)
90
92
  ], 64));
91
93
  }
92
94
  });
@@ -1,7 +1,7 @@
1
1
  import o from "./ImageMessage.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b76d8f98"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-435c558d"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as de, inject as fe, ref as f, watch as N, nextTick as A, onMounted as ve, onUnmounted as be, computed as k, createElementBlock as g, openBlock as i, normalizeStyle as U, normalizeClass as v, unref as a, createCommentVNode as n, createElementVNode as l, createBlock as b, createVNode as r, withCtx as d, createTextVNode as he, toDisplayString as L, Transition as x, withModifiers as D, Teleport as ye } from "vue";
1
+ import { defineComponent as de, inject as fe, ref as f, watch as N, nextTick as A, onMounted as ve, onUnmounted as be, computed as k, createElementBlock as u, openBlock as i, normalizeStyle as U, normalizeClass as v, unref as a, createCommentVNode as n, createElementVNode as l, createBlock as b, createVNode as r, withCtx as d, createTextVNode as he, toDisplayString as L, Transition as x, withModifiers as D, Teleport as ye } from "vue";
2
2
  import we from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
3
3
  import pe from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
4
4
  import ke from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
@@ -70,32 +70,32 @@ const Ve = ["messageId"], He = ["src"], We = {
70
70
  clickAction: Q,
71
71
  viewsAction: B,
72
72
  handleClickReplied: X
73
- } = Ie(s.message, C), R = f(!1), { linkedHtml: O, inNewWindow: z } = je(() => s.message.text), c = f(null), u = f(null), h = f(0), I = f(0);
73
+ } = Ie(s.message, C), R = f(!1), { linkedHtml: O, inNewWindow: z } = je(() => s.message.text), c = f(null), g = f(null), h = f(0), I = f(0);
74
74
  N(
75
75
  () => O.value,
76
76
  () => {
77
77
  y(), A(() => {
78
- o && u.value && o.observe(u.value);
78
+ o && g.value && o.observe(g.value);
79
79
  });
80
80
  }
81
81
  );
82
82
  const y = () => {
83
83
  A(() => {
84
- c.value && (h.value = c.value.offsetWidth), u.value && (I.value = u.value.offsetWidth);
84
+ c.value && (h.value = c.value.offsetWidth), g.value && (I.value = g.value.offsetWidth);
85
85
  });
86
86
  };
87
87
  let o = null, M = null;
88
88
  ve(() => {
89
89
  y(), M = () => y(), window.addEventListener("resize", M), typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
90
90
  y();
91
- }), c.value && o.observe(c.value), u.value && o.observe(u.value));
91
+ }), c.value && o.observe(c.value), g.value && o.observe(g.value));
92
92
  }), be(() => {
93
93
  M && window.removeEventListener("resize", M), o && o.disconnect();
94
94
  }), N(
95
95
  () => [s.message.text, s.message.url],
96
96
  () => {
97
97
  y(), A(() => {
98
- o && (o.disconnect(), c.value && o.observe(c.value), u.value && o.observe(u.value));
98
+ o && (o.disconnect(), c.value && o.observe(c.value), g.value && o.observe(g.value));
99
99
  });
100
100
  },
101
101
  { immediate: !0 }
@@ -119,7 +119,7 @@ const Ve = ["messageId"], He = ["src"], We = {
119
119
  headers: {
120
120
  Accept: "image/*"
121
121
  }
122
- }), ue = m.headers.get("content-type") || "", ge = await m.blob(), j = ((t = (w = s.message.url.split(".").pop()) == null ? void 0 : w.split("?")[0]) == null ? void 0 : t.toLowerCase()) || "", re = {
122
+ }), ge = m.headers.get("content-type") || "", ue = await m.blob(), j = ((t = (w = s.message.url.split(".").pop()) == null ? void 0 : w.split("?")[0]) == null ? void 0 : t.toLowerCase()) || "", re = {
123
123
  "image/jpeg": "jpg",
124
124
  "image/jpg": "jpg",
125
125
  "image/png": "png",
@@ -128,8 +128,8 @@ const Ve = ["messageId"], He = ["src"], We = {
128
128
  "image/svg+xml": "svg",
129
129
  "image/bmp": "bmp"
130
130
  };
131
- let W = j && ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp"].includes(j) ? j : re[ue] || "jpg";
132
- const ce = s.message.alt ? s.message.alt.includes(".") ? s.message.alt : `${s.message.alt}.${W}` : `image-${s.message.messageId}.${W}`, $ = window.URL.createObjectURL(ge), p = document.createElement("a");
131
+ let W = j && ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp"].includes(j) ? j : re[ge] || "jpg";
132
+ const ce = s.message.alt ? s.message.alt.includes(".") ? s.message.alt : `${s.message.alt}.${W}` : `image-${s.message.messageId}.${W}`, $ = window.URL.createObjectURL(ue), p = document.createElement("a");
133
133
  p.href = $, p.download = ce, document.body.appendChild(p), p.click(), document.body.removeChild(p), window.URL.revokeObjectURL($);
134
134
  } catch (m) {
135
135
  console.error("Ошибка при скачивании изображения:", m);
@@ -138,7 +138,7 @@ const Ve = ["messageId"], He = ["src"], We = {
138
138
  function me() {
139
139
  C("sms-invite", s.message);
140
140
  }
141
- return (w, t) => (i(), g("div", {
141
+ return (w, t) => (i(), u("div", {
142
142
  class: v(["image-message", [
143
143
  H(e.message),
144
144
  e.applyStyle(e.message)
@@ -147,14 +147,14 @@ const Ve = ["messageId"], He = ["src"], We = {
147
147
  style: U(a(se)),
148
148
  onMouseleave: V
149
149
  }, [
150
- e.message.avatar && e.isFirstInSeries ? (i(), g("img", {
150
+ e.message.avatar && e.isFirstInSeries ? (i(), u("img", {
151
151
  key: 0,
152
152
  class: "image-message__avatar",
153
153
  src: e.message.avatar,
154
154
  height: "32",
155
155
  width: "32"
156
156
  }, null, 8, He)) : n("", !0),
157
- e.message.subText && e.isFirstInSeries ? (i(), g("p", We, [
157
+ e.message.subText && e.isFirstInSeries ? (i(), u("p", We, [
158
158
  r(Se, {
159
159
  text: a(oe),
160
160
  position: e.message.position === "left" ? "right" : "left",
@@ -182,7 +182,7 @@ const Ve = ["messageId"], He = ["src"], We = {
182
182
  onMouseenter: Y,
183
183
  onMouseleave: V
184
184
  }, [
185
- F.value ? (i(), g("div", $e, [
185
+ F.value ? (i(), u("div", $e, [
186
186
  l("img", {
187
187
  class: "image-message__blur-left",
188
188
  src: e.message.url,
@@ -204,8 +204,8 @@ const Ve = ["messageId"], He = ["src"], We = {
204
204
  }, null, 12, De),
205
205
  r(x, { name: "modal-fade" }, {
206
206
  default: d(() => [
207
- R.value ? (i(), g("div", Pe, [
208
- e.message.views ? (i(), g("div", {
207
+ R.value ? (i(), u("div", Pe, [
208
+ e.message.views ? (i(), u("div", {
209
209
  key: 0,
210
210
  class: "image-message__views",
211
211
  onClick: t[0] || (t[0] = D(
@@ -231,7 +231,7 @@ const Ve = ["messageId"], He = ["src"], We = {
231
231
  }),
232
232
  r(x, { name: "modal-fade" }, {
233
233
  default: d(() => [
234
- R.value ? (i(), g("button", {
234
+ R.value ? (i(), u("button", {
235
235
  key: 0,
236
236
  class: "image-message__download-button",
237
237
  onClick: D(ae, ["stop"])
@@ -244,7 +244,7 @@ const Ve = ["messageId"], He = ["src"], We = {
244
244
  ], 34),
245
245
  r(x, { name: "modal-fade" }, {
246
246
  default: d(() => [
247
- a(G) && e.message.actions ? (i(), g("button", {
247
+ a(G) && e.message.actions ? (i(), u("button", {
248
248
  key: 0,
249
249
  class: "image-message__menu-button",
250
250
  onClick: t[2] || (t[2] = (m) => S.value = !a(S))
@@ -265,10 +265,10 @@ const Ve = ["messageId"], He = ["src"], We = {
265
265
  ]),
266
266
  _: 1
267
267
  }),
268
- e.message.text ? (i(), g("div", {
268
+ e.message.text ? (i(), u("div", {
269
269
  key: 1,
270
270
  ref_key: "textRef",
271
- ref: u,
271
+ ref: g,
272
272
  class: "image-message__text-container"
273
273
  }, [
274
274
  l("p", {
@@ -308,6 +308,7 @@ const Ve = ["messageId"], He = ["src"], We = {
308
308
  T.value ? (i(), b(Re, {
309
309
  key: 0,
310
310
  "data-theme": a(E)().theme ? a(E)().theme : "light",
311
+ title: e.message.alt,
311
312
  onClose: te
312
313
  }, {
313
314
  default: d(() => [
@@ -318,7 +319,7 @@ const Ve = ["messageId"], He = ["src"], We = {
318
319
  }, null, 8, Je)
319
320
  ]),
320
321
  _: 1
321
- }, 8, ["data-theme"])) : n("", !0)
322
+ }, 8, ["data-theme", "title"])) : n("", !0)
322
323
  ]),
323
324
  _: 1
324
325
  })