@qontinui/ui-bridge-native 0.3.2 → 0.4.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.
Files changed (108) hide show
  1. package/dist/control/{index.d.mts → action-executor.d.ts} +6 -10
  2. package/dist/control/action-executor.d.ts.map +1 -0
  3. package/dist/control/index.d.ts +5 -95
  4. package/dist/control/index.d.ts.map +1 -0
  5. package/dist/{types-CjEKTDYT.d.ts → control/types.d.ts} +17 -20
  6. package/dist/control/types.d.ts.map +1 -0
  7. package/dist/core/element-identifier.d.ts +41 -0
  8. package/dist/core/element-identifier.d.ts.map +1 -0
  9. package/dist/core/index.d.ts +6 -43
  10. package/dist/core/index.d.ts.map +1 -0
  11. package/dist/{registry-pAUpQq2O.d.ts → core/registry.d.ts} +10 -13
  12. package/dist/core/registry.d.ts.map +1 -0
  13. package/dist/{types-CGVut7mc.d.mts → core/types.d.ts} +41 -41
  14. package/dist/core/types.d.ts.map +1 -0
  15. package/dist/debug/index.d.ts +4 -44
  16. package/dist/debug/index.d.ts.map +1 -0
  17. package/dist/debug/index.js +1 -1
  18. package/dist/debug/index.js.map +1 -1
  19. package/dist/debug/index.mjs +2 -2
  20. package/dist/debug/index.mjs.map +1 -1
  21. package/dist/debug/{index.d.mts → inspector.d.ts} +3 -6
  22. package/dist/debug/inspector.d.ts.map +1 -0
  23. package/dist/design/{index.d.mts → design-inspector-native.d.ts} +7 -11
  24. package/dist/design/design-inspector-native.d.ts.map +1 -0
  25. package/dist/{design-types-BHr6Q1FX.d.mts → design/design-types.d.ts} +10 -11
  26. package/dist/design/design-types.d.ts.map +1 -0
  27. package/dist/design/index.d.ts +5 -60
  28. package/dist/design/index.d.ts.map +1 -0
  29. package/dist/index.d.ts +37 -86
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +3 -3
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +4 -4
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/modal/index.d.ts +2 -0
  36. package/dist/modal/index.d.ts.map +1 -0
  37. package/dist/modal/modal-detector.d.ts +29 -0
  38. package/dist/modal/modal-detector.d.ts.map +1 -0
  39. package/dist/react/StateAnnotation.d.ts +30 -0
  40. package/dist/react/StateAnnotation.d.ts.map +1 -0
  41. package/dist/react/UIBridgeNativeProvider.d.ts +156 -0
  42. package/dist/react/UIBridgeNativeProvider.d.ts.map +1 -0
  43. package/dist/react/index.d.ts +14 -69
  44. package/dist/react/index.d.ts.map +1 -0
  45. package/dist/react/index.js +3 -3
  46. package/dist/react/index.js.map +1 -1
  47. package/dist/react/index.mjs +4 -4
  48. package/dist/react/index.mjs.map +1 -1
  49. package/dist/react/{index.d.mts → useAutoRegister.d.ts} +7 -15
  50. package/dist/react/useAutoRegister.d.ts.map +1 -0
  51. package/dist/react/useUIBridge.d.ts +103 -0
  52. package/dist/react/useUIBridge.d.ts.map +1 -0
  53. package/dist/react/useUIBridgeModal.d.ts +14 -0
  54. package/dist/react/useUIBridgeModal.d.ts.map +1 -0
  55. package/dist/react/useUIBridgeToast.d.ts +25 -0
  56. package/dist/react/useUIBridgeToast.d.ts.map +1 -0
  57. package/dist/react/useUIComponent.d.ts +112 -0
  58. package/dist/react/useUIComponent.d.ts.map +1 -0
  59. package/dist/react/useUIElement.d.ts +162 -0
  60. package/dist/react/useUIElement.d.ts.map +1 -0
  61. package/dist/server/design-handlers.d.ts +47 -0
  62. package/dist/server/design-handlers.d.ts.map +1 -0
  63. package/dist/server/handlers.d.ts +25 -0
  64. package/dist/server/handlers.d.ts.map +1 -0
  65. package/dist/server/http-server.d.ts +262 -0
  66. package/dist/server/http-server.d.ts.map +1 -0
  67. package/dist/server/index.d.ts +14 -176
  68. package/dist/server/index.d.ts.map +1 -0
  69. package/dist/server/observability.d.ts +55 -0
  70. package/dist/server/observability.d.ts.map +1 -0
  71. package/dist/server/types.d.ts +368 -0
  72. package/dist/server/types.d.ts.map +1 -0
  73. package/dist/server/ws-connection.d.ts +48 -0
  74. package/dist/server/ws-connection.d.ts.map +1 -0
  75. package/dist/server/ws-event-bridge.d.ts +113 -0
  76. package/dist/server/ws-event-bridge.d.ts.map +1 -0
  77. package/dist/server/ws-protocol.d.ts +48 -0
  78. package/dist/server/ws-protocol.d.ts.map +1 -0
  79. package/dist/server/ws-types.d.ts +65 -0
  80. package/dist/server/ws-types.d.ts.map +1 -0
  81. package/dist/toast/index.d.ts +2 -0
  82. package/dist/toast/index.d.ts.map +1 -0
  83. package/dist/toast/toast-capture.d.ts +27 -0
  84. package/dist/toast/toast-capture.d.ts.map +1 -0
  85. package/dist/transport/CloudRelayClient.d.ts +51 -0
  86. package/dist/transport/CloudRelayClient.d.ts.map +1 -0
  87. package/dist/transport/DeviceAnnouncer.d.ts +75 -0
  88. package/dist/transport/DeviceAnnouncer.d.ts.map +1 -0
  89. package/dist/transport/index.d.ts +3 -0
  90. package/dist/transport/index.d.ts.map +1 -0
  91. package/dist/transport/logger.d.ts +23 -0
  92. package/dist/transport/logger.d.ts.map +1 -0
  93. package/dist/undo/index.d.ts +3 -0
  94. package/dist/undo/index.d.ts.map +1 -0
  95. package/dist/undo/undo-tracker.d.ts +59 -0
  96. package/dist/undo/undo-tracker.d.ts.map +1 -0
  97. package/package.json +3 -3
  98. package/dist/StateAnnotation--zm0Jfqj.d.ts +0 -755
  99. package/dist/StateAnnotation-BgFoVWFy.d.mts +0 -755
  100. package/dist/core/index.d.mts +0 -46
  101. package/dist/design-types-BHr6Q1FX.d.ts +0 -205
  102. package/dist/http-server--550eD1F.d.mts +0 -805
  103. package/dist/http-server-C9NaNBEP.d.ts +0 -805
  104. package/dist/index.d.mts +0 -89
  105. package/dist/registry-B5JadBN9.d.mts +0 -300
  106. package/dist/server/index.d.mts +0 -178
  107. package/dist/types-B0XA4vOF.d.mts +0 -197
  108. package/dist/types-CGVut7mc.d.ts +0 -567
@@ -0,0 +1,2 @@
1
+ export { ModalDetector } from './modal-detector';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { NativeModalInfo, NativeSnapshotModalContext } from '../core/types';
2
+ export interface ModalPushInput {
3
+ id: string;
4
+ title?: string;
5
+ type?: NativeModalInfo['type'];
6
+ blocking?: boolean;
7
+ dismissible?: boolean;
8
+ }
9
+ /**
10
+ * Declarative modal store. Components/hooks call pushModal/dismissModal directly
11
+ * — there is no DOM/tree scanner. The detector is the single source of truth for
12
+ * the snapshot's modalStack context.
13
+ */
14
+ export declare class ModalDetector {
15
+ /** Map preserves O(1) idempotent replace by id; ordering comes from detectedAt. */
16
+ private modals;
17
+ pushModal(modal: ModalPushInput): void;
18
+ /**
19
+ * Remove a modal from the stack. Returns `true` if a modal with that id
20
+ * was actually deleted, `false` if nothing matched (idempotent so repeated
21
+ * calls don't throw, but callers — e.g. the HTTP test-hook endpoint — can
22
+ * surface the miss to clients).
23
+ */
24
+ dismissModal(id: string): boolean;
25
+ getSnapshotModalContext(): NativeSnapshotModalContext;
26
+ getActive(): NativeModalInfo[];
27
+ clear(): void;
28
+ }
29
+ //# sourceMappingURL=modal-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-detector.d.ts","sourceRoot":"","sources":["../../src/modal/modal-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAEjF,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,mFAAmF;IACnF,OAAO,CAAC,MAAM,CAAsC;IAEpD,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IActC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIjC,uBAAuB,IAAI,0BAA0B;IAarD,SAAS,IAAI,eAAe,EAAE;IAI9B,KAAK,IAAI,IAAI;CAGd"}
@@ -0,0 +1,30 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ export interface StateAnnotationRequiredElement {
3
+ role?: string;
4
+ text?: string;
5
+ testID?: string;
6
+ [key: string]: unknown;
7
+ }
8
+ export interface StateProps {
9
+ id: string;
10
+ name?: string;
11
+ description?: string;
12
+ requiredElements?: StateAnnotationRequiredElement[];
13
+ blocking?: boolean;
14
+ children?: ReactNode;
15
+ [key: string]: unknown;
16
+ }
17
+ export declare function State(props: StateProps): ReactElement;
18
+ export interface TransitionToProps {
19
+ id: string;
20
+ name?: string;
21
+ fromStates?: string[];
22
+ activateStates?: string[];
23
+ exitStates?: string[];
24
+ effect?: string;
25
+ description?: string;
26
+ children?: ReactNode;
27
+ [key: string]: unknown;
28
+ }
29
+ export declare function TransitionTo(props: TransitionToProps): ReactElement;
30
+ //# sourceMappingURL=StateAnnotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateAnnotation.d.ts","sourceRoot":"","sources":["../../src/react/StateAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,WAAW,8BAA8B;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,8BAA8B,EAAE,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,CAErD;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAEnE"}
@@ -0,0 +1,156 @@
1
+ /**
2
+ * UI Bridge Native Provider
3
+ *
4
+ * React context provider for UI Bridge Native functionality.
5
+ */
6
+ import React from 'react';
7
+ import type { NativeUIBridgeFeatures, NativeUIBridgeConfig, RegisteredNativeElement, RegisteredNativeComponent, NativeBridgeSnapshot, BridgeEventType, BridgeEventListener } from '../core/types';
8
+ import { NativeUIBridgeRegistry } from '../core/registry';
9
+ import type { NativeActionExecutor } from '../control/types';
10
+ import { type ServerAdapter } from '../server/http-server';
11
+ import type { RouteProvider } from '../server/types';
12
+ import { type CloudRelayConfig } from '../transport/CloudRelayClient';
13
+ import { ModalDetector } from '../modal/modal-detector';
14
+ import { ToastCapture } from '../toast/toast-capture';
15
+ import { UndoTracker } from '../undo/undo-tracker';
16
+ /**
17
+ * UI Bridge Native context value
18
+ */
19
+ export interface UIBridgeNativeContextValue {
20
+ /** Feature flags */
21
+ features: NativeUIBridgeFeatures;
22
+ /** Configuration */
23
+ config: NativeUIBridgeConfig;
24
+ /** Element registry */
25
+ registry: NativeUIBridgeRegistry;
26
+ /** Action executor */
27
+ executor: NativeActionExecutor;
28
+ /** Modal stack tracker (declarative pushModal/dismissModal) */
29
+ modalDetector: ModalDetector;
30
+ /** Toast/snackbar tracker (declarative recordToast/dismissToast) */
31
+ toastCapture: ToastCapture;
32
+ /** Undo/redo action-correlation tracker */
33
+ undoTracker: UndoTracker;
34
+ /** Get all registered elements */
35
+ getElements: () => RegisteredNativeElement[];
36
+ /** Get all registered components */
37
+ getComponents: () => RegisteredNativeComponent[];
38
+ /** Create a snapshot */
39
+ createSnapshot: () => NativeBridgeSnapshot;
40
+ /** Subscribe to events */
41
+ on: <T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>) => () => void;
42
+ /** Unsubscribe from events */
43
+ off: <T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>) => void;
44
+ /** Whether the provider is initialized */
45
+ initialized: boolean;
46
+ /** Server running status */
47
+ serverRunning: boolean;
48
+ /** Start the HTTP server */
49
+ startServer: () => Promise<void>;
50
+ /** Stop the HTTP server */
51
+ stopServer: () => void;
52
+ /** Get the current navigation route (if a RouteProvider is configured) */
53
+ getCurrentRoute: () => string | null;
54
+ }
55
+ /**
56
+ * UI Bridge Native provider props
57
+ */
58
+ export interface UIBridgeNativeProviderProps {
59
+ /** Child components */
60
+ children: React.ReactNode;
61
+ /** Feature flags */
62
+ features?: NativeUIBridgeFeatures;
63
+ /** Configuration */
64
+ config?: NativeUIBridgeConfig;
65
+ /** Event handler */
66
+ onEvent?: BridgeEventListener;
67
+ /**
68
+ * A ServerAdapter instance for the HTTP server.
69
+ * The app is responsible for creating this using its preferred native TCP/HTTP library.
70
+ * @see ServerAdapter interface in server/http-server.ts
71
+ */
72
+ serverAdapter?: ServerAdapter;
73
+ /**
74
+ * Navigation provider for programmatic route navigation via UI Bridge.
75
+ * Pass Expo Router's push/back functions to enable `control/page/navigate`.
76
+ */
77
+ navigationProvider?: {
78
+ navigate: (url: string) => void;
79
+ back?: () => void;
80
+ };
81
+ /**
82
+ * Screenshot provider for native screen capture via UI Bridge.
83
+ * Pass a function that captures the current screen as base64 PNG.
84
+ */
85
+ screenshotProvider?: {
86
+ capture: () => Promise<{
87
+ base64: string;
88
+ width: number;
89
+ height: number;
90
+ }>;
91
+ };
92
+ /**
93
+ * Route provider for exposing the current navigation route in snapshots.
94
+ * Wire this to Expo Router's `usePathname()` / `useSegments()` via a module-level ref.
95
+ */
96
+ routeProvider?: RouteProvider;
97
+ /**
98
+ * Configuration for the cloud relay tunnel (enables remote device verification
99
+ * when USB/LAN are not available). Omit `uiBridgeServer` — the provider wires
100
+ * that automatically after the server starts.
101
+ */
102
+ cloudRelayConfig?: Omit<CloudRelayConfig, 'uiBridgeServer'>;
103
+ /**
104
+ * Enable mDNS advertisement so that runners on the same LAN can discover this
105
+ * device automatically (requires react-native-zeroconf).
106
+ */
107
+ enableMdnsAnnounce?: boolean;
108
+ /**
109
+ * Stable device identifier used for mDNS TXT records and cloud relay
110
+ * registration. Typically sourced from expo-device or a UUID stored in
111
+ * AsyncStorage.
112
+ */
113
+ deviceId?: string;
114
+ }
115
+ /**
116
+ * UI Bridge Native Provider
117
+ *
118
+ * Provides UI Bridge Native context to child components.
119
+ *
120
+ * @example
121
+ * ```tsx
122
+ * // app/_layout.tsx
123
+ * import { UIBridgeNativeProvider } from 'ui-bridge-native';
124
+ *
125
+ * export default function RootLayout() {
126
+ * return (
127
+ * <UIBridgeNativeProvider
128
+ * features={{ server: __DEV__, debug: __DEV__ }}
129
+ * config={{ serverPort: 8087 }}
130
+ * >
131
+ * <Stack>{children}</Stack>
132
+ * </UIBridgeNativeProvider>
133
+ * );
134
+ * }
135
+ * ```
136
+ */
137
+ export declare function UIBridgeNativeProvider({ children, features, config, onEvent, serverAdapter, navigationProvider, screenshotProvider, routeProvider, cloudRelayConfig, enableMdnsAnnounce, deviceId, }: UIBridgeNativeProviderProps): import("react/jsx-runtime").JSX.Element;
138
+ /**
139
+ * useUIBridgeNative hook
140
+ *
141
+ * Access the UI Bridge Native context. Throws if used outside provider.
142
+ */
143
+ export declare function useUIBridgeNative(): UIBridgeNativeContextValue;
144
+ /**
145
+ * useUIBridgeNativeOptional hook
146
+ *
147
+ * Access the UI Bridge Native context, returning null if outside provider.
148
+ */
149
+ export declare function useUIBridgeNativeOptional(): UIBridgeNativeContextValue | null;
150
+ /**
151
+ * useUIBridgeNativeRequired hook
152
+ *
153
+ * Alias for useUIBridgeNative (throws if outside provider).
154
+ */
155
+ export declare const useUIBridgeNativeRequired: typeof useUIBridgeNative;
156
+ //# sourceMappingURL=UIBridgeNativeProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIBridgeNativeProvider.d.ts","sourceRoot":"","sources":["../../src/react/UIBridgeNativeProvider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAA0C,MAAM,kBAAkB,CAAC;AAElG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM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AC"}
@@ -1,72 +1,17 @@
1
- export { b as ComponentActionDef, c as ComponentActionRequest, d as ComponentActionResponse, S as State, f as StateAnnotationRequiredElement, g as StateProps, j as ToastRecorderInput, k as TransitionTo, l as TransitionToProps, U as UIBridgeNativeContextValue, m as UIBridgeNativeProvider, n as UIBridgeNativeProviderProps, o as UIBridgeProps, 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';
2
- import { j as NativeElementRef } from '../types-CGVut7mc.js';
3
- import { b as RegisterElementOptions } from '../registry-pAUpQq2O.js';
4
- import 'react/jsx-runtime';
5
- import 'react';
6
- import '../types-CjEKTDYT.js';
7
- import '../http-server-C9NaNBEP.js';
8
- import '../design-types-BHr6Q1FX.js';
9
-
10
1
  /**
11
- * useAutoRegister Hook for React Native
2
+ * UI Bridge Native - React
12
3
  *
13
- * Enables automatic registration of interactive React Native components.
14
- * Unlike the web version, this doesn't use MutationObserver (no DOM).
15
- * Instead, it provides a simple API for components to register themselves.
16
- *
17
- * For comprehensive coverage in React Native, components should:
18
- * 1. Use this hook at the app root to enable the registry
19
- * 2. Use useUIElement on interactive components (or wrap with Pressable/TouchableOpacity)
20
- */
21
-
22
- /**
23
- * Options for auto-registration in React Native
24
- */
25
- interface NativeAutoRegisterOptions {
26
- /** Enable auto-registration (default: true in dev mode) */
27
- enabled?: boolean;
28
- /** Callback when element is registered */
29
- onRegister?: (id: string) => void;
30
- /** Callback when element is unregistered */
31
- onUnregister?: (id: string) => void;
32
- }
33
- /**
34
- * Handle returned by useAutoRegister for programmatic registration
35
- */
36
- interface NativeAutoRegisterHandle {
37
- /** Register an element programmatically */
38
- register: (id: string, ref: React.RefObject<NativeElementRef>, options?: RegisterElementOptions) => void;
39
- /** Unregister an element programmatically */
40
- unregister: (id: string) => void;
41
- /** Check if auto-registration is enabled */
42
- isEnabled: boolean;
43
- }
44
- /**
45
- * Hook for enabling automatic element registration in React Native.
46
- *
47
- * Since React Native doesn't have a DOM to observe, this hook provides
48
- * a handle for programmatic registration. For most use cases, you should
49
- * use useUIElement directly on interactive components.
50
- *
51
- * @example
52
- * ```tsx
53
- * function App() {
54
- * const autoRegister = useAutoRegister({ enabled: __DEV__ });
55
- *
56
- * // Programmatic registration (rare use case)
57
- * useEffect(() => {
58
- * autoRegister.register('custom-element', {
59
- * type: 'button',
60
- * label: 'Custom Button',
61
- * });
62
- *
63
- * return () => autoRegister.unregister('custom-element');
64
- * }, []);
65
- *
66
- * return <YourApp />;
67
- * }
68
- * ```
4
+ * React hooks and provider for React Native.
69
5
  */
70
- declare function useAutoRegister(options?: NativeAutoRegisterOptions): NativeAutoRegisterHandle;
71
-
72
- export { type NativeAutoRegisterHandle, type NativeAutoRegisterOptions, useAutoRegister };
6
+ export * from './UIBridgeNativeProvider';
7
+ export * from './useUIElement';
8
+ export * from './useUIComponent';
9
+ export * from './useUIBridge';
10
+ export * from './useAutoRegister';
11
+ export { useUIBridgeModal } from './useUIBridgeModal';
12
+ export type { UseUIBridgeModalOptions } from './useUIBridgeModal';
13
+ export { useUIBridgeToast, useToastRecorder } from './useUIBridgeToast';
14
+ export type { UseUIBridgeToastOptions, ToastRecorderInput } from './useUIBridgeToast';
15
+ export { State, TransitionTo } from './StateAnnotation';
16
+ export type { StateProps, TransitionToProps, StateAnnotationRequiredElement } from './StateAnnotation';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC"}
@@ -4937,17 +4937,17 @@ function UIBridgeNativeProvider({
4937
4937
  getCurrentRoute
4938
4938
  ]
4939
4939
  );
4940
- return /* @__PURE__ */ jsxRuntime.jsx(UIBridgeNativeContext.Provider, { value: contextValue, children });
4940
+ return /* @__PURE__ */ jsxRuntime.jsx(UIBridgeNativeContext, { value: contextValue, children });
4941
4941
  }
4942
4942
  function useUIBridgeNative() {
4943
- const context = react.useContext(UIBridgeNativeContext);
4943
+ const context = react.use(UIBridgeNativeContext);
4944
4944
  if (!context) {
4945
4945
  throw new Error("useUIBridgeNative must be used within a UIBridgeNativeProvider");
4946
4946
  }
4947
4947
  return context;
4948
4948
  }
4949
4949
  function useUIBridgeNativeOptional() {
4950
- return react.useContext(UIBridgeNativeContext);
4950
+ return react.use(UIBridgeNativeContext);
4951
4951
  }
4952
4952
  var useUIBridgeNativeRequired = useUIBridgeNative;
4953
4953
  function flattenStyle(style) {