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:
@@ -58,8 +58,25 @@ export function registerPackHandlers(
|
||||
})
|
||||
)
|
||||
|
||||
ipcMain.handle(IPC.PACK_PICK_FILE, (_e, { mode }: { mode: 'novel' | 'novel-all' | 'save-novel' | 'save-all' }) =>
|
||||
ipcMain.handle(IPC.PACK_PICK_FILE, (_e, { mode }: { mode: 'novel' | 'novel-all' | 'save-novel' | 'save-all' | 'import' }) =>
|
||||
wrap(async () => {
|
||||
if (process.env.BILIN_E2E === '1') {
|
||||
if (
|
||||
(mode === 'save-novel' || mode === 'save-all') &&
|
||||
process.env.BILIN_E2E_PACK_SAVE
|
||||
) {
|
||||
return process.env.BILIN_E2E_PACK_SAVE
|
||||
}
|
||||
if (
|
||||
(mode === 'import' || mode === 'novel' || mode === 'novel-all') &&
|
||||
process.env.BILIN_E2E_PACK_IMPORT_FILE
|
||||
) {
|
||||
return process.env.BILIN_E2E_PACK_IMPORT_FILE
|
||||
}
|
||||
if (mode === 'import' && process.env.BILIN_E2E_IMPORT_FILE) {
|
||||
return process.env.BILIN_E2E_IMPORT_FILE
|
||||
}
|
||||
}
|
||||
if (mode === 'save-novel' || mode === 'save-all') {
|
||||
const ext = mode === 'save-all' ? 'novel-all' : 'novel'
|
||||
const { canceled, filePath } = await dialog.showSaveDialog({
|
||||
@@ -69,7 +86,12 @@ export function registerPackHandlers(
|
||||
if (canceled || !filePath) return null
|
||||
return filePath
|
||||
}
|
||||
const extensions = mode === 'novel-all' ? ['novel-all'] : ['novel', 'novel-all']
|
||||
const extensions =
|
||||
mode === 'import'
|
||||
? ['txt', 'md', 'docx', 'novel', 'novel-all']
|
||||
: mode === 'novel-all'
|
||||
? ['novel-all']
|
||||
: ['novel', 'novel-all']
|
||||
const { canceled, filePaths } = await dialog.showOpenDialog({
|
||||
properties: ['openFile'],
|
||||
filters: [{ name: 'Bilin Pack', extensions }]
|
||||
|
||||
Reference in New Issue
Block a user