react-native-prod-debugger 1.0.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/LICENSE +21 -0
- package/README.md +350 -0
- package/lib/commonjs/core/DebugBubble.js +139 -0
- package/lib/commonjs/core/DebugBubble.js.map +1 -0
- package/lib/commonjs/core/DebugOverlay.js +184 -0
- package/lib/commonjs/core/DebugOverlay.js.map +1 -0
- package/lib/commonjs/core/DebuggerProvider.js +174 -0
- package/lib/commonjs/core/DebuggerProvider.js.map +1 -0
- package/lib/commonjs/core/GestureDetector.js +83 -0
- package/lib/commonjs/core/GestureDetector.js.map +1 -0
- package/lib/commonjs/core/PluginRegistry.js +124 -0
- package/lib/commonjs/core/PluginRegistry.js.map +1 -0
- package/lib/commonjs/core/theme.js +50 -0
- package/lib/commonjs/core/theme.js.map +1 -0
- package/lib/commonjs/core/types.js +6 -0
- package/lib/commonjs/core/types.js.map +1 -0
- package/lib/commonjs/core/useDebugger.js +27 -0
- package/lib/commonjs/core/useDebugger.js.map +1 -0
- package/lib/commonjs/core/utils.js +239 -0
- package/lib/commonjs/core/utils.js.map +1 -0
- package/lib/commonjs/index.js +132 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/plugins/console/ConsoleInterceptor.js +103 -0
- package/lib/commonjs/plugins/console/ConsoleInterceptor.js.map +1 -0
- package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js +269 -0
- package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js.map +1 -0
- package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js +363 -0
- package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
- package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js +218 -0
- package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js.map +1 -0
- package/lib/commonjs/plugins/customActions/actionStore.js +46 -0
- package/lib/commonjs/plugins/customActions/actionStore.js.map +1 -0
- package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js +268 -0
- package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
- package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js +184 -0
- package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
- package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js +381 -0
- package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
- package/lib/commonjs/plugins/featureFlags/flagStore.js +125 -0
- package/lib/commonjs/plugins/featureFlags/flagStore.js.map +1 -0
- package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js +250 -0
- package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/navigationInspector/navigationStore.js +65 -0
- package/lib/commonjs/plugins/navigationInspector/navigationStore.js.map +1 -0
- package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js +709 -0
- package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/network/NetworkInterceptor.js +305 -0
- package/lib/commonjs/plugins/network/NetworkInterceptor.js.map +1 -0
- package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js +261 -0
- package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js +265 -0
- package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
- package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js +50 -0
- package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
- package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js +378 -0
- package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js +62 -0
- package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
- package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js +496 -0
- package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
- package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js +44 -0
- package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
- package/lib/commonjs/plugins/timeline/TimelinePlugin.js +294 -0
- package/lib/commonjs/plugins/timeline/TimelinePlugin.js.map +1 -0
- package/lib/commonjs/plugins/timeline/timelineStore.js +61 -0
- package/lib/commonjs/plugins/timeline/timelineStore.js.map +1 -0
- package/lib/module/core/DebugBubble.js +131 -0
- package/lib/module/core/DebugBubble.js.map +1 -0
- package/lib/module/core/DebugOverlay.js +176 -0
- package/lib/module/core/DebugOverlay.js.map +1 -0
- package/lib/module/core/DebuggerProvider.js +167 -0
- package/lib/module/core/DebuggerProvider.js.map +1 -0
- package/lib/module/core/GestureDetector.js +75 -0
- package/lib/module/core/GestureDetector.js.map +1 -0
- package/lib/module/core/PluginRegistry.js +116 -0
- package/lib/module/core/PluginRegistry.js.map +1 -0
- package/lib/module/core/theme.js +43 -0
- package/lib/module/core/theme.js.map +1 -0
- package/lib/module/core/types.js +2 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/core/useDebugger.js +21 -0
- package/lib/module/core/useDebugger.js.map +1 -0
- package/lib/module/core/utils.js +219 -0
- package/lib/module/core/utils.js.map +1 -0
- package/lib/module/index.js +44 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/plugins/console/ConsoleInterceptor.js +97 -0
- package/lib/module/plugins/console/ConsoleInterceptor.js.map +1 -0
- package/lib/module/plugins/console/ConsoleViewerPlugin.js +262 -0
- package/lib/module/plugins/console/ConsoleViewerPlugin.js.map +1 -0
- package/lib/module/plugins/crashReporter/CrashReporterPlugin.js +357 -0
- package/lib/module/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
- package/lib/module/plugins/customActions/CustomActionsPlugin.js +211 -0
- package/lib/module/plugins/customActions/CustomActionsPlugin.js.map +1 -0
- package/lib/module/plugins/customActions/actionStore.js +38 -0
- package/lib/module/plugins/customActions/actionStore.js.map +1 -0
- package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js +261 -0
- package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
- package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js +177 -0
- package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
- package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js +374 -0
- package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
- package/lib/module/plugins/featureFlags/flagStore.js +117 -0
- package/lib/module/plugins/featureFlags/flagStore.js.map +1 -0
- package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js +243 -0
- package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/navigationInspector/navigationStore.js +58 -0
- package/lib/module/plugins/navigationInspector/navigationStore.js.map +1 -0
- package/lib/module/plugins/network/NetworkInspectorPlugin.js +703 -0
- package/lib/module/plugins/network/NetworkInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/network/NetworkInterceptor.js +299 -0
- package/lib/module/plugins/network/NetworkInterceptor.js.map +1 -0
- package/lib/module/plugins/performance/PerformanceMonitorPlugin.js +254 -0
- package/lib/module/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
- package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js +258 -0
- package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
- package/lib/module/plugins/remoteConfig/remoteConfigStore.js +43 -0
- package/lib/module/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
- package/lib/module/plugins/stateInspector/StateInspectorPlugin.js +372 -0
- package/lib/module/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/stateInspector/stateAdapterRegistry.js +54 -0
- package/lib/module/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
- package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js +489 -0
- package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
- package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js +36 -0
- package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
- package/lib/module/plugins/timeline/TimelinePlugin.js +287 -0
- package/lib/module/plugins/timeline/TimelinePlugin.js.map +1 -0
- package/lib/module/plugins/timeline/timelineStore.js +54 -0
- package/lib/module/plugins/timeline/timelineStore.js.map +1 -0
- package/lib/typescript/core/DebugBubble.d.ts +22 -0
- package/lib/typescript/core/DebugBubble.d.ts.map +1 -0
- package/lib/typescript/core/DebugOverlay.d.ts +18 -0
- package/lib/typescript/core/DebugOverlay.d.ts.map +1 -0
- package/lib/typescript/core/DebuggerProvider.d.ts +25 -0
- package/lib/typescript/core/DebuggerProvider.d.ts.map +1 -0
- package/lib/typescript/core/GestureDetector.d.ts +20 -0
- package/lib/typescript/core/GestureDetector.d.ts.map +1 -0
- package/lib/typescript/core/PluginRegistry.d.ts +41 -0
- package/lib/typescript/core/PluginRegistry.d.ts.map +1 -0
- package/lib/typescript/core/theme.d.ts +11 -0
- package/lib/typescript/core/theme.d.ts.map +1 -0
- package/lib/typescript/core/types.d.ts +269 -0
- package/lib/typescript/core/types.d.ts.map +1 -0
- package/lib/typescript/core/useDebugger.d.ts +14 -0
- package/lib/typescript/core/useDebugger.d.ts.map +1 -0
- package/lib/typescript/core/utils.d.ts +46 -0
- package/lib/typescript/core/utils.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +23 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts +32 -0
- package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts.map +1 -0
- package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts +3 -0
- package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts +3 -0
- package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts +3 -0
- package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/customActions/actionStore.d.ts +16 -0
- package/lib/typescript/plugins/customActions/actionStore.d.ts.map +1 -0
- package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts +3 -0
- package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts +3 -0
- package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts +3 -0
- package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/featureFlags/flagStore.d.ts +45 -0
- package/lib/typescript/plugins/featureFlags/flagStore.d.ts.map +1 -0
- package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts +30 -0
- package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts.map +1 -0
- package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/network/NetworkInterceptor.d.ts +42 -0
- package/lib/typescript/plugins/network/NetworkInterceptor.d.ts.map +1 -0
- package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts +3 -0
- package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts +20 -0
- package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts.map +1 -0
- package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts +34 -0
- package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts.map +1 -0
- package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts +3 -0
- package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts +16 -0
- package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts.map +1 -0
- package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts +3 -0
- package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/timeline/timelineStore.d.ts +24 -0
- package/lib/typescript/plugins/timeline/timelineStore.d.ts.map +1 -0
- package/package.json +131 -0
- package/src/core/DebugBubble.tsx +149 -0
- package/src/core/DebugOverlay.tsx +211 -0
- package/src/core/DebuggerProvider.tsx +211 -0
- package/src/core/GestureDetector.tsx +95 -0
- package/src/core/PluginRegistry.ts +118 -0
- package/src/core/theme.ts +41 -0
- package/src/core/types.ts +339 -0
- package/src/core/useDebugger.ts +24 -0
- package/src/core/utils.ts +221 -0
- package/src/index.ts +67 -0
- package/src/plugins/console/ConsoleInterceptor.ts +110 -0
- package/src/plugins/console/ConsoleViewerPlugin.tsx +241 -0
- package/src/plugins/crashReporter/CrashReporterPlugin.tsx +316 -0
- package/src/plugins/customActions/CustomActionsPlugin.tsx +199 -0
- package/src/plugins/customActions/actionStore.ts +49 -0
- package/src/plugins/deepLinkTester/DeepLinkTesterPlugin.tsx +213 -0
- package/src/plugins/deviceInfo/DeviceInfoPlugin.tsx +153 -0
- package/src/plugins/featureFlags/FeatureFlagsPlugin.tsx +338 -0
- package/src/plugins/featureFlags/flagStore.ts +118 -0
- package/src/plugins/navigationInspector/NavigationInspectorPlugin.tsx +170 -0
- package/src/plugins/navigationInspector/navigationStore.ts +70 -0
- package/src/plugins/network/NetworkInspectorPlugin.tsx +598 -0
- package/src/plugins/network/NetworkInterceptor.ts +344 -0
- package/src/plugins/performance/PerformanceMonitorPlugin.tsx +194 -0
- package/src/plugins/remoteConfig/RemoteConfigPlugin.tsx +205 -0
- package/src/plugins/remoteConfig/remoteConfigStore.ts +48 -0
- package/src/plugins/stateInspector/StateInspectorPlugin.tsx +342 -0
- package/src/plugins/stateInspector/stateAdapterRegistry.ts +66 -0
- package/src/plugins/storageBrowser/StorageBrowserPlugin.tsx +410 -0
- package/src/plugins/storageBrowser/storageAdapterRegistry.ts +47 -0
- package/src/plugins/timeline/TimelinePlugin.tsx +242 -0
- package/src/plugins/timeline/timelineStore.ts +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkInterceptor.d.ts","sourceRoot":"","sources":["../../../../src/plugins/network/NetworkInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,KAAK,eAAe,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;AAE5D;;;;;;GAMG;AACH,cAAM,uBAAuB;IAC3B,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,QAAQ,CAAkB;IAGlC,OAAO,CAAC,eAAe,CAAqD;IAC5E,OAAO,CAAC,eAAe,CAAqD;IAC5E,OAAO,CAAC,oBAAoB,CAAiE;IAC7F,OAAO,CAAC,aAAa,CAAwC;IAE7D,2CAA2C;IAC3C,KAAK,CAAC,WAAW,GAAE,MAAY,EAAE,WAAW,GAAE,OAAe,GAAG,IAAI;IAQpE,8DAA8D;IAC9D,IAAI,IAAI,IAAI;IAMZ,kEAAkE;IAClE,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,IAAI;IAOhD,iCAAiC;IACjC,MAAM,IAAI,cAAc,EAAE;IAI1B,mCAAmC;IACnC,KAAK,IAAI,IAAI;IAKb,0CAA0C;IAC1C,IAAI,MAAM,IAAI,OAAO,CAEpB;IAID,OAAO,CAAC,YAAY;IAgIpB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,cAAc;IAoGtB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,MAAM;CAUf;AAED,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,yBAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerformanceMonitorPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/performance/PerformanceMonitorPlugin.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAwB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuL7E,wBAAgB,8BAA8B,IAAI,cAAc,CAQ/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoteConfigPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/remoteConfig/RemoteConfigPlugin.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAA2C,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA0LhG,wBAAgB,wBAAwB,IAAI,cAAc,CAQzD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RemoteConfigProvider } from '../../core/types';
|
|
2
|
+
type Listener = () => void;
|
|
3
|
+
declare class RemoteConfigStoreClass {
|
|
4
|
+
private provider;
|
|
5
|
+
private listeners;
|
|
6
|
+
/** Set the remote config provider. */
|
|
7
|
+
set(provider: RemoteConfigProvider): void;
|
|
8
|
+
/** Get the current provider. */
|
|
9
|
+
get(): RemoteConfigProvider | null;
|
|
10
|
+
/** Remove the provider. */
|
|
11
|
+
remove(): void;
|
|
12
|
+
/** Subscribe to provider changes. */
|
|
13
|
+
subscribe(listener: Listener): () => void;
|
|
14
|
+
private notify;
|
|
15
|
+
}
|
|
16
|
+
export declare const remoteConfigStore: RemoteConfigStoreClass;
|
|
17
|
+
/** Set the remote config provider (e.g., Firebase). */
|
|
18
|
+
export declare function setRemoteConfigProvider(provider: RemoteConfigProvider): void;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=remoteConfigStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteConfigStore.d.ts","sourceRoot":"","sources":["../../../../src/plugins/remoteConfig/remoteConfigStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,cAAM,sBAAsB;IAC1B,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,SAAS,CAA4B;IAE7C,sCAAsC;IACtC,GAAG,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI;IAKzC,gCAAgC;IAChC,GAAG,IAAI,oBAAoB,GAAG,IAAI;IAIlC,2BAA2B;IAC3B,MAAM,IAAI,IAAI;IAKd,qCAAqC;IACrC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IAKzC,OAAO,CAAC,MAAM;CASf;AAED,eAAO,MAAM,iBAAiB,wBAA+B,CAAC;AAE9D,uDAAuD;AACvD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAE5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateInspectorPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/stateInspector/StateInspectorPlugin.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAwB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA2U7E,wBAAgB,0BAA0B,IAAI,cAAc,CAQ3D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State Adapter Registry — Allows consumers to register their state stores.
|
|
3
|
+
*
|
|
4
|
+
* Supports Redux, Zustand, MobX, or any custom state store via a simple adapter interface.
|
|
5
|
+
*/
|
|
6
|
+
export interface StateAdapter {
|
|
7
|
+
/** Adapter name (e.g., "Redux", "Zustand - userStore"). */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Get the current state snapshot. */
|
|
10
|
+
getState: () => unknown;
|
|
11
|
+
/** Subscribe to state changes. Returns unsubscribe function. */
|
|
12
|
+
subscribe?: (listener: () => void) => () => void;
|
|
13
|
+
}
|
|
14
|
+
type AdapterListener = () => void;
|
|
15
|
+
declare class StateAdapterRegistryClass {
|
|
16
|
+
private adapters;
|
|
17
|
+
private listeners;
|
|
18
|
+
/** Register a state adapter. */
|
|
19
|
+
set(id: string, adapter: StateAdapter): void;
|
|
20
|
+
/** Remove a state adapter. */
|
|
21
|
+
remove(id: string): void;
|
|
22
|
+
/** Get all registered adapters. */
|
|
23
|
+
getAll(): Map<string, StateAdapter>;
|
|
24
|
+
/** Subscribe to adapter changes. */
|
|
25
|
+
subscribe(listener: AdapterListener): () => void;
|
|
26
|
+
private notify;
|
|
27
|
+
}
|
|
28
|
+
export declare const stateAdapterRegistry: StateAdapterRegistryClass;
|
|
29
|
+
/** Register a state store adapter. */
|
|
30
|
+
export declare function setStateAdapter(id: string, adapter: StateAdapter): void;
|
|
31
|
+
/** Remove a state store adapter. */
|
|
32
|
+
export declare function removeStateAdapter(id: string): void;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=stateAdapterRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateAdapterRegistry.d.ts","sourceRoot":"","sources":["../../../../src/plugins/stateInspector/stateAdapterRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,gEAAgE;IAChE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAClD;AAED,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AAElC,cAAM,yBAAyB;IAC7B,OAAO,CAAC,QAAQ,CAAwC;IACxD,OAAO,CAAC,SAAS,CAAmC;IAEpD,gCAAgC;IAChC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAK5C,8BAA8B;IAC9B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKxB,mCAAmC;IACnC,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC;IAInC,oCAAoC;IACpC,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,IAAI;IAKhD,OAAO,CAAC,MAAM;CASf;AAED,eAAO,MAAM,oBAAoB,2BAAkC,CAAC;AAEpE,sCAAsC;AACtC,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAEvE;AAED,oCAAoC;AACpC,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAEnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageBrowserPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/storageBrowser/StorageBrowserPlugin.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAwC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAsY7F,wBAAgB,0BAA0B,IAAI,cAAc,CAQ3D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StorageAdapter } from '../../core/types';
|
|
2
|
+
type Listener = () => void;
|
|
3
|
+
declare class StorageAdapterRegistryClass {
|
|
4
|
+
private adapters;
|
|
5
|
+
private listeners;
|
|
6
|
+
set(id: string, adapter: StorageAdapter): void;
|
|
7
|
+
remove(id: string): void;
|
|
8
|
+
getAll(): Map<string, StorageAdapter>;
|
|
9
|
+
subscribe(listener: Listener): () => void;
|
|
10
|
+
private notify;
|
|
11
|
+
}
|
|
12
|
+
export declare const storageAdapterRegistry: StorageAdapterRegistryClass;
|
|
13
|
+
export declare function setStorageAdapter(id: string, adapter: StorageAdapter): void;
|
|
14
|
+
export declare function removeStorageAdapter(id: string): void;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=storageAdapterRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storageAdapterRegistry.d.ts","sourceRoot":"","sources":["../../../../src/plugins/storageBrowser/storageAdapterRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,cAAM,2BAA2B;IAC/B,OAAO,CAAC,QAAQ,CAA0C;IAC1D,OAAO,CAAC,SAAS,CAA4B;IAE7C,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAK9C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKxB,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IAIrC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IAKzC,OAAO,CAAC,MAAM;CASf;AAED,eAAO,MAAM,sBAAsB,6BAAoC,CAAC;AAExE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAE3E;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAErD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelinePlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/timeline/TimelinePlugin.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAuC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA+N5F,wBAAgB,oBAAoB,IAAI,cAAc,CAQrD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TimelineEvent } from '../../core/types';
|
|
2
|
+
type TimelineListener = (events: TimelineEvent[]) => void;
|
|
3
|
+
/**
|
|
4
|
+
* TimelineStore — Global event logger for tracking app lifecycle events.
|
|
5
|
+
*
|
|
6
|
+
* Records events with category, timestamp, and optional data.
|
|
7
|
+
* Useful for tracking user flows, state transitions, and debugging sequences.
|
|
8
|
+
*/
|
|
9
|
+
declare class TimelineStoreClass {
|
|
10
|
+
private events;
|
|
11
|
+
private listeners;
|
|
12
|
+
private maxEvents;
|
|
13
|
+
/** Log a timeline event. */
|
|
14
|
+
log(category: TimelineEvent['category'], title: string, data?: unknown): void;
|
|
15
|
+
getAll(): TimelineEvent[];
|
|
16
|
+
clear(): void;
|
|
17
|
+
subscribe(listener: TimelineListener): () => void;
|
|
18
|
+
private notify;
|
|
19
|
+
}
|
|
20
|
+
export declare const timelineStore: TimelineStoreClass;
|
|
21
|
+
/** Log a timeline event. */
|
|
22
|
+
export declare function logTimelineEvent(category: TimelineEvent['category'], title: string, data?: unknown): void;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=timelineStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timelineStore.d.ts","sourceRoot":"","sources":["../../../../src/plugins/timeline/timelineStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,KAAK,gBAAgB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;AAE1D;;;;;GAKG;AACH,cAAM,kBAAkB;IACtB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,SAAS,CAAoC;IACrD,OAAO,CAAC,SAAS,CAAO;IAExB,4BAA4B;IAC5B,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAY7E,MAAM,IAAI,aAAa,EAAE;IAGzB,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAMjD,OAAO,CAAC,MAAM;CAUf;AAED,eAAO,MAAM,aAAa,oBAA2B,CAAC;AAEtD,4BAA4B;AAC5B,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,EACnC,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,OAAO,GACb,IAAI,CAEN"}
|
package/package.json
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-prod-debugger",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A comprehensive, in-app debugging toolkit for React Native that works in production builds. Hidden gesture activation, network inspector, state viewer, feature flags, and 13+ debugging tools — zero native dependencies.",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib",
|
|
13
|
+
"!**/__tests__",
|
|
14
|
+
"!**/__fixtures__",
|
|
15
|
+
"!**/__mocks__",
|
|
16
|
+
"android",
|
|
17
|
+
"ios",
|
|
18
|
+
"cpp",
|
|
19
|
+
"*.podspec",
|
|
20
|
+
"!ios/build",
|
|
21
|
+
"!android/build",
|
|
22
|
+
"!android/gradle",
|
|
23
|
+
"!android/gradlew",
|
|
24
|
+
"!android/gradlew.bat"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "bob build",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"clean": "rm -rf lib",
|
|
32
|
+
"prepare": "bun run build",
|
|
33
|
+
"release": "npm publish"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"react-native",
|
|
37
|
+
"debugger",
|
|
38
|
+
"production",
|
|
39
|
+
"debug",
|
|
40
|
+
"overlay",
|
|
41
|
+
"network-logger",
|
|
42
|
+
"redux",
|
|
43
|
+
"zustand",
|
|
44
|
+
"mobx",
|
|
45
|
+
"state-inspector",
|
|
46
|
+
"feature-flags",
|
|
47
|
+
"remote-config",
|
|
48
|
+
"console-logger",
|
|
49
|
+
"performance-monitor",
|
|
50
|
+
"deep-link",
|
|
51
|
+
"crash-reporter",
|
|
52
|
+
"developer-tools",
|
|
53
|
+
"in-app-debugger",
|
|
54
|
+
"devtools"
|
|
55
|
+
],
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "https://github.com/amanverma/react-native-prod-debugger"
|
|
59
|
+
},
|
|
60
|
+
"author": "Aman Verma",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/amanverma/react-native-prod-debugger/issues"
|
|
64
|
+
},
|
|
65
|
+
"homepage": "https://github.com/amanverma/react-native-prod-debugger#readme",
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"registry": "https://registry.npmjs.org/"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"react": ">=16.8.0",
|
|
71
|
+
"react-native": ">=0.63.0"
|
|
72
|
+
},
|
|
73
|
+
"peerDependenciesMeta": {
|
|
74
|
+
"react": {
|
|
75
|
+
"optional": false
|
|
76
|
+
},
|
|
77
|
+
"react-native": {
|
|
78
|
+
"optional": false
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@types/react": "^18.2.0",
|
|
83
|
+
"@types/react-native": "^0.72.0",
|
|
84
|
+
"eslint": "^8.57.0",
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
86
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
87
|
+
"eslint-plugin-react": "^7.34.0",
|
|
88
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
89
|
+
"jest": "^29.7.0",
|
|
90
|
+
"@types/jest": "^29.5.0",
|
|
91
|
+
"ts-jest": "^29.1.0",
|
|
92
|
+
"prettier": "^3.2.0",
|
|
93
|
+
"react": "^18.2.0",
|
|
94
|
+
"react-native": "^0.73.0",
|
|
95
|
+
"react-native-builder-bob": "^0.23.0",
|
|
96
|
+
"typescript": "^5.3.0"
|
|
97
|
+
},
|
|
98
|
+
"react-native-builder-bob": {
|
|
99
|
+
"source": "src",
|
|
100
|
+
"output": "lib",
|
|
101
|
+
"targets": [
|
|
102
|
+
"commonjs",
|
|
103
|
+
"module",
|
|
104
|
+
[
|
|
105
|
+
"typescript",
|
|
106
|
+
{
|
|
107
|
+
"project": "tsconfig.build.json"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"jest": {
|
|
113
|
+
"preset": "ts-jest",
|
|
114
|
+
"testEnvironment": "node",
|
|
115
|
+
"testPathIgnorePatterns": [
|
|
116
|
+
"/node_modules/",
|
|
117
|
+
"/lib/"
|
|
118
|
+
],
|
|
119
|
+
"moduleFileExtensions": [
|
|
120
|
+
"ts",
|
|
121
|
+
"tsx",
|
|
122
|
+
"js",
|
|
123
|
+
"jsx",
|
|
124
|
+
"json"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"eslintIgnore": [
|
|
128
|
+
"node_modules/",
|
|
129
|
+
"lib/"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import React, { useRef, useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Animated,
|
|
4
|
+
PanResponder,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
Dimensions,
|
|
8
|
+
Text,
|
|
9
|
+
View,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import type { DebuggerTheme } from './types';
|
|
12
|
+
|
|
13
|
+
interface DebugBubbleProps {
|
|
14
|
+
onPress: () => void;
|
|
15
|
+
theme: DebuggerTheme;
|
|
16
|
+
size?: number;
|
|
17
|
+
initialPosition?: { x: number; y: number };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const SCREEN = Dimensions.get('window');
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* DebugBubble — A floating, draggable FAB that opens the debug overlay.
|
|
24
|
+
*
|
|
25
|
+
* - Fully draggable via PanResponder
|
|
26
|
+
* - Snaps to the nearest screen edge on release
|
|
27
|
+
* - Pulses subtly to indicate interactivity
|
|
28
|
+
* - Renders above all other content
|
|
29
|
+
*/
|
|
30
|
+
export const DebugBubble: React.FC<DebugBubbleProps> = ({
|
|
31
|
+
onPress,
|
|
32
|
+
theme,
|
|
33
|
+
size = 50,
|
|
34
|
+
initialPosition,
|
|
35
|
+
}) => {
|
|
36
|
+
const defaultPos = initialPosition ?? { x: SCREEN.width - size - 16, y: SCREEN.height * 0.7 };
|
|
37
|
+
const pan = useRef(new Animated.ValueXY(defaultPos)).current;
|
|
38
|
+
const scale = useRef(new Animated.Value(1)).current;
|
|
39
|
+
|
|
40
|
+
const panResponder = useMemo(
|
|
41
|
+
() =>
|
|
42
|
+
PanResponder.create({
|
|
43
|
+
onStartShouldSetPanResponder: () => true,
|
|
44
|
+
onMoveShouldSetPanResponder: (_, gesture) => {
|
|
45
|
+
// Only claim the gesture if the user has dragged more than 5px
|
|
46
|
+
return Math.abs(gesture.dx) > 5 || Math.abs(gesture.dy) > 5;
|
|
47
|
+
},
|
|
48
|
+
onPanResponderGrant: () => {
|
|
49
|
+
// Flatten offset into the value so extractOffset works correctly
|
|
50
|
+
pan.extractOffset();
|
|
51
|
+
Animated.spring(scale, {
|
|
52
|
+
toValue: 1.15,
|
|
53
|
+
useNativeDriver: true,
|
|
54
|
+
friction: 5,
|
|
55
|
+
}).start();
|
|
56
|
+
},
|
|
57
|
+
onPanResponderMove: Animated.event([null, { dx: pan.x, dy: pan.y }], {
|
|
58
|
+
useNativeDriver: false,
|
|
59
|
+
}),
|
|
60
|
+
onPanResponderRelease: (_, gesture) => {
|
|
61
|
+
pan.flattenOffset();
|
|
62
|
+
|
|
63
|
+
Animated.spring(scale, {
|
|
64
|
+
toValue: 1,
|
|
65
|
+
useNativeDriver: true,
|
|
66
|
+
friction: 5,
|
|
67
|
+
}).start();
|
|
68
|
+
|
|
69
|
+
// Snap to nearest horizontal edge
|
|
70
|
+
const finalX = gesture.moveX > SCREEN.width / 2 ? SCREEN.width - size - 8 : 8;
|
|
71
|
+
|
|
72
|
+
// Clamp vertical position
|
|
73
|
+
const finalY = Math.max(
|
|
74
|
+
50,
|
|
75
|
+
Math.min(gesture.moveY - size / 2, SCREEN.height - size - 50),
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
Animated.spring(pan, {
|
|
79
|
+
toValue: { x: finalX, y: finalY },
|
|
80
|
+
useNativeDriver: false,
|
|
81
|
+
friction: 7,
|
|
82
|
+
tension: 40,
|
|
83
|
+
}).start();
|
|
84
|
+
|
|
85
|
+
// If the user barely moved, treat it as a tap
|
|
86
|
+
if (Math.abs(gesture.dx) < 10 && Math.abs(gesture.dy) < 10) {
|
|
87
|
+
onPress();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
[pan, scale, size, onPress],
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<Animated.View
|
|
96
|
+
style={[
|
|
97
|
+
styles.container,
|
|
98
|
+
{
|
|
99
|
+
width: size,
|
|
100
|
+
height: size,
|
|
101
|
+
borderRadius: size / 2,
|
|
102
|
+
backgroundColor: theme.bubbleBackground,
|
|
103
|
+
transform: [{ translateX: pan.x }, { translateY: pan.y }, { scale }],
|
|
104
|
+
shadowColor: theme.shadow,
|
|
105
|
+
},
|
|
106
|
+
]}
|
|
107
|
+
{...panResponder.panHandlers}
|
|
108
|
+
>
|
|
109
|
+
<TouchableOpacity
|
|
110
|
+
activeOpacity={0.8}
|
|
111
|
+
style={[
|
|
112
|
+
styles.inner,
|
|
113
|
+
{
|
|
114
|
+
width: size,
|
|
115
|
+
height: size,
|
|
116
|
+
borderRadius: size / 2,
|
|
117
|
+
},
|
|
118
|
+
]}
|
|
119
|
+
onPress={onPress}
|
|
120
|
+
>
|
|
121
|
+
<View style={styles.iconContainer}>
|
|
122
|
+
<Text style={[styles.icon, { fontSize: size * 0.45 }]}>🐛</Text>
|
|
123
|
+
</View>
|
|
124
|
+
</TouchableOpacity>
|
|
125
|
+
</Animated.View>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const styles = StyleSheet.create({
|
|
130
|
+
container: {
|
|
131
|
+
position: 'absolute',
|
|
132
|
+
zIndex: 99999,
|
|
133
|
+
elevation: 99999,
|
|
134
|
+
shadowOffset: { width: 0, height: 4 },
|
|
135
|
+
shadowOpacity: 0.3,
|
|
136
|
+
shadowRadius: 8,
|
|
137
|
+
},
|
|
138
|
+
inner: {
|
|
139
|
+
alignItems: 'center',
|
|
140
|
+
justifyContent: 'center',
|
|
141
|
+
},
|
|
142
|
+
iconContainer: {
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
justifyContent: 'center',
|
|
145
|
+
},
|
|
146
|
+
icon: {
|
|
147
|
+
textAlign: 'center',
|
|
148
|
+
},
|
|
149
|
+
});
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import React, { useState, useMemo, useCallback, useRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
ScrollView,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
Animated,
|
|
9
|
+
Dimensions,
|
|
10
|
+
SafeAreaView,
|
|
11
|
+
StatusBar,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import type { DebuggerPlugin, DebuggerTheme } from './types';
|
|
14
|
+
|
|
15
|
+
interface DebugOverlayProps {
|
|
16
|
+
plugins: DebuggerPlugin[];
|
|
17
|
+
theme: DebuggerTheme;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const SCREEN = Dimensions.get('window');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* DebugOverlay — Full-screen modal with tab navigation for plugins.
|
|
25
|
+
*
|
|
26
|
+
* - Slide-up animation on open
|
|
27
|
+
* - Scrollable tab bar at the top
|
|
28
|
+
* - Each tab renders a plugin's component
|
|
29
|
+
* - Close button in the header
|
|
30
|
+
*/
|
|
31
|
+
export const DebugOverlay: React.FC<DebugOverlayProps> = ({ plugins, theme, onClose }) => {
|
|
32
|
+
const [activeTab, setActiveTab] = useState(0);
|
|
33
|
+
const slideAnim = useRef(new Animated.Value(SCREEN.height)).current;
|
|
34
|
+
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
Animated.spring(slideAnim, {
|
|
37
|
+
toValue: 0,
|
|
38
|
+
useNativeDriver: true,
|
|
39
|
+
damping: 20,
|
|
40
|
+
stiffness: 120,
|
|
41
|
+
}).start();
|
|
42
|
+
}, [slideAnim]);
|
|
43
|
+
|
|
44
|
+
const handleClose = useCallback(() => {
|
|
45
|
+
Animated.timing(slideAnim, {
|
|
46
|
+
toValue: SCREEN.height,
|
|
47
|
+
duration: 250,
|
|
48
|
+
useNativeDriver: true,
|
|
49
|
+
}).start(() => onClose());
|
|
50
|
+
}, [slideAnim, onClose]);
|
|
51
|
+
|
|
52
|
+
const ActivePlugin = useMemo(() => {
|
|
53
|
+
return plugins[activeTab]?.component;
|
|
54
|
+
}, [plugins, activeTab]);
|
|
55
|
+
|
|
56
|
+
if (plugins.length === 0) return null;
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Animated.View
|
|
60
|
+
style={[
|
|
61
|
+
styles.overlay,
|
|
62
|
+
{
|
|
63
|
+
backgroundColor: theme.overlay,
|
|
64
|
+
transform: [{ translateY: slideAnim }],
|
|
65
|
+
},
|
|
66
|
+
]}
|
|
67
|
+
>
|
|
68
|
+
<SafeAreaView style={[styles.safeArea, { backgroundColor: theme.headerBackground }]}>
|
|
69
|
+
<StatusBar barStyle="light-content" />
|
|
70
|
+
|
|
71
|
+
{/* Header */}
|
|
72
|
+
<View
|
|
73
|
+
style={[
|
|
74
|
+
styles.header,
|
|
75
|
+
{ backgroundColor: theme.headerBackground, borderBottomColor: theme.border },
|
|
76
|
+
]}
|
|
77
|
+
>
|
|
78
|
+
<View style={styles.headerLeft}>
|
|
79
|
+
<Text style={[styles.headerTitle, { color: theme.text }]}>🐛 Prod Debugger</Text>
|
|
80
|
+
</View>
|
|
81
|
+
<TouchableOpacity
|
|
82
|
+
onPress={handleClose}
|
|
83
|
+
style={[styles.closeButton, { backgroundColor: theme.surfaceAlt }]}
|
|
84
|
+
activeOpacity={0.7}
|
|
85
|
+
>
|
|
86
|
+
<Text style={[styles.closeIcon, { color: theme.textSecondary }]}>✕</Text>
|
|
87
|
+
</TouchableOpacity>
|
|
88
|
+
</View>
|
|
89
|
+
|
|
90
|
+
{/* Tab Bar */}
|
|
91
|
+
<View
|
|
92
|
+
style={[
|
|
93
|
+
styles.tabBarContainer,
|
|
94
|
+
{ backgroundColor: theme.headerBackground, borderBottomColor: theme.border },
|
|
95
|
+
]}
|
|
96
|
+
>
|
|
97
|
+
<ScrollView
|
|
98
|
+
horizontal
|
|
99
|
+
showsHorizontalScrollIndicator={false}
|
|
100
|
+
contentContainerStyle={styles.tabBarContent}
|
|
101
|
+
>
|
|
102
|
+
{plugins.map((plugin, index) => (
|
|
103
|
+
<TouchableOpacity
|
|
104
|
+
key={plugin.id}
|
|
105
|
+
style={[
|
|
106
|
+
styles.tab,
|
|
107
|
+
{
|
|
108
|
+
backgroundColor: index === activeTab ? theme.accent : 'transparent',
|
|
109
|
+
borderColor: index === activeTab ? theme.accent : theme.border,
|
|
110
|
+
},
|
|
111
|
+
]}
|
|
112
|
+
onPress={() => setActiveTab(index)}
|
|
113
|
+
activeOpacity={0.7}
|
|
114
|
+
>
|
|
115
|
+
<Text style={styles.tabIcon}>{plugin.icon}</Text>
|
|
116
|
+
<Text
|
|
117
|
+
style={[
|
|
118
|
+
styles.tabLabel,
|
|
119
|
+
{
|
|
120
|
+
color: index === activeTab ? '#FFFFFF' : theme.textSecondary,
|
|
121
|
+
fontWeight: index === activeTab ? '700' : '500',
|
|
122
|
+
},
|
|
123
|
+
]}
|
|
124
|
+
numberOfLines={1}
|
|
125
|
+
>
|
|
126
|
+
{plugin.name}
|
|
127
|
+
</Text>
|
|
128
|
+
</TouchableOpacity>
|
|
129
|
+
))}
|
|
130
|
+
</ScrollView>
|
|
131
|
+
</View>
|
|
132
|
+
|
|
133
|
+
{/* Active Plugin Content */}
|
|
134
|
+
<View style={[styles.content, { backgroundColor: theme.background }]}>
|
|
135
|
+
{ActivePlugin ? <ActivePlugin theme={theme} /> : null}
|
|
136
|
+
</View>
|
|
137
|
+
</SafeAreaView>
|
|
138
|
+
</Animated.View>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const styles = StyleSheet.create({
|
|
143
|
+
overlay: {
|
|
144
|
+
position: 'absolute',
|
|
145
|
+
top: 0,
|
|
146
|
+
left: 0,
|
|
147
|
+
right: 0,
|
|
148
|
+
bottom: 0,
|
|
149
|
+
zIndex: 999999,
|
|
150
|
+
elevation: 999999,
|
|
151
|
+
},
|
|
152
|
+
safeArea: {
|
|
153
|
+
flex: 1,
|
|
154
|
+
},
|
|
155
|
+
header: {
|
|
156
|
+
flexDirection: 'row',
|
|
157
|
+
alignItems: 'center',
|
|
158
|
+
justifyContent: 'space-between',
|
|
159
|
+
paddingHorizontal: 16,
|
|
160
|
+
paddingVertical: 12,
|
|
161
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
162
|
+
},
|
|
163
|
+
headerLeft: {
|
|
164
|
+
flexDirection: 'row',
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
gap: 8,
|
|
167
|
+
},
|
|
168
|
+
headerTitle: {
|
|
169
|
+
fontSize: 18,
|
|
170
|
+
fontWeight: '800',
|
|
171
|
+
letterSpacing: 0.5,
|
|
172
|
+
},
|
|
173
|
+
closeButton: {
|
|
174
|
+
width: 32,
|
|
175
|
+
height: 32,
|
|
176
|
+
borderRadius: 16,
|
|
177
|
+
alignItems: 'center',
|
|
178
|
+
justifyContent: 'center',
|
|
179
|
+
},
|
|
180
|
+
closeIcon: {
|
|
181
|
+
fontSize: 16,
|
|
182
|
+
fontWeight: '600',
|
|
183
|
+
},
|
|
184
|
+
tabBarContainer: {
|
|
185
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
186
|
+
},
|
|
187
|
+
tabBarContent: {
|
|
188
|
+
paddingHorizontal: 12,
|
|
189
|
+
paddingVertical: 8,
|
|
190
|
+
gap: 6,
|
|
191
|
+
},
|
|
192
|
+
tab: {
|
|
193
|
+
flexDirection: 'row',
|
|
194
|
+
alignItems: 'center',
|
|
195
|
+
paddingHorizontal: 12,
|
|
196
|
+
paddingVertical: 6,
|
|
197
|
+
borderRadius: 20,
|
|
198
|
+
borderWidth: 1,
|
|
199
|
+
gap: 4,
|
|
200
|
+
},
|
|
201
|
+
tabIcon: {
|
|
202
|
+
fontSize: 14,
|
|
203
|
+
},
|
|
204
|
+
tabLabel: {
|
|
205
|
+
fontSize: 12,
|
|
206
|
+
maxWidth: 80,
|
|
207
|
+
},
|
|
208
|
+
content: {
|
|
209
|
+
flex: 1,
|
|
210
|
+
},
|
|
211
|
+
});
|