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.
Files changed (200) hide show
  1. package/README.md +93 -83
  2. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +5 -3
  3. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +2 -4
  4. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -2
  5. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  6. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  7. package/android/build/intermediates/compile_symbol_list/debug/R.txt +8 -72
  8. package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
  9. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
  10. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
  11. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
  12. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +2 -2
  13. package/android/build/intermediates/incremental/packageDebugResources/merger.xml +1 -1
  14. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
  15. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView.class +0 -0
  16. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
  17. package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
  18. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +200 -198
  19. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +3 -5
  20. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  21. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +8 -66
  22. package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/caches-jvm/{lookups/id-to-file.tab.keystream → jvm/kotlin/java-sources-proto-map.tab} +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/{subtypes.tab_i → java-sources-proto-map.tab_i} +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
  46. package/android/build/outputs/logs/manifest-merger-debug-report.txt +128 -116
  47. package/android/build/tmp/kotlin-classes/debug/META-INF/rnWebView_debug.kotlin_module +0 -0
  48. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
  49. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
  50. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
  51. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
  52. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
  53. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
  54. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
  55. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
  56. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
  57. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
  58. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
  59. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
  60. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
  61. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
  62. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
  63. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
  64. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
  65. package/apple/BPCWebView.h +0 -19
  66. package/apple/BPCWebView.m +104 -284
  67. package/apple/BPCWebViewManager.h +0 -2
  68. package/apple/BPCWebViewManager.m +1 -25
  69. package/index.d.ts +5 -5
  70. package/ios/.DS_Store +0 -0
  71. package/ios/RNCWebView.xcodeproj/project.pbxproj +18 -18
  72. package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/bootpay.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  73. package/lib/WebView.android.d.ts +0 -3
  74. package/lib/WebView.android.d.ts.map +1 -1
  75. package/lib/WebView.android.js +4 -11
  76. package/lib/WebView.d.ts +2 -2
  77. package/lib/WebView.d.ts.map +1 -1
  78. package/lib/WebView.ios.d.ts +0 -1
  79. package/lib/WebView.ios.d.ts.map +1 -1
  80. package/lib/WebView.ios.js +7 -12
  81. package/lib/WebView.macos.d.ts.map +1 -1
  82. package/lib/WebView.macos.js +6 -10
  83. package/lib/WebView.windows.d.ts +2 -4
  84. package/lib/WebView.windows.d.ts.map +1 -1
  85. package/lib/WebView.windows.js +12 -18
  86. package/lib/WebViewShared.d.ts +0 -1
  87. package/lib/WebViewShared.d.ts.map +1 -1
  88. package/lib/WebViewTypes.d.ts +2 -113
  89. package/lib/WebViewTypes.d.ts.map +1 -1
  90. package/package.json +9 -10
  91. package/react-native-webview-bootpay.podspec +3 -1
  92. package/react-native.config.js +61 -47
  93. package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +20 -37
  94. package/windows/ReactNativeWebView/ReactPackageProvider.cpp +1 -5
  95. package/windows/ReactNativeWebView/ReactWebView.cpp +6 -2
  96. package/windows/ReactNativeWebView/ReactWebView.h +2 -3
  97. package/windows/ReactNativeWebView/ReactWebView.idl +1 -13
  98. package/windows/ReactNativeWebView/ReactWebViewManager.cpp +31 -36
  99. package/windows/ReactNativeWebView/packages.config +0 -2
  100. package/windows/ReactNativeWebView/pch.h +0 -6
  101. package/windows/ReactNativeWebView.sln +119 -81
  102. package/windows/WebViewBridgeComponent/PropertySheet.props +16 -0
  103. package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.cpp +1 -1
  104. package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.h +2 -2
  105. package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.idl +1 -1
  106. package/windows/WebViewBridgeComponent/WebViewBridgeComponent.def +3 -0
  107. package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj +160 -0
  108. package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj.filters +33 -0
  109. package/windows/WebViewBridgeComponent/packages.config +4 -0
  110. package/windows/WebViewBridgeComponent/pch.cpp +1 -0
  111. package/windows/WebViewBridgeComponent/pch.h +4 -0
  112. package/windows/WebViewBridgeComponent/readme.txt +23 -0
  113. package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/results.bin +0 -1
  114. package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/transformed/classes/classes.dex +0 -0
  115. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -100
  116. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  128. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  135. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  158. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  159. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  160. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  161. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  162. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  163. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  164. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +0 -2
  165. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  166. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  167. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
  168. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  169. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  170. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  171. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
  172. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  173. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  174. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
  175. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  176. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
  177. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
  178. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
  179. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  180. package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
  181. package/lib/WebViewNativeComponent.android.d.ts +0 -4
  182. package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
  183. package/lib/WebViewNativeComponent.android.js +0 -3
  184. package/lib/WebViewNativeComponent.ios.d.ts +0 -4
  185. package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
  186. package/lib/WebViewNativeComponent.ios.js +0 -3
  187. package/lib/WebViewNativeComponent.macos.d.ts +0 -4
  188. package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
  189. package/lib/WebViewNativeComponent.macos.js +0 -3
  190. package/lib/WebViewNativeComponent.windows.d.ts +0 -4
  191. package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
  192. package/lib/WebViewNativeComponent.windows.js +0 -3
  193. package/lib/index.d.ts +0 -4
  194. package/lib/index.d.ts.map +0 -1
  195. package/lib/index.js +0 -3
  196. package/windows/ExperimentalFeatures.props +0 -12
  197. package/windows/ReactNativeWebView/ReactWebView2.cpp +0 -119
  198. package/windows/ReactNativeWebView/ReactWebView2.h +0 -43
  199. package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +0 -147
  200. 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