feat(wasm): save files from the browser
Wire up save for the web build: - `io::save_to_bytes`: serialize a document to a byte buffer (DXF via write_to_vec, DWG via write_to_writer over a Cursor). - `io::download_web`: browser save dialog → write bytes (triggers a download). - Save and Save As on wasm both go through a new `web_save` helper: serialize the active tab and offer a download (no persistent path or in-app save dialog on the web). Format follows the tab name's extension, defaulting to DWG. Result reported via `WebSaveResult`. Native build + 75 tests unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
1ab892c635
commit
9d378a0533
3 changed files with 108 additions and 17 deletions
|
|
@ -678,6 +678,9 @@ pub enum Message {
|
|||
FileOpened(Result<(String, PathBuf, CadDocument, crate::scene::DerivedCaches), String>),
|
||||
SaveFile,
|
||||
SaveAs,
|
||||
/// Result of the web (browser download) save: file name or error.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
WebSaveResult(Result<String, String>),
|
||||
// ── Custom Save-As dialog ─────────────────────────────────────────────
|
||||
SaveDialogFormatChanged(String),
|
||||
SaveDialogFilenameChanged(String),
|
||||
|
|
|
|||
Loading…
Reference in a new issue