@omnipad/vue 0.4.1 → 0.4.2

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