-
-
Notifications
You must be signed in to change notification settings - Fork 112
refactor: Move semantic props #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次更改统一了预览组件相关的类型定义和接口结构。主要调整了 Image、Preview、PreviewGroup 组件以及相关钩子和测试用例中 classNames 与 styles 的声明方式,增加了 popup 子属性。与此同时,重命名了部分类型(如 InternalPreviewSemanticName → PreviewSemanticName)以及接口(GroupConsumerProps → PreviewGroupProps),并更新了参数传递与内部渲染逻辑,确保新结构的一致性。 Changes
Sequence Diagram(s)sequenceDiagram
participant PG as PreviewGroup
participant P as Preview
participant I as Image
PG->>P: 传递 classNames.popup 与 styles.popup
P->>I: 转发 popup 属性给 Image
I->>I: 内部逻辑使用新的 classNames 与 styles 渲染
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/Image.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. tests/preview.test.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. src/PreviewGroup.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #404 +/- ##
==========================================
- Coverage 99.40% 99.40% -0.01%
==========================================
Files 17 17
Lines 506 504 -2
Branches 148 146 -2
==========================================
- Hits 503 501 -2
Misses 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
改动
preview.classNames->classNames.popuppreview.styles->styles.popup为何这么改
和 @thinkasany 聊下来
classNames为唯一入口,子级组件都从classNames中走。以统一复杂结构的逻辑。例如 Transfer 组件使用了 Dropdown、Pagination、Input.Search 组件,但是本身并没有透出对应的 API 进行配置子组件的能力。如果是散装配置则需要每个都提供一个仅能配置classNames和styles的一级入口,会非常怪异。统一收口后,使用复合子组件的场景不需要额外打孔即可支持。Summary by CodeRabbit
新功能
重构