feat(w5): ship v2.0.0 platform sync, undo persistence, and updates

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-08 18:24:51 +08:00
parent cb6b4c3731
commit fe421ffc55
60 changed files with 2207 additions and 36 deletions
+20
View File
@@ -0,0 +1,20 @@
import type { UndoOperation, UndoStackEntry } from '../../shared/undo'
import { UndoStackRepository } from '../db/repositories/undo.repo'
import type { SqliteDb } from '../db/types'
export class UndoStackService {
constructor(private db: SqliteDb) {}
push(chapterId: string, operation: UndoOperation): UndoStackEntry {
return new UndoStackRepository(this.db).push(chapterId, operation)
}
list(chapterId: string): UndoStackEntry[] {
return new UndoStackRepository(this.db).list(chapterId)
}
apply(entryId: number): UndoOperation | null {
const entry = new UndoStackRepository(this.db).get(entryId)
return entry?.operation ?? null
}
}