@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.
- package/dist/chotto.css +1 -1
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +164 -160
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +106 -102
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +121 -116
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +116 -111
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +153 -149
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +131 -126
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +189 -161
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/Feed.vue2.js +174 -170
- package/dist/components/3_compounds/Feed/composables/useFeedReply.js +10 -10
- package/dist/functions/isSmsChannel.js +19 -0
- package/dist/hooks/messages/canStartEditLastSent.js +16 -0
- package/dist/hooks/messages/useMessageHoverActions.js +13 -0
- package/dist/index.js +112 -103
- package/dist/types/components/3_compounds/ChatInput/ChatInput.vue.d.ts +13 -0
- package/dist/types/components/3_compounds/Feed/composables/useFeedReply.d.ts +2 -1
- package/dist/types/functions/index.d.ts +1 -0
- package/dist/types/functions/isSmsChannel.d.ts +8 -0
- package/dist/types/hooks/messages/canStartEditLastSent.d.ts +22 -0
- package/dist/types/hooks/messages/index.d.ts +2 -0
- package/dist/types/hooks/messages/useMessageHoverActions.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useFeedButton as
|
|
10
|
-
import { useFeedComponents as
|
|
11
|
-
import { useFeedGrouping as
|
|
12
|
-
import { useFeedKeyboard as
|
|
13
|
-
import { useFeedLoadMore as
|
|
14
|
-
import { useFeedMessageVisibility as
|
|
15
|
-
import { useFeedReply as
|
|
16
|
-
import { useFeedScroll as
|
|
17
|
-
import { useFeedScrollTo as
|
|
18
|
-
import { useStickyDate as
|
|
19
|
-
import { throttle as
|
|
20
|
-
import { getDefaultMessageMenuActions as
|
|
21
|
-
import
|
|
22
|
-
|
|
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
|
-
},
|
|
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: () =>
|
|
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:
|
|
136
|
-
const
|
|
137
|
-
isShowButton:
|
|
138
|
-
isKeyboardPlace:
|
|
139
|
-
checkButtonVisibility:
|
|
140
|
-
} =
|
|
141
|
-
feedRef:
|
|
142
|
-
keyboardRef:
|
|
143
|
-
}), { componentsMap:
|
|
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(() =>
|
|
148
|
+
r(() => n.messageMenuActions)
|
|
147
149
|
);
|
|
148
|
-
const { groupedObjects:
|
|
149
|
-
objects: r(() =>
|
|
150
|
-
}), y =
|
|
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
|
|
155
|
-
return
|
|
156
|
+
function Q(o) {
|
|
157
|
+
return o.timestamp;
|
|
156
158
|
}
|
|
157
|
-
function
|
|
158
|
-
var
|
|
159
|
-
const
|
|
160
|
-
if (
|
|
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
|
|
163
|
-
return
|
|
165
|
+
const c = F.value.dialogs.find((he) => he.dialogId === a.dialogId);
|
|
166
|
+
return c == null ? void 0 : c.channelId;
|
|
164
167
|
}
|
|
165
|
-
function
|
|
166
|
-
return
|
|
168
|
+
function X(o) {
|
|
169
|
+
return o.type === "message.call" && typeof n.callMessageOnCallback == "function" ? { onCall: n.callMessageOnCallback } : {};
|
|
167
170
|
}
|
|
168
|
-
const d =
|
|
169
|
-
checkScrollPosition:
|
|
170
|
-
startScrollWatch:
|
|
171
|
-
stopScrollWatch:
|
|
172
|
-
resetAllowFlags:
|
|
173
|
-
} =
|
|
174
|
-
feedRef:
|
|
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(() =>
|
|
179
|
+
isLoadingMoreRef: r(() => n.isLoadingMore)
|
|
177
180
|
}), {
|
|
178
|
-
getMessage:
|
|
179
|
-
messageAction:
|
|
180
|
-
handleClickReplied:
|
|
181
|
-
feedObjectDoubleClick:
|
|
182
|
-
handleResetReply:
|
|
183
|
-
handleResetEdit:
|
|
184
|
-
} =
|
|
185
|
-
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
|
|
189
|
-
d("smsInvite",
|
|
192
|
+
function ne(o) {
|
|
193
|
+
d("smsInvite", o);
|
|
190
194
|
}
|
|
191
|
-
function
|
|
192
|
-
d("delimiterRead",
|
|
195
|
+
function ae(o) {
|
|
196
|
+
d("delimiterRead", o);
|
|
193
197
|
}
|
|
194
198
|
const {
|
|
195
|
-
showKeyboard:
|
|
196
|
-
keyboardAction:
|
|
197
|
-
feedKeyboardAction:
|
|
198
|
-
} =
|
|
199
|
-
isKeyboardPlace:
|
|
200
|
-
objects: r(() =>
|
|
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:
|
|
204
|
-
stickyDateText:
|
|
205
|
-
show:
|
|
206
|
-
} =
|
|
207
|
-
feedRef:
|
|
207
|
+
showStickyDate: de,
|
|
208
|
+
stickyDateText: ce,
|
|
209
|
+
show: ue
|
|
210
|
+
} = Ge({
|
|
211
|
+
feedRef: f,
|
|
208
212
|
trackingObjects: k
|
|
209
213
|
}), {
|
|
210
|
-
isInitialized:
|
|
211
|
-
initializeScroll:
|
|
212
|
-
smoothScrollToBottom:
|
|
213
|
-
} =
|
|
214
|
-
feedRef:
|
|
215
|
-
objectsRef: r(() =>
|
|
216
|
-
scrollToBottomRef: r(() =>
|
|
217
|
-
}),
|
|
218
|
-
function j(
|
|
219
|
-
|
|
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
|
|
222
|
-
function
|
|
223
|
-
d("forceScrollToBottom"),
|
|
225
|
+
const ye = He(() => j(), 250);
|
|
226
|
+
function pe() {
|
|
227
|
+
d("forceScrollToBottom"), ge();
|
|
224
228
|
}
|
|
225
|
-
function
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
return
|
|
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
|
|
235
|
+
return a.find((s) => s.messageId === o);
|
|
232
236
|
}
|
|
233
|
-
const { restartObserving:
|
|
237
|
+
const { restartObserving: ke } = qe({
|
|
234
238
|
trackingObjects: k,
|
|
235
239
|
chatAppId: y,
|
|
236
|
-
getMessageById:
|
|
237
|
-
onMessageVisible: (
|
|
240
|
+
getMessageById: be,
|
|
241
|
+
onMessageVisible: (o) => d("messageVisible", o)
|
|
238
242
|
});
|
|
239
|
-
return
|
|
240
|
-
() =>
|
|
243
|
+
return Me(
|
|
244
|
+
() => n.objects,
|
|
241
245
|
() => {
|
|
242
|
-
|
|
246
|
+
U(() => {
|
|
243
247
|
requestAnimationFrame(() => {
|
|
244
|
-
|
|
248
|
+
Z(), j(!1), k.value = document.querySelectorAll(".tracking-message"), ke();
|
|
245
249
|
});
|
|
246
250
|
});
|
|
247
251
|
},
|
|
248
252
|
{ immediate: !0 }
|
|
249
|
-
),
|
|
250
|
-
targetIdRef: r(() =>
|
|
253
|
+
), We({
|
|
254
|
+
targetIdRef: r(() => n.scrollTo),
|
|
251
255
|
feedContainerId: `feed-container-${y}`
|
|
252
|
-
}),
|
|
253
|
-
|
|
254
|
-
|
|
256
|
+
}), Se(() => {
|
|
257
|
+
U(() => {
|
|
258
|
+
n.objects.length > 0 && !me.value && fe();
|
|
255
259
|
});
|
|
256
|
-
}), (
|
|
257
|
-
e.objects.length > 0 || e.typing ? (i(),
|
|
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:
|
|
265
|
+
ref: f,
|
|
262
266
|
class: "message-feed",
|
|
263
|
-
style:
|
|
264
|
-
onScroll:
|
|
265
|
-
onMousedown:
|
|
266
|
-
(...
|
|
267
|
-
onMouseup:
|
|
268
|
-
(...
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
g(
|
|
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
|
-
[
|
|
282
|
+
[Re, e.isLoadingMore]
|
|
279
283
|
]),
|
|
280
284
|
g(S, null, {
|
|
281
|
-
default:
|
|
282
|
-
t(
|
|
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(
|
|
289
|
+
text: t(ce)
|
|
286
290
|
}, null, 8, ["text"])) : l("", !0)
|
|
287
291
|
]),
|
|
288
292
|
_: 1
|
|
289
293
|
}),
|
|
290
|
-
(i(!0),
|
|
291
|
-
id: "msg-" + (
|
|
292
|
-
key:
|
|
293
|
-
"data-timestamp":
|
|
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: (
|
|
299
|
+
onDblclick: (p) => t(te)(p, s)
|
|
296
300
|
}, [
|
|
297
|
-
(i(),
|
|
298
|
-
key:
|
|
301
|
+
(i(), m(Ce(t(W)(s)), Fe({
|
|
302
|
+
key: s.messageId ?? "mid-" + c,
|
|
299
303
|
class: "message-feed__message",
|
|
300
|
-
message:
|
|
304
|
+
message: s,
|
|
301
305
|
"apply-style": e.applyStyle,
|
|
302
|
-
"is-first-in-series":
|
|
303
|
-
"reactions-enabled":
|
|
304
|
-
"reactions-mode":
|
|
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:
|
|
309
|
-
}, { ref_for: !0 },
|
|
310
|
-
onAction: t(
|
|
311
|
-
onReply: t(
|
|
312
|
-
onSmsInvite: (
|
|
313
|
-
onRead:
|
|
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,
|
|
316
|
-
e.typing ? (i(),
|
|
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:
|
|
325
|
-
t(
|
|
328
|
+
default: I(() => [
|
|
329
|
+
t(ie) ? (i(), m(je, {
|
|
326
330
|
key: 0,
|
|
327
331
|
ref_key: "keyboardRef",
|
|
328
|
-
ref:
|
|
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(
|
|
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(),
|
|
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(
|
|
345
|
+
onAction: t(le)
|
|
342
346
|
}, null, 8, ["buttons", "align", "onAction"])) : l("", !0)
|
|
343
|
-
], 44,
|
|
347
|
+
], 44, Ze)) : (i(), u("div", {
|
|
344
348
|
key: 1,
|
|
345
349
|
ref_key: "refFeed",
|
|
346
|
-
ref:
|
|
350
|
+
ref: f,
|
|
347
351
|
class: "message-feed",
|
|
348
|
-
style:
|
|
352
|
+
style: E({ backgroundImage: `url(${K.value})` })
|
|
349
353
|
}, [
|
|
350
|
-
M("div",
|
|
351
|
-
|
|
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:
|
|
356
|
-
t(
|
|
359
|
+
default: I(() => [
|
|
360
|
+
t(q) ? (i(), u("button", {
|
|
357
361
|
key: 0,
|
|
358
362
|
class: "message-feed__button-down",
|
|
359
|
-
onClick:
|
|
363
|
+
onClick: pe
|
|
360
364
|
}, [
|
|
361
|
-
e.buttonParams ? (i(),
|
|
362
|
-
|
|
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(
|
|
371
|
+
t(b)().reply ? (i(), m(V, {
|
|
368
372
|
key: 2,
|
|
369
373
|
to: "#chat-input-reply-line-" + t(y)
|
|
370
374
|
}, [
|
|
371
|
-
g(
|
|
375
|
+
g(we, {
|
|
372
376
|
class: "chat-input-reply",
|
|
373
|
-
message: t(
|
|
374
|
-
onReset: t(
|
|
377
|
+
message: t(b)().reply,
|
|
378
|
+
onReset: t(oe)
|
|
375
379
|
}, null, 8, ["message", "onReset"])
|
|
376
380
|
], 8, ["to"])) : l("", !0),
|
|
377
|
-
t(
|
|
381
|
+
t(b)().edit ? (i(), m(V, {
|
|
378
382
|
key: 3,
|
|
379
383
|
to: "#chat-input-reply-line-" + t(y)
|
|
380
384
|
}, [
|
|
381
|
-
g(
|
|
385
|
+
g(Ke, {
|
|
382
386
|
class: "chat-input-reply",
|
|
383
|
-
message: t(
|
|
384
|
-
onReset: t(
|
|
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
|
-
|
|
395
|
+
Bt as default
|
|
392
396
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { useMessageDraft as
|
|
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
|
|
14
|
-
function
|
|
15
|
-
const 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 &&
|
|
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
|
-
|
|
36
|
+
n(), p(i);
|
|
37
37
|
},
|
|
38
38
|
handleResetEdit: () => {
|
|
39
|
-
|
|
39
|
+
d(), m(""), p(i);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
export {
|
|
44
|
-
|
|
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
|
+
};
|