react-native-debug-toolkit 2.0.0 → 2.1.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/README.md +72 -72
- package/README.zh-CN.md +209 -0
- package/lib/commonjs/components/ClipboardTab.js +15 -16
- package/lib/commonjs/components/ClipboardTab.js.map +1 -1
- package/lib/commonjs/components/ConsoleLogTab.js +69 -202
- package/lib/commonjs/components/ConsoleLogTab.js.map +1 -1
- package/lib/commonjs/components/DebugPanel.js +230 -0
- package/lib/commonjs/components/DebugPanel.js.map +1 -0
- package/lib/commonjs/components/DebugView.js +66 -0
- package/lib/commonjs/components/DebugView.js.map +1 -0
- package/lib/commonjs/components/EnvironmentTab.js +22 -23
- package/lib/commonjs/components/EnvironmentTab.js.map +1 -1
- package/lib/commonjs/components/FeatureTabBar.js +182 -0
- package/lib/commonjs/components/FeatureTabBar.js.map +1 -0
- package/lib/commonjs/components/FloatIcon.js +187 -0
- package/lib/commonjs/components/FloatIcon.js.map +1 -0
- package/lib/commonjs/components/FloatPanelView.js +140 -723
- package/lib/commonjs/components/FloatPanelView.js.map +1 -1
- package/lib/commonjs/components/NavigationLogTab.js +8 -8
- package/lib/commonjs/components/NavigationLogTab.js.map +1 -1
- package/lib/commonjs/components/NetworkLogTab.js +179 -350
- package/lib/commonjs/components/NetworkLogTab.js.map +1 -1
- package/lib/commonjs/components/ThirdPartyLibsTab.js +8 -8
- package/lib/commonjs/components/ThirdPartyLibsTab.js.map +1 -1
- package/lib/commonjs/components/TrackLogTab.js +106 -248
- package/lib/commonjs/components/TrackLogTab.js.map +1 -1
- package/lib/commonjs/components/ZustandLogTab.js +148 -288
- package/lib/commonjs/components/ZustandLogTab.js.map +1 -1
- package/lib/commonjs/components/shared/CollapsibleSection.js +4 -4
- package/lib/commonjs/components/shared/CollapsibleSection.js.map +1 -1
- package/lib/commonjs/components/shared/CopyButton.js +3 -3
- package/lib/commonjs/components/shared/CopyButton.js.map +1 -1
- package/lib/commonjs/components/shared/LogListScreen.js +174 -0
- package/lib/commonjs/components/shared/LogListScreen.js.map +1 -0
- package/lib/commonjs/core/DebugToolkit.js +92 -112
- package/lib/commonjs/core/DebugToolkit.js.map +1 -1
- package/lib/commonjs/core/DebugToolkitProvider.js +30 -28
- package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -1
- package/lib/commonjs/features/ClipboardFeature.js +6 -2
- package/lib/commonjs/features/ClipboardFeature.js.map +1 -1
- package/lib/commonjs/features/ConsoleLogFeature.js +66 -49
- package/lib/commonjs/features/ConsoleLogFeature.js.map +1 -1
- package/lib/commonjs/features/EnvironmentFeature.js +5 -13
- package/lib/commonjs/features/EnvironmentFeature.js.map +1 -1
- package/lib/commonjs/features/NavigationLogFeature.js +17 -38
- package/lib/commonjs/features/NavigationLogFeature.js.map +1 -1
- package/lib/commonjs/features/NetworkFeature.js +35 -256
- package/lib/commonjs/features/NetworkFeature.js.map +1 -1
- package/lib/commonjs/features/TrackFeature.js +17 -38
- package/lib/commonjs/features/TrackFeature.js.map +1 -1
- package/lib/commonjs/features/ZustandLogFeature.js +21 -38
- package/lib/commonjs/features/ZustandLogFeature.js.map +1 -1
- package/lib/commonjs/hooks/useNavigationLogger.js.map +1 -1
- package/lib/commonjs/index.js +7 -20
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/initialize.js +19 -96
- package/lib/commonjs/initialize.js.map +1 -1
- package/lib/commonjs/interceptors/networkInterceptor.js +466 -0
- package/lib/commonjs/interceptors/networkInterceptor.js.map +1 -0
- package/lib/commonjs/utils/colors.js +48 -0
- package/lib/commonjs/utils/colors.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +48 -0
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -0
- package/lib/commonjs/utils/layout.js +8 -0
- package/lib/commonjs/utils/layout.js.map +1 -0
- package/lib/commonjs/utils/urlRewriterRegistry.js +14 -0
- package/lib/commonjs/utils/urlRewriterRegistry.js.map +1 -0
- package/lib/module/components/ClipboardTab.js +8 -8
- package/lib/module/components/ClipboardTab.js.map +1 -1
- package/lib/module/components/ConsoleLogTab.js +66 -199
- package/lib/module/components/ConsoleLogTab.js.map +1 -1
- package/lib/module/components/DebugPanel.js +225 -0
- package/lib/module/components/DebugPanel.js.map +1 -0
- package/lib/module/components/DebugView.js +61 -0
- package/lib/module/components/DebugView.js.map +1 -0
- package/lib/module/components/EnvironmentTab.js +3 -3
- package/lib/module/components/EnvironmentTab.js.map +1 -1
- package/lib/module/components/FeatureTabBar.js +177 -0
- package/lib/module/components/FeatureTabBar.js.map +1 -0
- package/lib/module/components/FloatIcon.js +182 -0
- package/lib/module/components/FloatIcon.js.map +1 -0
- package/lib/module/components/FloatPanelView.js +141 -723
- package/lib/module/components/FloatPanelView.js.map +1 -1
- package/lib/module/components/NavigationLogTab.js +1 -1
- package/lib/module/components/NavigationLogTab.js.map +1 -1
- package/lib/module/components/NetworkLogTab.js +167 -338
- package/lib/module/components/NetworkLogTab.js.map +1 -1
- package/lib/module/components/ThirdPartyLibsTab.js +1 -1
- package/lib/module/components/ThirdPartyLibsTab.js.map +1 -1
- package/lib/module/components/TrackLogTab.js +94 -236
- package/lib/module/components/TrackLogTab.js.map +1 -1
- package/lib/module/components/ZustandLogTab.js +136 -276
- package/lib/module/components/ZustandLogTab.js.map +1 -1
- package/lib/module/components/shared/CollapsibleSection.js +1 -1
- package/lib/module/components/shared/CollapsibleSection.js.map +1 -1
- package/lib/module/components/shared/CopyButton.js +1 -1
- package/lib/module/components/shared/CopyButton.js.map +1 -1
- package/lib/module/components/shared/LogListScreen.js +169 -0
- package/lib/module/components/shared/LogListScreen.js.map +1 -0
- package/lib/module/core/DebugToolkit.js +92 -111
- package/lib/module/core/DebugToolkit.js.map +1 -1
- package/lib/module/core/DebugToolkitProvider.js +31 -29
- package/lib/module/core/DebugToolkitProvider.js.map +1 -1
- package/lib/module/features/ClipboardFeature.js +6 -2
- package/lib/module/features/ClipboardFeature.js.map +1 -1
- package/lib/module/features/ConsoleLogFeature.js +65 -49
- package/lib/module/features/ConsoleLogFeature.js.map +1 -1
- package/lib/module/features/EnvironmentFeature.js +5 -13
- package/lib/module/features/EnvironmentFeature.js.map +1 -1
- package/lib/module/features/NavigationLogFeature.js +16 -38
- package/lib/module/features/NavigationLogFeature.js.map +1 -1
- package/lib/module/features/NetworkFeature.js +34 -255
- package/lib/module/features/NetworkFeature.js.map +1 -1
- package/lib/module/features/TrackFeature.js +16 -38
- package/lib/module/features/TrackFeature.js.map +1 -1
- package/lib/module/features/ZustandLogFeature.js +22 -38
- package/lib/module/features/ZustandLogFeature.js.map +1 -1
- package/lib/module/hooks/useNavigationLogger.js.map +1 -1
- package/lib/module/index.js +2 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/initialize.js +19 -95
- package/lib/module/initialize.js.map +1 -1
- package/lib/module/interceptors/networkInterceptor.js +460 -0
- package/lib/module/interceptors/networkInterceptor.js.map +1 -0
- package/lib/module/utils/colors.js +43 -0
- package/lib/module/utils/colors.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +44 -0
- package/lib/module/utils/createChannelFeature.js.map +1 -0
- package/lib/module/utils/layout.js +4 -0
- package/lib/module/utils/layout.js.map +1 -0
- package/lib/module/utils/urlRewriterRegistry.js +10 -0
- package/lib/module/utils/urlRewriterRegistry.js.map +1 -0
- package/lib/typescript/src/components/ClipboardTab.d.ts.map +1 -1
- package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +1 -1
- package/lib/typescript/src/components/DebugPanel.d.ts +9 -0
- package/lib/typescript/src/components/DebugPanel.d.ts.map +1 -0
- package/lib/typescript/src/components/DebugView.d.ts +19 -0
- package/lib/typescript/src/components/DebugView.d.ts.map +1 -0
- package/lib/typescript/src/components/EnvironmentTab.d.ts.map +1 -1
- package/lib/typescript/src/components/FeatureTabBar.d.ts +13 -0
- package/lib/typescript/src/components/FeatureTabBar.d.ts.map +1 -0
- package/lib/typescript/src/components/FloatIcon.d.ts +12 -0
- package/lib/typescript/src/components/FloatIcon.d.ts.map +1 -0
- package/lib/typescript/src/components/FloatPanelView.d.ts +4 -59
- package/lib/typescript/src/components/FloatPanelView.d.ts.map +1 -1
- package/lib/typescript/src/components/NetworkLogTab.d.ts.map +1 -1
- package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +1 -1
- package/lib/typescript/src/components/TrackLogTab.d.ts.map +1 -1
- package/lib/typescript/src/components/ZustandLogTab.d.ts.map +1 -1
- package/lib/typescript/src/components/shared/LogListScreen.d.ts +21 -0
- package/lib/typescript/src/components/shared/LogListScreen.d.ts.map +1 -0
- package/lib/typescript/src/core/DebugToolkit.d.ts +11 -18
- package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -1
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts +2 -5
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -1
- package/lib/typescript/src/features/ClipboardFeature.d.ts +4 -0
- package/lib/typescript/src/features/ClipboardFeature.d.ts.map +1 -1
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts +2 -0
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +1 -1
- package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +1 -1
- package/lib/typescript/src/features/NavigationLogFeature.d.ts +2 -0
- package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +1 -1
- package/lib/typescript/src/features/NetworkFeature.d.ts +7 -20
- package/lib/typescript/src/features/NetworkFeature.d.ts.map +1 -1
- package/lib/typescript/src/features/TrackFeature.d.ts +2 -0
- package/lib/typescript/src/features/TrackFeature.d.ts.map +1 -1
- package/lib/typescript/src/features/ZustandLogFeature.d.ts +2 -0
- package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNavigationLogger.d.ts +1 -8
- package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -5
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/initialize.d.ts +3 -22
- package/lib/typescript/src/initialize.d.ts.map +1 -1
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts +18 -0
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +26 -29
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/colors.d.ts +21 -0
- package/lib/typescript/src/utils/colors.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +18 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -0
- package/lib/typescript/src/utils/layout.d.ts +2 -0
- package/lib/typescript/src/utils/layout.d.ts.map +1 -0
- package/lib/typescript/src/utils/urlRewriterRegistry.d.ts +7 -0
- package/lib/typescript/src/utils/urlRewriterRegistry.d.ts.map +1 -0
- package/package.json +5 -1
- package/src/components/ClipboardTab.tsx +8 -8
- package/src/components/ConsoleLogTab.tsx +49 -163
- package/src/components/DebugPanel.tsx +215 -0
- package/src/components/DebugView.tsx +80 -0
- package/src/components/EnvironmentTab.tsx +3 -3
- package/src/components/FeatureTabBar.tsx +204 -0
- package/src/components/FloatIcon.tsx +171 -0
- package/src/components/FloatPanelView.tsx +135 -647
- package/src/components/NavigationLogTab.tsx +1 -1
- package/src/components/NetworkLogTab.tsx +128 -269
- package/src/components/ThirdPartyLibsTab.tsx +3 -3
- package/src/components/TrackLogTab.tsx +53 -188
- package/src/components/ZustandLogTab.tsx +79 -181
- package/src/components/shared/CollapsibleSection.tsx +1 -1
- package/src/components/shared/CopyButton.tsx +1 -1
- package/src/components/shared/LogListScreen.tsx +164 -0
- package/src/core/DebugToolkit.tsx +114 -138
- package/src/core/DebugToolkitProvider.tsx +32 -38
- package/src/features/ClipboardFeature.ts +6 -2
- package/src/features/ConsoleLogFeature.ts +66 -68
- package/src/features/EnvironmentFeature.ts +5 -13
- package/src/features/NavigationLogFeature.ts +12 -42
- package/src/features/NetworkFeature.ts +43 -405
- package/src/features/TrackFeature.ts +14 -49
- package/src/features/ZustandLogFeature.ts +16 -42
- package/src/hooks/useNavigationLogger.ts +1 -6
- package/src/index.ts +5 -9
- package/src/initialize.ts +28 -120
- package/src/interceptors/networkInterceptor.ts +646 -0
- package/src/types/index.ts +25 -36
- package/src/utils/colors.ts +38 -0
- package/src/utils/createChannelFeature.ts +55 -0
- package/src/utils/layout.ts +1 -0
- package/src/utils/urlRewriterRegistry.ts +10 -0
- package/lib/commonjs/utils/constants.js +0 -135
- package/lib/commonjs/utils/constants.js.map +0 -1
- package/lib/module/utils/constants.js +0 -130
- package/lib/module/utils/constants.js.map +0 -1
- package/lib/typescript/src/utils/constants.d.ts +0 -96
- package/lib/typescript/src/utils/constants.d.ts.map +0 -1
- package/src/utils/constants.ts +0 -91
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationLogger.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useNavigationLogger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNavigationLogger.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useNavigationLogger.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAyBvD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC,QA+DhG"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { DebugToolkit } from './core/DebugToolkit';
|
|
2
2
|
export { DebugToolkitProvider, useDebugToolkit } from './core/DebugToolkitProvider';
|
|
3
|
-
export {
|
|
3
|
+
export { DebugView } from './components/DebugView';
|
|
4
|
+
export type { DebugViewProps } from './components/DebugView';
|
|
5
|
+
export { initializeDebugToolkit } from './initialize';
|
|
4
6
|
export type { InitializeOptions, FeatureConfigs } from './initialize';
|
|
5
7
|
export { createNetworkFeature } from './features/NetworkFeature';
|
|
6
|
-
export type {
|
|
8
|
+
export type { NetworkFeatureConfig, AxiosInstanceLike } from './features/NetworkFeature';
|
|
7
9
|
export { createConsoleLogFeature } from './features/ConsoleLogFeature';
|
|
8
10
|
export type { ConsoleFeatureConfig } from './features/ConsoleLogFeature';
|
|
9
11
|
export { createZustandLogFeature, zustandLogMiddleware, addZustandLog } from './features/ZustandLogFeature';
|
|
@@ -12,15 +14,13 @@ export { createNavigationLogFeature, addNavigationLog } from './features/Navigat
|
|
|
12
14
|
export type { NavigationFeatureConfig } from './features/NavigationLogFeature';
|
|
13
15
|
export { createTrackFeature, addTrackLog } from './features/TrackFeature';
|
|
14
16
|
export type { TrackFeatureConfig, TrackEventData } from './features/TrackFeature';
|
|
15
|
-
export { createThirdPartyLibsFeature } from './features/ThirdPartyLibsFeature';
|
|
16
17
|
export { createEnvironmentFeature } from './features/EnvironmentFeature';
|
|
17
18
|
export type { EnvironmentFeatureAPI } from './features/EnvironmentFeature';
|
|
18
19
|
export { createClipboardFeature } from './features/ClipboardFeature';
|
|
19
20
|
export { useNavigationLogger } from './hooks/useNavigationLogger';
|
|
20
|
-
export { useSlideDetailAnimation } from './hooks/useSlideDetailAnimation';
|
|
21
21
|
export { safeStringify } from './utils/safeStringify';
|
|
22
22
|
export { copyToComputer, logToComputer, fmt } from './utils/copyToComputer';
|
|
23
23
|
export type { CopyResult, CopyOptions, CopyMethod } from './utils/copyToComputer';
|
|
24
|
-
export type { BuiltInFeatureName, DebugFeature,
|
|
24
|
+
export type { AnyDebugFeature, BuiltInFeatureName, DebugFeature, DebugFeatureRenderProps, NetworkLogEntry, ConsoleLogEntry, ZustandLogEntry, NavigationLogEntry, TrackLogEntry, EnvironmentConfig, EnvironmentState, } from './types';
|
|
25
25
|
export { initializeDebugToolkit as default } from './initialize';
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE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AC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC5E,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGlF,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,sBAAsB,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -5,8 +5,6 @@ import type { ZustandFeatureConfig } from './features/ZustandLogFeature';
|
|
|
5
5
|
import type { NavigationFeatureConfig } from './features/NavigationLogFeature';
|
|
6
6
|
import type { TrackFeatureConfig } from './features/TrackFeature';
|
|
7
7
|
import { createEnvironmentFeature } from './features/EnvironmentFeature';
|
|
8
|
-
import type { DebugFeatureInput } from './types';
|
|
9
|
-
export declare const isDebugMode: boolean;
|
|
10
8
|
/** Feature-specific configuration map */
|
|
11
9
|
export interface FeatureConfigs {
|
|
12
10
|
network?: boolean | NetworkFeatureConfig;
|
|
@@ -14,38 +12,21 @@ export interface FeatureConfigs {
|
|
|
14
12
|
zustand?: boolean | ZustandFeatureConfig;
|
|
15
13
|
navigation?: boolean | NavigationFeatureConfig;
|
|
16
14
|
track?: boolean | TrackFeatureConfig;
|
|
17
|
-
thirdPartyLibs?: boolean;
|
|
18
15
|
environment?: Parameters<typeof createEnvironmentFeature>[0];
|
|
19
16
|
clipboard?: boolean;
|
|
20
17
|
}
|
|
21
18
|
export interface InitializeOptions {
|
|
22
|
-
|
|
19
|
+
features?: FeatureConfigs;
|
|
23
20
|
enabled?: boolean;
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
26
23
|
* Initialize the debug toolkit.
|
|
27
24
|
*
|
|
28
|
-
* @param featuresOrOptions - Either an array of feature inputs (legacy), or a full config object.
|
|
29
|
-
* @param options - Options when using legacy array mode.
|
|
30
|
-
*
|
|
31
25
|
* @example
|
|
32
|
-
* // Legacy mode (still supported)
|
|
33
|
-
* initializeDebugToolkit(['network', 'console'], { enabled: true });
|
|
34
|
-
*
|
|
35
|
-
* // Config object mode (recommended)
|
|
36
26
|
* initializeDebugToolkit({
|
|
37
|
-
* features: {
|
|
38
|
-
* network: { maxLogs: 100 },
|
|
39
|
-
* console: true,
|
|
40
|
-
* track: true,
|
|
41
|
-
* environment: { environments: [...] },
|
|
42
|
-
* },
|
|
27
|
+
* features: { network: true, console: true },
|
|
43
28
|
* enabled: true,
|
|
44
29
|
* });
|
|
45
30
|
*/
|
|
46
|
-
export declare function initializeDebugToolkit(
|
|
47
|
-
features?: FeatureConfigs;
|
|
48
|
-
enabled?: boolean;
|
|
49
|
-
doraemonProductId?: string;
|
|
50
|
-
}, options?: InitializeOptions): DebugToolkit | null;
|
|
31
|
+
export declare function initializeDebugToolkit(options?: InitializeOptions): typeof DebugToolkit;
|
|
51
32
|
//# sourceMappingURL=initialize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAMzE,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,GAAG,uBAAuB,CAAC;IAC/C,KAAK,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC;IACrC,WAAW,CAAC,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAmDD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,YAAY,CA4BrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NetworkLogEntry } from '../types';
|
|
2
|
+
type NetworkLogPayload = Omit<NetworkLogEntry, 'id'>;
|
|
3
|
+
interface AxiosInterceptorManager {
|
|
4
|
+
use: (onFulfilled: unknown, onRejected?: unknown) => number | void;
|
|
5
|
+
eject?: (id: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface AxiosInstanceLike {
|
|
8
|
+
interceptors: {
|
|
9
|
+
request: AxiosInterceptorManager;
|
|
10
|
+
response: AxiosInterceptorManager;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function startFetch(emit: (entry: NetworkLogPayload) => void): () => void;
|
|
14
|
+
export declare function startXMLHttpRequest(emit: (entry: NetworkLogPayload) => void): () => void;
|
|
15
|
+
export declare function setupAxios(axiosInstance: AxiosInstanceLike, emit: (entry: NetworkLogPayload) => void): () => void;
|
|
16
|
+
export declare function resetInterceptors(): void;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=networkInterceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkInterceptor.d.ts","sourceRoot":"","sources":["../../../../src/interceptors/networkInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,KAAK,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AAIrD,UAAU,uBAAuB;IAC/B,GAAG,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,CAAC;IACnE,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAwBD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE;QACZ,OAAO,EAAE,uBAAuB,CAAC;QACjC,QAAQ,EAAE,uBAAuB,CAAC;KACnC,CAAC;CACH;AAoOD,wBAAgB,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CA+D/E;AAqGD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GACvC,MAAM,IAAI,CA6FZ;AAoBD,wBAAgB,UAAU,CACxB,aAAa,EAAE,iBAAiB,EAChC,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GACvC,MAAM,IAAI,CAsFZ;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAQxC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
export type DebugFeatureListener = () => void;
|
|
3
|
-
export type BuiltInFeatureName = 'network' | 'console' | 'zustand' | 'navigation' | 'track' | '
|
|
3
|
+
export type BuiltInFeatureName = 'network' | 'console' | 'zustand' | 'navigation' | 'track' | 'environment' | 'clipboard';
|
|
4
|
+
/** Props passed to a feature's renderContent component */
|
|
4
5
|
export interface DebugFeatureRenderProps<TData = unknown> {
|
|
5
6
|
data: TData[];
|
|
6
7
|
feature: DebugFeature<TData>;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Type-erased feature for heterogeneous collections.
|
|
11
|
+
* Individual features should use `DebugFeature<TData>` with their specific data type.
|
|
12
|
+
* This alias is only for places that hold features of multiple types.
|
|
13
|
+
*/
|
|
14
|
+
export type AnyDebugFeature = DebugFeature<any>;
|
|
11
15
|
/** Base interface all debug features must implement */
|
|
12
16
|
export interface DebugFeature<TData = unknown> {
|
|
13
17
|
name: string;
|
|
@@ -17,7 +21,7 @@ export interface DebugFeature<TData = unknown> {
|
|
|
17
21
|
clear?: () => void;
|
|
18
22
|
cleanup: () => void;
|
|
19
23
|
subscribe?: (listener: DebugFeatureListener) => () => void;
|
|
20
|
-
renderContent?:
|
|
24
|
+
renderContent?: ComponentType<DebugFeatureRenderProps<TData>>;
|
|
21
25
|
badge?: () => {
|
|
22
26
|
label: string;
|
|
23
27
|
color: string;
|
|
@@ -73,17 +77,6 @@ export interface TrackLogEntry {
|
|
|
73
77
|
eventName: string;
|
|
74
78
|
[key: string]: unknown;
|
|
75
79
|
}
|
|
76
|
-
export interface ThirdPartyLib {
|
|
77
|
-
id: string;
|
|
78
|
-
name: string;
|
|
79
|
-
description: string;
|
|
80
|
-
platform: 'ios' | 'android' | 'both';
|
|
81
|
-
actions: Array<{
|
|
82
|
-
id: string;
|
|
83
|
-
label: string;
|
|
84
|
-
onPress: () => void;
|
|
85
|
-
}>;
|
|
86
|
-
}
|
|
87
80
|
export interface EnvironmentConfig {
|
|
88
81
|
id: string;
|
|
89
82
|
label: string;
|
|
@@ -94,19 +87,23 @@ export interface EnvironmentState {
|
|
|
94
87
|
environments: EnvironmentConfig[];
|
|
95
88
|
currentEnvironmentId: string | null;
|
|
96
89
|
}
|
|
97
|
-
export interface
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
export interface NavigationContainerRef {
|
|
91
|
+
getCurrentRoute?: () => {
|
|
92
|
+
name?: string;
|
|
93
|
+
} | undefined;
|
|
94
|
+
getRootState?: () => unknown;
|
|
95
|
+
addListener: (event: string, callback: () => void) => () => void;
|
|
102
96
|
}
|
|
103
|
-
export interface
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
export interface ThirdPartyLibAction {
|
|
98
|
+
id: string;
|
|
99
|
+
label: string;
|
|
100
|
+
onPress: () => void;
|
|
101
|
+
}
|
|
102
|
+
export interface ThirdPartyLib {
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
description: string;
|
|
106
|
+
platform: 'ios' | 'android' | 'both';
|
|
107
|
+
actions: ThirdPartyLibAction[];
|
|
111
108
|
}
|
|
112
109
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,SAAS,GACT,SAAS,GACT,YAAY,GACZ,OAAO,GACP,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,SAAS,GACT,SAAS,GACT,YAAY,GACZ,OAAO,GACP,aAAa,GACb,WAAW,CAAC;AAEhB,0DAA0D;AAC1D,MAAM,WAAW,uBAAuB,CAAC,KAAK,GAAG,OAAO;IACtD,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;AAGhD,uDAAuD;AACvD,MAAM,WAAW,YAAY,CAAC,KAAK,GAAG,OAAO;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,KAAK,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,MAAM,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,KAAK,CAAC,EAA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@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const Colors: {
|
|
2
|
+
readonly primary: "#007AFF";
|
|
3
|
+
readonly text: "#1C1C1E";
|
|
4
|
+
readonly textSecondary: "#8E8E93";
|
|
5
|
+
readonly textLight: "#C7C7CC";
|
|
6
|
+
readonly border: "#E5E5EA";
|
|
7
|
+
readonly background: "#F2F2F7";
|
|
8
|
+
readonly surface: "#FFFFFF";
|
|
9
|
+
readonly success: "#34C759";
|
|
10
|
+
readonly error: "#FF3B30";
|
|
11
|
+
readonly warning: "#FF9500";
|
|
12
|
+
readonly info: "#5AC8FA";
|
|
13
|
+
readonly purple: "#AF52DE";
|
|
14
|
+
readonly get: "#007AFF";
|
|
15
|
+
readonly post: "#34C759";
|
|
16
|
+
readonly put: "#FF9500";
|
|
17
|
+
readonly delete: "#FF3B30";
|
|
18
|
+
readonly patch: "#5AC8FA";
|
|
19
|
+
};
|
|
20
|
+
export declare function getMethodColor(method: string): string;
|
|
21
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/utils/colors.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;CAyBT,CAAC;AAEX,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CASrD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { DebugFeature, DebugFeatureRenderProps } from '../types';
|
|
3
|
+
import type { EventChannel } from './createEventChannel';
|
|
4
|
+
/**
|
|
5
|
+
* Generic factory for features that subscribe to an event channel.
|
|
6
|
+
* Eliminates boilerplate across channel-based features (Track, Navigation, Zustand).
|
|
7
|
+
*
|
|
8
|
+
* @param getChannel - Function returning the current channel (supports test resets)
|
|
9
|
+
* @param toEntry - Maps a payload + auto-generated id to a typed log entry
|
|
10
|
+
* @param options - Feature name, label, render component, and optional maxLogs
|
|
11
|
+
*/
|
|
12
|
+
export declare function createChannelFeature<TPayload, TEntry>(getChannel: () => EventChannel<TPayload>, toEntry: (payload: TPayload, id: string) => TEntry, options: {
|
|
13
|
+
name: string;
|
|
14
|
+
label: string;
|
|
15
|
+
renderContent?: ComponentType<DebugFeatureRenderProps<TEntry>>;
|
|
16
|
+
maxLogs?: number;
|
|
17
|
+
}): DebugFeature<TEntry>;
|
|
18
|
+
//# sourceMappingURL=createChannelFeature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createChannelFeature.d.ts","sourceRoot":"","sources":["../../../../src/utils/createChannelFeature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAwB,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKzD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EACnD,UAAU,EAAE,MAAM,YAAY,CAAC,QAAQ,CAAC,EACxC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,EAClD,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,YAAY,CAAC,MAAM,CAAC,CA8BtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/utils/layout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlRewriterRegistry.d.ts","sourceRoot":"","sources":["../../../../src/utils/urlRewriterRegistry.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAI3C,eAAO,MAAM,WAAW;eACb,WAAW,GAAG,IAAI;oBACX,WAAW,GAAG,IAAI,KAAG,IAAI;CAG1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-debug-toolkit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A dev-only floating debug panel for React Native with network, console, Zustand, navigation, and event logs",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"scripts": {
|
|
18
18
|
"typecheck": "tsc --noEmit",
|
|
19
19
|
"typescript": "npm run typecheck",
|
|
20
|
+
"test": "jest",
|
|
20
21
|
"build": "bob build",
|
|
21
22
|
"lint": "eslint \"src/**/*.{js,ts,tsx}\"",
|
|
22
23
|
"prepare": "bob build"
|
|
@@ -52,12 +53,15 @@
|
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@react-native/babel-preset": "^0.76.0",
|
|
54
55
|
"@react-native/eslint-config": "^0.76.0",
|
|
56
|
+
"@types/jest": "^30.0.0",
|
|
55
57
|
"@types/react": "^18.3.1",
|
|
56
58
|
"eslint": "^8.57.0",
|
|
59
|
+
"jest": "^30.3.0",
|
|
57
60
|
"prettier": "^3.3.0",
|
|
58
61
|
"react": "^18.3.1",
|
|
59
62
|
"react-native": "^0.76.6",
|
|
60
63
|
"react-native-builder-bob": "^0.30.0",
|
|
64
|
+
"ts-jest": "^29.4.9",
|
|
61
65
|
"typescript": "^5.5.0"
|
|
62
66
|
},
|
|
63
67
|
"react-native": "src/index.ts",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react';
|
|
2
2
|
import { View, Text, TextInput, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
-
import { Colors
|
|
3
|
+
import { Colors } from '../utils/colors';
|
|
4
4
|
import { copyToComputer } from '../utils/copyToComputer';
|
|
5
5
|
import type { DebugFeatureRenderProps } from '../types';
|
|
6
6
|
|
|
7
|
-
export const ClipboardTab: React.FC<DebugFeatureRenderProps<void>> = () => {
|
|
7
|
+
export const ClipboardTab: React.FC<DebugFeatureRenderProps<void>> = React.memo(() => {
|
|
8
8
|
const [text, setText] = useState('');
|
|
9
9
|
const [feedback, setFeedback] = useState<string | null>(null);
|
|
10
10
|
|
|
@@ -41,25 +41,25 @@ export const ClipboardTab: React.FC<DebugFeatureRenderProps<void>> = () => {
|
|
|
41
41
|
</View>
|
|
42
42
|
</View>
|
|
43
43
|
);
|
|
44
|
-
};
|
|
44
|
+
});
|
|
45
45
|
|
|
46
46
|
const s = StyleSheet.create({
|
|
47
47
|
container: {
|
|
48
48
|
flex: 1,
|
|
49
49
|
backgroundColor: Colors.background,
|
|
50
|
-
padding:
|
|
50
|
+
padding: 12,
|
|
51
51
|
},
|
|
52
52
|
input: {
|
|
53
53
|
flex: 1,
|
|
54
54
|
backgroundColor: Colors.surface,
|
|
55
|
-
borderRadius:
|
|
56
|
-
padding:
|
|
55
|
+
borderRadius: 12,
|
|
56
|
+
padding: 12,
|
|
57
57
|
fontSize: 14,
|
|
58
58
|
color: Colors.text,
|
|
59
59
|
lineHeight: 20,
|
|
60
60
|
},
|
|
61
61
|
footer: {
|
|
62
|
-
paddingTop:
|
|
62
|
+
paddingTop: 8,
|
|
63
63
|
minHeight: 36,
|
|
64
64
|
alignItems: 'flex-end',
|
|
65
65
|
},
|
|
@@ -71,7 +71,7 @@ const s = StyleSheet.create({
|
|
|
71
71
|
backgroundColor: Colors.background,
|
|
72
72
|
paddingHorizontal: 16,
|
|
73
73
|
paddingVertical: 6,
|
|
74
|
-
borderRadius:
|
|
74
|
+
borderRadius: 8,
|
|
75
75
|
},
|
|
76
76
|
copyBtnText: {
|
|
77
77
|
fontSize: 13,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { View, Text,
|
|
3
|
-
import { Colors } from '../utils/
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
3
|
+
import { Colors } from '../utils/colors';
|
|
4
4
|
import { safeStringify } from '../utils/safeStringify';
|
|
5
5
|
import { CollapsibleSection } from './shared/CollapsibleSection';
|
|
6
6
|
import { JsonView } from './shared/JsonView';
|
|
7
7
|
import { CopyButton } from './shared/CopyButton';
|
|
8
|
+
import { LogListScreen } from './shared/LogListScreen';
|
|
8
9
|
import { fmt } from '../utils/copyToComputer';
|
|
9
|
-
import { useSlideDetailAnimation } from '../hooks/useSlideDetailAnimation';
|
|
10
10
|
import type { ConsoleLogEntry, DebugFeatureRenderProps } from '../types';
|
|
11
11
|
|
|
12
12
|
const LEVEL_COLORS: Record<string, string> = {
|
|
@@ -23,14 +23,11 @@ const LEVEL_ICONS: Record<string, string> = {
|
|
|
23
23
|
error: '✕',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export const ConsoleLogTab: React.FC<DebugFeatureRenderProps<ConsoleLogEntry>> = React.memo(({
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const renderItem = ({ item }: { item: ConsoleLogEntry }) => (
|
|
33
|
-
<TouchableOpacity style={s.card} onPress={() => setSelected(item)} activeOpacity={0.6}>
|
|
26
|
+
export const ConsoleLogTab: React.FC<DebugFeatureRenderProps<ConsoleLogEntry>> = React.memo(({ data }) => (
|
|
27
|
+
<LogListScreen
|
|
28
|
+
data={data}
|
|
29
|
+
emptyText="No console logs"
|
|
30
|
+
renderRow={(item) => (
|
|
34
31
|
<View style={s.cardRow}>
|
|
35
32
|
<View style={[s.levelDot, { backgroundColor: LEVEL_COLORS[item.level] ?? '#8E8E93' }]}>
|
|
36
33
|
<Text style={s.levelIcon}>{LEVEL_ICONS[item.level] ?? '●'}</Text>
|
|
@@ -39,171 +36,60 @@ export const ConsoleLogTab: React.FC<DebugFeatureRenderProps<ConsoleLogEntry>> =
|
|
|
39
36
|
<Text style={s.logMessage} numberOfLines={2}>
|
|
40
37
|
{item.data.map((d) => (typeof d === 'string' ? d : safeStringify(d))).join(' ')}
|
|
41
38
|
</Text>
|
|
42
|
-
<Text style={s.time}>
|
|
43
|
-
{new Date(item.timestamp).toLocaleTimeString()}
|
|
44
|
-
</Text>
|
|
39
|
+
<Text style={s.time}>{new Date(item.timestamp).toLocaleTimeString()}</Text>
|
|
45
40
|
</View>
|
|
46
41
|
</View>
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
<View style={[s.levelBadge, { backgroundColor: LEVEL_COLORS[selected.level] ?? '#8E8E93' }]}>
|
|
82
|
-
<Text style={s.levelBadgeText}>{selected.level.toUpperCase()}</Text>
|
|
83
|
-
</View>
|
|
84
|
-
<Text style={s.detailTime}>
|
|
85
|
-
{new Date(selected.timestamp).toLocaleString()}
|
|
86
|
-
</Text>
|
|
87
|
-
</View>
|
|
88
|
-
<ScrollView style={s.detailBody} contentContainerStyle={s.detailBodyContent}>
|
|
89
|
-
{selected.data.map((item, index) => {
|
|
90
|
-
const formatted = typeof item === 'object' && item !== null
|
|
91
|
-
? fmt(item)
|
|
92
|
-
: String(item);
|
|
93
|
-
return (
|
|
94
|
-
<CollapsibleSection
|
|
95
|
-
key={index}
|
|
96
|
-
title={typeof item === 'object' && item !== null ? `Arg ${index + 1} (object)` : `Arg ${index + 1}`}
|
|
97
|
-
initiallyExpanded={index === 0}
|
|
98
|
-
>
|
|
99
|
-
<View style={s.sectionWithCopy}>
|
|
100
|
-
<CopyButton text={formatted} label={`Console Arg ${index + 1}`} />
|
|
101
|
-
{typeof item === 'object' && item !== null ? (
|
|
102
|
-
<JsonView data={item} maxHeight={250} />
|
|
103
|
-
) : (
|
|
104
|
-
<Text style={s.plainText} selectable>{String(item)}</Text>
|
|
105
|
-
)}
|
|
106
|
-
</View>
|
|
107
|
-
</CollapsibleSection>
|
|
108
|
-
);
|
|
109
|
-
})}
|
|
110
|
-
</ScrollView>
|
|
111
|
-
</Animated.View>
|
|
112
|
-
)}
|
|
113
|
-
</View>
|
|
114
|
-
);
|
|
115
|
-
});
|
|
42
|
+
)}
|
|
43
|
+
renderDetailHeader={(item) => (
|
|
44
|
+
<>
|
|
45
|
+
<View style={[s.levelBadge, { backgroundColor: LEVEL_COLORS[item.level] ?? '#8E8E93' }]}>
|
|
46
|
+
<Text style={s.levelBadgeText}>{item.level.toUpperCase()}</Text>
|
|
47
|
+
</View>
|
|
48
|
+
<Text style={s.detailTime}>{new Date(item.timestamp).toLocaleString()}</Text>
|
|
49
|
+
</>
|
|
50
|
+
)}
|
|
51
|
+
renderDetailBody={(item) => (
|
|
52
|
+
<ScrollView style={s.detailBody} contentContainerStyle={s.detailBodyContent}>
|
|
53
|
+
{item.data.map((d, index) => {
|
|
54
|
+
const formatted = typeof d === 'object' && d !== null ? fmt(d) : String(d);
|
|
55
|
+
return (
|
|
56
|
+
<CollapsibleSection
|
|
57
|
+
key={index}
|
|
58
|
+
title={typeof d === 'object' && d !== null ? `Arg ${index + 1} (object)` : `Arg ${index + 1}`}
|
|
59
|
+
initiallyExpanded={index === 0}
|
|
60
|
+
>
|
|
61
|
+
<View style={s.sectionWithCopy}>
|
|
62
|
+
<CopyButton text={formatted} label={`Console Arg ${index + 1}`} />
|
|
63
|
+
{typeof d === 'object' && d !== null ? (
|
|
64
|
+
<JsonView data={d} maxHeight={250} />
|
|
65
|
+
) : (
|
|
66
|
+
<Text style={s.plainText} selectable>{String(d)}</Text>
|
|
67
|
+
)}
|
|
68
|
+
</View>
|
|
69
|
+
</CollapsibleSection>
|
|
70
|
+
);
|
|
71
|
+
})}
|
|
72
|
+
</ScrollView>
|
|
73
|
+
)}
|
|
74
|
+
/>
|
|
75
|
+
));
|
|
116
76
|
|
|
117
77
|
const s = StyleSheet.create({
|
|
118
|
-
container: { flex: 1, backgroundColor: Colors.background },
|
|
119
|
-
listWrap: {
|
|
120
|
-
position: 'absolute',
|
|
121
|
-
top: 0,
|
|
122
|
-
left: 0,
|
|
123
|
-
right: 0,
|
|
124
|
-
bottom: 0,
|
|
125
|
-
},
|
|
126
|
-
listContent: { padding: 12 },
|
|
127
|
-
|
|
128
|
-
// Empty
|
|
129
|
-
emptyContainer: { flex: 1, alignItems: 'center', justifyContent: 'center' },
|
|
130
|
-
emptyIcon: { fontSize: 40, color: Colors.textLight, marginBottom: 4 },
|
|
131
|
-
empty: { textAlign: 'center', color: Colors.textLight, fontSize: 14 },
|
|
132
|
-
|
|
133
|
-
// Card
|
|
134
|
-
card: {
|
|
135
|
-
backgroundColor: Colors.surface,
|
|
136
|
-
borderRadius: 12,
|
|
137
|
-
marginBottom: 8,
|
|
138
|
-
overflow: 'hidden',
|
|
139
|
-
},
|
|
140
78
|
cardRow: { flexDirection: 'row', padding: 14, alignItems: 'flex-start' },
|
|
141
79
|
levelDot: {
|
|
142
|
-
width: 24,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
justifyContent: 'center',
|
|
147
|
-
marginRight: 12,
|
|
148
|
-
marginTop: 1,
|
|
80
|
+
width: 24, height: 24, borderRadius: 12,
|
|
81
|
+
alignItems: 'center', justifyContent: 'center',
|
|
82
|
+
marginRight: 12, marginTop: 1,
|
|
149
83
|
},
|
|
150
84
|
levelIcon: { color: '#FFF', fontSize: 11, fontWeight: '700' },
|
|
151
85
|
cardContent: { flex: 1 },
|
|
152
86
|
logMessage: { fontSize: 14, color: Colors.text, lineHeight: 20 },
|
|
153
87
|
time: { fontSize: 12, color: Colors.textSecondary, marginTop: 4 },
|
|
154
|
-
|
|
155
|
-
// Detail (in-panel navigation)
|
|
156
|
-
detailWrap: {
|
|
157
|
-
position: 'absolute',
|
|
158
|
-
top: 0,
|
|
159
|
-
left: 0,
|
|
160
|
-
right: 0,
|
|
161
|
-
bottom: 0,
|
|
162
|
-
backgroundColor: Colors.background,
|
|
163
|
-
},
|
|
164
|
-
detailHeader: {
|
|
165
|
-
flexDirection: 'row',
|
|
166
|
-
alignItems: 'center',
|
|
167
|
-
paddingHorizontal: 8,
|
|
168
|
-
paddingVertical: 10,
|
|
169
|
-
backgroundColor: Colors.surface,
|
|
170
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
171
|
-
borderBottomColor: Colors.border,
|
|
172
|
-
gap: 6,
|
|
173
|
-
},
|
|
174
|
-
backBtn: {
|
|
175
|
-
flexDirection: 'row',
|
|
176
|
-
alignItems: 'center',
|
|
177
|
-
paddingHorizontal: 6,
|
|
178
|
-
paddingVertical: 4,
|
|
179
|
-
borderRadius: 8,
|
|
180
|
-
},
|
|
181
|
-
backIcon: {
|
|
182
|
-
fontSize: 24,
|
|
183
|
-
fontWeight: '300',
|
|
184
|
-
color: Colors.primary,
|
|
185
|
-
marginTop: -2,
|
|
186
|
-
marginRight: 2,
|
|
187
|
-
},
|
|
188
|
-
backText: {
|
|
189
|
-
fontSize: 16,
|
|
190
|
-
color: Colors.primary,
|
|
191
|
-
fontWeight: '500',
|
|
192
|
-
},
|
|
193
|
-
levelBadge: {
|
|
194
|
-
paddingHorizontal: 10,
|
|
195
|
-
paddingVertical: 4,
|
|
196
|
-
borderRadius: 6,
|
|
197
|
-
},
|
|
88
|
+
levelBadge: { paddingHorizontal: 10, paddingVertical: 4, borderRadius: 6 },
|
|
198
89
|
levelBadgeText: { color: '#FFF', fontSize: 12, fontWeight: '700' },
|
|
199
90
|
detailTime: { flex: 1, fontSize: 13, color: Colors.textSecondary, textAlign: 'right' },
|
|
200
91
|
detailBody: { flex: 1 },
|
|
201
92
|
detailBodyContent: { padding: 12 },
|
|
202
93
|
sectionWithCopy: { gap: 8 },
|
|
203
|
-
plainText: {
|
|
204
|
-
fontFamily: 'Courier',
|
|
205
|
-
fontSize: 13,
|
|
206
|
-
color: Colors.text,
|
|
207
|
-
lineHeight: 20,
|
|
208
|
-
},
|
|
94
|
+
plainText: { fontFamily: 'Courier', fontSize: 13, color: Colors.text, lineHeight: 20 },
|
|
209
95
|
});
|