@qontinui/ui-bridge-native 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/control/{index.d.mts → action-executor.d.ts} +6 -10
- package/dist/control/action-executor.d.ts.map +1 -0
- package/dist/control/index.d.ts +5 -91
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +1 -1
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs +1 -1
- package/dist/control/index.mjs.map +1 -1
- package/dist/{types-BCYWwyVy.d.ts → control/types.d.ts} +17 -18
- package/dist/control/types.d.ts.map +1 -0
- package/dist/core/element-identifier.d.ts +41 -0
- package/dist/core/element-identifier.d.ts.map +1 -0
- package/dist/core/index.d.ts +6 -43
- package/dist/core/index.d.ts.map +1 -0
- package/dist/{registry-B8A_EoxS.d.ts → core/registry.d.ts} +10 -13
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/{types-BPNuYxDx.d.ts → core/types.d.ts} +30 -30
- package/dist/core/types.d.ts.map +1 -0
- package/dist/debug/index.d.ts +4 -44
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/index.mjs.map +1 -1
- package/dist/debug/{index.d.mts → inspector.d.ts} +3 -6
- package/dist/debug/inspector.d.ts.map +1 -0
- package/dist/design/{index.d.mts → design-inspector-native.d.ts} +7 -11
- package/dist/design/design-inspector-native.d.ts.map +1 -0
- package/dist/{design-types-BHr6Q1FX.d.ts → design/design-types.d.ts} +10 -11
- package/dist/design/design-types.d.ts.map +1 -0
- package/dist/design/index.d.ts +5 -60
- package/dist/design/index.d.ts.map +1 -0
- package/dist/index.d.ts +28 -73
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +129 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +129 -23
- package/dist/index.mjs.map +1 -1
- package/dist/react/UIBridgeNativeProvider.d.ts +147 -0
- package/dist/react/UIBridgeNativeProvider.d.ts.map +1 -0
- package/dist/react/index.d.ts +8 -69
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +138 -23
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +138 -23
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/{index.d.mts → useAutoRegister.d.ts} +7 -15
- package/dist/react/useAutoRegister.d.ts.map +1 -0
- package/dist/react/useUIBridge.d.ts +103 -0
- package/dist/react/useUIBridge.d.ts.map +1 -0
- package/dist/react/useUIComponent.d.ts +112 -0
- package/dist/react/useUIComponent.d.ts.map +1 -0
- package/dist/react/useUIElement.d.ts +162 -0
- package/dist/react/useUIElement.d.ts.map +1 -0
- package/dist/server/design-handlers.d.ts +47 -0
- package/dist/server/design-handlers.d.ts.map +1 -0
- package/dist/server/handlers.d.ts +20 -0
- package/dist/server/handlers.d.ts.map +1 -0
- package/dist/server/http-server.d.ts +247 -0
- package/dist/server/http-server.d.ts.map +1 -0
- package/dist/server/index.d.ts +13 -117
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +102 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +102 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/types.d.ts +200 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/ws-connection.d.ts +48 -0
- package/dist/server/ws-connection.d.ts.map +1 -0
- package/dist/server/ws-event-bridge.d.ts +113 -0
- package/dist/server/ws-event-bridge.d.ts.map +1 -0
- package/dist/server/ws-protocol.d.ts +48 -0
- package/dist/server/ws-protocol.d.ts.map +1 -0
- package/dist/server/ws-types.d.ts +65 -0
- package/dist/server/ws-types.d.ts.map +1 -0
- package/dist/transport/CloudRelayClient.d.ts +51 -0
- package/dist/transport/CloudRelayClient.d.ts.map +1 -0
- package/dist/transport/DeviceAnnouncer.d.ts +75 -0
- package/dist/transport/DeviceAnnouncer.d.ts.map +1 -0
- package/dist/transport/index.d.ts +3 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/core/index.d.mts +0 -46
- package/dist/design-types-BHr6Q1FX.d.mts +0 -205
- package/dist/http-server-B7KudcYJ.d.ts +0 -622
- package/dist/http-server-D7uVANBU.d.mts +0 -622
- package/dist/index.d.mts +0 -76
- package/dist/registry-DhbGbl9c.d.mts +0 -215
- package/dist/server/index.d.mts +0 -119
- package/dist/types-BPNuYxDx.d.mts +0 -383
- package/dist/types-Bcj7ji97.d.mts +0 -177
- package/dist/useUIBridge-CDZbWxII.d.ts +0 -571
- package/dist/useUIBridge-DfIEq9EQ.d.mts +0 -571
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* UI Bridge Native Debug Inspector
|
|
5
3
|
*
|
|
@@ -9,7 +7,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
9
7
|
/**
|
|
10
8
|
* Inspector props
|
|
11
9
|
*/
|
|
12
|
-
interface UIBridgeInspectorProps {
|
|
10
|
+
export interface UIBridgeInspectorProps {
|
|
13
11
|
/** Whether to show the inspector */
|
|
14
12
|
visible?: boolean;
|
|
15
13
|
/** Callback when inspector is closed */
|
|
@@ -42,6 +40,5 @@ interface UIBridgeInspectorProps {
|
|
|
42
40
|
* }
|
|
43
41
|
* ```
|
|
44
42
|
*/
|
|
45
|
-
declare function UIBridgeInspector({ visible, onClose, togglePosition, }: UIBridgeInspectorProps):
|
|
46
|
-
|
|
47
|
-
export { UIBridgeInspector, type UIBridgeInspectorProps };
|
|
43
|
+
export declare function UIBridgeInspector({ visible, onClose, togglePosition, }: UIBridgeInspectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
44
|
+
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../src/debug/inspector.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8CAA8C;IAC9C,cAAc,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;CAC5E;AA2ID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAe,EACf,OAAO,EACP,cAA+B,GAChC,EAAE,sBAAsB,kDAuGxB"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { R as ResponsiveSnapshot, S as StateStyles, E as ElementDesignData, a as ExtendedComputedStyles } from '../design-types-BHr6Q1FX.mjs';
|
|
2
|
-
export { F as FlattenedNativeStyle, N as NativeInteractionStateName, b as NativeStateStyles, P as PseudoElementStyles, c as StyleDiff } from '../design-types-BHr6Q1FX.mjs';
|
|
3
|
-
import { n as NativeLayout } from '../types-BPNuYxDx.mjs';
|
|
4
|
-
|
|
5
1
|
/**
|
|
6
2
|
* Native Design Inspector
|
|
7
3
|
*
|
|
@@ -18,7 +14,8 @@ import { n as NativeLayout } from '../types-BPNuYxDx.mjs';
|
|
|
18
14
|
* - Shadows differ: iOS uses shadow* props, Android uses elevation
|
|
19
15
|
* - Numeric values → "Npx" strings
|
|
20
16
|
*/
|
|
21
|
-
|
|
17
|
+
import type { ExtendedComputedStyles, ElementDesignData, StateStyles, ResponsiveSnapshot } from './design-types';
|
|
18
|
+
import type { NativeLayout } from '../core/types';
|
|
22
19
|
/**
|
|
23
20
|
* Map a flattened React Native style object to ExtendedComputedStyles.
|
|
24
21
|
*
|
|
@@ -29,16 +26,16 @@ import { n as NativeLayout } from '../types-BPNuYxDx.mjs';
|
|
|
29
26
|
* - RN shadow props → boxShadow string
|
|
30
27
|
* - CSS-only properties (cursor, visibility, grid*, etc.) → empty string
|
|
31
28
|
*/
|
|
32
|
-
declare function mapNativeStyleToExtended(rnStyle: Record<string, unknown> | undefined | null): ExtendedComputedStyles;
|
|
29
|
+
export declare function mapNativeStyleToExtended(rnStyle: Record<string, unknown> | undefined | null): ExtendedComputedStyles;
|
|
33
30
|
/**
|
|
34
31
|
* Produce ElementDesignData for a single native element.
|
|
35
32
|
*/
|
|
36
|
-
declare function getNativeElementDesignData(id: string, label: string | undefined, type: string, rnStyle: Record<string, unknown> | undefined | null, layout: NativeLayout | null): ElementDesignData;
|
|
33
|
+
export declare function getNativeElementDesignData(id: string, label: string | undefined, type: string, rnStyle: Record<string, unknown> | undefined | null, layout: NativeLayout | null): ElementDesignData;
|
|
37
34
|
/**
|
|
38
35
|
* Produce StateStyles[] for default/pressed/focused/disabled.
|
|
39
36
|
* Only includes states that have actual overrides or the default state.
|
|
40
37
|
*/
|
|
41
|
-
declare function captureNativeStateVariations(baseStyle: Record<string, unknown> | undefined | null, stateStyles?: {
|
|
38
|
+
export declare function captureNativeStateVariations(baseStyle: Record<string, unknown> | undefined | null, stateStyles?: {
|
|
42
39
|
pressed?: Record<string, unknown>;
|
|
43
40
|
focused?: Record<string, unknown>;
|
|
44
41
|
disabled?: Record<string, unknown>;
|
|
@@ -49,7 +46,7 @@ declare function captureNativeStateVariations(baseStyle: Record<string, unknown>
|
|
|
49
46
|
* Platform limitation: RN cannot constrain screen width at runtime.
|
|
50
47
|
* This returns a single snapshot at the current device dimensions.
|
|
51
48
|
*/
|
|
52
|
-
declare function captureNativeResponsiveSnapshot(elements: Array<{
|
|
49
|
+
export declare function captureNativeResponsiveSnapshot(elements: Array<{
|
|
53
50
|
id: string;
|
|
54
51
|
label?: string;
|
|
55
52
|
type: string;
|
|
@@ -59,5 +56,4 @@ declare function captureNativeResponsiveSnapshot(elements: Array<{
|
|
|
59
56
|
width: number;
|
|
60
57
|
height: number;
|
|
61
58
|
}): ResponsiveSnapshot[];
|
|
62
|
-
|
|
63
|
-
export { ElementDesignData, ExtendedComputedStyles, ResponsiveSnapshot, StateStyles, captureNativeResponsiveSnapshot, captureNativeStateVariations, getNativeElementDesignData, mapNativeStyleToExtended };
|
|
59
|
+
//# sourceMappingURL=design-inspector-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-inspector-native.d.ts","sourceRoot":"","sources":["../../src/design/design-inspector-native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EAEX,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA6JlD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GAClD,sBAAsB,CAqExB;AAMD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,EACnD,MAAM,EAAE,YAAY,GAAG,IAAI,GAC1B,iBAAiB,CAgBnB;AAiCD;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,EACrD,WAAW,CAAC,EAAE;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,GACA,WAAW,EAAE,CA+Bf;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,KAAK,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC7B,CAAC,EACF,gBAAgB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClD,kBAAkB,EAAE,CAatB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Extended computed styles (~40 design-relevant CSS properties).
|
|
9
9
|
* This is the canonical format shared with the web SDK.
|
|
10
10
|
*/
|
|
11
|
-
interface ExtendedComputedStyles {
|
|
11
|
+
export interface ExtendedComputedStyles {
|
|
12
12
|
display: string;
|
|
13
13
|
position: string;
|
|
14
14
|
boxSizing: string;
|
|
@@ -65,7 +65,7 @@ interface ExtendedComputedStyles {
|
|
|
65
65
|
/**
|
|
66
66
|
* Style diff entry: a property that changed from default state
|
|
67
67
|
*/
|
|
68
|
-
interface StyleDiff {
|
|
68
|
+
export interface StyleDiff {
|
|
69
69
|
property: string;
|
|
70
70
|
defaultValue: string;
|
|
71
71
|
stateValue: string;
|
|
@@ -73,7 +73,7 @@ interface StyleDiff {
|
|
|
73
73
|
/**
|
|
74
74
|
* Styles captured in a specific interaction state
|
|
75
75
|
*/
|
|
76
|
-
interface StateStyles {
|
|
76
|
+
export interface StateStyles {
|
|
77
77
|
state: NativeInteractionStateName;
|
|
78
78
|
styles: ExtendedComputedStyles;
|
|
79
79
|
diffFromDefault: StyleDiff[];
|
|
@@ -81,7 +81,7 @@ interface StateStyles {
|
|
|
81
81
|
/**
|
|
82
82
|
* Full design data for a single element
|
|
83
83
|
*/
|
|
84
|
-
interface ElementDesignData {
|
|
84
|
+
export interface ElementDesignData {
|
|
85
85
|
elementId: string;
|
|
86
86
|
label?: string;
|
|
87
87
|
type: string;
|
|
@@ -98,7 +98,7 @@ interface ElementDesignData {
|
|
|
98
98
|
/**
|
|
99
99
|
* Pseudo-element styles (always empty on RN — no ::before/::after)
|
|
100
100
|
*/
|
|
101
|
-
interface PseudoElementStyles {
|
|
101
|
+
export interface PseudoElementStyles {
|
|
102
102
|
selector: '::before' | '::after';
|
|
103
103
|
content: string;
|
|
104
104
|
styles: Partial<ExtendedComputedStyles>;
|
|
@@ -106,7 +106,7 @@ interface PseudoElementStyles {
|
|
|
106
106
|
/**
|
|
107
107
|
* Design snapshot at a specific viewport/screen size
|
|
108
108
|
*/
|
|
109
|
-
interface ResponsiveSnapshot {
|
|
109
|
+
export interface ResponsiveSnapshot {
|
|
110
110
|
viewportWidth: number;
|
|
111
111
|
viewportLabel?: string;
|
|
112
112
|
elements: ElementDesignData[];
|
|
@@ -116,7 +116,7 @@ interface ResponsiveSnapshot {
|
|
|
116
116
|
* Flattened React Native style — explicit RN style properties.
|
|
117
117
|
* Not tied to any specific RN version. All properties optional.
|
|
118
118
|
*/
|
|
119
|
-
interface FlattenedNativeStyle {
|
|
119
|
+
export interface FlattenedNativeStyle {
|
|
120
120
|
display?: 'flex' | 'none';
|
|
121
121
|
position?: 'absolute' | 'relative';
|
|
122
122
|
width?: number | string;
|
|
@@ -191,7 +191,7 @@ interface FlattenedNativeStyle {
|
|
|
191
191
|
/**
|
|
192
192
|
* State-specific style overrides for RN (maps to Pressable states)
|
|
193
193
|
*/
|
|
194
|
-
interface NativeStateStyles {
|
|
194
|
+
export interface NativeStateStyles {
|
|
195
195
|
pressed?: FlattenedNativeStyle;
|
|
196
196
|
focused?: FlattenedNativeStyle;
|
|
197
197
|
disabled?: FlattenedNativeStyle;
|
|
@@ -200,6 +200,5 @@ interface NativeStateStyles {
|
|
|
200
200
|
* Native interaction state names.
|
|
201
201
|
* RN doesn't have hover/active — uses pressed, focused, disabled instead.
|
|
202
202
|
*/
|
|
203
|
-
type NativeInteractionStateName = 'default' | 'pressed' | 'focused' | 'disabled';
|
|
204
|
-
|
|
205
|
-
export type { ElementDesignData as E, FlattenedNativeStyle as F, NativeInteractionStateName as N, PseudoElementStyles as P, ResponsiveSnapshot as R, StateStyles as S, ExtendedComputedStyles as a, NativeStateStyles as b, StyleDiff as c };
|
|
203
|
+
export type NativeInteractionStateName = 'default' | 'pressed' | 'focused' | 'disabled';
|
|
204
|
+
//# sourceMappingURL=design-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-types.d.ts","sourceRoot":"","sources":["../../src/design/design-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IAErC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAGlB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAA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AE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IAE1D,uDAAuD;IACvD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC"}
|
package/dist/design/index.d.ts
CHANGED
|
@@ -1,63 +1,8 @@
|
|
|
1
|
-
import { R as ResponsiveSnapshot, S as StateStyles, E as ElementDesignData, a as ExtendedComputedStyles } from '../design-types-BHr6Q1FX.js';
|
|
2
|
-
export { F as FlattenedNativeStyle, N as NativeInteractionStateName, b as NativeStateStyles, P as PseudoElementStyles, c as StyleDiff } from '../design-types-BHr6Q1FX.js';
|
|
3
|
-
import { n as NativeLayout } from '../types-BPNuYxDx.js';
|
|
4
|
-
|
|
5
1
|
/**
|
|
6
|
-
* Native Design
|
|
2
|
+
* UI Bridge Native - Design Review
|
|
7
3
|
*
|
|
8
|
-
*
|
|
9
|
-
* web SDK's ExtendedComputedStyles format. No react-native imports — works
|
|
10
|
-
* with already-flattened style objects from the registry.
|
|
11
|
-
*
|
|
12
|
-
* Key differences from web:
|
|
13
|
-
* - No `window.getComputedStyle()` — styles are declarative objects
|
|
14
|
-
* - No hover/active states — uses pressed/focused/disabled
|
|
15
|
-
* - No pseudo-elements (::before/::after)
|
|
16
|
-
* - No CSS grid, cursor, visibility, transitions, background-image
|
|
17
|
-
* - RN default flexDirection is 'column' (not 'row')
|
|
18
|
-
* - Shadows differ: iOS uses shadow* props, Android uses elevation
|
|
19
|
-
* - Numeric values → "Npx" strings
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Map a flattened React Native style object to ExtendedComputedStyles.
|
|
24
|
-
*
|
|
25
|
-
* Rules:
|
|
26
|
-
* - Numeric values → "Npx"
|
|
27
|
-
* - String values → pass through
|
|
28
|
-
* - textDecorationLine → textDecoration
|
|
29
|
-
* - RN shadow props → boxShadow string
|
|
30
|
-
* - CSS-only properties (cursor, visibility, grid*, etc.) → empty string
|
|
31
|
-
*/
|
|
32
|
-
declare function mapNativeStyleToExtended(rnStyle: Record<string, unknown> | undefined | null): ExtendedComputedStyles;
|
|
33
|
-
/**
|
|
34
|
-
* Produce ElementDesignData for a single native element.
|
|
35
|
-
*/
|
|
36
|
-
declare function getNativeElementDesignData(id: string, label: string | undefined, type: string, rnStyle: Record<string, unknown> | undefined | null, layout: NativeLayout | null): ElementDesignData;
|
|
37
|
-
/**
|
|
38
|
-
* Produce StateStyles[] for default/pressed/focused/disabled.
|
|
39
|
-
* Only includes states that have actual overrides or the default state.
|
|
40
|
-
*/
|
|
41
|
-
declare function captureNativeStateVariations(baseStyle: Record<string, unknown> | undefined | null, stateStyles?: {
|
|
42
|
-
pressed?: Record<string, unknown>;
|
|
43
|
-
focused?: Record<string, unknown>;
|
|
44
|
-
disabled?: Record<string, unknown>;
|
|
45
|
-
}): StateStyles[];
|
|
46
|
-
/**
|
|
47
|
-
* Capture a responsive snapshot.
|
|
48
|
-
*
|
|
49
|
-
* Platform limitation: RN cannot constrain screen width at runtime.
|
|
50
|
-
* This returns a single snapshot at the current device dimensions.
|
|
4
|
+
* Style capture, mapping, and design review for React Native elements.
|
|
51
5
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
type: string;
|
|
56
|
-
flatStyle?: Record<string, unknown>;
|
|
57
|
-
layout: NativeLayout | null;
|
|
58
|
-
}>, screenDimensions: {
|
|
59
|
-
width: number;
|
|
60
|
-
height: number;
|
|
61
|
-
}): ResponsiveSnapshot[];
|
|
62
|
-
|
|
63
|
-
export { ElementDesignData, ExtendedComputedStyles, ResponsiveSnapshot, StateStyles, captureNativeResponsiveSnapshot, captureNativeStateVariations, getNativeElementDesignData, mapNativeStyleToExtended };
|
|
6
|
+
export type { ExtendedComputedStyles, StyleDiff, StateStyles, ElementDesignData, PseudoElementStyles, ResponsiveSnapshot, FlattenedNativeStyle, NativeStateStyles, NativeInteractionStateName, } from './design-types';
|
|
7
|
+
export { mapNativeStyleToExtended, getNativeElementDesignData, captureNativeStateVariations, captureNativeResponsiveSnapshot, } from './design-inspector-native';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/design/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,sBAAsB,EACtB,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,2BAA2B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,76 +1,31 @@
|
|
|
1
|
-
export { A as ActionHandler, B as BridgeEvent, a as BridgeEventListener, b as BridgeEventType, C as ComponentAction, c as CustomAction, D as DiscoveredNativeElement, N as NativeActionRequest, d as NativeActionResponse, e as NativeBridgeSnapshot, f as NativeComponentAction, g as NativeCustomAction, h as NativeElementIdentifier, i as NativeElementRef, j as NativeElementState, k as NativeElementType, l as NativeFindRequest, m as NativeFindResponse, n as NativeLayout, o as NativeStandardAction, p as NativeUIBridgeConfig, q as NativeUIBridgeFeatures, R as RegisteredNativeComponent, r as RegisteredNativeElement, W as WaitOptions, s as Workflow, t as WorkflowStep, u as WorkflowStepType } from './types-BPNuYxDx.js';
|
|
2
|
-
export { N as NativeRegistryConfig, a as NativeUIBridgeRegistry, R as RegisterComponentOptions, b as RegisterElementOptions, e as extractHandlerNames, g as getGlobalRegistry, r as resetGlobalRegistry, s as setGlobalRegistry } from './registry-B8A_EoxS.js';
|
|
3
|
-
export { buildTreePath, createNativeElementIdentifier, findAllByPattern, findElementByIdentifier, matchesIdentifier, parseTreePath } from './core/index.js';
|
|
4
|
-
export { C as CloudRelayClient, a as CloudRelayConfig, b as ComponentActionDef, c as ComponentActionRequest, d as ComponentActionResponse, U as UIBridgeNativeContextValue, e as UIBridgeNativeProvider, f as UIBridgeNativeProviderProps, g as UIBridgeProps, h as UseUIBridgeReturn, i as UseUIComponentOptions, j as UseUIComponentReturn, k as UseUIElementOptions, l as UseUIElementReturn, m as UseUIElementWithPropsReturn, u as useUIBridge, n as useUIBridgeNative, o as useUIBridgeNativeOptional, p as useUIBridgeNativeRequired, q as useUIBridgeRequired, r as useUIComponent, s as useUIComponentAction, t as useUIElement, v as useUIElementWithProps } from './useUIBridge-CDZbWxII.js';
|
|
5
|
-
export { A as ActionExecutionOptions, C as ControlActionRequest, a as ControlActionResponse, b as ControlComponentActionRequest, c as ControlComponentActionResponse, N as NativeActionExecutor, P as PressActionParams, S as ScrollActionParams, d as SwipeActionParams, T as TypeActionParams, W as WaitResult } from './types-BCYWwyVy.js';
|
|
6
|
-
export { DefaultNativeActionExecutor, createNativeActionExecutor } from './control/index.js';
|
|
7
|
-
export { A as APIResponse, H as HTTPRequest, a as HTTPResponse, b as HandlerContext, c as HandlerFunction, J as JsonRpcBatchRequest, d as JsonRpcBatchResponse, e as JsonRpcEvent, f as JsonRpcRequest, g as JsonRpcResponse, N as NativeServerConfig, h as NativeServerHandlers, i as NativeUIBridgeServer, j as NavigationProvider, R as RequestHandler, k as RouteDefinition, l as RouteProvider, S as ScreenshotProvider, m as ServerAdapter, U as UI_BRIDGE_NATIVE_ROUTES, W as WebSocketConnection, n as WebSocketEventBridge, o as WebSocketMessageHandler, p as WebSocketServerAdapter, q as createNativeServer } from './http-server-B7KudcYJ.js';
|
|
8
|
-
export { NativeDesignHandlers, buildUpgradeResponse, computeAcceptKey, createDesignHandlers, createServerHandlers } from './server/index.js';
|
|
9
|
-
export { E as ElementDesignData, a as ExtendedComputedStyles, F as FlattenedNativeStyle, N as NativeInteractionStateName, b as NativeStateStyles, P as PseudoElementStyles, R as ResponsiveSnapshot, S as StateStyles, c as StyleDiff } from './design-types-BHr6Q1FX.js';
|
|
10
|
-
export { captureNativeResponsiveSnapshot, captureNativeStateVariations, getNativeElementDesignData, mapNativeStyleToExtended } from './design/index.js';
|
|
11
|
-
export { UIBridgeInspector, UIBridgeInspectorProps } from './debug/index.js';
|
|
12
|
-
import 'react/jsx-runtime';
|
|
13
|
-
import 'react';
|
|
14
|
-
|
|
15
1
|
/**
|
|
16
|
-
*
|
|
2
|
+
* UI Bridge Native
|
|
17
3
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
interface AnnouncerConfig {
|
|
23
|
-
/** Stable device identifier */
|
|
24
|
-
deviceId: string;
|
|
25
|
-
/** App bundle/package ID */
|
|
26
|
-
appId: string;
|
|
27
|
-
/** UI Bridge server port (default 8087) */
|
|
28
|
-
port?: number;
|
|
29
|
-
/** Cloud relay WebSocket URL for registration */
|
|
30
|
-
cloudRelayUrl?: string;
|
|
31
|
-
/** Auth token for cloud relay */
|
|
32
|
-
cloudToken?: string;
|
|
33
|
-
/** UI Bridge SDK version */
|
|
34
|
-
version?: string;
|
|
35
|
-
}
|
|
36
|
-
interface DeviceAnnouncerState {
|
|
37
|
-
mdnsActive: boolean;
|
|
38
|
-
cloudConnected: boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Announces the UI Bridge server on the local network (mDNS) and optionally
|
|
42
|
-
* registers with the qontinui.io cloud relay for remote discovery.
|
|
4
|
+
* UI Bridge framework for React Native applications.
|
|
5
|
+
* Enables AI-driven UI automation and testing for mobile apps.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
43
8
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*/
|
|
68
|
-
connectCloudRelay(): Promise<void>;
|
|
69
|
-
/** Stop all advertising and registration. */
|
|
70
|
-
stop(): Promise<void>;
|
|
71
|
-
/** Return a copy of the current announcer state. */
|
|
72
|
-
getState(): DeviceAnnouncerState;
|
|
73
|
-
private scheduleReconnect;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export { type AnnouncerConfig, DeviceAnnouncer, type DeviceAnnouncerState };
|
|
9
|
+
export { type NativeElementIdentifier, type NativeElementState, type NativeLayout, type NativeElementType, type NativeStandardAction, type NativeCustomAction, type RegisteredNativeElement, type RegisteredNativeComponent, type NativeComponentAction, type NativeActionRequest, type NativeActionResponse, type NativeBridgeSnapshot, type NativeUIBridgeFeatures, type NativeUIBridgeConfig, type NativeFindRequest, type NativeFindResponse, type DiscoveredNativeElement, type NativeElementRef, type Workflow, type WorkflowStep, type WorkflowStepType, type WaitOptions, type BridgeEvent, type BridgeEventType, type BridgeEventListener, type ActionHandler, type CustomAction, type ComponentAction, } from './core/types';
|
|
10
|
+
export { NativeUIBridgeRegistry, extractHandlerNames, setGlobalRegistry, getGlobalRegistry, resetGlobalRegistry, type RegisterElementOptions, type RegisterComponentOptions, type NativeRegistryConfig, } from './core/registry';
|
|
11
|
+
export { createNativeElementIdentifier, findElementByIdentifier, findAllByPattern, buildTreePath, parseTreePath, matchesIdentifier, } from './core/element-identifier';
|
|
12
|
+
export { UIBridgeNativeProvider, useUIBridgeNative, useUIBridgeNativeOptional, useUIBridgeNativeRequired, type UIBridgeNativeContextValue, type UIBridgeNativeProviderProps, } from './react/UIBridgeNativeProvider';
|
|
13
|
+
export { useUIElement, useUIElementWithProps, type UseUIElementOptions, type UseUIElementReturn, type UseUIElementWithPropsReturn, type UIBridgeProps, } from './react/useUIElement';
|
|
14
|
+
export { useUIComponent, useUIComponentAction, type ComponentActionDef, type UseUIComponentOptions, type UseUIComponentReturn, } from './react/useUIComponent';
|
|
15
|
+
export { useUIBridge, useUIBridgeRequired, type UseUIBridgeReturn, type ComponentActionRequest, type ComponentActionResponse, } from './react/useUIBridge';
|
|
16
|
+
export { type ControlActionRequest, type ControlActionResponse, type ComponentActionRequest as ControlComponentActionRequest, type ComponentActionResponse as ControlComponentActionResponse, type WaitResult, type NativeActionExecutor, type ActionExecutionOptions, type TypeActionParams, type ScrollActionParams, type SwipeActionParams, type PressActionParams, } from './control/types';
|
|
17
|
+
export { DefaultNativeActionExecutor, createNativeActionExecutor } from './control/action-executor';
|
|
18
|
+
export { type NativeServerConfig, type RouteDefinition, type APIResponse, type HandlerContext, type HandlerFunction, type NativeServerHandlers, type NavigationProvider, type ScreenshotProvider, type RouteProvider, UI_BRIDGE_NATIVE_ROUTES, } from './server/types';
|
|
19
|
+
export { createServerHandlers } from './server/handlers';
|
|
20
|
+
export { NativeUIBridgeServer, createNativeServer, type HTTPRequest, type HTTPResponse, type RequestHandler, type ServerAdapter, type WebSocketServerAdapter, } from './server/http-server';
|
|
21
|
+
export { buildUpgradeResponse, computeAcceptKey } from './server/ws-protocol';
|
|
22
|
+
export { WebSocketConnection } from './server/ws-connection';
|
|
23
|
+
export type { WebSocketMessageHandler } from './server/ws-connection';
|
|
24
|
+
export { WebSocketEventBridge } from './server/ws-event-bridge';
|
|
25
|
+
export type { JsonRpcRequest, JsonRpcResponse, JsonRpcEvent, JsonRpcBatchRequest, JsonRpcBatchResponse, } from './server/ws-types';
|
|
26
|
+
export { type ExtendedComputedStyles, type StyleDiff, type StateStyles, type ElementDesignData, type PseudoElementStyles, type ResponsiveSnapshot, type FlattenedNativeStyle, type NativeStateStyles, type NativeInteractionStateName, } from './design/design-types';
|
|
27
|
+
export { mapNativeStyleToExtended, getNativeElementDesignData, captureNativeStateVariations, captureNativeResponsiveSnapshot, } from './design/design-inspector-native';
|
|
28
|
+
export { createDesignHandlers, type NativeDesignHandlers } from './server/design-handlers';
|
|
29
|
+
export { UIBridgeInspector, type UIBridgeInspectorProps } from './debug/inspector';
|
|
30
|
+
export * from './transport';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EAErB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,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,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EACV,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,GAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAG3F,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAGnF,cAAc,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
4
|
var reactNative = require('react-native');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
7
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
8
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -741,7 +741,7 @@ var DefaultNativeActionExecutor = class {
|
|
|
741
741
|
if (!params?.text) {
|
|
742
742
|
throw new Error("Type action requires text parameter");
|
|
743
743
|
}
|
|
744
|
-
if (params.clearFirst) {
|
|
744
|
+
if (params.clearFirst || params.clear) {
|
|
745
745
|
await this.performClear(element, props);
|
|
746
746
|
}
|
|
747
747
|
if (params.delay && params.delay > 0) {
|
|
@@ -1974,6 +1974,10 @@ var WS_ROUTES = [
|
|
|
1974
1974
|
{ pattern: "health", handler: "health", httpMethods: ["GET"] },
|
|
1975
1975
|
// Elements
|
|
1976
1976
|
{ pattern: "control/elements", handler: "getElements", httpMethods: ["GET"] },
|
|
1977
|
+
// Flat alias — matches the runner UI Bridge's `/ui-bridge/elements` path so
|
|
1978
|
+
// agents can use the same URL across runner + mobile without remembering
|
|
1979
|
+
// the `control/` prefix. Delegates to the same handler.
|
|
1980
|
+
{ pattern: "elements", handler: "getElements", httpMethods: ["GET"] },
|
|
1977
1981
|
{ pattern: "control/element/:id", handler: "getElement", httpMethods: ["GET"] },
|
|
1978
1982
|
{ pattern: "control/element/:id/state", handler: "getElementState", httpMethods: ["GET"] },
|
|
1979
1983
|
{ pattern: "control/element/:id/action", handler: "executeAction", httpMethods: ["POST"] },
|
|
@@ -2024,6 +2028,87 @@ var WS_ROUTES = [
|
|
|
2024
2028
|
// Meta / Introspection
|
|
2025
2029
|
{ pattern: "meta/methods", handler: "getMethods", httpMethods: ["GET"] }
|
|
2026
2030
|
];
|
|
2031
|
+
var HANDLER_DESCRIPTIONS = {
|
|
2032
|
+
health: "Liveness probe; returns app metadata + element count",
|
|
2033
|
+
getElements: "Flat list of registered UI elements",
|
|
2034
|
+
getElement: "Single element by id",
|
|
2035
|
+
getElementState: "Dynamic state (value, focused, checked) for one element",
|
|
2036
|
+
executeAction: 'Run an action on an element (see "actions" below for names)',
|
|
2037
|
+
getComponents: "Higher-level components with action schemas",
|
|
2038
|
+
getComponent: "Component detail + per-action paramSchema",
|
|
2039
|
+
executeComponentAction: "Invoke a component action directly (preferred over button clicks)",
|
|
2040
|
+
find: "AI-powered element search by natural-language query",
|
|
2041
|
+
getSnapshot: "Full snapshot: elements + route + state. Supports ?visibleOnly=true and ?currentRouteOnly=true",
|
|
2042
|
+
getWorkflows: "List registered workflows",
|
|
2043
|
+
runWorkflow: "Trigger a workflow by id",
|
|
2044
|
+
pageRefresh: "Reload the current route",
|
|
2045
|
+
pageNavigate: "Imperative router.push(url) \u2014 preferred over tapping tab buttons",
|
|
2046
|
+
pageReplace: "router.replace(url)",
|
|
2047
|
+
pageGoBack: "router.back()",
|
|
2048
|
+
pageGoForward: "router.forward()",
|
|
2049
|
+
getScreenshot: "PNG screenshot of the current screen",
|
|
2050
|
+
getElementStyles: "Computed styles for an element (design review)",
|
|
2051
|
+
getElementStateStyles: "Computed styles per interaction state (hover/focus/disabled)",
|
|
2052
|
+
getDesignSnapshot: "Visual + style snapshot for design review",
|
|
2053
|
+
getResponsiveSnapshots: "Screenshots at multiple viewport widths",
|
|
2054
|
+
runDesignAudit: "Accessibility + visual audit",
|
|
2055
|
+
loadStyleGuide: "Load a design system style guide",
|
|
2056
|
+
getStyleGuide: "Fetch the currently loaded style guide",
|
|
2057
|
+
clearStyleGuide: "Unload the style guide",
|
|
2058
|
+
evaluateQuality: "Score the current UI against a quality context",
|
|
2059
|
+
getQualityContexts: "List available quality evaluation contexts",
|
|
2060
|
+
saveBaseline: "Save a quality baseline snapshot",
|
|
2061
|
+
diffBaseline: "Diff current UI against a saved baseline",
|
|
2062
|
+
getMethods: "List every handler name (legacy introspection)"
|
|
2063
|
+
};
|
|
2064
|
+
var ACTION_REFERENCE = [
|
|
2065
|
+
{ name: "press", aliases: ["click"], params: "PressActionParams (optional position)" },
|
|
2066
|
+
{ name: "longPress", params: "PressActionParams (optional position)" },
|
|
2067
|
+
{ name: "doubleTap", params: "none" },
|
|
2068
|
+
{
|
|
2069
|
+
name: "type",
|
|
2070
|
+
params: "TypeActionParams { text, delay?, clear? | clearFirst? } \u2014 `clear:true` replaces content atomically"
|
|
2071
|
+
},
|
|
2072
|
+
{ name: "clear", params: "none \u2014 empties the input" },
|
|
2073
|
+
{ name: "focus", params: "none" },
|
|
2074
|
+
{ name: "blur", params: "none" },
|
|
2075
|
+
{ name: "scroll", params: "ScrollActionParams { offset? {x,y}, to? }" },
|
|
2076
|
+
{ name: "swipe", params: "SwipeActionParams { direction, distance }" },
|
|
2077
|
+
{ name: "toggle", params: "none \u2014 flips boolean controls" }
|
|
2078
|
+
];
|
|
2079
|
+
function buildRoutesPayload() {
|
|
2080
|
+
const entries = [];
|
|
2081
|
+
for (const r of WS_ROUTES) {
|
|
2082
|
+
if (!r.httpMethods) continue;
|
|
2083
|
+
for (const m of r.httpMethods) {
|
|
2084
|
+
entries.push({ method: m, path: `/ui-bridge/${r.pattern}` });
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
entries.push({ method: "GET", path: "/ui-bridge/_help" });
|
|
2088
|
+
entries.push({ method: "GET", path: "/ui-bridge/_routes" });
|
|
2089
|
+
entries.sort((a, b) => a.path.localeCompare(b.path) || a.method.localeCompare(b.method));
|
|
2090
|
+
return { routes: entries, count: entries.length };
|
|
2091
|
+
}
|
|
2092
|
+
function buildHelpPayload() {
|
|
2093
|
+
return {
|
|
2094
|
+
version: 1,
|
|
2095
|
+
description: "UI Bridge Native HTTP surface. Prefix every path with /ui-bridge/.",
|
|
2096
|
+
routes: WS_ROUTES.map((r) => ({
|
|
2097
|
+
pattern: r.pattern,
|
|
2098
|
+
httpMethods: r.httpMethods ?? [],
|
|
2099
|
+
wsOnly: !r.httpMethods,
|
|
2100
|
+
handler: r.handler,
|
|
2101
|
+
description: HANDLER_DESCRIPTIONS[r.handler] ?? ""
|
|
2102
|
+
})),
|
|
2103
|
+
actions: ACTION_REFERENCE,
|
|
2104
|
+
tips: [
|
|
2105
|
+
"Start with `GET /ui-bridge/control/snapshot?visibleOnly=true` to see what the user actually sees.",
|
|
2106
|
+
"Prefer `control/component/:id/action/:actionId` over button presses \u2014 typed paramSchema, no button-id guessing.",
|
|
2107
|
+
"Use `pageNavigate` for tab switches instead of pressing tab buttons; gesture state often swallows clicks.",
|
|
2108
|
+
"The `type` action supports `clear:true` to replace existing text atomically in one call."
|
|
2109
|
+
]
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2027
2112
|
var NativeUIBridgeServer = class {
|
|
2028
2113
|
constructor(registry, executor, config = {}) {
|
|
2029
2114
|
this.registry = registry;
|
|
@@ -2040,7 +2125,9 @@ var NativeUIBridgeServer = class {
|
|
|
2040
2125
|
cors: true,
|
|
2041
2126
|
...config
|
|
2042
2127
|
};
|
|
2043
|
-
this.handlers = createServerHandlers(registry, executor
|
|
2128
|
+
this.handlers = createServerHandlers(registry, executor, {
|
|
2129
|
+
appInfo: this.config.appInfo
|
|
2130
|
+
});
|
|
2044
2131
|
this.handlers.getMethods = async () => {
|
|
2045
2132
|
const methods = WS_ROUTES.map((r) => ({
|
|
2046
2133
|
method: r.pattern,
|
|
@@ -2844,6 +2931,20 @@ var NativeUIBridgeServer = class {
|
|
|
2844
2931
|
};
|
|
2845
2932
|
}
|
|
2846
2933
|
const stripped = path.slice(PREFIX.length);
|
|
2934
|
+
if (method === "GET" && stripped === "_help") {
|
|
2935
|
+
return {
|
|
2936
|
+
success: true,
|
|
2937
|
+
data: buildHelpPayload(),
|
|
2938
|
+
timestamp: Date.now()
|
|
2939
|
+
};
|
|
2940
|
+
}
|
|
2941
|
+
if (method === "GET" && stripped === "_routes") {
|
|
2942
|
+
return {
|
|
2943
|
+
success: true,
|
|
2944
|
+
data: buildRoutesPayload(),
|
|
2945
|
+
timestamp: Date.now()
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2847
2948
|
let patternMatchedButWrongVerb = false;
|
|
2848
2949
|
for (const route of WS_ROUTES) {
|
|
2849
2950
|
const pathParams = parsePath(route.pattern, stripped);
|
|
@@ -3144,8 +3245,6 @@ var WebSocketEventBridge = class {
|
|
|
3144
3245
|
}, this.heartbeatIntervalMs);
|
|
3145
3246
|
}
|
|
3146
3247
|
};
|
|
3147
|
-
|
|
3148
|
-
// src/transport/DeviceAnnouncer.ts
|
|
3149
3248
|
var DEFAULT_PORT = 8087;
|
|
3150
3249
|
var RECONNECT_INITIAL_DELAY_MS = 2e3;
|
|
3151
3250
|
var RECONNECT_MAX_DELAY_MS = 6e4;
|
|
@@ -3166,15 +3265,27 @@ var DeviceAnnouncer = class {
|
|
|
3166
3265
|
}
|
|
3167
3266
|
// ── mDNS ──────────────────────────────────────────────────────────────────
|
|
3168
3267
|
/**
|
|
3169
|
-
* Start mDNS advertisement
|
|
3268
|
+
* Start mDNS advertisement.
|
|
3170
3269
|
*
|
|
3171
|
-
*
|
|
3270
|
+
* The consumer must pass the `Zeroconf` constructor (from `react-native-zeroconf`)
|
|
3271
|
+
* explicitly; otherwise this is a no-op.
|
|
3272
|
+
*
|
|
3273
|
+
* Rationale: Metro's `require()` throws an uncatchable module-load error if the
|
|
3274
|
+
* bundle doesn't include the named package. That error escapes async try/catch
|
|
3275
|
+
* boundaries and crashes the app. We avoid it by never calling `require()`
|
|
3276
|
+
* ourselves — the consumer imports the package when they know it's installed.
|
|
3277
|
+
*
|
|
3278
|
+
* @param ZeroconfCtor - constructor from `import Zeroconf from 'react-native-zeroconf'`
|
|
3172
3279
|
*/
|
|
3173
|
-
async startMdnsAdvertise() {
|
|
3280
|
+
async startMdnsAdvertise(ZeroconfCtor) {
|
|
3281
|
+
if (!ZeroconfCtor) {
|
|
3282
|
+
console.log(
|
|
3283
|
+
"[DeviceAnnouncer] mDNS advertisement skipped (no Zeroconf constructor provided). Pass one to enable mDNS."
|
|
3284
|
+
);
|
|
3285
|
+
return;
|
|
3286
|
+
}
|
|
3174
3287
|
try {
|
|
3175
|
-
|
|
3176
|
-
const Zeroconf = ZeroconfModule.default ?? ZeroconfModule;
|
|
3177
|
-
this.zeroconf = new Zeroconf();
|
|
3288
|
+
this.zeroconf = new ZeroconfCtor();
|
|
3178
3289
|
const port = this.config.port ?? DEFAULT_PORT;
|
|
3179
3290
|
const serviceName = `UIBridge-${this.config.deviceId.slice(0, 8)}`;
|
|
3180
3291
|
this.zeroconf.publishService("_uibridge", "_tcp.", "local.", serviceName, port, {
|
|
@@ -3185,10 +3296,8 @@ var DeviceAnnouncer = class {
|
|
|
3185
3296
|
});
|
|
3186
3297
|
this.state = { ...this.state, mdnsActive: true };
|
|
3187
3298
|
console.log(`[DeviceAnnouncer] mDNS: advertising "${serviceName}" on port ${port}`);
|
|
3188
|
-
} catch (
|
|
3189
|
-
console.warn(
|
|
3190
|
-
"[DeviceAnnouncer] react-native-zeroconf not available \u2014 mDNS advertisement skipped. Install it with: npx expo install react-native-zeroconf"
|
|
3191
|
-
);
|
|
3299
|
+
} catch (err) {
|
|
3300
|
+
console.warn("[DeviceAnnouncer] mDNS start failed:", err);
|
|
3192
3301
|
}
|
|
3193
3302
|
}
|
|
3194
3303
|
// ── Cloud relay ───────────────────────────────────────────────────────────
|
|
@@ -3293,12 +3402,7 @@ function generateHex(bytes) {
|
|
|
3293
3402
|
return Array.from(arr).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
3294
3403
|
}
|
|
3295
3404
|
function getPlatform() {
|
|
3296
|
-
|
|
3297
|
-
const { Platform } = __require("react-native");
|
|
3298
|
-
return Platform.OS ?? "unknown";
|
|
3299
|
-
} catch {
|
|
3300
|
-
return "unknown";
|
|
3301
|
-
}
|
|
3405
|
+
return reactNative.Platform?.OS ?? "unknown";
|
|
3302
3406
|
}
|
|
3303
3407
|
|
|
3304
3408
|
// src/transport/CloudRelayClient.ts
|
|
@@ -3505,7 +3609,8 @@ function UIBridgeNativeProvider({
|
|
|
3505
3609
|
}
|
|
3506
3610
|
const server = createNativeServer(registry, executor, {
|
|
3507
3611
|
serverPort: config.serverPort || 8087,
|
|
3508
|
-
cors: true
|
|
3612
|
+
cors: true,
|
|
3613
|
+
appInfo: config.appInfo
|
|
3509
3614
|
});
|
|
3510
3615
|
server.setAdapter(serverAdapter);
|
|
3511
3616
|
if (navigationProvider) {
|
|
@@ -3592,7 +3697,8 @@ function UIBridgeNativeProvider({
|
|
|
3592
3697
|
try {
|
|
3593
3698
|
const bareServer = createNativeServer(registry, executor, {
|
|
3594
3699
|
serverPort: config.serverPort || 8087,
|
|
3595
|
-
cors: true
|
|
3700
|
+
cors: true,
|
|
3701
|
+
appInfo: config.appInfo
|
|
3596
3702
|
});
|
|
3597
3703
|
if (navigationProvider) bareServer.setNavigationProvider(navigationProvider);
|
|
3598
3704
|
if (screenshotProvider) bareServer.setScreenshotProvider(screenshotProvider);
|