@mobilon-dev/chotto 0.2.25 → 0.3.1
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.
- package/README.md +14 -5
- package/dist/chotto.css +1 -1
- package/dist/vuessages.es.js +21173 -83
- package/dist/vuessages.umd.js +6 -7
- package/package.json +5 -1
- package/dist/CreateChat-B7Kq9eRQ.js +0 -30
- package/dist/CreateChat2-A8L9xv_j.js +0 -41
- package/dist/CreateDialog-B6g-ij6E.js +0 -77
- package/dist/ModalVideoRecorder-K2AOjOdR.js +0 -143
- package/dist/SelectUser2-DF4XQSJw.js +0 -46
- package/dist/index-9X5xBqLk.js +0 -29761
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mobilon-dev/chotto",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.1",
|
4
4
|
"type": "module",
|
5
5
|
"main": "./dist/vuessages.umd.js",
|
6
6
|
"module": "./dist/vuessages.es.js",
|
@@ -18,9 +18,12 @@
|
|
18
18
|
"scripts": {
|
19
19
|
"dev": "vite",
|
20
20
|
"build": "vite build && vue-tsc --emitDeclarationOnly",
|
21
|
+
"build:lib": "vite build && vue-tsc --emitDeclarationOnly",
|
21
22
|
"preview": "vite preview",
|
22
23
|
"storybook": "storybook dev -p 6006",
|
23
24
|
"build-storybook": "storybook build -o docs",
|
25
|
+
"validate-themes": "node ./scripts/validate-themes.cjs",
|
26
|
+
"validate-themes:ts": "tsx ./scripts/validate-themes.ts",
|
24
27
|
"lint-fix": "npx eslint . --fix",
|
25
28
|
"lint": "npx eslint ."
|
26
29
|
},
|
@@ -49,6 +52,7 @@
|
|
49
52
|
"moment": "^2.30.1",
|
50
53
|
"pinia": "^2.3.1",
|
51
54
|
"storybook": "^9.1.2",
|
55
|
+
"tsx": "^4.19.2",
|
52
56
|
"typescript": "^5.9.2",
|
53
57
|
"typescript-eslint": "^8.17.0",
|
54
58
|
"vite": "^6.3.5",
|
@@ -1,30 +0,0 @@
|
|
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
|
-
const h = {
|
3
|
-
__name: "CreateChat",
|
4
|
-
props: {
|
5
|
-
title: {
|
6
|
-
type: String,
|
7
|
-
required: !0
|
8
|
-
}
|
9
|
-
},
|
10
|
-
emits: ["change"],
|
11
|
-
setup(l, { emit: a }) {
|
12
|
-
const e = u(""), o = a, r = () => {
|
13
|
-
o("change", { name: e.value });
|
14
|
-
};
|
15
|
-
return (v, t) => (s(), m("div", null, [
|
16
|
-
n("h2", null, p(l.title), 1),
|
17
|
-
c(n("input", {
|
18
|
-
"onUpdate:modelValue": t[0] || (t[0] = (i) => e.value = i),
|
19
|
-
type: "text",
|
20
|
-
class: "name",
|
21
|
-
onInput: r
|
22
|
-
}, null, 544), [
|
23
|
-
[d, e.value]
|
24
|
-
])
|
25
|
-
]));
|
26
|
-
}
|
27
|
-
};
|
28
|
-
export {
|
29
|
-
h as default
|
30
|
-
};
|
@@ -1,41 +0,0 @@
|
|
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
|
-
const f = {
|
3
|
-
__name: "CreateChat2",
|
4
|
-
props: {
|
5
|
-
title: {
|
6
|
-
type: String,
|
7
|
-
required: !0
|
8
|
-
}
|
9
|
-
},
|
10
|
-
emits: ["change"],
|
11
|
-
setup(a, { emit: p }) {
|
12
|
-
const n = m({}), i = p, o = () => {
|
13
|
-
i("change", {
|
14
|
-
contact: n.value
|
15
|
-
});
|
16
|
-
};
|
17
|
-
return (g, t) => (d(), s("div", null, [
|
18
|
-
e("h2", null, v(a.title), 1),
|
19
|
-
t[2] || (t[2] = e("label", null, "Имя", -1)),
|
20
|
-
u(e("input", {
|
21
|
-
"onUpdate:modelValue": t[0] || (t[0] = (l) => n.value.name = l),
|
22
|
-
type: "text",
|
23
|
-
onInput: o
|
24
|
-
}, null, 544), [
|
25
|
-
[r, n.value.name]
|
26
|
-
]),
|
27
|
-
t[3] || (t[3] = e("br", null, null, -1)),
|
28
|
-
t[4] || (t[4] = e("label", null, "Телефон", -1)),
|
29
|
-
u(e("input", {
|
30
|
-
"onUpdate:modelValue": t[1] || (t[1] = (l) => n.value.phone = l),
|
31
|
-
type: "text",
|
32
|
-
onInput: o
|
33
|
-
}, null, 544), [
|
34
|
-
[r, n.value.phone]
|
35
|
-
])
|
36
|
-
]));
|
37
|
-
}
|
38
|
-
};
|
39
|
-
export {
|
40
|
-
f as default
|
41
|
-
};
|
@@ -1,77 +0,0 @@
|
|
1
|
-
import { ref as v, computed as d, createElementBlock as r, openBlock as i, 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-9X5xBqLk.js";
|
3
|
-
const S = { class: "modal__contact-line" }, k = ["value"], q = { 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
|
-
default: null
|
26
|
-
}
|
27
|
-
},
|
28
|
-
emits: ["change", "submit"],
|
29
|
-
setup(o, { emit: g }) {
|
30
|
-
const n = o, s = v(), a = v(), y = d(() => !!(s.value && a.value)), h = d(() => !!(n.filter && a.value || !n.filter)), b = d(() => n.filter && a.value ? n.filter(a.value, n.channels) : n.channels), c = g, C = () => {
|
31
|
-
c("change", { channel: s.value, contact: a.value }), c("submit");
|
32
|
-
};
|
33
|
-
return (B, l) => (i(), r("div", null, [
|
34
|
-
t("h3", null, u(o.title), 1),
|
35
|
-
t("div", null, " Контакт: " + u(o.name), 1),
|
36
|
-
t("div", S, [
|
37
|
-
l[2] || (l[2] = t("h3", { style: { margin: "0" } }, " Куда пишем ", -1)),
|
38
|
-
m(t("select", {
|
39
|
-
id: "folder",
|
40
|
-
"onUpdate:modelValue": l[0] || (l[0] = (e) => a.value = e)
|
41
|
-
}, [
|
42
|
-
(i(!0), r(f, null, p(o.contacts, (e) => (i(), r("option", {
|
43
|
-
key: e.id || e.value,
|
44
|
-
value: e
|
45
|
-
}, u(e.value), 9, k))), 128))
|
46
|
-
], 512), [
|
47
|
-
[_, a.value]
|
48
|
-
])
|
49
|
-
]),
|
50
|
-
t("div", q, [
|
51
|
-
l[3] || (l[3] = t("h3", { style: { margin: "0" } }, " Через какой канал ", -1)),
|
52
|
-
m(t("select", {
|
53
|
-
id: "folder",
|
54
|
-
"onUpdate:modelValue": l[1] || (l[1] = (e) => s.value = e),
|
55
|
-
disabled: !h.value
|
56
|
-
}, [
|
57
|
-
(i(!0), r(f, null, p(b.value, (e) => (i(), r("option", {
|
58
|
-
key: e.id || e.title,
|
59
|
-
value: e
|
60
|
-
}, u(e.title), 9, x))), 128))
|
61
|
-
], 8, w), [
|
62
|
-
[_, s.value]
|
63
|
-
])
|
64
|
-
]),
|
65
|
-
t("button", {
|
66
|
-
type: "button",
|
67
|
-
class: "modal__button-start",
|
68
|
-
"aria-label": "Close modal",
|
69
|
-
disabled: !y.value,
|
70
|
-
onClick: C
|
71
|
-
}, " Начать диалог ", 8, V)
|
72
|
-
]));
|
73
|
-
}
|
74
|
-
}, U = /* @__PURE__ */ D(A, [["__scopeId", "data-v-9fd510f2"]]);
|
75
|
-
export {
|
76
|
-
U as default
|
77
|
-
};
|
@@ -1,143 +0,0 @@
|
|
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-9X5xBqLk.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
|
-
ref_key: "refVideo",
|
75
|
-
ref: _,
|
76
|
-
class: "video-recorder__view-area"
|
77
|
-
}, null, 512), [
|
78
|
-
[I, !i.value]
|
79
|
-
]),
|
80
|
-
E(o("video", {
|
81
|
-
ref_key: "refRecord",
|
82
|
-
ref: R,
|
83
|
-
class: "video-recorder__view-area",
|
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-4115c81a"]]);
|
141
|
-
export {
|
142
|
-
ee as default
|
143
|
-
};
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import { ref as p, createElementBlock as n, openBlock as s, createElementVNode as t, toDisplayString as i, Fragment as m, renderList as _, withDirectives as h, vModelCheckbox as v } from "vue";
|
2
|
-
import { _ as f } from "./index-9X5xBqLk.js";
|
3
|
-
const g = { class: "participant-list" }, k = ["id", "value"], y = ["for"], x = {
|
4
|
-
__name: "SelectUser2",
|
5
|
-
props: {
|
6
|
-
users: {
|
7
|
-
type: Array,
|
8
|
-
required: !0
|
9
|
-
},
|
10
|
-
title: {
|
11
|
-
type: String,
|
12
|
-
required: !0
|
13
|
-
}
|
14
|
-
},
|
15
|
-
emits: ["change"],
|
16
|
-
setup(o, { emit: a }) {
|
17
|
-
const r = p([]), c = a, u = () => {
|
18
|
-
console.log("check"), c("change", { selectedUsers: r.value });
|
19
|
-
};
|
20
|
-
return (I, l) => (s(), n("div", null, [
|
21
|
-
t("h2", null, i(o.title), 1),
|
22
|
-
t("div", g, [
|
23
|
-
(s(!0), n(m, null, _(o.users, (e) => (s(), n("div", {
|
24
|
-
key: e.userId,
|
25
|
-
class: "participant-item"
|
26
|
-
}, [
|
27
|
-
h(t("input", {
|
28
|
-
id: e.userId,
|
29
|
-
"onUpdate:modelValue": l[0] || (l[0] = (d) => r.value = d),
|
30
|
-
type: "checkbox",
|
31
|
-
value: e.userId,
|
32
|
-
onChange: u
|
33
|
-
}, null, 40, k), [
|
34
|
-
[v, r.value]
|
35
|
-
]),
|
36
|
-
t("label", {
|
37
|
-
for: e.userId
|
38
|
-
}, i(e.name || "unknown username"), 9, y)
|
39
|
-
]))), 128))
|
40
|
-
])
|
41
|
-
]));
|
42
|
-
}
|
43
|
-
}, b = /* @__PURE__ */ f(x, [["__scopeId", "data-v-37981321"]]);
|
44
|
-
export {
|
45
|
-
b as default
|
46
|
-
};
|