@mobilon-dev/chotto 0.3.120 → 0.3.123
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/DeletedMessageContent/icons → 1_icons}/DeletedMessageIcon.vue.js +1 -1
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +197 -194
- package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue.js +4 -4
- package/dist/components/2_feed_elements/DeletedMessageContent/DeletedMessageContent.vue2.js +1 -1
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/Feed.vue2.js +126 -117
- package/dist/components/3_compounds/Feed/composables/useFeedScroll.js +19 -17
- package/dist/types/src/apps/data/chats.d.ts +9 -2
- package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts +1 -0
- package/dist/types/src/components/2_chatlist_elements/ChatItem/types.d.ts +2 -0
- package/dist/types/src/components/3_compounds/Feed/composables/useFeedScroll.d.ts +2 -0
- package/package.json +1 -1
- /package/dist/types/src/components/{2_feed_elements/DeletedMessageContent/icons → 1_icons}/DeletedMessageIcon.vue.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Feed.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-974328f1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useFeedButton as
|
|
11
|
-
import { useFeedComponents as
|
|
12
|
-
import { useFeedGrouping as
|
|
13
|
-
import { useFeedKeyboard as
|
|
14
|
-
import { useFeedLoadMore as
|
|
15
|
-
import { useFeedMessageVisibility as
|
|
16
|
-
import { useFeedProgressiveRender as
|
|
17
|
-
import { provideFeedReactionsOverlay as
|
|
18
|
-
import { useFeedReply as
|
|
19
|
-
import { useFeedScroll as
|
|
20
|
-
import { useFeedScrollTo as
|
|
21
|
-
import { useStickyDate as
|
|
22
|
-
import { throttle as
|
|
23
|
-
import { getDefaultMessageMenuActions as
|
|
24
|
-
import { isSmsFeedMessage as
|
|
1
|
+
import { defineComponent as Ke, ref as I, computed as l, provide as A, inject as H, unref as o, watch as B, nextTick as F, onMounted as xe, createElementBlock as y, openBlock as i, createVNode as p, createBlock as f, createCommentVNode as c, normalizeStyle as J, renderSlot as Q, withDirectives as Oe, createElementVNode as C, vShow as $e, Transition as T, withCtx as D, Fragment as Ne, renderList as Le, isMemoSame as Ue, resolveDynamicComponent as je, mergeProps as qe, toDisplayString as Ee, Teleport as X } from "vue";
|
|
2
|
+
import Pe from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
|
|
3
|
+
import Ve from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
4
|
+
import We from "../../2_feed_elements/BaseEditMessage/BaseEditMessage.vue.js";
|
|
5
|
+
import ze from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
|
|
6
|
+
import Ge from "../../2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js";
|
|
7
|
+
import He from "../../2_feed_elements/TypingMessage/TypingMessage.vue.js";
|
|
8
|
+
import Je from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
|
|
9
|
+
import Qe from "../../2_feed_elements/MessageReactions/MessageReactionsOverlay.vue.js";
|
|
10
|
+
import { useFeedButton as Xe } from "./composables/useFeedButton.js";
|
|
11
|
+
import { useFeedComponents as Ye } from "./composables/useFeedComponents.js";
|
|
12
|
+
import { useFeedGrouping as Ze } from "./composables/useFeedGrouping.js";
|
|
13
|
+
import { useFeedKeyboard as _e } from "./composables/useFeedKeyboard.js";
|
|
14
|
+
import { useFeedLoadMore as et } from "./composables/useFeedLoadMore.js";
|
|
15
|
+
import { useFeedMessageVisibility as tt } from "./composables/useFeedMessageVisibility.js";
|
|
16
|
+
import { useFeedProgressiveRender as st } from "./composables/useFeedProgressiveRender.js";
|
|
17
|
+
import { provideFeedReactionsOverlay as ot } from "./composables/useFeedReactionsOverlay.js";
|
|
18
|
+
import { useFeedReply as at } from "./composables/useFeedReply.js";
|
|
19
|
+
import { useFeedScroll as nt } from "./composables/useFeedScroll.js";
|
|
20
|
+
import { useFeedScrollTo as rt } from "./composables/useFeedScrollTo.js";
|
|
21
|
+
import { useStickyDate as it } from "./composables/useStickyDate.js";
|
|
22
|
+
import { throttle as lt } from "./functions/throttle.js";
|
|
23
|
+
import { getDefaultMessageMenuActions as dt } from "./utils/getDefaultMessageMenuActions.js";
|
|
24
|
+
import { isSmsFeedMessage as ct } from "../../../functions/isSmsChannel.js";
|
|
25
25
|
import "../../../functions/parseMarkdown.js";
|
|
26
|
-
import
|
|
27
|
-
const
|
|
26
|
+
import ut from "./assets/chat-background.svg.js";
|
|
27
|
+
const mt = {
|
|
28
28
|
class: "message-feed-wrapper",
|
|
29
29
|
"data-testid": "feed"
|
|
30
|
-
},
|
|
30
|
+
}, ft = ["id"], gt = { class: "message-feed__loading" }, yt = { style: { margin: "auto" } }, pt = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "message-feed__unread-amount"
|
|
33
|
-
},
|
|
33
|
+
}, Vt = /* @__PURE__ */ Ke({
|
|
34
34
|
__name: "Feed",
|
|
35
35
|
props: {
|
|
36
36
|
/**
|
|
@@ -128,7 +128,7 @@ const dt = {
|
|
|
128
128
|
*/
|
|
129
129
|
messageMenuActions: {
|
|
130
130
|
type: Array,
|
|
131
|
-
default: () =>
|
|
131
|
+
default: () => dt()
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
emits: [
|
|
@@ -143,22 +143,22 @@ const dt = {
|
|
|
143
143
|
"smsInvite",
|
|
144
144
|
"delimiterRead"
|
|
145
145
|
],
|
|
146
|
-
setup(a, { emit:
|
|
147
|
-
const n = a, v =
|
|
148
|
-
isShowButton:
|
|
146
|
+
setup(a, { emit: Y }) {
|
|
147
|
+
const n = a, v = I(), u = I(), w = I(), {
|
|
148
|
+
isShowButton: K,
|
|
149
149
|
isKeyboardPlace: Z,
|
|
150
150
|
checkButtonVisibility: _
|
|
151
|
-
} =
|
|
151
|
+
} = Xe({
|
|
152
152
|
feedRef: u,
|
|
153
153
|
keyboardRef: w
|
|
154
|
-
}), { componentsMap: ee } =
|
|
155
|
-
|
|
156
|
-
const te = l(() => n.reactionsMode),
|
|
157
|
-
A("currentUserId",
|
|
154
|
+
}), { componentsMap: ee } = Ye(), x = l(() => n.reactionsEnabled);
|
|
155
|
+
ot();
|
|
156
|
+
const te = l(() => n.reactionsMode), O = l(() => n.currentUserId), $ = l(() => n.reactionUserNames);
|
|
157
|
+
A("currentUserId", O), A("reactionUserNames", $), A(
|
|
158
158
|
"messageMenuActions",
|
|
159
159
|
l(() => n.messageMenuActions)
|
|
160
160
|
);
|
|
161
|
-
const { seriesFlags:
|
|
161
|
+
const { seriesFlags: N } = Ze({
|
|
162
162
|
objects: l(() => n.objects)
|
|
163
163
|
}), {
|
|
164
164
|
visibleObjects: se,
|
|
@@ -166,12 +166,12 @@ const dt = {
|
|
|
166
166
|
isBackfilling: oe,
|
|
167
167
|
revealThroughIndex: ae,
|
|
168
168
|
accelerateBackfill: ne
|
|
169
|
-
} =
|
|
169
|
+
} = st({
|
|
170
170
|
objectsRef: l(() => n.objects),
|
|
171
171
|
feedRef: u
|
|
172
|
-
}), b =
|
|
173
|
-
if (
|
|
174
|
-
return o(
|
|
172
|
+
}), b = H("chatAppId"), L = H("selectedChat", void 0), U = l(() => {
|
|
173
|
+
if (L)
|
|
174
|
+
return o(L);
|
|
175
175
|
});
|
|
176
176
|
function re(t) {
|
|
177
177
|
return t.timestamp;
|
|
@@ -184,38 +184,38 @@ const dt = {
|
|
|
184
184
|
const s = (e = t.reactions) == null ? void 0 : e.items;
|
|
185
185
|
return s != null && s.length ? s.map((r) => `${r.key}:${r.userId}`).join(",") : "";
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function j(t) {
|
|
188
188
|
var m, d, k;
|
|
189
189
|
const s = t, e = s.channelId || ((m = s.channel) == null ? void 0 : m.channelId) || ((d = s.meta) == null ? void 0 : d.channelId);
|
|
190
190
|
if (e) return String(e);
|
|
191
|
-
if (!s.dialogId || !((k =
|
|
191
|
+
if (!s.dialogId || !((k = U.value) != null && k.dialogs))
|
|
192
192
|
return;
|
|
193
|
-
const r =
|
|
193
|
+
const r = U.value.dialogs.find((R) => R.dialogId === s.dialogId);
|
|
194
194
|
return r == null ? void 0 : r.channelId;
|
|
195
195
|
}
|
|
196
196
|
function le(t) {
|
|
197
197
|
return t.type === "message.call" && typeof n.callMessageOnCallback == "function" ? { onCall: n.callMessageOnCallback } : {};
|
|
198
198
|
}
|
|
199
|
-
const g =
|
|
199
|
+
const g = Y, {
|
|
200
200
|
checkScrollPosition: de,
|
|
201
|
-
startScrollWatch:
|
|
202
|
-
stopScrollWatch:
|
|
201
|
+
startScrollWatch: q,
|
|
202
|
+
stopScrollWatch: E,
|
|
203
203
|
resetAllowFlags: ce
|
|
204
|
-
} =
|
|
204
|
+
} = et({
|
|
205
205
|
feedRef: u,
|
|
206
206
|
emit: g,
|
|
207
207
|
isLoadingMoreRef: l(() => n.isLoadingMore)
|
|
208
208
|
}), {
|
|
209
|
-
getMessage:
|
|
209
|
+
getMessage: S,
|
|
210
210
|
messageAction: ue,
|
|
211
211
|
handleClickReplied: me,
|
|
212
212
|
feedObjectDoubleClick: fe,
|
|
213
213
|
handleResetReply: ge,
|
|
214
214
|
handleResetEdit: ye
|
|
215
|
-
} =
|
|
215
|
+
} = at({
|
|
216
216
|
enableDoubleClickReply: n.enableDoubleClickReply,
|
|
217
217
|
emit: g,
|
|
218
|
-
isReplyAllowed: (t) => !
|
|
218
|
+
isReplyAllowed: (t) => !ct(t, j(t))
|
|
219
219
|
});
|
|
220
220
|
function pe(t) {
|
|
221
221
|
g("smsInvite", t);
|
|
@@ -227,39 +227,48 @@ const dt = {
|
|
|
227
227
|
showKeyboard: ke,
|
|
228
228
|
keyboardAction: ve,
|
|
229
229
|
feedKeyboardAction: he
|
|
230
|
-
} =
|
|
230
|
+
} = _e({
|
|
231
231
|
isKeyboardPlace: Z,
|
|
232
232
|
objects: l(() => n.objects),
|
|
233
233
|
emit: g
|
|
234
234
|
}), {
|
|
235
235
|
showStickyDate: Me,
|
|
236
|
-
stickyDateText:
|
|
237
|
-
show:
|
|
238
|
-
|
|
236
|
+
stickyDateText: Se,
|
|
237
|
+
show: Re,
|
|
238
|
+
hide: Ie
|
|
239
|
+
} = it({
|
|
239
240
|
feedRef: u,
|
|
240
241
|
trackingObjects: v
|
|
241
242
|
}), {
|
|
242
|
-
isInitialized:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
isInitialized: Ae,
|
|
244
|
+
stickToBottom: Be,
|
|
245
|
+
initializeScroll: Fe,
|
|
246
|
+
smoothScrollToBottom: Ce
|
|
247
|
+
} = nt({
|
|
246
248
|
feedRef: u,
|
|
247
249
|
objectsRef: l(() => n.objects),
|
|
248
250
|
scrollToBottomRef: l(() => n.scrollToBottom)
|
|
249
|
-
}), P = l(() => n.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(
|
|
250
|
-
function V(
|
|
251
|
+
}), P = l(() => n.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(ut)}`);
|
|
252
|
+
function V() {
|
|
253
|
+
if (Be.value || !K.value) {
|
|
254
|
+
Ie();
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
Re();
|
|
258
|
+
}
|
|
259
|
+
function W(t = !0) {
|
|
251
260
|
if (_(), oe.value) {
|
|
252
261
|
const s = u.value;
|
|
253
|
-
s && s.scrollTop < 300 && ne(),
|
|
262
|
+
s && s.scrollTop < 300 && ne(), V();
|
|
254
263
|
return;
|
|
255
264
|
}
|
|
256
|
-
de(t),
|
|
265
|
+
de(t), V();
|
|
257
266
|
}
|
|
258
|
-
const
|
|
259
|
-
function
|
|
260
|
-
g("forceScrollToBottom"),
|
|
267
|
+
const Te = lt(() => W(), 250);
|
|
268
|
+
function De() {
|
|
269
|
+
g("forceScrollToBottom"), Ce();
|
|
261
270
|
}
|
|
262
|
-
function
|
|
271
|
+
function we(t) {
|
|
263
272
|
const s = n.objects;
|
|
264
273
|
if (t.startsWith("mid-")) {
|
|
265
274
|
const e = parseInt(t.slice(4), 10);
|
|
@@ -267,10 +276,10 @@ const dt = {
|
|
|
267
276
|
}
|
|
268
277
|
return s.find((e) => e.messageId === t);
|
|
269
278
|
}
|
|
270
|
-
const { restartObserving:
|
|
279
|
+
const { restartObserving: z } = tt({
|
|
271
280
|
trackingObjects: v,
|
|
272
281
|
chatAppId: b,
|
|
273
|
-
getMessageById:
|
|
282
|
+
getMessageById: we,
|
|
274
283
|
onMessageVisible: (t) => g("messageVisible", t)
|
|
275
284
|
});
|
|
276
285
|
return B(
|
|
@@ -278,14 +287,14 @@ const dt = {
|
|
|
278
287
|
() => {
|
|
279
288
|
F(() => {
|
|
280
289
|
requestAnimationFrame(() => {
|
|
281
|
-
ce(),
|
|
290
|
+
ce(), W(!1), v.value = document.querySelectorAll(".tracking-message"), z();
|
|
282
291
|
});
|
|
283
292
|
});
|
|
284
293
|
},
|
|
285
294
|
{ immediate: !0 }
|
|
286
295
|
), B(h, () => {
|
|
287
296
|
F(() => {
|
|
288
|
-
v.value = document.querySelectorAll(".tracking-message"),
|
|
297
|
+
v.value = document.querySelectorAll(".tracking-message"), z();
|
|
289
298
|
});
|
|
290
299
|
}), B(
|
|
291
300
|
() => n.scrollTo,
|
|
@@ -295,14 +304,14 @@ const dt = {
|
|
|
295
304
|
let m = -1;
|
|
296
305
|
r.startsWith("mid-") ? m = Number.parseInt(r.slice(4), 10) : m = s.findIndex((d) => d.messageId === r || d.messageId === e), Number.isFinite(m) && ae(m);
|
|
297
306
|
}
|
|
298
|
-
),
|
|
307
|
+
), rt({
|
|
299
308
|
targetIdRef: l(() => n.scrollTo),
|
|
300
309
|
feedContainerId: `feed-container-${b}`
|
|
301
|
-
}),
|
|
310
|
+
}), xe(() => {
|
|
302
311
|
F(() => {
|
|
303
|
-
n.objects.length > 0 && !
|
|
312
|
+
n.objects.length > 0 && !Ae.value && Fe();
|
|
304
313
|
});
|
|
305
|
-
}), (t, s) => (i(), y("div",
|
|
314
|
+
}), (t, s) => (i(), y("div", mt, [
|
|
306
315
|
a.objects.length > 0 || a.typing ? (i(), y("div", {
|
|
307
316
|
key: 0,
|
|
308
317
|
id: "feed-container-" + o(b),
|
|
@@ -310,67 +319,67 @@ const dt = {
|
|
|
310
319
|
ref: u,
|
|
311
320
|
class: "message-feed",
|
|
312
321
|
"data-testid": "feed-scroll",
|
|
313
|
-
style:
|
|
314
|
-
onScroll: s[2] || (s[2] = (e) => o(
|
|
322
|
+
style: J({ backgroundImage: `url(${P.value})` }),
|
|
323
|
+
onScroll: s[2] || (s[2] = (e) => o(Te)()),
|
|
315
324
|
onMousedown: s[3] || (s[3] = //@ts-ignore
|
|
316
|
-
(...e) => o(
|
|
325
|
+
(...e) => o(q) && o(q)(...e)),
|
|
317
326
|
onMouseup: s[4] || (s[4] = //@ts-ignore
|
|
318
|
-
(...e) => o(
|
|
327
|
+
(...e) => o(E) && o(E)(...e))
|
|
319
328
|
}, [
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
p(
|
|
329
|
+
Q(t.$slots, "prepend", {}, void 0, !0),
|
|
330
|
+
Oe(C("div", gt, [
|
|
331
|
+
p(Je, {
|
|
323
332
|
"is-loading": a.isLoadingMore,
|
|
324
333
|
size: "small",
|
|
325
334
|
position: "top"
|
|
326
335
|
}, null, 8, ["is-loading"])
|
|
327
336
|
], 512), [
|
|
328
|
-
[
|
|
337
|
+
[$e, a.isLoadingMore]
|
|
329
338
|
]),
|
|
330
339
|
p(T, null, {
|
|
331
340
|
default: D(() => [
|
|
332
|
-
o(Me) && !a.isLoadingMore ? (i(), f(
|
|
341
|
+
o(Me) && !a.isLoadingMore ? (i(), f(Pe, {
|
|
333
342
|
key: 0,
|
|
334
343
|
class: "message-feed__sticky-date",
|
|
335
|
-
text: o(
|
|
344
|
+
text: o(Se)
|
|
336
345
|
}, null, 8, ["text"])) : c("", !0)
|
|
337
346
|
]),
|
|
338
347
|
_: 1
|
|
339
348
|
}),
|
|
340
|
-
(i(!0), y(
|
|
341
|
-
const k = [e.messageId, e.text, e.status, e.reply, e.deleted, o(
|
|
342
|
-
if (d && d.key === M(e, r) &&
|
|
343
|
-
const
|
|
349
|
+
(i(!0), y(Ne, null, Le(o(se), (e, r, m, d) => {
|
|
350
|
+
const k = [e.messageId, e.text, e.status, e.reply, e.deleted, o(N)[o(h) + r], ie(e)];
|
|
351
|
+
if (d && d.key === M(e, r) && Ue(d, k)) return d;
|
|
352
|
+
const R = (i(), y("div", {
|
|
344
353
|
id: "msg-" + M(e, r),
|
|
345
354
|
key: M(e, r),
|
|
346
355
|
"data-timestamp": re(e),
|
|
347
356
|
"data-testid": "feed-message",
|
|
348
357
|
"data-message-id": e.messageId,
|
|
349
358
|
class: "tracking-message",
|
|
350
|
-
onDblclick: (
|
|
359
|
+
onDblclick: (G) => o(fe)(G, e)
|
|
351
360
|
}, [
|
|
352
|
-
(i(), f(
|
|
361
|
+
(i(), f(je(o(ee)(e)), qe({
|
|
353
362
|
key: M(e, r),
|
|
354
363
|
class: "message-feed__message",
|
|
355
364
|
message: e,
|
|
356
365
|
"apply-style": a.applyStyle,
|
|
357
|
-
"is-first-in-series": o(
|
|
358
|
-
"reactions-enabled":
|
|
366
|
+
"is-first-in-series": o(N)[o(h) + r],
|
|
367
|
+
"reactions-enabled": x.value,
|
|
359
368
|
"reactions-mode": te.value,
|
|
360
|
-
"current-user-id":
|
|
361
|
-
"reaction-user-names":
|
|
369
|
+
"current-user-id": O.value,
|
|
370
|
+
"reaction-user-names": $.value,
|
|
362
371
|
"subtext-tooltip-data": a.subtextTooltipData,
|
|
363
|
-
channel:
|
|
372
|
+
channel: j(e)
|
|
364
373
|
}, { ref_for: !0 }, le(e), {
|
|
365
374
|
onAction: o(ue),
|
|
366
375
|
onReply: o(me),
|
|
367
|
-
onSmsInvite: (
|
|
376
|
+
onSmsInvite: (G) => pe(e),
|
|
368
377
|
onRead: be
|
|
369
378
|
}), 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"]))
|
|
370
379
|
], 40, ["id", "data-timestamp", "data-message-id", "onDblclick"]));
|
|
371
|
-
return
|
|
380
|
+
return R.memo = k, R;
|
|
372
381
|
}, s, 0), 128)),
|
|
373
|
-
a.typing ? (i(), f(
|
|
382
|
+
a.typing ? (i(), f(He, {
|
|
374
383
|
key: 0,
|
|
375
384
|
message: {
|
|
376
385
|
subText: a.typing.title,
|
|
@@ -379,7 +388,7 @@ const dt = {
|
|
|
379
388
|
}, null, 8, ["message"])) : c("", !0),
|
|
380
389
|
p(T, null, {
|
|
381
390
|
default: D(() => [
|
|
382
|
-
o(ke) ? (i(), f(
|
|
391
|
+
o(ke) ? (i(), f(ze, {
|
|
383
392
|
key: 0,
|
|
384
393
|
ref_key: "keyboardRef",
|
|
385
394
|
ref: w,
|
|
@@ -391,61 +400,61 @@ const dt = {
|
|
|
391
400
|
]),
|
|
392
401
|
_: 1
|
|
393
402
|
}),
|
|
394
|
-
a.feedKeyboards && a.feedKeyboards.length > 0 ? (i(), f(
|
|
403
|
+
a.feedKeyboards && a.feedKeyboards.length > 0 ? (i(), f(Ge, {
|
|
395
404
|
key: 1,
|
|
396
405
|
class: "message-feed__feed-keyboard",
|
|
397
406
|
buttons: a.feedKeyboards,
|
|
398
407
|
align: a.feedKeyboardAlign,
|
|
399
408
|
onAction: o(he)
|
|
400
409
|
}, null, 8, ["buttons", "align", "onAction"])) : c("", !0)
|
|
401
|
-
], 44,
|
|
410
|
+
], 44, ft)) : (i(), y("div", {
|
|
402
411
|
key: 1,
|
|
403
412
|
ref_key: "refFeed",
|
|
404
413
|
ref: u,
|
|
405
414
|
class: "message-feed",
|
|
406
|
-
style:
|
|
415
|
+
style: J({ backgroundImage: `url(${P.value})` })
|
|
407
416
|
}, [
|
|
408
|
-
C("div",
|
|
409
|
-
|
|
417
|
+
C("div", yt, [
|
|
418
|
+
Q(t.$slots, "empty-feed", {}, void 0, !0)
|
|
410
419
|
])
|
|
411
420
|
], 4)),
|
|
412
421
|
p(T, null, {
|
|
413
422
|
default: D(() => [
|
|
414
|
-
o(
|
|
423
|
+
o(K) ? (i(), y("button", {
|
|
415
424
|
key: 0,
|
|
416
425
|
class: "message-feed__button-down",
|
|
417
|
-
onClick:
|
|
426
|
+
onClick: De
|
|
418
427
|
}, [
|
|
419
|
-
a.buttonParams ? (i(), y("div",
|
|
428
|
+
a.buttonParams ? (i(), y("div", pt, Ee(a.buttonParams.unreadAmount), 1)) : c("", !0),
|
|
420
429
|
s[5] || (s[5] = C("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
421
430
|
])) : c("", !0)
|
|
422
431
|
]),
|
|
423
432
|
_: 1
|
|
424
433
|
}),
|
|
425
|
-
o(
|
|
434
|
+
o(S)().reply ? (i(), f(X, {
|
|
426
435
|
key: 2,
|
|
427
436
|
to: "#chat-input-reply-line-" + o(b)
|
|
428
437
|
}, [
|
|
429
|
-
p(
|
|
438
|
+
p(Ve, {
|
|
430
439
|
class: "chat-input-reply",
|
|
431
|
-
message: o(
|
|
440
|
+
message: o(S)().reply,
|
|
432
441
|
onReset: o(ge)
|
|
433
442
|
}, null, 8, ["message", "onReset"])
|
|
434
443
|
], 8, ["to"])) : c("", !0),
|
|
435
|
-
o(
|
|
444
|
+
o(S)().edit ? (i(), f(X, {
|
|
436
445
|
key: 3,
|
|
437
446
|
to: "#chat-input-reply-line-" + o(b)
|
|
438
447
|
}, [
|
|
439
|
-
p(
|
|
448
|
+
p(We, {
|
|
440
449
|
class: "chat-input-reply",
|
|
441
|
-
message: o(
|
|
450
|
+
message: o(S)().edit,
|
|
442
451
|
onReset: o(ye)
|
|
443
452
|
}, null, 8, ["message", "onReset"])
|
|
444
453
|
], 8, ["to"])) : c("", !0),
|
|
445
|
-
|
|
454
|
+
x.value ? (i(), f(Qe, { key: 4 })) : c("", !0)
|
|
446
455
|
]));
|
|
447
456
|
}
|
|
448
457
|
});
|
|
449
458
|
export {
|
|
450
|
-
|
|
459
|
+
Vt as default
|
|
451
460
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { ref as S, watch as f, nextTick as h, onUnmounted as U } from "vue";
|
|
2
|
-
function q({ feedRef:
|
|
3
|
-
const a = S(!1),
|
|
2
|
+
function q({ feedRef: i, objectsRef: l, scrollToBottomRef: B }) {
|
|
3
|
+
const a = S(!1), n = S(!1);
|
|
4
4
|
let d = !1, u = !1, s = null, e = null;
|
|
5
5
|
function c() {
|
|
6
|
-
if (!
|
|
7
|
-
const t =
|
|
6
|
+
if (!n.value) return;
|
|
7
|
+
const t = i.value;
|
|
8
8
|
t && (d = !0, t.style.scrollBehavior = "auto", t.scrollTop = t.scrollHeight, requestAnimationFrame(() => {
|
|
9
9
|
d = !1;
|
|
10
10
|
}));
|
|
11
11
|
}
|
|
12
12
|
function g() {
|
|
13
|
-
const t =
|
|
13
|
+
const t = i.value;
|
|
14
14
|
if (!t) return;
|
|
15
|
-
const
|
|
16
|
-
t.style.scrollBehavior = "auto", t.scrollTop =
|
|
15
|
+
const o = t.scrollTop;
|
|
16
|
+
t.style.scrollBehavior = "auto", t.scrollTop = o;
|
|
17
17
|
}
|
|
18
18
|
function m() {
|
|
19
|
-
|
|
19
|
+
n.value = !0, h(() => {
|
|
20
20
|
c(), requestAnimationFrame(() => c());
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
function r() {
|
|
24
|
-
|
|
24
|
+
n.value && (n.value = !1, g());
|
|
25
25
|
}
|
|
26
26
|
function p(t) {
|
|
27
27
|
e == null || e.disconnect(), e = new ResizeObserver(() => {
|
|
28
28
|
c();
|
|
29
29
|
}), e.observe(t);
|
|
30
|
-
for (const
|
|
31
|
-
|
|
30
|
+
for (const o of t.children)
|
|
31
|
+
o instanceof HTMLElement && e.observe(o);
|
|
32
32
|
}
|
|
33
33
|
function w() {
|
|
34
34
|
u = !0;
|
|
@@ -52,22 +52,22 @@ function q({ feedRef: o, objectsRef: l, scrollToBottomRef: B }) {
|
|
|
52
52
|
!a.value && l.value.length > 0 && (m(), a.value = !0);
|
|
53
53
|
}
|
|
54
54
|
function P() {
|
|
55
|
-
|
|
56
|
-
const t =
|
|
55
|
+
n.value = !0, h(() => {
|
|
56
|
+
const t = i.value;
|
|
57
57
|
t && t.scrollTo({ top: t.scrollHeight, behavior: "smooth" });
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
return f(
|
|
61
|
-
|
|
62
|
-
(t,
|
|
63
|
-
|
|
61
|
+
i,
|
|
62
|
+
(t, o) => {
|
|
63
|
+
o && E(o), s = t ?? null, t && (k(t), p(t), n.value && c());
|
|
64
64
|
},
|
|
65
65
|
{ immediate: !0 }
|
|
66
66
|
), f(
|
|
67
67
|
l,
|
|
68
68
|
() => {
|
|
69
69
|
h(() => {
|
|
70
|
-
|
|
70
|
+
i.value && p(i.value);
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
), f(
|
|
@@ -86,6 +86,8 @@ function q({ feedRef: o, objectsRef: l, scrollToBottomRef: B }) {
|
|
|
86
86
|
e == null || e.disconnect(), e = null, s && (E(s), s = null);
|
|
87
87
|
}), {
|
|
88
88
|
isInitialized: a,
|
|
89
|
+
/** true, пока лента прижата вниз (автоскролл при новых сообщениях) */
|
|
90
|
+
stickToBottom: n,
|
|
89
91
|
performScrollToBottom: F,
|
|
90
92
|
initializeScroll: T,
|
|
91
93
|
smoothScrollToBottom: P
|
|
@@ -166,6 +166,7 @@ export declare const chats: ({
|
|
|
166
166
|
lastMessage: {
|
|
167
167
|
type: string;
|
|
168
168
|
data?: undefined;
|
|
169
|
+
deleted?: undefined;
|
|
169
170
|
};
|
|
170
171
|
'lastMessage.status': string;
|
|
171
172
|
'lastActivity.time': string;
|
|
@@ -198,6 +199,7 @@ export declare const chats: ({
|
|
|
198
199
|
filename: string;
|
|
199
200
|
isVoiceMessage?: undefined;
|
|
200
201
|
};
|
|
202
|
+
deleted?: undefined;
|
|
201
203
|
};
|
|
202
204
|
'lastMessage.status': string;
|
|
203
205
|
'lastActivity.time': string;
|
|
@@ -254,6 +256,7 @@ export declare const chats: ({
|
|
|
254
256
|
filename: string;
|
|
255
257
|
isVoiceMessage?: undefined;
|
|
256
258
|
};
|
|
259
|
+
deleted?: undefined;
|
|
257
260
|
};
|
|
258
261
|
'lastActivity.time': string;
|
|
259
262
|
'lastActivity.timestamp': string;
|
|
@@ -305,10 +308,11 @@ export declare const chats: ({
|
|
|
305
308
|
countUnread: number;
|
|
306
309
|
lastMessage: {
|
|
307
310
|
type: string;
|
|
311
|
+
deleted: boolean;
|
|
308
312
|
data: {
|
|
309
313
|
text: string;
|
|
310
|
-
url
|
|
311
|
-
filename
|
|
314
|
+
url?: undefined;
|
|
315
|
+
filename?: undefined;
|
|
312
316
|
isVoiceMessage?: undefined;
|
|
313
317
|
};
|
|
314
318
|
};
|
|
@@ -393,6 +397,7 @@ export declare const chats: ({
|
|
|
393
397
|
filename: string;
|
|
394
398
|
isVoiceMessage?: undefined;
|
|
395
399
|
};
|
|
400
|
+
deleted?: undefined;
|
|
396
401
|
};
|
|
397
402
|
'lastActivity.time': string;
|
|
398
403
|
'lastActivity.timestamp': string;
|
|
@@ -425,6 +430,7 @@ export declare const chats: ({
|
|
|
425
430
|
text?: undefined;
|
|
426
431
|
isVoiceMessage?: undefined;
|
|
427
432
|
};
|
|
433
|
+
deleted?: undefined;
|
|
428
434
|
};
|
|
429
435
|
'lastMessage.status': string;
|
|
430
436
|
'lastActivity.time': string;
|
|
@@ -457,6 +463,7 @@ export declare const chats: ({
|
|
|
457
463
|
isVoiceMessage: boolean;
|
|
458
464
|
text?: undefined;
|
|
459
465
|
};
|
|
466
|
+
deleted?: undefined;
|
|
460
467
|
};
|
|
461
468
|
'lastMessage.status': string;
|
|
462
469
|
'lastActivity.time': string;
|
package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const ChatItemWithAvatar: Story;
|
|
|
15
15
|
export declare const ChatItemVerified: Story;
|
|
16
16
|
export declare const ChatItemWithUnread: Story;
|
|
17
17
|
export declare const ChatItemWithLongLastMessage: Story;
|
|
18
|
+
export declare const ChatItemWithDeletedLastMessage: Story;
|
|
18
19
|
export declare const ChatItemSelected: Story;
|
|
19
20
|
export declare const ChatItemWithActions: Story;
|
|
20
21
|
export declare const ChatItemWithStatusOnline: Story;
|
|
@@ -29,6 +29,8 @@ export interface ILastMessageObject {
|
|
|
29
29
|
channelId?: string;
|
|
30
30
|
senderId?: string;
|
|
31
31
|
type?: string;
|
|
32
|
+
/** Сообщение удалено — в lastMessage показываем tombstone независимо от type */
|
|
33
|
+
deleted?: boolean;
|
|
32
34
|
isVoiceMessage?: boolean;
|
|
33
35
|
data?: {
|
|
34
36
|
text?: string;
|
|
@@ -17,6 +17,8 @@ interface UseFeedScrollOptions<T = unknown> {
|
|
|
17
17
|
}
|
|
18
18
|
export declare function useFeedScroll<T = unknown>({ feedRef, objectsRef, scrollToBottomRef }: UseFeedScrollOptions<T>): {
|
|
19
19
|
isInitialized: Ref<boolean, boolean>;
|
|
20
|
+
/** true, пока лента прижата вниз (автоскролл при новых сообщениях) */
|
|
21
|
+
stickToBottom: Ref<boolean, boolean>;
|
|
20
22
|
performScrollToBottom: () => void;
|
|
21
23
|
initializeScroll: () => void;
|
|
22
24
|
smoothScrollToBottom: () => void;
|
package/package.json
CHANGED