pake-cli 3.1.1 → 3.2.0-beta

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.
Files changed (82) hide show
  1. package/README.md +82 -25
  2. package/dist/cli.js +145 -81
  3. package/dist/dev.js +39 -20
  4. package/dist/dev.js.map +1 -1
  5. package/package.json +15 -17
  6. package/src-tauri/.cargo/config.toml +5 -0
  7. package/src-tauri/Cargo.lock +1337 -1111
  8. package/src-tauri/Cargo.toml +12 -12
  9. package/src-tauri/assets/{com-tw93-weread.desktop → com-tw93-weekly.desktop} +4 -4
  10. package/src-tauri/gen/schemas/acl-manifests.json +1 -1
  11. package/src-tauri/gen/schemas/desktop-schema.json +906 -421
  12. package/src-tauri/gen/schemas/macOS-schema.json +906 -421
  13. package/src-tauri/icons/deepseek.icns +0 -0
  14. package/src-tauri/icons/grok.icns +0 -0
  15. package/src-tauri/icons/weekly.icns +0 -0
  16. package/src-tauri/pake.json +3 -2
  17. package/src-tauri/png/chatgpt_256.ico +0 -0
  18. package/src-tauri/png/chatgpt_32.ico +0 -0
  19. package/src-tauri/png/chatgpt_512.png +0 -0
  20. package/src-tauri/png/deepseek_256.ico +0 -0
  21. package/src-tauri/png/deepseek_32.ico +0 -0
  22. package/src-tauri/png/deepseek_512.png +0 -0
  23. package/src-tauri/png/excalidraw_256.ico +0 -0
  24. package/src-tauri/png/excalidraw_32.ico +0 -0
  25. package/src-tauri/png/excalidraw_512.png +0 -0
  26. package/src-tauri/png/flomo_256.ico +0 -0
  27. package/src-tauri/png/flomo_32.ico +0 -0
  28. package/src-tauri/png/flomo_512.png +0 -0
  29. package/src-tauri/png/gemini_256.ico +0 -0
  30. package/src-tauri/png/gemini_32.ico +0 -0
  31. package/src-tauri/png/gemini_512.png +0 -0
  32. package/src-tauri/png/grok_256.ico +0 -0
  33. package/src-tauri/png/grok_32.ico +0 -0
  34. package/src-tauri/png/grok_512.png +0 -0
  35. package/src-tauri/png/icon_256.ico +0 -0
  36. package/src-tauri/png/icon_32.ico +0 -0
  37. package/src-tauri/png/icon_512.png +0 -0
  38. package/src-tauri/png/lizhi_256.ico +0 -0
  39. package/src-tauri/png/lizhi_32.ico +0 -0
  40. package/src-tauri/png/lizhi_512.png +0 -0
  41. package/src-tauri/png/programmusic_256.ico +0 -0
  42. package/src-tauri/png/programmusic_32.ico +0 -0
  43. package/src-tauri/png/programmusic_512.png +0 -0
  44. package/src-tauri/png/qwerty_256.ico +0 -0
  45. package/src-tauri/png/qwerty_32.ico +0 -0
  46. package/src-tauri/png/qwerty_512.png +0 -0
  47. package/src-tauri/png/twitter_256.ico +0 -0
  48. package/src-tauri/png/twitter_32.ico +0 -0
  49. package/src-tauri/png/twitter_512.png +0 -0
  50. package/src-tauri/png/wechat_256.ico +0 -0
  51. package/src-tauri/png/wechat_32.ico +0 -0
  52. package/src-tauri/png/wechat_512.png +0 -0
  53. package/src-tauri/png/weekly_256.ico +0 -0
  54. package/src-tauri/png/weekly_32.ico +0 -0
  55. package/src-tauri/png/weekly_512.png +0 -0
  56. package/src-tauri/png/weread_256.ico +0 -0
  57. package/src-tauri/png/weread_32.ico +0 -0
  58. package/src-tauri/png/weread_512.png +0 -0
  59. package/src-tauri/png/xiaohongshu_256.ico +0 -0
  60. package/src-tauri/png/xiaohongshu_32.ico +0 -0
  61. package/src-tauri/png/xiaohongshu_512.png +0 -0
  62. package/src-tauri/png/youtube_256.ico +0 -0
  63. package/src-tauri/png/youtube_32.ico +0 -0
  64. package/src-tauri/png/youtube_512.png +0 -0
  65. package/src-tauri/png/youtubemusic_256.ico +0 -0
  66. package/src-tauri/png/youtubemusic_32.ico +0 -0
  67. package/src-tauri/png/youtubemusic_512.png +0 -0
  68. package/src-tauri/src/app/config.rs +1 -0
  69. package/src-tauri/src/app/setup.rs +3 -1
  70. package/src-tauri/src/app/window.rs +25 -3
  71. package/src-tauri/src/inject/component.js +6 -5
  72. package/src-tauri/src/inject/event.js +143 -62
  73. package/src-tauri/src/inject/style.js +29 -8
  74. package/src-tauri/src/lib.rs +18 -12
  75. package/src-tauri/src/util.rs +4 -4
  76. package/src-tauri/tauri.conf.json +3 -3
  77. package/src-tauri/tauri.linux.conf.json +4 -2
  78. package/src-tauri/tauri.macos.conf.json +1 -1
  79. package/src-tauri/tauri.windows.conf.json +2 -2
  80. package/src-tauri/.pake/pake.json +0 -30
  81. package/src-tauri/.pake/tauri.conf.json +0 -24
  82. package/src-tauri/.pake/tauri.macos.conf.json +0 -15
@@ -1,4 +1,4 @@
1
- window.addEventListener('DOMContentLoaded', _event => {
1
+ window.addEventListener("DOMContentLoaded", (_event) => {
2
2
  // Customize and transform existing functions
3
3
  const contentCSS = `
4
4
  #page #footer-wrapper,
@@ -21,7 +21,8 @@ window.addEventListener('DOMContentLoaded', _event => {
21
21
  #Rightbar > div:nth-child(6) > div.sidebar_compliance,
22
22
  #__next > div.PageWithSidebarLayout_centeringDiv___L9br > aside > div > div > a.ChatPageFollowTwitterLink_followLink__Gl2tt,
23
23
  #__next > div.PageWithSidebarLayout_centeringDiv___L9br > aside > div > div > a.Button_buttonBase__0QP_m.Button_primary__pIDjn.ChatPageDownloadLinks_downloadButton__amBRh,
24
- #__next > div.PageWithSidebarLayout_centeringDiv___L9br > aside > div > div > section a[href*="/contact"] {
24
+ #__next > div.PageWithSidebarLayout_centeringDiv___L9br > aside > div > div > section a[href*="/contact"],
25
+ .dc04ec1d .c7f51894 .a1e75851, .a7f3a288 .b91228e4, .efe408db .a24007f4{
25
26
  display: none !important;
26
27
  }
27
28
 
@@ -60,6 +61,14 @@ window.addEventListener('DOMContentLoaded', _event => {
60
61
  margin-left: 10px;
61
62
  }
62
63
 
64
+ .a7f3a288.f0d4f23d {
65
+ padding-top: 34px;
66
+ }
67
+
68
+ .ec92d1d3 {
69
+ padding-top: 48px;
70
+ }
71
+
63
72
  .chakra-ui-light #app .chakra-heading,
64
73
  .chakra-ui-dark #app .chakra-heading,
65
74
  .chakra-ui-light #app .chakra-stack,
@@ -275,8 +284,16 @@ window.addEventListener('DOMContentLoaded', _event => {
275
284
  margin: 0;
276
285
  display: inline;
277
286
  }
287
+
288
+ .AppHeader .AppHeader-globalBar.js-global-bar {
289
+ padding-top: 35px;
290
+ }
291
+
292
+ .header-overlay .header-logged-out {
293
+ margin-top: 15px;
294
+ }
278
295
  `;
279
- const contentStyleElement = document.createElement('style');
296
+ const contentStyleElement = document.createElement("style");
280
297
  contentStyleElement.innerHTML = contentCSS;
281
298
  document.head.appendChild(contentStyleElement);
282
299
 
@@ -300,7 +317,7 @@ window.addEventListener('DOMContentLoaded', _event => {
300
317
  }
301
318
 
302
319
  #root > .excalidraw-app> .excalidraw-container .App-menu.App-menu_top{
303
- margin-top: 15px;
320
+ margin-top: 15px;
304
321
  }
305
322
 
306
323
  .geist-page nav.dashboard_nav__PRmJv,
@@ -339,8 +356,12 @@ window.addEventListener('DOMContentLoaded', _event => {
339
356
  padding-top: 20px;
340
357
  }
341
358
 
359
+ .h-dvh.flex-grow .bg-gradient-to-b.from-background.via-background {
360
+ padding-top: 40px;
361
+ }
362
+
342
363
  body > div.relative.flex.h-full.w-full.overflow-hidden.transition-colors.z-0 > div.z-\\[21\\].flex-shrink-0.overflow-x-hidden.bg-token-sidebar-surface-primary.max-md\\:\\!w-0 > div > div > div > nav > div.flex.justify-between.h-\\[60px\\].items-center.md\\:h-header-height {
343
- padding-top: 25px;
364
+ padding-top: 25px;
344
365
  }
345
366
 
346
367
  body > div.relative.flex.h-full.w-full.overflow-hidden.transition-colors.z-0 > div.relative.flex.h-full.max-w-full.flex-1.flex-col.overflow-hidden > main > div.composer-parent.flex.h-full.flex-col.focus-visible\\:outline-0 > div.flex-1.overflow-hidden.\\@container\\/thread > div > div.absolute.left-0.right-0 > div{
@@ -436,9 +457,9 @@ window.addEventListener('DOMContentLoaded', _event => {
436
457
  }
437
458
  }
438
459
  `;
439
- const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
440
- if (window['pakeConfig']?.hide_title_bar && isMac) {
441
- const topPaddingStyleElement = document.createElement('style');
460
+ const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0;
461
+ if (window["pakeConfig"]?.hide_title_bar && isMac) {
462
+ const topPaddingStyleElement = document.createElement("style");
442
463
  topPaddingStyleElement.innerHTML = topPaddingCSS;
443
464
  document.head.appendChild(topPaddingStyleElement);
444
465
  }
@@ -21,6 +21,7 @@ pub fn run_app() {
21
21
  let tauri_app = tauri::Builder::default();
22
22
 
23
23
  let show_system_tray = pake_config.show_system_tray();
24
+ let hide_on_close = pake_config.windows[0].hide_on_close;
24
25
  let activation_shortcut = pake_config.windows[0].activation_shortcut.clone();
25
26
  let init_fullscreen = pake_config.windows[0].fullscreen;
26
27
 
@@ -54,19 +55,24 @@ pub fn run_app() {
54
55
  window.show().unwrap();
55
56
  Ok(())
56
57
  })
57
- .on_window_event(|_window, _event| {
58
- #[cfg(target_os = "macos")]
58
+ .on_window_event(move |_window, _event| {
59
59
  if let tauri::WindowEvent::CloseRequested { api, .. } = _event {
60
- let window = _window.clone();
61
- tauri::async_runtime::spawn(async move {
62
- if window.is_fullscreen().unwrap_or(false) {
63
- window.set_fullscreen(false).unwrap();
64
- tokio::time::sleep(Duration::from_millis(900)).await;
65
- }
66
- window.minimize().unwrap();
67
- window.hide().unwrap();
68
- });
69
- api.prevent_close();
60
+ if hide_on_close {
61
+ let window = _window.clone();
62
+ tauri::async_runtime::spawn(async move {
63
+ #[cfg(target_os = "macos")]
64
+ {
65
+ if window.is_fullscreen().unwrap_or(false) {
66
+ window.set_fullscreen(false).unwrap();
67
+ tokio::time::sleep(Duration::from_millis(900)).await;
68
+ }
69
+ }
70
+ window.minimize().unwrap();
71
+ window.hide().unwrap();
72
+ });
73
+ api.prevent_close();
74
+ }
75
+ // If hide_on_close is false, allow normal close behavior
70
76
  }
71
77
  })
72
78
  .run(tauri::generate_context!())
@@ -40,7 +40,7 @@ pub fn get_data_dir(app: &AppHandle, package_name: String) -> PathBuf {
40
40
  }
41
41
 
42
42
  pub fn show_toast(window: &WebviewWindow, message: &str) {
43
- let script = format!(r#"pakeToast("{}");"#, message);
43
+ let script = format!(r#"pakeToast("{message}");"#);
44
44
  window.eval(&script).unwrap();
45
45
  }
46
46
 
@@ -98,15 +98,15 @@ pub fn check_file_or_append(file_path: &str) -> String {
98
98
  Some(index) if file_stem[index + 1..].parse::<u32>().is_ok() => {
99
99
  let base_name = &file_stem[..index];
100
100
  counter = file_stem[index + 1..].parse::<u32>().unwrap() + 1;
101
- format!("{}-{}", base_name, counter)
101
+ format!("{base_name}-{counter}")
102
102
  }
103
103
  _ => {
104
104
  counter += 1;
105
- format!("{}-{}", file_stem, counter)
105
+ format!("{file_stem}-{counter}")
106
106
  }
107
107
  };
108
108
 
109
- new_path = parent_dir.join(format!("{}.{}", new_file_stem, extension));
109
+ new_path = parent_dir.join(format!("{new_file_stem}.{extension}"));
110
110
  }
111
111
 
112
112
  new_path.to_string_lossy().into_owned()
@@ -1,11 +1,11 @@
1
1
  {
2
- "productName": "WeRead",
3
- "identifier": "com.pake.weread",
2
+ "productName": "Weekly",
3
+ "identifier": "com.pake.weekly",
4
4
  "version": "1.0.0",
5
5
  "app": {
6
6
  "withGlobalTauri": true,
7
7
  "trayIcon": {
8
- "iconPath": "png/weread_512.png",
8
+ "iconPath": "png/weekly_512.png",
9
9
  "iconAsTemplate": false,
10
10
  "id": "pake-tray"
11
11
  }
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "productName": "we-read",
3
3
  "bundle": {
4
- "icon": ["png/weread_512.png"],
4
+ "icon": ["png/weekly.png"],
5
5
  "active": true,
6
6
  "linux": {
7
7
  "deb": {
8
8
  "depends": ["curl", "wget"],
9
- "files": { "/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop" }
9
+ "files": {
10
+ "/usr/share/applications/com-pake-weekly.desktop": "assets/com-pake-weekly.desktop"
11
+ }
10
12
  }
11
13
  },
12
14
  "targets": ["deb", "appimage"]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "bundle": {
3
- "icon": ["icons/weread.icns"],
3
+ "icon": ["icons/weekly.icns"],
4
4
  "active": true,
5
5
  "macOS": {},
6
6
  "targets": ["dmg"]
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "bundle": {
3
- "icon": ["png/weread_256.ico", "png/weread_32.ico"],
3
+ "icon": ["png/weekly_256.ico", "png/weekly_32.ico"],
4
4
  "active": true,
5
- "resources": ["png/weread_32.ico"],
5
+ "resources": ["png/weekly_32.ico"],
6
6
  "targets": ["msi"],
7
7
  "windows": {
8
8
  "digestAlgorithm": "sha256",
@@ -1,30 +0,0 @@
1
- {
2
- "windows": [
3
- {
4
- "url": "https://weread.qq.com",
5
- "url_type": "web",
6
- "hide_title_bar": true,
7
- "fullscreen": false,
8
- "width": 1200,
9
- "height": 780,
10
- "resizable": true,
11
- "always_on_top": false,
12
- "dark_mode": false,
13
- "activation_shortcut": "",
14
- "disabled_web_shortcuts": false
15
- }
16
- ],
17
- "user_agent": {
18
- "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",
19
- "linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
20
- "windows": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
21
- },
22
- "system_tray": {
23
- "macos": false,
24
- "linux": true,
25
- "windows": true
26
- },
27
- "system_tray_path": "png/icon_512.png",
28
- "inject": [],
29
- "proxy_url": ""
30
- }
@@ -1,24 +0,0 @@
1
- {
2
- "productName": "WeRead",
3
- "identifier": "com.pake.bfde08",
4
- "version": "1.0.0",
5
- "app": {
6
- "withGlobalTauri": true
7
- },
8
- "build": {
9
- "frontendDist": "../dist"
10
- },
11
- "bundle": {
12
- "icon": [
13
- "/Users/tw93/www/Pake/src-tauri/icons/icon.icns"
14
- ],
15
- "active": true,
16
- "macOS": {},
17
- "targets": [
18
- "dmg"
19
- ],
20
- "resources": [
21
- "icons/weread.icns"
22
- ]
23
- }
24
- }
@@ -1,15 +0,0 @@
1
- {
2
- "bundle": {
3
- "icon": [
4
- "/Users/tw93/www/Pake/src-tauri/icons/icon.icns"
5
- ],
6
- "active": true,
7
- "macOS": {},
8
- "targets": [
9
- "dmg"
10
- ],
11
- "resources": [
12
- "icons/weread.icns"
13
- ]
14
- }
15
- }