feat: Toast RN & 鸿蒙 适配
🤔 这个变动的性质是?
- [x] 新特性提交
- [ ] 日常 bug 修复
- [ ] 站点、文档改进
- [ ] 演示代码改进
- [ ] 组件样式/交互改进
- [ ] TypeScript 定义更新
- [ ] 包体积优化
- [ ] 性能优化
- [ ] 功能增强
- [ ] 国际化改进
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
- [ ] 其他改动(是关于什么的改动?)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
⚠️ 请自检并全部勾选全部选项。⚠️
- [ ] 文档已补充或无须补充
- [ ] 代码演示已提供或无须提供
- [ ] TypeScript 定义已补充或无须补充
- [ ] fork仓库代码是否为最新避免文件冲突
- [ ] Files changed 没有 package.json lock 等无关文件
Summary by CodeRabbit
-
新功能
- 完全替换了
Demo组件,提高了模块化和可重用性。 - 为
Toast组件添加了新的样式参数,增强了通知的外观。 - 更新了多个页面的标题文本,提升了一致性和可读性。
- 完全替换了
-
样式
- 改进了
.nut-toast组件的样式,增强了响应性和适应性。
- 改进了
鸿蒙和rn的换行截断demo未适配成功,函数调用demo需要修改一下demo样式,rn弹出样式居中偏下,
鸿蒙和rn的换行截断demo未适配成功,函数调用demo需要修改一下demo样式,rn弹出样式居中偏下,
1)鸿蒙和rn的换行不支持,已屏蔽; 2)函数调用demo已修改; 3)rn弹出样式居中修改已处理。
RN 下的展示换行了
鸿蒙下太宽了
Walkthrough
此次更改主要集中在 src/config.json 文件的版本更新,特别是将 Toast 组件的版本从 2.0.0 更新至 3.0.0。该更改表明组件功能或特性的潜在增强或修改,但具体的行为或实现细节未在差异中提供。JSON 的整体结构保持不变,组件的可见性设置也未发生变化。同时,CSS 和 SCSS 文件中的样式也进行了相应的调整,以支持不同平台的适配。
Changes
| 文件路径 | 更改摘要 |
|---|---|
src/config.json |
将 Toast 组件的版本从 2.0.0 更新至 3.0.0 |
src/packages/overlay/overlay.harmony.css |
为 .nut-overlay 类引入条件 CSS 规则,基于 rn 预处理指令设置 position 属性。移除 .nut-overflow-hidden .taro_page 规则。 |
src/packages/toast/toast.scss |
根据平台(React Native 与非 React Native)调整 .nut-toast 类的样式,添加新的大小类,增强响应式设计。 |
src/styles/variables-jrkf.scss |
更新多个字体大小变量的命名,确保一致性,调整多个组件中的字体大小引用。 |
src/packages/toast/__test__/toast.spec.tsx |
更新 Toast 组件的测试用例,调整类名的断言以反映新的类名。 |
src/packages/toast/demos/taro/demo1.tsx |
简化 Cell 组件的 title 属性文本,更新成功 Toast 的内容。 |
src/packages/toast/toast.taro.tsx |
更新 Toast 组件的导入语句和接口结构,简化逻辑,增强与 Taro 框架的兼容性。 |
src/packages/toast/toast.harmony.css |
为 .nut-toast 类添加条件样式,调整其 position 属性,重命名多个类以提高一致性,增强 RTL 支持。 |
package.json |
更新依赖 @nutui/icons-react-taro 的版本从 ^1.0.5 到 2.0.0-beta.0。 |
Sequence Diagram(s)
sequenceDiagram
participant User
participant ToastComponent
User->>ToastComponent: 请求显示 Toast 通知
activate ToastComponent
ToastComponent-->>User: 显示通知
deactivate ToastComponent
- #2343: 此 PR 涉及更新
Toast组件,与本次 PR 中Toast组件的版本更新直接相关。 - #2670: 此 PR 更新了
InfiniteLoading组件的版本,类似于本次 PR 中Toast组件的版本更新。 - #2672: 此 PR 更新了
Popup组件的版本,与本次 PR 中的Toast组件版本更新相关。 - #2703: 此 PR 更新了
@nutui/replace-icons依赖的版本,与本次 PR 中的版本更新主题一致。
Suggested labels
size/XXL
Suggested reviewers
- oasis-cloud
- irisSong
🐰 在草地上跳跃,欢呼变革来,
版本更新如春风,带来新气象!
Toast 组件焕新颜,功能更强大,
感谢大家的努力,共同筑梦想的未来!
✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin 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 generate unit testing code.@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.
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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation 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 for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.95%. Comparing base (
80c507d) to head (03c12f8). Report is 6 commits behind head on V3.0.
Additional details and impacted files
@@ Coverage Diff @@
## V3.0 #2299 +/- ##
=======================================
Coverage 83.95% 83.95%
=======================================
Files 221 221
Lines 17849 17849
Branches 2679 2679
=======================================
Hits 14986 14986
Misses 2858 2858
Partials 5 5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
加载状态透明遮罩 在H5没生效
all fixed