@qontinui/ui-bridge-native 0.1.5 → 0.2.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.
- package/dist/control/index.d.mts +9 -5
- package/dist/control/index.d.ts +9 -5
- package/dist/control/index.js +75 -12
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs +75 -12
- package/dist/control/index.mjs.map +1 -1
- package/dist/core/index.d.mts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +69 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +69 -1
- package/dist/core/index.mjs.map +1 -1
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/index.mjs.map +1 -1
- package/dist/design/index.d.mts +1 -1
- package/dist/design/index.d.ts +1 -1
- package/dist/{http-server-D7uVANBU.d.mts → http-server-DCdR8WlL.d.mts} +3 -3
- package/dist/{http-server-B7KudcYJ.d.ts → http-server-Dj3grQW4.d.ts} +3 -3
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +498 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +493 -17
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +5 -5
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.js +504 -16
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +502 -17
- package/dist/react/index.mjs.map +1 -1
- package/dist/{registry-DhbGbl9c.d.mts → registry-Cahd8Gn2.d.mts} +16 -1
- package/dist/{registry-B8A_EoxS.d.ts → registry-z-3WJsxp.d.ts} +16 -1
- package/dist/server/index.d.mts +5 -5
- package/dist/server/index.d.ts +5 -5
- 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/{types-Bcj7ji97.d.mts → types-DAfCeWXc.d.mts} +22 -2
- package/dist/{types-BPNuYxDx.d.mts → types-Oz13YLZq.d.mts} +95 -1
- package/dist/{types-BPNuYxDx.d.ts → types-Oz13YLZq.d.ts} +95 -1
- package/dist/{types-BCYWwyVy.d.ts → types-ajakyp-l.d.ts} +22 -2
- package/dist/{useUIBridge-CDZbWxII.d.ts → useUIBridgeToast-D32KXyL1.d.ts} +154 -5
- package/dist/{useUIBridge-DfIEq9EQ.d.mts → useUIBridgeToast-GmT1TzUe.d.mts} +154 -5
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1 from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { a as NativeUIBridgeRegistry } from './registry-
|
|
5
|
-
import { N as NativeActionExecutor } from './types-
|
|
6
|
-
import { i as NativeUIBridgeServer, m as ServerAdapter, l as RouteProvider } from './http-server-
|
|
3
|
+
import { p as NativeModalInfo, s as NativeSnapshotModalContext, f as NativeCapturedToast, t as NativeSnapshotToastContext, u as NativeSnapshotUndoContext, x as NativeUIBridgeFeatures, w as NativeUIBridgeConfig, y as RegisteredNativeElement, R as RegisteredNativeComponent, e as NativeBridgeSnapshot, b as BridgeEventType, a as BridgeEventListener, l as NativeElementType, v as NativeStandardAction, h as NativeCustomAction, k as NativeElementState, j as NativeElementRef, i as NativeElementIdentifier, z as Workflow, N as NativeActionRequest, d as NativeActionResponse, m as NativeFindRequest, n as NativeFindResponse } from './types-Oz13YLZq.mjs';
|
|
4
|
+
import { a as NativeUIBridgeRegistry } from './registry-Cahd8Gn2.mjs';
|
|
5
|
+
import { N as NativeActionExecutor } from './types-DAfCeWXc.mjs';
|
|
6
|
+
import { i as NativeUIBridgeServer, m as ServerAdapter, l as RouteProvider } from './http-server-DCdR8WlL.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Cloud Relay Client — WebSocket tunnel from mobile device to backend
|
|
@@ -56,6 +56,112 @@ declare class CloudRelayClient {
|
|
|
56
56
|
private scheduleReconnect;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
interface ModalPushInput {
|
|
60
|
+
id: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
type?: NativeModalInfo['type'];
|
|
63
|
+
blocking?: boolean;
|
|
64
|
+
dismissible?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Declarative modal store. Components/hooks call pushModal/dismissModal directly
|
|
68
|
+
* — there is no DOM/tree scanner. The detector is the single source of truth for
|
|
69
|
+
* the snapshot's modalStack context.
|
|
70
|
+
*/
|
|
71
|
+
declare class ModalDetector {
|
|
72
|
+
/** Map preserves O(1) idempotent replace by id; ordering comes from detectedAt. */
|
|
73
|
+
private modals;
|
|
74
|
+
pushModal(modal: ModalPushInput): void;
|
|
75
|
+
dismissModal(id: string): void;
|
|
76
|
+
getSnapshotModalContext(): NativeSnapshotModalContext;
|
|
77
|
+
getActive(): NativeModalInfo[];
|
|
78
|
+
clear(): void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface ToastRecordInput {
|
|
82
|
+
id: string;
|
|
83
|
+
message: string;
|
|
84
|
+
level?: NativeCapturedToast['level'];
|
|
85
|
+
appearedAt?: number;
|
|
86
|
+
}
|
|
87
|
+
interface ToastCaptureConfig {
|
|
88
|
+
maxRecent?: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Declarative toast/snackbar tracker. Components call recordToast/dismissToast
|
|
92
|
+
* directly — there is no DOM/tree scanner. The active map plus a fixed-size
|
|
93
|
+
* recent ring buffer feed the snapshot's toasts context.
|
|
94
|
+
*/
|
|
95
|
+
declare class ToastCapture {
|
|
96
|
+
private active;
|
|
97
|
+
private recent;
|
|
98
|
+
private totalCaptured;
|
|
99
|
+
private maxRecent;
|
|
100
|
+
constructor(config?: ToastCaptureConfig);
|
|
101
|
+
recordToast(toast: ToastRecordInput): void;
|
|
102
|
+
dismissToast(id: string): void;
|
|
103
|
+
getSnapshotToastContext(): NativeSnapshotToastContext;
|
|
104
|
+
clear(): void;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A single bridge action recorded for undo correlation. Action-correlation
|
|
109
|
+
* only — RN has no DOM/execCommand probe, so we rely on developer
|
|
110
|
+
* declaration plus this rolling history of recent actions.
|
|
111
|
+
*/
|
|
112
|
+
interface ActionRecord {
|
|
113
|
+
id: string;
|
|
114
|
+
type: string;
|
|
115
|
+
targetId?: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
timestamp: number;
|
|
118
|
+
/** Default true — set false for actions that aren't reversible (e.g. navigation, network calls) */
|
|
119
|
+
reversible?: boolean;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Developer-declared undo/redo state. When set, this is authoritative and
|
|
123
|
+
* overrides any heuristic inference from action history.
|
|
124
|
+
*/
|
|
125
|
+
interface DeclaredUndoState {
|
|
126
|
+
canUndo: boolean;
|
|
127
|
+
canRedo: boolean;
|
|
128
|
+
undoDescription?: string;
|
|
129
|
+
redoDescription?: string;
|
|
130
|
+
undoDepth?: number;
|
|
131
|
+
redoDepth?: number;
|
|
132
|
+
}
|
|
133
|
+
interface UndoTrackerConfig {
|
|
134
|
+
maxHistory?: number;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Action-correlation undo tracker for React Native.
|
|
138
|
+
*
|
|
139
|
+
* Maintains a rolling buffer of recent actions and a developer-declared
|
|
140
|
+
* undo state slot. The declared state is authoritative when set; otherwise
|
|
141
|
+
* we infer `canUndo` from whether any reversible action has been recorded.
|
|
142
|
+
* `executeUndo`/`executeRedo` are placeholders pending an IPC path through
|
|
143
|
+
* ui-bridge-native to the runner's `/control/undo`.
|
|
144
|
+
*/
|
|
145
|
+
declare class UndoTracker {
|
|
146
|
+
private readonly maxHistory;
|
|
147
|
+
private actions;
|
|
148
|
+
private declaredState;
|
|
149
|
+
constructor(config?: UndoTrackerConfig);
|
|
150
|
+
recordAction(record: ActionRecord): void;
|
|
151
|
+
setDeclaredState(state: DeclaredUndoState): void;
|
|
152
|
+
getActionHistory(): ActionRecord[];
|
|
153
|
+
getSnapshotUndoContext(): NativeSnapshotUndoContext;
|
|
154
|
+
executeUndo(): {
|
|
155
|
+
ok: boolean;
|
|
156
|
+
reason?: string;
|
|
157
|
+
};
|
|
158
|
+
executeRedo(): {
|
|
159
|
+
ok: boolean;
|
|
160
|
+
reason?: string;
|
|
161
|
+
};
|
|
162
|
+
clear(): void;
|
|
163
|
+
}
|
|
164
|
+
|
|
59
165
|
/**
|
|
60
166
|
* UI Bridge Native context value
|
|
61
167
|
*/
|
|
@@ -68,6 +174,12 @@ interface UIBridgeNativeContextValue {
|
|
|
68
174
|
registry: NativeUIBridgeRegistry;
|
|
69
175
|
/** Action executor */
|
|
70
176
|
executor: NativeActionExecutor;
|
|
177
|
+
/** Modal stack tracker (declarative pushModal/dismissModal) */
|
|
178
|
+
modalDetector: ModalDetector;
|
|
179
|
+
/** Toast/snackbar tracker (declarative recordToast/dismissToast) */
|
|
180
|
+
toastCapture: ToastCapture;
|
|
181
|
+
/** Undo/redo action-correlation tracker */
|
|
182
|
+
undoTracker: UndoTracker;
|
|
71
183
|
/** Get all registered elements */
|
|
72
184
|
getElements: () => RegisteredNativeElement[];
|
|
73
185
|
/** Get all registered components */
|
|
@@ -568,4 +680,41 @@ declare function useUIBridge(): UseUIBridgeReturn;
|
|
|
568
680
|
*/
|
|
569
681
|
declare function useUIBridgeRequired(): UseUIBridgeReturn;
|
|
570
682
|
|
|
571
|
-
|
|
683
|
+
interface UseUIBridgeModalOptions {
|
|
684
|
+
id: string;
|
|
685
|
+
title?: string;
|
|
686
|
+
type?: NativeModalInfo['type'];
|
|
687
|
+
blocking?: boolean;
|
|
688
|
+
dismissible?: boolean;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Declarative hook: while mounted, registers a modal entry on the active
|
|
692
|
+
* stack so UI Bridge snapshots reflect that a modal is open.
|
|
693
|
+
*/
|
|
694
|
+
declare function useUIBridgeModal(opts: UseUIBridgeModalOptions): void;
|
|
695
|
+
|
|
696
|
+
interface UseUIBridgeToastOptions {
|
|
697
|
+
id: string;
|
|
698
|
+
message: string;
|
|
699
|
+
level?: NativeCapturedToast['level'];
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Declarative hook: while mounted, surfaces a toast via the snapshot enricher.
|
|
703
|
+
* Best for explicit-lifecycle toast components.
|
|
704
|
+
*/
|
|
705
|
+
declare function useUIBridgeToast(opts: UseUIBridgeToastOptions): void;
|
|
706
|
+
interface ToastRecorderInput {
|
|
707
|
+
id: string;
|
|
708
|
+
message: string;
|
|
709
|
+
level?: NativeCapturedToast['level'];
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Imperative hook: returns a `recordToast` callback for code that fires
|
|
713
|
+
* toasts outside React (catch blocks, library callbacks, etc.).
|
|
714
|
+
*/
|
|
715
|
+
declare function useToastRecorder(): {
|
|
716
|
+
recordToast: (toast: ToastRecorderInput) => void;
|
|
717
|
+
dismissToast: (id: string) => void;
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
export { type ActionRecord as A, useUIBridgeNativeRequired as B, CloudRelayClient as C, type DeclaredUndoState as D, useUIBridgeRequired as E, useUIBridgeToast as F, useUIComponent as G, useUIComponentAction as H, useUIElement as I, useUIElementWithProps as J, ModalDetector as M, ToastCapture as T, type UIBridgeNativeContextValue as U, type CloudRelayConfig as a, type ComponentActionDef as b, type ComponentActionRequest as c, type ComponentActionResponse as d, type ModalPushInput as e, type ToastCaptureConfig as f, type ToastRecordInput as g, type ToastRecorderInput as h, UIBridgeNativeProvider as i, type UIBridgeNativeProviderProps as j, type UIBridgeProps as k, UndoTracker as l, type UndoTrackerConfig as m, type UseUIBridgeModalOptions as n, type UseUIBridgeReturn as o, type UseUIBridgeToastOptions as p, type UseUIComponentOptions as q, type UseUIComponentReturn as r, type UseUIElementOptions as s, type UseUIElementReturn as t, type UseUIElementWithPropsReturn as u, useToastRecorder as v, useUIBridge as w, useUIBridgeModal as x, useUIBridgeNative as y, useUIBridgeNativeOptional as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qontinui/ui-bridge-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "UI Bridge Framework for React Native - Hooks and providers for UI observation and control in mobile apps",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|