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