Skip to content

Conversation

li-jia-nan
Copy link
Member

@li-jia-nan li-jia-nan commented May 17, 2025

Summary by CodeRabbit

  • 新功能

    • 无新增功能。
  • 破坏性变更

    • Collapse 组件及相关接口的属性 destroyInactivePanel 更名为 destroyOnHidden,请及时更新相关用法。
    • CollapsePanelProps 的 header 和 extra 属性类型由 string | React.ReactNode 调整为 React.ReactNode。
  • 依赖更新

    • 替换 motion 动画库为 @rc-component/motion,并升级 React 及相关依赖至 19.x 版本。
    • 新增 @rc-component/np 依赖,移除 np。
  • 文档

    • 更新 Collapse 组件文档,反映属性名称和类型的最新变更。
  • 测试

    • 测试用例同步属性名称变更,调整依赖导入路径。
  • 配置

    • 新增 vercel.json 配置文件,替代已删除的 now.json。
    • 调整 GitHub Actions 部署目录由 .doc 改为 dist,移除部分旧配置。
  • 忽略文件

    • 将 pnpm-lock.yaml 添加至忽略列表,统一管理锁文件。

Copy link

vercel bot commented May 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
collapse ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2025 3:26am

Copy link
Contributor

coderabbitai bot commented May 17, 2025

## Walkthrough

本次更新主要将组件和类型中的 `destroyInactivePanel` 属性重命名为 `destroyOnHidden`,并同步更新相关文档、类型定义、测试用例和依赖包。此外,还调整了部分依赖包的来源和版本,统一了类型声明和导入路径。

## Changes

| 文件/文件组                                                                 | 变更摘要                                                                                                   |
|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
| .gitignore                                                                  | 新增忽略 `pnpm-lock.yaml` 文件。                                                                           |
| README.md                                                                   | 将 Collapse 组件文档中的 `destroyInactivePanel` 属性重命名为 `destroyOnHidden`|
| package.json                                                                | 替换依赖 `rc-motion``@rc-component/motion`,增加/升级相关依赖和类型定义,提升 React 相关依赖版本。      |
| docs/examples/_util/motionUtil.ts<br>src/Panel.tsx<br>src/interface.ts      | 将 motion 相关类型和组件的导入路径从 `rc-motion` 改为 `@rc-component/motion`|
| src/Collapse.tsx<br>src/hooks/useItems.tsx<br>src/interface.ts<br>src/Panel.tsx | 将所有 `destroyInactivePanel` 属性及相关逻辑重命名为 `destroyOnHidden`,并同步类型定义和用法。             |
| src/PanelContent.tsx                                                        | `PanelContent` 组件 props 类型声明由交叉类型改为 `PropsWithChildren<Readonly<CollapsePanelProps>>`|
| src/interface.ts                                                            | `CollapsePanelProps``header``extra` 属性类型由 `string | React.ReactNode` 改为 `React.ReactNode`。  |
| tests/index.spec.tsx                                                        | `KeyCode` 导入路径调整,测试用例中的 `destroyInactivePanel` 改为 `destroyOnHidden`|
| now.json                                                                    | 删除该部署配置文件。                                                                                        |
| vercel.json                                                                 | 新增 Vercel 部署配置文件,指定框架为 "umijs"。                                                            |
| .dumirc.ts                                                                  | 移除配置中的 `outputPath: '.doc'`|
| .github/workflows/site-deploy.yml                                           | 修改 GitHub Actions 部署流程,发布目录由 `./.doc` 改为 `./dist`|

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant Collapse
    participant Panel
    User->>Collapse: 设置 destroyOnHidden 属性
    Collapse->>Panel: 传递 destroyOnHidden
    Panel->>Panel: 根据 destroyOnHidden 控制面板销毁

Suggested reviewers

  • zombieJ

Poem

🐇
属性新名随风转,
旧貌换新颜。
依赖升级更通畅,
文档同步展。
代码焕然一新处,
小兔欢跃舞蓝天!


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between f8bad81e771982c4fc04cc149c929b35b70f06f4 and 92c2b1a940a764d1c4113246c1f0a0641bb50f10.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `.dumirc.ts` (0 hunks)
* `.github/workflows/site-deploy.yml` (1 hunks)
* `package.json` (3 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (1)</summary>

* .dumirc.ts

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* .github/workflows/site-deploy.yml

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* package.json

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4USAMzRj8FeBiKQKDMM3zj8WAkgAAU8wJmZuf3YAeh8/DAMAOWxmAUouAGYANgAWAwBVRHTIC3gwIXg0MAxMI31jcCgyenw7HAJiMmUaenC2DE4ePkERMUlpSDkFJSpVdS0depMoOFRUTHbCUnIqHoVWdhs0AHdIRBTmNAp5KaYZlTVNbV0wQwbTAw0idXgiDGdrAYAEQggwAYjBkAAggBJTo7ah0M4XK7yVqMWCYUiIMywEiQAAGXx+fwBBMgdngVkgxzQyGw3FoiPogVcDAs2CUhO4GG4zDAFnwDAA1hpZGhmBZya5ILg8SUkLh+G1fv9bPRKVZEBoYAhkGhaLQfv5IGRzrZkHLqLL5YKRRSqfjtt0kVM5fieXyeI5hWhSJBLjVSHxUCQAB7szlIuwUFiQKQURDwE1MAaxizoQVuJNc3x4vjcH1+/GB4t8O3Ch1ahXC/EE8UUDAaCvkzD0AmFkXFgVC0VCRD+ImQRL4fjuvgMTFuCaBd0oUm2b24GiN5DOKv4xC4CjYMTYRfHSglg0kDRGIwQ6EWFfUZMYS2judKdlXW/+NdtcORCh7dfcbACKUDCmgMPzSEYI7kMCoIGBAYBGAASgAolCAAiACySEaMwtAcNBQLgpCsLwi69DnKwqLKhiWLgQYcD4rQQopOwb5YHY65zgSADC+AWBYaDcEU5LhJE5ADAA5MgUIAAowjSdKQAyTJ7IEtg1GwNoerG3CEkoW6xrIMI1GMUjSZgJBSrKo4Enp274LIADyGAABLwIaZBDvRsqyNwJAADSQEoDjYNe8ZoBy/noBg9B6QwLjcPEHgkJcMrYBgk40bQAWuEaDC3m4NrWnOvD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z3xPHxHzkDpBXPmSDvnu3mr17W42redAWpXgXUnZX9VXh3gmh0Z0QaWOhDXegWBEYjhTgoibh5BKZZhHgFgXhDBlh9hflcBOY3JEBOZbAdp9i6BOYi7+b6gDBH2AB2DIID2gHIIDtAMDnIUD2pFQOwDIBgAQJkMGWpEJDIewWpOwFpOwEJNAdhEgEJHpDIGNpYRoTbAxFpOD9hA0HpIDnIBD1FOwAQEJVFLIEgDIEJCDoDnpEgAxJkWpAQIDkgHIFpNAFpe9wD8jkT2gLjjIdhAxBgOwXj9hAQOwHIAxLILIFQMDnjkJWgAxewcThgEJID2pWgWpAxWBsjiACkQTg0WpAjoDoD1pNDhgBjhgAxHIVI9hUThgFpEJFpAQDIHpITgxOwTT9TyTx9gLkzgQGjlpDTqD3IWgdhdz9hdhTjnILIBgdhCLtATTnIVTgQHpcLhTyTqT2zvodQV92gd9z98+cSzmZoe9oAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings
<details open="true">
<summary>🧪 Generate Unit Tests</summary>

- [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Create PR with Unit Tests
- [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Commit Unit Tests in branch `update-version`
- [ ] <!-- {"checkboxId": "07f1e7d6-8a8e-4e23-9900-8731c2c87f58", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} -->   Post Copyable Unit Tests in Comment

</details>

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=react-component/collapse&utm_content=364):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai generate unit tests` to generate unit tests for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link

socket-security bot commented May 17, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​rc-component/​np@​1.0.4701006686100
Updated@​types/​react-dom@​18.3.7 ⏵ 19.1.510010072 -195100
Updated@​types/​react@​18.3.21 ⏵ 19.1.4100 +110078 +195100
Added@​rc-component/​motion@​1.1.4811009985100
Updated@​testing-library/​react@​14.3.1 ⏵ 16.3.09910010089100

View full report

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 74a99fe and 737d47a.

📒 Files selected for processing (11)
  • .gitignore (1 hunks)
  • README.md (1 hunks)
  • docs/examples/_util/motionUtil.ts (1 hunks)
  • package.json (3 hunks)
  • src/Collapse.tsx (2 hunks)
  • src/Panel.tsx (4 hunks)
  • src/PanelContent.tsx (1 hunks)
  • src/hooks/useItems.tsx (10 hunks)
  • src/index.tsx (1 hunks)
  • src/interface.ts (4 hunks)
  • tests/index.spec.tsx (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/PanelContent.tsx (1)
src/interface.ts (1)
  • CollapsePanelProps (46-68)
src/hooks/useItems.tsx (1)
src/interface.ts (2)
  • CollapseProps (22-42)
  • CollapsePanelProps (46-68)
🪛 GitHub Actions: ✅ test
src/index.tsx

[error] 1-1: ESLint: 'React' is defined but never used. (@typescript-eslint/no-unused-vars)

🔇 Additional comments (35)
docs/examples/_util/motionUtil.ts (1)

1-5: 依赖包路径更新正确

成功将导入路径从 rc-motion 更新为 @rc-component/motion,与 PR 目标一致。

.gitignore (1)

31-31: 添加 pnpm-lock.yaml 到 .gitignore 文件

正确地将 pnpm 的锁文件添加到 .gitignore 中,与其他包管理器的锁文件(yarn.lock、package-lock.json)保持一致。

README.md (1)

81-81: 文档中属性名称统一更新

成功将文档中的 destroyInactivePanel 更新为 destroyOnHidden,与代码变更保持一致。

tests/index.spec.tsx (2)

3-3: 依赖包路径更新正确

成功将导入路径从 rc-util/lib/KeyCode 更新为 @rc-component/util/lib/KeyCode,与 PR 目标一致。


243-243: 测试用例属性名称统一更新

成功将测试代码中的 destroyInactivePanel 更新为 destroyOnHidden,与其他文件的变更保持一致。

src/Collapse.tsx (2)

23-23: 属性名称更改:destroyInactivePanel -> destroyOnHidden

属性名称从 destroyInactivePanel 更改为 destroyOnHidden,这使得属性名称更加直观,更好地描述了其功能:在面板隐藏时销毁内容。


75-75: 保持属性名称一致性

useItems 钩子中正确地使用更新后的 destroyOnHidden 属性名,保持了整个代码库的一致性。

package.json (4)

49-49: 依赖包更新:rc-motion -> @rc-component/motion

rc-motion 替换为 @rc-component/motion,与 PR 标题 "refactoring rc-motion to @rc-component/motion" 保持一致。这是一个好的改进,使用了更标准化的包命名方式。


60-62: TypeScript 类型声明更新

添加了 @types/node 并更新了 React 相关的类型声明到 v19,这与 React 版本升级保持一致。


77-78: React 依赖升级到 v19

将 React 和 React DOM 依赖从 v18 升级到 v19.1.0,确保组件与最新的 React 版本兼容。


82-83: 更新 peerDependencies 的最低要求

将 peerDependencies 的最低要求从 >=16.9.0 提高到 >=18.0.0,这是合理的,因为 React 18 引入了许多新特性和 API 更改。

src/PanelContent.tsx (1)

7-7: 改进类型定义

将 props 类型从交叉类型 CollapsePanelProps & { children: React.ReactNode } 更改为 React.PropsWithChildren<Readonly<CollapsePanelProps>>,这是一个更好的做法:

  1. 使用 Readonly 使 props 显式只读,符合 React 的最佳实践
  2. 使用 PropsWithChildren 工具类型代替手动添加 children 属性
  3. 代码更简洁且更符合 React 类型系统的标准用法
src/Panel.tsx (4)

2-2: 更新导入路径:rc-motion -> @rc-component/motion

'rc-motion' 更改为 '@rc-component/motion',与 package.json 中的依赖更改保持一致。


26-26: 属性名称更新:destroyInactivePanel -> destroyOnHidden

属性名称从 destroyInactivePanel 更改为 destroyOnHidden,保持了整个代码库的命名一致性。


107-107: 更新 CSSMotion 组件的属性

将传递给 CSSMotion 组件的属性从 destroyInactivePanel 更新为 removeOnLeave={destroyOnHidden},这不仅与新的属性名称保持一致,而且使用了 @rc-component/motion 包中 CSSMotion 组件期望的属性名。


120-120: 改进代码风格:void 0 -> undefined

role={accordion ? 'tabpanel' : void 0} 更改为 role={accordion ? 'tabpanel' : undefined},这是一个风格上的改进,使用更符合现代 JavaScript 习惯的 undefined 而不是 void 0。两者在功能上等效,但 undefined 更具可读性。

src/hooks/useItems.tsx (13)

10-10: 更新了 Props 类型中的属性名称

Props 类型中 CollapseProps 的 Pick 类型,将 destroyInactivePanel 属性更名为 destroyOnHidden,使命名更加直观。


19-19: 更新了解构赋值中的属性名称

解构赋值中的 destroyInactivePanel 属性更名为 destroyOnHidden,与接口定义保持一致。


35-35: 更新了 item 属性名称

item 对象中的 destroyInactivePanel 属性更名为 destroyOnHidden,保持命名一致性。


43-43: 更新了合并变量名称

mergedDestroyInactivePanel 变量名更新为 mergedDestroyOnHidden,并相应更新了引用的属性名。


46-48: 改进了条件语句格式

为单行 if 语句添加了明确的花括号,提高了代码的可读性和一致性。


75-75: 更新了组件属性名称

CollapsePanel 组件中的 destroyInactivePanel 属性更名为 destroyOnHidden


91-93: 改进了空值检查格式

为空值检查条件语句添加了明确的花括号,提高了代码的可读性和一致性。


99-99: 更新了解构赋值中的属性名称

props 解构赋值中的 destroyInactivePanel 属性更名为 destroyOnHidden


113-113: 更新了 child.props 解构赋值中的属性名称

child.props 解构赋值中的 destroyInactivePanel 属性更名为 destroyOnHidden


128-130: 改进了条件语句格式

为单行 if 语句添加了明确的花括号,提高了代码的一致性和可维护性。


144-144: 更新了属性合并逻辑

将属性名从 destroyInactivePanel 更新为 destroyOnHidden,同时保持了同样的合并逻辑 (childDestroyOnHidden ?? destroyOnHidden)。


164-164: 增强了类型安全性

React.cloneElement 添加了类型参数 <CollapsePanelProps>,提高了类型安全性。


175-177: 改进了代码格式并增强了类型安全性

改进了返回语句的格式,并添加了类型转换 as React.ReactElement<CollapsePanelProps>,确保类型安全。

src/interface.ts (6)

1-1: 更新了依赖包路径

rc-motion 导入源更新为 @rc-component/motion,符合 PR 标题中提到的重构目标。


31-31: 更新了 CollapseProps 接口属性名

CollapseProps 接口中的 destroyInactivePanel 属性更名为 destroyOnHidden,使命名更加直观。


45-45: 添加了空行

SemanticName 类型定义后添加了空行,改进了代码格式。


48-48: 优化了 header 属性类型

CollapsePanelProps 接口中 header 属性的类型从 string | React.ReactNode 简化为 React.ReactNode(因为 string 已包含在 React.ReactNode 中)。


58-58: 更新了 CollapsePanelProps 接口属性名

CollapsePanelProps 接口中的 destroyInactivePanel 属性更名为 destroyOnHidden,保持整个组件库的命名一致性。


61-61: 优化了 extra 属性类型

CollapsePanelProps 接口中 extra 属性的类型从 string | React.ReactNode 简化为 React.ReactNode(因为 string 已包含在 React.ReactNode 中)。

Copy link

codecov bot commented May 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.15%. Comparing base (74a99fe) to head (92c2b1a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   99.12%   99.15%   +0.02%     
==========================================
  Files           5        5              
  Lines         114      118       +4     
  Branches       43       43              
==========================================
+ Hits          113      117       +4     
  Misses          1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zombieJ zombieJ requested a review from Copilot May 19, 2025 03:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors animation integration from rc-motion to @rc-component/motion, renames the panel destruction prop, and updates related imports, dependencies, and documentation.

  • Renamed destroyInactivePanel prop to destroyOnHidden across interfaces, components, tests, and docs
  • Replaced rc-motion with @rc-component/motion imports and added @rc-component/motion dependency
  • Updated React and related peer/dev dependencies to version 19.x

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/index.spec.tsx Updated import path for KeyCode and prop rename in test
src/interface.ts Swapped CSSMotionProps import and renamed prop types
src/hooks/useItems.tsx Renamed destroyInactivePanel to destroyOnHidden in hook logic
src/PanelContent.tsx Adjusted forwardRef generic to use PropsWithChildren
src/Panel.tsx Updated motion import, prop rename, and cleaned up role default
src/Collapse.tsx Renamed default prop and forwarded prop in main component
package.json Added @rc-component/motion, bumped React versions, removed old lib
docs/examples/_util/motionUtil.ts Updated motion import types
README.md Renamed prop in documentation table
Comments suppressed due to low confidence (1)

README.md:84

  • [nitpick] The description is grammatically awkward. Consider rephrasing to: "Whether to destroy panels when hidden (not active), default false."
<td>If destroy the panel which not active, default false. </td>

@zombieJ zombieJ merged commit cf0fa80 into master May 19, 2025
10 checks passed
@li-jia-nan li-jia-nan deleted the update-version branch May 19, 2025 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants