tuikit-atomicx-vue3 4.5.2 → 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.
@@ -29,6 +29,7 @@ declare class RoomManager {
29
29
  private onRoomUserCountChanged;
30
30
  private onConferenceInfoChanged;
31
31
  private onKickedOutOfRoom;
32
+ private onConferenceDidCancelled;
32
33
  private bindEvent;
33
34
  }
34
35
  export default RoomManager;
@@ -1,47 +1,49 @@
1
- var U = Object.defineProperty;
2
- var A = (t, e, o) => e in t ? U(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var g = (t, e, o) => A(t, typeof e != "symbol" ? e + "" : e, o);
4
- import v, { TUIRoomType as d, TUIRoomEvents as r, TUIConferenceListManagerEvents as D } from "@tencentcloud/tuiroom-engine-js";
5
- import { useRoomEngine as I } from "../../hooks/useRoomEngine.js";
6
- import { isUndefined as b } from "../../utils/utils.js";
7
- import { useLoginState as p } from "../LoginState.js";
8
- import { transferTUIRoomInfoToRoomInfo as c } from "./common.js";
9
- import { useRoomStore as S } from "./store.js";
10
- const { loginUserInfo: w } = p(), s = I(), { currentRoom: n } = S(), l = class l {
1
+ var v = Object.defineProperty;
2
+ var A = (d, e, o) => e in d ? v(d, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : d[e] = o;
3
+ var g = (d, e, o) => A(d, typeof e != "symbol" ? e + "" : e, o);
4
+ import D, { TUIRoomType as c, TUIConferenceCancelReason as I, TUIConferenceListManagerEvents as b, TUIRoomEvents as t } from "@tencentcloud/tuiroom-engine-js";
5
+ import { useRoomEngine as p } from "../../hooks/useRoomEngine.js";
6
+ import { eventCenter as S } from "../../utils/eventCenter.js";
7
+ import { isUndefined as R } from "../../utils/utils.js";
8
+ import { useLoginState as w } from "../LoginState.js";
9
+ import { transferTUIRoomInfoToRoomInfo as h, roomInfoTransfer as y } from "./common.js";
10
+ import { useRoomStore as T } from "./store.js";
11
+ import { RoomEvent as N } from "../../types/room.js";
12
+ const { loginUserInfo: M } = w(), s = p(), { currentRoom: n } = T(), m = class m {
11
13
  constructor() {
12
14
  this.onRoomNameChanged = this.onRoomNameChanged.bind(this), this.onAllUserCameraDisableChanged = this.onAllUserCameraDisableChanged.bind(this), this.onScreenShareForAllUserDisableChanged = this.onScreenShareForAllUserDisableChanged.bind(this), this.onAllUserMicrophoneDisableChanged = this.onAllUserMicrophoneDisableChanged.bind(this), this.onAllUserMessageDisableChanged = this.onAllUserMessageDisableChanged.bind(this), this.onRoomUserCountChanged = this.onRoomUserCountChanged.bind(this), this.onKickedOutOfRoom = this.onKickedOutOfRoom.bind(this), this.bindEvent();
13
15
  }
14
16
  static getInstance() {
15
- return l.instance || (l.instance = new l()), l.instance;
17
+ return m.instance || (m.instance = new m()), m.instance;
16
18
  }
17
19
  async createAndJoinRoom({ roomId: e, options: o }) {
18
- var i, m, h;
19
- if (!((i = w.value) != null && i.userId) || !s.instance)
20
+ var i, l, r;
21
+ if (!((i = M.value) != null && i.userId) || !s.instance)
20
22
  throw new Error("please login firstly by useLoginState");
21
- await ((m = s.instance) == null ? void 0 : m.createRoom({
23
+ await ((l = s.instance) == null ? void 0 : l.createRoom({
22
24
  roomId: e,
23
25
  roomName: o.roomName,
24
- roomType: d.kConference,
26
+ roomType: c.kConference,
25
27
  password: o.password || "",
26
28
  isMicrophoneDisableForAllUser: o.isAllMicrophoneDisabled,
27
29
  isScreenShareDisableForAllUser: o.isAllScreenShareDisabled,
28
30
  isCameraDisableForAllUser: o.isAllCameraDisabled,
29
31
  isMessageDisableForAllUser: o.isAllMessageDisabled
30
32
  }));
31
- const a = await ((h = s.instance) == null ? void 0 : h.enterRoom({
33
+ const a = await ((r = s.instance) == null ? void 0 : r.enterRoom({
32
34
  roomId: e,
33
- roomType: d.kConference
35
+ roomType: c.kConference
34
36
  }));
35
- a && (n.value = c(a));
37
+ a && (n.value = h(a));
36
38
  }
37
39
  async joinRoom({ roomId: e, password: o }) {
38
40
  var i;
39
41
  const a = await ((i = s.instance) == null ? void 0 : i.enterRoom({
40
42
  roomId: e,
41
- roomType: d.kConference,
43
+ roomType: c.kConference,
42
44
  options: { password: o }
43
45
  }));
44
- a && (n.value = c(a));
46
+ a && (n.value = h(a));
45
47
  }
46
48
  async leaveRoom() {
47
49
  var e;
@@ -53,14 +55,14 @@ const { loginUserInfo: w } = p(), s = I(), { currentRoom: n } = S(), l = class l
53
55
  }
54
56
  async getRoomInfo({ roomId: e }) {
55
57
  var a;
56
- const o = await ((a = s.instance) == null ? void 0 : a.fetchRoomInfo({ roomId: e, roomType: d.kConference }));
58
+ const o = await ((a = s.instance) == null ? void 0 : a.fetchRoomInfo({ roomId: e, roomType: c.kConference }));
57
59
  if (!o)
58
60
  throw new Error("roomInfo is undefined");
59
- return c(o);
61
+ return h(o);
60
62
  }
61
63
  async updateRoomInfo({ options: e }) {
62
64
  var o, a;
63
- b(e.roomName) || await ((o = s.instance) == null ? void 0 : o.updateRoomNameByAdmin({ roomName: e.roomName || "" })), b(e.password) || await ((a = s.instance) == null ? void 0 : a.updateRoomPasswordByAdmin({ password: e.password || "" }));
65
+ R(e.roomName) || await ((o = s.instance) == null ? void 0 : o.updateRoomNameByAdmin({ roomName: e.roomName || "" })), R(e.password) || await ((a = s.instance) == null ? void 0 : a.updateRoomPasswordByAdmin({ password: e.password || "" }));
64
66
  }
65
67
  onRoomNameChanged({ roomId: e, roomName: o }) {
66
68
  var a;
@@ -108,16 +110,23 @@ const { loginUserInfo: w } = p(), s = I(), { currentRoom: n } = S(), l = class l
108
110
  var o;
109
111
  e === ((o = n.value) == null ? void 0 : o.roomId) && (n.value = null);
110
112
  }
113
+ onConferenceDidCancelled({ conferenceInfo: e, reason: o, operateUser: a }) {
114
+ var r;
115
+ const { roomId: i } = e.basicRoomInfo, l = y.transferConferenceInfoToRoomInfo(e);
116
+ i === ((r = n.value) == null ? void 0 : r.roomId) && o === I.kConferenceCancelReasonCancelledByAdmin && (n.value = null, S.emit(N.onRoomEnded, {
117
+ roomInfo: l
118
+ }));
119
+ }
111
120
  bindEvent() {
112
- v.once("ready", () => {
113
- var o, a, i, m, h, u, C, f;
121
+ D.once("ready", () => {
122
+ var o, a, i, l, r, C, f, u;
114
123
  const e = (o = s.instance) == null ? void 0 : o.getConferenceListManager();
115
- (a = s.instance) == null || a.on(r.onRoomNameChanged, this.onRoomNameChanged), e == null || e.on(D.onConferenceInfoChanged, this.onConferenceInfoChanged), (i = s.instance) == null || i.on(r.onKickedOutOfRoom, this.onKickedOutOfRoom), (m = s.instance) == null || m.on(r.onRoomUserCountChanged, this.onRoomUserCountChanged), (h = s.instance) == null || h.on(r.onAllUserCameraDisableChanged, this.onAllUserCameraDisableChanged), (u = s.instance) == null || u.on(r.onScreenShareForAllUserDisableChanged, this.onScreenShareForAllUserDisableChanged), (C = s.instance) == null || C.on(r.onAllUserMicrophoneDisableChanged, this.onAllUserMicrophoneDisableChanged), (f = s.instance) == null || f.on(r.onSendMessageForAllUserDisableChanged, this.onAllUserMessageDisableChanged);
124
+ e == null || e.on(b.onConferenceDidCancelled, this.onConferenceDidCancelled), e == null || e.on(b.onConferenceInfoChanged, this.onConferenceInfoChanged), (a = s.instance) == null || a.on(t.onRoomNameChanged, this.onRoomNameChanged), (i = s.instance) == null || i.on(t.onKickedOutOfRoom, this.onKickedOutOfRoom), (l = s.instance) == null || l.on(t.onRoomUserCountChanged, this.onRoomUserCountChanged), (r = s.instance) == null || r.on(t.onAllUserCameraDisableChanged, this.onAllUserCameraDisableChanged), (C = s.instance) == null || C.on(t.onScreenShareForAllUserDisableChanged, this.onScreenShareForAllUserDisableChanged), (f = s.instance) == null || f.on(t.onAllUserMicrophoneDisableChanged, this.onAllUserMicrophoneDisableChanged), (u = s.instance) == null || u.on(t.onSendMessageForAllUserDisableChanged, this.onAllUserMessageDisableChanged);
116
125
  });
117
126
  }
118
127
  };
119
- g(l, "instance");
120
- let R = l;
128
+ g(m, "instance");
129
+ let U = m;
121
130
  export {
122
- R as default
131
+ U as default
123
132
  };
@@ -1,13 +1,13 @@
1
1
  var g = Object.defineProperty;
2
2
  var p = (h, e, n) => e in h ? g(h, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : h[e] = n;
3
- var T = (h, e, n) => p(h, typeof e != "symbol" ? e + "" : e, n);
4
- import y, { TUIRoomType as E, TUIConferenceCancelReason as v, TUIConferenceListManagerEvents as f } from "@tencentcloud/tuiroom-engine-js";
5
- import { useRoomEngine as w } from "../../hooks/useRoomEngine.js";
6
- import { eventCenter as S } from "../../utils/eventCenter.js";
3
+ var v = (h, e, n) => p(h, typeof e != "symbol" ? e + "" : e, n);
4
+ import w, { TUIRoomType as y, TUIConferenceCancelReason as A, TUIConferenceListManagerEvents as f } from "@tencentcloud/tuiroom-engine-js";
5
+ import { useRoomEngine as E } from "../../hooks/useRoomEngine.js";
6
+ import { eventCenter as I } from "../../utils/eventCenter.js";
7
7
  import { roomInfoTransfer as a } from "./common.js";
8
8
  import { useRoomStore as D } from "./store.js";
9
- import { RoomEvent as I } from "../../types/room.js";
10
- const { scheduledRoomList: d, scheduledRoomListCursor: x, currentRoom: A } = D(), c = w(), l = class l {
9
+ import { RoomEvent as R } from "../../types/room.js";
10
+ const { scheduledRoomList: d, scheduledRoomListCursor: x, currentRoom: T } = D(), c = E(), l = class l {
11
11
  constructor() {
12
12
  this.onConferenceScheduled = this.onConferenceScheduled.bind(this), this.onConferenceWillStart = this.onConferenceWillStart.bind(this), this.onConferenceDidCancelled = this.onConferenceDidCancelled.bind(this), this.onConferenceInfoChanged = this.onConferenceInfoChanged.bind(this), this.onScheduleAttendeesUpdated = this.onScheduleAttendeesUpdated.bind(this), this.onConferenceStatusUpdated = this.onConferenceStatusUpdated.bind(this), this.bindEvent();
13
13
  }
@@ -24,11 +24,11 @@ const { scheduledRoomList: d, scheduledRoomListCursor: x, currentRoom: A } = D()
24
24
  cursor: e,
25
25
  count: 20
26
26
  }), i = ((s == null ? void 0 : s.conferenceList) || []).map((r) => a.transferConferenceInfoToRoomInfo(r)).reduce((r, u) => {
27
- const R = r.findIndex((b) => b.roomId === u.roomId);
28
- return R === -1 ? r.push(u) : r[R] = u, r;
27
+ const S = r.findIndex((b) => b.roomId === u.roomId);
28
+ return S === -1 ? r.push(u) : r[S] = u, r;
29
29
  }, []);
30
30
  e === "" && (d.value = []), i.forEach((r) => {
31
- const u = d.value.findIndex((R) => R.roomId === r.roomId);
31
+ const u = d.value.findIndex((S) => S.roomId === r.roomId);
32
32
  u !== -1 ? d.value[u] = r : d.value.push(r);
33
33
  });
34
34
  const C = (s == null ? void 0 : s.cursor) || "";
@@ -46,7 +46,7 @@ const { scheduledRoomList: d, scheduledRoomListCursor: x, currentRoom: A } = D()
46
46
  await (o == null ? void 0 : o.scheduleConference({
47
47
  roomId: e,
48
48
  roomName: n.roomName,
49
- roomType: E.kConference,
49
+ roomType: y.kConference,
50
50
  scheduleStartTime: n.scheduleStartTime,
51
51
  scheduleEndTime: n.scheduleEndTime,
52
52
  reminderSecondsBeforeStart: n.reminderSecondsBeforeStart,
@@ -111,7 +111,7 @@ const { scheduledRoomList: d, scheduledRoomListCursor: x, currentRoom: A } = D()
111
111
  // TODO: 缺少 operateUser 的数据,xxx 邀请我加入 xxx 的会议, 需要确认
112
112
  async onConferenceScheduled({ conferenceInfo: e }) {
113
113
  const { roomId: n } = e.basicRoomInfo, o = d.value.findIndex((s) => s.roomId === n), t = a.transferConferenceInfoToRoomInfo(e);
114
- o !== -1 ? d.value[o] = t : d.value.push(t), S.emit(I.onAddedToScheduledRoom, { roomInfo: t });
114
+ o !== -1 ? d.value[o] = t : d.value.push(t), I.emit(R.onAddedToScheduledRoom, { roomInfo: t });
115
115
  }
116
116
  onConferenceInfoChanged({ conferenceModifyInfo: e }) {
117
117
  const { roomId: n } = e.basicRoomInfo, o = d.value.findIndex((t) => t.roomId === n);
@@ -132,42 +132,36 @@ const { scheduledRoomList: d, scheduledRoomListCursor: x, currentRoom: A } = D()
132
132
  onScheduleAttendeesUpdated(e) {
133
133
  }
134
134
  onConferenceDidCancelled({ conferenceInfo: e, reason: n, operateUser: o }) {
135
- var m, i, C;
135
+ var m, i;
136
136
  const { roomId: t } = e.basicRoomInfo;
137
- d.value = d.value.filter((r) => r.roomId !== t);
137
+ d.value = d.value.filter((C) => C.roomId !== t);
138
138
  const s = a.transferConferenceInfoToRoomInfo(e);
139
- if (t === ((m = A.value) == null ? void 0 : m.roomId) && n === v.kConferenceCancelReasonCancelledByAdmin) {
140
- S.emit(I.onRoomEnded, {
141
- roomInfo: s
142
- });
143
- return;
144
- }
145
- if (t !== ((i = A.value) == null ? void 0 : i.roomId) && n === v.kConferenceCancelReasonCancelledByAdmin) {
146
- S.emit(I.onScheduledRoomCancelled, {
139
+ if (t !== ((m = T.value) == null ? void 0 : m.roomId) && n === A.kConferenceCancelReasonCancelledByAdmin) {
140
+ I.emit(R.onScheduledRoomCancelled, {
147
141
  roomInfo: s,
148
142
  operator: a.transferTUIUserInfoToRoomUser(o)
149
143
  });
150
144
  return;
151
145
  }
152
- t !== ((C = A.value) == null ? void 0 : C.roomId) && n === v.kConferenceCancelReasonRemovedFromAttendees && S.emit(I.onRemovedFromScheduledRoom, {
146
+ t !== ((i = T.value) == null ? void 0 : i.roomId) && n === A.kConferenceCancelReasonRemovedFromAttendees && I.emit(R.onRemovedFromScheduledRoom, {
153
147
  roomInfo: s,
154
148
  operator: a.transferTUIUserInfoToRoomUser(o)
155
149
  });
156
150
  }
157
151
  onConferenceWillStart({ conferenceInfo: e }) {
158
- S.emit(I.onScheduledRoomStartingSoon, {
152
+ I.emit(R.onScheduledRoomStartingSoon, {
159
153
  roomInfo: a.transferConferenceInfoToRoomInfo(e)
160
154
  });
161
155
  }
162
156
  bindEvent() {
163
- y.once("ready", () => {
157
+ w.once("ready", () => {
164
158
  var n;
165
159
  const e = (n = c.instance) == null ? void 0 : n.getConferenceListManager();
166
160
  e == null || e.on(f.onConferenceScheduled, this.onConferenceScheduled), e == null || e.on(f.onConferenceWillStart, this.onConferenceWillStart), e == null || e.on(f.onConferenceDidCancelled, this.onConferenceDidCancelled), e == null || e.on(f.onConferenceInfoChanged, this.onConferenceInfoChanged), e == null || e.on(f.onScheduleAttendeesUpdated, this.onScheduleAttendeesUpdated), e == null || e.on(f.onConferenceStatusUpdated, this.onConferenceStatusUpdated);
167
161
  });
168
162
  }
169
163
  };
170
- T(l, "instance");
164
+ v(l, "instance");
171
165
  let U = l;
172
166
  export {
173
167
  U as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuikit-atomicx-vue3",
3
- "version": "4.5.2",
3
+ "version": "4.5.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",