Skip to content

Commit

Permalink
docs: ✏️ Update Log
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjie.xue committed Sep 18, 2024
1 parent be583b6 commit 0630ab1
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 29 deletions.
56 changes: 41 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
# hp-richtext 是一个适用于 Harmony 的富文本解析组件。
# hp-richtext 是一个适用于 Harmony 的富文本解析组件

## ComponentV2 API升级,需要使用请升级v3.0.0版本(对V1版本向下兼容)

1. 参数变更 {richTextOption: {content: ''}, needScroll: true, onLinkPress: ()=>{}} => richTextModel: {richTextOption: {content: ''}, needScroll: true, onLinkPress: ()=>{}}

2. 用法参考,Example可参照:[V2用法示例](https://github.com/asasugar/HPRichText/blob/master/entry/src/main/ets/pages/V2/Index.ets)

```ets
import { HPRichTextV2, RichTextOptionModelV2 } from '@ohasasugar/hp-richtext';
@Entry
@Component
struct Index {
optionModel: RichTextOptionModelV2 = new RichTextOptionModelV2();
aboutToAppear() {
this.optionModel.richTextOption = {
content: '我是 ComponentV2 的 HPRichText 组件',
imageProp: {
webp: true,
}
}
}
build() {
Column() {
HPRichTextV2({
richTextModel: this.optionModel
})
}
}
}
```

## 别忘了帮我点一个小星星鼓励一下🌟🌟~

如果需要直接运行该代码示例,需要

方式一:安装最新的DevEco Studio从NEXT Developer Beta1;
方式一:安装最新的DevEco Studio从 NEXT Developer Beta1;

方式二:老版本运行,切换到[v1.0.8](https://github.com/asasugar/HPRichText/releases/tag/v1.0.8)

- 修改hvigor-config.json5文件的配置为当前IDE对应的版本,如IDE版本3.1:

```json
{
"hvigorVersion": "2.4.2",
Expand All @@ -17,6 +48,7 @@
}
}
```

- 点击构建-清理项目/重新建构项目/鼠标选中library文件,构建library

## OpenHarmony三方库中心仓链接(假如中心仓与tag版本不一致,则代表中心仓包正在审核中)
Expand All @@ -27,20 +59,12 @@

#### 完整日志:[changelog](https://github.com/asasugar/HPRichText/blob/master/library/CHANGELOG.md)

#### 最近更新:[v2.2.6](https://github.com/asasugar/HPRichText/releases/tag/v2.2.6) (2024-09-14)
#### 最近更新:[v3.0.0](https://github.com/asasugar/HPRichText/releases/tag/v3.0.0) (2024-09-18)

### Features

* 🎸
更新 API12 SDK重新编译发包 ([3f90518](https://github.com/asasugar/HPRichText/commit/3f905189faa9307aa5ef82e1316918350e9b3fec))

#### 最近更新:[v2.2.5](https://github.com/asasugar/HPRichText/releases/tag/v2.2.5) (2024-09-14)

### Features

* 🎸
新增 ObservedHPRichText
组件支持动态生成richTextOption参数 ([0d35d86](https://github.com/asasugar/HPRichText/commit/0d35d862d3d5610285d632c9aeddbb41f9b6a7b4))
- 🎸
升级 @ComponentV2装饰器 组件 [#60](https://github.com/asasugar/HPRichText/issues/60)([be583b6](https://github.com/asasugar/HPRichText/commit/be583b60c0ecf4a88b607dbd96f6cfca899c4e1d))

## 简介

Expand Down Expand Up @@ -226,7 +250,8 @@ Button('改变数据').onClick(() => {

### 自定义 parser 函数具体介绍

* 回调参数为当前节点 `node` 对象及解析结果 `results` 对象,例如:
- 回调参数为当前节点 `node` 对象及解析结果 `results` 对象,例如:

```
const customHandler = {
start(node:NodeInfo) {
Expand All @@ -238,6 +263,7 @@ Button('改变数据').onClick(() => {
chars: null
};
```

* 自定义函数会在原解析函数处理之后执行

### imageProp 对象具体属性
Expand Down Expand Up @@ -338,4 +364,4 @@ Button('改变数据').onClick(() => {

<a href="https://github.com/asasugar/HPRichText/graphs/contributors">
<img src="https://contrib.rocks/image?repo=asasugar/HPRichText" />
</a>
</a>
2 changes: 1 addition & 1 deletion entry/oh-package-lock.json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion library/BuildProfile.ets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Use these variables when you tailor your ArkTS code. They must be of the const type.
*/
export const HAR_VERSION = '2.2.6';
export const HAR_VERSION = '3.0.0';
export const BUILD_MODE_NAME = 'release';
export const DEBUG = false;
export const TARGET_NAME = 'default';
Expand Down
7 changes: 7 additions & 0 deletions library/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### [v3.0.0](https://github.com/asasugar/HPRichText/releases/tag/v3.0.0) (2024-09-18)

### Features

- 🎸
升级 @ComponentV2装饰器 组件 [#60](https://github.com/asasugar/HPRichText/issues/60)([be583b6](https://github.com/asasugar/HPRichText/commit/be583b60c0ecf4a88b607dbd96f6cfca899c4e1d))

### [v2.2.6](https://github.com/asasugar/HPRichText/releases/tag/v2.2.6) (2024-09-14)

### Features
Expand Down
42 changes: 32 additions & 10 deletions library/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
# hp-richtext 是一个适用于 Harmony 的富文本解析组件。

## ComponentV2 API升级,需要使用请升级v3.0.0版本(对V1版本向下兼容)

1. 参数变更 {richTextOption: {content: ''}, needScroll: true, onLinkPress: ()=>{}} => richTextModel: {richTextOption: {content: ''}, needScroll: true, onLinkPress: ()=>{}}

2. 用法参考,Example可参照:[V2用法示例](https://github.com/asasugar/HPRichText/blob/master/entry/src/main/ets/pages/V2/Index.ets)
```ets
import { HPRichTextV2, RichTextOptionModelV2 } from '@ohasasugar/hp-richtext';
@Entry
@Component
struct Index {
optionModel: RichTextOptionModelV2 = new RichTextOptionModelV2();
aboutToAppear() {
this.optionModel.richTextOption = {
content: '我是 ComponentV2 的 HPRichText 组件',
imageProp: {
webp: true,
}
}
}
build() {
Column() {
HPRichTextV2({
richTextModel: this.optionModel
})
}
}
}
```

## 别忘了帮我点一个小星星鼓励一下🌟🌟~

如果需要直接运行该代码示例,需要

方式一:安装最新的DevEco Studio从NEXT Developer Beta1;
方式一:安装最新的DevEco Studio从 NEXT Developer Beta1;

方式二:老版本运行,切换到[v1.0.8](https://github.com/asasugar/HPRichText/releases/tag/v1.0.8)

Expand All @@ -27,20 +56,13 @@

#### 完整日志:[changelog](https://github.com/asasugar/HPRichText/blob/master/library/CHANGELOG.md)

#### 最近更新:[v2.2.6](https://github.com/asasugar/HPRichText/releases/tag/v2.2.6) (2024-09-14)

### Features

* 🎸
更新 API12 SDK重新编译发包 ([3f90518](https://github.com/asasugar/HPRichText/commit/3f905189faa9307aa5ef82e1316918350e9b3fec))

#### 最近更新:[v2.2.5](https://github.com/asasugar/HPRichText/releases/tag/v2.2.5) (2024-09-14)
#### 最近更新:[v3.0.0](https://github.com/asasugar/HPRichText/releases/tag/v3.0.0) (2024-09-18)

### Features

* 🎸
新增 ObservedHPRichText
组件支持动态生成richTextOption参数 ([0d35d86](https://github.com/asasugar/HPRichText/commit/0d35d862d3d5610285d632c9aeddbb41f9b6a7b4))
升级 @ComponentV2装饰器 组件 [#60](https://github.com/asasugar/HPRichText/issues/60)([be583b6](https://github.com/asasugar/HPRichText/commit/be583b60c0ecf4a88b607dbd96f6cfca899c4e1d))

## 简介

Expand Down
6 changes: 4 additions & 2 deletions library/oh-package.json5
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "@ohasasugar/hp-richtext",
"version": "2.2.6",
"version": "3.0.0",
"description": "hp-richtext, 是一个基于HTML的标签解析,扩展了更多属性和样式的鸿蒙富文本组件,解决了遍历嵌套渲染原生RichText的性能问题。",
"homepage": "https://github.com/asasugar/HPRichText",
"repository": "https://github.com/asasugar/HPRichText",
"keywords": [
"hp-richtext",
"rich-text",
"harmony",
"harmony-rich-text"
"harmony-rich-text",
"@Component",
"@ComponentV2"
],
"main": "index.ets",
"author": "asasugar",
Expand Down

0 comments on commit 0630ab1

Please sign in to comment.