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