@mobilon-dev/chotto 0.3.58 → 0.3.60

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 +68 -56
  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
3
  import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-85a6ae46"]]);
4
+ const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-7014afaa"]]);
5
5
  export {
6
- p as default
6
+ e as default
7
7
  };
@@ -1,7 +1,7 @@
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";
2
- import q from "../FilePreview/FilePreview.vue.js";
3
- import { uploadFile as G } from "../../../hooks/uploadFile/uploadFile.js";
4
- import { useMessageDraft as J } from "../../../hooks/useMessageDraft.js";
1
+ import { defineComponent as O, ref as n, inject as P, computed as B, watchEffect as $, onMounted as H, onUnmounted as L, createElementBlock as _, openBlock as u, Fragment as R, createCommentVNode as b, createElementVNode as p, createBlock as V, normalizeClass as j, createVNode as T, unref as h, Teleport as q } from "vue";
2
+ import G from "../FilePreview/FilePreview.vue.js";
3
+ import { uploadFile as J } from "../../../hooks/uploadFile/uploadFile.js";
4
+ import { useMessageDraft as K } from "../../../hooks/useMessageDraft.js";
5
5
  import "../../../hooks/useSearchModel.js";
6
6
  import "../../../hooks/useTheme.js";
7
7
  /* empty css */
@@ -9,8 +9,14 @@ import "../../../hooks/useTheme.js";
9
9
  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
- import K from "./icons/FileUploaderIcon.vue.js";
13
- const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
12
+ import Q from "./icons/FileUploaderIcon.vue.js";
13
+ const W = {
14
+ key: 0,
15
+ class: "file-uploader__status file-uploader__status--uploading"
16
+ }, X = {
17
+ key: 1,
18
+ class: "file-uploader__status file-uploader__status--error"
19
+ }, Y = ["disabled"], ce = /* @__PURE__ */ O({
14
20
  __name: "FileUploader",
15
21
  props: {
16
22
  filebumpUrl: {
@@ -23,57 +29,62 @@ 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: Z }) {
33
+ const v = m, s = n(""), r = n(), f = n(), C = n();
34
+ C.value;
35
+ const i = P("chatAppId"), { setMessageFile: N, resetMessageFile: z, getMessage: I, setRecordingMessage: E } = K(i), c = n("#5F5F5F"), d = n("#404040"), g = n(!1);
36
+ let a = null;
29
37
  const y = () => {
30
38
  if (!i) {
31
- f.value = "#5F5F5F", c.value = "#404040";
39
+ c.value = "#5F5F5F", d.value = "#404040";
32
40
  return;
33
41
  }
34
42
  const l = document.getElementById(i);
35
43
  if (!l) {
36
- f.value = "#5F5F5F", c.value = "#404040";
44
+ c.value = "#5F5F5F", d.value = "#404040";
37
45
  return;
38
46
  }
39
47
  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);
42
- P(() => {
48
+ c.value = e || "#5F5F5F", d.value = o || "#404040";
49
+ }, A = B(() => g.value ? d.value : c.value);
50
+ $(() => {
43
51
  y();
44
52
  });
45
- const F = M(() => !C().file), E = () => {
53
+ const F = B(() => !I().file), w = () => {
54
+ r.value && (r.value.value = "");
55
+ }, k = () => {
46
56
  const l = document.getElementById("chat-input-file-line-" + i);
47
- l && (l.style.display = "none"), z(), p.value = void 0, r.value = "";
48
- }, N = async () => {
49
- var l, t;
50
- E(), (l = s.value) != null && l.files && U((t = s.value) == null ? void 0 : t.files[0]);
51
- }, D = () => {
52
- s.value && F && v.state == "active" && s.value.click();
53
- }, k = async (l) => {
57
+ l && (l.style.display = "none"), z(), f.value = void 0, s.value = "", w();
58
+ }, D = async () => {
59
+ var t, e;
60
+ const l = (e = (t = r.value) == null ? void 0 : t.files) == null ? void 0 : e[0];
61
+ k(), l && await M(l), w();
62
+ }, x = () => {
63
+ r.value && F.value && v.state == "active" && (w(), r.value.click());
64
+ }, U = async (l) => {
54
65
  var e;
55
66
  const t = (e = l.clipboardData) == null ? void 0 : e.items;
56
67
  if (t) {
57
68
  for (let o of t)
58
69
  if (o.type.indexOf("image") !== -1) {
59
70
  l.preventDefault();
60
- const _ = o.getAsFile();
61
- _ && U(_);
71
+ const S = o.getAsFile();
72
+ S && M(S);
62
73
  }
63
74
  }
64
- }, U = async (l) => {
65
- r.value = "uploading", I(!0);
75
+ }, M = async (l) => {
76
+ s.value = "uploading", E(!0);
66
77
  const t = typeof v.filebumpUrl == "string" ? v.filebumpUrl : null;
67
- await G(t, l).then((e) => {
68
- if (I(!1), r.value = e.status, e.status == "success") {
69
- V({
78
+ await J(t, l).then((e) => {
79
+ if (E(!1), s.value = e.status, e.status == "success") {
80
+ N({
70
81
  url: e.url,
71
82
  name: e.name,
72
83
  size: e.size,
73
84
  type: e.type
74
85
  });
75
86
  const o = document.getElementById("chat-input-file-line-" + i);
76
- o && (o.style.display = "inherit"), e.preview && (p.value = {
87
+ o && (o.style.display = "inherit"), e.preview && (f.value = {
77
88
  previewUrl: e.preview.previewUrl,
78
89
  isImage: e.preview.isImage,
79
90
  isVideo: e.preview.isVideo,
@@ -84,57 +95,58 @@ const Q = { key: 0 }, W = { key: 1 }, X = ["disabled"], fe = /* @__PURE__ */ x({
84
95
  }
85
96
  });
86
97
  };
87
- return $(() => {
88
- if (window.addEventListener("paste", k), y(), i) {
98
+ return H(() => {
99
+ if (window.addEventListener("paste", U), y(), i) {
89
100
  const l = document.getElementById(i);
90
- l && (u = new MutationObserver((t) => {
101
+ l && (a = new MutationObserver((t) => {
91
102
  t.forEach((e) => {
92
103
  e.type === "attributes" && e.attributeName === "data-theme" && y();
93
104
  });
94
- }), u.observe(l, {
105
+ }), a.observe(l, {
95
106
  attributes: !0,
96
107
  attributeFilter: ["data-theme"]
97
108
  }));
98
109
  }
99
- }), 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)
110
+ }), L(() => {
111
+ window.removeEventListener("paste", U), a && (a.disconnect(), a = null);
112
+ }), (l, t) => (u(), _(R, null, [
113
+ s.value === "uploading" ? (u(), _("div", W, [...t[2] || (t[2] = [
114
+ p("span", null, "Загрузка", -1),
115
+ p("span", null, "файла...", -1)
116
+ ])])) : s.value === "error" ? (u(), _("div", X, [...t[3] || (t[3] = [
117
+ p("span", null, "Ошибка при загрузке файла.", -1)
106
118
  ])])) : b("", !0),
107
- m("span", {
119
+ p("span", {
108
120
  ref_key: "triggerElement",
109
- ref: B,
110
- class: R(["file-uploader__trigger", { "file-uploader__disabled": !F.value || d.state == "disabled" }]),
111
- disabled: !F.value || d.state == "disabled",
112
- onClick: D,
121
+ ref: C,
122
+ class: j(["file-uploader__trigger", { "file-uploader__disabled": !F.value || m.state == "disabled" }]),
123
+ disabled: !F.value || m.state == "disabled",
124
+ onClick: x,
113
125
  onMouseenter: t[0] || (t[0] = (e) => g.value = !0),
114
126
  onMouseleave: t[1] || (t[1] = (e) => g.value = !1)
115
127
  }, [
116
- j(h(K), { fill: A.value }, null, 8, ["fill"])
117
- ], 42, X),
118
- m("input", {
128
+ T(h(Q), { fill: A.value }, null, 8, ["fill"])
129
+ ], 42, Y),
130
+ p("input", {
119
131
  ref_key: "fileInput",
120
- ref: s,
132
+ ref: r,
121
133
  style: { display: "none" },
122
134
  type: "file",
123
- onChange: N
135
+ onChange: D
124
136
  }, null, 544),
125
- h(C)().file ? (a(), S(T, {
137
+ h(I)().file ? (u(), V(q, {
126
138
  key: 2,
127
139
  to: "#chat-input-file-line-" + h(i)
128
140
  }, [
129
- p.value ? (a(), S(q, {
141
+ f.value ? (u(), V(G, {
130
142
  key: 0,
131
- "file-info": p.value,
132
- onReset: E
143
+ "file-info": f.value,
144
+ onReset: k
133
145
  }, null, 8, ["file-info"])) : b("", !0)
134
146
  ], 8, ["to"])) : b("", !0)
135
147
  ], 64));
136
148
  }
137
149
  });
138
150
  export {
139
- fe as default
151
+ ce as default
140
152
  };
@@ -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
  };