react-native-webview-bootpay 11.26.20 → 13.6.1
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 +9 -31
- package/android/build.gradle +70 -112
- package/android/gradle.properties +5 -6
- package/android/src/main/java/kr/co/bootpay/webview/BPCBasicAuthCredential.java +11 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +354 -434
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +350 -259
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +253 -399
- package/android/src/main/java/kr/co/bootpay/webview/{WebViewConfig.java → BPCWebViewConfig.java} +3 -4
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewFileProvider.java +1 -1
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +290 -877
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +664 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModule.java +29 -520
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +554 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.java +56 -0
- package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +122 -0
- package/android/src/main/java/kr/co/bootpay/webview/events/TopCustomMenuSelectionEvent.kt +24 -0
- package/android/src/main/java/kr/co/bootpay/webview/events/TopNewWindowEvent.kt +25 -0
- package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewManager.java +544 -0
- package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewModule.java +57 -0
- package/apple/BPCWebView.h +22 -126
- package/apple/BPCWebView.mm +528 -0
- package/apple/BPCWebViewDecisionManager.h +20 -0
- package/apple/BPCWebViewDecisionManager.m +47 -0
- package/apple/BPCWebViewImpl.h +150 -0
- package/apple/{BPCWebView.m → BPCWebViewImpl.m} +377 -210
- package/apple/BPCWebViewManager.h +4 -8
- package/apple/{BPCWebViewManager.m → BPCWebViewManager.mm} +93 -149
- package/ios/{BPCWebView.xcodeproj → RNCWebView.xcodeproj}/project.pbxproj +18 -18
- package/ios/main.jsbundle +457 -0
- package/lib/BPCWebViewNativeComponent.d.ts +242 -0
- package/lib/BPCWebViewNativeComponent.d.ts.map +1 -0
- package/lib/BPCWebViewNativeComponent.js +6 -0
- package/lib/NativeBPCWebView.d.ts +10 -0
- package/lib/NativeBPCWebView.d.ts.map +1 -0
- package/lib/NativeBPCWebView.js +2 -0
- package/lib/WebView.android.d.ts.map +1 -1
- package/lib/WebView.android.js +53 -29
- package/lib/WebView.ios.d.ts.map +1 -1
- package/lib/WebView.ios.js +49 -28
- package/lib/WebView.macos.d.ts.map +1 -1
- package/lib/WebView.macos.js +10 -14
- package/lib/WebView.windows.d.ts.map +1 -1
- package/lib/WebView.windows.js +4 -6
- package/lib/WebViewNativeComponent.macos.d.ts +2 -2
- package/lib/WebViewNativeComponent.macos.js +2 -2
- package/lib/WebViewShared.d.ts +4 -2
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewShared.js +8 -2
- package/lib/WebViewTypes.d.ts +62 -95
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/lib/WebViewTypes.js +0 -16
- package/macos/RNCWebView.xcodeproj/project.pbxproj +44 -44
- package/package.json +38 -20
- package/react-native-webview-bootpay.podspec +22 -3
- package/react-native.config.js +1 -2
- package/src/BPCWebViewNativeComponent.ts +281 -0
- package/src/NativeBPCWebView.ts +14 -0
- package/src/WebView.android.tsx +229 -0
- package/src/WebView.ios.tsx +232 -0
- package/src/WebView.macos.tsx +177 -0
- package/src/WebView.styles.ts +44 -0
- package/src/WebView.tsx +18 -0
- package/src/WebView.windows.tsx +156 -0
- package/src/WebViewNativeComponent.macos.ts +8 -0
- package/src/WebViewNativeComponent.windows.ts +10 -0
- package/src/WebViewShared.tsx +235 -0
- package/src/WebViewTypes.ts +1287 -0
- package/src/__tests__/WebViewShared-test.js +208 -0
- package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +8 -0
- package/src/index.ts +4 -0
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +1 -1
- package/windows/ReactNativeWebView/ReactWebView.idl +1 -0
- package/windows/ReactNativeWebView/ReactWebView2.cpp +142 -19
- package/windows/ReactNativeWebView/ReactWebView2.h +3 -0
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +29 -5
- package/windows/ReactNativeWebView/pch.h +1 -0
- package/android/.editorconfig +0 -6
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/results.bin +0 -1
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewClient.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$2.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$3.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$4.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$2.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewPackage.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BasicAuthCredential.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BuildConfig.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/URLUtil.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/WebViewConfig.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/desugar_graph.bin +0 -0
- package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/results.bin +0 -1
- package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/c0e86b44db04fcaf424a5b7ce79324f4/results.bin +0 -1
- package/android/build/generated/source/buildConfig/debug/kr/co/bootpay/webview/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -106
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1861
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -2
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/URLUtil.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/WebViewConfig.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -3
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -210
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -106
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- package/android/build/intermediates/packaged_res/debug/xml/file_provider_paths.xml +0 -6
- package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/URLUtil.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/WebViewConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1381
- 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/java-sources-proto-map.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -229
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.kt +0 -15
- package/android/src/main/java/kr/co/bootpay/webview/BasicAuthCredential.java +0 -11
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcuserdata/ehowlsla.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/BPCWebView.xcodeproj/xcuserdata/ehowlsla.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/WebViewNativeComponent.android.d.ts +0 -4
- package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.android.js +0 -3
- package/lib/WebViewNativeComponent.ios.d.ts +0 -4
- package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.ios.js +0 -3
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
// This guard prevent the code from being compiled in the old architecture
|
|
2
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
3
|
+
#import "BPCWebView.h"
|
|
4
|
+
#import "BPCWebViewImpl.h"
|
|
5
|
+
|
|
6
|
+
#import <react/renderer/components/BPCWebViewSpec/ComponentDescriptors.h>
|
|
7
|
+
#import <react/renderer/components/BPCWebViewSpec/EventEmitters.h>
|
|
8
|
+
#import <react/renderer/components/BPCWebViewSpec/Props.h>
|
|
9
|
+
#import <react/renderer/components/BPCWebViewSpec/RCTComponentViewHelpers.h>
|
|
10
|
+
|
|
11
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
12
|
+
|
|
13
|
+
using namespace facebook::react;
|
|
14
|
+
|
|
15
|
+
auto stringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string value) {
|
|
16
|
+
if (value == "click") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Click;
|
|
17
|
+
if (value == "formsubmit") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Formsubmit;
|
|
18
|
+
if (value == "backforward") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Backforward;
|
|
19
|
+
if (value == "reload") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Reload;
|
|
20
|
+
if (value == "formresubmit") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Formresubmit;
|
|
21
|
+
return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Other;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
auto stringToOnLoadingStartNavigationTypeEnum(std::string value) {
|
|
25
|
+
if (value == "click") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Click;
|
|
26
|
+
if (value == "formsubmit") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Formsubmit;
|
|
27
|
+
if (value == "backforward") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Backforward;
|
|
28
|
+
if (value == "reload") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Reload;
|
|
29
|
+
if (value == "formresubmit") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Formresubmit;
|
|
30
|
+
return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Other;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
34
|
+
if (value == "click") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Click;
|
|
35
|
+
if (value == "formsubmit") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Formsubmit;
|
|
36
|
+
if (value == "backforward") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Backforward;
|
|
37
|
+
if (value == "reload") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Reload;
|
|
38
|
+
if (value == "formresubmit") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Formresubmit;
|
|
39
|
+
return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Other;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@interface BPCWebView () <RCTBPCWebViewViewProtocol>
|
|
43
|
+
|
|
44
|
+
@end
|
|
45
|
+
|
|
46
|
+
@implementation BPCWebView {
|
|
47
|
+
BPCWebViewImpl * _view;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
51
|
+
{
|
|
52
|
+
return concreteComponentDescriptorProvider<BPCWebViewComponentDescriptor>();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Reproduce the idea from here: https://github.com/facebook/react-native/blob/8bd3edec88148d0ab1f225d2119435681fbbba33/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm#L142
|
|
56
|
+
- (void)prepareForRecycle {
|
|
57
|
+
[super prepareForRecycle];
|
|
58
|
+
[_view destroyWebView];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
62
|
+
{
|
|
63
|
+
if (self = [super initWithFrame:frame]) {
|
|
64
|
+
static const auto defaultProps = std::make_shared<const BPCWebViewProps>();
|
|
65
|
+
_props = defaultProps;
|
|
66
|
+
|
|
67
|
+
_view = [[BPCWebViewImpl alloc] init];
|
|
68
|
+
|
|
69
|
+
_view.onShouldStartLoadWithRequest = [self](NSDictionary* dictionary) {
|
|
70
|
+
if (_eventEmitter) {
|
|
71
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
72
|
+
facebook::react::BPCWebViewEventEmitter::OnShouldStartLoadWithRequest data = {
|
|
73
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
74
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
75
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
76
|
+
.navigationType = stringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
|
|
77
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
78
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
79
|
+
.isTopFrame = [[dictionary valueForKey:@"isTopFrame"] boolValue],
|
|
80
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
81
|
+
.mainDocumentURL = std::string([[dictionary valueForKey:@"mainDocumentURL"] UTF8String])
|
|
82
|
+
};
|
|
83
|
+
webViewEventEmitter->onShouldStartLoadWithRequest(data);
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
_view.onLoadingStart = [self](NSDictionary* dictionary) {
|
|
87
|
+
if (_eventEmitter) {
|
|
88
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
89
|
+
facebook::react::BPCWebViewEventEmitter::OnLoadingStart data = {
|
|
90
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
91
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
92
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
93
|
+
.navigationType = stringToOnLoadingStartNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
|
|
94
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
95
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
96
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
97
|
+
.mainDocumentURL = std::string([[dictionary valueForKey:@"mainDocumentURL"] UTF8String], [[dictionary valueForKey:@"mainDocumentURL"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])
|
|
98
|
+
};
|
|
99
|
+
webViewEventEmitter->onLoadingStart(data);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
_view.onLoadingError = [self](NSDictionary* dictionary) {
|
|
103
|
+
if (_eventEmitter) {
|
|
104
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
105
|
+
facebook::react::BPCWebViewEventEmitter::OnLoadingError data = {
|
|
106
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
107
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
108
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
109
|
+
.code = [[dictionary valueForKey:@"code"] intValue],
|
|
110
|
+
.description = std::string([[dictionary valueForKey:@"description"] UTF8String]),
|
|
111
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
112
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
113
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
114
|
+
.domain = std::string([[dictionary valueForKey:@"domain"] UTF8String])
|
|
115
|
+
};
|
|
116
|
+
webViewEventEmitter->onLoadingError(data);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
_view.onMessage = [self](NSDictionary* dictionary) {
|
|
120
|
+
if (_eventEmitter) {
|
|
121
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
122
|
+
facebook::react::BPCWebViewEventEmitter::OnMessage data = {
|
|
123
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
124
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
125
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
126
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
127
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
128
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
129
|
+
.data = std::string([[dictionary valueForKey:@"data"] UTF8String])
|
|
130
|
+
};
|
|
131
|
+
webViewEventEmitter->onMessage(data);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
_view.onLoadingFinish = [self](NSDictionary* dictionary) {
|
|
135
|
+
if (_eventEmitter) {
|
|
136
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
137
|
+
facebook::react::BPCWebViewEventEmitter::OnLoadingFinish data = {
|
|
138
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
139
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
140
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
141
|
+
.navigationType = stringToOnLoadingFinishNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String], [[dictionary valueForKey:@"navigationType"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])),
|
|
142
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
143
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
144
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
145
|
+
.mainDocumentURL = std::string([[dictionary valueForKey:@"mainDocumentURL"] UTF8String], [[dictionary valueForKey:@"mainDocumentURL"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])
|
|
146
|
+
};
|
|
147
|
+
webViewEventEmitter->onLoadingFinish(data);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
_view.onLoadingProgress = [self](NSDictionary* dictionary) {
|
|
151
|
+
if (_eventEmitter) {
|
|
152
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
153
|
+
facebook::react::BPCWebViewEventEmitter::OnLoadingProgress data = {
|
|
154
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
155
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
156
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
157
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
158
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
159
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
160
|
+
.progress = [[dictionary valueForKey:@"progress"] doubleValue]
|
|
161
|
+
};
|
|
162
|
+
webViewEventEmitter->onLoadingProgress(data);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
_view.onContentProcessDidTerminate = [self](NSDictionary* dictionary) {
|
|
166
|
+
if (_eventEmitter) {
|
|
167
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
168
|
+
facebook::react::BPCWebViewEventEmitter::OnContentProcessDidTerminate data = {
|
|
169
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
170
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
171
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
172
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
173
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
174
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue]
|
|
175
|
+
};
|
|
176
|
+
webViewEventEmitter->onContentProcessDidTerminate(data);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
_view.onCustomMenuSelection = [self](NSDictionary* dictionary) {
|
|
180
|
+
if (_eventEmitter) {
|
|
181
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
182
|
+
facebook::react::BPCWebViewEventEmitter::OnCustomMenuSelection data = {
|
|
183
|
+
.selectedText = std::string([[dictionary valueForKey:@"selectedText"] UTF8String]),
|
|
184
|
+
.key = std::string([[dictionary valueForKey:@"key"] UTF8String]),
|
|
185
|
+
.label = std::string([[dictionary valueForKey:@"label"] UTF8String])
|
|
186
|
+
|
|
187
|
+
};
|
|
188
|
+
webViewEventEmitter->onCustomMenuSelection(data);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
_view.onScroll = [self](NSDictionary* dictionary) {
|
|
192
|
+
if (_eventEmitter) {
|
|
193
|
+
NSDictionary* contentOffset = [dictionary valueForKey:@"contentOffset"];
|
|
194
|
+
NSDictionary* contentInset = [dictionary valueForKey:@"contentInset"];
|
|
195
|
+
NSDictionary* contentSize = [dictionary valueForKey:@"contentSize"];
|
|
196
|
+
NSDictionary* layoutMeasurement = [dictionary valueForKey:@"layoutMeasurement"];
|
|
197
|
+
double zoomScale = [[dictionary valueForKey:@"zoomScale"] doubleValue];
|
|
198
|
+
|
|
199
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
200
|
+
facebook::react::BPCWebViewEventEmitter::OnScroll data = {
|
|
201
|
+
.contentOffset = {
|
|
202
|
+
.x = [[contentOffset valueForKey:@"x"] doubleValue],
|
|
203
|
+
.y = [[contentOffset valueForKey:@"y"] doubleValue]
|
|
204
|
+
},
|
|
205
|
+
.contentInset = {
|
|
206
|
+
.left = [[contentInset valueForKey:@"left"] doubleValue],
|
|
207
|
+
.right = [[contentInset valueForKey:@"right"] doubleValue],
|
|
208
|
+
.top = [[contentInset valueForKey:@"top"] doubleValue],
|
|
209
|
+
.bottom = [[contentInset valueForKey:@"bottom"] doubleValue]
|
|
210
|
+
},
|
|
211
|
+
.contentSize = {
|
|
212
|
+
.width = [[contentSize valueForKey:@"width"] doubleValue],
|
|
213
|
+
.height = [[contentSize valueForKey:@"height"] doubleValue]
|
|
214
|
+
},
|
|
215
|
+
.layoutMeasurement = {
|
|
216
|
+
.width = [[layoutMeasurement valueForKey:@"width"] doubleValue],
|
|
217
|
+
.height = [[layoutMeasurement valueForKey:@"height"] doubleValue] },
|
|
218
|
+
.zoomScale = zoomScale
|
|
219
|
+
};
|
|
220
|
+
webViewEventEmitter->onScroll(data);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
_view.onHttpError = [self](NSDictionary* dictionary) {
|
|
224
|
+
if (_eventEmitter) {
|
|
225
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
226
|
+
facebook::react::BPCWebViewEventEmitter::OnHttpError data = {
|
|
227
|
+
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
228
|
+
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
229
|
+
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
230
|
+
.statusCode = [[dictionary valueForKey:@"statusCode"] intValue],
|
|
231
|
+
.description = std::string([[dictionary valueForKey:@"description"] UTF8String]),
|
|
232
|
+
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
233
|
+
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
234
|
+
.loading = [[dictionary valueForKey:@"loading"] boolValue]
|
|
235
|
+
};
|
|
236
|
+
webViewEventEmitter->onHttpError(data);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
self.contentView = _view;
|
|
240
|
+
}
|
|
241
|
+
return self;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
- (void)updateEventEmitter:(EventEmitter::Shared const &)eventEmitter
|
|
245
|
+
{
|
|
246
|
+
[super updateEventEmitter:eventEmitter];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
250
|
+
{
|
|
251
|
+
const auto &oldViewProps = *std::static_pointer_cast<BPCWebViewProps const>(_props);
|
|
252
|
+
const auto &newViewProps = *std::static_pointer_cast<BPCWebViewProps const>(props);
|
|
253
|
+
|
|
254
|
+
#define REMAP_WEBVIEW_PROP(name) \
|
|
255
|
+
if (oldViewProps.name != newViewProps.name) { \
|
|
256
|
+
_view.name = newViewProps.name; \
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
#define REMAP_WEBVIEW_STRING_PROP(name) \
|
|
260
|
+
if (oldViewProps.name != newViewProps.name) { \
|
|
261
|
+
_view.name = RCTNSStringFromString(newViewProps.name); \
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
REMAP_WEBVIEW_PROP(scrollEnabled)
|
|
265
|
+
REMAP_WEBVIEW_STRING_PROP(injectedJavaScript)
|
|
266
|
+
REMAP_WEBVIEW_STRING_PROP(injectedJavaScriptBeforeContentLoaded)
|
|
267
|
+
REMAP_WEBVIEW_PROP(injectedJavaScriptForMainFrameOnly)
|
|
268
|
+
REMAP_WEBVIEW_PROP(injectedJavaScriptBeforeContentLoadedForMainFrameOnly)
|
|
269
|
+
REMAP_WEBVIEW_PROP(javaScriptEnabled)
|
|
270
|
+
REMAP_WEBVIEW_PROP(javaScriptCanOpenWindowsAutomatically)
|
|
271
|
+
REMAP_WEBVIEW_PROP(allowFileAccessFromFileURLs)
|
|
272
|
+
REMAP_WEBVIEW_PROP(allowUniversalAccessFromFileURLs)
|
|
273
|
+
REMAP_WEBVIEW_PROP(allowsInlineMediaPlayback)
|
|
274
|
+
REMAP_WEBVIEW_PROP(webviewDebuggingEnabled)
|
|
275
|
+
REMAP_WEBVIEW_PROP(allowsAirPlayForMediaPlayback)
|
|
276
|
+
REMAP_WEBVIEW_PROP(mediaPlaybackRequiresUserAction)
|
|
277
|
+
REMAP_WEBVIEW_PROP(automaticallyAdjustContentInsets)
|
|
278
|
+
REMAP_WEBVIEW_PROP(autoManageStatusBarEnabled)
|
|
279
|
+
REMAP_WEBVIEW_PROP(hideKeyboardAccessoryView)
|
|
280
|
+
REMAP_WEBVIEW_PROP(allowsBackForwardNavigationGestures)
|
|
281
|
+
REMAP_WEBVIEW_PROP(incognito)
|
|
282
|
+
REMAP_WEBVIEW_PROP(pagingEnabled)
|
|
283
|
+
REMAP_WEBVIEW_STRING_PROP(applicationNameForUserAgent)
|
|
284
|
+
REMAP_WEBVIEW_PROP(cacheEnabled)
|
|
285
|
+
REMAP_WEBVIEW_PROP(allowsLinkPreview)
|
|
286
|
+
REMAP_WEBVIEW_STRING_PROP(allowingReadAccessToURL)
|
|
287
|
+
|
|
288
|
+
REMAP_WEBVIEW_PROP(messagingEnabled)
|
|
289
|
+
REMAP_WEBVIEW_PROP(fraudulentWebsiteWarningEnabled)
|
|
290
|
+
REMAP_WEBVIEW_PROP(enableApplePay)
|
|
291
|
+
REMAP_WEBVIEW_PROP(pullToRefreshEnabled)
|
|
292
|
+
REMAP_WEBVIEW_PROP(bounces)
|
|
293
|
+
REMAP_WEBVIEW_PROP(useSharedProcessPool)
|
|
294
|
+
REMAP_WEBVIEW_STRING_PROP(userAgent)
|
|
295
|
+
REMAP_WEBVIEW_PROP(sharedCookiesEnabled)
|
|
296
|
+
#if !TARGET_OS_OSX
|
|
297
|
+
REMAP_WEBVIEW_PROP(decelerationRate)
|
|
298
|
+
#endif // !TARGET_OS_OSX
|
|
299
|
+
REMAP_WEBVIEW_PROP(directionalLockEnabled)
|
|
300
|
+
REMAP_WEBVIEW_PROP(showsHorizontalScrollIndicator)
|
|
301
|
+
REMAP_WEBVIEW_PROP(showsVerticalScrollIndicator)
|
|
302
|
+
REMAP_WEBVIEW_PROP(keyboardDisplayRequiresUserAction)
|
|
303
|
+
|
|
304
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
305
|
+
REMAP_WEBVIEW_PROP(automaticallyAdjustContentInsets)
|
|
306
|
+
#endif
|
|
307
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 /* iOS 14 */
|
|
308
|
+
REMAP_WEBVIEW_PROP(limitsNavigationsToAppBoundDomains)
|
|
309
|
+
#endif
|
|
310
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */
|
|
311
|
+
REMAP_WEBVIEW_PROP(textInteractionEnabled)
|
|
312
|
+
#endif
|
|
313
|
+
|
|
314
|
+
if (oldViewProps.dataDetectorTypes != newViewProps.dataDetectorTypes) {
|
|
315
|
+
WKDataDetectorTypes dataDetectorTypes = WKDataDetectorTypeNone;
|
|
316
|
+
if (dataDetectorTypes & BPCWebViewDataDetectorTypes::Address) {
|
|
317
|
+
dataDetectorTypes |= WKDataDetectorTypeAddress;
|
|
318
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::Link) {
|
|
319
|
+
dataDetectorTypes |= WKDataDetectorTypeLink;
|
|
320
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::CalendarEvent) {
|
|
321
|
+
dataDetectorTypes |= WKDataDetectorTypeCalendarEvent;
|
|
322
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::TrackingNumber) {
|
|
323
|
+
dataDetectorTypes |= WKDataDetectorTypeTrackingNumber;
|
|
324
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::FlightNumber) {
|
|
325
|
+
dataDetectorTypes |= WKDataDetectorTypeFlightNumber;
|
|
326
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::LookupSuggestion) {
|
|
327
|
+
dataDetectorTypes |= WKDataDetectorTypeLookupSuggestion;
|
|
328
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::PhoneNumber) {
|
|
329
|
+
dataDetectorTypes |= WKDataDetectorTypePhoneNumber;
|
|
330
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::All) {
|
|
331
|
+
dataDetectorTypes |= WKDataDetectorTypeAll;
|
|
332
|
+
} else if (dataDetectorTypes & BPCWebViewDataDetectorTypes::None) {
|
|
333
|
+
dataDetectorTypes = WKDataDetectorTypeNone;
|
|
334
|
+
}
|
|
335
|
+
[_view setDataDetectorTypes:dataDetectorTypes];
|
|
336
|
+
}
|
|
337
|
+
if (oldViewProps.contentInset.top != newViewProps.contentInset.top || oldViewProps.contentInset.left != newViewProps.contentInset.left || oldViewProps.contentInset.right != newViewProps.contentInset.right || oldViewProps.contentInset.bottom != newViewProps.contentInset.bottom) {
|
|
338
|
+
UIEdgeInsets edgesInsets = {
|
|
339
|
+
.top = newViewProps.contentInset.top,
|
|
340
|
+
.left = newViewProps.contentInset.left,
|
|
341
|
+
.right = newViewProps.contentInset.right,
|
|
342
|
+
.bottom = newViewProps.contentInset.bottom
|
|
343
|
+
};
|
|
344
|
+
[_view setContentInset: edgesInsets];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (oldViewProps.basicAuthCredential.username != newViewProps.basicAuthCredential.username || oldViewProps.basicAuthCredential.password != newViewProps.basicAuthCredential.password) {
|
|
348
|
+
[_view setBasicAuthCredential: @{
|
|
349
|
+
@"username": RCTNSStringFromString(newViewProps.basicAuthCredential.username),
|
|
350
|
+
@"password": RCTNSStringFromString(newViewProps.basicAuthCredential.password)
|
|
351
|
+
}];
|
|
352
|
+
}
|
|
353
|
+
if (oldViewProps.contentInsetAdjustmentBehavior != newViewProps.contentInsetAdjustmentBehavior) {
|
|
354
|
+
if (newViewProps.contentInsetAdjustmentBehavior == BPCWebViewContentInsetAdjustmentBehavior::Never) {
|
|
355
|
+
[_view setContentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentNever];
|
|
356
|
+
} else if (newViewProps.contentInsetAdjustmentBehavior == BPCWebViewContentInsetAdjustmentBehavior::Automatic) {
|
|
357
|
+
[_view setContentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentAutomatic];
|
|
358
|
+
} else if (newViewProps.contentInsetAdjustmentBehavior == BPCWebViewContentInsetAdjustmentBehavior::ScrollableAxes) {
|
|
359
|
+
[_view setContentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentScrollableAxes];
|
|
360
|
+
} else if (newViewProps.contentInsetAdjustmentBehavior == BPCWebViewContentInsetAdjustmentBehavior::Always) {
|
|
361
|
+
[_view setContentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentAlways];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (oldViewProps.menuItems != newViewProps.menuItems) {
|
|
366
|
+
NSMutableArray *newMenuItems = [NSMutableArray array];
|
|
367
|
+
|
|
368
|
+
for (const auto &menuItem: newViewProps.menuItems) {
|
|
369
|
+
[newMenuItems addObject:@{
|
|
370
|
+
@"key": RCTNSStringFromString(menuItem.key),
|
|
371
|
+
@"label": RCTNSStringFromString(menuItem.label),
|
|
372
|
+
}];
|
|
373
|
+
|
|
374
|
+
}
|
|
375
|
+
[_view setMenuItems:newMenuItems];
|
|
376
|
+
}
|
|
377
|
+
if(oldViewProps.suppressMenuItems != newViewProps.suppressMenuItems) {
|
|
378
|
+
NSMutableArray *suppressMenuItems = [NSMutableArray array];
|
|
379
|
+
|
|
380
|
+
for (const auto &menuItem: newViewProps.suppressMenuItems) {
|
|
381
|
+
[suppressMenuItems addObject: RCTNSStringFromString(menuItem)];
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
[_view setSuppressMenuItems:suppressMenuItems];
|
|
385
|
+
}
|
|
386
|
+
if (oldViewProps.hasOnFileDownload != newViewProps.hasOnFileDownload) {
|
|
387
|
+
if (newViewProps.hasOnFileDownload) {
|
|
388
|
+
_view.onFileDownload = [self](NSDictionary* dictionary) {
|
|
389
|
+
if (_eventEmitter) {
|
|
390
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
391
|
+
facebook::react::BPCWebViewEventEmitter::OnFileDownload data = {
|
|
392
|
+
.downloadUrl = std::string([[dictionary valueForKey:@"downloadUrl"] UTF8String])
|
|
393
|
+
};
|
|
394
|
+
webViewEventEmitter->onFileDownload(data);
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
} else {
|
|
398
|
+
_view.onFileDownload = nil;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (oldViewProps.hasOnOpenWindowEvent != newViewProps.hasOnOpenWindowEvent) {
|
|
402
|
+
if (newViewProps.hasOnOpenWindowEvent) {
|
|
403
|
+
_view.onOpenWindow = [self](NSDictionary* dictionary) {
|
|
404
|
+
if (_eventEmitter) {
|
|
405
|
+
auto webViewEventEmitter = std::static_pointer_cast<BPCWebViewEventEmitter const>(_eventEmitter);
|
|
406
|
+
facebook::react::BPCWebViewEventEmitter::OnOpenWindow data = {
|
|
407
|
+
.targetUrl = std::string([[dictionary valueForKey:@"targetUrl"] UTF8String])
|
|
408
|
+
};
|
|
409
|
+
webViewEventEmitter->onOpenWindow(data);
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
} else {
|
|
413
|
+
_view.onOpenWindow = nil;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
//
|
|
417
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
|
|
418
|
+
if (oldViewProps.contentMode != newViewProps.contentMode) {
|
|
419
|
+
if (newViewProps.contentMode == BPCWebViewContentMode::Recommended) {
|
|
420
|
+
[_view setContentMode: WKContentModeRecommended];
|
|
421
|
+
} else if (newViewProps.contentMode == BPCWebViewContentMode::Mobile) {
|
|
422
|
+
[_view setContentMode:WKContentModeMobile];
|
|
423
|
+
} else if (newViewProps.contentMode == BPCWebViewContentMode::Desktop) {
|
|
424
|
+
[_view setContentMode:WKContentModeDesktop];
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
#endif
|
|
428
|
+
|
|
429
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
|
|
430
|
+
if (oldViewProps.mediaCapturePermissionGrantType != newViewProps.mediaCapturePermissionGrantType) {
|
|
431
|
+
if (newViewProps.mediaCapturePermissionGrantType == BPCWebViewMediaCapturePermissionGrantType::Prompt) {
|
|
432
|
+
[_view setMediaCapturePermissionGrantType:BPCWebViewPermissionGrantType_Prompt];
|
|
433
|
+
} else if (newViewProps.mediaCapturePermissionGrantType == BPCWebViewMediaCapturePermissionGrantType::Grant) {
|
|
434
|
+
[_view setMediaCapturePermissionGrantType:BPCWebViewPermissionGrantType_Grant];
|
|
435
|
+
} else if (newViewProps.mediaCapturePermissionGrantType == BPCWebViewMediaCapturePermissionGrantType::Deny) {
|
|
436
|
+
[_view setMediaCapturePermissionGrantType:BPCWebViewPermissionGrantType_Deny];
|
|
437
|
+
}else if (newViewProps.mediaCapturePermissionGrantType == BPCWebViewMediaCapturePermissionGrantType::GrantIfSameHostElsePrompt) {
|
|
438
|
+
[_view setMediaCapturePermissionGrantType:BPCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt];
|
|
439
|
+
}else if (newViewProps.mediaCapturePermissionGrantType == BPCWebViewMediaCapturePermissionGrantType::GrantIfSameHostElseDeny) {
|
|
440
|
+
[_view setMediaCapturePermissionGrantType:BPCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny];
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
#endif
|
|
444
|
+
|
|
445
|
+
NSMutableDictionary* source = [[NSMutableDictionary alloc] init];
|
|
446
|
+
if (!newViewProps.newSource.uri.empty()) {
|
|
447
|
+
[source setValue:RCTNSStringFromString(newViewProps.newSource.uri) forKey:@"uri"];
|
|
448
|
+
}
|
|
449
|
+
NSMutableDictionary* headers = [[NSMutableDictionary alloc] init];
|
|
450
|
+
for (auto & element : newViewProps.newSource.headers) {
|
|
451
|
+
[headers setValue:RCTNSStringFromString(element.value) forKey:RCTNSStringFromString(element.name)];
|
|
452
|
+
}
|
|
453
|
+
if (headers.count > 0) {
|
|
454
|
+
[source setObject:headers forKey:@"headers"];
|
|
455
|
+
}
|
|
456
|
+
if (!newViewProps.newSource.baseUrl.empty()) {
|
|
457
|
+
[source setValue:RCTNSStringFromString(newViewProps.newSource.baseUrl) forKey:@"baseUrl"];
|
|
458
|
+
}
|
|
459
|
+
if (!newViewProps.newSource.body.empty()) {
|
|
460
|
+
[source setValue:RCTNSStringFromString(newViewProps.newSource.body) forKey:@"body"];
|
|
461
|
+
}
|
|
462
|
+
if (!newViewProps.newSource.html.empty()) {
|
|
463
|
+
[source setValue:RCTNSStringFromString(newViewProps.newSource.html) forKey:@"html"];
|
|
464
|
+
}
|
|
465
|
+
if (!newViewProps.newSource.method.empty()) {
|
|
466
|
+
[source setValue:RCTNSStringFromString(newViewProps.newSource.method) forKey:@"method"];
|
|
467
|
+
}
|
|
468
|
+
[_view setSource:source];
|
|
469
|
+
|
|
470
|
+
[super updateProps:props oldProps:oldProps];
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
- (void)handleCommand:(nonnull const NSString *)commandName args:(nonnull const NSArray *)args {
|
|
474
|
+
RCTBPCWebViewHandleCommand(self, commandName, args);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
Class<RCTComponentViewProtocol> BPCWebViewCls(void)
|
|
479
|
+
{
|
|
480
|
+
return BPCWebView.class;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
- (void)goBack {
|
|
484
|
+
[_view goBack];
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
- (void)goForward {
|
|
488
|
+
[_view goForward];
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
- (void)injectJavaScript:(nonnull NSString *)javascript {
|
|
492
|
+
[_view injectJavaScript:javascript];
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
- (void)loadUrl:(nonnull NSString *)url {
|
|
496
|
+
// android only
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
- (void)postMessage:(nonnull NSString *)data {
|
|
500
|
+
[_view postMessage:data];
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
- (void)reload {
|
|
504
|
+
[_view reload];
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
- (void)requestFocus {
|
|
508
|
+
[_view requestFocus];
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
- (void)stopLoading {
|
|
512
|
+
[_view stopLoading];
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
- (void)clearFormData {
|
|
516
|
+
// android only
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
- (void)clearCache:(BOOL)includeDiskFiles {
|
|
520
|
+
// android only
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
- (void)clearHistory {
|
|
524
|
+
// android only
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
@end
|
|
528
|
+
#endif
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <React/RCTLog.h>
|
|
3
|
+
#import <WebKit/WebKit.h>
|
|
4
|
+
|
|
5
|
+
typedef void (^DecisionBlock)(BOOL);
|
|
6
|
+
|
|
7
|
+
@interface BPCWebViewDecisionManager : NSObject {
|
|
8
|
+
int nextLockIdentifier;
|
|
9
|
+
NSMutableDictionary *decisionHandlers;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@property (nonatomic) int nextLockIdentifier;
|
|
13
|
+
@property (nonatomic, retain) NSMutableDictionary *decisionHandlers;
|
|
14
|
+
|
|
15
|
+
+ (id) getInstance;
|
|
16
|
+
|
|
17
|
+
- (int)setDecisionHandler:(DecisionBlock)handler;
|
|
18
|
+
- (void) setResult:(BOOL)shouldStart
|
|
19
|
+
forLockIdentifier:(int)lockIdentifier;
|
|
20
|
+
@end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#import "BPCWebViewDecisionManager.h"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@implementation BPCWebViewDecisionManager
|
|
6
|
+
|
|
7
|
+
@synthesize nextLockIdentifier;
|
|
8
|
+
@synthesize decisionHandlers;
|
|
9
|
+
|
|
10
|
+
+ (id)getInstance {
|
|
11
|
+
static BPCWebViewDecisionManager *lockManager = nil;
|
|
12
|
+
static dispatch_once_t onceToken;
|
|
13
|
+
dispatch_once(&onceToken, ^{
|
|
14
|
+
lockManager = [[self alloc] init];
|
|
15
|
+
});
|
|
16
|
+
return lockManager;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (int)setDecisionHandler:(DecisionBlock)decisionHandler {
|
|
20
|
+
int lockIdentifier = self.nextLockIdentifier++;
|
|
21
|
+
|
|
22
|
+
[self.decisionHandlers setObject:decisionHandler forKey:@(lockIdentifier)];
|
|
23
|
+
return lockIdentifier;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
- (void) setResult:(BOOL)shouldStart
|
|
27
|
+
forLockIdentifier:(int)lockIdentifier {
|
|
28
|
+
DecisionBlock handler = [self.decisionHandlers objectForKey:@(lockIdentifier)];
|
|
29
|
+
if (handler == nil) {
|
|
30
|
+
RCTLogWarn(@"Lock not found");
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
handler(shouldStart);
|
|
34
|
+
[self.decisionHandlers removeObjectForKey:@(lockIdentifier)];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (id)init {
|
|
38
|
+
if (self = [super init]) {
|
|
39
|
+
self.nextLockIdentifier = 1;
|
|
40
|
+
self.decisionHandlers = [[NSMutableDictionary alloc] init];
|
|
41
|
+
}
|
|
42
|
+
return self;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
- (void)dealloc {}
|
|
46
|
+
|
|
47
|
+
@end
|