Skip to content

Commit 2f4db34

Browse files
committed
chore: address standardization review comments
1 parent 394d4eb commit 2f4db34

4 files changed

Lines changed: 34 additions & 21 deletions

File tree

.github/workflows/surge-preview.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,23 @@ jobs:
1818
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
1919
with:
2020
persist-credentials: false
21+
- name: Check Surge token
22+
id: surge-token
23+
env:
24+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
25+
run: |
26+
if [ -n "$SURGE_TOKEN" ]; then
27+
echo "enabled=true" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "enabled=false" >> "$GITHUB_OUTPUT"
30+
fi
2131
- name: Build preview
22-
if: ${{ secrets.SURGE_TOKEN != '' }}
32+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
2333
run: |
2434
npm install
2535
npm run build
2636
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
27-
if: ${{ secrets.SURGE_TOKEN != '' }}
37+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
2838
env:
2939
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
3040
with:
@@ -34,5 +44,5 @@ jobs:
3444
failOnError: false
3545
setCommitStatus: false
3646
- name: Skip Surge preview
37-
if: ${{ secrets.SURGE_TOKEN == '' }}
47+
if: ${{ steps.surge-token.outputs.enabled != 'true' }}
3848
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Then open `http://localhost:8000`.
104104
| --- | --- | --- | --- |
105105
| key | Panel key | `React.Key` | - |
106106
| label | Panel header content | `React.ReactNode` | - |
107+
| ref | Panel DOM ref | `React.RefObject<HTMLDivElement>` | - |
107108
| children | Panel body content | `React.ReactNode` | - |
108109
| className | Additional panel class name | string | - |
109110
| classNames | Semantic class names | `Partial<Record<SemanticName, string>>` | - |

README.zh-CN.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
- 支持手风琴和多面板折叠模式。
3232
- 推荐使用 `items` API 声明式配置面板。
3333
- 保留 `Collapse.Panel` 以实现兼容性。它已被弃用,并将在 v4 中删除。
34-
- 支持自定义展开图标、语义className称、语义样式和动作
34+
- 支持自定义展开图标、语义化类名、语义样式和动画
3535

3636
## 安装
3737

@@ -85,35 +85,36 @@ npm start
8585
| --- | --- | --- | --- |
8686
| accordion | 一次只能打开一个面板 | boolean | false |
8787
| activeKey | 当前活动面板键 | `React.Key \| React.Key[]` | - |
88-
| className | 附加className | string | - |
89-
| classNames | 语义className | `Partial<Record<SemanticName, string>>` | - |
88+
| className | 附加 className | string | - |
89+
| classNames | 语义化类名 | `Partial<Record<SemanticName, string>>` | - |
9090
| collapsible | 指定面板触发区域是否可折叠 | `header` \| `icon` \| `disabled` | - |
9191
| defaultActiveKey | 初始活动面板键 | `React.Key \| React.Key[]` | - |
9292
| destroyOnHidden | 销毁非活动面板内容 | boolean | false |
9393
| expandIcon | 自定义展开图标 | `(props: object) => React.ReactNode` | - |
94-
| 项目 | 折叠项目内容 | `ItemType[]` | - |
95-
| openMotion | 自定义打开动作 | `CSSMotionProps` | - |
96-
| prefixCls | 组件className前缀 | string | `rc-collapse` |
97-
| 风格 | 内联样式 | object | - |
98-
| styles | Semantic styles | `Partial<Record<SemanticName, React.CSSProperties>>` | - |
94+
| items | 折叠条目内容 | `ItemType[]` | - |
95+
| openMotion | 自定义展开动画 | `CSSMotionProps` | - |
96+
| prefixCls | 组件 className 前缀 | string | `rc-collapse` |
97+
| style | 内联样式 | object | - |
98+
| styles | 语义化样式 | `Partial<Record<SemanticName, React.CSSProperties>>` | - |
9999
| onChange | 活动面板更改时的回调 | `(key: React.Key[]) => void` | - |
100100

101101
### ItemType
102102

103103
| 参数 | 说明 | 类型 | 默认值 |
104104
| --- | --- | --- | --- |
105-
| key | 面板按键 | `React.Key` | - |
105+
| key | 面板键值 | `React.Key` | - |
106106
| label | 面板标题内容 | `React.ReactNode` | - |
107-
| 孩子们 | 面板主体内容 | `React.ReactNode` | - |
108-
| className | 附加面板className | string | - |
109-
| classNames | 语义className | `Partial<Record<SemanticName, string>>` | - |
107+
| ref | 面板 DOM 引用 | `React.RefObject<HTMLDivElement>` | - |
108+
| children | 面板主体内容 | `React.ReactNode` | - |
109+
| className | 附加面板 className | string | - |
110+
| classNames | 语义化类名 | `Partial<Record<SemanticName, string>>` | - |
110111
| collapsible | 指定面板是否可折叠 | `header` \| `icon` \| `disabled` | - |
111112
| destroyOnHidden | 销毁非活动面板内容 | boolean | false |
112-
| 额外的 | 面板标题中的额外内容 | `React.ReactNode` | - |
113+
| extra | 面板标题中的额外内容 | `React.ReactNode` | - |
113114
| forceRender | 在打开面板之前渲染面板内容 | boolean | false |
114115
| showArrow | 在标题旁边显示箭头 | boolean | true |
115-
| 风格 | 内联面板样式 | object | - |
116-
| styles | Semantic styles | `Partial<Record<SemanticName, React.CSSProperties>>` | - |
116+
| style | 内联面板样式 | object | - |
117+
| styles | 语义化样式 | `Partial<Record<SemanticName, React.CSSProperties>>` | - |
117118
| onItemClick | 点击该面板时的回调 | `(panelKey: React.Key) => void` | - |
118119

119120
### 折叠面板

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@
3232
"compile": "father build && lessc assets/index.less assets/index.css",
3333
"coverage": "rc-test --coverage",
3434
"docs:build": "dumi build",
35-
"docs:deploy": "npm run docs:build && gh-pages -d docs-dist",
35+
"docs:deploy": "gh-pages -d docs-dist",
3636
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
3737
"prepare": "husky",
3838
"prepublishOnly": "npm run compile && rc-np",
3939
"prettier": "prettier --write --ignore-unknown .",
40-
"postpublish": "npm run docs:deploy",
40+
"postpublish": "npm run docs:build:gh-pages && npm run docs:deploy",
4141
"start": "dumi dev",
4242
"test": "rc-test",
43-
"tsc": "tsc --noEmit"
43+
"tsc": "tsc --noEmit",
44+
"docs:build:gh-pages": "GH_PAGES=1 npm run docs:build"
4445
},
4546
"lint-staged": {
4647
"**/*.{ts,tsx,js,jsx,json,md}": "prettier --write --ignore-unknown"

0 commit comments

Comments
 (0)