@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.
- package/$package.json +30 -36
- package/android/app/build.gradle +56 -73
- package/android/app/src/debug/java/com/xrn/template/ReactNativeFlipper.java +23 -44
- package/android/app/src/main/assets/xrn-manifest.json +1 -1
- package/android/app/src/main/java/com/xrn/template/MainApplication.kt +54 -65
- package/android/app/src/main/java/com/xrn/template/multibundle/CodePushBundleActivity.kt +65 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/CodePushJSBundleLoader.kt +18 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/CodePushUtils.kt +263 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XBundleTool.kt +9 -0
- package/android/app/src/main/java/com/xrn/template/multibundle/XRNReactHostDelegate.kt +56 -0
- package/android/app/src/main/java/com/xrn/template/navigation/XBundleActivity.kt +10 -7
- package/android/app/src/main/res/raw/bundle_config.json +2 -6
- package/android/build.gradle +40 -39
- package/android/buildSrc/build.gradle.kts +15 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +3 -1
- package/android/gradle.properties +17 -10
- package/android/settings.gradle +40 -12
- package/harmony/.clang-tidy +1 -1
- package/harmony/.clangd +3 -1
- package/harmony/AppScope/app.json5 +1 -1
- package/harmony/build-profile.json5 +8 -8
- package/harmony/entry/oh-package-lock.json5 +283 -262
- package/harmony/entry/oh-package.json5 +35 -36
- package/harmony/entry/src/main/cpp/CMakeLists.txt +37 -17
- package/harmony/entry/src/main/cpp/PackageProvider.cpp +20 -2
- package/harmony/entry/src/main/cpp/generated/BundleNavigation.cpp +3 -0
- package/harmony/entry/src/main/cpp/generated/RNOHGeneratedPackage.h +31 -87
- package/harmony/entry/src/main/cpp/generated/RTNCodePush.cpp +7 -1
- package/harmony/entry/src/main/cpp/generated/XRNBundleModule.cpp +9 -0
- package/harmony/entry/src/main/cpp/generated/XRNDebugToolsModule.cpp +10 -0
- package/harmony/entry/src/main/cpp/generated/{ImageResizer.cpp → XRNImageView.cpp} +6 -3
- package/harmony/entry/src/main/cpp/generated/{ImageResizer.h → XRNImageView.h} +2 -2
- package/harmony/entry/src/main/cpp/generated/{RNCWebViewComponentDescriptor.h → XRNImageViewComponentDescriptor.h} +11 -10
- package/harmony/entry/src/main/cpp/generated/XRNImageViewJSIBinder.h +58 -0
- package/harmony/entry/src/main/cpp/generated/XRNKeyboard.cpp +23 -0
- package/harmony/entry/src/main/cpp/generated/{RNLocalize.h → XRNKeyboard.h} +2 -2
- package/harmony/entry/src/main/cpp/generated/XRNNavigation.cpp +5 -0
- package/harmony/entry/src/main/cpp/generated/{RNCWebViewModule.cpp → XRNNetworkModule.cpp} +2 -4
- package/harmony/entry/src/main/cpp/generated/{RNCWebViewModule.h → XRNNetworkModule.h} +2 -2
- package/harmony/entry/src/main/ets/BundleHelper.ets +41 -45
- package/harmony/entry/src/main/ets/MainAbilityStage.ets +9 -4
- package/harmony/entry/src/main/ets/entryability/EntryAbility.ets +1 -1
- package/harmony/entry/src/main/ets/navDestination/BizModuleContainer.ets +2 -2
- package/harmony/entry/src/main/ets/navDestination/MainModuleContainer.ets +2 -2
- package/harmony/entry/src/main/ets/navDestination/Splash.ets +1 -2
- package/harmony/entry/src/main/ets/pages/Index.ets +4 -4
- package/harmony/entry/src/main/resources/rawfile/bundle_config.json5 +2 -6
- package/harmony/entry/src/main/resources/rawfile/xrn-manifest.json +1 -0
- package/harmony/oh-package-lock.json5 +2 -1
- package/harmony/oh-package.json5 +12 -4
- package/index.ts +0 -0
- package/ios/BundleEventCenter/Hooks/XRNCustomKeyborad+XTHooks.h +16 -0
- package/ios/BundleEventCenter/Hooks/XRNCustomKeyborad+XTHooks.mm +40 -0
- package/ios/BundleEventCenter/Hooks/XTIQKeyboardManagerBridge.h +15 -0
- package/ios/BundleEventCenter/Hooks/XTIQKeyboardManagerBridge.m +22 -0
- package/ios/BundleEventCenter/XTBundleProvider.m +98 -72
- package/ios/BundleEventCenter/XTBundleViewControllerFactory.m +4 -15
- package/ios/BundleEventCenter/bundleController/XTBundleViewController.mm +43 -0
- package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.mm +48 -0
- package/ios/BundleEventCenter/bundleController/xtBundles.plist +1 -1
- package/ios/Podfile +234 -151
- package/ios/Podfile.lock +2810 -594
- package/ios/RNDebug/DebugPlugin/XTPluginManage.m +5 -5
- package/ios/RNDebug/MotroTools/XTMetroAutoConnector.h +21 -0
- package/ios/RNDebug/MotroTools/XTMetroAutoConnector.m +124 -0
- package/ios/RNDebug/MotroTools/XTReloadCommandHelper.h +30 -0
- package/ios/RNDebug/MotroTools/XTReloadCommandHelper.mm +128 -0
- package/ios/RNDebug/Views/XTScanQRPlugin.swift +9 -4
- package/ios/XRNTemplate/AppDelegate.h +3 -3
- package/ios/XRNTemplate/AppDelegate.mm +40 -102
- package/ios/XRNTemplate/Info.plist +4 -4
- package/ios/XRNTemplate/PrivacyInfo.xcprivacy +48 -0
- package/ios/XRNTemplate-Bridging-Header.h +2 -1
- package/ios/XRNTemplate.xcodeproj/project.pbxproj +68 -77
- package/ios/ios_patches/fixed_glog_config.h +195 -0
- package/ios/ios_patches/xt_IQKeyboardManager+Position.swift +1341 -0
- package/ios/ios_patches/xt_IQKeyboardManager.swift +454 -0
- package/ios/subBundles/.gitkeep +0 -0
- package/main-bundle/babel.config.js +2 -2
- package/main-bundle/package.json +11 -20
- package/main-bundle/yarn.lock +14655 -9651
- package/metro.config.js +21 -0
- package/package.json +2 -2
- package/react-native.config.js +3 -45
- package/src/.gitkeep +0 -0
- package/sub-bundle/babel.config.js +2 -2
- package/sub-bundle/package.json +11 -20
- package/sub-bundle/react-native.config.js +4 -0
- package/sub-bundle/yarn.lock +14655 -9651
- package/xrn.config.json +12 -12
- package/android/app/src/main/java/com/xrn/template/multibundle/XDevSupportParams.kt +0 -6
- package/android/app/src/main/java/com/xrn/template/multibundle/XRNHostParams.kt +0 -82
- package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.cpp +0 -21
- package/harmony/entry/src/main/cpp/generated/ConfigNativeModule.h +0 -21
- package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.cpp +0 -21
- package/harmony/entry/src/main/cpp/generated/GetRandomValuesNativeModule.h +0 -21
- package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.cpp +0 -22
- package/harmony/entry/src/main/cpp/generated/NativeHarmonyTouchId.h +0 -21
- package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.cpp +0 -31
- package/harmony/entry/src/main/cpp/generated/OreitationLockerNativeModule.h +0 -21
- package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.cpp +0 -28
- package/harmony/entry/src/main/cpp/generated/RNCCameraRoll.h +0 -21
- package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.cpp +0 -26
- package/harmony/entry/src/main/cpp/generated/RNCCameraRollPermission.h +0 -21
- package/harmony/entry/src/main/cpp/generated/RNCWebViewJSIBinder.h +0 -120
- package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.cpp +0 -164
- package/harmony/entry/src/main/cpp/generated/RNDeviceInfo.h +0 -21
- package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.cpp +0 -24
- package/harmony/entry/src/main/cpp/generated/RNDocumentPicker.h +0 -21
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonComponentDescriptor.h +0 -43
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerButtonJSIBinder.h +0 -38
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.cpp +0 -28
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerModule.h +0 -21
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewComponentDescriptor.h +0 -43
- package/harmony/entry/src/main/cpp/generated/RNGestureHandlerRootViewJSIBinder.h +0 -31
- package/harmony/entry/src/main/cpp/generated/RNLocalize.cpp +0 -31
- package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.cpp +0 -51
- package/harmony/entry/src/main/cpp/generated/ReactNativeBlobUtil.h +0 -21
- package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.cpp +0 -21
- package/harmony/entry/src/main/cpp/generated/XRNAssetLoaderModule.h +0 -21
- package/harmony/entry/src/main/cpp/generated/XRNFileModule.cpp +0 -22
- package/harmony/entry/src/main/cpp/generated/XRNFileModule.h +0 -21
- package/ios/BundleEventCenter/bundleController/XTBundleViewController.m +0 -35
- package/ios/BundleEventCenter/bundleController/XTMainBundleViewController.m +0 -41
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
namespace rnoh {
|
|
15
15
|
|
|
16
|
-
class JSI_EXPORT
|
|
16
|
+
class JSI_EXPORT XRNKeyboard : public ArkTSTurboModule {
|
|
17
17
|
public:
|
|
18
|
-
|
|
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 "
|
|
10
|
+
#include "XRNNetworkModule.h"
|
|
11
11
|
|
|
12
12
|
namespace rnoh {
|
|
13
13
|
using namespace facebook;
|
|
14
14
|
|
|
15
|
-
|
|
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
|
|
16
|
+
class JSI_EXPORT XRNNetworkModule : public ArkTSTurboModule {
|
|
17
17
|
public:
|
|
18
|
-
|
|
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-
|
|
2
|
-
import { ClipboardPackage } from "@react-native-
|
|
3
|
-
import { CookiesPackage } from "@react-native-
|
|
4
|
-
import { LottieAnimationView, LOTTIE_TYPE } from "@react-native-
|
|
5
|
-
import { RNConfigPackage } from "@react-native-
|
|
6
|
-
import { RNDeviceInfoPackage } from "@react-native-
|
|
7
|
-
import { RNGetRandomValuesPackage } from "@react-native-
|
|
8
|
-
import { RNLocalizePackage } from "@react-native-
|
|
9
|
-
import { PermissionsPackage } from "@react-native-
|
|
10
|
-
import { SafeAreaViewPackage } from "@react-native-
|
|
11
|
-
import { SvgPackage } from "@react-native-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
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-
|
|
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-
|
|
30
|
-
import { CodePushPackage } from '
|
|
31
|
-
import { RTNPdfView, PDF_VIEW_TYPE } from '@react-native-
|
|
32
|
-
import { WebView, WEB_VIEW } from "@react-native-
|
|
33
|
-
import { RNCVideo, RNC_VIDEO_TYPE } from "@react-native-
|
|
34
|
-
import { VisionCameraView } from "@react-native-
|
|
35
|
-
import { XRNNativeStoragePackage } from '
|
|
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 "
|
|
45
|
-
import { XRNLoadingPackage } from "
|
|
46
|
-
import { SmartRefreshPackage } from "@react-native-
|
|
47
|
-
import { XRNBundlePackage } from "
|
|
48
|
-
import { XRNNavigationPackage } from "
|
|
49
|
-
import { XRNAppUtilsPackage
|
|
50
|
-
import { XRNDebugToolsPackage } from '
|
|
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 "
|
|
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 "
|
|
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
|
|
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 '
|
|
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,13 +1,13 @@
|
|
|
1
1
|
import { Splash } from '../navDestination/Splash';
|
|
2
|
-
import { NavigationContainer, getModuleRouteParams, ModuleRouteParams } from '
|
|
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 '
|
|
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-
|
|
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}}
|
package/harmony/oh-package.json5
CHANGED
|
@@ -8,10 +8,18 @@
|
|
|
8
8
|
"@ohos/hamock": "1.0.0"
|
|
9
9
|
},
|
|
10
10
|
"overrides": {
|
|
11
|
-
|
|
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
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
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,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
|