tuikit-atomicx-vue3 3.4.1 → 3.4.2
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/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
- package/dist/components/BarrageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/CoHostPanel/BattlePanel.js +16 -16
- package/dist/components/CoHostPanel/CoHostPanel.js +60 -55
- package/dist/components/CoHostPanel/ConnectionPanel.js +42 -42
- package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleDecorate.js +1 -1
- package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleUserDecorate.js +56 -49
- package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/CoHostDecorate.js +1 -1
- package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/LiveCoreDecorate.js +1 -1
- package/dist/components/{LiveCoreView → LiveView}/DefaultStreamViewUI.js +7 -7
- package/dist/components/{LiveCoreView → LiveView}/PlayerControl/AudioControl.js +16 -16
- package/dist/components/{LiveCoreView → LiveView}/PlayerControl/MultiResolution.js +15 -15
- package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.js +1 -1
- package/dist/components/{LiveCoreView/i18n/zh-CN → LiveView/i18n/en-US}/index.d.ts +1 -0
- package/dist/components/{LiveCoreView → LiveView}/i18n/en-US/index.js +2 -1
- package/dist/components/{LiveCoreView/i18n/en-US → LiveView/i18n/zh-CN}/index.d.ts +1 -0
- package/dist/components/{LiveCoreView → LiveView}/i18n/zh-CN/index.js +2 -1
- package/dist/components/LiveView/index.d.ts +79 -0
- package/dist/components/{LiveCoreView → LiveView}/index.js +44 -42
- package/dist/components/MessageInput/TextEditor/EditorCore.js +2 -2
- package/dist/components/StreamMixer/index.js +6 -6
- package/dist/{index-D-KJvDvy.js → index-Bm-QfV5o.js} +1 -1
- package/dist/{index-D88ja_7_.js → index-D2OVtqc8.js} +1705 -1705
- package/dist/index.js +140 -138
- package/dist/rtc/index.d.ts +2 -39
- package/dist/rtc/index.js +49 -48
- package/dist/states/BattleState.js +48 -48
- package/dist/styles/index.css +1 -1
- package/package.json +2 -2
- package/src/components/CoHostPanel/BattlePanel.vue +3 -3
- package/src/components/CoHostPanel/CoHostPanel.vue +11 -3
- package/src/components/CoHostPanel/ConnectionPanel.vue +4 -4
- package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleUserDecorate.vue +28 -29
- package/src/components/{LiveCoreView → LiveView}/i18n/en-US/index.ts +1 -0
- package/src/components/{LiveCoreView → LiveView}/i18n/zh-CN/index.ts +1 -0
- package/src/components/{LiveCoreView → LiveView}/index.ts +5 -2
- package/src/components/{LiveCoreView → LiveView}/index.vue +1 -1
- package/src/components/StreamMixer/index.vue +1 -1
- package/src/rtc/index.ts +2 -2
- package/dist/components/LiveCoreView/index.d.ts +0 -4
- /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleDecorate.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleUserDecorate.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/CoHostDecorate.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/CoreViewDecorate/LiveCoreDecorate.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/DefaultStreamViewUI.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/AudioControl.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/MultiResolution.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.vue.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControlState.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControlState.js +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/index.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/index.js +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/deviceDetection.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/deviceDetection.js +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/domHelpers.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/domHelpers.js +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/fullscreenManager.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/PlayerControl/utils/fullscreenManager.js +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/i18n/index.d.ts +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/i18n/index.js +0 -0
- /package/dist/components/{LiveCoreView → LiveView}/index.vue.d.ts +0 -0
- /package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/BattleDecorate.vue +0 -0
- /package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/CoHostDecorate.vue +0 -0
- /package/src/components/{LiveCoreView → LiveView}/CoreViewDecorate/LiveCoreDecorate.vue +0 -0
- /package/src/components/{LiveCoreView → LiveView}/DefaultStreamViewUI.vue +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/AudioControl.vue +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/MultiResolution.vue +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.module.scss +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControl.vue +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/PlayerControlState.ts +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/index.ts +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/utils/deviceDetection.ts +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/utils/domHelpers.ts +0 -0
- /package/src/components/{LiveCoreView → LiveView}/PlayerControl/utils/fullscreenManager.ts +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/img/defeat.png +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/img/draw.png +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/img/victory.png +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/svg/BattleOrdinaryBadge.svg +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/svg/BattleTopBadge.svg +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/svg/blueBkg.svg +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/svg/redBkg.svg +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/svg/s.svg +0 -0
- /package/src/components/{LiveCoreView → LiveView}/assets/svg/v.svg +0 -0
- /package/src/components/{LiveCoreView → LiveView}/i18n/index.ts +0 -0
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ref as
|
|
3
|
-
import { useRoomEngine as
|
|
4
|
-
import { useLiveState as
|
|
5
|
-
import { DeviceStatusReason as l, DeviceStatus as
|
|
6
|
-
const s =
|
|
1
|
+
import f, { TUILiveBattleManagerEvents as c } from "@tencentcloud/tuiroom-engine-js";
|
|
2
|
+
import { ref as i, watch as v } from "vue";
|
|
3
|
+
import { useRoomEngine as S } from "../hooks/useRoomEngine.js";
|
|
4
|
+
import { useLiveState as g } from "./LiveState/index.js";
|
|
5
|
+
import { DeviceStatusReason as l, DeviceStatus as u } from "../types/device.js";
|
|
6
|
+
const s = S(), { currentLive: h } = g(), m = (e) => ({
|
|
7
7
|
liveId: e.roomId,
|
|
8
8
|
userId: e.userId,
|
|
9
9
|
userName: e.userName,
|
|
10
10
|
avatarUrl: e.avatarUrl,
|
|
11
|
-
microphoneStatus:
|
|
11
|
+
microphoneStatus: u.Off,
|
|
12
12
|
microphoneStatusReason: l.ChangedBySelf,
|
|
13
|
-
cameraStatus:
|
|
13
|
+
cameraStatus: u.Off,
|
|
14
14
|
cameraStatusReason: l.ChangedBySelf
|
|
15
|
-
}),
|
|
15
|
+
}), d = i(), r = i([]), o = i(/* @__PURE__ */ new Map()), p = (e, t) => {
|
|
16
16
|
var n;
|
|
17
17
|
const a = (n = s.instance) == null ? void 0 : n.getLiveBattleManager();
|
|
18
18
|
a == null || a.on(e, t);
|
|
19
|
-
},
|
|
19
|
+
}, I = (e, t) => {
|
|
20
20
|
var n;
|
|
21
21
|
const a = (n = s.instance) == null ? void 0 : n.getLiveBattleManager();
|
|
22
22
|
a == null || a.off(e, t);
|
|
23
|
-
},
|
|
23
|
+
}, b = (e) => {
|
|
24
24
|
var a;
|
|
25
25
|
const t = (a = s.instance) == null ? void 0 : a.getLiveBattleManager();
|
|
26
26
|
return t == null ? void 0 : t.requestBattle(e);
|
|
27
|
-
},
|
|
27
|
+
}, U = (e) => {
|
|
28
28
|
var a;
|
|
29
29
|
const t = (a = s.instance) == null ? void 0 : a.getLiveBattleManager();
|
|
30
30
|
return t == null ? void 0 : t.cancelBattleRequest(e);
|
|
31
|
-
},
|
|
31
|
+
}, E = (e) => {
|
|
32
32
|
var a;
|
|
33
33
|
const t = (a = s.instance) == null ? void 0 : a.getLiveBattleManager();
|
|
34
34
|
return t == null ? void 0 : t.acceptBattle(e);
|
|
35
|
-
},
|
|
35
|
+
}, L = (e) => {
|
|
36
36
|
var a;
|
|
37
37
|
const t = (a = s.instance) == null ? void 0 : a.getLiveBattleManager();
|
|
38
38
|
return t == null ? void 0 : t.rejectBattle(e);
|
|
39
|
-
}, L = (e) => {
|
|
40
|
-
var n;
|
|
41
|
-
const t = (n = s.instance) == null ? void 0 : n.getLiveBattleManager(), a = t == null ? void 0 : t.exitBattle(e);
|
|
42
|
-
return u.value = void 0, a;
|
|
43
39
|
}, R = (e) => {
|
|
44
|
-
|
|
40
|
+
var n;
|
|
41
|
+
const t = (n = s.instance) == null ? void 0 : n.getLiveBattleManager();
|
|
42
|
+
return t == null ? void 0 : t.exitBattle(e);
|
|
43
|
+
}, B = () => {
|
|
44
|
+
d.value = void 0, r.value = [], o.value = /* @__PURE__ */ new Map();
|
|
45
45
|
}, x = (e) => {
|
|
46
|
-
|
|
46
|
+
B();
|
|
47
47
|
}, T = (e) => {
|
|
48
|
-
|
|
48
|
+
o.value = new Map(e.battleUserList.map((t) => [t.userId, t.score]));
|
|
49
|
+
}, C = (e) => {
|
|
50
|
+
d.value = {
|
|
49
51
|
battleId: e.battleInfo.battleId,
|
|
50
52
|
config: {
|
|
51
53
|
duration: e.battleInfo.duration,
|
|
@@ -59,57 +61,55 @@ const s = B(), { currentLive: g } = S(), m = (e) => ({
|
|
|
59
61
|
o.value.set(t.userId, t.score), a.forEach((n) => {
|
|
60
62
|
o.value.set(n.userId, n.score);
|
|
61
63
|
}), r.value = [m(t), ...a.map((n) => m(n))];
|
|
62
|
-
},
|
|
64
|
+
}, y = (e) => {
|
|
63
65
|
var t;
|
|
64
66
|
r.value.length <= 2 || (r.value = (t = r.value) == null ? void 0 : t.filter((a) => a.userId !== e.user.userId), o.value.delete(e.user.userId));
|
|
65
|
-
},
|
|
67
|
+
}, q = (e) => {
|
|
66
68
|
var t;
|
|
67
69
|
(t = r.value) == null || t.push({
|
|
68
70
|
liveId: e.user.roomId,
|
|
69
71
|
userId: e.user.userId,
|
|
70
72
|
userName: e.user.userName,
|
|
71
73
|
avatarUrl: e.user.avatarUrl,
|
|
72
|
-
microphoneStatus:
|
|
74
|
+
microphoneStatus: u.Off,
|
|
73
75
|
microphoneStatusReason: l.ChangedBySelf,
|
|
74
|
-
cameraStatus:
|
|
76
|
+
cameraStatus: u.Off,
|
|
75
77
|
cameraStatusReason: l.ChangedBySelf
|
|
76
78
|
}), o.value.set(e.user.userId, e.user.score);
|
|
77
|
-
},
|
|
78
|
-
{ event: c.onBattleEnded, handler:
|
|
79
|
-
{ event: c.onBattleScoreChanged, handler:
|
|
80
|
-
{ event: c.onBattleStarted, handler:
|
|
81
|
-
{ event: c.onUserExitBattle, handler:
|
|
82
|
-
{ event: c.onUserJoinBattle, handler:
|
|
83
|
-
],
|
|
84
|
-
|
|
79
|
+
}, w = [
|
|
80
|
+
{ event: c.onBattleEnded, handler: x },
|
|
81
|
+
{ event: c.onBattleScoreChanged, handler: T },
|
|
82
|
+
{ event: c.onBattleStarted, handler: C },
|
|
83
|
+
{ event: c.onUserExitBattle, handler: y },
|
|
84
|
+
{ event: c.onUserJoinBattle, handler: q }
|
|
85
|
+
], M = () => {
|
|
86
|
+
w.forEach(({ event: e, handler: t }) => {
|
|
85
87
|
var n;
|
|
86
88
|
const a = (n = s.instance) == null ? void 0 : n.getLiveBattleManager();
|
|
87
89
|
a == null || a.on(e, t);
|
|
88
90
|
});
|
|
89
|
-
}, M = () => {
|
|
90
|
-
u.value = void 0, r.value = [], o.value = /* @__PURE__ */ new Map();
|
|
91
91
|
};
|
|
92
|
-
|
|
92
|
+
v(() => {
|
|
93
93
|
var e;
|
|
94
|
-
return (e =
|
|
94
|
+
return (e = h.value) == null ? void 0 : e.liveId;
|
|
95
95
|
}, (e) => {
|
|
96
|
-
e ||
|
|
96
|
+
e || B();
|
|
97
97
|
});
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
f.once("ready", () => {
|
|
99
|
+
M();
|
|
100
100
|
});
|
|
101
101
|
function k() {
|
|
102
102
|
return {
|
|
103
|
-
currentBattleInfo:
|
|
103
|
+
currentBattleInfo: d,
|
|
104
104
|
battleUsers: r,
|
|
105
105
|
battleScore: o,
|
|
106
|
-
subscribeEvent:
|
|
107
|
-
unsubscribeEvent:
|
|
108
|
-
requestBattle:
|
|
109
|
-
cancelBattleRequest:
|
|
110
|
-
acceptBattle:
|
|
111
|
-
rejectBattle:
|
|
112
|
-
exitBattle:
|
|
106
|
+
subscribeEvent: p,
|
|
107
|
+
unsubscribeEvent: I,
|
|
108
|
+
requestBattle: b,
|
|
109
|
+
cancelBattleRequest: U,
|
|
110
|
+
acceptBattle: E,
|
|
111
|
+
rejectBattle: L,
|
|
112
|
+
exitBattle: R
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
export {
|