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