@mobilon-dev/chotto 0.3.125 → 0.3.126
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/2_blocks/FeedFoundItem/FeedFoundItem.vue.js +2 -2
- package/dist/components/2_blocks/FeedFoundItem/FeedFoundItem.vue2.js +41 -31
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +2 -2
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +51 -30
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +286 -270
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +40 -34
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +282 -259
- package/dist/components/3_compounds/Feed/composables/useFeedScroll.js +79 -59
- package/dist/functions/parseMarkdown.js +7 -6
- package/dist/hooks/messages/useImageFeedSrc.js +50 -0
- package/dist/index.js +118 -113
- 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/2_feed_elements/ImageMessage/stories/ImageMessage.stories.d.ts +2 -0
- package/dist/types/src/components/3_compounds/Feed/composables/useFeedScroll.d.ts +3 -0
- package/dist/types/src/components/4_layouts/ChatWrapper/styles/types.d.ts +4 -0
- package/dist/types/src/hooks/messages/index.d.ts +1 -0
- package/dist/types/src/hooks/messages/useImageFeedSrc.d.ts +29 -0
- package/package.json +1 -1
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useMessageActions as
|
|
13
|
-
import { useMessageHoverActions as
|
|
14
|
-
import { useMessageReactionsInFeed as
|
|
15
|
-
import { useMessageMenuActions as
|
|
16
|
-
import { useMessageLinks as
|
|
17
|
-
import { useChannelAccentColor as
|
|
18
|
-
import { useSubtextTooltip as
|
|
19
|
-
import { useStartReply as
|
|
20
|
-
import { useTheme as
|
|
1
|
+
import { defineComponent as os, inject as is, ref as b, computed as u, watch as J, nextTick as X, onMounted as ms, onUnmounted as rs, createElementBlock as i, openBlock as l, normalizeStyle as O, normalizeClass as k, unref as t, createCommentVNode as m, createElementVNode as r, createBlock as h, createVNode as v, withCtx as M, createTextVNode as us, toDisplayString as R, Fragment as P, renderList as gs, withModifiers as T, Transition as L, Teleport as Me } from "vue";
|
|
2
|
+
import cs from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
|
+
import ds from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
|
+
import vs from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
5
|
+
import fs from "../FeedReplyQuote/FeedReplyQuote.vue.js";
|
|
6
|
+
import bs from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
|
|
7
|
+
import ys from "../MessageReactions/MessageReactions.vue.js";
|
|
8
|
+
import Re from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
|
|
9
|
+
import ps from "../MessageSmsInvite/MessageSmsInvite.vue.js";
|
|
10
|
+
import hs from "../DeletedMessageContent/DeletedMessageContent.vue.js";
|
|
11
|
+
import ws from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
12
|
+
import { useMessageActions as ks } from "../../../hooks/messages/useMessageActions.js";
|
|
13
|
+
import { useMessageHoverActions as Ms } from "../../../hooks/messages/useMessageHoverActions.js";
|
|
14
|
+
import { useMessageReactionsInFeed as Rs } from "../../../hooks/messages/useMessageReactionsInFeed.js";
|
|
15
|
+
import { useMessageMenuActions as Is } from "../../../hooks/messages/useMessageMenuActions.js";
|
|
16
|
+
import { useMessageLinks as xs } from "../../../hooks/messages/useMessageLinks.js";
|
|
17
|
+
import { useChannelAccentColor as Ss } from "../../../hooks/messages/useChannelAccentColor.js";
|
|
18
|
+
import { useSubtextTooltip as Cs } from "../../../hooks/messages/useSubtextTooltip.js";
|
|
19
|
+
import { useStartReply as As } from "../../../hooks/messages/useStartReply.js";
|
|
20
|
+
import { useTheme as Es } from "../../../hooks/useTheme.js";
|
|
21
21
|
/* empty css */
|
|
22
22
|
/* empty css */
|
|
23
23
|
import "../../../locale/useLocale.js";
|
|
24
24
|
/* empty css */
|
|
25
|
-
import { buildReplyPayload as
|
|
25
|
+
import { buildReplyPayload as Ie } from "../../../hooks/messages/buildReplyPayload.js";
|
|
26
26
|
import { getImageMessageItems as Ts } from "../../../hooks/messages/getImageMessageItems.js";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
27
|
+
import { useImageFeedSrc as Ls, useAlbumImageFeedSrc as Us } from "../../../hooks/messages/useImageFeedSrc.js";
|
|
28
|
+
import { getStatus as js, getStatusTitle as Fs } from "../../../functions/getStatusMessage.js";
|
|
29
|
+
import { getMessageClass as Os } from "../../../functions/getMessageClass.js";
|
|
30
|
+
import { createReactionHandlers as Ps } from "../../../functions/createReactionHandlers.js";
|
|
30
31
|
import "../../../functions/parseMarkdown.js";
|
|
31
|
-
const
|
|
32
|
+
const Bs = ["messageId"], Ns = ["src"], $s = {
|
|
32
33
|
key: 1,
|
|
33
34
|
class: "image-message__subtext"
|
|
34
|
-
},
|
|
35
|
+
}, zs = { class: "image-message__info-container" }, Hs = {
|
|
35
36
|
key: 0,
|
|
36
37
|
class: "image-message__time"
|
|
37
|
-
},
|
|
38
|
+
}, Vs = ["onClick"], Ds = ["src", "alt", "onError"], Ws = {
|
|
38
39
|
key: 0,
|
|
39
40
|
class: "image-message__album-overflow"
|
|
40
|
-
},
|
|
41
|
+
}, qs = {
|
|
41
42
|
key: 0,
|
|
42
43
|
class: "image-message__blur-wrapper"
|
|
43
|
-
},
|
|
44
|
+
}, Ks = ["src", "alt"], Qs = ["src", "alt"], Gs = ["src", "alt"], Js = {
|
|
44
45
|
key: 0,
|
|
45
46
|
class: "image-message__info-container"
|
|
46
|
-
},
|
|
47
|
+
}, Xs = { class: "image-message__time" }, Ys = ["innerHTML"], Zs = { class: "image-message__modal-body" }, _s = ["src", "alt"], et = {
|
|
47
48
|
key: 2,
|
|
48
49
|
class: "image-message__modal-counter"
|
|
49
|
-
}, B = 4,
|
|
50
|
+
}, B = 4, Ut = /* @__PURE__ */ os({
|
|
50
51
|
__name: "ImageMessage",
|
|
51
52
|
props: {
|
|
52
53
|
message: {
|
|
@@ -91,117 +92,125 @@ const Us = ["messageId"], Ps = ["src"], js = {
|
|
|
91
92
|
},
|
|
92
93
|
emits: ["action", "reply", "sms-invite"],
|
|
93
94
|
setup(e, { emit: xe }) {
|
|
94
|
-
const
|
|
95
|
-
() =>
|
|
96
|
-
() =>
|
|
97
|
-
() =>
|
|
98
|
-
), { startReply: Ce } =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
const Y = is("chatAppId"), { getTheme: Z } = Es(Y || ""), { menuActions: U } = Is(() => n.message), { hoverActionsEnabled: Se, reactionsActive: _ } = Ms(
|
|
96
|
+
() => n.channel,
|
|
97
|
+
() => n.reactionsEnabled,
|
|
98
|
+
() => n.message
|
|
99
|
+
), { startReply: Ce } = As(Y || ""), n = e, N = xe, I = b(!1), y = b(0), g = u(() => Ts(n.message)), d = u(() => g.value.length > 1), $ = u(() => g.value.slice(0, B)), z = u(() => Math.max(0, g.value.length - B)), Ae = u(() => String(Math.min(g.value.length, B))), { displaySrc: H, onImageError: x } = Ls(
|
|
100
|
+
() => {
|
|
101
|
+
var s;
|
|
102
|
+
return (s = g.value[0]) == null ? void 0 : s.imagePreviewUrl;
|
|
103
|
+
},
|
|
104
|
+
() => {
|
|
105
|
+
var s;
|
|
106
|
+
return (s = g.value[0]) == null ? void 0 : s.url;
|
|
107
|
+
}
|
|
108
|
+
), { getItemSrc: Ee, onItemError: Te } = Us(
|
|
109
|
+
() => g.value
|
|
110
|
+
), V = u(() => g.value[y.value] || g.value[0]), Le = u(() => {
|
|
102
111
|
var s;
|
|
103
112
|
return ((s = V.value) == null ? void 0 : s.url) || "";
|
|
104
|
-
}),
|
|
113
|
+
}), D = u(() => {
|
|
105
114
|
var s;
|
|
106
|
-
return ((s = V.value) == null ? void 0 : s.filename) ||
|
|
107
|
-
}),
|
|
108
|
-
function
|
|
109
|
-
y.value = s,
|
|
115
|
+
return ((s = V.value) == null ? void 0 : s.filename) || n.message.alt;
|
|
116
|
+
}), Ue = u(() => d.value ? D.value || `${y.value + 1} / ${g.value.length}` : D.value);
|
|
117
|
+
function ee(s) {
|
|
118
|
+
y.value = s, I.value = !0;
|
|
110
119
|
}
|
|
111
|
-
function
|
|
112
|
-
d.value ||
|
|
120
|
+
function je() {
|
|
121
|
+
d.value || ee(0);
|
|
113
122
|
}
|
|
114
|
-
function
|
|
115
|
-
const
|
|
116
|
-
|
|
123
|
+
function Fe(s) {
|
|
124
|
+
const a = z.value > 0 && s === $.value.length - 1;
|
|
125
|
+
ee(a ? B : s);
|
|
117
126
|
}
|
|
118
|
-
function
|
|
127
|
+
function se() {
|
|
119
128
|
const s = g.value.length;
|
|
120
129
|
s < 2 || (y.value = (y.value - 1 + s) % s);
|
|
121
130
|
}
|
|
122
|
-
function
|
|
131
|
+
function te() {
|
|
123
132
|
const s = g.value.length;
|
|
124
133
|
s < 2 || (y.value = (y.value + 1) % s);
|
|
125
134
|
}
|
|
126
|
-
function
|
|
127
|
-
!
|
|
135
|
+
function W(s) {
|
|
136
|
+
!I.value || !d.value || (s.key === "ArrowLeft" ? (s.preventDefault(), se()) : s.key === "ArrowRight" && (s.preventDefault(), te()));
|
|
128
137
|
}
|
|
129
|
-
|
|
130
|
-
s ? window.addEventListener("keydown",
|
|
138
|
+
J(I, (s) => {
|
|
139
|
+
s ? window.addEventListener("keydown", W) : window.removeEventListener("keydown", W);
|
|
131
140
|
});
|
|
132
141
|
const {
|
|
133
|
-
isOpenMenu:
|
|
134
|
-
buttonMenuVisible:
|
|
142
|
+
isOpenMenu: Oe,
|
|
143
|
+
buttonMenuVisible: ae,
|
|
135
144
|
menuAnchorRef: Pe,
|
|
136
|
-
menuRef:
|
|
137
|
-
menuStyle:
|
|
138
|
-
menuTheme:
|
|
139
|
-
showMenu:
|
|
140
|
-
hideMenu:
|
|
141
|
-
openMenu:
|
|
142
|
-
toggleMenu:
|
|
143
|
-
onMenuMouseEnter:
|
|
144
|
-
onMenuMouseLeave:
|
|
145
|
-
clickAction:
|
|
146
|
-
viewsAction:
|
|
147
|
-
handleClickReplied:
|
|
148
|
-
} =
|
|
149
|
-
onReply: () => Ce(
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
() =>
|
|
145
|
+
menuRef: Be,
|
|
146
|
+
menuStyle: Ne,
|
|
147
|
+
menuTheme: $e,
|
|
148
|
+
showMenu: ze,
|
|
149
|
+
hideMenu: He,
|
|
150
|
+
openMenu: Ve,
|
|
151
|
+
toggleMenu: ne,
|
|
152
|
+
onMenuMouseEnter: De,
|
|
153
|
+
onMenuMouseLeave: We,
|
|
154
|
+
clickAction: qe,
|
|
155
|
+
viewsAction: le,
|
|
156
|
+
handleClickReplied: Ke
|
|
157
|
+
} = ks(n.message, N, {
|
|
158
|
+
onReply: () => Ce(Ie(n.message, "message.image"))
|
|
159
|
+
}), S = b(!1), { linkedHtml: oe, inNewWindow: ie } = xs(() => n.message.text), w = b(null), f = b(null), C = b(0), q = b(0);
|
|
160
|
+
J(
|
|
161
|
+
() => oe.value,
|
|
153
162
|
() => {
|
|
154
|
-
|
|
163
|
+
A(), X(() => {
|
|
155
164
|
c && f.value && c.observe(f.value);
|
|
156
165
|
});
|
|
157
166
|
}
|
|
158
167
|
);
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
w.value && (C.value = w.value.offsetWidth), f.value && (
|
|
168
|
+
const A = () => {
|
|
169
|
+
X(() => {
|
|
170
|
+
w.value && (C.value = w.value.offsetWidth), f.value && (q.value = f.value.offsetWidth);
|
|
162
171
|
});
|
|
163
172
|
};
|
|
164
|
-
let c = null,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
173
|
+
let c = null, j = null;
|
|
174
|
+
ms(() => {
|
|
175
|
+
A(), j = () => A(), window.addEventListener("resize", j), typeof ResizeObserver < "u" && (c = new ResizeObserver(() => {
|
|
176
|
+
A();
|
|
168
177
|
}), w.value && c.observe(w.value), f.value && c.observe(f.value));
|
|
169
|
-
}),
|
|
170
|
-
|
|
171
|
-
}),
|
|
172
|
-
() => [
|
|
178
|
+
}), rs(() => {
|
|
179
|
+
j && window.removeEventListener("resize", j), c && c.disconnect(), window.removeEventListener("keydown", W);
|
|
180
|
+
}), J(
|
|
181
|
+
() => [n.message.text, n.message.url, n.message.imagePreviewUrl, n.message.items],
|
|
173
182
|
() => {
|
|
174
|
-
|
|
183
|
+
A(), X(() => {
|
|
175
184
|
c && (c.disconnect(), w.value && c.observe(w.value), f.value && c.observe(f.value));
|
|
176
185
|
});
|
|
177
186
|
},
|
|
178
187
|
{ immediate: !0 }
|
|
179
188
|
);
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
|
|
189
|
+
const me = u(() => d.value ? !1 : !!n.message.text && q.value > C.value && C.value > 0), Qe = () => {
|
|
190
|
+
ze(), S.value = !0;
|
|
191
|
+
}, re = (s) => {
|
|
192
|
+
He(s), ae.value || (S.value = !1);
|
|
193
|
+
}, Ge = () => {
|
|
194
|
+
We(), S.value = !1;
|
|
195
|
+
}, ue = u(() => n.message.reply && n.message.text ? "0" : n.message.text ? q.value > C.value && C.value > 0 ? "0" : "var(--chotto-imagemessage-preview-with-caption-border-radius, 7px 7px 0 0)" : n.message.reply ? "var(--chotto-imagemessage-preview-with-reply-border-radius, 0 0 7px 7px)" : "var(--chotto-imagemessage-preview-border-radius, 7px)"), ge = u(() => js(n.message.status)), ce = u(() => Fs(n.message.status, n.message.statusMsg)), { bubbleStyle: Je } = Ss(
|
|
196
|
+
u(() => n.message),
|
|
188
197
|
{ cssVariable: "--chotto-imagemessage-right-bg", position: "right" }
|
|
189
198
|
);
|
|
190
|
-
function
|
|
191
|
-
return
|
|
199
|
+
function K(s) {
|
|
200
|
+
return Os(s.position, "image-message");
|
|
192
201
|
}
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
var
|
|
197
|
-
const s =
|
|
202
|
+
const Xe = () => {
|
|
203
|
+
I.value = !1;
|
|
204
|
+
}, Ye = u(() => I.value ? V.value : g.value[0]), Ze = async () => {
|
|
205
|
+
var a, o;
|
|
206
|
+
const s = Ye.value;
|
|
198
207
|
if (s != null && s.url)
|
|
199
208
|
try {
|
|
200
|
-
const
|
|
209
|
+
const p = await fetch(s.url, {
|
|
201
210
|
headers: {
|
|
202
211
|
Accept: "image/*"
|
|
203
212
|
}
|
|
204
|
-
}),
|
|
213
|
+
}), Q = p.headers.get("content-type") || "", as = await p.blob(), G = ((o = (a = s.url.split(".").pop()) == null ? void 0 : a.split("?")[0]) == null ? void 0 : o.toLowerCase()) || "", ns = {
|
|
205
214
|
"image/jpeg": "jpg",
|
|
206
215
|
"image/jpg": "jpg",
|
|
207
216
|
"image/png": "png",
|
|
@@ -210,310 +219,317 @@ const Us = ["messageId"], Ps = ["src"], js = {
|
|
|
210
219
|
"image/svg+xml": "svg",
|
|
211
220
|
"image/bmp": "bmp"
|
|
212
221
|
};
|
|
213
|
-
let
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
} catch (
|
|
217
|
-
console.error("Ошибка при скачивании изображения:",
|
|
222
|
+
let we = G && ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp"].includes(G) ? G : ns[Q] || "jpg";
|
|
223
|
+
const F = s.filename || n.message.alt, ls = F ? F.includes(".") ? F : `${F}.${we}` : `image-${n.message.messageId}.${we}`, ke = window.URL.createObjectURL(as), E = document.createElement("a");
|
|
224
|
+
E.href = ke, E.download = ls, document.body.appendChild(E), E.click(), document.body.removeChild(E), window.URL.revokeObjectURL(ke);
|
|
225
|
+
} catch (p) {
|
|
226
|
+
console.error("Ошибка при скачивании изображения:", p);
|
|
218
227
|
}
|
|
219
|
-
}, { onToggleReaction:
|
|
220
|
-
var
|
|
221
|
-
const s = (
|
|
228
|
+
}, { onToggleReaction: de, onAddReaction: ve, onRemoveReaction: fe } = Ps(N), be = b(null), ye = b(null), _e = u(() => {
|
|
229
|
+
var a;
|
|
230
|
+
const s = (a = ye.value) == null ? void 0 : a.$el;
|
|
222
231
|
return s instanceof HTMLElement ? s : null;
|
|
223
|
-
}), { showReactions:
|
|
224
|
-
message: () =>
|
|
225
|
-
messageId: () =>
|
|
226
|
-
reactions: () =>
|
|
227
|
-
reactionsActive:
|
|
228
|
-
reactionsMode: () =>
|
|
229
|
-
reply: () =>
|
|
230
|
-
menuEnabled: () =>
|
|
231
|
-
contentRef:
|
|
232
|
-
chipsRef:
|
|
232
|
+
}), { showReactions: es, onContentPointerEnter: pe, onContentPointerLeave: he } = Rs({
|
|
233
|
+
message: () => n.message,
|
|
234
|
+
messageId: () => n.message.messageId,
|
|
235
|
+
reactions: () => n.message.reactions,
|
|
236
|
+
reactionsActive: _,
|
|
237
|
+
reactionsMode: () => n.reactionsMode,
|
|
238
|
+
reply: () => Ie(n.message, "message.image"),
|
|
239
|
+
menuEnabled: () => U.value.length > 0,
|
|
240
|
+
contentRef: be,
|
|
241
|
+
chipsRef: _e,
|
|
233
242
|
handlers: {
|
|
234
|
-
onToggleReaction:
|
|
235
|
-
onAddReaction:
|
|
236
|
-
onRemoveReaction:
|
|
237
|
-
onMenu:
|
|
243
|
+
onToggleReaction: de,
|
|
244
|
+
onAddReaction: ve,
|
|
245
|
+
onRemoveReaction: fe,
|
|
246
|
+
onMenu: Ve
|
|
238
247
|
}
|
|
239
|
-
}),
|
|
240
|
-
function
|
|
241
|
-
|
|
248
|
+
}), ss = Cs(() => n.message, () => n.subtextTooltipData);
|
|
249
|
+
function ts() {
|
|
250
|
+
N("sms-invite", n.message);
|
|
242
251
|
}
|
|
243
|
-
return (s,
|
|
252
|
+
return (s, a) => (l(), i("div", {
|
|
244
253
|
ref_key: "menuAnchorRef",
|
|
245
254
|
ref: Pe,
|
|
246
255
|
class: k(["image-message", [
|
|
247
|
-
|
|
256
|
+
K(e.message),
|
|
248
257
|
e.applyStyle(e.message)
|
|
249
258
|
]]),
|
|
250
259
|
messageId: e.message.messageId,
|
|
251
|
-
style:
|
|
252
|
-
onMouseleave:
|
|
260
|
+
style: O(t(Je)),
|
|
261
|
+
onMouseleave: re
|
|
253
262
|
}, [
|
|
254
|
-
e.message.avatar && e.isFirstInSeries ? (l(),
|
|
263
|
+
e.message.avatar && e.isFirstInSeries ? (l(), i("img", {
|
|
255
264
|
key: 0,
|
|
256
265
|
class: "image-message__avatar",
|
|
257
266
|
src: e.message.avatar,
|
|
258
267
|
height: "32",
|
|
259
268
|
width: "32"
|
|
260
|
-
}, null, 8,
|
|
261
|
-
e.message.subText && e.isFirstInSeries ? (l(),
|
|
262
|
-
v(
|
|
263
|
-
text:
|
|
269
|
+
}, null, 8, Ns)) : m("", !0),
|
|
270
|
+
e.message.subText && e.isFirstInSeries ? (l(), i("p", $s, [
|
|
271
|
+
v(ws, {
|
|
272
|
+
text: t(ss),
|
|
264
273
|
position: e.message.position === "left" ? "right" : "left",
|
|
265
274
|
offset: 8
|
|
266
275
|
}, {
|
|
267
276
|
default: M(() => [
|
|
268
|
-
|
|
277
|
+
us(R(e.message.subText), 1)
|
|
269
278
|
]),
|
|
270
279
|
_: 1
|
|
271
280
|
}, 8, ["text", "position"])
|
|
272
|
-
])) :
|
|
273
|
-
|
|
281
|
+
])) : m("", !0),
|
|
282
|
+
r("div", {
|
|
274
283
|
ref_key: "contentRef",
|
|
275
|
-
ref:
|
|
284
|
+
ref: be,
|
|
276
285
|
class: k(["image-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar, "has-caption": !!e.message.text }]),
|
|
277
|
-
onPointerenter:
|
|
278
|
-
(...
|
|
279
|
-
onPointerleave:
|
|
280
|
-
(...
|
|
286
|
+
onPointerenter: a[6] || (a[6] = //@ts-ignore
|
|
287
|
+
(...o) => t(pe) && t(pe)(...o)),
|
|
288
|
+
onPointerleave: a[7] || (a[7] = //@ts-ignore
|
|
289
|
+
(...o) => t(he) && t(he)(...o))
|
|
281
290
|
}, [
|
|
282
|
-
|
|
291
|
+
a[11] || (a[11] = r("div", {
|
|
283
292
|
class: "image-message__bottom-shadow",
|
|
284
293
|
"aria-hidden": "true"
|
|
285
294
|
}, null, -1)),
|
|
286
|
-
e.message.deleted ? (l(),
|
|
287
|
-
v(
|
|
288
|
-
|
|
289
|
-
e.message.time ? (l(),
|
|
290
|
-
v(
|
|
295
|
+
e.message.deleted ? (l(), i(P, { key: 0 }, [
|
|
296
|
+
v(hs),
|
|
297
|
+
r("div", zs, [
|
|
298
|
+
e.message.time ? (l(), i("span", Hs, R(e.message.time), 1)) : m("", !0),
|
|
299
|
+
v(Re, {
|
|
291
300
|
"base-class": "image-message",
|
|
292
|
-
"message-class":
|
|
301
|
+
"message-class": K(e.message),
|
|
293
302
|
"message-status": e.message.status,
|
|
294
|
-
"status-class":
|
|
295
|
-
"status-title":
|
|
303
|
+
"status-class": ge.value,
|
|
304
|
+
"status-title": ce.value
|
|
296
305
|
}, null, 8, ["message-class", "message-status", "status-class", "status-title"])
|
|
297
306
|
])
|
|
298
|
-
], 64)) : (l(),
|
|
299
|
-
e.message.reply ? (l(),
|
|
307
|
+
], 64)) : (l(), i(P, { key: 1 }, [
|
|
308
|
+
e.message.reply ? (l(), h(fs, {
|
|
300
309
|
key: 0,
|
|
301
310
|
style: { margin: "10px 10px 4px 16px" },
|
|
302
311
|
class: k(e.message.position),
|
|
303
312
|
message: e.message.reply,
|
|
304
|
-
onReply:
|
|
305
|
-
}, null, 8, ["class", "message", "onReply"])) :
|
|
306
|
-
|
|
313
|
+
onReply: t(Ke)
|
|
314
|
+
}, null, 8, ["class", "message", "onReply"])) : m("", !0),
|
|
315
|
+
r("div", {
|
|
307
316
|
class: k(["image-message__preview-button", {
|
|
308
|
-
"image-message__preview-button--blur-edges":
|
|
317
|
+
"image-message__preview-button--blur-edges": me.value,
|
|
309
318
|
"image-message__preview-button--album": d.value
|
|
310
319
|
}]),
|
|
311
|
-
style:
|
|
312
|
-
onClick:
|
|
313
|
-
onMouseenter:
|
|
314
|
-
onMouseleave:
|
|
320
|
+
style: O(d.value ? { borderRadius: ue.value } : void 0),
|
|
321
|
+
onClick: je,
|
|
322
|
+
onMouseenter: Qe,
|
|
323
|
+
onMouseleave: re
|
|
315
324
|
}, [
|
|
316
|
-
d.value ? (l(),
|
|
325
|
+
d.value ? (l(), i("div", {
|
|
317
326
|
key: 0,
|
|
318
|
-
class: k(["image-message__album", "image-message__album--" +
|
|
327
|
+
class: k(["image-message__album", "image-message__album--" + Ae.value])
|
|
319
328
|
}, [
|
|
320
|
-
(l(!0),
|
|
321
|
-
key: (
|
|
329
|
+
(l(!0), i(P, null, gs($.value, (o, p) => (l(), i("button", {
|
|
330
|
+
key: (o.url || "") + "-" + p,
|
|
322
331
|
type: "button",
|
|
323
332
|
class: "image-message__album-tile",
|
|
324
|
-
onClick:
|
|
333
|
+
onClick: T((Q) => Fe(p), ["stop"])
|
|
325
334
|
}, [
|
|
326
|
-
|
|
335
|
+
r("img", {
|
|
327
336
|
class: "image-message__album-image",
|
|
328
|
-
src:
|
|
329
|
-
alt:
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
337
|
+
src: t(Ee)(o),
|
|
338
|
+
alt: o.filename,
|
|
339
|
+
onError: (Q) => t(Te)(o)
|
|
340
|
+
}, null, 40, Ds),
|
|
341
|
+
z.value > 0 && p === $.value.length - 1 ? (l(), i("span", Ws, "+" + R(z.value), 1)) : m("", !0)
|
|
342
|
+
], 8, Vs))), 128))
|
|
343
|
+
], 2)) : (l(), i(P, { key: 1 }, [
|
|
344
|
+
me.value ? (l(), i("div", qs, [
|
|
345
|
+
r("img", {
|
|
336
346
|
class: "image-message__blur-left",
|
|
337
|
-
src: H
|
|
338
|
-
alt: e.message.alt
|
|
339
|
-
|
|
340
|
-
|
|
347
|
+
src: t(H),
|
|
348
|
+
alt: e.message.alt,
|
|
349
|
+
onError: a[0] || (a[0] = //@ts-ignore
|
|
350
|
+
(...o) => t(x) && t(x)(...o))
|
|
351
|
+
}, null, 40, Ks),
|
|
352
|
+
r("img", {
|
|
341
353
|
class: "image-message__blur-right",
|
|
342
|
-
src: H
|
|
343
|
-
alt: e.message.alt
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
354
|
+
src: t(H),
|
|
355
|
+
alt: e.message.alt,
|
|
356
|
+
onError: a[1] || (a[1] = //@ts-ignore
|
|
357
|
+
(...o) => t(x) && t(x)(...o))
|
|
358
|
+
}, null, 40, Qs)
|
|
359
|
+
])) : m("", !0),
|
|
360
|
+
r("img", {
|
|
347
361
|
ref_key: "imageRef",
|
|
348
362
|
ref: w,
|
|
349
363
|
class: "image-message__preview-image",
|
|
350
|
-
style:
|
|
351
|
-
src: H
|
|
352
|
-
alt: e.message.alt
|
|
353
|
-
|
|
364
|
+
style: O({ borderRadius: ue.value }),
|
|
365
|
+
src: t(H),
|
|
366
|
+
alt: e.message.alt,
|
|
367
|
+
onError: a[2] || (a[2] = //@ts-ignore
|
|
368
|
+
(...o) => t(x) && t(x)(...o))
|
|
369
|
+
}, null, 44, Gs)
|
|
354
370
|
], 64)),
|
|
355
371
|
v(L, { name: "modal-fade" }, {
|
|
356
372
|
default: M(() => [
|
|
357
|
-
|
|
358
|
-
e.message.views ? (l(),
|
|
373
|
+
S.value ? (l(), i("div", Js, [
|
|
374
|
+
e.message.views ? (l(), i("div", {
|
|
359
375
|
key: 0,
|
|
360
376
|
class: "image-message__views",
|
|
361
|
-
onClick:
|
|
377
|
+
onClick: a[3] || (a[3] = T(
|
|
362
378
|
//@ts-ignore
|
|
363
|
-
(...
|
|
379
|
+
(...o) => t(le) && t(le)(...o),
|
|
364
380
|
["stop"]
|
|
365
381
|
))
|
|
366
382
|
}, [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
])) :
|
|
370
|
-
|
|
371
|
-
v(
|
|
383
|
+
a[8] || (a[8] = r("span", { class: "pi pi-eye" }, null, -1)),
|
|
384
|
+
r("p", null, R(e.message.views), 1)
|
|
385
|
+
])) : m("", !0),
|
|
386
|
+
r("span", Xs, R(e.message.time), 1),
|
|
387
|
+
v(Re, {
|
|
372
388
|
"base-class": "image-message",
|
|
373
|
-
"message-class":
|
|
389
|
+
"message-class": K(e.message),
|
|
374
390
|
"message-status": e.message.status,
|
|
375
|
-
"status-class":
|
|
376
|
-
"status-title":
|
|
391
|
+
"status-class": ge.value,
|
|
392
|
+
"status-title": ce.value
|
|
377
393
|
}, null, 8, ["message-class", "message-status", "status-class", "status-title"])
|
|
378
|
-
])) :
|
|
394
|
+
])) : m("", !0)
|
|
379
395
|
]),
|
|
380
396
|
_: 1
|
|
381
397
|
}),
|
|
382
398
|
v(L, { name: "modal-fade" }, {
|
|
383
399
|
default: M(() => [
|
|
384
|
-
|
|
400
|
+
S.value ? (l(), i("button", {
|
|
385
401
|
key: 0,
|
|
386
402
|
class: "image-message__download-button",
|
|
387
|
-
onClick:
|
|
388
|
-
}, [...
|
|
389
|
-
|
|
390
|
-
])])) :
|
|
403
|
+
onClick: T(Ze, ["stop"])
|
|
404
|
+
}, [...a[9] || (a[9] = [
|
|
405
|
+
r("span", { class: "pi pi-download" }, null, -1)
|
|
406
|
+
])])) : m("", !0)
|
|
391
407
|
]),
|
|
392
408
|
_: 1
|
|
393
409
|
})
|
|
394
410
|
], 38),
|
|
395
411
|
v(L, { name: "modal-fade" }, {
|
|
396
412
|
default: M(() => [
|
|
397
|
-
|
|
413
|
+
t(ae) && t(U).length && !e.reactionsEnabled && t(Se) ? (l(), i("button", {
|
|
398
414
|
key: 0,
|
|
399
415
|
class: "image-message__menu-button",
|
|
400
|
-
onClick:
|
|
401
|
-
(...
|
|
402
|
-
}, [...
|
|
403
|
-
|
|
404
|
-
])])) :
|
|
416
|
+
onClick: a[4] || (a[4] = //@ts-ignore
|
|
417
|
+
(...o) => t(ne) && t(ne)(...o))
|
|
418
|
+
}, [...a[10] || (a[10] = [
|
|
419
|
+
r("span", { class: "pi pi-ellipsis-h" }, null, -1)
|
|
420
|
+
])])) : m("", !0)
|
|
405
421
|
]),
|
|
406
422
|
_: 1
|
|
407
423
|
}),
|
|
408
|
-
(l(),
|
|
424
|
+
(l(), h(Me, { to: "body" }, [
|
|
409
425
|
v(L, { name: "context-menu" }, {
|
|
410
426
|
default: M(() => [
|
|
411
|
-
|
|
427
|
+
t(Oe) && t(U).length ? (l(), h(cs, {
|
|
412
428
|
key: 0,
|
|
413
429
|
ref_key: "menuRef",
|
|
414
|
-
ref:
|
|
430
|
+
ref: Be,
|
|
415
431
|
class: "image-message__context-menu message-actions-menu",
|
|
416
|
-
style:
|
|
417
|
-
"data-theme":
|
|
418
|
-
actions:
|
|
419
|
-
onClick:
|
|
420
|
-
onMouseenter:
|
|
421
|
-
onMouseleave:
|
|
422
|
-
}, null, 8, ["style", "data-theme", "actions", "onClick", "onMouseenter"])) :
|
|
432
|
+
style: O(t(Ne)),
|
|
433
|
+
"data-theme": t($e),
|
|
434
|
+
actions: t(U),
|
|
435
|
+
onClick: t(qe),
|
|
436
|
+
onMouseenter: t(De),
|
|
437
|
+
onMouseleave: Ge
|
|
438
|
+
}, null, 8, ["style", "data-theme", "actions", "onClick", "onMouseenter"])) : m("", !0)
|
|
423
439
|
]),
|
|
424
440
|
_: 1
|
|
425
441
|
})
|
|
426
442
|
])),
|
|
427
|
-
e.message.text ? (l(),
|
|
443
|
+
e.message.text ? (l(), i("div", {
|
|
428
444
|
key: 1,
|
|
429
445
|
ref_key: "textRef",
|
|
430
446
|
ref: f,
|
|
431
447
|
class: "image-message__text-container"
|
|
432
448
|
}, [
|
|
433
|
-
|
|
434
|
-
onClick:
|
|
435
|
-
(...
|
|
436
|
-
innerHTML:
|
|
437
|
-
}, null, 8,
|
|
438
|
-
], 512)) :
|
|
439
|
-
v(
|
|
449
|
+
r("p", {
|
|
450
|
+
onClick: a[5] || (a[5] = //@ts-ignore
|
|
451
|
+
(...o) => t(ie) && t(ie)(...o)),
|
|
452
|
+
innerHTML: t(oe)
|
|
453
|
+
}, null, 8, Ys)
|
|
454
|
+
], 512)) : m("", !0),
|
|
455
|
+
v(ps, {
|
|
440
456
|
status: e.message.status,
|
|
441
457
|
"has-messenger-account": e.message.hasMessengerAccount,
|
|
442
458
|
channel: e.channel,
|
|
443
|
-
onSmsInvite:
|
|
459
|
+
onSmsInvite: ts
|
|
444
460
|
}, null, 8, ["status", "has-messenger-account", "channel"]),
|
|
445
|
-
e.message.linkPreview ? (l(),
|
|
461
|
+
e.message.linkPreview ? (l(), h(ds, {
|
|
446
462
|
key: 2,
|
|
447
463
|
class: k(["image-message__link-preview", e.message.position]),
|
|
448
464
|
"link-preview": e.message.linkPreview
|
|
449
|
-
}, null, 8, ["class", "link-preview"])) :
|
|
450
|
-
e.message.embed ? (l(),
|
|
465
|
+
}, null, 8, ["class", "link-preview"])) : m("", !0),
|
|
466
|
+
e.message.embed ? (l(), h(vs, {
|
|
451
467
|
key: 3,
|
|
452
468
|
class: k(e.message.position),
|
|
453
469
|
embed: e.message.embed
|
|
454
|
-
}, null, 8, ["class", "embed"])) :
|
|
455
|
-
|
|
470
|
+
}, null, 8, ["class", "embed"])) : m("", !0),
|
|
471
|
+
t(es) ? (l(), h(ys, {
|
|
456
472
|
key: 4,
|
|
457
473
|
ref_key: "reactionsRef",
|
|
458
|
-
ref:
|
|
474
|
+
ref: ye,
|
|
459
475
|
reactions: e.message.reactions,
|
|
460
476
|
"message-id": e.message.messageId,
|
|
461
|
-
enabled:
|
|
477
|
+
enabled: t(_),
|
|
462
478
|
mode: e.reactionsMode,
|
|
463
479
|
"current-user-id": e.currentUserId,
|
|
464
480
|
"reaction-user-names": e.reactionUserNames,
|
|
465
|
-
onToggleReaction:
|
|
466
|
-
onAddReaction:
|
|
467
|
-
onRemoveReaction:
|
|
468
|
-
}, null, 8, ["reactions", "message-id", "enabled", "mode", "current-user-id", "reaction-user-names", "onToggleReaction", "onAddReaction", "onRemoveReaction"])) :
|
|
481
|
+
onToggleReaction: t(de),
|
|
482
|
+
onAddReaction: t(ve),
|
|
483
|
+
onRemoveReaction: t(fe)
|
|
484
|
+
}, null, 8, ["reactions", "message-id", "enabled", "mode", "current-user-id", "reaction-user-names", "onToggleReaction", "onAddReaction", "onRemoveReaction"])) : m("", !0)
|
|
469
485
|
], 64))
|
|
470
486
|
], 34),
|
|
471
|
-
(l(),
|
|
487
|
+
(l(), h(Me, { to: "body" }, [
|
|
472
488
|
v(L, { name: "modal-fade" }, {
|
|
473
489
|
default: M(() => [
|
|
474
|
-
|
|
490
|
+
I.value && !e.message.deleted ? (l(), h(bs, {
|
|
475
491
|
key: 0,
|
|
476
|
-
"data-theme":
|
|
477
|
-
title:
|
|
478
|
-
onClose:
|
|
492
|
+
"data-theme": t(Z)().theme ? t(Z)().theme : "light",
|
|
493
|
+
title: Ue.value,
|
|
494
|
+
onClose: Xe
|
|
479
495
|
}, {
|
|
480
496
|
default: M(() => [
|
|
481
|
-
|
|
482
|
-
d.value ? (l(),
|
|
497
|
+
r("div", Zs, [
|
|
498
|
+
d.value ? (l(), i("button", {
|
|
483
499
|
key: 0,
|
|
484
500
|
type: "button",
|
|
485
501
|
class: "image-message__modal-nav image-message__modal-nav--prev",
|
|
486
502
|
"aria-label": "Предыдущее изображение",
|
|
487
|
-
onClick:
|
|
488
|
-
}, [...
|
|
489
|
-
|
|
490
|
-
])])) :
|
|
491
|
-
|
|
503
|
+
onClick: T(se, ["stop"])
|
|
504
|
+
}, [...a[12] || (a[12] = [
|
|
505
|
+
r("span", { class: "pi pi-chevron-left" }, null, -1)
|
|
506
|
+
])])) : m("", !0),
|
|
507
|
+
r("img", {
|
|
492
508
|
class: "image-message__modal-image",
|
|
493
|
-
src:
|
|
494
|
-
alt:
|
|
495
|
-
}, null, 8,
|
|
496
|
-
d.value ? (l(),
|
|
509
|
+
src: Le.value,
|
|
510
|
+
alt: D.value
|
|
511
|
+
}, null, 8, _s),
|
|
512
|
+
d.value ? (l(), i("button", {
|
|
497
513
|
key: 1,
|
|
498
514
|
type: "button",
|
|
499
515
|
class: "image-message__modal-nav image-message__modal-nav--next",
|
|
500
516
|
"aria-label": "Следующее изображение",
|
|
501
|
-
onClick:
|
|
502
|
-
}, [...
|
|
503
|
-
|
|
504
|
-
])])) :
|
|
505
|
-
d.value ? (l(),
|
|
517
|
+
onClick: T(te, ["stop"])
|
|
518
|
+
}, [...a[13] || (a[13] = [
|
|
519
|
+
r("span", { class: "pi pi-chevron-right" }, null, -1)
|
|
520
|
+
])])) : m("", !0),
|
|
521
|
+
d.value ? (l(), i("span", et, R(y.value + 1) + " / " + R(g.value.length), 1)) : m("", !0)
|
|
506
522
|
])
|
|
507
523
|
]),
|
|
508
524
|
_: 1
|
|
509
|
-
}, 8, ["data-theme", "title"])) :
|
|
525
|
+
}, 8, ["data-theme", "title"])) : m("", !0)
|
|
510
526
|
]),
|
|
511
527
|
_: 1
|
|
512
528
|
})
|
|
513
529
|
]))
|
|
514
|
-
], 46,
|
|
530
|
+
], 46, Bs));
|
|
515
531
|
}
|
|
516
532
|
});
|
|
517
533
|
export {
|
|
518
|
-
|
|
534
|
+
Ut as default
|
|
519
535
|
};
|