use indexmap::IndexMap;
#[derive(Debug, Clone)]
pub struct WdocDocument {
pub name: String,
pub title: String,
pub version: Option<String>,
pub author: Option<String>,
pub sections: Vec<Section>,
pub pages: Vec<Page>,
pub styles: Vec<WdocStyle>,
}
#[derive(Debug, Clone)]
pub struct Section {
pub id: String,
pub short_id: String,
pub title: String,
pub children: Vec<Section>,
}
#[derive(Debug, Clone)]
pub struct Page {
pub id: String,
pub section_id: String,
pub title: String,
pub layout: Layout,
}
#[derive(Debug, Clone)]
pub struct Layout {
pub children: Vec<LayoutItem>,
}
#[derive(Debug, Clone)]
pub enum LayoutItem {
SplitGroup(SplitGroup),
Content(ContentBlock),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SplitDirection {
Vertical,
Horizontal,
}
#[derive(Debug, Clone)]
pub struct SplitGroup {
pub direction: SplitDirection,
pub splits: Vec<Split>,
}
#[derive(Debug, Clone)]
pub struct Split {
pub size_percent: f64,
pub children: Vec<LayoutItem>,
}
#[derive(Debug, Clone)]
pub struct ContentBlock {
pub kind: String,
pub id: Option<String>,
pub rendered_html: String,
pub style: Option<String>,
}
#[derive(Debug, Clone)]
pub struct WdocStyle {
pub name: String,
pub rules: Vec<StyleRule>,
}
#[derive(Debug, Clone)]
pub struct StyleRule {
pub target: String,
pub properties: IndexMap<String, String>,
}