feat(editor): 添加撤销重做功能

实现完整的撤销重做功能,包括:
1. 添加工具栏撤销/重做按钮及快捷键支持
2. 实现状态保存与恢复机制
3. 添加状态变化检测与历史记录管理
4. 更新相关UI交互以触发状态保存
This commit is contained in:
Zhukj
2026-04-22 14:08:42 +08:00
parent e46805deca
commit 1983c15fb9
3 changed files with 428 additions and 0 deletions

View File

@@ -62,6 +62,43 @@ html, body {
background: #3a7bc8;
}
/* 工具栏垂直分隔线 */
.toolbar-divider-v {
width: 1px;
height: 24px;
background: #ddd;
margin: 0 4px;
}
/* 工具栏图标按钮 */
.toolbar-btn-icon {
width: 32px;
height: 32px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 6px;
background: #fff;
color: #333;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
}
.toolbar-btn-icon:hover {
background: #f5f5f5;
}
.toolbar-btn-icon:active {
background: #e8e8e8;
}
.toolbar-btn-icon:disabled {
opacity: 0.4;
cursor: not-allowed;
}
/* 文本输入框删除按钮 */
.text-input .text-delete-btn {
position: absolute;