From 09a2e997db5eb61de2d6131acdc05baef38211fe Mon Sep 17 00:00:00 2001
From: Louis-C7
Date: Mon, 25 Nov 2024 18:02:12 +0800
Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Egitee=E6=96=87?=
=?UTF-8?q?=E6=A1=A3=E6=A8=A1=E6=9D=BF=E4=B8=8E=E6=89=93=E6=A0=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zh-cn/model-gitee.md | 12 ++++-----
zh-cn/react-native-linear-gradient.md | 35 ++++++++++++---------------
2 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/zh-cn/model-gitee.md b/zh-cn/model-gitee.md
index 3f90d4f7..d2153b82 100644
--- a/zh-cn/model-gitee.md
+++ b/zh-cn/model-gitee.md
@@ -257,9 +257,9 @@ Needed for Android and harmony to work properly with assets, iOS will ignore it.
## 属性(如有)
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -267,9 +267,9 @@ Needed for Android and harmony to work properly with assets, iOS will ignore it.
## 静态方法(如有)
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -277,9 +277,9 @@ Needed for Android and harmony to work properly with assets, iOS will ignore it.
## API(如有,一般是 TurboModules)
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md
index b20748c6..66bd4881 100644
--- a/zh-cn/react-native-linear-gradient.md
+++ b/zh-cn/react-native-linear-gradient.md
@@ -3,18 +3,12 @@
react-native-linear-gradient
-
-
-
-
-
-
-
-
+
+本项目基于 [react-native-linear-gradient@3.0.0-alpha.1](https://github.com/react-native-linear-gradient/react-native-linear-gradient)
> [Gitee 仓库](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient)
-> [Gitee Releases: @react-native-ohos/react-native-linear-gradient ](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases)
+> [Gitee Releases: @react-native-ohos/react-native-linear-gradient](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases)
> [Github 仓库(已废弃)](https://github.com/react-native-oh-library/react-native-linear-gradient)
@@ -97,19 +91,24 @@ var styles = StyleSheet.create({
});
```
-## Link
+## Manual Link
-目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。
+此步骤为手动配置原生依赖项的指导。
-首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`
+首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`。
-### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段
+### 1. Overrides RN SDK
+
+为了让工程依赖同一个版本的 RN SDK,需要在工程根目录的 `oh-package.json5` 添加 overrides 字段,指向工程需要使用的 RN SDK 版本。替换的版本既可以是一个具体的版本号,也可以是一个模糊版本,还可以是本地存在的 HAR 包或源码目录。
+
+关于该字段的作用请阅读[官方说明](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-oh-package-json5-V5#zh-cn_topic_0000001792256137_overrides)
```json
{
- ...
"overrides": {
- "@rnoh/react-native-openharmony" : "./react_native_openharmony"
+ "@rnoh/react-native-openharmony": "^0.72.38" // ohpm 在线版本
+ // "@rnoh/react-native-openharmony" : "./react_native_openharmony.har" // 指向本地 har 包的路径
+ // "@rnoh/react-native-openharmony" : "./react_native_openharmony" // 指向源码路径
}
}
```
@@ -118,8 +117,8 @@ var styles = StyleSheet.create({
目前有两种方法:
-1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
-2. 直接链接源码。
+- 通过 har 包引入;
+- 直接链接源码。
方法一:通过 har 包引入(推荐)
@@ -196,8 +195,6 @@ ohpm install
## 兼容性
-要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-
请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/react-native-linear-gradient Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases)
## 属性
--
Gitee
From 20f5d3467a8ba184e621d76d56a99e7a5b532e87 Mon Sep 17 00:00:00 2001
From: Louis-C7
Date: Mon, 25 Nov 2024 18:07:16 +0800
Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20=E6=96=B0=E5=A2=9E=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E8=AF=B4=E6=98=8E=E8=A1=A8=E6=A0=BC=E5=92=8C=E5=BA=8F?=
=?UTF-8?q?=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zh-cn/model-gitee.md | 67 +++++++++++++--------------
zh-cn/react-native-linear-gradient.md | 41 +++++++---------
2 files changed, 51 insertions(+), 57 deletions(-)
diff --git a/zh-cn/model-gitee.md b/zh-cn/model-gitee.md
index d2153b82..274b17a5 100644
--- a/zh-cn/model-gitee.md
+++ b/zh-cn/model-gitee.md
@@ -1,6 +1,6 @@
# 文档模板(删除)
-> [!ATTENTION] 使用模板时请将后面带有 (删除) 的语句删除。<>内是需要修改的内容。(删除)
+> [!ATTENTION] 使用模板时请将后面带有 (删除) 的语句删除。(删除)
> 模板版本:v0.3.0
@@ -8,19 +8,16 @@
<原库 npm 包名>
-本项目基于 [原库 npm 名称@x.x.x](原库仓库连接)
+本项目基于 [原库 npm 名称@x.x.x](原库仓库连接) 开发。
-> [Gitee 仓库](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient)
+`该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:@react-native-ohos/react-native-linear-gradient,具体版本所属关系如下`
-> [Gitee Releases: @react-native-ohos/react-native-linear-gradient](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases)
+| Version | Package Name | Repository | Release |
+| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- |
+| <= 3.0.0-0.5.0@deprecated | @react-native-oh-tpl/react-native-linear-gradient | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient/releases) |
+| > 3.0.0 | @react-native-ohos/react-native-linear-gradient | [Gitee](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient) | [Gitee Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) |
-> [Github 仓库(已废弃)](https://github.com/react-native-oh-library/react-native-linear-gradient)
-
-> [Github Releases(<= 3.0.0-0.5.0): @react-native-oh-tpl/react-native-linear-gradient](https://github.com/react-native-oh-library/react-native-linear-gradient/releases)
-
-## 安装与使用
-
-`该第三方库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:@react-native-ohos/库名`
+## 1. 安装与使用
进入到工程目录并输入以下命令:
@@ -69,13 +66,13 @@ const App = () => {
export default App;
```
-## Manual Link
+## 2. Manual Link
此步骤为手动配置原生依赖项的指导。
首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`。
-### 1. Overrides RN SDK
+### 2.1 Overrides RN SDK
为了让工程依赖同一个版本的 RN SDK,需要在工程根目录的 `oh-package.json5` 添加 overrides 字段,指向工程需要使用的 RN SDK 版本。替换的版本既可以是一个具体的版本号,也可以是一个模糊版本,还可以是本地存在的 HAR 包或源码目录。
@@ -91,7 +88,7 @@ export default App;
}
```
-### 2. 引入原生端代码
+### 2.2 引入原生端代码
目前有两种方法:
@@ -106,7 +103,7 @@ export default App;
```json
"dependencies": {
- "@react-native-ohos/": "file:../../node_modules/@react-native-ohos//harmony/.har"
+ "@react-native-ohos/Package_Name": "file:../../node_modules/@react-native-ohos/Package_Name/harmony/xxx.har"
// 提示: "@react-native-ohos/react-native-safe-area-context": "file:../../node_modules/@react-native-ohos/react-native-safe-area-context/harmony/safe_area.har"(删除)
}
```
@@ -124,7 +121,7 @@ ohpm install
> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-### 3.配置 CMakeLists 和引入 xxxPackge
+### 2.3 配置 CMakeLists 和引入 xxxPackge
**若涉及接入 codegen-lib 导致的配置项新增,需要在配置项前明确声明:> [!TIP] 版本 vx.x.x 及以上需要**(删除)
@@ -161,7 +158,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
**提示:ArkTs 侧引入 Fabric 组件**(删除)
-### 4.在 ArkTs 侧引入 xxx 组件(若本库已 CAPI 化则需要删除本段)
+### 2.4 在 ArkTs 侧引入 xxx 组件(若本库已 CAPI 化则需要删除本段)
找到 `function buildCustomRNComponent()`,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
@@ -194,7 +191,7 @@ const arkTsComponentNames: Array = [
**提示:TurboModule**(删除)
-### 5. 在 ArkTs 侧引入 xxx Package
+### 2.5 在 ArkTs 侧引入 xxx Package
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
@@ -209,7 +206,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 6. 运行
+### 2.6 运行
点击右上角的 `sync` 按钮
@@ -222,9 +219,9 @@ ohpm install
然后编译、运行即可。
-## 约束与限制
+## 3. 约束与限制
-### 兼容性
+### 3.1 兼容性
**修改了原库代码的库使用下述描述**(删除)
@@ -240,7 +237,7 @@ ohpm install
1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); IDE: DevEco Studio 5.0.3.906; ROM: NEXT.0.0.71;
-### 权限要求(如有)
+### 3.2 权限要求(如有)
(填入相关权限配置)
@@ -255,44 +252,46 @@ Needed for Android and harmony to work properly with assets, iOS will ignore it.
(删除)
-## 属性(如有)
+## 4. 属性(如有)
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| XXX | XXX | XXX | (yes/no) | xxx | (yes/no/partially) |
-## 静态方法(如有)
+## 5. 静态方法(如有)
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| XXX | XXX | XXX | (yes/no) | xxx | (yes/no/partially) |
-## API(如有,一般是 TurboModules)
+## 6. API(如有,一般是 TurboModules)
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| XXX | XXX | XXX | (yes/no) | xxx | (yes/no/partially) |
-## 遗留问题
+## 7. 遗留问题
- [ ] xxx 问题: [issue#\*\*\*](https://github.com/issue地址1)
- [ ] yyy 问题: [issue#\*\*\*](https://github.com/issue地址2)
-## 其他
+## 8. 其他
+
+**其他补充说明(删除)**
-## 开源协议
+## 9. 开源协议
本项目基于 [XXX License (XXX)](gitee仓库的LICENSE链接) ,请自由地享受和参与开源。
diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md
index 66bd4881..4e53443d 100644
--- a/zh-cn/react-native-linear-gradient.md
+++ b/zh-cn/react-native-linear-gradient.md
@@ -4,19 +4,16 @@
react-native-linear-gradient
-本项目基于 [react-native-linear-gradient@3.0.0-alpha.1](https://github.com/react-native-linear-gradient/react-native-linear-gradient)
+本项目基于 [react-native-linear-gradient@3.0.0-alpha.1](https://github.com/react-native-linear-gradient/react-native-linear-gradient) 开发。
-> [Gitee 仓库](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient)
+`该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:@react-native-ohos/react-native-linear-gradient,具体版本所属关系如下`
-> [Gitee Releases: @react-native-ohos/react-native-linear-gradient](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases)
+| Version | Package Name | Repository | Release |
+| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- |
+| <= 3.0.0-0.5.0@deprecated | @react-native-oh-tpl/react-native-linear-gradient | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient/releases) |
+| > 3.0.0 | @react-native-ohos/react-native-linear-gradient | [Gitee](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient) | [Gitee Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) |
-> [Github 仓库(已废弃)](https://github.com/react-native-oh-library/react-native-linear-gradient)
-
-> [Github Releases(<= 3.0.0-0.5.0): @react-native-oh-tpl/react-native-linear-gradient](https://github.com/react-native-oh-library/react-native-linear-gradient/releases)
-
-## 安装与使用
-
-`该第三方库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:@react-native-ohos/react-native-linear-gradient`
+## 1. 安装与使用
进入到工程目录并输入以下命令:
@@ -91,15 +88,15 @@ var styles = StyleSheet.create({
});
```
-## Manual Link
+## 2. Manual Link
此步骤为手动配置原生依赖项的指导。
首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`。
-### 1. Overrides RN SDK
+### 2.1 Overrides RN SDK
-为了让工程依赖同一个版本的 RN SDK,需要在工程根目录的 `oh-package.json5` 添加 overrides 字段,指向工程需要使用的 RN SDK 版本。替换的版本既可以是一个具体的版本号,也可以是一个模糊版本,还可以是本地存在的 HAR 包或源码目录。
+为了让工程依赖同一个版本的 RN SDK,需要在工程根目录的 `harmony/oh-package.json5` 添加 overrides 字段,指向工程需要使用的 RN SDK 版本。替换的版本既可以是一个具体的版本号,也可以是一个模糊版本,还可以是本地存在的 HAR 包或源码目录。
关于该字段的作用请阅读[官方说明](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-oh-package-json5-V5#zh-cn_topic_0000001792256137_overrides)
@@ -113,7 +110,7 @@ var styles = StyleSheet.create({
}
```
-### 2.引入原生端代码
+### 2.2 引入原生端代码
目前有两种方法:
@@ -145,7 +142,7 @@ ohpm install
> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-### 3.配置 CMakeLists 和引入 LinearGradientPackage
+### 2.3 配置 CMakeLists 和引入 LinearGradientPackage
打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
@@ -178,7 +175,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4.运行
+### 2.4 运行
点击右上角的 `sync` 按钮
@@ -191,13 +188,13 @@ ohpm install
然后编译、运行即可。
-## 约束与限制
+## 3. 约束与限制
-## 兼容性
+### 3.1 兼容性
请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/react-native-linear-gradient Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases)
-## 属性
+## 4. 属性
> [!TIP] "Platform" 列表示这些属性在原始第三方库中支持的平台。
@@ -213,12 +210,10 @@ ohpm install
| start | Starting point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | yes |
| end | End point coordinates (default value: {x: 0.5,1}) | { x: number,y: number} | NO | All | yes |
-## 遗留问题
+## 5. 遗留问题
- HarmonyOS 当前版本暂时无法实现 angleCenter
-## 其他
-
-## 开源协议
+## 6. 开源协议
本项目基于 [The MIT License (MIT)](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/blob/master/LICENSE) ,请自由地享受和参与开源。
--
Gitee