@omnipad/core 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,152 @@
1
+ import { E as EntityType, A as AbstractRect, a as AbstractPointerEvent, c as AnyFunction, I as InputActionSignal } from './index-DVegtw8s.js';
2
+
3
+ /**
4
+ * Trait: Provides identity with a unique ID and specific entity type.
5
+ */
6
+ interface IIdentifiable {
7
+ readonly uid: string;
8
+ readonly type: EntityType;
9
+ }
10
+ /**
11
+ * Trait: Provides lifecycle management hooks.
12
+ */
13
+ interface ILifecycle {
14
+ /**
15
+ * Performs cleanup, unregisters the entity, and releases resources.
16
+ */
17
+ destroy(): void;
18
+ }
19
+ /**
20
+ * The core contract for any object that can be managed by the Registry.
21
+ * Only objects implementing this interface are eligible for registration.
22
+ */
23
+ interface ICoreEntity extends IIdentifiable, ILifecycle {
24
+ }
25
+ /**
26
+ * Trait: Enables spatial awareness for DOM/UI-related components.
27
+ */
28
+ interface ISpatial {
29
+ readonly rect: AbstractRect | null;
30
+ /**
31
+ * Dynamically obtain dimensions and position to ensure the most precise real-time screen coordinates are obtained during each interaction.
32
+ */
33
+ bindRectProvider(provider: () => AbstractRect, onMarkDirty?: () => void): void;
34
+ /**
35
+ * Trigger a cache invalidation.
36
+ */
37
+ markRectDirty(): void;
38
+ }
39
+ /**
40
+ * Trait: Provides configuration management.
41
+ */
42
+ interface IConfigurable<TConfig> {
43
+ /**
44
+ * Retrieves a snapshot of the current configuration.
45
+ */
46
+ getConfig(): TConfig;
47
+ /**
48
+ * Subscribes to config changes.
49
+ * @param cb - Callback function triggered on config updates.
50
+ * @returns An unsubscribe function.
51
+ */
52
+ subscribeConfig(cb: (config: TConfig) => void): () => void;
53
+ /**
54
+ * Updates the internal config and notifies all subscribers.
55
+ * @param config - Partial configuration object to merge.
56
+ */
57
+ updateConfig(config: Partial<TConfig>): void;
58
+ }
59
+ /**
60
+ * Trait: Provides state management.
61
+ */
62
+ interface IStateful<TState> {
63
+ /**
64
+ * Retrieves the current state snapshot.
65
+ */
66
+ getState(): TState;
67
+ /**
68
+ * Subscribes to state changes.
69
+ * @param cb - Callback function triggered on state updates.
70
+ * @returns An unsubscribe function.
71
+ */
72
+ subscribeState(cb: (state: TState) => void): () => void;
73
+ /**
74
+ * Updates the internal state and notifies all subscribers.
75
+ * @param state - Partial object containing updated state values.
76
+ */
77
+ setState(state: Partial<TState>): void;
78
+ }
79
+ /**
80
+ * Trait: Allows resetting the entity to its idle/safe state.
81
+ */
82
+ interface IResettable {
83
+ /**
84
+ * Forcefully clears active states and cuts off outgoing signals.
85
+ */
86
+ reset(): void;
87
+ }
88
+ /**
89
+ * Trait: Handles raw pointer input (Touch/Mouse).
90
+ */
91
+ interface IPointerHandler {
92
+ readonly activePointerId: number | null;
93
+ onPointerDown(e: AbstractPointerEvent): void;
94
+ onPointerMove(e: AbstractPointerEvent): void;
95
+ onPointerUp(e: AbstractPointerEvent): void;
96
+ onPointerCancel(e: AbstractPointerEvent): void;
97
+ }
98
+ /**
99
+ * Trait: Receives and processes input signals (e.g., TargetZone).
100
+ */
101
+ interface ISignalReceiver {
102
+ /**
103
+ * Handles incoming signals from widgets.
104
+ * @param signal - The signal data containing action type and payload.
105
+ */
106
+ handleSignal(signal: InputActionSignal): void;
107
+ }
108
+ /**
109
+ * Capability for an entity to receive and store external functional dependencies.
110
+ *
111
+ * This enables Runtime Dependency Injection (DI), allowing core logic to invoke
112
+ * host-specific methods (such as DOM event dispatchers or custom triggers)
113
+ * without being tightly coupled to the environment.
114
+ */
115
+ interface IDependencyBindable {
116
+ /**
117
+ * Binds a functional delegate by a specific identifier key.
118
+ *
119
+ * @param key - The unique lookup identifier for the dependency (e.g., 'domDispatcher').
120
+ * @param delegate - The function implementation provided by the adapter layer.
121
+ */
122
+ bindDelegate(key: string, delegate: AnyFunction): void;
123
+ }
124
+ /**
125
+ * Contract for widgets that support programmatic control.
126
+ *
127
+ * This interface allows external systems—such as a Physical Gamepad Manager or
128
+ * automation scripts—to directly drive the state and behavior of a widget,
129
+ * bypassing native DOM pointer events.
130
+ */
131
+ interface IProgrammatic {
132
+ /**
133
+ * Manually triggers the 'down' (pressed) state of the widget.
134
+ * Primarily used for Button-type components to simulate a physical press.
135
+ */
136
+ triggerDown?(): void;
137
+ /**
138
+ * Manually triggers the 'up' (released) state of the widget.
139
+ * Primarily used for Button-type components to simulate a physical release.
140
+ */
141
+ triggerUp?(): void;
142
+ /**
143
+ * Manually updates the directional input vector of the widget.
144
+ * Primarily used for Joystick or D-Pad components.
145
+ *
146
+ * @param x - The horizontal component, normalized between -1.0 and 1.0.
147
+ * @param y - The vertical component, normalized between -1.0 and 1.0.
148
+ */
149
+ triggerVector?(x: number, y: number): void;
150
+ }
151
+
152
+ export type { ICoreEntity as I, ISpatial as a, IResettable as b, IConfigurable as c, IStateful as d, IPointerHandler as e, IProgrammatic as f, IDependencyBindable as g, ISignalReceiver as h, IIdentifiable as i, ILifecycle as j };
@@ -1 +1 @@
1
- 'use strict';var chunkFAVAOSNA_cjs=require('../chunk-FAVAOSNA.cjs');function Z(t){let r=null,e=true;return {get:()=>((e||!r)&&(r=t(),e=false),r),markDirty:()=>{e=true;}}}function tt(t,r){let e={};return t?(Object.keys(r).forEach(i=>{let o=r[i],a=t[i];typeof o=="object"&&o!==null?JSON.stringify(o)!==JSON.stringify(a)&&(e[i]=o):o!==a&&(e[i]=o);}),e):{...r}}var v=(t,r,e="omnipad-prevent")=>{let o=document.elementsFromPoint(t,r).find(a=>!a.classList.contains(e));if(!o)return null;for(;o&&o.shadowRoot;){let d=o.shadowRoot.elementsFromPoint(t,r).find(f=>!f.classList.contains(e));if(!d||d===o)break;o=d;}return o},E=()=>{let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t},M=t=>{E()!==t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus());},nt=(t,r)=>{let e=new KeyboardEvent(t,{...r,which:r.keyCode,bubbles:true,cancelable:true,view:window});window.dispatchEvent(e);},rt=(t,r,e,i)=>{let o=v(r,e);if(!o)return;let a={bubbles:true,cancelable:true,composed:true,clientX:r,clientY:e,view:window,...i};if(t.startsWith("pointer")){o.dispatchEvent(new PointerEvent(t,{isPrimary:true,pointerId:9999,pointerType:"mouse",...a}));let d=t.replace("pointer","mouse");o.dispatchEvent(new MouseEvent(d,a));}else o.dispatchEvent(new MouseEvent(t,a));},ot=(t,r,e)=>{let i=v(t,r);if(!i)return;E()!==i&&(M(i),e());},g,it=()=>(g!==void 0||(g=typeof window<"u"&&!!window.CSS?.supports?.("width: 1cqw")),g),T=(t,r)=>{if(t instanceof Element)try{t.setPointerCapture(r);}catch(e){undefined?.DEV&&console.warn("[Omnipad-DOM] Failed to set pointer capture:",e);}},I=(t,r)=>{if(t instanceof Element&&t.hasPointerCapture(r))try{t.releasePointerCapture(r);}catch{}};function at(t,r={}){return {onPointerDown(e){if(!e.isTrusted||r?.requireDirectHit&&e.target!==e.currentTarget||t.activePointerId!=null)return;e.cancelable&&e.preventDefault(),e.stopPropagation();let i=e.currentTarget;i&&T(i,e.pointerId),t.onPointerDown(e);},onPointerMove(e){e.isTrusted&&(t.activePointerId!=null&&t.activePointerId!==e.pointerId||(e.cancelable&&e.preventDefault(),t.onPointerMove(e)));},onPointerUp(e){if(!e.isTrusted||t.activePointerId!=null&&t.activePointerId!==e.pointerId)return;e.cancelable&&e.preventDefault();let i=e.currentTarget;i&&I(i,e.pointerId),t.onPointerUp(e);},onPointerCancel(e){if(!e.isTrusted||t.activePointerId!=null&&t.activePointerId!==e.pointerId)return;let i=e.currentTarget;i&&I(i,e.pointerId),t.onPointerCancel(e);}}}var C=(t="omnipad")=>{let r=Date.now().toString(36),e=Math.random().toString(36).substring(2,6);return `${t}-${r}-${e}`};function m(t){return t.startsWith("$")}function k(t){if(t==null)return {value:0,unit:"px"};if(typeof t=="number")return {value:Number.isFinite(t)?t:0,unit:"px"};let r=t.trim(),e=parseFloat(r);if(isNaN(e))return {value:0,unit:"px"};let i=r.match(/[a-z%]+$/i),o=i?i[0].toLowerCase():"px";return w({value:e,unit:o})}var w=t=>{let{value:r,unit:e}=t;return chunkFAVAOSNA_cjs.e.includes(e)?{value:r,unit:e}:(console.warn(`[Omnipad-Core] Blocked invalid CSS unit: ${e}`),{value:r,unit:"px"})},S=t=>`${t.value}${t.unit}`,gt=t=>{if(Object.keys(t??{}).length===0)return {};let r={};r.position="absolute",t.isSquare&&(r.aspectRatio="1/1"),["left","top","right","bottom","width","height"].forEach(o=>{let a=t[o];if(a!=null){if(typeof a=="object"&&"unit"in a){let d=w(a);r[o]=S(d);}else if(typeof a=="string"||typeof a=="number"){let d=k(a);r[o]=S(d);}}}),t.zIndex!==void 0&&(r.zIndex=t.zIndex);let i={"top-left":"translate(0, 0)","top-center":"translate(-50%, 0)","top-right":"translate(-100%, 0)","center-left":"translate(0, -50%)",center:"translate(-50%, -50%)","center-right":"translate(-100%, -50%)","bottom-left":"translate(0, -100%)","bottom-center":"translate(-50%, -100%)","bottom-right":"translate(-100%, -100%)"};return t.anchor&&(r.transform=i[t.anchor]),r};function Pt(t){if(!t||typeof t!="object")throw new Error("[OmniPad-Validation] Profile must be a valid JSON object.");if(!Array.isArray(t.items))throw new Error('[OmniPad-Validation] "items" must be an array.');let r={name:t.meta?.name||"Untitled Profile",version:t.meta?.version||"1.0.0",author:t.meta?.author||"Unknown"},e=t.items.map((o,a)=>{if(!o.id||!o.type)throw new Error(`[OmniPad-Validation] Item at index ${a} is missing "id" or "type".`);return {id:String(o.id),type:String(o.type),parentId:o.parentId?String(o.parentId):void 0,config:o.config||{}}}),i=t.gamepadMappings;return {meta:r,items:e,gamepadMappings:i}}function yt(t){let{items:r,gamepadMappings:e}=t,i=new Map,o=(n,s="node")=>m(n)?n:(i.has(n)||i.set(n,C(s)),i.get(n));r.forEach(n=>o(n.id,n.type));let a=[];e&&e.forEach(n=>{let s={};if(n.buttons){s.buttons={};for(let[u,c]of Object.entries(n.buttons))s.buttons[u]=o(c);}n.dpad&&(s.dpad=o(n.dpad)),n.leftStick&&(s.leftStick=o(n.leftStick)),n.rightStick&&(s.rightStick=o(n.rightStick)),a.push(s);});let d=new Map,f=[];r.forEach(n=>{n.parentId?(d.has(n.parentId)||d.set(n.parentId,[]),d.get(n.parentId).push(n)):f.push(n);});let l=(n,s)=>{if(s.has(n.id))throw new Error(`[Omnipad-Core] Circular dependency detected at node: ${n.id}`);s.add(n.id);let u={...n.config};u?.targetStageId&&(u.targetStageId=o(u.targetStageId)),u?.dynamicWidgetId&&(u.dynamicWidgetId=o(u.dynamicWidgetId));let h=(d.get(n.id)||[]).map(b=>l(b,new Set(s)));return {uid:o(n.id),type:n.type,config:u,children:h}},p={};return f.forEach(n=>{p[n.id]=l(n,new Set);}),{roots:p,runtimeGamepadMappings:a}}function It(t,r,e){let i=chunkFAVAOSNA_cjs.g.getInstance(),o=[];if(!r||r.length===0)o=i.getAllEntities();else {let n=new Set;r.forEach(s=>{i.getEntitiesByRoot(s).forEach(c=>n.add(c));}),o=Array.from(n);}let a=new Map,d=0,f=n=>m(n)?n:(a.has(n)||a.set(n,`node_${++d}`),a.get(n)),l=o.map(n=>{let s=n.getConfig(),u=n.uid,c={...s};c.targetStageId&&(c.targetStageId=f(c.targetStageId)),c.dynamicWidgetId&&(c.dynamicWidgetId=f(c.dynamicWidgetId));let{id:h,parentId:b,...x}=c;return {id:f(u),type:n.type,parentId:s.parentId?f(s.parentId):void 0,config:x}}),p=[];return e&&e.forEach(n=>{let s={};if(n.buttons){s.buttons={};for(let[u,c]of Object.entries(n.buttons))a.has(c)&&(s.buttons[u]=a.get(c));}n.dpad&&a.has(n.dpad)&&(s.dpad=a.get(n.dpad)),n.leftStick&&a.has(n.leftStick)&&(s.leftStick=a.get(n.leftStick)),n.rightStick&&a.has(n.rightStick)&&(s.rightStick=a.get(n.rightStick)),Object.keys(s).length>0?p.push(s):p.push({});}),{meta:t,items:l,gamepadMappings:Object.keys(p).length>0?p:void 0}}Object.defineProperty(exports,"addVec",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.i}});Object.defineProperty(exports,"applyAxialDeadzone",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.C}});Object.defineProperty(exports,"applyRadialDeadzone",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.B}});Object.defineProperty(exports,"clamp",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.k}});Object.defineProperty(exports,"clampVector",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.r}});Object.defineProperty(exports,"degToRad",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.q}});Object.defineProperty(exports,"getAngle",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.o}});Object.defineProperty(exports,"getDeadzoneScalar",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.A}});Object.defineProperty(exports,"getDistance",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.n}});Object.defineProperty(exports,"isVec2Equal",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.z}});Object.defineProperty(exports,"lerp",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.l}});Object.defineProperty(exports,"lockTo4Directions",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.t}});Object.defineProperty(exports,"lockTo8Directions",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.s}});Object.defineProperty(exports,"normalizeVec",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.w}});Object.defineProperty(exports,"percentToPx",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.u}});Object.defineProperty(exports,"pxToPercent",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.v}});Object.defineProperty(exports,"radToDeg",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.p}});Object.defineProperty(exports,"radToVec",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.x}});Object.defineProperty(exports,"remap",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.y}});Object.defineProperty(exports,"roundTo",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.m}});Object.defineProperty(exports,"scaleVec",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.j}});Object.defineProperty(exports,"subVec",{enumerable:true,get:function(){return chunkFAVAOSNA_cjs.h}});exports.createCachedProvider=Z;exports.createPointerBridge=at;exports.dispatchKeyboardEvent=nt;exports.dispatchPointerEventAtPos=rt;exports.exportProfile=It;exports.focusElement=M;exports.generateUID=C;exports.getDeepActiveElement=E;exports.getDeepElement=v;exports.getObjectDiff=tt;exports.isGlobalID=m;exports.lengthToCss=S;exports.parseLength=k;exports.parseProfileJson=Pt;exports.parseProfileTrees=yt;exports.reclaimFocusAtPos=ot;exports.resolveLayoutStyle=gt;exports.safeReleaseCapture=I;exports.safeSetCapture=T;exports.sanitizeParsedLength=w;exports.supportsContainerQueries=it;
1
+ 'use strict';var chunkU52W5J3K_cjs=require('../chunk-U52W5J3K.cjs'),chunkFSJTQU4W_cjs=require('../chunk-FSJTQU4W.cjs'),chunkZHPNS73J_cjs=require('../chunk-ZHPNS73J.cjs');function tt(r,a){let s={};return r?(Object.keys(a).forEach(i=>{let e=a[i],o=r[i];typeof e=="object"&&e!==null?JSON.stringify(e)!==JSON.stringify(o)&&(s[i]=e):e!==o&&(s[i]=e);}),s):{...a}}var P=(r="omnipad")=>{let a=Date.now().toString(36),s=Math.random().toString(36).substring(2,6);return `${r}-${a}-${s}`};function l(r){return r.startsWith("$")}function st(r){if(!r||typeof r!="object")throw new Error("[OmniPad-Validation] Profile must be a valid JSON object.");if(!Array.isArray(r.items))throw new Error('[OmniPad-Validation] "items" must be an array.');let a={name:r.meta?.name||"Untitled Profile",version:r.meta?.version||"1.0.0",author:r.meta?.author||"Unknown"},s=r.items.map((e,o)=>{if(!e.id||!e.type)throw new Error(`[OmniPad-Validation] Item at index ${o} is missing "id" or "type".`);return {id:String(e.id),type:String(e.type),parentId:e.parentId?String(e.parentId):void 0,config:{...e.config,layout:chunkFSJTQU4W_cjs.h(e.config.layout),cssClass:chunkFSJTQU4W_cjs.d(e.config.cssClass)}}}),i=r.gamepadMappings;return {meta:a,items:s,gamepadMappings:i}}function dt(r){let{items:a,gamepadMappings:s}=r,i=new Map,e=(t,n="node")=>l(t)?t:(i.has(t)||i.set(t,P(n)),i.get(t));a.forEach(t=>e(t.id,t.type));let o=[];s&&s.forEach(t=>{let n={};if(t.buttons){n.buttons={};for(let[f,d]of Object.entries(t.buttons))n.buttons[f]=e(d);}t.dpad&&(n.dpad=e(t.dpad)),t.leftStick&&(n.leftStick=e(t.leftStick)),t.rightStick&&(n.rightStick=e(t.rightStick)),o.push(n);});let p=new Map,g=[];a.forEach(t=>{t.parentId?(p.has(t.parentId)||p.set(t.parentId,[]),p.get(t.parentId).push(t)):g.push(t);});let u=(t,n)=>{if(n.has(t.id))throw new Error(`[OmniPad-Core] Circular dependency detected at node: ${t.id}`);n.add(t.id);let f={...t.config};f?.targetStageId&&(f.targetStageId=e(f.targetStageId)),f?.dynamicWidgetId&&(f.dynamicWidgetId=e(f.dynamicWidgetId));let y=(p.get(t.id)||[]).map(m=>u(m,new Set(n)));return {uid:e(t.id),type:t.type,config:f,children:y}},c={};return g.forEach(t=>{c[t.id]=u(t,new Set);}),{roots:c,runtimeGamepadMappings:o}}function ft(r,a,s){let i=chunkZHPNS73J_cjs.h.getInstance(),e=[];if(!a||a.length===0)e=i.getAllEntities();else {let t=new Set;a.forEach(n=>{i.getEntitiesByRoot(n).forEach(d=>t.add(d));}),e=Array.from(t);}let o=new Map,p=0,g=t=>l(t)?t:(o.has(t)||o.set(t,`node_${++p}`),o.get(t)),u=e.map(t=>{let n=t.getConfig(),f=t.uid,d={...n};d.targetStageId&&(d.targetStageId=g(d.targetStageId)),d.dynamicWidgetId&&(d.dynamicWidgetId=g(d.dynamicWidgetId));let{id:y,parentId:m,...h}=d;return {id:g(f),type:t.type,parentId:n.parentId?g(n.parentId):void 0,config:{...h,layout:chunkFSJTQU4W_cjs.i(h.layout)}}}),c=[];return s&&s.forEach(t=>{let n={};if(t.buttons){n.buttons={};for(let[f,d]of Object.entries(t.buttons))o.has(d)&&(n.buttons[f]=o.get(d));}t.dpad&&o.has(t.dpad)&&(n.dpad=o.get(t.dpad)),t.leftStick&&o.has(t.leftStick)&&(n.leftStick=o.get(t.leftStick)),t.rightStick&&o.has(t.rightStick)&&(n.rightStick=o.get(t.rightStick)),Object.keys(n).length>0?c.push(n):c.push({});}),{meta:r,items:u,gamepadMappings:Object.keys(c).length>0?c:void 0}}function gt(r,a){let s={};for(let i in r)r[i]!==void 0&&!a.has(i)&&(s[i]=r[i]);return s}Object.defineProperty(exports,"addVec",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.b}});Object.defineProperty(exports,"applyAxialDeadzone",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.v}});Object.defineProperty(exports,"applyRadialDeadzone",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.u}});Object.defineProperty(exports,"clamp",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.d}});Object.defineProperty(exports,"clampVector",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.k}});Object.defineProperty(exports,"degToRad",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.j}});Object.defineProperty(exports,"getAngle",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.h}});Object.defineProperty(exports,"getDeadzoneScalar",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.t}});Object.defineProperty(exports,"getDistance",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.g}});Object.defineProperty(exports,"isVec2Equal",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.s}});Object.defineProperty(exports,"lerp",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.e}});Object.defineProperty(exports,"lockTo4Directions",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.m}});Object.defineProperty(exports,"lockTo8Directions",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.l}});Object.defineProperty(exports,"normalizeVec",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.p}});Object.defineProperty(exports,"percentToPx",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.n}});Object.defineProperty(exports,"pxToPercent",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.o}});Object.defineProperty(exports,"radToDeg",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.i}});Object.defineProperty(exports,"radToVec",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.q}});Object.defineProperty(exports,"remap",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.r}});Object.defineProperty(exports,"roundTo",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.f}});Object.defineProperty(exports,"scaleVec",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.c}});Object.defineProperty(exports,"subVec",{enumerable:true,get:function(){return chunkU52W5J3K_cjs.a}});Object.defineProperty(exports,"DANGEROUS_KEYWORDS",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.b}});Object.defineProperty(exports,"StickyProvider",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.k}});Object.defineProperty(exports,"compressLayoutBox",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.i}});Object.defineProperty(exports,"createCachedProvider",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.a}});Object.defineProperty(exports,"lengthToCss",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.g}});Object.defineProperty(exports,"parseLength",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.e}});Object.defineProperty(exports,"resolveLayoutStyle",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.j}});Object.defineProperty(exports,"resolveStickyLayout",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.l}});Object.defineProperty(exports,"sanitizeCssClass",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.d}});Object.defineProperty(exports,"sanitizeDomString",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.c}});Object.defineProperty(exports,"sanitizeParsedLength",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.f}});Object.defineProperty(exports,"validateLayoutBox",{enumerable:true,get:function(){return chunkFSJTQU4W_cjs.h}});exports.exportProfile=ft;exports.generateUID=P;exports.getBusinessProps=gt;exports.getObjectDiff=tt;exports.isGlobalID=l;exports.parseProfileJson=st;exports.parseProfileTrees=dt;
@@ -1,4 +1,5 @@
1
- import { e as IPointerHandler, P as ParsedLength, N as LayoutBox, V as Vec2, v as ConfigTreeNode, G as GamepadMappingConfig, y as GamepadProfile } from '../index-CTJog5sj.cjs';
1
+ import { L as LayoutBox, P as ParsedLength, o as FlexibleLength, V as Vec2, m as ConfigTreeNode, G as GamepadMappingConfig, O as OmniPadProfile } from '../index-DVegtw8s.cjs';
2
+ export { S as StickyProvider, r as resolveStickyLayout } from '../sticky-4yk5DLzG.cjs';
2
3
 
3
4
  /**
4
5
  * Creates a provider wrapper that caches the result of a value-producing function.
@@ -37,118 +38,6 @@ declare function createCachedProvider<T>(provider: () => T): {
37
38
  */
38
39
  declare function getObjectDiff(oldObj: any, newObj: any): Record<string, any>;
39
40
 
40
- /**
41
- * Recursively penetrates Shadow DOM boundaries to find the deepest element at the
42
- * specified viewport coordinates.
43
- *
44
- * @param x - Viewport X coordinate (px)
45
- * @param y - Viewport Y coordinate (px)
46
- * @param ignoreClass - Style class of DOM elements to be ignored
47
- * @returns The deepmost Element or null if none found at the position.
48
- */
49
- declare const getDeepElement: (x: number, y: number, ignoreClass?: string) => Element | null;
50
- /**
51
- * Recursively finds the truly focused element by traversing Shadow DOM boundaries.
52
- *
53
- * @returns The deepmost active Element in focus or null.
54
- */
55
- declare const getDeepActiveElement: () => Element | null;
56
- /**
57
- * Forcefully focuses an element.
58
- * Automatically handles the 'tabindex' attribute to ensure non-focusable elements (like Canvas)
59
- * can receive focus.
60
- *
61
- * @param el - The target HTMLElement to focus.
62
- */
63
- declare const focusElement: (el: HTMLElement) => void;
64
- /**
65
- * Dispatches a synthetic KeyboardEvent to the window object.
66
- *
67
- * @param type - The event type, e.g., 'keydown' or 'keyup'.
68
- * @param payload - Key mapping data including key, code, and legacy keyCode.
69
- */
70
- declare const dispatchKeyboardEvent: (type: string, payload: {
71
- key: string;
72
- code: string;
73
- keyCode: number;
74
- }) => void;
75
- /**
76
- * Dispatches a high-fidelity sequence of Pointer and Mouse events at specific pixel coordinates.
77
- * Finds the target element dynamically at the moment of dispatch.
78
- *
79
- * @param type - The event type (should start with 'pointer' for best compatibility).
80
- * @param x - Viewport X coordinate (px).
81
- * @param y - Viewport Y coordinate (px).
82
- * @param opts - Additional PointerEvent options (button, pressure, etc.).
83
- */
84
- declare const dispatchPointerEventAtPos: (type: string, x: number, y: number, opts: {
85
- button: number;
86
- buttons: number;
87
- pressure: number;
88
- }) => void;
89
- /**
90
- * Reclaims browser focus for the element located at the specified viewport coordinates.
91
- *
92
- * This utility identifies the deepest element (penetrating Shadow DOM) at the given position
93
- * and ensures it becomes the active element. It is essential for ensuring that
94
- * game engines (like Ruffle) receive keyboard events immediately after a virtual interaction.
95
- *
96
- * @param x - The horizontal coordinate relative to the viewport.
97
- * @param y - The vertical coordinate relative to the viewport.
98
- * @returns True if the focus was successfully moved to the target; false if it was already focused or no target found.
99
- */
100
- declare const reclaimFocusAtPos: (x: number, y: number, callback: () => void) => void;
101
- declare const supportsContainerQueries: () => boolean;
102
- /**
103
- * Safely sets pointer capture on an element.
104
- *
105
- * @param el - The target element to capture the pointer.
106
- * @param pointerId - The unique ID of the pointer (from PointerEvent).
107
- */
108
- declare const safeSetCapture: (el: EventTarget | null, pointerId: number) => void;
109
- /**
110
- * Safely releases pointer capture from an element.
111
- * Checks for current capture state and wraps in try-catch to prevent crashes.
112
- *
113
- * @param el - The target element.
114
- * @param pointerId - The unique ID of the pointer to release.
115
- */
116
- declare const safeReleaseCapture: (el: EventTarget | null, pointerId: number) => void;
117
- /**
118
- * Creates a standardized bridge between native DOM PointerEvents and Core abstract handlers.
119
- * Handles event prevention, stop propagation, pointer capture, and multi-touch filtering.
120
- *
121
- * @param coreHandler - The logic core instance that implements IPointerHandler.
122
- * @param getElement - A getter function to retrieve the DOM element for pointer capture.
123
- * @returns An object containing mapped event handlers for Vue/React template binding.
124
- */
125
- declare function createPointerBridge(coreHandler: IPointerHandler & {
126
- activePointerId?: number | null;
127
- }, options?: {
128
- /** Respond only to direct clicks (without responding to events bubbled up from child elements) */
129
- requireDirectHit?: boolean;
130
- }): {
131
- /**
132
- * Entry point for a pointer interaction.
133
- * Establishes capture and initializes core logic.
134
- */
135
- onPointerDown(e: PointerEvent): void;
136
- /**
137
- * Continuous movement handling.
138
- * Throttling should be handled within the core implementation.
139
- */
140
- onPointerMove(e: PointerEvent): void;
141
- /**
142
- * Successful interaction completion.
143
- * Filters by pointerId to ensure only the capturing finger triggers release.
144
- */
145
- onPointerUp(e: PointerEvent): void;
146
- /**
147
- * System-level interaction cancellation (e.g., alert popups, browser gestures).
148
- */
149
- onPointerCancel(e: PointerEvent): void;
150
- };
151
-
152
41
  /**
153
42
  * Generates a globally unique identifier (UID) for runtime entity management and DOM keys.
154
43
  *
@@ -185,7 +74,7 @@ declare function isGlobalID(id: string): boolean;
185
74
  * @param input - The raw length input.
186
75
  * @returns A sanitized ParsedLength.
187
76
  */
188
- declare function parseLength(input: string | number | undefined): ParsedLength;
77
+ declare function parseLength(input: FlexibleLength | undefined): ParsedLength | undefined;
189
78
  /**
190
79
  * Check the whitelist of verification units and sanitize ParsedLength.
191
80
  */
@@ -193,7 +82,15 @@ declare const sanitizeParsedLength: (parsed: ParsedLength) => ParsedLength;
193
82
  /**
194
83
  * Convert the ParsedLength back to a CSS string
195
84
  */
196
- declare const lengthToCss: (parsed: ParsedLength) => string;
85
+ declare const lengthToCss: (parsed: ParsedLength | undefined) => string | undefined;
86
+ /**
87
+ * Validate a raw LayoutBox config.
88
+ */
89
+ declare function validateLayoutBox(raw: LayoutBox): LayoutBox;
90
+ /**
91
+ * Compress layout properties into css strings.
92
+ */
93
+ declare function compressLayoutBox(raw: LayoutBox): LayoutBox;
197
94
  /**
198
95
  * Converts a LayoutBox configuration into a CSS style object suitable for Vue/React.
199
96
  *
@@ -319,16 +216,16 @@ declare const applyRadialDeadzone: (v: Vec2, radius: number, deadzonePercent: nu
319
216
  declare const applyAxialDeadzone: (v: Vec2, threshold: number, max: number) => Vec2;
320
217
 
321
218
  /**
322
- * Validates and normalizes raw JSON data into a standard GamepadProfile.
219
+ * Validates and normalizes raw JSON data into a standard OmniPadProfile.
323
220
  * Performs structural checks and injects default metadata.
324
221
  *
325
222
  * @param raw - The raw JSON object from disk or network.
326
- * @returns A validated GamepadProfile object.
223
+ * @returns A validated OmniPadProfile object.
327
224
  * @throws Error if the core structure is invalid.
328
225
  */
329
- declare function parseProfileJson(raw: any): GamepadProfile;
226
+ declare function parseProfileJson(raw: any): OmniPadProfile;
330
227
  /**
331
- * The resulting structure after parsing a GamepadProfile.
228
+ * The resulting structure after parsing a OmniPadProfile.
332
229
  * Contains a map of root nodes and a runtime-ready gamepad mapping table.
333
230
  */
334
231
  interface ParsedProfileForest {
@@ -341,22 +238,45 @@ interface ParsedProfileForest {
341
238
  runtimeGamepadMappings: GamepadMappingConfig[];
342
239
  }
343
240
  /**
344
- * Converts a flat GamepadProfile into a forest of ConfigTreeNodes for runtime rendering.
241
+ * Converts a flat OmniPadProfile into a forest of ConfigTreeNodes for runtime rendering.
345
242
  * Automatically identifies all items without a parentId as root nodes.
346
243
  *
347
244
  * @param profile - The normalized profile data.
348
245
  * @returns A record map of root nodes, keyed by their original configuration ID.
349
246
  */
350
- declare function parseProfileTrees(profile: GamepadProfile): ParsedProfileForest;
247
+ declare function parseProfileTrees(profile: OmniPadProfile): ParsedProfileForest;
351
248
  /**
352
- * Serializes the specified runtime entities into a flat GamepadProfile.
249
+ * Serializes the specified runtime entities into a flat OmniPadProfile.
353
250
  * If no rootUids are provided, exports all entities currently in the registry.
354
251
  *
355
252
  * @param meta - Metadata for the exported profile.
356
253
  * @param rootUid - The Entity ID of the node to be treated as the root.
357
254
  * @param runtimeGamepadMapping - The current mapping from GamepadManager (using UIDs).
358
- * @returns A flat GamepadProfile ready for storage.
255
+ * @returns A flat OmniPadProfile ready for storage.
256
+ */
257
+ declare function exportProfile(meta: OmniPadProfile['meta'], rootUids?: string[], runtimeGamepadMappings?: Readonly<GamepadMappingConfig[]>): OmniPadProfile;
258
+ /**
259
+ * Extract filtered business configurations.
260
+ * @param props Original Props object (e.g. Vue's props)
261
+ * @param skipKeys Ignore key set
262
+ */
263
+ declare function getBusinessProps(props: Record<string, any>, skipKeys: Set<string>): Record<string, any>;
264
+
265
+ /**
266
+ * Simple DOM string sanitizer to prevent CSS/JS injection.
267
+ * Validates selectors and class names.
268
+ */
269
+ declare const DANGEROUS_KEYWORDS: readonly ["script", "onerror", "eval", "onload", "javascript"];
270
+ /**
271
+ * Sanitizes a string intended for DOM use (selectors, classes, etc.)
272
+ * @param input - The raw string input
273
+ * @param fallback - Returned if input is unsafe
274
+ */
275
+ declare function sanitizeDomString(input: string | undefined, fallback?: string): string;
276
+ /**
277
+ * Specifically validates and cleans CSS class strings.
278
+ * Ensures it's just a space-separated list of valid class names.
359
279
  */
360
- declare function exportProfile(meta: GamepadProfile['meta'], rootUids?: string[], runtimeGamepadMappings?: Readonly<GamepadMappingConfig[]>): GamepadProfile;
280
+ declare function sanitizeCssClass(input: string | undefined): string;
361
281
 
362
- export { type ParsedProfileForest, addVec, applyAxialDeadzone, applyRadialDeadzone, clamp, clampVector, createCachedProvider, createPointerBridge, degToRad, dispatchKeyboardEvent, dispatchPointerEventAtPos, exportProfile, focusElement, generateUID, getAngle, getDeadzoneScalar, getDeepActiveElement, getDeepElement, getDistance, getObjectDiff, isGlobalID, isVec2Equal, lengthToCss, lerp, lockTo4Directions, lockTo8Directions, normalizeVec, parseLength, parseProfileJson, parseProfileTrees, percentToPx, pxToPercent, radToDeg, radToVec, reclaimFocusAtPos, remap, resolveLayoutStyle, roundTo, safeReleaseCapture, safeSetCapture, sanitizeParsedLength, scaleVec, subVec, supportsContainerQueries };
282
+ export { DANGEROUS_KEYWORDS, type ParsedProfileForest, addVec, applyAxialDeadzone, applyRadialDeadzone, clamp, clampVector, compressLayoutBox, createCachedProvider, degToRad, exportProfile, generateUID, getAngle, getBusinessProps, getDeadzoneScalar, getDistance, getObjectDiff, isGlobalID, isVec2Equal, lengthToCss, lerp, lockTo4Directions, lockTo8Directions, normalizeVec, parseLength, parseProfileJson, parseProfileTrees, percentToPx, pxToPercent, radToDeg, radToVec, remap, resolveLayoutStyle, roundTo, sanitizeCssClass, sanitizeDomString, sanitizeParsedLength, scaleVec, subVec, validateLayoutBox };
@@ -1,4 +1,5 @@
1
- import { e as IPointerHandler, P as ParsedLength, N as LayoutBox, V as Vec2, v as ConfigTreeNode, G as GamepadMappingConfig, y as GamepadProfile } from '../index-CTJog5sj.js';
1
+ import { L as LayoutBox, P as ParsedLength, o as FlexibleLength, V as Vec2, m as ConfigTreeNode, G as GamepadMappingConfig, O as OmniPadProfile } from '../index-DVegtw8s.js';
2
+ export { S as StickyProvider, r as resolveStickyLayout } from '../sticky-CLBq1EPa.js';
2
3
 
3
4
  /**
4
5
  * Creates a provider wrapper that caches the result of a value-producing function.
@@ -37,118 +38,6 @@ declare function createCachedProvider<T>(provider: () => T): {
37
38
  */
38
39
  declare function getObjectDiff(oldObj: any, newObj: any): Record<string, any>;
39
40
 
40
- /**
41
- * Recursively penetrates Shadow DOM boundaries to find the deepest element at the
42
- * specified viewport coordinates.
43
- *
44
- * @param x - Viewport X coordinate (px)
45
- * @param y - Viewport Y coordinate (px)
46
- * @param ignoreClass - Style class of DOM elements to be ignored
47
- * @returns The deepmost Element or null if none found at the position.
48
- */
49
- declare const getDeepElement: (x: number, y: number, ignoreClass?: string) => Element | null;
50
- /**
51
- * Recursively finds the truly focused element by traversing Shadow DOM boundaries.
52
- *
53
- * @returns The deepmost active Element in focus or null.
54
- */
55
- declare const getDeepActiveElement: () => Element | null;
56
- /**
57
- * Forcefully focuses an element.
58
- * Automatically handles the 'tabindex' attribute to ensure non-focusable elements (like Canvas)
59
- * can receive focus.
60
- *
61
- * @param el - The target HTMLElement to focus.
62
- */
63
- declare const focusElement: (el: HTMLElement) => void;
64
- /**
65
- * Dispatches a synthetic KeyboardEvent to the window object.
66
- *
67
- * @param type - The event type, e.g., 'keydown' or 'keyup'.
68
- * @param payload - Key mapping data including key, code, and legacy keyCode.
69
- */
70
- declare const dispatchKeyboardEvent: (type: string, payload: {
71
- key: string;
72
- code: string;
73
- keyCode: number;
74
- }) => void;
75
- /**
76
- * Dispatches a high-fidelity sequence of Pointer and Mouse events at specific pixel coordinates.
77
- * Finds the target element dynamically at the moment of dispatch.
78
- *
79
- * @param type - The event type (should start with 'pointer' for best compatibility).
80
- * @param x - Viewport X coordinate (px).
81
- * @param y - Viewport Y coordinate (px).
82
- * @param opts - Additional PointerEvent options (button, pressure, etc.).
83
- */
84
- declare const dispatchPointerEventAtPos: (type: string, x: number, y: number, opts: {
85
- button: number;
86
- buttons: number;
87
- pressure: number;
88
- }) => void;
89
- /**
90
- * Reclaims browser focus for the element located at the specified viewport coordinates.
91
- *
92
- * This utility identifies the deepest element (penetrating Shadow DOM) at the given position
93
- * and ensures it becomes the active element. It is essential for ensuring that
94
- * game engines (like Ruffle) receive keyboard events immediately after a virtual interaction.
95
- *
96
- * @param x - The horizontal coordinate relative to the viewport.
97
- * @param y - The vertical coordinate relative to the viewport.
98
- * @returns True if the focus was successfully moved to the target; false if it was already focused or no target found.
99
- */
100
- declare const reclaimFocusAtPos: (x: number, y: number, callback: () => void) => void;
101
- declare const supportsContainerQueries: () => boolean;
102
- /**
103
- * Safely sets pointer capture on an element.
104
- *
105
- * @param el - The target element to capture the pointer.
106
- * @param pointerId - The unique ID of the pointer (from PointerEvent).
107
- */
108
- declare const safeSetCapture: (el: EventTarget | null, pointerId: number) => void;
109
- /**
110
- * Safely releases pointer capture from an element.
111
- * Checks for current capture state and wraps in try-catch to prevent crashes.
112
- *
113
- * @param el - The target element.
114
- * @param pointerId - The unique ID of the pointer to release.
115
- */
116
- declare const safeReleaseCapture: (el: EventTarget | null, pointerId: number) => void;
117
- /**
118
- * Creates a standardized bridge between native DOM PointerEvents and Core abstract handlers.
119
- * Handles event prevention, stop propagation, pointer capture, and multi-touch filtering.
120
- *
121
- * @param coreHandler - The logic core instance that implements IPointerHandler.
122
- * @param getElement - A getter function to retrieve the DOM element for pointer capture.
123
- * @returns An object containing mapped event handlers for Vue/React template binding.
124
- */
125
- declare function createPointerBridge(coreHandler: IPointerHandler & {
126
- activePointerId?: number | null;
127
- }, options?: {
128
- /** Respond only to direct clicks (without responding to events bubbled up from child elements) */
129
- requireDirectHit?: boolean;
130
- }): {
131
- /**
132
- * Entry point for a pointer interaction.
133
- * Establishes capture and initializes core logic.
134
- */
135
- onPointerDown(e: PointerEvent): void;
136
- /**
137
- * Continuous movement handling.
138
- * Throttling should be handled within the core implementation.
139
- */
140
- onPointerMove(e: PointerEvent): void;
141
- /**
142
- * Successful interaction completion.
143
- * Filters by pointerId to ensure only the capturing finger triggers release.
144
- */
145
- onPointerUp(e: PointerEvent): void;
146
- /**
147
- * System-level interaction cancellation (e.g., alert popups, browser gestures).
148
- */
149
- onPointerCancel(e: PointerEvent): void;
150
- };
151
-
152
41
  /**
153
42
  * Generates a globally unique identifier (UID) for runtime entity management and DOM keys.
154
43
  *
@@ -185,7 +74,7 @@ declare function isGlobalID(id: string): boolean;
185
74
  * @param input - The raw length input.
186
75
  * @returns A sanitized ParsedLength.
187
76
  */
188
- declare function parseLength(input: string | number | undefined): ParsedLength;
77
+ declare function parseLength(input: FlexibleLength | undefined): ParsedLength | undefined;
189
78
  /**
190
79
  * Check the whitelist of verification units and sanitize ParsedLength.
191
80
  */
@@ -193,7 +82,15 @@ declare const sanitizeParsedLength: (parsed: ParsedLength) => ParsedLength;
193
82
  /**
194
83
  * Convert the ParsedLength back to a CSS string
195
84
  */
196
- declare const lengthToCss: (parsed: ParsedLength) => string;
85
+ declare const lengthToCss: (parsed: ParsedLength | undefined) => string | undefined;
86
+ /**
87
+ * Validate a raw LayoutBox config.
88
+ */
89
+ declare function validateLayoutBox(raw: LayoutBox): LayoutBox;
90
+ /**
91
+ * Compress layout properties into css strings.
92
+ */
93
+ declare function compressLayoutBox(raw: LayoutBox): LayoutBox;
197
94
  /**
198
95
  * Converts a LayoutBox configuration into a CSS style object suitable for Vue/React.
199
96
  *
@@ -319,16 +216,16 @@ declare const applyRadialDeadzone: (v: Vec2, radius: number, deadzonePercent: nu
319
216
  declare const applyAxialDeadzone: (v: Vec2, threshold: number, max: number) => Vec2;
320
217
 
321
218
  /**
322
- * Validates and normalizes raw JSON data into a standard GamepadProfile.
219
+ * Validates and normalizes raw JSON data into a standard OmniPadProfile.
323
220
  * Performs structural checks and injects default metadata.
324
221
  *
325
222
  * @param raw - The raw JSON object from disk or network.
326
- * @returns A validated GamepadProfile object.
223
+ * @returns A validated OmniPadProfile object.
327
224
  * @throws Error if the core structure is invalid.
328
225
  */
329
- declare function parseProfileJson(raw: any): GamepadProfile;
226
+ declare function parseProfileJson(raw: any): OmniPadProfile;
330
227
  /**
331
- * The resulting structure after parsing a GamepadProfile.
228
+ * The resulting structure after parsing a OmniPadProfile.
332
229
  * Contains a map of root nodes and a runtime-ready gamepad mapping table.
333
230
  */
334
231
  interface ParsedProfileForest {
@@ -341,22 +238,45 @@ interface ParsedProfileForest {
341
238
  runtimeGamepadMappings: GamepadMappingConfig[];
342
239
  }
343
240
  /**
344
- * Converts a flat GamepadProfile into a forest of ConfigTreeNodes for runtime rendering.
241
+ * Converts a flat OmniPadProfile into a forest of ConfigTreeNodes for runtime rendering.
345
242
  * Automatically identifies all items without a parentId as root nodes.
346
243
  *
347
244
  * @param profile - The normalized profile data.
348
245
  * @returns A record map of root nodes, keyed by their original configuration ID.
349
246
  */
350
- declare function parseProfileTrees(profile: GamepadProfile): ParsedProfileForest;
247
+ declare function parseProfileTrees(profile: OmniPadProfile): ParsedProfileForest;
351
248
  /**
352
- * Serializes the specified runtime entities into a flat GamepadProfile.
249
+ * Serializes the specified runtime entities into a flat OmniPadProfile.
353
250
  * If no rootUids are provided, exports all entities currently in the registry.
354
251
  *
355
252
  * @param meta - Metadata for the exported profile.
356
253
  * @param rootUid - The Entity ID of the node to be treated as the root.
357
254
  * @param runtimeGamepadMapping - The current mapping from GamepadManager (using UIDs).
358
- * @returns A flat GamepadProfile ready for storage.
255
+ * @returns A flat OmniPadProfile ready for storage.
256
+ */
257
+ declare function exportProfile(meta: OmniPadProfile['meta'], rootUids?: string[], runtimeGamepadMappings?: Readonly<GamepadMappingConfig[]>): OmniPadProfile;
258
+ /**
259
+ * Extract filtered business configurations.
260
+ * @param props Original Props object (e.g. Vue's props)
261
+ * @param skipKeys Ignore key set
262
+ */
263
+ declare function getBusinessProps(props: Record<string, any>, skipKeys: Set<string>): Record<string, any>;
264
+
265
+ /**
266
+ * Simple DOM string sanitizer to prevent CSS/JS injection.
267
+ * Validates selectors and class names.
268
+ */
269
+ declare const DANGEROUS_KEYWORDS: readonly ["script", "onerror", "eval", "onload", "javascript"];
270
+ /**
271
+ * Sanitizes a string intended for DOM use (selectors, classes, etc.)
272
+ * @param input - The raw string input
273
+ * @param fallback - Returned if input is unsafe
274
+ */
275
+ declare function sanitizeDomString(input: string | undefined, fallback?: string): string;
276
+ /**
277
+ * Specifically validates and cleans CSS class strings.
278
+ * Ensures it's just a space-separated list of valid class names.
359
279
  */
360
- declare function exportProfile(meta: GamepadProfile['meta'], rootUids?: string[], runtimeGamepadMappings?: Readonly<GamepadMappingConfig[]>): GamepadProfile;
280
+ declare function sanitizeCssClass(input: string | undefined): string;
361
281
 
362
- export { type ParsedProfileForest, addVec, applyAxialDeadzone, applyRadialDeadzone, clamp, clampVector, createCachedProvider, createPointerBridge, degToRad, dispatchKeyboardEvent, dispatchPointerEventAtPos, exportProfile, focusElement, generateUID, getAngle, getDeadzoneScalar, getDeepActiveElement, getDeepElement, getDistance, getObjectDiff, isGlobalID, isVec2Equal, lengthToCss, lerp, lockTo4Directions, lockTo8Directions, normalizeVec, parseLength, parseProfileJson, parseProfileTrees, percentToPx, pxToPercent, radToDeg, radToVec, reclaimFocusAtPos, remap, resolveLayoutStyle, roundTo, safeReleaseCapture, safeSetCapture, sanitizeParsedLength, scaleVec, subVec, supportsContainerQueries };
282
+ export { DANGEROUS_KEYWORDS, type ParsedProfileForest, addVec, applyAxialDeadzone, applyRadialDeadzone, clamp, clampVector, compressLayoutBox, createCachedProvider, degToRad, exportProfile, generateUID, getAngle, getBusinessProps, getDeadzoneScalar, getDistance, getObjectDiff, isGlobalID, isVec2Equal, lengthToCss, lerp, lockTo4Directions, lockTo8Directions, normalizeVec, parseLength, parseProfileJson, parseProfileTrees, percentToPx, pxToPercent, radToDeg, radToVec, remap, resolveLayoutStyle, roundTo, sanitizeCssClass, sanitizeDomString, sanitizeParsedLength, scaleVec, subVec, validateLayoutBox };