1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Dioxus backend for A2UI.
//!
//! Translates an A2UI component tree (the flat `id → ComponentModel` map owned
//! by [`a2ui_base::model`]) into a Dioxus [`Element`] tree rendered into a
//! desktop WebView, and bridges widget interactions back to the
//! framework-agnostic interaction layer in `a2ui_base` via Dioxus's
//! reactive-signals architecture.
//!
//! Of the six A2UI renderers this is the most architecturally distinct. Dioxus
//! is a *reactive-signals* framework (like React): the runtime state lives in a
//! [`Signal`] at the root, and the UI is a pure read of it — so unlike the Iced
//! backend (Elm `view`/`update`, needs a `Message` enum) or the egui backend
//! (immediate mode, needs a persistent `EditBuffers` state bridge), interactive
//! widgets here read straight from the signal in render and write straight back
//! through it on interaction. **No message enum, no state bridge.** The signal
//! *is* the interaction channel: any write re-renders every component that read
//! it.
//!
//! Two further Dioxus-specific simplifications:
//! - **Recursive components** — the whole tree is one [`A2uiNode`] component
//! that renders itself per node (Dioxus supports recursion natively, unlike
//! Slint's bounded-depth codegen), so there is no flat-array workaround.
//! - **WebView rendering** — Dioxus desktop renders to a system WebView
//! (WebKitGTK on Linux), so the bespoke dark theme is a CSS stylesheet
//! ([`theme::STYLESHEET`]) rather than a per-widget style-fn palette, and the
//! A2UI component kinds map to ordinary HTML elements + classes.
//!
//! Everything here lives behind the `backend` cargo feature, which pulls in the
//! Dioxus desktop runtime. Without it this crate is an empty shell (it compiles
//! with no dependencies beyond `a2ui-base`), keeping the workspace's default
//! build light.
//!
//! [`Element`]: dioxus::Element
//! [`Signal`]: dioxus::prelude::Signal
/// The gallery root component — owns the state signals and renders the sidebar
/// + preview pane + modal overlay. Construct from the gallery (or any host)
/// and hand to `dioxus::launch`.
pub use Gallery;
/// The recursive per-node component. Re-exported so a host can render a raw
/// subtree (`<A2uiNode id=.. base_path=.. />`) without the gallery chrome.
pub use A2uiNode;
/// The whole-gallery CSS stylesheet (the dark Catppuccin-Mocha + green-accent
/// palette). Inject it via the desktop `Config`'s custom `<head>`.
pub use STYLESHEET;
/// Re-export the core interaction pieces backends compose against, so consumers
/// can `use a2ui_dioxus::{dispatch_event, apply_event_result, ...}` in one place.
pub use dispatch_event;
pub use FocusManager;
pub use apply_event_result;