@bcc-code/vue-bcc-chat-ui 7.1.21 → 7.1.23
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/index.d.ts +3 -1
- package/dist/vue-bcc-chat-ui.js +35 -8
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -24,10 +24,12 @@ declare const __VLS_base: DefineComponent<__VLS_Props, {
|
|
|
24
24
|
chatMembersFetched: (members: ParticipantInfo[]) => any;
|
|
25
25
|
chatEmpty: () => any;
|
|
26
26
|
linkClicked: (event: MouseEvent, url: string) => any;
|
|
27
|
+
chatNotAMember: (chatUid: string) => any;
|
|
27
28
|
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
29
|
onChatMembersFetched?: ((members: ParticipantInfo[]) => any) | undefined;
|
|
29
30
|
onChatEmpty?: (() => any) | undefined;
|
|
30
31
|
onLinkClicked?: ((event: MouseEvent, url: string) => any) | undefined;
|
|
32
|
+
onChatNotAMember?: ((chatUid: string) => any) | undefined;
|
|
31
33
|
}>, {
|
|
32
34
|
chatUid: string;
|
|
33
35
|
client: ChatClient | null;
|
|
@@ -525,7 +527,7 @@ declare function getChatOnlineCount(chatUid: string): Promise<number>;
|
|
|
525
527
|
|
|
526
528
|
declare function getCurrentEnvironment(): ChatEnvironmentConfig;
|
|
527
529
|
|
|
528
|
-
declare function getGroup(groupUid: string): Promise<
|
|
530
|
+
declare function getGroup(groupUid: string): Promise<Group | null | undefined>;
|
|
529
531
|
|
|
530
532
|
declare function getMessageTextPreview(message?: any, showEmoji?: boolean, showAttachmentName?: boolean): string;
|
|
531
533
|
|
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -9662,7 +9662,8 @@ var uf = { class: "w-full" }, df = {
|
|
|
9662
9662
|
emits: [
|
|
9663
9663
|
"chatMembersFetched",
|
|
9664
9664
|
"chatEmpty",
|
|
9665
|
-
"linkClicked"
|
|
9665
|
+
"linkClicked",
|
|
9666
|
+
"chatNotAMember"
|
|
9666
9667
|
],
|
|
9667
9668
|
setup(t, { expose: o, emit: u }) {
|
|
9668
9669
|
function f(e) {
|
|
@@ -9774,6 +9775,14 @@ var uf = { class: "w-full" }, df = {
|
|
|
9774
9775
|
try {
|
|
9775
9776
|
e.conversations.value.length === 0 && await e.fetchConversations();
|
|
9776
9777
|
let t = e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null;
|
|
9778
|
+
if (!t) try {
|
|
9779
|
+
t = await V(p.chatUid, e);
|
|
9780
|
+
} catch (e) {
|
|
9781
|
+
if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
|
|
9782
|
+
x.value = !0, m("chatMembersFetched", []), m("chatNotAMember", p.chatUid);
|
|
9783
|
+
return;
|
|
9784
|
+
}
|
|
9785
|
+
}
|
|
9777
9786
|
if (!t) {
|
|
9778
9787
|
x.value = !0, m("chatMembersFetched", []);
|
|
9779
9788
|
return;
|
|
@@ -9784,23 +9793,41 @@ var uf = { class: "w-full" }, df = {
|
|
|
9784
9793
|
}
|
|
9785
9794
|
}
|
|
9786
9795
|
}
|
|
9787
|
-
function V(e, t) {
|
|
9796
|
+
async function V(e, t) {
|
|
9797
|
+
let n = await gu.getGroup(e);
|
|
9798
|
+
if (!n || typeof n != "object") return null;
|
|
9799
|
+
let r = String(n.getGuid());
|
|
9800
|
+
if (!r) return null;
|
|
9801
|
+
let i = {
|
|
9802
|
+
id: `group_${r}`,
|
|
9803
|
+
targetId: r,
|
|
9804
|
+
type: "group",
|
|
9805
|
+
title: String(n.getName() ?? r),
|
|
9806
|
+
subtitle: "No messages yet",
|
|
9807
|
+
unreadCount: 0,
|
|
9808
|
+
tags: (n.getTags() ?? []).map((e) => String(e)),
|
|
9809
|
+
memberCount: Math.max((Number(n.getMembersCount()) || 1) - 1, 0),
|
|
9810
|
+
source: { getConversationWith: () => n }
|
|
9811
|
+
};
|
|
9812
|
+
return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
|
|
9813
|
+
}
|
|
9814
|
+
function se(e, t) {
|
|
9788
9815
|
m("linkClicked", e, t);
|
|
9789
9816
|
}
|
|
9790
|
-
let
|
|
9817
|
+
let H = w(!1);
|
|
9791
9818
|
b(() => {
|
|
9792
9819
|
setTimeout(() => {
|
|
9793
|
-
|
|
9820
|
+
H.value = !0;
|
|
9794
9821
|
}, 200);
|
|
9795
9822
|
}), y(() => {
|
|
9796
9823
|
let e = T.value;
|
|
9797
9824
|
e && e.activeConversation.value === O.value && e.selectConversation(null);
|
|
9798
9825
|
});
|
|
9799
|
-
async function
|
|
9800
|
-
return await new Promise((e) => setTimeout(e, 100)),
|
|
9826
|
+
async function ce(e) {
|
|
9827
|
+
return await new Promise((e) => setTimeout(e, 100)), H.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), ce(e));
|
|
9801
9828
|
}
|
|
9802
9829
|
return o({
|
|
9803
|
-
scrollToMessage:
|
|
9830
|
+
scrollToMessage: ce,
|
|
9804
9831
|
groupMembers: n(() => A.value)
|
|
9805
9832
|
}), (n, o) => (S(), a("div", {
|
|
9806
9833
|
ref_key: "chatRootRef",
|
|
@@ -9824,7 +9851,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9824
9851
|
"show-header": L.value,
|
|
9825
9852
|
"action-message-class": t.actionMessageClass,
|
|
9826
9853
|
"action-message-row-class": t.actionMessageRowClass,
|
|
9827
|
-
onAnchorclick:
|
|
9854
|
+
onAnchorclick: se
|
|
9828
9855
|
}, s({
|
|
9829
9856
|
composer: I(() => [l(Zd, {
|
|
9830
9857
|
ref_key: "mainComposerRef",
|