raven-pensieve_obsidian-ace.../styles/SnippetsEditorView.css
RavenHogWarts a095d31176
refactor: 优化解决自动审查 (#112)
* refactor: 移除未使用的依赖项

移除项目中未使用的依赖项,包括 dotenv、
builtin-modules、fs-extra、jsonfile 和
universalify。这些依赖项不再被代码使用,
移除它们可以减少项目体积并简化依赖管理。

* refactor: 迁移 ESLint 配置到新版本

将 ESLint 配置迁移到最新的扁平化配置格式,
使用 defineConfig 和 globalIgnores 简化配置
结构。更新 TypeScript 解析器为 typescript-eslint
包,提取 Obsidian 全局变量为常量以提高可维护
性。调整测试环境从 Jest 改为 Mocha,并添加
React 全局变量支持。

* feat: 添加编辑器样式和调整大小光标

添加隐藏的字体测试元素样式用于测量字体
尺寸。添加调整大小状态样式以在拖动时显示
正确的光标和禁用文本选择。这些样式改进
了编辑器的用户交互体验。

* feat: 使用全局对象调用计时和动画函数

将所有 setTimeout、requestAnimationFrame 和
document.createElement 调用改为使用全局对象
(window 或 activeDocument) 来调用。这样做是为了
提高代码的可测试性和兼容性,使得在测试环境中能够
更容易地 mock 这些全局函数,同时确保在不同的执行
上下文中都能正确地访问这些 API。

* feat: 使用 activeDocument 替换全局 document

将所有全局 document 引用替换为 activeDocument,以支持
多文档环境。这包括事件监听器、DOM 操作和样式管理。

主要改动:
- Minimap 和 useResize 中的事件监听使用 activeDocument
- 将 useResize 中的内联样式改为 CSS 类名管理
- isFontAvailable 函数改用 Canvas API 替代 DOM 测试
- AceService 和 Select 组件中的 DOM 查询使用
  activeDocument
- 使用 window.requestAnimationFrame 替代全局引用

这些改动提高了代码的可移植性和多文档支持能力。

* feat: 更新设置视图的显示文本

修改 SettingsView 组件中 getDisplayText 方法返回的
文本内容,将显示文本从 "ACE SettingTab" 更新为
"Ace settingtab",以保持与应用命名规范的一致性。

* style: 修复代码格式和样式问题

修复多个文件中的代码格式问题,包括函数参数和
依赖数组末尾的逗号缺失。优化 CSS 选择器特异性
以确保 Ace 搜索框样式正确应用,并移除不必要的
!important 声明。这些改动提高了代码的一致性
和可维护性。

* feat: 移除 ace-builds esm-resolver 导入

移除了 ace-builds 的 esm-resolver 导入语句,因为该模块
在当前环境中不需要自动处理模块路径。同时简化了
AceService 构造函数,移除了不必要的注释说明。这些
改动使代码更加简洁,减少了不必要的依赖。
2026-05-20 00:36:28 +08:00

94 lines
1.5 KiB
CSS

.ace-snippets-editor {
display: flex;
padding: 0;
}
body.ace-is-resizing,
body.ace-is-resizing * {
cursor: col-resize;
user-select: none;
}
.ace-snippets-split-container {
display: flex;
flex: 1;
height: 100%;
}
.ace-snippets-left-panel {
display: flex;
flex-direction: column;
background-color: var(--background-secondary);
&.is-collapsed {
display: none;
}
}
.ace-snippets-resize-handle {
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 4px;
z-index: 10;
background-color: transparent;
cursor: col-resize;
transition: background-color 0.1s ease;
/* Visual separator */
border-left: 1px solid var(--background-modifier-border);
}
.ace-snippets-resize-handle:hover,
.ace-snippets-resize-handle.is-resizing {
background-color: var(--interactive-accent);
}
.ace-snippets-right-panel {
flex: 1;
position: relative;
background-color: var(--background-primary);
display: flex;
flex-direction: column;
}
.ace-snippets-navigation {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.animate-spin {
animation: spin 1s linear infinite;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.nav-file-title {
display: flex;
gap: 4px;
align-items: center;
}
.nav-file-title-icon {
display: flex;
}
}
.ace-snippets-empty-state {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: var(--text-muted);
font-size: 1.1em;
gap: 16px;
height: 100%;
}