@mobilon-dev/chotto 0.0.101 → 0.0.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.
@@ -1,4 +1,4 @@
1
- import { ref as u, openBlock as m, createElementBlock as s, createElementVNode as n, toDisplayString as c, withDirectives as p, vModelText as d } from "vue";
1
+ import { ref as u, createElementBlock as m, openBlock as s, createElementVNode as n, withDirectives as c, toDisplayString as p, vModelText as d } from "vue";
2
2
  const h = {
3
3
  __name: "CreateChat",
4
4
  props: {
@@ -12,9 +12,9 @@ const h = {
12
12
  const e = u(""), o = a, r = () => {
13
13
  o("change", { name: e.value });
14
14
  };
15
- return (v, t) => (m(), s("div", null, [
16
- n("h2", null, c(l.title), 1),
17
- p(n("input", {
15
+ return (v, t) => (s(), m("div", null, [
16
+ n("h2", null, p(l.title), 1),
17
+ c(n("input", {
18
18
  "onUpdate:modelValue": t[0] || (t[0] = (i) => e.value = i),
19
19
  type: "text",
20
20
  class: "name",
@@ -1,4 +1,4 @@
1
- import { ref as m, openBlock as s, createElementBlock as d, createElementVNode as e, toDisplayString as v, withDirectives as u, vModelText as r } from "vue";
1
+ import { ref as m, createElementBlock as s, openBlock as d, createElementVNode as e, withDirectives as u, toDisplayString as v, vModelText as r } from "vue";
2
2
  const f = {
3
3
  __name: "CreateChat2",
4
4
  props: {
@@ -14,7 +14,7 @@ const f = {
14
14
  contact: n.value
15
15
  });
16
16
  };
17
- return (g, t) => (s(), d("div", null, [
17
+ return (g, t) => (d(), s("div", null, [
18
18
  e("h2", null, v(a.title), 1),
19
19
  t[2] || (t[2] = e("label", null, "Имя", -1)),
20
20
  u(e("input", {
@@ -0,0 +1,70 @@
1
+ import { ref as v, computed as d, createElementBlock as r, openBlock as o, createElementVNode as t, toDisplayString as u, withDirectives as m, Fragment as f, renderList as p, vModelSelect as _ } from "vue";
2
+ import { _ as D } from "./index-i2H0KLkk.js";
3
+ const S = { class: "modal__contact-line" }, q = ["value"], k = { class: "modal__channel-line" }, w = ["disabled"], x = ["value"], V = ["disabled"], A = {
4
+ __name: "CreateDialog",
5
+ props: {
6
+ title: {
7
+ type: String,
8
+ required: !0
9
+ },
10
+ name: {
11
+ type: String,
12
+ required: !0
13
+ },
14
+ contacts: {
15
+ type: Array,
16
+ required: !0
17
+ },
18
+ channels: {
19
+ type: Array,
20
+ required: !0
21
+ },
22
+ filter: {
23
+ type: Function,
24
+ required: !1
25
+ }
26
+ },
27
+ emits: ["change", "submit"],
28
+ setup(i, { emit: h }) {
29
+ const a = i, s = v(), n = v(), g = d(() => !!(s.value && n.value)), b = d(() => !!(a.filter && n.value || !a.filter)), y = d(() => a.filter && n.value ? a.filter(n.value, a.channels) : a.channels), c = h, C = () => {
30
+ c("change", { channel: s.value, contact: n.value }), c("submit");
31
+ };
32
+ return (B, l) => (o(), r("div", null, [
33
+ t("h3", null, u(i.title), 1),
34
+ t("div", null, " Контакт: " + u(i.name), 1),
35
+ t("div", S, [
36
+ l[2] || (l[2] = t("h3", { style: { margin: "0" } }, " Куда пишем ", -1)),
37
+ m(t("select", {
38
+ id: "folder",
39
+ "onUpdate:modelValue": l[0] || (l[0] = (e) => n.value = e)
40
+ }, [
41
+ (o(!0), r(f, null, p(i.contacts, (e) => (o(), r("option", { value: e }, u(e.value), 9, q))), 256))
42
+ ], 512), [
43
+ [_, n.value]
44
+ ])
45
+ ]),
46
+ t("div", k, [
47
+ l[3] || (l[3] = t("h3", { style: { margin: "0" } }, " Через какой канал ", -1)),
48
+ m(t("select", {
49
+ id: "folder",
50
+ "onUpdate:modelValue": l[1] || (l[1] = (e) => s.value = e),
51
+ disabled: !b.value
52
+ }, [
53
+ (o(!0), r(f, null, p(y.value, (e) => (o(), r("option", { value: e }, u(e.title), 9, x))), 256))
54
+ ], 8, w), [
55
+ [_, s.value]
56
+ ])
57
+ ]),
58
+ t("button", {
59
+ type: "button",
60
+ class: "modal__button-start",
61
+ "aria-label": "Close modal",
62
+ disabled: !g.value,
63
+ onClick: C
64
+ }, " Начать диалог ", 8, V)
65
+ ]));
66
+ }
67
+ }, U = /* @__PURE__ */ D(A, [["__scopeId", "data-v-347541cb"]]);
68
+ export {
69
+ U as default
70
+ };
@@ -0,0 +1,143 @@
1
+ import { defineComponent as N, ref as l, computed as z, onMounted as $, createElementBlock as m, openBlock as f, Fragment as q, createElementVNode as o, withDirectives as E, vShow as I, createCommentVNode as g, normalizeClass as y, toDisplayString as A, nextTick as G, unref as k } from "vue";
2
+ import { _ as H } from "./index-i2H0KLkk.js";
3
+ const J = { class: "video-recorder__header" }, K = { class: "video-recorder__controls" }, P = { class: "video-recorder__recording-container" }, Q = { class: "video-recorder__recording-time" }, W = /* @__PURE__ */ N({
4
+ __name: "ModalVideoRecorder",
5
+ emits: ["change", "submit", "close"],
6
+ setup(X, { emit: L }) {
7
+ const S = l(), s = l(0), n = l(0), u = l(0), d = l(0), x = z(() => {
8
+ let a = d.value < 10 ? "0" + d.value : d.value, e = u.value < 10 ? "0" + u.value : u.value, t = n.value < 10 ? "0" + n.value : n.value, b = s.value < 10 ? "00" + s.value : s.value < 100 ? "0" + s.value : s.value;
9
+ return r.value ? a + ":" + e + ":" + t + ":" + b : " ";
10
+ }), _ = l(), R = l(), r = l(!1), c = l(), p = l(), V = l([]), i = l(), w = l(), v = l("camera"), F = () => {
11
+ v.value == "camera" ? (v.value = "screen", B()) : v.value == "screen" && (C(), v.value = "camera", M());
12
+ }, O = async () => {
13
+ !r.value && p.value instanceof MediaStream && (c.value = new MediaRecorder(p.value), c.value.start(), c.value.ondataavailable = (a) => {
14
+ V.value.push(a.data);
15
+ }, r.value = !0, S.value = setInterval(() => {
16
+ s.value += 10, s.value == 1e3 && (s.value = 0, n.value++, n.value == 60 && (n.value = 0, u.value++, u.value == 60 && (u.value = 0, d.value++)));
17
+ }, 10));
18
+ }, T = async () => {
19
+ D(), C(), i.value && (i.value = void 0, await M());
20
+ }, U = () => {
21
+ c.value && (c.value.stop(), c.value.onstop = async () => {
22
+ w.value = new File(V.value, "videomessage.mp4", { type: "video/*" });
23
+ const a = URL.createObjectURL(w.value);
24
+ i.value = a, G(() => {
25
+ R.value && (R.value.src = a);
26
+ });
27
+ }), D(), C();
28
+ };
29
+ function C() {
30
+ var e;
31
+ let a = (e = p.value) == null ? void 0 : e.getTracks();
32
+ a == null || a.forEach((t) => t.stop());
33
+ }
34
+ const D = () => {
35
+ clearInterval(S.value), s.value = 0, n.value = 0, u.value = 0, d.value = 0, r.value = !1, c.value = void 0, V.value = [];
36
+ }, h = L, j = () => {
37
+ h("change", { videoFile: w.value }), h("submit");
38
+ }, M = async () => {
39
+ await navigator.mediaDevices.getUserMedia({ audio: !0, video: !0 }).then((a) => {
40
+ const e = k(_.value);
41
+ p.value = a, e.srcObject = a, e.addEventListener("loadedmetadata", () => {
42
+ var t;
43
+ (t = k(_.value)) == null || t.play();
44
+ }), e.muted = !0;
45
+ });
46
+ }, B = async () => {
47
+ const a = {
48
+ video: {
49
+ cursor: "always"
50
+ },
51
+ audio: !1
52
+ };
53
+ await navigator.mediaDevices.getDisplayMedia(a).then((e) => {
54
+ const t = k(_.value);
55
+ p.value = e, t.srcObject = e, t.addEventListener("loadedmetadata", () => {
56
+ var b;
57
+ (b = k(_.value)) == null || b.play();
58
+ }), t.muted = !0;
59
+ });
60
+ };
61
+ return $(async () => {
62
+ await M();
63
+ }), (a, e) => (f(), m(q, null, [
64
+ o("div", J, [
65
+ o("button", {
66
+ class: "video-recorder__button video-recorder__button-close",
67
+ onClick: e[0] || (e[0] = (t) => h("close"))
68
+ }, e[1] || (e[1] = [
69
+ o("span", { class: "pi pi-times" }, null, -1)
70
+ ]))
71
+ ]),
72
+ o("div", null, [
73
+ E(o("video", {
74
+ class: "video-recorder__view-area",
75
+ ref_key: "refVideo",
76
+ ref: _
77
+ }, null, 512), [
78
+ [I, !i.value]
79
+ ]),
80
+ E(o("video", {
81
+ class: "video-recorder__view-area",
82
+ ref_key: "refRecord",
83
+ ref: R,
84
+ controls: ""
85
+ }, null, 512), [
86
+ [I, i.value]
87
+ ]),
88
+ o("div", K, [
89
+ o("div", P, [
90
+ !r.value && !i.value ? (f(), m("button", {
91
+ key: 0,
92
+ class: "video-recorder__button",
93
+ onClick: F
94
+ }, [
95
+ o("span", {
96
+ class: y({
97
+ "pi pi-desktop": v.value == "camera",
98
+ "pi pi-camera": v.value == "screen"
99
+ })
100
+ }, null, 2)
101
+ ])) : g("", !0),
102
+ i.value ? g("", !0) : (f(), m("button", {
103
+ key: 1,
104
+ class: y(["video-recorder__button", { "video-recorder__recording-button": r.value }]),
105
+ onClick: O
106
+ }, [
107
+ o("span", {
108
+ class: y(["pi", {
109
+ "pi-circle-fill video-recorder__recording-icon": r.value,
110
+ "pi-video": !r.value
111
+ }])
112
+ }, null, 2)
113
+ ], 2)),
114
+ !r.value && i.value ? (f(), m("button", {
115
+ key: 2,
116
+ class: "video-recorder__button",
117
+ onClick: T
118
+ }, e[2] || (e[2] = [
119
+ o("span", { class: "pi pi-trash" }, null, -1)
120
+ ]))) : g("", !0),
121
+ r.value ? (f(), m("button", {
122
+ key: 3,
123
+ class: "video-recorder__button",
124
+ onClick: U
125
+ }, e[3] || (e[3] = [
126
+ o("div", { class: "video-recorder__stop" }, null, -1)
127
+ ]))) : g("", !0),
128
+ o("span", Q, A(x.value), 1)
129
+ ]),
130
+ o("button", {
131
+ class: y(["video-recorder__button", { "video-recorder__button-disabled": !i.value }]),
132
+ onClick: j
133
+ }, e[4] || (e[4] = [
134
+ o("span", { class: "video-recorder__save-button" }, " Прикрепить видео ", -1)
135
+ ]), 2)
136
+ ])
137
+ ])
138
+ ], 64));
139
+ }
140
+ }), ee = /* @__PURE__ */ H(W, [["__scopeId", "data-v-6bf645f1"]]);
141
+ export {
142
+ ee as default
143
+ };
@@ -1,5 +1,5 @@
1
- import { ref as p, openBlock as n, createElementBlock as s, createElementVNode as t, toDisplayString as a, Fragment as m, renderList as _, withDirectives as h, vModelCheckbox as v } from "vue";
2
- import { _ as f } from "./index-D8nDb3IQ.js";
1
+ import { ref as p, createElementBlock as n, openBlock as s, createElementVNode as t, toDisplayString as a, Fragment as m, renderList as _, withDirectives as h, vModelCheckbox as v } from "vue";
2
+ import { _ as f } from "./index-i2H0KLkk.js";
3
3
  const g = { class: "participant-list" }, k = ["id", "value"], y = ["for"], x = {
4
4
  __name: "SelectUser2",
5
5
  props: {
@@ -17,10 +17,10 @@ const g = { class: "participant-list" }, k = ["id", "value"], y = ["for"], x = {
17
17
  const r = p([]), c = i, d = () => {
18
18
  console.log("check"), c("change", { selectedUsers: r.value });
19
19
  };
20
- return (I, l) => (n(), s("div", null, [
20
+ return (I, l) => (s(), n("div", null, [
21
21
  t("h2", null, a(o.title), 1),
22
22
  t("div", g, [
23
- (n(!0), s(m, null, _(o.users, (e) => (n(), s("div", {
23
+ (s(!0), n(m, null, _(o.users, (e) => (s(), n("div", {
24
24
  key: e.userId,
25
25
  class: "participant-item"
26
26
  }, [