react-native-inapp-inspector 2.5.12 → 2.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- 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/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build/.transforms/ad628164ecef2a7cc593f0fd2f4050ce/results.bin +1 -0
- 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$62$$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 +1 -0
- package/android/build/.transforms/c93e459e24d856bde563ebb048265732/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/inappinspector/BuildConfig.java +10 -0
- package/android/build/generated/source/codegen/java/com/inappinspector/NativeNetworkInspectorSpec.java +176 -0
- package/android/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
- package/android/build/generated/source/codegen/jni/RNInAppInspectorSpec-generated.cpp +236 -0
- package/android/build/generated/source/codegen/jni/RNInAppInspectorSpec.h +31 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ComponentDescriptors.cpp +22 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ComponentDescriptors.h +24 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/EventEmitters.cpp +16 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/EventEmitters.h +17 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/Props.cpp +19 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/Props.h +18 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/RNInAppInspectorSpecJSI.h +337 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ShadowNodes.cpp +17 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/ShadowNodes.h +23 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/States.cpp +16 -0
- package/android/build/generated/source/codegen/jni/react/renderer/components/RNInAppInspectorSpec/States.h +20 -0
- package/android/build/generated/source/codegen/schema.json +1 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +19 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- 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 +1 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_inappinspector_file_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- 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 +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +28 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +19 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/inappinspector_file_paths.xml +7 -0
- 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$62$$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 +2 -0
- 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 +2 -0
- 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 +35 -0
- 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$62$$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/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +492 -45
- package/android/src/main/res/xml/inappinspector_file_paths.xml +7 -0
- 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 +7 -7
- package/dist/commonjs/components/Inspector/CrashTab.js +17 -17
- package/dist/commonjs/components/Inspector/DebuggingTab.js +37 -37
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +2 -2
- package/dist/commonjs/components/Inspector/FabLauncher.js +4 -4
- package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +2 -2
- package/dist/commonjs/components/Inspector/InspectorHeader.js +36 -36
- package/dist/commonjs/components/Inspector/MainScreen.js +38 -75
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +10 -10
- package/dist/commonjs/components/Inspector/MediaPreviewModal.d.ts +1 -0
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +222 -222
- 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 +60 -53
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +11 -12
- package/dist/commonjs/components/Inspector/ReduxDetail.js +17 -19
- package/dist/commonjs/components/Inspector/ReduxTab.js +5 -5
- package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.d.ts +1 -0
- package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.js +17 -16
- package/dist/commonjs/components/Inspector/SettingsPanel.js +43 -47
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +34 -3
- 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 +9 -15
- 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 +12 -10
- package/dist/commonjs/components/SkeletonPlaceholder.d.ts +3 -0
- package/dist/commonjs/components/SkeletonPlaceholder.js +34 -3
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
- package/dist/commonjs/constants/telemetryConfig.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.js +1 -3
- 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 +4 -2
- package/dist/commonjs/index.js +3 -3
- package/dist/commonjs/native/NativeInspector.d.ts +4 -0
- package/dist/commonjs/native/NativeInspector.js +1 -1
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +4 -0
- package/dist/commonjs/styles/AppFonts.d.ts +4 -0
- package/dist/commonjs/styles/AppFonts.js +1 -1
- package/dist/commonjs/styles/index.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 +0 -2
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +1 -1
- 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 +48 -48
- package/dist/esm/components/Inspector/CrashTab.js +58 -58
- package/dist/esm/components/Inspector/DebuggingTab.js +105 -105
- package/dist/esm/components/Inspector/DeviceInfoTab.js +2 -2
- package/dist/esm/components/Inspector/FabLauncher.js +50 -50
- package/dist/esm/components/Inspector/FloatingCaptureWidget.js +23 -23
- package/dist/esm/components/Inspector/InspectorHeader.js +64 -64
- package/dist/esm/components/Inspector/MainScreen.js +87 -124
- package/dist/esm/components/Inspector/MediaGalleryTab.js +151 -151
- package/dist/esm/components/Inspector/MediaPreviewModal.d.ts +1 -0
- package/dist/esm/components/Inspector/MediaPreviewModal.js +468 -468
- 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 +143 -136
- package/dist/esm/components/Inspector/NpmStarPrompt.js +32 -33
- package/dist/esm/components/Inspector/ReduxDetail.js +54 -56
- package/dist/esm/components/Inspector/ReduxTab.js +9 -9
- package/dist/esm/components/Inspector/SecondaryTelemetryStrip.d.ts +1 -0
- package/dist/esm/components/Inspector/SecondaryTelemetryStrip.js +23 -22
- package/dist/esm/components/Inspector/SettingsPanel.js +109 -113
- package/dist/esm/components/Inspector/SkeletonPlaceholder.d.ts +3 -0
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +42 -11
- 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 +35 -41
- 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 +24 -22
- package/dist/esm/components/SkeletonPlaceholder.d.ts +3 -0
- package/dist/esm/components/SkeletonPlaceholder.js +42 -11
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/constants/telemetryConfig.d.ts +3 -3
- package/dist/esm/constants/telemetryConfig.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.js +4 -6
- 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 +4 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/native/NativeInspector.d.ts +4 -0
- package/dist/esm/native/NativeInspector.js +1 -1
- package/dist/esm/native/NativeNetworkInspector.d.ts +4 -0
- package/dist/esm/styles/AppFonts.d.ts +4 -0
- package/dist/esm/styles/AppFonts.js +1 -1
- package/dist/esm/styles/index.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 +0 -2
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +1 -1
- package/ios/NetworkInspectorModule.mm +597 -336
- package/package.json +1 -1
- package/src/native/NativeInspector.ts +67 -0
- package/src/native/NativeNetworkInspector.ts +4 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{LogBox as D,NativeModules as M,TurboModuleRegistry as U,NativeEventEmitter as P,Platform as x,AppState as J,Dimensions as z}from"react-native";import{CrashExportFormat as V,CrashType as
|
|
2
|
-
`),n=[];for(const o of r){const t=o.trim();if(!t||t.includes("crashHandler.ts")||t.includes("handleInterceptedCrash")||t.includes("addLogFromCrash")||t.includes("setupGlobalCrashHandler"))continue;const
|
|
3
|
-
`):
|
|
1
|
+
import{LogBox as D,NativeModules as M,TurboModuleRegistry as U,NativeEventEmitter as P,Platform as x,AppState as J,Dimensions as z}from"react-native";import{CrashExportFormat as V,CrashType as h}from"../types/enums";import{addLogFromCrash as G}from"./consoleLogger";import{showNativeFloatingButton as W,setNativeFloatingButtonBadge as Y}from"../native/NativeInspector";import{t as s}from"../i18n";export{V as CrashExportFormat};export const DEFAULT_CRASH_IGNORED_TYPES={js:!0,native:!1,render:!0,promise:!1,custom:!1};let k=[],T=!1,N=0,L="",p=[],g=[];const F=50;let C=100;const Z=Date.now();let _=!1,b={...DEFAULT_CRASH_IGNORED_TYPES},v="fatal_only",B=!0;export const setCrashIgnoredTypesConfig=e=>{b={...b,...e}},getCrashIgnoredTypesConfig=()=>({...b}),setCrashModalTriggerPolicyConfig=e=>{v=e},getCrashModalTriggerPolicyConfig=()=>v,setCrashThrottleDuplicatesConfig=e=>{B=e},applyCrashPolicyPreset=e=>{switch(e){case"max_shield":b={js:!1,native:!1,render:!1,promise:!1,custom:!1};break;case"silent":b={js:!0,native:!0,render:!0,promise:!0,custom:!0};break;default:b={...DEFAULT_CRASH_IGNORED_TYPES};break}return{...b}},setCrashModuleEnabled=e=>{_=e},getCrashModuleEnabled=()=>_,setMaxCrashLogsLimit=e=>{C=Math.max(10,e),p.length>C&&(p=p.slice(0,C))},getMaxCrashLogsLimit=()=>C,pruneCrashRecords=e=>{const r=e!==void 0?Math.max(0,e):Math.floor(p.length/2),n=p.length-r;return n>0&&(p=p.slice(0,r)),g.length>20&&(g=g.slice(0,20)),Math.max(0,n)},addCrashBreadcrumb=(e,r,n)=>{if(_)try{const o={type:e,message:r,timestamp:Date.now(),data:n};g.unshift(o),g.length>F&&(g=g.slice(0,F))}catch{}},recordNavigationBreadcrumb=(e,r)=>{addCrashBreadcrumb("navigation",s("crash.breadcrumbNavigation",{from:e||"/",to:r||"/"}),{from:e,to:r})},recordNetworkBreadcrumb=(e,r,n,o)=>{const t=n!=null?` [${n}]`:"",c=o!=null?` (${Math.round(o)}ms)`:"";addCrashBreadcrumb("network",`${r.toUpperCase()} ${e}${t}${c}`,{url:e,method:r,status:n,duration:o})},recordReduxBreadcrumb=(e,r)=>{addCrashBreadcrumb("redux",s("crash.breadcrumbAction",{actionType:e}),{type:e,payloadSummary:typeof r=="object"&&r!==null?Object.keys(r):typeof r})},recordUserActionBreadcrumb=(e,r)=>{addCrashBreadcrumb("user",e,r)},clearCrashBreadcrumbs=()=>{g=[]},getCrashBreadcrumbs=()=>[...g],parseCrashStackTrace=e=>{if(!e||typeof e!="string")return[];const r=e.split(`
|
|
2
|
+
`),n=[];for(const o of r){const t=o.trim();if(!t||t.includes("crashHandler.ts")||t.includes("handleInterceptedCrash")||t.includes("addLogFromCrash")||t.includes("setupGlobalCrashHandler"))continue;const c=t.match(/^([^@]+)@(.*):(\d+):(\d+)$/);if(c){const[,a,i,d,$]=c,y=i.split("?")[0].split("/").pop()||i,S=!i.includes("node_modules")&&!i.includes("react-native")&&!i.includes("react-dom")&&!i.includes("hermes")&&!i.includes("internal");n.push({method:a.trim(),file:y,lineNumber:parseInt(d,10),column:parseInt($,10),raw:t,isAppCode:S});continue}const l=t.match(/^at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);if(l){const[,a,i,d,$]=l,y=i.split("?")[0].split("/").pop()||i,S=!i.includes("node_modules")&&!i.includes("react-native")&&!i.includes("react-dom")&&!i.includes("internal");n.push({method:a.trim(),file:y,lineNumber:parseInt(d,10),column:parseInt($,10),raw:t,isAppCode:S});continue}const f=t.match(/^at\s+(.+):(\d+):(\d+)$/);if(f){const[,a,i,d]=f,$=a.split("?")[0].split("/").pop()||a,y=!a.includes("node_modules")&&!a.includes("react-native");n.push({method:"<anonymous>",file:$,lineNumber:parseInt(i,10),column:parseInt(d,10),raw:t,isAppCode:y});continue}const m=t.match(/^at\s+([a-zA-Z0-9_$.]+)\(([a-zA-Z0-9_$]+\.java):(\d+)\)$/);if(m){const[,a,i,d]=m,$=!a.startsWith("com.facebook.react")&&!a.startsWith("android.");n.push({method:a,file:i,lineNumber:parseInt(d,10),column:0,raw:t,isAppCode:$});continue}const u=t.match(/^\d+\s+([^\s]+)\s+(0x[0-9a-fA-F]+)\s+(.+)$/);if(u){const[,a,,i]=u,d=!a.startsWith("lib")&&!a.startsWith("Core")&&!a.startsWith("React");n.push({method:i,file:a,lineNumber:0,column:0,raw:t,isAppCode:d});continue}n.push({method:t.startsWith("at ")?t.slice(3):t,file:"runtime",lineNumber:0,column:0,raw:t,isAppCode:!1})}return n};const q=()=>{try{const e=globalThis.performance;if(e&&e.memory)return{usedJSHeapSize:Math.round(e.memory.usedJSHeapSize/(1024*1024)),totalJSHeapSize:Math.round(e.memory.totalJSHeapSize/(1024*1024))}}catch{}},K=()=>{try{const e=z.get("window");return`${Math.round(e.width)}x${Math.round(e.height)} (${e.scale}x)`}catch{return s("crash.unknown")}};export const computeCrashFingerprint=e=>{const r=e.type||"js",n=e.name||"Error",o=e.parsedStack&&e.parsedStack.length>0?e.parsedStack[0]:null,t=o?`${o.file}:${o.lineNumber}`:"unknown";return`${r}_${n}_${t}`},getCrashRecords=()=>[...p],clearCrashRecords=()=>{p=[],emitCrashEvent({error:null,message:"__CLEARED__",timestamp:Date.now()})},subscribeCrashEvents=e=>(k.push(e),()=>{k=k.filter(r=>r!==e)}),emitCrashEvent=e=>{if(e.message!=="__CLEARED__"){const r=Date.now();if(r-N<250)return;N=r}k.forEach(r=>{try{r(e)}catch{}})},handleInterceptedCrash=(e,r,n=!1,o,t,c=!1)=>{try{const l=e instanceof Error||typeof e=="object"&&e!==null?e:new Error(String(e||s("crash.runtimeException"))),f=l.message||(typeof e=="string"?e:s("crash.runtimeException"));let m="";typeof r=="string"?m=r:Array.isArray(r)?m=r.map(w=>`at ${w.methodName||"<anonymous>"} (${w.file||"unknown"}:${w.lineNumber||0}:${w.column||0})`).join(`
|
|
3
|
+
`):m=l.stack||new Error().stack||"";let u=o||h.Js;const a=f.toLowerCase();if(o||(a.includes("native")||a.includes("sigsegv")||a.includes("nsrange")||a.includes("nullpointerexception")||a.includes("fatal signal")?u=h.Native:a.includes("promise")||a.includes("unhandled rejection")||a.includes("unhandledrejection")?u=h.Promise:a.includes("render")||a.includes("errorboundary")||t?u=h.Render:u=h.Js),!c&&!!b[u])return{id:`crash_ignored_${Date.now()}`,isFatal:n,type:u,message:f,timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()};const i=new Date,d=i.toLocaleDateString(),$=i.toLocaleTimeString(),y=parseCrashStackTrace(m),S=`${u}_${f}_${m.slice(0,80)}`,R=Date.now();if(B&&S===L&&R-N<500)return p.length>0&&(p[0].duplicateCount=(p[0].duplicateCount||1)+1),p[0];L=S,N=R;const j=G(l,`[${n?s("crash.logFatalCrash"):s("crash.logUnhandledError")}] ${f}`,m,n),A=typeof globalThis.HermesInternal<"u",H=typeof globalThis.nativeFabricUIManager<"u",I={id:`crash_${Date.now()}_${Math.random().toString(36).substr(2,6)}`,error:l,isFatal:n,type:u,message:f,name:l.name||(n?s("crash.errorNameFatal"):s("crash.errorNameUnhandled")),stack:m,parsedStack:y,componentStack:t||void 0,timestamp:Date.now(),dateStr:d,timeStr:$,deviceInfo:{platform:x.OS,osVersion:String(x.Version),rnVersion:x.constants?.reactNativeVersion?`${x.constants.reactNativeVersion.major}.${x.constants.reactNativeVersion.minor}.${x.constants.reactNativeVersion.patch}`:s("crash.unknown"),isHermes:A,isFabric:H,appState:J.currentState||"active"},memoryInfo:q(),breadcrumbs:[...g],logId:j?.id};p.unshift(I),p.length>C&&(p=p.slice(0,C));let E=!1;v==="all_errors"?E=!0:v==="fatal_only"?E=n||u===h.Native:v==="silent_tab_only"&&(E=!1),emitCrashEvent({error:l,isFatal:n,message:`[${n?s("crash.logFatalCrash"):s("crash.logUnhandledError")}] ${f}`,stack:m,timestamp:Date.now(),logId:j?.id,crashRecord:I,shouldShowModal:E});try{W(),Y(!0)}catch{}return I}catch{return{id:`crash_${Date.now()}`,isFatal:!0,type:h.Js,message:String(e||s("crash.unknownException")),timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()}}},recordCustomCrash=(e,r)=>handleInterceptedCrash(e,typeof e=="object"?e.stack:void 0,r?.isFatal??!1,r?.type||h.Custom,r?.componentStack),triggerGlobalCrashScreen=e=>{emitCrashEvent({error:e.error||new Error(e.message),isFatal:!0,message:e.message,stack:e.stack,timestamp:e.timestamp||Date.now(),logId:e.logId,crashRecord:e})},simulateTestCrash=(e=h.Js,r,n,o=!0)=>{const t=new Error(r||X(e));return handleInterceptedCrash(e===h.Native?t.message:t,n||t.stack,o,e,e===h.Render?Q():void 0,!0)};const X=e=>{switch(e){case"native":return s("crash.simNativeMessage");case"promise":return s("crash.simPromiseMessage");case"render":return s("crash.simRenderMessage");default:return s("crash.simJsMessage")}},Q=()=>{try{const e=new Error;if(e.stack)return e.stack.split(`
|
|
4
4
|
`).slice(1,6).map(r=>` ${r.trim()}`).join(`
|
|
5
|
-
`)}catch{}};export const exportCrashReport=(e,r="text")=>{if(r==="json")return JSON.stringify(e,null,2);const n=Math.round((e.timestamp-Z)/1e3);if(r==="markdown"){const t=[];return t.push(`## ${s("crash.mdReportTitle",{name:e.name||"Error"})}`),t.push(`> **${e.message}**`),t.push(""),t.push(`- **${s("crash.reportType")}** \`${e.type.toUpperCase()}\``),t.push(`- **${s("crash.reportFatal")}** \`${e.isFatal?s("crash.mdSeverityFatal"):s("crash.mdSeverityHandled")}\``),t.push(`- **${s("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),t.push(`- **${s("crash.reportUptime")}** ${n}s`),t.push(`- **${s("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),t.push(`- **${s("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),t.push(`- **${s("crash.jsEngine")}** ${e.deviceInfo?.isHermes?s("crash.hermesEngine"):s("crash.jsc")}`),t.push(`- **${s("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),e.memoryInfo&&t.push(`- **${s("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),t.push(""),t.push(`### ${s("crash.mdStackTrace")}`),t.push("```"),t.push(e.stack||s("crash.reportNoStackTrace")),t.push("```"),e.componentStack&&(t.push(""),t.push(`### ${s("crash.mdComponentHierarchy")}`),t.push("```"),t.push(e.componentStack),t.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(""),t.push(`### ${s("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(
|
|
6
|
-
`)}const o=[];return o.push("===================================================="),o.push(` ${s("crash.reportTitle")} `),o.push("===================================================="),o.push(`${s("crash.reportErrorName")} ${e.name||"Error"}`),o.push(`${s("crash.reportMessage")} ${e.message}`),o.push(`${s("crash.reportType")} ${e.type.toUpperCase()}`),o.push(`${s("crash.reportFatal")} ${e.isFatal?s("crash.reportFatalYes"):s("crash.reportFatalNo")}`),o.push(`${s("crash.reportTimestamp")} ${e.dateStr} ${e.timeStr} (${e.timestamp})`),o.push(`${s("crash.reportUptime")} ${s("crash.reportUptimeValue",{seconds:n})}`),o.push(`${s("crash.reportPlatform")} ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),o.push(`${s("crash.reportReactNative")} ${e.deviceInfo?.rnVersion||"N/A"}`),o.push(`${s("crash.reportHermes")} ${e.deviceInfo?.isHermes?s("crash.reportEnabled"):s("crash.reportDisabled")}`),o.push(`${s("crash.reportArchitecture")} ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),o.push(`${s("crash.reportScreenSize")} ${K()}`),o.push(`${s("crash.reportAppState")} ${e.deviceInfo?.appState||"active"}`),e.memoryInfo&&o.push(`${s("crash.reportJsMemory")} ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),o.push("----------------------------------------------------"),o.push(`${s("crash.reportStackTrace")}`),o.push(e.stack||s("crash.reportNoStackTrace")),e.componentStack&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportComponentHierarchy")}`),o.push(e.componentStack)),e.breadcrumbs&&e.breadcrumbs.length>0&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportRecentBreadcrumbs")}`),e.breadcrumbs.forEach(t=>{const
|
|
7
|
-
`)},setupGlobalCrashHandler=()=>{if(!T){T=!0;try{D&&typeof D.ignoreAllLogs=="function"&&D.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=M?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new P(e).addListener("onNativeCrash",n=>{const t=`[${(n?.platform||x.OS).toUpperCase()} ${s("crash.nativeCrashTitle")}] ${n?.message||s("crash.nativeUncaughtException")}`,
|
|
5
|
+
`)}catch{}};export const exportCrashReport=(e,r="text")=>{if(r==="json")return JSON.stringify(e,null,2);const n=Math.round((e.timestamp-Z)/1e3);if(r==="markdown"){const t=[];return t.push(`## ${s("crash.mdReportTitle",{name:e.name||"Error"})}`),t.push(`> **${e.message}**`),t.push(""),t.push(`- **${s("crash.reportType")}** \`${e.type.toUpperCase()}\``),t.push(`- **${s("crash.reportFatal")}** \`${e.isFatal?s("crash.mdSeverityFatal"):s("crash.mdSeverityHandled")}\``),t.push(`- **${s("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),t.push(`- **${s("crash.reportUptime")}** ${n}s`),t.push(`- **${s("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),t.push(`- **${s("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),t.push(`- **${s("crash.jsEngine")}** ${e.deviceInfo?.isHermes?s("crash.hermesEngine"):s("crash.jsc")}`),t.push(`- **${s("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),e.memoryInfo&&t.push(`- **${s("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),t.push(""),t.push(`### ${s("crash.mdStackTrace")}`),t.push("```"),t.push(e.stack||s("crash.reportNoStackTrace")),t.push("```"),e.componentStack&&(t.push(""),t.push(`### ${s("crash.mdComponentHierarchy")}`),t.push("```"),t.push(e.componentStack),t.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(""),t.push(`### ${s("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(c=>{const l=new Date(c.timestamp).toLocaleTimeString();t.push(`- \`[${l}]\` **[${c.type.toUpperCase()}]** ${c.message}`)})),t.join(`
|
|
6
|
+
`)}const o=[];return o.push("===================================================="),o.push(` ${s("crash.reportTitle")} `),o.push("===================================================="),o.push(`${s("crash.reportErrorName")} ${e.name||"Error"}`),o.push(`${s("crash.reportMessage")} ${e.message}`),o.push(`${s("crash.reportType")} ${e.type.toUpperCase()}`),o.push(`${s("crash.reportFatal")} ${e.isFatal?s("crash.reportFatalYes"):s("crash.reportFatalNo")}`),o.push(`${s("crash.reportTimestamp")} ${e.dateStr} ${e.timeStr} (${e.timestamp})`),o.push(`${s("crash.reportUptime")} ${s("crash.reportUptimeValue",{seconds:n})}`),o.push(`${s("crash.reportPlatform")} ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),o.push(`${s("crash.reportReactNative")} ${e.deviceInfo?.rnVersion||"N/A"}`),o.push(`${s("crash.reportHermes")} ${e.deviceInfo?.isHermes?s("crash.reportEnabled"):s("crash.reportDisabled")}`),o.push(`${s("crash.reportArchitecture")} ${e.deviceInfo?.isFabric?s("crash.reportFabricNew"):s("crash.reportPaperLegacy")}`),o.push(`${s("crash.reportScreenSize")} ${K()}`),o.push(`${s("crash.reportAppState")} ${e.deviceInfo?.appState||"active"}`),e.memoryInfo&&o.push(`${s("crash.reportJsMemory")} ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),o.push("----------------------------------------------------"),o.push(`${s("crash.reportStackTrace")}`),o.push(e.stack||s("crash.reportNoStackTrace")),e.componentStack&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportComponentHierarchy")}`),o.push(e.componentStack)),e.breadcrumbs&&e.breadcrumbs.length>0&&(o.push("----------------------------------------------------"),o.push(`${s("crash.reportRecentBreadcrumbs")}`),e.breadcrumbs.forEach(t=>{const c=new Date(t.timestamp).toLocaleTimeString();o.push(` [${c}] [${t.type.toUpperCase()}] ${t.message}`)})),o.push("===================================================="),o.join(`
|
|
7
|
+
`)},setupGlobalCrashHandler=()=>{if(!T){T=!0;try{D&&typeof D.ignoreAllLogs=="function"&&D.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=M?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new P(e).addListener("onNativeCrash",n=>{const t=`[${(n?.platform||x.OS).toUpperCase()} ${s("crash.nativeCrashTitle")}] ${n?.message||s("crash.nativeUncaughtException")}`,c=n?.stack||"";handleInterceptedCrash(t,c,!0,"native")}))}catch{}try{const e=U||globalThis.__turboModuleProxy,r=M?.ExceptionsManager||(e?.get?e.get("ExceptionsManager"):null);if(r){r.reportFatalException=(o,t,c)=>{handleInterceptedCrash(o,t,!0,"native");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportSoftException=(o,t,c)=>{handleInterceptedCrash(o,t,!1,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.reportException=o=>{const t=o?.message||o?.title||s("crash.nativeException"),c=o?.stack||o?.rawStack;handleInterceptedCrash(t,c,o?.isFatal??!0,"js");try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}},r.updateExceptionMessage=()=>{};try{typeof r.dismissRedbox=="function"&&r.dismissRedbox()}catch{}}const n=M?.RedBox||M?.RCTRedBox||(e?.get?e.get("RedBox")||e.get("RCTRedBox"):null);n&&(typeof n.showErrorMessage=="function"&&(n.showErrorMessage=()=>{}),typeof n.showUserError=="function"&&(n.showUserError=()=>{}),typeof n.dismiss=="function"&&n.dismiss())}catch{}try{const r=globalThis.ErrorUtils;r&&(typeof r.setGlobalHandler=="function"&&r.setGlobalHandler((n,o)=>{handleInterceptedCrash(n,n?.stack,o??!1,"js")}),typeof r.reportFatalError=="function"&&(r.reportFatalError=n=>{handleInterceptedCrash(n,n?.stack,!0,"js")}),typeof r.reportError=="function"&&(r.reportError=n=>{handleInterceptedCrash(n,n?.stack,!1,"js")}))}catch{}try{const e=globalThis,r=n=>{try{const o=n?.reason||n?.detail?.reason||n,t=o?.stack||(n?.stack??new Error().stack);handleInterceptedCrash(o,t,!1,"promise")}catch{}};typeof e.addEventListener=="function"&&e.addEventListener("unhandledrejection",r),typeof e.onunhandledrejection<"u"&&(e.onunhandledrejection=r)}catch{}}};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InspectedElementInfo, UiInspectorSubTab } from '../types';
|
|
2
|
+
type UiInspectorListener = (state: UiInspectorState) => void;
|
|
3
|
+
export interface UiInspectorState {
|
|
4
|
+
isInspectModeActive: boolean;
|
|
5
|
+
selectedElement: InspectedElementInfo | null;
|
|
6
|
+
activeSubTab: UiInspectorSubTab;
|
|
7
|
+
showAlignmentGrid: boolean;
|
|
8
|
+
showDistanceGuides: boolean;
|
|
9
|
+
history: InspectedElementInfo[];
|
|
10
|
+
tweakedStyles: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
export declare function subscribeUiInspectorState(listener: UiInspectorListener): () => void;
|
|
13
|
+
export declare function getUiInspectorState(): UiInspectorState;
|
|
14
|
+
export declare function setInspectModeActive(active: boolean): void;
|
|
15
|
+
export declare function setSelectedUiElement(element: InspectedElementInfo | null): void;
|
|
16
|
+
export declare function setUiInspectorSubTab(subTab: UiInspectorSubTab): void;
|
|
17
|
+
export declare function toggleAlignmentGrid(show?: boolean): void;
|
|
18
|
+
export declare function toggleDistanceGuides(show?: boolean): void;
|
|
19
|
+
export declare function applyLiveStyleOverride(key: string, value: any): void;
|
|
20
|
+
export declare function resetLiveStyleOverrides(): void;
|
|
21
|
+
export declare function clearUiInspectorHistory(): void;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e={isInspectModeActive:!1,selectedElement:null,activeSubTab:"styles",showAlignmentGrid:!1,showDistanceGuides:!0,history:[],tweakedStyles:{}};const i=new Set;function s(){const t={...e,history:[...e.history],tweakedStyles:{...e.tweakedStyles}};i.forEach(n=>{try{n(t)}catch(o){console.warn("[UIInspector] Listener notification error:",o)}})}export function subscribeUiInspectorState(t){return i.add(t),t(e),()=>{i.delete(t)}}export function getUiInspectorState(){return e}export function setInspectModeActive(t){e.isInspectModeActive=t,s()}export function setSelectedUiElement(t){e.selectedElement=t,t?(e.tweakedStyles={...t.tweakedStyles},e.history.some(n=>n.id===t.id)||(e.history=[t,...e.history.slice(0,19)])):e.tweakedStyles={},s()}export function setUiInspectorSubTab(t){e.activeSubTab=t,s()}export function toggleAlignmentGrid(t){e.showAlignmentGrid=typeof t=="boolean"?t:!e.showAlignmentGrid,s()}export function toggleDistanceGuides(t){e.showDistanceGuides=typeof t=="boolean"?t:!e.showDistanceGuides,s()}export function applyLiveStyleOverride(t,n){e.tweakedStyles={...e.tweakedStyles,[t]:n},e.selectedElement&&(e.selectedElement={...e.selectedElement,tweakedStyles:{...e.tweakedStyles},flattenedStyles:{...e.selectedElement.originalStyles,...e.tweakedStyles}}),s()}export function resetLiveStyleOverrides(){e.tweakedStyles={},e.selectedElement&&(e.selectedElement={...e.selectedElement,tweakedStyles:{},flattenedStyles:{...e.selectedElement.originalStyles}}),s()}export function clearUiInspectorHistory(){e.history=[],s()}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import{Platform as
|
|
1
|
+
import{Platform as b,ToastAndroid as y,Alert as P,NativeModules as u,Linking as x}from"react-native";import N from"@react-native-clipboard/clipboard";import{showToast as w}from"./toast";import{copyMediaToClipboard as E}from"../native/NativeInspector";import{AppColors as c}from"../styles/AppColors";import{DOMAIN_COLORS as C,DURATION_FAST_MS as M,DURATION_SLOW_MS as T}from"../constants";export*from"./searchQueryParser";export*from"./memoryManager";export*from"./toast";export const isLocalDebugEnvironment=()=>{const e=typeof __DEV__<"u"&&!!__DEV__,t=u.SourceCode?.scriptURL||"",n=t.startsWith("http://")||t.startsWith("https://")||t.includes(":8081")||t.includes(":8082");return e||n},getDomainColor=e=>{if(!e)return C[0];let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return C[Math.abs(t)%C.length]},formatDateTime=e=>{const t=new Date(e),n=(d,l=2)=>String(d).padStart(l,"0"),r=n(t.getDate()),o=n(t.getMonth()+1),s=t.getFullYear(),i=n(t.getHours()),a=n(t.getMinutes()),p=n(t.getSeconds());return`${r}/${o}/${s} ${i}:${a}:${p}`},formatTimestamp=e=>{try{const t=new Date(e),n=t.getHours().toString().padStart(2,"0"),r=t.getMinutes().toString().padStart(2,"0"),o=t.getSeconds().toString().padStart(2,"0"),s=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${r}:${o}.${s}`}catch{return"\u2014"}},getStatusColor=e=>!e||e===0?c.errorColor:e>=500?c.errorColor:e>=400?c.darkOrange:e>=300?c.warningIconGold:c.greenColor,getDurationColor=e=>e==null?c.grayTextWeak:e<M?c.greenColor:e<T?c.lightOrange:c.errorColor,getSize=e=>{try{const t=JSON.stringify(e)?.length??0;return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}catch{return"\u2014"}},formatBytes=e=>{if(e===0||!e||isNaN(e))return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(1))} ${n[r]||"B"}`},formatByteSize=e=>!e||e<=0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`,copyToClipboard=(e,t)=>{const n=typeof e=="function"?e():e;let r="";if(typeof n=="string")r=n;else try{r=JSON.stringify(n,null,2)}catch{r=String(n)}try{typeof N?.setString=="function"?N.setString(r):typeof N?.default?.setString=="function"&&N.default.setString(r)}catch(o){__DEV__&&console.warn("[NetworkInspector] Clipboard.setString failed:",o)}try{w(t?`${t} copied to clipboard`:"Copied to clipboard")}catch{}try{b.OS==="android"&&y?.show&&y.show(t?`${t} copied to clipboard`:"Copied to clipboard",y.SHORT)}catch{}},copyImageOrMediaToClipboard=async(e,t="Image")=>{if(!e)return;let n=!1;try{n=await E(e)}catch{n=!1}if(!n){copyToClipboard(e,t);return}try{w(`${t} copied to clipboard`)}catch{}try{b.OS==="android"&&y?.show&&y.show(`${t} copied to clipboard`,y.SHORT)}catch{}},getPath=e=>{try{const t=new URL(e);return t.pathname+(t.search?t.search:"")}catch{return e.replace(/^https?:\/\/[^/?#]+/,"")||"/"}},getBaseUrl=e=>{try{const t=new URL(e);return`${t.protocol}//${t.host}`}catch{const t=e.match(/^(https?:\/\/[^/]+)/);return t?t[1]:""}},getCurlCommand=e=>{let t=`curl -X ${e.method} "${e.url}"`;if(e.requestHeaders&&Object.entries(e.requestHeaders).forEach(([n,r])=>{t+=` \\
|
|
2
2
|
-H "${n}: ${r}"`}),e.request&&e.method!=="GET"){const n=typeof e.request=="string"?e.request:JSON.stringify(e.request);t+=` \\
|
|
3
|
-
-d '${n.replace(/'/g,"'\\''")}'`}return t},getFetchCommand=e=>{const t={method:e.method};return e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(t.headers=e.requestHeaders),e.request&&e.method!=="GET"&&(t.body=JSON.stringify(e.request)),`fetch("${e.url}", ${JSON.stringify(t,null,2)})`},getPostmanRequestJson=e=>{let t;try{const s=new URL(e.url),i=s.hostname.split("."),a=s.pathname.replace(/^\//,"").split("/").filter(Boolean),p=[];s.searchParams.forEach((d,l)=>{p.push({key:l,value:d})}),t={raw:e.url,host:i,path:a,query:p.length>0?p:void 0}}catch{t={raw:e.url}}const n=[];e.requestHeaders&&typeof e.requestHeaders=="object"&&Object.entries(e.requestHeaders).forEach(([s,i])=>{n.push({key:s,value:String(i),type:"text"})});let r;if(e.request){const s=e.request;let i="";if(typeof s=="object")try{i=JSON.stringify(s,null,2)}catch{i=String(s)}else i=String(s);r={mode:"raw",raw:i,options:{raw:{language:"json"}}}}const o={info:{name:`${e.method} ${getPath(e.url)||e.url}`,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",_exporter_id:"inapp-inspector"},item:[{name:`${e.method} ${getPath(e.url)||e.url}`,request:{method:e.method||"GET",header:n,body:r,url:t,description:"Captured by React Native In-App Inspector"},response:[]}]};return JSON.stringify(o,null,2)},openWithPostman=async(e,t)=>{const n=getCurlCommand(e)
|
|
3
|
+
-d '${n.replace(/'/g,"'\\''")}'`}return t},getFetchCommand=e=>{const t={method:e.method};return e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(t.headers=e.requestHeaders),e.request&&e.method!=="GET"&&(t.body=JSON.stringify(e.request)),`fetch("${e.url}", ${JSON.stringify(t,null,2)})`},getPostmanRequestJson=e=>{let t;try{const s=new URL(e.url),i=s.hostname.split("."),a=s.pathname.replace(/^\//,"").split("/").filter(Boolean),p=[];s.searchParams.forEach((d,l)=>{p.push({key:l,value:d})}),t={raw:e.url,host:i,path:a,query:p.length>0?p:void 0}}catch{t={raw:e.url}}const n=[];e.requestHeaders&&typeof e.requestHeaders=="object"&&Object.entries(e.requestHeaders).forEach(([s,i])=>{n.push({key:s,value:String(i),type:"text"})});let r;if(e.request){const s=e.request;let i="";if(typeof s=="object")try{i=JSON.stringify(s,null,2)}catch{i=String(s)}else i=String(s);r={mode:"raw",raw:i,options:{raw:{language:"json"}}}}const o={info:{name:`${e.method} ${getPath(e.url)||e.url}`,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",_exporter_id:"inapp-inspector"},item:[{name:`${e.method} ${getPath(e.url)||e.url}`,request:{method:e.method||"GET",header:n,body:r,url:t,description:"Captured by React Native In-App Inspector"},response:[]}]};return JSON.stringify(o,null,2)},openWithPostman=async(e,t)=>{const n=getCurlCommand(e);N.setString(n);const r=s=>{t?t(s):w(s)},o="postman://";try{if(await x.canOpenURL(o))try{await x.openURL(o),r("Opened Postman (cURL copied to clipboard)");return}catch{}}catch{}r("cURL copied! Ready to paste into Postman")},deduplicateLogs=e=>{const t=new Map;return e.forEach(n=>{if(!t.has(n.id))t.set(n.id,n);else{const r=t.get(n.id);(r.status==null&&n.status!=null||(n.startTime??0)>=(r.startTime??0))&&t.set(n.id,n)}}),Array.from(t.values()).sort((n,r)=>r.id-n.id)},escapeRegex=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),getNavigationInfo=(e,t=[])=>{if(!e)return{path:t.length>0?t.join(" \u2794 "):"",params:null};if(e.name&&!e.routes)return{path:t.length>0?[...t,e.name].join(" \u2794 "):e.name,params:e.params||null};if(!e.routes||!Array.isArray(e.routes)||e.routes.length===0)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const n=typeof e.index=="number"&&e.index>=0&&e.index<e.routes.length?e.index:0,r=e.routes[n];if(!r)return{path:t.length>0?t.join(" \u2794 "):"",params:null};const o=r.name?[...t,r.name]:t;return r?.state?getNavigationInfo(r.state,o):{path:o.length>0?o.join(" \u2794 "):r.name||"",params:r.params||null}},getLogPageName=(e,t)=>{const n=t||e?.routeInfo;if(n&&n.path&&n.path!=="Navigators"){const r=n.path.split(" \u2794 ").map(o=>o.trim()).filter(Boolean);return r.length>0?r[r.length-1]:n.path}if(e.caller&&e.caller!=="Unknown")try{const r=e.caller.match(/([^/\\]+)\.(tsx|jsx|ts|js)/i);if(r&&r[1]){const o=r[1];if(!["networklogger","fetch","axios","apiclient","request","http","index","nativeinspector","inappinspector","bundleanalyzer"].includes(o.toLowerCase()))return o}}catch{}if(e.url)try{const o=e.url.split("?")[0].split("#")[0].replace(/^https?:\/\//i,""),s=o.indexOf("/");if(s!==-1){const a=o.substring(s+1).split("/").filter(Boolean),p=["api","v1","v2","v3","v4","rest","graphql","json","data","service","app"],d=a.filter(l=>!p.includes(l.toLowerCase()));if(d.length>0){const l=d[0];return l.charAt(0).toUpperCase()+l.slice(1)}}const i=o.split("/")[0];if(i)return i}catch{}return"General"},flattenObject=(e,t="")=>{let n={};return typeof e=="object"&&e!==null?Array.isArray(e)?e.forEach((r,o)=>{Object.assign(n,flattenObject(r,t?`${t}[${o}]`:`[${o}]`))}):Object.keys(e).forEach(r=>{Object.assign(n,flattenObject(e[r],t?`${t}.${r}`:r))}):n[t||"root"]=e,n},getDiff=(e,t)=>{const n=flattenObject(e),r=flattenObject(t),o=[];return new Set([...Object.keys(n),...Object.keys(r)]).forEach(i=>{i in n?i in r?n[i]!==r[i]&&o.push({type:"changed",path:i,oldVal:n[i],newVal:r[i]}):o.push({type:"removed",path:i,oldVal:n[i]}):o.push({type:"added",path:i,newVal:r[i]})}),o.sort((i,a)=>i.path.localeCompare(a.path))},formatDisplayUrl=e=>e?e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`:"",getLocalizedFilePath=(e,t,n)=>e.replace("country-language",`${t?.toLowerCase()}-${n?.toLowerCase()}`),getLocalizedFilePathWithSlash=(e,t,n)=>e.replace("country/language",`${t?.toLowerCase()}/${n?.toLowerCase()}`),isAllValuesEmpty=e=>!e||typeof e!="object"?!0:Object.values(e).every(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0),formatDateTimeToAnalytics=e=>new Date(e)?.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),getBundleIdentifier=()=>{const e=u.RNDeviceInfo;if(e&&typeof e.bundleId=="string")return e.bundleId;if(e&&typeof e.getBundleId=="function")try{const o=e.getBundleId();if(typeof o=="string")return o}catch{}const t=u.ExponentConstants;if(t&&t.manifest){const o=t.manifest;if(o.ios&&o.ios.bundleIdentifier)return o.ios.bundleIdentifier;if(o.android&&o.android.package)return o.android.package}const n=u.ExpoApplication;if(n&&typeof n.applicationId=="string")return n.applicationId;const r=u.SourceCode;if(r&&typeof r.scriptURL=="string"){const o=r.scriptURL;if(o.includes("assets/"))try{const s=o.match(/assets\/([^/?#]+)/);if(s&&s[1])return s[1]}catch{}}return"org.reactjs.native.example"},getAppName=()=>{const e=u.PlatformConstants;e&&e.interfaceIdiom;const t=u.RNDeviceInfo;if(t&&typeof t.appName=="string")return t.appName;const n=u.NetworkInspectorModule;if(n&&typeof n.appName=="string"&&n.appName.length>0&&n.appName!=="App")return n.appName;const r=u.ExpoApplication;if(r&&typeof r.applicationName=="string")return r.applicationName;const o=u.ExponentConstants;if(o&&o.manifest){const a=o.manifest;if(a.name)return a.name}const s=u.AppInfo;if(s&&typeof s.appName=="string")return s.appName;const i=getBundleIdentifier();if(i&&i!=="org.reactjs.native.example"){const a=i.split("."),p=a[a.length-1];return p?p.charAt(0).toUpperCase()+p.slice(1):"App"}return"App"},getAppVersionAndBuild=()=>{let e="",t="";const n=u.NetworkInspectorModule;if(n&&(typeof n.appVersion=="string"&&n.appVersion.length>0&&(e=n.appVersion),typeof n.appBuild=="string"&&n.appBuild.length>0&&(t=n.appBuild)),!e||!t){const r=u.ExpoApplication;r&&(!e&&typeof r.nativeAppVersion=="string"&&(e=r.nativeAppVersion),!t&&typeof r.nativeBuildVersion=="string"&&(t=r.nativeBuildVersion))}if(!e||!t){const r=u.ExponentConstants;if(r){const o=r.manifest||r.expoConfig;o&&(!e&&o.version&&(e=String(o.version)),t||(o.ios?.buildNumber?t=String(o.ios.buildNumber):o.android?.versionCode&&(t=String(o.android.versionCode))))}}if(!e||!t){const r=u.RNDeviceInfo;if(r){if(!e){if(typeof r.appVersion=="string")e=r.appVersion;else if(typeof r.getVersion=="function")try{e=r.getVersion()}catch{}}if(!t){if(typeof r.buildNumber=="string")t=r.buildNumber;else if(typeof r.getBuildNumber=="function")try{t=r.getBuildNumber()}catch{}}}}if(!e||!t){const r=u.AppInfo;r&&(!e&&typeof r.versionName=="string"&&(e=r.versionName),!t&&typeof r.versionCode=="string"&&(t=r.versionCode))}if(!e){const r=b.constants||u.PlatformConstants;r&&r.Version&&typeof r.Version=="string"&&r.Version.includes(".")&&(e=r.Version)}return e||(e="1.0"),t||(t="1"),{version:e,build:t,formatted:`${e} (${t})`}},handleOpenExternalLink=e=>{if(!e)return;const t=formatDisplayUrl(e);P.alert("Open Link",`Do you want to open this link in your web browser?
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
${t}`,[{text:"Cancel",style:"cancel"},{text:"Open",onPress:()=>{y.openURL(t).catch(()=>{})}}])},formatTimeShort=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${n}:${r}:${o}`},formatTime=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0"),s=String(t.getMilliseconds()).padStart(3,"0");return`${n}:${r}:${o}.${s}`},formatGap=e=>{if(e<1e3)return`+${e}ms`;const t=Math.round(e/1e3);if(t<60)return`+${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`+${n}m ${r}s`:`+${n}m`},getJsonContent=e=>{if(!e)return null;const t=[];for(let n=0;n<e.length;n++)(e[n]==="{"||e[n]==="[")&&t.push(n);for(const n of t){const r=e.substring(n).trim();try{const o=JSON.parse(r);if(o!==null&&typeof o=="object")return{header:e.substring(0,n).trim(),data:o}}catch{}}return null},getJsonPreviewText=(e,t=4)=>{try{const n=JSON.stringify(e,null,2),r=n.split(`
|
|
5
|
+
${t}`,[{text:"Cancel",style:"cancel"},{text:"Open",onPress:()=>{x.openURL(t).catch(()=>{})}}])},formatTimeShort=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${n}:${r}:${o}`},formatTime=e=>{const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0"),s=String(t.getMilliseconds()).padStart(3,"0");return`${n}:${r}:${o}.${s}`},formatGap=e=>{if(e<1e3)return`+${e}ms`;const t=Math.round(e/1e3);if(t<60)return`+${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`+${n}m ${r}s`:`+${n}m`},getJsonContent=e=>{if(!e)return null;const t=[];for(let n=0;n<e.length;n++)(e[n]==="{"||e[n]==="[")&&t.push(n);for(const n of t){const r=e.substring(n).trim();try{const o=JSON.parse(r);if(o!==null&&typeof o=="object")return{header:e.substring(0,n).trim(),data:o}}catch{}}return null},getJsonPreviewText=(e,t=4)=>{try{const n=JSON.stringify(e,null,2),r=n.split(`
|
|
8
6
|
`);return r.length>t?{text:r.slice(0,t).join(`
|
|
9
7
|
`)+`
|
|
10
|
-
...`,hasMore:!0}:{text:n,hasMore:!1}}catch{return{text:String(e),hasMore:!1}}},parseStackLine=(e,t=!1)=>{let n=e.trim().replace(/^at /,"");if(n.includes("@")){const
|
|
8
|
+
...`,hasMore:!0}:{text:n,hasMore:!1}}catch{return{text:String(e),hasMore:!1}}},parseStackLine=(e,t=!1)=>{let n=e.trim().replace(/^at /,"");if(n.includes("@")){const A=n.indexOf("@"),B=n.substring(0,A).trim(),L=n.substring(A+1).trim();n=B?`${B} (${L})`:L}const r=n.match(/^(.*?)\s*\((.*?)\)$/);let o="<anonymous>",s=n;r&&(o=r[1].trim()||"<anonymous>",s=r[2].trim()),(o.startsWith("?anon_")||o==="?")&&(o="anonymous"),s=s.replace(/^address at /,"");const i=s.match(/^(.*?):(\d+):(\d+)$/);let a=s,p,d;i&&(a=i[1],p=i[2],d=i[3]);let l=a.replace(/[?&].*$/,"").replace(/[)]+$/,"").replace(/\/\/+$/,"");l=l.replace(/^(?:https?:\/\/[^\/]+\/|file:\/\/\/|webpack:\/\/\/?)/,"");let f=l.split("/").filter(Boolean).pop()||l;f=f.replace(/[?&].*$/,"").replace(/[)]+$/,""),(f.startsWith("&")||f.startsWith("?")||f.startsWith("platform=")||f.includes("platform=")||f.startsWith("dev=")||f.includes("dev="))&&(f="Unknown",l="Unknown");const S=f.match(/\.([a-z0-9]+)$/i),m=S?S[1].toLowerCase():"",g=m==="tsx"||m==="jsx"||m==="ts"||m==="js"?m:"other",$=s==="native"||l==="native",v=l.includes("InternalBytecode")||l.includes("metro-runtime")||l.includes("regenerator-runtime")||o==="tryCallOne"||o==="asyncGeneratorStep"||o==="_next"||o==="next"&&$,O=l.includes("node_modules")||l.includes("react-native/Libraries")||l.includes("react-native-inapp-inspector")&&!l.includes("/example/"),I=!$&&!v&&!O&&(g==="tsx"||g==="jsx"||g==="ts"||g==="js"||!f.includes(".bundle")&&f!=="Unknown"),R=I?"app":O?"dependency":$?"native":"runtime",U=v||$||o==="asyncGeneratorStep"||o==="_next";let h=l;h.includes("/example/")?h=h.substring(h.indexOf("/example/")+9):h.includes("/src/")?h=h.substring(h.indexOf("/src/")+1):h.includes("/node_modules/")&&(h=h.substring(h.indexOf("/node_modules/")+14));const _=p?`${f}:${p}${d?`:${d}`:""}`:f;return{raw:e,functionName:o,fileName:f,fullPath:h,rawFilePath:a,fileExt:g,frameType:R,isUserCode:I,isRuntimeNoise:U,lineNumber:p,columnNumber:d,isOrigin:t,copyableLocation:_}},getCleanCallerDisplay=e=>{if(!e||e==="Unknown"||e.trim()==="")return null;const t=e.trim();if(t.startsWith("&platform")||t.startsWith("?platform")||t.startsWith("&")||t.includes("&platform=")||t.includes("?platform=")){const s=t.match(/^(.*?)\s*[\(@]/);if(s&&s[1]&&!s[1].includes("&")&&!s[1].includes("platform")){const i=s[1].trim();if(i&&i!=="<anonymous>"&&i!=="anonymous"&&!i.startsWith("?anon_"))return{fileName:i,functionName:i,display:i}}return null}const n=parseStackLine(e,!0);if(!n)return null;if(n.fileName.includes(".bundle")||n.fileName.includes("platform=")||n.fileName.startsWith("&")||n.fileName.startsWith("?")||n.fileName==="index.bundle"||n.fileName==="bundle"||n.fileName==="Unknown")return n.functionName&&n.functionName!=="<anonymous>"&&n.functionName!=="anonymous"&&!n.functionName.startsWith("?")&&!n.functionName.startsWith("_callee")&&!n.functionName.includes("regeneratorRuntime")?{fileName:n.functionName,lineNumber:n.lineNumber,functionName:n.functionName,display:n.functionName}:null;const o=n.lineNumber?`${n.fileName}:${n.lineNumber}`:n.fileName;return{fileName:n.fileName,lineNumber:n.lineNumber,functionName:n.functionName,display:o}},openInVSCode=(e,t,n)=>{const r=t?Number(t):1,o=n?Number(n):1,s=t?`:${t}`:"",i=n?`:${n}`:"",a=e.replace(/^file:\/\//,"");let p=null;try{const m=u?.SourceCode?.scriptURL||u?.PlatformConstants?.serverHost||u?.DevSettings?.serverHost;if(typeof m=="string"&&m.length>0){const g=m.match(/^(https?:\/\/[^/]+)/);g?p=g[1]:!m.startsWith("http")&&m.includes(":")&&(p=`http://${m}`)}}catch{}Array.from(new Set([...p?[p]:[],"http://localhost:8081","http://127.0.0.1:8081","http://10.0.2.2:8081"])).forEach(m=>{try{fetch(`${m}/open-stack-frame`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:a,lineNumber:r,column:o})}).catch(()=>{})}catch{}});const l=`vscode://file/${a.replace(/^\/+/,"")}${s}${i}`,f=`cursor://file/${a.replace(/^\/+/,"")}${s}${i}`,S=`vscode-insiders://file/${a.replace(/^\/+/,"")}${s}${i}`;x.openURL(l).catch(()=>{x.openURL(f).catch(()=>{x.openURL(S).catch(()=>{copyToClipboard(`${a}${s}${i}`,"Location")})})})},ANALYTICS_EVENT_PALETTE=[c.googleBlue,c.googleGreen,c.googlePurple,c.googleTeal,c.googleRed,c.googleOrange,c.blue700,c.materialGreen],getEventColor=e=>{const t=typeof e=="string"?e:String(e||"");let n=0;for(let r=0;r<t.length;r++)n=n*31+t.charCodeAt(r)|0;return ANALYTICS_EVENT_PALETTE[Math.abs(n)%ANALYTICS_EVENT_PALETTE.length]};export{getEventCategory,registerGAPlugin}from"./gaAnalyticsRegistry";export const getCategoryColors=e=>{switch(e){case"page_view":case"Page View":return{bg:c.blueBg,border:c.blueBorder,text:c.blue800};case"ecommerce":case"Ecommerce":return{bg:c.greenBg,border:c.greenBorder,text:c.materialGreen};case"system":case"System":return{bg:c.greyBg,border:c.greyBorder,text:c.grey600};default:return{bg:c.purpleBg,border:c.purpleBorder,text:c.purpleText}}},getRuntimeDiagnostics=()=>{const e=typeof global.HermesInternal<"u",t=typeof global._v8runtime<"u",n=e?"hermes":t?"v8":"jsc",o=typeof global.nativeFabricUIManager<"u"||!!global.__turboModuleProxy?"fabric":"paper";let s=32.4,i=64;try{const a=global.HermesInternal?.getInstrumentedStats?.();a?.js_heap_size?(s=Number((a.js_heap_size/(1024*1024)).toFixed(1)),i=Number(((a.js_allocated_bytes||a.js_heap_size*1.6)/(1024*1024)).toFixed(1))):global.performance?.memory?.usedJSHeapSize&&(s=Number((global.performance.memory.usedJSHeapSize/(1024*1024)).toFixed(1)),i=Number((global.performance.memory.totalJSHeapSize/(1024*1024)).toFixed(1)))}catch{}return{engineType:n,archType:o,usedHeapMb:s,totalAllocMb:i}},isUrlHidden=(e,t)=>{if(!e||!t||t.length===0)return!1;const n=e.trim();if(!n)return!1;const r=n.toLowerCase();for(let o=0;o<t.length;o++){const s=t[o]?.trim();if(!s)continue;const i=s.toLowerCase();if(r.includes(i))return!0;const a=i.replace(/^https?:\/\//,""),p=r.replace(/^https?:\/\//,"");if(a&&p.includes(a))return!0;if(s.includes("*"))try{const d=s.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");if(new RegExp(d,"i").test(n))return!0}catch{}try{if(new RegExp(s,"i").test(n))return!0}catch{}}return!1};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const d=["apis","logs","perf","analytics","redux","storage","device","crash","
|
|
1
|
+
const d=["apis","logs","perf","analytics","redux","storage","device","crash","media","socket"];let u=null;export function getFirebaseRemoteConfig(e){if(e&&typeof e=="object")return u=e,e;if(u)return u;try{const n=require("@react-native-firebase/remote-config"),t=typeof n.default=="function"?n.default():typeof n=="function"?n():n;return u=t,t}catch{return null}}export function isFirebaseRemoteConfigAvailable(e){return!!getFirebaseRemoteConfig(e)}function l(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}}}}export async function fetchRemoteConfigSettings(e,n=8e3){const t=getFirebaseRemoteConfig(e);if(!t)return null;try{const y=(async()=>{typeof t.fetchAndActivate=="function"?await t.fetchAndActivate():(typeof t.fetch=="function"&&await t.fetch(),typeof t.activate=="function"&&await t.activate())})(),_=new Promise((o,r)=>setTimeout(()=>r(new Error("Remote Config fetch timeout")),n));await Promise.race([y,_]).catch(()=>{});const s=o=>{if(typeof t.getValue=="function")try{return t.getValue(o)}catch{return}return t[o]},f={},i={},b=["inspector_modules","inapp_inspector_modules","react_native_inapp_inspector_modules"];for(const o of b){const r=s(o),c=l(r);if(c&&typeof c=="object")for(const a of d)typeof c[a]=="boolean"&&(i[a]=c[a])}for(const o of d){const r=[`inspector_module_${o}`,`inapp_inspector_${o}`,`inspector_${o}`,`inapp_inspector_module_${o}`,`rn_inspector_${o}`];for(const c of r){const a=s(c),p=l(a);if(typeof p=="boolean"){i[o]=p;break}}}Object.keys(i).length>0&&(i.apis===void 0&&(i.apis=!0),f.modules=i);const m=["inspector_capture_widget_enabled","inapp_inspector_capture_widget","inspector_floating_capture_enabled"];for(const o of m){const r=l(s(o));if(typeof r=="boolean"){f.captureWidgetEnabled=r;break}}const g=["inspector_enabled","inapp_inspector_enabled"];for(const o of g){const r=l(s(o));if(typeof r=="boolean"){f.enabled=r;break}}return Object.keys(f).length>0?f:null}catch{return null}}export 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
|
-
import{markSearchFilterUsed as
|
|
2
|
-
`):
|
|
3
|
-
`)},
|
|
4
|
-
${
|
|
5
|
-
${
|
|
1
|
+
import{markSearchFilterUsed as _}from"./telemetry";const A=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 J(t){const h=[],B=/[^\s"']+|"([^"]*)"|'([^']*)'/g;let p;for(;(p=B.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}export function matchNetworkLogQuery(t,h,B,p){if(!h||h.trim().length===0)return!0;_();const I=!!p?.isCaseSensitive,P=!!p?.isRegex,v=p?.scope||"all",x=t.method||"",O=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,N=t.client||"",q=t.caller||"",W=B||t?.routeInfo?.path||"",H=o=>{if(o==null)return"";if(typeof o=="string")return o;try{return JSON.stringify(o)}catch{return""}},$=H(t.request),j=H(t.response),b=(o,w=!1)=>{if(!o||typeof o!="object")return"";const c=Object.entries(o);return w?c.map(([s,y])=>`${s}: ${y}`).join(`
|
|
2
|
+
`):c.filter(([s])=>!A.has(s.toLowerCase())).map(([s,y])=>`${s}: ${y}`).join(`
|
|
3
|
+
`)},L=b(t.requestHeaders,v==="headers"),g=b(t.responseHeaders,v==="headers"),u=(o=>{switch(o){case"url":return O;case"reqBody":return $;case"resBody":return j;case"headers":return`${L}
|
|
4
|
+
${g}`;default:return[O,x,R,W,N,q,$,j,L,g].join(" ")}})(v),r=(o,w)=>{if(P)try{return new RegExp(w,I?"":"i").test(o)}catch{}return I?o.includes(w):o.toLowerCase().includes(w.toLowerCase())},S=J(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 y=c.indexOf(":");if(y>0){const n=c.slice(0,y).toLowerCase(),f=c.slice(y+1);if(n==="url"||n==="u"||n==="path")s=r(O,f);else if(n==="method"||n==="m")s=r(x,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 k=f[0];s=R.startsWith(k)}else s=R.includes(f);else if(n==="header"||n==="h"){const k=`${b(t.requestHeaders,!0)}
|
|
5
|
+
${b(t.responseHeaders,!0)}`;s=r(k,f)}else n==="body"||n==="b"?s=r($,f)||r(j,f):n==="client"||n==="c"?s=r(N,f):n==="page"||n==="p"?s=r(W,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})}export function scoreNetworkLogQuery(t,h,B,p){if(!h||h.trim().length===0)return 0;const I=!!p?.isCaseSensitive,P=p?.scope||"all",v=(t.method||"").trim(),x=(t.url||"").trim(),O=t.status!=null?String(t.status):"pending",R=t.client||"",m=t.caller||"",N=B||t?.routeInfo?.path||"";let q=x,W="",H="";try{const l=x.indexOf("?"),i=l>=0?x.slice(0,l):x;W=l>=0?x.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 T=q.split("/").filter(Boolean);H=T[T.length-1]||""}catch{q=x,H=x}const $=l=>{if(l==null)return"";if(typeof l=="string")return l;try{return JSON.stringify(l)}catch{return""}},j=$(t.request),b=$(t.response),L=(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])=>!A.has(a.toLowerCase())).map(([a,d])=>`${a}: ${d}`).join(`
|
|
7
|
+
`)},g=L(t.requestHeaders,P==="headers"),M=L(t.responseHeaders,P==="headers"),u=l=>I?l:l.toLowerCase(),r=u(h.trim()),S=u(H),o=u(q),w=u(x),c=u(v),s=u(O),y=u(N),n=u(R),f=u(m),k=u(W),E=u(g),U=u(M),z=u(j),F=u(b);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),y.includes(r)&&(e+=80),k.includes(r)&&(e+=60),E.includes(r)&&(e+=40),z.includes(r)&&(e+=30),U.includes(r)&&(e+=20),F.includes(r)&&(e+=5),J(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"?(z.includes(d)&&(e+=80),F.includes(d)&&(e+=40)):(a==="header"||a==="h")&&(E.includes(d)||U.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),y.includes(i)&&(e+=30),(n.includes(i)||f.includes(i))&&(e+=20),E.includes(i)&&(e+=15),z.includes(i)&&(e+=10),U.includes(i)&&(e+=8),F.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
|
-
import{Alert as
|
|
2
|
-
`)}export function formatPushReport(e){const n=
|
|
3
|
-
`)}export function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||
|
|
4
|
-
`)}export function formatAnalyticsReport(e){const n=
|
|
5
|
-
`)}export function formatReduxReport(e){const n=typeof e.timestamp=="number"?
|
|
6
|
-
`)}export function formatLogReport(e){const n=
|
|
7
|
-
`)}async function
|
|
8
|
-
`)}export async function shareSocketReport(e){const n=formatSocketReport(e),t=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await
|
|
9
|
-
`).map(
|
|
10
|
-
`);
|
|
1
|
+
import{Alert as L,Share as b}from"react-native";import{writeNativeExportFile as D,shareNativeFile as k}from"../native/NativeInspector";import{formatDateTime as S,getCurlCommand as w}from"./index";function m(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)}}export 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",r=e.duration!=null?`${e.duration}ms`:"N/A",p=S(e.startTime||Date.now()),s=w(e),o=["\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: ${r}`,`\u{1F552} Time: ${p}`];return e.client&&o.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),o.push(`\u{1F310} URL: ${e.url||"N/A"}`),o.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(o.push("\u{1F4CB} Request Headers:"),o.push(m(e.requestHeaders)),o.push("")),e.request!=null&&e.request!==""&&(o.push("\u{1F4DD} Request Body:"),o.push(m(e.request)),o.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(o.push("\u{1F4D1} Response Headers:"),o.push(m(e.responseHeaders)),o.push("")),e.response!=null&&e.response!==""&&(o.push("\u{1F4E5} Response Data:"),o.push(m(e.response)),o.push("")),s&&(o.push("\u{1F4BB} cURL Command:"),o.push(s),o.push("")),o.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"),o.push("Generated by React Native InApp Inspector"),o.join(`
|
|
2
|
+
`)}export function formatPushReport(e){const n=S(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),r=(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: ${r}`,`\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(m(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(m(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(m(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
|
+
`)}export function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||S(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(r=>{t.push(` \u2022 [${r.type}] ${r.message} (${S(r.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
|
+
`)}export function formatAnalyticsReport(e){const n=S(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(m(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(m(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
|
+
`)}export function formatReduxReport(e){const n=typeof e.timestamp=="number"?S(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(m(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(m(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(m(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
|
+
`)}export function formatLogReport(e){const n=S(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(m(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 y(e,n,t){try{const r=t||`export_${Date.now()}.txt`,p=await D(r,n);if(p){const s=r.endsWith(".json")?"application/json":(r.endsWith(".log")||r.endsWith(".txt"),"text/plain");if(await k(p,s,e))return}await b.share({title:e,message:n,url:p||void 0},{dialogTitle:e,subject:e})}catch(r){r?.message!=="User did not share"&&L.alert("Share Error",r?.message||"Failed to open share sheet")}}export async function shareApiReport(e){const n=formatApiReport(e),t=`api_${e.id??Date.now()}.txt`,r=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await y(r,n,t)}export async function sharePushReport(e){const n=formatPushReport(e),t=`push_${e.id??Date.now()}.txt`,r=`Push: ${e.title||e.id||"Notification"}`;await y(r,n,t)}export async function shareCrashReport(e){const n=formatCrashReport(e),t=`crash_${e.timestamp??Date.now()}.txt`,r=`Crash: ${e.name||e.message||"Error"}`;await y(r,n,t)}export async function shareAnalyticsReport(e){const n=formatAnalyticsReport(e),t=`analytics_${e.id??Date.now()}.txt`,r=`Analytics: ${e.name||"Event"}`;await y(r,n,t)}export async function shareReduxReport(e){const n=formatReduxReport(e),t=`redux_${e.id??Date.now()}.txt`,r=`Redux: ${e.type||"Action"}`;await y(r,n,t)}export async function shareLogReport(e){const n=formatLogReport(e),t=`log_${e.id??Date.now()}.txt`,r=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await y(r,n,t)}export function formatSocketReport(e){const n=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),r=e.duration!=null?`${e.duration}ms`:"Active / Open",p=S(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: ${r}`,`\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(m(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((o,C)=>{const T=o.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",R=o.eventName?` [${o.eventName}]`:"";s.push(`--- Frame #${C+1} (${T}${R}, ${o.type}, ${o.size||0}B) ---`),s.push(m(o.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
|
+
`)}export async function shareSocketReport(e){const n=formatSocketReport(e),t=`socket_${e.id??Date.now()}.txt`,r=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await y(r,n,t)}export const DEFAULT_CONSOLE_EXPORT_OPTIONS={includeStackTrace:!0,includeArguments:!0,includeCaller:!0,includeTimestamps:!0,includeAppInfo:!0,includeDuplicates:!1,ignorePattern:""};export function generateConsoleLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),r=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}${r}${p}_${s}.${e==="log"?"log":"txt"}`}export function formatConsoleLogsExport(e,n="txt",t=DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return"No console logs to export.";const{includeStackTrace:r=!0,includeArguments:p=!0,includeCaller:s=!0,includeTimestamps:o=!0,includeAppInfo:C=!0,includeDuplicates:T=!1,ignorePattern:R=""}=t;let x=e;if(R&&R.trim().length>0)try{const c=new RegExp(R.trim(),"i");x=e.filter(a=>{const u=a.message||"",d=a.rawArgs?m(a.rawArgs):"",l=a.caller||"";return!c.test(u)&&!c.test(d)&&!c.test(l)})}catch{}if(x.length===0)return"No console logs to export (all filtered out).";const P=new Date().toLocaleString(),$="********************************************************************************",f=[];C&&f.push(`/${$}`,` * \u{1F4DC} CONSOLE LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${P}`,` * \u{1F4CA} Total Logs: ${e.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${$}/`,"");const O=e.map((c,a)=>{const u=a+1,d=S(c.timestamp),l=(c.type||"info").toUpperCase(),g=T&&c.duplicateCount&&c.duplicateCount>1?` [DUPLICATES: \xD7${c.duplicateCount}]`:"",h=[`/${$}`,` * \u{1F4CC} LOG #${u} Starts [${l}]${o?` - ${d}`:""}${g}`,` ${$}/`];if(s&&c.caller&&h.push(`\u{1F4CD} Caller: ${c.caller}`),o&&h.push(`\u{1F552} Time: ${d}`),h.push(`\u{1F3F7}\uFE0F Level: ${l}`),c.sourceMethod&&c.sourceMethod!==c.type&&h.push(`\u2699\uFE0F Method: console.${c.sourceMethod}()`),h.push(""),h.push("\u{1F4AC} Message:"),h.push(c.message||"(Empty message)"),p&&c.rawArgs&&c.rawArgs.length>0&&(h.push(""),h.push("\u{1F4E6} Arguments / Data:"),h.push(m(c.rawArgs))),r&&(c.stack||c.errorStack)){h.push(""),h.push("\u{1F4DC} Stack Trace & Frames:");const A=(c.stack||c.errorStack||"").split(`
|
|
9
|
+
`).map(i=>` ${i}`).join(`
|
|
10
|
+
`);h.push(A)}return h.push(""),h.push(`/${$}`),h.push(` * \u{1F3C1} LOG #${u} Ends`),h.push(` ${$}/`),h.join(`
|
|
11
11
|
`)}).join(`
|
|
12
12
|
|
|
13
|
-
`),
|
|
14
|
-
`):"";return`${
|
|
15
|
-
`)}${
|
|
13
|
+
`),I=C?["",`/${$}`," * \u{1F3C1} END OF CONSOLE LOGS EXPORT",` ${$}/`].join(`
|
|
14
|
+
`):"";return`${f.join(`
|
|
15
|
+
`)}${O}${I}`}export function estimateConsoleLogsExportSize(e,n="txt",t=DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const r=Math.min(e.length,20),p=e.slice(0,r),o=formatConsoleLogsExport(p,n,t).length/r;return Math.round(o*e.length)}export async function shareConsoleLogs(e,n="txt",t=DEFAULT_CONSOLE_EXPORT_OPTIONS,r){const p=formatConsoleLogsExport(e,n,t),s=generateConsoleLogsFilename(n);await y(r||s,p,s)}export const DEFAULT_NETWORK_EXPORT_OPTIONS={includeRequestHeaders:!0,includeRequestBody:!0,includeResponseHeaders:!0,includeResponseBody:!0,includeCurlCommand:!0,includeTimestamps:!0,includeAppInfo:!0,ignorePattern:""};export function generateNetworkLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),r=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}${r}${p}_${s}.${e==="log"?"log":"txt"}`}export function formatNetworkLogsExport(e,n="txt",t=DEFAULT_NETWORK_EXPORT_OPTIONS){if(!e||e.length===0)return"No API requests to export.";const{includeRequestHeaders:r=!0,includeRequestBody:p=!0,includeResponseHeaders:s=!0,includeResponseBody:o=!0,includeCurlCommand:C=!0,includeTimestamps:T=!0,includeAppInfo:R=!0,ignorePattern:x=""}=t;let N=e;if(x&&x.trim().length>0)try{const a=new RegExp(x.trim(),"i");N=e.filter(u=>{const d=u.url||"",l=u.method||"",g=u.client||"",h=u.request?m(u.request):"",A=u.response?m(u.response):"",i=u.requestHeaders?m(u.requestHeaders):"",E=u.responseHeaders?m(u.responseHeaders):"";return!a.test(d)&&!a.test(l)&&!a.test(g)&&!a.test(h)&&!a.test(A)&&!a.test(i)&&!a.test(E)})}catch{}if(N.length===0)return"No API requests to export (all filtered out).";const $=new Date().toLocaleString(),f="********************************************************************************";if(n==="json"){const a=N.map((u,d)=>{const l={index:d+1,id:u.id,url:u.url,method:(u.method||"GET").toUpperCase(),status:u.status,duration:u.duration,startTime:u.startTime,client:u.client};return r&&u.requestHeaders&&(l.requestHeaders=u.requestHeaders),p&&u.request!=null&&(l.request=u.request),s&&u.responseHeaders&&(l.responseHeaders=u.responseHeaders),o&&u.response!=null&&(l.response=u.response),C&&(l.curl=w(u)),l});return JSON.stringify(a,null,2)}if(n==="curl"){const a=["#!/usr/bin/env bash","# ============================================================================== ","# \u{1F680} API Network Logs - cURL Script Export",`# \u{1F552} Exported At: ${$}`,`# \u{1F4CA} Total Commands: ${N.length}`,"# \u2699\uFE0F Generator: React Native InApp Inspector",`# ==============================================================================
|
|
16
|
+
`];return N.forEach((u,d)=>{const l=d+1,g=(u.method||"GET").toUpperCase(),h=u.status===0?"Failed / Error":u.status!=null?String(u.status):"Pending",A=u.duration!=null?`${u.duration}ms`:"N/A",i=S(u.startTime||Date.now());a.push(`# Request #${l}: [${g}] ${u.url||"N/A"} (Status: ${h}, ${A}, ${i})`);const E=w(u);E?a.push(E):a.push(`curl -X ${g} "${u.url||""}"`),a.push("")}),a.join(`
|
|
17
|
+
`)}const O=[];R&&O.push(`/${f}`,` * \u{1F680} API NETWORK LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${$}`,` * \u{1F4CA} Total Requests: ${N.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${f}/`,"");const I=N.map((a,u)=>{const d=u+1,l=S(a.startTime||Date.now()),g=(a.method||"GET").toUpperCase(),h=a.status===0?"Failed / Network Error":a.status!=null?`${a.status} ${a.status===200?"OK":""}`.trim():"Pending",A=a.duration!=null?`${a.duration}ms`:"N/A",i=[`/${f}`,` * \u{1F4CC} REQUEST #${d} Starts [${g}] [${h}] [${A}]${T?` - ${l}`:""}`,` ${f}/`];if(i.push(`\u{1F310} URL: ${a.url||"N/A"}`),i.push(`\u{1F4CC} Method: ${g}`),i.push(`\u{1F4CA} Status: ${h}`),i.push(`\u23F1\uFE0F Duration: ${A}`),T&&i.push(`\u{1F552} Time: ${l}`),a.client&&i.push(`\u{1F50C} Client: ${a.client.toUpperCase()}`),r&&a.requestHeaders&&Object.keys(a.requestHeaders).length>0&&(i.push(""),i.push("\u{1F4CB} Request Headers:"),i.push(m(a.requestHeaders))),p&&a.request!=null&&a.request!==""&&(i.push(""),i.push("\u{1F4DD} Request Body:"),i.push(m(a.request))),s&&a.responseHeaders&&Object.keys(a.responseHeaders).length>0&&(i.push(""),i.push("\u{1F4D1} Response Headers:"),i.push(m(a.responseHeaders))),o&&a.response!=null&&a.response!==""&&(i.push(""),i.push("\u{1F4E5} Response Data:"),i.push(m(a.response))),C){const E=w(a);E&&(i.push(""),i.push("\u{1F4BB} cURL Command:"),i.push(E))}return i.push(""),i.push(`/${f}`),i.push(` * \u{1F3C1} REQUEST #${d} Ends`),i.push(` ${f}/`),i.join(`
|
|
18
|
+
`)}).join(`
|
|
19
|
+
|
|
20
|
+
`),c=R?["",`/${f}`," * \u{1F3C1} END OF API NETWORK LOGS EXPORT",` ${f}/`].join(`
|
|
21
|
+
`):"";return`${O.join(`
|
|
22
|
+
`)}${I}${c}`}export function estimateNetworkLogsExportSize(e,n="txt",t=DEFAULT_NETWORK_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const r=Math.min(e.length,10),p=e.slice(0,r),o=formatNetworkLogsExport(p,n,t).length/r;return Math.round(o*e.length)}export async function shareNetworkLogs(e,n="txt",t=DEFAULT_NETWORK_EXPORT_OPTIONS,r){const p=formatNetworkLogsExport(e,n,t),s=generateNetworkLogsFilename(n);await y(r||s,p,s)}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { A11yAuditResult, BoxModelMetrics, HierarchyBreadcrumbItem, InspectedElementInfo } from '../types';
|
|
2
|
+
export declare function getCleanComponentName(type: any): string;
|
|
3
|
+
export declare function buildHierarchyFromFiber(fiber: any): HierarchyBreadcrumbItem[];
|
|
4
|
+
export declare function getDynamicInspectorDataForPoint(locationX: number, locationY: number, inspectedViewRef?: any): Promise<InspectedElementInfo | null>;
|
|
5
|
+
export declare function extractBoxModel(flattenedStyle?: Record<string, any>, layout?: {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}): BoxModelMetrics;
|
|
9
|
+
export declare function categorizeStyles(flattened?: Record<string, any>): {
|
|
10
|
+
layout: Record<string, any>;
|
|
11
|
+
dimensions: Record<string, any>;
|
|
12
|
+
position: Record<string, any>;
|
|
13
|
+
spacing: Record<string, any>;
|
|
14
|
+
typography: Record<string, any>;
|
|
15
|
+
appearance: Record<string, any>;
|
|
16
|
+
borders: Record<string, any>;
|
|
17
|
+
transforms: Record<string, any>;
|
|
18
|
+
other: Record<string, any>;
|
|
19
|
+
};
|
|
20
|
+
export declare function calculateContrastRatio(textColor?: string, bgColor?: string): {
|
|
21
|
+
ratio: any;
|
|
22
|
+
score: "N/A";
|
|
23
|
+
} | {
|
|
24
|
+
ratio: number;
|
|
25
|
+
score: "AAA" | "AA" | "Fail";
|
|
26
|
+
};
|
|
27
|
+
export declare function auditAccessibility(props?: Record<string, any>, layout?: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
}, styles?: Record<string, any>): A11yAuditResult;
|
|
31
|
+
export declare function generateJsxSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): string;
|
|
32
|
+
export declare function generateFullJsxSegmentSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): {
|
|
33
|
+
code: string;
|
|
34
|
+
sourceFile?: string;
|
|
35
|
+
sourceLocation?: string;
|
|
36
|
+
lineNumber?: number;
|
|
37
|
+
columnNumber?: number;
|
|
38
|
+
};
|
|
39
|
+
export declare function generateStyleSheetSnippet(componentName: string, styles?: Record<string, any>): string;
|
|
40
|
+
export declare function generateCssSnippet(componentName: string, styles?: Record<string, any>): string;
|
|
41
|
+
export declare function createInspectedElement(componentName: string, props: Record<string, any>, layout: {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
pageX: number;
|
|
47
|
+
pageY: number;
|
|
48
|
+
}, hierarchy?: HierarchyBreadcrumbItem[], nativeTag?: number, snapshotUri?: string, snapshotBase64?: string): InspectedElementInfo;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{StyleSheet as S,Platform as j}from"react-native";export function getCleanComponentName(e){if(!e)return"Unknown";if(typeof e=="string")return e==="RCTView"||e==="AndroidHorizontalScrollView"?"View":e==="RCTText"||e==="RCTRawText"||e==="RCTVirtualText"?"Text":e==="RCTImageView"||e==="RCTCxxImageView"?"Image":e==="RCTScrollView"?"ScrollView":e==="RCTModalHostView"?"Modal":e==="RCTSafeAreaView"?"SafeAreaView":e.replace(/^RCT/,"").replace(/^Android/,"");if(typeof e=="function")return e.displayName||e.name||"Component";if(typeof e=="object"){if(e.$$typeof?.toString().includes("memo")&&e.type)return`Memo(${getCleanComponentName(e.type)})`;if(e.$$typeof?.toString().includes("forward_ref")&&(e.render||e.type))return e.displayName||`ForwardRef(${getCleanComponentName(e.render||e.type)})`;if(e.displayName)return e.displayName;if(e.name)return e.name}return"Component"}function I(e){if(!e)return!0;const t=e.toLowerCase();return t.includes("provider")||t.includes("consumer")||t.includes("context")||t==="errorboundary"||t==="moduleerrorboundary"||t.includes("inspector")||t==="anonymous"}export function buildHierarchyFromFiber(e){const t=[];let o=e,a=0;for(;o&&a<25;){if(o.type){const r=getCleanComponentName(o.type),s=typeof o.type=="string",c=o.memoizedProps||{},n=c.style?S.flatten(c.style):void 0;(!I(r)||t.length===0)&&t.unshift({id:`breadcrumb_${a}_${r}`,displayName:r,componentName:r,depth:a,isHostComponent:s,props:c,styles:n})}o=o.return,a++}return t}export function getDynamicInspectorDataForPoint(e,t,o){return new Promise(a=>{let r=!1;const s=setTimeout(()=>{if(!r){r=!0;const n=O(e,t);a(n)}},120),c=n=>{if(!r&&n&&(n.frame||n.hierarchy&&n.hierarchy.length>0)){r=!0,clearTimeout(s);const{frame:l,props:i,hierarchy:p,selectedIndex:d,touchedViewTag:f,closestInstance:u}=n,g=[];Array.isArray(p)&&p.forEach((h,_)=>{const N=h?.type||h,m=h?.name||getCleanComponentName(N)||`View_${_}`;let y={};try{if(typeof h.getInspectorData=="function"){const H=h.getInspectorData();H?.props&&(y=H.props)}else h.props?y=h.props:h.memoizedProps&&(y=h.memoizedProps)}catch{}const R=y?.style||typeof h.getInspectorData=="function"&&h.getInspectorData()?.props?.style,A=R?S.flatten(R):void 0;g.push({id:`crumb_${_}_${m}`,displayName:getCleanComponentName(m),componentName:m,depth:_,isHostComponent:typeof m=="string"&&(m.startsWith("RCT")||m==="View"||m==="Text"||m==="Image"),props:y,styles:A})});const b=d!=null&&g[d]?g[d]:g[g.length-1],x=b?.componentName||(u?getCleanComponentName(u.type):"View"),$=getCleanComponentName(x),w=i&&Object.keys(i).length>0?i:b?.props||{},L=w.style?S.flatten(w.style):b?.styles||{},C={x:l?.left??e,y:l?.top??t,width:l?.width??0,height:l?.height??0,pageX:l?.left??e,pageY:l?.top??t},T=createInspectedElement($,w,C,g.length>0?g:void 0,f);a(T)}};try{const n=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n&&n.renderers){const l=Array.from(n.renderers.values());let i=!1,p=o||null;if(!p&&n._fiberRoots)try{for(const d of n._fiberRoots.values())if(d&&d.size>0){const f=Array.from(d.values())[0];if(f?.containerInfo){p=f.containerInfo;break}}}catch{}for(const d of l){const f=d?.rendererConfig?.getInspectorDataForViewAtPoint;if(typeof f=="function")try{f(p,e,t,u=>(c(u),!0)),i=!0}catch{}}if(!i){clearTimeout(s),r=!0;const d=O(e,t);a(d)}}else{clearTimeout(s),r=!0;const l=O(e,t);a(l)}}catch{clearTimeout(s),r=!0;const n=O(e,t);a(n)}})}function O(e,t){try{const o=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!o||!o._fiberRoots)return null;let a=null;for(const d of o._fiberRoots.values())if(d&&d.size>0){const f=Array.from(d.values())[0];if(f?.current){a=f.current;break}}if(!a)return null;const r=[];let s=a,c=0;for(;s&&c<30;){if(s.type){const d=getCleanComponentName(s.type),f=typeof s.type=="string",u=s.memoizedProps||s.pendingProps||{},g=u.style?S.flatten(u.style):void 0;I(d)||r.push({id:`fiber_crumb_${c}_${d}`,displayName:d,componentName:d,depth:c,isHostComponent:f,props:u,styles:g})}s=s.child,c++}if(r.length===0)return null;const n=r[r.length-1],l=n.props||{},i=n.styles||{},p={x:i.left??e,y:i.top??t,width:i.width??120,height:i.height??44,pageX:i.left??e,pageY:i.top??t};return createInspectedElement(n.componentName,l,p,r)}catch{return null}}export function extractBoxModel(e={},t={width:0,height:0}){const o=(y,R=0)=>{const A=typeof y=="number"?y:parseFloat(y);return isNaN(A)?R:A},a=o(e.margin,0),r=o(e.marginVertical,a),s=o(e.marginHorizontal,a),c=o(e.marginTop,r),n=o(e.marginBottom,r),l=o(e.marginLeft,s),i=o(e.marginRight,s),p=o(e.padding,0),d=o(e.paddingVertical,p),f=o(e.paddingHorizontal,p),u=o(e.paddingTop,d),g=o(e.paddingBottom,d),b=o(e.paddingLeft,f),x=o(e.paddingRight,f),$=o(e.borderWidth,0),w=o(e.borderTopWidth,$),L=o(e.borderBottomWidth,$),C=o(e.borderLeftWidth,$),T=o(e.borderRightWidth,$),h=t.width||o(e.width,0),_=t.height||o(e.height,0),N=Math.max(0,h-(b+x+C+T)),m=Math.max(0,_-(u+g+w+L));return{margin:{top:c,right:i,bottom:n,left:l},border:{top:w,right:T,bottom:L,left:C},padding:{top:u,right:x,bottom:g,left:b},content:{width:Math.round(N*10)/10,height:Math.round(m*10)/10}}}export function categorizeStyles(e={}){const t={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"]),a=new Set(["width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio"]),r=new Set(["position","top","bottom","left","right","start","end","zIndex"]),s=new Set(["padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","paddingStart","paddingEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","marginStart","marginEnd"]),c=new Set(["color","fontSize","fontWeight","fontFamily","fontStyle","lineHeight","letterSpacing","textAlign","textAlignVertical","textDecorationLine","textDecorationStyle","textDecorationColor","textTransform","includeFontPadding"]),n=new Set(["backgroundColor","opacity","overflow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","backfaceVisibility"]),l=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle"]);for(const[i,p]of Object.entries(e))p!==void 0&&(o.has(i)?t.layout[i]=p:a.has(i)?t.dimensions[i]=p:r.has(i)?t.position[i]=p:s.has(i)?t.spacing[i]=p:c.has(i)?t.typography[i]=p:n.has(i)?t.appearance[i]=p:l.has(i)?t.borders[i]=p:i==="transform"?t.transforms[i]=p:t.other[i]=p);return t}function v(e){const t=e.replace("#","");if(t.length<6)return .5;const o=parseInt(t.substring(0,2),16)/255,a=parseInt(t.substring(2,4),16)/255,r=parseInt(t.substring(4,6),16)/255,s=[o,a,r].map(c=>c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4));return .2126*s[0]+.7152*s[1]+.0722*s[2]}export function calculateContrastRatio(e,t){if(!e||!t||!e.startsWith("#")||!t.startsWith("#"))return{ratio:void 0,score:"N/A"};const o=v(e),a=v(t),r=Math.max(o,a),s=Math.min(o,a),c=(r+.05)/(s+.05),n=Math.round(c*100)/100;let l="Fail";return n>=7?l="AAA":n>=4.5&&(l="AA"),{ratio:n,score:l}}export function auditAccessibility(e={},t={width:0,height:0},o={}){const a=j.OS==="android",r=a?48:44,s=typeof e.onPress=="function"||typeof e.onLongPress=="function"||e.accessible===!0,c=t.width||o.width||0,n=t.height||o.height||0,l=[];let i=!0;s&&(c>0||n>0)&&(c<r||n<r)&&(i=!1,l.push(`Touch target is ${Math.round(c)}\xD7${Math.round(n)}pt. Recommended min is ${r}\xD7${r}pt for ${a?"Android Material Design":"Apple iOS HIG"}.`));const p=!!(e.accessibilityLabel||e["aria-label"]||e.accessibilityTitle);s&&!p&&!e.children&&typeof e.children!="string"&&l.push("Interactive element is missing an accessibilityLabel / aria-label.");const d=o.color,f=o.backgroundColor,u=calculateContrastRatio(d,f);return u.score==="Fail"&&u.ratio!==void 0&&l.push(`Contrast ratio is ${u.ratio}:1 (below WCAG AA minimum 4.5:1).`),{hasValidTouchTarget:i,touchTargetWidth:c,touchTargetHeight:n,recommendedMinSize:r,contrastRatio:u.ratio,contrastScore:u.score,textColor:d,backgroundColor:f,hasAccessibilityLabel:p,accessibilityRole:e.accessibilityRole||e.role,accessibilityHint:e.accessibilityHint,issues:l}}export function generateJsxSnippet(e,t={},o={}){return generateFullJsxSegmentSnippet(e,t,o).code}function D(e,t){return typeof t=="string"?`${e}="${t}"`:typeof t=="boolean"?t?e:`${e}={false}`:typeof t=="number"?`${e}={${t}}`:typeof t=="function"?`${e}={() => {}}`:typeof t=="object"&&t!==null?`${e}={${JSON.stringify(t)}}`:`${e}={${String(t)}}`}function V(e,t=1){if(e==null)return"";const o=" ".repeat(t);if(typeof e=="string"||typeof e=="number")return`${o}${e}`;if(Array.isArray(e))return e.map(a=>V(a,t)).filter(Boolean).join(`
|
|
2
|
+
`);if(typeof e=="object"&&e.type){const a=typeof e.type=="string"?e.type:e.type.displayName||e.type.name||"Component",r=e.props||{},s=[];for(const[n,l]of Object.entries(r))n==="children"||n==="__source"||n==="__self"||n==="_source"||s.push(D(n,l));const c=s.length?" "+s.join(" "):"";if(r.children){const n=V(r.children,t+1);return`${o}<${a}${c}>
|
|
3
|
+
${n}
|
|
4
|
+
${o}</${a}>`}return`${o}<${a}${c} />`}return""}export function generateFullJsxSegmentSnippet(e,t={},o={}){const a=t.__source||t._source,r=a?.fileName,s=a?.lineNumber,c=a?.columnNumber,n=r?r.replace(/^.*[\\/]/,""):void 0,l=n&&s?`${n}:${s}${c?`:${c}`:""}`:void 0,i=[];for(const[f,u]of Object.entries(t))f==="children"||f==="style"||f==="key"||f==="__source"||f==="__self"||f==="_source"||i.push(D(f,u));Object.keys(o).length>0&&i.push(`style={styles.${e.toLowerCase()||"container"}}`);const p=V(t.children,1);let d="";return i.length<=1&&!p?d=`<${e}${i.length?" "+i.join(" "):""} />`:p?d=`<${e}${i.length?`
|
|
5
|
+
`+i.join(`
|
|
6
|
+
`):""}>
|
|
7
|
+
${p}
|
|
8
|
+
</${e}>`:d=`<${e}
|
|
9
|
+
${i.join(`
|
|
10
|
+
`)}
|
|
11
|
+
/>`,{code:d,sourceFile:r,sourceLocation:l,lineNumber:s,columnNumber:c}}export function generateStyleSheetSnippet(e,t={}){const o=" ",a=[];for(const[s,c]of Object.entries(t)){if(c===void 0)continue;const n=typeof c=="string"?`'${c}'`:typeof c=="object"?JSON.stringify(c):String(c);a.push(`${o}${s}: ${n},`)}const r=a.length>0?`{
|
|
12
|
+
${a.join(`
|
|
13
|
+
`)}
|
|
14
|
+
}`:"{}";return`const styles = StyleSheet.create({
|
|
15
|
+
${e.toLowerCase()}Container: ${r},
|
|
16
|
+
});`}export function generateCssSnippet(e,t={}){const o=[];for(const[r,s]of Object.entries(t)){if(s===void 0)continue;const c=r.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),n=typeof s=="number"?`${s}px`:String(s);o.push(` ${c}: ${n};`)}const a=o.length>0?`{
|
|
17
|
+
${o.join(`
|
|
18
|
+
`)}
|
|
19
|
+
}`:"{}";return`.${e.toLowerCase()}-element ${a}`}export function createInspectedElement(e,t={},o,a=[],r,s,c){const n=t.style?S.flatten(t.style)||{}:{},l={...n},i=extractBoxModel(l,o),p=auditAccessibility(t,o,l);return{id:`elem_${Date.now()}_${Math.random().toString(36).substring(2,6)}`,componentName:e,displayName:e,hierarchy:a.length>0?a:[{id:"root_app",displayName:"App",componentName:"App",depth:0,isHostComponent:!1},{id:"inspected_node",displayName:e,componentName:e,depth:1,isHostComponent:!0,props:t,styles:l}],props:t,originalStyles:n,flattenedStyles:l,tweakedStyles:{},layout:o,boxModel:i,a11y:p,nativeTag:r,snapshotUri:s,snapshotBase64:c,timestamp:Date.now()}}
|