@omnipad/vue 0.4.4 → 0.5.0

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