pake-cli 3.2.17 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,17 +18,17 @@ crate-type = ["staticlib", "cdylib", "lib"]
18
18
  tauri-build = { version = "2.4.0", features = [] }
19
19
 
20
20
  [dependencies]
21
- serde_json = "1.0.142"
21
+ serde_json = "1.0.143"
22
22
  serde = { version = "1.0.219", features = ["derive"] }
23
23
  tokio = { version = "1.47.1", features = ["full"] }
24
- tauri = { version = "2.8.0", features = ["tray-icon", "image-ico", "image-png", "macos-proxy"] }
24
+ tauri = { version = "2.8.4", features = ["tray-icon", "image-ico", "image-png", "macos-proxy"] }
25
25
  tauri-plugin-window-state = "2.4.0"
26
26
  tauri-plugin-oauth = "2.0.0"
27
- tauri-plugin-http = "2.5.1"
27
+ tauri-plugin-http = "2.5.2"
28
28
  tauri-plugin-global-shortcut = { version = "2.3.0" }
29
- tauri-plugin-shell = "2.3.0"
30
- tauri-plugin-single-instance = "2.3.2"
31
- tauri-plugin-notification = "2.3.0"
29
+ tauri-plugin-shell = "2.3.1"
30
+ tauri-plugin-single-instance = "2.3.3"
31
+ tauri-plugin-notification = "2.3.1"
32
32
 
33
33
  [features]
34
34
  # this feature is used for development builds from development cli
@@ -13,13 +13,15 @@
13
13
  "activation_shortcut": "",
14
14
  "disabled_web_shortcuts": false,
15
15
  "hide_on_close": true,
16
- "incognito": false
16
+ "incognito": false,
17
+ "enable_wasm": false,
18
+ "enable_drag_drop": false
17
19
  }
18
20
  ],
19
21
  "user_agent": {
20
- "macos": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15",
21
- "linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
22
- "windows": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
22
+ "macos": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15",
23
+ "linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
24
+ "windows": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
23
25
  },
24
26
  "system_tray": {
25
27
  "macos": false,
@@ -17,6 +17,7 @@ pub struct WindowConfig {
17
17
  pub incognito: bool,
18
18
  pub title: Option<String>,
19
19
  pub enable_wasm: bool,
20
+ pub enable_drag_drop: bool,
20
21
  }
21
22
 
22
23
  #[derive(Debug, Serialize, Deserialize)]
@@ -38,22 +38,25 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) ->
38
38
  .fullscreen(window_config.fullscreen)
39
39
  .inner_size(window_config.width, window_config.height)
40
40
  .always_on_top(window_config.always_on_top)
41
- .disable_drag_drop_handler()
42
- .incognito(window_config.incognito)
41
+ .incognito(window_config.incognito);
42
+
43
+ if !window_config.enable_drag_drop {
44
+ window_builder = window_builder.disable_drag_drop_handler();
45
+ }
46
+
47
+ window_builder = window_builder
43
48
  .initialization_script(&config_script)
44
49
  .initialization_script(include_str!("../inject/component.js"))
45
50
  .initialization_script(include_str!("../inject/event.js"))
46
51
  .initialization_script(include_str!("../inject/style.js"))
47
52
  .initialization_script(include_str!("../inject/custom.js"));
48
53
 
49
- // Configure WASM support with required headers for SharedArrayBuffer
50
54
  if window_config.enable_wasm {
51
55
  window_builder = window_builder
52
56
  .additional_browser_args("--enable-features=SharedArrayBuffer")
53
57
  .additional_browser_args("--enable-unsafe-webgpu");
54
58
  }
55
59
 
56
- // Configure proxy if specified
57
60
  if !config.proxy_url.is_empty() {
58
61
  if let Ok(proxy_url) = Url::from_str(&config.proxy_url) {
59
62
  window_builder = window_builder.proxy_url(proxy_url);
@@ -80,10 +83,9 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) ->
80
83
  {
81
84
  window_builder = window_builder
82
85
  .data_directory(_data_dir)
83
- .title(app.package_info().name.clone());
86
+ .title(app.package_info().name.clone())
87
+ .additional_browser_args("--disable-blink-features=AutomationControlled");
84
88
 
85
- // Set theme to None for automatic system theme detection on Windows
86
- // This allows the window to respond to system theme changes automatically
87
89
  window_builder = window_builder.theme(None);
88
90
  }
89
91
 
@@ -91,10 +93,9 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) ->
91
93
  {
92
94
  window_builder = window_builder
93
95
  .data_directory(_data_dir)
94
- .title(app.package_info().name.clone());
96
+ .title(app.package_info().name.clone())
97
+ .additional_browser_args("--disable-blink-features=AutomationControlled");
95
98
 
96
- // Set theme to None for automatic system theme detection on Linux
97
- // This allows the window to respond to system theme changes automatically
98
99
  window_builder = window_builder.theme(None);
99
100
  }
100
101
 
@@ -41,7 +41,13 @@ pub fn run_app() {
41
41
  .plugin(tauri_plugin_http::init())
42
42
  .plugin(tauri_plugin_shell::init())
43
43
  .plugin(tauri_plugin_notification::init())
44
- .plugin(tauri_plugin_single_instance::init(|_, _, _| ()))
44
+ .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
45
+ if let Some(window) = app.get_webview_window("pake") {
46
+ let _ = window.unminimize();
47
+ let _ = window.show();
48
+ let _ = window.set_focus();
49
+ }
50
+ }))
45
51
  .invoke_handler(tauri::generate_handler![
46
52
  download_file,
47
53
  download_file_by_binary,
@@ -64,6 +70,7 @@ pub fn run_app() {
64
70
  .on_window_event(move |_window, _event| {
65
71
  if let tauri::WindowEvent::CloseRequested { api, .. } = _event {
66
72
  if hide_on_close {
73
+ // Hide window when hide_on_close is enabled (regardless of tray status)
67
74
  let window = _window.clone();
68
75
  tauri::async_runtime::spawn(async move {
69
76
  #[cfg(target_os = "macos")]
@@ -77,8 +84,10 @@ pub fn run_app() {
77
84
  window.hide().unwrap();
78
85
  });
79
86
  api.prevent_close();
87
+ } else {
88
+ // Exit app completely when hide_on_close is false
89
+ std::process::exit(0);
80
90
  }
81
- // If hide_on_close is false, allow normal close behavior
82
91
  }
83
92
  })
84
93
  .run(tauri::generate_context!())