Skip to main content

kozan_core/
lib.rs

1//! `kozan-core` — Core DOM engine for Kozan.
2//!
3//! # Module structure (mirrors Chrome)
4//!
5//! - [`dom`] — DOM types: Node, `EventTarget`, Element, Handle, Document, Text
6//! - [`events`] — Event system: Event, dispatch, listeners, path
7//! - [`html`] — HTML elements: `HtmlElement`, `HtmlDivElement`, `HtmlButtonElement`
8
9// Allow derive macros to reference `::kozan_core` from within this crate.
10extern crate self as kozan_core;
11
12// Internal infrastructure (not part of the public DOM API).
13mod data_storage;
14pub(crate) mod id;
15pub(crate) mod tree;
16
17// Public modules (Chrome-aligned structure).
18pub mod dom;
19pub mod events;
20pub mod html;
21pub mod input;
22pub mod styling;
23
24pub mod compositor;
25pub(crate) mod dirty_phases;
26pub mod layout;
27pub mod lifecycle;
28pub mod paint;
29pub mod scroll;
30pub mod widget;
31
32// Re-exports: styling (Stylo-backed CSS engine).
33pub use styling::style_structs;
34pub use styling::values;
35pub use styling::{Arc, ComputedValues, PropertyDeclarationBlock};
36
37// Re-exports: traits (most important — users import these).
38pub use dom::traits::{ContainerNode, Element, HasHandle, Node};
39pub use events::EventTarget;
40pub use html::HtmlElement;
41pub use html::MediaElement;
42pub use html::{FormControlElement, TextControlElement};
43pub use html::{IntrinsicSizing, ReplacedElement};
44
45// Re-exports: core types.
46pub use dom::attribute::{Attribute, AttributeCollection};
47pub use dom::document::Document;
48pub use dom::element_data::ElementData;
49pub use dom::handle::Handle;
50pub use dom::node::{NodeFlags, NodeType};
51pub use id::RawId;
52
53// Re-exports: node types.
54pub use dom::text::{Text, TextData};
55pub use html::HtmlAudioElement;
56pub use html::HtmlBodyElement;
57pub use html::HtmlDivElement;
58pub use html::HtmlParagraphElement;
59pub use html::HtmlSpanElement;
60pub use html::{AnchorData, HtmlAnchorElement};
61pub use html::{ButtonData, HtmlButtonElement};
62pub use html::{CanvasData, HtmlCanvasElement};
63pub use html::{FormData, HtmlFormElement};
64pub use html::{HeadingData, HtmlHeadingElement};
65pub use html::{HtmlImageElement, ImageData};
66pub use html::{HtmlInputElement, InputData, InputType};
67pub use html::{HtmlLabelElement, LabelData};
68pub use html::{HtmlSelectElement, SelectData};
69pub use html::{HtmlTextAreaElement, TextAreaData};
70pub use html::{HtmlVideoElement, VideoData};
71
72// Re-exports: events.
73pub use events::{Event, EventContext, ListenerId, ListenerOptions};
74
75// Re-exports: DOM event types (dispatched through the tree).
76// Note: MouseMoveEvent, MouseEnterEvent, MouseLeaveEvent, WheelEvent share names
77// with platform-level types in `input::`. Module path disambiguates.
78pub use events::{
79    BlurEvent, ClickEvent, ContextMenuEvent, DblClickEvent, FocusEvent, FocusInEvent,
80    FocusOutEvent, KeyDownEvent, KeyUpEvent, MouseDownEvent, MouseOutEvent, MouseOverEvent,
81    MouseUpEvent, ResizeEvent, ScrollEvent,
82};
83// Re-export collision-prone DOM events via their module for explicit access.
84pub use events::mouse_event::{MouseEnterEvent, MouseLeaveEvent, MouseMoveEvent};
85pub use events::wheel_event::WheelEvent;
86
87// Re-exports: input types (engine's public input API).
88pub use input::{ButtonState, InputEvent, KeyCode, Modifiers, MouseButton};
89
90// Re-export derive macros.
91pub use kozan_macros::{Element as DeriveElement, Event as DeriveEvent, Node as DeriveNode, Props};