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,7 +1,7 @@
|
|
|
1
|
-
import { S as g, P as x, E as p, I as o } from "../../../index-
|
|
1
|
+
import { S as g, P as x, E as p, I as o } from "../../../index-Bm-QfV5o.js";
|
|
2
2
|
import { isMobile as y } from "../../../utils/environment.js";
|
|
3
3
|
import { CharacterCount as M } from "./CharacterCountExtension.js";
|
|
4
|
-
import { E as T } from "../../../index-
|
|
4
|
+
import { E as T } from "../../../index-D2OVtqc8.js";
|
|
5
5
|
import { MessageContentType as a } from "../../../states/MessageInputState/type.js";
|
|
6
6
|
function b() {
|
|
7
7
|
return o.extend({
|
|
@@ -35,7 +35,7 @@ const se = {
|
|
|
35
35
|
battleUsers: L,
|
|
36
36
|
requestBattle: A,
|
|
37
37
|
exitBattle: D
|
|
38
|
-
} = W(), I = z(!1), $ = (e, t) => N.value.some((
|
|
38
|
+
} = W(), I = z(!1), $ = (e, t) => N.value.some((d) => d.userId === e && d.liveId === t), a = /* @__PURE__ */ new Set(), j = async (e) => {
|
|
39
39
|
try {
|
|
40
40
|
switch ((await w({
|
|
41
41
|
liveId: e.liveId,
|
|
@@ -47,7 +47,7 @@ const se = {
|
|
|
47
47
|
})
|
|
48
48
|
})).get(e.liveId)) {
|
|
49
49
|
case f.TUIConnectionCodeSuccess:
|
|
50
|
-
a.add(e.userId), n({ type: l.SUCCESS, message: o("Battle invitation sent to user", { userName: e.userName }) });
|
|
50
|
+
a.add(e.userId), n({ type: l.SUCCESS, message: o("Battle invitation sent to user", { userName: e.userName || e.userId }) });
|
|
51
51
|
break;
|
|
52
52
|
case f.TUIConnectionCodeRoomNotExist:
|
|
53
53
|
n({ type: l.ERROR, message: o("Send battle request failed, Room not exist") });
|
|
@@ -90,22 +90,22 @@ const se = {
|
|
|
90
90
|
}, _ = ({ inviter: e }) => {
|
|
91
91
|
a.has(e.userId) && a.delete(e.userId);
|
|
92
92
|
}, E = ({ invitee: e }) => {
|
|
93
|
-
a.has(e.userId) && (a.delete(e.userId), n({ type: l.INFO, message: o("Battle request rejected by user", { userName: e.userName }) }));
|
|
93
|
+
a.has(e.userId) && (a.delete(e.userId), n({ type: l.INFO, message: o("Battle request rejected by user", { userName: e.userName || e.userId }) }));
|
|
94
94
|
}, T = ({ inviter: e, invitee: t }) => {
|
|
95
|
-
var
|
|
96
|
-
e.userId === ((
|
|
95
|
+
var d;
|
|
96
|
+
e.userId === ((d = x.value) == null ? void 0 : d.userId) && a.has(t.userId) && (a.delete(t.userId), n({ type: l.INFO, message: o("Battle request timeout for user", { userName: t.userName || t.userId }) }));
|
|
97
97
|
};
|
|
98
98
|
return J(() => {
|
|
99
99
|
b(u.onCoHostRequestAccepted, k), b(u.onCoHostRequestCancelled, _), b(u.onCoHostRequestRejected, E), b(u.onCoHostRequestTimeout, T);
|
|
100
100
|
}), K(() => {
|
|
101
101
|
y(u.onCoHostRequestAccepted, k), y(u.onCoHostRequestCancelled, _), y(u.onCoHostRequestRejected, E), y(u.onCoHostRequestTimeout, T);
|
|
102
102
|
}), (e, t) => {
|
|
103
|
-
var
|
|
103
|
+
var d, S;
|
|
104
104
|
return m(), g(M, null, [
|
|
105
105
|
U("div", se, [
|
|
106
|
-
(
|
|
106
|
+
(d = s(v)) != null && d.battleId ? (m(), g("div", ae, [
|
|
107
107
|
p(Z, { userList: s(L) }, {
|
|
108
|
-
"user-actions": r(({ user:
|
|
108
|
+
"user-actions": r(({ user: i }) => [
|
|
109
109
|
U("div", ne, c(s(o)("In battle")) + "... ", 1)
|
|
110
110
|
]),
|
|
111
111
|
_: 1
|
|
@@ -114,12 +114,12 @@ const se = {
|
|
|
114
114
|
key: 1,
|
|
115
115
|
class: "recommend-host-list"
|
|
116
116
|
}, {
|
|
117
|
-
"host-item-actions": r(({ user:
|
|
118
|
-
$(
|
|
117
|
+
"host-item-actions": r(({ user: i }) => [
|
|
118
|
+
$(i.userId, i.liveId) ? (m(), h(s(R), {
|
|
119
119
|
key: 1,
|
|
120
120
|
size: "small",
|
|
121
121
|
color: "gray",
|
|
122
|
-
onClick: (P) => F(
|
|
122
|
+
onClick: (P) => F(i)
|
|
123
123
|
}, {
|
|
124
124
|
default: r(() => [
|
|
125
125
|
C(c(s(o)("Cancel invitation")), 1)
|
|
@@ -129,7 +129,7 @@ const se = {
|
|
|
129
129
|
key: 0,
|
|
130
130
|
size: "small",
|
|
131
131
|
type: "primary",
|
|
132
|
-
onClick: (P) => j(
|
|
132
|
+
onClick: (P) => j(i)
|
|
133
133
|
}, {
|
|
134
134
|
default: r(() => [
|
|
135
135
|
C(c(s(o)("Invite battle")), 1)
|
|
@@ -144,7 +144,7 @@ const se = {
|
|
|
144
144
|
p(s(R), {
|
|
145
145
|
type: "primary",
|
|
146
146
|
color: "red",
|
|
147
|
-
onClick: t[0] || (t[0] = (
|
|
147
|
+
onClick: t[0] || (t[0] = (i) => I.value = !0)
|
|
148
148
|
}, {
|
|
149
149
|
default: r(() => [
|
|
150
150
|
C(c(s(o)("End battle")), 1)
|
|
@@ -158,13 +158,13 @@ const se = {
|
|
|
158
158
|
modal: !1,
|
|
159
159
|
customClasses: ["exit-co-host-dialog"],
|
|
160
160
|
onConfirm: H,
|
|
161
|
-
onCancel: t[2] || (t[2] = (
|
|
161
|
+
onCancel: t[2] || (t[2] = (i) => I.value = !1)
|
|
162
162
|
}, {
|
|
163
163
|
footer: r(() => [
|
|
164
164
|
p(s(R), {
|
|
165
165
|
type: "default",
|
|
166
166
|
color: "gray",
|
|
167
|
-
onClick: t[1] || (t[1] = (
|
|
167
|
+
onClick: t[1] || (t[1] = (i) => I.value = !1)
|
|
168
168
|
}, {
|
|
169
169
|
default: r(() => [
|
|
170
170
|
C(c(s(o)("Cancel")), 1)
|
|
@@ -190,7 +190,7 @@ const se = {
|
|
|
190
190
|
], 64);
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
}), be = /* @__PURE__ */ oe(re, [["__scopeId", "data-v-
|
|
193
|
+
}), be = /* @__PURE__ */ oe(re, [["__scopeId", "data-v-460969fc"]]);
|
|
194
194
|
export {
|
|
195
195
|
be as default
|
|
196
196
|
};
|
|
@@ -1,58 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useUIKit as
|
|
3
|
-
import { useBattleState as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { defineComponent as N, ref as d, computed as b, watch as _, createBlock as g, openBlock as p, unref as i, withCtx as f, createElementVNode as e, createVNode as v, createElementBlock as $, createCommentVNode as y, normalizeClass as h, toDisplayString as C, withDirectives as k, vShow as L } from "vue";
|
|
2
|
+
import { useUIKit as w, TUIDialog as z, IconLiveSetting as A, IconClose as E } from "@tencentcloud/uikit-base-component-vue3";
|
|
3
|
+
import { useBattleState as V } from "../../states/BattleState.js";
|
|
4
|
+
import { useLoginState as F } from "../../states/LoginState.js";
|
|
5
|
+
import G from "./BattlePanel.js";
|
|
6
|
+
import K from "./ConfigSettingPanel.js";
|
|
7
|
+
import j from "./ConnectionPanel.js";
|
|
8
|
+
import { useCoHostState as q } from "../../states/CoHostState/CoHostState.js";
|
|
9
|
+
import { CoHostStatus as J, CoHostLayoutTemplate as M } from "../../types/coHost.js";
|
|
10
|
+
import { _ as O } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
|
+
const Q = { class: "dialog-header" }, R = { class: "dialog-title" }, W = { class: "icon-buttons" }, X = { class: "panel-content" }, Y = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "panel-header"
|
|
13
|
-
},
|
|
14
|
+
}, Z = { class: "tabs" }, tt = { class: "panel-body" }, et = { class: "battle-content" }, ot = { class: "coHost-content" }, at = /* @__PURE__ */ N({
|
|
14
15
|
__name: "CoHostPanel",
|
|
15
16
|
props: {
|
|
16
17
|
visible: { type: Boolean }
|
|
17
18
|
},
|
|
18
19
|
emits: ["update:visible"],
|
|
19
|
-
setup(
|
|
20
|
-
const { t: l } =
|
|
20
|
+
setup(S, { emit: D }) {
|
|
21
|
+
const { t: l } = w(), I = S, { loginUserInfo: B } = F(), { coHostStatus: P } = q(), { battleUsers: U } = V(), H = D, u = () => {
|
|
21
22
|
H("update:visible", !1);
|
|
22
|
-
}, a = d("battleTab"),
|
|
23
|
-
var
|
|
24
|
-
return ((
|
|
25
|
-
}),
|
|
23
|
+
}, a = d("battleTab"), m = d(!1), c = b(() => P.value === J.Connected), n = b(() => U.value.some((o) => {
|
|
24
|
+
var t;
|
|
25
|
+
return o.userId === ((t = B.value) == null ? void 0 : t.userId);
|
|
26
|
+
})), T = b(() => n.value ? l("Anchor battling...") : c.value ? l("Anchor connecting...") : l("CoHost")), s = d({
|
|
26
27
|
battleDuration: 5 * 60,
|
|
27
|
-
coHostLayoutTemplate:
|
|
28
|
-
}),
|
|
28
|
+
coHostLayoutTemplate: M.HostDynamicGrid
|
|
29
|
+
}), x = (o) => {
|
|
29
30
|
s.value = o;
|
|
30
31
|
};
|
|
31
|
-
return
|
|
32
|
+
return _(c, (o) => {
|
|
33
|
+
o && !n.value && (a.value = "coHostTab");
|
|
34
|
+
}, {
|
|
35
|
+
immediate: !0
|
|
36
|
+
}), _(n, (o, t) => {
|
|
32
37
|
o && (H("update:visible", !1), a.value = "battleTab"), o !== t && !o && (a.value = "coHostTab");
|
|
33
38
|
}, {
|
|
34
39
|
immediate: !0
|
|
35
|
-
}), (o, t) => (p(),
|
|
36
|
-
title:
|
|
37
|
-
visible:
|
|
40
|
+
}), (o, t) => (p(), g(i(z), {
|
|
41
|
+
title: T.value,
|
|
42
|
+
visible: I.visible,
|
|
38
43
|
"custom-classes": ["co-host-dialog"],
|
|
39
|
-
onClose:
|
|
40
|
-
onConfirm:
|
|
41
|
-
onCancel:
|
|
44
|
+
onClose: u,
|
|
45
|
+
onConfirm: u,
|
|
46
|
+
onCancel: u
|
|
42
47
|
}, {
|
|
43
48
|
header: f(() => [
|
|
44
|
-
e("div",
|
|
45
|
-
e("span",
|
|
46
|
-
e("div",
|
|
47
|
-
!
|
|
49
|
+
e("div", Q, [
|
|
50
|
+
e("span", R, C(T.value), 1),
|
|
51
|
+
e("div", W, [
|
|
52
|
+
!n.value && !c.value ? (p(), g(i(A), {
|
|
48
53
|
key: 0,
|
|
49
54
|
class: "icon-button",
|
|
50
55
|
size: "20",
|
|
51
|
-
onClick: t[0] || (t[0] = (
|
|
56
|
+
onClick: t[0] || (t[0] = (r) => m.value = !0)
|
|
52
57
|
})) : y("", !0),
|
|
53
|
-
|
|
58
|
+
v(i(E), {
|
|
54
59
|
class: "icon-button",
|
|
55
|
-
onClick:
|
|
60
|
+
onClick: u
|
|
56
61
|
})
|
|
57
62
|
])
|
|
58
63
|
])
|
|
@@ -61,49 +66,49 @@ const M = { class: "dialog-header" }, O = { class: "dialog-title" }, Q = { class
|
|
|
61
66
|
e("div", null, null, -1)
|
|
62
67
|
])]),
|
|
63
68
|
default: f(() => [
|
|
64
|
-
e("div",
|
|
65
|
-
!
|
|
66
|
-
e("div",
|
|
69
|
+
e("div", X, [
|
|
70
|
+
!c.value && !n.value ? (p(), $("div", Y, [
|
|
71
|
+
e("div", Z, [
|
|
67
72
|
e("span", {
|
|
68
|
-
class:
|
|
69
|
-
onClick: t[1] || (t[1] = (
|
|
70
|
-
}, C(
|
|
73
|
+
class: h(["tab-item", { active: a.value === "battleTab" }]),
|
|
74
|
+
onClick: t[1] || (t[1] = (r) => a.value = "battleTab")
|
|
75
|
+
}, C(i(l)("Host Battle")), 3),
|
|
71
76
|
e("span", {
|
|
72
|
-
class:
|
|
73
|
-
onClick: t[2] || (t[2] = (
|
|
74
|
-
}, C(
|
|
77
|
+
class: h(["tab-item", { active: a.value === "coHostTab" }]),
|
|
78
|
+
onClick: t[2] || (t[2] = (r) => a.value = "coHostTab")
|
|
79
|
+
}, C(i(l)("Host Connection")), 3)
|
|
75
80
|
])
|
|
76
81
|
])) : y("", !0),
|
|
77
|
-
e("div",
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
e("div", tt, [
|
|
83
|
+
k(e("div", et, [
|
|
84
|
+
v(G, {
|
|
80
85
|
"battle-duration": s.value.battleDuration,
|
|
81
86
|
coHostLayoutTemplate: s.value.coHostLayoutTemplate
|
|
82
87
|
}, null, 8, ["battle-duration", "coHostLayoutTemplate"])
|
|
83
88
|
], 512), [
|
|
84
|
-
[
|
|
89
|
+
[L, a.value === "battleTab"]
|
|
85
90
|
]),
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
k(e("div", ot, [
|
|
92
|
+
v(j, {
|
|
88
93
|
battleDuration: s.value.battleDuration,
|
|
89
94
|
coHostLayoutTemplate: s.value.coHostLayoutTemplate
|
|
90
95
|
}, null, 8, ["battleDuration", "coHostLayoutTemplate"])
|
|
91
96
|
], 512), [
|
|
92
|
-
[
|
|
97
|
+
[L, a.value === "coHostTab"]
|
|
93
98
|
])
|
|
94
99
|
])
|
|
95
100
|
]),
|
|
96
|
-
|
|
97
|
-
visible:
|
|
98
|
-
"onUpdate:visible": t[3] || (t[3] = (
|
|
101
|
+
v(K, {
|
|
102
|
+
visible: m.value,
|
|
103
|
+
"onUpdate:visible": t[3] || (t[3] = (r) => m.value = r),
|
|
99
104
|
form: s.value,
|
|
100
|
-
onConfirm:
|
|
105
|
+
onConfirm: x
|
|
101
106
|
}, null, 8, ["visible", "form"])
|
|
102
107
|
]),
|
|
103
108
|
_: 1
|
|
104
109
|
}, 8, ["title", "visible"]));
|
|
105
110
|
}
|
|
106
|
-
}),
|
|
111
|
+
}), bt = /* @__PURE__ */ O(at, [["__scopeId", "data-v-93d0efba"]]);
|
|
107
112
|
export {
|
|
108
|
-
|
|
113
|
+
bt as default
|
|
109
114
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as ce, computed as G, ref as S, onMounted as de, onUnmounted as me, createElementBlock as
|
|
1
|
+
import { defineComponent as ce, computed as G, ref as S, onMounted as de, onUnmounted as me, createElementBlock as I, openBlock as r, Fragment as O, createElementVNode as c, createCommentVNode as y, createVNode as h, unref as s, toDisplayString as l, renderList as ve, withCtx as m, createBlock as T, createTextVNode as p } from "vue";
|
|
2
2
|
import { TUILiveBattleManagerEvents as v, TUIConnectionCode as _ } from "@tencentcloud/tuiroom-engine-js";
|
|
3
|
-
import { useUIKit as Ce, TUIButton as
|
|
4
|
-
import { useBattleState as
|
|
5
|
-
import { useLoginState as
|
|
6
|
-
import
|
|
3
|
+
import { useUIKit as Ce, TUIButton as R, TUIDialog as pe, TUIToast as u, TOAST_TYPE as i } from "@tencentcloud/uikit-base-component-vue3";
|
|
4
|
+
import { useBattleState as Ie } from "../../states/BattleState.js";
|
|
5
|
+
import { useLoginState as Re } from "../../states/LoginState.js";
|
|
6
|
+
import fe from "../Avatar/Avatar.js";
|
|
7
7
|
import ye from "./RecommendHostList.js";
|
|
8
8
|
import { useCoHostState as he } from "../../states/CoHostState/CoHostState.js";
|
|
9
9
|
import { CoHostEvent as q, CoHostStatus as N, CoHostLayoutTemplate as J } from "../../types/coHost.js";
|
|
@@ -28,7 +28,7 @@ const qe = {
|
|
|
28
28
|
coHostLayoutTemplate: {}
|
|
29
29
|
},
|
|
30
30
|
setup(K) {
|
|
31
|
-
const U = K, { t: o } = Ce(), { loginUserInfo:
|
|
31
|
+
const U = K, { t: o } = Ce(), { loginUserInfo: f } = Re(), {
|
|
32
32
|
coHostStatus: H,
|
|
33
33
|
connected: k,
|
|
34
34
|
invitees: Y,
|
|
@@ -44,12 +44,12 @@ const qe = {
|
|
|
44
44
|
cancelBattleRequest: te,
|
|
45
45
|
subscribeEvent: b,
|
|
46
46
|
unsubscribeEvent: g
|
|
47
|
-
} =
|
|
47
|
+
} = Ie(), se = G(() => ({
|
|
48
48
|
[J.HostDynamicGrid]: 9,
|
|
49
49
|
[J.HostDynamic1v6]: 7
|
|
50
50
|
})[U.coHostLayoutTemplate]), B = S(!1), d = S(/* @__PURE__ */ new Set()), E = S(""), oe = (e, t) => Y.value.some((a) => a.userId === e && a.liveId === t), A = G(() => Z.value.some((e) => {
|
|
51
51
|
var t;
|
|
52
|
-
return e.userId === ((t =
|
|
52
|
+
return e.userId === ((t = f.value) == null ? void 0 : t.userId);
|
|
53
53
|
})), C = S(/* @__PURE__ */ new Set()), ne = async (e) => {
|
|
54
54
|
try {
|
|
55
55
|
const t = await Q({
|
|
@@ -62,43 +62,43 @@ const qe = {
|
|
|
62
62
|
})
|
|
63
63
|
});
|
|
64
64
|
if (t.get(e.liveId) === _.TUIConnectionCodeSuccess)
|
|
65
|
-
C.value.add(e.userId),
|
|
65
|
+
C.value.add(e.userId), u({ type: i.SUCCESS, message: o("Co-host invitation sent to user", { userName: e.userName || e.userId }) });
|
|
66
66
|
else
|
|
67
67
|
switch (t.get(e.liveId)) {
|
|
68
68
|
case _.TUIConnectionCodeRoomNotExist:
|
|
69
|
-
|
|
69
|
+
u({ type: i.ERROR, message: o("Send co-host request failed, Room not exist") });
|
|
70
70
|
break;
|
|
71
71
|
case _.TUIConnectionCodeConnecting:
|
|
72
|
-
|
|
72
|
+
u({ type: i.ERROR, message: o("Send co-host request failed, Room is connecting") });
|
|
73
73
|
break;
|
|
74
74
|
case _.TUIConnectionCodeConnectingOtherRoom:
|
|
75
|
-
|
|
75
|
+
u({ type: i.ERROR, message: o("Send co-host request failed, Room is connecting other room") });
|
|
76
76
|
break;
|
|
77
77
|
case _.TUIConnectionCodeFull:
|
|
78
|
-
|
|
78
|
+
u({ type: i.ERROR, message: o("Send co-host request failed, Connected count is full") });
|
|
79
79
|
break;
|
|
80
80
|
case _.TUIConnectionCodeRetry:
|
|
81
|
-
|
|
81
|
+
u({ type: i.ERROR, message: o("Send co-host request failed") });
|
|
82
82
|
break;
|
|
83
83
|
default:
|
|
84
|
-
|
|
84
|
+
u({ type: i.ERROR, message: o("Send co-host request failed") });
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
} catch (t) {
|
|
88
|
-
throw
|
|
88
|
+
throw u({ type: i.ERROR, message: o("Send co-host request failed") }), t;
|
|
89
89
|
}
|
|
90
90
|
}, ae = async (e) => {
|
|
91
91
|
try {
|
|
92
92
|
await W({ liveId: e.liveId }), C.value.delete(e.userId);
|
|
93
93
|
} catch (t) {
|
|
94
|
-
throw
|
|
94
|
+
throw u({ type: i.ERROR, message: o("Cancel co-host request failed") }), t;
|
|
95
95
|
}
|
|
96
96
|
}, le = () => {
|
|
97
97
|
L(), B.value = !1;
|
|
98
|
-
},
|
|
98
|
+
}, ue = async () => {
|
|
99
99
|
const e = k.value.filter((a) => {
|
|
100
100
|
var n;
|
|
101
|
-
return a.userId !== ((n =
|
|
101
|
+
return a.userId !== ((n = f.value) == null ? void 0 : n.userId);
|
|
102
102
|
}).map((a) => a.userId), t = await ee({
|
|
103
103
|
config: {
|
|
104
104
|
duration: U.battleDuration,
|
|
@@ -108,7 +108,7 @@ const qe = {
|
|
|
108
108
|
timeout: 10
|
|
109
109
|
});
|
|
110
110
|
E.value = t.battleId, e.forEach((a) => d.value.add(a));
|
|
111
|
-
},
|
|
111
|
+
}, ie = async () => {
|
|
112
112
|
await te({
|
|
113
113
|
battleId: E.value,
|
|
114
114
|
userIdList: Array.from(d.value)
|
|
@@ -116,19 +116,19 @@ const qe = {
|
|
|
116
116
|
}, $ = ({ invitee: e }) => {
|
|
117
117
|
C.value.has(e.userId) && C.value.delete(e.userId);
|
|
118
118
|
}, j = ({ invitee: e }) => {
|
|
119
|
-
C.value.has(e.userId) && (
|
|
119
|
+
C.value.has(e.userId) && (u({ type: i.INFO, message: o("Co-host request rejected by user", { userName: e.userName || e.userId }) }), C.value.delete(e.userId));
|
|
120
120
|
}, D = ({ inviter: e, invitee: t }) => {
|
|
121
121
|
var a;
|
|
122
|
-
e.userId === ((a =
|
|
122
|
+
e.userId === ((a = f.value) == null ? void 0 : a.userId) && C.value.has(t.userId) && (u({ type: i.INFO, message: o("Co-host request timeout for user", { userName: t.userName || t.userId }) }), C.value.delete(t.userId));
|
|
123
123
|
}, z = (e) => {
|
|
124
124
|
var t;
|
|
125
|
-
e.inviter.userId === ((t =
|
|
125
|
+
e.inviter.userId === ((t = f.value) == null ? void 0 : t.userId) && d.value.delete(e.invitee.userId);
|
|
126
126
|
}, F = (e) => {
|
|
127
127
|
var t;
|
|
128
|
-
e.inviter.userId === ((t =
|
|
128
|
+
e.inviter.userId === ((t = f.value) == null ? void 0 : t.userId) && (u({ type: i.INFO, message: o("Battle request rejected by user", { userName: e.invitee.userName || e.invitee.userId }) }), d.value.delete(e.invitee.userId));
|
|
129
129
|
}, P = (e) => {
|
|
130
130
|
var t;
|
|
131
|
-
e.inviter.userId === ((t =
|
|
131
|
+
e.inviter.userId === ((t = f.value) == null ? void 0 : t.userId) && d.value.delete(e.invitee.userId);
|
|
132
132
|
}, M = (e) => {
|
|
133
133
|
E.value = "", d.value.clear();
|
|
134
134
|
}, V = (e) => {
|
|
@@ -140,20 +140,20 @@ const qe = {
|
|
|
140
140
|
w(q.onCoHostRequestAccepted, $), w(q.onCoHostRequestRejected, j), w(q.onCoHostRequestTimeout, D), g(v.onBattleRequestAccept, z), g(v.onBattleRequestReject, F), g(v.onBattleRequestTimeout, P), g(v.onBattleStarted, M), g(v.onBattleEnded, V);
|
|
141
141
|
}), (e, t) => {
|
|
142
142
|
var a;
|
|
143
|
-
return r(),
|
|
143
|
+
return r(), I(O, null, [
|
|
144
144
|
c("div", qe, [
|
|
145
|
-
s(H) === s(N).Connected ? (r(),
|
|
145
|
+
s(H) === s(N).Connected ? (r(), I("div", be, [
|
|
146
146
|
c("div", ge, [
|
|
147
147
|
c("span", Be, l(s(o)("Current seat")), 1),
|
|
148
148
|
c("span", Ee, l(`(${s(k).length}/${se.value})`), 1)
|
|
149
149
|
]),
|
|
150
150
|
c("div", He, [
|
|
151
|
-
(r(!0),
|
|
151
|
+
(r(!0), I(O, null, ve(s(k), (n) => (r(), I("div", {
|
|
152
152
|
key: `${n.userId}-${n.liveId}`,
|
|
153
153
|
class: "user-item"
|
|
154
154
|
}, [
|
|
155
155
|
c("div", ke, [
|
|
156
|
-
h(s(
|
|
156
|
+
h(s(fe), {
|
|
157
157
|
src: n.avatarUrl,
|
|
158
158
|
size: 40
|
|
159
159
|
}, null, 8, ["src"])
|
|
@@ -166,13 +166,13 @@ const qe = {
|
|
|
166
166
|
])
|
|
167
167
|
]))), 128))
|
|
168
168
|
]),
|
|
169
|
-
s(k).length === 0 ? (r(),
|
|
169
|
+
s(k).length === 0 ? (r(), I("div", xe, [
|
|
170
170
|
c("span", null, l(s(o)("Seat is empty")), 1)
|
|
171
171
|
])) : y("", !0)
|
|
172
172
|
])) : y("", !0),
|
|
173
173
|
h(ye, { class: "recommend-host-list" }, {
|
|
174
174
|
"host-item-actions": m(({ user: n }) => [
|
|
175
|
-
oe(n.userId, n.liveId) ? (r(), T(s(
|
|
175
|
+
oe(n.userId, n.liveId) ? (r(), T(s(R), {
|
|
176
176
|
key: 1,
|
|
177
177
|
size: "small",
|
|
178
178
|
color: "gray",
|
|
@@ -182,7 +182,7 @@ const qe = {
|
|
|
182
182
|
p(l(s(o)("Cancel invitation")), 1)
|
|
183
183
|
]),
|
|
184
184
|
_: 1
|
|
185
|
-
}, 8, ["onClick"])) : (r(), T(s(
|
|
185
|
+
}, 8, ["onClick"])) : (r(), T(s(R), {
|
|
186
186
|
key: 0,
|
|
187
187
|
size: "small",
|
|
188
188
|
type: s(H) === s(N).Connected ? "default" : "primary",
|
|
@@ -197,8 +197,8 @@ const qe = {
|
|
|
197
197
|
_: 1
|
|
198
198
|
})
|
|
199
199
|
]),
|
|
200
|
-
s(H) === s(N).Connected ? (r(),
|
|
201
|
-
h(s(
|
|
200
|
+
s(H) === s(N).Connected ? (r(), I("div", we, [
|
|
201
|
+
h(s(R), {
|
|
202
202
|
color: "red",
|
|
203
203
|
onClick: t[0] || (t[0] = (n) => B.value = !0)
|
|
204
204
|
}, {
|
|
@@ -207,20 +207,20 @@ const qe = {
|
|
|
207
207
|
]),
|
|
208
208
|
_: 1
|
|
209
209
|
}),
|
|
210
|
-
(a = s(X)) != null && a.battleId ? y("", !0) : (r(),
|
|
211
|
-
!A.value && d.value.size === 0 ? (r(), T(s(
|
|
210
|
+
(a = s(X)) != null && a.battleId ? y("", !0) : (r(), I(O, { key: 0 }, [
|
|
211
|
+
!A.value && d.value.size === 0 ? (r(), T(s(R), {
|
|
212
212
|
key: 0,
|
|
213
213
|
type: "primary",
|
|
214
|
-
onClick:
|
|
214
|
+
onClick: ue
|
|
215
215
|
}, {
|
|
216
216
|
default: m(() => [
|
|
217
217
|
p(l(s(o)("Start battle")), 1)
|
|
218
218
|
]),
|
|
219
219
|
_: 1
|
|
220
220
|
})) : y("", !0),
|
|
221
|
-
!A.value && d.value.size > 0 ? (r(), T(s(
|
|
221
|
+
!A.value && d.value.size > 0 ? (r(), T(s(R), {
|
|
222
222
|
key: 1,
|
|
223
|
-
onClick:
|
|
223
|
+
onClick: ie
|
|
224
224
|
}, {
|
|
225
225
|
default: m(() => [
|
|
226
226
|
p(l(s(o)("Cancel battle")), 1)
|
|
@@ -238,7 +238,7 @@ const qe = {
|
|
|
238
238
|
onCancel: t[2] || (t[2] = (n) => B.value = !1)
|
|
239
239
|
}, {
|
|
240
240
|
footer: m(() => [
|
|
241
|
-
h(s(
|
|
241
|
+
h(s(R), {
|
|
242
242
|
type: "default",
|
|
243
243
|
color: "gray",
|
|
244
244
|
onClick: t[1] || (t[1] = (n) => B.value = !1)
|
|
@@ -248,7 +248,7 @@ const qe = {
|
|
|
248
248
|
]),
|
|
249
249
|
_: 1
|
|
250
250
|
}),
|
|
251
|
-
h(s(
|
|
251
|
+
h(s(R), {
|
|
252
252
|
type: "primary",
|
|
253
253
|
color: "red",
|
|
254
254
|
onClick: le
|
|
@@ -267,7 +267,7 @@ const qe = {
|
|
|
267
267
|
], 64);
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
}), Ge = /* @__PURE__ */ _e(Oe, [["__scopeId", "data-v-
|
|
270
|
+
}), Ge = /* @__PURE__ */ _e(Oe, [["__scopeId", "data-v-fdce3ba7"]]);
|
|
271
271
|
export {
|
|
272
272
|
Ge as default
|
|
273
273
|
};
|
|
@@ -146,7 +146,7 @@ const te = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAAD2CAYAAAAEXDiwAA
|
|
|
146
146
|
], 2)
|
|
147
147
|
])) : G("", !0);
|
|
148
148
|
}
|
|
149
|
-
}), we = /* @__PURE__ */ ee(ke, [["__scopeId", "data-v-
|
|
149
|
+
}), we = /* @__PURE__ */ ee(ke, [["__scopeId", "data-v-294c0910"]]);
|
|
150
150
|
export {
|
|
151
151
|
we as default
|
|
152
152
|
};
|