pake-cli 3.6.4 → 3.7.2

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.
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "pake"
3
- version = "3.6.4"
3
+ version = "3.7.2"
4
4
  description = "🤱🏻 Turn any webpage into a desktop app with Rust."
5
5
  authors = ["Tw93"]
6
6
  license = "MIT"
@@ -18,10 +18,10 @@ crate-type = ["staticlib", "cdylib", "lib"]
18
18
  tauri-build = { version = "2.5.3", features = [] }
19
19
 
20
20
  [dependencies]
21
- serde_json = "1.0.145"
21
+ serde_json = "1.0.147"
22
22
  serde = { version = "1.0.228", features = ["derive"] }
23
23
  tokio = { version = "1.48.0", features = ["full"] }
24
- tauri = { version = "2.9.4", features = [
24
+ tauri = { version = "2.9.5", features = [
25
25
  "tray-icon",
26
26
  "image-ico",
27
27
  "image-png",
@@ -45,3 +45,10 @@ default = ["custom-protocol"]
45
45
  # this feature is used for production builds where `devPath` points to the filesystem
46
46
  # DO NOT remove this
47
47
  custom-protocol = ["tauri/custom-protocol"]
48
+
49
+ [profile.release]
50
+ panic = "abort"
51
+ codegen-units = 16
52
+ lto = "thin"
53
+ opt-level = "z"
54
+ strip = true
@@ -1,3 +1,6 @@
1
+ // Menu functionality is only used on macOS
2
+ #![cfg(target_os = "macos")]
3
+
1
4
  use tauri::menu::{AboutMetadata, Menu, MenuItem, PredefinedMenuItem, Submenu};
2
5
  use tauri::{AppHandle, Manager, Wry};
3
6
  use tauri_plugin_opener::OpenerExt;
@@ -1,5 +1,6 @@
1
1
  pub mod config;
2
2
  pub mod invoke;
3
+ #[cfg(target_os = "macos")]
3
4
  pub mod menu;
4
5
  pub mod setup;
5
6
  pub mod window;
@@ -124,6 +124,34 @@ const ALL_DOWNLOADABLE_EXTENSIONS = Object.values(
124
124
  DOWNLOADABLE_FILE_EXTENSIONS,
125
125
  ).flat();
126
126
 
127
+ const PREVIEWABLE_MEDIA_EXTENSIONS = [
128
+ "png",
129
+ "jpg",
130
+ "jpeg",
131
+ "gif",
132
+ "webp",
133
+ "svg",
134
+ "bmp",
135
+ "tiff",
136
+ "tif",
137
+ "avif",
138
+ "heic",
139
+ "heif",
140
+ "mp4",
141
+ "webm",
142
+ "mov",
143
+ "m4v",
144
+ "mkv",
145
+ "avi",
146
+ "ogv",
147
+ "mp3",
148
+ "wav",
149
+ "ogg",
150
+ "flac",
151
+ "aac",
152
+ "m4a",
153
+ ];
154
+
127
155
  const DOWNLOAD_PATH_PATTERNS = [
128
156
  "/download/",
129
157
  "/files/",
@@ -164,24 +192,43 @@ function showDownloadError(filename) {
164
192
  }
165
193
  }
166
194
 
195
+ function getExtension(url) {
196
+ try {
197
+ const pathname = new URL(url).pathname.toLowerCase();
198
+ const extensionIndex = pathname.lastIndexOf(".");
199
+ return extensionIndex > -1 ? pathname.slice(extensionIndex + 1) : "";
200
+ } catch (e) {
201
+ return "";
202
+ }
203
+ }
204
+
205
+ function isPreviewableMedia(url) {
206
+ const extension = getExtension(url);
207
+ return PREVIEWABLE_MEDIA_EXTENSIONS.includes(extension);
208
+ }
209
+
167
210
  // Unified file detection - replaces both isDownloadLink and isFileLink
168
211
  function isDownloadableFile(url) {
169
212
  try {
170
- const urlObj = new URL(url);
171
- const pathname = urlObj.pathname.toLowerCase();
213
+ const extension = getExtension(url);
214
+ if (PREVIEWABLE_MEDIA_EXTENSIONS.includes(extension)) {
215
+ return false;
216
+ }
172
217
 
173
- // Get file extension
174
- const extension = pathname.substring(pathname.lastIndexOf(".") + 1);
218
+ const urlObj = new URL(url);
219
+ const hasDownloadHints =
220
+ urlObj.searchParams.has("download") ||
221
+ urlObj.searchParams.has("attachment");
175
222
 
176
- const fileExtensions = ALL_DOWNLOADABLE_EXTENSIONS;
223
+ if (hasDownloadHints) {
224
+ return true;
225
+ }
177
226
 
178
227
  return (
179
- fileExtensions.includes(extension) ||
180
- // Check for download hints
181
- urlObj.searchParams.has("download") ||
182
- urlObj.searchParams.has("attachment") ||
183
- // Check for common download paths
184
- DOWNLOAD_PATH_PATTERNS.some((pattern) => pathname.includes(pattern))
228
+ ALL_DOWNLOADABLE_EXTENSIONS.includes(extension) ||
229
+ DOWNLOAD_PATH_PATTERNS.some((pattern) =>
230
+ urlObj.pathname.toLowerCase().includes(pattern),
231
+ )
185
232
  );
186
233
  } catch (e) {
187
234
  return false;
@@ -455,6 +502,12 @@ document.addEventListener("DOMContentLoaded", () => {
455
502
 
456
503
  // Handle regular links: same domain allows normal navigation, cross-domain opens new window
457
504
  if (!target || target === "_self") {
505
+ // Optimization: Allow previewable media to be handled by the app/browser directly
506
+ // This fixes issues where CDN links are treated as external
507
+ if (isPreviewableMedia(absoluteUrl)) {
508
+ return;
509
+ }
510
+
458
511
  if (!isSameDomain(absoluteUrl)) {
459
512
  if (forceInternalNavigation) {
460
513
  return;
@@ -435,6 +435,14 @@ window.addEventListener("DOMContentLoaded", (_event) => {
435
435
  top: 28px;
436
436
  }
437
437
 
438
+ .flex.w-full.h-full.overflow-hidden{
439
+ padding-top:20px;
440
+ }
441
+
442
+ .text-sidebar-foreground .bg-sidebar{
443
+ padding-top:30px;
444
+ }
445
+
438
446
  #pake-top-dom:active {
439
447
  cursor: grabbing;
440
448
  cursor: -webkit-grabbing;
@@ -1,42 +0,0 @@
1
- {
2
- "windows": [
3
- {
4
- "url": "https://example.com",
5
- "url_type": "web",
6
- "hide_title_bar": false,
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
- "hide_on_close": true,
16
- "incognito": false,
17
- "enable_wasm": false,
18
- "enable_drag_drop": false,
19
- "maximize": false,
20
- "start_to_tray": false,
21
- "force_internal_navigation": false,
22
- "zoom": 100,
23
- "min_width": 0,
24
- "min_height": 0,
25
- "ignore_certificate_errors": false
26
- }
27
- ],
28
- "user_agent": {
29
- "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",
30
- "linux": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
31
- "windows": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
32
- },
33
- "system_tray": {
34
- "macos": false,
35
- "linux": true,
36
- "windows": true
37
- },
38
- "system_tray_path": "png/icon_512.png",
39
- "inject": [],
40
- "proxy_url": "",
41
- "multi_instance": false
42
- }
@@ -1,28 +0,0 @@
1
- {
2
- "productName": "Final App",
3
- "identifier": "com.pake.c984d0",
4
- "version": "1.0.0",
5
- "app": {
6
- "withGlobalTauri": true,
7
- "security": {
8
- "headers": {},
9
- "csp": null
10
- }
11
- },
12
- "build": {
13
- "frontendDist": "../dist"
14
- },
15
- "bundle": {
16
- "icon": [
17
- "icons/final_app.icns"
18
- ],
19
- "active": true,
20
- "targets": [
21
- "dmg"
22
- ],
23
- "resources": [
24
- "icons/final_app.icns"
25
- ]
26
- },
27
- "mainBinaryName": "pake-finalapp"
28
- }
@@ -1,12 +0,0 @@
1
- {
2
- "bundle": {
3
- "icon": ["png/weekly_512.png"],
4
- "active": true,
5
- "linux": {
6
- "deb": {
7
- "depends": ["curl", "wget"]
8
- }
9
- },
10
- "targets": ["deb", "appimage"]
11
- }
12
- }
@@ -1,14 +0,0 @@
1
- {
2
- "bundle": {
3
- "icon": [
4
- "icons/final_app.icns"
5
- ],
6
- "active": true,
7
- "targets": [
8
- "dmg"
9
- ],
10
- "resources": [
11
- "icons/final_app.icns"
12
- ]
13
- }
14
- }
@@ -1,15 +0,0 @@
1
- {
2
- "bundle": {
3
- "icon": ["png/weekly_256.ico", "png/weekly_32.ico"],
4
- "active": true,
5
- "resources": ["png/weekly_32.ico"],
6
- "targets": ["msi"],
7
- "windows": {
8
- "digestAlgorithm": "sha256",
9
- "wix": {
10
- "language": ["en-US"],
11
- "template": "assets/main.wxs"
12
- }
13
- }
14
- }
15
- }