@mobilon-dev/chotto 0.3.103 → 0.3.105

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 (30) 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 +164 -160
  4. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +2 -2
  5. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +106 -102
  6. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +3 -3
  7. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +121 -116
  8. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +3 -3
  9. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +116 -111
  10. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +1 -1
  11. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +153 -149
  12. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +3 -3
  13. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +131 -126
  14. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
  15. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +189 -161
  16. package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
  17. package/dist/components/3_compounds/Feed/Feed.vue2.js +174 -170
  18. package/dist/components/3_compounds/Feed/composables/useFeedReply.js +10 -10
  19. package/dist/functions/isSmsChannel.js +19 -0
  20. package/dist/hooks/messages/canStartEditLastSent.js +16 -0
  21. package/dist/hooks/messages/useMessageHoverActions.js +13 -0
  22. package/dist/index.js +112 -103
  23. package/dist/types/components/3_compounds/ChatInput/ChatInput.vue.d.ts +13 -0
  24. package/dist/types/components/3_compounds/Feed/composables/useFeedReply.d.ts +2 -1
  25. package/dist/types/functions/index.d.ts +1 -0
  26. package/dist/types/functions/isSmsChannel.d.ts +8 -0
  27. package/dist/types/hooks/messages/canStartEditLastSent.d.ts +22 -0
  28. package/dist/types/hooks/messages/index.d.ts +2 -0
  29. package/dist/types/hooks/messages/useMessageHoverActions.d.ts +9 -0
  30. package/package.json +1 -1
@@ -1,28 +1,30 @@
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 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";
22
+ 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 = {
23
25
  key: 0,
24
26
  class: "message-feed__unread-amount"
25
- }, vt = /* @__PURE__ */ be({
27
+ }, Bt = /* @__PURE__ */ ve({
26
28
  __name: "Feed",
27
29
  props: {
28
30
  objects: {
@@ -117,7 +119,7 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
117
119
  */
118
120
  messageMenuActions: {
119
121
  type: Array,
120
- default: () => We()
122
+ default: () => Je()
121
123
  }
122
124
  },
123
125
  emits: [
@@ -132,188 +134,190 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
132
134
  "smsInvite",
133
135
  "delimiterRead"
134
136
  ],
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);
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);
144
146
  v("currentUserId", A), v("reactionUserNames", B), v(
145
147
  "messageMenuActions",
146
- r(() => a.messageMenuActions)
148
+ r(() => n.messageMenuActions)
147
149
  );
148
- const { groupedObjects: W } = Le({
149
- objects: r(() => a.objects)
150
- }), y = K("chatAppId"), C = K("selectedChat", void 0), F = r(() => {
150
+ const { groupedObjects: J } = Ne({
151
+ objects: r(() => n.objects)
152
+ }), y = L("chatAppId"), C = L("selectedChat", void 0), F = r(() => {
151
153
  if (C)
152
154
  return t(C);
153
155
  });
154
- function G(s) {
155
- return s.timestamp;
156
+ function Q(o) {
157
+ return o.timestamp;
156
158
  }
157
- function H(s) {
158
- var f;
159
- const n = s;
160
- if (!n.dialogId || !((f = F.value) != null && f.dialogs))
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))
161
164
  return;
162
- const o = F.value.dialogs.find((b) => b.dialogId === n.dialogId);
163
- return o == null ? void 0 : o.channelId;
165
+ const c = F.value.dialogs.find((he) => he.dialogId === a.dialogId);
166
+ return c == null ? void 0 : c.channelId;
164
167
  }
165
- function J(s) {
166
- return s.type === "message.call" && typeof a.callMessageOnCallback == "function" ? { onCall: a.callMessageOnCallback } : {};
168
+ function X(o) {
169
+ return o.type === "message.call" && typeof n.callMessageOnCallback == "function" ? { onCall: n.callMessageOnCallback } : {};
167
170
  }
168
- const d = E, {
169
- checkScrollPosition: Q,
170
- startScrollWatch: T,
171
- stopScrollWatch: D,
172
- resetAllowFlags: X
173
- } = Ee({
174
- feedRef: m,
171
+ const d = $, {
172
+ checkScrollPosition: Y,
173
+ startScrollWatch: D,
174
+ stopScrollWatch: w,
175
+ resetAllowFlags: Z
176
+ } = $e({
177
+ feedRef: f,
175
178
  emit: d,
176
- isLoadingMoreRef: r(() => a.isLoadingMore)
179
+ isLoadingMoreRef: r(() => n.isLoadingMore)
177
180
  }), {
178
- getMessage: p,
179
- messageAction: Y,
180
- handleClickReplied: Z,
181
- feedObjectDoubleClick: _,
182
- handleResetReply: ee,
183
- handleResetEdit: te
184
- } = Ve({
185
- enableDoubleClickReply: a.enableDoubleClickReply,
186
- emit: d
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))
187
191
  });
188
- function oe(s) {
189
- d("smsInvite", s);
192
+ function ne(o) {
193
+ d("smsInvite", o);
190
194
  }
191
- function se(s) {
192
- d("delimiterRead", s);
195
+ function ae(o) {
196
+ d("delimiterRead", o);
193
197
  }
194
198
  const {
195
- showKeyboard: ae,
196
- keyboardAction: ne,
197
- feedKeyboardAction: ie
198
- } = Ue({
199
- isKeyboardPlace: V,
200
- objects: r(() => a.objects),
199
+ showKeyboard: ie,
200
+ keyboardAction: re,
201
+ feedKeyboardAction: le
202
+ } = Ve({
203
+ isKeyboardPlace: P,
204
+ objects: r(() => n.objects),
201
205
  emit: d
202
206
  }), {
203
- showStickyDate: re,
204
- stickyDateText: le,
205
- show: de
206
- } = Pe({
207
- feedRef: m,
207
+ showStickyDate: de,
208
+ stickyDateText: ce,
209
+ show: ue
210
+ } = Ge({
211
+ feedRef: f,
208
212
  trackingObjects: k
209
213
  }), {
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();
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();
220
224
  }
221
- const fe = ze(() => j(), 250);
222
- function ge() {
223
- d("forceScrollToBottom"), me();
225
+ const ye = He(() => j(), 250);
226
+ function pe() {
227
+ d("forceScrollToBottom"), ge();
224
228
  }
225
- function ye(s) {
226
- const n = a.objects;
227
- if (s.startsWith("mid-")) {
228
- const o = parseInt(s.slice(4), 10);
229
- return n[o];
229
+ function be(o) {
230
+ const a = n.objects;
231
+ if (o.startsWith("mid-")) {
232
+ const s = parseInt(o.slice(4), 10);
233
+ return a[s];
230
234
  }
231
- return n.find((o) => o.messageId === s);
235
+ return a.find((s) => s.messageId === o);
232
236
  }
233
- const { restartObserving: pe } = Ne({
237
+ const { restartObserving: ke } = qe({
234
238
  trackingObjects: k,
235
239
  chatAppId: y,
236
- getMessageById: ye,
237
- onMessageVisible: (s) => d("messageVisible", s)
240
+ getMessageById: be,
241
+ onMessageVisible: (o) => d("messageVisible", o)
238
242
  });
239
- return ke(
240
- () => a.objects,
243
+ return Me(
244
+ () => n.objects,
241
245
  () => {
242
- x(() => {
246
+ U(() => {
243
247
  requestAnimationFrame(() => {
244
- X(), j(!1), k.value = document.querySelectorAll(".tracking-message"), pe();
248
+ Z(), j(!1), k.value = document.querySelectorAll(".tracking-message"), ke();
245
249
  });
246
250
  });
247
251
  },
248
252
  { immediate: !0 }
249
- ), qe({
250
- targetIdRef: r(() => a.scrollTo),
253
+ ), We({
254
+ targetIdRef: r(() => n.scrollTo),
251
255
  feedContainerId: `feed-container-${y}`
252
- }), he(() => {
253
- x(() => {
254
- a.objects.length > 0 && !ce.value && ue();
256
+ }), Se(() => {
257
+ U(() => {
258
+ n.objects.length > 0 && !me.value && fe();
255
259
  });
256
- }), (s, n) => (i(), c("div", He, [
257
- e.objects.length > 0 || e.typing ? (i(), c("div", {
260
+ }), (o, a) => (i(), u("div", Ye, [
261
+ e.objects.length > 0 || e.typing ? (i(), u("div", {
258
262
  key: 0,
259
263
  id: "feed-container-" + t(y),
260
264
  ref_key: "refFeed",
261
- ref: m,
265
+ ref: f,
262
266
  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))
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))
269
273
  }, [
270
- L(s.$slots, "prepend", {}, void 0, !0),
271
- ve(M("div", Qe, [
272
- g(Ke, {
274
+ N(o.$slots, "prepend", {}, void 0, !0),
275
+ Ie(M("div", _e, [
276
+ g(Le, {
273
277
  "is-loading": e.isLoadingMore,
274
278
  size: "small",
275
279
  position: "top"
276
280
  }, null, 8, ["is-loading"])
277
281
  ], 512), [
278
- [Me, e.isLoadingMore]
282
+ [Re, e.isLoadingMore]
279
283
  ]),
280
284
  g(S, null, {
281
- default: R(() => [
282
- t(re) && !e.isLoadingMore ? (i(), u(Ce, {
285
+ default: I(() => [
286
+ t(de) && !e.isLoadingMore ? (i(), m(De, {
283
287
  key: 0,
284
288
  class: "message-feed__sticky-date",
285
- text: t(le)
289
+ text: t(ce)
286
290
  }, null, 8, ["text"])) : l("", !0)
287
291
  ]),
288
292
  _: 1
289
293
  }),
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
+ (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),
294
298
  class: "tracking-message",
295
- onDblclick: (b) => t(_)(b, o)
299
+ onDblclick: (p) => t(te)(p, s)
296
300
  }, [
297
- (i(), u(Ie(t(q)(o)), Ae({
298
- key: o.messageId ?? "mid-" + f,
301
+ (i(), m(Ce(t(W)(s)), Fe({
302
+ key: s.messageId ?? "mid-" + c,
299
303
  class: "message-feed__message",
300
- message: o,
304
+ message: s,
301
305
  "apply-style": e.applyStyle,
302
- "is-first-in-series": o.isFirstInSeries,
303
- "reactions-enabled": P.value,
304
- "reactions-mode": z.value,
306
+ "is-first-in-series": s.isFirstInSeries,
307
+ "reactions-enabled": G.value,
308
+ "reactions-mode": H.value,
305
309
  "current-user-id": A.value,
306
310
  "reaction-user-names": B.value,
307
311
  "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
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
314
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"]))
315
- ], 40, Xe))), 128)),
316
- e.typing ? (i(), u(je, {
319
+ ], 40, et))), 128)),
320
+ e.typing ? (i(), m(Oe, {
317
321
  key: 0,
318
322
  message: {
319
323
  subText: e.typing.title,
@@ -321,72 +325,72 @@ const He = { class: "message-feed-wrapper" }, Je = ["id"], Qe = { class: "messag
321
325
  }
322
326
  }, null, 8, ["message"])) : l("", !0),
323
327
  g(S, null, {
324
- default: R(() => [
325
- t(ae) ? (i(), u(De, {
328
+ default: I(() => [
329
+ t(ie) ? (i(), m(je, {
326
330
  key: 0,
327
331
  ref_key: "keyboardRef",
328
- ref: I,
332
+ ref: R,
329
333
  class: "message-feed__keyboard",
330
334
  keyboard: e.objects[e.objects.length - 1].keyboard,
331
335
  align: e.keyboardAlign,
332
- onAction: t(ne)
336
+ onAction: t(re)
333
337
  }, null, 8, ["keyboard", "align", "onAction"])) : l("", !0)
334
338
  ]),
335
339
  _: 1
336
340
  }),
337
- e.feedKeyboards && e.feedKeyboards.length > 0 ? (i(), u(we, {
341
+ e.feedKeyboards && e.feedKeyboards.length > 0 ? (i(), m(xe, {
338
342
  key: 1,
339
343
  buttons: e.feedKeyboards,
340
344
  align: e.feedKeyboardAlign,
341
- onAction: t(ie)
345
+ onAction: t(le)
342
346
  }, null, 8, ["buttons", "align", "onAction"])) : l("", !0)
343
- ], 44, Je)) : (i(), c("div", {
347
+ ], 44, Ze)) : (i(), u("div", {
344
348
  key: 1,
345
349
  ref_key: "refFeed",
346
- ref: m,
350
+ ref: f,
347
351
  class: "message-feed",
348
- style: O({ backgroundImage: `url(${w.value})` })
352
+ style: E({ backgroundImage: `url(${K.value})` })
349
353
  }, [
350
- M("div", Ye, [
351
- L(s.$slots, "empty-feed", {}, void 0, !0)
354
+ M("div", tt, [
355
+ N(o.$slots, "empty-feed", {}, void 0, !0)
352
356
  ])
353
357
  ], 4)),
354
358
  g(S, null, {
355
- default: R(() => [
356
- t(N) ? (i(), c("button", {
359
+ default: I(() => [
360
+ t(q) ? (i(), u("button", {
357
361
  key: 0,
358
362
  class: "message-feed__button-down",
359
- onClick: ge
363
+ onClick: pe
360
364
  }, [
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))
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))
363
367
  ])) : l("", !0)
364
368
  ]),
365
369
  _: 1
366
370
  }),
367
- t(p)().reply ? (i(), u(U, {
371
+ t(b)().reply ? (i(), m(V, {
368
372
  key: 2,
369
373
  to: "#chat-input-reply-line-" + t(y)
370
374
  }, [
371
- g(Fe, {
375
+ g(we, {
372
376
  class: "chat-input-reply",
373
- message: t(p)().reply,
374
- onReset: t(ee)
377
+ message: t(b)().reply,
378
+ onReset: t(oe)
375
379
  }, null, 8, ["message", "onReset"])
376
380
  ], 8, ["to"])) : l("", !0),
377
- t(p)().edit ? (i(), u(U, {
381
+ t(b)().edit ? (i(), m(V, {
378
382
  key: 3,
379
383
  to: "#chat-input-reply-line-" + t(y)
380
384
  }, [
381
- g(Te, {
385
+ g(Ke, {
382
386
  class: "chat-input-reply",
383
- message: t(p)().edit,
384
- onReset: t(te)
387
+ message: t(b)().edit,
388
+ onReset: t(se)
385
389
  }, null, 8, ["message", "onReset"])
386
390
  ], 8, ["to"])) : l("", !0)
387
391
  ]));
388
392
  }
389
393
  });
390
394
  export {
391
- vt as default
395
+ Bt as default
392
396
  };
@@ -1,5 +1,5 @@
1
- import { inject as m } from "vue";
2
- import { useMessageDraft as c } from "../../../../hooks/useMessageDraft.js";
1
+ import { inject as c } from "vue";
2
+ import { useMessageDraft as f } from "../../../../hooks/useMessageDraft.js";
3
3
  import "../../../../hooks/useSearchModel.js";
4
4
  import "../../../../hooks/useTheme.js";
5
5
  import "../../../../hooks/useEmojiNative.js";
@@ -10,9 +10,9 @@ import "../../../../locale/useLocale.js";
10
10
  import "../../../../node_modules/linkifyjs/dist/linkify.js";
11
11
  import "../../../../node_modules/linkify-string/dist/linkify-string.js";
12
12
  import "../../../../functions/parseMarkdown.js";
13
- import { useStartReply as f, hideReplyPreview as p } from "../../../../hooks/messages/useStartReply.js";
14
- function T({ enableDoubleClickReply: r, emit: s }) {
15
- const i = m("chatAppId"), { getMessage: l, resetReply: a, resetEdit: n, setMessageText: o } = c(i), { startReply: d } = f(i);
13
+ import { useStartReply as u, hideReplyPreview as p } from "../../../../hooks/messages/useStartReply.js";
14
+ function w({ enableDoubleClickReply: a, emit: s, isReplyAllowed: r }) {
15
+ const i = c("chatAppId"), { getMessage: l, resetReply: n, resetEdit: d, setMessageText: m } = f(i), { startReply: o } = u(i);
16
16
  return {
17
17
  getMessage: l,
18
18
  messageAction: (t) => {
@@ -22,7 +22,7 @@ function T({ enableDoubleClickReply: r, emit: s }) {
22
22
  s("clickRepliedMessage", t);
23
23
  },
24
24
  feedObjectDoubleClick: (t, e) => {
25
- r && (t == null || t.preventDefault(), e.type.indexOf("system") === -1 && e.type.indexOf("typing") === -1 && d({
25
+ a && (r && !r(e) || (t == null || t.preventDefault(), e.type.indexOf("system") === -1 && e.type.indexOf("typing") === -1 && o({
26
26
  messageId: e.messageId,
27
27
  type: e.type,
28
28
  text: e.text,
@@ -30,16 +30,16 @@ function T({ enableDoubleClickReply: r, emit: s }) {
30
30
  url: e.url,
31
31
  header: e.header,
32
32
  callDuration: e.callDuration
33
- }));
33
+ })));
34
34
  },
35
35
  handleResetReply: () => {
36
- a(), p(i);
36
+ n(), p(i);
37
37
  },
38
38
  handleResetEdit: () => {
39
- n(), o(""), p(i);
39
+ d(), m(""), p(i);
40
40
  }
41
41
  };
42
42
  }
43
43
  export {
44
- T as useFeedReply
44
+ w as useFeedReply
45
45
  };
@@ -0,0 +1,19 @@
1
+ function c(t) {
2
+ const r = t == null ? void 0 : t.toLowerCase().trim();
3
+ return r ? r.split(".")[0] === "sms" : !1;
4
+ }
5
+ function l(t) {
6
+ var r, n, i, o;
7
+ return String(
8
+ ((r = t == null ? void 0 : t.meta) == null ? void 0 : r.messageStyle) ?? (t == null ? void 0 : t.messageStyle) ?? ((n = t == null ? void 0 : t.channel) == null ? void 0 : n.serviceType) ?? ((i = t == null ? void 0 : t.channel) == null ? void 0 : i.type) ?? ((o = t == null ? void 0 : t.meta) == null ? void 0 : o.serviceType) ?? ""
9
+ ).toLowerCase().trim();
10
+ }
11
+ function u(t, r) {
12
+ var i, o;
13
+ const n = t;
14
+ return l(n) === "sms" ? !0 : c(r) || c(n == null ? void 0 : n.channelId) || c((i = n == null ? void 0 : n.channel) == null ? void 0 : i.channelId) || c((o = n == null ? void 0 : n.meta) == null ? void 0 : o.channelId);
15
+ }
16
+ export {
17
+ c as isSmsChannel,
18
+ u as isSmsFeedMessage
19
+ };
@@ -0,0 +1,16 @@
1
+ function a(e, r) {
2
+ const t = Math.max(0, r);
3
+ return !e.slice(0, t).includes(`
4
+ `);
5
+ }
6
+ function l(e) {
7
+ return e.key !== "ArrowUp" || e.altKey || e.metaKey || e.ctrlKey || e.shiftKey || !e.hasResolver || e.disabled || e.isRecording || (e.draftText ?? "").trim() !== "" || e.replyMessageId != null && e.replyMessageId !== "" || e.editMessageId != null && e.editMessageId !== "" ? !1 : a(e.textareaText ?? "", e.selectionStart);
8
+ }
9
+ function f(e) {
10
+ return !(!e || e.messageId == null || e.messageId === "" || e.deleted === !0 || e.canEdit === !1);
11
+ }
12
+ export {
13
+ l as canStartEditLastSent,
14
+ a as isCursorOnFirstLine,
15
+ f as isEditableLastSentCandidate
16
+ };
@@ -0,0 +1,13 @@
1
+ import { computed as t, toValue as e } from "vue";
2
+ import { isSmsFeedMessage as c } from "../../functions/isSmsChannel.js";
3
+ function m(s, r = !0, i = void 0) {
4
+ const o = t(
5
+ () => !c(e(i), e(s))
6
+ ), n = t(
7
+ () => e(r) && o.value
8
+ );
9
+ return { hoverActionsEnabled: o, reactionsActive: n };
10
+ }
11
+ export {
12
+ m as useMessageHoverActions
13
+ };