@quicktvui/naddons 1.0.0-alpha.11 → 1.0.0-alpha.13
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/naddons.es.js
CHANGED
|
@@ -1,86 +1,78 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Native as
|
|
3
|
-
import { useES as
|
|
4
|
-
const se = "QtGridTabs",
|
|
1
|
+
import { defineComponent as q, ref as x, openBlock as Q, createBlock as B, unref as U, mergeProps as K, withCtx as j, renderSlot as V, shallowRef as oe, watch as J, computed as Ae, onMounted as me, h as L, nextTick as Ie, provide as Ee, inject as Ne } from "vue";
|
|
2
|
+
import { Native as G } from "@extscreen/es3-vue";
|
|
3
|
+
import { useES as pe, useESPlugin as we } from "@extscreen/es3-core";
|
|
4
|
+
const se = "QtGridTabs", H = /* @__PURE__ */ q({
|
|
5
5
|
__name: "GridTabs",
|
|
6
6
|
props: {
|
|
7
7
|
protocolVersion: {},
|
|
8
|
-
pageSpec: {},
|
|
9
8
|
tabsData: {},
|
|
10
|
-
actionPayload: {}
|
|
9
|
+
actionPayload: {},
|
|
10
|
+
hsvHue: { default: -2 }
|
|
11
11
|
},
|
|
12
|
-
emits: ["onTabSelected", "onTabNeedsData", "onLoadMore", "onItemPresence", "onTabFocused", "onItemClick", "onItemFocused", "onProtocolMismatch"],
|
|
12
|
+
emits: ["onTabSelected", "onTabNeedsData", "onLoadMore", "onItemPresence", "onTabFocused", "onItemClick", "onItemFocused", "onProtocolMismatch", "onScroll", "onScrollStateChanged"],
|
|
13
13
|
setup(o, { expose: s }) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const d = x(), v = W(), b = se + "_Plugin", c = (v.isPluginActive ? b : se).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
|
|
15
|
+
c,
|
|
16
|
+
v.pluginPackageName || "com.quicktvui.plugin.glintui"
|
|
17
17
|
);
|
|
18
18
|
return s({
|
|
19
19
|
getNativeNode: () => {
|
|
20
|
-
var i,
|
|
21
|
-
return ((
|
|
20
|
+
var i, a;
|
|
21
|
+
return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
|
|
22
22
|
},
|
|
23
23
|
dispatchAction: (...i) => {
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
var l, P;
|
|
25
|
+
const a = ((P = (l = d.value) == null ? void 0 : l.getNativeNode) == null ? void 0 : P.call(l)) || d.value;
|
|
26
|
+
a && G.callUIFunction(a, "dispatchAction", i);
|
|
27
27
|
},
|
|
28
28
|
scrollToTop: (...i) => {
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
getFocusState: (...i) => {
|
|
34
|
-
var c, P;
|
|
35
|
-
const r = ((P = (c = u.value) == null ? void 0 : c.getNativeNode) == null ? void 0 : P.call(c)) || u.value;
|
|
36
|
-
r && $.callUIFunction(r, "getFocusState", i);
|
|
37
|
-
},
|
|
38
|
-
getItemRect: (...i) => {
|
|
39
|
-
var c, P;
|
|
40
|
-
const r = ((P = (c = u.value) == null ? void 0 : c.getNativeNode) == null ? void 0 : P.call(c)) || u.value;
|
|
41
|
-
r && $.callUIFunction(r, "getItemRect", i);
|
|
29
|
+
var l, P;
|
|
30
|
+
const a = ((P = (l = d.value) == null ? void 0 : l.getNativeNode) == null ? void 0 : P.call(l)) || d.value;
|
|
31
|
+
a && G.callUIFunction(a, "scrollToTop", i);
|
|
42
32
|
}
|
|
43
|
-
}), (i,
|
|
33
|
+
}), (i, a) => (Q(), B(U(m), K({
|
|
44
34
|
ref_key: "nativeRef",
|
|
45
|
-
ref:
|
|
35
|
+
ref: d,
|
|
46
36
|
protocolVersion: o.protocolVersion,
|
|
47
|
-
pageSpec: o.pageSpec,
|
|
48
37
|
tabsData: o.tabsData,
|
|
49
38
|
actionPayload: o.actionPayload,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
hsvHue: o.hsvHue,
|
|
40
|
+
onOnTabSelected: a[0] || (a[0] = (l) => i.$emit("onTabSelected", l.nativeEvent)),
|
|
41
|
+
onOnTabNeedsData: a[1] || (a[1] = (l) => i.$emit("onTabNeedsData", l.nativeEvent)),
|
|
42
|
+
onOnLoadMore: a[2] || (a[2] = (l) => i.$emit("onLoadMore", l.nativeEvent)),
|
|
43
|
+
onOnItemPresence: a[3] || (a[3] = (l) => i.$emit("onItemPresence", l.nativeEvent)),
|
|
44
|
+
onOnTabFocused: a[4] || (a[4] = (l) => i.$emit("onTabFocused", l.nativeEvent)),
|
|
45
|
+
onOnItemClick: a[5] || (a[5] = (l) => i.$emit("onItemClick", l.nativeEvent)),
|
|
46
|
+
onOnItemFocused: a[6] || (a[6] = (l) => i.$emit("onItemFocused", l.nativeEvent)),
|
|
47
|
+
onOnProtocolMismatch: a[7] || (a[7] = (l) => i.$emit("onProtocolMismatch", l.nativeEvent)),
|
|
48
|
+
onOnScroll: a[8] || (a[8] = (l) => i.$emit("onScroll", l.nativeEvent)),
|
|
49
|
+
onOnScrollStateChanged: a[9] || (a[9] = (l) => i.$emit("onScrollStateChanged", l.nativeEvent))
|
|
58
50
|
}, i.$attrs), {
|
|
59
|
-
default:
|
|
60
|
-
|
|
51
|
+
default: j(() => [
|
|
52
|
+
V(i.$slots, "default")
|
|
61
53
|
]),
|
|
62
54
|
_: 3
|
|
63
|
-
}, 16, ["protocolVersion", "
|
|
55
|
+
}, 16, ["protocolVersion", "tabsData", "actionPayload", "hsvHue"]));
|
|
64
56
|
}
|
|
65
57
|
});
|
|
66
|
-
let
|
|
58
|
+
let Y;
|
|
67
59
|
var ge;
|
|
68
60
|
try {
|
|
69
61
|
const o = require("@extscreen/es3-vue");
|
|
70
|
-
|
|
62
|
+
Y = o.registerElement || ((ge = o.default) == null ? void 0 : ge.registerElement);
|
|
71
63
|
} catch {
|
|
72
64
|
}
|
|
73
65
|
const ke = {
|
|
74
66
|
install: (o) => {
|
|
75
67
|
if (!globalThis.__QtGridTabs_registered)
|
|
76
|
-
if (
|
|
77
|
-
const s = (
|
|
78
|
-
|
|
68
|
+
if (Y) {
|
|
69
|
+
const s = (d, v) => {
|
|
70
|
+
Y(d, {
|
|
79
71
|
component: {
|
|
80
|
-
name:
|
|
81
|
-
processEventData(
|
|
82
|
-
const
|
|
83
|
-
return
|
|
72
|
+
name: v ? "QtGridTabs_Plugin" : "QtGridTabs",
|
|
73
|
+
processEventData(b, y) {
|
|
74
|
+
const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
|
|
75
|
+
return c && (c.nativeEvent = m), c;
|
|
84
76
|
}
|
|
85
77
|
}
|
|
86
78
|
});
|
|
@@ -88,48 +80,48 @@ const ke = {
|
|
|
88
80
|
s("qt-grid-tabs", !1), s("qt-grid-tabs-plugin", !0), s("QtGridTabs", !1), s("QtGridTabs_Plugin", !0), s("gt-tabs", !1), s("gt-tabs-plugin", !0), globalThis.__QtGridTabs_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtGridTabs");
|
|
89
81
|
} else
|
|
90
82
|
console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
|
|
91
|
-
o.component("GridTabs",
|
|
83
|
+
o.component("GridTabs", H), o.component("qt-grid-tabs", H), o.component("gt-tabs", H);
|
|
92
84
|
}
|
|
93
85
|
};
|
|
94
86
|
function Me(o, s) {
|
|
95
|
-
const
|
|
96
|
-
let
|
|
87
|
+
const d = x(""), v = oe([]), b = oe([]);
|
|
88
|
+
let y = !1, c = !1;
|
|
97
89
|
const m = "__virtual_single_tab__";
|
|
98
90
|
let i = "";
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
91
|
+
const a = x({}), l = (t) => {
|
|
92
|
+
const e = Array.isArray(t) ? t : [t], n = JSON.stringify(e);
|
|
93
|
+
if (c && o.value) {
|
|
102
94
|
if (typeof o.value.dispatchAction == "function") {
|
|
103
95
|
console.log("[useGridTabs] Calling Wrapper dispatchAction directly"), o.value.dispatchAction(n);
|
|
104
96
|
return;
|
|
105
97
|
}
|
|
106
|
-
let
|
|
107
|
-
typeof o.value.getNativeNode == "function" ?
|
|
98
|
+
let r = o.value;
|
|
99
|
+
typeof o.value.getNativeNode == "function" ? r = o.value.getNativeNode() || o.value : o.value.nativeRef && (r = o.value.nativeRef), r ? (console.log("[useGridTabs] Calling Native.callUIFunction(dispatchAction)"), G.callUIFunction(r, "dispatchAction", [n])) : console.warn("[useGridTabs] Native target is null or undefined, cannot call dispatchAction");
|
|
108
100
|
}
|
|
109
|
-
}, P = (
|
|
110
|
-
if (!
|
|
101
|
+
}, P = (t, e) => {
|
|
102
|
+
if (!t)
|
|
111
103
|
return !1;
|
|
112
104
|
let n = !0;
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
if (!
|
|
105
|
+
return t.id || (console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): 卡片缺失必填字段 'id'。每个卡片必须有唯一标识才能进行后续更新!`, t), n = !1), t.viewType || (console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): 卡片缺失必填字段 'viewType' (id: ${t.id || "未知"})。必须指定 Native 注册的视图类型或 Portal 标识!`, t), n = !1), n;
|
|
106
|
+
}, h = (t, e) => {
|
|
107
|
+
if (!t)
|
|
116
108
|
return !1;
|
|
117
109
|
let n = !0;
|
|
118
|
-
return
|
|
119
|
-
},
|
|
120
|
-
if (!
|
|
110
|
+
return t.tabId || (console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): Tab 缺失必填字段 'tabId'。每个 Tab 必须有唯一标识!`, t), n = !1), (t.title === void 0 || t.title === null) && console.warn(`[useGridTabs] ⚠️ 数据格式警告 (${e}): Tab 缺失 'title' 字段 (tabId: ${t.tabId || "未知"}),导航栏可能显示为空。`, t), n;
|
|
111
|
+
}, S = (t, e) => {
|
|
112
|
+
if (!t || t.length === 0)
|
|
121
113
|
return;
|
|
122
|
-
|
|
123
|
-
const n =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}),
|
|
127
|
-
},
|
|
128
|
-
if (!
|
|
114
|
+
I.clear();
|
|
115
|
+
const n = t[0].hasOwnProperty("tabId") || t[0].hasOwnProperty("items") && Array.isArray(t[0].items);
|
|
116
|
+
y = e === "1d", e === "1d" && n ? console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `items.value` (一维瀑布流) 赋值二维 Tabs 数据结构!请改用 `tabs.value = ...`") : e === "2d" && !n && console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `tabs.value` (二维导航) 赋值一维卡片列表数据结构!请改用 `items.value = ...`"), e === "1d" ? t.forEach((r, u) => P(r, `items.value[${u}]`)) : t.forEach((r, u) => {
|
|
117
|
+
h(r, `tabs.value[${u}]`), r.items && Array.isArray(r.items) && r.items.forEach((f, g) => P(f, `tabs.value[${u}].items[${g}]`));
|
|
118
|
+
}), c = !0, D();
|
|
119
|
+
}, I = /* @__PURE__ */ new Set(), D = (t = "unknown") => {
|
|
120
|
+
if (!c) {
|
|
129
121
|
console.warn("[useGridTabs] triggerRootUpdate skipped because isInitialized is false");
|
|
130
122
|
return;
|
|
131
123
|
}
|
|
132
|
-
let
|
|
124
|
+
let e = {
|
|
133
125
|
protocolVersion: "1.28.0",
|
|
134
126
|
// 新增:显式声明协议版本
|
|
135
127
|
gridBasis: (s == null ? void 0 : s.gridBasis) ?? 30,
|
|
@@ -169,317 +161,337 @@ function Me(o, s) {
|
|
|
169
161
|
themeConfig: s == null ? void 0 : s.themeConfig,
|
|
170
162
|
referenceResolution: (s == null ? void 0 : s.referenceResolution) ?? { w: 1920, h: 1080 }
|
|
171
163
|
}, n = [];
|
|
172
|
-
|
|
164
|
+
y ? (e.navConfig = { ...e.navConfig, renderType: "none" }, n = [
|
|
173
165
|
{
|
|
174
166
|
tabId: m,
|
|
175
167
|
title: "Virtual Tab",
|
|
176
168
|
hidden: !0,
|
|
177
|
-
items:
|
|
169
|
+
items: b.value
|
|
178
170
|
}
|
|
179
|
-
]) : n =
|
|
180
|
-
const
|
|
181
|
-
page_spec:
|
|
171
|
+
]) : n = v.value;
|
|
172
|
+
const r = JSON.stringify({
|
|
173
|
+
page_spec: e,
|
|
182
174
|
tabs: n
|
|
183
175
|
});
|
|
184
|
-
if (
|
|
185
|
-
console.log(`[useGridTabs] triggerRootUpdate: Initializing tabsDataStr (length=${
|
|
176
|
+
if (d.value === "")
|
|
177
|
+
console.log(`[useGridTabs] triggerRootUpdate: Initializing tabsDataStr (length=${r.length})`), d.value = r, i = r;
|
|
186
178
|
else {
|
|
187
|
-
if (i ===
|
|
179
|
+
if (i === r) {
|
|
188
180
|
console.log("[useGridTabs] triggerRootUpdate: Data unchanged, skipping RELOAD_TABS");
|
|
189
181
|
return;
|
|
190
182
|
}
|
|
191
|
-
console.log(`[useGridTabs] triggerRootUpdate: Sending RELOAD_TABS action directly to Native (length=${
|
|
183
|
+
console.log(`[useGridTabs] triggerRootUpdate: Sending RELOAD_TABS action directly to Native (length=${r.length})`), d.value = r, i = r, l({
|
|
192
184
|
op: "RELOAD_TABS",
|
|
193
185
|
payload: {
|
|
194
|
-
pageSpec:
|
|
186
|
+
pageSpec: e,
|
|
195
187
|
// 兼容不同的 Gson alias
|
|
196
|
-
page_spec:
|
|
188
|
+
page_spec: e,
|
|
197
189
|
tabs: n
|
|
198
190
|
}
|
|
199
191
|
});
|
|
200
192
|
}
|
|
201
|
-
}, R = (
|
|
202
|
-
if (!
|
|
203
|
-
return
|
|
204
|
-
|
|
205
|
-
set(n,
|
|
206
|
-
const
|
|
207
|
-
return
|
|
193
|
+
}, R = (t) => {
|
|
194
|
+
if (!t || typeof t != "object" || t.__isGridTabsProxy)
|
|
195
|
+
return t;
|
|
196
|
+
t.content && typeof t.content == "object" && !t.content.__isGridTabsProxy && (t.content = new Proxy(t.content, {
|
|
197
|
+
set(n, r, u, f) {
|
|
198
|
+
const g = Reflect.set(n, r, u, f);
|
|
199
|
+
return t.id && c && l({
|
|
208
200
|
op: "UPDATE_ITEM",
|
|
209
|
-
itemId:
|
|
210
|
-
payload:
|
|
211
|
-
}),
|
|
201
|
+
itemId: t.id,
|
|
202
|
+
payload: t
|
|
203
|
+
}), g;
|
|
212
204
|
}
|
|
213
|
-
}), Object.defineProperty(
|
|
214
|
-
const
|
|
215
|
-
set(n,
|
|
216
|
-
const
|
|
217
|
-
return n.id &&
|
|
205
|
+
}), Object.defineProperty(t.content, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(t.content, "__v_skip", { value: !0, enumerable: !1 })), t.subItems && Array.isArray(t.subItems) && !t.subItems.__isGridTabsProxy && (t.subItems = p(t.subItems, t.id), Object.defineProperty(t.subItems, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(t.subItems, "__v_skip", { value: !0, enumerable: !1 }));
|
|
206
|
+
const e = new Proxy(t, {
|
|
207
|
+
set(n, r, u, f) {
|
|
208
|
+
const g = Reflect.set(n, r, u, f);
|
|
209
|
+
return n.id && c && l({
|
|
218
210
|
op: "UPDATE_ITEM",
|
|
219
211
|
itemId: n.id,
|
|
220
212
|
payload: n
|
|
221
|
-
}),
|
|
213
|
+
}), g;
|
|
222
214
|
}
|
|
223
215
|
});
|
|
224
|
-
return Object.defineProperty(
|
|
225
|
-
},
|
|
226
|
-
for (let n = 0; n <
|
|
227
|
-
|
|
228
|
-
return new Proxy(
|
|
229
|
-
get(n,
|
|
230
|
-
return
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
return
|
|
216
|
+
return Object.defineProperty(e, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(e, "__v_skip", { value: !0, enumerable: !1 }), e;
|
|
217
|
+
}, p = (t, e) => {
|
|
218
|
+
for (let n = 0; n < t.length; n++)
|
|
219
|
+
t[n] = R(t[n]);
|
|
220
|
+
return new Proxy(t, {
|
|
221
|
+
get(n, r, u) {
|
|
222
|
+
return r === "push" ? (...f) => {
|
|
223
|
+
f.forEach((C, he) => P(C, `push(${he})`)), c || console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");
|
|
224
|
+
const g = f.map((C) => R(C)), k = Array.prototype.push.apply(n, g);
|
|
225
|
+
return l({
|
|
234
226
|
op: "APPEND_SUB_ITEMS",
|
|
235
|
-
itemId:
|
|
236
|
-
payload: { subItems:
|
|
237
|
-
}),
|
|
238
|
-
} :
|
|
239
|
-
const
|
|
240
|
-
return
|
|
227
|
+
itemId: e,
|
|
228
|
+
payload: { subItems: g }
|
|
229
|
+
}), k;
|
|
230
|
+
} : r === "splice" ? (...f) => {
|
|
231
|
+
const g = f.length >= 2 && f[0] === 0 && f[1] === n.length, k = Array.prototype.splice.apply(n, f);
|
|
232
|
+
return c && g && e !== m ? l({
|
|
241
233
|
op: "UPDATE_TAB_STATE",
|
|
242
234
|
// 借用 UPDATE_TAB_STATE 指令,但带有特殊标识,要求底层清空该 Tab
|
|
243
|
-
itemId:
|
|
235
|
+
itemId: e,
|
|
244
236
|
payload: { action: "clear_items" }
|
|
245
|
-
}) :
|
|
246
|
-
} : Reflect.get(n,
|
|
237
|
+
}) : c && D("items array spliced"), k;
|
|
238
|
+
} : Reflect.get(n, r, u);
|
|
247
239
|
},
|
|
248
|
-
set(n,
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
return
|
|
240
|
+
set(n, r, u, f) {
|
|
241
|
+
if (r !== "length" && !isNaN(Number(r))) {
|
|
242
|
+
c || console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(r)}]。请先对 items.value 或 tabs.value 进行全量赋值!`), P(u, `索引赋值 [${String(r)}]`);
|
|
243
|
+
const g = R(u), k = Reflect.set(n, r, g, f);
|
|
244
|
+
return g && g.id && l({
|
|
253
245
|
op: "UPDATE_ITEM",
|
|
254
|
-
itemId:
|
|
255
|
-
payload:
|
|
256
|
-
}),
|
|
246
|
+
itemId: g.id,
|
|
247
|
+
payload: g
|
|
248
|
+
}), k;
|
|
257
249
|
}
|
|
258
|
-
return Reflect.set(n,
|
|
250
|
+
return Reflect.set(n, r, u, f);
|
|
259
251
|
}
|
|
260
252
|
});
|
|
261
|
-
},
|
|
262
|
-
set(
|
|
253
|
+
}, A = (t) => (t.items && Array.isArray(t.items) && !t.items.__isGridTabsProxy && (t.items = p(t.items, t.tabId), Object.defineProperty(t.items, "__isGridTabsProxy", { value: !0, enumerable: !1 })), new Proxy(t, {
|
|
254
|
+
set(e, n, r, u) {
|
|
263
255
|
if (n === "items") {
|
|
264
|
-
let
|
|
265
|
-
return Array.isArray(
|
|
256
|
+
let g = r;
|
|
257
|
+
return Array.isArray(r) && !r.__isGridTabsProxy && (g = p(r, e.tabId), Object.defineProperty(g, "__isGridTabsProxy", { value: !0, enumerable: !1 })), Reflect.set(e, n, g, u);
|
|
266
258
|
} else if (n === "loadState") {
|
|
267
|
-
const
|
|
268
|
-
return
|
|
259
|
+
const g = Reflect.set(e, n, r, u);
|
|
260
|
+
return c && e.tabId && l({
|
|
269
261
|
op: "UPDATE_TAB_STATE",
|
|
270
|
-
itemId:
|
|
271
|
-
payload: { loadState:
|
|
272
|
-
}),
|
|
262
|
+
itemId: e.tabId,
|
|
263
|
+
payload: { loadState: r }
|
|
264
|
+
}), g;
|
|
273
265
|
}
|
|
274
|
-
return Reflect.set(
|
|
266
|
+
return Reflect.set(e, n, r, u);
|
|
275
267
|
}
|
|
276
|
-
})),
|
|
277
|
-
const
|
|
278
|
-
return new Proxy(
|
|
279
|
-
set(n,
|
|
280
|
-
if (
|
|
281
|
-
let
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
return
|
|
268
|
+
})), w = (t) => {
|
|
269
|
+
const e = t.map((n) => A(n));
|
|
270
|
+
return new Proxy(e, {
|
|
271
|
+
set(n, r, u, f) {
|
|
272
|
+
if (r !== "length" && !isNaN(Number(r))) {
|
|
273
|
+
let g = u;
|
|
274
|
+
u.__isGridTabsProxy || (g = A(u), Object.defineProperty(g, "__isGridTabsProxy", { value: !0, enumerable: !1 }));
|
|
275
|
+
const k = Reflect.set(n, r, g, f);
|
|
276
|
+
return D(), k;
|
|
285
277
|
}
|
|
286
|
-
return Reflect.set(n,
|
|
278
|
+
return Reflect.set(n, r, u, f);
|
|
287
279
|
}
|
|
288
280
|
});
|
|
289
281
|
};
|
|
290
|
-
|
|
291
|
-
if (console.log("[useGridTabs] watch(tabs) triggered:", { newTabs:
|
|
292
|
-
|
|
282
|
+
J(v, (t, e) => {
|
|
283
|
+
if (console.log("[useGridTabs] watch(tabs) triggered:", { newTabs: t, isInitialized: c }), !t || t.length === 0) {
|
|
284
|
+
d.value = "", i = "", c = !1;
|
|
293
285
|
return;
|
|
294
286
|
}
|
|
295
|
-
if (
|
|
296
|
-
console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"),
|
|
287
|
+
if (t.__isGridTabsProxy)
|
|
288
|
+
console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"), D();
|
|
297
289
|
else {
|
|
298
290
|
console.log("[useGridTabs] newTabs is NOT a proxy, performing full deduceModeAndInitialize & wrapping");
|
|
299
|
-
const n =
|
|
300
|
-
Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }),
|
|
291
|
+
const n = w(t);
|
|
292
|
+
Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }), S(n, "2d"), v.value = n;
|
|
301
293
|
}
|
|
302
|
-
}, { flush: "sync", deep: !1 }),
|
|
303
|
-
if (console.log("[useGridTabs] watch(items) triggered:", { newItems:
|
|
304
|
-
|
|
294
|
+
}, { flush: "sync", deep: !1 }), J(b, (t, e) => {
|
|
295
|
+
if (console.log("[useGridTabs] watch(items) triggered:", { newItems: t, isInitialized: c }), !t || t.length === 0) {
|
|
296
|
+
d.value = "", i = "", c = !1;
|
|
305
297
|
return;
|
|
306
298
|
}
|
|
307
|
-
if (
|
|
308
|
-
console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"),
|
|
299
|
+
if (t.__isGridTabsProxy)
|
|
300
|
+
console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"), D();
|
|
309
301
|
else {
|
|
310
302
|
console.log("[useGridTabs] newItems is NOT a proxy, performing full deduceModeAndInitialize & wrapping");
|
|
311
|
-
const n =
|
|
312
|
-
Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }),
|
|
303
|
+
const n = p(t, m);
|
|
304
|
+
Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }), S(n, "1d"), b.value = n;
|
|
313
305
|
}
|
|
314
306
|
}, { flush: "sync", deep: !1 });
|
|
315
|
-
const T = {},
|
|
316
|
-
console.log("[useGridTabs] resetInitialization called manually"),
|
|
317
|
-
for (const
|
|
318
|
-
delete T[
|
|
319
|
-
},
|
|
320
|
-
if (!
|
|
321
|
-
|
|
307
|
+
const T = {}, $ = () => {
|
|
308
|
+
console.log("[useGridTabs] resetInitialization called manually"), c = !1, I.clear();
|
|
309
|
+
for (const t in T)
|
|
310
|
+
delete T[t];
|
|
311
|
+
}, E = (t) => {
|
|
312
|
+
if (!t || t.length === 0) {
|
|
313
|
+
d.value = "", c = !1;
|
|
322
314
|
return;
|
|
323
315
|
}
|
|
324
|
-
|
|
325
|
-
}, _ = (
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
tabsData:
|
|
316
|
+
t[0].hasOwnProperty("tabId") || t[0].hasOwnProperty("items") && Array.isArray(t[0].items) ? v.value = t : b.value = t;
|
|
317
|
+
}, _ = (t) => {
|
|
318
|
+
a.value = t;
|
|
319
|
+
}, O = Ae(() => ({
|
|
320
|
+
tabsData: d.value,
|
|
329
321
|
// 不再绑定 actionPayload 属性,完全走命令式 API,防止触发无意义的 Vue 节点更新
|
|
330
|
-
onTabNeedsData: async (...
|
|
331
|
-
let
|
|
332
|
-
if (
|
|
322
|
+
onTabNeedsData: async (...t) => {
|
|
323
|
+
let e = t[0];
|
|
324
|
+
if (e && e.nativeEvent && (e = e.nativeEvent), !a.value.onTabNeedsData)
|
|
333
325
|
return;
|
|
334
|
-
const { tabId: n, index:
|
|
335
|
-
if (
|
|
326
|
+
const { tabId: n, index: r, reason: u } = e;
|
|
327
|
+
if (I.has(n)) {
|
|
336
328
|
console.log(`[useGridTabs] onTabNeedsData SKIP: tabId=${n} 已经发起过请求,防止死循环`);
|
|
337
329
|
return;
|
|
338
330
|
}
|
|
339
|
-
|
|
331
|
+
I.add(n);
|
|
340
332
|
try {
|
|
341
|
-
const
|
|
342
|
-
if (
|
|
343
|
-
if (T[n] = 1,
|
|
344
|
-
const
|
|
345
|
-
|
|
333
|
+
const f = await a.value.onTabNeedsData(n, r, u);
|
|
334
|
+
if (f && Array.isArray(f))
|
|
335
|
+
if (T[n] = 1, f.length > 0) {
|
|
336
|
+
const g = v.value.find((k) => k.tabId === n);
|
|
337
|
+
g && (g.items ? g.items.length > 0 && g.items.splice(0, g.items.length) : g.items = [], g.items.push(...f), g.loadState = "ready", l({
|
|
346
338
|
op: "UPDATE_TAB_STATE",
|
|
347
339
|
itemId: n,
|
|
348
340
|
payload: { loadState: "ready" }
|
|
349
341
|
}));
|
|
350
342
|
} else
|
|
351
343
|
console.warn(`[useGridTabs] ⚠️ 警告: onTabNeedsData(tabId="${n}") 返回了空数组 []!`), console.warn("👉 如果你已经在此函数内手动调用了 push() 来追加数据,请在最后 return null 或 undefined。"), console.warn("👉 如果该 Tab 确实没有数据,返回 [] 可能会导致底层的 Header 等已有元素被清空,请注意检查。"), console.warn("👉 框架已为您拦截此次空数组覆盖,保留了当前的 DOM 结构。");
|
|
352
|
-
} catch (
|
|
353
|
-
console.error("[useGridTabs] onTabNeedsData 执行失败:",
|
|
344
|
+
} catch (f) {
|
|
345
|
+
console.error("[useGridTabs] onTabNeedsData 执行失败:", f), I.delete(n);
|
|
354
346
|
}
|
|
355
347
|
},
|
|
356
|
-
onLoadMore: async (...
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
348
|
+
onLoadMore: async (...t) => {
|
|
349
|
+
let e = t[0];
|
|
350
|
+
if (e && e.nativeEvent && (e = e.nativeEvent), !a.value.onLoadMore)
|
|
359
351
|
return;
|
|
360
|
-
const { tabId: n, itemId:
|
|
361
|
-
console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${n}, pageNo=${
|
|
352
|
+
const { tabId: n, itemId: r } = e, f = (T[n] || 1) + 1;
|
|
353
|
+
console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${n}, pageNo=${f}`);
|
|
362
354
|
try {
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
365
|
-
if (
|
|
366
|
-
if (T[n] =
|
|
367
|
-
|
|
355
|
+
const g = await a.value.onLoadMore(n, f, r);
|
|
356
|
+
if (g && Array.isArray(g))
|
|
357
|
+
if (g.length > 0)
|
|
358
|
+
if (T[n] = f, y)
|
|
359
|
+
b.value.push(...g);
|
|
368
360
|
else {
|
|
369
|
-
const
|
|
370
|
-
|
|
361
|
+
const k = v.value.find((C) => C.tabId === n);
|
|
362
|
+
k && k.items && k.items.push(...g);
|
|
371
363
|
}
|
|
372
364
|
else
|
|
373
|
-
console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${n}", pageNo="${
|
|
374
|
-
} catch (
|
|
375
|
-
console.error("[useGridTabs] onLoadMore 业务层请求失败:",
|
|
365
|
+
console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${n}", pageNo="${f}") 返回了空数组 []!`), console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'), console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。");
|
|
366
|
+
} catch (g) {
|
|
367
|
+
console.error("[useGridTabs] onLoadMore 业务层请求失败:", g);
|
|
376
368
|
}
|
|
377
369
|
},
|
|
378
|
-
onItemPresence: (...
|
|
379
|
-
let
|
|
380
|
-
if (console.log("[useGridTabs] ⚡️ bindings caught onItemPresence:",
|
|
370
|
+
onItemPresence: (...t) => {
|
|
371
|
+
let e = t[0];
|
|
372
|
+
if (console.log("[useGridTabs] ⚡️ bindings caught onItemPresence:", e), a.value.onItemPresence)
|
|
381
373
|
try {
|
|
382
|
-
let n = typeof
|
|
374
|
+
let n = typeof e == "string" ? e : (e == null ? void 0 : e.nativeEvent) || e;
|
|
383
375
|
n && typeof n.data == "string" && (n = n.data);
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}) :
|
|
376
|
+
const r = typeof n == "string" ? JSON.parse(n) : n;
|
|
377
|
+
r && r.type === "VIEW_PRESENCE_BATCH" && Array.isArray(r.payload) ? r.payload.forEach((u) => {
|
|
378
|
+
u.itemId && typeof u.itemId == "string" && u.itemId.startsWith("fallback_pos_") && console.warn(`[useGridTabs] ⚠️ 警告:检测到列表项曝光 (index=${u.index}),但未配置 itemId。请检查传入的 items 数组,务必为每个数据项指定唯一的 itemId,否则底层无法准确进行去重与曝光上报。`), a.value.onItemPresence(u);
|
|
379
|
+
}) : a.value.onItemPresence(r);
|
|
388
380
|
} catch (n) {
|
|
389
|
-
console.error("[useGridTabs] Failed to parse onItemPresence event payload:", n),
|
|
381
|
+
console.error("[useGridTabs] Failed to parse onItemPresence event payload:", n), a.value.onItemPresence(e);
|
|
390
382
|
}
|
|
391
383
|
},
|
|
392
|
-
onTabSelected: (...
|
|
393
|
-
let
|
|
394
|
-
|
|
384
|
+
onTabSelected: (...t) => {
|
|
385
|
+
let e = t[0];
|
|
386
|
+
e && e.nativeEvent && (e = e.nativeEvent), a.value.onTabSelected && a.value.onTabSelected(e);
|
|
395
387
|
},
|
|
396
|
-
onItemClick: (...
|
|
397
|
-
let
|
|
398
|
-
if (console.log("[useGridTabs] RAW onItemClick intercepted from Native:",
|
|
388
|
+
onItemClick: (...t) => {
|
|
389
|
+
let e = t[0];
|
|
390
|
+
if (console.log("[useGridTabs] RAW onItemClick intercepted from Native:", e), e && e.nativeEvent && (e = e.nativeEvent), a.value.onItemClick)
|
|
399
391
|
try {
|
|
400
|
-
let n = typeof
|
|
392
|
+
let n = typeof e == "string" ? e : (e == null ? void 0 : e.data) || e;
|
|
401
393
|
console.log("[useGridTabs] Parsed eventStr:", n);
|
|
402
|
-
const
|
|
403
|
-
|
|
394
|
+
const r = typeof n == "string" ? JSON.parse(n) : n;
|
|
395
|
+
a.value.onItemClick(r);
|
|
404
396
|
} catch (n) {
|
|
405
|
-
console.error("[useGridTabs] Failed to parse onItemClick event payload:", n),
|
|
397
|
+
console.error("[useGridTabs] Failed to parse onItemClick event payload:", n), a.value.onItemClick(e);
|
|
406
398
|
}
|
|
407
399
|
else
|
|
408
400
|
console.warn("[useGridTabs] onItemClick triggered but NO callback registered in callbacksRef!");
|
|
409
401
|
},
|
|
410
|
-
onItemFocused: (...
|
|
411
|
-
let
|
|
412
|
-
if (
|
|
402
|
+
onItemFocused: (...t) => {
|
|
403
|
+
let e = t[0];
|
|
404
|
+
if (e && e.nativeEvent && (e = e.nativeEvent), a.value.onItemFocused)
|
|
413
405
|
try {
|
|
414
|
-
let n = typeof
|
|
415
|
-
const
|
|
416
|
-
|
|
406
|
+
let n = typeof e == "string" ? e : (e == null ? void 0 : e.data) || e;
|
|
407
|
+
const r = typeof n == "string" ? JSON.parse(n) : n;
|
|
408
|
+
a.value.onItemFocused(r);
|
|
417
409
|
} catch (n) {
|
|
418
|
-
console.error("[useGridTabs] Failed to parse onItemFocused event payload:", n),
|
|
410
|
+
console.error("[useGridTabs] Failed to parse onItemFocused event payload:", n), a.value.onItemFocused(e);
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
onTabFocused: (...t) => {
|
|
414
|
+
let e = t[0];
|
|
415
|
+
e && e.nativeEvent && (e = e.nativeEvent), a.value.onTabFocused && a.value.onTabFocused(e);
|
|
416
|
+
},
|
|
417
|
+
onScroll: (...t) => {
|
|
418
|
+
let e = t[0];
|
|
419
|
+
if (e && e.nativeEvent && (e = e.nativeEvent), a.value.onScroll)
|
|
420
|
+
try {
|
|
421
|
+
const n = (e == null ? void 0 : e.data) || e;
|
|
422
|
+
a.value.onScroll(n);
|
|
423
|
+
} catch {
|
|
424
|
+
a.value.onScroll(e);
|
|
419
425
|
}
|
|
420
426
|
},
|
|
421
|
-
|
|
422
|
-
let
|
|
423
|
-
|
|
427
|
+
onScrollStateChanged: (...t) => {
|
|
428
|
+
let e = t[0];
|
|
429
|
+
if (e && e.nativeEvent && (e = e.nativeEvent), a.value.onScrollStateChanged)
|
|
430
|
+
try {
|
|
431
|
+
const n = (e == null ? void 0 : e.data) || e;
|
|
432
|
+
a.value.onScrollStateChanged(n);
|
|
433
|
+
} catch {
|
|
434
|
+
a.value.onScrollStateChanged(e);
|
|
435
|
+
}
|
|
424
436
|
}
|
|
425
437
|
}));
|
|
426
438
|
return {
|
|
427
|
-
tabsDataStr:
|
|
428
|
-
bindings:
|
|
429
|
-
tabs:
|
|
430
|
-
items:
|
|
431
|
-
initData:
|
|
439
|
+
tabsDataStr: d,
|
|
440
|
+
bindings: O,
|
|
441
|
+
tabs: v,
|
|
442
|
+
items: b,
|
|
443
|
+
initData: E,
|
|
432
444
|
setCallbacks: _,
|
|
433
|
-
updateItem: (
|
|
434
|
-
if (!
|
|
445
|
+
updateItem: (t, e) => {
|
|
446
|
+
if (!c) {
|
|
435
447
|
console.error("[useGridTabs] ❌ 时机错误: 尚未初始化数据,无法调用 updateItem");
|
|
436
448
|
return;
|
|
437
449
|
}
|
|
438
|
-
|
|
439
|
-
const n = (
|
|
440
|
-
for (const
|
|
441
|
-
|
|
450
|
+
l({ op: "UPDATE_ITEM", itemId: t, payload: e });
|
|
451
|
+
const n = (r) => {
|
|
452
|
+
for (const u in e)
|
|
453
|
+
u === "content" && r.content ? Object.assign(r.content, e.content) : r[u] = e[u];
|
|
442
454
|
};
|
|
443
|
-
if (
|
|
444
|
-
const
|
|
445
|
-
|
|
455
|
+
if (y) {
|
|
456
|
+
const r = b.value.find((u) => u.id === t);
|
|
457
|
+
r && n(r);
|
|
446
458
|
} else
|
|
447
|
-
for (const
|
|
448
|
-
if (
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
451
|
-
n(
|
|
459
|
+
for (const r of v.value)
|
|
460
|
+
if (r.items) {
|
|
461
|
+
const u = r.items.find((f) => f.id === t);
|
|
462
|
+
if (u) {
|
|
463
|
+
n(u);
|
|
452
464
|
break;
|
|
453
465
|
}
|
|
454
466
|
}
|
|
455
467
|
},
|
|
456
|
-
dispatchAction:
|
|
457
|
-
resetInitialization:
|
|
458
|
-
getFocusState: async () => new Promise((
|
|
468
|
+
dispatchAction: l,
|
|
469
|
+
resetInitialization: $,
|
|
470
|
+
getFocusState: async () => new Promise((t, e) => {
|
|
459
471
|
let n = o.value;
|
|
460
|
-
typeof o.value.getNativeNode == "function" ? n = o.value.getNativeNode() || o.value : o.value.nativeRef && (n = o.value.nativeRef),
|
|
472
|
+
typeof o.value.getNativeNode == "function" ? n = o.value.getNativeNode() || o.value : o.value.nativeRef && (n = o.value.nativeRef), G.callUIFunction(n, "getFocusState", [], (r) => {
|
|
461
473
|
try {
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
} catch (
|
|
465
|
-
|
|
474
|
+
const u = typeof r == "string" ? JSON.parse(r) : r;
|
|
475
|
+
t(u);
|
|
476
|
+
} catch (u) {
|
|
477
|
+
e(u);
|
|
466
478
|
}
|
|
467
479
|
});
|
|
468
480
|
}),
|
|
469
|
-
getItemRect: async (
|
|
470
|
-
let
|
|
471
|
-
typeof o.value.getNativeNode == "function" ?
|
|
481
|
+
getItemRect: async (t) => new Promise((e, n) => {
|
|
482
|
+
let r = o.value;
|
|
483
|
+
typeof o.value.getNativeNode == "function" ? r = o.value.getNativeNode() || o.value : o.value.nativeRef && (r = o.value.nativeRef), G.callUIFunction(r, "getItemRect", [t], (u) => {
|
|
472
484
|
try {
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
} catch (
|
|
476
|
-
n(
|
|
485
|
+
const f = typeof u == "string" ? JSON.parse(u) : u;
|
|
486
|
+
e(f);
|
|
487
|
+
} catch (f) {
|
|
488
|
+
n(f);
|
|
477
489
|
}
|
|
478
490
|
});
|
|
479
491
|
})
|
|
480
492
|
};
|
|
481
493
|
}
|
|
482
|
-
const
|
|
494
|
+
const re = "QtKeyboard", ae = /* @__PURE__ */ q({
|
|
483
495
|
__name: "Keyboard",
|
|
484
496
|
props: {
|
|
485
497
|
backgroundColor: {},
|
|
@@ -495,28 +507,42 @@ const ae = "QtKeyboard", re = /* @__PURE__ */ M({
|
|
|
495
507
|
textDelete: {},
|
|
496
508
|
currentInput: {},
|
|
497
509
|
autofocus: { type: Boolean },
|
|
498
|
-
requestFocus: { type: Boolean }
|
|
510
|
+
requestFocus: { type: Boolean },
|
|
511
|
+
keyboardType: {},
|
|
512
|
+
rememberKeyboardType: { type: Boolean }
|
|
499
513
|
},
|
|
500
514
|
emits: ["onInputChanged", "onKeyPressed"],
|
|
501
|
-
setup(o, { expose: s }) {
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
|
|
515
|
+
setup(o, { expose: s, emit: d }) {
|
|
516
|
+
const v = x(), b = W(), y = re + "_Plugin", m = (b.isPluginActive ? y : re).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), i = z(
|
|
517
|
+
m,
|
|
518
|
+
b.pluginPackageName || "com.quicktvui.plugin.extraui",
|
|
505
519
|
"com.quicktvui.plugin.extraui.ExtraUIPluginApp"
|
|
506
|
-
);
|
|
507
|
-
return
|
|
520
|
+
), a = o;
|
|
521
|
+
return me(() => {
|
|
522
|
+
(a.autofocus || a.requestFocus) && setTimeout(() => {
|
|
523
|
+
var P, h;
|
|
524
|
+
const l = ((h = (P = v.value) == null ? void 0 : P.getNativeNode) == null ? void 0 : h.call(P)) || v.value;
|
|
525
|
+
l && G.callUIFunction(l, "requestFocus", [!0]);
|
|
526
|
+
}, 300);
|
|
527
|
+
}), J(() => a.requestFocus, (l) => {
|
|
528
|
+
l && setTimeout(() => {
|
|
529
|
+
var h, S;
|
|
530
|
+
const P = ((S = (h = v.value) == null ? void 0 : h.getNativeNode) == null ? void 0 : S.call(h)) || v.value;
|
|
531
|
+
P && G.callUIFunction(P, "requestFocus", [!0]);
|
|
532
|
+
}, 300);
|
|
533
|
+
}), s({
|
|
508
534
|
getNativeNode: () => {
|
|
509
|
-
var
|
|
510
|
-
return ((
|
|
535
|
+
var l, P;
|
|
536
|
+
return ((P = (l = v.value) == null ? void 0 : l.getNativeNode) == null ? void 0 : P.call(l)) || v.value;
|
|
511
537
|
},
|
|
512
|
-
requestFocus: (...
|
|
513
|
-
var
|
|
514
|
-
const
|
|
515
|
-
|
|
538
|
+
requestFocus: (...l) => {
|
|
539
|
+
var h, S;
|
|
540
|
+
const P = ((S = (h = v.value) == null ? void 0 : h.getNativeNode) == null ? void 0 : S.call(h)) || v.value;
|
|
541
|
+
P && G.callUIFunction(P, "requestFocus", l);
|
|
516
542
|
}
|
|
517
|
-
}), (
|
|
543
|
+
}), (l, P) => (Q(), B(U(i), K({
|
|
518
544
|
ref_key: "nativeRef",
|
|
519
|
-
ref:
|
|
545
|
+
ref: v,
|
|
520
546
|
backgroundColor: o.backgroundColor,
|
|
521
547
|
backgroundGradient: o.backgroundGradient,
|
|
522
548
|
textColor: o.textColor,
|
|
@@ -531,34 +557,36 @@ const ae = "QtKeyboard", re = /* @__PURE__ */ M({
|
|
|
531
557
|
currentInput: o.currentInput,
|
|
532
558
|
autofocus: o.autofocus,
|
|
533
559
|
requestFocus: o.requestFocus,
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
560
|
+
keyboardType: o.keyboardType,
|
|
561
|
+
rememberKeyboardType: o.rememberKeyboardType ?? !0,
|
|
562
|
+
onOnInputChanged: P[0] || (P[0] = (h) => l.$emit("onInputChanged", h.nativeEvent)),
|
|
563
|
+
onOnKeyPressed: P[1] || (P[1] = (h) => l.$emit("onKeyPressed", h.nativeEvent))
|
|
564
|
+
}, l.$attrs), {
|
|
565
|
+
default: j(() => [
|
|
566
|
+
V(l.$slots, "default")
|
|
539
567
|
]),
|
|
540
568
|
_: 3
|
|
541
|
-
}, 16, ["backgroundColor", "backgroundGradient", "textColor", "weakTextColor", "focusBackgroundColor", "focusTextColor", "placeholder", "textFullKeyboard", "textT9Keyboard", "textClear", "textDelete", "currentInput", "autofocus", "requestFocus"]));
|
|
569
|
+
}, 16, ["backgroundColor", "backgroundGradient", "textColor", "weakTextColor", "focusBackgroundColor", "focusTextColor", "placeholder", "textFullKeyboard", "textT9Keyboard", "textClear", "textDelete", "currentInput", "autofocus", "requestFocus", "keyboardType", "rememberKeyboardType"]));
|
|
542
570
|
}
|
|
543
571
|
});
|
|
544
|
-
let
|
|
572
|
+
let X;
|
|
545
573
|
var fe;
|
|
546
574
|
try {
|
|
547
575
|
const o = require("@extscreen/es3-vue");
|
|
548
|
-
|
|
576
|
+
X = o.registerElement || ((fe = o.default) == null ? void 0 : fe.registerElement);
|
|
549
577
|
} catch {
|
|
550
578
|
}
|
|
551
|
-
const
|
|
579
|
+
const Se = {
|
|
552
580
|
install: (o) => {
|
|
553
581
|
if (!globalThis.__QtKeyboard_registered)
|
|
554
|
-
if (
|
|
555
|
-
const s = (
|
|
556
|
-
|
|
582
|
+
if (X) {
|
|
583
|
+
const s = (d, v) => {
|
|
584
|
+
X(d, {
|
|
557
585
|
component: {
|
|
558
|
-
name:
|
|
559
|
-
processEventData(
|
|
560
|
-
const
|
|
561
|
-
return
|
|
586
|
+
name: v ? "QtKeyboard_Plugin" : "QtKeyboard",
|
|
587
|
+
processEventData(b, y) {
|
|
588
|
+
const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
|
|
589
|
+
return c && (c.nativeEvent = m), c;
|
|
562
590
|
}
|
|
563
591
|
}
|
|
564
592
|
});
|
|
@@ -566,49 +594,49 @@ const _e = {
|
|
|
566
594
|
s("qt-keyboard", !1), s("qt-keyboard-plugin", !0), s("QtKeyboard", !1), s("QtKeyboard_Plugin", !0), globalThis.__QtKeyboard_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtKeyboard");
|
|
567
595
|
} else
|
|
568
596
|
console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
|
|
569
|
-
o.component("Keyboard",
|
|
597
|
+
o.component("Keyboard", ae), o.component("qt-keyboard", ae);
|
|
570
598
|
}
|
|
571
|
-
}, ie = "QtPortalPool", le = /* @__PURE__ */
|
|
599
|
+
}, ie = "QtPortalPool", le = /* @__PURE__ */ q({
|
|
572
600
|
__name: "PortalPool",
|
|
573
601
|
setup(o, { expose: s }) {
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
|
|
602
|
+
const d = x(), v = W(), b = ie + "_Plugin", c = (v.isPluginActive ? b : ie).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
|
|
603
|
+
c,
|
|
604
|
+
v.pluginPackageName || "com.quicktvui.plugin.glintui"
|
|
577
605
|
);
|
|
578
606
|
return s({
|
|
579
607
|
getNativeNode: () => {
|
|
580
|
-
var i,
|
|
581
|
-
return ((
|
|
608
|
+
var i, a;
|
|
609
|
+
return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
|
|
582
610
|
}
|
|
583
|
-
}), (i,
|
|
611
|
+
}), (i, a) => (Q(), B(U(m), K({
|
|
584
612
|
ref_key: "nativeRef",
|
|
585
|
-
ref:
|
|
613
|
+
ref: d
|
|
586
614
|
}, i.$attrs), {
|
|
587
|
-
default:
|
|
588
|
-
|
|
615
|
+
default: j(() => [
|
|
616
|
+
V(i.$slots, "default")
|
|
589
617
|
]),
|
|
590
618
|
_: 3
|
|
591
619
|
}, 16));
|
|
592
620
|
}
|
|
593
621
|
});
|
|
594
|
-
let
|
|
595
|
-
var
|
|
622
|
+
let ee;
|
|
623
|
+
var be;
|
|
596
624
|
try {
|
|
597
625
|
const o = require("@extscreen/es3-vue");
|
|
598
|
-
|
|
626
|
+
ee = o.registerElement || ((be = o.default) == null ? void 0 : be.registerElement);
|
|
599
627
|
} catch {
|
|
600
628
|
}
|
|
601
629
|
const $e = {
|
|
602
630
|
install: (o) => {
|
|
603
631
|
if (!globalThis.__QtPortalPool_registered)
|
|
604
|
-
if (
|
|
605
|
-
const s = (
|
|
606
|
-
|
|
632
|
+
if (ee) {
|
|
633
|
+
const s = (d, v) => {
|
|
634
|
+
ee(d, {
|
|
607
635
|
component: {
|
|
608
|
-
name:
|
|
609
|
-
processEventData(
|
|
610
|
-
const
|
|
611
|
-
return
|
|
636
|
+
name: v ? "QtPortalPool_Plugin" : "QtPortalPool",
|
|
637
|
+
processEventData(b, y) {
|
|
638
|
+
const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
|
|
639
|
+
return c && (c.nativeEvent = m), c;
|
|
612
640
|
}
|
|
613
641
|
}
|
|
614
642
|
});
|
|
@@ -618,51 +646,51 @@ const $e = {
|
|
|
618
646
|
console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
|
|
619
647
|
o.component("PortalPool", le), o.component("qt-portal-pool", le);
|
|
620
648
|
}
|
|
621
|
-
}, ce = "QtPortalItem", ue = /* @__PURE__ */
|
|
649
|
+
}, ce = "QtPortalItem", ue = /* @__PURE__ */ q({
|
|
622
650
|
__name: "PortalItem",
|
|
623
651
|
props: {
|
|
624
652
|
portalId: {}
|
|
625
653
|
},
|
|
626
654
|
setup(o, { expose: s }) {
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
|
|
655
|
+
const d = x(), v = W(), b = ce + "_Plugin", c = (v.isPluginActive ? b : ce).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
|
|
656
|
+
c,
|
|
657
|
+
v.pluginPackageName || "com.quicktvui.plugin.glintui"
|
|
630
658
|
);
|
|
631
659
|
return s({
|
|
632
660
|
getNativeNode: () => {
|
|
633
|
-
var i,
|
|
634
|
-
return ((
|
|
661
|
+
var i, a;
|
|
662
|
+
return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
|
|
635
663
|
}
|
|
636
|
-
}), (i,
|
|
664
|
+
}), (i, a) => (Q(), B(U(m), K({
|
|
637
665
|
ref_key: "nativeRef",
|
|
638
|
-
ref:
|
|
666
|
+
ref: d,
|
|
639
667
|
portalId: o.portalId
|
|
640
668
|
}, i.$attrs), {
|
|
641
|
-
default:
|
|
642
|
-
|
|
669
|
+
default: j(() => [
|
|
670
|
+
V(i.$slots, "default")
|
|
643
671
|
]),
|
|
644
672
|
_: 3
|
|
645
673
|
}, 16, ["portalId"]));
|
|
646
674
|
}
|
|
647
675
|
});
|
|
648
|
-
let
|
|
649
|
-
var
|
|
676
|
+
let te;
|
|
677
|
+
var ye;
|
|
650
678
|
try {
|
|
651
679
|
const o = require("@extscreen/es3-vue");
|
|
652
|
-
|
|
680
|
+
te = o.registerElement || ((ye = o.default) == null ? void 0 : ye.registerElement);
|
|
653
681
|
} catch {
|
|
654
682
|
}
|
|
655
|
-
const
|
|
683
|
+
const _e = {
|
|
656
684
|
install: (o) => {
|
|
657
685
|
if (!globalThis.__QtPortalItem_registered)
|
|
658
|
-
if (
|
|
659
|
-
const s = (
|
|
660
|
-
|
|
686
|
+
if (te) {
|
|
687
|
+
const s = (d, v) => {
|
|
688
|
+
te(d, {
|
|
661
689
|
component: {
|
|
662
|
-
name:
|
|
663
|
-
processEventData(
|
|
664
|
-
const
|
|
665
|
-
return
|
|
690
|
+
name: v ? "QtPortalItem_Plugin" : "QtPortalItem",
|
|
691
|
+
processEventData(b, y) {
|
|
692
|
+
const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
|
|
693
|
+
return c && (c.nativeEvent = m), c;
|
|
666
694
|
}
|
|
667
695
|
}
|
|
668
696
|
});
|
|
@@ -672,28 +700,28 @@ const Se = {
|
|
|
672
700
|
console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
|
|
673
701
|
o.component("PortalItem", ue), o.component("qt-portal-item", ue);
|
|
674
702
|
}
|
|
675
|
-
}, de = "QtHsvBackground", ve = /* @__PURE__ */
|
|
703
|
+
}, de = "QtHsvBackground", ve = /* @__PURE__ */ q({
|
|
676
704
|
__name: "HsvBackground",
|
|
677
705
|
props: {
|
|
678
706
|
hue: { default: -2 }
|
|
679
707
|
},
|
|
680
708
|
setup(o, { expose: s }) {
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
|
|
709
|
+
const d = x(), v = W(), b = de + "_Plugin", c = (v.isPluginActive ? b : de).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
|
|
710
|
+
c,
|
|
711
|
+
v.pluginPackageName || "com.quicktvui.plugin.glintui"
|
|
684
712
|
);
|
|
685
713
|
return s({
|
|
686
714
|
getNativeNode: () => {
|
|
687
|
-
var i,
|
|
688
|
-
return ((
|
|
715
|
+
var i, a;
|
|
716
|
+
return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
|
|
689
717
|
}
|
|
690
|
-
}), (i,
|
|
718
|
+
}), (i, a) => (Q(), B(U(m), K({
|
|
691
719
|
ref_key: "nativeRef",
|
|
692
|
-
ref:
|
|
720
|
+
ref: d,
|
|
693
721
|
hue: o.hue
|
|
694
722
|
}, i.$attrs), {
|
|
695
|
-
default:
|
|
696
|
-
|
|
723
|
+
default: j(() => [
|
|
724
|
+
V(i.$slots, "default")
|
|
697
725
|
]),
|
|
698
726
|
_: 3
|
|
699
727
|
}, 16, ["hue"]));
|
|
@@ -706,8 +734,8 @@ const Se = {
|
|
|
706
734
|
// 如果设置为 true,则全局跳过所有组件的原生插件安装检查,直接渲染
|
|
707
735
|
skipPluginCheck: !1
|
|
708
736
|
}, Z = /* @__PURE__ */ new Set();
|
|
709
|
-
function
|
|
710
|
-
return
|
|
737
|
+
function z(o, s, d) {
|
|
738
|
+
return q({
|
|
711
739
|
name: `${o}AsyncWrapper`,
|
|
712
740
|
inheritAttrs: !1,
|
|
713
741
|
props: {
|
|
@@ -717,59 +745,59 @@ function V(o, s, u) {
|
|
|
717
745
|
default: !1
|
|
718
746
|
}
|
|
719
747
|
},
|
|
720
|
-
setup(
|
|
721
|
-
const m =
|
|
722
|
-
|
|
748
|
+
setup(v, { slots: b, attrs: y, expose: c }) {
|
|
749
|
+
const m = x("loading"), i = x(""), a = x(), l = globalThis.__VUE_INSTANCE__;
|
|
750
|
+
c({
|
|
723
751
|
getNativeNode: () => {
|
|
724
|
-
let
|
|
725
|
-
return !
|
|
752
|
+
let p = a.value;
|
|
753
|
+
return !p && l && l.vnode && l.vnode.el && (p = l.vnode.el, p.childNodes && p.childNodes.length > 0 && (p = p.childNodes[0])), p;
|
|
726
754
|
},
|
|
727
|
-
nativeRef:
|
|
755
|
+
nativeRef: a
|
|
728
756
|
});
|
|
729
|
-
let
|
|
757
|
+
let S = null, I = null;
|
|
730
758
|
try {
|
|
731
|
-
|
|
732
|
-
} catch (
|
|
733
|
-
console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。",
|
|
759
|
+
S = pe(), I = we();
|
|
760
|
+
} catch (p) {
|
|
761
|
+
console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。", p);
|
|
734
762
|
}
|
|
735
|
-
const
|
|
736
|
-
if (!
|
|
763
|
+
const D = async () => {
|
|
764
|
+
if (!S || typeof S.isComponentRegistered != "function")
|
|
737
765
|
return console.log("[withAsyncPlugin] es.isComponentRegistered 不可用"), !1;
|
|
738
766
|
try {
|
|
739
|
-
const
|
|
740
|
-
if (console.log(`[withAsyncPlugin] isComponentRegistered('${o}') 返回:`,
|
|
767
|
+
const p = await S.isComponentRegistered(o);
|
|
768
|
+
if (console.log(`[withAsyncPlugin] isComponentRegistered('${o}') 返回:`, p), p === !0 || p && typeof p == "object" && (p.registered === !0 || p.isRegistered === !0))
|
|
741
769
|
return !0;
|
|
742
770
|
try {
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
745
|
-
const
|
|
746
|
-
console.log(`[withAsyncPlugin] 当前引擎核心版本: ${
|
|
747
|
-
const T =
|
|
771
|
+
const A = await G.callNativeWithPromise("ExtendModule", "getCoreSDKInfo");
|
|
772
|
+
if (A && A.core_version) {
|
|
773
|
+
const w = A.core_version;
|
|
774
|
+
console.log(`[withAsyncPlugin] 当前引擎核心版本: ${w}`);
|
|
775
|
+
const T = w.split(".").map(($) => parseInt($, 10));
|
|
748
776
|
if (T.length >= 3 && !isNaN(T[0]) && !isNaN(T[1]) && !isNaN(T[2]))
|
|
749
777
|
if (T[0] * 1e6 + T[1] * 1e3 + T[2] >= 1011205) {
|
|
750
778
|
console.log(`[withAsyncPlugin] 引擎 >= 1.11.205,使用 ExtendModule 检查 Controller: ${o}`);
|
|
751
|
-
const
|
|
752
|
-
console.log(`[withAsyncPlugin] 同时检查原名和驼峰名: ${o}, ${
|
|
753
|
-
const [_,
|
|
754
|
-
|
|
755
|
-
|
|
779
|
+
const E = o.split("-").map((N) => N.charAt(0).toUpperCase() + N.slice(1)).join("");
|
|
780
|
+
console.log(`[withAsyncPlugin] 同时检查原名和驼峰名: ${o}, ${E}`);
|
|
781
|
+
const [_, O] = await Promise.all([
|
|
782
|
+
G.callNativeWithPromise("ExtendModule", "isComponentRegistered", o).catch(() => !1),
|
|
783
|
+
G.callNativeWithPromise("ExtendModule", "isComponentRegistered", E).catch(() => !1)
|
|
756
784
|
]);
|
|
757
|
-
if (console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${_}, ${
|
|
785
|
+
if (console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${_}, ${O}]`), _ === !0 || O === !0)
|
|
758
786
|
return !0;
|
|
759
787
|
} else
|
|
760
|
-
console.log(`[withAsyncPlugin] 引擎版本 ${
|
|
788
|
+
console.log(`[withAsyncPlugin] 引擎版本 ${w} < 1.11.205,跳过 ExtendModule 检查`);
|
|
761
789
|
else
|
|
762
|
-
console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${
|
|
790
|
+
console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${w}`);
|
|
763
791
|
}
|
|
764
|
-
} catch (
|
|
765
|
-
console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:",
|
|
792
|
+
} catch (A) {
|
|
793
|
+
console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:", A);
|
|
766
794
|
}
|
|
767
795
|
return !1;
|
|
768
|
-
} catch (
|
|
769
|
-
return console.warn("[withAsyncPlugin] 检查组件注册状态异常:",
|
|
796
|
+
} catch (p) {
|
|
797
|
+
return console.warn("[withAsyncPlugin] 检查组件注册状态异常:", p), !1;
|
|
770
798
|
}
|
|
771
799
|
}, R = async () => {
|
|
772
|
-
if (xe.skipPluginCheck ||
|
|
800
|
+
if (xe.skipPluginCheck || v.skipPluginCheck) {
|
|
773
801
|
console.log(`[withAsyncPlugin] 跳过 ${o} 插件检查 (skipPluginCheck = true)`), m.value = "ready";
|
|
774
802
|
return;
|
|
775
803
|
}
|
|
@@ -777,144 +805,148 @@ function V(o, s, u) {
|
|
|
777
805
|
m.value = "ready";
|
|
778
806
|
return;
|
|
779
807
|
}
|
|
780
|
-
const
|
|
781
|
-
if (console.log(`[withAsyncPlugin] 拦截检查 - ${o} 是否已注册:`,
|
|
808
|
+
const p = await D();
|
|
809
|
+
if (console.log(`[withAsyncPlugin] 拦截检查 - ${o} 是否已注册:`, p), p || Z.has(s)) {
|
|
782
810
|
m.value = "ready", Z.add(s), console.log("[withAsyncPlugin] 组件已注册,跳过安装流程");
|
|
783
811
|
return;
|
|
784
812
|
}
|
|
785
|
-
if (!
|
|
813
|
+
if (!I) {
|
|
786
814
|
console.warn(`[withAsyncPlugin] 无法获取 useESPlugin 实例,可能处于内置 AAR 环境或非插件环境,尝试直接渲染 ${o}`), m.value = "ready";
|
|
787
815
|
return;
|
|
788
816
|
}
|
|
789
817
|
console.log(`[withAsyncPlugin] 开始动态安装插件: ${s}`);
|
|
790
818
|
try {
|
|
791
|
-
await new Promise((
|
|
819
|
+
await new Promise((A, w) => {
|
|
792
820
|
let T;
|
|
793
|
-
const
|
|
794
|
-
onPluginInstallSuccess(
|
|
795
|
-
|
|
821
|
+
const $ = {
|
|
822
|
+
onPluginInstallSuccess(E, _, O) {
|
|
823
|
+
E === s && (clearTimeout(T), I.removeListener($), console.log(`[withAsyncPlugin] 安装成功 pkg=${E} 状态码=${_}`), _ == 1003 || _ == 1001 ? (d ? (console.log(`[withAsyncPlugin] 触发反射初始化: ${d}`), G.callNative("EsNativeModule", "callReflect", {
|
|
796
824
|
entry: {
|
|
797
|
-
from:
|
|
825
|
+
from: d,
|
|
798
826
|
method: "setup"
|
|
799
827
|
}
|
|
800
|
-
})) : console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"),
|
|
828
|
+
})) : console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"), A()) : w(new Error(`安装失败 pkg=${E} status=${_} msg=${O}`)));
|
|
801
829
|
},
|
|
802
|
-
onPluginInstallError(
|
|
803
|
-
|
|
830
|
+
onPluginInstallError(E, _, O) {
|
|
831
|
+
E === s && (clearTimeout(T), I.removeListener($), w(new Error(`安装失败 pkg=${E} status=${_} msg=${O}`)));
|
|
804
832
|
}
|
|
805
833
|
};
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
}, 8e3), typeof
|
|
834
|
+
I.addListener({ pkg: s }, $), T = setTimeout(() => {
|
|
835
|
+
I.removeListener($), w(new Error(`插件安装超时: ${s}`));
|
|
836
|
+
}, 8e3), typeof I.installPlugin == "function" ? I.installPlugin({ pkg: s }) : typeof I.install == "function" ? I.install(s) : w(new Error("当前运行时不支持 install / installPlugin"));
|
|
809
837
|
}), await Ie(), Z.add(s), m.value = "ready";
|
|
810
|
-
} catch (
|
|
811
|
-
console.error("[withAsyncPlugin] 插件加载失败:",
|
|
838
|
+
} catch (A) {
|
|
839
|
+
console.error("[withAsyncPlugin] 插件加载失败:", A), i.value = (A == null ? void 0 : A.message) || String(A), m.value = "error";
|
|
812
840
|
}
|
|
813
841
|
};
|
|
814
|
-
return
|
|
842
|
+
return me(() => {
|
|
815
843
|
R();
|
|
816
844
|
}), () => {
|
|
817
|
-
const
|
|
818
|
-
|
|
845
|
+
const p = {
|
|
846
|
+
display: "flex",
|
|
847
|
+
flexDirection: "column",
|
|
848
|
+
justifyContent: "center",
|
|
849
|
+
alignItems: "center",
|
|
850
|
+
...y.style || {}
|
|
819
851
|
};
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
class:
|
|
823
|
-
style:
|
|
852
|
+
y.width !== void 0 && !p.width && (p.width = typeof y.width == "number" ? `${y.width}px` : y.width), y.height !== void 0 && !p.height && (p.height = typeof y.height == "number" ? `${y.height}px` : y.height);
|
|
853
|
+
const A = y.class ? `qt-plugin-container ${y.class}` : "qt-plugin-container", w = {
|
|
854
|
+
class: A,
|
|
855
|
+
style: p,
|
|
824
856
|
// 默认关闭外层 div 的裁剪,防止内部组件 focusScale 时被切
|
|
825
857
|
clipChildren: !1,
|
|
826
858
|
clipPadding: !1,
|
|
827
859
|
clipToPadding: !1
|
|
828
860
|
};
|
|
829
861
|
if (m.value === "loading")
|
|
830
|
-
return L("div",
|
|
862
|
+
return L("div", w, [
|
|
831
863
|
L("div", { style: { color: "white", fontSize: "30px" } }, "插件加载中...")
|
|
832
864
|
]);
|
|
833
865
|
if (m.value === "error")
|
|
834
|
-
return L("div",
|
|
866
|
+
return L("div", w, [
|
|
835
867
|
L("div", { style: { color: "white", fontSize: "30px", backgroundColor: "rgba(255,0,0,0.5)" } }, `插件加载失败: ${i.value}`)
|
|
836
868
|
]);
|
|
837
|
-
const T = {},
|
|
838
|
-
for (const [N,
|
|
839
|
-
if (N.startsWith("on") && typeof
|
|
840
|
-
let
|
|
841
|
-
N.startsWith("onOn") && (
|
|
842
|
-
} else if (N.startsWith("on") && Array.isArray(
|
|
843
|
-
let
|
|
844
|
-
N.startsWith("onOn") && (
|
|
869
|
+
const T = {}, $ = {};
|
|
870
|
+
for (const [N, F] of Object.entries(y))
|
|
871
|
+
if (N.startsWith("on") && typeof F == "function") {
|
|
872
|
+
let M = N;
|
|
873
|
+
N.startsWith("onOn") && (M = "on" + N.slice(4)), $[M] = F;
|
|
874
|
+
} else if (N.startsWith("on") && Array.isArray(F)) {
|
|
875
|
+
let M = N;
|
|
876
|
+
N.startsWith("onOn") && (M = "on" + N.slice(4)), $[M] = F;
|
|
845
877
|
} else
|
|
846
|
-
N.startsWith("onOn") || (T[N] =
|
|
847
|
-
const
|
|
878
|
+
N.startsWith("onOn") || (T[N] = F);
|
|
879
|
+
const E = {
|
|
848
880
|
...T,
|
|
849
|
-
|
|
850
|
-
class:
|
|
881
|
+
...$,
|
|
882
|
+
class: A,
|
|
851
883
|
// 把外层 class 传给内部
|
|
852
|
-
style:
|
|
884
|
+
style: p,
|
|
853
885
|
// 把外层 style 传给内部
|
|
854
886
|
ref: (N) => {
|
|
855
|
-
|
|
887
|
+
a.value = N;
|
|
856
888
|
}
|
|
857
|
-
}, _ =
|
|
858
|
-
return console.log("[withAsyncPlugin] 最终准备传递给 h() 的属性键集合:", Object.keys(
|
|
889
|
+
}, _ = E.tabsData || "", O = E.actionPayload || "";
|
|
890
|
+
return console.log("[withAsyncPlugin] 最终准备传递给 h() 的属性键集合:", Object.keys(E), "tabsData.length=", _.length, "actionPayload.length=", O.length), L(o, E, b.default ? b.default() : []);
|
|
859
891
|
};
|
|
860
892
|
}
|
|
861
893
|
});
|
|
862
894
|
}
|
|
863
|
-
const
|
|
895
|
+
const Pe = Symbol("AddonEnvContext"), Te = {
|
|
864
896
|
isPluginActive: !1,
|
|
865
897
|
nameSuffix: "",
|
|
866
898
|
pluginPackageName: "com.quicktvui.plugin.glintui",
|
|
867
899
|
builtInVersions: {}
|
|
868
900
|
};
|
|
869
|
-
async function
|
|
870
|
-
const
|
|
871
|
-
let
|
|
901
|
+
async function qe(o = "com.quicktvui.plugin.glintui", s = "_Plugin") {
|
|
902
|
+
const d = pe();
|
|
903
|
+
let v = {};
|
|
872
904
|
try {
|
|
873
|
-
const i = await
|
|
874
|
-
i && typeof i == "object" && (
|
|
905
|
+
const i = await G.callNativeModule("AddonEnvModule", "getBuiltInVersions", []);
|
|
906
|
+
i && typeof i == "object" && (v = i);
|
|
875
907
|
} catch (i) {
|
|
876
908
|
console.warn("[AddonProvider] Failed to fetch built-in versions from AddonEnvModule", i);
|
|
877
909
|
}
|
|
878
|
-
const
|
|
879
|
-
isPluginActive:
|
|
880
|
-
nameSuffix:
|
|
910
|
+
const b = `QtGridTabs${s}`, y = d.isComponentRegistered(b), c = y instanceof Promise ? await y : y, m = {
|
|
911
|
+
isPluginActive: c,
|
|
912
|
+
nameSuffix: c ? s : "",
|
|
881
913
|
// 如果使用了热更插件,包名加上 .ext 后缀(与 Gradle 打包脚本对齐)
|
|
882
|
-
pluginPackageName:
|
|
883
|
-
builtInVersions:
|
|
914
|
+
pluginPackageName: c ? `${o}.ext` : o,
|
|
915
|
+
builtInVersions: v
|
|
884
916
|
};
|
|
885
917
|
return console.info("[AddonProvider] Environment initialized:", m), m;
|
|
886
918
|
}
|
|
887
|
-
let
|
|
888
|
-
function
|
|
889
|
-
|
|
919
|
+
let ne = x(Te);
|
|
920
|
+
function Re(o) {
|
|
921
|
+
ne.value = o, Ee(Pe, ne);
|
|
890
922
|
}
|
|
891
|
-
function
|
|
923
|
+
function W() {
|
|
892
924
|
var o;
|
|
893
|
-
return ((o =
|
|
925
|
+
return ((o = Ne(Pe, ne)) == null ? void 0 : o.value) || Te;
|
|
894
926
|
}
|
|
895
|
-
const
|
|
927
|
+
const Ce = {
|
|
896
928
|
install: (o) => {
|
|
897
|
-
o.use(ke), o.use(
|
|
929
|
+
o.use(ke), o.use(Se), o.use($e), o.use(_e), o.use(Ge);
|
|
898
930
|
}
|
|
899
931
|
};
|
|
900
932
|
export {
|
|
901
|
-
|
|
902
|
-
|
|
933
|
+
Pe as ADDON_ENV_CONTEXT_KEY,
|
|
934
|
+
H as GridTabs,
|
|
903
935
|
ke as GridTabsPlugin,
|
|
904
936
|
ve as HsvBackground,
|
|
905
937
|
Ge as HsvBackgroundPlugin,
|
|
906
|
-
|
|
907
|
-
|
|
938
|
+
ae as Keyboard,
|
|
939
|
+
Se as KeyboardPlugin,
|
|
908
940
|
ue as PortalItem,
|
|
909
|
-
|
|
941
|
+
_e as PortalItemPlugin,
|
|
910
942
|
le as PortalPool,
|
|
911
943
|
$e as PortalPoolPlugin,
|
|
912
|
-
|
|
944
|
+
Ce as QuickTVUINAddons,
|
|
913
945
|
xe as QuickTVUINAddonsConfig,
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
946
|
+
Ce as default,
|
|
947
|
+
qe as initAddonEnv,
|
|
948
|
+
Re as provideAddonEnv,
|
|
949
|
+
W as useAddonEnv,
|
|
918
950
|
Me as useGridTabs,
|
|
919
|
-
|
|
951
|
+
z as withAsyncPlugin
|
|
920
952
|
};
|