@mobilon-dev/chotto 0.3.57 → 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 (35) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +1 -1
  3. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +41 -39
  4. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +2 -2
  5. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +14 -13
  6. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +2 -2
  7. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +48 -41
  8. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +1 -1
  9. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +19 -16
  10. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +2 -2
  11. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +29 -27
  12. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +2 -2
  13. package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +11 -11
  14. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
  15. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +21 -20
  16. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +3 -3
  17. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +15 -14
  18. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +2 -2
  19. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +8 -7
  20. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +2 -2
  21. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +11 -10
  22. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -4
  23. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +8 -7
  24. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +1 -1
  25. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +2 -1
  26. package/dist/components/2_modals/ModalFullscreen/ModalFullscreen.vue.js +41 -29
  27. package/dist/themes/dark.css +1 -1
  28. package/dist/themes/default.css +1 -1
  29. package/dist/themes/glass.css +1 -1
  30. package/dist/themes/green.css +1 -1
  31. package/dist/themes/mobilon1.css +1 -1
  32. package/dist/types/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +2 -2
  33. package/dist/types/components/2_modals/ModalFullscreen/ModalFullscreen.vue.d.ts +2 -0
  34. package/dist/types/components/2_modals/ModalFullscreen/stories/ModalFullscreen.stories.d.ts +6 -0
  35. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import o from "./Tooltip.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-595f9104"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a2bb5769"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as k, inject as N, ref as u, computed as A, onUnmounted as D, createElementBlock as T, openBlock as m, Fragment as R, createElementVNode as V, createBlock as E, renderSlot as I, Teleport as L, createVNode as M, Transition as $, withCtx as j, createCommentVNode as q, normalizeClass as z, unref as v, toDisplayString as F, nextTick as g } from "vue";
1
+ import { defineComponent as k, inject as N, ref as n, computed as A, onUnmounted as D, createElementBlock as T, openBlock as s, Fragment as R, createElementVNode as V, createBlock as E, renderSlot as I, Teleport as L, createVNode as M, Transition as $, withCtx as j, createCommentVNode as q, normalizeClass as z, unref as g, toDisplayString as F, nextTick as v } from "vue";
2
2
  import "../../../hooks/useMessageDraft.js";
3
3
  import "../../../hooks/useSearchModel.js";
4
4
  import { useTheme as P } from "../../../hooks/useTheme.js";
@@ -36,72 +36,74 @@ const U = ["data-theme"], Z = /* @__PURE__ */ k({
36
36
  }
37
37
  },
38
38
  setup(w, { expose: d }) {
39
- const x = N("chatAppId"), { getTheme: y } = P(x), p = u(), a = u(), c = u(!1), h = u(null), r = u(null), e = w, _ = A(() => ({
39
+ const x = N("chatAppId"), { getTheme: y } = P(x), a = n(), p = n(), c = n(!1), u = n(null), r = n(null), o = w, _ = A(() => ({
40
40
  tooltip__text: !0,
41
- [`tooltip--${e.position}`]: !0
41
+ [`tooltip--${o.position}`]: !0
42
42
  })), B = () => {
43
- e.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), r.value = setTimeout(() => {
44
- c.value = !0, g(() => {
45
- if (p.value && a.value) {
46
- const f = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), l = o.left < 0 ? o.left : 0, i = o.top < 0 ? o.top : 0, n = {
47
- left: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - o.width - l - e.offset },
48
- right: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + e.offset },
49
- bottom: { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) - l },
50
- "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - o.width / 2 - l },
51
- top: { top: t.top - o.height - e.offset - i, left: (t == null ? void 0 : t.left) - l },
52
- "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - l }
43
+ o.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), r.value = setTimeout(() => {
44
+ c.value = !0, v(() => {
45
+ if (a.value && p.value) {
46
+ const f = p.value, t = a.value.getBoundingClientRect(), e = p.value.getBoundingClientRect(), l = e.left < 0 ? e.left : 0, i = e.top < 0 ? e.top : 0, h = {
47
+ left: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - e.width - l - o.offset },
48
+ right: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + o.offset },
49
+ bottom: { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) - l },
50
+ "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
51
+ top: { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) - l },
52
+ "top-center": { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
53
+ "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width - e.width - l }
53
54
  };
54
- f.style.top = n[e.position].top + "px", f.style.left = n[e.position].left + "px";
55
+ f.style.top = h[o.position].top + "px", f.style.left = h[o.position].left + "px";
55
56
  }
56
57
  }), r.value = null;
57
- }, e.delay));
58
+ }, o.delay));
58
59
  }, C = () => {
59
- e.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), c.value = !1, g(() => {
60
- const f = v(a);
60
+ o.trigger !== "auto" && (r.value && (clearTimeout(r.value), r.value = null), c.value = !1, v(() => {
61
+ const f = g(p);
61
62
  f && (f.style.top = "0", f.style.left = "0");
62
63
  }));
63
64
  }, S = () => {
64
- s(), c.value = !0, g(() => {
65
- if (p.value && a.value) {
66
- const f = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), l = o.left < 0 ? o.left : 0, i = o.top < 0 ? o.top : 0, n = {
67
- left: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - o.width - l - e.offset },
68
- right: { top: t.top - (o.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + e.offset },
69
- bottom: { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) - l },
70
- "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - o.width / 2 - l },
71
- top: { top: t.top - o.height - e.offset - i, left: (t == null ? void 0 : t.left) - l },
72
- "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - l }
65
+ m(), c.value = !0, v(() => {
66
+ if (a.value && p.value) {
67
+ const f = p.value, t = a.value.getBoundingClientRect(), e = p.value.getBoundingClientRect(), l = e.left < 0 ? e.left : 0, i = e.top < 0 ? e.top : 0, h = {
68
+ left: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) - e.width - l - o.offset },
69
+ right: { top: t.top - (e.height - t.height) / 2 - i, left: (t == null ? void 0 : t.left) + t.width - l + o.offset },
70
+ bottom: { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) - l },
71
+ "bottom-center": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
72
+ top: { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) - l },
73
+ "top-center": { top: t.top - e.height - o.offset - i, left: (t == null ? void 0 : t.left) + t.width / 2 - e.width / 2 - l },
74
+ "bottom-left": { top: (t == null ? void 0 : t.bottom) - i + o.offset, left: (t == null ? void 0 : t.left) + t.width - e.width - l }
73
75
  };
74
- f.style.top = n[e.position].top + "px", f.style.left = n[e.position].left + "px";
76
+ f.style.top = h[o.position].top + "px", f.style.left = h[o.position].left + "px";
75
77
  }
76
- }), e.autoShowDuration > 0 && (h.value = setTimeout(() => {
78
+ }), o.autoShowDuration > 0 && (u.value = setTimeout(() => {
77
79
  c.value = !1;
78
- }, e.autoShowDuration));
79
- }, s = () => {
80
- h.value && (clearTimeout(h.value), h.value = null);
80
+ }, o.autoShowDuration));
81
+ }, m = () => {
82
+ u.value && (clearTimeout(u.value), u.value = null);
81
83
  };
82
84
  return D(() => {
83
- r.value && clearTimeout(r.value), s();
85
+ r.value && clearTimeout(r.value), m();
84
86
  }), d({
85
87
  startAutoShow: S,
86
- clearAutoTimer: s
87
- }), (f, t) => (m(), T(R, null, [
88
+ clearAutoTimer: m
89
+ }), (f, t) => (s(), T(R, null, [
88
90
  V("div", {
89
91
  ref_key: "container",
90
- ref: p,
92
+ ref: a,
91
93
  class: "tooltip-wrapper",
92
94
  onMouseover: B,
93
95
  onMouseout: C
94
96
  }, [
95
97
  I(f.$slots, "default", {}, void 0, !0)
96
98
  ], 544),
97
- (m(), E(L, { to: "body" }, [
99
+ (s(), E(L, { to: "body" }, [
98
100
  M($, null, {
99
101
  default: j(() => [
100
- c.value ? (m(), T("span", {
102
+ c.value ? (s(), T("span", {
101
103
  key: 0,
102
104
  ref_key: "tooltip",
103
- ref: a,
104
- "data-theme": v(y)().theme ? v(y)().theme : "light",
105
+ ref: p,
106
+ "data-theme": g(y)().theme ? g(y)().theme : "light",
105
107
  class: z(_.value)
106
108
  }, F(w.text), 11, U)) : q("", !0)
107
109
  ]),
@@ -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 e from "./DelimiterMessage.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-6097de8c"]]);
4
+ const m = /* @__PURE__ */ o(e, [["__scopeId", "data-v-75a5769e"]]);
5
5
  export {
6
- s as default
6
+ m as default
7
7
  };