@mobilon-dev/chotto 0.3.31 → 0.3.33
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_atoms/LoadingIndicator/LoadingIndicator.vue.js +23 -0
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.js +1 -1
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +340 -0
- package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +20 -0
- package/dist/components/3_compounds/ChatList/ChatList.vue.js +61 -52
- package/dist/index.js +191 -189
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/apps/data/images/stickers/animated/index.d.ts +9 -0
- package/dist/types/apps/data/images/stickers/index.d.ts +10 -0
- package/dist/types/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.d.ts +7 -0
- package/dist/types/components/1_atoms/LoadingIndicator/stories/LoadingIndicator.stories.d.ts +9 -0
- package/dist/types/components/1_atoms/LoadingIndicator/styles/types.d.ts +49 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.d.ts +1 -1
- package/dist/types/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.d.ts +13 -0
- package/dist/types/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.d.ts +2 -0
- package/dist/types/components/2_chatinput_elements/StickerPicker/icons/index.d.ts +1 -0
- package/dist/types/components/2_chatinput_elements/StickerPicker/stories/StickerPicker.stories.d.ts +12 -0
- package/dist/types/components/2_chatinput_elements/StickerPicker/styles/types.d.ts +275 -0
- package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +2 -0
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createElementBlock as d, createCommentVNode as s, openBlock as o, createStaticVNode as a } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import l from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const i = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "messages-loading-indicator"
|
|
7
|
+
}, c = {
|
|
8
|
+
__name: "LoadingIndicator",
|
|
9
|
+
props: {
|
|
10
|
+
isLoading: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(t) {
|
|
16
|
+
return (r, e) => t.isLoading ? (o(), d("div", i, [...e[0] || (e[0] = [
|
|
17
|
+
a('<svg width="120px" height="116px" viewBox="-8 -8 120 116" xmlns="http://www.w3.org/2000/svg" data-v-eed64d67><ellipse class="dot dot-1" cx="51.75" cy="18.82" rx="12.18" ry="12.14" data-v-eed64d67></ellipse><ellipse class="dot dot-2" cx="84.42" cy="42.24" rx="12.18" ry="12.14" data-v-eed64d67></ellipse><ellipse class="dot dot-3" cx="72.00" cy="80.35" rx="12.18" ry="12.14" data-v-eed64d67></ellipse><ellipse class="dot dot-4" cx="31.51" cy="80.35" rx="12.18" ry="12.14" data-v-eed64d67></ellipse><ellipse class="dot dot-5" cx="18.86" cy="42.24" rx="12.18" ry="12.14" data-v-eed64d67></ellipse></svg>', 1)
|
|
18
|
+
])])) : s("", !0);
|
|
19
|
+
}
|
|
20
|
+
}, m = /* @__PURE__ */ l(c, [["__scopeId", "data-v-eed64d67"]]);
|
|
21
|
+
export {
|
|
22
|
+
m as default
|
|
23
|
+
};
|
|
@@ -9,7 +9,7 @@ import v from "../icons/CommunicationPanelSubmenuWhatsAppIcon.vue.js";
|
|
|
9
9
|
import x from "../icons/CommunicationPanelSubmenuTelegramIcon.vue.js";
|
|
10
10
|
import w from "../icons/CommunicationPanelSubmenuMaxIcon.vue.js";
|
|
11
11
|
import A from "../icons/CommunicationPanelSubmenuSMSIcon.vue.js";
|
|
12
|
-
const F = ["
|
|
12
|
+
const F = ["whatsapp", "telegram", "max", "sms", "phone"], y = {
|
|
13
13
|
phone: P,
|
|
14
14
|
whatsapp: S,
|
|
15
15
|
telegram: M,
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { ref as c, inject as Pe, computed as y, watch as V, onMounted as Le, onUnmounted as Ee, createElementBlock as o, openBlock as i, Fragment as j, createCommentVNode as M, createVNode as S, unref as w, normalizeClass as J, createElementVNode as P, Transition as Q, withCtx as Z, withDirectives as Ce, renderList as x, toDisplayString as ee, vShow as Ue, normalizeStyle as $e } from "vue";
|
|
2
|
+
import { useMessageDraft as De } from "../../../hooks/useMessageDraft.js";
|
|
3
|
+
import "../../../hooks/useSearchModel.js";
|
|
4
|
+
import "../../../hooks/useTheme.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import Ae from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
9
|
+
import "../../../functions/parseMarkdown.js";
|
|
10
|
+
import te from "./icons/StickerIcon.vue.js";
|
|
11
|
+
import { isAnimatedSticker as L } from "../../2_feed_elements/StickerMessage/utils/stickerUtils.js";
|
|
12
|
+
import "../../2_feed_elements/StickerMessage/utils/suppress-lit-warning.js";
|
|
13
|
+
/* empty css */
|
|
14
|
+
const Fe = { class: "sticker-picker__container" }, Oe = ["onClick", "onMouseenter", "onMouseleave"], Be = ["src"], Re = ["src", "alt"], We = {
|
|
15
|
+
key: 2,
|
|
16
|
+
class: "sticker-picker__tab-icon-placeholder"
|
|
17
|
+
}, Ve = { class: "sticker-picker__content" }, je = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "sticker-picker__empty"
|
|
20
|
+
}, ze = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "sticker-picker__grid"
|
|
23
|
+
}, Ne = ["onClick", "onMousedown", "onMouseenter", "onTouchstart"], Ge = ["src"], Ie = ["src", "alt"], Xe = ["src"], Ye = ["src", "alt"], Ke = {
|
|
24
|
+
key: 2,
|
|
25
|
+
class: "sticker-picker__preview-label"
|
|
26
|
+
}, qe = 500, He = {
|
|
27
|
+
__name: "StickerPicker",
|
|
28
|
+
props: {
|
|
29
|
+
state: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "active"
|
|
32
|
+
},
|
|
33
|
+
mode: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "click",
|
|
36
|
+
// или 'hover'
|
|
37
|
+
validator: (h) => ["click", "hover"].includes(h)
|
|
38
|
+
},
|
|
39
|
+
stickers: {
|
|
40
|
+
type: Array,
|
|
41
|
+
default: () => []
|
|
42
|
+
// Поддерживаем два формата:
|
|
43
|
+
// 1. Массив стикеров: [{ url, alt? }, ...]
|
|
44
|
+
// 2. Массив наборов (вкладок): [[{ url, alt? }, ...], ...] или [{ stickers: [...], label?, iconUrl? }, ...]
|
|
45
|
+
},
|
|
46
|
+
emptyText: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "Нет доступных стикеров"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
setup(h) {
|
|
52
|
+
const a = h, E = c(null), C = c(null), U = c(null), $ = c(null), v = c(!1), d = c(0), se = Pe("chatAppId"), { getMessage: re, setMessageFile: le, setForceSendMessage: ae } = De(se), n = c(null), D = c({}), m = c(null), u = c(!1), oe = c(null), f = c(/* @__PURE__ */ new Map()), p = c(/* @__PURE__ */ new Map());
|
|
53
|
+
let T = !1, b = !1;
|
|
54
|
+
const k = c(!1), A = c(!1);
|
|
55
|
+
async function z() {
|
|
56
|
+
if (!(k.value || A.value)) {
|
|
57
|
+
A.value = !0;
|
|
58
|
+
try {
|
|
59
|
+
await import("../../2_feed_elements/StickerMessage/libs/tgs-player/lottie-player.esm.js"), await import("../../2_feed_elements/StickerMessage/libs/tgs-player/tgs-player.esm.js"), k.value = !0;
|
|
60
|
+
} catch (e) {
|
|
61
|
+
console.error("Failed to load TGS libraries:", e);
|
|
62
|
+
} finally {
|
|
63
|
+
A.value = !1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const ie = () => {
|
|
68
|
+
if (!a.stickers || a.stickers.length === 0)
|
|
69
|
+
return { hasTabs: !1, tabs: [] };
|
|
70
|
+
const e = a.stickers[0], t = Array.isArray(e), s = e && typeof e == "object" && e.stickers;
|
|
71
|
+
return t ? {
|
|
72
|
+
hasTabs: !0,
|
|
73
|
+
tabs: a.stickers.map((r, l) => ({
|
|
74
|
+
id: `tab-${l}`,
|
|
75
|
+
label: `Set ${l + 1}`,
|
|
76
|
+
stickers: r,
|
|
77
|
+
iconUrl: r && r.length > 0 ? r[0].url : null
|
|
78
|
+
}))
|
|
79
|
+
} : s && e.stickers ? {
|
|
80
|
+
hasTabs: !0,
|
|
81
|
+
tabs: a.stickers.map((r, l) => ({
|
|
82
|
+
id: r.id || `tab-${l}`,
|
|
83
|
+
label: r.label || `Set ${l + 1}`,
|
|
84
|
+
stickers: r.stickers || [],
|
|
85
|
+
iconUrl: r.iconUrl || (r.stickers && r.stickers.length > 0 ? r.stickers[0].url : null)
|
|
86
|
+
}))
|
|
87
|
+
} : {
|
|
88
|
+
hasTabs: !0,
|
|
89
|
+
tabs: [{
|
|
90
|
+
id: "default",
|
|
91
|
+
label: "Stickers",
|
|
92
|
+
stickers: a.stickers,
|
|
93
|
+
iconUrl: a.stickers.length > 0 ? a.stickers[0].url : null
|
|
94
|
+
}]
|
|
95
|
+
};
|
|
96
|
+
}, F = y(() => ie()), ce = y(() => F.value.hasTabs && F.value.tabs.length > 0), _ = y(() => F.value.tabs), O = y(() => {
|
|
97
|
+
var e;
|
|
98
|
+
return _.value.length === 0 ? [] : ((e = _.value[d.value]) == null ? void 0 : e.stickers) || [];
|
|
99
|
+
}), N = y(() => {
|
|
100
|
+
const e = O.value.some((s) => L(s.url)), t = _.value.some((s) => s.iconUrl && L(s.iconUrl));
|
|
101
|
+
return e || t;
|
|
102
|
+
});
|
|
103
|
+
V(N, (e) => {
|
|
104
|
+
e && !k.value && z();
|
|
105
|
+
}, { immediate: !0 });
|
|
106
|
+
const B = (e) => L(e.url), ne = (e, t) => {
|
|
107
|
+
t ? f.value.set(e, t) : f.value.delete(e);
|
|
108
|
+
}, ue = (e, t) => {
|
|
109
|
+
t ? p.value.set(e, t) : p.value.delete(e);
|
|
110
|
+
}, ve = (e) => {
|
|
111
|
+
const t = p.value.get(e);
|
|
112
|
+
t && typeof t.play == "function" && t.play();
|
|
113
|
+
}, fe = (e) => {
|
|
114
|
+
const t = p.value.get(e);
|
|
115
|
+
t && typeof t.pause == "function" && t.pause();
|
|
116
|
+
};
|
|
117
|
+
V(d, () => {
|
|
118
|
+
f.value.clear();
|
|
119
|
+
}), V(() => a.stickers, () => {
|
|
120
|
+
d.value >= _.value.length && (d.value = 0);
|
|
121
|
+
}, { deep: !0 });
|
|
122
|
+
const ke = (e) => {
|
|
123
|
+
if (!e) return "image";
|
|
124
|
+
const t = e.toLowerCase();
|
|
125
|
+
return t.endsWith(".tgs") || t.endsWith(".webp") ? "sticker" : "image";
|
|
126
|
+
}, G = (e) => {
|
|
127
|
+
if (a.state === "disabled") return;
|
|
128
|
+
const t = ke(e.url);
|
|
129
|
+
le({
|
|
130
|
+
url: e.url,
|
|
131
|
+
name: e.alt || `sticker.${t === "sticker" ? e.url.toLowerCase().endsWith(".tgs") ? "tgs" : "webp" : "png"}`,
|
|
132
|
+
type: t
|
|
133
|
+
}), ae(!0), a.mode === "click" && (v.value = !1);
|
|
134
|
+
}, I = (e, t) => {
|
|
135
|
+
oe.value = t.currentTarget, u.value = !1, m.value && clearTimeout(m.value), m.value = setTimeout(() => {
|
|
136
|
+
u.value = !0, _e(e);
|
|
137
|
+
}, qe);
|
|
138
|
+
}, X = () => {
|
|
139
|
+
if (R(), u.value) {
|
|
140
|
+
u.value = !1;
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
}, pe = (e, t) => {
|
|
144
|
+
if (B(e) && k.value) {
|
|
145
|
+
const s = f.value.get(t);
|
|
146
|
+
s && typeof s.play == "function" && s.play();
|
|
147
|
+
}
|
|
148
|
+
}, de = () => {
|
|
149
|
+
f.value.forEach((e) => {
|
|
150
|
+
e && typeof e.pause == "function" && e.pause();
|
|
151
|
+
}), !(u.value && n.value) && (R(), g());
|
|
152
|
+
}, me = (e, t) => {
|
|
153
|
+
I(e, t);
|
|
154
|
+
}, Y = () => {
|
|
155
|
+
X();
|
|
156
|
+
}, he = (e, t) => {
|
|
157
|
+
if (u.value) {
|
|
158
|
+
t.preventDefault(), t.stopPropagation(), u.value = !1, g();
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
G(e);
|
|
162
|
+
}, R = () => {
|
|
163
|
+
m.value && (clearTimeout(m.value), m.value = null);
|
|
164
|
+
}, _e = (e) => {
|
|
165
|
+
n.value = e, D.value = {
|
|
166
|
+
left: "50%",
|
|
167
|
+
top: "50%",
|
|
168
|
+
transform: "translate(-50%, -50%)"
|
|
169
|
+
};
|
|
170
|
+
}, g = () => {
|
|
171
|
+
n.value = null, D.value = {};
|
|
172
|
+
}, ge = () => {
|
|
173
|
+
n.value && (G(n.value), g());
|
|
174
|
+
}, K = () => {
|
|
175
|
+
a.state === "active" && (v.value = !0);
|
|
176
|
+
}, W = () => {
|
|
177
|
+
f.value.forEach((e) => {
|
|
178
|
+
e && typeof e.pause == "function" && e.pause();
|
|
179
|
+
}), p.value.forEach((e) => {
|
|
180
|
+
e && typeof e.pause == "function" && e.pause();
|
|
181
|
+
}), v.value = !1;
|
|
182
|
+
}, ye = () => {
|
|
183
|
+
a.mode === "click" && (v.value = !v.value, v.value && K());
|
|
184
|
+
}, Te = () => {
|
|
185
|
+
a.mode === "hover" && (T = !0, K());
|
|
186
|
+
}, be = () => {
|
|
187
|
+
a.mode === "hover" && (T = !1, setTimeout(() => {
|
|
188
|
+
!b && !T && W();
|
|
189
|
+
}, 150));
|
|
190
|
+
}, Me = () => {
|
|
191
|
+
a.mode === "hover" && (b = !0);
|
|
192
|
+
}, Se = () => {
|
|
193
|
+
a.mode === "hover" && (b = !1, setTimeout(() => {
|
|
194
|
+
!T && !b && W();
|
|
195
|
+
}, 150));
|
|
196
|
+
}, we = (e) => {
|
|
197
|
+
if (!U.value) return;
|
|
198
|
+
const t = e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY;
|
|
199
|
+
U.value.scrollLeft += t, e.preventDefault();
|
|
200
|
+
}, q = (e) => {
|
|
201
|
+
a.mode === "click" && v.value && C.value && E.value && !C.value.contains(e.target) && !E.value.contains(e.target) && W(), n.value && $.value && !$.value.contains(e.target) && g();
|
|
202
|
+
}, H = () => {
|
|
203
|
+
u.value && (u.value = !1);
|
|
204
|
+
};
|
|
205
|
+
return Le(() => {
|
|
206
|
+
document.addEventListener("click", q), document.addEventListener("mouseup", H), N.value && !k.value && z();
|
|
207
|
+
}), Ee(() => {
|
|
208
|
+
document.removeEventListener("click", q), document.removeEventListener("mouseup", H), R(), g(), f.value.forEach((e) => {
|
|
209
|
+
e && typeof e.pause == "function" && e.pause();
|
|
210
|
+
}), f.value.clear(), p.value.forEach((e) => {
|
|
211
|
+
e && typeof e.pause == "function" && e.pause();
|
|
212
|
+
}), p.value.clear();
|
|
213
|
+
}), (e, t) => (i(), o(j, null, [
|
|
214
|
+
w(re)().isRecording ? M("", !0) : (i(), o("button", {
|
|
215
|
+
key: 0,
|
|
216
|
+
ref_key: "stickerButton",
|
|
217
|
+
ref: C,
|
|
218
|
+
class: J(["button", { "button-disabled": h.state === "disabled" }]),
|
|
219
|
+
onClick: ye,
|
|
220
|
+
onMouseenter: Te,
|
|
221
|
+
onMouseleave: be
|
|
222
|
+
}, [
|
|
223
|
+
P("span", null, [
|
|
224
|
+
S(w(te))
|
|
225
|
+
])
|
|
226
|
+
], 34)),
|
|
227
|
+
S(Q, null, {
|
|
228
|
+
default: Z(() => [
|
|
229
|
+
Ce(P("div", {
|
|
230
|
+
ref_key: "stickerPicker",
|
|
231
|
+
ref: E,
|
|
232
|
+
class: "sticker-picker",
|
|
233
|
+
onMouseenter: Me,
|
|
234
|
+
onMouseleave: Se
|
|
235
|
+
}, [
|
|
236
|
+
P("div", Fe, [
|
|
237
|
+
ce.value ? (i(), o("div", {
|
|
238
|
+
key: 0,
|
|
239
|
+
ref_key: "tabsContainer",
|
|
240
|
+
ref: U,
|
|
241
|
+
class: "sticker-picker__tabs",
|
|
242
|
+
onWheel: we
|
|
243
|
+
}, [
|
|
244
|
+
(i(!0), o(j, null, x(_.value, (s, r) => (i(), o("button", {
|
|
245
|
+
key: r,
|
|
246
|
+
class: J(["sticker-picker__tab", { "sticker-picker__tab--active": d.value === r }]),
|
|
247
|
+
onClick: (l) => d.value = r,
|
|
248
|
+
onMouseenter: (l) => ve(r),
|
|
249
|
+
onMouseleave: (l) => fe(r)
|
|
250
|
+
}, [
|
|
251
|
+
s.iconUrl && w(L)(s.iconUrl) && k.value ? (i(), o("tgs-player", {
|
|
252
|
+
key: 0,
|
|
253
|
+
ref_for: !0,
|
|
254
|
+
ref: (l) => ue(r, l),
|
|
255
|
+
src: s.iconUrl,
|
|
256
|
+
class: "sticker-picker__tab-icon sticker-picker__tab-icon-animated",
|
|
257
|
+
loop: "",
|
|
258
|
+
mode: "normal"
|
|
259
|
+
}, null, 8, Be)) : s.iconUrl ? (i(), o("img", {
|
|
260
|
+
key: 1,
|
|
261
|
+
src: s.iconUrl,
|
|
262
|
+
alt: s.label || `Tab ${r + 1}`,
|
|
263
|
+
class: "sticker-picker__tab-icon"
|
|
264
|
+
}, null, 8, Re)) : (i(), o("span", We, [
|
|
265
|
+
S(w(te))
|
|
266
|
+
]))
|
|
267
|
+
], 42, Oe))), 128))
|
|
268
|
+
], 544)) : M("", !0),
|
|
269
|
+
P("div", Ve, [
|
|
270
|
+
O.value.length === 0 ? (i(), o("div", je, ee(h.emptyText), 1)) : (i(), o("div", ze, [
|
|
271
|
+
(i(!0), o(j, null, x(O.value, (s, r) => (i(), o("button", {
|
|
272
|
+
key: r,
|
|
273
|
+
class: "sticker-picker__item",
|
|
274
|
+
onClick: (l) => he(s, l),
|
|
275
|
+
onMousedown: (l) => I(s, l),
|
|
276
|
+
onMouseup: X,
|
|
277
|
+
onMouseenter: (l) => pe(s, r),
|
|
278
|
+
onMouseleave: de,
|
|
279
|
+
onTouchstart: (l) => me(s, l),
|
|
280
|
+
onTouchend: Y,
|
|
281
|
+
onTouchcancel: Y
|
|
282
|
+
}, [
|
|
283
|
+
B(s) && k.value ? (i(), o("tgs-player", {
|
|
284
|
+
key: 0,
|
|
285
|
+
ref_for: !0,
|
|
286
|
+
ref: (l) => ne(r, l),
|
|
287
|
+
src: s.url,
|
|
288
|
+
class: "sticker-picker__image sticker-picker__image-animated",
|
|
289
|
+
loop: "",
|
|
290
|
+
mode: "normal"
|
|
291
|
+
}, null, 8, Ge)) : (i(), o("img", {
|
|
292
|
+
key: 1,
|
|
293
|
+
src: s.url,
|
|
294
|
+
alt: s.alt || `Sticker ${r + 1}`,
|
|
295
|
+
class: "sticker-picker__image"
|
|
296
|
+
}, null, 8, Ie))
|
|
297
|
+
], 40, Ne))), 128))
|
|
298
|
+
]))
|
|
299
|
+
])
|
|
300
|
+
])
|
|
301
|
+
], 544), [
|
|
302
|
+
[Ue, v.value]
|
|
303
|
+
])
|
|
304
|
+
]),
|
|
305
|
+
_: 1
|
|
306
|
+
}),
|
|
307
|
+
S(Q, { name: "preview" }, {
|
|
308
|
+
default: Z(() => [
|
|
309
|
+
n.value ? (i(), o("div", {
|
|
310
|
+
key: 0,
|
|
311
|
+
ref_key: "previewElement",
|
|
312
|
+
ref: $,
|
|
313
|
+
class: "sticker-picker__preview",
|
|
314
|
+
style: $e(D.value),
|
|
315
|
+
onClick: ge
|
|
316
|
+
}, [
|
|
317
|
+
B(n.value) && k.value ? (i(), o("tgs-player", {
|
|
318
|
+
key: 0,
|
|
319
|
+
src: n.value.url,
|
|
320
|
+
class: "sticker-picker__preview-image sticker-picker__preview-image-animated",
|
|
321
|
+
autoplay: "",
|
|
322
|
+
loop: "",
|
|
323
|
+
mode: "normal"
|
|
324
|
+
}, null, 8, Xe)) : (i(), o("img", {
|
|
325
|
+
key: 1,
|
|
326
|
+
src: n.value.url,
|
|
327
|
+
alt: n.value.alt || "Preview",
|
|
328
|
+
class: "sticker-picker__preview-image"
|
|
329
|
+
}, null, 8, Ye)),
|
|
330
|
+
n.value.alt ? (i(), o("div", Ke, ee(n.value.alt), 1)) : M("", !0)
|
|
331
|
+
], 4)) : M("", !0)
|
|
332
|
+
]),
|
|
333
|
+
_: 1
|
|
334
|
+
})
|
|
335
|
+
], 64));
|
|
336
|
+
}
|
|
337
|
+
}, nt = /* @__PURE__ */ Ae(He, [["__scopeId", "data-v-16a91ee6"]]);
|
|
338
|
+
export {
|
|
339
|
+
nt as default
|
|
340
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createElementBlock as t, openBlock as o, createStaticVNode as c } from "vue";
|
|
2
|
+
import l from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const r = {}, n = {
|
|
4
|
+
version: "1.1",
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
7
|
+
width: "23px",
|
|
8
|
+
height: "23px",
|
|
9
|
+
viewBox: "42.67 42.67 170.66 170.66",
|
|
10
|
+
overflow: "visible"
|
|
11
|
+
};
|
|
12
|
+
function i(f, e) {
|
|
13
|
+
return o(), t("svg", n, [...e[0] || (e[0] = [
|
|
14
|
+
c('<g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode:normal;"><g transform="scale(5.33333,5.33333)"><path d="M28.921,42.016l-14.366,-0.016c-4.717,0 -8.555,-3.838 -8.555,-8.556v-18.888c0,-4.718 3.838,-8.556 8.556,-8.556h18.889c4.717,0 8.555,3.838 8.555,8.556v14.554zM14.556,8c-3.615,0 -6.556,2.94 -6.556,6.556v18.889c0,3.615 2.941,6.555 6.556,6.555l13.546,0.016l11.898,-11.742v-13.718c0,-3.616 -2.941,-6.556 -6.556,-6.556z" fill="#5f5f5f"></path><circle cx="16.047" cy="19.023" r="2" fill="#5f5f5f"></circle><circle cx="31.938" cy="19.023" r="2" fill="#5f5f5f"></circle><path d="M23.984,33.016c-3.042,0 -5.872,-1.326 -7.387,-3.461c-0.32,-0.451 -0.214,-1.075 0.237,-1.395c0.452,-0.32 1.074,-0.213 1.394,0.236c1.146,1.615 3.352,2.619 5.756,2.619c2.428,0 4.643,-1.018 5.781,-2.655c0.316,-0.453 0.939,-0.564 1.392,-0.25c0.454,0.315 0.565,0.938 0.25,1.393c-1.506,2.167 -4.35,3.513 -7.423,3.513z" fill="#5f5f5f"></path><path d="M41.972,26.004h-6.839c-5.034,0 -9.13,4.111 -9.13,9.164l0.013,6.832h3.023l12.933,-12.867z" fill="#5f5f5f"></path></g></g>', 1)
|
|
15
|
+
])]);
|
|
16
|
+
}
|
|
17
|
+
const h = /* @__PURE__ */ l(r, [["render", i]]);
|
|
18
|
+
export {
|
|
19
|
+
h as default
|
|
20
|
+
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
1
|
+
import { ref as I, computed as D, createElementBlock as o, openBlock as a, renderSlot as v, createBlock as r, createCommentVNode as n, createElementVNode as i, createVNode as L, unref as e, toDisplayString as u, createTextVNode as Q, Fragment as m, renderList as p, Transition as N, withCtx as V } from "vue";
|
|
2
|
+
import S from "../../2_chatlist_elements/ChatItem/ChatItem.vue.js";
|
|
3
3
|
import $ from "../../2_chatlist_elements/ChatFilter/ChatFilter.vue.js";
|
|
4
4
|
import q from "../../2_chatlist_elements/ChatTabs/ChatTabs.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import M from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
|
|
6
|
+
import { useChatListScroll as P } from "./composables/useChatListScroll.js";
|
|
7
|
+
import { useChatListSelection as U } from "./composables/useChatListSelection.js";
|
|
8
|
+
import { useChatListFilter as W } from "./composables/useChatListFilter.js";
|
|
9
|
+
import { useChatListActions as j } from "./composables/useChatListActions.js";
|
|
9
10
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
const
|
|
11
|
+
import O from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
12
|
+
const R = { class: "chat-list" }, z = {
|
|
12
13
|
key: 2,
|
|
13
14
|
class: "chat-list__search-indicator"
|
|
14
|
-
},
|
|
15
|
+
}, G = { class: "chat-list__search-content" }, H = { class: "chat-list__search-text" }, J = {
|
|
15
16
|
key: 0,
|
|
16
17
|
class: "chat-list__search-progress"
|
|
17
|
-
},
|
|
18
|
+
}, K = {
|
|
18
19
|
key: 1,
|
|
19
20
|
class: "chat-list__search-query"
|
|
20
|
-
},
|
|
21
|
+
}, X = {
|
|
21
22
|
key: 0,
|
|
22
23
|
class: "chat-list__search-stats"
|
|
23
|
-
},
|
|
24
|
+
}, Y = {
|
|
24
25
|
key: 0,
|
|
25
26
|
class: "chat-list__no-data"
|
|
26
|
-
},
|
|
27
|
+
}, Z = { class: "chat-list__fixed-items-top" }, tt = { class: "chat-list__scrollable-items" }, et = { class: "chat-list__fixed-items-bottom" }, st = {
|
|
27
28
|
__name: "ChatList",
|
|
28
29
|
props: {
|
|
29
30
|
chats: {
|
|
@@ -66,45 +67,49 @@ const O = { class: "chat-list" }, R = {
|
|
|
66
67
|
showDialogs: {
|
|
67
68
|
type: Boolean,
|
|
68
69
|
default: !0
|
|
70
|
+
},
|
|
71
|
+
isLoading: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !1
|
|
69
74
|
}
|
|
70
75
|
},
|
|
71
76
|
emits: ["select", "action", "loadMoreChats", "expand", "tab-click", "search", "clear-search"],
|
|
72
77
|
setup(s, { emit: A }) {
|
|
73
|
-
const
|
|
74
|
-
isShowButton:
|
|
78
|
+
const d = s, c = A, _ = I(), k = D(() => d.chats), {
|
|
79
|
+
isShowButton: B,
|
|
75
80
|
scrollToTopForce: C,
|
|
76
81
|
scrollCheck: b,
|
|
77
82
|
startScrollWatch: x,
|
|
78
83
|
stopScrollWatch: T
|
|
79
|
-
} =
|
|
80
|
-
selectChat:
|
|
81
|
-
} =
|
|
82
|
-
getSortedAndFilteredChats:
|
|
83
|
-
getFilter:
|
|
84
|
-
} =
|
|
85
|
-
expandChat:
|
|
84
|
+
} = P({ refChatList: _, chats: k, emit: c }), {
|
|
85
|
+
selectChat: f
|
|
86
|
+
} = U({ chats: k, emit: c }), {
|
|
87
|
+
getSortedAndFilteredChats: h,
|
|
88
|
+
getFilter: E
|
|
89
|
+
} = W({ props: d, emit: c }), {
|
|
90
|
+
expandChat: g,
|
|
86
91
|
action: y,
|
|
87
|
-
handleTabClick:
|
|
88
|
-
} =
|
|
89
|
-
return (w, l) => (a(), o("div",
|
|
92
|
+
handleTabClick: F
|
|
93
|
+
} = j({ emit: c });
|
|
94
|
+
return (w, l) => (a(), o("div", R, [
|
|
90
95
|
v(w.$slots, "header", {}, void 0, !0),
|
|
91
96
|
v(w.$slots, "sidebar", {}, void 0, !0),
|
|
92
97
|
s.filterEnabled ? (a(), r($, {
|
|
93
98
|
key: 0,
|
|
94
99
|
class: "chat-list__filter",
|
|
95
|
-
onUpdate: e(
|
|
100
|
+
onUpdate: e(E)
|
|
96
101
|
}, null, 8, ["onUpdate"])) : n("", !0),
|
|
97
102
|
s.dialogTabs && s.dialogTabs.length > 0 ? (a(), r(q, {
|
|
98
103
|
key: 1,
|
|
99
104
|
tabs: s.dialogTabs,
|
|
100
|
-
onTabClick: e(
|
|
105
|
+
onTabClick: e(F)
|
|
101
106
|
}, null, 8, ["tabs", "onTabClick"])) : n("", !0),
|
|
102
|
-
s.isSearching || s.searchQuery ? (a(), o("div",
|
|
103
|
-
i("div",
|
|
104
|
-
i("div",
|
|
105
|
-
s.isSearching ? (a(), o("span",
|
|
106
|
-
Q(' Поиск "' +
|
|
107
|
-
s.searchStats.loaded > 0 ? (a(), o("span",
|
|
107
|
+
s.isSearching || s.searchQuery ? (a(), o("div", z, [
|
|
108
|
+
i("div", G, [
|
|
109
|
+
i("div", H, [
|
|
110
|
+
s.isSearching ? (a(), o("span", J, u(s.searchProgress || "Поиск..."), 1)) : (a(), o("span", K, [
|
|
111
|
+
Q(' Поиск "' + u(s.searchQuery) + '" завершён ', 1),
|
|
112
|
+
s.searchStats.loaded > 0 ? (a(), o("span", X, " (" + u(s.searchStats.loaded) + " " + u(s.searchStats.total !== "?" ? `из ${s.searchStats.total}` : "") + ") ", 1)) : n("", !0)
|
|
108
113
|
]))
|
|
109
114
|
]),
|
|
110
115
|
s.searchQuery ? (a(), o("button", {
|
|
@@ -119,56 +124,60 @@ const O = { class: "chat-list" }, R = {
|
|
|
119
124
|
])) : n("", !0),
|
|
120
125
|
i("div", {
|
|
121
126
|
ref_key: "refChatList",
|
|
122
|
-
ref:
|
|
127
|
+
ref: _,
|
|
123
128
|
class: "chat-list__items",
|
|
124
129
|
onScroll: l[1] || (l[1] = (...t) => e(b) && e(b)(...t)),
|
|
125
130
|
onMousedown: l[2] || (l[2] = (...t) => e(x) && e(x)(...t)),
|
|
126
131
|
onMouseup: l[3] || (l[3] = (...t) => e(T) && e(T)(...t))
|
|
127
132
|
}, [
|
|
128
|
-
|
|
133
|
+
L(M, {
|
|
134
|
+
class: "chat-list__loading-indicator",
|
|
135
|
+
"is-loading": d.isLoading
|
|
136
|
+
}, null, 8, ["is-loading"]),
|
|
137
|
+
!d.isLoading && e(h)().length === 0 ? (a(), o("div", Y, [...l[6] || (l[6] = [
|
|
129
138
|
i("div", { class: "chat-list__placeholder" }, [
|
|
130
139
|
i("p", { class: "chat-list__placeholder-title" }, " Нет контактных данных, чтобы начать чат "),
|
|
131
140
|
i("p", { class: "chat-list__placeholder-hint" }, " Добавьте номер телефона или имя Telegram в карточку контакта ")
|
|
132
141
|
], -1)
|
|
133
|
-
])])) : (a(), o(
|
|
134
|
-
i("div",
|
|
135
|
-
(a(!0), o(
|
|
142
|
+
])])) : (a(), o(m, { key: 1 }, [
|
|
143
|
+
i("div", Z, [
|
|
144
|
+
(a(!0), o(m, null, p(e(h)().filter((t) => t.isFixedTop), (t) => (a(), r(S, {
|
|
136
145
|
key: t.chatId,
|
|
137
146
|
class: "chat-list__item",
|
|
138
147
|
chat: t,
|
|
139
148
|
"show-dialogs": s.showDialogs,
|
|
140
|
-
onSelect: e(
|
|
141
|
-
onExpand: e(
|
|
149
|
+
onSelect: e(f),
|
|
150
|
+
onExpand: e(g),
|
|
142
151
|
onAction: e(y)
|
|
143
152
|
}, null, 8, ["chat", "show-dialogs", "onSelect", "onExpand", "onAction"]))), 128))
|
|
144
153
|
]),
|
|
145
|
-
i("div",
|
|
146
|
-
(a(!0), o(
|
|
154
|
+
i("div", tt, [
|
|
155
|
+
(a(!0), o(m, null, p(e(h)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (a(), r(S, {
|
|
147
156
|
key: t.chatId,
|
|
148
157
|
class: "chat-list__item",
|
|
149
158
|
chat: t,
|
|
150
159
|
"show-dialogs": s.showDialogs,
|
|
151
|
-
onSelect: e(
|
|
152
|
-
onExpand: e(
|
|
160
|
+
onSelect: e(f),
|
|
161
|
+
onExpand: e(g),
|
|
153
162
|
onAction: e(y)
|
|
154
163
|
}, null, 8, ["chat", "show-dialogs", "onSelect", "onExpand", "onAction"]))), 128))
|
|
155
164
|
]),
|
|
156
|
-
i("div",
|
|
157
|
-
(a(!0), o(
|
|
165
|
+
i("div", et, [
|
|
166
|
+
(a(!0), o(m, null, p(e(h)().filter((t) => t.isFixedBottom), (t) => (a(), r(S, {
|
|
158
167
|
key: t.chatId,
|
|
159
168
|
class: "chat-list__item",
|
|
160
169
|
chat: t,
|
|
161
170
|
"show-dialogs": s.showDialogs,
|
|
162
|
-
onSelect: e(
|
|
163
|
-
onExpand: e(
|
|
171
|
+
onSelect: e(f),
|
|
172
|
+
onExpand: e(g),
|
|
164
173
|
onAction: e(y)
|
|
165
174
|
}, null, 8, ["chat", "show-dialogs", "onSelect", "onExpand", "onAction"]))), 128))
|
|
166
175
|
])
|
|
167
176
|
], 64))
|
|
168
177
|
], 544),
|
|
169
|
-
|
|
178
|
+
L(N, null, {
|
|
170
179
|
default: V(() => [
|
|
171
|
-
e(
|
|
180
|
+
e(B) ? (a(), o("button", {
|
|
172
181
|
key: 0,
|
|
173
182
|
class: "chat-list__button-up",
|
|
174
183
|
onClick: l[4] || (l[4] = (...t) => e(C) && e(C)(...t))
|
|
@@ -180,7 +189,7 @@ const O = { class: "chat-list" }, R = {
|
|
|
180
189
|
})
|
|
181
190
|
]));
|
|
182
191
|
}
|
|
183
|
-
},
|
|
192
|
+
}, ft = /* @__PURE__ */ O(st, [["__scopeId", "data-v-98c65a4e"]]);
|
|
184
193
|
export {
|
|
185
|
-
|
|
194
|
+
ft as default
|
|
186
195
|
};
|