@qontinui/ui-bridge-native 0.3.2 → 0.5.1
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 -95
- package/dist/control/index.d.ts.map +1 -0
- package/dist/{types-CjEKTDYT.d.ts → control/types.d.ts} +17 -20
- 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-pAUpQq2O.d.ts → core/registry.d.ts} +10 -13
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/{types-CGVut7mc.d.mts → core/types.d.ts} +41 -41
- 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 +1 -1
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/index.mjs +2 -2
- 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.mts → 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 +37 -86
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -5
- package/dist/index.mjs.map +1 -1
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.d.ts.map +1 -0
- package/dist/modal/modal-detector.d.ts +29 -0
- package/dist/modal/modal-detector.d.ts.map +1 -0
- package/dist/react/StateAnnotation.d.ts +30 -0
- package/dist/react/StateAnnotation.d.ts.map +1 -0
- package/dist/react/UIBridgeNativeProvider.d.ts +163 -0
- package/dist/react/UIBridgeNativeProvider.d.ts.map +1 -0
- package/dist/react/index.d.ts +14 -69
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +60 -4
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +61 -5
- 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/useUIBridgeModal.d.ts +14 -0
- package/dist/react/useUIBridgeModal.d.ts.map +1 -0
- package/dist/react/useUIBridgeToast.d.ts +25 -0
- package/dist/react/useUIBridgeToast.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 +25 -0
- package/dist/server/handlers.d.ts.map +1 -0
- package/dist/server/http-server.d.ts +269 -0
- package/dist/server/http-server.d.ts.map +1 -0
- package/dist/server/index.d.ts +14 -176
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +51 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +51 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/observability.d.ts +55 -0
- package/dist/server/observability.d.ts.map +1 -0
- package/dist/server/types.d.ts +377 -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/toast/index.d.ts +2 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toast/toast-capture.d.ts +27 -0
- package/dist/toast/toast-capture.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/dist/transport/logger.d.ts +23 -0
- package/dist/transport/logger.d.ts.map +1 -0
- package/dist/undo/index.d.ts +3 -0
- package/dist/undo/index.d.ts.map +1 -0
- package/dist/undo/undo-tracker.d.ts +59 -0
- package/dist/undo/undo-tracker.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/StateAnnotation--zm0Jfqj.d.ts +0 -755
- package/dist/StateAnnotation-BgFoVWFy.d.mts +0 -755
- package/dist/core/index.d.mts +0 -46
- package/dist/design-types-BHr6Q1FX.d.ts +0 -205
- package/dist/http-server--550eD1F.d.mts +0 -805
- package/dist/http-server-C9NaNBEP.d.ts +0 -805
- package/dist/index.d.mts +0 -89
- package/dist/registry-B5JadBN9.d.mts +0 -300
- package/dist/server/index.d.mts +0 -178
- package/dist/types-B0XA4vOF.d.mts +0 -197
- package/dist/types-CGVut7mc.d.ts +0 -567
package/dist/index.d.ts
CHANGED
|
@@ -1,89 +1,40 @@
|
|
|
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 NativeCapturedToast, g as NativeComponentAction, h as NativeCustomAction, i as NativeElementIdentifier, j as NativeElementRef, k as NativeElementState, l as NativeElementType, m as NativeFindRequest, n as NativeFindResponse, o as NativeLayout, p as NativeModalInfo, q as NativeRegistrationCoverage, r as NativeSnapshotEnricher, s as NativeSnapshotEnrichers, t as NativeSnapshotModalContext, u as NativeSnapshotToastContext, v as NativeSnapshotUndoContext, w as NativeStandardAction, x as NativeUIBridgeConfig, y as NativeUIBridgeFeatures, R as RegisteredNativeComponent, z as RegisteredNativeElement, W as WaitOptions, E as Workflow, F as WorkflowStep, G as WorkflowStepType } from './types-CGVut7mc.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-pAUpQq2O.js';
|
|
3
|
-
export { buildTreePath, createNativeElementIdentifier, findAllByPattern, findElementByIdentifier, matchesIdentifier, parseTreePath } from './core/index.js';
|
|
4
|
-
export { A as ActionRecord, C as CloudRelayClient, a as CloudRelayConfig, b as ComponentActionDef, c as ComponentActionRequest, d as ComponentActionResponse, D as DeclaredUndoState, M as ModalDetector, e as ModalPushInput, S as State, f as StateAnnotationRequiredElement, g as StateProps, T as ToastCapture, h as ToastCaptureConfig, i as ToastRecordInput, j as ToastRecorderInput, k as TransitionTo, l as TransitionToProps, U as UIBridgeNativeContextValue, m as UIBridgeNativeProvider, n as UIBridgeNativeProviderProps, o as UIBridgeProps, p as UndoTracker, q as UndoTrackerConfig, r as UseUIBridgeModalOptions, s as UseUIBridgeReturn, t as UseUIBridgeToastOptions, u as UseUIComponentOptions, v as UseUIComponentReturn, w as UseUIElementOptions, x as UseUIElementReturn, y as UseUIElementWithPropsReturn, z as useToastRecorder, B as useUIBridge, E as useUIBridgeModal, F as useUIBridgeNative, G as useUIBridgeNativeOptional, H as useUIBridgeNativeRequired, I as useUIBridgeRequired, J as useUIBridgeToast, K as useUIComponent, L as useUIComponentAction, N as useUIElement, O as useUIElementWithProps } from './StateAnnotation--zm0Jfqj.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-CjEKTDYT.js';
|
|
6
|
-
export { DefaultNativeActionExecutor, createNativeActionExecutor } from './control/index.js';
|
|
7
|
-
export { A as APIResponse, F as FillFormFieldInput, a as FillFormFieldResult, b as FillFormRequest, c as FillFormResponse, H as HTTPRequest, d as HTTPResponse, e as HandlerContext, f as HandlerFunction, J as JsonRpcBatchRequest, g as JsonRpcBatchResponse, h as JsonRpcEvent, i as JsonRpcRequest, j as JsonRpcResponse, N as NativeServerConfig, k as NativeServerHandlers, l as NativeUIBridgeServer, m as NavigationProvider, R as RequestHandler, n as RouteDefinition, o as RouteProvider, S as ScreenshotProvider, p as ServerAdapter, U as UI_BRIDGE_NATIVE_ROUTES, W as WebSocketConnection, q as WebSocketEventBridge, r as WebSocketMessageHandler, s as WebSocketServerAdapter, t as createNativeServer } from './http-server-C9NaNBEP.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
|
-
/** Minimal interface for the react-native-zeroconf Zeroconf instance */
|
|
41
|
-
interface ZeroconfService {
|
|
42
|
-
publishService(type: string, protocol: string, domain: string, name: string, port: number, txtRecord: Record<string, string>): void;
|
|
43
|
-
unpublishService(name: string): void;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Announces the UI Bridge server on the local network (mDNS) and optionally
|
|
47
|
-
* 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
|
|
48
8
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
connectCloudRelay(): Promise<void>;
|
|
82
|
-
/** Stop all advertising and registration. */
|
|
83
|
-
stop(): Promise<void>;
|
|
84
|
-
/** Return a copy of the current announcer state. */
|
|
85
|
-
getState(): DeviceAnnouncerState;
|
|
86
|
-
private scheduleReconnect;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
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 NativeRegistrationCoverage, type NativeModalInfo, type NativeSnapshotModalContext, type NativeCapturedToast, type NativeSnapshotToastContext, type NativeSnapshotUndoContext, type NativeSnapshotEnrichers, type NativeSnapshotEnricher, 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 { useUIBridgeModal, type UseUIBridgeModalOptions } from './react/useUIBridgeModal';
|
|
17
|
+
export { useUIBridgeToast, useToastRecorder, type UseUIBridgeToastOptions, type ToastRecorderInput, } from './react/useUIBridgeToast';
|
|
18
|
+
export { State, TransitionTo, type StateProps, type TransitionToProps, type StateAnnotationRequiredElement, } from './react/StateAnnotation';
|
|
19
|
+
export { ModalDetector } from './modal/modal-detector';
|
|
20
|
+
export type { ModalPushInput } from './modal/modal-detector';
|
|
21
|
+
export { ToastCapture } from './toast/toast-capture';
|
|
22
|
+
export type { ToastRecordInput, ToastCaptureConfig } from './toast/toast-capture';
|
|
23
|
+
export { UndoTracker } from './undo';
|
|
24
|
+
export type { ActionRecord, DeclaredUndoState, UndoTrackerConfig } from './undo';
|
|
25
|
+
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';
|
|
26
|
+
export { DefaultNativeActionExecutor, createNativeActionExecutor } from './control/action-executor';
|
|
27
|
+
export { type NativeServerConfig, type RouteDefinition, type APIResponse, type HandlerContext, type HandlerFunction, type NativeServerHandlers, type NavigationProvider, type ScreenshotProvider, type KeepAwakeProvider, type RouteProvider, type FillFormFieldInput, type FillFormFieldResult, type FillFormRequest, type FillFormResponse, UI_BRIDGE_NATIVE_ROUTES, } from './server/types';
|
|
28
|
+
export { createServerHandlers } from './server/handlers';
|
|
29
|
+
export { NativeUIBridgeServer, createNativeServer, type HTTPRequest, type HTTPResponse, type RequestHandler, type ServerAdapter, type WebSocketServerAdapter, } from './server/http-server';
|
|
30
|
+
export { buildUpgradeResponse, computeAcceptKey } from './server/ws-protocol';
|
|
31
|
+
export { WebSocketConnection } from './server/ws-connection';
|
|
32
|
+
export type { WebSocketMessageHandler } from './server/ws-connection';
|
|
33
|
+
export { WebSocketEventBridge } from './server/ws-event-bridge';
|
|
34
|
+
export type { JsonRpcRequest, JsonRpcResponse, JsonRpcEvent, JsonRpcBatchRequest, JsonRpcBatchResponse, } from './server/ws-types';
|
|
35
|
+
export { type ExtendedComputedStyles, type StyleDiff, type StateStyles, type ElementDesignData, type PseudoElementStyles, type ResponsiveSnapshot, type FlattenedNativeStyle, type NativeStateStyles, type NativeInteractionStateName, } from './design/design-types';
|
|
36
|
+
export { mapNativeStyleToExtended, getNativeElementDesignData, captureNativeStateVariations, captureNativeResponsiveSnapshot, } from './design/design-inspector-native';
|
|
37
|
+
export { createDesignHandlers, type NativeDesignHandlers } from './server/design-handlers';
|
|
38
|
+
export { UIBridgeInspector, type UIBridgeInspectorProps } from './debug/inspector';
|
|
39
|
+
export * from './transport';
|
|
40
|
+
//# 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,0BAA0B,EAC/B,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,yBAAy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221
2221
|
);
|
|
2222
2222
|
},
|
|
2223
|
+
// Keep-awake (stub — apps should override via setKeepAwakeProvider, which
|
|
2224
|
+
// the provider wires when a keepAwakeProvider prop is supplied)
|
|
2225
|
+
keepAwake: async () => {
|
|
2226
|
+
return error2(
|
|
2227
|
+
"keep-awake not configured. Provide a keepAwakeProvider to UIBridgeNativeProvider.",
|
|
2228
|
+
"NOT_SUPPORTED"
|
|
2229
|
+
);
|
|
2230
|
+
},
|
|
2223
2231
|
// Meta / Introspection (stub — server constructor overrides with real route table)
|
|
2224
2232
|
getMethods: async () => {
|
|
2225
2233
|
return error2("Methods introspection not configured", "NOT_SUPPORTED");
|
|
@@ -2893,6 +2901,12 @@ var WS_ROUTES = [
|
|
|
2893
2901
|
httpMethods: ["POST"],
|
|
2894
2902
|
requiresTestHooks: true
|
|
2895
2903
|
},
|
|
2904
|
+
{
|
|
2905
|
+
pattern: "control/keep-awake",
|
|
2906
|
+
handler: "keepAwake",
|
|
2907
|
+
httpMethods: ["POST"],
|
|
2908
|
+
requiresTestHooks: true
|
|
2909
|
+
},
|
|
2896
2910
|
// Observability — last-N console errors + network requests. testHooks-gated
|
|
2897
2911
|
// because patching `console.error` / `fetch` is invasive in production.
|
|
2898
2912
|
{
|
|
@@ -2945,7 +2959,8 @@ var HANDLER_DESCRIPTIONS = {
|
|
|
2945
2959
|
getConsoleErrors: "TEST HOOK \u2014 last-N console.error/console.warn entries; ?since=<ms>&limit=<n>",
|
|
2946
2960
|
getNetworkRequests: "TEST HOOK \u2014 last-N fetch/XHR entries with status + duration; ?since=<ms>&limit=<n>",
|
|
2947
2961
|
pushModal: "TEST HOOK \u2014 push a modal onto the snapshot.modalStack via the registry ModalDetector",
|
|
2948
|
-
dismissModal: "TEST HOOK \u2014 dismiss a modal by id from the snapshot.modalStack via the registry ModalDetector"
|
|
2962
|
+
dismissModal: "TEST HOOK \u2014 dismiss a modal by id from the snapshot.modalStack via the registry ModalDetector",
|
|
2963
|
+
keepAwake: "TEST HOOK \u2014 keep the device screen awake via the injected keepAwakeProvider: body { enabled: boolean, durationMs?: number }"
|
|
2949
2964
|
};
|
|
2950
2965
|
var ACTION_REFERENCE = [
|
|
2951
2966
|
{ name: "press", aliases: ["click"], params: "PressActionParams (optional position)" },
|
|
@@ -3213,6 +3228,35 @@ var NativeUIBridgeServer = class {
|
|
|
3213
3228
|
}
|
|
3214
3229
|
};
|
|
3215
3230
|
}
|
|
3231
|
+
/**
|
|
3232
|
+
* Set a keep-awake provider for native screen-wake control.
|
|
3233
|
+
* This enables `control/keep-awake` and arms the auto-arm hook in
|
|
3234
|
+
* handleRequest (every request keeps the screen alive for 60s).
|
|
3235
|
+
*/
|
|
3236
|
+
setKeepAwakeProvider(provider) {
|
|
3237
|
+
this.keepAwakeProvider = provider;
|
|
3238
|
+
this.handlers.keepAwake = async (ctx) => {
|
|
3239
|
+
const { enabled, durationMs } = ctx.body ?? {};
|
|
3240
|
+
if (typeof enabled !== "boolean") {
|
|
3241
|
+
return {
|
|
3242
|
+
success: false,
|
|
3243
|
+
error: "enabled must be boolean",
|
|
3244
|
+
code: "INVALID_REQUEST",
|
|
3245
|
+
timestamp: Date.now()
|
|
3246
|
+
};
|
|
3247
|
+
}
|
|
3248
|
+
if (enabled) {
|
|
3249
|
+
provider.request("ui-bridge", typeof durationMs === "number" ? durationMs : void 0);
|
|
3250
|
+
} else {
|
|
3251
|
+
provider.release("ui-bridge");
|
|
3252
|
+
}
|
|
3253
|
+
return {
|
|
3254
|
+
success: true,
|
|
3255
|
+
data: { enabled, durationMs: typeof durationMs === "number" ? durationMs : null },
|
|
3256
|
+
timestamp: Date.now()
|
|
3257
|
+
};
|
|
3258
|
+
};
|
|
3259
|
+
}
|
|
3216
3260
|
/**
|
|
3217
3261
|
* Start the HTTP server
|
|
3218
3262
|
*/
|
|
@@ -3805,6 +3849,12 @@ var NativeUIBridgeServer = class {
|
|
|
3805
3849
|
if (request.method === "OPTIONS") {
|
|
3806
3850
|
return { status: 204, headers, body: "" };
|
|
3807
3851
|
}
|
|
3852
|
+
if (this.config.testHooks === true && this.keepAwakeProvider) {
|
|
3853
|
+
try {
|
|
3854
|
+
this.keepAwakeProvider.request("auto-arm", 6e4);
|
|
3855
|
+
} catch {
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3808
3858
|
try {
|
|
3809
3859
|
const response = await this.routeRequest(request);
|
|
3810
3860
|
return {
|
|
@@ -4705,6 +4755,7 @@ function UIBridgeNativeProvider({
|
|
|
4705
4755
|
serverAdapter,
|
|
4706
4756
|
navigationProvider,
|
|
4707
4757
|
screenshotProvider,
|
|
4758
|
+
keepAwakeProvider,
|
|
4708
4759
|
routeProvider,
|
|
4709
4760
|
cloudRelayConfig,
|
|
4710
4761
|
enableMdnsAnnounce,
|
|
@@ -4759,6 +4810,9 @@ function UIBridgeNativeProvider({
|
|
|
4759
4810
|
if (screenshotProvider) {
|
|
4760
4811
|
server.setScreenshotProvider(screenshotProvider);
|
|
4761
4812
|
}
|
|
4813
|
+
if (keepAwakeProvider) {
|
|
4814
|
+
server.setKeepAwakeProvider(keepAwakeProvider);
|
|
4815
|
+
}
|
|
4762
4816
|
if (routeProvider) {
|
|
4763
4817
|
server.setRouteProvider(routeProvider);
|
|
4764
4818
|
}
|
|
@@ -4812,6 +4866,7 @@ function UIBridgeNativeProvider({
|
|
|
4812
4866
|
serverAdapter,
|
|
4813
4867
|
navigationProvider,
|
|
4814
4868
|
screenshotProvider,
|
|
4869
|
+
keepAwakeProvider,
|
|
4815
4870
|
routeProvider
|
|
4816
4871
|
]);
|
|
4817
4872
|
const stopServer = react.useCallback(() => {
|
|
@@ -4845,6 +4900,7 @@ function UIBridgeNativeProvider({
|
|
|
4845
4900
|
});
|
|
4846
4901
|
if (navigationProvider) bareServer.setNavigationProvider(navigationProvider);
|
|
4847
4902
|
if (screenshotProvider) bareServer.setScreenshotProvider(screenshotProvider);
|
|
4903
|
+
if (keepAwakeProvider) bareServer.setKeepAwakeProvider(keepAwakeProvider);
|
|
4848
4904
|
if (routeProvider) bareServer.setRouteProvider(routeProvider);
|
|
4849
4905
|
serverRef.current = bareServer;
|
|
4850
4906
|
} catch (err) {
|
|
@@ -4989,17 +5045,17 @@ function UIBridgeNativeProvider({
|
|
|
4989
5045
|
getCurrentRoute
|
|
4990
5046
|
]
|
|
4991
5047
|
);
|
|
4992
|
-
return /* @__PURE__ */ jsxRuntime.jsx(UIBridgeNativeContext
|
|
5048
|
+
return /* @__PURE__ */ jsxRuntime.jsx(UIBridgeNativeContext, { value: contextValue, children });
|
|
4993
5049
|
}
|
|
4994
5050
|
function useUIBridgeNative() {
|
|
4995
|
-
const context = react.
|
|
5051
|
+
const context = react.use(UIBridgeNativeContext);
|
|
4996
5052
|
if (!context) {
|
|
4997
5053
|
throw new Error("useUIBridgeNative must be used within a UIBridgeNativeProvider");
|
|
4998
5054
|
}
|
|
4999
5055
|
return context;
|
|
5000
5056
|
}
|
|
5001
5057
|
function useUIBridgeNativeOptional() {
|
|
5002
|
-
return react.
|
|
5058
|
+
return react.use(UIBridgeNativeContext);
|
|
5003
5059
|
}
|
|
5004
5060
|
var useUIBridgeNativeRequired = useUIBridgeNative;
|
|
5005
5061
|
function flattenStyle(style) {
|