@mobilon-dev/chotto 0.3.104 → 0.3.106
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_feed_elements/AudioMessage/AudioMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +171 -167
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.js +7 -0
- package/dist/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue2.js +73 -0
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +112 -108
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +133 -128
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +131 -126
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +149 -145
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +131 -126
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/Feed.vue2.js +249 -207
- package/dist/components/3_compounds/Feed/composables/useFeedGrouping.js +23 -20
- package/dist/components/3_compounds/Feed/composables/useFeedProgressiveRender.js +79 -0
- package/dist/components/3_compounds/Feed/composables/useFeedReply.js +10 -10
- package/dist/functions/isSmsChannel.js +19 -0
- package/dist/hooks/messages/useMessageHoverActions.js +13 -0
- package/dist/index.js +225 -218
- package/dist/types/components/2_feed_elements/FeedReplyQuote/FeedReplyQuote.vue.d.ts +19 -0
- package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +6 -0
- package/dist/types/components/3_compounds/Feed/composables/index.d.ts +1 -0
- package/dist/types/components/3_compounds/Feed/composables/useFeedGrouping.d.ts +3 -22
- package/dist/types/components/3_compounds/Feed/composables/useFeedProgressiveRender.d.ts +22 -0
- package/dist/types/components/3_compounds/Feed/composables/useFeedReply.d.ts +2 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/functions/index.d.ts +1 -0
- package/dist/types/functions/isSmsChannel.d.ts +8 -0
- package/dist/types/hooks/messages/index.d.ts +1 -0
- package/dist/types/hooks/messages/useMessageHoverActions.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useFeedButton as
|
|
10
|
-
import { useFeedComponents as
|
|
11
|
-
import { useFeedGrouping as
|
|
12
|
-
import { useFeedKeyboard as
|
|
13
|
-
import { useFeedLoadMore as
|
|
14
|
-
import { useFeedMessageVisibility as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
|
|
1
|
+
import { defineComponent as Ce, ref as R, computed as i, provide as A, inject as z, unref as t, watch as B, nextTick as F, onMounted as Te, createElementBlock as g, openBlock as l, createVNode as p, createBlock as y, createCommentVNode as m, normalizeStyle as G, renderSlot as H, withDirectives as De, createElementVNode as C, vShow as we, Transition as T, withCtx as D, Fragment as xe, renderList as Ke, isMemoSame as Oe, resolveDynamicComponent as je, mergeProps as Ne, toDisplayString as Le, Teleport as J } from "vue";
|
|
2
|
+
import Ue from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
|
|
3
|
+
import $e from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
4
|
+
import qe from "../../2_feed_elements/BaseEditMessage/BaseEditMessage.vue.js";
|
|
5
|
+
import Ee from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
|
|
6
|
+
import Pe from "../../2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js";
|
|
7
|
+
import Ve from "../../2_feed_elements/TypingMessage/TypingMessage.vue.js";
|
|
8
|
+
import We from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
|
|
9
|
+
import { useFeedButton as ze } from "./composables/useFeedButton.js";
|
|
10
|
+
import { useFeedComponents as Ge } from "./composables/useFeedComponents.js";
|
|
11
|
+
import { useFeedGrouping as He } from "./composables/useFeedGrouping.js";
|
|
12
|
+
import { useFeedKeyboard as Je } from "./composables/useFeedKeyboard.js";
|
|
13
|
+
import { useFeedLoadMore as Qe } from "./composables/useFeedLoadMore.js";
|
|
14
|
+
import { useFeedMessageVisibility as Xe } from "./composables/useFeedMessageVisibility.js";
|
|
15
|
+
import { useFeedProgressiveRender as Ye } from "./composables/useFeedProgressiveRender.js";
|
|
16
|
+
import { useFeedReply as Ze } from "./composables/useFeedReply.js";
|
|
17
|
+
import { useFeedScroll as _e } from "./composables/useFeedScroll.js";
|
|
18
|
+
import { useFeedScrollTo as et } from "./composables/useFeedScrollTo.js";
|
|
19
|
+
import { useStickyDate as tt } from "./composables/useStickyDate.js";
|
|
20
|
+
import { throttle as ot } from "./functions/throttle.js";
|
|
21
|
+
import { getDefaultMessageMenuActions as st } from "./utils/getDefaultMessageMenuActions.js";
|
|
22
|
+
import { isSmsFeedMessage as nt } from "../../../functions/isSmsChannel.js";
|
|
23
|
+
import "../../../functions/parseMarkdown.js";
|
|
24
|
+
import at from "./assets/chat-background.svg.js";
|
|
25
|
+
const rt = { class: "message-feed-wrapper" }, it = ["id"], lt = { class: "message-feed__loading" }, dt = { style: { margin: "auto" } }, ct = {
|
|
23
26
|
key: 0,
|
|
24
27
|
class: "message-feed__unread-amount"
|
|
25
|
-
},
|
|
28
|
+
}, jt = /* @__PURE__ */ Ce({
|
|
26
29
|
__name: "Feed",
|
|
27
30
|
props: {
|
|
31
|
+
/**
|
|
32
|
+
* Объекты ленты. При смене чата сначала рисуется хвост, остальное дорисовывается пачками.
|
|
33
|
+
*/
|
|
28
34
|
objects: {
|
|
29
35
|
type: Array,
|
|
30
36
|
required: !0
|
|
@@ -58,7 +64,7 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
|
|
|
58
64
|
keyboardAlign: {
|
|
59
65
|
type: String,
|
|
60
66
|
default: "right",
|
|
61
|
-
validator: (
|
|
67
|
+
validator: (s) => ["left", "center", "right"].includes(s)
|
|
62
68
|
},
|
|
63
69
|
feedKeyboards: {
|
|
64
70
|
type: Array,
|
|
@@ -68,7 +74,7 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
|
|
|
68
74
|
feedKeyboardAlign: {
|
|
69
75
|
type: String,
|
|
70
76
|
default: "right",
|
|
71
|
-
validator: (
|
|
77
|
+
validator: (s) => ["left", "center", "right"].includes(s)
|
|
72
78
|
},
|
|
73
79
|
chatBackground: {
|
|
74
80
|
type: String,
|
|
@@ -85,7 +91,7 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
|
|
|
85
91
|
reactionsMode: {
|
|
86
92
|
type: String,
|
|
87
93
|
default: "single",
|
|
88
|
-
validator: (
|
|
94
|
+
validator: (s) => ["single", "multi"].includes(s)
|
|
89
95
|
},
|
|
90
96
|
/** Id текущего пользователя — для расчёта «моих» реакций */
|
|
91
97
|
currentUserId: {
|
|
@@ -117,7 +123,7 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
|
|
|
117
123
|
*/
|
|
118
124
|
messageMenuActions: {
|
|
119
125
|
type: Array,
|
|
120
|
-
default: () =>
|
|
126
|
+
default: () => st()
|
|
121
127
|
}
|
|
122
128
|
},
|
|
123
129
|
emits: [
|
|
@@ -132,261 +138,297 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
|
|
|
132
138
|
"smsInvite",
|
|
133
139
|
"delimiterRead"
|
|
134
140
|
],
|
|
135
|
-
setup(
|
|
136
|
-
const a =
|
|
137
|
-
isShowButton:
|
|
138
|
-
isKeyboardPlace:
|
|
139
|
-
checkButtonVisibility:
|
|
140
|
-
} =
|
|
141
|
-
feedRef:
|
|
142
|
-
keyboardRef:
|
|
143
|
-
}), { componentsMap:
|
|
144
|
-
|
|
141
|
+
setup(s, { emit: Q }) {
|
|
142
|
+
const a = s, v = R(), c = R(), w = R(), {
|
|
143
|
+
isShowButton: X,
|
|
144
|
+
isKeyboardPlace: Y,
|
|
145
|
+
checkButtonVisibility: Z
|
|
146
|
+
} = ze({
|
|
147
|
+
feedRef: c,
|
|
148
|
+
keyboardRef: w
|
|
149
|
+
}), { componentsMap: _ } = Ge(), ee = i(() => a.reactionsEnabled), te = i(() => a.reactionsMode), x = i(() => a.currentUserId), K = i(() => a.reactionUserNames);
|
|
150
|
+
A("currentUserId", x), A("reactionUserNames", K), A(
|
|
145
151
|
"messageMenuActions",
|
|
146
|
-
|
|
152
|
+
i(() => a.messageMenuActions)
|
|
147
153
|
);
|
|
148
|
-
const {
|
|
149
|
-
objects:
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
const { seriesFlags: O } = He({
|
|
155
|
+
objects: i(() => a.objects)
|
|
156
|
+
}), {
|
|
157
|
+
visibleObjects: oe,
|
|
158
|
+
renderStart: h,
|
|
159
|
+
isBackfilling: se,
|
|
160
|
+
revealThroughIndex: ne,
|
|
161
|
+
accelerateBackfill: ae
|
|
162
|
+
} = Ye({
|
|
163
|
+
objectsRef: i(() => a.objects),
|
|
164
|
+
feedRef: c
|
|
165
|
+
}), b = z("chatAppId"), j = z("selectedChat", void 0), N = i(() => {
|
|
166
|
+
if (j)
|
|
167
|
+
return t(j);
|
|
153
168
|
});
|
|
154
|
-
function
|
|
155
|
-
return
|
|
169
|
+
function re(o) {
|
|
170
|
+
return o.timestamp;
|
|
156
171
|
}
|
|
157
|
-
function
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
172
|
+
function M(o, n) {
|
|
173
|
+
return o.messageId || `mid-${h.value + n}`;
|
|
174
|
+
}
|
|
175
|
+
function L(o) {
|
|
176
|
+
var u, d, k;
|
|
177
|
+
const n = o, e = n.channelId || ((u = n.channel) == null ? void 0 : u.channelId) || ((d = n.meta) == null ? void 0 : d.channelId);
|
|
178
|
+
if (e) return String(e);
|
|
179
|
+
if (!n.dialogId || !((k = N.value) != null && k.dialogs))
|
|
161
180
|
return;
|
|
162
|
-
const
|
|
163
|
-
return
|
|
181
|
+
const r = N.value.dialogs.find((I) => I.dialogId === n.dialogId);
|
|
182
|
+
return r == null ? void 0 : r.channelId;
|
|
164
183
|
}
|
|
165
|
-
function
|
|
166
|
-
return
|
|
184
|
+
function ie(o) {
|
|
185
|
+
return o.type === "message.call" && typeof a.callMessageOnCallback == "function" ? { onCall: a.callMessageOnCallback } : {};
|
|
167
186
|
}
|
|
168
|
-
const
|
|
169
|
-
checkScrollPosition:
|
|
170
|
-
startScrollWatch:
|
|
171
|
-
stopScrollWatch:
|
|
172
|
-
resetAllowFlags:
|
|
173
|
-
} =
|
|
174
|
-
feedRef:
|
|
175
|
-
emit:
|
|
176
|
-
isLoadingMoreRef:
|
|
187
|
+
const f = Q, {
|
|
188
|
+
checkScrollPosition: le,
|
|
189
|
+
startScrollWatch: U,
|
|
190
|
+
stopScrollWatch: $,
|
|
191
|
+
resetAllowFlags: de
|
|
192
|
+
} = Qe({
|
|
193
|
+
feedRef: c,
|
|
194
|
+
emit: f,
|
|
195
|
+
isLoadingMoreRef: i(() => a.isLoadingMore)
|
|
177
196
|
}), {
|
|
178
|
-
getMessage:
|
|
179
|
-
messageAction:
|
|
180
|
-
handleClickReplied:
|
|
181
|
-
feedObjectDoubleClick:
|
|
182
|
-
handleResetReply:
|
|
183
|
-
handleResetEdit:
|
|
184
|
-
} =
|
|
197
|
+
getMessage: S,
|
|
198
|
+
messageAction: ce,
|
|
199
|
+
handleClickReplied: ue,
|
|
200
|
+
feedObjectDoubleClick: me,
|
|
201
|
+
handleResetReply: fe,
|
|
202
|
+
handleResetEdit: ge
|
|
203
|
+
} = Ze({
|
|
185
204
|
enableDoubleClickReply: a.enableDoubleClickReply,
|
|
186
|
-
emit:
|
|
205
|
+
emit: f,
|
|
206
|
+
isReplyAllowed: (o) => !nt(o, L(o))
|
|
187
207
|
});
|
|
188
|
-
function
|
|
189
|
-
|
|
208
|
+
function ye(o) {
|
|
209
|
+
f("smsInvite", o);
|
|
190
210
|
}
|
|
191
|
-
function
|
|
192
|
-
|
|
211
|
+
function pe(o) {
|
|
212
|
+
f("delimiterRead", o);
|
|
193
213
|
}
|
|
194
214
|
const {
|
|
195
|
-
showKeyboard:
|
|
196
|
-
keyboardAction:
|
|
197
|
-
feedKeyboardAction:
|
|
198
|
-
} =
|
|
199
|
-
isKeyboardPlace:
|
|
200
|
-
objects:
|
|
201
|
-
emit:
|
|
215
|
+
showKeyboard: be,
|
|
216
|
+
keyboardAction: ke,
|
|
217
|
+
feedKeyboardAction: ve
|
|
218
|
+
} = Je({
|
|
219
|
+
isKeyboardPlace: Y,
|
|
220
|
+
objects: i(() => a.objects),
|
|
221
|
+
emit: f
|
|
202
222
|
}), {
|
|
203
|
-
showStickyDate:
|
|
204
|
-
stickyDateText:
|
|
205
|
-
show:
|
|
206
|
-
} =
|
|
207
|
-
feedRef:
|
|
208
|
-
trackingObjects:
|
|
223
|
+
showStickyDate: he,
|
|
224
|
+
stickyDateText: Me,
|
|
225
|
+
show: q
|
|
226
|
+
} = tt({
|
|
227
|
+
feedRef: c,
|
|
228
|
+
trackingObjects: v
|
|
209
229
|
}), {
|
|
210
|
-
isInitialized:
|
|
211
|
-
initializeScroll:
|
|
212
|
-
smoothScrollToBottom:
|
|
213
|
-
} =
|
|
214
|
-
feedRef:
|
|
215
|
-
objectsRef:
|
|
216
|
-
scrollToBottomRef:
|
|
217
|
-
}),
|
|
218
|
-
function
|
|
219
|
-
|
|
230
|
+
isInitialized: Se,
|
|
231
|
+
initializeScroll: Ie,
|
|
232
|
+
smoothScrollToBottom: Re
|
|
233
|
+
} = _e({
|
|
234
|
+
feedRef: c,
|
|
235
|
+
objectsRef: i(() => a.objects),
|
|
236
|
+
scrollToBottomRef: i(() => a.scrollToBottom)
|
|
237
|
+
}), E = i(() => a.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(at)}`);
|
|
238
|
+
function P(o = !0) {
|
|
239
|
+
if (Z(), se.value) {
|
|
240
|
+
const n = c.value;
|
|
241
|
+
n && n.scrollTop < 300 && ae(), q();
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
le(o), q();
|
|
220
245
|
}
|
|
221
|
-
const
|
|
222
|
-
function
|
|
223
|
-
|
|
246
|
+
const Ae = ot(() => P(), 250);
|
|
247
|
+
function Be() {
|
|
248
|
+
f("forceScrollToBottom"), Re();
|
|
224
249
|
}
|
|
225
|
-
function
|
|
250
|
+
function Fe(o) {
|
|
226
251
|
const n = a.objects;
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
return n[
|
|
252
|
+
if (o.startsWith("mid-")) {
|
|
253
|
+
const e = parseInt(o.slice(4), 10);
|
|
254
|
+
return n[e];
|
|
230
255
|
}
|
|
231
|
-
return n.find((
|
|
256
|
+
return n.find((e) => e.messageId === o);
|
|
232
257
|
}
|
|
233
|
-
const { restartObserving:
|
|
234
|
-
trackingObjects:
|
|
235
|
-
chatAppId:
|
|
236
|
-
getMessageById:
|
|
237
|
-
onMessageVisible: (
|
|
258
|
+
const { restartObserving: V } = Xe({
|
|
259
|
+
trackingObjects: v,
|
|
260
|
+
chatAppId: b,
|
|
261
|
+
getMessageById: Fe,
|
|
262
|
+
onMessageVisible: (o) => f("messageVisible", o)
|
|
238
263
|
});
|
|
239
|
-
return
|
|
264
|
+
return B(
|
|
240
265
|
() => a.objects,
|
|
241
266
|
() => {
|
|
242
|
-
|
|
267
|
+
F(() => {
|
|
243
268
|
requestAnimationFrame(() => {
|
|
244
|
-
|
|
269
|
+
de(), P(!1), v.value = document.querySelectorAll(".tracking-message"), V();
|
|
245
270
|
});
|
|
246
271
|
});
|
|
247
272
|
},
|
|
248
273
|
{ immediate: !0 }
|
|
249
|
-
),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
274
|
+
), B(h, () => {
|
|
275
|
+
F(() => {
|
|
276
|
+
v.value = document.querySelectorAll(".tracking-message"), V();
|
|
277
|
+
});
|
|
278
|
+
}), B(
|
|
279
|
+
() => a.scrollTo,
|
|
280
|
+
(o) => {
|
|
281
|
+
if (!o) return;
|
|
282
|
+
const n = a.objects, e = o.trim(), r = e.startsWith("msg-") ? e.slice(4) : e;
|
|
283
|
+
let u = -1;
|
|
284
|
+
r.startsWith("mid-") ? u = Number.parseInt(r.slice(4), 10) : u = n.findIndex((d) => d.messageId === r || d.messageId === e), Number.isFinite(u) && ne(u);
|
|
285
|
+
}
|
|
286
|
+
), et({
|
|
287
|
+
targetIdRef: i(() => a.scrollTo),
|
|
288
|
+
feedContainerId: `feed-container-${b}`
|
|
289
|
+
}), Te(() => {
|
|
290
|
+
F(() => {
|
|
291
|
+
a.objects.length > 0 && !Se.value && Ie();
|
|
255
292
|
});
|
|
256
|
-
}), (
|
|
257
|
-
|
|
293
|
+
}), (o, n) => (l(), g("div", rt, [
|
|
294
|
+
s.objects.length > 0 || s.typing ? (l(), g("div", {
|
|
258
295
|
key: 0,
|
|
259
|
-
id: "feed-container-" + t(
|
|
296
|
+
id: "feed-container-" + t(b),
|
|
260
297
|
ref_key: "refFeed",
|
|
261
|
-
ref:
|
|
298
|
+
ref: c,
|
|
262
299
|
class: "message-feed",
|
|
263
|
-
style:
|
|
264
|
-
onScroll: n[
|
|
265
|
-
onMousedown: n[
|
|
266
|
-
(...
|
|
267
|
-
onMouseup: n[
|
|
268
|
-
(...
|
|
300
|
+
style: G({ backgroundImage: `url(${E.value})` }),
|
|
301
|
+
onScroll: n[2] || (n[2] = (e) => t(Ae)()),
|
|
302
|
+
onMousedown: n[3] || (n[3] = //@ts-ignore
|
|
303
|
+
(...e) => t(U) && t(U)(...e)),
|
|
304
|
+
onMouseup: n[4] || (n[4] = //@ts-ignore
|
|
305
|
+
(...e) => t($) && t($)(...e))
|
|
269
306
|
}, [
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
"is-loading":
|
|
307
|
+
H(o.$slots, "prepend", {}, void 0, !0),
|
|
308
|
+
De(C("div", lt, [
|
|
309
|
+
p(We, {
|
|
310
|
+
"is-loading": s.isLoadingMore,
|
|
274
311
|
size: "small",
|
|
275
312
|
position: "top"
|
|
276
313
|
}, null, 8, ["is-loading"])
|
|
277
314
|
], 512), [
|
|
278
|
-
[
|
|
315
|
+
[we, s.isLoadingMore]
|
|
279
316
|
]),
|
|
280
|
-
|
|
281
|
-
default:
|
|
282
|
-
t(
|
|
317
|
+
p(T, null, {
|
|
318
|
+
default: D(() => [
|
|
319
|
+
t(he) && !s.isLoadingMore ? (l(), y(Ue, {
|
|
283
320
|
key: 0,
|
|
284
321
|
class: "message-feed__sticky-date",
|
|
285
|
-
text: t(
|
|
286
|
-
}, null, 8, ["text"])) :
|
|
322
|
+
text: t(Me)
|
|
323
|
+
}, null, 8, ["text"])) : m("", !0)
|
|
287
324
|
]),
|
|
288
325
|
_: 1
|
|
289
326
|
}),
|
|
290
|
-
(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
327
|
+
(l(!0), g(xe, null, Ke(t(oe), (e, r, u, d) => {
|
|
328
|
+
const k = [e.messageId, e.text, e.status, e.reply, t(O)[t(h) + r]];
|
|
329
|
+
if (d && d.key === M(e, r) && Oe(d, k)) return d;
|
|
330
|
+
const I = (l(), g("div", {
|
|
331
|
+
id: "msg-" + M(e, r),
|
|
332
|
+
key: M(e, r),
|
|
333
|
+
"data-timestamp": re(e),
|
|
334
|
+
class: "tracking-message",
|
|
335
|
+
onDblclick: (W) => t(me)(W, e)
|
|
336
|
+
}, [
|
|
337
|
+
(l(), y(je(t(_)(e)), Ne({
|
|
338
|
+
key: M(e, r),
|
|
339
|
+
class: "message-feed__message",
|
|
340
|
+
message: e,
|
|
341
|
+
"apply-style": s.applyStyle,
|
|
342
|
+
"is-first-in-series": t(O)[t(h) + r],
|
|
343
|
+
"reactions-enabled": ee.value,
|
|
344
|
+
"reactions-mode": te.value,
|
|
345
|
+
"current-user-id": x.value,
|
|
346
|
+
"reaction-user-names": K.value,
|
|
347
|
+
"subtext-tooltip-data": s.subtextTooltipData,
|
|
348
|
+
channel: L(e)
|
|
349
|
+
}, { ref_for: !0 }, ie(e), {
|
|
350
|
+
onAction: t(ce),
|
|
351
|
+
onReply: t(ue),
|
|
352
|
+
onSmsInvite: (W) => ye(e),
|
|
353
|
+
onRead: pe
|
|
354
|
+
}), null, 16, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "reactions-mode", "current-user-id", "reaction-user-names", "subtext-tooltip-data", "channel", "onAction", "onReply", "onSmsInvite"]))
|
|
355
|
+
], 40, ["id", "data-timestamp", "onDblclick"]));
|
|
356
|
+
return I.memo = k, I;
|
|
357
|
+
}, n, 0), 128)),
|
|
358
|
+
s.typing ? (l(), y(Ve, {
|
|
317
359
|
key: 0,
|
|
318
360
|
message: {
|
|
319
|
-
subText:
|
|
320
|
-
avatar:
|
|
361
|
+
subText: s.typing.title,
|
|
362
|
+
avatar: s.typing.avatar
|
|
321
363
|
}
|
|
322
|
-
}, null, 8, ["message"])) :
|
|
323
|
-
|
|
324
|
-
default:
|
|
325
|
-
t(
|
|
364
|
+
}, null, 8, ["message"])) : m("", !0),
|
|
365
|
+
p(T, null, {
|
|
366
|
+
default: D(() => [
|
|
367
|
+
t(be) ? (l(), y(Ee, {
|
|
326
368
|
key: 0,
|
|
327
369
|
ref_key: "keyboardRef",
|
|
328
|
-
ref:
|
|
370
|
+
ref: w,
|
|
329
371
|
class: "message-feed__keyboard",
|
|
330
|
-
keyboard:
|
|
331
|
-
align:
|
|
332
|
-
onAction: t(
|
|
333
|
-
}, null, 8, ["keyboard", "align", "onAction"])) :
|
|
372
|
+
keyboard: s.objects[s.objects.length - 1].keyboard,
|
|
373
|
+
align: s.keyboardAlign,
|
|
374
|
+
onAction: t(ke)
|
|
375
|
+
}, null, 8, ["keyboard", "align", "onAction"])) : m("", !0)
|
|
334
376
|
]),
|
|
335
377
|
_: 1
|
|
336
378
|
}),
|
|
337
|
-
|
|
379
|
+
s.feedKeyboards && s.feedKeyboards.length > 0 ? (l(), y(Pe, {
|
|
338
380
|
key: 1,
|
|
339
|
-
buttons:
|
|
340
|
-
align:
|
|
341
|
-
onAction: t(
|
|
342
|
-
}, null, 8, ["buttons", "align", "onAction"])) :
|
|
343
|
-
], 44,
|
|
381
|
+
buttons: s.feedKeyboards,
|
|
382
|
+
align: s.feedKeyboardAlign,
|
|
383
|
+
onAction: t(ve)
|
|
384
|
+
}, null, 8, ["buttons", "align", "onAction"])) : m("", !0)
|
|
385
|
+
], 44, it)) : (l(), g("div", {
|
|
344
386
|
key: 1,
|
|
345
387
|
ref_key: "refFeed",
|
|
346
|
-
ref:
|
|
388
|
+
ref: c,
|
|
347
389
|
class: "message-feed",
|
|
348
|
-
style:
|
|
390
|
+
style: G({ backgroundImage: `url(${E.value})` })
|
|
349
391
|
}, [
|
|
350
|
-
|
|
351
|
-
|
|
392
|
+
C("div", dt, [
|
|
393
|
+
H(o.$slots, "empty-feed", {}, void 0, !0)
|
|
352
394
|
])
|
|
353
395
|
], 4)),
|
|
354
|
-
|
|
355
|
-
default:
|
|
356
|
-
t(
|
|
396
|
+
p(T, null, {
|
|
397
|
+
default: D(() => [
|
|
398
|
+
t(X) ? (l(), g("button", {
|
|
357
399
|
key: 0,
|
|
358
400
|
class: "message-feed__button-down",
|
|
359
|
-
onClick:
|
|
401
|
+
onClick: Be
|
|
360
402
|
}, [
|
|
361
|
-
|
|
362
|
-
n[
|
|
363
|
-
])) :
|
|
403
|
+
s.buttonParams ? (l(), g("div", ct, Le(s.buttonParams.unreadAmount), 1)) : m("", !0),
|
|
404
|
+
n[5] || (n[5] = C("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
405
|
+
])) : m("", !0)
|
|
364
406
|
]),
|
|
365
407
|
_: 1
|
|
366
408
|
}),
|
|
367
|
-
t(
|
|
409
|
+
t(S)().reply ? (l(), y(J, {
|
|
368
410
|
key: 2,
|
|
369
|
-
to: "#chat-input-reply-line-" + t(
|
|
411
|
+
to: "#chat-input-reply-line-" + t(b)
|
|
370
412
|
}, [
|
|
371
|
-
|
|
413
|
+
p($e, {
|
|
372
414
|
class: "chat-input-reply",
|
|
373
|
-
message: t(
|
|
374
|
-
onReset: t(
|
|
415
|
+
message: t(S)().reply,
|
|
416
|
+
onReset: t(fe)
|
|
375
417
|
}, null, 8, ["message", "onReset"])
|
|
376
|
-
], 8, ["to"])) :
|
|
377
|
-
t(
|
|
418
|
+
], 8, ["to"])) : m("", !0),
|
|
419
|
+
t(S)().edit ? (l(), y(J, {
|
|
378
420
|
key: 3,
|
|
379
|
-
to: "#chat-input-reply-line-" + t(
|
|
421
|
+
to: "#chat-input-reply-line-" + t(b)
|
|
380
422
|
}, [
|
|
381
|
-
|
|
423
|
+
p(qe, {
|
|
382
424
|
class: "chat-input-reply",
|
|
383
|
-
message: t(
|
|
384
|
-
onReset: t(
|
|
425
|
+
message: t(S)().edit,
|
|
426
|
+
onReset: t(ge)
|
|
385
427
|
}, null, 8, ["message", "onReset"])
|
|
386
|
-
], 8, ["to"])) :
|
|
428
|
+
], 8, ["to"])) : m("", !0)
|
|
387
429
|
]));
|
|
388
430
|
}
|
|
389
431
|
});
|
|
390
432
|
export {
|
|
391
|
-
|
|
433
|
+
jt as default
|
|
392
434
|
};
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
const
|
|
1
|
+
import { computed as a } from "vue";
|
|
2
|
+
const u = /* @__PURE__ */ new Set([
|
|
3
3
|
"message.system",
|
|
4
4
|
"message.typing",
|
|
5
5
|
"message.delimiter",
|
|
6
6
|
"system.date"
|
|
7
7
|
]);
|
|
8
|
-
function
|
|
9
|
-
for (let e =
|
|
10
|
-
if (!
|
|
11
|
-
return
|
|
8
|
+
function l(t, o) {
|
|
9
|
+
for (let e = o - 1; e >= 0; e--)
|
|
10
|
+
if (!u.has(t[e].type))
|
|
11
|
+
return t[e];
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function c({ objects: t }) {
|
|
15
15
|
return {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
seriesFlags: a(() => {
|
|
17
|
+
const e = t.value;
|
|
18
|
+
if (!e || e.length === 0) return [];
|
|
19
|
+
const n = new Array(e.length);
|
|
20
|
+
for (let s = 0; s < e.length; s++) {
|
|
21
|
+
const r = e[s];
|
|
22
|
+
if (u.has(r.type)) {
|
|
23
|
+
n[s] = !0;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const i = l(e, s);
|
|
27
|
+
n[s] = !(i != null && i.position === r.position && i.header === r.header);
|
|
28
|
+
}
|
|
29
|
+
return n;
|
|
30
|
+
})
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
export {
|
|
31
|
-
|
|
34
|
+
c as useFeedGrouping
|
|
32
35
|
};
|