Conversation
🦋 Changeset detectedLatest commit: 6a3adea The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
【预览链接】
|
|
Size Change: -1.05 kB (-0.01%) Total Size: 7.84 MB 📦 View Changed
ℹ️ View Unchanged
|
当 toolbar 和 toolbarRight 都为 false/空数组时,隐藏顶部工具栏 DOM; 统一将非数组的工具栏配置归一化为空数组
🔌 VSCode Plugin 构建产物
|
🌐 Playground 预览 |
There was a problem hiding this comment.
Pull request overview
该 PR 旨在修复 toolbars.toolbar / toolbars.toolbarRight 配置为 false 时顶部工具栏的渲染异常,并补充一个用于手动验证工具栏挂载/卸载与模式切换的 demo 页面。
Changes:
- 在
Cherry初始化与模式切换/重置工具栏时,引入“是否应渲染工具栏 DOM”的统一计算与同步挂载逻辑(syncToolbarDom/#computeShouldRenderToolbar)。 - 更新 CodeMirror
EditorView的类型引用方式(改为 JSDocimport()类型),避免运行时依赖。 - 新增
toolbar-toggle-demo.html示例页,并将其加入 Vite 的可访问页面列表;新增 changeset 记录版本变更。
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/cherry-markdown/vite.config.ts | 将新示例页加入 dev server 页面列表,便于验证修复效果 |
| packages/cherry-markdown/src/Cherry.js | 工具栏 DOM 挂载/卸载同步逻辑 + resetToolbar 清理逻辑 + 类型注释调整 |
| examples/toolbar-toggle-demo.html | 新增手动/半自动验证工具栏显示/隐藏/重置/模式切换的 demo |
| .changeset/yellow-cougars-flow.md | 记录本次变更的发布说明与版本类型 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* fix: 修复工具栏配置为 false 时的渲染问题 * Create yellow-cougars-flow.md * refactor: 移除工具栏高度更新逻辑 * chore: 更新 changeset 版本类型为 minor * fix: 修复工具栏配置为 false 时的渲染问题 当 toolbar 和 toolbarRight 都为 false/空数组时,隐藏顶部工具栏 DOM; 统一将非数组的工具栏配置归一化为空数组 * feat(examples): add toolbar toggle demo * refactor(cherry): 优化工具栏渲染与清理逻辑 * fix(cherry): 修复工具栏配置为 false 时的渲染问题 * fix(cherry): 修复工具栏显式禁用时意外显示的问题 * refactor(ui): 统一管理工具栏状态和样式 * fix: 修复工具栏CSS类与DOM状态不同步的问题 * refactor(core): 简化工具栏显隐逻辑 * fix(examples): 更新测试断言以匹配 shouldHide 逻辑 * fix(toolbar): 隐藏顶部工具栏 * fix: 重构工具栏逻辑,显隐逻辑收纳到事件的回调里 --------- Co-authored-by: sunsonliu(刘阳) <sunsonliu@tencent.com>
当
toolbar和toolbarRight都为false时,则隐藏顶部工具栏。toolbartoolbarRightshowToolbardefaultModeltoolbarUserDisabledshouldHideToolbar()['bold',...][]trueedit&preview['bold',...]['theme']trueedit&preview[]['theme']trueedit&preview[][]trueedit&preview['bold',...][]falseedit&previewfalse[]trueedit&previewfalse['theme']trueedit&previewfalsefalsetrueedit&preview['bold',...]falsetrueedit&preview['bold',...][]trueeditOnly['bold',...][]falseeditOnly['bold',...][]previewOnlyfalsefalsepreviewOnly[][]previewOnly