@pixui-dev/pixui-richtext-helper 0.2.7 → 0.2.8
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/dist/richtext/RichTextCore.js +1 -1
- package/index.js +5 -5
- package/package.json +27 -27
- package/readme.md +6 -0
|
@@ -813,7 +813,7 @@ var RichTextCore = /** @class */ (function () {
|
|
|
813
813
|
if (textIndent) {
|
|
814
814
|
var repeatCnt = parseInt(textIndent);
|
|
815
815
|
if (repeatCnt > 0) {
|
|
816
|
-
var spacer = "<div style=\"".concat(mergeStyles("color: transparent", "flex-shrink: 0", "font-size: 16px"), "\">").concat("一".repeat(repeatCnt), "</div>");
|
|
816
|
+
var spacer = "<div style=\"".concat(mergeStyles("color: transparent", "flex-shrink: 0", "font-size: 16px"), "\" class='pixui-richtext-indent-placeholder'>").concat("一".repeat(repeatCnt), "</div>");
|
|
817
817
|
var textChild = $(this).children("text").first();
|
|
818
818
|
if (textChild.length > 0) {
|
|
819
819
|
var first = textChild.children().first();
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { RichText } = require("./dist/index");
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
RichText,
|
|
5
|
-
};
|
|
1
|
+
const { RichText } = require("./dist/index");
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
RichText,
|
|
5
|
+
};
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pixui-dev/pixui-richtext-helper",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "pixui richtext helper",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist/**/*",
|
|
9
|
-
"index.js",
|
|
10
|
-
"readme.md"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"build": "rm -rf dist && tsc"
|
|
15
|
-
},
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
18
|
-
},
|
|
19
|
-
"author": "jnjnjnzhang",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@types/node": "^22.15.33",
|
|
23
|
-
"typescript": "^5.8.3"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"cheerio": "1.0.0-rc.10"
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pixui-dev/pixui-richtext-helper",
|
|
3
|
+
"version": "0.2.8",
|
|
4
|
+
"description": "pixui richtext helper",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/**/*",
|
|
9
|
+
"index.js",
|
|
10
|
+
"readme.md"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
+
"build": "rm -rf dist && tsc"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"author": "jnjnjnzhang",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^22.15.33",
|
|
23
|
+
"typescript": "^5.8.3"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"cheerio": "1.0.0-rc.10"
|
|
27
|
+
}
|
|
28
28
|
}
|
package/readme.md
CHANGED
|
@@ -40,6 +40,7 @@ componentDidMount() { // 在节点渲染后绑定点击事件
|
|
|
40
40
|
| 带超链接的图片(`img`) | `.PA_RichTextHref_ImgTag` | 图片本身存在跳转链接时添加 |
|
|
41
41
|
| 所有图片(`img`) | `.PA_RichTextImgTag` | 富文本中的通用图片标记 |
|
|
42
42
|
| 占位换行节点(`div`/`span`) | `.pixui-richtext-br-placeholder` | 连续 `<br>` 会被替换为透明字符占位,可调整段落之间的间距 |
|
|
43
|
+
| 缩进节点(`text-indent`) | `.pixui-richtext-indent-placeholder` | text-indent 首行缩进处理 |
|
|
43
44
|
| 列表条目容器(`div`) | `data-list-item="true"` | 每个列表项均带此属性,方便定制行距、缩进等 |
|
|
44
45
|
| 超链接节点(任何) | `id="PA_RichTextHrefId_xxx"` | 与 `bindLinkClickEvents` 配合,可用 `[id^="PA_RichTextHrefId_"]` 选择 |
|
|
45
46
|
|
|
@@ -67,6 +68,11 @@ componentDidMount() { // 在节点渲染后绑定点击事件
|
|
|
67
68
|
.pixui-richtext-br-placeholder {
|
|
68
69
|
font-size: 12px;
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
/* 自定义缩进大小 */
|
|
73
|
+
.pixui-richtext-indent-placeholder {
|
|
74
|
+
|
|
75
|
+
}
|
|
70
76
|
```
|
|
71
77
|
|
|
72
78
|
版本更新记录
|