@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.
- package/dist/index.d.ts +4 -5
- package/dist/omnipad-vue.css +1 -1
- package/dist/omnipad-vue.mjs +414 -423
- package/dist/omnipad-vue.umd.js +1 -1
- package/package.json +2 -2
package/dist/omnipad-vue.mjs
CHANGED
|
@@ -1,138 +1,126 @@
|
|
|
1
|
-
import { Registry as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
function F(e,
|
|
6
|
-
|
|
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
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
render: () =>
|
|
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
|
|
15
|
-
return !e || !
|
|
14
|
+
function re(e) {
|
|
15
|
+
return !e || !j[e] ? null : j[e];
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return e ? !!
|
|
17
|
+
function Pt(e) {
|
|
18
|
+
return e ? !!j[e] : !1;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
if (!
|
|
39
|
-
const
|
|
40
|
-
Object.keys(
|
|
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
|
-
),
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
if (a.value && (a.value instanceof Element ?
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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:
|
|
62
|
+
bindDelegates: f
|
|
67
63
|
};
|
|
68
64
|
}
|
|
69
|
-
const
|
|
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
|
|
76
|
-
let
|
|
77
|
-
return !
|
|
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:
|
|
75
|
+
component: t
|
|
80
76
|
};
|
|
81
77
|
}));
|
|
82
|
-
return (s,
|
|
83
|
-
(
|
|
84
|
-
key:
|
|
85
|
-
"tree-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
|
-
|
|
83
|
+
h(s.$slots, "default", {}, void 0, !0)
|
|
88
84
|
]));
|
|
89
85
|
}
|
|
90
|
-
}),
|
|
91
|
-
const
|
|
92
|
-
for (const [s,
|
|
93
|
-
|
|
94
|
-
return
|
|
95
|
-
},
|
|
96
|
-
function
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
`[OmniPad-Validation] Type mismatch! Component expected "${e}", but received "${
|
|
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
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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:
|
|
105
|
+
parentId: i.value,
|
|
114
106
|
// 特殊处理 Layout:深度合并,确保即便只传了 { width: 100 } 也不丢失原来的 left/top
|
|
115
107
|
layout: {
|
|
116
|
-
...
|
|
117
|
-
...
|
|
118
|
-
...
|
|
108
|
+
...d.layout || {},
|
|
109
|
+
...f.layout || {},
|
|
110
|
+
..._.layout || {}
|
|
119
111
|
}
|
|
120
|
-
}
|
|
121
|
-
const
|
|
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
|
-
...
|
|
129
|
-
|
|
115
|
+
...u,
|
|
116
|
+
parentId: i.value,
|
|
117
|
+
layout: u.layout || void 0
|
|
130
118
|
// 只有当传入了新的 layout 时才包裹
|
|
131
119
|
};
|
|
132
120
|
});
|
|
133
|
-
return { uid:
|
|
121
|
+
return { uid: l, initialConfig: R, reactiveConfig: y };
|
|
134
122
|
}
|
|
135
|
-
const
|
|
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
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
), { core: i, state:
|
|
148
|
-
() => new
|
|
149
|
-
|
|
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
|
-
),
|
|
154
|
-
const p =
|
|
155
|
-
return
|
|
156
|
-
}),
|
|
157
|
-
const
|
|
158
|
-
(
|
|
159
|
-
),
|
|
160
|
-
return
|
|
161
|
-
`[OmniPad-Validation] InputZone ${
|
|
162
|
-
),
|
|
163
|
-
`[OmniPad-Validation] InputZone ${
|
|
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:
|
|
166
|
-
isFromSlot:
|
|
153
|
+
nodeToRender: W ? A[0] : S || null,
|
|
154
|
+
isFromSlot: W
|
|
167
155
|
};
|
|
168
|
-
}),
|
|
169
|
-
const p =
|
|
170
|
-
return
|
|
156
|
+
}), P = $(() => {
|
|
157
|
+
const p = m.value.nodeToRender;
|
|
158
|
+
return ue(p.config?.baseType || p.type);
|
|
171
159
|
});
|
|
172
|
-
|
|
160
|
+
le(
|
|
173
161
|
s,
|
|
174
162
|
(p) => {
|
|
175
|
-
|
|
163
|
+
Ve(() => {
|
|
176
164
|
p && p?.uid && (i.value?.updateConfig({
|
|
177
165
|
dynamicWidgetId: p.uid
|
|
178
|
-
}),
|
|
179
|
-
dynamicWidgetPointerDown: (
|
|
180
|
-
p.markRectDirty?.(), p.onPointerDown?.(
|
|
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
|
|
191
|
-
if (!
|
|
192
|
-
if (!
|
|
193
|
-
let p,
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
196
|
-
p = `${
|
|
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
|
|
199
|
-
p = `${G(
|
|
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":
|
|
192
|
+
"--dynamic-widget-mount-y": A,
|
|
205
193
|
visibility: "visible",
|
|
206
194
|
opacity: 1,
|
|
207
195
|
pointerEvents: "auto"
|
|
208
196
|
};
|
|
209
|
-
}),
|
|
210
|
-
return (p,
|
|
211
|
-
id: t
|
|
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:
|
|
214
|
-
class: D(["omnipad-input-zone omnipad-prevent",
|
|
215
|
-
style:
|
|
201
|
+
ref: R,
|
|
202
|
+
class: D(["omnipad-input-zone omnipad-prevent", o(f)?.cssClasses]),
|
|
203
|
+
style: O(C.value)
|
|
216
204
|
}, [
|
|
217
|
-
H(
|
|
205
|
+
H(ve, { nodes: u.value }, {
|
|
218
206
|
default: N(() => [
|
|
219
|
-
|
|
207
|
+
h(p.$slots, "default", {}, void 0, !0)
|
|
220
208
|
]),
|
|
221
209
|
_: 3
|
|
222
210
|
}, 8, ["nodes"]),
|
|
223
|
-
|
|
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:
|
|
227
|
-
onPointermove:
|
|
228
|
-
onPointerup:
|
|
214
|
+
onPointerdown: c,
|
|
215
|
+
onPointermove: L,
|
|
216
|
+
onPointerup: g,
|
|
229
217
|
onPointercancel: oe,
|
|
230
218
|
onLostpointercapture: oe
|
|
231
219
|
}, [
|
|
232
|
-
|
|
220
|
+
T("div", {
|
|
233
221
|
class: "dynamic-widget-mount",
|
|
234
|
-
style:
|
|
222
|
+
style: O(v.value)
|
|
235
223
|
}, [
|
|
236
|
-
|
|
224
|
+
m.value.isFromSlot ? (w(), Z(ee(m.value.nodeToRender), {
|
|
237
225
|
key: 0,
|
|
238
|
-
ref: (
|
|
239
|
-
}, null, 512)) :
|
|
226
|
+
ref: (S) => s.value = S
|
|
227
|
+
}, null, 512)) : m.value.nodeToRender ? (w(), Z(ee(P.value), {
|
|
240
228
|
key: 1,
|
|
241
|
-
ref: (
|
|
242
|
-
"tree-node":
|
|
243
|
-
}, null, 8, ["tree-node"])) :
|
|
229
|
+
ref: (S) => s.value = S,
|
|
230
|
+
"tree-node": m.value.nodeToRender
|
|
231
|
+
}, null, 8, ["tree-node"])) : Y("", !0)
|
|
244
232
|
], 4)
|
|
245
|
-
], 32)) :
|
|
246
|
-
], 14,
|
|
233
|
+
], 32)) : Y("", !0)
|
|
234
|
+
], 14, ze));
|
|
247
235
|
}
|
|
248
|
-
}), je = /* @__PURE__ */
|
|
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
|
|
257
|
-
|
|
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
|
-
),
|
|
263
|
-
|
|
264
|
-
|
|
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",
|
|
268
|
-
style:
|
|
255
|
+
class: D(["omnipad-root-layer omnipad-prevent", o(r)?.cssClasses]),
|
|
256
|
+
style: O(l.value)
|
|
269
257
|
}, [
|
|
270
|
-
H(
|
|
258
|
+
H(ve, {
|
|
271
259
|
nodes: e.treeNode?.children || []
|
|
272
260
|
}, {
|
|
273
261
|
default: N(() => [
|
|
274
|
-
|
|
262
|
+
h(a.$slots, "default", {}, void 0, !0)
|
|
275
263
|
]),
|
|
276
264
|
_: 3
|
|
277
265
|
}, 8, ["nodes"])
|
|
278
|
-
], 14,
|
|
266
|
+
], 14, qe));
|
|
279
267
|
}
|
|
280
|
-
}),
|
|
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
|
-
},
|
|
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
|
|
281
|
+
const n = e, d = {
|
|
294
282
|
cursorAutoDelay: 2500
|
|
295
|
-
}, { uid: s, initialConfig:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
), { core:
|
|
300
|
-
() => new
|
|
301
|
-
|
|
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:
|
|
305
|
-
dispatchPointerEventAtPos:
|
|
306
|
-
reclaimFocusAtPos:
|
|
292
|
+
dispatchKeyboardEvent: ce,
|
|
293
|
+
dispatchPointerEventAtPos: Ie,
|
|
294
|
+
reclaimFocusAtPos: Ne
|
|
307
295
|
}
|
|
308
|
-
),
|
|
296
|
+
), R = $(() => f.value ? q(f.value) : {}), y = Q(), u = $(() => {
|
|
309
297
|
if (!i.value) return { display: "none" };
|
|
310
|
-
let
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
313
|
-
|
|
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
|
|
316
|
-
|
|
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":
|
|
320
|
-
"--omnipad-virtual-cursor-y":
|
|
307
|
+
"--omnipad-virtual-cursor-x": v,
|
|
308
|
+
"--omnipad-virtual-cursor-y": c,
|
|
321
309
|
opacity: i.value.isVisible ? 1 : 0
|
|
322
310
|
};
|
|
323
|
-
}),
|
|
324
|
-
return (
|
|
325
|
-
id:
|
|
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:
|
|
328
|
-
class: D(["omnipad-target-zone omnipad-prevent",
|
|
329
|
-
style:
|
|
330
|
-
onPointerdown:
|
|
331
|
-
onPointermove:
|
|
332
|
-
onPointerup:
|
|
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
|
-
|
|
337
|
-
state:
|
|
338
|
-
isReturning:
|
|
339
|
-
cursorPos:
|
|
324
|
+
h(v.$slots, "focus-feedback", {
|
|
325
|
+
state: o(i),
|
|
326
|
+
isReturning: o(i)?.isFocusReturning,
|
|
327
|
+
cursorPos: o(i)?.position
|
|
340
328
|
}, () => [
|
|
341
|
-
H(
|
|
329
|
+
H(Me, { name: "omnipad-default-focus-fade" }, {
|
|
342
330
|
default: N(() => [
|
|
343
|
-
|
|
331
|
+
o(i)?.isFocusReturning ? (w(), E("div", He)) : Y("", !0)
|
|
344
332
|
]),
|
|
345
333
|
_: 1
|
|
346
334
|
})
|
|
347
335
|
], !0),
|
|
348
|
-
|
|
336
|
+
o(a)?.cursorEnabled ? (w(), E("div", {
|
|
349
337
|
key: 0,
|
|
350
338
|
class: "omnipad-virtual-cursor",
|
|
351
|
-
style:
|
|
339
|
+
style: O(u.value)
|
|
352
340
|
}, [
|
|
353
|
-
|
|
354
|
-
state:
|
|
355
|
-
isDown:
|
|
356
|
-
isReturning:
|
|
357
|
-
cursorPos:
|
|
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
|
-
|
|
360
|
-
class: D(["omnipad-default-cursor-dot", { "is-down":
|
|
347
|
+
T("div", {
|
|
348
|
+
class: D(["omnipad-default-cursor-dot", { "is-down": o(i)?.isPointerDown }])
|
|
361
349
|
}, null, 2)
|
|
362
350
|
], !0)
|
|
363
|
-
], 4)) :
|
|
364
|
-
|
|
351
|
+
], 4)) : Y("", !0),
|
|
352
|
+
o(a)?.cursorEnabled ? (w(), E("div", {
|
|
365
353
|
key: 1,
|
|
366
354
|
class: "omnipad-virtual-cursor",
|
|
367
|
-
style:
|
|
355
|
+
style: O(u.value)
|
|
368
356
|
}, [
|
|
369
|
-
|
|
370
|
-
state:
|
|
371
|
-
isDown:
|
|
372
|
-
isReturning:
|
|
373
|
-
cursorPos:
|
|
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)) :
|
|
376
|
-
|
|
377
|
-
state:
|
|
378
|
-
isDown:
|
|
379
|
-
isReturning:
|
|
380
|
-
cursorPos:
|
|
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,
|
|
370
|
+
], 46, Ge));
|
|
383
371
|
}
|
|
384
|
-
}),
|
|
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
|
-
},
|
|
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
|
|
396
|
-
return (s,
|
|
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:
|
|
386
|
+
style: O(d.value),
|
|
399
387
|
tabindex: "-1"
|
|
400
388
|
}, [
|
|
401
|
-
|
|
389
|
+
h(s.$slots, "base", {
|
|
402
390
|
isActive: e.isActive,
|
|
403
391
|
label: e.label
|
|
404
392
|
}, () => [
|
|
405
|
-
|
|
393
|
+
T("div", {
|
|
406
394
|
class: D(["omnipad-default-button-base", { "is-active": e.isActive }])
|
|
407
395
|
}, null, 2)
|
|
408
396
|
], !0),
|
|
409
|
-
|
|
410
|
-
|
|
397
|
+
T("div", tt, [
|
|
398
|
+
h(s.$slots, "default", {
|
|
411
399
|
isActive: e.isActive,
|
|
412
400
|
label: e.label
|
|
413
401
|
}, () => [
|
|
414
|
-
e.label ? (
|
|
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__ */
|
|
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:
|
|
430
|
-
const
|
|
417
|
+
setup(e, { expose: n }) {
|
|
418
|
+
const d = e, s = {
|
|
431
419
|
label: "BTN"
|
|
432
|
-
}, { uid:
|
|
433
|
-
|
|
434
|
-
|
|
420
|
+
}, { uid: t, initialConfig: r, reactiveConfig: b } = z(
|
|
421
|
+
I.BUTTON,
|
|
422
|
+
d,
|
|
435
423
|
s
|
|
436
|
-
), { core: i, state:
|
|
437
|
-
return
|
|
438
|
-
uid:
|
|
439
|
-
onPointerDown:
|
|
440
|
-
onPointerMove:
|
|
441
|
-
onPointerUp:
|
|
442
|
-
onPointerCancel:
|
|
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
|
-
}), (
|
|
445
|
-
id: t
|
|
432
|
+
}), (C, k) => (w(), Z(te, {
|
|
433
|
+
id: o(t),
|
|
446
434
|
ref_key: "elementRef",
|
|
447
|
-
ref:
|
|
448
|
-
class: D(["omnipad-button omnipad-prevent",
|
|
449
|
-
layout:
|
|
450
|
-
label:
|
|
451
|
-
"is-active":
|
|
452
|
-
onPointerdown:
|
|
453
|
-
onPointerup:
|
|
454
|
-
onPointercancel:
|
|
455
|
-
onLostpointercapture:
|
|
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((
|
|
458
|
-
|
|
445
|
+
base: N((v) => [
|
|
446
|
+
h(C.$slots, "base", x(U(v)))
|
|
459
447
|
]),
|
|
460
|
-
default: N((
|
|
461
|
-
|
|
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
|
-
}),
|
|
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
|
|
477
|
-
const
|
|
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":
|
|
481
|
-
"--omnipad-axis-stick-width":
|
|
482
|
-
"--omnipad-axis-stick-height":
|
|
468
|
+
"--omnipad-axis-stick-container-y": f,
|
|
469
|
+
"--omnipad-axis-stick-width": _,
|
|
470
|
+
"--omnipad-axis-stick-height": R,
|
|
483
471
|
// 松手时加一点回弹过渡,活动时取消过渡保证绝对跟手
|
|
484
|
-
transition:
|
|
472
|
+
transition: n.isActive ? "none" : "transform 0.1s ease-out"
|
|
485
473
|
};
|
|
486
474
|
});
|
|
487
|
-
return (
|
|
475
|
+
return (r, b) => (w(), E("div", {
|
|
488
476
|
class: D(["omnipad-axis-base omnipad-prevent", { "is-active": e.isActive }]),
|
|
489
|
-
style:
|
|
477
|
+
style: O(d.value),
|
|
490
478
|
tabindex: "-1"
|
|
491
479
|
}, [
|
|
492
|
-
|
|
493
|
-
|
|
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 ? (
|
|
486
|
+
e.showStick ? (w(), E("div", {
|
|
499
487
|
key: 0,
|
|
500
488
|
class: "omnipad-axis-stick-container",
|
|
501
|
-
style:
|
|
489
|
+
style: O(t.value)
|
|
502
490
|
}, [
|
|
503
|
-
|
|
491
|
+
h(r.$slots, "stick", {
|
|
504
492
|
isActive: e.isActive,
|
|
505
493
|
vector: e.vector
|
|
506
494
|
}, () => [
|
|
507
|
-
|
|
495
|
+
T("div", {
|
|
508
496
|
class: D(["omnipad-default-axis-stick", { "is-active": e.isActive }])
|
|
509
497
|
}, null, 2)
|
|
510
498
|
], !0)
|
|
511
|
-
], 4)) :
|
|
512
|
-
|
|
513
|
-
|
|
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
|
-
}),
|
|
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:
|
|
532
|
-
const
|
|
519
|
+
setup(e, { expose: n }) {
|
|
520
|
+
const d = e, s = {
|
|
533
521
|
showStick: !1,
|
|
534
522
|
threshold: 0.3
|
|
535
|
-
}, { uid:
|
|
536
|
-
|
|
537
|
-
|
|
523
|
+
}, { uid: t, initialConfig: r, reactiveConfig: b } = z(
|
|
524
|
+
I.D_PAD,
|
|
525
|
+
d,
|
|
538
526
|
s
|
|
539
|
-
), { core: i, state:
|
|
540
|
-
const
|
|
541
|
-
|
|
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
|
-
|
|
544
|
-
const
|
|
545
|
-
return
|
|
546
|
-
uid:
|
|
547
|
-
onPointerDown:
|
|
548
|
-
onPointerMove:
|
|
549
|
-
onPointerUp:
|
|
550
|
-
onPointerCancel:
|
|
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
|
-
}), (
|
|
540
|
+
}), (c, L) => (w(), Z(fe, {
|
|
553
541
|
ref_key: "elementRef",
|
|
554
|
-
ref:
|
|
555
|
-
class: D(["omnipad-dpad omnipad-prevent",
|
|
556
|
-
layout:
|
|
557
|
-
"is-active":
|
|
558
|
-
vector:
|
|
559
|
-
"show-stick":
|
|
560
|
-
"base-radius":
|
|
561
|
-
onPointerdown:
|
|
562
|
-
onPointermove:
|
|
563
|
-
onPointerup:
|
|
564
|
-
onPointercancel:
|
|
565
|
-
onLostpointercapture:
|
|
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((
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
class: D(["dpad-arm top", { on:
|
|
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
|
-
|
|
574
|
-
class: D(["dpad-arm bottom", { on:
|
|
561
|
+
T("div", {
|
|
562
|
+
class: D(["dpad-arm bottom", { on: g.vector && g.vector.y > o(f)?.threshold }])
|
|
575
563
|
}, null, 2),
|
|
576
|
-
|
|
577
|
-
class: D(["dpad-arm left", { on:
|
|
564
|
+
T("div", {
|
|
565
|
+
class: D(["dpad-arm left", { on: g.vector && g.vector.x < -o(f)?.threshold }])
|
|
578
566
|
}, null, 2),
|
|
579
|
-
|
|
580
|
-
class: D(["dpad-arm right", { on:
|
|
567
|
+
T("div", {
|
|
568
|
+
class: D(["dpad-arm right", { on: g.vector && g.vector.x > o(f)?.threshold }])
|
|
581
569
|
}, null, 2),
|
|
582
|
-
|
|
570
|
+
L[0] || (L[0] = T("div", { class: "dpad-center" }, null, -1))
|
|
583
571
|
])
|
|
584
572
|
], !0)
|
|
585
573
|
]),
|
|
586
|
-
stick: N((
|
|
587
|
-
|
|
574
|
+
stick: N((g) => [
|
|
575
|
+
h(c.$slots, "stick", x(U(g)), void 0, !0)
|
|
588
576
|
]),
|
|
589
|
-
default: N((
|
|
590
|
-
|
|
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
|
-
}),
|
|
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:
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
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:
|
|
615
|
-
return
|
|
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:
|
|
618
|
-
onPointerMove:
|
|
619
|
-
onPointerUp:
|
|
620
|
-
onPointerCancel:
|
|
621
|
-
markRectDirty: () =>
|
|
622
|
-
}), (
|
|
623
|
-
id:
|
|
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:
|
|
626
|
-
class: D(["omnipad-trackpad omnipad-prevent",
|
|
627
|
-
layout:
|
|
628
|
-
label:
|
|
629
|
-
"is-active":
|
|
630
|
-
onPointerdown:
|
|
631
|
-
onPointermove:
|
|
632
|
-
onPointerup:
|
|
633
|
-
onPointercancel:
|
|
634
|
-
onLostpointercapture:
|
|
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
|
|
624
|
+
base: N((k) => [
|
|
625
|
+
h(P.$slots, "base", x(U(k)), void 0, !0)
|
|
638
626
|
]),
|
|
639
|
-
default: N((
|
|
640
|
-
P
|
|
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
|
-
}),
|
|
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:
|
|
659
|
-
const
|
|
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:
|
|
665
|
-
|
|
666
|
-
|
|
652
|
+
}, { uid: t, initialConfig: r, reactiveConfig: b } = z(
|
|
653
|
+
I.JOYSTICK,
|
|
654
|
+
d,
|
|
667
655
|
s
|
|
668
|
-
), { core: i, state:
|
|
669
|
-
const
|
|
670
|
-
|
|
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
|
-
|
|
673
|
-
const
|
|
674
|
-
return
|
|
675
|
-
uid:
|
|
676
|
-
onPointerDown:
|
|
677
|
-
onPointerMove:
|
|
678
|
-
onPointerUp:
|
|
679
|
-
onPointerCancel:
|
|
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
|
-
}), (
|
|
669
|
+
}), (c, L) => (w(), Z(fe, {
|
|
682
670
|
ref_key: "elementRef",
|
|
683
|
-
ref:
|
|
684
|
-
class: D(["omnipad-joystick omnipad-prevent",
|
|
685
|
-
layout:
|
|
686
|
-
"is-active":
|
|
687
|
-
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":
|
|
690
|
-
onPointerdown:
|
|
691
|
-
onPointermove:
|
|
692
|
-
onPointerup:
|
|
693
|
-
onPointercancel:
|
|
694
|
-
onLostpointercapture:
|
|
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((
|
|
697
|
-
|
|
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":
|
|
703
|
-
label:
|
|
690
|
+
"is-active": o(l)?.isPressed,
|
|
691
|
+
label: o(f)?.label
|
|
704
692
|
}, {
|
|
705
|
-
base: N((
|
|
706
|
-
|
|
693
|
+
base: N((g) => [
|
|
694
|
+
h(c.$slots, "stick-base", x(U(g)), void 0, !0)
|
|
707
695
|
]),
|
|
708
|
-
default: N((
|
|
709
|
-
|
|
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((
|
|
715
|
-
|
|
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
|
-
}),
|
|
721
|
-
F(
|
|
722
|
-
F(
|
|
723
|
-
F(
|
|
724
|
-
F(
|
|
725
|
-
F(
|
|
726
|
-
F(
|
|
727
|
-
F(
|
|
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
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
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
|
};
|