tuikit-atomicx-vue3-electron 0.0.2 → 5.2.0

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.
@@ -1,9 +1,9 @@
1
- import { defineComponent as g, ref as h, onBeforeMount as y, openBlock as d, createBlock as v, unref as o, withCtx as _, createElementBlock as b, Fragment as C, renderList as B } from "vue";
2
- import { useUIKit as U, TUISelect as x, TUIOption as w } from "@tencentcloud/uikit-base-component-vue3";
3
- import L from "@tencentcloud/tuiroom-engine-electron";
4
- import T from "../../states/DeviceState/DeviceState.js";
5
- import { _ as V } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
6
- const D = /* @__PURE__ */ g({
1
+ import { defineComponent as h, ref as b, watch as g, onBeforeMount as y, openBlock as d, createBlock as v, unref as o, withCtx as _, createElementBlock as C, Fragment as B, renderList as U } from "vue";
2
+ import { useUIKit as w, TUISelect as x, TUIOption as L } from "@tencentcloud/uikit-base-component-vue3";
3
+ import T from "@tencentcloud/tuiroom-engine-electron";
4
+ import V from "../../states/DeviceState/DeviceState.js";
5
+ import { _ as D } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const E = /* @__PURE__ */ h({
7
7
  __name: "SpeakerSelect",
8
8
  props: {
9
9
  onChange: {},
@@ -11,25 +11,34 @@ const D = /* @__PURE__ */ g({
11
11
  },
12
12
  setup(c) {
13
13
  var i;
14
- const { t: f } = U(), r = c, { speakerList: u, currentSpeaker: t, setCurrentSpeaker: m, getSpeakerList: I } = T(), n = h((i = t.value) == null ? void 0 : i.deviceId);
15
- async function S(a) {
16
- var l, e, s, p;
17
- (l = r.onChange) == null || l.call(r, a);
14
+ const { t: m } = w(), r = c, { speakerList: u, currentSpeaker: t, setCurrentSpeaker: f, getSpeakerList: I } = V(), l = b((i = t.value) == null ? void 0 : i.deviceId);
15
+ g(
16
+ () => {
17
+ var e;
18
+ return (e = t.value) == null ? void 0 : e.deviceId;
19
+ },
20
+ (e) => {
21
+ l.value !== e && (l.value = e);
22
+ },
23
+ { immediate: !0 }
24
+ );
25
+ async function S(e) {
26
+ var n, a, s, p;
27
+ (n = r.onChange) == null || n.call(r, e);
18
28
  try {
19
- await m({ deviceId: a });
29
+ await f({ deviceId: e });
20
30
  } catch {
21
- (e = t.value) != null && e.deviceId && u.value.map((k) => k.deviceId).includes((s = t.value) == null ? void 0 : s.deviceId) && (n.value = (p = t.value) == null ? void 0 : p.deviceId);
31
+ (a = t.value) != null && a.deviceId && u.value.map((k) => k.deviceId).includes((s = t.value) == null ? void 0 : s.deviceId) && (l.value = (p = t.value) == null ? void 0 : p.deviceId);
22
32
  }
23
33
  }
24
34
  return y(async () => {
25
- L.once("ready", async () => {
26
- var a;
27
- await I(), n.value = (a = t.value) == null ? void 0 : a.deviceId;
35
+ T.once("ready", async () => {
36
+ await I();
28
37
  });
29
- }), (a, l) => (d(), v(o(x), {
30
- modelValue: n.value,
31
- "onUpdate:modelValue": l[0] || (l[0] = (e) => n.value = e),
32
- placeholder: o(f)("AudioSettingPanel.SelectSpeaker"),
38
+ }), (e, n) => (d(), v(o(x), {
39
+ modelValue: l.value,
40
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => l.value = a),
41
+ placeholder: o(m)("AudioSettingPanel.SelectSpeaker"),
33
42
  class: "select",
34
43
  disabled: c.disabled,
35
44
  teleported: !1,
@@ -37,16 +46,16 @@ const D = /* @__PURE__ */ g({
37
46
  onChange: S
38
47
  }, {
39
48
  default: _(() => [
40
- (d(!0), b(C, null, B(o(u), (e) => (d(), v(o(w), {
41
- key: e.deviceId,
42
- label: e.deviceName,
43
- value: e.deviceId
49
+ (d(!0), C(B, null, U(o(u), (a) => (d(), v(o(L), {
50
+ key: a.deviceId,
51
+ label: a.deviceName,
52
+ value: a.deviceId
44
53
  }, null, 8, ["label", "value"]))), 128))
45
54
  ]),
46
55
  _: 1
47
56
  }, 8, ["modelValue", "placeholder", "disabled"]));
48
57
  }
49
- }), O = /* @__PURE__ */ V(D, [["__scopeId", "data-v-e9ea9848"]]);
58
+ }), P = /* @__PURE__ */ D(E, [["__scopeId", "data-v-56bea6ce"]]);
50
59
  export {
51
- O as default
60
+ P as default
52
61
  };
@@ -38,4 +38,8 @@ export declare const resource: {
38
38
  'This camera has already been added to the materials list': string;
39
39
  'This screen has already been added to the materials list': string;
40
40
  'Failed to add image': string;
41
+ 'Failed to add screen or window source': string;
42
+ 'Failed to add camera source': string;
43
+ 'Failed to update media source': string;
44
+ 'Failed to update media source. The new media source ID already exited.': string;
41
45
  };
@@ -44,7 +44,11 @@ const e = {
44
44
  "Please check the current browser camera permission": "Please check the current browser camera permission",
45
45
  "This camera has already been added to the materials list": "This camera has already been added to the materials list",
46
46
  "This screen has already been added to the materials list": "This screen has already been added to the materials list",
47
- "Failed to add image": "Failed to add image"
47
+ "Failed to add image": "Failed to add image",
48
+ "Failed to add screen or window source": "Failed to add screen or window source",
49
+ "Failed to add camera source": "Failed to add camera source",
50
+ "Failed to update media source": "Failed to update media source",
51
+ "Failed to update media source. The new media source ID already exited.": "Failed to update media source. The new media source ID already exited."
48
52
  };
49
53
  export {
50
54
  e as resource
@@ -38,4 +38,8 @@ export declare const resource: {
38
38
  'This camera has already been added to the materials list': string;
39
39
  'This screen has already been added to the materials list': string;
40
40
  'Failed to add image': string;
41
+ 'Failed to add screen or window source': string;
42
+ 'Failed to add camera source.': string;
43
+ 'Failed to update media source': string;
44
+ 'Failed to update media source. The new media source ID already exited.': string;
41
45
  };
@@ -44,7 +44,11 @@ const e = {
44
44
  "Please check the current browser camera permission": "请检查当前浏览器摄像头权限",
45
45
  "This camera has already been added to the materials list": "该摄像头已在素材列表中,无需重复添加",
46
46
  "This screen has already been added to the materials list": "该屏幕分享已在素材列表中,无需重复添加",
47
- "Failed to add image": "添加图片失败"
47
+ "Failed to add image": "添加图片失败",
48
+ "Failed to add screen or window source": "添加屏幕或窗口失败",
49
+ "Failed to add camera source.": "添加摄像头失败",
50
+ "Failed to update media source": "更新媒体源失败",
51
+ "Failed to update media source. The new media source ID already exited.": "更新媒体源失败,新修改的媒体源 ID 已存在"
48
52
  };
49
53
  export {
50
54
  e as resource
@@ -1,159 +1,177 @@
1
- import { addI18n as U } from "../../i18n/index.js";
2
- import { resource as G } from "./i18n/en-US/index.js";
3
- import { resource as H } from "./i18n/zh-CN/index.js";
4
- import { defineComponent as K, ref as r, computed as Y, openBlock as o, createElementBlock as L, normalizeClass as Z, unref as T, createVNode as q, createElementVNode as J, Fragment as Q, renderList as X, createBlock as m, createCommentVNode as I } from "vue";
5
- import { TRTCMediaSourceType as u } from "@tencentcloud/tuiroom-engine-electron";
6
- import { useUIKit as ee, TUIToast as d, TOAST_TYPE as g } from "@tencentcloud/uikit-base-component-vue3";
7
- import ae from "./CameraSettingDialog.js";
8
- import te from "./LiveSceneSelect.js";
9
- import re from "./MaterialItem.js";
10
- import { _ as oe } from "../../MaterialRenameDialog.vue_vue_type_script_setup_true_lang-CBgkIenq.js";
11
- import ne from "./ScreenShareSettingDialog.js";
1
+ import { addI18n as T } from "../../i18n/index.js";
2
+ import { resource as H } from "./i18n/en-US/index.js";
3
+ import { resource as K } from "./i18n/zh-CN/index.js";
4
+ import { defineComponent as Y, ref as l, computed as Z, openBlock as i, createElementBlock as w, normalizeClass as q, unref as L, createVNode as J, createElementVNode as Q, Fragment as X, renderList as ee, createBlock as p, createCommentVNode as k } from "vue";
5
+ import { TRTCMediaSourceType as g } from "@tencentcloud/tuiroom-engine-electron";
6
+ import { useUIKit as ae, TUIToast as n, TOAST_TYPE as s } from "@tencentcloud/uikit-base-component-vue3";
7
+ import te from "./CameraSettingDialog.js";
8
+ import re from "./LiveSceneSelect.js";
9
+ import oe from "./MaterialItem.js";
10
+ import { _ as ne } from "../../MaterialRenameDialog.vue_vue_type_script_setup_true_lang-CBgkIenq.js";
11
+ import se from "./ScreenShareSettingDialog.js";
12
12
  import { useVideoMixerState as le } from "../../states/VideoMixerState/VideoMixerState.js";
13
13
  import { _ as ie } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
14
- const se = { class: "materials-list" }, ce = /* @__PURE__ */ K({
14
+ const ce = { class: "materials-list" }, de = /* @__PURE__ */ Y({
15
15
  __name: "index",
16
16
  setup(ue) {
17
- const { t: n } = ee(), {
18
- addMediaSource: p,
19
- updateMediaSource: O,
20
- mediaSourceList: S
21
- } = le(), f = r(null), h = r(null), N = Y(() => [...S.value].sort(
22
- (e, a) => (a.zOrder || 0) - (e.zOrder || 0)
23
- )), x = r(!1), s = r(!1), c = r(!1), v = r(!1), A = () => {
24
- x.value = !1;
25
- }, M = r(null), E = (e) => {
26
- M.value = e, v.value = !0;
27
- }, y = () => {
28
- s.value = !1;
17
+ const { t: o } = ae(), {
18
+ addMediaSource: S,
19
+ updateMediaSource: b,
20
+ mediaSourceList: f
21
+ } = le(), h = l(null), v = l(null), U = Z(() => [...f.value].sort(
22
+ (a, t) => (t.zOrder || 0) - (a.zOrder || 0)
23
+ )), A = l(!1), d = l(!1), m = l(!1), y = l(!1), O = () => {
24
+ A.value = !1;
25
+ }, M = l(null), x = (a) => {
26
+ M.value = a, y.value = !0;
27
+ }, R = () => {
28
+ d.value = !1;
29
29
  }, C = () => {
30
- c.value = !1;
30
+ m.value = !1;
31
31
  }, D = () => {
32
- v.value = !1;
33
- }, j = async (e) => {
32
+ y.value = !1;
33
+ }, F = async (a) => {
34
+ var t;
34
35
  try {
35
- await p(e), y();
36
- } catch (a) {
37
- console.error("addCameraMaterial error:", a), a.message.includes("Media source already existed") && d({
38
- type: g.WARNING,
39
- message: n("This camera has already been added to the materials list")
36
+ await S(a), R();
37
+ } catch (e) {
38
+ console.error("addCameraMaterial error:", e), ((t = e == null ? void 0 : e.message) == null ? void 0 : t.includes("Media source already existed")) || !1 ? n({
39
+ type: s.WARNING,
40
+ message: o("This camera has already been added to the materials list")
41
+ }) : n({
42
+ type: s.WARNING,
43
+ message: o("Failed to add camera source.")
40
44
  });
41
45
  }
42
- }, z = (e) => {
43
- f.value = e, s.value = !0;
44
- }, $ = (e) => {
45
- h.value = e, c.value = !0;
46
- }, F = async (e) => {
47
- switch (A(), e) {
48
- case u.kCamera:
49
- f.value = null, s.value = !0;
46
+ }, W = (a) => {
47
+ h.value = a, d.value = !0;
48
+ }, E = (a) => {
49
+ v.value = a, m.value = !0;
50
+ }, G = async (a) => {
51
+ switch (O(), a) {
52
+ case g.kCamera:
53
+ h.value = null, d.value = !0;
50
54
  break;
51
- case u.kScreen:
52
- h.value = null, c.value = !0;
55
+ case g.kScreen:
56
+ v.value = null, m.value = !0;
53
57
  break;
54
- case u.kImage:
55
- P();
58
+ case g.kImage:
59
+ j();
56
60
  break;
57
61
  }
58
62
  };
59
- function P() {
60
- const e = document.createElement("input");
61
- e.type = "file", e.accept = ".jpg,.jpeg,.png,.bmp", e.onchange = async (a) => {
62
- var b, w;
63
- const t = (w = (b = a.target) == null ? void 0 : b.files) == null ? void 0 : w[0];
64
- if (!t)
63
+ function j() {
64
+ const a = document.createElement("input");
65
+ a.type = "file", a.accept = ".jpg,.jpeg,.png,.bmp", a.onchange = async (t) => {
66
+ var N, _;
67
+ const e = (_ = (N = t.target) == null ? void 0 : N.files) == null ? void 0 : _[0];
68
+ if (!e)
65
69
  return;
66
- const l = t.path;
67
- if (!l) {
70
+ const r = e.path;
71
+ if (!r) {
68
72
  console.warn("Failed to get file path");
69
73
  return;
70
74
  }
71
- const k = URL.createObjectURL(t), i = new Image();
72
- i.src = k, i.onload = async () => {
73
- const W = i.width, B = i.height;
75
+ const u = URL.createObjectURL(e), c = new Image();
76
+ c.src = u, c.onload = async () => {
77
+ const $ = c.width, P = c.height, V = {
78
+ sourceId: r,
79
+ sourceType: g.kImage,
80
+ name: e.name || o("Image"),
81
+ rect: {
82
+ left: 0,
83
+ top: 0,
84
+ right: $,
85
+ bottom: P
86
+ },
87
+ zOrder: 1
88
+ };
74
89
  try {
75
- const _ = {
76
- sourceId: l,
77
- sourceType: u.kImage,
78
- name: t.name || n("Image"),
79
- rect: {
80
- left: 0,
81
- top: 0,
82
- right: W,
83
- bottom: B
84
- },
85
- zOrder: 1
86
- };
87
- await p(_);
88
- } catch (_) {
89
- console.error("addImageMaterial error:", _), d({
90
- type: g.ERROR,
91
- message: n("Failed to add image")
90
+ await S(V);
91
+ } catch (B) {
92
+ console.error("addImageMaterial error:", B), n({
93
+ type: s.ERROR,
94
+ message: o("Failed to add image")
92
95
  });
93
96
  }
94
- URL.revokeObjectURL(k);
95
- }, i.onerror = () => {
96
- URL.revokeObjectURL(k), d({
97
- type: g.ERROR,
98
- message: n("Failed to load image")
97
+ URL.revokeObjectURL(u);
98
+ }, c.onerror = () => {
99
+ URL.revokeObjectURL(u), n({
100
+ type: s.ERROR,
101
+ message: o("Failed to load image")
99
102
  });
100
103
  };
101
- }, e.click();
104
+ }, a.click();
102
105
  }
103
- const V = async (e) => {
106
+ const z = async (a) => {
107
+ var t;
104
108
  try {
105
- await p(e), C();
106
- } catch (a) {
107
- console.log("addScreenMaterial error", a), a.message.includes("Media source already existed") && d({
108
- type: g.WARNING,
109
- message: n("This screen has already been added to the materials list")
109
+ await S(a), C();
110
+ } catch (e) {
111
+ console.log("addScreenMaterial error", e), ((t = e == null ? void 0 : e.message) == null ? void 0 : t.includes("Media source already existed")) || !1 ? n({
112
+ type: s.WARNING,
113
+ message: o("This screen has already been added to the materials list")
114
+ }) : n({
115
+ type: s.WARNING,
116
+ message: o("Failed to add screen or window source")
117
+ });
118
+ }
119
+ }, I = async (a, t) => {
120
+ var e;
121
+ try {
122
+ await b(a, t), R(), C(), D();
123
+ } catch (r) {
124
+ console.log("updateMediaSource error", r), ((e = r == null ? void 0 : r.message) == null ? void 0 : e.includes("Media source already existed")) || !1 ? n({
125
+ type: s.WARNING,
126
+ message: o("Failed to update media source. The new media source ID already exited.")
127
+ }) : n({
128
+ type: s.WARNING,
129
+ message: o("Failed to update media source")
110
130
  });
111
131
  }
112
- }, R = async (e, a) => {
113
- await O(e, a), y(), C(), D();
114
132
  };
115
- return (e, a) => (o(), L("div", {
116
- class: Z(["live-scene-panel", { "no-material": T(S).length === 0 }])
133
+ return (a, t) => (i(), w("div", {
134
+ class: q(["live-scene-panel", { "no-material": L(f).length === 0 }])
117
135
  }, [
118
- q(te, {
119
- displayMode: T(S).length === 0 ? "panel" : "button",
120
- onAddMaterial: F
136
+ J(re, {
137
+ displayMode: L(f).length === 0 ? "panel" : "button",
138
+ onAddMaterial: G
121
139
  }, null, 8, ["displayMode"]),
122
- J("div", se, [
123
- (o(!0), L(Q, null, X(N.value, (t) => (o(), m(re, {
124
- key: t.sourceId,
125
- material: t,
126
- onCameraSetting: (l) => z(t),
127
- onScreenShareSetting: (l) => $(t),
128
- onRename: (l) => E(t)
140
+ Q("div", ce, [
141
+ (i(!0), w(X, null, ee(U.value, (e) => (i(), p(oe, {
142
+ key: e.sourceId,
143
+ material: e,
144
+ onCameraSetting: (r) => W(e),
145
+ onScreenShareSetting: (r) => E(e),
146
+ onRename: (r) => x(e)
129
147
  }, null, 8, ["material", "onCameraSetting", "onScreenShareSetting", "onRename"]))), 128))
130
148
  ]),
131
- s.value ? (o(), m(ae, {
149
+ d.value ? (i(), p(te, {
132
150
  key: 0,
133
- mediaSource: f.value,
134
- onClose: y,
135
- onAddCameraMaterial: j,
136
- onUpdateCameraMaterial: R
137
- }, null, 8, ["mediaSource"])) : I("", !0),
138
- c.value ? (o(), m(ne, {
139
- key: 1,
140
151
  mediaSource: h.value,
152
+ onClose: R,
153
+ onAddCameraMaterial: F,
154
+ onUpdateCameraMaterial: I
155
+ }, null, 8, ["mediaSource"])) : k("", !0),
156
+ m.value ? (i(), p(se, {
157
+ key: 1,
158
+ mediaSource: v.value,
141
159
  onClose: C,
142
- onAddScreenMaterial: V,
143
- onUpdateScreenMaterial: R
144
- }, null, 8, ["mediaSource"])) : I("", !0),
145
- v.value ? (o(), m(oe, {
160
+ onAddScreenMaterial: z,
161
+ onUpdateScreenMaterial: I
162
+ }, null, 8, ["mediaSource"])) : k("", !0),
163
+ y.value ? (i(), p(ne, {
146
164
  key: 2,
147
165
  material: M.value,
148
166
  onClose: D,
149
- onRename: a[0] || (a[0] = (t) => R(M.value, { name: t }))
150
- }, null, 8, ["material"])) : I("", !0)
167
+ onRename: t[0] || (t[0] = (e) => I(M.value, { name: e }))
168
+ }, null, 8, ["material"])) : k("", !0)
151
169
  ], 2));
152
170
  }
153
- }), me = /* @__PURE__ */ ie(ce, [["__scopeId", "data-v-b76e16ec"]]);
154
- U("en-US", { translation: G });
155
- U("zh-CN", { translation: H });
156
- const Ie = me;
171
+ }), me = /* @__PURE__ */ ie(de, [["__scopeId", "data-v-4f634084"]]);
172
+ T("en-US", { translation: H });
173
+ T("zh-CN", { translation: K });
174
+ const Ne = me;
157
175
  export {
158
- Ie as LiveScenePanel
176
+ Ne as LiveScenePanel
159
177
  };
@@ -1,35 +1,35 @@
1
- import { defineComponent as O, computed as u, openBlock as m, createElementBlock as v, Fragment as w, renderList as V, withModifiers as z, normalizeStyle as T, normalizeClass as I, createElementVNode as f, createBlock as h, resolveDynamicComponent as k, toDisplayString as S } from "vue";
2
- import { TRTCVideoMirrorType as p, TRTCVideoRotation as i } from "@tencentcloud/tuiroom-engine-electron";
3
- import { useUIKit as b } from "@tencentcloud/uikit-base-component-vue3";
4
- import D from "../icons/CameraMirror.js";
5
- import g from "../icons/Delete.js";
6
- import A from "../icons/Down.js";
7
- import B from "../icons/Rotation.js";
8
- import E from "../icons/Up.js";
9
- import { useVideoMixerState as L } from "../../../states/VideoMixerState/VideoMixerState.js";
10
- import { _ as Z } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
11
- const U = ["onClick"], j = { class: "mixer-control-item-icon" }, F = { class: "mixer-control-item-name" }, K = /* @__PURE__ */ O({
1
+ import { defineComponent as V, computed as u, openBlock as m, createElementBlock as v, Fragment as h, renderList as z, withModifiers as I, normalizeStyle as T, normalizeClass as b, createElementVNode as f, createBlock as k, resolveDynamicComponent as S, toDisplayString as D } from "vue";
2
+ import { TRTCVideoMirrorType as p, TRTCVideoRotation as n } from "@tencentcloud/tuiroom-engine-electron";
3
+ import { useUIKit as g } from "@tencentcloud/uikit-base-component-vue3";
4
+ import A from "../icons/CameraMirror.js";
5
+ import B from "../icons/Delete.js";
6
+ import E from "../icons/Down.js";
7
+ import L from "../icons/Rotation.js";
8
+ import Z from "../icons/Up.js";
9
+ import { useVideoMixerState as U } from "../../../states/VideoMixerState/VideoMixerState.js";
10
+ import { _ as j } from "../../../_plugin-vue_export-helper-CHgC5LLL.js";
11
+ const F = ["onClick"], K = { class: "mixer-control-item-icon" }, N = { class: "mixer-control-item-name" }, P = /* @__PURE__ */ V({
12
12
  __name: "MixerControl",
13
- setup(N) {
14
- const { activeMediaSource: e, mediaSourceList: C, updateMediaSource: a, removeMediaSource: R } = L(), { t: n } = b();
13
+ setup(q) {
14
+ const { activeMediaSource: e, mediaSourceList: C, updateMediaSource: c, removeMediaSource: R } = U(), { t: l } = g();
15
15
  function M(o) {
16
16
  o.stopPropagation();
17
17
  }
18
- const c = u(() => [...C.value].sort((o, r) => o.zOrder - r.zOrder)), x = u(() => {
19
- var o, r;
20
- return ((o = e.value) == null ? void 0 : o.sourceId) === ((r = c.value[0]) == null ? void 0 : r.sourceId);
18
+ const s = u(() => [...C.value].sort((o, t) => o.zOrder - t.zOrder)), x = u(() => {
19
+ var o, t;
20
+ return ((o = e.value) == null ? void 0 : o.sourceId) === ((t = s.value[0]) == null ? void 0 : t.sourceId);
21
21
  }), y = u(() => {
22
- var o, r;
23
- return ((o = e.value) == null ? void 0 : o.sourceId) === ((r = c.value[c.value.length - 1]) == null ? void 0 : r.sourceId);
22
+ var o, t;
23
+ return ((o = e.value) == null ? void 0 : o.sourceId) === ((t = s.value[s.value.length - 1]) == null ? void 0 : t.sourceId);
24
24
  }), _ = u(() => [
25
25
  {
26
26
  name: "mirror",
27
- text: n("Mirror"),
28
- icon: D,
27
+ text: l("Mirror"),
28
+ icon: A,
29
29
  onClick: () => {
30
30
  if (e.value) {
31
31
  const o = e.value.mirrorType;
32
- a(e.value, {
32
+ c(e.value, {
33
33
  mirrorType: o === p.TRTCVideoMirrorType_Enable ? p.TRTCVideoMirrorType_Disable : p.TRTCVideoMirrorType_Enable
34
34
  });
35
35
  }
@@ -37,95 +37,103 @@ const U = ["onClick"], j = { class: "mixer-control-item-icon" }, F = { class: "m
37
37
  },
38
38
  {
39
39
  name: "rotate",
40
- text: n("Rotate"),
41
- icon: B,
40
+ text: l("Rotate"),
41
+ icon: L,
42
42
  onClick: () => {
43
43
  var o;
44
44
  if (e.value) {
45
- const r = ((o = e.value) == null ? void 0 : o.rotation) || i.TRTCVideoRotation0, s = {
46
- [i.TRTCVideoRotation0]: i.TRTCVideoRotation90,
47
- [i.TRTCVideoRotation90]: i.TRTCVideoRotation180,
48
- [i.TRTCVideoRotation180]: i.TRTCVideoRotation270,
49
- [i.TRTCVideoRotation270]: i.TRTCVideoRotation0
50
- }[r];
51
- a(e.value, { rotation: s });
45
+ const t = ((o = e.value) == null ? void 0 : o.rotation) || n.TRTCVideoRotation0, d = {
46
+ [n.TRTCVideoRotation0]: n.TRTCVideoRotation90,
47
+ [n.TRTCVideoRotation90]: n.TRTCVideoRotation180,
48
+ [n.TRTCVideoRotation180]: n.TRTCVideoRotation270,
49
+ [n.TRTCVideoRotation270]: n.TRTCVideoRotation0
50
+ }[t], { top: i, left: a, right: O, bottom: w } = e.value.rect;
51
+ c(e.value, {
52
+ rotation: d,
53
+ rect: {
54
+ top: i,
55
+ left: a,
56
+ right: a + w - i,
57
+ bottom: i + O - a
58
+ }
59
+ });
52
60
  }
53
61
  }
54
62
  },
55
63
  {
56
64
  name: "up",
57
- text: n("Move Up"),
58
- icon: E,
65
+ text: l("Move Up"),
66
+ icon: Z,
59
67
  disable: y.value,
60
68
  onClick: async () => {
61
69
  if (e.value) {
62
- const o = c.value.findIndex((l) => {
63
- var d;
64
- return l.sourceId === ((d = e.value) == null ? void 0 : d.sourceId);
65
- }), r = c.value[o + 1], t = e.value.zOrder, s = r.zOrder;
66
- if (r)
70
+ const o = s.value.findIndex((i) => {
71
+ var a;
72
+ return i.sourceId === ((a = e.value) == null ? void 0 : a.sourceId);
73
+ }), t = s.value[o + 1], r = e.value.zOrder, d = t.zOrder;
74
+ if (t)
67
75
  try {
68
- await a(e.value, { zOrder: 999 }), await a(r, { zOrder: t }), await a(e.value, { zOrder: s });
69
- } catch (l) {
70
- console.warn("Move up failed.", l);
76
+ await c(e.value, { zOrder: 999 }), await c(t, { zOrder: r }), await c(e.value, { zOrder: d });
77
+ } catch (i) {
78
+ console.warn("Move up failed.", i);
71
79
  }
72
80
  else
73
- console.error(n("Already at top"));
81
+ console.error(l("Already at top"));
74
82
  }
75
83
  }
76
84
  },
77
85
  {
78
86
  name: "down",
79
- text: n("Move Down"),
80
- icon: A,
87
+ text: l("Move Down"),
88
+ icon: E,
81
89
  disable: x.value,
82
90
  onClick: async () => {
83
91
  if (e.value) {
84
- const o = c.value.findIndex((l) => {
85
- var d;
86
- return l.sourceId === ((d = e.value) == null ? void 0 : d.sourceId);
87
- }), r = c.value[o - 1], t = e.value.zOrder, s = r.zOrder;
88
- if (r)
92
+ const o = s.value.findIndex((i) => {
93
+ var a;
94
+ return i.sourceId === ((a = e.value) == null ? void 0 : a.sourceId);
95
+ }), t = s.value[o - 1], r = e.value.zOrder, d = t.zOrder;
96
+ if (t)
89
97
  try {
90
- await a(e.value, { zOrder: 0 }), await a(r, { zOrder: t }), await a(e.value, { zOrder: s });
91
- } catch (l) {
92
- console.warn("Move down failed.", l);
98
+ await c(e.value, { zOrder: 0 }), await c(t, { zOrder: r }), await c(e.value, { zOrder: d });
99
+ } catch (i) {
100
+ console.warn("Move down failed.", i);
93
101
  }
94
102
  else
95
- console.error(n("Already at bottom"));
103
+ console.error(l("Already at bottom"));
96
104
  }
97
105
  }
98
106
  },
99
107
  {
100
108
  name: "delete",
101
- text: n("Delete"),
102
- icon: g,
109
+ text: l("Delete"),
110
+ icon: B,
103
111
  style: "color: red",
104
112
  onClick: () => {
105
113
  e.value && R(e.value);
106
114
  }
107
115
  }
108
116
  ]);
109
- return (o, r) => (m(), v("div", {
117
+ return (o, t) => (m(), v("div", {
110
118
  class: "mixer-control",
111
119
  onMousedown: M
112
120
  }, [
113
- (m(!0), v(w, null, V(_.value, (t) => (m(), v("div", {
114
- key: t.name,
115
- class: I(["mixer-control-item", { disable: t.disable }]),
116
- style: T(t.style),
117
- onClick: z(t.onClick, ["stop"])
121
+ (m(!0), v(h, null, z(_.value, (r) => (m(), v("div", {
122
+ key: r.name,
123
+ class: b(["mixer-control-item", { disable: r.disable }]),
124
+ style: T(r.style),
125
+ onClick: I(r.onClick, ["stop"])
118
126
  }, [
119
- f("div", j, [
120
- (m(), h(k(t.icon), {
121
- style: T([{ width: "100%", height: "100%" }, t.style])
127
+ f("div", K, [
128
+ (m(), k(S(r.icon), {
129
+ style: T([{ width: "100%", height: "100%" }, r.style])
122
130
  }, null, 8, ["style"]))
123
131
  ]),
124
- f("span", F, S(t.text), 1)
125
- ], 14, U))), 128))
132
+ f("span", N, D(r.text), 1)
133
+ ], 14, F))), 128))
126
134
  ], 32));
127
135
  }
128
- }), ee = /* @__PURE__ */ Z(K, [["__scopeId", "data-v-50f80a55"]]);
136
+ }), te = /* @__PURE__ */ j(P, [["__scopeId", "data-v-05dd636b"]]);
129
137
  export {
130
- ee as default
138
+ te as default
131
139
  };