@omnipad/vue 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,138 +1,126 @@
1
- import { Registry as ue, WindowManager as de, CONTEXT as ne, CMP_TYPES as T, InputZoneCore as ve, RootLayerCore as fe, TargetZoneCore as pe, ButtonCore as me, DPadCore as ye, TrackpadCore as ge, JoystickCore as Pe } from "@omnipad/core";
2
- import { defineComponent as O, h as be, shallowRef as Ce, ref as L, watch as se, onMounted as he, onUnmounted as we, readonly as q, computed as $, openBlock as k, createElementBlock as A, Fragment as Re, renderList as _e, createBlock as j, resolveDynamicComponent as ee, renderSlot as P, inject as ke, provide as $e, useSlots as De, nextTick as Ne, normalizeStyle as V, normalizeClass as D, unref as t, createVNode as H, withCtx as N, createElementVNode as I, createCommentVNode as Z, Transition as Te, toDisplayString as Ie, normalizeProps as S, guardReactiveProps as U, watchEffect as ae } from "vue";
3
- import { getObjectDiff as Ae, createCachedProvider as Ee, createPointerBridge as xe, generateUID as Se, resolveLayoutStyle as W, supportsContainerQueries as J, remap as G, reclaimFocusAtPos as Ue, dispatchPointerEventAtPos as Oe, dispatchKeyboardEvent as Be } from "@omnipad/core/utils";
4
- const Q = {};
5
- function F(e, o) {
6
- Q[e] = o;
1
+ import { Registry as pe, ElementObserver as ne, WindowManager as ye, CONTEXT as ie, CMP_TYPES as I, InputZoneCore as me, RootLayerCore as ge, TargetZoneCore as Pe, ButtonCore as be, DPadCore as he, TrackpadCore as Ce, JoystickCore as _e, setGlobalSignalHandler as we, ACTION_TYPES as se } from "@omnipad/core";
2
+ import { getObjectDiff as Re, createCachedProvider as ke, createPointerBridge as $e, generateUID as De, getBusinessProps as ae, resolveLayoutStyle as q, supportsContainerQueries as Q, remap as G, reclaimFocusAtPos as Ne, dispatchPointerEventAtPos as Ie, dispatchKeyboardEvent as ce } from "@omnipad/core/utils";
3
+ import { defineComponent as B, h as Te, shallowRef as Ee, ref as M, computed as $, watch as le, onMounted as Ae, onUnmounted as Se, readonly as X, openBlock as w, createElementBlock as E, Fragment as xe, renderList as Ue, createBlock as Z, resolveDynamicComponent as ee, renderSlot as h, inject as Be, provide as Le, useSlots as Oe, nextTick as Ve, normalizeStyle as O, normalizeClass as D, unref as o, createVNode as H, withCtx as N, createElementVNode as T, createCommentVNode as Y, Transition as Me, toDisplayString as Ye, normalizeProps as x, guardReactiveProps as U, watchEffect as de } from "vue";
4
+ const j = {};
5
+ function F(e, n) {
6
+ j[e] = n;
7
7
  }
8
- function re(e) {
9
- const o = Q[e];
10
- return o || O({
11
- render: () => be("div", { style: "color:red" }, `[Unknown: ${e}]`)
8
+ function ue(e) {
9
+ const n = j[e];
10
+ return n || B({
11
+ render: () => Te("div", { style: "color:red" }, `[Unknown: ${e}]`)
12
12
  });
13
13
  }
14
- function ie(e) {
15
- return !e || !Q[e] ? null : Q[e];
14
+ function re(e) {
15
+ return !e || !j[e] ? null : j[e];
16
16
  }
17
- function ft(e) {
18
- return e ? !!Q[e] : !1;
17
+ function Pt(e) {
18
+ return e ? !!j[e] : !1;
19
19
  }
20
- function z(e, o, v = {}, s) {
21
- const n = e(), l = Ce(), g = L(), i = L(), u = L(), a = L(null), m = L({});
22
- let b = null;
23
- const C = (c) => {
24
- g.value = c;
25
- }, w = (c) => {
26
- i.value = c, i.value && (u.value = i.value?.layout);
27
- }, R = (c) => {
28
- if (!l.value) return;
29
- const f = l.value;
30
- typeof f.bindDelegate == "function" && Object.entries(c).forEach(([_, d]) => {
31
- f.bindDelegate(_, d);
20
+ function K(e, n, d = {}, s) {
21
+ const t = e(), r = Ee(), b = M(), i = M(), l = $(() => i.value?.layout), a = M(null), f = (y) => {
22
+ r.value && "bindDelegate" in r.value && Object.entries(y).forEach(([u, m]) => {
23
+ r.value.bindDelegate(u, m);
32
24
  });
33
25
  };
34
- let h = { ...o.value };
35
- return se(
36
- o,
37
- (c) => {
38
- if (!l.value) return;
39
- const f = Ae(h, c);
40
- Object.keys(f).length > 0 && l.value.updateConfig(f), h = { ...o.value };
26
+ let _ = { ...n.value };
27
+ le(
28
+ n,
29
+ (y) => {
30
+ if (!r.value) return;
31
+ const u = Re(_, y);
32
+ Object.keys(u).length > 0 && r.value.updateConfig(u), _ = { ...n.value };
41
33
  },
42
34
  { deep: !0 }
43
- ), he(() => {
44
- l.value = n, ue.getInstance().register(n), "subscribeState" in n && n.subscribeState(C), "subscribeConfig" in n && n.subscribeConfig(w), s && R(s);
45
- let c = null;
46
- if (a.value && (a.value instanceof Element ? c = a.value : a.value.$el instanceof Element && (c = a.value.$el)), c && "bindRectProvider" in n) {
47
- const f = n, _ = Ee(() => c.getBoundingClientRect());
48
- f.bindRectProvider(_.get, _.markDirty), b = new ResizeObserver(() => {
49
- f.markRectDirty();
50
- }), b.observe(c);
51
- }
52
- if ("onPointerDown" in n) {
53
- const f = xe(n, v);
54
- m.value = { ...f };
35
+ ), Ae(() => {
36
+ r.value = t, pe.getInstance().register(t), "subscribeState" in t && t.subscribeState((u) => b.value = u), "subscribeConfig" in t && t.subscribeConfig((u) => i.value = u), s && f(s);
37
+ let y = null;
38
+ if (a.value && (a.value instanceof Element ? y = a.value : a.value.$el instanceof Element && (y = a.value.$el)), y instanceof Element) {
39
+ const u = ne.getInstance();
40
+ if ("bindRectProvider" in t) {
41
+ const m = ke(() => y.getBoundingClientRect());
42
+ t.bindRectProvider(m.get, m.markDirty), u.observeResize(t.uid, y, () => {
43
+ t.markRectDirty();
44
+ });
45
+ }
46
+ u.observeIntersect(t.uid, y, (m) => {
47
+ m || t.reset();
48
+ });
55
49
  }
56
- de.getInstance().init();
57
- }), we(() => {
58
- b && (b.disconnect(), b = null), l.value && l.value.destroy();
59
- }), {
60
- core: q(l),
61
- state: q(g),
62
- domEvents: q(m),
63
- effectiveConfig: q(i),
64
- effectiveLayout: q(u),
50
+ ye.getInstance().init();
51
+ }), Se(() => {
52
+ ne.getInstance().disconnect(t.uid), r.value && r.value.destroy();
53
+ });
54
+ const R = "onPointerDown" in t ? $e(t, d) : {};
55
+ return {
56
+ core: X(r),
57
+ state: X(b),
58
+ domEvents: R,
59
+ effectiveConfig: X(i),
60
+ effectiveLayout: l,
65
61
  elementRef: a,
66
- bindDelegates: R
62
+ bindDelegates: f
67
63
  };
68
64
  }
69
- const Le = { class: "omnipad-virtual-layer-base omnipad-prevent" }, Ve = /* @__PURE__ */ O({
65
+ const Ze = { class: "omnipad-virtual-layer-base omnipad-prevent" }, Fe = /* @__PURE__ */ B({
70
66
  __name: "VirtualLayerBase",
71
67
  props: {
72
68
  nodes: {}
73
69
  },
74
70
  setup(e) {
75
- const o = e, v = $(() => (o.nodes || []).map((s) => {
76
- let n = ie(s.type);
77
- return !n && s.config?.baseType && (n = ie(s.config.baseType)), n || (n = re(s.type)), {
71
+ const n = e, d = $(() => (n.nodes || []).map((s) => {
72
+ let t = re(s.type);
73
+ return !t && s.config?.baseType && (t = re(s.config.baseType)), t || (t = ue(s.type)), {
78
74
  node: s,
79
- component: n
75
+ component: t
80
76
  };
81
77
  }));
82
- return (s, n) => (k(), A("div", Le, [
83
- (k(!0), A(Re, null, _e(v.value, (l) => (k(), j(ee(l.component), {
84
- key: l.node.uid,
85
- "tree-node": l.node
78
+ return (s, t) => (w(), E("div", Ze, [
79
+ (w(!0), E(xe, null, Ue(d.value, (r) => (w(), Z(ee(r.component), {
80
+ key: r.node.uid,
81
+ "tree-node": r.node
86
82
  }, null, 8, ["tree-node"]))), 128)),
87
- P(s.$slots, "default", {}, void 0, !0)
83
+ h(s.$slots, "default", {}, void 0, !0)
88
84
  ]));
89
85
  }
90
- }), M = (e, o) => {
91
- const v = e.__vccOpts || e;
92
- for (const [s, n] of o)
93
- v[s] = n;
94
- return v;
95
- }, ce = /* @__PURE__ */ M(Ve, [["__scopeId", "data-v-d67cc501"]]);
96
- function Y(e, o, v = {}) {
97
- const s = o.treeNode, n = s && s.config?.baseType === e || s?.type === e ? s : void 0;
98
- s && !n && console.warn(
99
- `[OmniPad-Validation] Type mismatch! Component expected "${e}", but received "${s.type}". Config ignored.`
86
+ }), V = (e, n) => {
87
+ const d = e.__vccOpts || e;
88
+ for (const [s, t] of n)
89
+ d[s] = t;
90
+ return d;
91
+ }, ve = /* @__PURE__ */ V(Fe, [["__scopeId", "data-v-d67cc501"]]), Ke = ["treeNode", "widgetId", "parentId"];
92
+ function z(e, n, d = {}, s = []) {
93
+ const t = n.treeNode, r = t && t.config?.baseType === e || t?.type === e ? t : void 0;
94
+ t && !r && console.warn(
95
+ `[OmniPad-Validation] Type mismatch! Component expected "${e}", but received "${t.type}". Config ignored.`
100
96
  );
101
- const l = ke(ne.PARENT_ID_KEY, L(void 0)), g = $(() => o.parentId || n?.config?.parentId || l.value), i = $(() => o.widgetId || n?.uid || Se(e));
102
- $e(ne.PARENT_ID_KEY, i);
103
- const u = n?.config || {}, a = Object.fromEntries(
104
- Object.entries(o).filter(
105
- ([C, w]) => w !== void 0 && C !== "treeNode" && C !== "widgetId"
106
- )
107
- ), m = $(() => ({
108
- ...v,
109
- ...u,
110
- ...a,
111
- id: i.value,
97
+ const b = Be(ie.PARENT_ID_KEY, M(void 0)), i = $(() => n.parentId || r?.config?.parentId || b.value), l = n.widgetId || r?.uid || De(e);
98
+ Le(ie.PARENT_ID_KEY, l);
99
+ const a = /* @__PURE__ */ new Set([...Ke, ...s]), f = r?.config || {}, _ = ae(n, a), R = {
100
+ ...d,
101
+ ...f,
102
+ ..._,
103
+ id: l,
112
104
  baseType: e,
113
- parentId: g.value,
105
+ parentId: i.value,
114
106
  // 特殊处理 Layout:深度合并,确保即便只传了 { width: 100 } 也不丢失原来的 left/top
115
107
  layout: {
116
- ...v.layout || {},
117
- ...u.layout || {},
118
- ...a.layout || {}
108
+ ...d.layout || {},
109
+ ...f.layout || {},
110
+ ..._.layout || {}
119
111
  }
120
- })), b = $(() => {
121
- const C = Object.fromEntries(
122
- // 排除身份和依赖配置的异常变更
123
- Object.entries(o).filter(
124
- ([w, R]) => R !== void 0 && w !== "treeNode" && w !== "widgetId" && w !== "parentId"
125
- )
126
- );
112
+ }, y = $(() => {
113
+ const u = ae(n, a);
127
114
  return {
128
- ...C,
129
- layout: C.layout || void 0
115
+ ...u,
116
+ parentId: i.value,
117
+ layout: u.layout || void 0
130
118
  // 只有当传入了新的 layout 时才包裹
131
119
  };
132
120
  });
133
- return { uid: i, initialConfig: m, reactiveConfig: b };
121
+ return { uid: l, initialConfig: R, reactiveConfig: y };
134
122
  }
135
- const Me = ["id"], Ze = /* @__PURE__ */ O({
123
+ const ze = ["id"], We = /* @__PURE__ */ B({
136
124
  __name: "InputZone",
137
125
  props: {
138
126
  treeNode: {},
@@ -141,43 +129,43 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
141
129
  preventFocusLoss: {}
142
130
  },
143
131
  setup(e) {
144
- const o = e, v = De(), s = L(null), { uid: n, initialConfig: l, reactiveConfig: g } = Y(
145
- T.INPUT_ZONE,
146
- o
147
- ), { core: i, state: u, domEvents: a, effectiveConfig: m, effectiveLayout: b, elementRef: C, bindDelegates: w } = z(
148
- () => new ve(n.value, l.value, o.treeNode?.type),
149
- g,
132
+ const n = e, d = Oe(), s = M(null), { uid: t, initialConfig: r, reactiveConfig: b } = z(
133
+ I.INPUT_ZONE,
134
+ n
135
+ ), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R, bindDelegates: y } = K(
136
+ () => new me(t, r, n.treeNode?.type),
137
+ b,
150
138
  {
151
139
  requireDirectHit: !0
152
140
  }
153
- ), R = $(() => {
154
- const p = o.treeNode?.config?.dynamicWidgetId;
155
- return o.treeNode?.children?.filter((E) => E.uid !== p) || [];
156
- }), h = $(() => {
157
- const E = (v.dynamicWidget?.() || []).filter((X) => !(X.type === Comment || X.type === Text)), x = o.treeNode?.children?.find(
158
- (X) => X.uid === o.treeNode?.config?.dynamicWidgetId
159
- ), K = E.length > 0;
160
- return E.length > 1 && console.error(
161
- `[OmniPad-Validation] InputZone ${n.value} has multiple dynamic widgets in slot. Only the first one will be activated.`
162
- ), K && x && console.warn(
163
- `[OmniPad-Validation] InputZone ${n.value} has both Slot and Config dynamic widgets. Config ignored.`
141
+ ), u = $(() => {
142
+ const p = n.treeNode?.config?.dynamicWidgetId;
143
+ return n.treeNode?.children?.filter((A) => A.uid !== p) || [];
144
+ }), m = $(() => {
145
+ const A = (d.dynamicWidget?.() || []).filter((J) => !(J.type === Comment || J.type === Text)), S = n.treeNode?.children?.find(
146
+ (J) => J.uid === n.treeNode?.config?.dynamicWidgetId
147
+ ), W = A.length > 0;
148
+ return A.length > 1 && console.error(
149
+ `[OmniPad-Validation] InputZone ${t} has multiple dynamic widgets in slot. Only the first one will be activated.`
150
+ ), W && S && console.warn(
151
+ `[OmniPad-Validation] InputZone ${t} has both Slot and Config dynamic widgets. Config ignored.`
164
152
  ), {
165
- nodeToRender: K ? E[0] : x || null,
166
- isFromSlot: K
153
+ nodeToRender: W ? A[0] : S || null,
154
+ isFromSlot: W
167
155
  };
168
- }), c = $(() => {
169
- const p = h.value.nodeToRender;
170
- return re(p.config?.baseType || p.type);
156
+ }), P = $(() => {
157
+ const p = m.value.nodeToRender;
158
+ return ue(p.config?.baseType || p.type);
171
159
  });
172
- se(
160
+ le(
173
161
  s,
174
162
  (p) => {
175
- Ne(() => {
163
+ Ve(() => {
176
164
  p && p?.uid && (i.value?.updateConfig({
177
165
  dynamicWidgetId: p.uid
178
- }), w({
179
- dynamicWidgetPointerDown: (E) => {
180
- p.markRectDirty?.(), p.onPointerDown?.(E);
166
+ }), y({
167
+ dynamicWidgetPointerDown: (A) => {
168
+ p.markRectDirty?.(), p.onPointerDown?.(A);
181
169
  },
182
170
  dynamicWidgetPointerMove: p.onPointerMove,
183
171
  dynamicWidgetPointerUp: p.onPointerUp,
@@ -187,65 +175,65 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
187
175
  },
188
176
  { immediate: !0 }
189
177
  );
190
- const f = $(() => b.value ? W(b.value) : {}), _ = J(), d = $(() => {
191
- if (!u.value) return { display: "none" };
192
- if (!u.value?.isDynamicActive) return { visibility: "hidden", opacity: 0 };
193
- let p, E;
194
- const x = u?.value?.dynamicPosition;
195
- if (_)
196
- p = `${x.x}cqw`, E = `${x.y}cqh`;
178
+ const C = $(() => _.value ? q(_.value) : {}), k = Q(), v = $(() => {
179
+ if (!l.value) return { display: "none" };
180
+ if (!l.value?.isDynamicActive) return { visibility: "hidden", opacity: 0 };
181
+ let p, A;
182
+ const S = l?.value?.dynamicPosition;
183
+ if (k)
184
+ p = `${S.x}cqw`, A = `${S.y}cqh`;
197
185
  else {
198
- const K = i?.value?.rect;
199
- p = `${G(x?.x || 0, 0, 100, 0, K?.width || 0)}px`, E = `${G(x?.y || 0, 0, 100, 0, K?.height || 0)}px`;
186
+ const W = i?.value?.rect;
187
+ p = `${G(S?.x || 0, 0, 100, 0, W?.width || 0)}px`, A = `${G(S?.y || 0, 0, 100, 0, W?.height || 0)}px`;
200
188
  }
201
189
  return {
202
190
  zIndex: 100,
203
191
  "--dynamic-widget-mount-x": p,
204
- "--dynamic-widget-mount-y": E,
192
+ "--dynamic-widget-mount-y": A,
205
193
  visibility: "visible",
206
194
  opacity: 1,
207
195
  pointerEvents: "auto"
208
196
  };
209
- }), r = (p) => a.value?.onPointerDown(p), B = (p) => a.value?.onPointerMove(p), y = (p) => a.value?.onPointerUp(p), oe = (p) => a.value?.onPointerCancel(p);
210
- return (p, E) => (k(), A("div", {
211
- id: t(n),
197
+ }), c = (p) => a?.onPointerDown?.(p), L = (p) => a?.onPointerMove?.(p), g = (p) => a?.onPointerUp?.(p), oe = (p) => a?.onPointerCancel?.(p);
198
+ return (p, A) => (w(), E("div", {
199
+ id: o(t),
212
200
  ref_key: "elementRef",
213
- ref: C,
214
- class: D(["omnipad-input-zone omnipad-prevent", t(m)?.cssClasses]),
215
- style: V(f.value)
201
+ ref: R,
202
+ class: D(["omnipad-input-zone omnipad-prevent", o(f)?.cssClasses]),
203
+ style: O(C.value)
216
204
  }, [
217
- H(ce, { nodes: R.value }, {
205
+ H(ve, { nodes: u.value }, {
218
206
  default: N(() => [
219
- P(p.$slots, "default", {}, void 0, !0)
207
+ h(p.$slots, "default", {}, void 0, !0)
220
208
  ]),
221
209
  _: 3
222
210
  }, 8, ["nodes"]),
223
- h.value.nodeToRender || t(i)?.isInterceptorRequired ? (k(), A("div", {
211
+ m.value.nodeToRender || o(i)?.isInterceptorRequired ? (w(), E("div", {
224
212
  key: 0,
225
213
  class: "omnipad-input-zone-trigger omnipad-prevent",
226
- onPointerdown: r,
227
- onPointermove: B,
228
- onPointerup: y,
214
+ onPointerdown: c,
215
+ onPointermove: L,
216
+ onPointerup: g,
229
217
  onPointercancel: oe,
230
218
  onLostpointercapture: oe
231
219
  }, [
232
- I("div", {
220
+ T("div", {
233
221
  class: "dynamic-widget-mount",
234
- style: V(d.value)
222
+ style: O(v.value)
235
223
  }, [
236
- h.value.isFromSlot ? (k(), j(ee(h.value.nodeToRender), {
224
+ m.value.isFromSlot ? (w(), Z(ee(m.value.nodeToRender), {
237
225
  key: 0,
238
- ref: (x) => s.value = x
239
- }, null, 512)) : h.value.nodeToRender ? (k(), j(ee(c.value), {
226
+ ref: (S) => s.value = S
227
+ }, null, 512)) : m.value.nodeToRender ? (w(), Z(ee(P.value), {
240
228
  key: 1,
241
- ref: (x) => s.value = x,
242
- "tree-node": h.value.nodeToRender
243
- }, null, 8, ["tree-node"])) : Z("", !0)
229
+ ref: (S) => s.value = S,
230
+ "tree-node": m.value.nodeToRender
231
+ }, null, 8, ["tree-node"])) : Y("", !0)
244
232
  ], 4)
245
- ], 32)) : Z("", !0)
246
- ], 14, Me));
233
+ ], 32)) : Y("", !0)
234
+ ], 14, ze));
247
235
  }
248
- }), je = /* @__PURE__ */ M(Ze, [["__scopeId", "data-v-7dde40d2"]]), Fe = ["id"], ze = /* @__PURE__ */ O({
236
+ }), je = /* @__PURE__ */ V(We, [["__scopeId", "data-v-8b58e8ce"]]), qe = ["id"], Qe = /* @__PURE__ */ B({
249
237
  __name: "RootLayer",
250
238
  props: {
251
239
  treeNode: {},
@@ -253,34 +241,34 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
253
241
  layout: {}
254
242
  },
255
243
  setup(e) {
256
- const o = e, { uid: v, initialConfig: s, reactiveConfig: n } = Y(
257
- T.ROOT_LAYER,
258
- o
259
- ), { effectiveConfig: l, effectiveLayout: g, elementRef: i } = z(
260
- () => new fe(v.value, s.value, o.treeNode?.type),
244
+ const n = e, { uid: d, initialConfig: s, reactiveConfig: t } = z(
245
+ I.ROOT_LAYER,
261
246
  n
262
- ), u = $(() => g.value ? W(g.value) : {});
263
- return (a, m) => (k(), A("div", {
264
- id: t(v),
247
+ ), { effectiveConfig: r, effectiveLayout: b, elementRef: i } = K(
248
+ () => new ge(d, s, n.treeNode?.type),
249
+ t
250
+ ), l = $(() => b.value ? q(b.value) : {});
251
+ return (a, f) => (w(), E("div", {
252
+ id: o(d),
265
253
  ref_key: "elementRef",
266
254
  ref: i,
267
- class: D(["omnipad-root-layer omnipad-prevent", t(l)?.cssClasses]),
268
- style: V(u.value)
255
+ class: D(["omnipad-root-layer omnipad-prevent", o(r)?.cssClasses]),
256
+ style: O(l.value)
269
257
  }, [
270
- H(ce, {
258
+ H(ve, {
271
259
  nodes: e.treeNode?.children || []
272
260
  }, {
273
261
  default: N(() => [
274
- P(a.$slots, "default", {}, void 0, !0)
262
+ h(a.$slots, "default", {}, void 0, !0)
275
263
  ]),
276
264
  _: 3
277
265
  }, 8, ["nodes"])
278
- ], 14, Fe));
266
+ ], 14, qe));
279
267
  }
280
- }), Ye = /* @__PURE__ */ M(ze, [["__scopeId", "data-v-18e8b5d5"]]), Ke = ["id"], qe = {
268
+ }), Je = /* @__PURE__ */ V(Qe, [["__scopeId", "data-v-2e1f7fa1"]]), Ge = ["id"], He = {
281
269
  key: 0,
282
270
  class: "omnipad-default-focus-border-feedback"
283
- }, Qe = /* @__PURE__ */ O({
271
+ }, Xe = /* @__PURE__ */ B({
284
272
  __name: "TargetZone",
285
273
  props: {
286
274
  treeNode: {},
@@ -290,101 +278,101 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
290
278
  layout: {}
291
279
  },
292
280
  setup(e) {
293
- const o = e, v = {
281
+ const n = e, d = {
294
282
  cursorAutoDelay: 2500
295
- }, { uid: s, initialConfig: n, reactiveConfig: l } = Y(
296
- T.TARGET_ZONE,
297
- o,
298
- v
299
- ), { core: g, state: i, domEvents: u, effectiveConfig: a, effectiveLayout: m, elementRef: b } = z(
300
- () => new pe(s.value, n.value, o.treeNode?.type),
301
- l,
283
+ }, { uid: s, initialConfig: t, reactiveConfig: r } = z(
284
+ I.TARGET_ZONE,
285
+ n,
286
+ d
287
+ ), { core: b, state: i, domEvents: l, effectiveConfig: a, effectiveLayout: f, elementRef: _ } = K(
288
+ () => new Pe(s, t, n.treeNode?.type),
289
+ r,
302
290
  {},
303
291
  {
304
- dispatchKeyboardEvent: Be,
305
- dispatchPointerEventAtPos: Oe,
306
- reclaimFocusAtPos: Ue
292
+ dispatchKeyboardEvent: ce,
293
+ dispatchPointerEventAtPos: Ie,
294
+ reclaimFocusAtPos: Ne
307
295
  }
308
- ), C = $(() => m.value ? W(m.value) : {}), w = J(), R = $(() => {
296
+ ), R = $(() => f.value ? q(f.value) : {}), y = Q(), u = $(() => {
309
297
  if (!i.value) return { display: "none" };
310
- let d, r;
311
- const B = i?.value?.position;
312
- if (w)
313
- d = `${B.x}cqw`, r = `${B.y}cqh`;
298
+ let v, c;
299
+ const L = i?.value?.position;
300
+ if (y)
301
+ v = `${L.x}cqw`, c = `${L.y}cqh`;
314
302
  else {
315
- const y = g?.value?.rect;
316
- d = `${G(B?.x || 0, 0, 100, 0, y?.width || 0)}px`, r = `${G(B?.y || 0, 0, 100, 0, y?.height || 0)}px`;
303
+ const g = b?.value?.rect;
304
+ v = `${G(L?.x || 0, 0, 100, 0, g?.width || 0)}px`, c = `${G(L?.y || 0, 0, 100, 0, g?.height || 0)}px`;
317
305
  }
318
306
  return {
319
- "--omnipad-virtual-cursor-x": d,
320
- "--omnipad-virtual-cursor-y": r,
307
+ "--omnipad-virtual-cursor-x": v,
308
+ "--omnipad-virtual-cursor-y": c,
321
309
  opacity: i.value.isVisible ? 1 : 0
322
310
  };
323
- }), h = (d) => u.value?.onPointerDown(d), c = (d) => u.value?.onPointerMove(d), f = (d) => u.value?.onPointerUp(d), _ = (d) => u.value?.onPointerCancel(d);
324
- return (d, r) => (k(), A("div", {
325
- id: t(s),
311
+ }), m = (v) => l?.onPointerDown?.(v), P = (v) => l?.onPointerMove?.(v), C = (v) => l?.onPointerUp?.(v), k = (v) => l?.onPointerCancel?.(v);
312
+ return (v, c) => (w(), E("div", {
313
+ id: o(s),
326
314
  ref_key: "elementRef",
327
- ref: b,
328
- class: D(["omnipad-target-zone omnipad-prevent", t(a)?.cssClasses]),
329
- style: V(C.value),
330
- onPointerdown: h,
331
- onPointermove: c,
332
- onPointerup: f,
333
- onPointercancel: _,
334
- onLostpointercapture: _
315
+ ref: _,
316
+ class: D(["omnipad-target-zone omnipad-prevent", o(a)?.cssClasses]),
317
+ style: O(R.value),
318
+ onPointerdown: m,
319
+ onPointermove: P,
320
+ onPointerup: C,
321
+ onPointercancel: k,
322
+ onLostpointercapture: k
335
323
  }, [
336
- P(d.$slots, "focus-feedback", {
337
- state: t(i),
338
- isReturning: t(i)?.isFocusReturning,
339
- cursorPos: t(i)?.position
324
+ h(v.$slots, "focus-feedback", {
325
+ state: o(i),
326
+ isReturning: o(i)?.isFocusReturning,
327
+ cursorPos: o(i)?.position
340
328
  }, () => [
341
- H(Te, { name: "omnipad-default-focus-fade" }, {
329
+ H(Me, { name: "omnipad-default-focus-fade" }, {
342
330
  default: N(() => [
343
- t(i)?.isFocusReturning ? (k(), A("div", qe)) : Z("", !0)
331
+ o(i)?.isFocusReturning ? (w(), E("div", He)) : Y("", !0)
344
332
  ]),
345
333
  _: 1
346
334
  })
347
335
  ], !0),
348
- t(a)?.cursorEnabled ? (k(), A("div", {
336
+ o(a)?.cursorEnabled ? (w(), E("div", {
349
337
  key: 0,
350
338
  class: "omnipad-virtual-cursor",
351
- style: V(R.value)
339
+ style: O(u.value)
352
340
  }, [
353
- P(d.$slots, "cursor", {
354
- state: t(i),
355
- isDown: t(i)?.isPointerDown,
356
- isReturning: t(i)?.isFocusReturning,
357
- cursorPos: t(i)?.position
341
+ h(v.$slots, "cursor", {
342
+ state: o(i),
343
+ isDown: o(i)?.isPointerDown,
344
+ isReturning: o(i)?.isFocusReturning,
345
+ cursorPos: o(i)?.position
358
346
  }, () => [
359
- I("div", {
360
- class: D(["omnipad-default-cursor-dot", { "is-down": t(i)?.isPointerDown }])
347
+ T("div", {
348
+ class: D(["omnipad-default-cursor-dot", { "is-down": o(i)?.isPointerDown }])
361
349
  }, null, 2)
362
350
  ], !0)
363
- ], 4)) : Z("", !0),
364
- t(a)?.cursorEnabled ? (k(), A("div", {
351
+ ], 4)) : Y("", !0),
352
+ o(a)?.cursorEnabled ? (w(), E("div", {
365
353
  key: 1,
366
354
  class: "omnipad-virtual-cursor",
367
- style: V(R.value)
355
+ style: O(u.value)
368
356
  }, [
369
- P(d.$slots, "with-cursor", {
370
- state: t(i),
371
- isDown: t(i)?.isPointerDown,
372
- isReturning: t(i)?.isFocusReturning,
373
- cursorPos: t(i)?.position
357
+ h(v.$slots, "with-cursor", {
358
+ state: o(i),
359
+ isDown: o(i)?.isPointerDown,
360
+ isReturning: o(i)?.isFocusReturning,
361
+ cursorPos: o(i)?.position
374
362
  }, void 0, !0)
375
- ], 4)) : Z("", !0),
376
- P(d.$slots, "default", {
377
- state: t(i),
378
- isDown: t(i)?.isPointerDown,
379
- isReturning: t(i)?.isFocusReturning,
380
- cursorPos: t(i)?.position
363
+ ], 4)) : Y("", !0),
364
+ h(v.$slots, "default", {
365
+ state: o(i),
366
+ isDown: o(i)?.isPointerDown,
367
+ isReturning: o(i)?.isFocusReturning,
368
+ cursorPos: o(i)?.position
381
369
  }, void 0, !0)
382
- ], 46, Ke));
370
+ ], 46, Ge));
383
371
  }
384
- }), We = /* @__PURE__ */ M(Qe, [["__scopeId", "data-v-f6f0fd4c"]]), Je = { class: "omnipad-button-content-layer" }, Xe = {
372
+ }), et = /* @__PURE__ */ V(Xe, [["__scopeId", "data-v-ef213f3f"]]), tt = { class: "omnipad-button-content-layer" }, ot = {
385
373
  key: 0,
386
374
  class: "omnipad-default-button-label"
387
- }, Ge = /* @__PURE__ */ O({
375
+ }, nt = /* @__PURE__ */ B({
388
376
  __name: "VirtualButtonBase",
389
377
  props: {
390
378
  layout: {},
@@ -392,31 +380,31 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
392
380
  label: {}
393
381
  },
394
382
  setup(e) {
395
- const o = e, v = $(() => o.layout ? W(o.layout) : {});
396
- return (s, n) => (k(), A("div", {
383
+ const n = e, d = $(() => n.layout ? q(n.layout) : {});
384
+ return (s, t) => (w(), E("div", {
397
385
  class: "omnipad-button-base omnipad-prevent",
398
- style: V(v.value),
386
+ style: O(d.value),
399
387
  tabindex: "-1"
400
388
  }, [
401
- P(s.$slots, "base", {
389
+ h(s.$slots, "base", {
402
390
  isActive: e.isActive,
403
391
  label: e.label
404
392
  }, () => [
405
- I("div", {
393
+ T("div", {
406
394
  class: D(["omnipad-default-button-base", { "is-active": e.isActive }])
407
395
  }, null, 2)
408
396
  ], !0),
409
- I("div", Je, [
410
- P(s.$slots, "default", {
397
+ T("div", tt, [
398
+ h(s.$slots, "default", {
411
399
  isActive: e.isActive,
412
400
  label: e.label
413
401
  }, () => [
414
- e.label ? (k(), A("span", Xe, Ie(e.label), 1)) : Z("", !0)
402
+ e.label ? (w(), E("span", ot, Ye(e.label), 1)) : Y("", !0)
415
403
  ], !0)
416
404
  ])
417
405
  ], 4));
418
406
  }
419
- }), te = /* @__PURE__ */ M(Ge, [["__scopeId", "data-v-f6a6e082"]]), He = /* @__PURE__ */ O({
407
+ }), te = /* @__PURE__ */ V(nt, [["__scopeId", "data-v-f6a6e082"]]), it = /* @__PURE__ */ B({
420
408
  __name: "VirtualButton",
421
409
  props: {
422
410
  treeNode: {},
@@ -426,44 +414,44 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
426
414
  mapping: {},
427
415
  layout: {}
428
416
  },
429
- setup(e, { expose: o }) {
430
- const v = e, s = {
417
+ setup(e, { expose: n }) {
418
+ const d = e, s = {
431
419
  label: "BTN"
432
- }, { uid: n, initialConfig: l, reactiveConfig: g } = Y(
433
- T.BUTTON,
434
- v,
420
+ }, { uid: t, initialConfig: r, reactiveConfig: b } = z(
421
+ I.BUTTON,
422
+ d,
435
423
  s
436
- ), { core: i, state: u, domEvents: a, effectiveConfig: m, effectiveLayout: b, elementRef: C } = z(() => new me(n.value, l.value, v.treeNode?.type), g), w = (f) => a.value?.onPointerDown(f), R = (f) => a.value?.onPointerMove(f), h = (f) => a.value?.onPointerUp(f), c = (f) => a.value?.onPointerCancel(f);
437
- return o({
438
- uid: n,
439
- onPointerDown: w,
440
- onPointerMove: R,
441
- onPointerUp: h,
442
- onPointerCancel: c,
424
+ ), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R } = K(() => new be(t, r, d.treeNode?.type), b), y = (C) => a?.onPointerDown?.(C), u = (C) => a?.onPointerMove?.(C), m = (C) => a?.onPointerUp?.(C), P = (C) => a?.onPointerCancel?.(C);
425
+ return n({
426
+ uid: t,
427
+ onPointerDown: y,
428
+ onPointerMove: u,
429
+ onPointerUp: m,
430
+ onPointerCancel: P,
443
431
  markRectDirty: () => i.value?.markRectDirty
444
- }), (f, _) => (k(), j(te, {
445
- id: t(n),
432
+ }), (C, k) => (w(), Z(te, {
433
+ id: o(t),
446
434
  ref_key: "elementRef",
447
- ref: C,
448
- class: D(["omnipad-button omnipad-prevent", t(m)?.cssClasses]),
449
- layout: t(b),
450
- label: t(m)?.label,
451
- "is-active": t(u)?.isPressed,
452
- onPointerdown: w,
453
- onPointerup: h,
454
- onPointercancel: c,
455
- onLostpointercapture: c
435
+ ref: R,
436
+ class: D(["omnipad-button omnipad-prevent", o(f)?.cssClasses]),
437
+ layout: o(_),
438
+ label: o(f)?.label,
439
+ "is-active": o(l)?.isPressed,
440
+ onPointerdown: y,
441
+ onPointerup: m,
442
+ onPointercancel: P,
443
+ onLostpointercapture: P
456
444
  }, {
457
- base: N((d) => [
458
- P(f.$slots, "base", S(U(d)))
445
+ base: N((v) => [
446
+ h(C.$slots, "base", x(U(v)))
459
447
  ]),
460
- default: N((d) => [
461
- P(f.$slots, "default", S(U(d)))
448
+ default: N((v) => [
449
+ h(C.$slots, "default", x(U(v)))
462
450
  ]),
463
451
  _: 3
464
452
  }, 8, ["id", "class", "layout", "label", "is-active"]));
465
453
  }
466
- }), et = { class: "omnipad-axis-bg" }, tt = { class: "omnipad-axis-content-layer" }, ot = /* @__PURE__ */ O({
454
+ }), st = { class: "omnipad-axis-bg" }, at = { class: "omnipad-axis-content-layer" }, rt = /* @__PURE__ */ B({
467
455
  __name: "VirtualAxisBase",
468
456
  props: {
469
457
  layout: {},
@@ -473,51 +461,51 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
473
461
  baseRadius: {}
474
462
  },
475
463
  setup(e) {
476
- const o = e, v = $(() => o.layout ? W(o.layout) : {}), s = J(), n = $(() => {
477
- const l = o.vector?.x || 0, g = o.vector?.y || 0, i = o.baseRadius?.x || 0, u = o.baseRadius?.y || 0, a = s ? `${l * 50}cqw` : `${l * i}px`, m = s ? `${g * 50}cqh` : `${g * u}px`, b = s ? "100cqw" : `${i * 2}px`, C = s ? "100cqh" : `${u * 2}px`;
464
+ const n = e, d = $(() => n.layout ? q(n.layout) : {}), s = Q(), t = $(() => {
465
+ const r = n.vector?.x || 0, b = n.vector?.y || 0, i = n.baseRadius?.x || 0, l = n.baseRadius?.y || 0, a = s ? `${r * 50}cqw` : `${r * i}px`, f = s ? `${b * 50}cqh` : `${b * l}px`, _ = s ? "100cqw" : `${i * 2}px`, R = s ? "100cqh" : `${l * 2}px`;
478
466
  return {
479
467
  "--omnipad-axis-stick-container-x": a,
480
- "--omnipad-axis-stick-container-y": m,
481
- "--omnipad-axis-stick-width": b,
482
- "--omnipad-axis-stick-height": C,
468
+ "--omnipad-axis-stick-container-y": f,
469
+ "--omnipad-axis-stick-width": _,
470
+ "--omnipad-axis-stick-height": R,
483
471
  // 松手时加一点回弹过渡,活动时取消过渡保证绝对跟手
484
- transition: o.isActive ? "none" : "transform 0.1s ease-out"
472
+ transition: n.isActive ? "none" : "transform 0.1s ease-out"
485
473
  };
486
474
  });
487
- return (l, g) => (k(), A("div", {
475
+ return (r, b) => (w(), E("div", {
488
476
  class: D(["omnipad-axis-base omnipad-prevent", { "is-active": e.isActive }]),
489
- style: V(v.value),
477
+ style: O(d.value),
490
478
  tabindex: "-1"
491
479
  }, [
492
- I("div", et, [
493
- P(l.$slots, "base", {
480
+ T("div", st, [
481
+ h(r.$slots, "base", {
494
482
  isActive: e.isActive,
495
483
  vector: e.vector
496
484
  }, void 0, !0)
497
485
  ]),
498
- e.showStick ? (k(), A("div", {
486
+ e.showStick ? (w(), E("div", {
499
487
  key: 0,
500
488
  class: "omnipad-axis-stick-container",
501
- style: V(n.value)
489
+ style: O(t.value)
502
490
  }, [
503
- P(l.$slots, "stick", {
491
+ h(r.$slots, "stick", {
504
492
  isActive: e.isActive,
505
493
  vector: e.vector
506
494
  }, () => [
507
- I("div", {
495
+ T("div", {
508
496
  class: D(["omnipad-default-axis-stick", { "is-active": e.isActive }])
509
497
  }, null, 2)
510
498
  ], !0)
511
- ], 4)) : Z("", !0),
512
- I("div", tt, [
513
- P(l.$slots, "default", {
499
+ ], 4)) : Y("", !0),
500
+ T("div", at, [
501
+ h(r.$slots, "default", {
514
502
  isActive: e.isActive,
515
503
  vector: e.vector
516
504
  }, void 0, !0)
517
505
  ])
518
506
  ], 6));
519
507
  }
520
- }), le = /* @__PURE__ */ M(ot, [["__scopeId", "data-v-95bb429e"]]), nt = { class: "omnipad-dpad-cross-bg" }, it = /* @__PURE__ */ O({
508
+ }), fe = /* @__PURE__ */ V(rt, [["__scopeId", "data-v-95bb429e"]]), ct = { class: "omnipad-dpad-cross-bg" }, lt = /* @__PURE__ */ B({
521
509
  __name: "VirtualDPad",
522
510
  props: {
523
511
  treeNode: {},
@@ -528,71 +516,71 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
528
516
  showStick: {},
529
517
  layout: {}
530
518
  },
531
- setup(e, { expose: o }) {
532
- const v = e, s = {
519
+ setup(e, { expose: n }) {
520
+ const d = e, s = {
533
521
  showStick: !1,
534
522
  threshold: 0.3
535
- }, { uid: n, initialConfig: l, reactiveConfig: g } = Y(
536
- T.D_PAD,
537
- v,
523
+ }, { uid: t, initialConfig: r, reactiveConfig: b } = z(
524
+ I.D_PAD,
525
+ d,
538
526
  s
539
- ), { core: i, state: u, domEvents: a, effectiveConfig: m, effectiveLayout: b, elementRef: C } = z(() => new ye(n.value, l.value, v.treeNode?.type), g), w = J(), R = L({ x: 0, y: 0 }), h = ae(() => {
540
- const r = i.value?.rect;
541
- r && (R.value = { x: r.width / 2, y: r.height / 2 });
527
+ ), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R } = K(() => new he(t, r, d.treeNode?.type), b), y = Q(), u = M({ x: 0, y: 0 }), m = de(() => {
528
+ const c = i.value?.rect;
529
+ c && (u.value = { x: c.width / 2, y: c.height / 2 });
542
530
  });
543
- w && h();
544
- const c = (r) => a.value?.onPointerDown(r), f = (r) => a.value?.onPointerMove(r), _ = (r) => a.value?.onPointerUp(r), d = (r) => a.value?.onPointerCancel(r);
545
- return o({
546
- uid: n,
547
- onPointerDown: c,
548
- onPointerMove: f,
549
- onPointerUp: _,
550
- onPointerCancel: d,
531
+ y && m();
532
+ const P = (c) => a?.onPointerDown?.(c), C = (c) => a?.onPointerMove?.(c), k = (c) => a?.onPointerUp?.(c), v = (c) => a?.onPointerCancel?.(c);
533
+ return n({
534
+ uid: t,
535
+ onPointerDown: P,
536
+ onPointerMove: C,
537
+ onPointerUp: k,
538
+ onPointerCancel: v,
551
539
  markRectDirty: () => i.value?.markRectDirty()
552
- }), (r, B) => (k(), j(le, {
540
+ }), (c, L) => (w(), Z(fe, {
553
541
  ref_key: "elementRef",
554
- ref: C,
555
- class: D(["omnipad-dpad omnipad-prevent", t(m)?.cssClasses]),
556
- layout: t(b),
557
- "is-active": t(u)?.isActive,
558
- vector: t(u)?.vector,
559
- "show-stick": t(m)?.showStick,
560
- "base-radius": R.value,
561
- onPointerdown: c,
562
- onPointermove: f,
563
- onPointerup: _,
564
- onPointercancel: d,
565
- onLostpointercapture: d
542
+ ref: R,
543
+ class: D(["omnipad-dpad omnipad-prevent", o(f)?.cssClasses]),
544
+ layout: o(_),
545
+ "is-active": o(l)?.isActive,
546
+ vector: o(l)?.vector,
547
+ "show-stick": o(f)?.showStick,
548
+ "base-radius": u.value,
549
+ onPointerdown: P,
550
+ onPointermove: C,
551
+ onPointerup: k,
552
+ onPointercancel: v,
553
+ onLostpointercapture: v
566
554
  }, {
567
- base: N((y) => [
568
- P(r.$slots, "base", S(U(y)), () => [
569
- I("div", nt, [
570
- I("div", {
571
- class: D(["dpad-arm top", { on: y.vector && y.vector.y < -t(m)?.threshold }])
555
+ base: N((g) => [
556
+ h(c.$slots, "base", x(U(g)), () => [
557
+ T("div", ct, [
558
+ T("div", {
559
+ class: D(["dpad-arm top", { on: g.vector && g.vector.y < -o(f)?.threshold }])
572
560
  }, null, 2),
573
- I("div", {
574
- class: D(["dpad-arm bottom", { on: y.vector && y.vector.y > t(m)?.threshold }])
561
+ T("div", {
562
+ class: D(["dpad-arm bottom", { on: g.vector && g.vector.y > o(f)?.threshold }])
575
563
  }, null, 2),
576
- I("div", {
577
- class: D(["dpad-arm left", { on: y.vector && y.vector.x < -t(m)?.threshold }])
564
+ T("div", {
565
+ class: D(["dpad-arm left", { on: g.vector && g.vector.x < -o(f)?.threshold }])
578
566
  }, null, 2),
579
- I("div", {
580
- class: D(["dpad-arm right", { on: y.vector && y.vector.x > t(m)?.threshold }])
567
+ T("div", {
568
+ class: D(["dpad-arm right", { on: g.vector && g.vector.x > o(f)?.threshold }])
581
569
  }, null, 2),
582
- B[0] || (B[0] = I("div", { class: "dpad-center" }, null, -1))
570
+ L[0] || (L[0] = T("div", { class: "dpad-center" }, null, -1))
583
571
  ])
584
572
  ], !0)
585
573
  ]),
586
- stick: N((y) => [
587
- P(r.$slots, "stick", S(U(y)), void 0, !0)
574
+ stick: N((g) => [
575
+ h(c.$slots, "stick", x(U(g)), void 0, !0)
588
576
  ]),
589
- default: N((y) => [
590
- P(r.$slots, "default", S(U(y)), void 0, !0)
577
+ default: N((g) => [
578
+ h(c.$slots, "default", x(U(g)), void 0, !0)
591
579
  ]),
592
580
  _: 3
593
581
  }, 8, ["class", "layout", "is-active", "vector", "show-stick", "base-radius"]));
594
582
  }
595
- }), st = /* @__PURE__ */ M(it, [["__scopeId", "data-v-248b6118"]]), at = /* @__PURE__ */ O({
583
+ }), dt = /* @__PURE__ */ V(lt, [["__scopeId", "data-v-1bf11a90"]]), ut = /* @__PURE__ */ B({
596
584
  __name: "VirtualTrackpad",
597
585
  props: {
598
586
  treeNode: {},
@@ -603,46 +591,46 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
603
591
  mapping: {},
604
592
  layout: {}
605
593
  },
606
- setup(e, { expose: o }) {
607
- const v = e, { uid: s, initialConfig: n, reactiveConfig: l } = Y(
608
- T.TRACKPAD,
609
- v,
594
+ setup(e, { expose: n }) {
595
+ const d = e, { uid: s, initialConfig: t, reactiveConfig: r } = z(
596
+ I.TRACKPAD,
597
+ d,
610
598
  {
611
599
  label: "TRACKPAD",
612
600
  sensitivity: 1
613
601
  }
614
- ), { core: g, state: i, domEvents: u, effectiveConfig: a, effectiveLayout: m, elementRef: b } = z(() => new ge(s.value, n.value, v.treeNode?.type), l), C = (c) => u.value?.onPointerDown(c), w = (c) => u.value?.onPointerMove(c), R = (c) => u.value?.onPointerUp(c), h = (c) => u.value?.onPointerCancel(c);
615
- return o({
602
+ ), { core: b, state: i, domEvents: l, effectiveConfig: a, effectiveLayout: f, elementRef: _ } = K(() => new Ce(s, t, d.treeNode?.type), r), R = (P) => l?.onPointerDown?.(P), y = (P) => l?.onPointerMove?.(P), u = (P) => l?.onPointerUp?.(P), m = (P) => l?.onPointerCancel?.(P);
603
+ return n({
616
604
  uid: s,
617
- onPointerDown: C,
618
- onPointerMove: w,
619
- onPointerUp: R,
620
- onPointerCancel: h,
621
- markRectDirty: () => g.value?.markRectDirty
622
- }), (c, f) => (k(), j(te, {
623
- id: t(s),
605
+ onPointerDown: R,
606
+ onPointerMove: y,
607
+ onPointerUp: u,
608
+ onPointerCancel: m,
609
+ markRectDirty: () => b.value?.markRectDirty
610
+ }), (P, C) => (w(), Z(te, {
611
+ id: o(s),
624
612
  ref_key: "elementRef",
625
- ref: b,
626
- class: D(["omnipad-trackpad omnipad-prevent", t(a)?.cssClasses]),
627
- layout: t(m),
628
- label: t(a)?.label,
629
- "is-active": t(i)?.isPressed,
630
- onPointerdown: C,
631
- onPointermove: w,
632
- onPointerup: R,
633
- onPointercancel: h,
634
- onLostpointercapture: h
613
+ ref: _,
614
+ class: D(["omnipad-trackpad omnipad-prevent", o(a)?.cssClasses]),
615
+ layout: o(f),
616
+ label: o(a)?.label,
617
+ "is-active": o(i)?.isPressed,
618
+ onPointerdown: R,
619
+ onPointermove: y,
620
+ onPointerup: u,
621
+ onPointercancel: m,
622
+ onLostpointercapture: m
635
623
  }, {
636
- base: N((_) => [
637
- P(c.$slots, "base", S(U(_)), void 0, !0)
624
+ base: N((k) => [
625
+ h(P.$slots, "base", x(U(k)), void 0, !0)
638
626
  ]),
639
- default: N((_) => [
640
- P(c.$slots, "default", S(U(_)), void 0, !0)
627
+ default: N((k) => [
628
+ h(P.$slots, "default", x(U(k)), void 0, !0)
641
629
  ]),
642
630
  _: 3
643
631
  }, 8, ["id", "class", "layout", "label", "is-active"]));
644
632
  }
645
- }), rt = /* @__PURE__ */ M(at, [["__scopeId", "data-v-6b706af3"]]), ct = /* @__PURE__ */ O({
633
+ }), vt = /* @__PURE__ */ V(ut, [["__scopeId", "data-v-e9f8b8d7"]]), ft = /* @__PURE__ */ B({
646
634
  __name: "VirtualJoystick",
647
635
  props: {
648
636
  treeNode: {},
@@ -655,86 +643,89 @@ const Me = ["id"], Ze = /* @__PURE__ */ O({
655
643
  mapping: {},
656
644
  layout: {}
657
645
  },
658
- setup(e, { expose: o }) {
659
- const v = e, s = {
646
+ setup(e, { expose: n }) {
647
+ const d = e, s = {
660
648
  label: "PUSH",
661
649
  threshold: 0.2,
662
650
  cursorMode: !1,
663
651
  cursorSensitivity: 1
664
- }, { uid: n, initialConfig: l, reactiveConfig: g } = Y(
665
- T.JOYSTICK,
666
- v,
652
+ }, { uid: t, initialConfig: r, reactiveConfig: b } = z(
653
+ I.JOYSTICK,
654
+ d,
667
655
  s
668
- ), { core: i, state: u, domEvents: a, effectiveConfig: m, effectiveLayout: b, elementRef: C } = z(() => new Pe(n.value, l.value, v.treeNode?.type), g), w = J(), R = L({ x: 0, y: 0 }), h = ae(() => {
669
- const r = i.value?.rect;
670
- r && (R.value = { x: r.width / 2, y: r.height / 2 });
656
+ ), { core: i, state: l, domEvents: a, effectiveConfig: f, effectiveLayout: _, elementRef: R } = K(() => new _e(t, r, d.treeNode?.type), b), y = Q(), u = M({ x: 0, y: 0 }), m = de(() => {
657
+ const c = i.value?.rect;
658
+ c && (u.value = { x: c.width / 2, y: c.height / 2 });
671
659
  });
672
- w && h();
673
- const c = (r) => a.value?.onPointerDown(r), f = (r) => a.value?.onPointerMove(r), _ = (r) => a.value?.onPointerUp(r), d = (r) => a.value?.onPointerCancel(r);
674
- return o({
675
- uid: n,
676
- onPointerDown: c,
677
- onPointerMove: f,
678
- onPointerUp: _,
679
- onPointerCancel: d,
660
+ y && m();
661
+ const P = (c) => a?.onPointerDown?.(c), C = (c) => a?.onPointerMove?.(c), k = (c) => a?.onPointerUp?.(c), v = (c) => a?.onPointerCancel?.(c);
662
+ return n({
663
+ uid: t,
664
+ onPointerDown: P,
665
+ onPointerMove: C,
666
+ onPointerUp: k,
667
+ onPointerCancel: v,
680
668
  markRectDirty: () => i.value?.markRectDirty
681
- }), (r, B) => (k(), j(le, {
669
+ }), (c, L) => (w(), Z(fe, {
682
670
  ref_key: "elementRef",
683
- ref: C,
684
- class: D(["omnipad-joystick omnipad-prevent", t(m)?.cssClasses]),
685
- layout: t(b),
686
- "is-active": t(u)?.isActive,
687
- vector: t(u)?.vector,
671
+ ref: R,
672
+ class: D(["omnipad-joystick omnipad-prevent", o(f)?.cssClasses]),
673
+ layout: o(_),
674
+ "is-active": o(l)?.isActive,
675
+ vector: o(l)?.vector,
688
676
  "show-stick": "",
689
- "base-radius": R.value,
690
- onPointerdown: c,
691
- onPointermove: f,
692
- onPointerup: _,
693
- onPointercancel: d,
694
- onLostpointercapture: d
677
+ "base-radius": u.value,
678
+ onPointerdown: P,
679
+ onPointermove: C,
680
+ onPointerup: k,
681
+ onPointercancel: v,
682
+ onLostpointercapture: v
695
683
  }, {
696
- base: N((y) => [
697
- P(r.$slots, "base", S(U(y)), void 0, !0)
684
+ base: N((g) => [
685
+ h(c.$slots, "base", x(U(g)), void 0, !0)
698
686
  ]),
699
687
  stick: N(() => [
700
688
  H(te, {
701
689
  layout: { height: "100%", width: "100%" },
702
- "is-active": t(u)?.isPressed,
703
- label: t(m)?.label
690
+ "is-active": o(l)?.isPressed,
691
+ label: o(f)?.label
704
692
  }, {
705
- base: N((y) => [
706
- P(r.$slots, "stick-base", S(U(y)), void 0, !0)
693
+ base: N((g) => [
694
+ h(c.$slots, "stick-base", x(U(g)), void 0, !0)
707
695
  ]),
708
- default: N((y) => [
709
- P(r.$slots, "stick", S(U(y)), void 0, !0)
696
+ default: N((g) => [
697
+ h(c.$slots, "stick", x(U(g)), void 0, !0)
710
698
  ]),
711
699
  _: 3
712
700
  }, 8, ["is-active", "label"])
713
701
  ]),
714
- default: N((y) => [
715
- P(r.$slots, "default", S(U(y)), void 0, !0)
702
+ default: N((g) => [
703
+ h(c.$slots, "default", x(U(g)), void 0, !0)
716
704
  ]),
717
705
  _: 3
718
706
  }, 8, ["class", "layout", "is-active", "vector", "base-radius"]));
719
707
  }
720
- }), lt = /* @__PURE__ */ M(ct, [["__scopeId", "data-v-b10666e4"]]);
721
- F(T.BUTTON, He);
722
- F(T.INPUT_ZONE, je);
723
- F(T.ROOT_LAYER, Ye);
724
- F(T.TARGET_ZONE, We);
725
- F(T.TRACKPAD, rt);
726
- F(T.D_PAD, st);
727
- F(T.JOYSTICK, lt);
708
+ }), pt = /* @__PURE__ */ V(ft, [["__scopeId", "data-v-ec529d0c"]]);
709
+ F(I.BUTTON, it);
710
+ F(I.INPUT_ZONE, je);
711
+ F(I.ROOT_LAYER, Je);
712
+ F(I.TARGET_ZONE, et);
713
+ F(I.TRACKPAD, vt);
714
+ F(I.D_PAD, dt);
715
+ F(I.JOYSTICK, pt);
716
+ we((e) => {
717
+ (e.type === se.KEYDOWN || e.type === se.KEYUP) && ce(e.type, e.payload);
718
+ });
728
719
  export {
729
720
  je as InputZone,
730
- Ye as RootLayer,
731
- We as TargetZone,
732
- He as VirtualButton,
733
- st as VirtualDPad,
734
- lt as VirtualJoystick,
735
- rt as VirtualTrackpad,
736
- re as getComponent,
737
- ie as getComponentSafe,
738
- ft as hasRegisteredComponent,
721
+ Je as RootLayer,
722
+ et as TargetZone,
723
+ it as VirtualButton,
724
+ dt as VirtualDPad,
725
+ pt as VirtualJoystick,
726
+ vt as VirtualTrackpad,
727
+ ue as getComponent,
728
+ re as getComponentSafe,
729
+ Pt as hasRegisteredComponent,
739
730
  F as registerComponent
740
731
  };