From 910c65cd6a00efae2a78ba1deff078519468a8d3 Mon Sep 17 00:00:00 2001 From: Helen Kwok <107752876+helenkwok@users.noreply.github.com> Date: Thu, 5 Nov 2026 16:50:03 +0800 Subject: [PATCH] filmcraft-web: speak the host messages through craft-web-host The transports, the message types and the origin checks come from the shared crate (storytold/craft-libs#420); FilmCraft keeps what is its own: project or media, the open size limit and the saveAs rule. --- Cargo.lock | 10 + apps/filmcraft-web/Cargo.toml | 2 + apps/filmcraft-web/src/host.rs | 270 +++++------------------- apps/filmcraft-web/src/hostmode.rs | 27 +-- apps/filmcraft-web/src/lib.rs | 24 +-- apps/filmcraft-web/tests/it/hostmode.rs | 22 +- packaging/web/README.md | 4 +- 7 files changed, 91 insertions(+), 268 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b632368ea..cb00b1a44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1146,6 +1146,15 @@ dependencies = [ "zip 9.1.0", ] +[[package]] +name = "craft-web-host" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=2e2312ddaf21bc3d85cd3395d0955c7d239306f6#2e2312ddaf21bc3d85cd3395d0955c7d239306f6" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "crc32fast" version = "1.5.2" @@ -2584,6 +2593,7 @@ dependencies = [ name = "filmcraft-web" version = "0.17.0" dependencies = [ + "craft-web-host", "eframe", "egui", "filmcraft-codecs", diff --git a/apps/filmcraft-web/Cargo.toml b/apps/filmcraft-web/Cargo.toml index 10affd2c0..54751628c 100644 --- a/apps/filmcraft-web/Cargo.toml +++ b/apps/filmcraft-web/Cargo.toml @@ -16,6 +16,8 @@ crate-type = ["cdylib", "rlib"] # and clippy stay cheap). Build with `cargo xtask web` (see docs/web.md). [target.'cfg(target_arch = "wasm32")'.dependencies] filmcraft-engine = { workspace = true } +# The host messages (storytold/craft-libs): one contract and one bridge for the web builds. +craft-web-host = { git = "https://github.com/storytold/craft-libs", rev = "2e2312ddaf21bc3d85cd3395d0955c7d239306f6", version = "0.1.0" } filmcraft-ui-egui = { workspace = true } filmcraft-media = { workspace = true } filmcraft-codecs = { workspace = true } diff --git a/apps/filmcraft-web/src/host.rs b/apps/filmcraft-web/src/host.rs index ca3d464fa..7f0b5b260 100644 --- a/apps/filmcraft-web/src/host.rs +++ b/apps/filmcraft-web/src/host.rs @@ -1,39 +1,22 @@ //! Host modes: a page that runs FilmCraft (as an `