mirror of
https://github.com/storytold/cadcraft.git
synced 2026-11-12 00:45:16 -06:00
Without a path the screenshot was written into a private temp directory, and std::env::temp_dir panics on wasm32 (no file system), which stopped the whole web app: the page's call never got a reply and nothing after it ran. On wasm the PNG now comes back inline (pngBase64, width, height, bytes), as ui.render's does. Native builds are unchanged.
40 lines
1.7 KiB
TOML
40 lines
1.7 KiB
TOML
[package]
|
|
name = "cadcraft-web"
|
|
description = "CADCraft in the browser (eframe web runner, WebGPU with WebGL2 fallback)"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version = "1.95"
|
|
publish = false
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[[bin]]
|
|
name = "cadcraft-web"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
cadcraft-engine = { workspace = true }
|
|
cadcraft-ui-egui = { workspace = true }
|
|
cadcraft-io = { workspace = true }
|
|
cadcraft-fonts = { workspace = true }
|
|
# The host messages (storytold/craft-libs): one contract and one bridge for the web builds.
|
|
# The page command API (storytold/craft-libs#413): window.cadcraft over the control channel.
|
|
craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "fd5e2feff6ea25bed371a99cc732b3968d621505", version = "0.1.0" }
|
|
craft-web-host = { git = "https://github.com/storytold/craft-libs", rev = "fd5e2feff6ea25bed371a99cc732b3968d621505", version = "0.1.0" }
|
|
egui = { workspace = true }
|
|
log = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
|
|
# File > Open… and dropped files (src/upload.rs): the browser's file picker and file reads.
|
|
[target.wasm32-unknown-unknown.dependencies]
|
|
web-sys = { version = "0.3", features = ["HtmlInputElement", "FileList", "File"] }
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
eframe = { workspace = true, features = ["persistence", "wgpu", "accesskit"] }
|
|
wasm-bindgen = "0.2"
|
|
wasm-bindgen-futures = "0.4"
|
|
js-sys = "0.3"
|
|
web-sys = { version = "0.3", features = ["Window", "Document", "Element", "HtmlElement", "HtmlCanvasElement", "HtmlAnchorElement", "Location", "Navigator", "Blob", "BlobPropertyBag", "Url", "MessageEvent", "UrlSearchParams", "MediaQueryList", "Event", "EventTarget", "CustomEvent", "CustomEventInit"] }
|