@omnipad/vue 0.4.2 → 0.4.4

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