@mobilon-dev/chotto 0.3.32 → 0.3.34
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/ButtonContextMenu/ButtonContextMenu.vue.js +2 -2
- package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +28 -27
- package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +36 -22
- package/dist/components/1_icons/SettingsIcon.vue.js +6 -6
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +164 -156
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +4 -103
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +135 -0
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.js +33 -11
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue2.js +4 -0
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.js +4 -102
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +135 -0
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.js +21 -18
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue2.js +4 -0
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +2 -2
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +89 -55
- package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.js +17 -14
- package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue2.js +4 -0
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +7 -0
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +360 -0
- package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +65 -0
- package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue2.js +4 -0
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +164 -100
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +184 -134
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +1 -1
- package/dist/components/3_compounds/ChatList/ChatList.vue.js +101 -91
- package/dist/components/3_compounds/SideBar/SideBar.vue.js +68 -67
- package/dist/hooks/messages/useChannelAccentColor.js +35 -19
- package/dist/index.js +191 -189
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -0
- 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/apps/data/messages.d.ts +117 -86
- package/dist/types/components/1_atoms/ContextMenu/ContextMenu.vue.d.ts +5 -1
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +4 -0
- package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +31 -7
- package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.d.ts +6 -1
- package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/styles/types.d.ts +6 -0
- package/dist/types/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.d.ts +59 -11
- package/dist/types/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.d.ts +6 -1
- package/dist/types/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.d.ts +6 -1
- package/dist/types/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.d.ts +25 -0
- package/dist/types/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.d.ts +7 -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/2_chatlist_elements/ChatItem/ChatItem.vue.d.ts +2 -0
- package/dist/types/components/2_chatlist_elements/ChatItem/styles/types.d.ts +2 -0
- package/dist/types/components/2_elements/ChatInfo/styles/types.d.ts +2 -0
- package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +18 -0
- package/dist/types/components/2_feed_elements/CallMessage/styles/types.d.ts +24 -0
- package/dist/types/components/2_feed_elements/DateMessage/styles/types.d.ts +6 -0
- package/dist/types/components/2_feed_elements/DateMessageSticky/styles/types.d.ts +4 -0
- package/dist/types/components/2_feed_elements/FeedKeyboard/styles/types.d.ts +2 -0
- package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +12 -0
- package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +126 -0
- package/dist/types/components/2_feed_elements/MessageReactions/styles/types.d.ts +8 -0
- package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +16 -0
- package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
- package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +2 -0
- package/dist/types/components/3_compounds/ChatList/styles/types.d.ts +8 -0
- package/dist/types/components/3_compounds/SideBar/styles/types.d.ts +6 -16
- package/dist/types/components/4_layouts/ChatWrapper/styles/types.d.ts +4 -0
- package/dist/types/components/4_layouts/ExtendedLayout/styles/types.d.ts +8 -0
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as I, computed as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { ref as I, computed as M, createElementBlock as i, openBlock as a, renderSlot as L, createBlock as h, createCommentVNode as n, createElementVNode as r, createVNode as w, unref as e, toDisplayString as u, createTextVNode as D, Fragment as y, renderList as p, Transition as Q, withCtx as N } from "vue";
|
|
2
|
+
import x from "../../2_chatlist_elements/ChatItem/ChatItem.vue.js";
|
|
3
|
+
import V from "../../2_chatlist_elements/ChatFilter/ChatFilter.vue.js";
|
|
4
|
+
import $ from "../../2_chatlist_elements/ChatTabs/ChatTabs.vue.js";
|
|
5
|
+
import q from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
|
|
6
6
|
import { useChatListScroll as P } from "./composables/useChatListScroll.js";
|
|
7
7
|
import { useChatListSelection as U } from "./composables/useChatListSelection.js";
|
|
8
8
|
import { useChatListFilter as W } from "./composables/useChatListFilter.js";
|
|
@@ -22,9 +22,15 @@ const R = { class: "chat-list" }, z = {
|
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "chat-list__search-stats"
|
|
24
24
|
}, Y = {
|
|
25
|
+
key: 3,
|
|
26
|
+
class: "chat-list__fixed-items-top"
|
|
27
|
+
}, Z = {
|
|
25
28
|
key: 0,
|
|
26
29
|
class: "chat-list__no-data"
|
|
27
|
-
},
|
|
30
|
+
}, tt = {
|
|
31
|
+
key: 4,
|
|
32
|
+
class: "chat-list__fixed-items-bottom"
|
|
33
|
+
}, et = {
|
|
28
34
|
__name: "ChatList",
|
|
29
35
|
props: {
|
|
30
36
|
chats: {
|
|
@@ -71,125 +77,129 @@ const R = { class: "chat-list" }, z = {
|
|
|
71
77
|
isLoading: {
|
|
72
78
|
type: Boolean,
|
|
73
79
|
default: !1
|
|
80
|
+
},
|
|
81
|
+
contextMenuTrigger: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: "hover",
|
|
84
|
+
validator: (s) => ["hover", "rightClick"].includes(s)
|
|
74
85
|
}
|
|
75
86
|
},
|
|
76
87
|
emits: ["select", "action", "loadMoreChats", "expand", "tab-click", "search", "clear-search"],
|
|
77
|
-
setup(s, { emit:
|
|
78
|
-
const
|
|
88
|
+
setup(s, { emit: F }) {
|
|
89
|
+
const l = s, d = F, S = I(), k = M(() => l.chats), {
|
|
79
90
|
isShowButton: B,
|
|
80
91
|
scrollToTopForce: C,
|
|
81
|
-
scrollCheck:
|
|
82
|
-
startScrollWatch:
|
|
92
|
+
scrollCheck: _,
|
|
93
|
+
startScrollWatch: b,
|
|
83
94
|
stopScrollWatch: T
|
|
84
|
-
} = P({ refChatList:
|
|
85
|
-
selectChat:
|
|
86
|
-
} = U({ chats: k, emit:
|
|
87
|
-
getSortedAndFilteredChats:
|
|
88
|
-
getFilter:
|
|
89
|
-
} = W({ props:
|
|
90
|
-
expandChat:
|
|
91
|
-
action:
|
|
92
|
-
handleTabClick:
|
|
93
|
-
} = j({ emit:
|
|
94
|
-
return (
|
|
95
|
-
v
|
|
96
|
-
v
|
|
97
|
-
s.filterEnabled ? (a(),
|
|
95
|
+
} = P({ refChatList: S, chats: k, emit: d }), {
|
|
96
|
+
selectChat: g
|
|
97
|
+
} = U({ chats: k, emit: d }), {
|
|
98
|
+
getSortedAndFilteredChats: c,
|
|
99
|
+
getFilter: A
|
|
100
|
+
} = W({ props: l, emit: d }), {
|
|
101
|
+
expandChat: m,
|
|
102
|
+
action: f,
|
|
103
|
+
handleTabClick: E
|
|
104
|
+
} = j({ emit: d });
|
|
105
|
+
return (v, o) => (a(), i("div", R, [
|
|
106
|
+
L(v.$slots, "header", {}, void 0, !0),
|
|
107
|
+
L(v.$slots, "sidebar", {}, void 0, !0),
|
|
108
|
+
s.filterEnabled ? (a(), h(V, {
|
|
98
109
|
key: 0,
|
|
99
110
|
class: "chat-list__filter",
|
|
100
|
-
onUpdate: e(
|
|
111
|
+
onUpdate: e(A)
|
|
101
112
|
}, null, 8, ["onUpdate"])) : n("", !0),
|
|
102
|
-
s.dialogTabs && s.dialogTabs.length > 0 ? (a(),
|
|
113
|
+
s.dialogTabs && s.dialogTabs.length > 0 ? (a(), h($, {
|
|
103
114
|
key: 1,
|
|
104
115
|
tabs: s.dialogTabs,
|
|
105
|
-
onTabClick: e(
|
|
116
|
+
onTabClick: e(E)
|
|
106
117
|
}, null, 8, ["tabs", "onTabClick"])) : n("", !0),
|
|
107
|
-
s.isSearching || s.searchQuery ? (a(),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
s.isSearching ? (a(),
|
|
111
|
-
|
|
112
|
-
s.searchStats.loaded > 0 ? (a(),
|
|
118
|
+
s.isSearching || s.searchQuery ? (a(), i("div", z, [
|
|
119
|
+
r("div", G, [
|
|
120
|
+
r("div", H, [
|
|
121
|
+
s.isSearching ? (a(), i("span", J, u(s.searchProgress || "Поиск..."), 1)) : (a(), i("span", K, [
|
|
122
|
+
D(' Поиск "' + u(s.searchQuery) + '" завершён ', 1),
|
|
123
|
+
s.searchStats.loaded > 0 ? (a(), i("span", X, " (" + u(s.searchStats.loaded) + " " + u(s.searchStats.total !== "?" ? `из ${s.searchStats.total}` : "") + ") ", 1)) : n("", !0)
|
|
113
124
|
]))
|
|
114
125
|
]),
|
|
115
|
-
s.searchQuery ? (a(),
|
|
126
|
+
s.searchQuery ? (a(), i("button", {
|
|
116
127
|
key: 0,
|
|
117
128
|
class: "chat-list__search-clear",
|
|
118
129
|
title: "Очистить поиск",
|
|
119
|
-
onClick:
|
|
120
|
-
}, [...
|
|
121
|
-
|
|
130
|
+
onClick: o[0] || (o[0] = (t) => d("clear-search"))
|
|
131
|
+
}, [...o[5] || (o[5] = [
|
|
132
|
+
r("i", { class: "pi pi-times" }, null, -1)
|
|
122
133
|
])])) : n("", !0)
|
|
123
134
|
])
|
|
124
135
|
])) : n("", !0),
|
|
125
|
-
i("div",
|
|
136
|
+
!l.isLoading && e(c)().filter((t) => t.isFixedTop).length > 0 ? (a(), i("div", Y, [
|
|
137
|
+
(a(!0), i(y, null, p(e(c)().filter((t) => t.isFixedTop), (t) => (a(), h(x, {
|
|
138
|
+
key: t.chatId,
|
|
139
|
+
class: "chat-list__item",
|
|
140
|
+
chat: t,
|
|
141
|
+
"show-dialogs": s.showDialogs,
|
|
142
|
+
"context-menu-trigger": l.contextMenuTrigger,
|
|
143
|
+
onSelect: e(g),
|
|
144
|
+
onExpand: e(m),
|
|
145
|
+
onAction: e(f)
|
|
146
|
+
}, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
|
|
147
|
+
])) : n("", !0),
|
|
148
|
+
r("div", {
|
|
126
149
|
ref_key: "refChatList",
|
|
127
|
-
ref:
|
|
150
|
+
ref: S,
|
|
128
151
|
class: "chat-list__items",
|
|
129
|
-
onScroll:
|
|
130
|
-
onMousedown:
|
|
131
|
-
onMouseup:
|
|
152
|
+
onScroll: o[1] || (o[1] = (...t) => e(_) && e(_)(...t)),
|
|
153
|
+
onMousedown: o[2] || (o[2] = (...t) => e(b) && e(b)(...t)),
|
|
154
|
+
onMouseup: o[3] || (o[3] = (...t) => e(T) && e(T)(...t))
|
|
132
155
|
}, [
|
|
133
|
-
|
|
156
|
+
w(q, {
|
|
134
157
|
class: "chat-list__loading-indicator",
|
|
135
|
-
"is-loading":
|
|
158
|
+
"is-loading": l.isLoading
|
|
136
159
|
}, null, 8, ["is-loading"]),
|
|
137
|
-
!
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
160
|
+
!l.isLoading && e(c)().length === 0 ? (a(), i("div", Z, [...o[6] || (o[6] = [
|
|
161
|
+
r("div", { class: "chat-list__placeholder" }, [
|
|
162
|
+
r("p", { class: "chat-list__placeholder-title" }, " Нет контактных данных, чтобы начать чат "),
|
|
163
|
+
r("p", { class: "chat-list__placeholder-hint" }, " Добавьте номер телефона или имя Telegram в карточку контакта ")
|
|
141
164
|
], -1)
|
|
142
|
-
])])) : (a(),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}, null, 8, ["chat", "show-dialogs", "onSelect", "onExpand", "onAction"]))), 128))
|
|
153
|
-
]),
|
|
154
|
-
i("div", tt, [
|
|
155
|
-
(a(!0), o(m, null, p(e(h)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (a(), r(S, {
|
|
156
|
-
key: t.chatId,
|
|
157
|
-
class: "chat-list__item",
|
|
158
|
-
chat: t,
|
|
159
|
-
"show-dialogs": s.showDialogs,
|
|
160
|
-
onSelect: e(f),
|
|
161
|
-
onExpand: e(g),
|
|
162
|
-
onAction: e(y)
|
|
163
|
-
}, null, 8, ["chat", "show-dialogs", "onSelect", "onExpand", "onAction"]))), 128))
|
|
164
|
-
]),
|
|
165
|
-
i("div", et, [
|
|
166
|
-
(a(!0), o(m, null, p(e(h)().filter((t) => t.isFixedBottom), (t) => (a(), r(S, {
|
|
167
|
-
key: t.chatId,
|
|
168
|
-
class: "chat-list__item",
|
|
169
|
-
chat: t,
|
|
170
|
-
"show-dialogs": s.showDialogs,
|
|
171
|
-
onSelect: e(f),
|
|
172
|
-
onExpand: e(g),
|
|
173
|
-
onAction: e(y)
|
|
174
|
-
}, null, 8, ["chat", "show-dialogs", "onSelect", "onExpand", "onAction"]))), 128))
|
|
175
|
-
])
|
|
176
|
-
], 64))
|
|
165
|
+
])])) : (a(!0), i(y, { key: 1 }, p(e(c)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (a(), h(x, {
|
|
166
|
+
key: t.chatId,
|
|
167
|
+
class: "chat-list__item",
|
|
168
|
+
chat: t,
|
|
169
|
+
"show-dialogs": s.showDialogs,
|
|
170
|
+
"context-menu-trigger": l.contextMenuTrigger,
|
|
171
|
+
onSelect: e(g),
|
|
172
|
+
onExpand: e(m),
|
|
173
|
+
onAction: e(f)
|
|
174
|
+
}, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
|
|
177
175
|
], 544),
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
!l.isLoading && e(c)().filter((t) => t.isFixedBottom).length > 0 ? (a(), i("div", tt, [
|
|
177
|
+
(a(!0), i(y, null, p(e(c)().filter((t) => t.isFixedBottom), (t) => (a(), h(x, {
|
|
178
|
+
key: t.chatId,
|
|
179
|
+
class: "chat-list__item",
|
|
180
|
+
chat: t,
|
|
181
|
+
"show-dialogs": s.showDialogs,
|
|
182
|
+
"context-menu-trigger": l.contextMenuTrigger,
|
|
183
|
+
onSelect: e(g),
|
|
184
|
+
onExpand: e(m),
|
|
185
|
+
onAction: e(f)
|
|
186
|
+
}, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
|
|
187
|
+
])) : n("", !0),
|
|
188
|
+
w(Q, null, {
|
|
189
|
+
default: N(() => [
|
|
190
|
+
e(B) ? (a(), i("button", {
|
|
181
191
|
key: 0,
|
|
182
192
|
class: "chat-list__button-up",
|
|
183
|
-
onClick:
|
|
184
|
-
}, [...
|
|
185
|
-
|
|
193
|
+
onClick: o[4] || (o[4] = (...t) => e(C) && e(C)(...t))
|
|
194
|
+
}, [...o[7] || (o[7] = [
|
|
195
|
+
r("span", { class: "pi pi-angle-up chat-list__icon-down" }, null, -1)
|
|
186
196
|
])])) : n("", !0)
|
|
187
197
|
]),
|
|
188
198
|
_: 1
|
|
189
199
|
})
|
|
190
200
|
]));
|
|
191
201
|
}
|
|
192
|
-
},
|
|
202
|
+
}, gt = /* @__PURE__ */ O(et, [["__scopeId", "data-v-60e0e8be"]]);
|
|
193
203
|
export {
|
|
194
|
-
|
|
204
|
+
gt as default
|
|
195
205
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { toRef as
|
|
1
|
+
import { toRef as B, computed as I, ref as m, onMounted as P, nextTick as S, onUnmounted as U, watch as W, createElementBlock as a, openBlock as n, normalizeClass as s, createCommentVNode as u, createElementVNode as d, normalizeStyle as J, Fragment as E, renderList as T, createBlock as q, withCtx as y, toDisplayString as A, createVNode as w } from "vue";
|
|
2
2
|
import K from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
|
|
3
3
|
import O from "../../1_icons/SettingsIcon.vue.js";
|
|
4
|
-
import
|
|
4
|
+
import R from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import Q from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
-
const X =
|
|
7
|
+
const X = ["onClick"], Z = ["src", "alt"], $ = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "sidebar__notification-count"
|
|
10
|
-
}, te = ["onClick"], oe = ["src", "alt"], ne = ["src"], ie = { key: 2 }, ae = {
|
|
11
|
-
key:
|
|
10
|
+
}, ee = { class: "sidebar__scroll-container" }, te = ["onClick"], oe = ["src", "alt"], ne = ["src"], ie = { key: 2 }, ae = {
|
|
11
|
+
key: 2,
|
|
12
12
|
class: "sidebar__settings-container"
|
|
13
13
|
}, se = { class: "sidebar__settings-btn" }, re = {
|
|
14
14
|
__name: "SideBar",
|
|
@@ -35,15 +35,15 @@ const X = { class: "sidebar__scroll-container" }, Z = ["onClick"], $ = ["src", "
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
emits: ["selectItem"],
|
|
38
|
-
setup(i, { emit:
|
|
39
|
-
const
|
|
40
|
-
() =>
|
|
41
|
-
), N =
|
|
42
|
-
() =>
|
|
38
|
+
setup(i, { emit: M }) {
|
|
39
|
+
const k = i, f = B(k, "sidebarItems"), F = B(k, "menuActions"), L = M, C = I(
|
|
40
|
+
() => f.value.filter((e) => e.isFixedBottom).sort((e, t) => t.notificationCount - e.notificationCount)
|
|
41
|
+
), N = I(
|
|
42
|
+
() => f.value.filter((e) => !e.isFixedBottom).sort((e, t) => t.notificationCount - e.notificationCount)
|
|
43
43
|
), V = (e) => {
|
|
44
|
-
const t =
|
|
45
|
-
|
|
46
|
-
},
|
|
44
|
+
const t = f.value.find((o) => o.itemId === e);
|
|
45
|
+
L("selectItem", t);
|
|
46
|
+
}, p = (e, t) => {
|
|
47
47
|
D(e.currentTarget), V(t);
|
|
48
48
|
}, H = (e) => {
|
|
49
49
|
const t = e.split(" ");
|
|
@@ -52,21 +52,21 @@ const X = { class: "sidebar__scroll-container" }, Z = ["onClick"], $ = ["src", "
|
|
|
52
52
|
console.log("Выбрано действие:", e), typeof e.action == "function" && e.action();
|
|
53
53
|
}, j = () => {
|
|
54
54
|
console.log("Кнопка меню была нажата");
|
|
55
|
-
}, l =
|
|
55
|
+
}, l = m(null), v = m(!1), g = m(0), h = m(40), b = m(!1), z = (e) => {
|
|
56
56
|
const t = l.value;
|
|
57
57
|
if (!t || !e) return 0;
|
|
58
58
|
const o = t.getBoundingClientRect(), r = e.getBoundingClientRect(), G = r.top + r.height / 2 - o.top - h.value / 2;
|
|
59
59
|
return Math.max(0, G);
|
|
60
|
-
},
|
|
60
|
+
}, _ = () => {
|
|
61
61
|
if (!l.value) return;
|
|
62
62
|
const t = l.value.querySelector(".sidebar__image--active");
|
|
63
|
-
t ? (g.value =
|
|
63
|
+
t ? (g.value = z(t), v.value = !0) : v.value = !1;
|
|
64
64
|
}, D = (e) => {
|
|
65
65
|
try {
|
|
66
66
|
if (!e || !l.value) return;
|
|
67
67
|
const t = e.querySelector(".sidebar__image");
|
|
68
68
|
if (!t) return;
|
|
69
|
-
const o =
|
|
69
|
+
const o = z(t), r = 12, c = 160;
|
|
70
70
|
b.value = !0, h.value = r, setTimeout(() => {
|
|
71
71
|
g.value = o, requestAnimationFrame(() => {
|
|
72
72
|
h.value = 40, setTimeout(() => {
|
|
@@ -76,18 +76,18 @@ const X = { class: "sidebar__scroll-container" }, Z = ["onClick"], $ = ["src", "
|
|
|
76
76
|
}, c);
|
|
77
77
|
} catch {
|
|
78
78
|
}
|
|
79
|
-
},
|
|
79
|
+
}, x = () => _();
|
|
80
80
|
return P(() => {
|
|
81
81
|
var t;
|
|
82
|
-
|
|
82
|
+
S(_), window.addEventListener("resize", x);
|
|
83
83
|
const e = (t = l.value) == null ? void 0 : t.querySelector(".sidebar__scroll-container");
|
|
84
|
-
e && e.addEventListener("scroll",
|
|
84
|
+
e && e.addEventListener("scroll", _);
|
|
85
85
|
}), U(() => {
|
|
86
86
|
var t;
|
|
87
|
-
window.removeEventListener("resize",
|
|
87
|
+
window.removeEventListener("resize", x);
|
|
88
88
|
const e = (t = l.value) == null ? void 0 : t.querySelector(".sidebar__scroll-container");
|
|
89
|
-
e && e.removeEventListener("scroll",
|
|
90
|
-
}), W(() =>
|
|
89
|
+
e && e.removeEventListener("scroll", _);
|
|
90
|
+
}), W(() => f.value.map((e) => e.selected), () => S(_)), (e, t) => (n(), a("div", {
|
|
91
91
|
ref_key: "containerRef",
|
|
92
92
|
ref: l,
|
|
93
93
|
class: s(["sidebar__container", { "sidebar-horizontal__container": i.horizontal }])
|
|
@@ -96,54 +96,55 @@ const X = { class: "sidebar__scroll-container" }, Z = ["onClick"], $ = ["src", "
|
|
|
96
96
|
key: 0,
|
|
97
97
|
class: s(["sidebar__selected-bar", { "is-animating": b.value }]),
|
|
98
98
|
style: J({ top: g.value + "px", height: h.value + "px" })
|
|
99
|
-
}, null, 6)) :
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
}, null, 6)) : u("", !0),
|
|
100
|
+
C.value.length > 0 ? (n(), a("ul", {
|
|
101
|
+
key: 1,
|
|
102
|
+
class: s(["sidebar__list-fixed", { "sidebar-horizontal__list-fixed": i.horizontal }])
|
|
103
|
+
}, [
|
|
104
|
+
(n(!0), a(E, null, T(C.value, (o, r) => (n(), a("li", {
|
|
105
|
+
key: r,
|
|
106
|
+
class: s(["sidebar__item-fixed", { "sidebar-horizontal__item": i.horizontal }]),
|
|
107
|
+
onClick: (c) => p(c, o.itemId)
|
|
103
108
|
}, [
|
|
104
|
-
|
|
105
|
-
key:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
o.notificationCount ? (n(), a("span", ee, q(o.notificationCount > 99 ? "99+" : o.notificationCount), 1)) : f("", !0)
|
|
129
|
-
], 10, Z))), 128))
|
|
130
|
-
], 2),
|
|
131
|
-
u("ul", {
|
|
109
|
+
o.name ? (n(), q(R, {
|
|
110
|
+
key: 0,
|
|
111
|
+
text: H(o.name),
|
|
112
|
+
position: "right",
|
|
113
|
+
offset: 8
|
|
114
|
+
}, {
|
|
115
|
+
default: y(() => [
|
|
116
|
+
d("img", {
|
|
117
|
+
src: o.icon,
|
|
118
|
+
alt: o.name,
|
|
119
|
+
class: s(["sidebar__image", {
|
|
120
|
+
"sidebar__image--active": o.selected === !0,
|
|
121
|
+
"sidebar-horizontal__image": i.horizontal
|
|
122
|
+
}])
|
|
123
|
+
}, null, 10, Z),
|
|
124
|
+
t[0] || (t[0] = d("p", null, "Мои", -1))
|
|
125
|
+
]),
|
|
126
|
+
_: 2
|
|
127
|
+
}, 1032, ["text"])) : u("", !0),
|
|
128
|
+
o.notificationCount ? (n(), a("span", $, A(o.notificationCount > 99 ? "99+" : o.notificationCount), 1)) : u("", !0)
|
|
129
|
+
], 10, X))), 128))
|
|
130
|
+
], 2)) : u("", !0),
|
|
131
|
+
d("div", ee, [
|
|
132
|
+
d("ul", {
|
|
132
133
|
class: s(["sidebar__list", { "sidebar-horizontal__list": i.horizontal }])
|
|
133
134
|
}, [
|
|
134
|
-
(n(!0), a(
|
|
135
|
+
(n(!0), a(E, null, T(N.value, (o, r) => (n(), a("li", {
|
|
135
136
|
key: r,
|
|
136
137
|
class: s(["sidebar__item", { "sidebar-horizontal__item": i.horizontal }]),
|
|
137
|
-
onClick: (c) =>
|
|
138
|
+
onClick: (c) => p(c, o.itemId)
|
|
138
139
|
}, [
|
|
139
|
-
o.name ? (n(),
|
|
140
|
+
o.name ? (n(), q(R, {
|
|
140
141
|
key: 0,
|
|
141
142
|
text: o.name,
|
|
142
143
|
position: "right",
|
|
143
144
|
offset: 8
|
|
144
145
|
}, {
|
|
145
146
|
default: y(() => [
|
|
146
|
-
|
|
147
|
+
d("img", {
|
|
147
148
|
src: o.icon,
|
|
148
149
|
alt: o.name,
|
|
149
150
|
class: s(["sidebar__image", {
|
|
@@ -162,29 +163,29 @@ const X = { class: "sidebar__scroll-container" }, Z = ["onClick"], $ = ["src", "
|
|
|
162
163
|
"sidebar-horizontal__image": i.horizontal
|
|
163
164
|
}])
|
|
164
165
|
}, null, 10, ne)),
|
|
165
|
-
o.notificationCount ? (n(), a("span", ie,
|
|
166
|
+
o.notificationCount ? (n(), a("span", ie, A(o.notificationCount > 99 ? "99+" : o.notificationCount), 1)) : u("", !0)
|
|
166
167
|
], 10, te))), 128))
|
|
167
168
|
], 2)
|
|
168
169
|
]),
|
|
169
170
|
i.showSettings ? (n(), a("div", ae, [
|
|
170
|
-
|
|
171
|
-
actions:
|
|
171
|
+
w(K, {
|
|
172
|
+
actions: F.value,
|
|
172
173
|
mode: "click",
|
|
173
174
|
"menu-side": "top-right",
|
|
174
175
|
onClick: Y,
|
|
175
176
|
onButtonClick: j
|
|
176
177
|
}, {
|
|
177
178
|
default: y(() => [
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
d("button", se, [
|
|
180
|
+
w(O)
|
|
180
181
|
])
|
|
181
182
|
]),
|
|
182
183
|
_: 1
|
|
183
184
|
}, 8, ["actions"])
|
|
184
|
-
])) :
|
|
185
|
+
])) : u("", !0)
|
|
185
186
|
], 2));
|
|
186
187
|
}
|
|
187
|
-
},
|
|
188
|
+
}, fe = /* @__PURE__ */ Q(re, [["__scopeId", "data-v-8b18d054"]]);
|
|
188
189
|
export {
|
|
189
|
-
|
|
190
|
+
fe as default
|
|
190
191
|
};
|
|
@@ -1,27 +1,43 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { getChannelAccentColor as
|
|
1
|
+
import { computed as s, unref as g, inject as b } from "vue";
|
|
2
|
+
import { getChannelAccentColor as C } from "../../functions/getChannelAccentColor.js";
|
|
3
3
|
import "../../functions/parseMarkdown.js";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
function I(o, l = 0.6) {
|
|
5
|
+
const n = o.replace("#", ""), u = parseInt(n.substring(0, 2), 16), r = parseInt(n.substring(2, 4), 16), a = parseInt(n.substring(4, 6), 16);
|
|
6
|
+
return `rgba(${u}, ${r}, ${a}, ${l})`;
|
|
7
|
+
}
|
|
8
|
+
function y(o) {
|
|
9
|
+
if (typeof document > "u")
|
|
10
|
+
return !1;
|
|
11
|
+
if (o) {
|
|
12
|
+
const n = document.getElementById(o);
|
|
13
|
+
return (n == null ? void 0 : n.dataset.theme) === "glass";
|
|
14
|
+
}
|
|
15
|
+
return document.querySelector('[data-theme="glass"]') !== null;
|
|
16
|
+
}
|
|
17
|
+
function j(o, l = {}) {
|
|
18
|
+
const { cssVariable: n, position: u = "right" } = l, r = s(() => g(o)), a = b("chatAppId", void 0), d = b("selectedChat", void 0), m = s(() => {
|
|
19
|
+
if (d)
|
|
20
|
+
return g(d);
|
|
21
|
+
}), f = s(() => {
|
|
22
|
+
const e = m.value, t = r.value;
|
|
10
23
|
if (!(t != null && t.dialogId) || !(e != null && e.dialogs))
|
|
11
24
|
return;
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
}),
|
|
25
|
+
const i = e.dialogs.find((v) => v.dialogId === t.dialogId);
|
|
26
|
+
return i == null ? void 0 : i.channelId;
|
|
27
|
+
}), h = s(() => {
|
|
15
28
|
var e;
|
|
16
|
-
return
|
|
17
|
-
}),
|
|
18
|
-
const e =
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
return u === "both" ? !0 : (e = r.value) != null && e.position ? r.value.position === u : !1;
|
|
30
|
+
}), c = s(() => {
|
|
31
|
+
const e = r.value;
|
|
32
|
+
if (!e || !h.value)
|
|
33
|
+
return null;
|
|
34
|
+
let t = null;
|
|
35
|
+
return e.backgroundColor ? t = e.backgroundColor : t = C(f.value, null), t && y(a) && t.startsWith("#") ? I(t, 0.6) : t;
|
|
36
|
+
}), p = s(() => !n || !c.value ? null : { [n]: c.value });
|
|
21
37
|
return {
|
|
22
|
-
bubbleColor:
|
|
23
|
-
bubbleStyle:
|
|
24
|
-
messageChannelId:
|
|
38
|
+
bubbleColor: c,
|
|
39
|
+
bubbleStyle: p,
|
|
40
|
+
messageChannelId: f
|
|
25
41
|
};
|
|
26
42
|
}
|
|
27
43
|
export {
|