pake-cli 3.1.0 → 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.
- package/README.md +82 -25
- package/dist/cli.js +160 -88
- package/dist/dev.js +39 -20
- package/dist/dev.js.map +1 -1
- package/package.json +15 -17
- package/src-tauri/.cargo/config.toml +5 -0
- package/src-tauri/Cargo.lock +1392 -1154
- package/src-tauri/Cargo.toml +12 -12
- package/src-tauri/assets/{com-tw93-weread.desktop → com-tw93-weekly.desktop} +4 -4
- package/src-tauri/gen/schemas/acl-manifests.json +1 -1
- package/src-tauri/gen/schemas/desktop-schema.json +946 -411
- package/src-tauri/gen/schemas/macOS-schema.json +946 -411
- package/src-tauri/icons/deepseek.icns +0 -0
- package/src-tauri/icons/grok.icns +0 -0
- package/src-tauri/icons/weekly.icns +0 -0
- package/src-tauri/pake.json +3 -2
- package/src-tauri/png/chatgpt_256.ico +0 -0
- package/src-tauri/png/chatgpt_32.ico +0 -0
- package/src-tauri/png/chatgpt_512.png +0 -0
- package/src-tauri/png/deepseek_256.ico +0 -0
- package/src-tauri/png/deepseek_32.ico +0 -0
- package/src-tauri/png/deepseek_512.png +0 -0
- package/src-tauri/png/excalidraw_256.ico +0 -0
- package/src-tauri/png/excalidraw_32.ico +0 -0
- package/src-tauri/png/excalidraw_512.png +0 -0
- package/src-tauri/png/flomo_256.ico +0 -0
- package/src-tauri/png/flomo_32.ico +0 -0
- package/src-tauri/png/flomo_512.png +0 -0
- package/src-tauri/png/gemini_256.ico +0 -0
- package/src-tauri/png/gemini_32.ico +0 -0
- package/src-tauri/png/gemini_512.png +0 -0
- package/src-tauri/png/grok_256.ico +0 -0
- package/src-tauri/png/grok_32.ico +0 -0
- package/src-tauri/png/grok_512.png +0 -0
- package/src-tauri/png/icon_256.ico +0 -0
- package/src-tauri/png/icon_32.ico +0 -0
- package/src-tauri/png/icon_512.png +0 -0
- package/src-tauri/png/lizhi_256.ico +0 -0
- package/src-tauri/png/lizhi_32.ico +0 -0
- package/src-tauri/png/lizhi_512.png +0 -0
- package/src-tauri/png/programmusic_256.ico +0 -0
- package/src-tauri/png/programmusic_32.ico +0 -0
- package/src-tauri/png/programmusic_512.png +0 -0
- package/src-tauri/png/qwerty_256.ico +0 -0
- package/src-tauri/png/qwerty_32.ico +0 -0
- package/src-tauri/png/qwerty_512.png +0 -0
- package/src-tauri/png/twitter_256.ico +0 -0
- package/src-tauri/png/twitter_32.ico +0 -0
- package/src-tauri/png/twitter_512.png +0 -0
- package/src-tauri/png/wechat_256.ico +0 -0
- package/src-tauri/png/wechat_32.ico +0 -0
- package/src-tauri/png/wechat_512.png +0 -0
- package/src-tauri/png/weekly_256.ico +0 -0
- package/src-tauri/png/weekly_32.ico +0 -0
- package/src-tauri/png/weekly_512.png +0 -0
- package/src-tauri/png/weread_256.ico +0 -0
- package/src-tauri/png/weread_32.ico +0 -0
- package/src-tauri/png/weread_512.png +0 -0
- package/src-tauri/png/xiaohongshu_256.ico +0 -0
- package/src-tauri/png/xiaohongshu_32.ico +0 -0
- package/src-tauri/png/xiaohongshu_512.png +0 -0
- package/src-tauri/png/youtube_256.ico +0 -0
- package/src-tauri/png/youtube_32.ico +0 -0
- package/src-tauri/png/youtube_512.png +0 -0
- package/src-tauri/png/youtubemusic_256.ico +0 -0
- package/src-tauri/png/youtubemusic_32.ico +0 -0
- package/src-tauri/png/youtubemusic_512.png +0 -0
- package/src-tauri/src/app/config.rs +1 -0
- package/src-tauri/src/app/setup.rs +3 -1
- package/src-tauri/src/app/window.rs +25 -3
- package/src-tauri/src/inject/component.js +6 -5
- package/src-tauri/src/inject/event.js +143 -62
- package/src-tauri/src/inject/style.js +29 -8
- package/src-tauri/src/lib.rs +22 -13
- package/src-tauri/src/util.rs +4 -4
- package/src-tauri/tauri.conf.json +3 -3
- package/src-tauri/tauri.linux.conf.json +4 -2
- package/src-tauri/tauri.macos.conf.json +1 -1
- package/src-tauri/tauri.windows.conf.json +2 -2
- package/src-tauri/.pake/pake.json +0 -30
- package/src-tauri/.pake/tauri.conf.json +0 -24
- package/src-tauri/.pake/tauri.macos.conf.json +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.addEventListener(
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
440
|
-
if (window[
|
|
441
|
-
const topPaddingStyleElement = document.createElement(
|
|
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
|
}
|
package/src-tauri/src/lib.rs
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
mod app;
|
|
3
3
|
mod util;
|
|
4
4
|
|
|
5
|
-
use std::time::Duration;
|
|
6
5
|
use tauri::Manager;
|
|
7
6
|
use tauri_plugin_window_state::Builder as WindowStatePlugin;
|
|
8
7
|
use tauri_plugin_window_state::StateFlags;
|
|
9
8
|
|
|
9
|
+
#[cfg(target_os = "macos")]
|
|
10
|
+
use std::time::Duration;
|
|
11
|
+
|
|
10
12
|
use app::{
|
|
11
13
|
invoke::{download_file, download_file_by_binary, send_notification},
|
|
12
14
|
setup::{set_global_shortcut, set_system_tray},
|
|
@@ -19,6 +21,7 @@ pub fn run_app() {
|
|
|
19
21
|
let tauri_app = tauri::Builder::default();
|
|
20
22
|
|
|
21
23
|
let show_system_tray = pake_config.show_system_tray();
|
|
24
|
+
let hide_on_close = pake_config.windows[0].hide_on_close;
|
|
22
25
|
let activation_shortcut = pake_config.windows[0].activation_shortcut.clone();
|
|
23
26
|
let init_fullscreen = pake_config.windows[0].fullscreen;
|
|
24
27
|
|
|
@@ -31,6 +34,7 @@ pub fn run_app() {
|
|
|
31
34
|
})
|
|
32
35
|
.build();
|
|
33
36
|
|
|
37
|
+
#[allow(deprecated)]
|
|
34
38
|
tauri_app
|
|
35
39
|
.plugin(window_state_plugin)
|
|
36
40
|
.plugin(tauri_plugin_oauth::init())
|
|
@@ -51,19 +55,24 @@ pub fn run_app() {
|
|
|
51
55
|
window.show().unwrap();
|
|
52
56
|
Ok(())
|
|
53
57
|
})
|
|
54
|
-
.on_window_event(|_window, _event| {
|
|
55
|
-
#[cfg(target_os = "macos")]
|
|
58
|
+
.on_window_event(move |_window, _event| {
|
|
56
59
|
if let tauri::WindowEvent::CloseRequested { api, .. } = _event {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
|
67
76
|
}
|
|
68
77
|
})
|
|
69
78
|
.run(tauri::generate_context!())
|
package/src-tauri/src/util.rs
CHANGED
|
@@ -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("{}");"
|
|
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!("{}-{}"
|
|
101
|
+
format!("{base_name}-{counter}")
|
|
102
102
|
}
|
|
103
103
|
_ => {
|
|
104
104
|
counter += 1;
|
|
105
|
-
format!("{}-{}"
|
|
105
|
+
format!("{file_stem}-{counter}")
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
new_path = parent_dir.join(format!("{}.{}"
|
|
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": "
|
|
3
|
-
"identifier": "com.pake.
|
|
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/
|
|
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/
|
|
4
|
+
"icon": ["png/weekly.png"],
|
|
5
5
|
"active": true,
|
|
6
6
|
"linux": {
|
|
7
7
|
"deb": {
|
|
8
8
|
"depends": ["curl", "wget"],
|
|
9
|
-
"files": {
|
|
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,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bundle": {
|
|
3
|
-
"icon": ["png/
|
|
3
|
+
"icon": ["png/weekly_256.ico", "png/weekly_32.ico"],
|
|
4
4
|
"active": true,
|
|
5
|
-
"resources": ["png/
|
|
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
|
-
}
|