react-native-webview-bootpay 11.18.11 → 11.18.12
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 +93 -83
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +5 -3
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +2 -4
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -2
- 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 +8 -72
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +2 -2
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +1 -1
- 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.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +200 -198
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +3 -5
- 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 +8 -66
- package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/{lookups/id-to-file.tab.keystream → jvm/kotlin/java-sources-proto-map.tab} +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/{subtypes.tab_i → java-sources-proto-map.tab_i} +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +128 -116
- package/android/build/tmp/kotlin-classes/debug/META-INF/rnWebView_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/apple/BPCWebView.h +0 -19
- package/apple/BPCWebView.m +104 -284
- package/apple/BPCWebViewManager.h +0 -2
- package/apple/BPCWebViewManager.m +1 -25
- package/index.d.ts +5 -5
- package/ios/.DS_Store +0 -0
- package/ios/RNCWebView.xcodeproj/project.pbxproj +18 -18
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/bootpay.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/WebView.android.d.ts +0 -3
- package/lib/WebView.android.d.ts.map +1 -1
- package/lib/WebView.android.js +4 -11
- package/lib/WebView.d.ts +2 -2
- package/lib/WebView.d.ts.map +1 -1
- package/lib/WebView.ios.d.ts +0 -1
- package/lib/WebView.ios.d.ts.map +1 -1
- package/lib/WebView.ios.js +7 -12
- package/lib/WebView.macos.d.ts.map +1 -1
- package/lib/WebView.macos.js +6 -10
- package/lib/WebView.windows.d.ts +2 -4
- package/lib/WebView.windows.d.ts.map +1 -1
- package/lib/WebView.windows.js +12 -18
- package/lib/WebViewShared.d.ts +0 -1
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewTypes.d.ts +2 -113
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/package.json +9 -10
- package/react-native-webview-bootpay.podspec +3 -1
- package/react-native.config.js +61 -47
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +20 -37
- package/windows/ReactNativeWebView/ReactPackageProvider.cpp +1 -5
- package/windows/ReactNativeWebView/ReactWebView.cpp +6 -2
- package/windows/ReactNativeWebView/ReactWebView.h +2 -3
- package/windows/ReactNativeWebView/ReactWebView.idl +1 -13
- package/windows/ReactNativeWebView/ReactWebViewManager.cpp +31 -36
- package/windows/ReactNativeWebView/packages.config +0 -2
- package/windows/ReactNativeWebView/pch.h +0 -6
- package/windows/ReactNativeWebView.sln +119 -81
- package/windows/WebViewBridgeComponent/PropertySheet.props +16 -0
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.cpp +1 -1
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.h +2 -2
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.idl +1 -1
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.def +3 -0
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj +160 -0
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj.filters +33 -0
- package/windows/WebViewBridgeComponent/packages.config +4 -0
- package/windows/WebViewBridgeComponent/pch.cpp +1 -0
- package/windows/WebViewBridgeComponent/pch.h +4 -0
- package/windows/WebViewBridgeComponent/readme.txt +23 -0
- package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/results.bin +0 -1
- package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/transformed/classes/classes.dex +0 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -100
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
- 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/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
- package/lib/WebViewNativeComponent.macos.d.ts +0 -4
- package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.macos.js +0 -3
- package/lib/WebViewNativeComponent.windows.d.ts +0 -4
- package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.windows.js +0 -3
- package/lib/index.d.ts +0 -4
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -3
- package/windows/ExperimentalFeatures.props +0 -12
- package/windows/ReactNativeWebView/ReactWebView2.cpp +0 -119
- package/windows/ReactNativeWebView/ReactWebView2.h +0 -43
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +0 -147
- package/windows/ReactNativeWebView/ReactWebView2Manager.h +0 -54
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
#include "pch.h"
|
|
2
|
-
#if RNW_VERSION_AT_LEAST(0,68,0)
|
|
3
|
-
#include "ReactWebView2Manager.h"
|
|
4
|
-
#include "NativeModules.h"
|
|
5
|
-
#include "ReactWebView2.h"
|
|
6
|
-
#include "JSValueXaml.h"
|
|
7
|
-
|
|
8
|
-
namespace winrt {
|
|
9
|
-
using namespace Microsoft::ReactNative;
|
|
10
|
-
using namespace Windows::Foundation;
|
|
11
|
-
using namespace Windows::Foundation::Collections;
|
|
12
|
-
using namespace Windows::UI;
|
|
13
|
-
using namespace Windows::UI::Xaml;
|
|
14
|
-
using namespace Windows::UI::Xaml::Controls;
|
|
15
|
-
using namespace Microsoft::UI::Xaml::Controls;
|
|
16
|
-
using namespace Windows::Web::Http;
|
|
17
|
-
using namespace Windows::Web::Http::Headers;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
namespace winrt::ReactNativeWebView::implementation {
|
|
21
|
-
|
|
22
|
-
ReactWebView2Manager::ReactWebView2Manager() {}
|
|
23
|
-
|
|
24
|
-
// IViewManager
|
|
25
|
-
winrt::hstring ReactWebView2Manager::Name() noexcept {
|
|
26
|
-
return L"RCTWebView2";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
winrt::FrameworkElement ReactWebView2Manager::CreateView() noexcept {
|
|
30
|
-
auto view = winrt::ReactNativeWebView::ReactWebView2(m_reactContext);
|
|
31
|
-
return view;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// IViewManagerWithReactContext
|
|
35
|
-
winrt::IReactContext ReactWebView2Manager::ReactContext() noexcept {
|
|
36
|
-
return m_reactContext;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
void ReactWebView2Manager::ReactContext(IReactContext reactContext) noexcept {
|
|
40
|
-
m_reactContext = reactContext;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// IViewManagerWithNativeProperties
|
|
44
|
-
IMapView<hstring, ViewManagerPropertyType> ReactWebView2Manager::NativeProps() noexcept {
|
|
45
|
-
auto nativeProps = winrt::single_threaded_map<hstring, ViewManagerPropertyType>();
|
|
46
|
-
nativeProps.Insert(L"source", ViewManagerPropertyType::Map);
|
|
47
|
-
return nativeProps.GetView();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
void ReactWebView2Manager::UpdateProperties(
|
|
51
|
-
FrameworkElement const& view,
|
|
52
|
-
IJSValueReader const& propertyMapReader) noexcept {
|
|
53
|
-
auto control = view.as<winrt::ContentPresenter>();
|
|
54
|
-
auto content = control.Content();
|
|
55
|
-
auto webView = content.as<winrt::WebView2>();
|
|
56
|
-
const JSValueObject& propertyMap = JSValueObject::ReadFrom(propertyMapReader);
|
|
57
|
-
|
|
58
|
-
for (auto const& pair : propertyMap) {
|
|
59
|
-
auto const& propertyName = pair.first;
|
|
60
|
-
auto const& propertyValue = pair.second;
|
|
61
|
-
if (propertyValue.IsNull()) continue;
|
|
62
|
-
|
|
63
|
-
if (propertyName == "source") {
|
|
64
|
-
auto const& srcMap = propertyValue.AsObject();
|
|
65
|
-
std::string file = "file://";
|
|
66
|
-
if (srcMap.find("uri") != srcMap.end()) {
|
|
67
|
-
auto uriString = srcMap.at("uri").AsString();
|
|
68
|
-
if (uriString.length() == 0) {
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
bool isPackagerAsset = false;
|
|
73
|
-
if (srcMap.find("__packager_asset") != srcMap.end()) {
|
|
74
|
-
isPackagerAsset = srcMap.at("__packager_asset").AsBoolean();
|
|
75
|
-
}
|
|
76
|
-
if (isPackagerAsset && uriString.find(file) == 0) {
|
|
77
|
-
auto bundleRootPath = winrt::to_string(ReactNativeHost().InstanceSettings().BundleRootPath());
|
|
78
|
-
uriString.replace(0, std::size(file), bundleRootPath.empty() ? "ms-appx-web:///Bundle/" : bundleRootPath);
|
|
79
|
-
}
|
|
80
|
-
webView.Source(winrt::Uri(to_hstring(uriString)));
|
|
81
|
-
}
|
|
82
|
-
else if (srcMap.find("html") != srcMap.end()) {
|
|
83
|
-
auto htmlString = srcMap.at("html").AsString();
|
|
84
|
-
auto reactWebView2 = view.as<winrt::ReactNativeWebView::ReactWebView2>();
|
|
85
|
-
reactWebView2.NavigateToHtml(to_hstring(htmlString));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// IViewManagerWithExportedEventTypeConstants
|
|
92
|
-
ConstantProviderDelegate ReactWebView2Manager::ExportedCustomBubblingEventTypeConstants() noexcept {
|
|
93
|
-
return nullptr;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
ConstantProviderDelegate ReactWebView2Manager::ExportedCustomDirectEventTypeConstants() noexcept {
|
|
97
|
-
return [](winrt::IJSValueWriter const& constantWriter) {
|
|
98
|
-
WriteCustomDirectEventTypeConstant(constantWriter, "LoadingStart");
|
|
99
|
-
WriteCustomDirectEventTypeConstant(constantWriter, "LoadingFinish");
|
|
100
|
-
WriteCustomDirectEventTypeConstant(constantWriter, "LoadingError");
|
|
101
|
-
WriteCustomDirectEventTypeConstant(constantWriter, "Message");
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// IViewManagerWithCommands
|
|
106
|
-
IVectorView<hstring> ReactWebView2Manager::Commands() noexcept {
|
|
107
|
-
auto commands = winrt::single_threaded_vector<hstring>();
|
|
108
|
-
commands.Append(L"goForward");
|
|
109
|
-
commands.Append(L"goBack");
|
|
110
|
-
commands.Append(L"reload");
|
|
111
|
-
commands.Append(L"stopLoading");
|
|
112
|
-
commands.Append(L"injectJavaScript");
|
|
113
|
-
return commands.GetView();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
void ReactWebView2Manager::DispatchCommand(
|
|
117
|
-
FrameworkElement const& view,
|
|
118
|
-
winrt::hstring const& commandId,
|
|
119
|
-
winrt::IJSValueReader const& commandArgsReader) noexcept {
|
|
120
|
-
auto control = view.as<winrt::ContentPresenter>();
|
|
121
|
-
auto content = control.Content();
|
|
122
|
-
auto webView = content.as<winrt::WebView>();
|
|
123
|
-
auto commandArgs = JSValue::ReadArrayFrom(commandArgsReader);
|
|
124
|
-
|
|
125
|
-
if (commandId == L"goForward") {
|
|
126
|
-
if (webView.CanGoForward()) {
|
|
127
|
-
webView.GoForward();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
else if (commandId == L"goBack") {
|
|
131
|
-
if (webView.CanGoBack()) {
|
|
132
|
-
webView.GoBack();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
else if (commandId == L"reload") {
|
|
136
|
-
webView.Refresh();
|
|
137
|
-
}
|
|
138
|
-
else if (commandId == L"stopLoading") {
|
|
139
|
-
webView.Stop();
|
|
140
|
-
}
|
|
141
|
-
else if (commandId == L"injectJavaScript") {
|
|
142
|
-
webView.InvokeScriptAsync(L"eval", { winrt::to_hstring(commandArgs[0].AsString()) });
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
} // namespace winrt::ReactNativeWebView::implementation
|
|
147
|
-
#endif
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
#if RNW_VERSION_AT_LEAST(0,68,0)
|
|
4
|
-
#pragma once
|
|
5
|
-
#include "winrt/Microsoft.ReactNative.h"
|
|
6
|
-
#include "NativeModules.h"
|
|
7
|
-
#include "ReactWebView2.h"
|
|
8
|
-
|
|
9
|
-
namespace winrt::ReactNativeWebView::implementation {
|
|
10
|
-
|
|
11
|
-
class ReactWebView2Manager : public winrt::implements<
|
|
12
|
-
ReactWebView2Manager,
|
|
13
|
-
winrt::Microsoft::ReactNative::IViewManager,
|
|
14
|
-
winrt::Microsoft::ReactNative::IViewManagerWithReactContext,
|
|
15
|
-
winrt::Microsoft::ReactNative::IViewManagerWithNativeProperties,
|
|
16
|
-
winrt::Microsoft::ReactNative::IViewManagerWithExportedEventTypeConstants,
|
|
17
|
-
winrt::Microsoft::ReactNative::IViewManagerWithCommands> {
|
|
18
|
-
public:
|
|
19
|
-
ReactWebView2Manager();
|
|
20
|
-
// IViewManager
|
|
21
|
-
winrt::hstring Name() noexcept;
|
|
22
|
-
winrt::Windows::UI::Xaml::FrameworkElement CreateView() noexcept;
|
|
23
|
-
|
|
24
|
-
// IViewManagerWithReactContext
|
|
25
|
-
winrt::Microsoft::ReactNative::IReactContext ReactContext() noexcept;
|
|
26
|
-
void ReactContext(winrt::Microsoft::ReactNative::IReactContext reactContext) noexcept;
|
|
27
|
-
|
|
28
|
-
// IViewManagerWithNativeProperties
|
|
29
|
-
winrt::Windows::Foundation::Collections::
|
|
30
|
-
IMapView<winrt::hstring, winrt::Microsoft::ReactNative::ViewManagerPropertyType>
|
|
31
|
-
NativeProps() noexcept;
|
|
32
|
-
|
|
33
|
-
void UpdateProperties(
|
|
34
|
-
winrt::Windows::UI::Xaml::FrameworkElement const& view,
|
|
35
|
-
winrt::Microsoft::ReactNative::IJSValueReader const& propertyMapReader) noexcept;
|
|
36
|
-
|
|
37
|
-
// IViewManagerWithExportedEventTypeConstants
|
|
38
|
-
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomBubblingEventTypeConstants() noexcept;
|
|
39
|
-
winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomDirectEventTypeConstants() noexcept;
|
|
40
|
-
|
|
41
|
-
// IViewManagerWithCommands
|
|
42
|
-
winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring> Commands() noexcept;
|
|
43
|
-
|
|
44
|
-
void DispatchCommand(
|
|
45
|
-
winrt::Windows::UI::Xaml::FrameworkElement const& view,
|
|
46
|
-
winrt::hstring const& commandId,
|
|
47
|
-
winrt::Microsoft::ReactNative::IJSValueReader const& commandArgsReader) noexcept;
|
|
48
|
-
|
|
49
|
-
private:
|
|
50
|
-
winrt::Microsoft::ReactNative::IReactContext m_reactContext{ nullptr };
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
} // namespace winrt::ReactNativeWebView::implementation
|
|
54
|
-
#endif
|