pake-cli 3.8.1 → 3.8.3

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 CHANGED
@@ -137,21 +137,22 @@
137
137
 
138
138
  <br/>
139
139
 
140
- | Mac | Windows/Linux | Function |
141
- | ------------------------------------------ | --------------------------------------------------- | ----------------------------------- |
142
- | <kbd>⌘</kbd> + <kbd>[</kbd> | <kbd>Ctrl</kbd> + <kbd>←</kbd> | Return to the previous page |
143
- | <kbd>⌘</kbd> + <kbd>]</kbd> | <kbd>Ctrl</kbd> + <kbd>→</kbd> | Go to the next page |
144
- | <kbd>⌘</kbd> + <kbd>↑</kbd> | <kbd>Ctrl</kbd> + <kbd>↑</kbd> | Auto scroll to top of page |
145
- | <kbd>⌘</kbd> + <kbd>↓</kbd> | <kbd>Ctrl</kbd> + <kbd>↓</kbd> | Auto scroll to bottom of page |
146
- | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> | Refresh Page |
147
- | <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> | Hide window, not quit |
148
- | <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> | Zoom out the page |
149
- | <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> | Zoom in the Page |
150
- | <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> | Reset the page zoom |
151
- | <kbd>⌘</kbd> + <kbd>L</kbd> | <kbd>Ctrl</kbd> + <kbd>L</kbd> | Copy Current Page URL |
152
- | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>H</kbd> | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>H</kbd> | Go to Home Page |
153
- | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>I</kbd> | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd> | Toggle Developer Tools (Debug Only) |
154
- | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>⌫</kbd> | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Del</kbd> | Clear Cache & Restart |
140
+ | Mac | Windows/Linux | Function |
141
+ | --------------------------------------------------------- | --------------------------------------------------- | ----------------------------------- |
142
+ | <kbd>⌘</kbd> + <kbd>[</kbd> | <kbd>Ctrl</kbd> + <kbd>←</kbd> | Return to the previous page |
143
+ | <kbd>⌘</kbd> + <kbd>]</kbd> | <kbd>Ctrl</kbd> + <kbd>→</kbd> | Go to the next page |
144
+ | <kbd>⌘</kbd> + <kbd>↑</kbd> | <kbd>Ctrl</kbd> + <kbd>↑</kbd> | Auto scroll to top of page |
145
+ | <kbd>⌘</kbd> + <kbd>↓</kbd> | <kbd>Ctrl</kbd> + <kbd>↓</kbd> | Auto scroll to bottom of page |
146
+ | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> | Refresh Page |
147
+ | <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> | Hide window, not quit |
148
+ | <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> | Zoom out the page |
149
+ | <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> | Zoom in the Page |
150
+ | <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> | Reset the page zoom |
151
+ | <kbd>⌘</kbd> + <kbd>L</kbd> | <kbd>Ctrl</kbd> + <kbd>L</kbd> | Copy Current Page URL |
152
+ | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>⌥</kbd> + <kbd>V</kbd> | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> | Paste and Match Style |
153
+ | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>H</kbd> | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>H</kbd> | Go to Home Page |
154
+ | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>I</kbd> | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd> | Toggle Developer Tools (Debug Only) |
155
+ | <kbd>⌘</kbd> + <kbd>⇧</kbd> + <kbd>⌫</kbd> | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Del</kbd> | Clear Cache & Restart |
155
156
 
156
157
  In addition, double-click the title bar to switch to full-screen mode. For Mac users, you can also use the gesture to go to the previous or next page and drag the title bar to move the window. The new menu also offers options for navigation, zoom, and window controls.
157
158
 
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import * as psl from 'psl';
22
22
  import { InvalidArgumentError, program as program$1, Option } from 'commander';
23
23
 
24
24
  var name = "pake-cli";
25
- var version = "3.8.1";
25
+ var version = "3.8.3";
26
26
  var description = "🤱🏻 Turn any webpage into a desktop app with one command. 🤱🏻 一键打包网页生成轻量桌面应用。";
27
27
  var engines = {
28
28
  node: ">=18.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "3.8.1",
3
+ "version": "3.8.3",
4
4
  "description": "🤱🏻 Turn any webpage into a desktop app with one command. 🤱🏻 一键打包网页生成轻量桌面应用。",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -2526,7 +2526,7 @@ dependencies = [
2526
2526
 
2527
2527
  [[package]]
2528
2528
  name = "pake"
2529
- version = "3.8.1"
2529
+ version = "3.8.3"
2530
2530
  dependencies = [
2531
2531
  "serde",
2532
2532
  "serde_json",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pake"
3
- version = "3.8.1"
3
+ version = "3.8.3"
4
4
  description = "🤱🏻 Turn any webpage into a desktop app with Rust."
5
5
  authors = ["Tw93"]
6
6
  license = "MIT"
@@ -66,6 +66,13 @@ fn edit_menu(app: &AppHandle<Wry>) -> tauri::Result<Submenu<Wry>> {
66
66
  edit_menu.append(&PredefinedMenuItem::cut(app, None)?)?;
67
67
  edit_menu.append(&PredefinedMenuItem::copy(app, None)?)?;
68
68
  edit_menu.append(&PredefinedMenuItem::paste(app, None)?)?;
69
+ edit_menu.append(&MenuItem::with_id(
70
+ app,
71
+ "paste_and_match_style",
72
+ "Paste and Match Style",
73
+ true,
74
+ Some("CmdOrCtrl+Shift+Option+V"),
75
+ )?)?;
69
76
  edit_menu.append(&PredefinedMenuItem::select_all(app, None)?)?;
70
77
  edit_menu.append(&PredefinedMenuItem::separator(app)?)?;
71
78
  edit_menu.append(&MenuItem::with_id(
@@ -229,6 +236,11 @@ pub fn handle_menu_click(app_handle: &AppHandle, id: &str) {
229
236
  let _ = window.eval("navigator.clipboard.writeText(window.location.href)");
230
237
  }
231
238
  }
239
+ "paste_and_match_style" => {
240
+ if let Some(window) = app_handle.get_webview_window("pake") {
241
+ let _ = window.eval("triggerPasteAsPlainText()");
242
+ }
243
+ }
232
244
  "clear_cache_restart" => {
233
245
  if let Some(window) = app_handle.get_webview_window("pake") {
234
246
  if let Ok(_) = window.clear_all_browsing_data() {
@@ -12,7 +12,19 @@ const shortcuts = {
12
12
 
13
13
  function setZoom(zoom) {
14
14
  const html = document.getElementsByTagName("html")[0];
15
- html.style.zoom = zoom;
15
+ const body = document.body;
16
+ const zoomValue = parseFloat(zoom) / 100;
17
+ const isWindows = /windows/i.test(navigator.userAgent);
18
+
19
+ if (isWindows) {
20
+ body.style.transform = `scale(${zoomValue})`;
21
+ body.style.transformOrigin = "top left";
22
+ body.style.width = `${100 / zoomValue}%`;
23
+ body.style.height = `${100 / zoomValue}%`;
24
+ } else {
25
+ html.style.zoom = zoom;
26
+ }
27
+
16
28
  window.localStorage.setItem("htmlZoom", zoom);
17
29
  }
18
30
 
@@ -29,6 +41,16 @@ function zoomOut() {
29
41
  zoomCommon((currentZoom) => `${Math.max(parseInt(currentZoom) - 10, 30)}%`);
30
42
  }
31
43
 
44
+ let pasteAsPlainTextPending = false;
45
+
46
+ function triggerPasteAsPlainText() {
47
+ pasteAsPlainTextPending = true;
48
+ document.execCommand("paste");
49
+ setTimeout(() => {
50
+ pasteAsPlainTextPending = false;
51
+ }, 100);
52
+ }
53
+
32
54
  function handleShortcut(event) {
33
55
  if (shortcuts[event.key]) {
34
56
  event.preventDefault();
@@ -36,7 +58,6 @@ function handleShortcut(event) {
36
58
  }
37
59
  }
38
60
 
39
- // Configuration constants
40
61
  const DOWNLOADABLE_FILE_EXTENSIONS = {
41
62
  documents: [
42
63
  "pdf",
@@ -278,6 +299,22 @@ document.addEventListener("DOMContentLoaded", () => {
278
299
  });
279
300
  }
280
301
 
302
+ document.addEventListener(
303
+ "paste",
304
+ (event) => {
305
+ if (pasteAsPlainTextPending) {
306
+ event.preventDefault();
307
+ event.stopImmediatePropagation();
308
+
309
+ const text = event.clipboardData?.getData("text/plain") || "";
310
+ if (text) {
311
+ document.execCommand("insertText", false, text);
312
+ }
313
+ }
314
+ },
315
+ true,
316
+ );
317
+
281
318
  // Collect blob urls to blob by overriding window.URL.createObjectURL
282
319
  function collectUrlToBlobs() {
283
320
  const backupCreateObjectURL = window.URL.createObjectURL;
@@ -115,6 +115,12 @@ pub fn run_app() {
115
115
  window_clone.set_fullscreen(true).unwrap();
116
116
  // Ensure webview maintains focus for input after fullscreen
117
117
  let _ = window_clone.set_focus();
118
+ } else {
119
+ // Fix: Ubuntu 24.04/GNOME window buttons non-functional until resize (#1122)
120
+ // The window manager needs time to process the MapWindow event before
121
+ // accepting focus requests. Without this, decorations remain non-interactive.
122
+ tokio::time::sleep(tokio::time::Duration::from_millis(30)).await;
123
+ let _ = window_clone.set_focus();
118
124
  }
119
125
  }
120
126
  });
@@ -1 +0,0 @@
1
- <html><body><h1>Hello Pake</h1></body></html>
@@ -1,10 +0,0 @@
1
- [source.crates-io]
2
- replace-with = 'rsproxy-sparse'
3
- [source.rsproxy]
4
- registry = "https://rsproxy.cn/crates.io-index"
5
- [source.rsproxy-sparse]
6
- registry = "sparse+https://rsproxy.cn/index/"
7
- [registries.rsproxy]
8
- index = "https://rsproxy.cn/crates.io-index"
9
- [net]
10
- git-fetch-with-cli = true