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