Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix clipboard + web deploy

Brendan Allanf9690eeed23c
diff --git a/Cargo.lock b/Cargo.lock
index 7ace25096..5fe4ea212 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -200,6 +200,24 @@ dependencies = [
"derive_arbitrary",
]
+[[package]]
+name = "arboard"
+version = "3.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4"
+dependencies = [
+ "clipboard-win",
+ "core-graphics 0.23.2",
+ "image 0.25.5",
+ "log",
+ "objc2",
+ "objc2-app-kit",
+ "objc2-foundation",
+ "parking_lot",
+ "windows-sys 0.48.0",
+ "x11rb",
+]
+
[[package]]
name = "arg_enum_proc_macro"
version = "0.3.4"
@@ -910,6 +928,7 @@ dependencies = [
"tauri",
"tauri-build",
"tauri-nspanel",
+ "tauri-plugin-clipboard-manager",
"tauri-plugin-deep-link",
"tauri-plugin-dialog",
"tauri-plugin-fs",
@@ -7130,6 +7149,21 @@ dependencies = [
"walkdir",
]
+[[package]]
+name = "tauri-plugin-clipboard-manager"
+version = "2.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54de1e3a2ea008687954d5d72952800e87b09f6fbea6d0960d99e58050537642"
+dependencies = [
+ "arboard",
+ "log",
+ "serde",
+ "serde_json",
+ "tauri",
+ "tauri-plugin",
+ "thiserror 2.0.6",
+]
+
[[package]]
name = "tauri-plugin-deep-link"
version = "2.2.0"
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml
index 0c43eb082..1da35faee 100644
--- a/apps/desktop/src-tauri/Cargo.toml
+++ b/apps/desktop/src-tauri/Cargo.toml
@@ -85,6 +85,7 @@ tracing-subscriber = "0.3.19"
tracing-appender = "0.2.3"
dirs = "6.0.0"
relative-path = "1.9.3"
+tauri-plugin-clipboard-manager = "2.2.1"
[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = "0.24.0"
diff --git a/apps/desktop/src-tauri/capabilities/default.json b/apps/desktop/src-tauri/capabilities/default.json
index 4a92bdb42..4c0f177e8 100644
--- a/apps/desktop/src-tauri/capabilities/default.json
+++ b/apps/desktop/src-tauri/capabilities/default.json
@@ -40,6 +40,7 @@
{ "url": "https://cap.so" },
{ "url": "http://localhost:3000/*" }
]
- }
+ },
+ "clipboard-manager:allow-write-text"
]
}
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 0df39f341..6762371b1 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -2100,6 +2100,7 @@ pub async fn run() {
.plugin(tauri_plugin_notification::init())
.plugin(flags::plugin::init())
.plugin(tauri_plugin_deep_link::init())
+ .plugin(tauri_plugin_clipboard_manager::init())
.plugin(
tauri_plugin_window_state::Builder::new()
.with_state_flags({
diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx
index 4a6f24414..9b1271d62 100644
--- a/apps/desktop/src/App.tsx
+++ b/apps/desktop/src/App.tsx
@@ -72,7 +72,7 @@ function Inner() {
<div class="flex flex-row gap-x-4">
<Button
onClick={() => {
- clipboard.copyText(`${e.toString()}\n\n${e.stack}`);
+ writeText(`${e.toString()}\n\n${e.stack}`);
}}
>
Copy Error to Clipboard
diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs
index 88adefd91..09c46d46c 100644
--- a/apps/web/next.config.mjs
+++ b/apps/web/next.config.mjs
@@ -48,7 +48,7 @@ const nextConfig = {
port: "3902",
pathname: "**",
},
- ],
+ ].filter(Boolean),
},
async rewrites() {
return [