mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
feat(composer): compose spoiler, annotation, and tooltip controls (#1491)
Signed-off-by: Taylor Ho <taylorkmho@gmail.com> Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
co-authored by
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w
parent
36ac5243ff
commit
1aa87bb26b
@@ -0,0 +1,16 @@
|
||||
import { invokeTauri } from "./tauri";
|
||||
|
||||
/**
|
||||
* Fetch relay media bytes over IPC (Rust reqwest, WARP-tunneled).
|
||||
*
|
||||
* Used by the composer image editor: wrapping the bytes in a same-origin
|
||||
* `blob:` URL gives the canvas pixel access without CORS, so the media
|
||||
* proxy needs no special headers. The Rust side enforces the same URL
|
||||
* validation and size cap as the download commands.
|
||||
*/
|
||||
export async function fetchMediaBytes(
|
||||
url: string,
|
||||
): Promise<Uint8Array<ArrayBuffer>> {
|
||||
const bytes = await invokeTauri<number[]>("fetch_media_bytes", { url });
|
||||
return new Uint8Array(bytes);
|
||||
}
|
||||
Reference in New Issue
Block a user