@mobilon-dev/chotto 0.3.117 → 0.3.118
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/dist/chotto.css +1 -1
- package/dist/components/1_icons/VerifiedBadge.vue.js +31 -0
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +197 -187
- package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +43 -40
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +243 -232
- package/dist/index.js +325 -323
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/src/components/1_icons/VerifiedBadge.vue.d.ts +2 -0
- package/dist/types/src/components/2_chatlist_elements/ChatItem/ChatItem.vue.d.ts +11 -1
- package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts +1 -0
- package/dist/types/src/components/2_chatlist_elements/ChatItem/styles/types.d.ts +35 -3
- package/dist/types/src/components/2_chatlist_elements/ChatItem/types.d.ts +2 -0
- package/dist/types/src/components/2_elements/ChatInfo/ChatInfo.vue.d.ts +2 -0
- package/dist/types/src/components/2_elements/ChatInfo/stories/ChatInfo.stories.d.ts +2 -0
- package/dist/types/src/components/2_elements/ChatInfo/styles/types.d.ts +20 -0
- package/dist/types/src/components/3_compounds/ChatInput/styles/types.d.ts +32 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/test-utils/withSetup.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElementBlock as t, openBlock as r, createElementVNode as e } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import i from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const o = {}, d = {
|
|
5
|
+
class: "verified-badge",
|
|
6
|
+
"data-testid": "verified-badge",
|
|
7
|
+
role: "img",
|
|
8
|
+
"aria-label": "verified",
|
|
9
|
+
title: "Verified"
|
|
10
|
+
};
|
|
11
|
+
function a(L, C) {
|
|
12
|
+
return r(), t("span", d, [...C[0] || (C[0] = [
|
|
13
|
+
e("svg", {
|
|
14
|
+
width: "16",
|
|
15
|
+
height: "16",
|
|
16
|
+
viewBox: "0 0 16 16",
|
|
17
|
+
fill: "none",
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}, [
|
|
21
|
+
e("path", {
|
|
22
|
+
d: "M10.0662 0.870195C9.79703 0.594736 9.47551 0.375856 9.12055 0.226418C8.76558 0.0769807 8.38433 0 7.9992 0C7.61406 0 7.23281 0.0769807 6.87784 0.226418C6.52288 0.375856 6.20137 0.594736 5.9322 0.870195L5.31019 1.5082L4.4202 1.4972C4.03495 1.49264 3.65267 1.56515 3.29586 1.71048C2.93904 1.85581 2.61489 2.07102 2.34245 2.34345C2.07002 2.61589 1.85481 2.94004 1.70948 3.29686C1.56415 3.65367 1.49164 4.03595 1.4962 4.4212L1.5062 5.3112L0.870195 5.9332C0.594736 6.20237 0.375856 6.52388 0.226418 6.87884C0.0769807 7.23381 0 7.61506 0 8.0002C0 8.38533 0.0769807 8.76659 0.226418 9.12155C0.375856 9.47651 0.594736 9.79803 0.870195 10.0672L1.5072 10.6892L1.4962 11.5792C1.49164 11.9644 1.56415 12.3467 1.70948 12.7035C1.85481 13.0603 2.07002 13.3845 2.34245 13.6569C2.61489 13.9294 2.93904 14.1446 3.29586 14.2899C3.65267 14.4352 4.03495 14.5078 4.4202 14.5032L5.31019 14.4932L5.9322 15.1292C6.20137 15.4047 6.52288 15.6235 6.87784 15.773C7.23281 15.9224 7.61406 15.9994 7.9992 15.9994C8.38433 15.9994 8.76558 15.9224 9.12055 15.773C9.47551 15.6235 9.79703 15.4047 10.0662 15.1292L10.6882 14.4922L11.5782 14.5032C11.9634 14.5078 12.3457 14.4352 12.7025 14.2899C13.0593 14.1446 13.3835 13.9294 13.6559 13.6569C13.9284 13.3845 14.1436 13.0603 14.2889 12.7035C14.4342 12.3467 14.5068 11.9644 14.5022 11.5792L14.4922 10.6892L15.1282 10.0672C15.4037 9.79803 15.6225 9.47651 15.772 9.12155C15.9214 8.76659 15.9984 8.38533 15.9984 8.0002C15.9984 7.61506 15.9214 7.23381 15.772 6.87884C15.6225 6.52388 15.4037 6.20237 15.1282 5.9332L14.4912 5.3112L14.5022 4.4212C14.5068 4.03595 14.4342 3.65367 14.2889 3.29686C14.1436 2.94004 13.9284 2.61589 13.6559 2.34345C13.3835 2.07102 13.0593 1.85581 12.7025 1.71048C12.3457 1.56515 11.9634 1.49264 11.5782 1.4972L10.6882 1.5072L10.0662 0.870195ZM10.3532 6.8542L7.3532 9.8542C7.30675 9.90076 7.25157 9.9377 7.19083 9.96291C7.13008 9.98811 7.06496 10.0011 6.9992 10.0011C6.93343 10.0011 6.86831 9.98811 6.80756 9.96291C6.74682 9.9377 6.69164 9.90076 6.6452 9.8542L5.1452 8.3542C5.09871 8.30771 5.06183 8.25252 5.03667 8.19178C5.01151 8.13104 4.99856 8.06594 4.99856 8.0002C4.99856 7.93445 5.01151 7.86935 5.03667 7.80861C5.06183 7.74787 5.09871 7.69268 5.1452 7.6462C5.19168 7.59971 5.24687 7.56283 5.30761 7.53767C5.36835 7.51251 5.43345 7.49956 5.4992 7.49956C5.56494 7.49956 5.63004 7.51251 5.69078 7.53767C5.75152 7.56283 5.80671 7.59971 5.8532 7.6462L6.9992 8.7932L9.6452 6.1462C9.73908 6.05231 9.86642 5.99956 9.9992 5.99956C10.132 5.99956 10.2593 6.05231 10.3532 6.1462C10.4471 6.24008 10.4998 6.36742 10.4998 6.5002C10.4998 6.63297 10.4471 6.76031 10.3532 6.8542Z",
|
|
23
|
+
fill: "currentColor"
|
|
24
|
+
})
|
|
25
|
+
], -1)
|
|
26
|
+
])]);
|
|
27
|
+
}
|
|
28
|
+
const f = /* @__PURE__ */ i(o, [["render", a], ["__scopeId", "data-v-6ea31684"]]);
|
|
29
|
+
export {
|
|
30
|
+
f as default
|
|
31
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./ChatItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f1c3ebdc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getStatus as
|
|
1
|
+
import { defineComponent as Ht, inject as Nt, useId as Ut, ref as E, computed as l, watch as Ft, onMounted as Pt, nextTick as F, onUnmounted as Rt, createElementBlock as a, openBlock as o, createElementVNode as m, createCommentVNode as c, withModifiers as Wt, normalizeClass as P, normalizeStyle as nt, createVNode as R, createBlock as d, renderSlot as $t, withCtx as W, toDisplayString as f, resolveDynamicComponent as it, unref as h, Teleport as jt, Fragment as Xt, renderList as Yt } from "vue";
|
|
2
|
+
import { getStatus as zt, statuses as Ot } from "../../../functions/getStatusMessage.js";
|
|
3
3
|
import "../../../functions/parseMarkdown.js";
|
|
4
|
-
import { t as
|
|
5
|
-
import { resolveMessageDraftStore as
|
|
6
|
-
import { useTheme as
|
|
7
|
-
import { useEmojiNative as
|
|
4
|
+
import { t as A } from "../../../locale/useLocale.js";
|
|
5
|
+
import { resolveMessageDraftStore as qt } from "../../../hooks/useMessageDraft.js";
|
|
6
|
+
import { useTheme as Gt } from "../../../hooks/useTheme.js";
|
|
7
|
+
import { useEmojiNative as Jt } from "../../../hooks/useEmojiNative.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
12
12
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
13
|
-
import { textToAppleEmojiHtml as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
13
|
+
import { textToAppleEmojiHtml as $, textContainsEmoji as ot } from "../../../functions/renderAppleEmojis.js";
|
|
14
|
+
import at from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
15
|
+
import Kt from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
|
|
16
|
+
import Qt from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
17
|
+
import Zt from "../../1_icons/AvatarIcon.vue.js";
|
|
18
|
+
import te from "../../1_icons/VerifiedBadge.vue.js";
|
|
19
|
+
import ee from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
|
|
20
|
+
import ne from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
|
|
21
|
+
import ie from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
|
|
22
|
+
import oe from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
|
|
23
|
+
import ae from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
|
|
24
|
+
import st from "./icons/AudioIcon.vue.js";
|
|
24
25
|
import j from "./icons/FileIcon.vue.js";
|
|
25
26
|
import ct from "./icons/ImageIcon.vue.js";
|
|
26
|
-
import
|
|
27
|
+
import se from "./icons/MissedCallIcon.vue.js";
|
|
27
28
|
import X from "./icons/StickerIcon.vue.js";
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
const
|
|
29
|
+
import rt from "./icons/VideoIcon.vue.js";
|
|
30
|
+
import lt from "./icons/VoiceIcon.vue.js";
|
|
31
|
+
const ce = ["data-chat-id"], re = { class: "chat-item__avatar-container" }, le = ["src"], ue = {
|
|
31
32
|
key: 1,
|
|
32
33
|
class: "chat-item__avatar-placeholder"
|
|
33
|
-
},
|
|
34
|
+
}, me = { class: "chat-item__info-container" }, de = { class: "chat-item__title-row" }, he = ["innerHTML"], fe = {
|
|
34
35
|
key: 1,
|
|
35
36
|
class: "chat-item__name"
|
|
36
|
-
},
|
|
37
|
+
}, ve = {
|
|
37
38
|
key: 0,
|
|
38
39
|
class: "chat-item__last-message"
|
|
39
|
-
},
|
|
40
|
+
}, ge = {
|
|
40
41
|
key: 1,
|
|
41
42
|
class: "chat-item__last-message-text chat-item__last-message-text--draft"
|
|
42
|
-
},
|
|
43
|
+
}, ye = { class: "chat-item__draft-label" }, pe = ["innerHTML"], _e = {
|
|
43
44
|
key: 2,
|
|
44
45
|
class: "chat-item__draft-text"
|
|
45
|
-
},
|
|
46
|
+
}, ke = ["innerHTML"], xe = {
|
|
46
47
|
key: 3,
|
|
47
48
|
class: "chat-item__last-message-text"
|
|
48
|
-
},
|
|
49
|
+
}, we = { class: "chat-item__details-container" }, Ce = {
|
|
49
50
|
key: 0,
|
|
50
51
|
class: "chat-item__time"
|
|
51
|
-
},
|
|
52
|
+
}, Ie = { class: "chat-item__status-unread-container" }, Te = {
|
|
52
53
|
key: 1,
|
|
53
54
|
class: "chat-item__unread"
|
|
54
|
-
},
|
|
55
|
+
}, Me = {
|
|
55
56
|
key: 2,
|
|
56
57
|
class: "chat-item__status-chat-container"
|
|
57
|
-
},
|
|
58
|
+
}, Ee = {
|
|
58
59
|
key: 0,
|
|
59
60
|
class: "chat-item__fixed pi pi-thumbtack"
|
|
60
|
-
},
|
|
61
|
+
}, Se = {
|
|
61
62
|
key: 0,
|
|
62
63
|
id: "noSelectButton",
|
|
63
64
|
class: "chat-item__menu-button"
|
|
64
|
-
},
|
|
65
|
+
}, Le = {
|
|
65
66
|
key: 1,
|
|
66
67
|
id: "noSelectButton",
|
|
67
68
|
class: "chat-item__menu-button"
|
|
68
|
-
},
|
|
69
|
+
}, be = {
|
|
69
70
|
key: 0,
|
|
70
71
|
class: "dialog__container"
|
|
71
|
-
},
|
|
72
|
+
}, Ae = ["onClick"], Be = ["src"], Ve = {
|
|
72
73
|
key: 1,
|
|
73
74
|
class: "dialog__icon pi pi-user"
|
|
74
|
-
},
|
|
75
|
+
}, De = { class: "dialog__text-container" }, He = { class: "dialog__name" }, Ne = { class: "dialog__time" }, fn = /* @__PURE__ */ Ht({
|
|
75
76
|
__name: "ChatItem",
|
|
76
77
|
props: {
|
|
77
78
|
chat: {},
|
|
@@ -79,59 +80,64 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
|
|
|
79
80
|
contextMenuTrigger: { default: "hover" }
|
|
80
81
|
},
|
|
81
82
|
emits: ["select", "action", "expand"],
|
|
82
|
-
setup(
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
setup(s, { emit: ut }) {
|
|
84
|
+
const S = Nt("chatAppId"), { getTheme: Y } = Gt(S), { isNative: z, emojiSrc: B } = Jt(S), mt = qt(String(S ?? "")), n = s, L = ut, y = Ut(), p = E(!1), k = E(!1), V = E(!1), dt = E(null), x = l(
|
|
85
|
+
() => {
|
|
86
|
+
var t;
|
|
87
|
+
return (((t = n.chat.actions) == null ? void 0 : t.length) ?? 0) > 0;
|
|
88
|
+
}
|
|
89
|
+
), ht = () => {
|
|
90
|
+
V.value = !0;
|
|
87
91
|
}, ft = (t) => {
|
|
88
|
-
|
|
89
|
-
}, vt = (
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
+
V.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && L("select", { chat: n.chat, dialog: null }), V.value = !1;
|
|
93
|
+
}, vt = (t) => {
|
|
94
|
+
L("select", { chat: n.chat, dialog: t });
|
|
95
|
+
}, gt = () => n.chat.isSelected ? "chat-item__selected" : "", yt = (t) => t.isSelected ? "dialog__selected" : "", O = (t) => {
|
|
96
|
+
n.contextMenuTrigger === "rightClick" && D(), L("action", { chat: n.chat, ...t });
|
|
97
|
+
}, D = () => {
|
|
92
98
|
const t = document.getElementById("context-menu-rightclick-" + y);
|
|
93
99
|
t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.display = "none"), k.value = !1;
|
|
94
|
-
},
|
|
100
|
+
}, pt = () => {
|
|
95
101
|
document.querySelectorAll('[id^="context-menu-rightclick-"]').forEach((e) => {
|
|
96
102
|
const i = e;
|
|
97
103
|
i.id !== "context-menu-rightclick-" + y && (i.style.top = "0", i.style.left = "0", i.style.opacity = "0", i.style.display = "none");
|
|
98
104
|
});
|
|
99
|
-
},
|
|
100
|
-
let
|
|
101
|
-
const _ =
|
|
102
|
-
var
|
|
105
|
+
}, _t = () => n.chat.dialogs ? [...n.chat.dialogs].sort((t, e) => Number(t["lastActivity.timestamp"]) > Number(e["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(e["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(e["lastActivity.timestamp"]), 0)) : [], kt = l(() => zt(n.chat["lastMessage.status"])), xt = l(() => n.chat.showEmptyIndicator || n.chat.countUnread > 0), wt = l(() => n.chat.countUnread > 0 ? n.chat.countUnread > 99 ? "99+" : n.chat.countUnread : n.chat.showEmptyIndicator ? "" : void 0);
|
|
106
|
+
let b;
|
|
107
|
+
const _ = E(0), q = [A("component.ChatItem.typing") + ".", A("component.ChatItem.typing") + "..", A("component.ChatItem.typing") + "..."], G = (t) => {
|
|
108
|
+
var u, r, v;
|
|
103
109
|
if (typeof t == "string")
|
|
104
110
|
return t;
|
|
105
111
|
if ((t == null ? void 0 : t.type) === "message.sticker")
|
|
106
112
|
return "Стикер";
|
|
107
113
|
if ((t == null ? void 0 : t.type) === "message.audio")
|
|
108
|
-
return (t.isVoiceMessage || ((
|
|
114
|
+
return (t.isVoiceMessage || ((u = t == null ? void 0 : t.data) == null ? void 0 : u.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
|
|
109
115
|
if ((t == null ? void 0 : t.type) === "message.missedCall")
|
|
110
116
|
return "Пропущенный звонок";
|
|
111
|
-
const e = (
|
|
117
|
+
const e = (r = t == null ? void 0 : t.data) == null ? void 0 : r.text;
|
|
112
118
|
if (e)
|
|
113
119
|
return e;
|
|
114
120
|
const i = (v = t == null ? void 0 : t.data) == null ? void 0 : v.filename;
|
|
115
121
|
return i || "";
|
|
116
|
-
},
|
|
122
|
+
}, Ct = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, H = A("component.ChatItem.draft"), N = l(() => {
|
|
117
123
|
var e;
|
|
118
|
-
const t =
|
|
124
|
+
const t = mt.getChatDraft(String(S ?? ""), n.chat.chatId);
|
|
119
125
|
if (!(!t || t.edit) && !(!t.listPreviewText && !t.listPreviewFile) && !(!(t.text || "").trim() && !t.file && !((e = t.files) != null && e.length)))
|
|
120
126
|
return t;
|
|
121
|
-
}),
|
|
127
|
+
}), w = l(() => !!N.value), g = l(() => {
|
|
122
128
|
var e;
|
|
123
|
-
const t =
|
|
129
|
+
const t = N.value;
|
|
124
130
|
return t ? t.file ? (((e = t.listPreviewFile) == null ? void 0 : e.name) || t.file.name || "").trim() : (t.listPreviewText || "").trim() : "";
|
|
125
|
-
}),
|
|
126
|
-
const t =
|
|
131
|
+
}), J = l(() => {
|
|
132
|
+
const t = N.value;
|
|
127
133
|
if (!(t != null && t.file)) return null;
|
|
128
|
-
const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(),
|
|
129
|
-
return i === "sticker" ||
|
|
130
|
-
}),
|
|
131
|
-
var e, i,
|
|
132
|
-
if (n.chat.typing ||
|
|
134
|
+
const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(), u = ((e == null ? void 0 : e.name) || t.file.name || "").toLowerCase();
|
|
135
|
+
return i === "sticker" || u.endsWith(".tgs") || u.endsWith(".webp") ? X : i === "image" || i.includes("image") ? ct : i === "video" || i.includes("video") ? rt : i === "audio" || i.includes("audio") ? u.includes("voice") || u.includes("голос") ? lt : st : i === "file" || u ? j : j;
|
|
136
|
+
}), It = l(() => $(g.value || "", null, B.value)), K = l(() => {
|
|
137
|
+
var e, i, u;
|
|
138
|
+
if (n.chat.typing || w.value)
|
|
133
139
|
return null;
|
|
134
|
-
const t =
|
|
140
|
+
const t = Ct(n.chat.lastMessage);
|
|
135
141
|
if (!t)
|
|
136
142
|
return null;
|
|
137
143
|
if (t === "message.sticker")
|
|
@@ -139,226 +145,230 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
|
|
|
139
145
|
if (t === "message.image")
|
|
140
146
|
return ct;
|
|
141
147
|
if (t === "message.video")
|
|
142
|
-
return
|
|
148
|
+
return rt;
|
|
143
149
|
if (t === "message.audio") {
|
|
144
|
-
const
|
|
145
|
-
return (
|
|
150
|
+
const r = n.chat.lastMessage;
|
|
151
|
+
return (r.isVoiceMessage || ((e = r == null ? void 0 : r.data) == null ? void 0 : e.isVoiceMessage)) === !0 ? lt : st;
|
|
146
152
|
}
|
|
147
153
|
if (t === "message.missedCall")
|
|
148
|
-
return
|
|
154
|
+
return se;
|
|
149
155
|
if (t === "message.file") {
|
|
150
|
-
const
|
|
156
|
+
const r = n.chat.lastMessage, v = ((u = (i = r == null ? void 0 : r.data) == null ? void 0 : i.filename) == null ? void 0 : u.toLowerCase()) || "";
|
|
151
157
|
return v.endsWith(".tgs") || v.endsWith(".webp") ? X : j;
|
|
152
158
|
}
|
|
153
159
|
return null;
|
|
154
|
-
}),
|
|
155
|
-
() =>
|
|
156
|
-
),
|
|
157
|
-
() =>
|
|
158
|
-
),
|
|
159
|
-
|
|
160
|
+
}), Tt = l(() => n.chat.typing ? q[_.value] : w.value ? g.value ? `${H} ${g.value}` : H : G(n.chat.lastMessage)), U = l(() => n.chat.typing ? q[_.value] : G(n.chat.lastMessage)), Q = l(
|
|
161
|
+
() => !z.value && ot(g.value || U.value || "")
|
|
162
|
+
), Mt = l(
|
|
163
|
+
() => !z.value && ot(n.chat.name || "")
|
|
164
|
+
), Et = l(() => $(U.value || "", null, B.value)), St = l(() => $(n.chat.name || "", null, B.value));
|
|
165
|
+
Ft(
|
|
160
166
|
() => n.chat.typing,
|
|
161
167
|
() => {
|
|
162
|
-
n.chat.typing ?
|
|
168
|
+
n.chat.typing ? b = setInterval(() => {
|
|
163
169
|
_.value < 2 ? _.value += 1 : _.value = 0;
|
|
164
|
-
}, 1e3) : (_.value = 0,
|
|
170
|
+
}, 1e3) : (_.value = 0, b && (clearInterval(b), b = void 0));
|
|
165
171
|
},
|
|
166
172
|
{ immediate: !0 }
|
|
167
173
|
);
|
|
168
|
-
const
|
|
169
|
-
n.contextMenuTrigger === "hover" && (p.value = !0);
|
|
170
|
-
}, Lt = (t) => {
|
|
171
|
-
n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
|
|
174
|
+
const Lt = () => {
|
|
175
|
+
n.contextMenuTrigger === "hover" && x.value && (p.value = !0);
|
|
172
176
|
}, bt = (t) => {
|
|
173
|
-
n.contextMenuTrigger === "
|
|
177
|
+
n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
|
|
174
178
|
}, At = (t) => {
|
|
175
|
-
|
|
179
|
+
n.contextMenuTrigger === "rightClick" && x.value && Bt(t);
|
|
180
|
+
}, Bt = (t) => {
|
|
181
|
+
pt(), k.value = !0, F(() => {
|
|
176
182
|
const e = document.getElementById("context-menu-rightclick-" + y);
|
|
177
183
|
if (e) {
|
|
178
|
-
const i = t.clientX,
|
|
184
|
+
const i = t.clientX, u = t.clientY;
|
|
179
185
|
e.style.display = "inherit";
|
|
180
|
-
const
|
|
181
|
-
e.style.display = "none",
|
|
182
|
-
const v = window.innerWidth,
|
|
183
|
-
let
|
|
184
|
-
|
|
186
|
+
const r = e.getBoundingClientRect();
|
|
187
|
+
e.style.display = "none", F(() => {
|
|
188
|
+
const v = window.innerWidth, et = window.innerHeight, C = window.scrollX || window.pageXOffset, I = window.scrollY || window.pageYOffset;
|
|
189
|
+
let T = i + C, M = u + I;
|
|
190
|
+
T + r.width > v + C && (T = i + C - r.width), M + r.height > et + I && (M = u + I - r.height), T < C && (T = C), M < I && (M = I), e.style.top = M + "px", e.style.left = T + "px", e.style.opacity = "1", e.style.display = "inherit";
|
|
185
191
|
});
|
|
186
192
|
}
|
|
187
193
|
});
|
|
188
|
-
}, Bt = () => {
|
|
189
194
|
}, Vt = () => {
|
|
190
|
-
},
|
|
195
|
+
}, Dt = () => {
|
|
196
|
+
}, Z = (t) => {
|
|
191
197
|
if (n.contextMenuTrigger === "rightClick" && k.value) {
|
|
192
198
|
const e = t.target, i = document.getElementById("context-menu-rightclick-" + y);
|
|
193
|
-
(!i || !i.contains(e)) &&
|
|
199
|
+
(!i || !i.contains(e)) && D();
|
|
194
200
|
}
|
|
195
|
-
},
|
|
196
|
-
n.contextMenuTrigger === "rightClick" && k.value &&
|
|
201
|
+
}, tt = () => {
|
|
202
|
+
n.contextMenuTrigger === "rightClick" && k.value && D();
|
|
197
203
|
};
|
|
198
|
-
return
|
|
199
|
-
n.contextMenuTrigger === "rightClick" && (document.addEventListener("click",
|
|
204
|
+
return Pt(() => {
|
|
205
|
+
n.contextMenuTrigger === "rightClick" && (document.addEventListener("click", Z), window.addEventListener("scroll", tt, !0), F(() => {
|
|
200
206
|
const t = document.getElementById("context-menu-rightclick-" + y);
|
|
201
207
|
t && (t.style.display = "none", t.style.opacity = "0");
|
|
202
208
|
}));
|
|
203
|
-
}),
|
|
204
|
-
document.removeEventListener("click",
|
|
205
|
-
}), (t, e) => (o(),
|
|
209
|
+
}), Rt(() => {
|
|
210
|
+
document.removeEventListener("click", Z), window.removeEventListener("scroll", tt, !0);
|
|
211
|
+
}), (t, e) => (o(), a("div", null, [
|
|
206
212
|
m("div", {
|
|
207
213
|
ref_key: "containerRef",
|
|
208
|
-
ref:
|
|
209
|
-
class:
|
|
214
|
+
ref: dt,
|
|
215
|
+
class: P(["chat-item__container", gt()]),
|
|
210
216
|
"data-testid": "chat-item",
|
|
211
217
|
"data-chat-id": n.chat.chatId,
|
|
212
|
-
onMouseenter:
|
|
213
|
-
onMouseleave:
|
|
214
|
-
onClick:
|
|
215
|
-
onContextmenu:
|
|
218
|
+
onMouseenter: Lt,
|
|
219
|
+
onMouseleave: bt,
|
|
220
|
+
onClick: ft,
|
|
221
|
+
onContextmenu: Wt(At, ["prevent"])
|
|
216
222
|
}, [
|
|
217
|
-
m("div",
|
|
223
|
+
m("div", re, [
|
|
218
224
|
m("span", {
|
|
219
225
|
class: "chat-item__status-user",
|
|
220
|
-
style:
|
|
226
|
+
style: nt({ backgroundColor: n.chat.status })
|
|
221
227
|
}, null, 4),
|
|
222
|
-
n.chat.avatar ? (o(),
|
|
228
|
+
n.chat.avatar ? (o(), a("img", {
|
|
223
229
|
key: 0,
|
|
224
230
|
src: n.chat.avatar,
|
|
225
231
|
height: "48",
|
|
226
232
|
width: "48"
|
|
227
|
-
}, null, 8,
|
|
228
|
-
|
|
233
|
+
}, null, 8, le)) : (o(), a("div", ue, [
|
|
234
|
+
R(Zt)
|
|
229
235
|
]))
|
|
230
236
|
]),
|
|
231
|
-
m("div",
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
237
|
+
m("div", me, [
|
|
238
|
+
m("div", de, [
|
|
239
|
+
R(at, {
|
|
240
|
+
text: s.chat.name,
|
|
241
|
+
position: "bottom"
|
|
242
|
+
}, {
|
|
243
|
+
default: W(() => [
|
|
244
|
+
Mt.value ? (o(), a("div", {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "chat-item__name",
|
|
247
|
+
innerHTML: St.value
|
|
248
|
+
}, null, 8, he)) : (o(), a("div", fe, f(s.chat.name), 1))
|
|
249
|
+
]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 8, ["text"]),
|
|
252
|
+
s.chat.verified ? (o(), d(te, { key: 0 })) : c("", !0),
|
|
253
|
+
$t(t.$slots, "name-suffix", {}, void 0, !0)
|
|
254
|
+
]),
|
|
255
|
+
R(at, {
|
|
256
|
+
text: Tt.value,
|
|
247
257
|
position: "bottom"
|
|
248
258
|
}, {
|
|
249
|
-
default:
|
|
250
|
-
|
|
251
|
-
|
|
259
|
+
default: W(() => [
|
|
260
|
+
s.chat.lastMessage || s.chat.typing || w.value ? (o(), a("div", ve, [
|
|
261
|
+
K.value && !w.value ? (o(), d(it(K.value), {
|
|
252
262
|
key: 0,
|
|
253
263
|
class: "chat-item__message-icon"
|
|
254
|
-
})) :
|
|
255
|
-
|
|
256
|
-
m("span",
|
|
257
|
-
|
|
264
|
+
})) : c("", !0),
|
|
265
|
+
w.value ? (o(), a("span", ge, [
|
|
266
|
+
m("span", ye, f(h(H)), 1),
|
|
267
|
+
J.value ? (o(), d(it(J.value), {
|
|
258
268
|
key: 0,
|
|
259
269
|
class: "chat-item__message-icon"
|
|
260
|
-
})) :
|
|
261
|
-
g.value &&
|
|
270
|
+
})) : c("", !0),
|
|
271
|
+
g.value && Q.value ? (o(), a("span", {
|
|
262
272
|
key: 1,
|
|
263
273
|
class: "chat-item__draft-text",
|
|
264
|
-
innerHTML:
|
|
265
|
-
}, null, 8,
|
|
266
|
-
])) :
|
|
274
|
+
innerHTML: It.value
|
|
275
|
+
}, null, 8, pe)) : g.value ? (o(), a("span", _e, f(g.value), 1)) : c("", !0)
|
|
276
|
+
])) : Q.value ? (o(), a("span", {
|
|
267
277
|
key: 2,
|
|
268
278
|
class: "chat-item__last-message-text",
|
|
269
|
-
innerHTML:
|
|
270
|
-
}, null, 8,
|
|
271
|
-
])) :
|
|
279
|
+
innerHTML: Et.value
|
|
280
|
+
}, null, 8, ke)) : (o(), a("span", xe, f(U.value), 1))
|
|
281
|
+
])) : c("", !0)
|
|
272
282
|
]),
|
|
273
283
|
_: 1
|
|
274
284
|
}, 8, ["text"])
|
|
275
285
|
]),
|
|
276
|
-
m("div",
|
|
277
|
-
|
|
278
|
-
p.value &&
|
|
286
|
+
m("div", we, [
|
|
287
|
+
s.chat["lastActivity.time"] && (!x.value || !p.value) ? (o(), a("div", Ce, f(s.chat["lastActivity.time"]), 1)) : c("", !0),
|
|
288
|
+
p.value && x.value && s.contextMenuTrigger === "hover" ? (o(), d(Kt, {
|
|
279
289
|
key: 1,
|
|
280
290
|
mode: "click",
|
|
281
291
|
"menu-side": "bottom-right",
|
|
282
|
-
actions:
|
|
283
|
-
onClick:
|
|
284
|
-
onButtonClick:
|
|
292
|
+
actions: s.chat.actions,
|
|
293
|
+
onClick: O,
|
|
294
|
+
onButtonClick: ht,
|
|
285
295
|
onMenuMouseLeave: e[0] || (e[0] = (i) => p.value = !1)
|
|
286
296
|
}, {
|
|
287
|
-
default:
|
|
297
|
+
default: W(() => [...e[2] || (e[2] = [
|
|
288
298
|
m("span", { class: "pi pi-ellipsis-h chat-item__actions-trigger" }, null, -1)
|
|
289
299
|
])]),
|
|
290
300
|
_: 1
|
|
291
|
-
}, 8, ["actions"])) :
|
|
292
|
-
(o(), d(
|
|
293
|
-
|
|
301
|
+
}, 8, ["actions"])) : c("", !0),
|
|
302
|
+
(o(), d(jt, { to: "body" }, [
|
|
303
|
+
s.contextMenuTrigger === "rightClick" && x.value && k.value ? (o(), d(Qt, {
|
|
294
304
|
key: 0,
|
|
295
305
|
id: "context-menu-rightclick-" + h(y),
|
|
296
|
-
actions:
|
|
306
|
+
actions: s.chat.actions,
|
|
297
307
|
"data-theme": h(Y)().theme ? h(Y)().theme : "light",
|
|
298
|
-
onClick:
|
|
299
|
-
onMouseenter:
|
|
300
|
-
onMouseleave:
|
|
301
|
-
}, null, 8, ["id", "actions", "data-theme"])) :
|
|
308
|
+
onClick: O,
|
|
309
|
+
onMouseenter: Vt,
|
|
310
|
+
onMouseleave: Dt
|
|
311
|
+
}, null, 8, ["id", "actions", "data-theme"])) : c("", !0)
|
|
302
312
|
])),
|
|
303
|
-
m("div",
|
|
304
|
-
h(
|
|
313
|
+
m("div", Ie, [
|
|
314
|
+
h(Ot).includes(s.chat["lastMessage.status"]) ? (o(), a("div", {
|
|
305
315
|
key: 0,
|
|
306
|
-
class:
|
|
316
|
+
class: P(["chat-item__status-message", kt.value])
|
|
307
317
|
}, [
|
|
308
|
-
|
|
309
|
-
], 2)) :
|
|
310
|
-
|
|
318
|
+
s.chat["lastMessage.status"] === "pending" ? (o(), d(h(ne), { key: 0 })) : s.chat["lastMessage.status"] === "error" ? (o(), d(h(ee), { key: 1 })) : s.chat["lastMessage.status"] === "read" ? (o(), d(h(ie), { key: 2 })) : s.chat["lastMessage.status"] === "received" ? (o(), d(h(oe), { key: 3 })) : (o(), d(h(ae), { key: 4 }))
|
|
319
|
+
], 2)) : c("", !0),
|
|
320
|
+
xt.value ? (o(), a("div", Te, f(wt.value), 1)) : c("", !0)
|
|
311
321
|
]),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
])) :
|
|
322
|
+
s.chat.countUnread < 1 ? (o(), a("div", Me, [
|
|
323
|
+
s.chat.isFixedTop || s.chat.isFixedBottom ? (o(), a("span", Ee)) : c("", !0)
|
|
324
|
+
])) : c("", !0)
|
|
315
325
|
]),
|
|
316
|
-
n.showDialogs &&
|
|
326
|
+
n.showDialogs && s.chat.dialogs ? (o(), a("div", {
|
|
317
327
|
key: 0,
|
|
318
328
|
class: "chat-item__dialog-buttons",
|
|
319
|
-
onClick: e[1] || (e[1] = (i) =>
|
|
329
|
+
onClick: e[1] || (e[1] = (i) => L("expand", n.chat))
|
|
320
330
|
}, [
|
|
321
|
-
n.showDialogs && !
|
|
331
|
+
n.showDialogs && !s.chat.dialogsExpanded ? (o(), a("button", Se, [...e[3] || (e[3] = [
|
|
322
332
|
m("span", {
|
|
323
333
|
id: "noSelectButton",
|
|
324
334
|
class: "pi pi-angle-down"
|
|
325
335
|
}, null, -1)
|
|
326
|
-
])])) :
|
|
327
|
-
n.showDialogs &&
|
|
336
|
+
])])) : c("", !0),
|
|
337
|
+
n.showDialogs && s.chat.dialogsExpanded ? (o(), a("button", Le, [...e[4] || (e[4] = [
|
|
328
338
|
m("span", {
|
|
329
339
|
id: "noSelectButton",
|
|
330
340
|
class: "pi pi-angle-up"
|
|
331
341
|
}, null, -1)
|
|
332
|
-
])])) :
|
|
333
|
-
])) :
|
|
334
|
-
], 42,
|
|
335
|
-
n.showDialogs &&
|
|
336
|
-
(o(!0),
|
|
342
|
+
])])) : c("", !0)
|
|
343
|
+
])) : c("", !0)
|
|
344
|
+
], 42, ce),
|
|
345
|
+
n.showDialogs && s.chat.dialogsExpanded ? (o(), a("div", be, [
|
|
346
|
+
(o(!0), a(Xt, null, Yt(_t(), (i) => (o(), a("div", {
|
|
337
347
|
key: i.dialogId,
|
|
338
|
-
class:
|
|
339
|
-
onClick: (
|
|
348
|
+
class: P(["dialog__item", yt(i)]),
|
|
349
|
+
onClick: (u) => vt(i)
|
|
340
350
|
}, [
|
|
341
|
-
i.icon ? (o(),
|
|
351
|
+
i.icon ? (o(), a("img", {
|
|
342
352
|
key: 0,
|
|
343
353
|
class: "dialog__icon",
|
|
344
354
|
src: i.icon,
|
|
345
355
|
height: "16",
|
|
346
356
|
width: "16"
|
|
347
|
-
}, null, 8,
|
|
348
|
-
m("div",
|
|
349
|
-
m("div",
|
|
350
|
-
m("div",
|
|
357
|
+
}, null, 8, Be)) : (o(), a("span", Ve)),
|
|
358
|
+
m("div", De, [
|
|
359
|
+
m("div", He, f(i.name), 1),
|
|
360
|
+
m("div", Ne, f(i["lastActivity.time"]), 1)
|
|
351
361
|
]),
|
|
352
|
-
i.countUnread > 0 ? (o(),
|
|
362
|
+
i.countUnread > 0 ? (o(), a("div", {
|
|
353
363
|
key: 2,
|
|
354
364
|
class: "chat-item__unread",
|
|
355
|
-
style:
|
|
356
|
-
}, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) :
|
|
357
|
-
], 10,
|
|
358
|
-
])) :
|
|
365
|
+
style: nt(i.colorUnread ? { backgroundColor: i.colorUnread } : {})
|
|
366
|
+
}, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) : c("", !0)
|
|
367
|
+
], 10, Ae))), 128))
|
|
368
|
+
])) : c("", !0)
|
|
359
369
|
]));
|
|
360
370
|
}
|
|
361
371
|
});
|
|
362
372
|
export {
|
|
363
|
-
|
|
373
|
+
fn as default
|
|
364
374
|
};
|