@mobilon-dev/chotto 0.3.33 → 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.
Files changed (68) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js +2 -2
  3. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +28 -27
  4. package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +36 -22
  5. package/dist/components/1_icons/SettingsIcon.vue.js +6 -6
  6. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +164 -156
  7. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +4 -103
  8. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +135 -0
  9. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.js +33 -11
  10. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue2.js +4 -0
  11. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.js +4 -102
  12. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +135 -0
  13. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.js +21 -18
  14. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue2.js +4 -0
  15. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +2 -2
  16. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +89 -55
  17. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.js +17 -14
  18. package/dist/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue2.js +4 -0
  19. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +4 -337
  20. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +360 -0
  21. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.js +56 -11
  22. package/dist/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue2.js +4 -0
  23. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
  24. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +164 -100
  25. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
  26. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +184 -134
  27. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +3 -3
  28. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +1 -1
  29. package/dist/components/3_compounds/ChatList/ChatList.vue.js +101 -91
  30. package/dist/components/3_compounds/SideBar/SideBar.vue.js +68 -67
  31. package/dist/hooks/messages/useChannelAccentColor.js +35 -19
  32. package/dist/themes/dark.css +1 -1
  33. package/dist/themes/default.css +1 -1
  34. package/dist/themes/glass.css +1 -0
  35. package/dist/themes/green.css +1 -1
  36. package/dist/themes/mobilon1.css +1 -1
  37. package/dist/types/apps/data/messages.d.ts +117 -86
  38. package/dist/types/components/1_atoms/ContextMenu/ContextMenu.vue.d.ts +5 -1
  39. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -0
  40. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -0
  41. package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +4 -0
  42. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +31 -7
  43. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/icons/SmilesIcon.vue.d.ts +6 -1
  44. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/styles/types.d.ts +6 -0
  45. package/dist/types/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue.d.ts +59 -11
  46. package/dist/types/components/2_chatinput_elements/ButtonTemplateSelector/icons/ChatTemplatesIcon.vue.d.ts +6 -1
  47. package/dist/types/components/2_chatinput_elements/FileUploader/icons/FileUploaderIcon.vue.d.ts +6 -1
  48. package/dist/types/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.d.ts +22 -10
  49. package/dist/types/components/2_chatinput_elements/StickerPicker/icons/StickerIcon.vue.d.ts +6 -1
  50. package/dist/types/components/2_chatlist_elements/ChatItem/ChatItem.vue.d.ts +2 -0
  51. package/dist/types/components/2_chatlist_elements/ChatItem/styles/types.d.ts +2 -0
  52. package/dist/types/components/2_elements/ChatInfo/styles/types.d.ts +2 -0
  53. package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +18 -0
  54. package/dist/types/components/2_feed_elements/CallMessage/styles/types.d.ts +24 -0
  55. package/dist/types/components/2_feed_elements/DateMessage/styles/types.d.ts +6 -0
  56. package/dist/types/components/2_feed_elements/DateMessageSticky/styles/types.d.ts +4 -0
  57. package/dist/types/components/2_feed_elements/FeedKeyboard/styles/types.d.ts +2 -0
  58. package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +12 -0
  59. package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +126 -0
  60. package/dist/types/components/2_feed_elements/MessageReactions/styles/types.d.ts +8 -0
  61. package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +16 -0
  62. package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
  63. package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +2 -0
  64. package/dist/types/components/3_compounds/ChatList/styles/types.d.ts +8 -0
  65. package/dist/types/components/3_compounds/SideBar/styles/types.d.ts +6 -16
  66. package/dist/types/components/4_layouts/ChatWrapper/styles/types.d.ts +4 -0
  67. package/dist/types/components/4_layouts/ExtendedLayout/styles/types.d.ts +8 -0
  68. package/package.json +2 -1
@@ -1,8 +1,8 @@
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
- import $ from "../../2_chatlist_elements/ChatFilter/ChatFilter.vue.js";
4
- import q from "../../2_chatlist_elements/ChatTabs/ChatTabs.vue.js";
5
- import M from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
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
- }, Z = { class: "chat-list__fixed-items-top" }, tt = { class: "chat-list__scrollable-items" }, et = { class: "chat-list__fixed-items-bottom" }, st = {
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: A }) {
78
- const d = s, c = A, _ = I(), k = D(() => d.chats), {
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: b,
82
- startScrollWatch: x,
92
+ scrollCheck: _,
93
+ startScrollWatch: b,
83
94
  stopScrollWatch: T
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,
91
- action: y,
92
- handleTabClick: F
93
- } = j({ emit: c });
94
- return (w, l) => (a(), o("div", R, [
95
- v(w.$slots, "header", {}, void 0, !0),
96
- v(w.$slots, "sidebar", {}, void 0, !0),
97
- s.filterEnabled ? (a(), r($, {
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(E)
111
+ onUpdate: e(A)
101
112
  }, null, 8, ["onUpdate"])) : n("", !0),
102
- s.dialogTabs && s.dialogTabs.length > 0 ? (a(), r(q, {
113
+ s.dialogTabs && s.dialogTabs.length > 0 ? (a(), h($, {
103
114
  key: 1,
104
115
  tabs: s.dialogTabs,
105
- onTabClick: e(F)
116
+ onTabClick: e(E)
106
117
  }, null, 8, ["tabs", "onTabClick"])) : n("", !0),
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)
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(), o("button", {
126
+ s.searchQuery ? (a(), i("button", {
116
127
  key: 0,
117
128
  class: "chat-list__search-clear",
118
129
  title: "Очистить поиск",
119
- onClick: l[0] || (l[0] = (t) => c("clear-search"))
120
- }, [...l[5] || (l[5] = [
121
- i("i", { class: "pi pi-times" }, null, -1)
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: l[1] || (l[1] = (...t) => e(b) && e(b)(...t)),
130
- onMousedown: l[2] || (l[2] = (...t) => e(x) && e(x)(...t)),
131
- onMouseup: l[3] || (l[3] = (...t) => e(T) && e(T)(...t))
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
- L(M, {
156
+ w(q, {
134
157
  class: "chat-list__loading-indicator",
135
- "is-loading": d.isLoading
158
+ "is-loading": l.isLoading
136
159
  }, null, 8, ["is-loading"]),
137
- !d.isLoading && e(h)().length === 0 ? (a(), o("div", Y, [...l[6] || (l[6] = [
138
- i("div", { class: "chat-list__placeholder" }, [
139
- i("p", { class: "chat-list__placeholder-title" }, " Нет контактных данных, чтобы начать чат "),
140
- i("p", { class: "chat-list__placeholder-hint" }, " Добавьте номер телефона или имя Telegram в карточку контакта ")
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(), 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, {
145
- key: t.chatId,
146
- class: "chat-list__item",
147
- chat: t,
148
- "show-dialogs": s.showDialogs,
149
- onSelect: e(f),
150
- onExpand: e(g),
151
- onAction: e(y)
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
- L(N, null, {
179
- default: V(() => [
180
- e(B) ? (a(), o("button", {
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: l[4] || (l[4] = (...t) => e(C) && e(C)(...t))
184
- }, [...l[7] || (l[7] = [
185
- i("span", { class: "pi pi-angle-up chat-list__icon-down" }, null, -1)
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
- }, ft = /* @__PURE__ */ O(st, [["__scopeId", "data-v-98c65a4e"]]);
202
+ }, gt = /* @__PURE__ */ O(et, [["__scopeId", "data-v-60e0e8be"]]);
193
203
  export {
194
- ft as default
204
+ gt as default
195
205
  };
@@ -1,14 +1,14 @@
1
- import { toRef as x, computed as B, ref as _, onMounted as P, nextTick as I, onUnmounted as U, watch as W, createElementBlock as a, openBlock as n, normalizeClass as s, createCommentVNode as f, createElementVNode as u, normalizeStyle as J, Fragment as S, renderList as E, createBlock as T, withCtx as y, toDisplayString as q, createVNode as A } from "vue";
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 w from "../../1_atoms/Tooltip/Tooltip.vue.js";
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 = { class: "sidebar__scroll-container" }, Z = ["onClick"], $ = ["src", "alt"], ee = {
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: 1,
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: R }) {
39
- const C = i, m = x(C, "sidebarItems"), M = x(C, "menuActions"), F = R, L = B(
40
- () => m.value.filter((e) => e.isFixedBottom).sort((e, t) => t.notificationCount - e.notificationCount)
41
- ), N = B(
42
- () => m.value.filter((e) => !e.isFixedBottom).sort((e, t) => t.notificationCount - e.notificationCount)
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 = m.value.find((o) => o.itemId === e);
45
- F("selectItem", t);
46
- }, k = (e, t) => {
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 = _(null), v = _(!1), g = _(0), h = _(40), b = _(!1), p = (e) => {
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
- }, d = () => {
60
+ }, _ = () => {
61
61
  if (!l.value) return;
62
62
  const t = l.value.querySelector(".sidebar__image--active");
63
- t ? (g.value = p(t), v.value = !0) : v.value = !1;
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 = p(t), r = 12, c = 160;
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
- }, z = () => d();
79
+ }, x = () => _();
80
80
  return P(() => {
81
81
  var t;
82
- I(d), window.addEventListener("resize", z);
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", d);
84
+ e && e.addEventListener("scroll", _);
85
85
  }), U(() => {
86
86
  var t;
87
- window.removeEventListener("resize", z);
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", d);
90
- }), W(() => m.value.map((e) => e.selected), () => I(d)), (e, t) => (n(), a("div", {
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)) : f("", !0),
100
- u("div", X, [
101
- u("ul", {
102
- class: s(["sidebar__list-fixed", { "sidebar-horizontal__list-fixed": i.horizontal }])
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
- (n(!0), a(S, null, E(L.value, (o, r) => (n(), a("li", {
105
- key: r,
106
- class: s(["sidebar__item-fixed", { "sidebar-horizontal__item": i.horizontal }]),
107
- onClick: (c) => k(c, o.itemId)
108
- }, [
109
- o.name ? (n(), T(w, {
110
- key: 0,
111
- text: H(o.name),
112
- position: "right",
113
- offset: 8
114
- }, {
115
- default: y(() => [
116
- u("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, $),
124
- t[0] || (t[0] = u("p", null, "Мои", -1))
125
- ]),
126
- _: 2
127
- }, 1032, ["text"])) : f("", !0),
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(S, null, E(N.value, (o, r) => (n(), a("li", {
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) => k(c, o.itemId)
138
+ onClick: (c) => p(c, o.itemId)
138
139
  }, [
139
- o.name ? (n(), T(w, {
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
- u("img", {
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, q(o.notificationCount > 99 ? "99+" : o.notificationCount), 1)) : f("", !0)
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
- A(K, {
171
- actions: M.value,
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
- u("button", se, [
179
- A(O)
179
+ d("button", se, [
180
+ w(O)
180
181
  ])
181
182
  ]),
182
183
  _: 1
183
184
  }, 8, ["actions"])
184
- ])) : f("", !0)
185
+ ])) : u("", !0)
185
186
  ], 2));
186
187
  }
187
- }, me = /* @__PURE__ */ Q(re, [["__scopeId", "data-v-6dff8029"]]);
188
+ }, fe = /* @__PURE__ */ Q(re, [["__scopeId", "data-v-8b18d054"]]);
188
189
  export {
189
- me as default
190
+ fe as default
190
191
  };
@@ -1,27 +1,43 @@
1
- import { computed as n, unref as a, inject as p } from "vue";
2
- import { getChannelAccentColor as h } from "../../functions/getChannelAccentColor.js";
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 j(d, f = {}) {
5
- const { cssVariable: u, position: i = "right" } = f, o = n(() => a(d)), s = p("selectedChat", void 0), v = n(() => {
6
- if (s)
7
- return a(s);
8
- }), c = n(() => {
9
- const e = v.value, t = o.value;
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 l = e.dialogs.find((g) => g.dialogId === t.dialogId);
13
- return l == null ? void 0 : l.channelId;
14
- }), C = n(() => {
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 i === "both" ? !0 : (e = o.value) != null && e.position ? o.value.position === i : !1;
17
- }), r = n(() => {
18
- const e = o.value;
19
- return !e || !C.value ? null : e.backgroundColor ? e.backgroundColor : h(c.value, null);
20
- }), b = n(() => !u || !r.value ? null : { [u]: r.value });
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: r,
23
- bubbleStyle: b,
24
- messageChannelId: c
38
+ bubbleColor: c,
39
+ bubbleStyle: p,
40
+ messageChannelId: f
25
41
  };
26
42
  }
27
43
  export {