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

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,86 +1,78 @@
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 q, ref as x, openBlock as Q, createBlock as B, unref as U, mergeProps as K, withCtx as j, renderSlot as V, shallowRef as oe, watch as J, computed as Ae, onMounted as me, h as L, nextTick as Ie, provide as Ee, inject as Ne } from "vue";
2
+ import { Native as G } from "@extscreen/es3-vue";
3
+ import { useES as pe, useESPlugin as we } from "@extscreen/es3-core";
4
+ const se = "QtGridTabs", H = /* @__PURE__ */ q({
5
5
  __name: "GridTabs",
6
6
  props: {
7
7
  protocolVersion: {},
8
- pageSpec: {},
9
8
  tabsData: {},
10
- actionPayload: {}
9
+ actionPayload: {},
10
+ hsvHue: { default: -2 }
11
11
  },
12
- emits: ["onTabSelected", "onTabNeedsData", "onLoadMore", "onItemPresence", "onTabFocused", "onItemClick", "onItemFocused", "onProtocolMismatch"],
12
+ emits: ["onTabSelected", "onTabNeedsData", "onLoadMore", "onItemPresence", "onTabFocused", "onItemClick", "onItemFocused", "onProtocolMismatch", "onScroll", "onScrollStateChanged"],
13
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(
15
- l,
16
- f.pluginPackageName || "com.quicktvui.plugin.glintui"
14
+ const d = x(), v = W(), b = se + "_Plugin", c = (v.isPluginActive ? b : se).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
15
+ c,
16
+ v.pluginPackageName || "com.quicktvui.plugin.glintui"
17
17
  );
18
18
  return s({
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, a;
21
+ return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
22
22
  },
23
23
  dispatchAction: (...i) => {
24
- var 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 l, P;
25
+ const a = ((P = (l = d.value) == null ? void 0 : l.getNativeNode) == null ? void 0 : P.call(l)) || d.value;
26
+ a && G.callUIFunction(a, "dispatchAction", i);
27
27
  },
28
28
  scrollToTop: (...i) => {
29
- var 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 l, P;
30
+ const a = ((P = (l = d.value) == null ? void 0 : l.getNativeNode) == null ? void 0 : P.call(l)) || d.value;
31
+ a && G.callUIFunction(a, "scrollToTop", i);
42
32
  }
43
- }), (i, r) => (Q(), C(U(m), B({
33
+ }), (i, a) => (Q(), B(U(m), K({
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: a[0] || (a[0] = (l) => i.$emit("onTabSelected", l.nativeEvent)),
41
+ onOnTabNeedsData: a[1] || (a[1] = (l) => i.$emit("onTabNeedsData", l.nativeEvent)),
42
+ onOnLoadMore: a[2] || (a[2] = (l) => i.$emit("onLoadMore", l.nativeEvent)),
43
+ onOnItemPresence: a[3] || (a[3] = (l) => i.$emit("onItemPresence", l.nativeEvent)),
44
+ onOnTabFocused: a[4] || (a[4] = (l) => i.$emit("onTabFocused", l.nativeEvent)),
45
+ onOnItemClick: a[5] || (a[5] = (l) => i.$emit("onItemClick", l.nativeEvent)),
46
+ onOnItemFocused: a[6] || (a[6] = (l) => i.$emit("onItemFocused", l.nativeEvent)),
47
+ onOnProtocolMismatch: a[7] || (a[7] = (l) => i.$emit("onProtocolMismatch", l.nativeEvent)),
48
+ onOnScroll: a[8] || (a[8] = (l) => i.$emit("onScroll", l.nativeEvent)),
49
+ onOnScrollStateChanged: a[9] || (a[9] = (l) => i.$emit("onScrollStateChanged", l.nativeEvent))
58
50
  }, i.$attrs), {
59
- default: K(() => [
60
- j(i.$slots, "default")
51
+ default: j(() => [
52
+ V(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 Y;
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
+ Y = 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 (Y) {
69
+ const s = (d, v) => {
70
+ Y(d, {
79
71
  component: {
80
- 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;
72
+ name: v ? "QtGridTabs_Plugin" : "QtGridTabs",
73
+ processEventData(b, y) {
74
+ const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
75
+ return c && (c.nativeEvent = m), c;
84
76
  }
85
77
  }
86
78
  });
@@ -88,48 +80,48 @@ const ke = {
88
80
  s("qt-grid-tabs", !1), s("qt-grid-tabs-plugin", !0), s("QtGridTabs", !1), s("QtGridTabs_Plugin", !0), s("gt-tabs", !1), s("gt-tabs-plugin", !0), globalThis.__QtGridTabs_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtGridTabs");
89
81
  } else
90
82
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
91
- o.component("GridTabs", W), o.component("qt-grid-tabs", W), o.component("gt-tabs", W);
83
+ o.component("GridTabs", H), o.component("qt-grid-tabs", H), o.component("gt-tabs", H);
92
84
  }
93
85
  };
94
86
  function Me(o, s) {
95
- const u = S(""), f = ne([]), p = ne([]);
96
- let b = !1, l = !1;
87
+ const d = x(""), v = oe([]), b = oe([]);
88
+ let y = !1, c = !1;
97
89
  const m = "__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);
101
- if (l && o.value) {
91
+ const a = x({}), l = (t) => {
92
+ const e = Array.isArray(t) ? t : [t], n = JSON.stringify(e);
93
+ if (c && 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)"), G.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
+ }, P = (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
+ }, h = (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
+ }, S = (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}]`));
126
- }), l = !0, O();
127
- }, A = /* @__PURE__ */ new Set(), O = (e = "unknown") => {
128
- if (!l) {
114
+ I.clear();
115
+ const n = t[0].hasOwnProperty("tabId") || t[0].hasOwnProperty("items") && Array.isArray(t[0].items);
116
+ y = e === "1d", e === "1d" && n ? console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `items.value` (一维瀑布流) 赋值二维 Tabs 数据结构!请改用 `tabs.value = ...`") : e === "2d" && !n && console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `tabs.value` (二维导航) 赋值一维卡片列表数据结构!请改用 `items.value = ...`"), e === "1d" ? t.forEach((r, u) => P(r, `items.value[${u}]`)) : t.forEach((r, u) => {
117
+ h(r, `tabs.value[${u}]`), r.items && Array.isArray(r.items) && r.items.forEach((f, g) => P(f, `tabs.value[${u}].items[${g}]`));
118
+ }), c = !0, D();
119
+ }, I = /* @__PURE__ */ new Set(), D = (t = "unknown") => {
120
+ if (!c) {
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
127
  gridBasis: (s == null ? void 0 : s.gridBasis) ?? 30,
@@ -169,317 +161,337 @@ function Me(o, s) {
169
161
  themeConfig: s == null ? void 0 : s.themeConfig,
170
162
  referenceResolution: (s == null ? void 0 : s.referenceResolution) ?? { w: 1920, h: 1080 }
171
163
  }, n = [];
172
- b ? (t.navConfig = { ...t.navConfig, renderType: "none" }, n = [
164
+ y ? (e.navConfig = { ...e.navConfig, renderType: "none" }, n = [
173
165
  {
174
166
  tabId: m,
175
167
  title: "Virtual Tab",
176
168
  hidden: !0,
177
- items: p.value
169
+ items: b.value
178
170
  }
179
- ]) : n = f.value;
180
- const a = JSON.stringify({
181
- page_spec: t,
171
+ ]) : n = v.value;
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, l({
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, f) {
198
+ const g = Reflect.set(n, r, u, f);
199
+ return t.id && c && l({
208
200
  op: "UPDATE_ITEM",
209
- itemId: e.id,
210
- payload: e
211
- }), v;
201
+ itemId: t.id,
202
+ payload: t
203
+ }), g;
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);
217
- return n.id && l && c({
205
+ }), Object.defineProperty(t.content, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(t.content, "__v_skip", { value: !0, enumerable: !1 })), t.subItems && Array.isArray(t.subItems) && !t.subItems.__isGridTabsProxy && (t.subItems = p(t.subItems, t.id), Object.defineProperty(t.subItems, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(t.subItems, "__v_skip", { value: !0, enumerable: !1 }));
206
+ const e = new Proxy(t, {
207
+ set(n, r, u, f) {
208
+ const g = Reflect.set(n, r, u, f);
209
+ return n.id && c && l({
218
210
  op: "UPDATE_ITEM",
219
211
  itemId: n.id,
220
212
  payload: n
221
- }), v;
213
+ }), g;
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 进行全量赋值!");
232
- const v = g.map((q) => R(q)), w = Array.prototype.push.apply(n, v);
233
- return c({
216
+ return Object.defineProperty(e, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(e, "__v_skip", { value: !0, enumerable: !1 }), e;
217
+ }, p = (t, e) => {
218
+ for (let n = 0; n < t.length; n++)
219
+ t[n] = R(t[n]);
220
+ return new Proxy(t, {
221
+ get(n, r, u) {
222
+ return r === "push" ? (...f) => {
223
+ f.forEach((C, he) => P(C, `push(${he})`)), c || console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");
224
+ const g = f.map((C) => R(C)), k = Array.prototype.push.apply(n, g);
225
+ return l({
234
226
  op: "APPEND_SUB_ITEMS",
235
- itemId: t,
236
- payload: { subItems: v }
237
- }), w;
238
- } : a === "splice" ? (...g) => {
239
- 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({
227
+ itemId: e,
228
+ payload: { subItems: g }
229
+ }), k;
230
+ } : r === "splice" ? (...f) => {
231
+ const g = f.length >= 2 && f[0] === 0 && f[1] === n.length, k = Array.prototype.splice.apply(n, f);
232
+ return c && g && e !== m ? l({
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
- }) : l && O("items array spliced"), w;
246
- } : Reflect.get(n, a, d);
237
+ }) : c && D("items array spliced"), k;
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);
252
- return v && v.id && c({
240
+ set(n, r, u, f) {
241
+ if (r !== "length" && !isNaN(Number(r))) {
242
+ c || console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(r)}]。请先对 items.value 或 tabs.value 进行全量赋值!`), P(u, `索引赋值 [${String(r)}]`);
243
+ const g = R(u), k = Reflect.set(n, r, g, f);
244
+ return g && g.id && l({
253
245
  op: "UPDATE_ITEM",
254
- itemId: v.id,
255
- payload: v
256
- }), w;
246
+ itemId: g.id,
247
+ payload: g
248
+ }), k;
257
249
  }
258
- return Reflect.set(n, a, d, g);
250
+ return Reflect.set(n, r, u, f);
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
+ }, A = (t) => (t.items && Array.isArray(t.items) && !t.items.__isGridTabsProxy && (t.items = p(t.items, t.tabId), Object.defineProperty(t.items, "__isGridTabsProxy", { value: !0, enumerable: !1 })), new Proxy(t, {
254
+ set(e, n, r, u) {
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 g = r;
257
+ return Array.isArray(r) && !r.__isGridTabsProxy && (g = p(r, e.tabId), Object.defineProperty(g, "__isGridTabsProxy", { value: !0, enumerable: !1 })), Reflect.set(e, n, g, u);
266
258
  } else if (n === "loadState") {
267
- const v = Reflect.set(t, n, a, d);
268
- return l && t.tabId && c({
259
+ const g = Reflect.set(e, n, r, u);
260
+ return c && e.tabId && l({
269
261
  op: "UPDATE_TAB_STATE",
270
- itemId: t.tabId,
271
- payload: { loadState: a }
272
- }), v;
262
+ itemId: e.tabId,
263
+ payload: { loadState: r }
264
+ }), g;
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);
284
- return O(), w;
268
+ })), w = (t) => {
269
+ const e = t.map((n) => A(n));
270
+ return new Proxy(e, {
271
+ set(n, r, u, f) {
272
+ if (r !== "length" && !isNaN(Number(r))) {
273
+ let g = u;
274
+ u.__isGridTabsProxy || (g = A(u), Object.defineProperty(g, "__isGridTabsProxy", { value: !0, enumerable: !1 }));
275
+ const k = Reflect.set(n, r, g, f);
276
+ return D(), k;
285
277
  }
286
- return Reflect.set(n, a, d, g);
278
+ return Reflect.set(n, r, u, f);
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
+ J(v, (t, e) => {
283
+ if (console.log("[useGridTabs] watch(tabs) triggered:", { newTabs: t, isInitialized: c }), !t || t.length === 0) {
284
+ d.value = "", i = "", c = !1;
293
285
  return;
294
286
  }
295
- if (e.__isGridTabsProxy)
296
- console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"), O();
287
+ if (t.__isGridTabsProxy)
288
+ console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"), D();
297
289
  else {
298
290
  console.log("[useGridTabs] newTabs is NOT a proxy, performing full deduceModeAndInitialize & wrapping");
299
- const n = E(e);
300
- Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }), x(n, "2d"), f.value = n;
291
+ const n = w(t);
292
+ Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }), S(n, "2d"), v.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 }), J(b, (t, e) => {
295
+ if (console.log("[useGridTabs] watch(items) triggered:", { newItems: t, isInitialized: c }), !t || t.length === 0) {
296
+ d.value = "", i = "", c = !1;
305
297
  return;
306
298
  }
307
- if (e.__isGridTabsProxy)
308
- console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"), O();
299
+ if (t.__isGridTabsProxy)
300
+ console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"), D();
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 = p(t, m);
304
+ Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }), S(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 T = {}, $ = () => {
308
+ console.log("[useGridTabs] resetInitialization called manually"), c = !1, I.clear();
309
+ for (const t in T)
310
+ delete T[t];
311
+ }, E = (t) => {
312
+ if (!t || t.length === 0) {
313
+ d.value = "", c = !1;
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) ? v.value = t : b.value = t;
317
+ }, _ = (t) => {
318
+ a.value = t;
319
+ }, O = Ae(() => ({
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), !a.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 (I.has(n)) {
336
328
  console.log(`[useGridTabs] onTabNeedsData SKIP: tabId=${n} 已经发起过请求,防止死循环`);
337
329
  return;
338
330
  }
339
- A.add(n);
331
+ I.add(n);
340
332
  try {
341
- const g = await r.value.onTabNeedsData(n, a, d);
342
- if (g && Array.isArray(g))
343
- if (T[n] = 1, g.length > 0) {
344
- const v = f.value.find((w) => w.tabId === n);
345
- v && (v.items ? v.items.length > 0 && v.items.splice(0, v.items.length) : v.items = [], v.items.push(...g), v.loadState = "ready", c({
333
+ const f = await a.value.onTabNeedsData(n, r, u);
334
+ if (f && Array.isArray(f))
335
+ if (T[n] = 1, f.length > 0) {
336
+ const g = v.value.find((k) => k.tabId === n);
337
+ g && (g.items ? g.items.length > 0 && g.items.splice(0, g.items.length) : g.items = [], g.items.push(...f), g.loadState = "ready", l({
346
338
  op: "UPDATE_TAB_STATE",
347
339
  itemId: n,
348
340
  payload: { loadState: "ready" }
349
341
  }));
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
- } catch (g) {
353
- console.error("[useGridTabs] onTabNeedsData 执行失败:", g), A.delete(n);
344
+ } catch (f) {
345
+ console.error("[useGridTabs] onTabNeedsData 执行失败:", f), I.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), !a.value.onLoadMore)
359
351
  return;
360
- const { tabId: n, itemId: a } = t, g = (T[n] || 1) + 1;
361
- console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${n}, pageNo=${g}`);
352
+ const { tabId: n, itemId: r } = e, f = (T[n] || 1) + 1;
353
+ console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${n}, pageNo=${f}`);
362
354
  try {
363
- const v = await r.value.onLoadMore(n, g, a);
364
- if (v && Array.isArray(v))
365
- if (v.length > 0)
366
- if (T[n] = g, b)
367
- p.value.push(...v);
355
+ const g = await a.value.onLoadMore(n, f, r);
356
+ if (g && Array.isArray(g))
357
+ if (g.length > 0)
358
+ if (T[n] = f, y)
359
+ b.value.push(...g);
368
360
  else {
369
- const w = f.value.find((q) => q.tabId === n);
370
- w && w.items && w.items.push(...v);
361
+ const k = v.value.find((C) => C.tabId === n);
362
+ k && k.items && k.items.push(...g);
371
363
  }
372
364
  else
373
- console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${n}", pageNo="${g}") 返回了空数组 []!`), console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'), console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。");
374
- } catch (v) {
375
- console.error("[useGridTabs] onLoadMore 业务层请求失败:", v);
365
+ console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${n}", pageNo="${f}") 返回了空数组 []!`), console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'), console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。");
366
+ } catch (g) {
367
+ console.error("[useGridTabs] onLoadMore 业务层请求失败:", g);
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), a.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,否则底层无法准确进行去重与曝光上报。`), a.value.onItemPresence(u);
379
+ }) : a.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), a.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), a.value.onTabSelected && a.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), a.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
+ a.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), a.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), a.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
+ a.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), a.value.onItemFocused(e);
411
+ }
412
+ },
413
+ onTabFocused: (...t) => {
414
+ let e = t[0];
415
+ e && e.nativeEvent && (e = e.nativeEvent), a.value.onTabFocused && a.value.onTabFocused(e);
416
+ },
417
+ onScroll: (...t) => {
418
+ let e = t[0];
419
+ if (e && e.nativeEvent && (e = e.nativeEvent), a.value.onScroll)
420
+ try {
421
+ const n = (e == null ? void 0 : e.data) || e;
422
+ a.value.onScroll(n);
423
+ } catch {
424
+ a.value.onScroll(e);
419
425
  }
420
426
  },
421
- onTabFocused: (...e) => {
422
- let t = e[0];
423
- t && t.nativeEvent && (t = t.nativeEvent), r.value.onTabFocused && r.value.onTabFocused(t);
427
+ onScrollStateChanged: (...t) => {
428
+ let e = t[0];
429
+ if (e && e.nativeEvent && (e = e.nativeEvent), a.value.onScrollStateChanged)
430
+ try {
431
+ const n = (e == null ? void 0 : e.data) || e;
432
+ a.value.onScrollStateChanged(n);
433
+ } catch {
434
+ a.value.onScrollStateChanged(e);
435
+ }
424
436
  }
425
437
  }));
426
438
  return {
427
- tabsDataStr: u,
428
- bindings: G,
429
- tabs: f,
430
- items: p,
431
- initData: I,
439
+ tabsDataStr: d,
440
+ bindings: O,
441
+ tabs: v,
442
+ items: b,
443
+ initData: E,
432
444
  setCallbacks: _,
433
- updateItem: (e, t) => {
434
- if (!l) {
445
+ updateItem: (t, e) => {
446
+ if (!c) {
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
+ l({ op: "UPDATE_ITEM", itemId: t, payload: e });
451
+ const n = (r) => {
452
+ for (const u in e)
453
+ u === "content" && r.content ? Object.assign(r.content, e.content) : r[u] = e[u];
442
454
  };
443
- if (b) {
444
- const a = p.value.find((d) => d.id === e);
445
- a && n(a);
455
+ if (y) {
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 v.value)
460
+ if (r.items) {
461
+ const u = r.items.find((f) => f.id === t);
462
+ if (u) {
463
+ n(u);
452
464
  break;
453
465
  }
454
466
  }
455
467
  },
456
- dispatchAction: c,
457
- resetInitialization: k,
458
- getFocusState: async () => new Promise((e, t) => {
468
+ dispatchAction: l,
469
+ resetInitialization: $,
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), G.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), G.callUIFunction(r, "getItemRect", [t], (u) => {
472
484
  try {
473
- const g = typeof d == "string" ? JSON.parse(d) : d;
474
- t(g);
475
- } catch (g) {
476
- n(g);
485
+ const f = typeof u == "string" ? JSON.parse(u) : u;
486
+ e(f);
487
+ } catch (f) {
488
+ n(f);
477
489
  }
478
490
  });
479
491
  })
480
492
  };
481
493
  }
482
- const ae = "QtKeyboard", re = /* @__PURE__ */ M({
494
+ const re = "QtKeyboard", ae = /* @__PURE__ */ q({
483
495
  __name: "Keyboard",
484
496
  props: {
485
497
  backgroundColor: {},
@@ -495,28 +507,42 @@ const ae = "QtKeyboard", re = /* @__PURE__ */ M({
495
507
  textDelete: {},
496
508
  currentInput: {},
497
509
  autofocus: { type: Boolean },
498
- requestFocus: { type: Boolean }
510
+ requestFocus: { type: Boolean },
511
+ keyboardType: {},
512
+ rememberKeyboardType: { type: Boolean }
499
513
  },
500
514
  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(
503
- l,
504
- f.pluginPackageName || "com.quicktvui.plugin.extraui",
515
+ setup(o, { expose: s, emit: d }) {
516
+ const v = x(), b = W(), y = re + "_Plugin", m = (b.isPluginActive ? y : re).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), i = z(
517
+ m,
518
+ b.pluginPackageName || "com.quicktvui.plugin.extraui",
505
519
  "com.quicktvui.plugin.extraui.ExtraUIPluginApp"
506
- );
507
- return s({
520
+ ), a = o;
521
+ return me(() => {
522
+ (a.autofocus || a.requestFocus) && setTimeout(() => {
523
+ var P, h;
524
+ const l = ((h = (P = v.value) == null ? void 0 : P.getNativeNode) == null ? void 0 : h.call(P)) || v.value;
525
+ l && G.callUIFunction(l, "requestFocus", [!0]);
526
+ }, 300);
527
+ }), J(() => a.requestFocus, (l) => {
528
+ l && setTimeout(() => {
529
+ var h, S;
530
+ const P = ((S = (h = v.value) == null ? void 0 : h.getNativeNode) == null ? void 0 : S.call(h)) || v.value;
531
+ P && G.callUIFunction(P, "requestFocus", [!0]);
532
+ }, 300);
533
+ }), s({
508
534
  getNativeNode: () => {
509
- var i, r;
510
- return ((r = (i = u.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : r.call(i)) || u.value;
535
+ var l, P;
536
+ return ((P = (l = v.value) == null ? void 0 : l.getNativeNode) == null ? void 0 : P.call(l)) || v.value;
511
537
  },
512
- 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);
538
+ requestFocus: (...l) => {
539
+ var h, S;
540
+ const P = ((S = (h = v.value) == null ? void 0 : h.getNativeNode) == null ? void 0 : S.call(h)) || v.value;
541
+ P && G.callUIFunction(P, "requestFocus", l);
516
542
  }
517
- }), (i, r) => (Q(), C(U(m), B({
543
+ }), (l, P) => (Q(), B(U(i), K({
518
544
  ref_key: "nativeRef",
519
- ref: u,
545
+ ref: v,
520
546
  backgroundColor: o.backgroundColor,
521
547
  backgroundGradient: o.backgroundGradient,
522
548
  textColor: o.textColor,
@@ -531,34 +557,36 @@ const ae = "QtKeyboard", re = /* @__PURE__ */ M({
531
557
  currentInput: o.currentInput,
532
558
  autofocus: o.autofocus,
533
559
  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))
536
- }, i.$attrs), {
537
- default: K(() => [
538
- j(i.$slots, "default")
560
+ keyboardType: o.keyboardType,
561
+ rememberKeyboardType: o.rememberKeyboardType ?? !0,
562
+ onOnInputChanged: P[0] || (P[0] = (h) => l.$emit("onInputChanged", h.nativeEvent)),
563
+ onOnKeyPressed: P[1] || (P[1] = (h) => l.$emit("onKeyPressed", h.nativeEvent))
564
+ }, l.$attrs), {
565
+ default: j(() => [
566
+ V(l.$slots, "default")
539
567
  ]),
540
568
  _: 3
541
- }, 16, ["backgroundColor", "backgroundGradient", "textColor", "weakTextColor", "focusBackgroundColor", "focusTextColor", "placeholder", "textFullKeyboard", "textT9Keyboard", "textClear", "textDelete", "currentInput", "autofocus", "requestFocus"]));
569
+ }, 16, ["backgroundColor", "backgroundGradient", "textColor", "weakTextColor", "focusBackgroundColor", "focusTextColor", "placeholder", "textFullKeyboard", "textT9Keyboard", "textClear", "textDelete", "currentInput", "autofocus", "requestFocus", "keyboardType", "rememberKeyboardType"]));
542
570
  }
543
571
  });
544
- let J;
572
+ let X;
545
573
  var fe;
546
574
  try {
547
575
  const o = require("@extscreen/es3-vue");
548
- J = o.registerElement || ((fe = o.default) == null ? void 0 : fe.registerElement);
576
+ X = o.registerElement || ((fe = o.default) == null ? void 0 : fe.registerElement);
549
577
  } catch {
550
578
  }
551
- const _e = {
579
+ const Se = {
552
580
  install: (o) => {
553
581
  if (!globalThis.__QtKeyboard_registered)
554
- if (J) {
555
- const s = (u, f) => {
556
- J(u, {
582
+ if (X) {
583
+ const s = (d, v) => {
584
+ X(d, {
557
585
  component: {
558
- 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;
586
+ name: v ? "QtKeyboard_Plugin" : "QtKeyboard",
587
+ processEventData(b, y) {
588
+ const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
589
+ return c && (c.nativeEvent = m), c;
562
590
  }
563
591
  }
564
592
  });
@@ -566,49 +594,49 @@ const _e = {
566
594
  s("qt-keyboard", !1), s("qt-keyboard-plugin", !0), s("QtKeyboard", !1), s("QtKeyboard_Plugin", !0), globalThis.__QtKeyboard_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtKeyboard");
567
595
  } else
568
596
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
569
- o.component("Keyboard", re), o.component("qt-keyboard", re);
597
+ o.component("Keyboard", ae), o.component("qt-keyboard", ae);
570
598
  }
571
- }, ie = "QtPortalPool", le = /* @__PURE__ */ M({
599
+ }, ie = "QtPortalPool", le = /* @__PURE__ */ q({
572
600
  __name: "PortalPool",
573
601
  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(
575
- l,
576
- f.pluginPackageName || "com.quicktvui.plugin.glintui"
602
+ const d = x(), v = W(), b = ie + "_Plugin", c = (v.isPluginActive ? b : ie).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
603
+ c,
604
+ v.pluginPackageName || "com.quicktvui.plugin.glintui"
577
605
  );
578
606
  return s({
579
607
  getNativeNode: () => {
580
- var i, r;
581
- return ((r = (i = u.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : r.call(i)) || u.value;
608
+ var i, a;
609
+ return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
582
610
  }
583
- }), (i, r) => (Q(), C(U(m), B({
611
+ }), (i, a) => (Q(), B(U(m), K({
584
612
  ref_key: "nativeRef",
585
- ref: u
613
+ ref: d
586
614
  }, i.$attrs), {
587
- default: K(() => [
588
- j(i.$slots, "default")
615
+ default: j(() => [
616
+ V(i.$slots, "default")
589
617
  ]),
590
618
  _: 3
591
619
  }, 16));
592
620
  }
593
621
  });
594
- let Y;
595
- var pe;
622
+ let ee;
623
+ var be;
596
624
  try {
597
625
  const o = require("@extscreen/es3-vue");
598
- Y = o.registerElement || ((pe = o.default) == null ? void 0 : pe.registerElement);
626
+ ee = o.registerElement || ((be = o.default) == null ? void 0 : be.registerElement);
599
627
  } catch {
600
628
  }
601
629
  const $e = {
602
630
  install: (o) => {
603
631
  if (!globalThis.__QtPortalPool_registered)
604
- if (Y) {
605
- const s = (u, f) => {
606
- Y(u, {
632
+ if (ee) {
633
+ const s = (d, v) => {
634
+ ee(d, {
607
635
  component: {
608
- 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;
636
+ name: v ? "QtPortalPool_Plugin" : "QtPortalPool",
637
+ processEventData(b, y) {
638
+ const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
639
+ return c && (c.nativeEvent = m), c;
612
640
  }
613
641
  }
614
642
  });
@@ -618,51 +646,51 @@ const $e = {
618
646
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
619
647
  o.component("PortalPool", le), o.component("qt-portal-pool", le);
620
648
  }
621
- }, ce = "QtPortalItem", ue = /* @__PURE__ */ M({
649
+ }, ce = "QtPortalItem", ue = /* @__PURE__ */ q({
622
650
  __name: "PortalItem",
623
651
  props: {
624
652
  portalId: {}
625
653
  },
626
654
  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(
628
- l,
629
- f.pluginPackageName || "com.quicktvui.plugin.glintui"
655
+ const d = x(), v = W(), b = ce + "_Plugin", c = (v.isPluginActive ? b : ce).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
656
+ c,
657
+ v.pluginPackageName || "com.quicktvui.plugin.glintui"
630
658
  );
631
659
  return s({
632
660
  getNativeNode: () => {
633
- var i, r;
634
- return ((r = (i = u.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : r.call(i)) || u.value;
661
+ var i, a;
662
+ return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
635
663
  }
636
- }), (i, r) => (Q(), C(U(m), B({
664
+ }), (i, a) => (Q(), B(U(m), K({
637
665
  ref_key: "nativeRef",
638
- ref: u,
666
+ ref: d,
639
667
  portalId: o.portalId
640
668
  }, i.$attrs), {
641
- default: K(() => [
642
- j(i.$slots, "default")
669
+ default: j(() => [
670
+ V(i.$slots, "default")
643
671
  ]),
644
672
  _: 3
645
673
  }, 16, ["portalId"]));
646
674
  }
647
675
  });
648
- let X;
649
- var be;
676
+ let te;
677
+ var ye;
650
678
  try {
651
679
  const o = require("@extscreen/es3-vue");
652
- X = o.registerElement || ((be = o.default) == null ? void 0 : be.registerElement);
680
+ te = o.registerElement || ((ye = o.default) == null ? void 0 : ye.registerElement);
653
681
  } catch {
654
682
  }
655
- const Se = {
683
+ const _e = {
656
684
  install: (o) => {
657
685
  if (!globalThis.__QtPortalItem_registered)
658
- if (X) {
659
- const s = (u, f) => {
660
- X(u, {
686
+ if (te) {
687
+ const s = (d, v) => {
688
+ te(d, {
661
689
  component: {
662
- 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;
690
+ name: v ? "QtPortalItem_Plugin" : "QtPortalItem",
691
+ processEventData(b, y) {
692
+ const c = b.handler || b, m = y || (c == null ? void 0 : c.nativeParams) || {};
693
+ return c && (c.nativeEvent = m), c;
666
694
  }
667
695
  }
668
696
  });
@@ -672,28 +700,28 @@ const Se = {
672
700
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
673
701
  o.component("PortalItem", ue), o.component("qt-portal-item", ue);
674
702
  }
675
- }, de = "QtHsvBackground", ve = /* @__PURE__ */ M({
703
+ }, de = "QtHsvBackground", ve = /* @__PURE__ */ q({
676
704
  __name: "HsvBackground",
677
705
  props: {
678
706
  hue: { default: -2 }
679
707
  },
680
708
  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(
682
- l,
683
- f.pluginPackageName || "com.quicktvui.plugin.glintui"
709
+ const d = x(), v = W(), b = de + "_Plugin", c = (v.isPluginActive ? b : de).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), m = z(
710
+ c,
711
+ v.pluginPackageName || "com.quicktvui.plugin.glintui"
684
712
  );
685
713
  return s({
686
714
  getNativeNode: () => {
687
- var i, r;
688
- return ((r = (i = u.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : r.call(i)) || u.value;
715
+ var i, a;
716
+ return ((a = (i = d.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : a.call(i)) || d.value;
689
717
  }
690
- }), (i, r) => (Q(), C(U(m), B({
718
+ }), (i, a) => (Q(), B(U(m), K({
691
719
  ref_key: "nativeRef",
692
- ref: u,
720
+ ref: d,
693
721
  hue: o.hue
694
722
  }, i.$attrs), {
695
- default: K(() => [
696
- j(i.$slots, "default")
723
+ default: j(() => [
724
+ V(i.$slots, "default")
697
725
  ]),
698
726
  _: 3
699
727
  }, 16, ["hue"]));
@@ -706,8 +734,8 @@ const Se = {
706
734
  // 如果设置为 true,则全局跳过所有组件的原生插件安装检查,直接渲染
707
735
  skipPluginCheck: !1
708
736
  }, Z = /* @__PURE__ */ new Set();
709
- function V(o, s, u) {
710
- return M({
737
+ function z(o, s, d) {
738
+ return q({
711
739
  name: `${o}AsyncWrapper`,
712
740
  inheritAttrs: !1,
713
741
  props: {
@@ -717,59 +745,59 @@ function V(o, s, u) {
717
745
  default: !1
718
746
  }
719
747
  },
720
- setup(f, { slots: p, attrs: b, expose: l }) {
721
- const m = S("loading"), i = S(""), r = S(), c = globalThis.__VUE_INSTANCE__;
722
- l({
748
+ setup(v, { slots: b, attrs: y, expose: c }) {
749
+ const m = x("loading"), i = x(""), a = x(), l = globalThis.__VUE_INSTANCE__;
750
+ c({
723
751
  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;
752
+ let p = a.value;
753
+ return !p && l && l.vnode && l.vnode.el && (p = l.vnode.el, p.childNodes && p.childNodes.length > 0 && (p = p.childNodes[0])), p;
726
754
  },
727
- nativeRef: r
755
+ nativeRef: a
728
756
  });
729
- let x = null, A = null;
757
+ let S = null, I = null;
730
758
  try {
731
- x = me(), A = we();
732
- } catch (y) {
733
- console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。", y);
759
+ S = pe(), I = we();
760
+ } catch (p) {
761
+ console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。", p);
734
762
  }
735
- const O = async () => {
736
- if (!x || typeof x.isComponentRegistered != "function")
763
+ const D = async () => {
764
+ if (!S || typeof S.isComponentRegistered != "function")
737
765
  return console.log("[withAsyncPlugin] es.isComponentRegistered 不可用"), !1;
738
766
  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))
767
+ const p = await S.isComponentRegistered(o);
768
+ if (console.log(`[withAsyncPlugin] isComponentRegistered('${o}') 返回:`, p), p === !0 || p && typeof p == "object" && (p.registered === !0 || p.isRegistered === !0))
741
769
  return !0;
742
770
  try {
743
- const h = await $.callNativeWithPromise("ExtendModule", "getCoreSDKInfo");
744
- 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));
771
+ const A = await G.callNativeWithPromise("ExtendModule", "getCoreSDKInfo");
772
+ if (A && A.core_version) {
773
+ const w = A.core_version;
774
+ console.log(`[withAsyncPlugin] 当前引擎核心版本: ${w}`);
775
+ const T = w.split(".").map(($) => parseInt($, 10));
748
776
  if (T.length >= 3 && !isNaN(T[0]) && !isNaN(T[1]) && !isNaN(T[2]))
749
777
  if (T[0] * 1e6 + T[1] * 1e3 + T[2] >= 1011205) {
750
778
  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)
779
+ const E = o.split("-").map((N) => N.charAt(0).toUpperCase() + N.slice(1)).join("");
780
+ console.log(`[withAsyncPlugin] 同时检查原名和驼峰名: ${o}, ${E}`);
781
+ const [_, O] = await Promise.all([
782
+ G.callNativeWithPromise("ExtendModule", "isComponentRegistered", o).catch(() => !1),
783
+ G.callNativeWithPromise("ExtendModule", "isComponentRegistered", E).catch(() => !1)
756
784
  ]);
757
- if (console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${_}, ${G}]`), _ === !0 || G === !0)
785
+ if (console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${_}, ${O}]`), _ === !0 || O === !0)
758
786
  return !0;
759
787
  } else
760
- console.log(`[withAsyncPlugin] 引擎版本 ${E} < 1.11.205,跳过 ExtendModule 检查`);
788
+ console.log(`[withAsyncPlugin] 引擎版本 ${w} < 1.11.205,跳过 ExtendModule 检查`);
761
789
  else
762
- console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${E}`);
790
+ console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${w}`);
763
791
  }
764
- } catch (h) {
765
- console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:", h);
792
+ } catch (A) {
793
+ console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:", A);
766
794
  }
767
795
  return !1;
768
- } catch (y) {
769
- return console.warn("[withAsyncPlugin] 检查组件注册状态异常:", y), !1;
796
+ } catch (p) {
797
+ return console.warn("[withAsyncPlugin] 检查组件注册状态异常:", p), !1;
770
798
  }
771
799
  }, R = async () => {
772
- if (xe.skipPluginCheck || f.skipPluginCheck) {
800
+ if (xe.skipPluginCheck || v.skipPluginCheck) {
773
801
  console.log(`[withAsyncPlugin] 跳过 ${o} 插件检查 (skipPluginCheck = true)`), m.value = "ready";
774
802
  return;
775
803
  }
@@ -777,144 +805,148 @@ function V(o, s, u) {
777
805
  m.value = "ready";
778
806
  return;
779
807
  }
780
- const y = await O();
781
- if (console.log(`[withAsyncPlugin] 拦截检查 - ${o} 是否已注册:`, y), y || Z.has(s)) {
808
+ const p = await D();
809
+ if (console.log(`[withAsyncPlugin] 拦截检查 - ${o} 是否已注册:`, p), p || Z.has(s)) {
782
810
  m.value = "ready", Z.add(s), console.log("[withAsyncPlugin] 组件已注册,跳过安装流程");
783
811
  return;
784
812
  }
785
- if (!A) {
813
+ if (!I) {
786
814
  console.warn(`[withAsyncPlugin] 无法获取 useESPlugin 实例,可能处于内置 AAR 环境或非插件环境,尝试直接渲染 ${o}`), m.value = "ready";
787
815
  return;
788
816
  }
789
817
  console.log(`[withAsyncPlugin] 开始动态安装插件: ${s}`);
790
818
  try {
791
- await new Promise((h, E) => {
819
+ await new Promise((A, w) => {
792
820
  let T;
793
- 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", {
821
+ const $ = {
822
+ onPluginInstallSuccess(E, _, O) {
823
+ E === s && (clearTimeout(T), I.removeListener($), console.log(`[withAsyncPlugin] 安装成功 pkg=${E} 状态码=${_}`), _ == 1003 || _ == 1001 ? (d ? (console.log(`[withAsyncPlugin] 触发反射初始化: ${d}`), G.callNative("EsNativeModule", "callReflect", {
796
824
  entry: {
797
- from: u,
825
+ from: d,
798
826
  method: "setup"
799
827
  }
800
- })) : console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"), h()) : E(new Error(`安装失败 pkg=${I} status=${_} msg=${G}`)));
828
+ })) : console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"), A()) : w(new Error(`安装失败 pkg=${E} status=${_} msg=${O}`)));
801
829
  },
802
- onPluginInstallError(I, _, G) {
803
- I === s && (clearTimeout(T), A.removeListener(k), E(new Error(`安装失败 pkg=${I} status=${_} msg=${G}`)));
830
+ onPluginInstallError(E, _, O) {
831
+ E === s && (clearTimeout(T), I.removeListener($), w(new Error(`安装失败 pkg=${E} status=${_} msg=${O}`)));
804
832
  }
805
833
  };
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"));
834
+ I.addListener({ pkg: s }, $), T = setTimeout(() => {
835
+ I.removeListener($), w(new Error(`插件安装超时: ${s}`));
836
+ }, 8e3), typeof I.installPlugin == "function" ? I.installPlugin({ pkg: s }) : typeof I.install == "function" ? I.install(s) : w(new Error("当前运行时不支持 install / installPlugin"));
809
837
  }), await Ie(), Z.add(s), m.value = "ready";
810
- } catch (h) {
811
- console.error("[withAsyncPlugin] 插件加载失败:", h), i.value = (h == null ? void 0 : h.message) || String(h), m.value = "error";
838
+ } catch (A) {
839
+ console.error("[withAsyncPlugin] 插件加载失败:", A), i.value = (A == null ? void 0 : A.message) || String(A), m.value = "error";
812
840
  }
813
841
  };
814
- return Ae(() => {
842
+ return me(() => {
815
843
  R();
816
844
  }), () => {
817
- const y = {
818
- ...b.style || {}
845
+ const p = {
846
+ display: "flex",
847
+ flexDirection: "column",
848
+ justifyContent: "center",
849
+ alignItems: "center",
850
+ ...y.style || {}
819
851
  };
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 = {
822
- class: h,
823
- style: y,
852
+ y.width !== void 0 && !p.width && (p.width = typeof y.width == "number" ? `${y.width}px` : y.width), y.height !== void 0 && !p.height && (p.height = typeof y.height == "number" ? `${y.height}px` : y.height);
853
+ const A = y.class ? `qt-plugin-container ${y.class}` : "qt-plugin-container", w = {
854
+ class: A,
855
+ style: p,
824
856
  // 默认关闭外层 div 的裁剪,防止内部组件 focusScale 时被切
825
857
  clipChildren: !1,
826
858
  clipPadding: !1,
827
859
  clipToPadding: !1
828
860
  };
829
861
  if (m.value === "loading")
830
- return L("div", E, [
862
+ return L("div", w, [
831
863
  L("div", { style: { color: "white", fontSize: "30px" } }, "插件加载中...")
832
864
  ]);
833
865
  if (m.value === "error")
834
- return L("div", E, [
866
+ return L("div", w, [
835
867
  L("div", { style: { color: "white", fontSize: "30px", backgroundColor: "rgba(255,0,0,0.5)" } }, `插件加载失败: ${i.value}`)
836
868
  ]);
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;
869
+ const T = {}, $ = {};
870
+ for (const [N, F] of Object.entries(y))
871
+ if (N.startsWith("on") && typeof F == "function") {
872
+ let M = N;
873
+ N.startsWith("onOn") && (M = "on" + N.slice(4)), $[M] = F;
874
+ } else if (N.startsWith("on") && Array.isArray(F)) {
875
+ let M = N;
876
+ N.startsWith("onOn") && (M = "on" + N.slice(4)), $[M] = F;
845
877
  } else
846
- N.startsWith("onOn") || (T[N] = D);
847
- const I = {
878
+ N.startsWith("onOn") || (T[N] = F);
879
+ const E = {
848
880
  ...T,
849
- ...k,
850
- class: h,
881
+ ...$,
882
+ class: A,
851
883
  // 把外层 class 传给内部
852
- style: y,
884
+ style: p,
853
885
  // 把外层 style 传给内部
854
886
  ref: (N) => {
855
- r.value = N;
887
+ a.value = N;
856
888
  }
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() : []);
889
+ }, _ = E.tabsData || "", O = E.actionPayload || "";
890
+ return console.log("[withAsyncPlugin] 最终准备传递给 h() 的属性键集合:", Object.keys(E), "tabsData.length=", _.length, "actionPayload.length=", O.length), L(o, E, b.default ? b.default() : []);
859
891
  };
860
892
  }
861
893
  });
862
894
  }
863
- const ye = Symbol("AddonEnvContext"), Pe = {
895
+ const Pe = Symbol("AddonEnvContext"), Te = {
864
896
  isPluginActive: !1,
865
897
  nameSuffix: "",
866
898
  pluginPackageName: "com.quicktvui.plugin.glintui",
867
899
  builtInVersions: {}
868
900
  };
869
- async function Re(o = "com.quicktvui.plugin.glintui", s = "_Plugin") {
870
- const u = me();
871
- let f = {};
901
+ async function qe(o = "com.quicktvui.plugin.glintui", s = "_Plugin") {
902
+ const d = pe();
903
+ let v = {};
872
904
  try {
873
- const i = await $.callNativeModule("AddonEnvModule", "getBuiltInVersions", []);
874
- i && typeof i == "object" && (f = i);
905
+ const i = await G.callNativeModule("AddonEnvModule", "getBuiltInVersions", []);
906
+ i && typeof i == "object" && (v = i);
875
907
  } catch (i) {
876
908
  console.warn("[AddonProvider] Failed to fetch built-in versions from AddonEnvModule", i);
877
909
  }
878
- const p = `QtGridTabs${s}`, b = u.isComponentRegistered(p), l = b instanceof Promise ? await b : b, m = {
879
- isPluginActive: l,
880
- nameSuffix: l ? s : "",
910
+ const b = `QtGridTabs${s}`, y = d.isComponentRegistered(b), c = y instanceof Promise ? await y : y, m = {
911
+ isPluginActive: c,
912
+ nameSuffix: c ? s : "",
881
913
  // 如果使用了热更插件,包名加上 .ext 后缀(与 Gradle 打包脚本对齐)
882
- pluginPackageName: l ? `${o}.ext` : o,
883
- builtInVersions: f
914
+ pluginPackageName: c ? `${o}.ext` : o,
915
+ builtInVersions: v
884
916
  };
885
917
  return console.info("[AddonProvider] Environment initialized:", m), m;
886
918
  }
887
- let ee = S(Pe);
888
- function qe(o) {
889
- ee.value = o, Ne(ye, ee);
919
+ let ne = x(Te);
920
+ function Re(o) {
921
+ ne.value = o, Ee(Pe, ne);
890
922
  }
891
- function z() {
923
+ function W() {
892
924
  var o;
893
- return ((o = Ee(ye, ee)) == null ? void 0 : o.value) || Pe;
925
+ return ((o = Ne(Pe, ne)) == null ? void 0 : o.value) || Te;
894
926
  }
895
- const Le = {
927
+ const Ce = {
896
928
  install: (o) => {
897
- o.use(ke), o.use(_e), o.use($e), o.use(Se), o.use(Ge);
929
+ o.use(ke), o.use(Se), o.use($e), o.use(_e), o.use(Ge);
898
930
  }
899
931
  };
900
932
  export {
901
- ye as ADDON_ENV_CONTEXT_KEY,
902
- W as GridTabs,
933
+ Pe as ADDON_ENV_CONTEXT_KEY,
934
+ H as GridTabs,
903
935
  ke as GridTabsPlugin,
904
936
  ve as HsvBackground,
905
937
  Ge as HsvBackgroundPlugin,
906
- re as Keyboard,
907
- _e as KeyboardPlugin,
938
+ ae as Keyboard,
939
+ Se as KeyboardPlugin,
908
940
  ue as PortalItem,
909
- Se as PortalItemPlugin,
941
+ _e as PortalItemPlugin,
910
942
  le as PortalPool,
911
943
  $e as PortalPoolPlugin,
912
- Le as QuickTVUINAddons,
944
+ Ce as QuickTVUINAddons,
913
945
  xe as QuickTVUINAddonsConfig,
914
- Le as default,
915
- Re as initAddonEnv,
916
- qe as provideAddonEnv,
917
- z as useAddonEnv,
946
+ Ce as default,
947
+ qe as initAddonEnv,
948
+ Re as provideAddonEnv,
949
+ W as useAddonEnv,
918
950
  Me as useGridTabs,
919
- V as withAsyncPlugin
951
+ z as withAsyncPlugin
920
952
  };