@xrnjs/app-template 0.0.6 → 0.1.0

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 (124) hide show
  1. package/$package.json +30 -36
  2. package/android/app/build.gradle +56 -73
  3. package/android/app/src/debug/java/com/xrn/template/ReactNativeFlipper.java +23 -44
  4. package/android/app/src/main/assets/xrn-manifest.json +1 -1
  5. package/android/app/src/main/java/com/xrn/template/MainApplication.kt +54 -65
  6. package/android/app/src/main/java/com/xrn/template/multibundle/CodePushBundleActivity.kt +65 -0
  7. package/android/app/src/main/java/com/xrn/template/multibundle/CodePushJSBundleLoader.kt +18 -0
  8. package/android/app/src/main/java/com/xrn/template/multibundle/CodePushUtils.kt +263 -0
  9. package/android/app/src/main/java/com/xrn/template/multibundle/XBundleTool.kt +9 -0
  10. package/android/app/src/main/java/com/xrn/template/multibundle/XRNReactHostDelegate.kt +56 -0
  11. package/android/app/src/main/java/com/xrn/template/navigation/XBundleActivity.kt +10 -7
  12. package/android/app/src/main/res/raw/bundle_config.json +2 -6
  13. package/android/build.gradle +40 -39
  14. package/android/buildSrc/build.gradle.kts +15 -0
  15. package/android/gradle/wrapper/gradle-wrapper.properties +3 -1
  16. package/android/gradle.properties +17 -10
  17. package/android/settings.gradle +40 -12
  18. package/harmony/.clang-tidy +1 -1
  19. package/harmony/.clangd +3 -1
  20. package/harmony/AppScope/app.json5 +1 -1
  21. package/harmony/build-profile.json5 +8 -8
  22. package/harmony/entry/oh-package-lock.json5 +283 -262
  23. package/harmony/entry/oh-package.json5 +35 -36
  24. package/harmony/entry/src/main/cpp/CMakeLists.txt +37 -17
  25. package/harmony/entry/src/main/cpp/PackageProvider.cpp +20 -2
  26. package/harmony/entry/src/main/cpp/generated/BundleNavigation.cpp +3 -0
  27. package/harmony/entry/src/main/cpp/generated/RNOHGeneratedPackage.h +31 -87
  28. package/harmony/entry/src/main/cpp/generated/RTNCodePush.cpp +7 -1
  29. package/harmony/entry/src/main/cpp/generated/XRNBundleModule.cpp +9 -0
  30. package/harmony/entry/src/main/cpp/generated/XRNDebugToolsModule.cpp +10 -0
  31. package/harmony/entry/src/main/cpp/generated/{ImageResizer.cpp → XRNImageView.cpp} +6 -3
  32. package/harmony/entry/src/main/cpp/generated/{ImageResizer.h → XRNImageView.h} +2 -2
  33. package/harmony/entry/src/main/cpp/generated/{RNCWebViewComponentDescriptor.h → XRNImageViewComponentDescriptor.h} +11 -10
  34. package/harmony/entry/src/main/cpp/generated/XRNImageViewJSIBinder.h +58 -0
  35. package/harmony/entry/src/main/cpp/generated/XRNKeyboard.cpp +23 -0
  36. package/harmony/entry/src/main/cpp/generated/{RNLocalize.h → XRNKeyboard.h} +2 -2
  37. package/harmony/entry/src/main/cpp/generated/XRNNavigation.cpp +5 -0
  38. package/harmony/entry/src/main/cpp/generated/{RNCWebViewModule.cpp → XRNNetworkModule.cpp} +2 -4
  39. package/harmony/entry/src/main/cpp/generated/{RNCWebViewModule.h → XRNNetworkModule.h} +2 -2
  40. package/harmony/entry/src/main/ets/BundleHelper.ets +41 -45
  41. package/harmony/entry/src/main/ets/MainAbilityStage.ets +9 -4
  42. package/harmony/entry/src/main/ets/entryability/EntryAbility.ets +1 -1
  43. package/harmony/entry/src/main/ets/navDestination/BizModuleContainer.ets +2 -2
  44. package/harmony/entry/src/main/ets/navDestination/MainModuleContainer.ets +2 -2
  45. package/harmony/entry/src/main/ets/navDestination/Splash.ets +1 -2
  46. package/harmony/entry/src/main/ets/pages/Index.ets +4 -4
  47. package/harmony/entry/src/main/resources/rawfile/bundle_config.json5 +2 -6
  48. package/harmony/entry/src/main/resources/rawfile/xrn-manifest.json +1 -0
  49. package/harmony/oh-package-lock.json5 +2 -1
  50. package/harmony/oh-package.json5 +12 -4
  51. package/index.ts +0 -0
  52. package/ios/BundleEventCenter/Hooks/XRNCustomKeyborad+XTHooks.h +16 -0
  53. package/ios/BundleEventCenter/Hooks/XRNCustomKeyborad+XTHooks.mm +40 -0
  54. package/ios/BundleEventCenter/Hooks/XTIQKeyboardManagerBridge.h +15 -0
  55. package/ios/BundleEventCenter/Hooks/XTIQKeyboardManagerBridge.m +22 -0
  56. package/ios/BundleEventCenter/XTBundleProvider.m +98 -72
  57. package/ios/BundleEventCenter/XTBundleViewControllerFactory.m +4 -15
  58. package/ios/BundleEventCenter/bundleController/XTBundleViewController.mm +43 -0
  59. package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.mm +48 -0
  60. package/ios/BundleEventCenter/bundleController/xtBundles.plist +1 -1
  61. package/ios/Podfile +234 -151
  62. package/ios/Podfile.lock +2810 -594
  63. package/ios/RNDebug/DebugPlugin/XTPluginManage.m +5 -5
  64. package/ios/RNDebug/MotroTools/XTMetroAutoConnector.h +21 -0
  65. package/ios/RNDebug/MotroTools/XTMetroAutoConnector.m +124 -0
  66. package/ios/RNDebug/MotroTools/XTReloadCommandHelper.h +30 -0
  67. package/ios/RNDebug/MotroTools/XTReloadCommandHelper.mm +128 -0
  68. package/ios/RNDebug/Views/XTScanQRPlugin.swift +9 -4
  69. package/ios/XRNTemplate/AppDelegate.h +3 -3
  70. package/ios/XRNTemplate/AppDelegate.mm +40 -102
  71. package/ios/XRNTemplate/Info.plist +4 -4
  72. package/ios/XRNTemplate/PrivacyInfo.xcprivacy +48 -0
  73. package/ios/XRNTemplate-Bridging-Header.h +2 -1
  74. package/ios/XRNTemplate.xcodeproj/project.pbxproj +68 -77
  75. package/ios/ios_patches/fixed_glog_config.h +195 -0
  76. package/ios/ios_patches/xt_IQKeyboardManager+Position.swift +1341 -0
  77. package/ios/ios_patches/xt_IQKeyboardManager.swift +454 -0
  78. package/ios/subBundles/.gitkeep +0 -0
  79. package/main-bundle/babel.config.js +2 -2
  80. package/main-bundle/package.json +11 -20
  81. package/main-bundle/yarn.lock +14655 -9651
  82. package/metro.config.js +21 -0
  83. package/package.json +2 -2
  84. package/react-native.config.js +3 -45
  85. package/src/.gitkeep +0 -0
  86. package/sub-bundle/babel.config.js +2 -2
  87. package/sub-bundle/package.json +11 -20
  88. package/sub-bundle/react-native.config.js +4 -0
  89. package/sub-bundle/yarn.lock +14655 -9651
  90. package/xrn.config.json +12 -12
  91. package/android/app/src/main/java/com/xrn/template/multibundle/XDevSupportParams.kt +0 -6
  92. package/android/app/src/main/java/com/xrn/template/multibundle/XRNHostParams.kt +0 -82
  93. package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.cpp +0 -21
  94. package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.h +0 -21
  95. package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.cpp +0 -21
  96. package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.h +0 -21
  97. package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.cpp +0 -22
  98. package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.h +0 -21
  99. package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.cpp +0 -31
  100. package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.h +0 -21
  101. package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.cpp +0 -28
  102. package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.h +0 -21
  103. package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.cpp +0 -26
  104. package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.h +0 -21
  105. package/harmony/entry/src/main/cpp/generated/RNCWebViewJSIBinder.h +0 -120
  106. package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.cpp +0 -164
  107. package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.h +0 -21
  108. package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.cpp +0 -24
  109. package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.h +0 -21
  110. package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonComponentDescriptor.h +0 -43
  111. package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonJSIBinder.h +0 -38
  112. package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.cpp +0 -28
  113. package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.h +0 -21
  114. package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewComponentDescriptor.h +0 -43
  115. package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewJSIBinder.h +0 -31
  116. package/harmony/entry/src/main/cpp/generated/RNLocalize.cpp +0 -31
  117. package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.cpp +0 -51
  118. package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.h +0 -21
  119. package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.cpp +0 -21
  120. package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.h +0 -21
  121. package/harmony/entry/src/main/cpp/generated/XRNFileModule.cpp +0 -22
  122. package/harmony/entry/src/main/cpp/generated/XRNFileModule.h +0 -21
  123. package/ios/BundleEventCenter/bundleController/XTBundleViewController.m +0 -35
  124. package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.m +0 -41
@@ -13,9 +13,9 @@
13
13
 
14
14
  namespace rnoh {
15
15
 
16
- class JSI_EXPORT RNLocalize : public ArkTSTurboModule {
16
+ class JSI_EXPORT XRNKeyboard : public ArkTSTurboModule {
17
17
  public:
18
- RNLocalize(const ArkTSTurboModule::Context ctx, const std::string name);
18
+ XRNKeyboard(const ArkTSTurboModule::Context ctx, const std::string name);
19
19
  };
20
20
 
21
21
  } // namespace rnoh
@@ -15,8 +15,13 @@ using namespace facebook;
15
15
  XRNNavigation::XRNNavigation(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
16
16
  methodMap_ = {
17
17
  ARK_METHOD_METADATA(setNavigationKey, 1),
18
+ ARK_METHOD_METADATA(setNavigationState, 1),
18
19
  ARK_ASYNC_METHOD_METADATA(dispatchAction, 1),
19
20
  ARK_ASYNC_METHOD_METADATA(getCurrentModuleInfo, 0),
21
+ ARK_METHOD_METADATA(setShouldInterceptSideSwipe, 2),
22
+ ARK_METHOD_METADATA(confirmShouldSideSwipePop, 0),
23
+ ARK_METHOD_METADATA(addListener, 1),
24
+ ARK_METHOD_METADATA(removeListeners, 1),
20
25
  };
21
26
  }
22
27
 
@@ -7,15 +7,13 @@
7
7
  * @generatorVersion: 1
8
8
  */
9
9
 
10
- #include "RNCWebViewModule.h"
10
+ #include "XRNNetworkModule.h"
11
11
 
12
12
  namespace rnoh {
13
13
  using namespace facebook;
14
14
 
15
- RNCWebViewModule::RNCWebViewModule(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
15
+ XRNNetworkModule::XRNNetworkModule(const ArkTSTurboModule::Context ctx, const std::string name) : ArkTSTurboModule(ctx, name) {
16
16
  methodMap_ = {
17
- ARK_ASYNC_METHOD_METADATA(isFileUploadSupported, 0),
18
- ARK_METHOD_METADATA(shouldStartLoadWithLockIdentifier, 2),
19
17
  };
20
18
  }
21
19
 
@@ -13,9 +13,9 @@
13
13
 
14
14
  namespace rnoh {
15
15
 
16
- class JSI_EXPORT RNCWebViewModule : public ArkTSTurboModule {
16
+ class JSI_EXPORT XRNNetworkModule : public ArkTSTurboModule {
17
17
  public:
18
- RNCWebViewModule(const ArkTSTurboModule::Context ctx, const std::string name);
18
+ XRNNetworkModule(const ArkTSTurboModule::Context ctx, const std::string name);
19
19
  };
20
20
 
21
21
  } // namespace rnoh
@@ -1,38 +1,37 @@
1
- import { AsyncStoragePackage } from "@react-native-oh-tpl/async-storage";
2
- import { ClipboardPackage } from "@react-native-oh-tpl/clipboard";
3
- import { CookiesPackage } from "@react-native-oh-tpl/cookies";
4
- import { LottieAnimationView, LOTTIE_TYPE } from "@react-native-oh-tpl/lottie-react-native";
5
- import { RNConfigPackage } from "@react-native-oh-tpl/react-native-config";
6
- import { RNDeviceInfoPackage } from "@react-native-oh-tpl/react-native-device-info";
7
- import { RNGetRandomValuesPackage } from "@react-native-oh-tpl/react-native-get-random-values";
8
- import { RNLocalizePackage } from "@react-native-oh-tpl/react-native-localize";
9
- import { PermissionsPackage } from "@react-native-oh-tpl/react-native-permissions";
10
- import { SafeAreaViewPackage } from "@react-native-oh-tpl/react-native-safe-area-context";
11
- import { SvgPackage } from "@react-native-oh-tpl/react-native-svg";
12
- import { TouchIdPackage } from "@react-native-oh-tpl/react-native-touch-id";
13
- import { CameraRollPackage } from "@react-native-oh-tpl/camera-roll"
14
- import { LottieAnimationViewPackage } from "@react-native-oh-tpl/lottie-react-native/ts"
15
- import { NetInfoPackage } from "@react-native-oh-tpl/netinfo/ts"
16
- import { BlobUtilPackage } from "@react-native-oh-tpl/react-native-blob-util"
17
- import { DocumentPickerPackage } from "@react-native-oh-tpl/react-native-document-picker/ts"
18
- import { FastImagePackage } from "@react-native-oh-tpl/react-native-fast-image"
19
- import { GestureHandlerPackage } from "@react-native-oh-tpl/react-native-gesture-handler"
20
- import { ImagePickerViewPackage } from "@react-native-oh-tpl/react-native-image-picker"
21
- import { ImageResizerPackage } from "@react-native-oh-tpl/react-native-image-resizer"
22
- import { RNOrientationLockerPackage } from "@react-native-oh-tpl/react-native-orientation-locker"
23
- import { ReanimatedPackage } from "@react-native-oh-tpl/react-native-reanimated/ts"
24
- import { RNCVideoPackage } from "@react-native-oh-tpl/react-native-video/ts"
1
+ import { AsyncStoragePackage } from "@react-native-ohos/async-storage";
2
+ import { ClipboardPackage } from "@react-native-ohos/clipboard";
3
+ import { CookiesPackage } from "@react-native-ohos/cookies";
4
+ import { LottieAnimationView, LOTTIE_TYPE } from "@react-native-ohos/lottie-react-native";
5
+ import { RNConfigPackage } from "@react-native-ohos/react-native-config";
6
+ import { RNDeviceInfoPackage } from "@react-native-ohos/react-native-device-info";
7
+ import { RNGetRandomValuesPackage } from "@react-native-ohos/react-native-get-random-values";
8
+ import { RNLocalizePackage } from "@react-native-ohos/react-native-localize";
9
+ import { PermissionsPackage } from "@react-native-ohos/react-native-permissions";
10
+ import { SafeAreaViewPackage } from "@react-native-ohos/react-native-safe-area-context";
11
+ import { SvgPackage } from "@react-native-ohos/react-native-svg";
12
+ import { CameraRollPackage } from "@react-native-ohos/camera-roll"
13
+ import { LottieAnimationViewPackage } from "@react-native-ohos/lottie-react-native/ts"
14
+ import { NetInfoPackage } from "@react-native-ohos/netinfo/ts"
15
+ import { BlobUtilPackage } from "@react-native-ohos/react-native-blob-util"
16
+ import { DocumentPickerPackage } from "@react-native-ohos/react-native-document-picker/ts"
17
+ import { FastImagePackage } from "@react-native-ohos/react-native-fast-image"
18
+ import { GestureHandlerPackage } from "@react-native-ohos/react-native-gesture-handler"
19
+ import { ImagePickerViewPackage } from "@react-native-ohos/react-native-image-picker"
20
+ import { ImageResizerPackage } from "@react-native-ohos/react-native-image-resizer"
21
+ import { RNOrientationLockerPackage } from "@react-native-ohos/react-native-orientation-locker"
22
+ import { ReanimatedPackage } from "@react-native-ohos/react-native-reanimated/ts"
23
+ import { RNCVideoPackage } from "@react-native-ohos/react-native-video/ts"
25
24
 
26
- import { VisionCameraModulePackage } from "@react-native-oh-tpl/react-native-vision-camera"
25
+ import { VisionCameraModulePackage } from "@react-native-ohos/react-native-vision-camera"
27
26
  import { PushNotificationPackage } from "@react-native-ohos/push-notification-ios"
28
27
  import { FsPackage } from "@react-native-ohos/react-native-fs"
29
- import { WebViewPackage} from '@react-native-oh-tpl/react-native-webview/ts'
30
- import { CodePushPackage } from 'xrn-code-push'
31
- import { RTNPdfView, PDF_VIEW_TYPE } from '@react-native-oh-tpl/react-native-pdf';
32
- import { WebView, WEB_VIEW } from "@react-native-oh-tpl/react-native-webview"
33
- import { RNCVideo, RNC_VIDEO_TYPE } from "@react-native-oh-tpl/react-native-video"
34
- import { VisionCameraView } from "@react-native-oh-tpl/react-native-vision-camera";
35
- import { XRNNativeStoragePackage } from 'xrn-native-storage'
28
+ import { WebViewPackage} from '@react-native-ohos/react-native-webview/ts'
29
+ import { CodePushPackage } from '@xrnjs/react-native-code-push'
30
+ import { RTNPdfView, PDF_VIEW_TYPE } from '@react-native-ohos/react-native-pdf';
31
+ import { WebView, WEB_VIEW } from "@react-native-ohos/react-native-webview"
32
+ import { RNCVideo, RNC_VIDEO_TYPE } from "@react-native-ohos/react-native-video"
33
+ import { VisionCameraView } from "@react-native-ohos/react-native-vision-camera";
34
+ import { XRNNativeStoragePackage } from '@xrnjs/native-storage'
36
35
 
37
36
 
38
37
  import {
@@ -41,13 +40,13 @@ import {
41
40
  RNPackageContext,
42
41
  WrappedCustomRNComponentBuilder } from "@rnoh/react-native-openharmony/src/main/ets/RNOH";
43
42
  import { RNInstance, RNInstanceOptions } from "@rnoh/react-native-openharmony/src/main/ets/RNOH/RNInstance";
44
- import { BundleInfo, RNContainerOptions, XRNMultiBundlePackage } from "xrn-multi-bundle";
45
- import { XRNLoadingPackage } from "xrn-loading";
46
- import { SmartRefreshPackage } from "@react-native-oh-tpl/react-native-smartrefreshlayout";
47
- import { XRNBundlePackage } from "xrn-bundle";
48
- import { XRNNavigationPackage } from "xrn-navigation";
49
- import { XRNAppUtilsPackage, XRNFilePackage, XRNToastPackage } from "xrn-app-utils";
50
- import { XRNDebugToolsPackage } from 'xrn-debug-tools';
43
+ import { BundleInfo, RNContainerOptions, XRNMultiBundlePackage } from "@xrnjs/multi-bundle";
44
+ import { XRNLoadingPackage } from "@xrnjs/loading";
45
+ import { SmartRefreshPackage } from "@react-native-ohos/react-native-smartrefreshlayout";
46
+ import { XRNBundlePackage } from "@xrnjs/bundle";
47
+ import { XRNNavigationPackage } from "@xrnjs/navigation";
48
+ import { XRNAppUtilsPackage } from "@xrnjs/app-utils";
49
+ import { XRNDebugToolsPackage } from '@xrnjs/debug-tools';
51
50
 
52
51
  export function getRNContainerOptions(): RNContainerOptions {
53
52
  return {
@@ -91,7 +90,6 @@ export function createRNPackages(ctx: RNPackageContext, bundleInfo: BundleInfo):
91
90
  new GestureHandlerPackage(ctx),
92
91
  new SvgPackage(ctx),
93
92
  new WebViewPackage(ctx),
94
- new TouchIdPackage(ctx),
95
93
  new PermissionsPackage(ctx),
96
94
  new CookiesPackage(ctx),
97
95
  new LottieAnimationViewPackage(ctx),
@@ -112,16 +110,14 @@ export function createRNPackages(ctx: RNPackageContext, bundleInfo: BundleInfo):
112
110
  new ReanimatedPackage(ctx),
113
111
  new RNCVideoPackage(ctx),
114
112
  new VisionCameraModulePackage(ctx),
115
- new CodePushPackage(ctx, bundleInfo, ""),
113
+ new CodePushPackage(ctx, bundleInfo, "", ""),
116
114
  new XRNLoadingPackage(ctx),
117
115
  new SmartRefreshPackage(ctx),
118
116
  new XRNMultiBundlePackage(ctx),
119
- new XRNBundlePackage(ctx, bundleInfo.bundleName),
117
+ new XRNBundlePackage(ctx, bundleInfo.bundleName, "", ""),
120
118
  new XRNAppUtilsPackage(ctx),
121
- new XRNFilePackage(ctx),
122
119
  new XRNNavigationPackage(ctx),
123
120
  new XRNNativeStoragePackage(ctx),
124
- new XRNToastPackage(ctx),
125
121
  new XRNDebugToolsPackage(ctx, bundleInfo.bundleName),
126
122
  ]
127
123
  }
@@ -195,4 +191,4 @@ const fontResourceByFontFamily: Record<string, string | Resource> = {
195
191
  // 'icomoon': $rawfile('fonts/icomoon.ttf'),
196
192
  // 'fontello': $rawfile('fonts/fontello.ttf'),
197
193
  // 'poppy-icon': $rawfile('fonts/test.ttf')
198
- }
194
+ }
@@ -1,7 +1,7 @@
1
1
  import { AbilityStage } from "@kit.AbilityKit";
2
2
  import {
3
3
  APP_RNOH_RNOHCoreContext,
4
- BundleInfo, BundleInfoManager, initRNContainerOptions, RNInstanceManager } from "xrn-multi-bundle";
4
+ BundleInfo, BundleInfoManager, initRNContainerOptions, RNInstanceManager } from "@xrnjs/multi-bundle";
5
5
  import { getRNContainerOptions, getRNInstanceOptions } from "./BundleHelper";
6
6
  import {
7
7
  AnyJSBundleProvider,
@@ -9,7 +9,7 @@ import {
9
9
  ResourceJSBundleProvider,
10
10
  RNOHCoreContext,
11
11
  TraceJSBundleProviderDecorator} from "@rnoh/react-native-openharmony";
12
- import { CodePushJSBundleProvider } from "xrn-code-push";
12
+ import { CodePushJSBundleProvider } from "@xrnjs/react-native-code-push";
13
13
 
14
14
  export default class MainAbilityStage extends AbilityStage {
15
15
 
@@ -19,10 +19,15 @@ export default class MainAbilityStage extends AbilityStage {
19
19
 
20
20
  onCreate(): void {
21
21
  initRNContainerOptions(getRNContainerOptions())
22
- BundleInfoManager.initWithRawFile(this.context, "bundle_config.json5", undefined)
22
+ BundleInfoManager.initWithRawFile(this.context, "bundle_config.json5", undefined, undefined)
23
23
  RNInstanceManager.init({
24
24
  getRNInstanceOptions: getRNInstanceOptions,
25
25
  createJSBundleProvider: createJSBundleProvider,
26
+ getSplitBundleOptions: () => ({
27
+ getCommonBundleName: () => "oh.xt-app-common.bundle",
28
+ isSplitMode: (_bundleInfo: BundleInfo) => false,
29
+ }),
30
+ isMemoryPressured: () => false,
26
31
  })
27
32
 
28
33
  }
@@ -43,7 +48,7 @@ function createJSBundleProvider(bundleInfo: BundleInfo): JSBundleProvider | unde
43
48
  //本地服务,TODO:Dev 环境
44
49
  jsBundleProviderArray.push(new MetroJSBundleProvider(bundleInfo.getLocalServerUrl(), bundleInfo.getModuleNames()))
45
50
  // //热更新
46
- jsBundleProviderArray.push(CodePushJSBundleProvider.loadCodePushBundle(rnohCoreContext?.uiAbilityContext, bundleInfo.getJSBundleName(), bundleInfo.getCodePushKey()))
51
+ jsBundleProviderArray.push(CodePushJSBundleProvider.loadCodePushBundle(rnohCoreContext?.uiAbilityContext, bundleInfo, bundleInfo.getCodePushKey(), "", "", false))
47
52
  // NOTE: to load the bundle from file, place it in
48
53
  // `/data/app/el2/100/base/com.rnoh.tester/files/bundle.harmony.js`
49
54
  // on your device. The path mismatch is due to app sandboxing on HarmonyOS
@@ -1,4 +1,4 @@
1
- import { XRNAbility } from 'xrn-multi-bundle';
1
+ import { XRNAbility } from '@xrnjs/multi-bundle';
2
2
  import { window } from '@kit.ArkUI';
3
3
  import { BusinessError } from '@kit.BasicServicesKit';
4
4
  import { APP_SYS_NAVIGATION_HEIGHT, APP_SYS_SYSTEM_BAR_HEIGHT } from '../Constants';
@@ -1,8 +1,8 @@
1
- import { BaseModuleContainer } from "xrn-navigation";
1
+ import { BaseModuleContainer } from "@xrnjs/navigation";
2
2
 
3
3
  @Component
4
4
  export struct BizModuleContainer {
5
5
  build() {
6
6
  BaseModuleContainer()
7
7
  }
8
- }
8
+ }
@@ -1,8 +1,8 @@
1
- import { BaseModuleContainer } from "xrn-navigation";
1
+ import { BaseModuleContainer } from "@xrnjs/navigation";
2
2
 
3
3
  @Component
4
4
  export struct MainModuleContainer {
5
5
  build() {
6
6
  BaseModuleContainer()
7
7
  }
8
- }
8
+ }
@@ -1,4 +1,4 @@
1
- import { NavPath, replaceToMain } from "xrn-navigation"
1
+ import { NavPath, replaceToMain } from "@xrnjs/navigation"
2
2
 
3
3
  @Component
4
4
  export struct Splash {
@@ -35,4 +35,3 @@ export struct Splash {
35
35
  .hideToolBar(true)
36
36
  }
37
37
  }
38
-
@@ -1,13 +1,13 @@
1
1
  import { Splash } from '../navDestination/Splash';
2
- import { NavigationContainer, getModuleRouteParams, ModuleRouteParams } from 'xrn-navigation'
2
+ import { NavigationContainer, getModuleRouteParams, ModuleRouteParams } from '@xrnjs/navigation'
3
3
  import webview from '@ohos.web.webview';
4
4
  import { preferences } from "@kit.ArkData";
5
5
  import { MainModuleContainer } from '../navDestination/MainModuleContainer';
6
6
  import { BizModuleContainer } from '../navDestination/BizModuleContainer';
7
- import { RN_INSTANCE_MANAGER } from 'xrn-multi-bundle';
7
+ import { RN_INSTANCE_MANAGER } from '@xrnjs/multi-bundle';
8
8
  import { FloatBall } from '../module/devtools/components/FloatBall'
9
9
  import { RNInstance } from '@rnoh/react-native-openharmony';
10
- import { BuildConfig } from '@react-native-oh-tpl/react-native-config/BuildConfig'
10
+ import { BuildConfig } from '@react-native-ohos/react-native-config/BuildConfig'
11
11
  // const DEV_ENV_NAME = "DEV_ENV_NAME"
12
12
  const DEV_ENV_NAME = "dev"
13
13
  const PROD = 'prod';
@@ -63,4 +63,4 @@ struct MainPage {
63
63
  .height('100%')
64
64
 
65
65
  }
66
- }
66
+ }
@@ -1,21 +1,17 @@
1
1
  {
2
- "project": {
3
- "name": "XRNTemplate"
4
- },
5
- "defaultOptions": {
6
- "bundleType": "sub"
7
- },
8
2
  "bundles": [
9
3
  {
10
4
  "bundleName": "main-bundle",
11
5
  "bundlePackageRelativePath": "./main-bundle",
12
6
  "bundleType": "main",
7
+ "checkNativeDep": false,
13
8
  "codePushKey": "0NzkdHaOp6RhCDWjD1G3KogLieV54ksvOXqog",
14
9
  "port": 8081
15
10
  },
16
11
  {
17
12
  "bundleName": "sub-bundle",
18
13
  "bundlePackageRelativePath": "./sub-bundle",
14
+ "checkNativeDep": false,
19
15
  "codePushKey": "KpWDtkf7lssWGGhFVlubzRq9gAg74ksvOXqog",
20
16
  "port": 6061
21
17
  }
@@ -0,0 +1 @@
1
+ {"dependencies":{"@xrnjs/cli":"0.1.0","@xrnjs/core":"0.1.0"},"commonBaseLine":{"modules":{},"id":0,"hash":"","useOldApp":true}}
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "meta": {
3
- "stableOrder": true
3
+ "stableOrder": true,
4
+ "enableUnifiedLockfile": false
4
5
  },
5
6
  "lockfileVersion": 3,
6
7
  "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
@@ -8,10 +8,18 @@
8
8
  "@ohos/hamock": "1.0.0"
9
9
  },
10
10
  "overrides": {
11
- // "@rnoh/react-native-openharmony": "0.72.38",
11
+ // "@rnoh/react-native-openharmony": "0.72.38",
12
12
  "@rnoh/react-native-openharmony": "../node_modules/@react-native-oh/react-native-harmony/react_native_openharmony.har",
13
- "xrn-multi-bundle": "../node_modules/@xrnjs/multi-bundle/harmony/xrn_multi_bundle",
14
- "xrn-navigation": "../node_modules/@xrnjs/navigation/harmony/xrn_navigation",
15
- "xrn-code-push": "../node_modules/@xrnjs/react-native-code-push/harmony/codePush"
13
+ "@xrnjs/multi-bundle": "../node_modules/@xrnjs/multi-bundle/harmony/xrn_multi_bundle",
14
+ "@xrnjs/react-native-code-push": "../node_modules/@xrnjs/react-native-code-push/harmony/codePush",
15
+ "@xrnjs/navigation": "../node_modules/@xrnjs/navigation/harmony/xrn_navigation",
16
+ "@xrnjs/bundle": "../node_modules/@xrnjs/bundle/harmony/xrn_bundle",
17
+ "@xrnjs/app-utils": "../node_modules/@xrnjs/app-utils/harmony/xrn_app_utils",
18
+ "@xrnjs/debug-tools": "../node_modules/@xrnjs/debug-tools/harmony/xrn_debug_tools",
19
+ "@xrnjs/native-storage": "../node_modules/@xrnjs/native-storage/harmony/xrn_native_storage",
20
+ "@xrnjs/loading": "../node_modules/@xrnjs/loading/harmony/xrn_loading",
21
+ "@xrnjs/modules-core": "../node_modules/@xrnjs/modules-core/harmony/xrn_modules_core",
22
+ "@wolfx/json5": "2.2.3-rc.1",
23
+ "@ohos/lottie": "2.0.25"
16
24
  }
17
25
  }
package/index.ts ADDED
File without changes
@@ -0,0 +1,16 @@
1
+ //
2
+ // XRNCustomKeyborad+XTHooks.h
3
+ // xrngo
4
+ //
5
+ // Created by xupeng on 2025/10/14.
6
+ //
7
+
8
+ #import <XRNCustomKeyborad.h>
9
+
10
+ NS_ASSUME_NONNULL_BEGIN
11
+
12
+ @interface XRNCustomKeyborad (XTHooks)
13
+
14
+ @end
15
+
16
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,40 @@
1
+ //
2
+ // XRNCustomKeyborad+XTHooks.mm
3
+ // xrngo
4
+ //
5
+ // Created by xupeng on 2025/10/14.
6
+ //
7
+
8
+ #import "XRNCustomKeyborad+XTHooks.h"
9
+ #import "XTIQKeyboardManagerBridge.h"
10
+ #import <JRSwizzle/JRSwizzle.h>
11
+
12
+ @implementation XRNCustomKeyborad (XTHooks)
13
+
14
+ + (void)load {
15
+ static dispatch_once_t onceToken;
16
+ dispatch_once(&onceToken, ^{
17
+ [XRNCustomKeyborad jr_swizzleMethod:@selector(setMode:) withMethod:@selector(xt_setMode:) error:nil];
18
+ [XRNCustomKeyborad jr_swizzleMethod:@selector(setExtra:) withMethod:@selector(xt_setExtra:) error:nil];
19
+ // [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(hiddenKeyboard) name:UIKeyboardWillHideNotification object:nil];
20
+ });
21
+ }
22
+
23
+
24
+ - (void)xt_setMode:(NSString *)mode {
25
+ [XTIQKeyboardManagerBridge xt_setViewSoftInputMode:mode];
26
+ [self xt_setMode:mode];
27
+ }
28
+
29
+ - (void)xt_setExtra:(NSDictionary *)extra {
30
+ if (extra[@"softInputSpace"]) {
31
+ [XTIQKeyboardManagerBridge xt_setViewSoftInputSpace:extra[@"softInputSpace"]];
32
+ }
33
+ [self xt_setExtra:extra];
34
+ }
35
+
36
+ + (void)hiddenKeyboard {
37
+ [XTIQKeyboardManagerBridge xt_clearViewPositionInfo];
38
+ }
39
+
40
+ @end
@@ -0,0 +1,15 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ NS_ASSUME_NONNULL_BEGIN
4
+
5
+ /// Pure ObjC shim so ObjC++ files (e.g. hooks pulling in ReactCodegen) do not need `@import IQKeyboardManagerSwift`,
6
+ /// which requires C++ modules in `.mm` translation units.
7
+ @interface XTIQKeyboardManagerBridge : NSObject
8
+
9
+ + (void)xt_setViewSoftInputMode:(NSString *)mode;
10
+ + (void)xt_setViewSoftInputSpace:(nullable id)space;
11
+ + (void)xt_clearViewPositionInfo;
12
+
13
+ @end
14
+
15
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,22 @@
1
+ #import "XTIQKeyboardManagerBridge.h"
2
+
3
+ @import IQKeyboardManagerSwift;
4
+
5
+ @implementation XTIQKeyboardManagerBridge
6
+
7
+ + (void)xt_setViewSoftInputMode:(NSString *)mode
8
+ {
9
+ [IQKeyboardManager shared].viewSoftInputMode.softInputMode = mode;
10
+ }
11
+
12
+ + (void)xt_setViewSoftInputSpace:(id)space
13
+ {
14
+ [IQKeyboardManager shared].viewSoftInputMode.space = space;
15
+ }
16
+
17
+ + (void)xt_clearViewPositionInfo
18
+ {
19
+ [[IQKeyboardManager shared] clearViewPositionInfo];
20
+ }
21
+
22
+ @end