diff --git a/Cargo.lock b/Cargo.lock index 89aaa91aa..b4059e689 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,6 +935,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" @@ -1322,6 +1331,7 @@ dependencies = [ name = "deckcraft-web" version = "0.15.0" dependencies = [ + "craft-web-host", "deckcraft-engine", "deckcraft-ui-egui", "eframe", diff --git a/apps/deckcraft-web/Cargo.toml b/apps/deckcraft-web/Cargo.toml index ca04d5be9..58e8657a4 100644 --- a/apps/deckcraft-web/Cargo.toml +++ b/apps/deckcraft-web/Cargo.toml @@ -16,6 +16,8 @@ path = "src/main.rs" [dependencies] deckcraft-engine = { workspace = true } deckcraft-ui-egui = { 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" } egui = { workspace = true } log = { workspace = true } serde_json = { workspace = true } diff --git a/apps/deckcraft-web/src/host.rs b/apps/deckcraft-web/src/host.rs index 85c357a12..5cf4b0399 100644 --- a/apps/deckcraft-web/src/host.rs +++ b/apps/deckcraft-web/src/host.rs @@ -1,17 +1,21 @@ -//! The `postMessage` bridge to a same-origin parent page (`?host=parent`), for pages that embed -//! DeckCraft in an `