Draft
Conversation
|
Collaborator
【预览链接】
|
commit: |
**/min.js
Contributor
|
Size Change: -1.61 MB (-21.54%) 🎉 Total Size: 5.86 MB
ℹ️ View Unchanged
|
dd5ecbe to
aa9b262
Compare
Collaborator
Author
所有
|
| 行号 | 代码位置 | 保护机制 | 状态 |
|---|---|---|---|
| 165 | $hasEditor() 内部 |
&& 短路保护 |
✅ 安全 |
| 258-280 | $dealCheckboxClick |
入口 $hasEditor() 检查 |
✅ 安全 |
| 320 | drawio 回调 | 入口 $hasEditor() 检查 |
✅ 安全 |
| 618 | $showTablePreviewerBubbles |
调用处已检查 | ✅ 安全 |
| 641 | showCodeBlockPreviewerBubbles |
三元判断 ? : null |
✅ 安全 |
| 720-741 | beginChangeDrawioImg |
入口 $hasEditor() 检查 |
✅ 安全 |
| 766-794 | beginChangeImgValue |
入口 $hasEditor() 检查 |
✅ 安全 |
| 876 | changeImgValue |
入口 $hasEditor() 检查 |
✅ 安全 |
入口保护矩阵
| 功能 | 触发方式 | 入口位置 | 保护机制 | 原有模式 | 流式模式 |
|---|---|---|---|---|---|
| 表格 hover | mouseover | $onMouseOver → $isEnableBubbleAndEditorShow() |
双重检查 | ✅ 正常 | ❌ 跳过 |
| 表格 click | click | $onClick → $hasEditor() |
显式检查 | ✅ 正常 | ❌ 跳过 |
| 列表 click | click | $onClick → $hasEditor() |
显式检查 | ✅ 正常 | ❌ 跳过 |
| checkbox click | click | $dealCheckboxClick → $hasEditor() |
显式检查 | ✅ 正常 | ❌ 跳过 |
| drawio 编辑 | click | $onClick → $hasEditor() |
显式检查 | ✅ 正常 | ❌ 跳过 |
| 图片编辑 | click | $onClick → $hasEditor() |
显式检查 | ✅ 正常 | ❌ 跳过 |
| 代码块 hover | mouseover | showCodeBlockPreviewerBubbles |
传递 null,方法内检查 | ✅ 完整功能 | ✅ 只读功能 |
| 公式操作 | click/hover | $showFormulaPreviewerBubbles |
改用 $cherry |
✅ 正常 | ✅ 正常 |
流式模式功能矩阵
| 功能类别 | 具体功能 | 流式模式可用性 | 说明 |
|---|---|---|---|
| 代码块 | 复制代码 | ✅ 可用 | 不依赖 editor |
| 展开/收起 | ✅ 可用 | 不依赖 editor | |
| 自定义按钮 | ✅ 可用 | 不依赖 editor | |
| 修改语言 | ❌ 隐藏 | 需要 editor | |
| 编辑代码 | ❌ 隐藏 | 需要 editor | |
| 公式 | 输出图片 (svg/png/jpg) | ✅ 可用 | 不依赖 editor |
| 输出 HTML/svgcode | ✅ 可用 | 不依赖 editor | |
| 复制 latex | ✅ 可用 | 从 DOM data-content 属性获取 |
|
| 输出 mathml | ✅ 可用 | 通过 $cherry.engine 获取 MathJax hook |
|
| 表格 | 全部功能 | ❌ 不可用 | 强依赖 editor |
| 列表 | 全部功能 | ❌ 不可用 | 强依赖 editor |
| 图片 | 编辑/调整 | ❌ 不可用 | 强依赖 editor |
| drawio | 编辑 | ❌ 不可用 | 强依赖 editor |
| checkbox | 点击切换 | ❌ 不可用 | 强依赖 editor |
Collaborator
Author
|
用户想复制修正后的功能对比表。让我把表格整理得更清晰,方便用户复制。 修正后的功能对比表
|
8f3596b to
758d217
Compare
48b597b to
c618edf
Compare
**/min.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.11.0-alpha-2
主要修改内容包括:
构建相关修改(这部分是核心):
packages/cherry-markdown/build/addons.build.cjs- 删除文件packages/cherry-markdown/build/addons.build.js- 修改packages/cherry-markdown/build/build.js- 修改packages/cherry-markdown/build/replacePaths.cjs- 删除文件packages/cherry-markdown/build/replacePaths.js- 修改packages/cherry-markdown/build/rollup.base.config.js- 修改packages/cherry-markdown/build/rollup.core.config.js- 修改packages/cherry-markdown/build/rollup.engine.config.js- 修改packages/cherry-markdown/build/rollup.stream.config.js- 修改示例文件修改:
examples/h5.html- 修改导入顺序examples/img.html- 修改导入顺序examples/index.html- 修改examples/multiple.html- 修改examples/notoolbar.html- 修改examples/preview_only.html- 修改核心源代码和依赖处理:
packages/cherry-markdown/src/Previewer.js- 新增一行packages/cherry-markdown/src/core/hooks/Suggester.js- 功能扩展packages/cherry-markdown/src/index.stream.core.js- 删除文件packages/cherry-markdown/src/index.stream.js- 简化版本packages/cherry-markdown/src/utils/codeBlockContentHandler.js- 优化加载机制这些调整主要集中在构建流程、依赖管理和模块化优化,目的是提升项目整体性能和可维护性。代码处理更加动态和灵活,减少了不必要的依赖和冗余代码。
我来分析一下当前分支相对于
dev分支的修改内容及其影响。📊 修改统计
🔧 主要修改内容
1️⃣ 构建系统优化(核心改动)
删除冗余的 CommonJS 配置文件:
addons.build.cjsreplacePaths.cjs.js)简化 rollup 配置:
rollup.base.config.js、rollup.core.config.js等配置文件2️⃣ 代码模块化优化
CodeMirror 动态导入:
移除冗余文件:
src/index.stream.core.js(合并到其他文件)mermaidAPI.8.5.2.js3️⃣ 示例文件调整
4️⃣ 其他改进
.eslintignore规则更精准Previewer.js)