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