@react-native-ohos/react-native-webview 13.15.3 → 13.15.4-beta.3

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 (59) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/LICENSE +20 -20
  3. package/README.OpenSource +10 -10
  4. package/README.md +395 -13
  5. package/harmony/rn_webview/.gitignore +6 -0
  6. package/harmony/rn_webview/BuildProfile.ets +17 -0
  7. package/harmony/rn_webview/OAT.xml +44 -44
  8. package/harmony/rn_webview/build-profile.json5 +28 -28
  9. package/harmony/rn_webview/index.ets +12 -12
  10. package/harmony/rn_webview/oh-package-lock.json5 +18 -0
  11. package/harmony/rn_webview/oh-package.json5 +13 -13
  12. package/harmony/rn_webview/src/main/cpp/CMakeLists.txt +9 -9
  13. package/harmony/rn_webview/src/main/cpp/WebViewPackage.h +16 -16
  14. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/BaseReactNativeWebviewPackage.h +95 -95
  15. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/components/RNCWebViewJSIBinder.h +127 -127
  16. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.cpp +18 -18
  17. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.h +16 -16
  18. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.cpp +17 -17
  19. package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.h +16 -16
  20. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ComponentDescriptors.h +24 -24
  21. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.cpp +241 -241
  22. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.h +263 -263
  23. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.cpp +109 -109
  24. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.h +512 -512
  25. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.cpp +17 -17
  26. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.h +32 -32
  27. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.cpp +16 -16
  28. package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.h +28 -28
  29. package/harmony/rn_webview/src/main/ets/CutomReference.ts +29 -29
  30. package/harmony/rn_webview/src/main/ets/Logger.ts +43 -43
  31. package/harmony/rn_webview/src/main/ets/Magic.ets +200 -200
  32. package/harmony/rn_webview/src/main/ets/RNCWebView.ets +842 -889
  33. package/harmony/rn_webview/src/main/ets/RNCWebViewPackage.ets +37 -37
  34. package/harmony/rn_webview/src/main/ets/ShouldRequestUrl.ts +47 -47
  35. package/harmony/rn_webview/src/main/ets/WebViewBaseOperate.ets +470 -470
  36. package/harmony/rn_webview/src/main/ets/WebViewTurboModule.ets +62 -62
  37. package/harmony/rn_webview/src/main/ets/generated/components/RNCWebView.ts +530 -530
  38. package/harmony/rn_webview/src/main/ets/generated/components/ts.ts +5 -5
  39. package/harmony/rn_webview/src/main/ets/generated/index.ets +5 -5
  40. package/harmony/rn_webview/src/main/ets/generated/ts.ts +6 -6
  41. package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebView.ts +18 -18
  42. package/harmony/rn_webview/src/main/ets/generated/turboModules/RNCWebViewModule.ts +16 -16
  43. package/harmony/rn_webview/src/main/ets/generated/turboModules/ts.ts +6 -6
  44. package/harmony/rn_webview/src/main/module.json5 +10 -10
  45. package/harmony/rn_webview/src/main/resources/base/element/string.json +39 -39
  46. package/harmony/rn_webview/src/main/resources/en_US/element/string.json +39 -39
  47. package/harmony/rn_webview/src/main/resources/zh_CN/element/string.json +39 -39
  48. package/harmony/rn_webview/src/test/List.test.ets +4 -4
  49. package/harmony/rn_webview/src/test/LocalUnit.test.ets +32 -32
  50. package/harmony/rn_webview/ts.ets +8 -8
  51. package/harmony/rn_webview.har +0 -0
  52. package/package.json +100 -99
  53. package/src/NativeRNCWebView.ts +21 -21
  54. package/src/NativeRNCWebViewModule.ts +19 -19
  55. package/src/RNCWebViewNativeComponent.ts +357 -357
  56. package/src/WebView.harmony.tsx +344 -344
  57. package/src/WebView.tsx +10 -10
  58. package/src/codegenUtils.ts +10 -10
  59. package/src/index.ts +10 -10
@@ -1,38 +1,38 @@
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 type {
6
- DescriptorWrapperFactoryByDescriptorType,
7
- DescriptorWrapperFactoryByDescriptorTypeCtx,
8
- } from '@rnoh/react-native-openharmony/ts';
9
- import { RNC, TM } from './generated/ts';
10
- import { AnyThreadTurboModuleFactory, AnyThreadTurboModule } from '@rnoh/react-native-openharmony/ts';
11
- import { RNOHPackage } from '@rnoh/react-native-openharmony';
12
- import { WebViewTurboModule } from './WebViewTurboModule'
13
- import { WorkerTurboModuleContext } from '@rnoh/react-native-openharmony/src/main/ets/RNOH/RNOHContext';
14
-
15
- export class RNCWebViewPackage extends RNOHPackage {
16
- createDescriptorWrapperFactoryByDescriptorType(ctx: DescriptorWrapperFactoryByDescriptorTypeCtx): DescriptorWrapperFactoryByDescriptorType {
17
- return {
18
- "RNCWebView": (ctx) => new RNC.RNCWebView.DescriptorWrapper(ctx.descriptor)
19
- }
20
- }
21
-
22
- createAnyThreadTurboModuleFactory(ctx: WorkerTurboModuleContext): AnyThreadTurboModuleFactory {
23
- return new WebViewTurboModulesFactory(ctx);
24
- }
25
- }
26
-
27
- class WebViewTurboModulesFactory extends AnyThreadTurboModuleFactory {
28
- createTurboModule(name: string): AnyThreadTurboModule | null {
29
- if (name === TM.RNCWebViewModule.NAME) {
30
- return new WebViewTurboModule(this.ctx);
31
- }
32
- return null;
33
- }
34
-
35
- hasTurboModule(name: string): boolean {
36
- return name === TM.RNCWebViewModule.NAME;
37
- }
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 type {
6
+ DescriptorWrapperFactoryByDescriptorType,
7
+ DescriptorWrapperFactoryByDescriptorTypeCtx,
8
+ } from '@rnoh/react-native-openharmony/ts';
9
+ import { RNC, TM } from './generated/ts';
10
+ import { AnyThreadTurboModuleFactory, AnyThreadTurboModule } from '@rnoh/react-native-openharmony/ts';
11
+ import { RNOHPackage } from '@rnoh/react-native-openharmony';
12
+ import { WebViewTurboModule } from './WebViewTurboModule'
13
+ import { WorkerTurboModuleContext } from '@rnoh/react-native-openharmony/src/main/ets/RNOH/RNOHContext';
14
+
15
+ export class RNCWebViewPackage extends RNOHPackage {
16
+ createDescriptorWrapperFactoryByDescriptorType(ctx: DescriptorWrapperFactoryByDescriptorTypeCtx): DescriptorWrapperFactoryByDescriptorType {
17
+ return {
18
+ "RNCWebView": (ctx) => new RNC.RNCWebView.DescriptorWrapper(ctx.descriptor)
19
+ }
20
+ }
21
+
22
+ createAnyThreadTurboModuleFactory(ctx: WorkerTurboModuleContext): AnyThreadTurboModuleFactory {
23
+ return new WebViewTurboModulesFactory(ctx);
24
+ }
25
+ }
26
+
27
+ class WebViewTurboModulesFactory extends AnyThreadTurboModuleFactory {
28
+ createTurboModule(name: string): AnyThreadTurboModule | null {
29
+ if (name === TM.RNCWebViewModule.NAME) {
30
+ return new WebViewTurboModule(this.ctx);
31
+ }
32
+ return null;
33
+ }
34
+
35
+ hasTurboModule(name: string): boolean {
36
+ return name === TM.RNCWebViewModule.NAME;
37
+ }
38
38
  }
@@ -1,48 +1,48 @@
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 { CustomReference } from './CutomReference';
6
- import HashMap from '@ohos.util.HashMap';
7
-
8
- export enum CallbackState {
9
- UNDECIDED,
10
- SHOULD_OVERRIDE,
11
- DO_NOT_OVERRIDE,
12
- }
13
-
14
- export class ShouldRequestUrl {
15
- private constructor() {
16
- }
17
-
18
- static nextLockIdentifier: number = 1;
19
- static ShouldRequestUrlLocks: HashMap<string, CustomReference> = new HashMap();
20
- static callBack: Function;
21
-
22
- static setCallBack(lockIdentifier: string, callBack: Function): void {
23
- let data: CustomReference = ShouldRequestUrl.ShouldRequestUrlLocks.get(lockIdentifier);
24
- data.setCallBack(callBack)
25
- }
26
-
27
- public static getNewData(): string {
28
- let lockIdentifier = ShouldRequestUrl.nextLockIdentifier++ + ''
29
- let custom = new CustomReference(CallbackState.UNDECIDED)
30
- ShouldRequestUrl.ShouldRequestUrlLocks.set(lockIdentifier, custom)
31
- return lockIdentifier
32
- }
33
-
34
- public static setValue(lockIdentifier: number, stateParam: CallbackState): void {
35
- let lock: string = lockIdentifier + '';
36
- if (ShouldRequestUrl.ShouldRequestUrlLocks.hasKey(lock)) {
37
- let data: CustomReference = ShouldRequestUrl.ShouldRequestUrlLocks.get(lock)
38
- data.setValue(stateParam)
39
- }
40
- }
41
-
42
- public static getValue(lockIdentifier: string): CallbackState {
43
- return ShouldRequestUrl.ShouldRequestUrlLocks.get(lockIdentifier).getValue()
44
- }
45
- public static removeData(lockIdentifier: string): void {
46
- ShouldRequestUrl.ShouldRequestUrlLocks.remove(lockIdentifier)
47
- }
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 { CustomReference } from './CutomReference';
6
+ import HashMap from '@ohos.util.HashMap';
7
+
8
+ export enum CallbackState {
9
+ UNDECIDED,
10
+ SHOULD_OVERRIDE,
11
+ DO_NOT_OVERRIDE,
12
+ }
13
+
14
+ export class ShouldRequestUrl {
15
+ private constructor() {
16
+ }
17
+
18
+ static nextLockIdentifier: number = 1;
19
+ static ShouldRequestUrlLocks: HashMap<string, CustomReference> = new HashMap();
20
+ static callBack: Function;
21
+
22
+ static setCallBack(lockIdentifier: string, callBack: Function): void {
23
+ let data: CustomReference = ShouldRequestUrl.ShouldRequestUrlLocks.get(lockIdentifier);
24
+ data.setCallBack(callBack)
25
+ }
26
+
27
+ public static getNewData(): string {
28
+ let lockIdentifier = ShouldRequestUrl.nextLockIdentifier++ + ''
29
+ let custom = new CustomReference(CallbackState.UNDECIDED)
30
+ ShouldRequestUrl.ShouldRequestUrlLocks.set(lockIdentifier, custom)
31
+ return lockIdentifier
32
+ }
33
+
34
+ public static setValue(lockIdentifier: number, stateParam: CallbackState): void {
35
+ let lock: string = lockIdentifier + '';
36
+ if (ShouldRequestUrl.ShouldRequestUrlLocks.hasKey(lock)) {
37
+ let data: CustomReference = ShouldRequestUrl.ShouldRequestUrlLocks.get(lock)
38
+ data.setValue(stateParam)
39
+ }
40
+ }
41
+
42
+ public static getValue(lockIdentifier: string): CallbackState {
43
+ return ShouldRequestUrl.ShouldRequestUrlLocks.get(lockIdentifier).getValue()
44
+ }
45
+ public static removeData(lockIdentifier: string): void {
46
+ ShouldRequestUrl.ShouldRequestUrlLocks.remove(lockIdentifier)
47
+ }
48
48
  }