feat(w2): ship v1.3.0 project pack UI, preload, and E2E

Wire .novel/.novel-all export-import through modals, settings backup, and home bulk export with progress IPC.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-08 16:31:16 +08:00
parent a4412793f4
commit fe6e411d2c
19 changed files with 823 additions and 131 deletions
+13
View File
@@ -59,6 +59,7 @@ import type {
ImportExecuteParams,
ImportSplitMode
} from './types'
import type { PackImportStrategy, PackImportReport, PackProgressEvent } from './novel-pack'
export interface ElectronAPI {
window: {
@@ -445,6 +446,17 @@ export interface ElectronAPI {
copyClipboard: (text: string) => Promise<IpcResult<void>>
saveTxt: (text: string, defaultName: string) => Promise<IpcResult<string | null>>
}
pack: {
pickFile: (
mode: 'novel' | 'novel-all' | 'save-novel' | 'save-all' | 'import'
) => Promise<IpcResult<string | null>>
exportBook: (bookId: string, destPath: string) => Promise<IpcResult<void>>
importBook: (filePath: string) => Promise<IpcResult<string>>
exportAll: (destPath: string) => Promise<IpcResult<void>>
importAll: (filePath: string, strategy: PackImportStrategy) => Promise<IpcResult<PackImportReport>>
estimateExportAll: () => Promise<IpcResult<{ bytes: number; needsConfirm: boolean }>>
cancel: () => Promise<IpcResult<void>>
}
bridge: {
get: (
bookId: string,
@@ -471,6 +483,7 @@ export interface ElectronAPI {
onPomodoroTick: (callback: (state: PomodoroState) => void) => () => void
onGoalNotification: (callback: (payload: GoalNotificationPayload) => void) => () => void
onImportProgress: (callback: (payload: { current: number; total: number }) => void) => () => void
onPackProgress: (callback: (payload: PackProgressEvent) => void) => () => void
}
declare global {