@quicktvui/naddons 1.0.0-rc.0 → 1.0.0-rc.2

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.
Files changed (32) hide show
  1. package/dist/components/GridTabs/GridTabs.vue.d.ts +56 -2
  2. package/dist/components/GridTabs/useGridTabs.d.ts +5 -1
  3. package/dist/components/HsvBackground/HsvBackground.vue.d.ts +7 -19
  4. package/dist/components/HsvBackground/index.d.ts +9 -2
  5. package/dist/components/NaButton/NaButton.vue.d.ts +24 -0
  6. package/dist/components/NaButton/NaButtonBase.vue.d.ts +60 -0
  7. package/dist/components/NaButton/index.d.ts +13 -0
  8. package/dist/components/NaCheckbox/NaCheckbox.vue.d.ts +108 -0
  9. package/dist/components/NaCheckbox/index.d.ts +13 -0
  10. package/dist/components/NaCheckboxGroup/NaCheckboxGroup.vue.d.ts +103 -0
  11. package/dist/components/NaCheckboxGroup/index.d.ts +13 -0
  12. package/dist/components/NaInputView/NaInputView.vue.d.ts +42 -0
  13. package/dist/components/NaInputView/NaInputViewBase.vue.d.ts +46 -0
  14. package/dist/components/NaInputView/index.d.ts +13 -0
  15. package/dist/components/NaRadioGroup/NaRadioGroup.vue.d.ts +103 -0
  16. package/dist/components/NaRadioGroup/index.d.ts +13 -0
  17. package/dist/components/NaSettingSwitch/NaSettingSwitch.vue.d.ts +111 -0
  18. package/dist/components/NaSettingSwitch/index.d.ts +6 -0
  19. package/dist/components/NaSwitcher/NaSwitcher.vue.d.ts +50 -0
  20. package/dist/components/NaSwitcher/index.d.ts +13 -0
  21. package/dist/components/SvgImage/SvgImage.vue.d.ts +26 -0
  22. package/dist/components/SvgImage/index.d.ts +13 -0
  23. package/dist/core/AddonProvider.d.ts +14 -1
  24. package/dist/index.d.ts +33 -1
  25. package/dist/modules/AddonEnvModule.d.ts +4 -0
  26. package/dist/modules/ExtraUIConfigModule.d.ts +7 -0
  27. package/dist/modules/GridTabsConfigModule.d.ts +7 -0
  28. package/dist/naddons.cjs.js +1 -1
  29. package/dist/naddons.es.js +1528 -622
  30. package/dist/style.css +1 -0
  31. package/dist/types/index.d.ts +50 -0
  32. package/package.json +1 -1
@@ -1,97 +1,149 @@
1
- import { defineComponent as L, ref as G, openBlock as B, createBlock as Q, unref as K, mergeProps as j, withCtx as V, renderSlot as W, shallowRef as oe, watch as se, computed as Ie, onMounted as Ae, h as U, nextTick as Ee, provide as Ne, inject as _e } from "vue";
2
- import { Native as x } from "@extscreen/es3-vue";
3
- import { useES as me, useESPlugin as ke } from "@extscreen/es3-core";
4
- const ae = "QtGridTabs", J = /* @__PURE__ */ L({
1
+ import { defineComponent as w, ref as A, openBlock as S, createBlock as $, unref as D, mergeProps as B, withCtx as R, renderSlot as F, shallowRef as me, watch as ee, computed as W, resolveComponent as ge, createElementBlock as J, normalizeStyle as fe, Fragment as Ke, renderList as He, onMounted as et, h as H, nextTick as tt, provide as ot, inject as nt } from "vue";
2
+ import { Native as N } from "@extscreen/es3-vue";
3
+ import { useES as Ze, useESPlugin as at } from "@extscreen/es3-core";
4
+ const be = "QtGridTabs", X = /* @__PURE__ */ w({
5
5
  __name: "GridTabs",
6
- setup(o, { expose: s }) {
7
- const v = G(), p = Z(), f = ae + "_Plugin", r = (p.isPluginActive ? f : ae).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), y = z(
8
- r,
9
- p.pluginPackageName || "com.quicktvui.plugin.glintui",
10
- "com.quicktvui.plugin.glintui.GlintPluginApp"
6
+ props: {
7
+ protocolVersion: {},
8
+ pageSpec: {},
9
+ tabsData: {},
10
+ actionPayload: {}
11
+ },
12
+ emits: ["onTabSelected", "onTabClick", "onTabNeedsData", "onLoadMore", "onScroll", "onScrollStateChanged", "onItemPresence", "onTabFocused", "onItemClick", "onItemLongClick", "onItemFocused", "onProtocolMismatch"],
13
+ setup(e, { expose: i }) {
14
+ const u = A(), s = _(), f = be + "_Plugin", l = (s.isPluginActive ? f : be).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
15
+ l,
16
+ s.pluginPackageName || "com.quicktvui.plugin.glintui"
11
17
  );
12
- return s({
18
+ return i({
13
19
  getNativeNode: () => {
14
- var i, d;
15
- return ((d = (i = v.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : d.call(i)) || v.value;
20
+ var a, c;
21
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
22
+ },
23
+ dispatchAction: (...a) => {
24
+ var d, h;
25
+ const c = ((h = (d = u.value) == null ? void 0 : d.getNativeNode) == null ? void 0 : h.call(d)) || u.value;
26
+ if (c)
27
+ if (a.length > 0) {
28
+ let C = a[0];
29
+ typeof C == "object" && (C = JSON.stringify(C)), N.callUIFunction(c, "dispatchAction", [C]);
30
+ } else
31
+ N.callUIFunction(c, "dispatchAction", a);
32
+ },
33
+ scrollToTop: (...a) => {
34
+ var d, h;
35
+ const c = ((h = (d = u.value) == null ? void 0 : d.getNativeNode) == null ? void 0 : h.call(d)) || u.value;
36
+ c && N.callUIFunction(c, "scrollToTop", a);
37
+ },
38
+ getFocusState: (...a) => {
39
+ var d, h;
40
+ const c = ((h = (d = u.value) == null ? void 0 : d.getNativeNode) == null ? void 0 : h.call(d)) || u.value;
41
+ c && N.callUIFunction(c, "getFocusState", a);
42
+ },
43
+ getItemRect: (...a) => {
44
+ var d, h;
45
+ const c = ((h = (d = u.value) == null ? void 0 : d.getNativeNode) == null ? void 0 : h.call(d)) || u.value;
46
+ c && N.callUIFunction(c, "getItemRect", a);
47
+ },
48
+ requestFocus: (...a) => {
49
+ var d, h;
50
+ const c = ((h = (d = u.value) == null ? void 0 : d.getNativeNode) == null ? void 0 : h.call(d)) || u.value;
51
+ c && N.callUIFunction(c, "requestFocus", a);
16
52
  }
17
- }), (i, d) => (B(), Q(K(y), j({
53
+ }), (a, c) => (S(), $(D(r), B({
18
54
  ref_key: "nativeRef",
19
- ref: v
20
- }, i.$attrs), {
21
- default: V(() => [
22
- W(i.$slots, "default")
55
+ ref: u,
56
+ protocolVersion: e.protocolVersion,
57
+ pageSpec: e.pageSpec,
58
+ tabsData: e.tabsData,
59
+ actionPayload: e.actionPayload,
60
+ onOnTabSelected: c[0] || (c[0] = (d) => a.$emit("onTabSelected", d.nativeEvent)),
61
+ onOnTabClick: c[1] || (c[1] = (d) => a.$emit("onTabClick", d.nativeEvent)),
62
+ onOnTabNeedsData: c[2] || (c[2] = (d) => a.$emit("onTabNeedsData", d.nativeEvent)),
63
+ onOnLoadMore: c[3] || (c[3] = (d) => a.$emit("onLoadMore", d.nativeEvent)),
64
+ onOnScroll: c[4] || (c[4] = (d) => a.$emit("onScroll", d.nativeEvent)),
65
+ onOnScrollStateChanged: c[5] || (c[5] = (d) => a.$emit("onScrollStateChanged", d.nativeEvent)),
66
+ onOnItemPresence: c[6] || (c[6] = (d) => a.$emit("onItemPresence", d.nativeEvent)),
67
+ onOnTabFocused: c[7] || (c[7] = (d) => a.$emit("onTabFocused", d.nativeEvent)),
68
+ onOnItemClick: c[8] || (c[8] = (d) => a.$emit("onItemClick", d.nativeEvent)),
69
+ onOnItemLongClick: c[9] || (c[9] = (d) => a.$emit("onItemLongClick", d.nativeEvent)),
70
+ onOnItemFocused: c[10] || (c[10] = (d) => a.$emit("onItemFocused", d.nativeEvent)),
71
+ onOnProtocolMismatch: c[11] || (c[11] = (d) => a.$emit("onProtocolMismatch", d.nativeEvent))
72
+ }, a.$attrs), {
73
+ default: R(() => [
74
+ F(a.$slots, "default")
23
75
  ]),
24
76
  _: 3
25
- }, 16));
77
+ }, 16, ["protocolVersion", "pageSpec", "tabsData", "actionPayload"]));
26
78
  }
27
79
  });
28
- let Y;
29
- var ge;
80
+ let te;
81
+ var Fe;
30
82
  try {
31
- const o = require("@extscreen/es3-vue");
32
- Y = o.registerElement || ((ge = o.default) == null ? void 0 : ge.registerElement);
83
+ const e = require("@extscreen/es3-vue");
84
+ te = e.registerElement || ((Fe = e.default) == null ? void 0 : Fe.registerElement);
33
85
  } catch {
34
86
  }
35
- const we = {
36
- install: (o) => {
87
+ const it = {
88
+ install: (e) => {
37
89
  if (!globalThis.__QtGridTabs_registered)
38
- if (Y) {
39
- const s = (v, p) => {
40
- Y(v, {
90
+ if (te) {
91
+ const i = (u, s) => {
92
+ te(u, {
41
93
  component: {
42
- name: p ? "QtGridTabs_Plugin" : "QtGridTabs",
43
- processEventData(f, b) {
44
- const r = f.handler || f, y = b || (r == null ? void 0 : r.nativeParams) || {};
45
- return r && (r.nativeEvent = y), r;
94
+ name: s ? "QtGridTabs_Plugin" : "QtGridTabs",
95
+ processEventData(f, v) {
96
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
97
+ return l && (l.nativeEvent = r), l;
46
98
  }
47
99
  }
48
100
  });
49
101
  };
50
- 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");
102
+ i("qt-grid-tabs", !1), i("qt-grid-tabs-plugin", !0), i("QtGridTabs", !1), i("QtGridTabs_Plugin", !0), i("gt-tabs", !1), i("gt-tabs-plugin", !0), globalThis.__QtGridTabs_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtGridTabs");
51
103
  } else
52
104
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
53
- o.component("GridTabs", J), o.component("qt-grid-tabs", J), o.component("gt-tabs", J);
105
+ e.component("GridTabs", X), e.component("qt-grid-tabs", X), e.component("gt-tabs", X);
54
106
  }
55
107
  };
56
- function Ke(o, s) {
57
- const v = G(""), p = oe([]), f = oe([]);
58
- let b = !1, r = !1;
59
- const y = "__virtual_single_tab__";
60
- let i = "", d = !1;
61
- const g = G({}), T = (n) => {
62
- const e = Array.isArray(n) ? n : [n];
63
- if (r && o.value) {
64
- if (typeof o.value.dispatchAction == "function") {
65
- console.log("[useGridTabs] Calling Wrapper dispatchAction directly"), o.value.dispatchAction(e);
108
+ function _t(e, i) {
109
+ const u = A(""), s = i ? JSON.parse(JSON.stringify(i)) : {}, f = me([]), v = me([]);
110
+ let l = !1, r = !1;
111
+ const a = "__virtual_single_tab__";
112
+ let c = "", d = !1;
113
+ const h = A({}), C = (o) => {
114
+ const t = Array.isArray(o) ? o : [o];
115
+ if (r && e.value) {
116
+ if (typeof e.value.dispatchAction == "function") {
117
+ console.log("[useGridTabs] Calling Wrapper dispatchAction directly"), e.value.dispatchAction(t);
66
118
  return;
67
119
  }
68
- let t = o.value;
69
- typeof o.value.getNativeNode == "function" ? t = o.value.getNativeNode() || o.value : o.value.nativeRef && (t = o.value.nativeRef), t ? (console.log("[useGridTabs] Calling Native callUIFunction dispatchAction fallback"), x.callUIFunction(t, "dispatchAction", [JSON.stringify(e)])) : console.warn("[useGridTabs] Native target is null or undefined, cannot call dispatchAction");
120
+ let n = e.value;
121
+ typeof e.value.getNativeNode == "function" ? n = e.value.getNativeNode() || e.value : e.value.nativeRef && (n = e.value.nativeRef), n ? (console.log("[useGridTabs] Calling Native callUIFunction dispatchAction fallback"), N.callUIFunction(n, "dispatchAction", [JSON.stringify(t)])) : console.warn("[useGridTabs] Native target is null or undefined, cannot call dispatchAction");
70
122
  }
71
- }, F = (n, e) => {
72
- if (!n)
123
+ }, z = (o, t) => {
124
+ if (!o)
73
125
  return !1;
74
- let t = !0;
75
- return n.id || (console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): 卡片缺失必填字段 'id'。每个卡片必须有唯一标识才能进行后续更新!`, n), t = !1), n.viewType || (console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): 卡片缺失必填字段 'viewType' (id: ${n.id || "未知"})。必须指定 Native 注册的视图类型或 Portal 标识!`, n), t = !1), t;
76
- }, R = (n, e) => {
77
- if (!n)
126
+ let n = !0;
127
+ return o.id || (console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'id'。每个卡片必须有唯一标识才能进行后续更新!`, o), n = !1), o.viewType || (console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): 卡片缺失必填字段 'viewType' (id: ${o.id || "未知"})。必须指定 Native 注册的视图类型或 Portal 标识!`, o), n = !1), n;
128
+ }, q = (o, t) => {
129
+ if (!o)
78
130
  return !1;
79
- let t = !0;
80
- return n.tabId || (console.error(`[useGridTabs] ❌ 数据格式错误 (${e}): Tab 缺失必填字段 'tabId'。每个 Tab 必须有唯一标识!`, n), t = !1), (n.title === void 0 || n.title === null) && console.warn(`[useGridTabs] ⚠️ 数据格式警告 (${e}): Tab 缺失 'title' 字段 (tabId: ${n.tabId || "未知"}),导航栏可能显示为空。`, n), t;
81
- }, k = (n, e) => {
82
- if (!n || n.length === 0)
131
+ let n = !0;
132
+ return o.tabId || (console.error(`[useGridTabs] ❌ 数据格式错误 (${t}): Tab 缺失必填字段 'tabId'。每个 Tab 必须有唯一标识!`, o), n = !1), (o.title === void 0 || o.title === null) && console.warn(`[useGridTabs] ⚠️ 数据格式警告 (${t}): Tab 缺失 'title' 字段 (tabId: ${o.tabId || "未知"}),导航栏可能显示为空。`, o), n;
133
+ }, Z = (o, t) => {
134
+ if (!o || o.length === 0)
83
135
  return;
84
- O.clear();
85
- const t = n[0].hasOwnProperty("tabId") || n[0].hasOwnProperty("items") && Array.isArray(n[0].items);
86
- b = e === "1d", e === "1d" && t ? console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `items.value` (一维瀑布流) 赋值二维 Tabs 数据结构!请改用 `tabs.value = ...`") : e === "2d" && !t && console.error("[useGridTabs] ❌ 赋值错误: 你正在向 `tabs.value` (二维导航) 赋值一维卡片列表数据结构!请改用 `items.value = ...`"), e === "1d" ? n.forEach((a, l) => F(a, `items.value[${l}]`)) : n.forEach((a, l) => {
87
- R(a, `tabs.value[${l}]`), a.items && Array.isArray(a.items) && a.items.forEach((u, c) => F(u, `tabs.value[${l}].items[${c}]`));
88
- }), r = !0, M();
89
- }, O = /* @__PURE__ */ new Set(), M = (n = "unknown") => {
136
+ U.clear();
137
+ const n = o[0].hasOwnProperty("tabId") || o[0].hasOwnProperty("items") && Array.isArray(o[0].items);
138
+ l = 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" ? o.forEach((g, m) => z(g, `items.value[${m}]`)) : o.forEach((g, m) => {
139
+ q(g, `tabs.value[${m}]`), g.items && Array.isArray(g.items) && g.items.forEach((y, b) => z(y, `tabs.value[${m}].items[${b}]`));
140
+ }), r = !0, p();
141
+ }, U = /* @__PURE__ */ new Set(), p = (o = "unknown") => {
90
142
  if (!r) {
91
143
  console.warn("[useGridTabs] triggerRootUpdate skipped because isInitialized is false");
92
144
  return;
93
145
  }
94
- let e = {
146
+ let t = {
95
147
  protocolVersion: "1.28.0",
96
148
  // 新增:显式声明协议版本
97
149
  gridBasis: (s == null ? void 0 : s.gridBasis) ?? 30,
@@ -130,320 +182,324 @@ function Ke(o, s) {
130
182
  },
131
183
  themeConfig: s == null ? void 0 : s.themeConfig,
132
184
  referenceResolution: (s == null ? void 0 : s.referenceResolution) ?? { w: 1920, h: 1080 }
133
- }, t = [];
134
- b ? (e.navConfig = { ...e.navConfig, renderType: "none" }, t = [
185
+ }, n = [];
186
+ l ? (t.navConfig = { ...t.navConfig, renderType: "none" }, n = [
135
187
  {
136
- tabId: y,
188
+ tabId: a,
137
189
  title: "Virtual Tab",
138
190
  hidden: !0,
139
- items: f.value
191
+ items: v.value
140
192
  }
141
- ]) : t = p.value;
142
- const a = JSON.stringify({
143
- page_spec: e,
144
- tabs: t
193
+ ]) : n = f.value;
194
+ const g = JSON.stringify({
195
+ page_spec: t,
196
+ tabs: n
145
197
  });
146
- if (v.value === "")
147
- console.log(`[useGridTabs] triggerRootUpdate: Initializing tabsDataStr (length=${a.length})`), v.value = a, i = a;
198
+ if (u.value === "")
199
+ console.log(`[useGridTabs] triggerRootUpdate: Initializing tabsDataStr (length=${g.length})`), u.value = g, c = g;
148
200
  else {
149
- if (i === a) {
201
+ if (c === g) {
150
202
  console.log("[useGridTabs] triggerRootUpdate: Data unchanged, skipping RELOAD_TABS");
151
203
  return;
152
204
  }
153
- console.log(`[useGridTabs] triggerRootUpdate: Sending RELOAD_TABS action directly to Native (length=${a.length})`), v.value = a, i = a, T({
205
+ console.log(`[useGridTabs] triggerRootUpdate: Sending RELOAD_TABS action directly to Native (length=${g.length})`), u.value = g, c = g, C({
154
206
  op: "RELOAD_TABS",
155
207
  payload: {
156
- pageSpec: e,
208
+ pageSpec: t,
157
209
  // 兼容不同的 Gson alias
158
- page_spec: e,
159
- tabs: t
210
+ page_spec: t,
211
+ tabs: n
160
212
  }
161
213
  });
162
214
  }
163
- }, m = (n) => {
164
- if (!n || typeof n != "object" || n.__isGridTabsProxy)
165
- return n;
166
- n.content && typeof n.content == "object" && !n.content.__isGridTabsProxy && (n.content = new Proxy(n.content, {
167
- set(t, a, l, u) {
168
- const c = Reflect.set(t, a, l, u);
169
- return n.id && r && T({
215
+ }, I = (o) => {
216
+ if (!o || typeof o != "object" || o.__isGridTabsProxy)
217
+ return o;
218
+ o.content && typeof o.content == "object" && !o.content.__isGridTabsProxy && (o.content = new Proxy(o.content, {
219
+ set(n, g, m, y) {
220
+ const b = Reflect.set(n, g, m, y);
221
+ return o.id && r && C({
170
222
  op: "UPDATE_ITEM",
171
- itemId: n.id,
172
- payload: n
173
- }), c;
223
+ itemId: o.id,
224
+ payload: o
225
+ }), b;
174
226
  }
175
- }), Object.defineProperty(n.content, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(n.content, "__v_skip", { value: !0, enumerable: !1 })), n.subItems && Array.isArray(n.subItems) && !n.subItems.__isGridTabsProxy && (n.subItems = P(n.subItems, n.id), Object.defineProperty(n.subItems, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(n.subItems, "__v_skip", { value: !0, enumerable: !1 }));
176
- const e = new Proxy(n, {
177
- set(t, a, l, u) {
178
- const c = Reflect.set(t, a, l, u);
179
- return t.id && r && !d && T({
227
+ }), Object.defineProperty(o.content, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(o.content, "__v_skip", { value: !0, enumerable: !1 })), o.subItems && Array.isArray(o.subItems) && !o.subItems.__isGridTabsProxy && (o.subItems = P(o.subItems, o.id), Object.defineProperty(o.subItems, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(o.subItems, "__v_skip", { value: !0, enumerable: !1 }));
228
+ const t = new Proxy(o, {
229
+ set(n, g, m, y) {
230
+ const b = Reflect.set(n, g, m, y);
231
+ return n.id && r && !d && C({
180
232
  op: "UPDATE_ITEM",
181
- itemId: t.id,
182
- payload: t
183
- }), c;
233
+ itemId: n.id,
234
+ payload: n
235
+ }), b;
184
236
  }
185
237
  });
186
- return Object.defineProperty(e, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(e, "__v_skip", { value: !0, enumerable: !1 }), e;
187
- }, P = (n, e) => {
188
- for (let t = 0; t < n.length; t++)
189
- n[t] = m(n[t]);
190
- return new Proxy(n, {
191
- get(t, a, l) {
192
- return a === "push" ? (...u) => {
193
- u.forEach((S, q) => F(S, `push(${q})`)), r || console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");
194
- const c = u.map((S) => m(S)), h = Array.prototype.push.apply(t, c);
195
- return d || T({
238
+ return Object.defineProperty(t, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Object.defineProperty(t, "__v_skip", { value: !0, enumerable: !1 }), t;
239
+ }, P = (o, t) => {
240
+ for (let n = 0; n < o.length; n++)
241
+ o[n] = I(o[n]);
242
+ return new Proxy(o, {
243
+ get(n, g, m) {
244
+ return g === "push" ? (...y) => {
245
+ y.forEach((Q, K) => z(Q, `push(${K})`)), r || console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 push()。请先对 items.value 或 tabs.value 进行全量赋值!");
246
+ const b = y.map((Q) => I(Q)), k = Array.prototype.push.apply(n, b);
247
+ return d || C({
196
248
  op: "APPEND_SUB_ITEMS",
197
- itemId: e,
198
- payload: { subItems: c }
199
- }), h;
200
- } : a === "unshift" ? (...u) => {
201
- u.forEach((S, q) => F(S, `unshift(${q})`)), r || console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 unshift()。请先对 items.value 或 tabs.value 进行全量赋值!");
202
- const c = u.map((S) => m(S)), h = Array.prototype.unshift.apply(t, c);
203
- return r && c.length > 0 && !d && T({
249
+ itemId: t,
250
+ payload: { subItems: b }
251
+ }), k;
252
+ } : g === "unshift" ? (...y) => {
253
+ y.forEach((Q, K) => z(Q, `unshift(${K})`)), r || console.error("[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时调用了 unshift()。请先对 items.value 或 tabs.value 进行全量赋值!");
254
+ const b = y.map((Q) => I(Q)), k = Array.prototype.unshift.apply(n, b);
255
+ return r && b.length > 0 && !d && C({
204
256
  op: "PREPEND_SUB_ITEMS",
205
- itemId: e,
206
- payload: { subItems: c }
207
- }), h;
208
- } : a === "splice" ? (...u) => {
209
- const c = u.length >= 2 && u[0] === 0 && u[1] === t.length, h = Array.prototype.splice.apply(t, u);
210
- return r && c && e !== y ? d || T({
257
+ itemId: t,
258
+ payload: { subItems: b }
259
+ }), k;
260
+ } : g === "splice" ? (...y) => {
261
+ const b = y.length >= 2 && y[0] === 0 && y[1] === n.length, k = Array.prototype.splice.apply(n, y);
262
+ return r && b && t !== a ? d || C({
211
263
  op: "CLEAR_SUB_ITEMS",
212
- itemId: e
213
- }) : r && (d || M("items array spliced")), h;
214
- } : Reflect.get(t, a, l);
264
+ itemId: t
265
+ }) : r && (d || p("items array spliced")), k;
266
+ } : Reflect.get(n, g, m);
215
267
  },
216
- set(t, a, l, u) {
217
- if (a !== "length" && !isNaN(Number(a))) {
218
- r || console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(a)}]。请先对 items.value 或 tabs.value 进行全量赋值!`), F(l, `索引赋值 [${String(a)}]`);
219
- const c = m(l), h = Reflect.set(t, a, c, u);
220
- return c && c.id && !d && T({
268
+ set(n, g, m, y) {
269
+ if (g !== "length" && !isNaN(Number(g))) {
270
+ r || console.error(`[useGridTabs] ❌ 时机错误: 在底层还未完成初始化时直接修改了索引 [${String(g)}]。请先对 items.value 或 tabs.value 进行全量赋值!`), z(m, `索引赋值 [${String(g)}]`);
271
+ const b = I(m), k = Reflect.set(n, g, b, y);
272
+ return b && b.id && !d && C({
221
273
  op: "UPDATE_ITEM",
222
- itemId: c.id,
223
- payload: c
224
- }), h;
274
+ itemId: b.id,
275
+ payload: b
276
+ }), k;
225
277
  }
226
- return Reflect.set(t, a, l, u);
278
+ return Reflect.set(n, g, m, y);
227
279
  }
228
280
  });
229
- }, _ = (n) => (n.items && Array.isArray(n.items) && !n.items.__isGridTabsProxy && (n.items = P(n.items, n.tabId), Object.defineProperty(n.items, "__isGridTabsProxy", { value: !0, enumerable: !1 })), new Proxy(n, {
230
- set(e, t, a, l) {
231
- if (t === "items") {
232
- let c = a;
233
- return Array.isArray(a) && !a.__isGridTabsProxy && (c = P(a, e.tabId), Object.defineProperty(c, "__isGridTabsProxy", { value: !0, enumerable: !1 })), Reflect.set(e, t, c, l);
234
- } else if (t === "loadState") {
235
- const c = Reflect.set(e, t, a, l);
236
- return r && e.tabId && !d && T({
281
+ }, E = (o) => (o.items && Array.isArray(o.items) && !o.items.__isGridTabsProxy && (o.items = P(o.items, o.tabId), Object.defineProperty(o.items, "__isGridTabsProxy", { value: !0, enumerable: !1 })), new Proxy(o, {
282
+ set(t, n, g, m) {
283
+ if (n === "items") {
284
+ let b = g;
285
+ return Array.isArray(g) && !g.__isGridTabsProxy && (b = P(g, t.tabId), Object.defineProperty(b, "__isGridTabsProxy", { value: !0, enumerable: !1 })), Reflect.set(t, n, b, m);
286
+ } else if (n === "loadState") {
287
+ const b = Reflect.set(t, n, g, m);
288
+ return r && t.tabId && !d && C({
237
289
  op: "UPDATE_TAB_STATE",
238
- itemId: e.tabId,
239
- payload: { loadState: a }
240
- }), c;
290
+ itemId: t.tabId,
291
+ payload: { loadState: g }
292
+ }), b;
241
293
  }
242
- return Reflect.set(e, t, a, l);
294
+ return Reflect.set(t, n, g, m);
243
295
  }
244
- })), E = (n) => {
245
- const e = n.map((t) => _(t));
246
- return new Proxy(e, {
247
- set(t, a, l, u) {
248
- if (a !== "length" && !isNaN(Number(a))) {
249
- let c = l;
250
- l.__isGridTabsProxy || (c = _(l), Object.defineProperty(c, "__isGridTabsProxy", { value: !0, enumerable: !1 }));
251
- const h = Reflect.set(t, a, c, u);
252
- return M(), h;
296
+ })), G = (o) => {
297
+ const t = o.map((n) => E(n));
298
+ return new Proxy(t, {
299
+ set(n, g, m, y) {
300
+ if (g !== "length" && !isNaN(Number(g))) {
301
+ let b = m;
302
+ m.__isGridTabsProxy || (b = E(m), Object.defineProperty(b, "__isGridTabsProxy", { value: !0, enumerable: !1 }));
303
+ const k = Reflect.set(n, g, b, y);
304
+ return p(), k;
253
305
  }
254
- return Reflect.set(t, a, l, u);
306
+ return Reflect.set(n, g, m, y);
255
307
  }
256
308
  });
257
309
  };
258
- se(p, (n, e) => {
259
- if (console.log("[useGridTabs] watch(tabs) triggered:", { newTabs: n, isInitialized: r }), !n || n.length === 0) {
260
- v.value = "", i = "", r = !1;
310
+ ee(f, (o, t) => {
311
+ if (console.log("[useGridTabs] watch(tabs) triggered:", { newTabs: o, isInitialized: r }), !o || o.length === 0) {
312
+ u.value = "", c = "", r = !1;
261
313
  return;
262
314
  }
263
- if (n.__isGridTabsProxy)
264
- console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"), M();
315
+ if (o.__isGridTabsProxy)
316
+ console.log("[useGridTabs] newTabs is ALREADY a proxy, triggering root update"), p();
265
317
  else {
266
318
  console.log("[useGridTabs] newTabs is NOT a proxy, performing full deduceModeAndInitialize & wrapping");
267
- const t = E(n);
268
- Object.defineProperty(t, "__isGridTabsProxy", { value: !0, enumerable: !1 }), k(t, "2d"), p.value = t;
319
+ const n = G(o);
320
+ Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Z(n, "2d"), f.value = n;
269
321
  }
270
- }, { flush: "sync", deep: !1 }), se(f, (n, e) => {
271
- if (console.log("[useGridTabs] watch(items) triggered:", { newItems: n, isInitialized: r }), !n || n.length === 0) {
272
- v.value = "", i = "", r = !1;
322
+ }, { flush: "sync", deep: !1 }), ee(v, (o, t) => {
323
+ if (console.log("[useGridTabs] watch(items) triggered:", { newItems: o, isInitialized: r }), !o || o.length === 0) {
324
+ u.value = "", c = "", r = !1;
273
325
  return;
274
326
  }
275
- if (n.__isGridTabsProxy)
276
- console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"), M();
327
+ if (o.__isGridTabsProxy)
328
+ console.log("[useGridTabs] newItems is ALREADY a proxy, triggering root update"), p();
277
329
  else {
278
330
  console.log("[useGridTabs] newItems is NOT a proxy, performing full deduceModeAndInitialize & wrapping");
279
- const t = P(n, y);
280
- Object.defineProperty(t, "__isGridTabsProxy", { value: !0, enumerable: !1 }), k(t, "1d"), f.value = t;
331
+ const n = P(o, a);
332
+ Object.defineProperty(n, "__isGridTabsProxy", { value: !0, enumerable: !1 }), Z(n, "1d"), v.value = n;
281
333
  }
282
334
  }, { flush: "sync", deep: !1 });
283
- const I = {}, N = () => {
284
- console.log("[useGridTabs] resetInitialization called manually"), r = !1, O.clear();
285
- for (const n in I)
286
- delete I[n];
287
- }, w = (n) => {
288
- if (!n || n.length === 0) {
289
- v.value = "", r = !1;
335
+ const T = {}, O = () => {
336
+ console.log("[useGridTabs] resetInitialization called manually"), r = !1, U.clear();
337
+ for (const o in T)
338
+ delete T[o];
339
+ }, M = (o) => {
340
+ if (!o || o.length === 0) {
341
+ u.value = "", r = !1;
290
342
  return;
291
343
  }
292
- n[0].hasOwnProperty("tabId") || n[0].hasOwnProperty("items") && Array.isArray(n[0].items) ? p.value = n : f.value = n;
293
- }, $ = (n) => {
294
- g.value = n;
295
- }, A = Ie(() => ({
296
- tabsData: v.value,
344
+ o[0].hasOwnProperty("tabId") || o[0].hasOwnProperty("items") && Array.isArray(o[0].items) ? f.value = o : v.value = o;
345
+ }, x = (o) => {
346
+ h.value = o;
347
+ }, V = W(() => ({
348
+ tabsData: u.value,
297
349
  // 不再绑定 actionPayload 属性,完全走命令式 API,防止触发无意义的 Vue 节点更新
298
- onTabNeedsData: async (...n) => {
299
- let e = n[0];
300
- if (e && e.nativeEvent && (e = e.nativeEvent), !g.value.onTabNeedsData)
350
+ onTabNeedsData: async (...o) => {
351
+ let t = o[0];
352
+ if (t && t.nativeEvent && (t = t.nativeEvent), !h.value.onTabNeedsData)
301
353
  return;
302
- const { tabId: t, index: a, reason: l } = e;
303
- if (O.has(t)) {
304
- console.log(`[useGridTabs] onTabNeedsData SKIP: tabId=${t} 已经发起过请求,防止死循环`);
354
+ const { tabId: n, index: g, reason: m } = t;
355
+ if (U.has(n)) {
356
+ console.log(`[useGridTabs] onTabNeedsData SKIP: tabId=${n} 已经发起过请求,防止死循环`);
305
357
  return;
306
358
  }
307
- O.add(t);
359
+ U.add(n);
308
360
  try {
309
- const u = await g.value.onTabNeedsData(t, a, l);
310
- if (u && Array.isArray(u))
311
- if (I[t] = 1, u.length > 0) {
312
- const c = p.value.find((h) => h.tabId === t);
313
- c && (c.items ? c.items.length > 0 && c.items.splice(0, c.items.length) : c.items = [], c.items.push(...u), c.loadState = "ready", T({
361
+ const y = await h.value.onTabNeedsData(n, g, m);
362
+ if (y && Array.isArray(y))
363
+ if (T[n] = 1, y.length > 0) {
364
+ const b = f.value.find((k) => k.tabId === n);
365
+ b && (b.items ? b.items.length > 0 && b.items.splice(0, b.items.length) : b.items = [], b.items.push(...y), b.loadState = "ready", C({
314
366
  op: "UPDATE_TAB_STATE",
315
- itemId: t,
367
+ itemId: n,
316
368
  payload: { loadState: "ready" }
317
369
  }));
318
370
  } else
319
- console.warn(`[useGridTabs] ⚠️ 警告: onTabNeedsData(tabId="${t}") 返回了空数组 []!`), console.warn("👉 如果你已经在此函数内手动调用了 push() 来追加数据,请在最后 return null 或 undefined。"), console.warn("👉 如果该 Tab 确实没有数据,返回 [] 可能会导致底层的 Header 等已有元素被清空,请注意检查。"), console.warn("👉 框架已为您拦截此次空数组覆盖,保留了当前的 DOM 结构。");
320
- } catch (u) {
321
- console.error("[useGridTabs] onTabNeedsData 执行失败:", u), O.delete(t);
371
+ console.warn(`[useGridTabs] ⚠️ 警告: onTabNeedsData(tabId="${n}") 返回了空数组 []!`), console.warn("👉 如果你已经在此函数内手动调用了 push() 来追加数据,请在最后 return null 或 undefined。"), console.warn("👉 如果该 Tab 确实没有数据,返回 [] 可能会导致底层的 Header 等已有元素被清空,请注意检查。"), console.warn("👉 框架已为您拦截此次空数组覆盖,保留了当前的 DOM 结构。");
372
+ } catch (y) {
373
+ console.error("[useGridTabs] onTabNeedsData 执行失败:", y), U.delete(n);
322
374
  }
323
375
  },
324
- onLoadMore: async (...n) => {
325
- let e = n[0];
326
- if (e && e.nativeEvent && (e = e.nativeEvent), !g.value.onLoadMore)
376
+ onLoadMore: async (...o) => {
377
+ let t = o[0];
378
+ if (t && t.nativeEvent && (t = t.nativeEvent), !h.value.onLoadMore)
327
379
  return;
328
- const { tabId: t, itemId: a } = e, u = (I[t] || 1) + 1;
329
- console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${t}, pageNo=${u}`);
380
+ const { tabId: n, itemId: g } = t, y = (T[n] || 1) + 1;
381
+ console.log(`[useGridTabs] 拦截到底层 onLoadMore,强行接管页码: tabId=${n}, pageNo=${y}`);
330
382
  try {
331
- const c = await g.value.onLoadMore(t, u, a);
332
- if (c && Array.isArray(c))
333
- if (c.length > 0)
334
- if (I[t] = u, b)
335
- f.value.push(...c);
383
+ const b = await h.value.onLoadMore(n, y, g);
384
+ if (b && Array.isArray(b))
385
+ if (b.length > 0)
386
+ if (T[n] = y, l)
387
+ v.value.push(...b);
336
388
  else {
337
- const h = p.value.find((S) => S.tabId === t);
338
- h && h.items && h.items.push(...c);
389
+ const k = f.value.find((Q) => Q.tabId === n);
390
+ k && k.items && k.items.push(...b);
339
391
  }
340
392
  else
341
- console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${t}", pageNo="${u}") 返回了空数组 []!`), console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'), console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。");
342
- } catch (c) {
343
- console.error("[useGridTabs] onLoadMore 业务层请求失败:", c);
393
+ console.warn(`[useGridTabs] ⚠️ 警告: onLoadMore(tabId="${n}", pageNo="${y}") 返回了空数组 []!`), console.warn('👉 如果这是你的最后一页数据,推荐在卡片列表中追加一个 type="no_more" 的 footer 卡片,而不是仅仅返回空。'), console.warn("👉 框架已忽略本次空数据追加,且不会自增页码。");
394
+ } catch (b) {
395
+ console.error("[useGridTabs] onLoadMore 业务层请求失败:", b);
344
396
  }
345
397
  },
346
- onItemPresence: (...n) => {
347
- let e = n[0];
348
- if (console.log("[useGridTabs] ⚡️ bindings caught onItemPresence:", e), g.value.onItemPresence)
398
+ onItemPresence: (...o) => {
399
+ let t = o[0];
400
+ if (console.log("[useGridTabs] ⚡️ bindings caught onItemPresence:", t), h.value.onItemPresence)
349
401
  try {
350
- let t = typeof e == "string" ? e : (e == null ? void 0 : e.nativeEvent) || e;
351
- t && typeof t.data == "string" && (t = t.data);
352
- const a = typeof t == "string" ? JSON.parse(t) : t;
353
- a && a.type === "VIEW_PRESENCE_BATCH" && Array.isArray(a.payload) ? a.payload.forEach((l) => {
354
- l.itemId && typeof l.itemId == "string" && l.itemId.startsWith("fallback_pos_") && console.warn(`[useGridTabs] ⚠️ 警告:检测到列表项曝光 (index=${l.index}),但未配置 itemId。请检查传入的 items 数组,务必为每个数据项指定唯一的 itemId,否则底层无法准确进行去重与曝光上报。`), g.value.onItemPresence(l);
355
- }) : g.value.onItemPresence(a);
356
- } catch (t) {
357
- console.error("[useGridTabs] Failed to parse onItemPresence event payload:", t), g.value.onItemPresence(e);
402
+ let n = typeof t == "string" ? t : (t == null ? void 0 : t.nativeEvent) || t;
403
+ n && typeof n.data == "string" && (n = n.data);
404
+ const g = typeof n == "string" ? JSON.parse(n) : n;
405
+ g && g.type === "VIEW_PRESENCE_BATCH" && Array.isArray(g.payload) ? g.payload.forEach((m) => {
406
+ m.itemId && typeof m.itemId == "string" && m.itemId.startsWith("fallback_pos_") && console.warn(`[useGridTabs] ⚠️ 警告:检测到列表项曝光 (index=${m.index}),但未配置 itemId。请检查传入的 items 数组,务必为每个数据项指定唯一的 itemId,否则底层无法准确进行去重与曝光上报。`), h.value.onItemPresence(m);
407
+ }) : h.value.onItemPresence(g);
408
+ } catch (n) {
409
+ console.error("[useGridTabs] Failed to parse onItemPresence event payload:", n), h.value.onItemPresence(t);
358
410
  }
359
411
  },
360
- onTabSelected: (...n) => {
361
- let e = n[0];
362
- e && e.nativeEvent && (e = e.nativeEvent), g.value.onTabSelected && g.value.onTabSelected(e);
412
+ onTabSelected: (...o) => {
413
+ let t = o[0];
414
+ t && t.nativeEvent && (t = t.nativeEvent), h.value.onTabSelected && h.value.onTabSelected(t);
363
415
  },
364
- onItemClick: (...n) => {
365
- let e = n[0];
366
- if (console.log("[useGridTabs] RAW onItemClick intercepted from Native:", e), e && e.nativeEvent && (e = e.nativeEvent), g.value.onItemClick)
416
+ onTabClick: (...o) => {
417
+ let t = o[0];
418
+ t && t.nativeEvent && (t = t.nativeEvent), h.value.onTabClick && h.value.onTabClick(t);
419
+ },
420
+ onItemClick: (...o) => {
421
+ let t = o[0];
422
+ if (console.log("[useGridTabs] RAW onItemClick intercepted from Native:", t), t && t.nativeEvent && (t = t.nativeEvent), h.value.onItemClick)
367
423
  try {
368
- let t = typeof e == "string" ? e : (e == null ? void 0 : e.data) || e;
369
- const a = typeof t == "string" ? JSON.parse(t) : t;
370
- g.value.onItemClick(a);
371
- } catch (t) {
372
- console.error("[useGridTabs] Failed to parse onItemClick event payload:", t), g.value.onItemClick(e);
424
+ let n = typeof t == "string" ? t : (t == null ? void 0 : t.data) || t;
425
+ const g = typeof n == "string" ? JSON.parse(n) : n;
426
+ h.value.onItemClick(g);
427
+ } catch (n) {
428
+ console.error("[useGridTabs] Failed to parse onItemClick event payload:", n), h.value.onItemClick(t);
373
429
  }
374
430
  else
375
431
  console.warn("[useGridTabs] onItemClick triggered but NO callback registered in callbacksRef!");
376
432
  },
377
- onItemLongClick: (...n) => {
378
- let e = n[0];
379
- if (console.log("[useGridTabs] RAW onItemLongClick intercepted from Native:", e), typeof e == "number" && n.length >= 3 && typeof n[1] == "string" && (e = n[2]), e && e.nativeEvent && (e = e.nativeEvent), g.value.onItemLongClick)
433
+ onItemLongClick: (...o) => {
434
+ let t = o[0];
435
+ if (console.log("[useGridTabs] RAW onItemLongClick intercepted from Native:", t), typeof t == "number" && o.length >= 3 && typeof o[1] == "string" && (t = o[2]), t && t.nativeEvent && (t = t.nativeEvent), h.value.onItemLongClick)
380
436
  try {
381
- let t = typeof e == "string" ? e : (e == null ? void 0 : e.data) || e;
382
- const a = typeof t == "string" ? JSON.parse(t) : t;
383
- g.value.onItemLongClick(a);
384
- } catch (t) {
385
- console.error("[useGridTabs] Failed to parse onItemLongClick event payload:", t), g.value.onItemLongClick(e);
437
+ let n = typeof t == "string" ? t : (t == null ? void 0 : t.data) || t;
438
+ const g = typeof n == "string" ? JSON.parse(n) : n;
439
+ h.value.onItemLongClick(g);
440
+ } catch (n) {
441
+ console.error("[useGridTabs] Failed to parse onItemLongClick event payload:", n), h.value.onItemLongClick(t);
386
442
  }
387
443
  },
388
- onItemFocused: (...n) => {
389
- let e = n[0];
390
- if (e && e.nativeEvent && (e = e.nativeEvent), g.value.onItemFocused)
444
+ onItemFocused: (...o) => {
445
+ let t = o[0];
446
+ if (t && t.nativeEvent && (t = t.nativeEvent), h.value.onItemFocused)
391
447
  try {
392
- let t = typeof e == "string" ? e : (e == null ? void 0 : e.data) || e;
393
- const a = typeof t == "string" ? JSON.parse(t) : t;
394
- g.value.onItemFocused(a);
395
- } catch (t) {
396
- console.error("[useGridTabs] Failed to parse onItemFocused event payload:", t), g.value.onItemFocused(e);
448
+ let n = typeof t == "string" ? t : (t == null ? void 0 : t.data) || t;
449
+ const g = typeof n == "string" ? JSON.parse(n) : n;
450
+ h.value.onItemFocused(g);
451
+ } catch (n) {
452
+ console.error("[useGridTabs] Failed to parse onItemFocused event payload:", n), h.value.onItemFocused(t);
397
453
  }
398
454
  },
399
- onTabFocused: (...n) => {
400
- let e = n[0];
401
- e && e.nativeEvent && (e = e.nativeEvent), g.value.onTabFocused && g.value.onTabFocused(e);
455
+ onTabFocused: (...o) => {
456
+ let t = o[0];
457
+ t && t.nativeEvent && (t = t.nativeEvent), h.value.onTabFocused && h.value.onTabFocused(t);
402
458
  },
403
- onScroll: (...n) => {
404
- let e = n[0];
405
- if (e && e.nativeEvent && (e = e.nativeEvent), g.value.onScroll)
459
+ onScroll: (...o) => {
460
+ let t = o[0];
461
+ if (t && t.nativeEvent && (t = t.nativeEvent), h.value.onScroll)
406
462
  try {
407
- const t = (e == null ? void 0 : e.data) || e;
408
- g.value.onScroll(t);
463
+ const n = (t == null ? void 0 : t.data) || t;
464
+ h.value.onScroll(n);
409
465
  } catch {
410
- g.value.onScroll(e);
466
+ h.value.onScroll(t);
411
467
  }
412
468
  },
413
- onScrollStateChanged: (...n) => {
414
- let e = n[0];
415
- if (e && e.nativeEvent && (e = e.nativeEvent), g.value.onScrollStateChanged)
469
+ onScrollStateChanged: (...o) => {
470
+ let t = o[0];
471
+ if (t && t.nativeEvent && (t = t.nativeEvent), h.value.onScrollStateChanged)
416
472
  try {
417
- const t = (e == null ? void 0 : e.data) || e;
418
- g.value.onScrollStateChanged(t);
473
+ const n = (t == null ? void 0 : t.data) || t;
474
+ h.value.onScrollStateChanged(n);
419
475
  } catch {
420
- g.value.onScrollStateChanged(e);
476
+ h.value.onScrollStateChanged(t);
421
477
  }
422
478
  }
423
479
  }));
424
480
  return {
425
- tabsDataStr: v,
426
- bindings: A,
427
- tabs: p,
428
- items: f,
429
- initData: w,
430
- setCallbacks: $,
431
- updateItem: (n, e) => {
481
+ tabsDataStr: u,
482
+ bindings: V,
483
+ tabs: f,
484
+ items: v,
485
+ initData: M,
486
+ setCallbacks: x,
487
+ updateItem: (o, t) => {
432
488
  if (!r) {
433
489
  console.error("[useGridTabs] ❌ 时机错误: 尚未初始化数据,无法调用 updateItem");
434
490
  return;
435
491
  }
436
- T({ op: "UPDATE_ITEM", itemId: n, payload: e }), d = !0;
492
+ C({ op: "UPDATE_ITEM", itemId: o, payload: t }), d = !0;
437
493
  try {
438
- if (b) {
439
- const t = f.value.find((a) => a.id === n);
440
- t && Object.assign(t, e);
494
+ if (l) {
495
+ const n = v.value.find((g) => g.id === o);
496
+ n && Object.assign(n, t);
441
497
  } else
442
- for (const t of p.value)
443
- if (t.items) {
444
- const a = t.items.find((l) => l.id === n);
445
- if (a) {
446
- Object.assign(a, e);
498
+ for (const n of f.value)
499
+ if (n.items) {
500
+ const g = n.items.find((m) => m.id === o);
501
+ if (g) {
502
+ Object.assign(g, t);
447
503
  break;
448
504
  }
449
505
  }
@@ -451,19 +507,19 @@ function Ke(o, s) {
451
507
  d = !1;
452
508
  }
453
509
  },
454
- deleteItem: (n, e = !0) => {
510
+ deleteItem: (o, t = !0) => {
455
511
  if (r) {
456
- T({ op: "DELETE_ITEM", itemId: n, payload: { animated: e } }), d = !0;
512
+ C({ op: "DELETE_ITEM", itemId: o, payload: { animated: t } }), d = !0;
457
513
  try {
458
- if (b) {
459
- const t = f.value.findIndex((a) => a.id === n);
460
- t !== -1 && f.value.splice(t, 1);
514
+ if (l) {
515
+ const n = v.value.findIndex((g) => g.id === o);
516
+ n !== -1 && v.value.splice(n, 1);
461
517
  } else
462
- for (const t of p.value)
463
- if (t.items) {
464
- const a = t.items.findIndex((l) => l.id === n);
465
- if (a !== -1) {
466
- t.items.splice(a, 1);
518
+ for (const n of f.value)
519
+ if (n.items) {
520
+ const g = n.items.findIndex((m) => m.id === o);
521
+ if (g !== -1) {
522
+ n.items.splice(g, 1);
467
523
  break;
468
524
  }
469
525
  }
@@ -472,85 +528,85 @@ function Ke(o, s) {
472
528
  }
473
529
  }
474
530
  },
475
- prependItems: (n, e) => {
531
+ prependItems: (o, t) => {
476
532
  if (r) {
477
- T({
533
+ C({
478
534
  op: "PREPEND_SUB_ITEMS",
479
- itemId: n,
480
- payload: { subItems: e }
535
+ itemId: o,
536
+ payload: { subItems: t }
481
537
  }), d = !0;
482
538
  try {
483
- if (b)
484
- f.value.unshift(...e);
539
+ if (l)
540
+ v.value.unshift(...t);
485
541
  else {
486
- const t = p.value.find((a) => a.tabId === n);
487
- t && t.items && t.items.unshift(...e);
542
+ const n = f.value.find((g) => g.tabId === o);
543
+ n && n.items && n.items.unshift(...t);
488
544
  }
489
545
  } finally {
490
546
  d = !1;
491
547
  }
492
548
  }
493
549
  },
494
- clearItems: (n) => {
550
+ clearItems: (o) => {
495
551
  if (r) {
496
- T({
552
+ C({
497
553
  op: "CLEAR_SUB_ITEMS",
498
- itemId: n
554
+ itemId: o
499
555
  }), d = !0;
500
556
  try {
501
- if (b)
502
- f.value.splice(0, f.value.length);
557
+ if (l)
558
+ v.value.splice(0, v.value.length);
503
559
  else {
504
- const e = p.value.find((t) => t.tabId === n);
505
- e && e.items && e.items.splice(0, e.items.length);
560
+ const t = f.value.find((n) => n.tabId === o);
561
+ t && t.items && t.items.splice(0, t.items.length);
506
562
  }
507
563
  } finally {
508
564
  d = !1;
509
565
  }
510
566
  }
511
567
  },
512
- moveItem: (n, e, t) => {
568
+ moveItem: (o, t, n) => {
513
569
  if (r) {
514
- T({
570
+ C({
515
571
  op: "MOVE_ITEM",
516
- itemId: n,
517
- payload: { targetPosition: e, anchorItemId: t }
572
+ itemId: o,
573
+ payload: { targetPosition: t, anchorItemId: n }
518
574
  }), d = !0;
519
575
  try {
520
- const a = (l) => {
521
- const u = l.findIndex((h) => h.id === n), c = l.findIndex((h) => h.id === t);
522
- if (u !== -1 && c !== -1) {
523
- const h = l.splice(u, 1)[0], S = l.findIndex((Te) => Te.id === t), q = e === "after" ? S + 1 : S;
524
- l.splice(q, 0, h);
576
+ const g = (m) => {
577
+ const y = m.findIndex((k) => k.id === o), b = m.findIndex((k) => k.id === n);
578
+ if (y !== -1 && b !== -1) {
579
+ const k = m.splice(y, 1)[0], Q = m.findIndex((Ye) => Ye.id === n), K = t === "after" ? Q + 1 : Q;
580
+ m.splice(K, 0, k);
525
581
  }
526
582
  };
527
- if (b)
528
- a(f.value);
583
+ if (l)
584
+ g(v.value);
529
585
  else
530
- for (const l of p.value)
531
- l.items && a(l.items);
586
+ for (const m of f.value)
587
+ m.items && g(m.items);
532
588
  } finally {
533
589
  d = !1;
534
590
  }
535
591
  }
536
592
  },
537
- replaceItem: (n, e) => {
593
+ replaceItem: (o, t) => {
538
594
  if (r) {
539
- T({
595
+ C({
540
596
  op: "REPLACE_ITEM",
541
- itemId: n,
542
- payload: e
597
+ itemId: o,
598
+ payload: t
543
599
  }), d = !0;
544
600
  try {
545
- if (b) {
546
- const t = f.value.findIndex((a) => a.id === n);
547
- t !== -1 && (f.value[t] = e);
601
+ if (l) {
602
+ const n = v.value.findIndex((g) => g.id === o);
603
+ n !== -1 && (v.value[n] = t);
548
604
  } else
549
- for (const t of p.value)
550
- if (t.items) {
551
- const a = t.items.findIndex((l) => l.id === n);
552
- if (a !== -1) {
553
- t.items[a] = e;
605
+ for (const n of f.value)
606
+ if (n.items) {
607
+ const g = n.items.findIndex((m) => m.id === o);
608
+ if (g !== -1) {
609
+ n.items[g] = t;
554
610
  break;
555
611
  }
556
612
  }
@@ -559,49 +615,78 @@ function Ke(o, s) {
559
615
  }
560
616
  }
561
617
  },
562
- dispatchAction: T,
563
- resetInitialization: N,
564
- getFocusState: async () => new Promise((n, e) => {
565
- let t = o.value;
566
- typeof o.value.getNativeNode == "function" ? t = o.value.getNativeNode() || o.value : o.value.nativeRef && (t = o.value.nativeRef), console.log("[useGridTabs] getFocusState called, nativeTarget:", t);
567
- const a = (l) => {
568
- if (console.log("[useGridTabs] getFocusState callback received:", l), l && l.isSuccess !== void 0 && l.result !== void 0) {
569
- n(l.result);
618
+ dispatchAction: C,
619
+ resetInitialization: O,
620
+ getFocusState: async () => new Promise((o, t) => {
621
+ let n = e.value;
622
+ typeof e.value.getNativeNode == "function" ? n = e.value.getNativeNode() || e.value : e.value.nativeRef && (n = e.value.nativeRef), console.log("[useGridTabs] getFocusState called, nativeTarget:", n);
623
+ const g = (m) => {
624
+ if (console.log("[useGridTabs] getFocusState callback received:", m), m && m.isSuccess !== void 0 && m.result !== void 0) {
625
+ o(m.result);
570
626
  return;
571
627
  }
572
628
  try {
573
- const u = typeof l == "string" ? JSON.parse(l) : l;
574
- n(u);
575
- } catch (u) {
576
- e(u);
629
+ const y = typeof m == "string" ? JSON.parse(m) : m;
630
+ o(y);
631
+ } catch (y) {
632
+ t(y);
577
633
  }
578
634
  };
579
- typeof x.callUIFunction == "function" ? (console.log('[useGridTabs] Executing Native.callUIFunction("getFocusState") with callback as 4th arg'), x.callUIFunction(t, "getFocusState", [], a)) : (console.error("[useGridTabs] Native.callUIFunction is not available"), e(new Error("Native.callUIFunction is not available")));
635
+ typeof N.callUIFunction == "function" ? (console.log('[useGridTabs] Executing Native.callUIFunction("getFocusState") with callback as 4th arg'), N.callUIFunction(n, "getFocusState", [], g)) : (console.error("[useGridTabs] Native.callUIFunction is not available"), t(new Error("Native.callUIFunction is not available")));
580
636
  }),
581
- getItemRect: async (n) => new Promise((e, t) => {
582
- let a = o.value;
583
- typeof o.value.getNativeNode == "function" ? a = o.value.getNativeNode() || o.value : o.value.nativeRef && (a = o.value.nativeRef), console.log(`[useGridTabs] getItemRect called for itemId=${n}, nativeTarget:`, a);
584
- const l = (u) => {
585
- if (console.log(`[useGridTabs] getItemRect callback received for itemId=${n}:`, u), u && u.isSuccess !== void 0 && u.result !== void 0) {
586
- e(u.result);
637
+ getItemRect: async (o) => new Promise((t, n) => {
638
+ let g = e.value;
639
+ typeof e.value.getNativeNode == "function" ? g = e.value.getNativeNode() || e.value : e.value.nativeRef && (g = e.value.nativeRef), console.log(`[useGridTabs] getItemRect called for itemId=${o}, nativeTarget:`, g);
640
+ const m = (y) => {
641
+ if (console.log(`[useGridTabs] getItemRect callback received for itemId=${o}:`, y), y && y.isSuccess !== void 0 && y.result !== void 0) {
642
+ t(y.result);
587
643
  return;
588
644
  }
589
645
  try {
590
- const c = typeof u == "string" ? JSON.parse(u) : u;
591
- e(c);
592
- } catch (c) {
593
- t(c);
646
+ const b = typeof y == "string" ? JSON.parse(y) : y;
647
+ t(b);
648
+ } catch (b) {
649
+ n(b);
594
650
  }
595
651
  };
596
- typeof x.callUIFunction == "function" ? (console.log('[useGridTabs] Executing Native.callUIFunction("getItemRect") with itemId and callback as 4th arg'), x.callUIFunction(a, "getItemRect", [n], l)) : (console.error("[useGridTabs] Native.callUIFunction is not available"), t(new Error("Native.callUIFunction is not available")));
652
+ typeof N.callUIFunction == "function" ? (console.log('[useGridTabs] Executing Native.callUIFunction("getItemRect") with itemId and callback as 4th arg'), N.callUIFunction(g, "getItemRect", [o], m)) : (console.error("[useGridTabs] Native.callUIFunction is not available"), n(new Error("Native.callUIFunction is not available")));
597
653
  }),
598
- requestFocus: (n) => {
599
- let e = o.value;
600
- typeof o.value.getNativeNode == "function" ? e = o.value.getNativeNode() || o.value : o.value.nativeRef && (e = o.value.nativeRef), x.callUIFunction(e, "requestFocus", [n]);
654
+ requestFocus: (o) => {
655
+ let t = e.value;
656
+ typeof e.value.getNativeNode == "function" ? t = e.value.getNativeNode() || e.value : e.value.nativeRef && (t = e.value.nativeRef), N.callUIFunction(t, "requestFocus", [o]);
657
+ },
658
+ updatePageSpec: (o) => {
659
+ if (!r)
660
+ return;
661
+ const t = Object.assign({}, JSON.parse(u.value).page_spec, o);
662
+ o.layout && (t.navConfig = Object.assign({}, t.navConfig, o.layout)), o.navConfig && (t.navConfig = Object.assign({}, t.navConfig, o.navConfig)), o.contentConfig && (t.contentConfig = Object.assign({}, t.contentConfig, o.contentConfig)), s && Object.assign(s, t), C({
663
+ op: "RELOAD_TABS",
664
+ payload: {
665
+ pageSpec: t,
666
+ page_spec: t,
667
+ tabs: f.value
668
+ }
669
+ });
670
+ const n = JSON.parse(u.value);
671
+ n.page_spec = t, u.value = JSON.stringify(n), c = u.value;
672
+ },
673
+ reloadAll: (o, t) => {
674
+ s && (Object.keys(s).forEach((n) => delete s[n]), Object.assign(s, o)), f.value = t, C({
675
+ op: "RELOAD_TABS",
676
+ payload: {
677
+ pageSpec: o,
678
+ page_spec: o,
679
+ tabs: t
680
+ }
681
+ });
682
+ },
683
+ scrollToTop: () => {
684
+ let o = e.value;
685
+ typeof e.value.getNativeNode == "function" ? o = e.value.getNativeNode() || e.value : e.value.nativeRef && (o = e.value.nativeRef), N.callUIFunction(o, "scrollToTop", []);
601
686
  }
602
687
  };
603
688
  }
604
- const re = "QtKeyboard", ie = /* @__PURE__ */ L({
689
+ const ye = "QtKeyboard", he = /* @__PURE__ */ w({
605
690
  __name: "Keyboard",
606
691
  props: {
607
692
  backgroundColor: {},
@@ -621,218 +706,989 @@ const re = "QtKeyboard", ie = /* @__PURE__ */ L({
621
706
  rememberKeyboardType: { type: Boolean }
622
707
  },
623
708
  emits: ["onInputChanged", "onKeyPressed"],
624
- setup(o, { expose: s }) {
625
- const v = G(), p = Z(), f = re + "_Plugin", r = (p.isPluginActive ? f : re).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), y = z(
626
- r,
627
- p.pluginPackageName || "com.quicktvui.plugin.extraui",
709
+ setup(e, { expose: i }) {
710
+ const u = A(), s = _(), f = ye + "_Plugin", l = (s.isPluginActive ? f : ye).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
711
+ l,
712
+ s.pluginPackageName || "com.quicktvui.plugin.extraui",
628
713
  "com.quicktvui.plugin.extraui.ExtraUIPluginApp"
629
714
  );
630
- return s({
715
+ return i({
631
716
  getNativeNode: () => {
632
- var i, d;
633
- return ((d = (i = v.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : d.call(i)) || v.value;
717
+ var a, c;
718
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
634
719
  },
635
- requestFocus: (...i) => {
636
- var g, T;
637
- const d = ((T = (g = v.value) == null ? void 0 : g.getNativeNode) == null ? void 0 : T.call(g)) || v.value;
638
- d && x.callUIFunction(d, "requestFocus", i);
720
+ requestFocus: (...a) => {
721
+ var d, h;
722
+ const c = ((h = (d = u.value) == null ? void 0 : d.getNativeNode) == null ? void 0 : h.call(d)) || u.value;
723
+ c && N.callUIFunction(c, "requestFocus", a);
639
724
  }
640
- }), (i, d) => (B(), Q(K(y), j({
725
+ }), (a, c) => (S(), $(D(r), B({
641
726
  ref_key: "nativeRef",
642
- ref: v,
643
- backgroundColor: o.backgroundColor,
644
- backgroundGradient: o.backgroundGradient,
645
- textColor: o.textColor,
646
- weakTextColor: o.weakTextColor,
647
- focusBackgroundColor: o.focusBackgroundColor,
648
- focusTextColor: o.focusTextColor,
649
- placeholder: o.placeholder,
650
- textFullKeyboard: o.textFullKeyboard,
651
- textT9Keyboard: o.textT9Keyboard,
652
- keyboardType: o.keyboardType,
653
- textClear: o.textClear,
654
- textDelete: o.textDelete,
655
- currentInput: o.currentInput,
656
- autofocus: o.autofocus,
657
- rememberKeyboardType: o.rememberKeyboardType,
658
- onOnInputChanged: d[0] || (d[0] = (g) => i.$emit("onInputChanged", g.nativeEvent)),
659
- onOnKeyPressed: d[1] || (d[1] = (g) => i.$emit("onKeyPressed", g.nativeEvent))
660
- }, i.$attrs), {
661
- default: V(() => [
662
- W(i.$slots, "default")
727
+ ref: u,
728
+ backgroundColor: e.backgroundColor,
729
+ backgroundGradient: e.backgroundGradient,
730
+ textColor: e.textColor,
731
+ weakTextColor: e.weakTextColor,
732
+ focusBackgroundColor: e.focusBackgroundColor,
733
+ focusTextColor: e.focusTextColor,
734
+ placeholder: e.placeholder,
735
+ textFullKeyboard: e.textFullKeyboard,
736
+ textT9Keyboard: e.textT9Keyboard,
737
+ keyboardType: e.keyboardType,
738
+ textClear: e.textClear,
739
+ textDelete: e.textDelete,
740
+ currentInput: e.currentInput,
741
+ autofocus: e.autofocus,
742
+ rememberKeyboardType: e.rememberKeyboardType,
743
+ onOnInputChanged: c[0] || (c[0] = (d) => a.$emit("onInputChanged", d.nativeEvent)),
744
+ onOnKeyPressed: c[1] || (c[1] = (d) => a.$emit("onKeyPressed", d.nativeEvent))
745
+ }, a.$attrs), {
746
+ default: R(() => [
747
+ F(a.$slots, "default")
663
748
  ]),
664
749
  _: 3
665
750
  }, 16, ["backgroundColor", "backgroundGradient", "textColor", "weakTextColor", "focusBackgroundColor", "focusTextColor", "placeholder", "textFullKeyboard", "textT9Keyboard", "keyboardType", "textClear", "textDelete", "currentInput", "autofocus", "rememberKeyboardType"]));
666
751
  }
667
752
  });
668
- let X;
669
- var pe;
753
+ let oe;
754
+ var ze;
670
755
  try {
671
- const o = require("@extscreen/es3-vue");
672
- X = o.registerElement || ((pe = o.default) == null ? void 0 : pe.registerElement);
756
+ const e = require("@extscreen/es3-vue");
757
+ oe = e.registerElement || ((ze = e.default) == null ? void 0 : ze.registerElement);
673
758
  } catch {
674
759
  }
675
- const xe = {
676
- install: (o) => {
760
+ const lt = {
761
+ install: (e) => {
677
762
  if (!globalThis.__QtKeyboard_registered)
678
- if (X) {
679
- const s = (v, p) => {
680
- X(v, {
763
+ if (oe) {
764
+ const i = (u, s) => {
765
+ oe(u, {
681
766
  component: {
682
- name: p ? "QtKeyboard_Plugin" : "QtKeyboard",
683
- processEventData(f, b) {
684
- const r = f.handler || f, y = b || (r == null ? void 0 : r.nativeParams) || {};
685
- return r && (r.nativeEvent = y), r;
767
+ name: s ? "QtKeyboard_Plugin" : "QtKeyboard",
768
+ processEventData(f, v) {
769
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
770
+ return l && (l.nativeEvent = r), l;
686
771
  }
687
772
  }
688
773
  });
689
774
  };
690
- 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");
775
+ i("qt-keyboard", !1), i("qt-keyboard-plugin", !0), i("QtKeyboard", !1), i("QtKeyboard_Plugin", !0), globalThis.__QtKeyboard_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtKeyboard");
691
776
  } else
692
777
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
693
- o.component("Keyboard", ie), o.component("qt-keyboard", ie);
778
+ e.component("Keyboard", he), e.component("qt-keyboard", he);
694
779
  }
695
- }, le = "QtPortalPool", ce = /* @__PURE__ */ L({
780
+ }, pe = "QtPortalPool", Ce = /* @__PURE__ */ w({
696
781
  __name: "PortalPool",
697
- setup(o, { expose: s }) {
698
- const v = G(), p = Z(), f = le + "_Plugin", r = (p.isPluginActive ? f : le).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), y = z(
699
- r,
700
- p.pluginPackageName || "com.quicktvui.plugin.glintui"
782
+ setup(e, { expose: i }) {
783
+ const u = A(), s = _(), f = pe + "_Plugin", l = (s.isPluginActive ? f : pe).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
784
+ l,
785
+ s.pluginPackageName || "com.quicktvui.plugin.glintui"
701
786
  );
702
- return s({
787
+ return i({
703
788
  getNativeNode: () => {
704
- var i, d;
705
- return ((d = (i = v.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : d.call(i)) || v.value;
789
+ var a, c;
790
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
706
791
  }
707
- }), (i, d) => (B(), Q(K(y), j({
792
+ }), (a, c) => (S(), $(D(r), B({
708
793
  ref_key: "nativeRef",
709
- ref: v
710
- }, i.$attrs), {
711
- default: V(() => [
712
- W(i.$slots, "default")
794
+ ref: u,
795
+ style: { position: "absolute" },
796
+ absolute: !0
797
+ }, a.$attrs), {
798
+ default: R(() => [
799
+ F(a.$slots, "default")
713
800
  ]),
714
801
  _: 3
715
802
  }, 16));
716
803
  }
717
804
  });
718
- let ee;
719
- var be;
805
+ let ne;
806
+ var Me;
720
807
  try {
721
- const o = require("@extscreen/es3-vue");
722
- ee = o.registerElement || ((be = o.default) == null ? void 0 : be.registerElement);
808
+ const e = require("@extscreen/es3-vue");
809
+ ne = e.registerElement || ((Me = e.default) == null ? void 0 : Me.registerElement);
723
810
  } catch {
724
811
  }
725
- const Se = {
726
- install: (o) => {
812
+ const rt = {
813
+ install: (e) => {
727
814
  if (!globalThis.__QtPortalPool_registered)
728
- if (ee) {
729
- const s = (v, p) => {
730
- ee(v, {
815
+ if (ne) {
816
+ const i = (u, s) => {
817
+ ne(u, {
731
818
  component: {
732
- name: p ? "QtPortalPool_Plugin" : "QtPortalPool",
733
- processEventData(f, b) {
734
- const r = f.handler || f, y = b || (r == null ? void 0 : r.nativeParams) || {};
735
- return r && (r.nativeEvent = y), r;
819
+ name: s ? "QtPortalPool_Plugin" : "QtPortalPool",
820
+ processEventData(f, v) {
821
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
822
+ return l && (l.nativeEvent = r), l;
736
823
  }
737
824
  }
738
825
  });
739
826
  };
740
- 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");
827
+ i("qt-portal-pool", !1), i("qt-portal-pool-plugin", !0), i("QtPortalPool", !1), i("QtPortalPool_Plugin", !0), globalThis.__QtPortalPool_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtPortalPool");
741
828
  } else
742
829
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
743
- o.component("PortalPool", ce), o.component("qt-portal-pool", ce);
830
+ e.component("PortalPool", Ce), e.component("qt-portal-pool", Ce);
744
831
  }
745
- }, ue = "QtPortalItem", de = /* @__PURE__ */ L({
832
+ }, ke = "QtPortalItem", Ie = /* @__PURE__ */ w({
746
833
  __name: "PortalItem",
747
834
  props: {
748
835
  portalId: {}
749
836
  },
750
- setup(o, { expose: s }) {
751
- const v = G(), p = Z(), f = ue + "_Plugin", r = (p.isPluginActive ? f : ue).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), y = z(
752
- r,
753
- p.pluginPackageName || "com.quicktvui.plugin.glintui"
837
+ setup(e, { expose: i }) {
838
+ const u = A(), s = _(), f = ke + "_Plugin", l = (s.isPluginActive ? f : ke).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
839
+ l,
840
+ s.pluginPackageName || "com.quicktvui.plugin.glintui"
754
841
  );
755
- return s({
842
+ return i({
756
843
  getNativeNode: () => {
757
- var i, d;
758
- return ((d = (i = v.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : d.call(i)) || v.value;
844
+ var a, c;
845
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
759
846
  }
760
- }), (i, d) => (B(), Q(K(y), j({
847
+ }), (a, c) => (S(), $(D(r), B({
761
848
  ref_key: "nativeRef",
762
- ref: v,
763
- portalId: o.portalId
764
- }, i.$attrs), {
765
- default: V(() => [
766
- W(i.$slots, "default")
849
+ ref: u,
850
+ style: { position: "absolute" },
851
+ absolute: !0,
852
+ portalId: e.portalId
853
+ }, a.$attrs), {
854
+ default: R(() => [
855
+ F(a.$slots, "default")
767
856
  ]),
768
857
  _: 3
769
858
  }, 16, ["portalId"]));
770
859
  }
771
860
  });
772
- let te;
773
- var ye;
861
+ let ae;
862
+ var De;
774
863
  try {
775
- const o = require("@extscreen/es3-vue");
776
- te = o.registerElement || ((ye = o.default) == null ? void 0 : ye.registerElement);
864
+ const e = require("@extscreen/es3-vue");
865
+ ae = e.registerElement || ((De = e.default) == null ? void 0 : De.registerElement);
777
866
  } catch {
778
867
  }
779
- const Ge = {
780
- install: (o) => {
868
+ const st = {
869
+ install: (e) => {
781
870
  if (!globalThis.__QtPortalItem_registered)
782
- if (te) {
783
- const s = (v, p) => {
784
- te(v, {
871
+ if (ae) {
872
+ const i = (u, s) => {
873
+ ae(u, {
785
874
  component: {
786
- name: p ? "QtPortalItem_Plugin" : "QtPortalItem",
787
- processEventData(f, b) {
788
- const r = f.handler || f, y = b || (r == null ? void 0 : r.nativeParams) || {};
789
- return r && (r.nativeEvent = y), r;
875
+ name: s ? "QtPortalItem_Plugin" : "QtPortalItem",
876
+ processEventData(f, v) {
877
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
878
+ return l && (l.nativeEvent = r), l;
790
879
  }
791
880
  }
792
881
  });
793
882
  };
794
- 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");
883
+ i("qt-portal-item", !1), i("qt-portal-item-plugin", !0), i("QtPortalItem", !1), i("QtPortalItem_Plugin", !0), globalThis.__QtPortalItem_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtPortalItem");
795
884
  } else
796
885
  console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
797
- o.component("PortalItem", de), o.component("qt-portal-item", de);
886
+ e.component("PortalItem", Ie), e.component("qt-portal-item", Ie);
798
887
  }
799
- }, ve = "QtHsvBackground", fe = /* @__PURE__ */ L({
888
+ }, Ne = "QtHsvBackground", Te = /* @__PURE__ */ w({
800
889
  __name: "HsvBackground",
801
890
  props: {
802
- hue: { default: -2 }
891
+ hue: {},
892
+ hueDuration: {}
893
+ },
894
+ setup(e, { expose: i }) {
895
+ const u = A(), s = _(), f = Ne + "_Plugin", l = (s.isPluginActive ? f : Ne).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
896
+ l,
897
+ s.pluginPackageName || "com.quicktvui.plugin.glintui"
898
+ );
899
+ return i({
900
+ getNativeNode: () => {
901
+ var a, c;
902
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
903
+ }
904
+ }), (a, c) => (S(), $(D(r), B({
905
+ ref_key: "nativeRef",
906
+ ref: u,
907
+ hue: e.hue,
908
+ hueDuration: e.hueDuration
909
+ }, a.$attrs), {
910
+ default: R(() => [
911
+ F(a.$slots, "default")
912
+ ]),
913
+ _: 3
914
+ }, 16, ["hue", "hueDuration"]));
915
+ }
916
+ });
917
+ let ie;
918
+ var Le;
919
+ try {
920
+ const e = require("@extscreen/es3-vue");
921
+ ie = e.registerElement || ((Le = e.default) == null ? void 0 : Le.registerElement);
922
+ } catch {
923
+ }
924
+ const ct = {
925
+ install: (e) => {
926
+ if (!globalThis.__QtHsvBackground_registered)
927
+ if (ie) {
928
+ const i = (u, s) => {
929
+ ie(u, {
930
+ component: {
931
+ name: s ? "QtHsvBackground_Plugin" : "QtHsvBackground",
932
+ processEventData(f, v) {
933
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
934
+ return l && (l.nativeEvent = r), l;
935
+ }
936
+ }
937
+ });
938
+ };
939
+ i("qt-hsv-background", !1), i("qt-hsv-background-plugin", !0), i("QtHsvBackground", !1), i("QtHsvBackground_Plugin", !0), globalThis.__QtHsvBackground_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtHsvBackground");
940
+ } else
941
+ console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
942
+ e.component("HsvBackground", Te), e.component("qt-hsv-background", Te);
943
+ }
944
+ }, Se = "QtSvgImage", Pe = /* @__PURE__ */ w({
945
+ __name: "SvgImage",
946
+ props: {
947
+ src: {},
948
+ tintColor: {}
949
+ },
950
+ setup(e, { expose: i }) {
951
+ const u = A(), s = _(), f = Se + "_Plugin", l = (s.isPluginActive ? f : Se).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
952
+ l,
953
+ s.pluginPackageName || "com.quicktvui.plugin.extraui",
954
+ "com.quicktvui.plugin.extraui.ExtraUIPluginApp"
955
+ );
956
+ return i({
957
+ getNativeNode: () => {
958
+ var a, c;
959
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
960
+ }
961
+ }), (a, c) => (S(), $(D(r), B({
962
+ ref_key: "nativeRef",
963
+ ref: u,
964
+ src: e.src,
965
+ tintColor: e.tintColor
966
+ }, a.$attrs), {
967
+ default: R(() => [
968
+ F(a.$slots, "default")
969
+ ]),
970
+ _: 3
971
+ }, 16, ["src", "tintColor"]));
972
+ }
973
+ });
974
+ let le;
975
+ var _e;
976
+ try {
977
+ const e = require("@extscreen/es3-vue");
978
+ le = e.registerElement || ((_e = e.default) == null ? void 0 : _e.registerElement);
979
+ } catch {
980
+ }
981
+ const ut = {
982
+ install: (e) => {
983
+ if (!globalThis.__QtSvgImage_registered)
984
+ if (le) {
985
+ const i = (u, s) => {
986
+ le(u, {
987
+ component: {
988
+ name: s ? "QtSvgImage_Plugin" : "QtSvgImage",
989
+ processEventData(f, v) {
990
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
991
+ return l && (l.nativeEvent = r), l;
992
+ }
993
+ }
994
+ });
995
+ };
996
+ i("qt-svg-image", !1), i("qt-svg-image-plugin", !0), i("QtSvgImage", !1), i("QtSvgImage_Plugin", !0), globalThis.__QtSvgImage_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtSvgImage");
997
+ } else
998
+ console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
999
+ e.component("SvgImage", Pe), e.component("qt-svg-image", Pe);
1000
+ }
1001
+ }, Ee = "QtNaButton", dt = /* @__PURE__ */ w({
1002
+ __name: "NaButtonBase",
1003
+ props: {
1004
+ text: {},
1005
+ icon: {},
1006
+ iconSize: {},
1007
+ iconSpace: {},
1008
+ layoutDirection: {},
1009
+ fontSize: {},
1010
+ maxLines: {},
1011
+ textColor: {},
1012
+ focusTextColor: {},
1013
+ backgroundColor: {},
1014
+ focusBackgroundColor: {},
1015
+ normalBorderWidth: {},
1016
+ normalBorderColor: {},
1017
+ focusBorderColor: {},
1018
+ cornerRadius: {},
1019
+ focusScale: {},
1020
+ enableFocusBorder: { type: Boolean }
1021
+ },
1022
+ emits: ["onButtonCustomEvent"],
1023
+ setup(e, { expose: i }) {
1024
+ const u = A(), s = _(), f = Ee + "_Plugin", l = (s.isPluginActive ? f : Ee).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
1025
+ l,
1026
+ s.pluginPackageName || "com.quicktvui.plugin.extraui",
1027
+ "com.quicktvui.plugin.extraui.ExtraUIPluginApp"
1028
+ );
1029
+ return i({
1030
+ getNativeNode: () => {
1031
+ var a, c;
1032
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
1033
+ }
1034
+ }), (a, c) => (S(), $(D(r), B({
1035
+ ref_key: "nativeRef",
1036
+ ref: u,
1037
+ text: e.text,
1038
+ icon: e.icon,
1039
+ iconSize: e.iconSize,
1040
+ iconSpace: e.iconSpace,
1041
+ layoutDirection: e.layoutDirection,
1042
+ fontSize: e.fontSize,
1043
+ maxLines: e.maxLines,
1044
+ textColor: e.textColor,
1045
+ focusTextColor: e.focusTextColor,
1046
+ backgroundColor: e.backgroundColor,
1047
+ focusBackgroundColor: e.focusBackgroundColor,
1048
+ normalBorderWidth: e.normalBorderWidth,
1049
+ normalBorderColor: e.normalBorderColor,
1050
+ focusBorderColor: e.focusBorderColor,
1051
+ cornerRadius: e.cornerRadius,
1052
+ focusScale: e.focusScale,
1053
+ enableFocusBorder: e.enableFocusBorder,
1054
+ onOnButtonCustomEvent: c[0] || (c[0] = (d) => a.$emit("onButtonCustomEvent", d.nativeEvent))
1055
+ }, a.$attrs), {
1056
+ default: R(() => [
1057
+ F(a.$slots, "default")
1058
+ ]),
1059
+ _: 3
1060
+ }, 16, ["text", "icon", "iconSize", "iconSpace", "layoutDirection", "fontSize", "maxLines", "textColor", "focusTextColor", "backgroundColor", "focusBackgroundColor", "normalBorderWidth", "normalBorderColor", "focusBorderColor", "cornerRadius", "focusScale", "enableFocusBorder"]));
1061
+ }
1062
+ }), xe = /* @__PURE__ */ w({
1063
+ __name: "NaButton",
1064
+ props: {
1065
+ width: {},
1066
+ height: {}
1067
+ },
1068
+ setup(e) {
1069
+ const i = e, u = W(() => ({
1070
+ width: typeof i.width == "number" ? `${i.width}px` : i.width,
1071
+ height: typeof i.height == "number" ? `${i.height}px` : i.height
1072
+ }));
1073
+ return (s, f) => (S(), $(dt, B(s.$attrs, { style: u.value }), {
1074
+ default: R(() => [
1075
+ F(s.$slots, "default")
1076
+ ]),
1077
+ _: 3
1078
+ }, 16, ["style"]));
1079
+ }
1080
+ });
1081
+ let re;
1082
+ var Ue;
1083
+ try {
1084
+ const e = require("@extscreen/es3-vue");
1085
+ re = e.registerElement || ((Ue = e.default) == null ? void 0 : Ue.registerElement);
1086
+ } catch {
1087
+ }
1088
+ const gt = {
1089
+ install: (e) => {
1090
+ if (!globalThis.__QtNaButton_registered)
1091
+ if (re) {
1092
+ const i = (u, s) => {
1093
+ re(u, {
1094
+ component: {
1095
+ name: s ? "QtNaButton_Plugin" : "QtNaButton",
1096
+ processEventData(f, v) {
1097
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
1098
+ return l && (l.nativeEvent = r), l;
1099
+ }
1100
+ }
1101
+ });
1102
+ };
1103
+ i("qt-na-button", !1), i("qt-na-button-plugin", !0), i("QtNaButton", !1), i("QtNaButton_Plugin", !0), globalThis.__QtNaButton_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtNaButton");
1104
+ } else
1105
+ console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
1106
+ e.component("NaButton", xe), e.component("qt-na-button", xe);
1107
+ }
1108
+ }, Ae = "QtNaCheckbox", we = /* @__PURE__ */ w({
1109
+ __name: "NaCheckbox",
1110
+ props: {
1111
+ text: {},
1112
+ checked: { type: Boolean },
1113
+ disabled: { type: Boolean },
1114
+ checkedIcon: {},
1115
+ uncheckedIcon: {},
1116
+ iconSize: {},
1117
+ iconSpace: {},
1118
+ layoutDirection: {},
1119
+ gravity: {},
1120
+ paddingX: {},
1121
+ showBackground: { type: Boolean },
1122
+ fontSize: {},
1123
+ textColor: {},
1124
+ focusTextColor: {},
1125
+ checkedTextColor: {},
1126
+ focusCheckedTextColor: {},
1127
+ disabledTextColor: {},
1128
+ iconColor: {},
1129
+ focusIconColor: {},
1130
+ checkedIconColor: {},
1131
+ focusCheckedIconColor: {},
1132
+ disabledIconColor: {},
1133
+ iconInnerColor: {},
1134
+ focusIconInnerColor: {},
1135
+ checkedIconInnerColor: {},
1136
+ focusCheckedIconInnerColor: {},
1137
+ disabledIconInnerColor: {},
1138
+ focusMode: {},
1139
+ bgColor: {},
1140
+ focusBgColor: {},
1141
+ checkedBgColor: {},
1142
+ focusCheckedBgColor: {},
1143
+ disabledBgColor: {},
1144
+ borderColor: {},
1145
+ focusBorderColor: {},
1146
+ checkedBorderColor: {},
1147
+ focusCheckedBorderColor: {},
1148
+ disabledBorderColor: {},
1149
+ cornerRadius: {},
1150
+ focusScale: {},
1151
+ type: {}
1152
+ },
1153
+ emits: ["onCheckedChange"],
1154
+ setup(e, { expose: i }) {
1155
+ const u = A(), s = _(), f = Ae + "_Plugin", l = (s.isPluginActive ? f : Ae).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
1156
+ l,
1157
+ s.pluginPackageName || ""
1158
+ );
1159
+ return i({
1160
+ getNativeNode: () => {
1161
+ var a, c;
1162
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
1163
+ }
1164
+ }), (a, c) => (S(), $(D(r), B({
1165
+ ref_key: "nativeRef",
1166
+ ref: u,
1167
+ text: e.text,
1168
+ checked: e.checked,
1169
+ disabled: e.disabled,
1170
+ checkedIcon: e.checkedIcon,
1171
+ uncheckedIcon: e.uncheckedIcon,
1172
+ iconSize: e.iconSize,
1173
+ iconSpace: e.iconSpace,
1174
+ layoutDirection: e.layoutDirection,
1175
+ gravity: e.gravity,
1176
+ paddingX: e.paddingX,
1177
+ showBackground: e.showBackground,
1178
+ fontSize: e.fontSize,
1179
+ textColor: e.textColor,
1180
+ focusTextColor: e.focusTextColor,
1181
+ checkedTextColor: e.checkedTextColor,
1182
+ focusCheckedTextColor: e.focusCheckedTextColor,
1183
+ disabledTextColor: e.disabledTextColor,
1184
+ iconColor: e.iconColor,
1185
+ focusIconColor: e.focusIconColor,
1186
+ checkedIconColor: e.checkedIconColor,
1187
+ focusCheckedIconColor: e.focusCheckedIconColor,
1188
+ disabledIconColor: e.disabledIconColor,
1189
+ iconInnerColor: e.iconInnerColor,
1190
+ focusIconInnerColor: e.focusIconInnerColor,
1191
+ checkedIconInnerColor: e.checkedIconInnerColor,
1192
+ focusCheckedIconInnerColor: e.focusCheckedIconInnerColor,
1193
+ disabledIconInnerColor: e.disabledIconInnerColor,
1194
+ focusMode: e.focusMode,
1195
+ bgColor: e.bgColor,
1196
+ focusBgColor: e.focusBgColor,
1197
+ checkedBgColor: e.checkedBgColor,
1198
+ focusCheckedBgColor: e.focusCheckedBgColor,
1199
+ disabledBgColor: e.disabledBgColor,
1200
+ borderColor: e.borderColor,
1201
+ focusBorderColor: e.focusBorderColor,
1202
+ checkedBorderColor: e.checkedBorderColor,
1203
+ focusCheckedBorderColor: e.focusCheckedBorderColor,
1204
+ disabledBorderColor: e.disabledBorderColor,
1205
+ cornerRadius: e.cornerRadius,
1206
+ focusScale: e.focusScale,
1207
+ type: e.type,
1208
+ onOnCheckedChange: c[0] || (c[0] = (d) => a.$emit("onCheckedChange", d.nativeEvent))
1209
+ }, a.$attrs), {
1210
+ default: R(() => [
1211
+ F(a.$slots, "default")
1212
+ ]),
1213
+ _: 3
1214
+ }, 16, ["text", "checked", "disabled", "checkedIcon", "uncheckedIcon", "iconSize", "iconSpace", "layoutDirection", "gravity", "paddingX", "showBackground", "fontSize", "textColor", "focusTextColor", "checkedTextColor", "focusCheckedTextColor", "disabledTextColor", "iconColor", "focusIconColor", "checkedIconColor", "focusCheckedIconColor", "disabledIconColor", "iconInnerColor", "focusIconInnerColor", "checkedIconInnerColor", "focusCheckedIconInnerColor", "disabledIconInnerColor", "focusMode", "bgColor", "focusBgColor", "checkedBgColor", "focusCheckedBgColor", "disabledBgColor", "borderColor", "focusBorderColor", "checkedBorderColor", "focusCheckedBorderColor", "disabledBorderColor", "cornerRadius", "focusScale", "type"]));
1215
+ }
1216
+ });
1217
+ let se;
1218
+ var Ve;
1219
+ try {
1220
+ const e = require("@extscreen/es3-vue");
1221
+ se = e.registerElement || ((Ve = e.default) == null ? void 0 : Ve.registerElement);
1222
+ } catch {
1223
+ }
1224
+ const ft = {
1225
+ install: (e) => {
1226
+ if (!globalThis.__QtNaCheckbox_registered)
1227
+ if (se) {
1228
+ const i = (u, s) => {
1229
+ se(u, {
1230
+ component: {
1231
+ name: s ? "QtNaCheckbox_Plugin" : "QtNaCheckbox",
1232
+ processEventData(f, v) {
1233
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
1234
+ return l && (l.nativeEvent = r), l;
1235
+ }
1236
+ }
1237
+ });
1238
+ };
1239
+ i("qt-na-checkbox", !1), i("qt-na-checkbox-plugin", !0), i("QtNaCheckbox", !1), i("QtNaCheckbox_Plugin", !0), globalThis.__QtNaCheckbox_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtNaCheckbox");
1240
+ } else
1241
+ console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
1242
+ e.component("NaCheckbox", we), e.component("qt-na-checkbox", we);
1243
+ }
1244
+ }, vt = w({
1245
+ name: "NaRadioGroup",
1246
+ props: {
1247
+ modelValue: {
1248
+ type: [String, Number, Boolean],
1249
+ default: ""
1250
+ },
1251
+ options: {
1252
+ type: Array,
1253
+ default: () => []
1254
+ },
1255
+ direction: {
1256
+ type: String,
1257
+ default: "row"
1258
+ },
1259
+ itemWidth: {
1260
+ type: Number,
1261
+ default: void 0
1262
+ },
1263
+ itemHeight: {
1264
+ type: Number,
1265
+ default: void 0
1266
+ },
1267
+ itemGap: {
1268
+ type: Number,
1269
+ default: 20
1270
+ },
1271
+ gravity: {
1272
+ type: String,
1273
+ default: "center"
1274
+ },
1275
+ showBackground: {
1276
+ type: Boolean,
1277
+ default: !0
1278
+ }
803
1279
  },
804
- setup(o, { expose: s }) {
805
- const v = G(), p = Z(), f = ve + "_Plugin", r = (p.isPluginActive ? f : ve).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), y = z(
806
- r,
807
- p.pluginPackageName || "com.quicktvui.plugin.glintui"
1280
+ emits: ["update:modelValue", "change"],
1281
+ setup(e, { emit: i }) {
1282
+ return {
1283
+ groupStyle: W(() => ({
1284
+ display: "flex",
1285
+ flexDirection: e.direction,
1286
+ alignItems: "center"
1287
+ })),
1288
+ getItemStyle: (v, l) => {
1289
+ var a;
1290
+ const r = { ...((a = v.props) == null ? void 0 : a.style) || {} };
1291
+ return e.itemWidth !== void 0 && (r.width = e.itemWidth), e.itemHeight !== void 0 && (r.height = e.itemHeight), l !== e.options.length - 1 && (e.direction === "row" ? r.marginRight = e.itemGap : r.marginBottom = e.itemGap), r;
1292
+ },
1293
+ onItemClick: (v) => {
1294
+ v.disabled || (i("update:modelValue", v.value), i("change", v.value));
1295
+ }
1296
+ };
1297
+ }
1298
+ });
1299
+ const ve = (e, i) => {
1300
+ const u = e.__vccOpts || e;
1301
+ for (const [s, f] of i)
1302
+ u[s] = f;
1303
+ return u;
1304
+ };
1305
+ function mt(e, i, u, s, f, v) {
1306
+ const l = ge("qt-na-checkbox");
1307
+ return S(), J("div", {
1308
+ class: "na-radio-group",
1309
+ style: fe(e.groupStyle)
1310
+ }, [
1311
+ (S(!0), J(Ke, null, He(e.options, (r, a) => (S(), $(l, B({
1312
+ key: a,
1313
+ type: "radio",
1314
+ checked: e.modelValue === r.value,
1315
+ text: r.label,
1316
+ gravity: e.gravity,
1317
+ showBackground: e.showBackground,
1318
+ disabled: r.disabled
1319
+ }, { ref_for: !0 }, r.props, {
1320
+ style: e.getItemStyle(r, a),
1321
+ onClick: (c) => e.onItemClick(r)
1322
+ }), null, 16, ["checked", "text", "gravity", "showBackground", "disabled", "style", "onClick"]))), 128))
1323
+ ], 4);
1324
+ }
1325
+ const $e = /* @__PURE__ */ ve(vt, [["render", mt], ["__scopeId", "data-v-448252ff"]]), bt = {
1326
+ install: (e) => {
1327
+ e.component("NaRadioGroup", $e), e.component("qt-na-radio-group", $e);
1328
+ }
1329
+ }, yt = w({
1330
+ name: "NaCheckboxGroup",
1331
+ props: {
1332
+ modelValue: {
1333
+ type: Array,
1334
+ default: () => []
1335
+ },
1336
+ options: {
1337
+ type: Array,
1338
+ default: () => []
1339
+ },
1340
+ direction: {
1341
+ type: String,
1342
+ default: "row"
1343
+ },
1344
+ itemWidth: {
1345
+ type: Number,
1346
+ default: void 0
1347
+ },
1348
+ itemHeight: {
1349
+ type: Number,
1350
+ default: void 0
1351
+ },
1352
+ itemGap: {
1353
+ type: Number,
1354
+ default: 20
1355
+ },
1356
+ gravity: {
1357
+ type: String,
1358
+ default: "center"
1359
+ },
1360
+ showBackground: {
1361
+ type: Boolean,
1362
+ default: !0
1363
+ }
1364
+ },
1365
+ emits: ["update:modelValue", "change"],
1366
+ setup(e, { emit: i }) {
1367
+ return {
1368
+ groupStyle: W(() => ({
1369
+ display: "flex",
1370
+ flexDirection: e.direction,
1371
+ alignItems: "center"
1372
+ })),
1373
+ getItemStyle: (v, l) => {
1374
+ var a;
1375
+ const r = { ...((a = v.props) == null ? void 0 : a.style) || {} };
1376
+ return e.itemWidth !== void 0 && (r.width = e.itemWidth), e.itemHeight !== void 0 && (r.height = e.itemHeight), l !== e.options.length - 1 && (e.direction === "row" ? r.marginRight = e.itemGap : r.marginBottom = e.itemGap), r;
1377
+ },
1378
+ onItemClick: (v) => {
1379
+ if (v.disabled)
1380
+ return;
1381
+ const l = [...e.modelValue], r = l.indexOf(v.value);
1382
+ r > -1 ? l.splice(r, 1) : l.push(v.value), i("update:modelValue", l), i("change", l);
1383
+ }
1384
+ };
1385
+ }
1386
+ });
1387
+ function ht(e, i, u, s, f, v) {
1388
+ const l = ge("qt-na-checkbox");
1389
+ return S(), J("div", {
1390
+ class: "na-checkbox-group",
1391
+ style: fe(e.groupStyle)
1392
+ }, [
1393
+ (S(!0), J(Ke, null, He(e.options, (r, a) => (S(), $(l, B({
1394
+ key: a,
1395
+ type: "checkbox",
1396
+ checked: e.modelValue.includes(r.value),
1397
+ text: r.label,
1398
+ gravity: e.gravity,
1399
+ showBackground: e.showBackground,
1400
+ disabled: r.disabled
1401
+ }, { ref_for: !0 }, r.props, {
1402
+ style: e.getItemStyle(r, a),
1403
+ onClick: (c) => e.onItemClick(r)
1404
+ }), null, 16, ["checked", "text", "gravity", "showBackground", "disabled", "style", "onClick"]))), 128))
1405
+ ], 4);
1406
+ }
1407
+ const Be = /* @__PURE__ */ ve(yt, [["render", ht], ["__scopeId", "data-v-cf6a4eaa"]]), pt = {
1408
+ install: (e) => {
1409
+ e.component("NaCheckboxGroup", Be), e.component("qt-na-checkbox-group", Be);
1410
+ }
1411
+ }, Ge = "QtNaSwitcher", Oe = /* @__PURE__ */ w({
1412
+ __name: "NaSwitcher",
1413
+ props: {
1414
+ checked: { type: Boolean },
1415
+ disabled: { type: Boolean },
1416
+ title: {},
1417
+ textOn: {},
1418
+ textOff: {},
1419
+ subtitle: {},
1420
+ subtitleColor: {},
1421
+ titleColor: {},
1422
+ focusTitleColor: {},
1423
+ titleTextSize: {},
1424
+ subtitleTextSize: {},
1425
+ stateTextSize: {}
1426
+ },
1427
+ emits: ["onCheckedChange"],
1428
+ setup(e, { expose: i }) {
1429
+ const u = A(), s = _(), f = Ge + "_Plugin", l = (s.isPluginActive ? f : Ge).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
1430
+ l,
1431
+ s.pluginPackageName || ""
808
1432
  );
809
- return s({
1433
+ return i({
810
1434
  getNativeNode: () => {
811
- var i, d;
812
- return ((d = (i = v.value) == null ? void 0 : i.getNativeNode) == null ? void 0 : d.call(i)) || v.value;
1435
+ var a, c;
1436
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
813
1437
  }
814
- }), (i, d) => (B(), Q(K(y), j({
1438
+ }), (a, c) => (S(), $(D(r), B({
815
1439
  ref_key: "nativeRef",
816
- ref: v,
817
- hue: o.hue
818
- }, i.$attrs), {
819
- default: V(() => [
820
- W(i.$slots, "default")
1440
+ ref: u,
1441
+ checked: e.checked,
1442
+ disabled: e.disabled,
1443
+ title: e.title,
1444
+ textOn: e.textOn,
1445
+ textOff: e.textOff,
1446
+ subtitle: e.subtitle,
1447
+ subtitleColor: e.subtitleColor,
1448
+ titleColor: e.titleColor,
1449
+ focusTitleColor: e.focusTitleColor,
1450
+ titleTextSize: e.titleTextSize,
1451
+ subtitleTextSize: e.subtitleTextSize,
1452
+ stateTextSize: e.stateTextSize,
1453
+ onOnCheckedChange: c[0] || (c[0] = (d) => a.$emit("onCheckedChange", d.nativeEvent))
1454
+ }, a.$attrs), {
1455
+ default: R(() => [
1456
+ F(a.$slots, "default")
821
1457
  ]),
822
1458
  _: 3
823
- }, 16, ["hue"]));
1459
+ }, 16, ["checked", "disabled", "title", "textOn", "textOff", "subtitle", "subtitleColor", "titleColor", "focusTitleColor", "titleTextSize", "subtitleTextSize", "stateTextSize"]));
824
1460
  }
825
- }), $e = {
826
- install(o) {
827
- o.component("qt-hsv-background", fe), o.component("HsvBackground", fe);
1461
+ });
1462
+ let ce;
1463
+ var We;
1464
+ try {
1465
+ const e = require("@extscreen/es3-vue");
1466
+ ce = e.registerElement || ((We = e.default) == null ? void 0 : We.registerElement);
1467
+ } catch {
1468
+ }
1469
+ const Ct = {
1470
+ install: (e) => {
1471
+ if (!globalThis.__QtNaSwitcher_registered)
1472
+ if (ce) {
1473
+ const i = (u, s) => {
1474
+ ce(u, {
1475
+ component: {
1476
+ name: s ? "QtNaSwitcher_Plugin" : "QtNaSwitcher",
1477
+ processEventData(f, v) {
1478
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
1479
+ return l && (l.nativeEvent = r), l;
1480
+ }
1481
+ }
1482
+ });
1483
+ };
1484
+ i("qt-na-switcher", !1), i("qt-na-switcher-plugin", !0), i("QtNaSwitcher", !1), i("QtNaSwitcher_Plugin", !0), globalThis.__QtNaSwitcher_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtNaSwitcher");
1485
+ } else
1486
+ console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
1487
+ e.component("NaSwitcher", Oe), e.component("qt-na-switcher", Oe);
828
1488
  }
829
- }, Oe = {
1489
+ }, kt = w({
1490
+ name: "NaSettingSwitch",
1491
+ props: {
1492
+ title: {
1493
+ type: String,
1494
+ default: ""
1495
+ },
1496
+ subtitle: {
1497
+ type: String,
1498
+ default: ""
1499
+ },
1500
+ modelValue: {
1501
+ type: Boolean,
1502
+ default: !1
1503
+ },
1504
+ textOn: {
1505
+ type: String,
1506
+ default: "打开"
1507
+ },
1508
+ textOff: {
1509
+ type: String,
1510
+ default: "关闭"
1511
+ },
1512
+ titleTextSize: {
1513
+ type: Number,
1514
+ default: 28
1515
+ },
1516
+ subtitleTextSize: {
1517
+ type: Number,
1518
+ default: 22
1519
+ },
1520
+ stateTextSize: {
1521
+ type: Number,
1522
+ default: 24
1523
+ },
1524
+ disabled: {
1525
+ type: Boolean,
1526
+ default: !1
1527
+ },
1528
+ width: {
1529
+ type: [Number, String],
1530
+ default: 800
1531
+ },
1532
+ height: {
1533
+ type: [Number, String],
1534
+ default: 100
1535
+ }
1536
+ },
1537
+ emits: ["update:modelValue", "change"],
1538
+ setup(e, { emit: i, attrs: u }) {
1539
+ const s = A(e.modelValue);
1540
+ ee(() => e.modelValue, (r) => {
1541
+ s.value = r;
1542
+ });
1543
+ const f = (r) => {
1544
+ const a = r.checked;
1545
+ s.value = a, i("update:modelValue", a), i("change", a);
1546
+ }, v = W(() => typeof e.width == "number" ? `${e.width}px` : e.width), l = W(() => {
1547
+ const r = u.style || {}, a = e.subtitle ? (typeof e.height == "number" ? e.height : parseInt(e.height)) + 30 : e.height;
1548
+ return {
1549
+ width: v.value,
1550
+ height: typeof a == "number" ? `${a}px` : a,
1551
+ ...r
1552
+ };
1553
+ });
1554
+ return {
1555
+ checked: s,
1556
+ handleCheckedChange: f,
1557
+ mergedStyle: l
1558
+ };
1559
+ }
1560
+ });
1561
+ function It(e, i, u, s, f, v) {
1562
+ const l = ge("qt-na-switcher");
1563
+ return S(), $(l, {
1564
+ class: "na-setting-switch",
1565
+ style: fe(e.mergedStyle),
1566
+ title: e.title,
1567
+ subtitle: e.subtitle,
1568
+ checked: e.checked,
1569
+ textOn: e.textOn,
1570
+ textOff: e.textOff,
1571
+ titleTextSize: e.titleTextSize,
1572
+ subtitleTextSize: e.subtitleTextSize,
1573
+ stateTextSize: e.stateTextSize,
1574
+ disabled: e.disabled,
1575
+ onOnCheckedChange: e.handleCheckedChange
1576
+ }, null, 8, ["style", "title", "subtitle", "checked", "textOn", "textOff", "titleTextSize", "subtitleTextSize", "stateTextSize", "disabled", "onOnCheckedChange"]);
1577
+ }
1578
+ const qe = /* @__PURE__ */ ve(kt, [["render", It]]), Nt = {
1579
+ install(e) {
1580
+ e.component("NaSettingSwitch", qe), e.component("qt-na-setting-switch", qe);
1581
+ }
1582
+ }, Qe = "QtNaInputView", Tt = /* @__PURE__ */ w({
1583
+ __name: "NaInputViewBase",
1584
+ props: {
1585
+ text: {},
1586
+ placeholder: {},
1587
+ type: {},
1588
+ status: {},
1589
+ disabled: { type: Boolean },
1590
+ inputSize: {},
1591
+ cursorVisible: { type: Boolean },
1592
+ useSystemKeyboard: { type: Boolean },
1593
+ trailingIcon: {}
1594
+ },
1595
+ emits: ["onInputClick", "onChange"],
1596
+ setup(e, { expose: i }) {
1597
+ const u = A(), s = _(), f = Qe + "_Plugin", l = (s.isPluginActive ? f : Qe).replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase().replace(/^-/, ""), r = L(
1598
+ l,
1599
+ s.pluginPackageName || "com.quicktvui.plugin.extraui",
1600
+ "com.quicktvui.plugin.extraui.ExtraUIPluginApp"
1601
+ );
1602
+ return i({
1603
+ getNativeNode: () => {
1604
+ var a, c;
1605
+ return ((c = (a = u.value) == null ? void 0 : a.getNativeNode) == null ? void 0 : c.call(a)) || u.value;
1606
+ }
1607
+ }), (a, c) => (S(), $(D(r), B({
1608
+ ref_key: "nativeRef",
1609
+ ref: u,
1610
+ text: e.text,
1611
+ placeholder: e.placeholder,
1612
+ type: e.type,
1613
+ status: e.status,
1614
+ disabled: e.disabled,
1615
+ inputSize: e.inputSize,
1616
+ cursorVisible: e.cursorVisible,
1617
+ useSystemKeyboard: e.useSystemKeyboard,
1618
+ trailingIcon: e.trailingIcon,
1619
+ onOnInputClick: c[0] || (c[0] = (d) => a.$emit("onInputClick", d.nativeEvent)),
1620
+ onOnChange: c[1] || (c[1] = (d) => a.$emit("onChange", d.nativeEvent))
1621
+ }, a.$attrs), {
1622
+ default: R(() => [
1623
+ F(a.$slots, "default")
1624
+ ]),
1625
+ _: 3
1626
+ }, 16, ["text", "placeholder", "type", "status", "disabled", "inputSize", "cursorVisible", "useSystemKeyboard", "trailingIcon"]));
1627
+ }
1628
+ }), Re = /* @__PURE__ */ w({
1629
+ __name: "NaInputView",
1630
+ props: {
1631
+ inputSize: { default: "medium" }
1632
+ },
1633
+ emits: ["onInputClick", "onChange"],
1634
+ setup(e, { emit: i }) {
1635
+ const u = i, s = e, f = W(() => {
1636
+ let r = 60;
1637
+ return s.inputSize === "large" ? r = 70 : s.inputSize === "small" && (r = 50), {
1638
+ height: `${r}px`
1639
+ };
1640
+ }), v = (r) => {
1641
+ u("onInputClick", r);
1642
+ }, l = (r) => {
1643
+ u("onChange", r);
1644
+ };
1645
+ return (r, a) => (S(), $(Tt, B(r.$attrs, {
1646
+ style: f.value,
1647
+ inputSize: e.inputSize,
1648
+ onOnInputClick: v,
1649
+ onOnChange: l
1650
+ }), {
1651
+ default: R(() => [
1652
+ F(r.$slots, "default")
1653
+ ]),
1654
+ _: 3
1655
+ }, 16, ["style", "inputSize"]));
1656
+ }
1657
+ });
1658
+ let ue;
1659
+ var je;
1660
+ try {
1661
+ const e = require("@extscreen/es3-vue");
1662
+ ue = e.registerElement || ((je = e.default) == null ? void 0 : je.registerElement);
1663
+ } catch {
1664
+ }
1665
+ const St = {
1666
+ install: (e) => {
1667
+ if (!globalThis.__QtNaInputView_registered)
1668
+ if (ue) {
1669
+ const i = (u, s) => {
1670
+ ue(u, {
1671
+ component: {
1672
+ name: s ? "QtNaInputView_Plugin" : "QtNaInputView",
1673
+ processEventData(f, v) {
1674
+ const l = f.handler || f, r = v || (l == null ? void 0 : l.nativeParams) || {};
1675
+ return l && (l.nativeEvent = r), l;
1676
+ }
1677
+ }
1678
+ });
1679
+ };
1680
+ i("qt-na-input-view", !1), i("qt-na-input-view-plugin", !0), i("QtNaInputView", !1), i("QtNaInputView_Plugin", !0), globalThis.__QtNaInputView_registered = !0, console.log("[@quicktvui/naddons] Successfully registered Native tag:", "QtNaInputView");
1681
+ } else
1682
+ console.warn("[@quicktvui/naddons] Failed to find registerElement from @extscreen/es3-vue");
1683
+ e.component("NaInputView", Re), e.component("qt-na-input-view", Re);
1684
+ }
1685
+ }, Pt = {
830
1686
  // 如果设置为 true,则全局跳过所有组件的原生插件安装检查,直接渲染
831
1687
  skipPluginCheck: !1
832
- }, H = /* @__PURE__ */ new Set();
833
- function z(o, s, v) {
834
- return L({
835
- name: `${o}AsyncWrapper`,
1688
+ }, Y = /* @__PURE__ */ new Set();
1689
+ function L(e, i, u) {
1690
+ return w({
1691
+ name: `${e}AsyncWrapper`,
836
1692
  inheritAttrs: !1,
837
1693
  props: {
838
1694
  // 允许单个组件级别跳过检查
@@ -841,218 +1697,268 @@ function z(o, s, v) {
841
1697
  default: !1
842
1698
  }
843
1699
  },
844
- setup(p, { slots: f, attrs: b, expose: r }) {
845
- const y = G("loading"), i = G(""), d = G(), g = globalThis.__VUE_INSTANCE__;
846
- r({
1700
+ setup(s, { slots: f, attrs: v, expose: l }) {
1701
+ const r = A("loading"), a = A(""), c = A(), d = globalThis.__VUE_INSTANCE__;
1702
+ l({
847
1703
  getNativeNode: () => {
848
- let m = d.value;
849
- return !m && g && g.vnode && g.vnode.el && (m = g.vnode.el, m.childNodes && m.childNodes.length > 0 && (m = m.childNodes[0])), m;
1704
+ let p = c.value;
1705
+ return !p && d && d.vnode && d.vnode.el && (p = d.vnode.el, p.childNodes && p.childNodes.length > 0 && (p = p.childNodes[0])), p;
850
1706
  },
851
- nativeRef: d
1707
+ nativeRef: c
852
1708
  });
853
- let R = null, k = null;
1709
+ let z = null, q = null;
854
1710
  try {
855
- R = me(), k = ke();
856
- } catch (m) {
857
- console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。", m);
1711
+ z = Ze(), q = at();
1712
+ } catch (p) {
1713
+ console.warn("[withAsyncPlugin] 获取 useES 或 useESPlugin 失败,可能处于非 ES 环境。", p);
858
1714
  }
859
- const O = async () => {
860
- if (!R || typeof R.isComponentRegistered != "function")
1715
+ const Z = async () => {
1716
+ if (!z || typeof z.isComponentRegistered != "function")
861
1717
  return console.log("[withAsyncPlugin] es.isComponentRegistered 不可用"), !1;
862
1718
  try {
863
- const m = await R.isComponentRegistered(o);
864
- if (console.log(`[withAsyncPlugin] isComponentRegistered('${o}') 返回:`, m), m === !0 || m && typeof m == "object" && (m.registered === !0 || m.isRegistered === !0))
1719
+ const p = await z.isComponentRegistered(e);
1720
+ if (console.log(`[withAsyncPlugin] isComponentRegistered('${e}') 返回:`, p), p === !0 || p && typeof p == "object" && (p.registered === !0 || p.isRegistered === !0))
865
1721
  return !0;
866
1722
  try {
867
- const P = await x.callNativeWithPromise("ExtendModule", "getCoreSDKInfo");
868
- if (P && P.core_version) {
869
- const _ = P.core_version;
870
- console.log(`[withAsyncPlugin] 当前引擎核心版本: ${_}`);
871
- const E = _.split(".").map((I) => parseInt(I, 10));
1723
+ const I = await N.callNativeWithPromise("ExtendModule", "getCoreSDKInfo");
1724
+ if (I && I.core_version) {
1725
+ const P = I.core_version;
1726
+ console.log(`[withAsyncPlugin] 当前引擎核心版本: ${P}`);
1727
+ const E = P.split(".").map((G) => parseInt(G, 10));
872
1728
  if (E.length >= 3 && !isNaN(E[0]) && !isNaN(E[1]) && !isNaN(E[2]))
873
1729
  if (E[0] * 1e6 + E[1] * 1e3 + E[2] >= 1011205) {
874
- console.log(`[withAsyncPlugin] 引擎 >= 1.11.205,使用 ExtendModule 检查 Controller: ${o}`);
875
- const N = o.split("-").map((A) => A.charAt(0).toUpperCase() + A.slice(1)).join("");
876
- console.log(`[withAsyncPlugin] 同时检查原名和驼峰名: ${o}, ${N}`);
877
- const [w, $] = await Promise.all([
878
- x.callNativeWithPromise("ExtendModule", "isComponentRegistered", o).catch(() => !1),
879
- x.callNativeWithPromise("ExtendModule", "isComponentRegistered", N).catch(() => !1)
1730
+ console.log(`[withAsyncPlugin] 引擎 >= 1.11.205,使用 ExtendModule 检查 Controller: ${e}`);
1731
+ const T = e.split("-").map((x) => x.charAt(0).toUpperCase() + x.slice(1)).join("");
1732
+ console.log(`[withAsyncPlugin] 同时检查原名和驼峰名: ${e}, ${T}`);
1733
+ const [O, M] = await Promise.all([
1734
+ N.callNativeWithPromise("ExtendModule", "isComponentRegistered", e).catch(() => !1),
1735
+ N.callNativeWithPromise("ExtendModule", "isComponentRegistered", T).catch(() => !1)
880
1736
  ]);
881
- if (console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${w}, ${$}]`), w === !0 || $ === !0)
1737
+ if (console.log(`[withAsyncPlugin] ExtendModule.isComponentRegistered 返回: [${O}, ${M}]`), O === !0 || M === !0)
882
1738
  return !0;
883
1739
  } else
884
- console.log(`[withAsyncPlugin] 引擎版本 ${_} < 1.11.205,跳过 ExtendModule 检查`);
1740
+ console.log(`[withAsyncPlugin] 引擎版本 ${P} < 1.11.205,跳过 ExtendModule 检查`);
885
1741
  else
886
- console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${_}`);
1742
+ console.log(`[withAsyncPlugin] 无法解析引擎版本号: ${P}`);
887
1743
  }
888
- } catch (P) {
889
- console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:", P);
1744
+ } catch (I) {
1745
+ console.log("[withAsyncPlugin] 获取引擎版本或检查 Controller 失败:", I);
890
1746
  }
891
1747
  return !1;
892
- } catch (m) {
893
- return console.warn("[withAsyncPlugin] 检查组件注册状态异常:", m), !1;
1748
+ } catch (p) {
1749
+ return console.warn("[withAsyncPlugin] 检查组件注册状态异常:", p), !1;
894
1750
  }
895
- }, M = async () => {
896
- if (Oe.skipPluginCheck || p.skipPluginCheck) {
897
- console.log(`[withAsyncPlugin] 跳过 ${o} 插件检查 (skipPluginCheck = true)`), y.value = "ready";
1751
+ }, U = async () => {
1752
+ if (Pt.skipPluginCheck || s.skipPluginCheck) {
1753
+ console.log(`[withAsyncPlugin] 跳过 ${e} 插件检查 (skipPluginCheck = true)`), r.value = "ready";
898
1754
  return;
899
1755
  }
900
- if (!s) {
901
- y.value = "ready";
1756
+ if (!i) {
1757
+ r.value = "ready";
902
1758
  return;
903
1759
  }
904
- const m = await O();
905
- if (console.log(`[withAsyncPlugin] 拦截检查 - ${o} 是否已注册:`, m), m || H.has(s)) {
906
- y.value = "ready", H.add(s), console.log("[withAsyncPlugin] 组件已注册,跳过安装流程");
1760
+ const p = await Z();
1761
+ if (console.log(`[withAsyncPlugin] 拦截检查 - ${e} 是否已注册:`, p), p || Y.has(i)) {
1762
+ r.value = "ready", Y.add(i), console.log("[withAsyncPlugin] 组件已注册,跳过安装流程");
907
1763
  return;
908
1764
  }
909
- if (!k) {
910
- console.warn(`[withAsyncPlugin] 无法获取 useESPlugin 实例,可能处于内置 AAR 环境或非插件环境,尝试直接渲染 ${o}`), y.value = "ready";
1765
+ if (!q) {
1766
+ console.warn(`[withAsyncPlugin] 无法获取 useESPlugin 实例,可能处于内置 AAR 环境或非插件环境,尝试直接渲染 ${e}`), r.value = "ready";
911
1767
  return;
912
1768
  }
913
- console.log(`[withAsyncPlugin] 开始动态安装插件: ${s}`);
1769
+ console.log(`[withAsyncPlugin] 开始动态安装插件: ${i}`);
914
1770
  try {
915
- await new Promise((P, _) => {
1771
+ await new Promise((I, P) => {
916
1772
  let E;
917
- const I = {
918
- onPluginInstallSuccess(N, w, $) {
919
- N === s && (clearTimeout(E), k.removeListener(I), console.log(`[withAsyncPlugin] 安装成功 pkg=${N} 状态码=${w}`), w == 1003 || w == 1001 ? (v ? (console.log(`[withAsyncPlugin] 触发反射初始化: ${v}`), x.callNative("EsNativeModule", "callReflect", {
1773
+ const G = {
1774
+ onPluginInstallSuccess(T, O, M) {
1775
+ T === i && (clearTimeout(E), q.removeListener(G), console.log(`[withAsyncPlugin] 安装成功 pkg=${T} 状态码=${O}`), O == 1003 || O == 1001 ? (u ? (console.log(`[withAsyncPlugin] 触发反射初始化: ${u}`), N.callNative("EsNativeModule", "callReflect", {
920
1776
  entry: {
921
- from: v,
1777
+ from: u,
922
1778
  method: "setup"
923
1779
  }
924
- })) : console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"), P()) : _(new Error(`安装失败 pkg=${N} status=${w} msg=${$}`)));
1780
+ })) : console.log("[withAsyncPlugin] 安装成功,跳过反射初始化(无 pluginInitClass)"), I()) : P(new Error(`安装失败 pkg=${T} status=${O} msg=${M}`)));
925
1781
  },
926
- onPluginInstallError(N, w, $) {
927
- N === s && (clearTimeout(E), k.removeListener(I), _(new Error(`安装失败 pkg=${N} status=${w} msg=${$}`)));
1782
+ onPluginInstallError(T, O, M) {
1783
+ T === i && (clearTimeout(E), q.removeListener(G), P(new Error(`安装失败 pkg=${T} status=${O} msg=${M}`)));
928
1784
  }
929
1785
  };
930
- k.addListener({ pkg: s }, I), E = setTimeout(() => {
931
- k.removeListener(I), _(new Error(`插件安装超时: ${s}`));
932
- }, 8e3), typeof k.installPlugin == "function" ? k.installPlugin({ pkg: s }) : typeof k.install == "function" ? k.install(s) : _(new Error("当前运行时不支持 install / installPlugin"));
933
- }), await Ee(), H.add(s), y.value = "ready";
934
- } catch (P) {
935
- console.error("[withAsyncPlugin] 插件加载失败:", P), i.value = (P == null ? void 0 : P.message) || String(P), y.value = "error";
1786
+ q.addListener({ pkg: i }, G), E = setTimeout(() => {
1787
+ q.removeListener(G), P(new Error(`插件安装超时: ${i}`));
1788
+ }, 8e3), typeof q.installPlugin == "function" ? q.installPlugin({ pkg: i }) : typeof q.install == "function" ? q.install(i) : P(new Error("当前运行时不支持 install / installPlugin"));
1789
+ }), await tt(), Y.add(i), r.value = "ready";
1790
+ } catch (I) {
1791
+ console.error("[withAsyncPlugin] 插件加载失败:", I), a.value = (I == null ? void 0 : I.message) || String(I), r.value = "error";
936
1792
  }
937
1793
  };
938
- return Ae(() => {
939
- M();
1794
+ return et(() => {
1795
+ U();
940
1796
  }), () => {
941
- const m = {
1797
+ const p = {
942
1798
  display: "flex",
943
1799
  flexDirection: "column",
944
1800
  justifyContent: "center",
945
1801
  alignItems: "center",
946
- ...b.style || {}
1802
+ ...v.style || {}
947
1803
  };
948
- b.width !== void 0 && !m.width && (m.width = typeof b.width == "number" ? `${b.width}px` : b.width), b.height !== void 0 && !m.height && (m.height = typeof b.height == "number" ? `${b.height}px` : b.height);
949
- const P = b.class ? `qt-plugin-container ${b.class}` : "qt-plugin-container", _ = {
950
- class: P,
951
- style: m,
1804
+ v.width !== void 0 && !p.width && (p.width = typeof v.width == "number" ? `${v.width}px` : v.width), v.height !== void 0 && !p.height && (p.height = typeof v.height == "number" ? `${v.height}px` : v.height);
1805
+ const I = v.class ? `qt-plugin-container ${v.class}` : "qt-plugin-container", P = {
1806
+ class: I,
1807
+ style: p,
952
1808
  // 默认关闭外层 div 的裁剪,防止内部组件 focusScale 时被切
953
1809
  clipChildren: !1,
954
1810
  clipPadding: !1,
955
1811
  clipToPadding: !1
956
1812
  };
957
- if (y.value === "loading")
958
- return U("div", _, [
959
- U("div", { style: { color: "white", fontSize: "30px" } }, "插件加载中...")
1813
+ if (r.value === "loading")
1814
+ return H("div", P, [
1815
+ H("div", { style: { color: "white", fontSize: "30px" } }, "插件加载中...")
960
1816
  ]);
961
- if (y.value === "error")
962
- return U("div", _, [
963
- U("div", { style: { color: "white", fontSize: "30px", backgroundColor: "rgba(255,0,0,0.5)" } }, `插件加载失败: ${i.value}`)
1817
+ if (r.value === "error")
1818
+ return H("div", P, [
1819
+ H("div", { style: { color: "white", fontSize: "30px", backgroundColor: "rgba(255,0,0,0.5)" } }, `插件加载失败: ${a.value}`)
964
1820
  ]);
965
- const E = {}, I = {};
966
- for (const [A, C] of Object.entries(b))
967
- if (A.startsWith("on") && typeof C == "function") {
968
- let D = A;
969
- A.startsWith("onOn") && (D = "on" + A.slice(4)), I[D] = C;
970
- } else if (A.startsWith("on") && Array.isArray(C)) {
971
- let D = A;
972
- A.startsWith("onOn") && (D = "on" + A.slice(4)), I[D] = C;
1821
+ const E = {}, G = {};
1822
+ for (const [x, V] of Object.entries(v))
1823
+ if (x.startsWith("on") && typeof V == "function") {
1824
+ let j = x;
1825
+ x.startsWith("onOn") && (j = "on" + x.slice(4)), G[j] = V;
1826
+ } else if (x.startsWith("on") && Array.isArray(V)) {
1827
+ let j = x;
1828
+ x.startsWith("onOn") && (j = "on" + x.slice(4)), G[j] = V;
973
1829
  } else
974
- A.startsWith("onOn") || (E[A] = C);
975
- const N = {
1830
+ x.startsWith("onOn") || (E[x] = V);
1831
+ const T = {
976
1832
  ...E,
977
- ...I,
978
- class: P,
1833
+ ...G,
1834
+ class: I,
979
1835
  // 把外层 class 传给内部
980
- style: m,
1836
+ style: p,
981
1837
  // 把外层 style 传给内部
982
- ref: (A) => {
983
- d.value = A;
1838
+ ref: (x) => {
1839
+ c.value = x;
984
1840
  }
985
- }, w = N.tabsData || "", $ = N.actionPayload || "";
986
- return console.log("[withAsyncPlugin] 最终准备传递给 h() 的属性键集合:", Object.keys(N), "tabsData.length=", w.length, "actionPayload.length=", $.length), U(o, N, f.default ? f.default() : []);
1841
+ }, O = T.tabsData || "", M = T.actionPayload || "";
1842
+ return console.log("[withAsyncPlugin] 最终准备传递给 h() 的属性键集合:", Object.keys(T), "tabsData.length=", O.length, "actionPayload.length=", M.length), H(e, T, f.default ? f.default() : []);
987
1843
  };
988
1844
  }
989
1845
  });
990
1846
  }
991
- const he = Symbol("AddonEnvContext"), Pe = {
1847
+ const Je = Symbol("AddonEnvContext"), Xe = {
992
1848
  isPluginActive: !1,
993
1849
  nameSuffix: "",
994
1850
  pluginPackageName: "com.quicktvui.plugin.glintui",
995
1851
  builtInVersions: {}
996
1852
  };
997
- async function je(o = "com.quicktvui.plugin.glintui", s = "_Plugin") {
998
- const v = me();
999
- let p = {};
1853
+ async function Ut(e = "com.quicktvui.plugin.glintui", i = "_Plugin") {
1854
+ const u = Ze();
1855
+ let s = {};
1000
1856
  try {
1001
- const i = await x.callNativeModule("AddonEnvModule", "getBuiltInVersions", []);
1002
- i && typeof i == "object" && (p = i);
1003
- } catch (i) {
1004
- console.warn("[AddonProvider] Failed to fetch built-in versions from AddonEnvModule", i);
1857
+ const a = await N.callNativeModule("AddonEnvModule", "getBuiltInVersions", []);
1858
+ a && typeof a == "object" && (s = a);
1859
+ } catch (a) {
1860
+ console.warn("[AddonProvider] Failed to fetch built-in versions from AddonEnvModule", a);
1005
1861
  }
1006
- const f = `QtGridTabs${s}`, b = v.isComponentRegistered(f), r = b instanceof Promise ? await b : b, y = {
1007
- isPluginActive: r,
1008
- nameSuffix: r ? s : "",
1862
+ const f = `QtGridTabs${i}`, v = u.isComponentRegistered(f), l = v instanceof Promise ? await v : v, r = {
1863
+ isPluginActive: l,
1864
+ nameSuffix: l ? i : "",
1009
1865
  // 如果使用了热更插件,包名加上 .ext 后缀(与 Gradle 打包脚本对齐)
1010
- pluginPackageName: r ? `${o}.ext` : o,
1011
- builtInVersions: p
1866
+ pluginPackageName: l ? `${e}.ext` : e,
1867
+ builtInVersions: s
1012
1868
  };
1013
- return console.info("[AddonProvider] Environment initialized:", y), y;
1869
+ return console.info("[AddonProvider] Environment initialized:", r), r;
1870
+ }
1871
+ let de = A(Xe);
1872
+ function Vt(e) {
1873
+ de.value = e, ot(Je, de);
1014
1874
  }
1015
- let ne = G(Pe);
1016
- function Ve(o) {
1017
- ne.value = o, Ne(he, ne);
1875
+ function _() {
1876
+ var e;
1877
+ return ((e = nt(Je, de)) == null ? void 0 : e.value) || Xe;
1018
1878
  }
1019
- function Z() {
1020
- var o;
1021
- return ((o = _e(he, ne)) == null ? void 0 : o.value) || Pe;
1879
+ async function Et(e) {
1880
+ console.log("[AddonProvider] Sending GridTabs global config to Native:", e);
1881
+ try {
1882
+ const i = await N.callNativeWithPromise("GridTabsConfigModule", "setDefaultConfig", JSON.stringify(e));
1883
+ return console.log("[AddonProvider] Received response from Native:", i), !!(i && i.success);
1884
+ } catch (i) {
1885
+ return console.error("[AddonProvider] Failed to initialize GridTabs global config:", i), !1;
1886
+ }
1022
1887
  }
1023
- async function We(o) {
1024
- console.log("[AddonProvider] Sending GridTabs global config to Native:", o);
1888
+ async function xt(e) {
1889
+ console.log("[AddonProvider] Sending ExtraUI global theme config to Native:", e);
1025
1890
  try {
1026
- const s = await x.callNativeWithPromise("GridTabsConfigModule", "setDefaultConfig", JSON.stringify(o));
1027
- return console.log("[AddonProvider] Received response from Native:", s), !!(s && s.success);
1028
- } catch (s) {
1029
- return console.error("[AddonProvider] Failed to initialize GridTabs global config:", s), !1;
1891
+ const i = await N.callNativeWithPromise("ExtraUIConfigModule", "setThemeConfig", JSON.stringify(e));
1892
+ return console.log("[AddonProvider] Received ExtraUI theme response from Native:", i), !!(i && i.success);
1893
+ } catch (i) {
1894
+ return console.error("[AddonProvider] Failed to initialize ExtraUI global theme config:", i), !1;
1030
1895
  }
1031
1896
  }
1032
- const ze = {
1033
- install: (o) => {
1034
- o.use(we), o.use(xe), o.use(Se), o.use(Ge), o.use($e);
1897
+ async function Wt(e) {
1898
+ console.log("[AddonProvider] Initializing global theme across all modules:", e);
1899
+ const i = await xt(e), u = await Et({
1900
+ themeConfig: {
1901
+ placeholderColor: e.placeholderColor,
1902
+ glowColor: e.glowColor || e.focusBackgroundColor,
1903
+ outerBorderColor: e.outerBorderColor || e.focusBorderColor,
1904
+ innerBorderColor: e.innerBorderColor,
1905
+ enableElevationShadow: e.enableElevationShadow,
1906
+ cornerRadius: e.cornerRadius,
1907
+ buttonCornerRadius: e.buttonCornerRadius,
1908
+ primaryTextColor: e.primaryTextColor,
1909
+ secondaryTextColor: e.secondaryTextColor,
1910
+ focusTextColor: e.focusTextColor,
1911
+ selectedTextColor: e.selectedTextColor,
1912
+ selectedBackgroundColor: e.selectedBackgroundColor,
1913
+ focusBackgroundColor: e.focusBackgroundColor,
1914
+ buttonNormalBackgroundColor: e.buttonNormalBackgroundColor
1915
+ // 更多属性映射根据后续 Glint/GridTabs 支持情况添加
1916
+ }
1917
+ });
1918
+ return i && u;
1919
+ }
1920
+ const jt = {
1921
+ install: (e) => {
1922
+ e.use(it), e.use(lt), e.use(rt), e.use(st), e.use(ct), e.use(ut), e.use(gt), e.use(ft), e.use(bt), e.use(pt), e.use(Ct), e.use(Nt), e.use(St);
1035
1923
  }
1036
1924
  };
1037
1925
  export {
1038
- he as ADDON_ENV_CONTEXT_KEY,
1039
- J as GridTabs,
1040
- we as GridTabsPlugin,
1041
- fe as HsvBackground,
1042
- $e as HsvBackgroundPlugin,
1043
- ie as Keyboard,
1044
- xe as KeyboardPlugin,
1045
- de as PortalItem,
1046
- Ge as PortalItemPlugin,
1047
- ce as PortalPool,
1048
- Se as PortalPoolPlugin,
1049
- ze as QuickTVUINAddons,
1050
- Oe as QuickTVUINAddonsConfig,
1051
- ze as default,
1052
- je as initAddonEnv,
1053
- We as initGridTabsGlobalConfig,
1054
- Ve as provideAddonEnv,
1055
- Z as useAddonEnv,
1056
- Ke as useGridTabs,
1057
- z as withAsyncPlugin
1926
+ Je as ADDON_ENV_CONTEXT_KEY,
1927
+ X as GridTabs,
1928
+ it as GridTabsPlugin,
1929
+ Te as HsvBackground,
1930
+ ct as HsvBackgroundPlugin,
1931
+ he as Keyboard,
1932
+ lt as KeyboardPlugin,
1933
+ xe as NaButton,
1934
+ gt as NaButtonPlugin,
1935
+ we as NaCheckbox,
1936
+ Be as NaCheckboxGroup,
1937
+ pt as NaCheckboxGroupPlugin,
1938
+ ft as NaCheckboxPlugin,
1939
+ Re as NaInputView,
1940
+ St as NaInputViewPlugin,
1941
+ $e as NaRadioGroup,
1942
+ bt as NaRadioGroupPlugin,
1943
+ qe as NaSettingSwitch,
1944
+ Nt as NaSettingSwitchPlugin,
1945
+ Oe as NaSwitcher,
1946
+ Ct as NaSwitcherPlugin,
1947
+ Ie as PortalItem,
1948
+ st as PortalItemPlugin,
1949
+ Ce as PortalPool,
1950
+ rt as PortalPoolPlugin,
1951
+ jt as QuickTVUINAddons,
1952
+ Pt as QuickTVUINAddonsConfig,
1953
+ Pe as SvgImage,
1954
+ ut as SvgImagePlugin,
1955
+ jt as default,
1956
+ Ut as initAddonEnv,
1957
+ xt as initExtraUIGlobalTheme,
1958
+ Wt as initGlobalTheme,
1959
+ Et as initGridTabsGlobalConfig,
1960
+ Vt as provideAddonEnv,
1961
+ _ as useAddonEnv,
1962
+ _t as useGridTabs,
1963
+ L as withAsyncPlugin
1058
1964
  };