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