tuikit-atomicx-vue3 4.5.1 → 4.5.3
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/{MessageInput.vue_vue_type_script_setup_true_lang-jPzZ5INK.js → MessageInput.vue_vue_type_script_setup_true_lang-3RVYOdkv.js} +38 -38
- package/dist/{PopoverPortal-DghpKKm8.js → PopoverPortal-DV6zFXcf.js} +3 -3
- package/dist/{PopoverTrigger-BajjNkGO.js → PopoverTrigger-DIjW4PKa.js} +4 -4
- package/dist/{PopperContent-SLoFuK7k.js → PopperContent-D__dbwpA.js} +1 -1
- package/dist/{Teleport-DFrneqLM.js → Teleport-98QrIYDI.js} +278 -268
- package/dist/baseComp/Modal/Modal.js +3 -3
- package/dist/components/AudioSettingPanel/index.js +14 -14
- package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +2 -2
- package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +4 -4
- package/dist/components/ConversationList/ConversationActions/ConversationActions.js +53 -50
- package/dist/components/ConversationList/ConversationActions/ConversationActions.vue.d.ts +2 -0
- package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +25 -25
- package/dist/components/ConversationList/ConversationList.vue.d.ts +16 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +16 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +18 -18
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +13 -13
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +11 -11
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +84 -75
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +4 -0
- package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +14 -14
- package/dist/components/ConversationList/i18n/en-US.d.ts +1 -0
- package/dist/components/ConversationList/i18n/en-US.js +2 -1
- package/dist/components/ConversationList/i18n/zh-CN.d.ts +1 -0
- package/dist/components/ConversationList/i18n/zh-CN.js +2 -1
- package/dist/components/ConversationList/index.d.ts +48 -0
- package/dist/components/LiveScenePanel/index.js +9 -10
- package/dist/components/MessageInput/AttachmentPicker/index.js +2 -2
- package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +2 -2
- package/dist/components/MessageInput/MessageInput.js +1 -1
- package/dist/components/MessageInput/TextEditor/EditorCore.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +3 -3
- package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +1 -1
- package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +2 -2
- package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +2 -2
- package/dist/components/MessageInput/TextEditor/index.js +1 -1
- package/dist/components/MessageInput/index.js +1 -1
- package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
- package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.js +37 -28
- package/dist/components/MessageList/MessageList.js +77 -67
- package/dist/components/ScheduleRoomPanel/RoomDetail.js +22 -22
- package/dist/components/ScheduleRoomPanel/RoomEdit.js +1 -1
- package/dist/components/ScheduleRoomPanel/RoomShare.js +4 -4
- package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.js +1 -1
- package/dist/components/ScheduleRoomPanel/ScheduledRoomList.js +1 -1
- package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.d.ts +72 -0
- package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.js +95 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.d.ts +40 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.js +51 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/index.d.ts +4 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/index.js +6 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.d.ts +40 -0
- package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.js +51 -0
- package/dist/components/UIKitModal/chatErrorModal/index.d.ts +3 -0
- package/dist/components/UIKitModal/chatErrorModal/index.js +11 -0
- package/dist/components/VideoSettingPanel/index.js +1 -1
- package/dist/hooks/useReadReceipt/useReadReceipt.js +44 -41
- package/dist/index-CTthrJb2.js +1461 -0
- package/dist/{index-CzCDLp99.js → index-DXC5bPY4.js} +32 -32
- package/dist/{index-C8Jw_xE4.js → index-DuAffztD.js} +1731 -1648
- package/dist/{index-CiYL_XsE.js → index-hHVD-MG2.js} +1 -1
- package/dist/index.js +59 -58
- package/dist/states/GroupSettingState/GroupSettingState.js +109 -102
- package/dist/states/LoginState.js +43 -43
- package/dist/states/MessageInputState/MessageInputState.js +75 -78
- package/dist/states/MessageListState/MessageListState.js +26 -23
- package/dist/states/RoomParticipantState/index.js +83 -24
- package/dist/states/RoomParticipantState/participantEventManager.d.ts +2 -2
- package/dist/states/RoomParticipantState/participantEventManager.js +217 -205
- package/dist/states/RoomParticipantState/participantManager.d.ts +4 -0
- package/dist/states/RoomParticipantState/participantManager.js +159 -127
- package/dist/states/RoomState/callManager.d.ts +3 -3
- package/dist/states/RoomState/callManager.js +20 -20
- package/dist/states/RoomState/common.d.ts +3 -2
- package/dist/states/RoomState/common.js +34 -24
- package/dist/states/RoomState/roomManager.d.ts +1 -1
- package/dist/states/RoomState/roomManager.js +37 -34
- package/dist/states/RoomState/scheduleManager.js +21 -27
- package/dist/styles/index.css +1 -1
- package/dist/subEntry/chat/chat.d.ts +48 -0
- package/dist/subEntry/live/index.js +46 -45
- package/dist/subEntry/room/index.js +39 -38
- package/dist/types/beauty.d.ts +20 -0
- package/dist/types/index.js +37 -36
- package/dist/types/participant.d.ts +2 -0
- package/dist/types/room.d.ts +45 -1
- package/dist/types/room.js +4 -3
- package/dist/{useId-D5WE76CM.js → useId-B1VwPJLm.js} +1 -1
- package/dist/utils/call.js +77 -71
- package/dist/{utils-CttDpxqz.js → utils-BU8IkP_V.js} +1 -1
- package/package.json +5 -6
- package/src/components/AudioSettingPanel/index.vue +4 -5
- package/src/components/ConversationList/ConversationActions/ConversationActions.vue +7 -1
- package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +5 -1
- package/src/components/ConversationList/ConversationList.vue +0 -1
- package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +2 -2
- package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +15 -0
- package/src/components/ConversationList/i18n/en-US.ts +1 -0
- package/src/components/ConversationList/i18n/zh-CN.ts +1 -0
- package/src/components/LiveScenePanel/index.vue +0 -1
- package/src/components/MessageInput/MessageInput.module.scss +1 -0
- package/src/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +12 -3
- package/src/components/MessageList/MessageList.vue +14 -0
- package/src/components/ScheduleRoomPanel/RoomDetail.vue +1 -0
- package/src/components/ScheduleRoomPanel/RoomEdit.vue +2 -1
- package/src/components/ScheduleRoomPanel/RoomShare.vue +1 -0
- package/src/components/ScheduleRoomPanel/ScheduleRoomPanel.vue +1 -0
- package/src/components/ScheduleRoomPanel/ScheduledRoomList.vue +1 -0
- package/src/components/UIKitModal/chatErrorModal/chatErrorModal.ts +205 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/en-US/index.ts +56 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/index.ts +4 -0
- package/src/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.ts +56 -0
- package/src/components/UIKitModal/chatErrorModal/index.ts +16 -0
- package/src/components/VideoSettingPanel/index.vue +1 -0
- package/src/hooks/useReadReceipt/useReadReceipt.ts +5 -4
- package/src/types/beauty.ts +20 -0
- package/src/types/participant.ts +3 -0
- package/src/types/room.ts +49 -1
- package/src/utils/call.ts +8 -0
- package/dist/index-BvFYOUyz.js +0 -2936
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { ref as o } from "vue";
|
|
2
|
-
import { TUIStore as Y, StoreName as j, TUIChatEngine as q, TUIGroupService as
|
|
2
|
+
import { TUIStore as Y, StoreName as j, TUIChatEngine as q, TUIGroupService as v } from "@tencentcloud/chat-uikit-engine";
|
|
3
3
|
import { FULL_PERMISSION_MATRIX as U } from "./permissions.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import "../../components/UIKitModal/chatErrorModal/index.js";
|
|
5
|
+
import { GroupInviteType as C, GroupMemberRole as D } from "./types.js";
|
|
6
|
+
import { GroupPermission as Me, GroupType as me } from "./types.js";
|
|
7
|
+
import { handleChatErrorWithModal as X } from "../../components/UIKitModal/chatErrorModal/chatErrorModal.js";
|
|
8
|
+
const f = o(void 0), i = o(void 0), p = o(void 0), h = o(void 0), G = o(void 0), M = o(void 0), m = o(void 0), b = o(void 0), y = o(void 0), O = o(void 0), g = o([]), s = o([]), k = o(void 0), x = o(void 0), d = o(void 0), N = o(void 0), S = o(void 0), T = o(void 0), R = o(void 0), w = o(void 0);
|
|
7
9
|
async function L(e) {
|
|
8
|
-
var
|
|
10
|
+
var n;
|
|
9
11
|
const r = (e == null ? void 0 : e.groupID) || i.value;
|
|
10
12
|
if (!r)
|
|
11
13
|
throw new Error("getGroupMemberList::groupID is required");
|
|
12
|
-
const t = await
|
|
14
|
+
const t = await v.getGroupMemberList({
|
|
13
15
|
groupID: r,
|
|
14
16
|
count: (e == null ? void 0 : e.count) || 100,
|
|
15
17
|
offset: (e == null ? void 0 : e.offset) || 0
|
|
16
18
|
});
|
|
17
|
-
if ((
|
|
18
|
-
const
|
|
19
|
+
if ((n = t == null ? void 0 : t.data) != null && n.memberList) {
|
|
20
|
+
const a = t.data.memberList.map((u) => ({
|
|
19
21
|
userID: u.userID,
|
|
20
22
|
nick: u.nick || u.userID,
|
|
21
23
|
avatar: u.avatar || "",
|
|
@@ -23,18 +25,18 @@ async function L(e) {
|
|
|
23
25
|
joinTime: u.joinTime,
|
|
24
26
|
muteUntil: u.muteUntil || "",
|
|
25
27
|
memberCustomField: u.memberCustomField || ""
|
|
26
|
-
})), c =
|
|
27
|
-
let
|
|
28
|
-
I === 0 ?
|
|
28
|
+
})), c = s.value || [], I = (e == null ? void 0 : e.offset) || 0;
|
|
29
|
+
let l;
|
|
30
|
+
I === 0 ? l = a : (l = [...c], a.forEach((u, _) => {
|
|
29
31
|
const P = I + _;
|
|
30
|
-
P <
|
|
32
|
+
P < l.length ? l[P] = u : l.push(u);
|
|
31
33
|
}));
|
|
32
|
-
const E =
|
|
33
|
-
return E && (
|
|
34
|
+
const E = l.find((u) => u.role === D.OWNER), A = l.filter((u) => u.role === D.ADMIN);
|
|
35
|
+
return E && (O.value = E), g.value = A, s.value = l, l;
|
|
34
36
|
}
|
|
35
37
|
throw new Error("getGroupMemberList::getGroupMemberList failed");
|
|
36
38
|
}
|
|
37
|
-
async function
|
|
39
|
+
async function z(e) {
|
|
38
40
|
const r = e.groupID || i.value;
|
|
39
41
|
if (!r)
|
|
40
42
|
throw new Error("updateGroupProfile::groupID is required");
|
|
@@ -46,7 +48,7 @@ async function X(e) {
|
|
|
46
48
|
throw new Error("updateGroupProfile::name cannot be empty");
|
|
47
49
|
if (e.name.length > 30)
|
|
48
50
|
throw new Error("updateGroupProfile::name must be less than or equal to 25 characters");
|
|
49
|
-
if (e.name ===
|
|
51
|
+
if (e.name === h.value)
|
|
50
52
|
throw new Error("updateGroupProfile::name cannot be the same as current value");
|
|
51
53
|
t.name = e.name;
|
|
52
54
|
}
|
|
@@ -64,7 +66,7 @@ async function X(e) {
|
|
|
64
66
|
throw new Error("updateGroupProfile::notification must be a string");
|
|
65
67
|
if (e.notification.length > 130)
|
|
66
68
|
throw new Error("updateGroupProfile::notification must be less than 100 characters");
|
|
67
|
-
if (e.notification ===
|
|
69
|
+
if (e.notification === m.value)
|
|
68
70
|
throw new Error("updateGroupProfile::notification cannot be the same as current value");
|
|
69
71
|
t.notification = e.notification;
|
|
70
72
|
}
|
|
@@ -73,172 +75,177 @@ async function X(e) {
|
|
|
73
75
|
throw new Error("updateGroupProfile::avatar must be a string");
|
|
74
76
|
if (e.avatar.length > 500)
|
|
75
77
|
throw new Error("updateGroupProfile::avatar must be less than 500 characters");
|
|
76
|
-
if (e.avatar ===
|
|
78
|
+
if (e.avatar === G.value)
|
|
77
79
|
throw new Error("updateGroupProfile::avatar cannot be the same as current value");
|
|
78
80
|
t.avatar = e.avatar;
|
|
79
81
|
}
|
|
80
|
-
|
|
82
|
+
try {
|
|
83
|
+
await v.updateGroupProfile(t);
|
|
84
|
+
} catch (n) {
|
|
85
|
+
throw X(n), n;
|
|
86
|
+
}
|
|
87
|
+
e.name !== void 0 && (h.value = e.name), e.introduction !== void 0 && (M.value = e.introduction), e.notification !== void 0 && (m.value = e.notification), e.avatar !== void 0 && (G.value = e.avatar);
|
|
81
88
|
}
|
|
82
|
-
async function
|
|
89
|
+
async function H(e) {
|
|
83
90
|
const r = e.groupID || i.value;
|
|
84
91
|
if (!r)
|
|
85
92
|
throw new Error("addGroupMember::groupID is required");
|
|
86
|
-
const t = await
|
|
93
|
+
const t = await v.addGroupMember({
|
|
87
94
|
groupID: r,
|
|
88
95
|
userIDList: e.userIDList
|
|
89
96
|
});
|
|
90
97
|
return L({ count: 100 }), t;
|
|
91
98
|
}
|
|
92
|
-
async function
|
|
93
|
-
var
|
|
99
|
+
async function K(e) {
|
|
100
|
+
var a, c;
|
|
94
101
|
const r = e.groupID || i.value;
|
|
95
102
|
if (!r)
|
|
96
103
|
throw new Error("deleteGroupMember::groupID is required");
|
|
97
|
-
await
|
|
104
|
+
await v.deleteGroupMember({
|
|
98
105
|
groupID: r,
|
|
99
106
|
userIDList: e.userIDList
|
|
100
107
|
});
|
|
101
|
-
const t = (
|
|
102
|
-
|
|
108
|
+
const t = (a = s.value) == null ? void 0 : a.filter((I) => !e.userIDList.includes(I.userID)), n = (c = g.value) == null ? void 0 : c.filter((I) => !e.userIDList.includes(I.userID));
|
|
109
|
+
s.value = t, g.value = n;
|
|
103
110
|
}
|
|
104
|
-
async function
|
|
111
|
+
async function Q(e) {
|
|
105
112
|
const r = e.groupID || i.value;
|
|
106
|
-
r && await
|
|
113
|
+
r && await v.changeGroupOwner({
|
|
107
114
|
groupID: r,
|
|
108
115
|
newOwnerID: e.newOwnerID
|
|
109
116
|
});
|
|
110
117
|
}
|
|
111
|
-
async function
|
|
118
|
+
async function Z(e) {
|
|
112
119
|
const r = e.groupID || i.value;
|
|
113
|
-
r && (await
|
|
120
|
+
r && (await v.setGroupMemberRole({
|
|
114
121
|
groupID: r,
|
|
115
122
|
userID: e.userID,
|
|
116
123
|
role: e.role
|
|
117
124
|
}), L({ count: 100 }));
|
|
118
125
|
}
|
|
119
|
-
async function
|
|
126
|
+
async function ee(e) {
|
|
120
127
|
const r = e.groupID || i.value;
|
|
121
|
-
!r || !d.value || (S.value = e.nameCard, await
|
|
128
|
+
!r || !d.value || (S.value = e.nameCard, await v.setGroupMemberNameCard({
|
|
122
129
|
groupID: r,
|
|
123
130
|
userID: e.userID || d.value,
|
|
124
131
|
nameCard: e.nameCard
|
|
125
132
|
}));
|
|
126
133
|
}
|
|
127
|
-
async function
|
|
134
|
+
async function re(e) {
|
|
128
135
|
if (!f.value)
|
|
129
136
|
throw new Error("setChatPinned::currentConversation is required");
|
|
130
|
-
e !== f.value.isPinned && (
|
|
137
|
+
e !== f.value.isPinned && (y.value = e, await f.value.pinConversation());
|
|
131
138
|
}
|
|
132
|
-
async function
|
|
139
|
+
async function oe(e) {
|
|
133
140
|
if (!f.value)
|
|
134
141
|
throw new Error("setChatMuted::currentConversation is required");
|
|
135
142
|
if (e !== f.value.isMuted) {
|
|
136
|
-
|
|
143
|
+
b.value = e;
|
|
137
144
|
try {
|
|
138
145
|
await f.value.muteConversation();
|
|
139
146
|
} catch (r) {
|
|
140
|
-
throw
|
|
147
|
+
throw b.value = !e, r;
|
|
141
148
|
}
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
|
-
async function
|
|
151
|
+
async function te(e) {
|
|
145
152
|
const r = e.groupID || i.value;
|
|
146
153
|
if (!r)
|
|
147
154
|
throw new Error("setGroupMemberMuteTime::groupID is required");
|
|
148
|
-
await
|
|
155
|
+
await v.setGroupMemberMuteTime({
|
|
149
156
|
groupID: r,
|
|
150
157
|
userID: e.userID,
|
|
151
158
|
muteTime: e.time
|
|
152
159
|
}), L({ count: 100 });
|
|
153
160
|
}
|
|
154
|
-
async function
|
|
161
|
+
async function ue(e) {
|
|
155
162
|
if (!i.value)
|
|
156
163
|
throw new Error("setMuteAllMember::groupID is required");
|
|
157
|
-
await
|
|
164
|
+
await v.updateGroupProfile({
|
|
158
165
|
groupID: i.value,
|
|
159
166
|
muteAllMembers: e
|
|
160
167
|
}), T.value = e;
|
|
161
168
|
}
|
|
162
|
-
async function
|
|
169
|
+
async function ie(e) {
|
|
163
170
|
const r = e || i.value;
|
|
164
171
|
if (!r)
|
|
165
172
|
throw new Error("dismissGroup::groupID is required");
|
|
166
|
-
await
|
|
173
|
+
await v.dismissGroup(r);
|
|
167
174
|
}
|
|
168
|
-
async function
|
|
175
|
+
async function ne(e) {
|
|
169
176
|
const r = e || i.value;
|
|
170
177
|
if (!r)
|
|
171
178
|
throw new Error("quitGroup::groupID is required");
|
|
172
|
-
await
|
|
179
|
+
await v.quitGroup(r);
|
|
173
180
|
}
|
|
174
|
-
function
|
|
175
|
-
const
|
|
176
|
-
if (!
|
|
181
|
+
function ae(e, r, t) {
|
|
182
|
+
const n = t || p.value, a = r || N.value || D.COMMON;
|
|
183
|
+
if (!n || !a)
|
|
177
184
|
throw new Error("hasPermission::groupType or userRole is required");
|
|
178
|
-
const c = U[
|
|
185
|
+
const c = U[n][a][e];
|
|
179
186
|
if (typeof c != "boolean")
|
|
180
|
-
throw new Error(`hasPermission::${e}-${
|
|
187
|
+
throw new Error(`hasPermission::${e}-${n}-${a} is not defined`);
|
|
181
188
|
return c;
|
|
182
189
|
}
|
|
183
|
-
function
|
|
184
|
-
if (!d.value || !
|
|
190
|
+
function le(e) {
|
|
191
|
+
if (!d.value || !s.value)
|
|
185
192
|
return !1;
|
|
186
|
-
const r =
|
|
193
|
+
const r = s.value.find((t) => t.userID === d.value);
|
|
187
194
|
return !r || r.userID === e.userID ? !1 : r.role === D.OWNER ? !0 : r.role === D.ADMIN ? e.role === D.COMMON : !1;
|
|
188
195
|
}
|
|
189
|
-
function
|
|
190
|
-
if (!p.value || !d.value || !
|
|
196
|
+
function se() {
|
|
197
|
+
if (!p.value || !d.value || !s.value)
|
|
191
198
|
return [];
|
|
192
|
-
const e =
|
|
199
|
+
const e = s.value.find((r) => r.userID === d.value);
|
|
193
200
|
return e ? U[p.value][e.role] ? Object.keys(U[p.value][e.role]) : [] : [];
|
|
194
201
|
}
|
|
195
|
-
function se() {
|
|
196
|
-
f.value = void 0, i.value = void 0, p.value = void 0, G.value = void 0, h.value = void 0, M.value = void 0, b.value = void 0, m.value = void 0, O.value = void 0, y.value = void 0, g.value = [], l.value = [], k.value = void 0, x.value = void 0, d.value = void 0, N.value = void 0, S.value = void 0, T.value = void 0, C.value = void 0, w.value = void 0;
|
|
197
|
-
}
|
|
198
202
|
function ve() {
|
|
203
|
+
f.value = void 0, i.value = void 0, p.value = void 0, h.value = void 0, G.value = void 0, M.value = void 0, m.value = void 0, b.value = void 0, y.value = void 0, O.value = void 0, g.value = [], s.value = [], k.value = void 0, x.value = void 0, d.value = void 0, N.value = void 0, S.value = void 0, T.value = void 0, R.value = void 0, w.value = void 0;
|
|
204
|
+
}
|
|
205
|
+
function ce() {
|
|
199
206
|
Y.watch(j.CONV, {
|
|
200
207
|
currentConversation: (e) => {
|
|
201
208
|
var r;
|
|
202
209
|
if (e && e.type === "GROUP") {
|
|
203
|
-
((r = f.value) == null ? void 0 : r.conversationID) !== e.conversationID && (
|
|
210
|
+
((r = f.value) == null ? void 0 : r.conversationID) !== e.conversationID && (s.value = void 0, g.value = void 0, O.value = void 0), f.value = e;
|
|
204
211
|
const {
|
|
205
212
|
groupProfile: {
|
|
206
|
-
groupID:
|
|
207
|
-
name:
|
|
213
|
+
groupID: n,
|
|
214
|
+
name: a,
|
|
208
215
|
avatar: c,
|
|
209
216
|
introduction: I,
|
|
210
|
-
muteAllMembers:
|
|
217
|
+
muteAllMembers: l,
|
|
211
218
|
memberCount: E,
|
|
212
219
|
maxMemberCount: A,
|
|
213
220
|
notification: u,
|
|
214
221
|
type: _,
|
|
215
222
|
inviteOption: P,
|
|
216
223
|
selfInfo: {
|
|
217
|
-
role:
|
|
218
|
-
userID:
|
|
219
|
-
nameCard:
|
|
224
|
+
role: W,
|
|
225
|
+
userID: B,
|
|
226
|
+
nameCard: J
|
|
220
227
|
}
|
|
221
228
|
},
|
|
222
229
|
isMuted: $,
|
|
223
230
|
isPinned: V,
|
|
224
231
|
operationType: F
|
|
225
232
|
} = e;
|
|
226
|
-
switch (i.value =
|
|
233
|
+
switch (i.value = n, p.value = _, h.value = a, G.value = c, M.value = I, b.value = $, y.value = V, T.value = l, k.value = E, d.value = B, N.value = W, S.value = J, x.value = A, m.value = u, P) {
|
|
227
234
|
case q.TYPES.JOIN_OPTIONS_FREE_ACCESS:
|
|
228
|
-
w.value =
|
|
235
|
+
w.value = C.FREE_ACCESS;
|
|
229
236
|
break;
|
|
230
237
|
case q.TYPES.JOIN_OPTIONS_NEED_PERMISSION:
|
|
231
|
-
w.value =
|
|
238
|
+
w.value = C.NEED_PERMISSION;
|
|
232
239
|
break;
|
|
233
240
|
case q.TYPES.JOIN_OPTIONS_DISABLE_INVITE:
|
|
234
|
-
w.value =
|
|
241
|
+
w.value = C.DISABLE_APPLY;
|
|
235
242
|
break;
|
|
236
243
|
default:
|
|
237
|
-
w.value =
|
|
244
|
+
w.value = C.DISABLE_APPLY;
|
|
238
245
|
}
|
|
239
|
-
[4, 5, 8].includes(F) ?
|
|
246
|
+
[4, 5, 8].includes(F) ? R.value = !1 : F === 0 && (R.value = !0);
|
|
240
247
|
} else
|
|
241
|
-
|
|
248
|
+
ve();
|
|
242
249
|
}
|
|
243
250
|
}), Y.watch(j.GRP, {
|
|
244
251
|
groupProfile: (e) => {
|
|
@@ -246,53 +253,53 @@ function ve() {
|
|
|
246
253
|
}
|
|
247
254
|
});
|
|
248
255
|
}
|
|
249
|
-
|
|
250
|
-
function
|
|
256
|
+
ce();
|
|
257
|
+
function ge() {
|
|
251
258
|
return {
|
|
252
259
|
// State
|
|
253
260
|
groupID: i,
|
|
254
261
|
groupType: p,
|
|
255
|
-
groupName:
|
|
256
|
-
avatar:
|
|
262
|
+
groupName: h,
|
|
263
|
+
avatar: G,
|
|
257
264
|
introduction: M,
|
|
258
|
-
notification:
|
|
259
|
-
isMuted:
|
|
260
|
-
isPinned:
|
|
261
|
-
groupOwner:
|
|
265
|
+
notification: m,
|
|
266
|
+
isMuted: b,
|
|
267
|
+
isPinned: y,
|
|
268
|
+
groupOwner: O,
|
|
262
269
|
adminMembers: g,
|
|
263
|
-
allMembers:
|
|
270
|
+
allMembers: s,
|
|
264
271
|
memberCount: k,
|
|
265
272
|
maxMemberCount: x,
|
|
266
273
|
currentUserID: d,
|
|
267
274
|
currentUserRole: N,
|
|
268
275
|
nameCard: S,
|
|
269
276
|
isMuteAllMembers: T,
|
|
270
|
-
isInGroup:
|
|
277
|
+
isInGroup: R,
|
|
271
278
|
inviteOption: w,
|
|
272
279
|
// Permission utilities
|
|
273
|
-
hasPermission:
|
|
274
|
-
canOperateOnMember:
|
|
275
|
-
getAvailablePermissions:
|
|
280
|
+
hasPermission: ae,
|
|
281
|
+
canOperateOnMember: le,
|
|
282
|
+
getAvailablePermissions: se,
|
|
276
283
|
// Business actions
|
|
277
284
|
getGroupMemberList: L,
|
|
278
|
-
updateGroupProfile:
|
|
279
|
-
addGroupMember:
|
|
280
|
-
deleteGroupMember:
|
|
281
|
-
changeGroupOwner:
|
|
282
|
-
setGroupMemberRole:
|
|
283
|
-
setGroupMemberNameCard:
|
|
284
|
-
setChatPinned:
|
|
285
|
-
setChatMuted:
|
|
286
|
-
setGroupMemberMuteTime:
|
|
287
|
-
setMuteAllMember:
|
|
288
|
-
dismissGroup:
|
|
289
|
-
quitGroup:
|
|
285
|
+
updateGroupProfile: z,
|
|
286
|
+
addGroupMember: H,
|
|
287
|
+
deleteGroupMember: K,
|
|
288
|
+
changeGroupOwner: Q,
|
|
289
|
+
setGroupMemberRole: Z,
|
|
290
|
+
setGroupMemberNameCard: ee,
|
|
291
|
+
setChatPinned: re,
|
|
292
|
+
setChatMuted: oe,
|
|
293
|
+
setGroupMemberMuteTime: te,
|
|
294
|
+
setMuteAllMember: ue,
|
|
295
|
+
dismissGroup: ie,
|
|
296
|
+
quitGroup: ne
|
|
290
297
|
};
|
|
291
298
|
}
|
|
292
299
|
export {
|
|
293
|
-
|
|
300
|
+
C as GroupInviteType,
|
|
294
301
|
D as GroupMemberRole,
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
302
|
+
Me as GroupPermission,
|
|
303
|
+
me as GroupType,
|
|
304
|
+
ge as useGroupSettingState
|
|
298
305
|
};
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { TUILogin as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { userId:
|
|
9
|
-
SDKAppID:
|
|
10
|
-
userID:
|
|
11
|
-
userSig:
|
|
1
|
+
import { ref as f } from "vue";
|
|
2
|
+
import { TUILogin as c } from "@tencentcloud/tui-core";
|
|
3
|
+
import "../components/UIKitModal/chatErrorModal/index.js";
|
|
4
|
+
import { useStatistical as I } from "../statistical/statistical.js";
|
|
5
|
+
import { handleChatErrorWithModal as d, showChatErrorModalById as i, ChatErrorModalId as u } from "../components/UIKitModal/chatErrorModal/chatErrorModal.js";
|
|
6
|
+
const s = f(null), { getChatScene: g } = I();
|
|
7
|
+
async function m(t) {
|
|
8
|
+
const { userId: a, userSig: r, sdkAppId: e, ...o } = t, l = {
|
|
9
|
+
SDKAppID: e,
|
|
10
|
+
userID: a,
|
|
11
|
+
userSig: r,
|
|
12
12
|
useUploadPlugin: !0,
|
|
13
|
-
scene:
|
|
14
|
-
...
|
|
13
|
+
scene: g(),
|
|
14
|
+
...o
|
|
15
15
|
};
|
|
16
16
|
try {
|
|
17
|
-
await
|
|
18
|
-
} catch (
|
|
19
|
-
throw
|
|
17
|
+
await c.login(l);
|
|
18
|
+
} catch (n) {
|
|
19
|
+
throw d(n) || (a ? r ? e || i(u.LOGIN_INVALID_SDK_APP_ID) : i(u.LOGIN_INVALID_USER_SIG) : i(u.LOGIN_INVALID_USER_ID)), n;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
async function
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
key:
|
|
31
|
-
value: (
|
|
22
|
+
async function h(t) {
|
|
23
|
+
const a = s.value || {}, { chat: r } = c.getContext();
|
|
24
|
+
if (r) {
|
|
25
|
+
const e = [];
|
|
26
|
+
t.customInfo && Object.keys(t.customInfo).forEach((o) => {
|
|
27
|
+
var n;
|
|
28
|
+
let l = o;
|
|
29
|
+
o.includes("Tag_Profile_Custom") || (l = `Tag_Profile_Custom_${o}`), e.push({
|
|
30
|
+
key: l,
|
|
31
|
+
value: (n = t.customInfo) == null ? void 0 : n[o]
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
nick:
|
|
37
|
-
avatar:
|
|
38
|
-
profileCustomField:
|
|
35
|
+
const o = await r.updateMyProfile({
|
|
36
|
+
nick: t.userName,
|
|
37
|
+
avatar: t.avatarUrl,
|
|
38
|
+
profileCustomField: e
|
|
39
39
|
});
|
|
40
40
|
return s.value = {
|
|
41
|
-
...
|
|
42
|
-
...
|
|
43
|
-
},
|
|
44
|
-
} catch (
|
|
45
|
-
throw console.error("[loginState setSelfInfo] error",
|
|
41
|
+
...a,
|
|
42
|
+
...t
|
|
43
|
+
}, o;
|
|
44
|
+
} catch (o) {
|
|
45
|
+
throw console.error("[loginState setSelfInfo] error", o), o;
|
|
46
46
|
}
|
|
47
47
|
} else
|
|
48
48
|
throw Error("[loginState setSelfInfo] not login");
|
|
49
49
|
}
|
|
50
|
-
async function
|
|
51
|
-
s.value = null,
|
|
50
|
+
async function _() {
|
|
51
|
+
s.value = null, c.logout();
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function E() {
|
|
54
54
|
return {
|
|
55
55
|
loginUserInfo: s,
|
|
56
|
-
login:
|
|
57
|
-
logout:
|
|
58
|
-
setSelfInfo:
|
|
56
|
+
login: m,
|
|
57
|
+
logout: _,
|
|
58
|
+
setSelfInfo: h
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
E as default,
|
|
63
|
+
E as useLoginState
|
|
64
64
|
};
|