@react-native-ohos/react-native-webview 13.15.1-rc.1 → 13.15.1-rc.4

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 (56) hide show
  1. package/LICENSE +20 -20
  2. package/README.OpenSource +10 -10
  3. package/README.md +12 -12
  4. package/harmony/rn_webview/OAT.xml +44 -44
  5. package/harmony/rn_webview/build-profile.json5 +28 -28
  6. package/harmony/rn_webview/index.ets +12 -12
  7. package/harmony/rn_webview/oh-package.json5 +13 -13
  8. package/harmony/rn_webview/src/main/cpp/CMakeLists.txt +9 -9
  9. package/harmony/rn_webview/src/main/cpp/WebViewPackage.h +16 -16
  10. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/BaseReactNativeWebviewPackage.h +95 -95
  11. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/components/RNCWebViewJSIBinder.h +119 -119
  12. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.cpp +18 -18
  13. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.h +16 -16
  14. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.cpp +17 -17
  15. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.h +16 -16
  16. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ComponentDescriptors.h +24 -24
  17. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.cpp +241 -241
  18. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.h +263 -263
  19. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.cpp +103 -103
  20. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.h +509 -509
  21. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.cpp +17 -17
  22. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.h +32 -32
  23. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.cpp +16 -16
  24. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.h +28 -28
  25. package/harmony/rn_webview/src/main/ets/CutomReference.ts +29 -29
  26. package/harmony/rn_webview/src/main/ets/Logger.ts +43 -43
  27. package/harmony/rn_webview/src/main/ets/Magic.ets +184 -184
  28. package/harmony/rn_webview/src/main/ets/RNCWebView.ets +645 -570
  29. package/harmony/rn_webview/src/main/ets/RNCWebViewPackage.ets +37 -37
  30. package/harmony/rn_webview/src/main/ets/ShouldRequestUrl.ts +47 -47
  31. package/harmony/rn_webview/src/main/ets/WebViewBaseOperate.ets +457 -443
  32. package/harmony/rn_webview/src/main/ets/WebViewTurboModule.ets +57 -57
  33. package/harmony/rn_webview/src/main/ets/generated/components/RNCWebView.ts +524 -524
  34. package/harmony/rn_webview/src/main/ets/generated/components/ts.ts +5 -5
  35. package/harmony/rn_webview/src/main/ets/generated/index.ets +5 -5
  36. package/harmony/rn_webview/src/main/ets/generated/ts.ts +6 -6
  37. package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebView.ts +18 -18
  38. package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebViewModule.ts +16 -16
  39. package/harmony/rn_webview/src/main/ets/generated/turboModules/ts.ts +6 -6
  40. package/harmony/rn_webview/src/main/module.json5 +10 -10
  41. package/harmony/rn_webview/src/main/resources/base/element/string.json +39 -39
  42. package/harmony/rn_webview/src/main/resources/en_US/element/string.json +39 -39
  43. package/harmony/rn_webview/src/main/resources/zh_CN/element/string.json +39 -39
  44. package/harmony/rn_webview/src/test/List.test.ets +4 -4
  45. package/harmony/rn_webview/src/test/LocalUnit.test.ets +32 -32
  46. package/harmony/rn_webview/ts.ets +8 -8
  47. package/harmony/rn_webview.har +0 -0
  48. package/package.json +99 -99
  49. package/src/NativeRNCWebView.ts +21 -21
  50. package/src/NativeRNCWebViewModule.ts +19 -19
  51. package/src/RNCWebViewNativeComponent.ts +354 -354
  52. package/src/WebView.harmony.tsx +342 -342
  53. package/src/WebView.tsx +10 -10
  54. package/src/codegenUtils.ts +10 -10
  55. package/src/index.ts +10 -10
  56. package/harmony/rn_webview/BuildProfile.ets +0 -17
@@ -1,58 +1,58 @@
1
- // Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
2
- // Use of this source code is governed by a Apache-2.0 license that can be
3
- // found in the LICENSE file.
4
-
5
- import { TM } from './generated/ts';
6
- import { AnyThreadTurboModule } from '@rnoh/react-native-openharmony/ts';
7
- import Logger from './Logger';
8
-
9
- const TAG = "WebViewTurboModule"
10
-
11
- export class WebViewTurboModule extends AnyThreadTurboModule implements TM.RNCWebViewModule.Spec {
12
- private shouldStartParamsMap : Map<number,ShouldStartParams> = new Map();
13
-
14
- isFileUploadSupported(): Promise<boolean> {
15
- return Promise.resolve(true)
16
- }
17
-
18
- shouldStartLoadWithLockIdentifier(shouldStart: boolean, lockIdentifier: number): void {
19
- Logger.debug("shouldStartLoadWithLockIdentifier:" + shouldStart + " lockIdentifier:" + lockIdentifier)
20
- let shouldStartParams = this.shouldStartParamsMap.get(lockIdentifier)
21
- Logger.debug("shouldStartLoadWithLockIdentifier setShouldStartParams:" + JSON.stringify(shouldStartParams))
22
- if (shouldStartParams) {
23
- shouldStartParams.shouldStart = shouldStart
24
- shouldStartParams.lockState = shouldStart ? ShouldOverrideCallbackState.ALLOW_LOADING : ShouldOverrideCallbackState.SHOULD_OVERRIDE;
25
- }
26
- this.shouldStartParamsMap.set(lockIdentifier,shouldStartParams || new ShouldStartParams())
27
- }
28
-
29
-
30
- setShouldStartParams(params: ShouldStartParams){
31
- Logger.debug("setShouldStartParams:" + JSON.stringify(params))
32
- this.shouldStartParamsMap.set(params.lockIdentifier,params)
33
- }
34
- }
35
-
36
- // 锁状态
37
- export enum ShouldOverrideCallbackState {
38
- /**
39
- * 初始状态
40
- */
41
- UNDECIDED,
42
- /**
43
- * 阻止加载
44
- */
45
- SHOULD_OVERRIDE,
46
- /**
47
- * 允许加载
48
- */
49
- ALLOW_LOADING,
50
- }
51
-
52
- @Sendable
53
- export class ShouldStartParams {
54
- shouldStart: boolean = true
55
- lockIdentifier: number = -1
56
- // 对应ShouldOverrideCallbackState
57
- lockState: number = 0
1
+ // Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
2
+ // Use of this source code is governed by a Apache-2.0 license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import { TM } from './generated/ts';
6
+ import { AnyThreadTurboModule } from '@rnoh/react-native-openharmony/ts';
7
+ import Logger from './Logger';
8
+
9
+ const TAG = "WebViewTurboModule"
10
+
11
+ export class WebViewTurboModule extends AnyThreadTurboModule implements TM.RNCWebViewModule.Spec {
12
+ private shouldStartParamsMap : Map<number,ShouldStartParams> = new Map();
13
+
14
+ isFileUploadSupported(): Promise<boolean> {
15
+ return Promise.resolve(true)
16
+ }
17
+
18
+ shouldStartLoadWithLockIdentifier(shouldStart: boolean, lockIdentifier: number): void {
19
+ Logger.debug("shouldStartLoadWithLockIdentifier:" + shouldStart + " lockIdentifier:" + lockIdentifier)
20
+ let shouldStartParams = this.shouldStartParamsMap.get(lockIdentifier)
21
+ Logger.debug("shouldStartLoadWithLockIdentifier setShouldStartParams:" + JSON.stringify(shouldStartParams))
22
+ if (shouldStartParams) {
23
+ shouldStartParams.shouldStart = shouldStart
24
+ shouldStartParams.lockState = shouldStart ? ShouldOverrideCallbackState.ALLOW_LOADING : ShouldOverrideCallbackState.SHOULD_OVERRIDE;
25
+ }
26
+ this.shouldStartParamsMap.set(lockIdentifier,shouldStartParams || new ShouldStartParams())
27
+ }
28
+
29
+
30
+ setShouldStartParams(params: ShouldStartParams){
31
+ Logger.debug("setShouldStartParams:" + JSON.stringify(params))
32
+ this.shouldStartParamsMap.set(params.lockIdentifier,params)
33
+ }
34
+ }
35
+
36
+ // 锁状态
37
+ export enum ShouldOverrideCallbackState {
38
+ /**
39
+ * 初始状态
40
+ */
41
+ UNDECIDED,
42
+ /**
43
+ * 阻止加载
44
+ */
45
+ SHOULD_OVERRIDE,
46
+ /**
47
+ * 允许加载
48
+ */
49
+ ALLOW_LOADING,
50
+ }
51
+
52
+ @Sendable
53
+ export class ShouldStartParams {
54
+ shouldStart: boolean = true
55
+ lockIdentifier: number = -1
56
+ // 对应ShouldOverrideCallbackState
57
+ lockState: number = 0
58
58
  }