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