@mobilon-dev/chotto 0.3.61 → 0.3.62
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Feed.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ecfc31fa"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as me, ref as k, computed as l, inject as w, unref as o, watch as fe, nextTick as j, onMounted as ge, createElementBlock as c, openBlock as i, createVNode as g, createBlock as f, createCommentVNode as u, normalizeStyle as K, renderSlot as x, withDirectives as ye, createElementVNode as h, vShow as pe, Transition as v, withCtx as S, Fragment as be, renderList as ke, resolveDynamicComponent as he, toDisplayString as ve, Teleport as Se } from "vue";
|
|
2
2
|
import Re from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
|
|
3
3
|
import Be from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
4
4
|
import Ie from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
|
|
@@ -17,10 +17,10 @@ import { useFeedScrollTo as Oe } from "./composables/useFeedScrollTo.js";
|
|
|
17
17
|
import { useStickyDate as Ve } from "./composables/useStickyDate.js";
|
|
18
18
|
import { throttle as $e } from "./functions/throttle.js";
|
|
19
19
|
import qe from "./assets/chat-background.svg.js";
|
|
20
|
-
const ze = ["id"],
|
|
20
|
+
const ze = { class: "message-feed-wrapper" }, Ee = ["id"], Pe = { class: "message-feed__loading" }, We = ["id", "data-timestamp", "onDblclick"], Ne = { style: { margin: "auto" } }, Ge = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "message-feed__unread-amount"
|
|
23
|
-
},
|
|
23
|
+
}, ut = /* @__PURE__ */ me({
|
|
24
24
|
__name: "Feed",
|
|
25
25
|
props: {
|
|
26
26
|
objects: {
|
|
@@ -98,24 +98,24 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
98
98
|
"smsInvite",
|
|
99
99
|
"delimiterRead"
|
|
100
100
|
],
|
|
101
|
-
setup(e, { emit:
|
|
101
|
+
setup(e, { emit: L }) {
|
|
102
102
|
const a = e, b = k(), r = k(), R = k(), {
|
|
103
|
-
isShowButton:
|
|
104
|
-
isKeyboardPlace:
|
|
105
|
-
checkButtonVisibility:
|
|
103
|
+
isShowButton: O,
|
|
104
|
+
isKeyboardPlace: V,
|
|
105
|
+
checkButtonVisibility: $
|
|
106
106
|
} = Fe({
|
|
107
107
|
feedRef: r,
|
|
108
108
|
keyboardRef: R
|
|
109
|
-
}), { componentsMap:
|
|
110
|
-
objects:
|
|
111
|
-
}), y = w("chatAppId"), B = w("selectedChat", void 0), I =
|
|
109
|
+
}), { componentsMap: q } = Ce(), z = l(() => a.reactionsEnabled), { groupedObjects: E } = De({
|
|
110
|
+
objects: l(() => a.objects)
|
|
111
|
+
}), y = w("chatAppId"), B = w("selectedChat", void 0), I = l(() => {
|
|
112
112
|
if (B)
|
|
113
113
|
return o(B);
|
|
114
114
|
});
|
|
115
|
-
function
|
|
115
|
+
function P(s) {
|
|
116
116
|
return s.timestamp;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function W(s) {
|
|
119
119
|
var m;
|
|
120
120
|
const n = s;
|
|
121
121
|
if (!n.dialogId || !((m = I.value) != null && m.dialogs))
|
|
@@ -123,65 +123,65 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
123
123
|
const t = I.value.dialogs.find((p) => p.dialogId === n.dialogId);
|
|
124
124
|
return t == null ? void 0 : t.channelId;
|
|
125
125
|
}
|
|
126
|
-
const d =
|
|
127
|
-
checkScrollPosition:
|
|
126
|
+
const d = L, {
|
|
127
|
+
checkScrollPosition: N,
|
|
128
128
|
startScrollWatch: T,
|
|
129
129
|
stopScrollWatch: A,
|
|
130
|
-
resetAllowFlags:
|
|
130
|
+
resetAllowFlags: G
|
|
131
131
|
} = je({
|
|
132
132
|
feedRef: r,
|
|
133
133
|
emit: d,
|
|
134
|
-
isLoadingMoreRef:
|
|
134
|
+
isLoadingMoreRef: l(() => a.isLoadingMore)
|
|
135
135
|
}), {
|
|
136
136
|
getMessage: M,
|
|
137
|
-
messageAction:
|
|
138
|
-
handleClickReplied:
|
|
139
|
-
feedObjectDoubleClick:
|
|
140
|
-
handleResetReply:
|
|
137
|
+
messageAction: U,
|
|
138
|
+
handleClickReplied: H,
|
|
139
|
+
feedObjectDoubleClick: J,
|
|
140
|
+
handleResetReply: Q
|
|
141
141
|
} = xe({
|
|
142
142
|
enableDoubleClickReply: a.enableDoubleClickReply,
|
|
143
143
|
emit: d
|
|
144
144
|
});
|
|
145
|
-
function
|
|
145
|
+
function X(s) {
|
|
146
146
|
d("smsInvite", s);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Y(s) {
|
|
149
149
|
d("delimiterRead", s);
|
|
150
150
|
}
|
|
151
151
|
const {
|
|
152
|
-
showKeyboard:
|
|
153
|
-
keyboardAction:
|
|
154
|
-
feedKeyboardAction:
|
|
152
|
+
showKeyboard: Z,
|
|
153
|
+
keyboardAction: _,
|
|
154
|
+
feedKeyboardAction: ee
|
|
155
155
|
} = we({
|
|
156
|
-
isKeyboardPlace:
|
|
157
|
-
objects:
|
|
156
|
+
isKeyboardPlace: V,
|
|
157
|
+
objects: l(() => a.objects),
|
|
158
158
|
emit: d
|
|
159
159
|
}), {
|
|
160
|
-
showStickyDate:
|
|
161
|
-
stickyDateText:
|
|
162
|
-
show:
|
|
160
|
+
showStickyDate: te,
|
|
161
|
+
stickyDateText: oe,
|
|
162
|
+
show: se
|
|
163
163
|
} = Ve({
|
|
164
164
|
feedRef: r,
|
|
165
165
|
trackingObjects: b
|
|
166
166
|
}), {
|
|
167
|
-
isInitialized:
|
|
168
|
-
performScrollToBottom:
|
|
167
|
+
isInitialized: ne,
|
|
168
|
+
performScrollToBottom: ae,
|
|
169
169
|
ensureScrollToBottom: F,
|
|
170
170
|
initializeScroll: ie,
|
|
171
|
-
smoothScrollToBottom:
|
|
171
|
+
smoothScrollToBottom: le
|
|
172
172
|
} = Le({
|
|
173
173
|
feedRef: r,
|
|
174
|
-
objectsRef:
|
|
175
|
-
scrollToBottomRef:
|
|
176
|
-
}), C =
|
|
174
|
+
objectsRef: l(() => a.objects),
|
|
175
|
+
scrollToBottomRef: l(() => a.scrollToBottom)
|
|
176
|
+
}), C = l(() => a.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(qe)}`);
|
|
177
177
|
function D(s = !0) {
|
|
178
|
-
|
|
178
|
+
$(), N(s), se();
|
|
179
179
|
}
|
|
180
|
-
const
|
|
181
|
-
function
|
|
182
|
-
d("forceScrollToBottom"),
|
|
180
|
+
const re = $e(() => D(), 250);
|
|
181
|
+
function de() {
|
|
182
|
+
d("forceScrollToBottom"), le();
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ce(s) {
|
|
185
185
|
const n = a.objects;
|
|
186
186
|
if (s.startsWith("mid-")) {
|
|
187
187
|
const t = parseInt(s.slice(4), 10);
|
|
@@ -189,30 +189,30 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
189
189
|
}
|
|
190
190
|
return n.find((t) => t.messageId === s);
|
|
191
191
|
}
|
|
192
|
-
const { restartObserving:
|
|
192
|
+
const { restartObserving: ue } = Ke({
|
|
193
193
|
trackingObjects: b,
|
|
194
194
|
chatAppId: y,
|
|
195
|
-
getMessageById:
|
|
195
|
+
getMessageById: ce,
|
|
196
196
|
onMessageVisible: (s) => d("messageVisible", s)
|
|
197
197
|
});
|
|
198
|
-
return
|
|
198
|
+
return fe(
|
|
199
199
|
() => a.objects,
|
|
200
200
|
() => {
|
|
201
201
|
j(() => {
|
|
202
202
|
requestAnimationFrame(() => {
|
|
203
|
-
|
|
203
|
+
G(), D(!1), b.value = document.querySelectorAll(".tracking-message"), ue();
|
|
204
204
|
});
|
|
205
205
|
});
|
|
206
206
|
},
|
|
207
207
|
{ immediate: !0 }
|
|
208
208
|
), Oe({
|
|
209
|
-
targetIdRef:
|
|
209
|
+
targetIdRef: l(() => a.scrollTo),
|
|
210
210
|
feedContainerId: `feed-container-${y}`
|
|
211
|
-
}),
|
|
211
|
+
}), ge(() => {
|
|
212
212
|
j(() => {
|
|
213
|
-
a.objects.length > 0 && !
|
|
213
|
+
a.objects.length > 0 && !ne.value && ie();
|
|
214
214
|
const s = new ResizeObserver(() => {
|
|
215
|
-
a.scrollToBottom && (
|
|
215
|
+
a.scrollToBottom && (ae(), setTimeout(() => {
|
|
216
216
|
F();
|
|
217
217
|
}, 200), setTimeout(() => {
|
|
218
218
|
F();
|
|
@@ -220,63 +220,63 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
220
220
|
});
|
|
221
221
|
r.value && s.observe(r.value);
|
|
222
222
|
});
|
|
223
|
-
}), (s, n) => (
|
|
224
|
-
e.objects.length > 0 || e.typing ? (
|
|
223
|
+
}), (s, n) => (i(), c("div", ze, [
|
|
224
|
+
e.objects.length > 0 || e.typing ? (i(), c("div", {
|
|
225
225
|
key: 0,
|
|
226
226
|
id: "feed-container-" + o(y),
|
|
227
227
|
ref_key: "refFeed",
|
|
228
228
|
ref: r,
|
|
229
229
|
class: "message-feed",
|
|
230
|
-
style:
|
|
231
|
-
onScroll: n[0] || (n[0] = (t) => o(
|
|
230
|
+
style: K({ backgroundImage: `url(${C.value})` }),
|
|
231
|
+
onScroll: n[0] || (n[0] = (t) => o(re)()),
|
|
232
232
|
onMousedown: n[1] || (n[1] = //@ts-ignore
|
|
233
233
|
(...t) => o(T) && o(T)(...t)),
|
|
234
234
|
onMouseup: n[2] || (n[2] = //@ts-ignore
|
|
235
235
|
(...t) => o(A) && o(A)(...t))
|
|
236
236
|
}, [
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
x(s.$slots, "prepend", {}, void 0, !0),
|
|
238
|
+
ye(h("div", Pe, [
|
|
239
239
|
g(Me, {
|
|
240
240
|
"is-loading": e.isLoadingMore,
|
|
241
241
|
size: "small",
|
|
242
242
|
position: "top"
|
|
243
243
|
}, null, 8, ["is-loading"])
|
|
244
244
|
], 512), [
|
|
245
|
-
[
|
|
245
|
+
[pe, e.isLoadingMore]
|
|
246
246
|
]),
|
|
247
247
|
g(v, null, {
|
|
248
248
|
default: S(() => [
|
|
249
|
-
o(
|
|
249
|
+
o(te) && !e.isLoadingMore ? (i(), f(Re, {
|
|
250
250
|
key: 0,
|
|
251
251
|
class: "message-feed__sticky-date",
|
|
252
|
-
text: o(
|
|
252
|
+
text: o(oe)
|
|
253
253
|
}, null, 8, ["text"])) : u("", !0)
|
|
254
254
|
]),
|
|
255
255
|
_: 1
|
|
256
256
|
}),
|
|
257
|
-
(
|
|
257
|
+
(i(!0), c(be, null, ke(o(E), (t, m) => (i(), c("div", {
|
|
258
258
|
id: "msg-" + (t.messageId ?? "mid-" + m),
|
|
259
259
|
key: t.messageId ?? "mid-" + m,
|
|
260
|
-
"data-timestamp":
|
|
260
|
+
"data-timestamp": P(t),
|
|
261
261
|
class: "tracking-message",
|
|
262
|
-
onDblclick: (p) => o(
|
|
262
|
+
onDblclick: (p) => o(J)(p, t)
|
|
263
263
|
}, [
|
|
264
|
-
(
|
|
264
|
+
(i(), f(he(o(q)(t.type)), {
|
|
265
265
|
key: t.messageId ?? "mid-" + m,
|
|
266
266
|
class: "message-feed__message",
|
|
267
267
|
message: t,
|
|
268
268
|
"apply-style": e.applyStyle,
|
|
269
269
|
"is-first-in-series": t.isFirstInSeries,
|
|
270
|
-
"reactions-enabled":
|
|
270
|
+
"reactions-enabled": z.value,
|
|
271
271
|
"subtext-tooltip-data": e.subtextTooltipData,
|
|
272
|
-
channel:
|
|
273
|
-
onAction: o(
|
|
274
|
-
onReply: o(
|
|
275
|
-
onSmsInvite: (p) =>
|
|
276
|
-
onRead:
|
|
272
|
+
channel: W(t),
|
|
273
|
+
onAction: o(U),
|
|
274
|
+
onReply: o(H),
|
|
275
|
+
onSmsInvite: (p) => X(t),
|
|
276
|
+
onRead: Y
|
|
277
277
|
}, null, 40, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "subtext-tooltip-data", "channel", "onAction", "onReply", "onSmsInvite"]))
|
|
278
|
-
], 40,
|
|
279
|
-
e.typing ? (
|
|
278
|
+
], 40, We))), 128)),
|
|
279
|
+
e.typing ? (i(), f(Ae, {
|
|
280
280
|
key: 0,
|
|
281
281
|
message: {
|
|
282
282
|
subText: e.typing.title,
|
|
@@ -285,61 +285,61 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
285
285
|
}, null, 8, ["message"])) : u("", !0),
|
|
286
286
|
g(v, null, {
|
|
287
287
|
default: S(() => [
|
|
288
|
-
o(
|
|
288
|
+
o(Z) ? (i(), f(Ie, {
|
|
289
289
|
key: 0,
|
|
290
290
|
ref_key: "keyboardRef",
|
|
291
291
|
ref: R,
|
|
292
292
|
class: "message-feed__keyboard",
|
|
293
293
|
keyboard: e.objects[e.objects.length - 1].keyboard,
|
|
294
294
|
align: e.keyboardAlign,
|
|
295
|
-
onAction: o(
|
|
295
|
+
onAction: o(_)
|
|
296
296
|
}, null, 8, ["keyboard", "align", "onAction"])) : u("", !0)
|
|
297
297
|
]),
|
|
298
298
|
_: 1
|
|
299
299
|
}),
|
|
300
|
-
|
|
301
|
-
default: S(() => [
|
|
302
|
-
o(V) ? (l(), c("button", {
|
|
303
|
-
key: 0,
|
|
304
|
-
class: "message-feed__button-down",
|
|
305
|
-
onClick: ce
|
|
306
|
-
}, [
|
|
307
|
-
e.buttonParams ? (l(), c("div", We, ve(e.buttonParams.unreadAmount), 1)) : u("", !0),
|
|
308
|
-
n[3] || (n[3] = h("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
309
|
-
])) : u("", !0)
|
|
310
|
-
]),
|
|
311
|
-
_: 1
|
|
312
|
-
}),
|
|
313
|
-
e.feedKeyboards && e.feedKeyboards.length > 0 ? (l(), f(Te, {
|
|
300
|
+
e.feedKeyboards && e.feedKeyboards.length > 0 ? (i(), f(Te, {
|
|
314
301
|
key: 1,
|
|
315
302
|
buttons: e.feedKeyboards,
|
|
316
303
|
align: e.feedKeyboardAlign,
|
|
317
|
-
onAction: o(
|
|
304
|
+
onAction: o(ee)
|
|
318
305
|
}, null, 8, ["buttons", "align", "onAction"])) : u("", !0)
|
|
319
|
-
], 44,
|
|
306
|
+
], 44, Ee)) : (i(), c("div", {
|
|
320
307
|
key: 1,
|
|
321
308
|
ref_key: "refFeed",
|
|
322
309
|
ref: r,
|
|
323
310
|
class: "message-feed",
|
|
324
|
-
style:
|
|
311
|
+
style: K({ backgroundImage: `url(${C.value})` })
|
|
325
312
|
}, [
|
|
326
313
|
h("div", Ne, [
|
|
327
|
-
|
|
314
|
+
x(s.$slots, "empty-feed", {}, void 0, !0)
|
|
328
315
|
])
|
|
329
316
|
], 4)),
|
|
330
|
-
|
|
317
|
+
g(v, null, {
|
|
318
|
+
default: S(() => [
|
|
319
|
+
o(O) ? (i(), c("button", {
|
|
320
|
+
key: 0,
|
|
321
|
+
class: "message-feed__button-down",
|
|
322
|
+
onClick: de
|
|
323
|
+
}, [
|
|
324
|
+
e.buttonParams ? (i(), c("div", Ge, ve(e.buttonParams.unreadAmount), 1)) : u("", !0),
|
|
325
|
+
n[3] || (n[3] = h("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
326
|
+
])) : u("", !0)
|
|
327
|
+
]),
|
|
328
|
+
_: 1
|
|
329
|
+
}),
|
|
330
|
+
o(M)().reply ? (i(), f(Se, {
|
|
331
331
|
key: 2,
|
|
332
332
|
to: "#chat-input-reply-line-" + o(y)
|
|
333
333
|
}, [
|
|
334
334
|
g(Be, {
|
|
335
335
|
class: "chat-input-reply",
|
|
336
336
|
message: o(M)().reply,
|
|
337
|
-
onReset: o(
|
|
337
|
+
onReset: o(Q)
|
|
338
338
|
}, null, 8, ["message", "onReset"])
|
|
339
339
|
], 8, ["to"])) : u("", !0)
|
|
340
|
-
]
|
|
340
|
+
]));
|
|
341
341
|
}
|
|
342
342
|
});
|
|
343
343
|
export {
|
|
344
|
-
|
|
344
|
+
ut as default
|
|
345
345
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IFeedObject, IFeedTyping, IFeedUnreadButton, IFeedKeyboard } from '@/types';
|
|
2
|
-
declare var __VLS_1: {},
|
|
2
|
+
declare var __VLS_1: {}, __VLS_47: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
4
|
prepend?: (props: typeof __VLS_1) => any;
|
|
5
5
|
} & {
|
|
6
|
-
'empty-feed'?: (props: typeof
|
|
6
|
+
'empty-feed'?: (props: typeof __VLS_47) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
9
|
objects: {
|