react-native-inapp-inspector 2.5.11 → 2.5.13
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.ar.md +0 -8
- package/README.de.md +0 -8
- package/README.es.md +0 -8
- package/README.fr.md +0 -8
- package/README.hi.md +0 -8
- package/README.ja.md +0 -8
- package/README.ko.md +0 -8
- package/README.md +54 -26
- package/README.pt-BR.md +0 -8
- package/README.ru.md +0 -8
- package/README.zh-CN.md +0 -8
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +379 -19
- package/android/src/main/res/xml/inappinspector_file_paths.xml +7 -0
- package/dist/commonjs/components/ConsoleLogCard.js +32 -26
- package/dist/commonjs/components/Inspector/AboutModal.js +1 -4
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +47 -49
- package/dist/commonjs/components/Inspector/BoxModelVisualizer.d.ts +8 -0
- package/dist/commonjs/components/Inspector/BoxModelVisualizer.js +76 -0
- package/dist/commonjs/components/Inspector/ConsoleExportModal.js +51 -51
- package/dist/commonjs/components/Inspector/ConsoleTab.js +19 -14
- package/dist/commonjs/components/Inspector/CrashTab.js +17 -17
- package/dist/commonjs/components/Inspector/DebuggingTab.js +24 -24
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +2 -2
- package/dist/commonjs/components/Inspector/FabLauncher.js +2 -2
- package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +2 -2
- package/dist/commonjs/components/Inspector/InspectorHeader.js +15 -15
- package/dist/commonjs/components/Inspector/MainScreen.js +9 -6
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +187 -90
- package/dist/commonjs/components/Inspector/MediaPreviewModal.d.ts +1 -0
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +222 -222
- package/dist/commonjs/components/Inspector/NetworkDetail.js +11 -8
- package/dist/commonjs/components/Inspector/NetworkExportModal.d.ts +10 -0
- package/dist/commonjs/components/Inspector/NetworkExportModal.js +333 -0
- package/dist/commonjs/components/Inspector/NetworkTab.js +48 -42
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +11 -12
- package/dist/commonjs/components/Inspector/PerformanceTab.d.ts +2 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +652 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.js +17 -19
- package/dist/commonjs/components/Inspector/ReduxTab.js +5 -5
- package/dist/commonjs/components/Inspector/SettingsPanel.js +259 -255
- package/dist/commonjs/components/Inspector/SocketCard.js +2 -2
- package/dist/commonjs/components/Inspector/SupportPage.js +5 -5
- package/dist/commonjs/components/Inspector/TabBar.js +17 -16
- package/dist/commonjs/components/Inspector/UiA11yAuditPanel.d.ts +7 -0
- package/dist/commonjs/components/Inspector/UiA11yAuditPanel.js +97 -0
- package/dist/commonjs/components/Inspector/UiInspectorDetail.d.ts +2 -0
- package/dist/commonjs/components/Inspector/UiInspectorDetail.js +485 -0
- package/dist/commonjs/components/Inspector/UiInspectorOverlay.d.ts +2 -0
- package/dist/commonjs/components/Inspector/UiInspectorOverlay.js +199 -0
- package/dist/commonjs/components/Inspector/UiInspectorTab.d.ts +2 -0
- package/dist/commonjs/components/Inspector/UiInspectorTab.js +117 -0
- package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.d.ts +10 -0
- package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.js +148 -0
- package/dist/commonjs/components/Inspector/index.d.ts +28 -0
- package/dist/commonjs/components/Inspector/index.js +1 -0
- package/dist/commonjs/components/LogCard.js +15 -10
- package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
- package/dist/commonjs/components/NetworkIcons.js +35 -3
- package/dist/commonjs/constants/index.d.ts +1 -0
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.d.ts +1 -1
- package/dist/commonjs/customHooks/crashHandler.js +6 -6
- package/dist/commonjs/customHooks/uiInspectorManager.d.ts +22 -0
- package/dist/commonjs/customHooks/uiInspectorManager.js +1 -0
- package/dist/commonjs/helpers/index.d.ts +3 -0
- package/dist/commonjs/helpers/index.js +6 -6
- package/dist/commonjs/helpers/performanceSampler.d.ts +88 -0
- package/dist/commonjs/helpers/performanceSampler.js +1 -0
- package/dist/commonjs/helpers/remoteConfig.d.ts +0 -2
- package/dist/commonjs/helpers/remoteConfig.js +1 -1
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -0
- package/dist/commonjs/helpers/searchQueryParser.js +7 -5
- package/dist/commonjs/helpers/shareFormatter.d.ts +16 -0
- package/dist/commonjs/helpers/shareFormatter.js +16 -9
- package/dist/commonjs/helpers/uiInspectorEngine.d.ts +62 -0
- package/dist/commonjs/helpers/uiInspectorEngine.js +19 -0
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -1
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -1
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -1
- package/dist/commonjs/i18n/locales/it.json +1 -1
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -1
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -1
- package/dist/commonjs/i18n/locales/mr.json +1 -1
- package/dist/commonjs/i18n/locales/nl.json +1 -1
- package/dist/commonjs/i18n/locales/pa.json +1 -1
- package/dist/commonjs/i18n/locales/pl.json +1 -1
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -1
- package/dist/commonjs/i18n/locales/te.json +1 -1
- package/dist/commonjs/i18n/locales/tr.json +1 -1
- package/dist/commonjs/i18n/locales/vi.json +1 -1
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +6 -4
- package/dist/commonjs/index.js +3 -3
- package/dist/commonjs/native/NativeInspector.d.ts +2 -0
- package/dist/commonjs/native/NativeInspector.js +1 -1
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +2 -0
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/editor.d.ts +31 -0
- package/dist/commonjs/types/enums.d.ts +1 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +8 -0
- package/dist/esm/components/ConsoleLogCard.js +67 -61
- package/dist/esm/components/Inspector/AboutModal.js +14 -17
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +73 -75
- package/dist/esm/components/Inspector/BoxModelVisualizer.d.ts +8 -0
- package/dist/esm/components/Inspector/BoxModelVisualizer.js +76 -0
- package/dist/esm/components/Inspector/ConsoleExportModal.js +67 -67
- package/dist/esm/components/Inspector/ConsoleTab.js +33 -28
- package/dist/esm/components/Inspector/CrashTab.js +58 -58
- package/dist/esm/components/Inspector/DebuggingTab.js +89 -89
- package/dist/esm/components/Inspector/DeviceInfoTab.js +2 -2
- package/dist/esm/components/Inspector/FabLauncher.js +21 -21
- package/dist/esm/components/Inspector/FloatingCaptureWidget.js +23 -23
- package/dist/esm/components/Inspector/InspectorHeader.js +31 -31
- package/dist/esm/components/Inspector/MainScreen.js +61 -58
- package/dist/esm/components/Inspector/MediaGalleryTab.js +244 -147
- package/dist/esm/components/Inspector/MediaPreviewModal.d.ts +1 -0
- package/dist/esm/components/Inspector/MediaPreviewModal.js +468 -468
- package/dist/esm/components/Inspector/NetworkDetail.js +62 -59
- package/dist/esm/components/Inspector/NetworkExportModal.d.ts +10 -0
- package/dist/esm/components/Inspector/NetworkExportModal.js +333 -0
- package/dist/esm/components/Inspector/NetworkTab.js +76 -70
- package/dist/esm/components/Inspector/NpmStarPrompt.js +32 -33
- package/dist/esm/components/Inspector/PerformanceTab.d.ts +2 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +652 -0
- package/dist/esm/components/Inspector/ReduxDetail.js +54 -56
- package/dist/esm/components/Inspector/ReduxTab.js +9 -9
- package/dist/esm/components/Inspector/SettingsPanel.js +302 -298
- package/dist/esm/components/Inspector/SocketCard.js +13 -13
- package/dist/esm/components/Inspector/SupportPage.js +5 -5
- package/dist/esm/components/Inspector/TabBar.js +4 -3
- package/dist/esm/components/Inspector/UiA11yAuditPanel.d.ts +7 -0
- package/dist/esm/components/Inspector/UiA11yAuditPanel.js +97 -0
- package/dist/esm/components/Inspector/UiInspectorDetail.d.ts +2 -0
- package/dist/esm/components/Inspector/UiInspectorDetail.js +422 -0
- package/dist/esm/components/Inspector/UiInspectorOverlay.d.ts +2 -0
- package/dist/esm/components/Inspector/UiInspectorOverlay.js +138 -0
- package/dist/esm/components/Inspector/UiInspectorTab.d.ts +2 -0
- package/dist/esm/components/Inspector/UiInspectorTab.js +117 -0
- package/dist/esm/components/Inspector/UiLiveStyleTweaker.d.ts +10 -0
- package/dist/esm/components/Inspector/UiLiveStyleTweaker.js +148 -0
- package/dist/esm/components/Inspector/index.d.ts +28 -0
- package/dist/esm/components/Inspector/index.js +1 -0
- package/dist/esm/components/LogCard.js +60 -55
- package/dist/esm/components/NetworkIcons.d.ts +6 -0
- package/dist/esm/components/NetworkIcons.js +32 -0
- package/dist/esm/constants/index.d.ts +1 -0
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/crashHandler.d.ts +1 -1
- package/dist/esm/customHooks/crashHandler.js +6 -6
- package/dist/esm/customHooks/uiInspectorManager.d.ts +22 -0
- package/dist/esm/customHooks/uiInspectorManager.js +1 -0
- package/dist/esm/helpers/index.d.ts +3 -0
- package/dist/esm/helpers/index.js +6 -6
- package/dist/esm/helpers/performanceSampler.d.ts +88 -0
- package/dist/esm/helpers/performanceSampler.js +1 -0
- package/dist/esm/helpers/remoteConfig.d.ts +0 -2
- package/dist/esm/helpers/remoteConfig.js +1 -1
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -0
- package/dist/esm/helpers/searchQueryParser.js +7 -5
- package/dist/esm/helpers/shareFormatter.d.ts +16 -0
- package/dist/esm/helpers/shareFormatter.js +20 -13
- package/dist/esm/helpers/uiInspectorEngine.d.ts +48 -0
- package/dist/esm/helpers/uiInspectorEngine.js +19 -0
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -1
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -1
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -1
- package/dist/esm/i18n/locales/it.json +1 -1
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -1
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -1
- package/dist/esm/i18n/locales/mr.json +1 -1
- package/dist/esm/i18n/locales/nl.json +1 -1
- package/dist/esm/i18n/locales/pa.json +1 -1
- package/dist/esm/i18n/locales/pl.json +1 -1
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -1
- package/dist/esm/i18n/locales/te.json +1 -1
- package/dist/esm/i18n/locales/tr.json +1 -1
- package/dist/esm/i18n/locales/vi.json +1 -1
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +6 -4
- package/dist/esm/index.js +8 -8
- package/dist/esm/native/NativeInspector.d.ts +2 -0
- package/dist/esm/native/NativeInspector.js +1 -1
- package/dist/esm/native/NativeNetworkInspector.d.ts +2 -0
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/editor.d.ts +31 -0
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +8 -0
- package/ios/NetworkInspectorModule.mm +314 -16
- package/package.json +24 -1
- package/src/native/NativeInspector.ts +37 -0
- package/src/native/NativeNetworkInspector.ts +2 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/results.bin +0 -1
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/BuildConfig.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/InAppInspectorFloatingView$iconView$1.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/InAppInspectorFloatingView.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NativeNetworkInspectorSpec.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorModule$Companion.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorModule$activityEventListener$1.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorModule$frameCallback$1.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorModule$getCapturedMedia$lambda$57$$inlined$sortedByDescending$1.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorModule$shakeListener$1.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorModule$startVideoRecording$2$1.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorModule.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/inappinspector/NetworkInspectorPackage.dex +0 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/c93e459e24d856bde563ebb048265732/results.bin +0 -1
- package/android/build/.transforms/c93e459e24d856bde563ebb048265732/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/inappinspector/BuildConfig.java +0 -10
- package/android/build/generated/source/codegen/java/com/inappinspector/NativeNetworkInspectorSpec.java +0 -160
- package/android/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
- package/android/build/generated/source/codegen/jni/RNInAppInspectorSpec-generated.cpp +0 -212
- package/android/build/generated/source/codegen/jni/RNInAppInspectorSpec.h +0 -31
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ComponentDescriptors.cpp +0 -22
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ComponentDescriptors.h +0 -24
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/EventEmitters.cpp +0 -16
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/EventEmitters.h +0 -17
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/Props.cpp +0 -19
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/Props.h +0 -18
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/RNInAppInspectorSpecJSI.h +0 -300
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ShadowNodes.cpp +0 -17
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ShadowNodes.h +0 -23
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/States.cpp +0 -16
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/States.h +0 -20
- package/android/build/generated/source/codegen/schema.json +0 -1
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/react-native-inapp-inspector_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/inappinspector/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/inappinspector/NativeNetworkInspectorSpec.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/react-native-inapp-inspector_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/InAppInspectorFloatingView$iconView$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/InAppInspectorFloatingView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NativeNetworkInspectorSpec.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorModule$activityEventListener$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorModule$frameCallback$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorModule$getCapturedMedia$lambda$57$$inlined$sortedByDescending$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorModule$shakeListener$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorModule$startVideoRecording$2$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/inappinspector/NetworkInspectorPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
- package/android/build/reports/problems/problems-report.html +0 -659
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-inapp-inspector_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/InAppInspectorFloatingView$iconView$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/InAppInspectorFloatingView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorModule$activityEventListener$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorModule$frameCallback$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorModule$getCapturedMedia$lambda$57$$inlined$sortedByDescending$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorModule$shakeListener$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorModule$startVideoRecording$2$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/inappinspector/NetworkInspectorPackage.class +0 -0
- package/dist/commonjs/a11y.d.ts +0 -2
- package/dist/commonjs/a11y.js +0 -1
- package/dist/commonjs/components/Inspector/A11yTab.d.ts +0 -2
- package/dist/commonjs/components/Inspector/A11yTab.js +0 -268
- package/dist/commonjs/components/Inspector/DeveloperSponsorCard.d.ts +0 -9
- package/dist/commonjs/components/Inspector/DeveloperSponsorCard.js +0 -52
- package/dist/commonjs/customHooks/a11yAdapter.d.ts +0 -11
- package/dist/commonjs/customHooks/a11yAdapter.js +0 -1
- package/dist/commonjs/helpers/sponsorService.d.ts +0 -20
- package/dist/commonjs/helpers/sponsorService.js +0 -1
- package/dist/esm/a11y.d.ts +0 -2
- package/dist/esm/a11y.js +0 -1
- package/dist/esm/components/Inspector/A11yTab.d.ts +0 -2
- package/dist/esm/components/Inspector/A11yTab.js +0 -268
- package/dist/esm/components/Inspector/DeveloperSponsorCard.d.ts +0 -9
- package/dist/esm/components/Inspector/DeveloperSponsorCard.js +0 -52
- package/dist/esm/customHooks/a11yAdapter.d.ts +0 -11
- package/dist/esm/customHooks/a11yAdapter.js +0 -1
- package/dist/esm/helpers/sponsorService.d.ts +0 -20
- package/dist/esm/helpers/sponsorService.js +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface FrameSample {
|
|
2
|
+
timestamp: number;
|
|
3
|
+
durationMs: number;
|
|
4
|
+
fps: number;
|
|
5
|
+
isJank: boolean;
|
|
6
|
+
isFrozen: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface JankEvent {
|
|
9
|
+
id: string;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
timeStr: string;
|
|
12
|
+
durationMs: number;
|
|
13
|
+
fps: number;
|
|
14
|
+
severity: 'moderate' | 'severe' | 'frozen';
|
|
15
|
+
}
|
|
16
|
+
export interface MemoryStats {
|
|
17
|
+
usedHeapMb: number;
|
|
18
|
+
totalAllocMb: number;
|
|
19
|
+
peakHeapMb: number;
|
|
20
|
+
engine: string;
|
|
21
|
+
isAvailable: boolean;
|
|
22
|
+
gcCount?: number;
|
|
23
|
+
gcTimeMs?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface PercentileStats {
|
|
26
|
+
p50Ms: number;
|
|
27
|
+
p90Ms: number;
|
|
28
|
+
p95Ms: number;
|
|
29
|
+
p99Ms: number;
|
|
30
|
+
}
|
|
31
|
+
export interface BucketDistribution {
|
|
32
|
+
ultraSmoothCount: number;
|
|
33
|
+
smoothCount: number;
|
|
34
|
+
degradedCount: number;
|
|
35
|
+
stutteredCount: number;
|
|
36
|
+
frozenCount: number;
|
|
37
|
+
totalSamples: number;
|
|
38
|
+
}
|
|
39
|
+
export interface EngineDetails {
|
|
40
|
+
engineName: string;
|
|
41
|
+
isHermes: boolean;
|
|
42
|
+
isFabric: boolean;
|
|
43
|
+
isTurboModules: boolean;
|
|
44
|
+
architectureName: string;
|
|
45
|
+
gcCollections?: number;
|
|
46
|
+
gcCpuTimeMs?: number;
|
|
47
|
+
heapUsedMb: number;
|
|
48
|
+
heapTotalMb: number;
|
|
49
|
+
peakHeapMb: number;
|
|
50
|
+
}
|
|
51
|
+
export interface LivePerformanceData {
|
|
52
|
+
fps: number;
|
|
53
|
+
avgFps: number;
|
|
54
|
+
minFps: number;
|
|
55
|
+
maxFps: number;
|
|
56
|
+
frameDurationMs: number;
|
|
57
|
+
refreshRateHz: number;
|
|
58
|
+
jankCount: number;
|
|
59
|
+
frozenCount: number;
|
|
60
|
+
jankPercent: number;
|
|
61
|
+
apdexScore: number;
|
|
62
|
+
apdexStatus: 'EXCELLENT' | 'GOOD' | 'FAIR' | 'POOR';
|
|
63
|
+
satisfiedCount: number;
|
|
64
|
+
toleratingCount: number;
|
|
65
|
+
frustratedCount: number;
|
|
66
|
+
longTaskCount: number;
|
|
67
|
+
percentiles: PercentileStats;
|
|
68
|
+
budgetUsedPercent: number;
|
|
69
|
+
budgetHeadroomMs: number;
|
|
70
|
+
distribution: BucketDistribution;
|
|
71
|
+
engineDetails: EngineDetails;
|
|
72
|
+
jsEventLoopLagMs: number;
|
|
73
|
+
avgJsLagMs: number;
|
|
74
|
+
peakJsLagMs: number;
|
|
75
|
+
healthScore: number;
|
|
76
|
+
healthStatus: 'EXCELLENT' | 'GOOD' | 'FAIR' | 'POOR';
|
|
77
|
+
frameHistory: number[];
|
|
78
|
+
jsLagHistory: number[];
|
|
79
|
+
recentJanks: JankEvent[];
|
|
80
|
+
memory: MemoryStats;
|
|
81
|
+
sessionDurationSec: number;
|
|
82
|
+
isStressTesting: boolean;
|
|
83
|
+
runJsStressTest: (durationMs?: number) => void;
|
|
84
|
+
runRenderStressTest: () => void;
|
|
85
|
+
triggerGC: () => void;
|
|
86
|
+
resetStats: () => void;
|
|
87
|
+
}
|
|
88
|
+
export declare const usePerformanceMonitor: (active?: boolean) => LivePerformanceData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.usePerformanceMonitor=void 0;const react_1=require("react"),usePerformanceMonitor=(l=!0)=>{const y=(0,react_1.useRef)(0),L=(0,react_1.useRef)(0),b=(0,react_1.useRef)([]),S=(0,react_1.useRef)([]),R=(0,react_1.useRef)(0),F=(0,react_1.useRef)(0),T=(0,react_1.useRef)(0),H=(0,react_1.useRef)(0),D=(0,react_1.useRef)(0),E=(0,react_1.useRef)(0),J=(0,react_1.useRef)(0),j=(0,react_1.useRef)(0),I=(0,react_1.useRef)(0),v=(0,react_1.useRef)(0),d=(0,react_1.useRef)([]),x=(0,react_1.useRef)(null),C=(0,react_1.useRef)(null),z=(0,react_1.useRef)(null),B=(0,react_1.useRef)(null),p=(0,react_1.useCallback)(()=>{const e=!!global.HermesInternal,u=!!global._v8runtime,t=typeof global.nativeFabricUIManager<"u"||!!global.__turboModuleProxy,r=`${e?"Hermes":u?"V8 Engine":"JavaScriptCore"} \u2022 ${t?"Fabric":"Paper"}`;let s=0,a=0,i=!1,m,A;try{const k=global.HermesInternal;if(k?.getInstrumentedStats){const n=k.getInstrumentedStats();if(n&&typeof n=="object"){const c=n.js_heap_size??n.heapSize??n["js.heap_size"]??n.js_allocated_bytes??0,w=n.js_allocated_bytes??n.allocatedBytes??n["js.allocated_bytes"]??n.totalAllocatedBytes??c;(c>0||w>0)&&(s=Number((c/(1024*1024)).toFixed(2)),a=Number((w/(1024*1024)).toFixed(2)),m=n.gc_num_collections??n.num_gc_collections??n["gc.num_collections"],A=n.gc_cpu_time??n.gc_time??n["gc.cpu_time"],i=!0)}}else if(global.performance?.memory?.usedJSHeapSize){const n=global.performance.memory;s=Number((n.usedJSHeapSize/(1024*1024)).toFixed(2)),a=Number((n.totalJSHeapSize/(1024*1024)).toFixed(2)),i=!0}}catch{}const _=H?.current||0,h=Math.max(_,s);return H&&(H.current=h),{usedHeapMb:s,totalAllocMb:a,peakHeapMb:h,engine:r,isAvailable:i,gcCount:m,gcTimeMs:A}},[]),[Me,V]=(0,react_1.useState)(60),[he,G]=(0,react_1.useState)(60),[be,X]=(0,react_1.useState)(60),[Se,K]=(0,react_1.useState)(60),[Re,O]=(0,react_1.useState)(16.6),[Fe,rt]=(0,react_1.useState)(60),[xe,Q]=(0,react_1.useState)(0),[Ce,W]=(0,react_1.useState)(0),[_e,Y]=(0,react_1.useState)(0),[M,Z]=(0,react_1.useState)(1),[ke,ee]=(0,react_1.useState)(0),[ye,te]=(0,react_1.useState)(0),[Le,ne]=(0,react_1.useState)(0),[U,re]=(0,react_1.useState)(0),[Te,He]=(0,react_1.useState)({p50Ms:16.6,p90Ms:16.6,p95Ms:16.6,p99Ms:16.6}),[Ie,ve]=(0,react_1.useState)(100),[Ne,Pe]=(0,react_1.useState)(0),[Ae,we]=(0,react_1.useState)({ultraSmoothCount:0,smoothCount:0,degradedCount:0,stutteredCount:0,frozenCount:0,totalSamples:0}),[De,se]=(0,react_1.useState)(0),[Ee,oe]=(0,react_1.useState)(0),[Je,ae]=(0,react_1.useState)(0),[je,ue]=(0,react_1.useState)(()=>Array(45).fill(16.6)),[ze,ce]=(0,react_1.useState)(()=>Array(25).fill(0)),[Be,ie]=(0,react_1.useState)([]),[Oe,N]=(0,react_1.useState)(!1),[Ue,le]=(0,react_1.useState)(0),[g,$]=(0,react_1.useState)(()=>p()),$e=(0,react_1.useMemo)(()=>{const e=!!global.HermesInternal,u=!!global._v8runtime,t=typeof global.nativeFabricUIManager<"u"||!!global.__turboModuleProxy,o=!!global.__turboModuleProxy;return{engineName:e?"Hermes":u?"V8 Engine":"JavaScriptCore",isHermes:e,isFabric:t,isTurboModules:o,architectureName:t?"Fabric (New Architecture)":"Paper (Legacy)",heapUsedMb:g.usedHeapMb,heapTotalMb:g.totalAllocMb,peakHeapMb:g.peakHeapMb,gcCollections:g.gcCount,gcCpuTimeMs:g.gcTimeMs}},[g]);(0,react_1.useEffect)(()=>{if(!l)return;let e=!0,u=6;y.current=performance.now();const t=o=>{if(!e)return;if(u>0){y.current=o,u--,x.current=requestAnimationFrame(t);return}const r=o-y.current;if(y.current=o,r>0&&r<800){L.current++;const s=Math.min(60,Math.max(1,Math.round(1e3/Math.max(16,r)))),a=Number(r.toFixed(1));if(r<=18.5)D.current++;else if(r<=66.6){if(E.current++,I.current++,r>36){const i={id:`jank_${Date.now()}_${Math.random().toString(36).substring(2,6)}`,timestamp:Date.now(),timeStr:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),durationMs:a,fps:s,severity:"moderate"};d.current=[i,...d.current.slice(0,19)]}}else{J.current++,v.current++;const i={id:`jank_${Date.now()}_${Math.random().toString(36).substring(2,6)}`,timestamp:Date.now(),timeStr:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),durationMs:a,fps:s,severity:"frozen"};d.current=[i,...d.current.slice(0,19)]}b.current.push(a),b.current.length>45&&b.current.shift(),L.current===1?(R.current=s,F.current=s):(s<R.current&&s>=15&&(R.current=s),s>F.current&&(F.current=s))}x.current=requestAnimationFrame(t)};return x.current=requestAnimationFrame(t),()=>{e=!1,x.current&&cancelAnimationFrame(x.current)}},[l]),(0,react_1.useEffect)(()=>{if(!l)return;const e=30;let u=performance.now()+e,t=5;const o=()=>{const r=performance.now(),s=r-u;if(u=r+e,t>0){t--,C.current=setTimeout(o,e);return}const a=Math.max(0,Number((s-8).toFixed(1)));a>T.current&&(T.current=a),a>=50&&j.current++,S.current.push(a),S.current.length>30&&S.current.shift(),C.current=setTimeout(o,e)};return C.current=setTimeout(o,e),()=>{C.current&&clearTimeout(C.current)}},[l]),(0,react_1.useEffect)(()=>{if(!l)return;const u=setInterval(()=>{const t=b.current,o=S.current;if(t.length>0){const r=t[t.length-1]??16.6,a=t.reduce((f,q)=>f+q,0)/t.length,i=Math.min(60,Math.max(1,Math.round(1e3/Math.max(16,a)))),m=Math.min(60,Math.max(1,Math.round(1e3/Math.max(16,r))));V(m),G(i),O(r),ue([...t]),X(R.current||m),K(F.current||m);const A=Math.max(1,L.current),_=D.current,h=E.current,k=J.current,n=Number(((_+h/2)/Math.max(1,_+h+k)).toFixed(2));Z(Math.max(0,Math.min(1,n))),ee(_),te(h),ne(k),re(j.current);const c=[...t].sort((f,q)=>f-q),w=c[Math.floor(c.length*.5)]??16.6,We=c[Math.floor(c.length*.9)]??16.6,Ye=c[Math.floor(c.length*.95)]??16.6,Ze=c[Math.floor(c.length*.99)]??16.6;He({p50Ms:Number(w.toFixed(1)),p90Ms:Number(We.toFixed(1)),p95Ms:Number(Ye.toFixed(1)),p99Ms:Number(Ze.toFixed(1))});const et=Math.min(250,Number((r/16.6*100).toFixed(0))),tt=Number(Math.max(0,16.6-r).toFixed(1));ve(et),Pe(tt);let me=0,fe=0,ge=0,de=0,pe=0;for(const f of t)f<=16.6?me++:f<=24?fe++:f<=34?ge++:f<=66.6?de++:pe++;we({ultraSmoothCount:me,smoothCount:fe,degradedCount:ge,stutteredCount:de,frozenCount:pe,totalSamples:t.length});const nt=Number(((I.current+v.current)/A*100).toFixed(1));Y(nt),Q(I.current),W(v.current),ie([...d.current])}if(o.length>0){const r=o[o.length-1]??0,s=o.reduce((i,m)=>i+m,0),a=Number((s/o.length).toFixed(1));se(r),oe(a),ae(T.current),ce([...o])}},300);return()=>{clearInterval(u)}},[l]),(0,react_1.useEffect)(()=>{if(l)return z.current=setInterval(()=>{$(p())},1500),B.current=setInterval(()=>{le(e=>e+1)},1e3),()=>{z.current&&clearInterval(z.current),B.current&&clearInterval(B.current)}},[l,p]);const P=(0,react_1.useMemo)(()=>{const e=Math.round(M*100-Math.min(U*2,10));return Math.max(0,Math.min(100,e))},[M,U]),qe=P>=88?"EXCELLENT":P>=72?"GOOD":P>=55?"FAIR":"POOR",Ve=M>=.94?"EXCELLENT":M>=.85?"GOOD":M>=.7?"FAIR":"POOR",Ge=(0,react_1.useCallback)((e=120)=>{N(!0),setTimeout(()=>{const u=performance.now();for(;performance.now()-u<e;)Math.sqrt(Math.random()*1e6);N(!1)},50)},[]),Xe=(0,react_1.useCallback)(()=>{N(!0);let e=0;const u=setInterval(()=>{e++,O(t=>Number((t+.1).toFixed(1))),e>25&&(clearInterval(u),N(!1))},16)},[]),Ke=(0,react_1.useCallback)(()=>{try{const e=global.HermesInternal;e?.gc?e.gc():global.gc&&global.gc(),setTimeout(()=>{$(p())},200)}catch{}},[]),Qe=(0,react_1.useCallback)(()=>{L.current=0,D.current=0,E.current=0,J.current=0,j.current=0,I.current=0,v.current=0,R.current=0,F.current=0,T.current=0,H.current=0,b.current=[],S.current=[],d.current=[],V(60),G(60),X(60),K(60),O(16.6),Z(1),ee(0),te(0),ne(0),re(0),Q(0),W(0),Y(0),se(0),oe(0),ae(0),ue(Array(45).fill(16.6)),ce(Array(25).fill(0)),ie([]),le(0),$(p())},[p]);return{fps:Me,avgFps:he,minFps:be,maxFps:Se,frameDurationMs:Re,refreshRateHz:Fe,jankCount:xe,frozenCount:Ce,jankPercent:_e,apdexScore:M,apdexStatus:Ve,satisfiedCount:ke,toleratingCount:ye,frustratedCount:Le,longTaskCount:U,percentiles:Te,budgetUsedPercent:Ie,budgetHeadroomMs:Ne,distribution:Ae,engineDetails:$e,jsEventLoopLagMs:De,avgJsLagMs:Ee,peakJsLagMs:Je,healthScore:P,healthStatus:qe,frameHistory:je,jsLagHistory:ze,recentJanks:Be,memory:g,sessionDurationSec:Ue,isStressTesting:Oe,runJsStressTest:Ge,runRenderStressTest:Xe,triggerGC:Ke,resetStats:Qe}};exports.usePerformanceMonitor=usePerformanceMonitor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFirebaseRemoteConfig=getFirebaseRemoteConfig,exports.isFirebaseRemoteConfigAvailable=isFirebaseRemoteConfigAvailable,exports.fetchRemoteConfigSettings=fetchRemoteConfigSettings,exports.fetchRemoteConfigModuleStatus=fetchRemoteConfigModuleStatus;const MODULE_KEYS=["apis","logs","analytics","redux","storage","device","crash","debugging","media","socket"];let cachedRemoteConfigInstance=null;function getFirebaseRemoteConfig(e){if(e&&typeof e=="object")return cachedRemoteConfigInstance=e,e;if(cachedRemoteConfigInstance)return cachedRemoteConfigInstance;try{const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFirebaseRemoteConfig=getFirebaseRemoteConfig,exports.isFirebaseRemoteConfigAvailable=isFirebaseRemoteConfigAvailable,exports.fetchRemoteConfigSettings=fetchRemoteConfigSettings,exports.fetchRemoteConfigModuleStatus=fetchRemoteConfigModuleStatus;const MODULE_KEYS=["apis","logs","perf","analytics","redux","storage","device","crash","debugging","media","socket"];let cachedRemoteConfigInstance=null;function getFirebaseRemoteConfig(e){if(e&&typeof e=="object")return cachedRemoteConfigInstance=e,e;if(cachedRemoteConfigInstance)return cachedRemoteConfigInstance;try{const n=require("@react-native-firebase/remote-config"),t=typeof n.default=="function"?n.default():typeof n=="function"?n():n;return cachedRemoteConfigInstance=t,t}catch{return null}}function isFirebaseRemoteConfigAvailable(e){return!!getFirebaseRemoteConfig(e)}function extractValue(e){if(e!=null){if(typeof e=="boolean")return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){const n=e.trim().toLowerCase();if(n==="true"||n==="1"||n==="enabled"||n==="on")return!0;if(n==="false"||n==="0"||n==="disabled"||n==="off")return!1;try{return JSON.parse(e)}catch{return}}if(typeof e.asBoolean=="function")return e.asBoolean();if(typeof e.asString=="function"){const n=e.asString(),t=n.trim().toLowerCase();if(t==="true"||t==="1"||t==="enabled"||t==="on")return!0;if(t==="false"||t==="0"||t==="disabled"||t==="off")return!1;try{return JSON.parse(n)}catch{return}}}}async function fetchRemoteConfigSettings(e,n=8e3){const t=getFirebaseRemoteConfig(e);if(!t)return null;try{const l=(async()=>{typeof t.fetchAndActivate=="function"?await t.fetchAndActivate():(typeof t.fetch=="function"&&await t.fetch(),typeof t.activate=="function"&&await t.activate())})(),p=new Promise((o,r)=>setTimeout(()=>r(new Error("Remote Config fetch timeout")),n));await Promise.race([l,p]).catch(()=>{});const a=o=>{if(typeof t.getValue=="function")try{return t.getValue(o)}catch{return}return t[o]},s={},i={},d=["inspector_modules","inapp_inspector_modules","react_native_inapp_inspector_modules"];for(const o of d){const r=a(o),f=extractValue(r);if(f&&typeof f=="object")for(const c of MODULE_KEYS)typeof f[c]=="boolean"&&(i[c]=f[c])}for(const o of MODULE_KEYS){const r=[`inspector_module_${o}`,`inapp_inspector_${o}`,`inspector_${o}`,`inapp_inspector_module_${o}`,`rn_inspector_${o}`];for(const f of r){const c=a(f),u=extractValue(c);if(typeof u=="boolean"){i[o]=u;break}}}Object.keys(i).length>0&&(i.apis===void 0&&(i.apis=!0),s.modules=i);const y=["inspector_capture_widget_enabled","inapp_inspector_capture_widget","inspector_floating_capture_enabled"];for(const o of y){const r=extractValue(a(o));if(typeof r=="boolean"){s.captureWidgetEnabled=r;break}}const b=["inspector_enabled","inapp_inspector_enabled"];for(const o of b){const r=extractValue(a(o));if(typeof r=="boolean"){s.enabled=r;break}}return Object.keys(s).length>0?s:null}catch{return null}}async function fetchRemoteConfigModuleStatus(e,n=8e3){return(await fetchRemoteConfigSettings(e,n))?.modules||null}
|
|
@@ -5,3 +5,4 @@ export interface SearchQueryOptions {
|
|
|
5
5
|
isCaseSensitive?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function matchNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string, options?: SearchQueryOptions): boolean;
|
|
8
|
+
export declare function scoreNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string, options?: SearchQueryOptions): number;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.matchNetworkLogQuery=matchNetworkLogQuery;const telemetry_1=require("./telemetry"),PROXY_INFRA_HEADERS=new Set(["via","nel","report-to","reporting-endpoints","cf-ray","cf-cache-status","alt-svc","server","etag","date","x-powered-by","x-request-id","x-content-type-options","accept-ranges","transfer-encoding","connection","keep-alive"]);function tokenizeQuery(
|
|
2
|
-
`):
|
|
3
|
-
`)}
|
|
4
|
-
${
|
|
5
|
-
${
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.matchNetworkLogQuery=matchNetworkLogQuery,exports.scoreNetworkLogQuery=scoreNetworkLogQuery;const telemetry_1=require("./telemetry"),PROXY_INFRA_HEADERS=new Set(["via","nel","report-to","reporting-endpoints","cf-ray","cf-cache-status","alt-svc","server","etag","date","x-powered-by","x-request-id","x-content-type-options","accept-ranges","transfer-encoding","connection","keep-alive"]);function tokenizeQuery(t){const h=[],v=/[^\s"']+|"([^"]*)"|'([^']*)'/g;let p;for(;(p=v.exec(t))!==null;)p[1]!=null?h.push(p[1]):p[2]!=null?h.push(p[2]):p[0]&&h.push(p[0]);return h}function matchNetworkLogQuery(t,h,v,p){if(!h||h.trim().length===0)return!0;(0,telemetry_1.markSearchFilterUsed)();const N=!!p?.isCaseSensitive,P=!!p?.isRegex,B=p?.scope||"all",y=t.method||"",L=t.url||"",R=t.status!=null?String(t.status):"pending",m=typeof t.status=="number"?t.status:t.status!=null?parseInt(String(t.status),10):null,I=t.client||"",q=t.caller||"",O=v||t?.routeInfo?.path||"",H=o=>{if(o==null)return"";if(typeof o=="string")return o;try{return JSON.stringify(o)}catch{return""}},b=H(t.request),j=H(t.response),$=(o,w=!1)=>{if(!o||typeof o!="object")return"";const c=Object.entries(o);return w?c.map(([s,x])=>`${s}: ${x}`).join(`
|
|
2
|
+
`):c.filter(([s])=>!PROXY_INFRA_HEADERS.has(s.toLowerCase())).map(([s,x])=>`${s}: ${x}`).join(`
|
|
3
|
+
`)},k=$(t.requestHeaders,B==="headers"),g=$(t.responseHeaders,B==="headers"),u=(o=>{switch(o){case"url":return L;case"reqBody":return b;case"resBody":return j;case"headers":return`${k}
|
|
4
|
+
${g}`;default:return[L,y,R,O,I,q,b,j,k,g].join(" ")}})(B),r=(o,w)=>{if(P)try{return new RegExp(w,N?"":"i").test(o)}catch{}return N?o.includes(w):o.toLowerCase().includes(w.toLowerCase())},S=tokenizeQuery(h);return S.length===0?!0:S.every(o=>{let w=!1,c=o;if(c.length>1&&(c.startsWith("-")||c.startsWith("!"))&&(w=!0,c=c.slice(1)),!c)return!0;let s=!1;const x=c.indexOf(":");if(x>0){const n=c.slice(0,x).toLowerCase(),f=c.slice(x+1);if(n==="url"||n==="u"||n==="path")s=r(L,f);else if(n==="method"||n==="m")s=r(y,f);else if(n==="status"||n==="s")if(f==="error"||f==="failed"||f==="err")s=t.status===0||m!==null&&m>=400;else if(f==="success"||f==="ok")s=m!==null&&m>=200&&m<300;else if(f.endsWith("xx")){const W=f[0];s=R.startsWith(W)}else s=R.includes(f);else if(n==="header"||n==="h"){const W=`${$(t.requestHeaders,!0)}
|
|
5
|
+
${$(t.responseHeaders,!0)}`;s=r(W,f)}else n==="body"||n==="b"?s=r(b,f)||r(j,f):n==="client"||n==="c"?s=r(I,f):n==="page"||n==="p"?s=r(O,f):s=r(u,c)}else{const n=c.toLowerCase();n==="error"||n==="failed"||n==="err"||n==="fail"?s=t.status===0||m!==null&&m>=400||r(u,c):n==="success"||n==="ok"||n==="2xx"?s=m!==null&&m>=200&&m<300||r(u,c):/^[1-5]xx$/.test(n)?s=R.startsWith(n[0]):s=r(u,c)}return w?!s:s})}function scoreNetworkLogQuery(t,h,v,p){if(!h||h.trim().length===0)return 0;const N=!!p?.isCaseSensitive,P=p?.scope||"all",B=(t.method||"").trim(),y=(t.url||"").trim(),L=t.status!=null?String(t.status):"pending",R=t.client||"",m=t.caller||"",I=v||t?.routeInfo?.path||"";let q=y,O="",H="";try{const l=y.indexOf("?"),i=l>=0?y.slice(0,l):y;O=l>=0?y.slice(l+1):"";const C=i.indexOf("://"),a=C>=0?i.slice(C+3):i,d=a.indexOf("/");q=d>=0?a.slice(d):a;const F=q.split("/").filter(Boolean);H=F[F.length-1]||""}catch{q=y,H=y}const b=l=>{if(l==null)return"";if(typeof l=="string")return l;try{return JSON.stringify(l)}catch{return""}},j=b(t.request),$=b(t.response),k=(l,i=!1)=>{if(!l||typeof l!="object")return"";const C=Object.entries(l);return i?C.map(([a,d])=>`${a}: ${d}`).join(`
|
|
6
|
+
`):C.filter(([a])=>!PROXY_INFRA_HEADERS.has(a.toLowerCase())).map(([a,d])=>`${a}: ${d}`).join(`
|
|
7
|
+
`)},g=k(t.requestHeaders,P==="headers"),z=k(t.responseHeaders,P==="headers"),u=l=>N?l:l.toLowerCase(),r=u(h.trim()),S=u(H),o=u(q),w=u(y),c=u(B),s=u(L),x=u(I),n=u(R),f=u(m),W=u(O),E=u(g),_=u(z),M=u(j),U=u($);let e=0;return S===r?e+=500:S.startsWith(r)?e+=350:S.includes(r)&&(e+=250),o===r?e+=400:o.includes(r)&&(e+=180),w.includes(r)&&(e+=120),c===r&&(e+=100),s===r&&(e+=90),x.includes(r)&&(e+=80),W.includes(r)&&(e+=60),E.includes(r)&&(e+=40),M.includes(r)&&(e+=30),_.includes(r)&&(e+=20),U.includes(r)&&(e+=5),tokenizeQuery(h).forEach(l=>{if(!l||l.startsWith("-")||l.startsWith("!"))return;const i=u(l),C=i.indexOf(":");if(C>0){const a=i.slice(0,C),d=i.slice(C+1);a==="url"||a==="u"||a==="path"?o.includes(d)?e+=150:w.includes(d)&&(e+=100):a==="method"||a==="m"?c===d&&(e+=150):a==="status"||a==="s"?s.includes(d)&&(e+=150):a==="body"||a==="b"?(M.includes(d)&&(e+=80),U.includes(d)&&(e+=40)):(a==="header"||a==="h")&&(E.includes(d)||_.includes(d))&&(e+=80);return}S===i?e+=150:S.startsWith(i)?e+=100:S.includes(i)&&(e+=70),o.includes(i)?e+=40:w.includes(i)&&(e+=25),c===i&&(e+=50),s===i&&(e+=40),x.includes(i)&&(e+=30),(n.includes(i)||f.includes(i))&&(e+=20),E.includes(i)&&(e+=15),M.includes(i)&&(e+=10),_.includes(i)&&(e+=8),U.includes(i)&&(e+=2)}),e}
|
|
@@ -28,3 +28,19 @@ export declare function generateConsoleLogsFilename(format?: ConsoleLogExportFor
|
|
|
28
28
|
export declare function formatConsoleLogsExport(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): string;
|
|
29
29
|
export declare function estimateConsoleLogsExportSize(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): number;
|
|
30
30
|
export declare function shareConsoleLogs(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions, customTitle?: string): Promise<void>;
|
|
31
|
+
export type NetworkLogExportFormat = 'txt' | 'log' | 'json' | 'curl';
|
|
32
|
+
export interface NetworkLogExportOptions {
|
|
33
|
+
includeRequestHeaders?: boolean;
|
|
34
|
+
includeRequestBody?: boolean;
|
|
35
|
+
includeResponseHeaders?: boolean;
|
|
36
|
+
includeResponseBody?: boolean;
|
|
37
|
+
includeCurlCommand?: boolean;
|
|
38
|
+
includeTimestamps?: boolean;
|
|
39
|
+
includeAppInfo?: boolean;
|
|
40
|
+
ignorePattern?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const DEFAULT_NETWORK_EXPORT_OPTIONS: NetworkLogExportOptions;
|
|
43
|
+
export declare function generateNetworkLogsFilename(format?: NetworkLogExportFormat): string;
|
|
44
|
+
export declare function formatNetworkLogsExport(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions): string;
|
|
45
|
+
export declare function estimateNetworkLogsExportSize(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions): number;
|
|
46
|
+
export declare function shareNetworkLogs(logs: NetworkLog[], format?: NetworkLogExportFormat, options?: NetworkLogExportOptions, customTitle?: string): Promise<void>;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_CONSOLE_EXPORT_OPTIONS=void 0,exports.formatApiReport=formatApiReport,exports.formatPushReport=formatPushReport,exports.formatCrashReport=formatCrashReport,exports.formatAnalyticsReport=formatAnalyticsReport,exports.formatReduxReport=formatReduxReport,exports.formatLogReport=formatLogReport,exports.shareApiReport=shareApiReport,exports.sharePushReport=sharePushReport,exports.shareCrashReport=shareCrashReport,exports.shareAnalyticsReport=shareAnalyticsReport,exports.shareReduxReport=shareReduxReport,exports.shareLogReport=shareLogReport,exports.formatSocketReport=formatSocketReport,exports.shareSocketReport=shareSocketReport,exports.generateConsoleLogsFilename=generateConsoleLogsFilename,exports.formatConsoleLogsExport=formatConsoleLogsExport,exports.estimateConsoleLogsExportSize=estimateConsoleLogsExportSize,exports.shareConsoleLogs=shareConsoleLogs;const react_native_1=require("react-native"),index_1=require("./index");function safeStringify(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function formatApiReport(e){const n=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",
|
|
2
|
-
`)}function formatPushReport(e){const n=(0,index_1.formatDateTime)(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),
|
|
3
|
-
`)}function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${n}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_NETWORK_EXPORT_OPTIONS=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS=void 0,exports.formatApiReport=formatApiReport,exports.formatPushReport=formatPushReport,exports.formatCrashReport=formatCrashReport,exports.formatAnalyticsReport=formatAnalyticsReport,exports.formatReduxReport=formatReduxReport,exports.formatLogReport=formatLogReport,exports.shareApiReport=shareApiReport,exports.sharePushReport=sharePushReport,exports.shareCrashReport=shareCrashReport,exports.shareAnalyticsReport=shareAnalyticsReport,exports.shareReduxReport=shareReduxReport,exports.shareLogReport=shareLogReport,exports.formatSocketReport=formatSocketReport,exports.shareSocketReport=shareSocketReport,exports.generateConsoleLogsFilename=generateConsoleLogsFilename,exports.formatConsoleLogsExport=formatConsoleLogsExport,exports.estimateConsoleLogsExportSize=estimateConsoleLogsExportSize,exports.shareConsoleLogs=shareConsoleLogs,exports.generateNetworkLogsFilename=generateNetworkLogsFilename,exports.formatNetworkLogsExport=formatNetworkLogsExport,exports.estimateNetworkLogsExportSize=estimateNetworkLogsExportSize,exports.shareNetworkLogs=shareNetworkLogs;const react_native_1=require("react-native"),NativeInspector_1=require("../native/NativeInspector"),index_1=require("./index");function safeStringify(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function formatApiReport(e){const n=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",a=e.duration!=null?`${e.duration}ms`:"N/A",p=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=(0,index_1.getCurlCommand)(e),i=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${n}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${a}`,`\u{1F552} Time: ${p}`];return e.client&&i.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),i.push(`\u{1F310} URL: ${e.url||"N/A"}`),i.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(i.push("\u{1F4CB} Request Headers:"),i.push(safeStringify(e.requestHeaders)),i.push("")),e.request!=null&&e.request!==""&&(i.push("\u{1F4DD} Request Body:"),i.push(safeStringify(e.request)),i.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(i.push("\u{1F4D1} Response Headers:"),i.push(safeStringify(e.responseHeaders)),i.push("")),e.response!=null&&e.response!==""&&(i.push("\u{1F4E5} Response Data:"),i.push(safeStringify(e.response)),i.push("")),s&&(i.push("\u{1F4BB} cURL Command:"),i.push(s),i.push("")),i.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),i.push("Generated by React Native InApp Inspector"),i.join(`
|
|
2
|
+
`)}function formatPushReport(e){const n=(0,index_1.formatDateTime)(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),a=(e.appState||"unknown").toUpperCase(),p=(e.action||"received").toUpperCase(),s=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${a}`,`\u{1F3AF} Action: ${p}`,`\u{1F552} Time: ${n}`];return e.subtitle&&s.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&s.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&s.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&s.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&s.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&s.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),s.push(""),e.data&&Object.keys(e.data).length>0&&(s.push("\u{1F4E6} Custom Data Payload:"),s.push(safeStringify(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(safeStringify(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(safeStringify(e.rawPayload)),s.push("")),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
|
|
3
|
+
`)}function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${n}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(a=>{t.push(` \u2022 [${a.type}] ${a.message} (${(0,index_1.formatDateTime)(a.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
4
4
|
`)}function formatAnalyticsReport(e){const n=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4CA} ANALYTICS EVENT REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Event Name: ${e.name||"Unknown"}`,`\u{1F3E2} Source: ${(e.source||"manual").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`];return e.screenName&&t.push(`\u{1F4F1} Screen Name: ${e.screenName}`),e.userId&&t.push(`\u{1F464} User ID: ${e.userId}`),e.trackingId&&t.push(`\u{1F194} Tracking ID: ${e.trackingId}`),t.push(""),e.params&&Object.keys(e.params).length>0&&(t.push("\u{1F4E6} Event Parameters:"),t.push(safeStringify(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(safeStringify(e.userProperties)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
5
5
|
`)}function formatReduxReport(e){const n=typeof e.timestamp=="number"?(0,index_1.formatDateTime)(e.timestamp):e.timestamp,t=["\u{1F504} REDUX ACTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Action Type: ${e.type||"UNKNOWN"}`,`\u{1F552} Timestamp: ${n}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),e.originType&&t.push(`\u2699\uFE0F Origin: ${e.originType}`),e.affectedSlices&&e.affectedSlices.length>0&&t.push(`\u{1F370} Slices: ${e.affectedSlices.join(", ")}`),t.push(""),t.push("\u{1F4E6} Action Payload:"),t.push(safeStringify(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(safeStringify(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(safeStringify(e.nextState)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
6
6
|
`)}function formatLogReport(e){const n=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4DC} CONSOLE LOG REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Level: ${(e.type||"info").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`,`\u{1F4AC} Message: ${e.message||""}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),t.push(""),e.rawArgs&&e.rawArgs.length>0&&(t.push("\u{1F4E6} Arguments:"),t.push(safeStringify(e.rawArgs)),t.push("")),(e.stack||e.errorStack)&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack||e.errorStack||""),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
|
|
7
|
-
`)}async function triggerNativeShare(e,n){try{await react_native_1.Share.share({title:e,message:n},{dialogTitle:e})}catch(
|
|
8
|
-
`)}async function shareSocketReport(e){const n=formatSocketReport(e),t=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await triggerNativeShare(
|
|
9
|
-
`).map(
|
|
10
|
-
`);
|
|
7
|
+
`)}async function triggerNativeShare(e,n,t){try{const a=t||`export_${Date.now()}.txt`,p=await(0,NativeInspector_1.writeNativeExportFile)(a,n);if(p){const s=a.endsWith(".json")?"application/json":(a.endsWith(".log")||a.endsWith(".txt"),"text/plain");if(await(0,NativeInspector_1.shareNativeFile)(p,s,e))return}await react_native_1.Share.share({title:e,message:n,url:p||void 0},{dialogTitle:e,subject:e})}catch(a){a?.message!=="User did not share"&&react_native_1.Alert.alert("Share Error",a?.message||"Failed to open share sheet")}}async function shareApiReport(e){const n=formatApiReport(e),t=`api_${e.id??Date.now()}.txt`,a=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await triggerNativeShare(a,n,t)}async function sharePushReport(e){const n=formatPushReport(e),t=`push_${e.id??Date.now()}.txt`,a=`Push: ${e.title||e.id||"Notification"}`;await triggerNativeShare(a,n,t)}async function shareCrashReport(e){const n=formatCrashReport(e),t=`crash_${e.timestamp??Date.now()}.txt`,a=`Crash: ${e.name||e.message||"Error"}`;await triggerNativeShare(a,n,t)}async function shareAnalyticsReport(e){const n=formatAnalyticsReport(e),t=`analytics_${e.id??Date.now()}.txt`,a=`Analytics: ${e.name||"Event"}`;await triggerNativeShare(a,n,t)}async function shareReduxReport(e){const n=formatReduxReport(e),t=`redux_${e.id??Date.now()}.txt`,a=`Redux: ${e.type||"Action"}`;await triggerNativeShare(a,n,t)}async function shareLogReport(e){const n=formatLogReport(e),t=`log_${e.id??Date.now()}.txt`,a=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await triggerNativeShare(a,n,t)}function formatSocketReport(e){const n=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),a=e.duration!=null?`${e.duration}ms`:"Active / Open",p=(0,index_1.formatDateTime)(e.startTime||Date.now()),s=["\u{1F50C} WEBSOCKET / SOCKET.IO REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4E1} Client: ${n}`,`\u{1F310} URL: ${e.url||"N/A"}`,`\u26A1 Status: ${t}`,`\u23F1\uFE0F Connected: ${p}`,`\u23F3 Duration: ${a}`,`\u{1F4E6} Total Frames: ${e.frames?.length||0} (${e.sentCount||0} sent, ${e.receivedCount||0} recvd)`,`\u{1F4CA} Data Size: ${(e.totalBytesSent||0)+(e.totalBytesReceived||0)} bytes`];return e.protocols&&s.push(`\u{1F4DC} Protocols: ${Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}`),e.closeCode!=null&&s.push(`\u{1F6D1} Close Code: ${e.closeCode} (${e.closeReason||"N/A"})`),e.error&&s.push(`\u274C Error: ${e.error}`),e.caller&&s.push(`\u{1F4CD} Caller: ${e.caller}`),e.query&&Object.keys(e.query).length>0&&(s.push(""),s.push("\u{1F50D} Query Parameters:"),s.push(safeStringify(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((i,T)=>{const E=i.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",S=i.eventName?` [${i.eventName}]`:"";s.push(`--- Frame #${T+1} (${E}${S}, ${i.type}, ${i.size||0}B) ---`),s.push(safeStringify(i.data))})),s.push(""),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
|
|
8
|
+
`)}async function shareSocketReport(e){const n=formatSocketReport(e),t=`socket_${e.id??Date.now()}.txt`,a=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await triggerNativeShare(a,n,t)}exports.DEFAULT_CONSOLE_EXPORT_OPTIONS={includeStackTrace:!1,includeArguments:!1,includeCaller:!1,includeTimestamps:!1,includeAppInfo:!1,includeDuplicates:!1,ignorePattern:""};function generateConsoleLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),a=String(n.getMonth()+1).padStart(2,"0"),p=String(n.getFullYear()).slice(-2),s=Math.random().toString(36).substring(2,8).padEnd(6,"0");return`log_${t}${a}${p}_${s}.${e==="log"?"log":"txt"}`}function formatConsoleLogsExport(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return"No console logs to export.";const{includeStackTrace:a=!1,includeArguments:p=!1,includeCaller:s=!1,includeTimestamps:i=!1,includeAppInfo:T=!1,includeDuplicates:E=!1,ignorePattern:S=""}=t;let N=e;if(S&&S.trim().length>0)try{const c=new RegExp(S.trim(),"i");N=e.filter(r=>{const o=r.message||"",l=r.rawArgs?safeStringify(r.rawArgs):"",h=r.caller||"";return!c.test(o)&&!c.test(l)&&!c.test(h)})}catch{}if(N.length===0)return"No console logs to export (all filtered out).";const C=new Date().toLocaleString(),f="********************************************************************************",d=[];T&&d.push(`/${f}`,` * \u{1F4DC} CONSOLE LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${C}`,` * \u{1F4CA} Total Logs: ${e.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${f}/`,"");const y=e.map((c,r)=>{const o=r+1,l=(0,index_1.formatDateTime)(c.timestamp),h=(c.type||"info").toUpperCase(),$=E&&c.duplicateCount&&c.duplicateCount>1?` [DUPLICATES: \xD7${c.duplicateCount}]`:"",m=[`/${f}`,` * \u{1F4CC} LOG #${o} Starts [${h}]${i?` - ${l}`:""}${$}`,` ${f}/`];if(s&&c.caller&&m.push(`\u{1F4CD} Caller: ${c.caller}`),i&&m.push(`\u{1F552} Time: ${l}`),m.push(`\u{1F3F7}\uFE0F Level: ${h}`),c.sourceMethod&&c.sourceMethod!==c.type&&m.push(`\u2699\uFE0F Method: console.${c.sourceMethod}()`),m.push(""),m.push("\u{1F4AC} Message:"),m.push(c.message||"(Empty message)"),p&&c.rawArgs&&c.rawArgs.length>0&&(m.push(""),m.push("\u{1F4E6} Arguments / Data:"),m.push(safeStringify(c.rawArgs))),a&&(c.stack||c.errorStack)){m.push(""),m.push("\u{1F4DC} Stack Trace & Frames:");const R=(c.stack||c.errorStack||"").split(`
|
|
9
|
+
`).map(u=>` ${u}`).join(`
|
|
10
|
+
`);m.push(R)}return m.push(""),m.push(`/${f}`),m.push(` * \u{1F3C1} LOG #${o} Ends`),m.push(` ${f}/`),m.join(`
|
|
11
11
|
`)}).join(`
|
|
12
12
|
|
|
13
|
-
`),T
|
|
13
|
+
`),x=T?["",`/${f}`," * \u{1F3C1} END OF CONSOLE LOGS EXPORT",` ${f}/`].join(`
|
|
14
|
+
`):"";return`${d.join(`
|
|
15
|
+
`)}${y}${x}`}function estimateConsoleLogsExportSize(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const a=Math.min(e.length,20),p=e.slice(0,a),i=formatConsoleLogsExport(p,n,t).length/a;return Math.round(i*e.length)}async function shareConsoleLogs(e,n="txt",t=exports.DEFAULT_CONSOLE_EXPORT_OPTIONS,a){const p=formatConsoleLogsExport(e,n,t),s=generateConsoleLogsFilename(n);await triggerNativeShare(a||s,p,s)}exports.DEFAULT_NETWORK_EXPORT_OPTIONS={includeRequestHeaders:!1,includeRequestBody:!1,includeResponseHeaders:!1,includeResponseBody:!1,includeCurlCommand:!1,includeTimestamps:!1,includeAppInfo:!1,ignorePattern:""};function generateNetworkLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),a=String(n.getMonth()+1).padStart(2,"0"),p=String(n.getFullYear()).slice(-2),s=Math.random().toString(36).substring(2,8).padEnd(6,"0");return`api_${t}${a}${p}_${s}.${e==="log"?"log":"txt"}`}function formatNetworkLogsExport(e,n="txt",t=exports.DEFAULT_NETWORK_EXPORT_OPTIONS){if(!e||e.length===0)return"No API requests to export.";const{includeRequestHeaders:a=!1,includeRequestBody:p=!1,includeResponseHeaders:s=!1,includeResponseBody:i=!1,includeCurlCommand:T=!1,includeTimestamps:E=!1,includeAppInfo:S=!1,ignorePattern:N=""}=t;let g=e;if(N&&N.trim().length>0)try{const r=new RegExp(N.trim(),"i");g=e.filter(o=>{const l=o.url||"",h=o.method||"",$=o.client||"",m=o.request?safeStringify(o.request):"",R=o.response?safeStringify(o.response):"",u=o.requestHeaders?safeStringify(o.requestHeaders):"",O=o.responseHeaders?safeStringify(o.responseHeaders):"";return!r.test(l)&&!r.test(h)&&!r.test($)&&!r.test(m)&&!r.test(R)&&!r.test(u)&&!r.test(O)})}catch{}if(g.length===0)return"No API requests to export (all filtered out).";const f=new Date().toLocaleString(),d="********************************************************************************";if(n==="json"){const r=g.map((o,l)=>{const h={index:l+1,id:o.id,url:o.url,method:(o.method||"GET").toUpperCase(),status:o.status,duration:o.duration,startTime:o.startTime,client:o.client};return a&&o.requestHeaders&&(h.requestHeaders=o.requestHeaders),p&&o.request!=null&&(h.request=o.request),s&&o.responseHeaders&&(h.responseHeaders=o.responseHeaders),i&&o.response!=null&&(h.response=o.response),T&&(h.curl=(0,index_1.getCurlCommand)(o)),h});return JSON.stringify(r,null,2)}if(n==="curl"){const r=["#!/usr/bin/env bash","# ============================================================================== ","# \u{1F680} API Network Logs - cURL Script Export",`# \u{1F552} Exported At: ${f}`,`# \u{1F4CA} Total Commands: ${g.length}`,"# \u2699\uFE0F Generator: React Native InApp Inspector",`# ==============================================================================
|
|
16
|
+
`];return g.forEach((o,l)=>{const h=l+1,$=(o.method||"GET").toUpperCase(),m=o.status===0?"Failed / Error":o.status!=null?String(o.status):"Pending",R=o.duration!=null?`${o.duration}ms`:"N/A",u=(0,index_1.formatDateTime)(o.startTime||Date.now());r.push(`# Request #${h}: [${$}] ${o.url||"N/A"} (Status: ${m}, ${R}, ${u})`);const O=(0,index_1.getCurlCommand)(o);O?r.push(O):r.push(`curl -X ${$} "${o.url||""}"`),r.push("")}),r.join(`
|
|
17
|
+
`)}const y=[];S&&y.push(`/${d}`,` * \u{1F680} API NETWORK LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${f}`,` * \u{1F4CA} Total Requests: ${g.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${d}/`,"");const x=g.map((r,o)=>{const l=o+1,h=(0,index_1.formatDateTime)(r.startTime||Date.now()),$=(r.method||"GET").toUpperCase(),m=r.status===0?"Failed / Network Error":r.status!=null?`${r.status} ${r.status===200?"OK":""}`.trim():"Pending",R=r.duration!=null?`${r.duration}ms`:"N/A",u=[`/${d}`,` * \u{1F4CC} REQUEST #${l} Starts [${$}] [${m}] [${R}]${E?` - ${h}`:""}`,` ${d}/`];if(u.push(`\u{1F310} URL: ${r.url||"N/A"}`),u.push(`\u{1F4CC} Method: ${$}`),u.push(`\u{1F4CA} Status: ${m}`),u.push(`\u23F1\uFE0F Duration: ${R}`),E&&u.push(`\u{1F552} Time: ${h}`),r.client&&u.push(`\u{1F50C} Client: ${r.client.toUpperCase()}`),a&&r.requestHeaders&&Object.keys(r.requestHeaders).length>0&&(u.push(""),u.push("\u{1F4CB} Request Headers:"),u.push(safeStringify(r.requestHeaders))),p&&r.request!=null&&r.request!==""&&(u.push(""),u.push("\u{1F4DD} Request Body:"),u.push(safeStringify(r.request))),s&&r.responseHeaders&&Object.keys(r.responseHeaders).length>0&&(u.push(""),u.push("\u{1F4D1} Response Headers:"),u.push(safeStringify(r.responseHeaders))),i&&r.response!=null&&r.response!==""&&(u.push(""),u.push("\u{1F4E5} Response Data:"),u.push(safeStringify(r.response))),T){const O=(0,index_1.getCurlCommand)(r);O&&(u.push(""),u.push("\u{1F4BB} cURL Command:"),u.push(O))}return u.push(""),u.push(`/${d}`),u.push(` * \u{1F3C1} REQUEST #${l} Ends`),u.push(` ${d}/`),u.join(`
|
|
18
|
+
`)}).join(`
|
|
19
|
+
|
|
20
|
+
`),c=S?["",`/${d}`," * \u{1F3C1} END OF API NETWORK LOGS EXPORT",` ${d}/`].join(`
|
|
14
21
|
`):"";return`${y.join(`
|
|
15
|
-
`)}${
|
|
22
|
+
`)}${x}${c}`}function estimateNetworkLogsExportSize(e,n="txt",t=exports.DEFAULT_NETWORK_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const a=Math.min(e.length,10),p=e.slice(0,a),i=formatNetworkLogsExport(p,n,t).length/a;return Math.round(i*e.length)}async function shareNetworkLogs(e,n="txt",t=exports.DEFAULT_NETWORK_EXPORT_OPTIONS,a){const p=formatNetworkLogsExport(e,n,t),s=generateNetworkLogsFilename(n);await triggerNativeShare(a||s,p,s)}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { A11yAuditResult, BoxModelMetrics, ComponentTreeNode, HierarchyBreadcrumbItem, InspectedElementInfo } from '../types';
|
|
2
|
+
export declare function getCleanComponentName(type: any): string;
|
|
3
|
+
export declare function buildHierarchyFromFiber(fiber: any): HierarchyBreadcrumbItem[];
|
|
4
|
+
export interface IndexedFiberItem {
|
|
5
|
+
fiber: any;
|
|
6
|
+
name: string;
|
|
7
|
+
isHost: boolean;
|
|
8
|
+
props: Record<string, any>;
|
|
9
|
+
styles: Record<string, any>;
|
|
10
|
+
nativeTag?: number;
|
|
11
|
+
text?: string;
|
|
12
|
+
sourceLocation?: string;
|
|
13
|
+
depth: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function getAllAppFibers(): IndexedFiberItem[];
|
|
16
|
+
export declare function getFullComponentTree(): ComponentTreeNode[];
|
|
17
|
+
export declare function inspectFiberTreeAtPoint(locationX: number, locationY: number, nativeHit?: any): InspectedElementInfo | null;
|
|
18
|
+
export declare function getDynamicInspectorDataForPoint(locationX: number, locationY: number, inspectedViewRef?: any): Promise<InspectedElementInfo | null>;
|
|
19
|
+
export declare function extractBoxModel(flattenedStyle?: Record<string, any>, layout?: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}): BoxModelMetrics;
|
|
23
|
+
export declare function categorizeStyles(flattened?: Record<string, any>): {
|
|
24
|
+
layout: Record<string, any>;
|
|
25
|
+
dimensions: Record<string, any>;
|
|
26
|
+
position: Record<string, any>;
|
|
27
|
+
spacing: Record<string, any>;
|
|
28
|
+
typography: Record<string, any>;
|
|
29
|
+
appearance: Record<string, any>;
|
|
30
|
+
borders: Record<string, any>;
|
|
31
|
+
transforms: Record<string, any>;
|
|
32
|
+
other: Record<string, any>;
|
|
33
|
+
};
|
|
34
|
+
export declare function calculateContrastRatio(textColor?: string, bgColor?: string): {
|
|
35
|
+
ratio: any;
|
|
36
|
+
score: "N/A";
|
|
37
|
+
} | {
|
|
38
|
+
ratio: number;
|
|
39
|
+
score: "AAA" | "AA" | "Fail";
|
|
40
|
+
};
|
|
41
|
+
export declare function auditAccessibility(props?: Record<string, any>, layout?: {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
}, styles?: Record<string, any>): A11yAuditResult;
|
|
45
|
+
export declare function generateJsxSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): string;
|
|
46
|
+
export declare function generateFullJsxSegmentSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): {
|
|
47
|
+
code: string;
|
|
48
|
+
sourceFile?: string;
|
|
49
|
+
sourceLocation?: string;
|
|
50
|
+
lineNumber?: number;
|
|
51
|
+
columnNumber?: number;
|
|
52
|
+
};
|
|
53
|
+
export declare function generateStyleSheetSnippet(componentName: string, styles?: Record<string, any>): string;
|
|
54
|
+
export declare function generateCssSnippet(componentName: string, styles?: Record<string, any>): string;
|
|
55
|
+
export declare function createInspectedElement(componentName: string, props: Record<string, any>, layout: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
pageX: number;
|
|
61
|
+
pageY: number;
|
|
62
|
+
}, hierarchy?: HierarchyBreadcrumbItem[], nativeTag?: number, snapshotUri?: string, snapshotBase64?: string): InspectedElementInfo;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCleanComponentName=getCleanComponentName,exports.buildHierarchyFromFiber=buildHierarchyFromFiber,exports.getAllAppFibers=getAllAppFibers,exports.getFullComponentTree=getFullComponentTree,exports.inspectFiberTreeAtPoint=inspectFiberTreeAtPoint,exports.getDynamicInspectorDataForPoint=getDynamicInspectorDataForPoint,exports.extractBoxModel=extractBoxModel,exports.categorizeStyles=categorizeStyles,exports.calculateContrastRatio=calculateContrastRatio,exports.auditAccessibility=auditAccessibility,exports.generateJsxSnippet=generateJsxSnippet,exports.generateFullJsxSegmentSnippet=generateFullJsxSegmentSnippet,exports.generateStyleSheetSnippet=generateStyleSheetSnippet,exports.generateCssSnippet=generateCssSnippet,exports.createInspectedElement=createInspectedElement;const react_native_1=require("react-native");function getCleanComponentName(t){if(!t)return"Unknown";if(typeof t=="string")return t==="RCTView"||t==="AndroidHorizontalScrollView"?"View":t==="RCTText"||t==="RCTRawText"||t==="RCTVirtualText"?"Text":t==="RCTImageView"||t==="RCTCxxImageView"?"Image":t==="RCTScrollView"?"ScrollView":t==="RCTModalHostView"?"Modal":t==="RCTSafeAreaView"?"SafeAreaView":t.replace(/^RCT/,"").replace(/^Android/,"");if(typeof t=="function")return t.displayName||t.name||"Component";if(typeof t=="object"){if(t.$$typeof?.toString().includes("memo")&&t.type)return`Memo(${getCleanComponentName(t.type)})`;if(t.$$typeof?.toString().includes("forward_ref")&&(t.render||t.type))return t.displayName||`ForwardRef(${getCleanComponentName(t.render||t.type)})`;if(t.displayName)return t.displayName;if(t.name)return t.name}return"Component"}function isInternalWrapper(t){if(!t)return!0;const e=t.toLowerCase();return e.includes("provider")||e.includes("consumer")||e.includes("context")||e.includes("safearray")||e==="errorboundary"||e==="moduleerrorboundary"||e.includes("inspector")||e.includes("screengroup")||e.includes("screenstack")||e.includes("screencontainer")||e.includes("nativestackview")||e.includes("navigationcontainerinner")||e==="anonymous"}function extractTextFromFiber(t){if(!t)return;const e=t.memoizedProps||t.pendingProps;if(typeof e?.children=="string")return e.children;if(typeof e?.title=="string")return e.title;if(typeof e?.label=="string")return e.label;if(typeof e?.text=="string")return e.text;if(typeof e?.accessibilityLabel=="string")return e.accessibilityLabel}function buildHierarchyFromFiber(t){const e=[];let o=t,i=0;for(;o&&i<30;){if(o.type){const n=getCleanComponentName(o.type),l=typeof o.type=="string",a=o.memoizedProps||o.pendingProps||{},c=a.style?react_native_1.StyleSheet.flatten(a.style):void 0,r=extractTextFromFiber(o),s=o._debugSource||a.__source||a._source,d=s?.fileName&&s?.lineNumber?`${s.fileName.replace(/^.*[\\/]/,"")}:${s.lineNumber}`:void 0;(!isInternalWrapper(n)||e.length===0)&&e.unshift({id:`crumb_${i}_${n}_${Math.random().toString(36).substring(2,5)}`,displayName:n,componentName:n,depth:i,isHostComponent:l,props:a,styles:c})}o=o.return,i++}return e}function getAllAppFibers(){const t=[];try{const e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!e||!e._fiberRoots)return t;for(const o of e._fiberRoots.values())if(!(!o||o.size===0))for(const i of o.values()){const n=i?.current;if(!n)continue;const l=[{fiber:n,depth:0}],a=new Set;let c=0;for(;l.length>0&&c<8e3;){const{fiber:r,depth:s}=l.pop();if(!r||a.has(r)||(a.add(r),c++,r.sibling&&l.push({fiber:r.sibling,depth:s}),r.child&&l.push({fiber:r.child,depth:s+1}),!r.type))continue;const d=getCleanComponentName(r.type),u=d.toLowerCase();if(u.includes("inappinspector")||u.includes("uiinspector")||u.includes("floatingcapture")||u.includes("tabbar")||u.includes("devtools"))continue;const p=r.memoizedProps||r.pendingProps||{},f=p.style?react_native_1.StyleSheet.flatten(p.style)||{}:{},g=typeof r.type=="string",y=extractTextFromFiber(r),m=r._debugSource||p.__source||p._source,_=m?.fileName&&m?.lineNumber?`${m.fileName.replace(/^.*[\\/]/,"")}:${m.lineNumber}`:void 0;let w;r.stateNode&&(w=r.stateNode._nativeTag||r.stateNode.canonical?.nativeTag||r.stateNode.node||(typeof r.stateNode=="number"?r.stateNode:void 0)),t.push({fiber:r,name:d,isHost:g,props:p,styles:f,nativeTag:w,text:y,sourceLocation:_,depth:s})}}}catch{}return t}function getFullComponentTree(){try{const t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t||!t._fiberRoots)return[];const e=[];for(const o of t._fiberRoots.values())if(!(!o||o.size===0))for(const i of o.values()){let n=function(c,r){if(!c||r>20)return null;const s=getCleanComponentName(c.type),d=s.toLowerCase();if(d.includes("inappinspector")||d.includes("uiinspector")||d.includes("floatingcapture")||d.includes("tabbar"))return null;const u=typeof c.type=="string",p=c.memoizedProps||c.pendingProps||{},f=[];let g=c.child;for(;g;){const y=n(g,r+1);y&&f.push(y),g=g.sibling}return isInternalWrapper(s)&&f.length>0?f.length===1?f[0]:{id:`tree_${r}_${s}_${Math.random().toString(36).substring(2,5)}`,name:s,displayName:s,depth:r,isHostComponent:u,props:p,children:f}:{id:`tree_${r}_${s}_${Math.random().toString(36).substring(2,5)}`,name:s,displayName:s,depth:r,isHostComponent:u,props:p,children:f}};const l=i?.current;if(!l)continue;const a=n(l,0);a&&e.push(a)}return e}catch{return[]}}function inspectFiberTreeAtPoint(t,e,o){try{const i=getAllAppFibers();if(i.length===0)return null;let n=null;if(o?.tag||o?.id){const u=o.tag||o.id;n=i.find(p=>p.nativeTag===u)||null}if(!n&&o?.text&&o.text.trim().length>0){const u=o.text.trim();n=i.find(p=>p.text&&(p.text===u||p.text.includes(u)))||null}if(!n&&o?.className){const u=o.className.replace(/^RCT/,"").replace(/^Android/,"");n=i.find(p=>!isInternalWrapper(p.name)&&(p.name===u||p.name===o.className))||null}if(!n){const u=i.filter(p=>!p.isHost&&!isInternalWrapper(p.name));if(u.length>0)n=u[u.length-1];else{const p=i.filter(f=>!isInternalWrapper(f.name));n=p.length>0?p[p.length-1]:i[i.length-1]}}if(!n)return null;const l=buildHierarchyFromFiber(n.fiber),a=o?.x??n.styles.left??t,c=o?.y??n.styles.top??e,r=o?.width??n.styles.width??160,s=o?.height??n.styles.height??44,d={x:a,y:c,width:r,height:s,pageX:a,pageY:c};return createInspectedElement(n.name,n.props,d,l,n.nativeTag)}catch{return null}}async function getDynamicInspectorDataForPoint(t,e,o){let i=null;try{const{findNativeViewAtPoint:l}=require("../native/NativeInspector");typeof l=="function"&&(i=await l(t,e))}catch{}const n=inspectFiberTreeAtPoint(t,e,i);return n&&n.hierarchy&&n.hierarchy.length>0?(i&&i.width>0&&i.height>0&&(n.layout={x:i.x,y:i.y,width:i.width,height:i.height,pageX:i.x,pageY:i.y},n.boxModel=extractBoxModel(n.flattenedStyles,n.layout)),n):new Promise(l=>{let a=!1;const c=setTimeout(()=>{a||(a=!0,l(inspectFiberTreeAtPoint(t,e,i)))},100);try{const r=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(r&&r.renderers){const s=Array.from(r.renderers.values());for(const d of s){const u=d?.rendererConfig?.getInspectorDataForViewAtPoint;typeof u=="function"&&u(o||null,t,e,p=>{if(a)return!0;if(p&&(p.frame||p.hierarchy&&p.hierarchy.length>0)){a=!0,clearTimeout(c);const{frame:f,props:g,hierarchy:y,selectedIndex:m,touchedViewTag:_,closestInstance:w}=p,b=[];Array.isArray(y)&&y.forEach((h,T)=>{const N=h?.type||h,$=h?.name||getCleanComponentName(N)||`View_${T}`;let C={};try{if(typeof h.getInspectorData=="function"){const V=h.getInspectorData();V?.props&&(C=V.props)}else h.props?C=h.props:h.memoizedProps&&(C=h.memoizedProps)}catch{}const v=C?.style||typeof h.getInspectorData=="function"&&h.getInspectorData()?.props?.style,H=v?react_native_1.StyleSheet.flatten(v):void 0;b.push({id:`crumb_${T}_${$}`,displayName:getCleanComponentName($),componentName:$,depth:T,isHostComponent:typeof $=="string"&&($.startsWith("RCT")||$==="View"||$==="Text"||$==="Image"),props:C,styles:H})});const S=m!=null&&b[m]?b[m]:b[b.length-1],A=S?.componentName||(w?getCleanComponentName(w.type):"View"),R=getCleanComponentName(A),x=g&&Object.keys(g).length>0?g:S?.props||{},O=x.style?react_native_1.StyleSheet.flatten(x.style):S?.styles||{},L={x:f?.left??t,y:f?.top??e,width:f?.width??(i?.width||120),height:f?.height??(i?.height||44),pageX:f?.left??t,pageY:f?.top??e};return l(createInspectedElement(R,x,L,b.length>0?b:void 0,_)),!0}return!1})}}}catch{clearTimeout(c),l(inspectFiberTreeAtPoint(t,e,i))}})}function extractBoxModel(t={},e={width:0,height:0}){const o=(h,T=0)=>{const N=typeof h=="number"?h:parseFloat(h);return isNaN(N)?T:N},i=o(t.margin,0),n=o(t.marginVertical,i),l=o(t.marginHorizontal,i),a=o(t.marginTop,n),c=o(t.marginBottom,n),r=o(t.marginLeft,l),s=o(t.marginRight,l),d=o(t.padding,0),u=o(t.paddingVertical,d),p=o(t.paddingHorizontal,d),f=o(t.paddingTop,u),g=o(t.paddingBottom,u),y=o(t.paddingLeft,p),m=o(t.paddingRight,p),_=o(t.borderWidth,0),w=o(t.borderTopWidth,_),b=o(t.borderBottomWidth,_),S=o(t.borderLeftWidth,_),A=o(t.borderRightWidth,_),R=e.width||o(t.width,0),x=e.height||o(t.height,0),O=Math.max(0,R-(y+m+S+A)),L=Math.max(0,x-(f+g+w+b));return{margin:{top:a,right:s,bottom:c,left:r},border:{top:w,right:A,bottom:b,left:S},padding:{top:f,right:m,bottom:g,left:y},content:{width:Math.round(O*10)/10,height:Math.round(L*10)/10}}}function categorizeStyles(t={}){const e={layout:{},dimensions:{},position:{},spacing:{},typography:{},appearance:{},borders:{},transforms:{},other:{}},o=new Set(["flex","flexDirection","justifyContent","alignItems","alignSelf","alignContent","flexWrap","flexGrow","flexShrink","flexBasis","gap","rowGap","columnGap"]),i=new Set(["width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio"]),n=new Set(["position","top","bottom","left","right","start","end","zIndex"]),l=new Set(["padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","paddingStart","paddingEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","marginStart","marginEnd"]),a=new Set(["color","fontSize","fontWeight","fontFamily","fontStyle","lineHeight","letterSpacing","textAlign","textAlignVertical","textDecorationLine","textDecorationStyle","textDecorationColor","textTransform","includeFontPadding"]),c=new Set(["backgroundColor","opacity","overflow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","backfaceVisibility"]),r=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle"]);for(const[s,d]of Object.entries(t))d!==void 0&&(o.has(s)?e.layout[s]=d:i.has(s)?e.dimensions[s]=d:n.has(s)?e.position[s]=d:l.has(s)?e.spacing[s]=d:a.has(s)?e.typography[s]=d:c.has(s)?e.appearance[s]=d:r.has(s)?e.borders[s]=d:s==="transform"?e.transforms[s]=d:e.other[s]=d);return e}function getLuminance(t){const e=t.replace("#","");if(e.length<6)return .5;const o=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,l=[o,i,n].map(a=>a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4));return .2126*l[0]+.7152*l[1]+.0722*l[2]}function calculateContrastRatio(t,e){if(!t||!e||!t.startsWith("#")||!e.startsWith("#"))return{ratio:void 0,score:"N/A"};const o=getLuminance(t),i=getLuminance(e),n=Math.max(o,i),l=Math.min(o,i),a=(n+.05)/(l+.05),c=Math.round(a*100)/100;let r="Fail";return c>=7?r="AAA":c>=4.5&&(r="AA"),{ratio:c,score:r}}function auditAccessibility(t={},e={width:0,height:0},o={}){const i=react_native_1.Platform.OS==="android",n=i?48:44,l=typeof t.onPress=="function"||typeof t.onLongPress=="function"||t.accessible===!0,a=e.width||o.width||0,c=e.height||o.height||0,r=[];let s=!0;l&&(a>0||c>0)&&(a<n||c<n)&&(s=!1,r.push(`Touch target is ${Math.round(a)}\xD7${Math.round(c)}pt. Recommended min is ${n}\xD7${n}pt for ${i?"Android Material Design":"Apple iOS HIG"}.`));const d=!!(t.accessibilityLabel||t["aria-label"]||t.accessibilityTitle);l&&!d&&!t.children&&typeof t.children!="string"&&r.push("Interactive element is missing an accessibilityLabel / aria-label.");const u=o.color,p=o.backgroundColor,f=calculateContrastRatio(u,p);return f.score==="Fail"&&f.ratio!==void 0&&r.push(`Contrast ratio is ${f.ratio}:1 (below WCAG AA minimum 4.5:1).`),{hasValidTouchTarget:s,touchTargetWidth:a,touchTargetHeight:c,recommendedMinSize:n,contrastRatio:f.ratio,contrastScore:f.score,textColor:u,backgroundColor:p,hasAccessibilityLabel:d,accessibilityRole:t.accessibilityRole||t.role,accessibilityHint:t.accessibilityHint,issues:r}}function generateJsxSnippet(t,e={},o={}){return generateFullJsxSegmentSnippet(t,e,o).code}function formatJsxProp(t,e){return typeof e=="string"?`${t}="${e}"`:typeof e=="boolean"?e?t:`${t}={false}`:typeof e=="number"?`${t}={${e}}`:typeof e=="function"?`${t}={() => {}}`:typeof e=="object"&&e!==null?`${t}={${JSON.stringify(e)}}`:`${t}={${String(e)}}`}function formatJsxChildren(t,e=1){if(t==null)return"";const o=" ".repeat(e);if(typeof t=="string"||typeof t=="number")return`${o}${t}`;if(Array.isArray(t))return t.map(i=>formatJsxChildren(i,e)).filter(Boolean).join(`
|
|
2
|
+
`);if(typeof t=="object"&&t.type){const i=typeof t.type=="string"?t.type:t.type.displayName||t.type.name||"Component",n=t.props||{},l=[];for(const[c,r]of Object.entries(n))c==="children"||c==="__source"||c==="__self"||c==="_source"||l.push(formatJsxProp(c,r));const a=l.length?" "+l.join(" "):"";if(n.children){const c=formatJsxChildren(n.children,e+1);return`${o}<${i}${a}>
|
|
3
|
+
${c}
|
|
4
|
+
${o}</${i}>`}return`${o}<${i}${a} />`}return""}function generateFullJsxSegmentSnippet(t,e={},o={}){const i=e.__source||e._source,n=i?.fileName,l=i?.lineNumber,a=i?.columnNumber,c=n?n.replace(/^.*[\\/]/,""):void 0,r=c&&l?`${c}:${l}${a?`:${a}`:""}`:void 0,s=[];for(const[p,f]of Object.entries(e))p==="children"||p==="style"||p==="key"||p==="__source"||p==="__self"||p==="_source"||s.push(formatJsxProp(p,f));Object.keys(o).length>0&&s.push(`style={styles.${t.toLowerCase()||"container"}}`);const d=formatJsxChildren(e.children,1);let u="";return s.length<=1&&!d?u=`<${t}${s.length?" "+s.join(" "):""} />`:d?u=`<${t}${s.length?`
|
|
5
|
+
`+s.join(`
|
|
6
|
+
`):""}>
|
|
7
|
+
${d}
|
|
8
|
+
</${t}>`:u=`<${t}
|
|
9
|
+
${s.join(`
|
|
10
|
+
`)}
|
|
11
|
+
/>`,{code:u,sourceFile:n,sourceLocation:r,lineNumber:l,columnNumber:a}}function generateStyleSheetSnippet(t,e={}){const o=" ",i=[];for(const[l,a]of Object.entries(e)){if(a===void 0)continue;const c=typeof a=="string"?`'${a}'`:typeof a=="object"?JSON.stringify(a):String(a);i.push(`${o}${l}: ${c},`)}const n=i.length>0?`{
|
|
12
|
+
${i.join(`
|
|
13
|
+
`)}
|
|
14
|
+
}`:"{}";return`const styles = StyleSheet.create({
|
|
15
|
+
${t.toLowerCase()}Container: ${n},
|
|
16
|
+
});`}function generateCssSnippet(t,e={}){const o=[];for(const[n,l]of Object.entries(e)){if(l===void 0)continue;const a=n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),c=typeof l=="number"?`${l}px`:String(l);o.push(` ${a}: ${c};`)}const i=o.length>0?`{
|
|
17
|
+
${o.join(`
|
|
18
|
+
`)}
|
|
19
|
+
}`:"{}";return`.${t.toLowerCase()}-element ${i}`}function createInspectedElement(t,e={},o,i=[],n,l,a){const c=e.style?react_native_1.StyleSheet.flatten(e.style)||{}:{},r={...c},s=extractBoxModel(r,o),d=auditAccessibility(e,o,r);return{id:`elem_${Date.now()}_${Math.random().toString(36).substring(2,6)}`,componentName:t,displayName:t,hierarchy:i.length>0?i:[{id:"root_app",displayName:"App",componentName:"App",depth:0,isHostComponent:!1},{id:"inspected_node",displayName:t,componentName:t,depth:1,isHostComponent:!0,props:e,styles:r}],props:e,originalStyles:c,flattenedStyles:r,tweakedStyles:{},layout:o,boxModel:s,a11y:d,nativeTag:n,snapshotUri:l,snapshotBase64:a,timestamp:Date.now()}}
|