@mobilon-dev/chotto 0.3.52 → 0.3.54
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/1_atoms/LoadingIndicator/LoadingIndicator.vue.js +33 -12
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +245 -313
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +32 -61
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +18 -41
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.js +21 -22
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationPlaceholder.js +13 -22
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.js +34 -46
- package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.js +19 -0
- package/dist/components/3_compounds/Feed/Feed.vue.js +1 -1
- package/dist/components/3_compounds/Feed/Feed.vue2.js +173 -149
- package/dist/components/3_compounds/Feed/composables/useFeedLoadMore.js +40 -37
- package/dist/components/3_compounds/Feed/composables/useFeedMessageVisibility.js +17 -19
- package/dist/components/3_compounds/Feed/composables/useStickyDate.js +31 -35
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/components/1_atoms/LoadingIndicator/LoadingIndicator.vue.d.ts +4 -0
- package/dist/types/components/1_atoms/LoadingIndicator/styles/types.d.ts +6 -0
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +0 -2
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +2 -12
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.d.ts +2 -17
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +1 -3
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationPlaceholder.d.ts +1 -7
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.d.ts +1 -5
- package/dist/types/components/2_blocks/CommunicationPanel/icons/CommunicationPanelCheckIcon.vue.d.ts +2 -0
- package/dist/types/components/2_blocks/CommunicationPanel/icons/index.d.ts +1 -0
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +0 -2
- package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +32 -0
- package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +2 -2
- package/dist/types/components/3_compounds/Feed/composables/useFeedMessageVisibility.d.ts +3 -1
- package/dist/types/components/3_compounds/Feed/styles/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import $e from "./
|
|
19
|
-
|
|
1
|
+
import { defineComponent as fe, ref as k, computed as i, inject as w, unref as o, watch as ge, nextTick as j, onMounted as ye, createElementBlock as c, openBlock as l, Fragment as K, createBlock as f, createCommentVNode as u, normalizeStyle as x, renderSlot as L, withDirectives as pe, createVNode as g, createElementVNode as h, vShow as be, Transition as v, withCtx as S, renderList as ke, resolveDynamicComponent as he, toDisplayString as ve, Teleport as Se } from "vue";
|
|
2
|
+
import Re from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
|
|
3
|
+
import Be from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
4
|
+
import Ie from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
|
|
5
|
+
import Te from "../../2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js";
|
|
6
|
+
import Ae from "../../2_feed_elements/TypingMessage/TypingMessage.vue.js";
|
|
7
|
+
import Me from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
|
|
8
|
+
import { useFeedButton as Fe } from "./composables/useFeedButton.js";
|
|
9
|
+
import { useFeedComponents as Ce } from "./composables/useFeedComponents.js";
|
|
10
|
+
import { useFeedGrouping as De } from "./composables/useFeedGrouping.js";
|
|
11
|
+
import { useFeedKeyboard as we } from "./composables/useFeedKeyboard.js";
|
|
12
|
+
import { useFeedLoadMore as je } from "./composables/useFeedLoadMore.js";
|
|
13
|
+
import { useFeedMessageVisibility as Ke } from "./composables/useFeedMessageVisibility.js";
|
|
14
|
+
import { useFeedReply as xe } from "./composables/useFeedReply.js";
|
|
15
|
+
import { useFeedScroll as Le } from "./composables/useFeedScroll.js";
|
|
16
|
+
import { useFeedScrollTo as Oe } from "./composables/useFeedScrollTo.js";
|
|
17
|
+
import { useStickyDate as Ve } from "./composables/useStickyDate.js";
|
|
18
|
+
import { throttle as $e } from "./functions/throttle.js";
|
|
19
|
+
import qe from "./assets/chat-background.svg.js";
|
|
20
|
+
const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-timestamp", "onDblclick"], We = {
|
|
20
21
|
key: 0,
|
|
21
22
|
class: "message-feed__unread-amount"
|
|
22
|
-
},
|
|
23
|
+
}, Ne = { style: { margin: "auto" } }, ct = /* @__PURE__ */ fe({
|
|
23
24
|
__name: "Feed",
|
|
24
25
|
props: {
|
|
25
26
|
objects: {
|
|
@@ -55,7 +56,7 @@ const xe = ["id"], Oe = ["id", "onDblclick"], Ve = {
|
|
|
55
56
|
keyboardAlign: {
|
|
56
57
|
type: String,
|
|
57
58
|
default: "right",
|
|
58
|
-
validator: (
|
|
59
|
+
validator: (e) => ["left", "center", "right"].includes(e)
|
|
59
60
|
},
|
|
60
61
|
feedKeyboards: {
|
|
61
62
|
type: Array,
|
|
@@ -65,7 +66,7 @@ const xe = ["id"], Oe = ["id", "onDblclick"], Ve = {
|
|
|
65
66
|
feedKeyboardAlign: {
|
|
66
67
|
type: String,
|
|
67
68
|
default: "right",
|
|
68
|
-
validator: (
|
|
69
|
+
validator: (e) => ["left", "center", "right"].includes(e)
|
|
69
70
|
},
|
|
70
71
|
chatBackground: {
|
|
71
72
|
type: String,
|
|
@@ -97,225 +98,248 @@ const xe = ["id"], Oe = ["id", "onDblclick"], Ve = {
|
|
|
97
98
|
"smsInvite",
|
|
98
99
|
"delimiterRead"
|
|
99
100
|
],
|
|
100
|
-
setup(
|
|
101
|
-
const
|
|
101
|
+
setup(e, { emit: O }) {
|
|
102
|
+
const a = e, b = k(), r = k(), R = k(), {
|
|
102
103
|
isShowButton: V,
|
|
103
|
-
isKeyboardPlace:
|
|
104
|
-
checkButtonVisibility:
|
|
105
|
-
} =
|
|
104
|
+
isKeyboardPlace: $,
|
|
105
|
+
checkButtonVisibility: q
|
|
106
|
+
} = Fe({
|
|
106
107
|
feedRef: r,
|
|
107
|
-
keyboardRef:
|
|
108
|
-
}), { componentsMap:
|
|
109
|
-
objects: i(() =>
|
|
110
|
-
}), y =
|
|
111
|
-
if (
|
|
112
|
-
return
|
|
108
|
+
keyboardRef: R
|
|
109
|
+
}), { componentsMap: z } = Ce(), E = i(() => a.reactionsEnabled), { groupedObjects: P } = De({
|
|
110
|
+
objects: i(() => a.objects)
|
|
111
|
+
}), y = w("chatAppId"), B = w("selectedChat", void 0), I = i(() => {
|
|
112
|
+
if (B)
|
|
113
|
+
return o(B);
|
|
113
114
|
});
|
|
115
|
+
function W(s) {
|
|
116
|
+
return s.timestamp;
|
|
117
|
+
}
|
|
114
118
|
function N(s) {
|
|
115
|
-
var
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
119
|
+
var m;
|
|
120
|
+
const n = s;
|
|
121
|
+
if (!n.dialogId || !((m = I.value) != null && m.dialogs))
|
|
118
122
|
return;
|
|
119
|
-
const
|
|
120
|
-
return
|
|
123
|
+
const t = I.value.dialogs.find((p) => p.dialogId === n.dialogId);
|
|
124
|
+
return t == null ? void 0 : t.channelId;
|
|
121
125
|
}
|
|
122
126
|
const d = O, {
|
|
123
|
-
checkScrollPosition:
|
|
127
|
+
checkScrollPosition: G,
|
|
124
128
|
startScrollWatch: T,
|
|
125
129
|
stopScrollWatch: A,
|
|
126
|
-
resetAllowFlags:
|
|
127
|
-
} =
|
|
130
|
+
resetAllowFlags: U
|
|
131
|
+
} = je({
|
|
128
132
|
feedRef: r,
|
|
129
133
|
emit: d,
|
|
130
|
-
isLoadingMoreRef: i(() =>
|
|
134
|
+
isLoadingMoreRef: i(() => a.isLoadingMore)
|
|
131
135
|
}), {
|
|
132
|
-
getMessage:
|
|
133
|
-
messageAction:
|
|
134
|
-
handleClickReplied:
|
|
135
|
-
feedObjectDoubleClick:
|
|
136
|
-
handleResetReply:
|
|
137
|
-
} =
|
|
138
|
-
enableDoubleClickReply:
|
|
136
|
+
getMessage: M,
|
|
137
|
+
messageAction: H,
|
|
138
|
+
handleClickReplied: J,
|
|
139
|
+
feedObjectDoubleClick: Q,
|
|
140
|
+
handleResetReply: X
|
|
141
|
+
} = xe({
|
|
142
|
+
enableDoubleClickReply: a.enableDoubleClickReply,
|
|
139
143
|
emit: d
|
|
140
144
|
});
|
|
141
|
-
function
|
|
145
|
+
function Y(s) {
|
|
142
146
|
d("smsInvite", s);
|
|
143
147
|
}
|
|
144
|
-
function
|
|
148
|
+
function Z(s) {
|
|
145
149
|
d("delimiterRead", s);
|
|
146
150
|
}
|
|
147
151
|
const {
|
|
148
|
-
showKeyboard:
|
|
149
|
-
keyboardAction:
|
|
150
|
-
feedKeyboardAction:
|
|
151
|
-
} =
|
|
152
|
-
isKeyboardPlace:
|
|
153
|
-
objects: i(() =>
|
|
152
|
+
showKeyboard: _,
|
|
153
|
+
keyboardAction: ee,
|
|
154
|
+
feedKeyboardAction: te
|
|
155
|
+
} = we({
|
|
156
|
+
isKeyboardPlace: $,
|
|
157
|
+
objects: i(() => a.objects),
|
|
154
158
|
emit: d
|
|
155
159
|
}), {
|
|
156
|
-
showStickyDate:
|
|
157
|
-
stickyDateText:
|
|
158
|
-
show:
|
|
159
|
-
} =
|
|
160
|
+
showStickyDate: oe,
|
|
161
|
+
stickyDateText: se,
|
|
162
|
+
show: ne
|
|
163
|
+
} = Ve({
|
|
160
164
|
feedRef: r,
|
|
161
|
-
trackingObjects:
|
|
165
|
+
trackingObjects: b
|
|
162
166
|
}), {
|
|
163
|
-
isInitialized:
|
|
167
|
+
isInitialized: ae,
|
|
164
168
|
performScrollToBottom: le,
|
|
165
|
-
ensureScrollToBottom:
|
|
166
|
-
initializeScroll:
|
|
169
|
+
ensureScrollToBottom: F,
|
|
170
|
+
initializeScroll: ie,
|
|
167
171
|
smoothScrollToBottom: re
|
|
168
|
-
} =
|
|
172
|
+
} = Le({
|
|
169
173
|
feedRef: r,
|
|
170
|
-
objectsRef: i(() =>
|
|
171
|
-
scrollToBottomRef: i(() =>
|
|
172
|
-
}),
|
|
173
|
-
function
|
|
174
|
-
|
|
174
|
+
objectsRef: i(() => a.objects),
|
|
175
|
+
scrollToBottomRef: i(() => a.scrollToBottom)
|
|
176
|
+
}), C = i(() => a.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(qe)}`);
|
|
177
|
+
function D(s = !0) {
|
|
178
|
+
q(), G(s), ne();
|
|
175
179
|
}
|
|
176
|
-
const
|
|
177
|
-
function
|
|
180
|
+
const de = $e(() => D(), 250);
|
|
181
|
+
function ce() {
|
|
178
182
|
d("forceScrollToBottom"), re();
|
|
179
183
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
function ue(s) {
|
|
185
|
+
const n = a.objects;
|
|
186
|
+
if (s.startsWith("mid-")) {
|
|
187
|
+
const t = parseInt(s.slice(4), 10);
|
|
188
|
+
return n[t];
|
|
189
|
+
}
|
|
190
|
+
return n.find((t) => t.messageId === s);
|
|
191
|
+
}
|
|
192
|
+
const { restartObserving: me } = Ke({
|
|
193
|
+
trackingObjects: b,
|
|
183
194
|
chatAppId: y,
|
|
195
|
+
getMessageById: ue,
|
|
184
196
|
onMessageVisible: (s) => d("messageVisible", s)
|
|
185
197
|
});
|
|
186
|
-
return
|
|
187
|
-
() =>
|
|
198
|
+
return ge(
|
|
199
|
+
() => a.objects,
|
|
188
200
|
() => {
|
|
189
|
-
|
|
190
|
-
|
|
201
|
+
j(() => {
|
|
202
|
+
requestAnimationFrame(() => {
|
|
203
|
+
U(), D(!1), b.value = document.querySelectorAll(".tracking-message"), me();
|
|
204
|
+
});
|
|
191
205
|
});
|
|
192
206
|
},
|
|
193
207
|
{ immediate: !0 }
|
|
194
|
-
),
|
|
195
|
-
targetIdRef: i(() =>
|
|
208
|
+
), Oe({
|
|
209
|
+
targetIdRef: i(() => a.scrollTo),
|
|
196
210
|
feedContainerId: `feed-container-${y}`
|
|
197
|
-
}),
|
|
198
|
-
|
|
199
|
-
|
|
211
|
+
}), ye(() => {
|
|
212
|
+
j(() => {
|
|
213
|
+
a.objects.length > 0 && !ae.value && ie();
|
|
200
214
|
const s = new ResizeObserver(() => {
|
|
201
|
-
|
|
202
|
-
|
|
215
|
+
a.scrollToBottom && (le(), setTimeout(() => {
|
|
216
|
+
F();
|
|
203
217
|
}, 200), setTimeout(() => {
|
|
204
|
-
|
|
218
|
+
F();
|
|
205
219
|
}, 800));
|
|
206
220
|
});
|
|
207
221
|
r.value && s.observe(r.value);
|
|
208
222
|
});
|
|
209
|
-
}), (s,
|
|
210
|
-
|
|
223
|
+
}), (s, n) => (l(), c(K, null, [
|
|
224
|
+
e.objects.length > 0 || e.typing ? (l(), c("div", {
|
|
211
225
|
key: 0,
|
|
212
|
-
id: "feed-container-" +
|
|
226
|
+
id: "feed-container-" + o(y),
|
|
213
227
|
ref_key: "refFeed",
|
|
214
228
|
ref: r,
|
|
215
229
|
class: "message-feed",
|
|
216
|
-
style:
|
|
217
|
-
onScroll:
|
|
218
|
-
onMousedown:
|
|
219
|
-
(...
|
|
220
|
-
onMouseup:
|
|
221
|
-
(...
|
|
230
|
+
style: x({ backgroundImage: `url(${C.value})` }),
|
|
231
|
+
onScroll: n[0] || (n[0] = (t) => o(de)()),
|
|
232
|
+
onMousedown: n[1] || (n[1] = //@ts-ignore
|
|
233
|
+
(...t) => o(T) && o(T)(...t)),
|
|
234
|
+
onMouseup: n[2] || (n[2] = //@ts-ignore
|
|
235
|
+
(...t) => o(A) && o(A)(...t))
|
|
222
236
|
}, [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
e
|
|
237
|
+
L(s.$slots, "prepend", {}, void 0, !0),
|
|
238
|
+
pe(h("div", Ee, [
|
|
239
|
+
g(Me, {
|
|
240
|
+
"is-loading": e.isLoadingMore,
|
|
241
|
+
size: "small",
|
|
242
|
+
position: "top"
|
|
243
|
+
}, null, 8, ["is-loading"])
|
|
244
|
+
], 512), [
|
|
245
|
+
[be, e.isLoadingMore]
|
|
246
|
+
]),
|
|
247
|
+
g(v, null, {
|
|
248
|
+
default: S(() => [
|
|
249
|
+
o(oe) && !e.isLoadingMore ? (l(), f(Re, {
|
|
227
250
|
key: 0,
|
|
228
251
|
class: "message-feed__sticky-date",
|
|
229
|
-
text:
|
|
252
|
+
text: o(se)
|
|
230
253
|
}, null, 8, ["text"])) : u("", !0)
|
|
231
254
|
]),
|
|
232
255
|
_: 1
|
|
233
256
|
}),
|
|
234
|
-
(
|
|
235
|
-
id:
|
|
236
|
-
key:
|
|
257
|
+
(l(!0), c(K, null, ke(o(P), (t, m) => (l(), c("div", {
|
|
258
|
+
id: "msg-" + (t.messageId ?? "mid-" + m),
|
|
259
|
+
key: t.messageId ?? "mid-" + m,
|
|
260
|
+
"data-timestamp": W(t),
|
|
237
261
|
class: "tracking-message",
|
|
238
|
-
onDblclick: (
|
|
262
|
+
onDblclick: (p) => o(Q)(p, t)
|
|
239
263
|
}, [
|
|
240
|
-
(
|
|
241
|
-
key:
|
|
264
|
+
(l(), f(he(o(z)(t.type)), {
|
|
265
|
+
key: t.messageId ?? "mid-" + m,
|
|
242
266
|
class: "message-feed__message",
|
|
243
|
-
message:
|
|
244
|
-
"apply-style":
|
|
245
|
-
"is-first-in-series":
|
|
246
|
-
"reactions-enabled":
|
|
247
|
-
"subtext-tooltip-data":
|
|
248
|
-
channel: N(
|
|
249
|
-
onAction:
|
|
250
|
-
onReply:
|
|
251
|
-
onSmsInvite: (
|
|
252
|
-
onRead:
|
|
267
|
+
message: t,
|
|
268
|
+
"apply-style": e.applyStyle,
|
|
269
|
+
"is-first-in-series": t.isFirstInSeries,
|
|
270
|
+
"reactions-enabled": E.value,
|
|
271
|
+
"subtext-tooltip-data": e.subtextTooltipData,
|
|
272
|
+
channel: N(t),
|
|
273
|
+
onAction: o(H),
|
|
274
|
+
onReply: o(J),
|
|
275
|
+
onSmsInvite: (p) => Y(t),
|
|
276
|
+
onRead: Z
|
|
253
277
|
}, null, 40, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "subtext-tooltip-data", "channel", "onAction", "onReply", "onSmsInvite"]))
|
|
254
|
-
], 40,
|
|
255
|
-
|
|
278
|
+
], 40, Pe))), 128)),
|
|
279
|
+
e.typing ? (l(), f(Ae, {
|
|
256
280
|
key: 0,
|
|
257
281
|
message: {
|
|
258
|
-
subText:
|
|
259
|
-
avatar:
|
|
282
|
+
subText: e.typing.title,
|
|
283
|
+
avatar: e.typing.avatar
|
|
260
284
|
}
|
|
261
285
|
}, null, 8, ["message"])) : u("", !0),
|
|
262
|
-
|
|
263
|
-
default:
|
|
264
|
-
|
|
286
|
+
g(v, null, {
|
|
287
|
+
default: S(() => [
|
|
288
|
+
o(_) ? (l(), f(Ie, {
|
|
265
289
|
key: 0,
|
|
266
290
|
ref_key: "keyboardRef",
|
|
267
|
-
ref:
|
|
291
|
+
ref: R,
|
|
268
292
|
class: "message-feed__keyboard",
|
|
269
|
-
keyboard:
|
|
270
|
-
align:
|
|
271
|
-
onAction:
|
|
293
|
+
keyboard: e.objects[e.objects.length - 1].keyboard,
|
|
294
|
+
align: e.keyboardAlign,
|
|
295
|
+
onAction: o(ee)
|
|
272
296
|
}, null, 8, ["keyboard", "align", "onAction"])) : u("", !0)
|
|
273
297
|
]),
|
|
274
298
|
_: 1
|
|
275
299
|
}),
|
|
276
|
-
|
|
277
|
-
default:
|
|
278
|
-
|
|
300
|
+
g(v, null, {
|
|
301
|
+
default: S(() => [
|
|
302
|
+
o(V) ? (l(), c("button", {
|
|
279
303
|
key: 0,
|
|
280
304
|
class: "message-feed__button-down",
|
|
281
|
-
onClick:
|
|
305
|
+
onClick: ce
|
|
282
306
|
}, [
|
|
283
|
-
|
|
284
|
-
|
|
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))
|
|
285
309
|
])) : u("", !0)
|
|
286
310
|
]),
|
|
287
311
|
_: 1
|
|
288
312
|
}),
|
|
289
|
-
|
|
313
|
+
e.feedKeyboards && e.feedKeyboards.length > 0 ? (l(), f(Te, {
|
|
290
314
|
key: 1,
|
|
291
|
-
buttons:
|
|
292
|
-
align:
|
|
293
|
-
onAction:
|
|
315
|
+
buttons: e.feedKeyboards,
|
|
316
|
+
align: e.feedKeyboardAlign,
|
|
317
|
+
onAction: o(te)
|
|
294
318
|
}, null, 8, ["buttons", "align", "onAction"])) : u("", !0)
|
|
295
|
-
], 44,
|
|
319
|
+
], 44, ze)) : (l(), c("div", {
|
|
296
320
|
key: 1,
|
|
297
321
|
ref_key: "refFeed",
|
|
298
322
|
ref: r,
|
|
299
323
|
class: "message-feed",
|
|
300
|
-
style:
|
|
324
|
+
style: x({ backgroundImage: `url(${C.value})` })
|
|
301
325
|
}, [
|
|
302
|
-
|
|
303
|
-
|
|
326
|
+
h("div", Ne, [
|
|
327
|
+
L(s.$slots, "empty-feed", {}, void 0, !0)
|
|
304
328
|
])
|
|
305
329
|
], 4)),
|
|
306
|
-
|
|
330
|
+
o(M)().reply ? (l(), f(Se, {
|
|
307
331
|
key: 2,
|
|
308
|
-
to: "#chat-input-reply-line-" +
|
|
332
|
+
to: "#chat-input-reply-line-" + o(y)
|
|
309
333
|
}, [
|
|
310
|
-
|
|
334
|
+
g(Be, {
|
|
311
335
|
class: "chat-input-reply",
|
|
312
|
-
message:
|
|
313
|
-
onReset:
|
|
336
|
+
message: o(M)().reply,
|
|
337
|
+
onReset: o(X)
|
|
314
338
|
}, null, 8, ["message", "onReset"])
|
|
315
339
|
], 8, ["to"])) : u("", !0)
|
|
316
340
|
], 64));
|
|
317
341
|
}
|
|
318
342
|
});
|
|
319
343
|
export {
|
|
320
|
-
|
|
344
|
+
ct as default
|
|
321
345
|
};
|
|
@@ -1,62 +1,65 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
1
|
+
import { ref as t, watch as m, unref as v, nextTick as w } from "vue";
|
|
2
|
+
function F({ feedRef: u, emit: i, isLoadingMoreRef: p }) {
|
|
3
|
+
const s = t(!1), a = t(!1), n = t(!1), r = t(!1), h = t(0), T = t(0), c = t(!1), f = t(!1), d = (o = !0) => {
|
|
4
4
|
const l = v(u);
|
|
5
5
|
if (!l) return;
|
|
6
|
-
const
|
|
7
|
-
r.value ? (l.scrollTop < 300 && (n.value = !1,
|
|
8
|
-
}, S = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
f.value = !
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
const e = l.scrollHeight - l.scrollTop - l.clientHeight;
|
|
7
|
+
r.value ? (l.scrollTop < 300 && (n.value = !1, s.value = !1), e < 300 && (a.value = !1, n.value = !0)) : o && (l.scrollTop < 300 && (h.value = l.scrollHeight, T.value = l.scrollTop, c.value = !0, s.value = !1), e < 300 && (a.value = !1));
|
|
8
|
+
}, S = (o = 0) => {
|
|
9
|
+
const l = () => {
|
|
10
|
+
w(() => {
|
|
11
|
+
requestAnimationFrame(() => {
|
|
12
|
+
try {
|
|
13
|
+
const e = v(u);
|
|
14
|
+
if (!e || !c.value) return;
|
|
15
|
+
const g = e.style.scrollBehavior;
|
|
16
|
+
e.style.scrollBehavior = "auto";
|
|
17
|
+
const B = e.scrollHeight - h.value;
|
|
18
|
+
e.scrollTop = T.value + B, setTimeout(() => {
|
|
19
|
+
e.style.scrollBehavior = g || "auto";
|
|
20
|
+
}, 50);
|
|
21
|
+
} finally {
|
|
22
|
+
c.value = !1, f.value = !0, setTimeout(() => {
|
|
23
|
+
f.value = !1;
|
|
24
|
+
}, 500);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
o > 0 ? setTimeout(l, o) : l();
|
|
27
30
|
};
|
|
28
|
-
return i &&
|
|
29
|
-
() => [
|
|
31
|
+
return i && m(
|
|
32
|
+
() => [a.value, s.value],
|
|
30
33
|
() => {
|
|
31
|
-
|
|
34
|
+
a.value || i("loadMoreDown"), s.value || i("loadMore");
|
|
32
35
|
}
|
|
33
|
-
), p &&
|
|
36
|
+
), p && m(
|
|
34
37
|
() => p.value,
|
|
35
|
-
(
|
|
36
|
-
l === !0 &&
|
|
38
|
+
(o, l) => {
|
|
39
|
+
l === !0 && o === !1 && S(0);
|
|
37
40
|
}
|
|
38
41
|
), {
|
|
39
|
-
allowLoadMoreTop:
|
|
40
|
-
allowLoadMoreBottom:
|
|
42
|
+
allowLoadMoreTop: s,
|
|
43
|
+
allowLoadMoreBottom: a,
|
|
41
44
|
movingDown: n,
|
|
42
45
|
isScrollByMouseButton: r,
|
|
43
46
|
pendingTopRestore: c,
|
|
44
47
|
topLoadJustHappened: f,
|
|
45
|
-
checkScrollPosition:
|
|
48
|
+
checkScrollPosition: d,
|
|
46
49
|
restoreScrollPosition: S,
|
|
47
|
-
startScrollWatch: (
|
|
50
|
+
startScrollWatch: (o) => {
|
|
48
51
|
const l = v(u);
|
|
49
52
|
if (!l) return;
|
|
50
|
-
(
|
|
53
|
+
(o.offsetX > l.clientWidth || o.offsetY > l.clientHeight) && (r.value = !0);
|
|
51
54
|
},
|
|
52
55
|
stopScrollWatch: () => {
|
|
53
56
|
r.value = !1;
|
|
54
57
|
},
|
|
55
58
|
resetAllowFlags: () => {
|
|
56
|
-
|
|
59
|
+
s.value = !0, a.value = !0;
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
62
|
}
|
|
60
63
|
export {
|
|
61
|
-
|
|
64
|
+
F as useFeedLoadMore
|
|
62
65
|
};
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
function
|
|
2
|
-
trackingObjects:
|
|
3
|
-
chatAppId:
|
|
4
|
-
|
|
1
|
+
function f({
|
|
2
|
+
trackingObjects: t,
|
|
3
|
+
chatAppId: c,
|
|
4
|
+
getMessageById: a,
|
|
5
|
+
onMessageVisible: g
|
|
5
6
|
}) {
|
|
6
|
-
const
|
|
7
|
+
const d = (e) => {
|
|
7
8
|
e.forEach((n) => {
|
|
8
|
-
if (n.isIntersecting)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} catch (r) {
|
|
13
|
-
console.error("Failed to parse message from IntersectionObserver:", r);
|
|
14
|
-
}
|
|
9
|
+
if (n.isIntersecting) {
|
|
10
|
+
const s = n.target.id, v = s.startsWith("msg-") ? s.slice(4) : s, i = a(v);
|
|
11
|
+
i && g(i);
|
|
12
|
+
}
|
|
15
13
|
});
|
|
16
|
-
},
|
|
17
|
-
root: document.getElementById("feed-container-" +
|
|
14
|
+
}, l = {
|
|
15
|
+
root: document.getElementById("feed-container-" + c),
|
|
18
16
|
rootMargin: "5px",
|
|
19
17
|
threshold: 0
|
|
20
|
-
}, o = new IntersectionObserver(
|
|
21
|
-
|
|
18
|
+
}, o = new IntersectionObserver(d, l), r = () => {
|
|
19
|
+
t.value && t.value.forEach((e) => o.observe(e));
|
|
22
20
|
};
|
|
23
21
|
return {
|
|
24
22
|
observer: o,
|
|
25
|
-
observeMessages:
|
|
23
|
+
observeMessages: r,
|
|
26
24
|
restartObserving: () => {
|
|
27
|
-
|
|
25
|
+
r();
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
28
|
}
|
|
31
29
|
export {
|
|
32
|
-
|
|
30
|
+
f as useFeedMessageVisibility
|
|
33
31
|
};
|