@mobilon-dev/chotto 0.3.101 → 0.3.103

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 (29) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue.js +4 -3
  3. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +72 -119
  4. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +2 -2
  5. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +109 -88
  6. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
  7. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +334 -225
  8. package/dist/components/3_compounds/ChatInput/icons/ArrowIcon.vue.js +40 -0
  9. package/dist/hooks/uploadFile/generatePreview.js +19 -18
  10. package/dist/hooks/useMessageDraft.js +85 -65
  11. package/dist/index.js +159 -157
  12. package/dist/locale/en.js +4 -0
  13. package/dist/locale/ru.js +4 -0
  14. package/dist/themes/dark.css +1 -1
  15. package/dist/themes/default.css +1 -1
  16. package/dist/themes/glass.css +1 -1
  17. package/dist/themes/green.css +1 -1
  18. package/dist/themes/mobilon1.css +1 -1
  19. package/dist/types/components/2_chatinput_elements/FilePreview/stories/FilePreview.stories.d.ts +3 -3
  20. package/dist/types/components/2_chatinput_elements/FilePreview/styles/types.d.ts +135 -127
  21. package/dist/types/components/2_chatinput_elements/FileUploader/FileUploader.vue.d.ts +9 -0
  22. package/dist/types/components/3_compounds/ChatInput/ChatInput.vue.d.ts +14 -3
  23. package/dist/types/components/3_compounds/ChatInput/icons/ArrowIcon.vue.d.ts +2 -0
  24. package/dist/types/components/3_compounds/ChatInput/icons/index.d.ts +1 -0
  25. package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +74 -0
  26. package/dist/types/hooks/useMessageDraft.d.ts +10 -3
  27. package/dist/types/locale/en.d.ts +4 -0
  28. package/dist/types/locale/ru.d.ts +4 -0
  29. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
1
  import o from "./FilePreview.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-94cf2f67"]]);
3
+ /* empty css */
4
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
5
+ const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-592e055e"]]);
5
6
  export {
6
- i as default
7
+ p as default
7
8
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as V, inject as $, 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
- import z from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
1
+ import { defineComponent as _, inject as b, ref as g, computed as N, createElementBlock as l, openBlock as i, createElementVNode as n, createBlock as m, createCommentVNode as o, toDisplayString as c, Teleport as V, createVNode as C, Transition as T, withCtx as d, unref as u } from "vue";
2
+ import U from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
3
3
  import "../../../hooks/useMessageDraft.js";
4
4
  import "../../../hooks/useSearchModel.js";
5
5
  import { useTheme as B } from "../../../hooks/useTheme.js";
@@ -11,20 +11,16 @@ import "../../../locale/useLocale.js";
11
11
  import "../../../node_modules/linkifyjs/dist/linkify.js";
12
12
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
13
13
  import "../../../functions/parseMarkdown.js";
14
- import { safeMediaPlay as D } from "../../../functions/safeMediaPlay.js";
15
- const j = { class: "preview__container" }, F = { class: "preview__block" }, O = ["src"], q = ["src"], G = {
14
+ const x = { class: "preview" }, z = ["src", "alt"], F = ["src"], M = {
16
15
  key: 2,
17
- style: { display: "flex", gap: "5px" }
18
- }, H = ["src"], J = { class: "pi pi-play" }, K = { class: "pi pi-pause" }, Q = { key: 3 }, R = { class: "preview__control-block" }, W = { class: "preview__information" }, X = { class: "preview__name" }, Y = {
16
+ class: "pi pi-play preview__thumb-play"
17
+ }, S = {
18
+ key: 1,
19
+ class: "pi pi-file preview__icon"
20
+ }, j = { class: "preview__info" }, A = ["title"], E = {
19
21
  key: 0,
20
22
  class: "preview__size"
21
- }, Z = {
22
- key: 1,
23
- class: "preview__audio-time"
24
- }, ee = {
25
- key: 2,
26
- class: "preview__audio-time"
27
- }, ie = { class: "preview__reset" }, te = ["src"], le = ["src"], ye = /* @__PURE__ */ V({
23
+ }, O = ["aria-label"], P = ["src"], $ = ["src", "alt"], ee = /* @__PURE__ */ _({
28
24
  __name: "FilePreview",
29
25
  props: {
30
26
  fileInfo: {
@@ -33,124 +29,81 @@ const j = { class: "preview__container" }, F = { class: "preview__block" }, O =
33
29
  }
34
30
  },
35
31
  emits: ["reset"],
36
- setup(t, { emit: C }) {
37
- const b = $("chatAppId"), { getTheme: p } = B(b), E = C, e = s(), a = s(), u = s(!1), d = s(0), _ = s(0), v = s(!1), M = () => v.value = !1;
38
- function P() {
39
- e.value && (u.value ? e.value.pause() : D(e.value), u.value = !u.value);
32
+ setup(e, { emit: v }) {
33
+ const p = b("chatAppId"), { getTheme: r } = B(p), s = e, I = v, a = g(!1), h = N(
34
+ () => !!s.fileInfo.previewUrl && (s.fileInfo.isImage || s.fileInfo.isVideo)
35
+ );
36
+ function w() {
37
+ a.value = !1;
40
38
  }
41
- const w = (m) => {
42
- const l = Math.floor(m / 60), f = Math.floor(m % 60);
43
- return `${l.toString().padStart(2, "0")}:${f.toString().padStart(2, "0")}`;
44
- }, S = I(() => e.value ? w(_.value) : "0:00"), y = I(() => e.value || a.value ? w(d.value) : "0:00");
45
- return x(() => {
46
- e.value != null && (e.value.addEventListener("loadedmetadata", () => {
47
- e.value != null && (e.value.duration == 1 / 0 || Number.isNaN(e.value.duration)) && (e.value.currentTime = 1e101, e.value.addEventListener("timeupdate", () => {
48
- e.value && (e.value.currentTime = 0, d.value = e.value.duration);
49
- }, { once: !0 })), d.value = e.value != null ? e.value.duration : 0;
50
- }), e.value.addEventListener("timeupdate", () => {
51
- _.value = e.value != null ? e.value.currentTime : 0;
52
- })), a.value && a.value.addEventListener("loadedmetadata", () => {
53
- a.value && (d.value = a.value.duration, (a.value.duration == 1 / 0 || Number.isNaN(a.value.duration)) && (a.value.currentTime = 1e101, a.value.addEventListener("timeupdate", () => {
54
- a.value && (a.value.currentTime = 0, d.value = a.value.duration);
55
- }, { once: !0 })));
56
- });
57
- }), (m, l) => (o(), n("div", j, [
58
- i("div", F, [
59
- t.fileInfo.isImage ? (o(), n("div", {
39
+ function y(f) {
40
+ const t = f.target;
41
+ t.currentTime === 0 && (t.currentTime = 0.1);
42
+ }
43
+ return (f, t) => (i(), l("div", x, [
44
+ h.value ? (i(), l("div", {
45
+ key: 0,
46
+ class: "preview__thumb",
47
+ onClick: t[0] || (t[0] = (k) => a.value = !0)
48
+ }, [
49
+ e.fileInfo.isImage ? (i(), l("img", {
60
50
  key: 0,
61
- style: { position: "relative" },
62
- onClick: l[0] || (l[0] = (f) => v.value = !0)
63
- }, [
64
- i("img", {
65
- src: t.fileInfo.previewUrl,
66
- alt: "Image Preview",
67
- class: "preview__image"
68
- }, null, 8, O),
69
- l[3] || (l[3] = i("div", { class: "preview__shadow" }, [
70
- i("span", { class: "pi pi-plus-circle" })
71
- ], -1))
72
- ])) : t.fileInfo.isVideo ? (o(), n("div", {
51
+ src: e.fileInfo.previewUrl,
52
+ alt: e.fileInfo.fileName,
53
+ class: "preview__thumb-media"
54
+ }, null, 8, z)) : e.fileInfo.isVideo ? (i(), l("video", {
73
55
  key: 1,
74
- style: { position: "relative" },
75
- onClick: l[1] || (l[1] = (f) => v.value = !0)
76
- }, [
77
- i("video", {
78
- ref_key: "video",
79
- ref: a,
80
- src: t.fileInfo.previewUrl,
81
- class: "preview__video"
82
- }, null, 8, q),
83
- l[4] || (l[4] = i("div", { class: "preview__shadow" }, [
84
- i("span", { class: "pi pi-play" })
85
- ], -1))
86
- ])) : t.fileInfo.isAudio ? (o(), n("div", G, [
87
- l[5] || (l[5] = i("span", {
88
- class: "pi pi-headphones",
89
- style: { "font-size": "1rem", margin: "auto" }
90
- }, null, -1)),
91
- i("audio", {
92
- ref_key: "audio",
93
- ref: e,
94
- src: t.fileInfo.previewUrl
95
- }, null, 8, H),
96
- i("button", {
97
- class: "preview__audio-control",
98
- onClick: P
99
- }, [
100
- k(i("span", J, null, 512), [
101
- [g, !u.value]
102
- ]),
103
- k(i("span", K, null, 512), [
104
- [g, u.value]
105
- ])
106
- ])
107
- ])) : (o(), n("div", Q, [...l[6] || (l[6] = [
108
- i("span", {
109
- class: "pi pi-file",
110
- style: { "font-size": "2.5rem" }
111
- }, null, -1)
112
- ])]))
113
- ]),
114
- i("div", R, [
115
- i("div", W, [
116
- i("span", X, c(t.fileInfo.fileName), 1),
117
- !t.fileInfo.isAudio && !t.fileInfo.isVideo ? (o(), n("span", Y, c(t.fileInfo.fileSize), 1)) : r("", !0),
118
- t.fileInfo.isAudio ? (o(), n("span", Z, c(`${S.value} / ${y.value}`), 1)) : r("", !0),
119
- t.fileInfo.isVideo ? (o(), n("span", ee, c(y.value), 1)) : r("", !0)
120
- ]),
121
- i("div", ie, [
122
- i("span", {
123
- class: "pi pi-times",
124
- onClick: l[2] || (l[2] = (f) => E("reset"))
125
- })
126
- ])
56
+ src: e.fileInfo.previewUrl,
57
+ class: "preview__thumb-media",
58
+ muted: "",
59
+ playsinline: "",
60
+ preload: "metadata",
61
+ onLoadedmetadata: y
62
+ }, null, 40, F)) : o("", !0),
63
+ e.fileInfo.isVideo ? (i(), l("span", M)) : o("", !0)
64
+ ])) : (i(), l("span", S)),
65
+ n("div", j, [
66
+ n("span", {
67
+ class: "preview__name",
68
+ title: e.fileInfo.fileName
69
+ }, c(e.fileInfo.fileName), 9, A),
70
+ e.fileInfo.fileSize ? (i(), l("span", E, c(e.fileInfo.fileSize), 1)) : o("", !0)
127
71
  ]),
128
- (o(), h(A, { to: "body" }, [
129
- L(U, { name: "modal-fade" }, {
130
- default: T(() => [
131
- v.value ? (o(), h(z, {
72
+ n("button", {
73
+ type: "button",
74
+ class: "preview__reset",
75
+ "aria-label": e.fileInfo.fileName,
76
+ onClick: t[1] || (t[1] = (k) => I("reset"))
77
+ }, [...t[2] || (t[2] = [
78
+ n("span", { class: "pi pi-times" }, null, -1)
79
+ ])], 8, O),
80
+ (i(), m(V, { to: "body" }, [
81
+ C(T, { name: "modal-fade" }, {
82
+ default: d(() => [
83
+ a.value ? (i(), m(U, {
132
84
  key: 0,
133
- theme: N(p)().theme ? N(p)().theme : "",
134
- title: t.fileInfo.fileName,
135
- onClose: M
85
+ theme: u(r)().theme ? u(r)().theme : "light",
86
+ title: e.fileInfo.fileName,
87
+ onClose: w
136
88
  }, {
137
- default: T(() => [
138
- t.fileInfo.isVideo ? (o(), n("video", {
89
+ default: d(() => [
90
+ e.fileInfo.isVideo ? (i(), l("video", {
139
91
  key: 0,
140
92
  class: "preview__modal-video",
141
- src: t.fileInfo.previewUrl,
93
+ src: e.fileInfo.previewUrl,
142
94
  controls: "",
143
- autoplay: ""
144
- }, null, 8, te)) : r("", !0),
145
- t.fileInfo.isImage ? (o(), n("img", {
95
+ autoplay: "",
96
+ playsinline: ""
97
+ }, null, 8, P)) : o("", !0),
98
+ e.fileInfo.isImage ? (i(), l("img", {
146
99
  key: 1,
147
100
  class: "preview__modal-image",
148
- src: t.fileInfo.previewUrl,
149
- alt: "Image Preview"
150
- }, null, 8, le)) : r("", !0)
101
+ src: e.fileInfo.previewUrl,
102
+ alt: e.fileInfo.fileName
103
+ }, null, 8, $)) : o("", !0)
151
104
  ]),
152
105
  _: 1
153
- }, 8, ["theme", "title"])) : r("", !0)
106
+ }, 8, ["theme", "title"])) : o("", !0)
154
107
  ]),
155
108
  _: 1
156
109
  })
@@ -159,5 +112,5 @@ const j = { class: "preview__container" }, F = { class: "preview__block" }, O =
159
112
  }
160
113
  });
161
114
  export {
162
- ye as default
115
+ ee as default
163
116
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./FileUploader.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f82b23fd"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0d65ea38"]]);
5
5
  export {
6
- a as default
6
+ p as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as D, ref as r, inject as x, computed as M, watchEffect as z, watch as A, onMounted as O, onUnmounted as P, createElementBlock as y, openBlock as b, Fragment as $, createCommentVNode as H, createElementVNode as a, normalizeClass as L, createVNode as j, unref as R } from "vue";
2
- import { buildFilePreview as q } from "../../../hooks/uploadFile/generatePreview.js";
3
- import { uploadFile as G } from "../../../hooks/uploadFile/uploadFile.js";
4
- import { useMessageDraft as J } from "../../../hooks/useMessageDraft.js";
1
+ import { defineComponent as H, ref as n, inject as S, computed as _, unref as U, watchEffect as L, watch as O, onMounted as $, onUnmounted as T, createElementBlock as w, openBlock as A, Fragment as R, createCommentVNode as X, createElementVNode as d, normalizeClass as q, createVNode as G } from "vue";
2
+ import { buildFilePreview as J } from "../../../hooks/uploadFile/generatePreview.js";
3
+ import { uploadFile as K } from "../../../hooks/uploadFile/uploadFile.js";
4
+ import { MAX_ATTACHED_FILES as D, useMessageDraft as Q, getDraftFiles as C } from "../../../hooks/useMessageDraft.js";
5
5
  import "../../../hooks/useSearchModel.js";
6
6
  import "../../../hooks/useTheme.js";
7
7
  import "../../../hooks/useEmojiNative.js";
@@ -12,14 +12,14 @@ import "../../../locale/useLocale.js";
12
12
  import "../../../node_modules/linkifyjs/dist/linkify.js";
13
13
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
14
14
  import "../../../functions/parseMarkdown.js";
15
- import K from "./icons/FileUploaderIcon.vue.js";
16
- const Q = {
15
+ import W from "./icons/FileUploaderIcon.vue.js";
16
+ const Y = {
17
17
  key: 0,
18
18
  class: "file-uploader__status file-uploader__status--uploading"
19
- }, T = {
19
+ }, Z = {
20
20
  key: 1,
21
21
  class: "file-uploader__status file-uploader__status--error"
22
- }, W = ["disabled"], de = /* @__PURE__ */ D({
22
+ }, ee = ["disabled"], Fe = /* @__PURE__ */ H({
23
23
  __name: "FileUploader",
24
24
  props: {
25
25
  filebumpUrl: {
@@ -29,111 +29,132 @@ const Q = {
29
29
  state: {
30
30
  type: String,
31
31
  default: "active"
32
+ },
33
+ maxAttachedFiles: {
34
+ type: Number,
35
+ default: void 0
32
36
  }
33
37
  },
34
38
  emits: ["fileUploaded"],
35
- setup(d, { emit: X }) {
36
- const m = d, o = r(""), i = r(), _ = r();
37
- _.value;
38
- const n = x("chatAppId"), { setMessageFile: U, resetMessageFile: k, getMessage: w, setRecordingMessage: C } = J(n), u = r("#5F5F5F"), p = r("#404040"), v = r(!1);
39
- let s = null;
40
- const g = () => {
41
- if (!n) {
42
- u.value = "#5F5F5F", p.value = "#404040";
39
+ setup(v, { emit: te }) {
40
+ const s = v, r = n(""), a = n(), M = n();
41
+ M.value;
42
+ const u = S("chatAppId"), N = S("maxAttachedFiles", D), { addMessageFiles: V, getMessage: g, setRecordingMessage: E } = Q(u), F = _(() => {
43
+ const t = s.maxAttachedFiles;
44
+ if (typeof t == "number" && t > 0) return Math.floor(t);
45
+ const e = U(N);
46
+ return typeof e == "number" && e > 0 ? Math.floor(e) : D;
47
+ }), f = n("#5F5F5F"), p = n("#404040"), y = n(!1);
48
+ let c = null;
49
+ const h = () => {
50
+ if (!u) {
51
+ f.value = "#5F5F5F", p.value = "#404040";
43
52
  return;
44
53
  }
45
- const l = document.getElementById(n);
46
- if (!l) {
47
- u.value = "#5F5F5F", p.value = "#404040";
54
+ const t = document.getElementById(u);
55
+ if (!t) {
56
+ f.value = "#5F5F5F", p.value = "#404040";
48
57
  return;
49
58
  }
50
- const e = window.getComputedStyle(l), t = e.getPropertyValue("--chotto-fileuploader-trigger-color").trim(), f = e.getPropertyValue("--chotto-fileuploader-trigger-hover-color").trim();
51
- u.value = t || "#5F5F5F", p.value = f || "#404040";
52
- }, S = M(() => v.value ? p.value : u.value);
53
- z(() => {
54
- g();
59
+ const e = window.getComputedStyle(t), l = e.getPropertyValue("--chotto-fileuploader-trigger-color").trim(), i = e.getPropertyValue("--chotto-fileuploader-trigger-hover-color").trim();
60
+ f.value = l || "#5F5F5F", p.value = i || "#404040";
61
+ }, B = _(() => y.value ? p.value : f.value);
62
+ L(() => {
63
+ h();
55
64
  });
56
- const F = M(() => !w().file), c = () => {
57
- i.value && (i.value.value = "");
58
- }, N = () => {
59
- k(), o.value = "", c();
60
- }, V = async () => {
61
- var e, t;
62
- const l = (t = (e = i.value) == null ? void 0 : e.files) == null ? void 0 : t[0];
63
- N(), l && await E(l), c();
64
- }, B = () => {
65
- i.value && F.value && m.state == "active" && (c(), i.value.click());
66
- }, h = async (l) => {
67
- var t;
68
- const e = (t = l.clipboardData) == null ? void 0 : t.items;
69
- if (e) {
70
- for (let f of e)
71
- if (f.type.indexOf("image") !== -1) {
72
- l.preventDefault();
73
- const I = f.getAsFile();
74
- I && E(I);
65
+ const m = _(() => C(g()).length < F.value), b = () => {
66
+ a.value && (a.value.value = "");
67
+ }, P = () => F.value - C(g()).length, I = async (t) => {
68
+ const e = t.slice(0, Math.max(0, P()));
69
+ if (e.length) {
70
+ r.value = "uploading", E(!0);
71
+ try {
72
+ const l = [];
73
+ for (const i of e) {
74
+ const o = await K(
75
+ typeof s.filebumpUrl == "string" ? s.filebumpUrl : null,
76
+ i
77
+ );
78
+ o.status == "success" ? l.push({
79
+ url: o.url,
80
+ name: o.name,
81
+ size: o.size,
82
+ type: o.type,
83
+ preview: J(o.name, o.preview)
84
+ }) : r.value = "error";
75
85
  }
86
+ l.length ? (V(l, F.value), r.value !== "error" && (r.value = "success")) : r.value !== "error" && (r.value = "error");
87
+ } finally {
88
+ E(!1);
89
+ }
76
90
  }
77
- }, E = async (l) => {
78
- o.value = "uploading", C(!0);
79
- const e = typeof m.filebumpUrl == "string" ? m.filebumpUrl : null;
80
- await G(e, l).then((t) => {
81
- C(!1), o.value = t.status, t.status == "success" && U({
82
- url: t.url,
83
- name: t.name,
84
- size: t.size,
85
- type: t.type,
86
- preview: q(t.name, t.preview)
87
- });
88
- });
91
+ }, j = async () => {
92
+ var l;
93
+ const t = (l = a.value) == null ? void 0 : l.files, e = t ? Array.from(t) : [];
94
+ b(), await I(e);
95
+ }, z = () => {
96
+ a.value && m.value && s.state == "active" && (b(), a.value.click());
97
+ }, x = async (t) => {
98
+ var i;
99
+ if (!m.value || s.state !== "active") return;
100
+ const e = (i = t.clipboardData) == null ? void 0 : i.items;
101
+ if (!e) return;
102
+ const l = [];
103
+ for (const o of e)
104
+ if (o.type.indexOf("image") !== -1) {
105
+ const k = o.getAsFile();
106
+ k && l.push(k);
107
+ }
108
+ l.length && (t.preventDefault(), await I(l));
89
109
  };
90
- return A(
91
- () => w().file,
92
- (l) => {
93
- l || (o.value = "", c());
110
+ return O(
111
+ () => C(g()).length,
112
+ (t) => {
113
+ t || (r.value = "", b());
94
114
  }
95
- ), O(() => {
96
- if (window.addEventListener("paste", h), g(), n) {
97
- const l = document.getElementById(n);
98
- l && (s = new MutationObserver((e) => {
99
- e.forEach((t) => {
100
- t.type === "attributes" && t.attributeName === "data-theme" && g();
115
+ ), $(() => {
116
+ if (window.addEventListener("paste", x), h(), u) {
117
+ const t = document.getElementById(u);
118
+ t && (c = new MutationObserver((e) => {
119
+ e.forEach((l) => {
120
+ l.type === "attributes" && l.attributeName === "data-theme" && h();
101
121
  });
102
- }), s.observe(l, {
122
+ }), c.observe(t, {
103
123
  attributes: !0,
104
124
  attributeFilter: ["data-theme"]
105
125
  }));
106
126
  }
107
- }), P(() => {
108
- window.removeEventListener("paste", h), s && (s.disconnect(), s = null);
109
- }), (l, e) => (b(), y($, null, [
110
- o.value === "uploading" ? (b(), y("div", Q, [...e[2] || (e[2] = [
111
- a("span", null, "Загрузка", -1),
112
- a("span", null, "файла...", -1)
113
- ])])) : o.value === "error" ? (b(), y("div", T, [...e[3] || (e[3] = [
114
- a("span", null, "Ошибка при загрузке файла.", -1)
115
- ])])) : H("", !0),
116
- a("span", {
127
+ }), T(() => {
128
+ window.removeEventListener("paste", x), c && (c.disconnect(), c = null);
129
+ }), (t, e) => (A(), w(R, null, [
130
+ r.value === "uploading" ? (A(), w("div", Y, [...e[2] || (e[2] = [
131
+ d("span", null, "Загрузка", -1),
132
+ d("span", null, "файла...", -1)
133
+ ])])) : r.value === "error" ? (A(), w("div", Z, [...e[3] || (e[3] = [
134
+ d("span", null, "Ошибка при загрузке файла.", -1)
135
+ ])])) : X("", !0),
136
+ d("span", {
117
137
  ref_key: "triggerElement",
118
- ref: _,
119
- class: L(["file-uploader__trigger", { "file-uploader__disabled": !F.value || d.state == "disabled" }]),
120
- disabled: !F.value || d.state == "disabled",
121
- onClick: B,
122
- onMouseenter: e[0] || (e[0] = (t) => v.value = !0),
123
- onMouseleave: e[1] || (e[1] = (t) => v.value = !1)
138
+ ref: M,
139
+ class: q(["file-uploader__trigger", { "file-uploader__disabled": !m.value || v.state == "disabled" }]),
140
+ disabled: !m.value || v.state == "disabled",
141
+ onClick: z,
142
+ onMouseenter: e[0] || (e[0] = (l) => y.value = !0),
143
+ onMouseleave: e[1] || (e[1] = (l) => y.value = !1)
124
144
  }, [
125
- j(R(K), { fill: S.value }, null, 8, ["fill"])
126
- ], 42, W),
127
- a("input", {
145
+ G(U(W), { fill: B.value }, null, 8, ["fill"])
146
+ ], 42, ee),
147
+ d("input", {
128
148
  ref_key: "fileInput",
129
- ref: i,
149
+ ref: a,
130
150
  style: { display: "none" },
131
151
  type: "file",
132
- onChange: V
152
+ multiple: "",
153
+ onChange: j
133
154
  }, null, 544)
134
155
  ], 64));
135
156
  }
136
157
  });
137
158
  export {
138
- de as default
159
+ Fe as default
139
160
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./ChatInput.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-c13af78f"]]);
4
+ const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-9692636b"]]);
5
5
  export {
6
- r as default
6
+ m as default
7
7
  };