Files
lightcraft/docs
Claude 78a01f47db #2270: a host bridge for pages framing the web build (?host=parent)
A same-origin page that embeds LightCraft in an iframe can now speak to
it over postMessage, with the protocol PdfCraft, GridCraft and DeckCraft
share (deckcraft#983), under lightcraft: message types:

- ready {version} / failed {error} at start-up;
- open {name, bytes} from the page adds a photo, as one dropped on the
  window (the name gives the format);
- save {name, bytes} replaces every download: exports, preset and
  keyword files, the library backup (handed over as a transferred
  ArrayBuffer);
- dirty {dirty} whenever closing the page would start or stop losing
  something (a write to browser storage queued or running, or changes
  storage refused), so the page can ask before closing a window with
  edits;
- cmd {id, params} runs a command like lightcraft.command(..) and is
  answered with response {ok, value}.

Only the parent window on the page's own origin is heard or answered.
There is no docClosed: LightCraft has a library, not documents. The
message layer (apps/lightcraft-web/src/host.rs) is plain Rust with
native tests; the postMessage part is wasm32 only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AbegtYaPuwqZ81pGfELsFK
2026-10-19 11:29:52 +00:00
..
2026-10-15 00:44:42 -04:00
2026-10-13 14:34:54 +02:00
2026-10-15 01:42:11 -04:00
2026-10-15 01:42:11 -04:00
2026-10-15 03:24:51 -04:00
2026-10-14 22:32:33 -04:00
2026-10-14 22:33:11 -04:00
2026-10-15 02:39:01 -04:00
2026-10-15 01:42:11 -04:00
2026-10-15 01:42:11 -04:00
2026-10-11 12:03:53 +00:00
2026-10-14 01:29:30 -04:00
2026-10-15 01:48:43 -04:00
2026-10-14 23:54:06 -04:00
2026-10-15 03:40:37 -04:00
2026-10-15 03:40:37 -04:00