@omnipad/vue 0.2.0-alpha.2 → 0.2.0-alpha.3
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 +8 -2
- package/dist/omnipad-vue.css +1 -1
- package/dist/omnipad-vue.mjs +229 -216
- package/dist/omnipad-vue.umd.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -73,12 +73,18 @@ declare function __VLS_template_3(): {
|
|
|
73
73
|
'focus-feedback'?(_: {
|
|
74
74
|
state: CursorState | undefined;
|
|
75
75
|
isReturning: boolean | undefined;
|
|
76
|
-
cursorPos:
|
|
76
|
+
cursorPos: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
};
|
|
77
80
|
}): any;
|
|
78
81
|
cursor?(_: {
|
|
79
82
|
state: CursorState | undefined;
|
|
80
83
|
isDown: boolean | undefined;
|
|
81
|
-
cursorPos:
|
|
84
|
+
cursorPos: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
};
|
|
82
88
|
}): any;
|
|
83
89
|
};
|
|
84
90
|
refs: {
|
package/dist/omnipad-vue.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--omnipad-btn-bg: rgba(255, 255, 255, .2);--omnipad-btn-border-color: rgba(255, 255, 255, .4);--omnipad-btn-border-width: 2px;--omnipad-btn-border-style: solid;--omnipad-btn-radius: 8px;--omnipad-btn-label-color: #ffffff;--omnipad-btn-font-family: "Upheaval", "monacoregular", sans-serif;--omnipad-btn-font-size: 18px;--omnipad-btn-font-weight: bold;--omnipad-btn-pressed-bg: rgba(255, 186, 67, .6);--omnipad-btn-pressed-border-color: #ffba43;--omnipad-btn-pressed-scale: .92;--omnipad-btn-pressed-opacity: 1;--omnipad-btn-transition-duration: .1s;--omnipad-btn-transition-timing: ease-out;--omnipad-default-cursor-height: 20px;--omnipad-default-cursor-width: 20px;--omnipad-default-cursor-transition: var(--omnipad-default-cursor-transition-mode) var(--omnipad-default-cursor-transition-time);--omnipad-default-cursor-transition-mode: opacity;--omnipad-default-cursor-transition-time: .2s;--omnipad-default-cursor-dot-background: #ff000080;--omnipad-default-cursor-dot-border-color: #ffffff;--omnipad-default-cursor-dot-border-radius: 50%;--omnipad-default-cursor-dot-border-style: solid;--omnipad-default-cursor-dot-border-width: 2px;--omnipad-default-cursor-dot-down-background: #ff0000;--omnipad-default-cursor-dot-down-scale: .8;--omnipad-focus-color: rgba(100, 200, 255, .8);--omnipad-focus-bg-color: rgba(100, 200, 255, .05);--omnipad-trackpad-bg: rgba(255, 255, 255, .05);--omnipad-trackpad-border-style: dashed;--omnipad-trackpad-cursor: crosshair}.omnipad-button-base{background:var(--omnipad-btn-bg);border:var(--omnipad-btn-border-width) var(--omnipad-btn-border-style) var(--omnipad-btn-border-color);border-radius:var(--omnipad-btn-radius);display:flex;align-items:center;justify-content:center;transition:all var(--omnipad-btn-transition-duration) var(--omnipad-btn-transition-timing)}.omnipad-button-label-hollow{font-family:var(--omnipad-btn-font-family);font-size:var(--omnipad-btn-font-size);color:var(--omnipad-btn-label-color);font-weight:var(--omnipad-btn-font-weight);background:inherit;-webkit-background-clip:text;background-clip:text;color:transparent;filter:invert(1) grayscale(1) contrast(9);mix-blend-mode:destination-out}.omnipad-default-cursor-dot{width:100%;height:100%;border-width:var(--omnipad-default-cursor-dot-border-width);border-style:var(--omnipad-default-cursor-dot-border-style);border-color:var(--omnipad-default-cursor-dot-border-color);border-radius:var(--omnipad-default-cursor-dot-border-radius);background:var(--omnipad-default-cursor-dot-background)}.omnipad-default-cursor-dot.is-down{transform:scale(var(--omnipad-default-cursor-dot-down-scale));background:var(--omnipad-default-cursor-dot-down-background)}.omnipad-default-focus-border-feedback{position:absolute;inset:0;pointer-events:none;z-index:5;border:2px solid var(--omnipad-focus-color);background-color:var(--omnipad-focus-bg-color);box-shadow:inset 0 0 10px var(--omnipad-focus-color);box-sizing:border-box}.omnipad-default-focus-fade-enter-active{transition:opacity .05s ease-in}.omnipad-default-focus-fade-leave-active{transition:opacity .2s ease-out}.omnipad-default-focus-fade-enter-from,.omnipad-default-focus-fade-leave-to{opacity:0}.omnipad-prevent{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}.omnipad-trackpad:before{content:"";position:absolute;inset:10px;background-image:radial-gradient(rgba(255,255,255,.1) 1px,transparent 1px);background-size:20px 20px;pointer-events:none}.omnipad-virtual-layer-base[data-v-6f1860f6]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1000}[data-v-6f1860f6] .omnipad-input-zone,[data-v-6f1860f6] .omnipad-button{pointer-events:auto}.omnipad-input-zone[data-v-
|
|
1
|
+
:root{--omnipad-btn-bg: rgba(255, 255, 255, .2);--omnipad-btn-border-color: rgba(255, 255, 255, .4);--omnipad-btn-border-width: 2px;--omnipad-btn-border-style: solid;--omnipad-btn-radius: 8px;--omnipad-btn-label-color: #ffffff;--omnipad-btn-font-family: "Upheaval", "monacoregular", sans-serif;--omnipad-btn-font-size: 18px;--omnipad-btn-font-weight: bold;--omnipad-btn-pressed-bg: rgba(255, 186, 67, .6);--omnipad-btn-pressed-border-color: #ffba43;--omnipad-btn-pressed-scale: .92;--omnipad-btn-pressed-opacity: 1;--omnipad-btn-transition-duration: .1s;--omnipad-btn-transition-timing: ease-out;--omnipad-default-cursor-height: 20px;--omnipad-default-cursor-width: 20px;--omnipad-default-cursor-transition: var(--omnipad-default-cursor-transition-mode) var(--omnipad-default-cursor-transition-time);--omnipad-default-cursor-transition-mode: opacity;--omnipad-default-cursor-transition-time: .2s;--omnipad-default-cursor-dot-background: #ff000080;--omnipad-default-cursor-dot-border-color: #ffffff;--omnipad-default-cursor-dot-border-radius: 50%;--omnipad-default-cursor-dot-border-style: solid;--omnipad-default-cursor-dot-border-width: 2px;--omnipad-default-cursor-dot-down-background: #ff0000;--omnipad-default-cursor-dot-down-scale: .8;--omnipad-focus-color: rgba(100, 200, 255, .8);--omnipad-focus-bg-color: rgba(100, 200, 255, .05);--omnipad-trackpad-bg: rgba(255, 255, 255, .05);--omnipad-trackpad-border-style: dashed;--omnipad-trackpad-cursor: crosshair}.omnipad-button-base{background:var(--omnipad-btn-bg);border:var(--omnipad-btn-border-width) var(--omnipad-btn-border-style) var(--omnipad-btn-border-color);border-radius:var(--omnipad-btn-radius);display:flex;align-items:center;justify-content:center;transition:all var(--omnipad-btn-transition-duration) var(--omnipad-btn-transition-timing)}.omnipad-button-label-hollow{font-family:var(--omnipad-btn-font-family);font-size:var(--omnipad-btn-font-size);color:var(--omnipad-btn-label-color);font-weight:var(--omnipad-btn-font-weight);background:inherit;-webkit-background-clip:text;background-clip:text;color:transparent;filter:invert(1) grayscale(1) contrast(9);mix-blend-mode:destination-out}.omnipad-default-cursor-dot{width:100%;height:100%;border-width:var(--omnipad-default-cursor-dot-border-width);border-style:var(--omnipad-default-cursor-dot-border-style);border-color:var(--omnipad-default-cursor-dot-border-color);border-radius:var(--omnipad-default-cursor-dot-border-radius);background:var(--omnipad-default-cursor-dot-background)}.omnipad-default-cursor-dot.is-down{transform:scale(var(--omnipad-default-cursor-dot-down-scale));background:var(--omnipad-default-cursor-dot-down-background)}.omnipad-default-focus-border-feedback{position:absolute;inset:0;pointer-events:none;z-index:5;border:2px solid var(--omnipad-focus-color);background-color:var(--omnipad-focus-bg-color);box-shadow:inset 0 0 10px var(--omnipad-focus-color);box-sizing:border-box}.omnipad-default-focus-fade-enter-active{transition:opacity .05s ease-in}.omnipad-default-focus-fade-leave-active{transition:opacity .2s ease-out}.omnipad-default-focus-fade-enter-from,.omnipad-default-focus-fade-leave-to{opacity:0}.omnipad-prevent{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}.omnipad-trackpad:before{content:"";position:absolute;inset:10px;background-image:radial-gradient(rgba(255,255,255,.1) 1px,transparent 1px);background-size:20px 20px;pointer-events:none}.omnipad-virtual-layer-base[data-v-6f1860f6]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1000}[data-v-6f1860f6] .omnipad-input-zone,[data-v-6f1860f6] .omnipad-button{pointer-events:auto}.omnipad-input-zone[data-v-f734ffc6]{position:absolute;pointer-events:none;-webkit-user-select:none;user-select:none;touch-action:none}.omnipad-input-zone-trigger[data-v-f734ffc6]{position:absolute;inset:0;pointer-events:auto;background:transparent;touch-action:none}.dynamic-widget-mount[data-v-f734ffc6]{position:absolute;left:0;top:0;pointer-events:none;will-change:transform;transform:translate3d(var(--dynamic-widget-mount-x, 0px),var(--dynamic-widget-mount-y, 0px),0);--dynamic-widget-mount-x: 0px;--dynamic-widget-mount-y: 0px}.omnipad-virtual-layer[data-v-9e46ef9c]{position:relative;height:100%;width:100%;pointer-events:none}.omnipad-target-zone[data-v-3067b26e]{-webkit-user-select:none;user-select:none;touch-action:none;pointer-events:auto;overflow:hidden}.omnipad-virtual-cursor[data-v-3067b26e]{position:absolute;top:0;left:0;width:var(--omnipad-default-cursor-width);height:var(--omnipad-default-cursor-height);pointer-events:none;will-change:transform;transition:var(--omnipad-default-cursor-transition);z-index:10;transform:translate3d(var(--omnipad-virtual-cursor-x, 0px),var(--omnipad-virtual-cursor-y, 0px),0) translate(-50%,-50%);--omnipad-virtual-cursor-x: 0px;--omnipad-virtual-cursor-y: 0px}.omnipad-button-base[data-v-3db6d4f9]{-webkit-user-select:none;user-select:none;touch-action:none;overflow:hidden;box-sizing:border-box;pointer-events:auto}.omnipad-button-base.is-active[data-v-3db6d4f9]{background:var(--omnipad-btn-pressed-bg);border-color:var(--omnipad-btn-pressed-border-color);opacity:var(--omnipad-btn-pressed-opacity);filter:brightness(1.2)}.omnipad-button-label[data-v-3db6d4f9]{font-family:var(--omnipad-btn-font-family);font-size:var(--omnipad-btn-font-size);color:var(--omnipad-btn-label-color);font-weight:var(--omnipad-btn-font-weight)}.omnipad-trackpad[data-v-c28e3a2e]{-webkit-user-select:none;user-select:none;touch-action:none;overflow:hidden;--omnipad-btn-border-style: var(--omnipad-trackpad-border-style);--omnipad-btn-bg: var(--omnipad-trackpad-bg);cursor:var(--omnipad-trackpad-cursor)}
|
package/dist/omnipad-vue.mjs
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { Registry as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
|
|
1
|
+
import { Registry as H, CONTEXT as z, generateUID as J, CMP_TYPES as _, resolveLayoutStyle as L, remap as U, InputZoneCore as Q, RootLayerCore as q, TargetZoneCore as ee, KeyboardButtonCore as te, MouseButtonCore as ne, TrackpadCore as oe } from "@omnipad/core";
|
|
2
|
+
import { defineComponent as w, h as ie, shallowRef as ae, ref as A, onMounted as re, onUnmounted as le, openBlock as f, createElementBlock as g, Fragment as se, renderList as ue, createBlock as T, resolveDynamicComponent as V, unref as l, renderSlot as h, inject as ce, computed as P, provide as de, useSlots as ve, watch as pe, nextTick as fe, normalizeStyle as $, createVNode as M, withCtx as Z, createElementVNode as F, createCommentVNode as B, Transition as ye, normalizeClass as W, toDisplayString as me } from "vue";
|
|
3
|
+
const j = {};
|
|
4
|
+
function I(o, n) {
|
|
5
|
+
j[o] = n;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
render: () =>
|
|
7
|
+
function G(o) {
|
|
8
|
+
const n = j[o];
|
|
9
|
+
return n || w({
|
|
10
|
+
render: () => ie("div", { style: "color:red" }, `[Unknown: ${o}]`)
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
s.value =
|
|
13
|
+
function N(o) {
|
|
14
|
+
const n = ae(), s = A(), e = A(null), a = (i) => {
|
|
15
|
+
s.value = i;
|
|
16
16
|
};
|
|
17
|
-
return
|
|
18
|
-
const
|
|
19
|
-
|
|
17
|
+
return re(() => {
|
|
18
|
+
const i = o();
|
|
19
|
+
n.value = i, H.getInstance().register(i), "subscribe" in i && i.subscribe(a);
|
|
20
20
|
let t = null;
|
|
21
|
-
e.value && (e.value instanceof Element ? t = e.value : e.value.$el instanceof Element && (t = e.value.$el)), t && "bindRectProvider" in
|
|
22
|
-
}),
|
|
23
|
-
|
|
21
|
+
e.value && (e.value instanceof Element ? t = e.value : e.value.$el instanceof Element && (t = e.value.$el)), t && "bindRectProvider" in i && i.bindRectProvider(() => t.getBoundingClientRect());
|
|
22
|
+
}), le(() => {
|
|
23
|
+
n.value && n.value.destroy();
|
|
24
24
|
}), {
|
|
25
|
-
core:
|
|
25
|
+
core: n,
|
|
26
26
|
state: s,
|
|
27
27
|
elementRef: e
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const Pe = { class: "omnipad-virtual-layer-base omnipad-prevent" }, _e = /* @__PURE__ */ w({
|
|
31
31
|
__name: "VirtualLayerBase",
|
|
32
32
|
props: {
|
|
33
33
|
nodes: {}
|
|
34
34
|
},
|
|
35
|
-
setup(
|
|
36
|
-
return (
|
|
37
|
-
(
|
|
35
|
+
setup(o) {
|
|
36
|
+
return (n, s) => (f(), g("div", Pe, [
|
|
37
|
+
(f(!0), g(se, null, ue(o.nodes || [], (e) => (f(), T(V(l(G)(e.type)), {
|
|
38
38
|
key: e.uid,
|
|
39
39
|
"tree-node": e
|
|
40
40
|
}, null, 8, ["tree-node"]))), 128)),
|
|
41
|
-
|
|
41
|
+
h(n.$slots, "default", {}, void 0, !0)
|
|
42
42
|
]));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
45
|
-
const s =
|
|
46
|
-
for (const [e,
|
|
47
|
-
s[e] =
|
|
44
|
+
}), D = (o, n) => {
|
|
45
|
+
const s = o.__vccOpts || o;
|
|
46
|
+
for (const [e, a] of n)
|
|
47
|
+
s[e] = a;
|
|
48
48
|
return s;
|
|
49
|
-
},
|
|
50
|
-
function
|
|
51
|
-
const e =
|
|
52
|
-
e && e.type !==
|
|
53
|
-
`[OmniPad-Validation] Type mismatch! Component expected "${
|
|
49
|
+
}, X = /* @__PURE__ */ D(_e, [["__scopeId", "data-v-6f1860f6"]]);
|
|
50
|
+
function x(o, n, s = {}) {
|
|
51
|
+
const e = n.treeNode, a = e && e.type === o ? e : void 0;
|
|
52
|
+
e && e.type !== o && console.warn(
|
|
53
|
+
`[OmniPad-Validation] Type mismatch! Component expected "${o}", but received "${e.type}". Config ignored.`
|
|
54
54
|
);
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
const m =
|
|
58
|
-
const
|
|
59
|
-
Object.entries(
|
|
55
|
+
const i = ce(z.PARENT_ID_KEY, A(void 0)), t = P(() => n.parentId || a?.config?.parentId || i.value), d = P(() => n.widgetId || a?.uid || J(o));
|
|
56
|
+
de(z.PARENT_ID_KEY, d);
|
|
57
|
+
const m = P(() => {
|
|
58
|
+
const v = a?.config || {}, c = Object.fromEntries(
|
|
59
|
+
Object.entries(n).filter(([p, r]) => r !== void 0 && p !== "treeNode" && p !== "widgetId")
|
|
60
60
|
);
|
|
61
61
|
return {
|
|
62
62
|
...s,
|
|
63
|
-
...
|
|
64
|
-
...
|
|
63
|
+
...v,
|
|
64
|
+
...c,
|
|
65
65
|
id: d.value,
|
|
66
|
-
type:
|
|
66
|
+
type: o,
|
|
67
67
|
parentId: t.value,
|
|
68
68
|
// 特殊处理 Layout:深度合并,确保即便只传了 { width: 100 } 也不丢失原来的 left/top
|
|
69
69
|
layout: {
|
|
70
70
|
...s.layout || {},
|
|
71
|
-
...
|
|
72
|
-
...
|
|
71
|
+
...v.layout || {},
|
|
72
|
+
...c.layout || {}
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
});
|
|
76
76
|
return { uid: d, config: m };
|
|
77
77
|
}
|
|
78
|
-
const
|
|
78
|
+
const ge = ["id"], be = /* @__PURE__ */ w({
|
|
79
79
|
__name: "InputZone",
|
|
80
80
|
props: {
|
|
81
81
|
treeNode: {},
|
|
@@ -83,117 +83,124 @@ const Pe = ["id"], _e = /* @__PURE__ */ b({
|
|
|
83
83
|
layout: {},
|
|
84
84
|
preventFocusLoss: {}
|
|
85
85
|
},
|
|
86
|
-
setup(
|
|
87
|
-
const
|
|
88
|
-
() => new
|
|
89
|
-
),
|
|
90
|
-
const
|
|
91
|
-
return
|
|
92
|
-
}),
|
|
93
|
-
const
|
|
94
|
-
(
|
|
95
|
-
),
|
|
96
|
-
return
|
|
97
|
-
`[OmniPad-Validation] InputZone ${
|
|
98
|
-
),
|
|
99
|
-
`[OmniPad-Validation] InputZone ${
|
|
86
|
+
setup(o) {
|
|
87
|
+
const n = o, s = ve(), e = A(null), { uid: a, config: i } = x(_.INPUT_ZONE, n), { core: t, state: d, elementRef: m } = N(
|
|
88
|
+
() => new Q(a.value, i.value)
|
|
89
|
+
), v = P(() => {
|
|
90
|
+
const u = n.treeNode?.config?.dynamicWidgetId;
|
|
91
|
+
return n.treeNode?.children?.filter((b) => b.uid !== u) || [];
|
|
92
|
+
}), c = P(() => {
|
|
93
|
+
const b = (s.dynamicWidget?.() || []).filter((O) => !(O.type === Comment || O.type === Text)), C = n.treeNode?.children?.find(
|
|
94
|
+
(O) => O.uid === n.treeNode?.config?.dynamicWidgetId
|
|
95
|
+
), S = b.length > 0;
|
|
96
|
+
return b.length > 1 && console.error(
|
|
97
|
+
`[OmniPad-Validation] InputZone ${a.value} has multiple dynamic widgets in slot. Only the first one will be activated.`
|
|
98
|
+
), S && C && console.warn(
|
|
99
|
+
`[OmniPad-Validation] InputZone ${a.value} has both Slot and Config dynamic widgets. Config ignored.`
|
|
100
100
|
), {
|
|
101
|
-
nodeToRender:
|
|
102
|
-
isFromSlot:
|
|
101
|
+
nodeToRender: S ? b[0] : C || null,
|
|
102
|
+
isFromSlot: S
|
|
103
103
|
};
|
|
104
104
|
});
|
|
105
|
-
|
|
105
|
+
pe(
|
|
106
106
|
e,
|
|
107
|
-
(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
dynamicWidgetId:
|
|
107
|
+
(u) => {
|
|
108
|
+
fe(() => {
|
|
109
|
+
u && u?.uid && t.value?.updateConfig({
|
|
110
|
+
dynamicWidgetId: u.uid
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
},
|
|
114
114
|
{ immediate: !0 }
|
|
115
115
|
);
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
const p = P(() => L(i.value.layout)), r = P(() => {
|
|
117
|
+
const u = t?.value?.getRect(), b = d?.value?.dynamicPosition;
|
|
118
|
+
return {
|
|
119
|
+
x: U(b?.x || 0, 0, 100, 0, u?.width || 0),
|
|
120
|
+
y: U(b?.y || 0, 0, 100, 0, u?.height || 0)
|
|
121
|
+
};
|
|
122
|
+
}), R = P(() => d.value ? d.value?.isDynamicActive ? {
|
|
120
123
|
zIndex: 100,
|
|
124
|
+
"--dynamic-widget-mount-x": `${r.value.x}px`,
|
|
125
|
+
"--dynamic-widget-mount-y": `${r.value.y}px`,
|
|
126
|
+
visibility: "visible",
|
|
127
|
+
opacity: 1,
|
|
121
128
|
pointerEvents: "auto"
|
|
122
|
-
} : { display: "none" }),
|
|
123
|
-
t.value && (t.value.onPointerDown(
|
|
124
|
-
}, y = (
|
|
125
|
-
t.value && (t.value.onPointerMove(
|
|
126
|
-
},
|
|
127
|
-
d.value?.isDynamicActive && e.value && typeof e.value.onPointerUp == "function" && e.value.onPointerUp(
|
|
128
|
-
},
|
|
129
|
-
d.value?.isDynamicActive && e.value && typeof e.value.onPointerCancel == "function" && e.value.onPointerCancel(
|
|
129
|
+
} : { visibility: "hidden", opacity: 0 } : { display: "none" }), k = (u) => {
|
|
130
|
+
t.value && (t.value.onPointerDown(u), d.value?.isDynamicActive && e.value && typeof e.value.onPointerDown == "function" && e.value.onPointerDown(u));
|
|
131
|
+
}, y = (u) => {
|
|
132
|
+
t.value && (t.value.onPointerMove(u), d.value?.isDynamicActive && e.value && typeof e.value.onPointerMove == "function" && e.value.onPointerMove(u));
|
|
133
|
+
}, E = (u) => {
|
|
134
|
+
d.value?.isDynamicActive && e.value && typeof e.value.onPointerUp == "function" && e.value.onPointerUp(u), t.value && t.value.onPointerUp(u);
|
|
135
|
+
}, Y = (u) => {
|
|
136
|
+
d.value?.isDynamicActive && e.value && typeof e.value.onPointerCancel == "function" && e.value.onPointerCancel(u), t.value && t.value.onPointerCancel(u);
|
|
130
137
|
};
|
|
131
|
-
return (
|
|
132
|
-
id: l(
|
|
138
|
+
return (u, b) => (f(), g("div", {
|
|
139
|
+
id: l(a),
|
|
133
140
|
ref_key: "elementRef",
|
|
134
141
|
ref: m,
|
|
135
142
|
class: "omnipad-input-zone omnipad-prevent",
|
|
136
|
-
style: $(
|
|
143
|
+
style: $(p.value)
|
|
137
144
|
}, [
|
|
138
|
-
|
|
139
|
-
default:
|
|
140
|
-
|
|
145
|
+
M(X, { nodes: v.value }, {
|
|
146
|
+
default: Z(() => [
|
|
147
|
+
h(u.$slots, "default", {}, void 0, !0)
|
|
141
148
|
]),
|
|
142
149
|
_: 3
|
|
143
150
|
}, 8, ["nodes"]),
|
|
144
|
-
|
|
151
|
+
c.value.nodeToRender || l(t)?.isInterceptorRequired ? (f(), g("div", {
|
|
145
152
|
key: 0,
|
|
146
153
|
class: "omnipad-input-zone-trigger",
|
|
147
|
-
onPointerdown:
|
|
154
|
+
onPointerdown: k,
|
|
148
155
|
onPointermove: y,
|
|
149
|
-
onPointerup:
|
|
150
|
-
onPointercancel:
|
|
151
|
-
onLostpointercapture:
|
|
156
|
+
onPointerup: E,
|
|
157
|
+
onPointercancel: Y,
|
|
158
|
+
onLostpointercapture: Y
|
|
152
159
|
}, [
|
|
153
|
-
|
|
160
|
+
F("div", {
|
|
154
161
|
class: "dynamic-widget-mount",
|
|
155
|
-
style: $(
|
|
162
|
+
style: $(R.value)
|
|
156
163
|
}, [
|
|
157
|
-
|
|
164
|
+
c.value.isFromSlot ? (f(), T(V(c.value.nodeToRender), {
|
|
158
165
|
key: 0,
|
|
159
166
|
ref: (C) => e.value = C
|
|
160
|
-
}, null, 512)) :
|
|
167
|
+
}, null, 512)) : c.value.nodeToRender ? (f(), T(V(l(G)(c.value.nodeToRender.type)), {
|
|
161
168
|
key: 1,
|
|
162
169
|
ref: (C) => e.value = C,
|
|
163
|
-
"tree-node":
|
|
170
|
+
"tree-node": c.value.nodeToRender
|
|
164
171
|
}, null, 8, ["tree-node"])) : B("", !0)
|
|
165
172
|
], 4)
|
|
166
173
|
], 32)) : B("", !0)
|
|
167
|
-
], 12,
|
|
174
|
+
], 12, ge));
|
|
168
175
|
}
|
|
169
|
-
}),
|
|
176
|
+
}), we = /* @__PURE__ */ D(be, [["__scopeId", "data-v-f734ffc6"]]), Re = ["id"], Ce = /* @__PURE__ */ w({
|
|
170
177
|
__name: "RootLayer",
|
|
171
178
|
props: {
|
|
172
179
|
treeNode: {},
|
|
173
180
|
widgetId: {}
|
|
174
181
|
},
|
|
175
|
-
setup(
|
|
176
|
-
const
|
|
177
|
-
return (
|
|
182
|
+
setup(o) {
|
|
183
|
+
const n = o, { uid: s, config: e } = x(_.ROOT_LAYER, n), { elementRef: a } = N(() => new q(s.value, e.value));
|
|
184
|
+
return (i, t) => (f(), g("div", {
|
|
178
185
|
id: l(s),
|
|
179
186
|
ref_key: "elementRef",
|
|
180
|
-
ref:
|
|
187
|
+
ref: a,
|
|
181
188
|
class: "omnipad-virtual-layer"
|
|
182
189
|
}, [
|
|
183
|
-
|
|
184
|
-
nodes:
|
|
190
|
+
M(X, {
|
|
191
|
+
nodes: o.treeNode?.children || []
|
|
185
192
|
}, {
|
|
186
|
-
default:
|
|
187
|
-
|
|
193
|
+
default: Z(() => [
|
|
194
|
+
h(i.$slots, "default", {}, void 0, !0)
|
|
188
195
|
]),
|
|
189
196
|
_: 3
|
|
190
197
|
}, 8, ["nodes"])
|
|
191
|
-
], 8,
|
|
198
|
+
], 8, Re));
|
|
192
199
|
}
|
|
193
|
-
}),
|
|
200
|
+
}), Te = /* @__PURE__ */ D(Ce, [["__scopeId", "data-v-9e46ef9c"]]), he = ["id"], Ie = {
|
|
194
201
|
key: 0,
|
|
195
202
|
class: "omnipad-default-focus-border-feedback"
|
|
196
|
-
},
|
|
203
|
+
}, Ne = /* @__PURE__ */ w({
|
|
197
204
|
__name: "TargetZone",
|
|
198
205
|
props: {
|
|
199
206
|
treeNode: {},
|
|
@@ -202,84 +209,90 @@ const Pe = ["id"], _e = /* @__PURE__ */ b({
|
|
|
202
209
|
cursorAutoDelay: {},
|
|
203
210
|
layout: {}
|
|
204
211
|
},
|
|
205
|
-
setup(
|
|
206
|
-
const
|
|
212
|
+
setup(o) {
|
|
213
|
+
const n = o, s = {
|
|
207
214
|
cursorAutoDelay: 2500
|
|
208
|
-
}, { uid: e, config:
|
|
209
|
-
|
|
210
|
-
|
|
215
|
+
}, { uid: e, config: a } = x(
|
|
216
|
+
_.TARGET_ZONE,
|
|
217
|
+
n,
|
|
211
218
|
s
|
|
212
|
-
), { core:
|
|
213
|
-
() => new
|
|
214
|
-
), m =
|
|
215
|
-
|
|
216
|
-
|
|
219
|
+
), { core: i, state: t, elementRef: d } = N(
|
|
220
|
+
() => new ee(e.value, a.value)
|
|
221
|
+
), m = P(() => L(a.value.layout)), v = P(() => {
|
|
222
|
+
const y = i?.value?.getRect(), E = t?.value?.position;
|
|
223
|
+
return {
|
|
224
|
+
x: U(E?.x || 0, 0, 100, 0, y?.width || 0),
|
|
225
|
+
y: U(E?.y || 0, 0, 100, 0, y?.height || 0)
|
|
226
|
+
};
|
|
227
|
+
}), c = P(() => t.value ? {
|
|
228
|
+
"--omnipad-virtual-cursor-x": `${v.value.x}px`,
|
|
229
|
+
"--omnipad-virtual-cursor-y": `${v.value.y}px`,
|
|
217
230
|
opacity: t.value.isVisible ? 1 : 0
|
|
218
|
-
} : { display: "none" }),
|
|
219
|
-
return (y,
|
|
231
|
+
} : { display: "none" }), p = (y) => i.value?.onPointerDown(y), r = (y) => i.value?.onPointerMove(y), R = (y) => i.value?.onPointerUp(y), k = (y) => i.value?.onPointerCancel(y);
|
|
232
|
+
return (y, E) => (f(), g("div", {
|
|
220
233
|
id: l(e),
|
|
221
234
|
ref_key: "elementRef",
|
|
222
235
|
ref: d,
|
|
223
236
|
class: "omnipad-target-zone",
|
|
224
237
|
style: $(m.value),
|
|
225
|
-
onPointerdown:
|
|
226
|
-
onPointermove:
|
|
227
|
-
onPointerup:
|
|
228
|
-
onPointercancel:
|
|
229
|
-
onLostpointercapture:
|
|
238
|
+
onPointerdown: p,
|
|
239
|
+
onPointermove: r,
|
|
240
|
+
onPointerup: R,
|
|
241
|
+
onPointercancel: k,
|
|
242
|
+
onLostpointercapture: k
|
|
230
243
|
}, [
|
|
231
|
-
|
|
244
|
+
h(y.$slots, "focus-feedback", {
|
|
232
245
|
state: l(t),
|
|
233
246
|
isReturning: l(t)?.isFocusReturning,
|
|
234
|
-
cursorPos:
|
|
247
|
+
cursorPos: v.value
|
|
235
248
|
}, () => [
|
|
236
|
-
|
|
237
|
-
default:
|
|
238
|
-
l(t)?.isFocusReturning ? (
|
|
249
|
+
M(ye, { name: "omnipad-default-focus-fade" }, {
|
|
250
|
+
default: Z(() => [
|
|
251
|
+
l(t)?.isFocusReturning ? (f(), g("div", Ie)) : B("", !0)
|
|
239
252
|
]),
|
|
240
253
|
_: 1
|
|
241
254
|
})
|
|
242
255
|
], !0),
|
|
243
|
-
l(
|
|
256
|
+
l(a).cursorEnabled ? (f(), g("div", {
|
|
244
257
|
key: 0,
|
|
245
258
|
class: "omnipad-virtual-cursor",
|
|
246
|
-
style: $(
|
|
259
|
+
style: $(c.value)
|
|
247
260
|
}, [
|
|
248
|
-
|
|
261
|
+
h(y.$slots, "cursor", {
|
|
249
262
|
state: l(t),
|
|
250
263
|
isDown: l(t)?.isPointerDown,
|
|
251
|
-
cursorPos:
|
|
264
|
+
cursorPos: v.value
|
|
252
265
|
}, () => [
|
|
253
|
-
|
|
254
|
-
class:
|
|
266
|
+
F("div", {
|
|
267
|
+
class: W(["omnipad-default-cursor-dot", { "is-down": l(t)?.isPointerDown }])
|
|
255
268
|
}, null, 2)
|
|
256
269
|
], !0)
|
|
257
270
|
], 4)) : B("", !0)
|
|
258
|
-
], 44,
|
|
271
|
+
], 44, he));
|
|
259
272
|
}
|
|
260
|
-
}),
|
|
273
|
+
}), De = /* @__PURE__ */ D(Ne, [["__scopeId", "data-v-3067b26e"]]), xe = {
|
|
261
274
|
key: 0,
|
|
262
275
|
class: "omnipad-button-label"
|
|
263
|
-
},
|
|
276
|
+
}, Ee = /* @__PURE__ */ w({
|
|
264
277
|
__name: "VirtualButtonBase",
|
|
265
278
|
props: {
|
|
266
279
|
layout: {},
|
|
267
280
|
isActive: { type: Boolean },
|
|
268
281
|
label: {}
|
|
269
282
|
},
|
|
270
|
-
setup(
|
|
271
|
-
const
|
|
272
|
-
return (e,
|
|
273
|
-
class:
|
|
283
|
+
setup(o) {
|
|
284
|
+
const n = o, s = P(() => n.layout ? L(n.layout) : {});
|
|
285
|
+
return (e, a) => (f(), g("div", {
|
|
286
|
+
class: W(["omnipad-button-base", { "is-active": o.isActive }]),
|
|
274
287
|
style: $(s.value),
|
|
275
288
|
tabindex: "-1"
|
|
276
289
|
}, [
|
|
277
|
-
|
|
278
|
-
|
|
290
|
+
h(e.$slots, "default", {}, () => [
|
|
291
|
+
o.label ? (f(), g("span", xe, me(o.label), 1)) : B("", !0)
|
|
279
292
|
], !0)
|
|
280
293
|
], 6));
|
|
281
294
|
}
|
|
282
|
-
}),
|
|
295
|
+
}), K = /* @__PURE__ */ D(Ee, [["__scopeId", "data-v-3db6d4f9"]]), $e = /* @__PURE__ */ w({
|
|
283
296
|
__name: "VirtualKeyboardButton",
|
|
284
297
|
props: {
|
|
285
298
|
treeNode: {},
|
|
@@ -289,35 +302,35 @@ const Pe = ["id"], _e = /* @__PURE__ */ b({
|
|
|
289
302
|
mapping: {},
|
|
290
303
|
layout: {}
|
|
291
304
|
},
|
|
292
|
-
setup(
|
|
293
|
-
const s =
|
|
305
|
+
setup(o, { expose: n }) {
|
|
306
|
+
const s = o, e = {
|
|
294
307
|
label: "BTN"
|
|
295
|
-
}, { uid:
|
|
296
|
-
|
|
308
|
+
}, { uid: a, config: i } = x(
|
|
309
|
+
_.KEYBOARD_BUTTON,
|
|
297
310
|
s,
|
|
298
311
|
e
|
|
299
|
-
), { core: t, state: d, elementRef: m } =
|
|
300
|
-
() => new
|
|
301
|
-
),
|
|
302
|
-
return
|
|
303
|
-
uid:
|
|
304
|
-
onPointerDown:
|
|
305
|
-
onPointerUp:
|
|
306
|
-
onPointerCancel:
|
|
307
|
-
}), (r, R) => (
|
|
308
|
-
id: l(
|
|
312
|
+
), { core: t, state: d, elementRef: m } = N(
|
|
313
|
+
() => new te(a.value, i.value)
|
|
314
|
+
), v = (r) => t.value?.onPointerDown(r), c = (r) => t.value?.onPointerUp(r), p = (r) => t.value?.onPointerCancel(r);
|
|
315
|
+
return n({
|
|
316
|
+
uid: a,
|
|
317
|
+
onPointerDown: v,
|
|
318
|
+
onPointerUp: c,
|
|
319
|
+
onPointerCancel: p
|
|
320
|
+
}), (r, R) => (f(), T(K, {
|
|
321
|
+
id: l(a),
|
|
309
322
|
ref_key: "elementRef",
|
|
310
323
|
ref: m,
|
|
311
|
-
layout: l(
|
|
312
|
-
label: l(
|
|
324
|
+
layout: l(i).layout,
|
|
325
|
+
label: l(i).label,
|
|
313
326
|
"is-active": l(d)?.isPressed,
|
|
314
|
-
onPointerdown:
|
|
315
|
-
onPointerup:
|
|
316
|
-
onPointercancel:
|
|
317
|
-
onLostpointercapture:
|
|
327
|
+
onPointerdown: v,
|
|
328
|
+
onPointerup: c,
|
|
329
|
+
onPointercancel: p,
|
|
330
|
+
onLostpointercapture: p
|
|
318
331
|
}, null, 8, ["id", "layout", "label", "is-active"]));
|
|
319
332
|
}
|
|
320
|
-
}),
|
|
333
|
+
}), Be = /* @__PURE__ */ w({
|
|
321
334
|
__name: "VirtualMouseButton",
|
|
322
335
|
props: {
|
|
323
336
|
treeNode: {},
|
|
@@ -328,36 +341,36 @@ const Pe = ["id"], _e = /* @__PURE__ */ b({
|
|
|
328
341
|
fixedPoint: {},
|
|
329
342
|
layout: {}
|
|
330
343
|
},
|
|
331
|
-
setup(
|
|
332
|
-
const s =
|
|
344
|
+
setup(o, { expose: n }) {
|
|
345
|
+
const s = o, e = {
|
|
333
346
|
label: "LMB",
|
|
334
347
|
button: 0
|
|
335
|
-
}, { uid:
|
|
336
|
-
|
|
348
|
+
}, { uid: a, config: i } = x(
|
|
349
|
+
_.MOUSE_BUTTON,
|
|
337
350
|
s,
|
|
338
351
|
e
|
|
339
|
-
), { core: t, state: d, elementRef: m } =
|
|
340
|
-
() => new
|
|
341
|
-
),
|
|
342
|
-
return
|
|
343
|
-
uid:
|
|
344
|
-
onPointerDown:
|
|
345
|
-
onPointerUp:
|
|
346
|
-
onPointerCancel:
|
|
347
|
-
}), (r, R) => (
|
|
348
|
-
id: l(
|
|
352
|
+
), { core: t, state: d, elementRef: m } = N(
|
|
353
|
+
() => new ne(a.value, i.value)
|
|
354
|
+
), v = (r) => t.value?.onPointerDown(r), c = (r) => t.value?.onPointerUp(r), p = (r) => t.value?.onPointerCancel(r);
|
|
355
|
+
return n({
|
|
356
|
+
uid: a,
|
|
357
|
+
onPointerDown: v,
|
|
358
|
+
onPointerUp: c,
|
|
359
|
+
onPointerCancel: p
|
|
360
|
+
}), (r, R) => (f(), T(K, {
|
|
361
|
+
id: l(a),
|
|
349
362
|
ref_key: "elementRef",
|
|
350
363
|
ref: m,
|
|
351
|
-
layout: l(
|
|
352
|
-
label: l(
|
|
364
|
+
layout: l(i).layout,
|
|
365
|
+
label: l(i).label,
|
|
353
366
|
"is-active": l(d)?.isPressed,
|
|
354
|
-
onPointerdown:
|
|
355
|
-
onPointerup:
|
|
356
|
-
onPointercancel:
|
|
357
|
-
onLostpointercapture:
|
|
367
|
+
onPointerdown: v,
|
|
368
|
+
onPointerup: c,
|
|
369
|
+
onPointercancel: p,
|
|
370
|
+
onLostpointercapture: p
|
|
358
371
|
}, null, 8, ["id", "layout", "label", "is-active"]));
|
|
359
372
|
}
|
|
360
|
-
}),
|
|
373
|
+
}), ke = /* @__PURE__ */ w({
|
|
361
374
|
__name: "VirtualTrackpad",
|
|
362
375
|
props: {
|
|
363
376
|
treeNode: {},
|
|
@@ -367,47 +380,47 @@ const Pe = ["id"], _e = /* @__PURE__ */ b({
|
|
|
367
380
|
targetStageId: {},
|
|
368
381
|
layout: {}
|
|
369
382
|
},
|
|
370
|
-
setup(
|
|
371
|
-
const s =
|
|
383
|
+
setup(o, { expose: n }) {
|
|
384
|
+
const s = o, { uid: e, config: a } = x(_.TRACKPAD, s, {
|
|
372
385
|
label: "TRACKPAD",
|
|
373
386
|
sensitivity: 1
|
|
374
|
-
}), { core:
|
|
375
|
-
() => new
|
|
376
|
-
), m = (r) =>
|
|
377
|
-
return
|
|
387
|
+
}), { core: i, state: t, elementRef: d } = N(
|
|
388
|
+
() => new oe(e.value, a.value)
|
|
389
|
+
), m = (r) => i.value?.onPointerDown(r), v = (r) => i.value?.onPointerMove(r), c = (r) => i.value?.onPointerUp(r), p = (r) => i.value?.onPointerCancel(r);
|
|
390
|
+
return n({
|
|
378
391
|
uid: e,
|
|
379
392
|
onPointerDown: m,
|
|
380
|
-
onPointerMove:
|
|
381
|
-
onPointerUp:
|
|
382
|
-
onPointerCancel:
|
|
383
|
-
}), (r, R) => (
|
|
393
|
+
onPointerMove: v,
|
|
394
|
+
onPointerUp: c,
|
|
395
|
+
onPointerCancel: p
|
|
396
|
+
}), (r, R) => (f(), T(K, {
|
|
384
397
|
id: l(e),
|
|
385
398
|
ref_key: "elementRef",
|
|
386
399
|
ref: d,
|
|
387
400
|
class: "omnipad-trackpad",
|
|
388
|
-
layout: l(
|
|
389
|
-
label: l(
|
|
401
|
+
layout: l(a).layout,
|
|
402
|
+
label: l(a).label,
|
|
390
403
|
"is-active": l(t)?.isPressed,
|
|
391
404
|
onPointerdown: m,
|
|
392
|
-
onPointermove:
|
|
393
|
-
onPointerup:
|
|
394
|
-
onPointercancel:
|
|
395
|
-
onLostpointercapture:
|
|
405
|
+
onPointermove: v,
|
|
406
|
+
onPointerup: c,
|
|
407
|
+
onPointercancel: p,
|
|
408
|
+
onLostpointercapture: p
|
|
396
409
|
}, null, 8, ["id", "layout", "label", "is-active"]));
|
|
397
410
|
}
|
|
398
|
-
}),
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
411
|
+
}), Oe = /* @__PURE__ */ D(ke, [["__scopeId", "data-v-c28e3a2e"]]);
|
|
412
|
+
I(_.INPUT_ZONE, we);
|
|
413
|
+
I(_.ROOT_LAYER, Te);
|
|
414
|
+
I(_.TARGET_ZONE, De);
|
|
415
|
+
I(_.KEYBOARD_BUTTON, $e);
|
|
416
|
+
I(_.MOUSE_BUTTON, Be);
|
|
417
|
+
I(_.TRACKPAD, Oe);
|
|
405
418
|
export {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
419
|
+
we as InputZone,
|
|
420
|
+
Te as RootLayer,
|
|
421
|
+
De as TargetZone,
|
|
422
|
+
$e as VirtualKeyboardButton,
|
|
423
|
+
Be as VirtualMouseButton,
|
|
424
|
+
Oe as VirtualTrackpad,
|
|
425
|
+
I as registerComponent
|
|
413
426
|
};
|
package/dist/omnipad-vue.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(y,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("@omnipad/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@omnipad/core","vue"],l):(y=typeof globalThis<"u"?globalThis:y||self,l(y.OmnipadVue={},y.OmniPadCore,y.Vue))})(this,(function(y,l,e){"use strict";const N={};function C(r,t){N[r]=t}function v(r){const t=N[r];return t||e.defineComponent({render:()=>e.h("div",{style:"color:red"},`[Unknown: ${r}]`)})}function T(r){const t=e.shallowRef(),s=e.ref(),n=e.ref(null),i=a=>{s.value=a};return e.onMounted(()=>{const a=r();t.value=a,l.Registry.getInstance().register(a),"subscribe"in a&&a.subscribe(i);let o=null;n.value&&(n.value instanceof Element?o=n.value:n.value.$el instanceof Element&&(o=n.value.$el)),o&&"bindRectProvider"in a&&a.bindRectProvider(()=>o.getBoundingClientRect())}),e.onUnmounted(()=>{t.value&&t.value.destroy()}),{core:t,state:s,elementRef:n}}const L={class:"omnipad-virtual-layer-base omnipad-prevent"},Y=e.defineComponent({__name:"VirtualLayerBase",props:{nodes:{}},setup(r){return(t,s)=>(e.openBlock(),e.createElementBlock("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.nodes||[],n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)(n.type)),{key:n.uid,"tree-node":n},null,8,["tree-node"]))),128)),e.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),B=(r,t)=>{const s=r.__vccOpts||r;for(const[n,i]of t)s[n]=i;return s},I=B(Y,[["__scopeId","data-v-6f1860f6"]]);function k(r,t,s={}){const n=t.treeNode,i=n&&n.type===r?n:void 0;n&&n.type!==r&&console.warn(`[OmniPad-Validation] Type mismatch! Component expected "${r}", but received "${n.type}". Config ignored.`);const a=e.inject(l.CONTEXT.PARENT_ID_KEY,e.ref(void 0)),o=e.computed(()=>t.parentId||i?.config?.parentId||a.value),f=e.computed(()=>t.widgetId||i?.uid||l.generateUID(r));e.provide(l.CONTEXT.PARENT_ID_KEY,f);const P=e.computed(()=>{const m=i?.config||{},d=Object.fromEntries(Object.entries(t).filter(([p,c])=>c!==void 0&&p!=="treeNode"&&p!=="widgetId"));return{...s,...m,...d,id:f.value,type:r,parentId:o.value,layout:{...s.layout||{},...m.layout||{},...d.layout||{}}}});return{uid:f,config:P}}const x=["id"],$=B(e.defineComponent({__name:"InputZone",props:{treeNode:{},widgetId:{},layout:{},preventFocusLoss:{}},setup(r){const t=r,s=e.useSlots(),n=e.ref(null),{uid:i,config:a}=k(l.CMP_TYPES.INPUT_ZONE,t),{core:o,state:f,elementRef:P}=T(()=>new l.InputZoneCore(i.value,a.value)),m=e.computed(()=>{const u=t.treeNode?.config?.dynamicWidgetId;return t.treeNode?.children?.filter(b=>b.uid!==u)||[]}),d=e.computed(()=>{const b=(s.dynamicWidget?.()||[]).filter(w=>!(w.type===Comment||w.type===Text)),E=t.treeNode?.children?.find(w=>w.uid===t.treeNode?.config?.dynamicWidgetId),S=b.length>0;return b.length>1&&console.error(`[OmniPad-Validation] InputZone ${i.value} has multiple dynamic widgets in slot. Only the first one will be activated.`),S&&E&&console.warn(`[OmniPad-Validation] InputZone ${i.value} has both Slot and Config dynamic widgets. Config ignored.`),{nodeToRender:S?b[0]:E||null,isFromSlot:S}});e.watch(n,u=>{e.nextTick(()=>{u&&u?.uid&&o.value?.updateConfig({dynamicWidgetId:u.uid})})},{immediate:!0});const p=e.computed(()=>l.resolveLayoutStyle(a.value.layout)),c=e.computed(()=>f.value?.isDynamicActive?{position:"absolute",left:`${f.value.dynamicPosition.x}%`,top:`${f.value.dynamicPosition.y}%`,zIndex:100,pointerEvents:"auto"}:{display:"none"}),g=u=>{o.value&&(o.value.onPointerDown(u),f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerDown=="function"&&n.value.onPointerDown(u))},_=u=>{o.value&&(o.value.onPointerMove(u),f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerMove=="function"&&n.value.onPointerMove(u))},U=u=>{f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerUp=="function"&&n.value.onPointerUp(u),o.value&&o.value.onPointerUp(u)},A=u=>{f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerCancel=="function"&&n.value.onPointerCancel(u),o.value&&o.value.onPointerCancel(u)};return(u,b)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(i),ref_key:"elementRef",ref:P,class:"omnipad-input-zone omnipad-prevent",style:e.normalizeStyle(p.value)},[e.createVNode(I,{nodes:m.value},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},8,["nodes"]),d.value.nodeToRender||e.unref(o)?.isInterceptorRequired?(e.openBlock(),e.createElementBlock("div",{key:0,class:"omnipad-input-zone-trigger",onPointerdown:g,onPointermove:_,onPointerup:U,onPointercancel:A,onLostpointercapture:A},[e.createElementVNode("div",{class:"dynamic-widget-mount",style:e.normalizeStyle(c.value)},[d.value.isFromSlot?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value.nodeToRender),{key:0,ref:E=>n.value=E},null,512)):d.value.nodeToRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)(d.value.nodeToRender.type)),{key:1,ref:E=>n.value=E,"tree-node":d.value.nodeToRender},null,8,["tree-node"])):e.createCommentVNode("",!0)],4)],32)):e.createCommentVNode("",!0)],12,x))}}),[["__scopeId","data-v-e0c28ebd"]]),Z=["id"],h=B(e.defineComponent({__name:"RootLayer",props:{treeNode:{},widgetId:{}},setup(r){const t=r,{uid:s,config:n}=k(l.CMP_TYPES.ROOT_LAYER,t),{elementRef:i}=T(()=>new l.RootLayerCore(s.value,n.value));return(a,o)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(s),ref_key:"elementRef",ref:i,class:"omnipad-virtual-layer"},[e.createVNode(I,{nodes:r.treeNode?.children||[]},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["nodes"])],8,Z))}}),[["__scopeId","data-v-9e46ef9c"]]),z=["id"],K={key:0,class:"omnipad-default-focus-border-feedback"},D=B(e.defineComponent({__name:"TargetZone",props:{treeNode:{},widgetId:{},cursorEnabled:{type:Boolean},cursorAutoDelay:{},layout:{}},setup(r){const t=r,s={cursorAutoDelay:2500},{uid:n,config:i}=k(l.CMP_TYPES.TARGET_ZONE,t,s),{core:a,state:o,elementRef:f}=T(()=>new l.TargetZoneCore(n.value,i.value)),P=e.computed(()=>l.resolveLayoutStyle(i.value.layout)),m=e.computed(()=>o.value?{left:`${o.value.position.x}%`,top:`${o.value.position.y}%`,opacity:o.value.isVisible?1:0}:{display:"none"}),d=_=>a.value?.onPointerDown(_),p=_=>a.value?.onPointerMove(_),c=_=>a.value?.onPointerUp(_),g=_=>a.value?.onPointerCancel(_);return(_,U)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(n),ref_key:"elementRef",ref:f,class:"omnipad-target-zone",style:e.normalizeStyle(P.value),onPointerdown:d,onPointermove:p,onPointerup:c,onPointercancel:g,onLostpointercapture:g},[e.renderSlot(_.$slots,"focus-feedback",{state:e.unref(o),isReturning:e.unref(o)?.isFocusReturning,cursorPos:e.unref(o)?.position},()=>[e.createVNode(e.Transition,{name:"omnipad-default-focus-fade"},{default:e.withCtx(()=>[e.unref(o)?.isFocusReturning?(e.openBlock(),e.createElementBlock("div",K)):e.createCommentVNode("",!0)]),_:1})],!0),e.unref(i).cursorEnabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"omnipad-virtual-cursor",style:e.normalizeStyle(m.value)},[e.renderSlot(_.$slots,"cursor",{state:e.unref(o),isDown:e.unref(o)?.isPointerDown,cursorPos:e.unref(o)?.position},()=>[e.createElementVNode("div",{class:e.normalizeClass(["omnipad-default-cursor-dot",{"is-down":e.unref(o)?.isPointerDown}])},null,2)],!0)],4)):e.createCommentVNode("",!0)],44,z))}}),[["__scopeId","data-v-70b706ac"]]),j={key:0,class:"omnipad-button-label"},R=B(e.defineComponent({__name:"VirtualButtonBase",props:{layout:{},isActive:{type:Boolean},label:{}},setup(r){const t=r,s=e.computed(()=>t.layout?l.resolveLayoutStyle(t.layout):{});return(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["omnipad-button-base",{"is-active":r.isActive}]),style:e.normalizeStyle(s.value),tabindex:"-1"},[e.renderSlot(n.$slots,"default",{},()=>[r.label?(e.openBlock(),e.createElementBlock("span",j,e.toDisplayString(r.label),1)):e.createCommentVNode("",!0)],!0)],6))}}),[["__scopeId","data-v-3db6d4f9"]]),M=e.defineComponent({__name:"VirtualKeyboardButton",props:{treeNode:{},widgetId:{},label:{},targetStageId:{},mapping:{},layout:{}},setup(r,{expose:t}){const s=r,n={label:"BTN"},{uid:i,config:a}=k(l.CMP_TYPES.KEYBOARD_BUTTON,s,n),{core:o,state:f,elementRef:P}=T(()=>new l.KeyboardButtonCore(i.value,a.value)),m=c=>o.value?.onPointerDown(c),d=c=>o.value?.onPointerUp(c),p=c=>o.value?.onPointerCancel(c);return t({uid:i,onPointerDown:m,onPointerUp:d,onPointerCancel:p}),(c,g)=>(e.openBlock(),e.createBlock(R,{id:e.unref(i),ref_key:"elementRef",ref:P,layout:e.unref(a).layout,label:e.unref(a).label,"is-active":e.unref(f)?.isPressed,onPointerdown:m,onPointerup:d,onPointercancel:p,onLostpointercapture:p},null,8,["id","layout","label","is-active"]))}}),O=e.defineComponent({__name:"VirtualMouseButton",props:{treeNode:{},widgetId:{},label:{},targetStageId:{},button:{},fixedPoint:{},layout:{}},setup(r,{expose:t}){const s=r,n={label:"LMB",button:0},{uid:i,config:a}=k(l.CMP_TYPES.MOUSE_BUTTON,s,n),{core:o,state:f,elementRef:P}=T(()=>new l.MouseButtonCore(i.value,a.value)),m=c=>o.value?.onPointerDown(c),d=c=>o.value?.onPointerUp(c),p=c=>o.value?.onPointerCancel(c);return t({uid:i,onPointerDown:m,onPointerUp:d,onPointerCancel:p}),(c,g)=>(e.openBlock(),e.createBlock(R,{id:e.unref(i),ref_key:"elementRef",ref:P,layout:e.unref(a).layout,label:e.unref(a).label,"is-active":e.unref(f)?.isPressed,onPointerdown:m,onPointerup:d,onPointercancel:p,onLostpointercapture:p},null,8,["id","layout","label","is-active"]))}}),V=B(e.defineComponent({__name:"VirtualTrackpad",props:{treeNode:{},widgetId:{},label:{},sensitivity:{},targetStageId:{},layout:{}},setup(r,{expose:t}){const s=r,{uid:n,config:i}=k(l.CMP_TYPES.TRACKPAD,s,{label:"TRACKPAD",sensitivity:1}),{core:a,state:o,elementRef:f}=T(()=>new l.TrackpadCore(n.value,i.value)),P=c=>a.value?.onPointerDown(c),m=c=>a.value?.onPointerMove(c),d=c=>a.value?.onPointerUp(c),p=c=>a.value?.onPointerCancel(c);return t({uid:n,onPointerDown:P,onPointerMove:m,onPointerUp:d,onPointerCancel:p}),(c,g)=>(e.openBlock(),e.createBlock(R,{id:e.unref(n),ref_key:"elementRef",ref:f,class:"omnipad-trackpad",layout:e.unref(i).layout,label:e.unref(i).label,"is-active":e.unref(o)?.isPressed,onPointerdown:P,onPointermove:m,onPointerup:d,onPointercancel:p,onLostpointercapture:p},null,8,["id","layout","label","is-active"]))}}),[["__scopeId","data-v-c28e3a2e"]]);C(l.CMP_TYPES.INPUT_ZONE,$),C(l.CMP_TYPES.ROOT_LAYER,h),C(l.CMP_TYPES.TARGET_ZONE,D),C(l.CMP_TYPES.KEYBOARD_BUTTON,M),C(l.CMP_TYPES.MOUSE_BUTTON,O),C(l.CMP_TYPES.TRACKPAD,V),y.InputZone=$,y.RootLayer=h,y.TargetZone=D,y.VirtualKeyboardButton=M,y.VirtualMouseButton=O,y.VirtualTrackpad=V,y.registerComponent=C,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(P,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@omnipad/core"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@omnipad/core","vue"],a):(P=typeof globalThis<"u"?globalThis:P||self,a(P.OmnipadVue={},P.OmniPadCore,P.Vue))})(this,(function(P,a,e){"use strict";const h={};function C(i,o){h[i]=o}function I(i){const o=h[i];return o||e.defineComponent({render:()=>e.h("div",{style:"color:red"},`[Unknown: ${i}]`)})}function T(i){const o=e.shallowRef(),s=e.ref(),n=e.ref(null),l=r=>{s.value=r};return e.onMounted(()=>{const r=i();o.value=r,a.Registry.getInstance().register(r),"subscribe"in r&&r.subscribe(l);let t=null;n.value&&(n.value instanceof Element?t=n.value:n.value.$el instanceof Element&&(t=n.value.$el)),t&&"bindRectProvider"in r&&r.bindRectProvider(()=>t.getBoundingClientRect())}),e.onUnmounted(()=>{o.value&&o.value.destroy()}),{core:o,state:s,elementRef:n}}const L={class:"omnipad-virtual-layer-base omnipad-prevent"},Y=e.defineComponent({__name:"VirtualLayerBase",props:{nodes:{}},setup(i){return(o,s)=>(e.openBlock(),e.createElementBlock("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.nodes||[],n=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(I)(n.type)),{key:n.uid,"tree-node":n},null,8,["tree-node"]))),128)),e.renderSlot(o.$slots,"default",{},void 0,!0)]))}}),B=(i,o)=>{const s=i.__vccOpts||i;for(const[n,l]of o)s[n]=l;return s},$=B(Y,[["__scopeId","data-v-6f1860f6"]]);function k(i,o,s={}){const n=o.treeNode,l=n&&n.type===i?n:void 0;n&&n.type!==i&&console.warn(`[OmniPad-Validation] Type mismatch! Component expected "${i}", but received "${n.type}". Config ignored.`);const r=e.inject(a.CONTEXT.PARENT_ID_KEY,e.ref(void 0)),t=e.computed(()=>o.parentId||l?.config?.parentId||r.value),f=e.computed(()=>o.widgetId||l?.uid||a.generateUID(i));e.provide(a.CONTEXT.PARENT_ID_KEY,f);const _=e.computed(()=>{const p=l?.config||{},u=Object.fromEntries(Object.entries(o).filter(([m,c])=>c!==void 0&&m!=="treeNode"&&m!=="widgetId"));return{...s,...p,...u,id:f.value,type:i,parentId:t.value,layout:{...s.layout||{},...p.layout||{},...u.layout||{}}}});return{uid:f,config:_}}const Z=["id"],D=B(e.defineComponent({__name:"InputZone",props:{treeNode:{},widgetId:{},layout:{},preventFocusLoss:{}},setup(i){const o=i,s=e.useSlots(),n=e.ref(null),{uid:l,config:r}=k(a.CMP_TYPES.INPUT_ZONE,o),{core:t,state:f,elementRef:_}=T(()=>new a.InputZoneCore(l.value,r.value)),p=e.computed(()=>{const d=o.treeNode?.config?.dynamicWidgetId;return o.treeNode?.children?.filter(g=>g.uid!==d)||[]}),u=e.computed(()=>{const g=(s.dynamicWidget?.()||[]).filter(R=>!(R.type===Comment||R.type===Text)),v=o.treeNode?.children?.find(R=>R.uid===o.treeNode?.config?.dynamicWidgetId),N=g.length>0;return g.length>1&&console.error(`[OmniPad-Validation] InputZone ${l.value} has multiple dynamic widgets in slot. Only the first one will be activated.`),N&&v&&console.warn(`[OmniPad-Validation] InputZone ${l.value} has both Slot and Config dynamic widgets. Config ignored.`),{nodeToRender:N?g[0]:v||null,isFromSlot:N}});e.watch(n,d=>{e.nextTick(()=>{d&&d?.uid&&t.value?.updateConfig({dynamicWidgetId:d.uid})})},{immediate:!0});const m=e.computed(()=>a.resolveLayoutStyle(r.value.layout)),c=e.computed(()=>{const d=t?.value?.getRect(),g=f?.value?.dynamicPosition;return{x:a.remap(g?.x||0,0,100,0,d?.width||0),y:a.remap(g?.y||0,0,100,0,d?.height||0)}}),b=e.computed(()=>f.value?f.value?.isDynamicActive?{zIndex:100,"--dynamic-widget-mount-x":`${c.value.x}px`,"--dynamic-widget-mount-y":`${c.value.y}px`,visibility:"visible",opacity:1,pointerEvents:"auto"}:{visibility:"hidden",opacity:0}:{display:"none"}),E=d=>{t.value&&(t.value.onPointerDown(d),f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerDown=="function"&&n.value.onPointerDown(d))},y=d=>{t.value&&(t.value.onPointerMove(d),f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerMove=="function"&&n.value.onPointerMove(d))},w=d=>{f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerUp=="function"&&n.value.onPointerUp(d),t.value&&t.value.onPointerUp(d)},A=d=>{f.value?.isDynamicActive&&n.value&&typeof n.value.onPointerCancel=="function"&&n.value.onPointerCancel(d),t.value&&t.value.onPointerCancel(d)};return(d,g)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(l),ref_key:"elementRef",ref:_,class:"omnipad-input-zone omnipad-prevent",style:e.normalizeStyle(m.value)},[e.createVNode($,{nodes:p.value},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",{},void 0,!0)]),_:3},8,["nodes"]),u.value.nodeToRender||e.unref(t)?.isInterceptorRequired?(e.openBlock(),e.createElementBlock("div",{key:0,class:"omnipad-input-zone-trigger",onPointerdown:E,onPointermove:y,onPointerup:w,onPointercancel:A,onLostpointercapture:A},[e.createElementVNode("div",{class:"dynamic-widget-mount",style:e.normalizeStyle(b.value)},[u.value.isFromSlot?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value.nodeToRender),{key:0,ref:v=>n.value=v},null,512)):u.value.nodeToRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(I)(u.value.nodeToRender.type)),{key:1,ref:v=>n.value=v,"tree-node":u.value.nodeToRender},null,8,["tree-node"])):e.createCommentVNode("",!0)],4)],32)):e.createCommentVNode("",!0)],12,Z))}}),[["__scopeId","data-v-f734ffc6"]]),z=["id"],M=B(e.defineComponent({__name:"RootLayer",props:{treeNode:{},widgetId:{}},setup(i){const o=i,{uid:s,config:n}=k(a.CMP_TYPES.ROOT_LAYER,o),{elementRef:l}=T(()=>new a.RootLayerCore(s.value,n.value));return(r,t)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(s),ref_key:"elementRef",ref:l,class:"omnipad-virtual-layer"},[e.createVNode($,{nodes:i.treeNode?.children||[]},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},void 0,!0)]),_:3},8,["nodes"])],8,z))}}),[["__scopeId","data-v-9e46ef9c"]]),K=["id"],j={key:0,class:"omnipad-default-focus-border-feedback"},O=B(e.defineComponent({__name:"TargetZone",props:{treeNode:{},widgetId:{},cursorEnabled:{type:Boolean},cursorAutoDelay:{},layout:{}},setup(i){const o=i,s={cursorAutoDelay:2500},{uid:n,config:l}=k(a.CMP_TYPES.TARGET_ZONE,o,s),{core:r,state:t,elementRef:f}=T(()=>new a.TargetZoneCore(n.value,l.value)),_=e.computed(()=>a.resolveLayoutStyle(l.value.layout)),p=e.computed(()=>{const y=r?.value?.getRect(),w=t?.value?.position;return{x:a.remap(w?.x||0,0,100,0,y?.width||0),y:a.remap(w?.y||0,0,100,0,y?.height||0)}}),u=e.computed(()=>t.value?{"--omnipad-virtual-cursor-x":`${p.value.x}px`,"--omnipad-virtual-cursor-y":`${p.value.y}px`,opacity:t.value.isVisible?1:0}:{display:"none"}),m=y=>r.value?.onPointerDown(y),c=y=>r.value?.onPointerMove(y),b=y=>r.value?.onPointerUp(y),E=y=>r.value?.onPointerCancel(y);return(y,w)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(n),ref_key:"elementRef",ref:f,class:"omnipad-target-zone",style:e.normalizeStyle(_.value),onPointerdown:m,onPointermove:c,onPointerup:b,onPointercancel:E,onLostpointercapture:E},[e.renderSlot(y.$slots,"focus-feedback",{state:e.unref(t),isReturning:e.unref(t)?.isFocusReturning,cursorPos:p.value},()=>[e.createVNode(e.Transition,{name:"omnipad-default-focus-fade"},{default:e.withCtx(()=>[e.unref(t)?.isFocusReturning?(e.openBlock(),e.createElementBlock("div",j)):e.createCommentVNode("",!0)]),_:1})],!0),e.unref(l).cursorEnabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"omnipad-virtual-cursor",style:e.normalizeStyle(u.value)},[e.renderSlot(y.$slots,"cursor",{state:e.unref(t),isDown:e.unref(t)?.isPointerDown,cursorPos:p.value},()=>[e.createElementVNode("div",{class:e.normalizeClass(["omnipad-default-cursor-dot",{"is-down":e.unref(t)?.isPointerDown}])},null,2)],!0)],4)):e.createCommentVNode("",!0)],44,K))}}),[["__scopeId","data-v-3067b26e"]]),F={key:0,class:"omnipad-button-label"},S=B(e.defineComponent({__name:"VirtualButtonBase",props:{layout:{},isActive:{type:Boolean},label:{}},setup(i){const o=i,s=e.computed(()=>o.layout?a.resolveLayoutStyle(o.layout):{});return(n,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["omnipad-button-base",{"is-active":i.isActive}]),style:e.normalizeStyle(s.value),tabindex:"-1"},[e.renderSlot(n.$slots,"default",{},()=>[i.label?(e.openBlock(),e.createElementBlock("span",F,e.toDisplayString(i.label),1)):e.createCommentVNode("",!0)],!0)],6))}}),[["__scopeId","data-v-3db6d4f9"]]),V=e.defineComponent({__name:"VirtualKeyboardButton",props:{treeNode:{},widgetId:{},label:{},targetStageId:{},mapping:{},layout:{}},setup(i,{expose:o}){const s=i,n={label:"BTN"},{uid:l,config:r}=k(a.CMP_TYPES.KEYBOARD_BUTTON,s,n),{core:t,state:f,elementRef:_}=T(()=>new a.KeyboardButtonCore(l.value,r.value)),p=c=>t.value?.onPointerDown(c),u=c=>t.value?.onPointerUp(c),m=c=>t.value?.onPointerCancel(c);return o({uid:l,onPointerDown:p,onPointerUp:u,onPointerCancel:m}),(c,b)=>(e.openBlock(),e.createBlock(S,{id:e.unref(l),ref_key:"elementRef",ref:_,layout:e.unref(r).layout,label:e.unref(r).label,"is-active":e.unref(f)?.isPressed,onPointerdown:p,onPointerup:u,onPointercancel:m,onLostpointercapture:m},null,8,["id","layout","label","is-active"]))}}),x=e.defineComponent({__name:"VirtualMouseButton",props:{treeNode:{},widgetId:{},label:{},targetStageId:{},button:{},fixedPoint:{},layout:{}},setup(i,{expose:o}){const s=i,n={label:"LMB",button:0},{uid:l,config:r}=k(a.CMP_TYPES.MOUSE_BUTTON,s,n),{core:t,state:f,elementRef:_}=T(()=>new a.MouseButtonCore(l.value,r.value)),p=c=>t.value?.onPointerDown(c),u=c=>t.value?.onPointerUp(c),m=c=>t.value?.onPointerCancel(c);return o({uid:l,onPointerDown:p,onPointerUp:u,onPointerCancel:m}),(c,b)=>(e.openBlock(),e.createBlock(S,{id:e.unref(l),ref_key:"elementRef",ref:_,layout:e.unref(r).layout,label:e.unref(r).label,"is-active":e.unref(f)?.isPressed,onPointerdown:p,onPointerup:u,onPointercancel:m,onLostpointercapture:m},null,8,["id","layout","label","is-active"]))}}),U=B(e.defineComponent({__name:"VirtualTrackpad",props:{treeNode:{},widgetId:{},label:{},sensitivity:{},targetStageId:{},layout:{}},setup(i,{expose:o}){const s=i,{uid:n,config:l}=k(a.CMP_TYPES.TRACKPAD,s,{label:"TRACKPAD",sensitivity:1}),{core:r,state:t,elementRef:f}=T(()=>new a.TrackpadCore(n.value,l.value)),_=c=>r.value?.onPointerDown(c),p=c=>r.value?.onPointerMove(c),u=c=>r.value?.onPointerUp(c),m=c=>r.value?.onPointerCancel(c);return o({uid:n,onPointerDown:_,onPointerMove:p,onPointerUp:u,onPointerCancel:m}),(c,b)=>(e.openBlock(),e.createBlock(S,{id:e.unref(n),ref_key:"elementRef",ref:f,class:"omnipad-trackpad",layout:e.unref(l).layout,label:e.unref(l).label,"is-active":e.unref(t)?.isPressed,onPointerdown:_,onPointermove:p,onPointerup:u,onPointercancel:m,onLostpointercapture:m},null,8,["id","layout","label","is-active"]))}}),[["__scopeId","data-v-c28e3a2e"]]);C(a.CMP_TYPES.INPUT_ZONE,D),C(a.CMP_TYPES.ROOT_LAYER,M),C(a.CMP_TYPES.TARGET_ZONE,O),C(a.CMP_TYPES.KEYBOARD_BUTTON,V),C(a.CMP_TYPES.MOUSE_BUTTON,x),C(a.CMP_TYPES.TRACKPAD,U),P.InputZone=D,P.RootLayer=M,P.TargetZone=O,P.VirtualKeyboardButton=V,P.VirtualMouseButton=x,P.VirtualTrackpad=U,P.registerComponent=C,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnipad/vue",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/omnipad-vue.umd.js",
|
|
6
6
|
"module": "./dist/omnipad-vue.mjs",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"vue": "^3.5.27"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@omnipad/core": "0.2.0-alpha.
|
|
30
|
+
"@omnipad/core": "0.2.0-alpha.3"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public",
|