diff --git a/en/model-gitcode.md b/en/model-gitcode.md
index b994ab19cc7a6fb060d25bced818ea0a2b1046d5..5c91cc0eb274b8ee1fee868490a5a543432586ca 100644
--- a/en/model-gitcode.md
+++ b/en/model-gitcode.md
@@ -69,7 +69,7 @@ const App = () => {
export default App;
```
-## 2. Manual Link
+## 2. Link
| | Supported Autolink | Supported RN Version |
|--------------------------------------|------------------|-----------|
diff --git a/en/react-native-safe-area-context.md b/en/react-native-safe-area-context.md
index 4062e1011b87bfc3c7d0c9dd3ac0351a7514e341..c4021795465650f84182555e73ba5c397f9c3acf 100644
--- a/en/react-native-safe-area-context.md
+++ b/en/react-native-safe-area-context.md
@@ -1,29 +1,21 @@
-> Template Version: v0.2.2
+> Template version: v0.4.0
react-native-safe-area-context
-
-
-
-
-
-
-
-
-> [!TIP] [Github Address](https://github.com/react-native-oh-library/react-native-safe-area-context)
+This project is based on [react-native-safe-area-context](https://github.com/AppAndFlow/react-native-safe-area-context).
-## Installation and Usage
+## 1. Installation and Usage
Please refer to the Releases page of the third-party library for the corresponding version information
-| Third-party Library Version | community version | Release Information | Supported RN Version |
-|-----------------------------| ------------------------------------------------------------ | ---------- | ---------- |
-| 5.6.3 | 5.6.2 | [@react-native-ohos/react-native-safe-area-context Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.82 |
-| 5.1.1 | 5.1.0 | [@react-native-ohos/react-native-safe-area-context Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.77 |
-| 4.7.5 | 4.7.4 | [@react-native-ohos/react-native-safe-area-context Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.72 |
-| <= 4.7.4-0.2.1@deprecated | 4.7.4 | [@react-native-oh-tpl/react-native-safe-area-context Releases(deprecated)](https://github.com/react-native-oh-library/react-native-safe-area-context/releases) | 0.72 |
+| Name | Version | Release Information | Supported RN Version | Supported Autolink | Compile API Version | Community Baseline Version | npm Address |
+| --------------| -------------- | ------------------------------ | ------------- | ------------- |------------------------ | ------------- | ------------- |
+| @react-native-ohos/react-native-safe-area-context | ~5.6.3 | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.82.* | No | API14+ | 5.6.2 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-safe-area-context) |
+| @react-native-ohos/react-native-safe-area-context | ~5.1.1 | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.77.* | No | API14+ | 5.1.0 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-safe-area-context) |
+| @react-native-ohos/react-native-safe-area-context | ~4.7.5 | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.72.* | Yes | API14+ | 4.7.4 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-safe-area-context) |
+| @react-native-oh-tpl/react-native-safe-area-context | <= 4.7.4-0.2.1@deprecated | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-safe-area-context/releases) | 0.72.* | No | API14+ | 4.7.4 | [Npm Address](https://www.npmjs.com/package/@react-native-oh-tpl/react-native-safe-area-context) |
For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package.
@@ -73,13 +65,13 @@ const App = () => {
export default App;
```
-## Link
+## 2. Link
| | Is supported autolink | Supported RN Version |
|--------------------------------------|-----------------------|----------------------|
-| ~5.6.3 | No | 0.82 |
+| ~5.6.3 | No | 0.82 |
| ~5.1.1 | No | 0.77 |
-| ~4.7.5 | Yes | 0.72 |
+| ~4.7.5 | Yes | 0.72 |
| <= 4.7.4-0.2.1@deprecated | No | 0.72 |
Using AutoLink need to be configured according to this document, Autolink Framework Guide Documentation: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
@@ -90,7 +82,7 @@ If the version you use supports Autolink and the project has been connected to A
First, use DevEco Studio to open the HarmonyOS project `harmony` in the project directory.
-### 1. Add the overrides field to the root `oh-package.json5` of the project
+### 2.1. Add the overrides field to the root `oh-package.json5` of the project
```json
{
@@ -101,7 +93,7 @@ First, use DevEco Studio to open the HarmonyOS project `harmony` in the project
}
```
-### 2. Import Native Side Code
+### 2.2. Import Native Side Code
There are currently two methods:
@@ -135,7 +127,7 @@ Method 2: Link Source Code Directly
> [!TIP] If you need to link source code directly, please refer to the [Direct Link Source Code Instructions](/en/link-source-code.md)
-### 3. Configure CMakeLists and Import SafeAreaViewPackage
+### 2.3. Configure CMakeLists and Import SafeAreaViewPackage
> If you are using version <= 4.7.4-0.2.1, please skip this chapter.
@@ -198,7 +190,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4. Import SafeAreaViewPackage on the ArkTs Side
+### 2.4. Import SafeAreaViewPackage on the ArkTs Side
Open `entry/src/main/ets/RNPackagesFactory.ts` and add:
@@ -216,7 +208,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
-## Running
+## 2.5. Running
Click the `sync` button in the top right corner.
@@ -229,20 +221,28 @@ ohpm install
Then compile and run.
-## Compatibility
+## 3. Constraints
-To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+### 3.1 Compatibility
-> [!TIP] Versions >=4.7.4-0.2.1 need to run on DevEco Studio 5.0.2 (API14) or later.
+To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
Verified successfully in the following versions:
1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71;
3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
-4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.1 Release SDK; IDE: DevEco Studio 6.0.1 Release; ROM:6.0.0.120 SP7
+4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.1 Release SDK; IDE: DevEco Studio 6.0.1 Release; ROM:6.0.0.120 SP7;
+
+### 3.2. API requirements
+
+> [!TIP] `~4.7.5(0.72)`,`~5.1.1(0.77)`,`~5.6.3(0.82) ` of the current third-party libraries have implemented version isolation, supporting compilation in `API12+` projects and execution on `API12+` ROMs.
+
+> [!TIP] The following features depend on specific API versions. Compiling the project with an API version lower than specified or running the ROM with an API version lower than specified may result in limited functionality.
+
+1. Version `4.7.4-0.2.1` introduced [OH_ArkUI_NodeUtils_GetParentInPag](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-native-node-h#oh_arkui_nodeutils_getparentinpagetree), achieves the xxx functionality (resolves/addresses xxx issue). This API requires compilation in a project that supports `API14+` and must run on a ROM that supports `API14+` to take effect. Version `~4.7.5(0.72)`,`~5.1.1(0.77)`,`~5.6.3(0.82) ` requires compilation in a project that supports `API12+` and must run on a ROM that supports `API14+` to take effect.
-## Props
+## 4. Props
> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library for that prop.
@@ -269,7 +269,7 @@ Note that providers should not be inside a View that is animated with `Animated`
| `edges` | Sets the edges to apply the safe area insets to. Defaults to all. | array | no | All | yes |
| `mode` | Optional, `padding` (default) or `margin`. Apply the safe area to either the padding or the margin. | string | no | All | yes |
-## API
+## 5. API
> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library for that API.
@@ -285,10 +285,10 @@ Note that providers should not be inside a View that is animated with `Animated`
| `initialWindowMetrics` | Insets and frame of the window on initial render. This can be used with the `initialMetrics` from `SafeAreaProvider`. | object | no | All | yes |
| SafeAreaListener5.6.3+ | Monitor changes in the safe area of the rendering location | object | no | All | yes |
-## Known Issues
+## 6. Known Issues
-## Others
+## 7. Others
-## License
+## 8. License
This project is based on [The MIT License (MIT)](https://github.com/th3rdwave/react-native-safe-area-context/blob/main/LICENSE). Feel free to enjoy and participate in open source.
\ No newline at end of file
diff --git a/zh-cn/react-native-safe-area-context.md b/zh-cn/react-native-safe-area-context.md
index dbb8a027bf2d5222f6b49e44392cc9c51e8f794a..3c3acc9f1f52e0fa1f3759e8b042a56442e7fd12 100644
--- a/zh-cn/react-native-safe-area-context.md
+++ b/zh-cn/react-native-safe-area-context.md
@@ -1,31 +1,20 @@
-> 模板版本:v0.2.2
+> 模板版本:v0.4.0
react-native-safe-area-context
-
-
-
-
-
-
-
-
-
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-safe-area-context)
-## 安装与使用
+本项目基于 [react-native-safe-area-context](https://github.com/AppAndFlow/react-native-safe-area-context) 开发。
-请到三方库的 Releases 发布地址查看配套的版本信息:
+该第三方库的仓库已迁移至 Gitcode,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/react-native-safe-area-context` 版本所属关系如下:
+| 三方库名称 | 三方库版本 | 发布信息 | 支持RN版本 | Autolink | 编译API版本 | 社区基线版本 | npm地址 |
+| ------------ | ------------ | ------------------------------ | ------------- | ------------- |------------------------ | ------------- | ------------- |
+| @react-native-ohos/react-native-safe-area-context | ~5.6.3 | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.82.* | 否 | API14+ | 5.6.2 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-safe-area-context) |
+| @react-native-ohos/react-native-safe-area-context | ~5.1.1 | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.77.* | 否 | API14+ | 5.1.0 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-safe-area-context) |
+| @react-native-ohos/react-native-safe-area-context | ~4.7.5 | [Gitcode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.72.* | 是 | API14+ | 4.7.4 | [Npm Address](https://www.npmjs.com/package/@react-native-ohos/react-native-safe-area-context) |
+| @react-native-oh-tpl/react-native-safe-area-context | <= 4.7.4-0.2.1@deprecated | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-safe-area-context/releases) | 0.72.* | 否 | API14+ | 4.7.4 | [Npm Address](https://www.npmjs.com/package/@react-native-oh-tpl/react-native-safe-area-context) |
-| 三方库版本 | 社区版本 | 发布信息 | 支持RN版本 |
-|-------|-------------------------------------------------------------------------------------------------------------------------------------------------| ---------- | ---------- |
-| 5.6.3 | 5.6.2 | [@react-native-ohos/react-native-safe-area-context Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.82 |
-| 5.1.1 | 5.1.0 | [@react-native-ohos/react-native-safe-area-context Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.77 |
-| 4.7.5 | 4.7.4 | [@react-native-ohos/react-native-safe-area-context Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-safe-area-context/releases) | 0.72 |
-| <= 4.7.4-0.2.1@deprecated | 4.7.4 | [@react-native-oh-tpl/react-native-safe-area-context Releases(deprecated)](https://github.com/react-native-oh-library/react-native-safe-area-context/releases) | 0.72 |
-
-对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
+## 1. 安装与使用
进入到工程目录并输入以下命令:
@@ -73,13 +62,13 @@ const App = () => {
export default App;
```
-## Link
+## 2. Link
| | 是否支持autolink | RN框架版本 |
|--------------------------------------|-----------------|------------|
-| ~5.6.3 | No | 0.82 |
+| ~5.6.3 | No | 0.82 |
| ~5.1.1 | No | 0.77 |
-| ~4.7.5 | Yes | 0.72 |
+| ~4.7.5 | Yes | 0.72 |
| <= 4.7.4-0.2.1@deprecated | No | 0.72 |
使用AutoLink的工程需要根据该文档配置,Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
@@ -90,7 +79,7 @@ export default App;
首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`
-### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段
+### 2.1. 在工程根目录的 `oh-package.json5` 添加 overrides 字段
```json
{
@@ -101,7 +90,7 @@ export default App;
}
```
-### 2.引入原生端代码
+### 2.2. 引入原生端代码
目前有两种方法:
@@ -135,9 +124,7 @@ ohpm install
> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-### 3.配置 CMakeLists 和引入 SafeAreaViewPackage
-
-> 若使用的是 <= 4.7.4-0.2.1 版本,请跳过本章
+### 2.3. 配置 CMakeLists 和引入 SafeAreaViewPackage
打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
@@ -198,7 +185,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4.在 ArkTs 侧引入 SafeAreaViewPackage
+### 2.4. 在 ArkTs 侧引入 SafeAreaViewPackage
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
@@ -216,7 +203,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
-## 运行
+## 2.5. 运行
点击右上角的 `sync` 按钮
@@ -229,22 +216,29 @@ ohpm install
然后编译、运行即可。
-## 兼容性
+## 3. 约束与限制
-要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+### 3.1. 兼容性
-> [!TIP] version>=4.7.4-0.2.1的版本需要在DevEco Studio 5.0.2(API14) 及以上版本编译
+要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
在以下版本验证通过:
1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71;
3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
-4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.1 Release SDK; IDE: DevEco Studio 6.0.1 Release; ROM:6.0.0.120 SP7
+4. RNOH: 0.82.1; SDK: HarmonyOS 6.0.1 Release SDK; IDE: DevEco Studio 6.0.1 Release; ROM:6.0.0.120 SP7;
+
+### 3.2. 编译运行API要求
+
+> [!TIP] 当前三方库`~4.7.5(0.72)`,`~5.1.1(0.77)`,`~5.6.3(0.82) `及以上版本均已实现版本隔离,支持在 `API12+` 工程编译,及 `API12+` ROM运行。
+
+> [!TIP] 以下功能依赖特定版本的API,使用 `低于指定API版本的工程编译` 或 `低于指定API版本的ROM运行` 均可能导致部分功能受限。
+1. `4.7.4-0.2.1`版本引入[OH_ArkUI_NodeUtils_GetParentInPageTree](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/capi-native-node-h#oh_arkui_nodeutils_getparentinpagetree),解决了对SafeAreaProvider父节点查找存在缺漏问题,此API需要在支持`API14+`的工程编译,并在支持`API14+`的ROM上运行,方可生效。 `~4.7.5(0.72)`、`~5.1.1(0.77)`、`~5.6.3(0.82)` 及之后的版本可以在支持 `API12+` 的工程编译,并在支持`API14+`的ROM上运行,方可生效。
-## 属性
+## 4. 属性
> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
@@ -271,7 +265,7 @@ ohpm install
| `edges` | 设置要应用安全区域插入的边。默认为全部。 | array | no | All | yes |
| `mode` | 可选,padding(默认)或 margin。将安全区域应用到 padding 或 margin。 | string | no | All | yes |
-# API
+## 5. API
> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
@@ -287,10 +281,10 @@ ohpm install
| initialWindowMetrics | 初始渲染时窗口的插入(insets)和 frame。这可以与 SafeAreaProvider 的 initialMetrics 一起使用。 | object | no | All | yes |
| SafeAreaListener5.6.3+ | 监听渲染位置的安全区域变化 | object | no | All | yes |
-## 遗留问题
+## 6. 遗留问题
-## 其他
+## 7. 其他
-## 开源协议
+## 8. 开源协议
本项目基于 [The MIT License (MIT)](https://github.com/th3rdwave/react-native-safe-area-context/blob/main/LICENSE) ,请自由地享受和参与开源。