@quicktvui/naddons 1.0.0-alpha.11 → 1.0.0-alpha.12

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