Support drag-and-drop configuration

This commit is contained in:
Tw93
2025-08-31 15:29:28 +08:00
parent c68daf6ed6
commit bd764f5f5f
9 changed files with 54 additions and 6 deletions

9
dist/cli.js vendored
View File

@@ -348,10 +348,10 @@ async function mergeConfig(url, options, tauriConf) {
await fsExtra.copy(sourcePath, destPath);
}
}));
const { width, height, fullscreen, hideTitleBar, alwaysOnTop, appVersion, darkMode, disabledWebShortcuts, activationShortcut, userAgent, showSystemTray, systemTrayIcon, useLocalFile, identifier, name, resizable = true, inject, proxyUrl, installerLanguage, hideOnClose, incognito, title, wasm, } = options;
const { width, height, fullscreen, hideTitleBar, alwaysOnTop, appVersion, darkMode, disabledWebShortcuts, activationShortcut, userAgent, showSystemTray, systemTrayIcon, useLocalFile, identifier, name, resizable = true, inject, proxyUrl, installerLanguage, hideOnClose, incognito, title, wasm, enableDragDrop, } = options;
const { platform } = process;
// Platform-specific hide_on_close behavior: macOS keeps true, others default to false
const platformHideOnClose = hideOnClose ?? (platform === 'darwin');
const platformHideOnClose = hideOnClose ?? platform === 'darwin';
// Set Windows parameters.
const tauriConfWindowOptions = {
width,
@@ -367,6 +367,7 @@ async function mergeConfig(url, options, tauriConf) {
incognito: incognito,
title: title || null,
enable_wasm: wasm,
enable_drag_drop: enableDragDrop,
};
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
tauriConf.productName = name;
@@ -1062,6 +1063,7 @@ const DEFAULT_PAKE_OPTIONS = {
hideOnClose: undefined, // Platform-specific: true for macOS, false for others
incognito: false,
wasm: false,
enableDragDrop: false,
};
async function checkUpdateTips() {
@@ -1516,6 +1518,9 @@ program
.addOption(new Option('--wasm', 'Enable WebAssembly support (Flutter Web, etc.)')
.default(DEFAULT_PAKE_OPTIONS.wasm)
.hideHelp())
.addOption(new Option('--enable-drag-drop', 'Enable drag and drop functionality')
.default(DEFAULT_PAKE_OPTIONS.enableDragDrop)
.hideHelp())
.addOption(new Option('--installer-language <string>', 'Installer language')
.default(DEFAULT_PAKE_OPTIONS.installerLanguage)
.hideHelp())