Skip to main content

systemprompt_provider_contracts/web_config/
mod.rs

1mod branding;
2mod error;
3mod paths;
4mod theme;
5
6pub use branding::{BrandingConfig, LogoConfig, LogoVariant};
7pub use error::WebConfigError;
8pub use paths::{ContentConfig, PathsConfig, ScriptConfig};
9pub use theme::{
10    AnimationConfig, CardConfig, CardGradient, CardPadding, CardRadius, ColorPalette, ColorsConfig,
11    FontConfig, FontFile, FontsConfig, LayoutConfig, MobileConfig, MobileLayout, MobileTypography,
12    PrimaryColor, RadiusConfig, ShadowSet, ShadowsConfig, SidebarConfig, SpacingConfig,
13    TouchTargetsConfig, TypographyConfig, TypographySizes, TypographyWeights, ZIndexConfig,
14};
15
16use serde::{Deserialize, Serialize};
17use std::collections::HashMap;
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(deny_unknown_fields)]
21pub struct WebConfig {
22    pub paths: PathsConfig,
23    #[serde(default)]
24    pub scripts: Vec<ScriptConfig>,
25    #[serde(default)]
26    pub content: Option<ContentConfig>,
27    pub branding: BrandingConfig,
28    pub fonts: FontsConfig,
29    pub colors: ColorsConfig,
30    pub typography: TypographyConfig,
31    pub spacing: SpacingConfig,
32    pub radius: RadiusConfig,
33    pub shadows: ShadowsConfig,
34    pub animation: AnimationConfig,
35    #[serde(rename = "zIndex")]
36    pub z_index: ZIndexConfig,
37    pub layout: LayoutConfig,
38    pub card: CardConfig,
39    pub mobile: MobileConfig,
40    #[serde(rename = "touchTargets")]
41    pub touch_targets: TouchTargetsConfig,
42    #[serde(default)]
43    pub nav: NavConfig,
44    #[serde(default)]
45    pub social_action_bar: SocialActionBarConfig,
46    #[serde(default)]
47    pub pages: HashMap<String, serde_json::Value>,
48}
49
50#[derive(Debug, Clone, Serialize, Deserialize, Default)]
51#[serde(deny_unknown_fields)]
52#[allow(clippy::struct_field_names)]
53pub struct NavConfig {
54    #[serde(default)]
55    pub app_url: String,
56    #[serde(default)]
57    pub docs_url: String,
58    #[serde(default)]
59    pub blog_url: String,
60    #[serde(default)]
61    pub playbooks_url: String,
62    #[serde(default)]
63    pub github_url: String,
64    #[serde(default)]
65    pub getting_started_url: String,
66}
67
68#[derive(Debug, Clone, Serialize, Deserialize, Default)]
69#[serde(deny_unknown_fields)]
70pub struct SocialActionBarConfig {
71    #[serde(default)]
72    pub label: String,
73    #[serde(default)]
74    pub platforms: Vec<SocialPlatform>,
75    #[serde(default)]
76    pub enable_share: bool,
77}
78
79#[derive(Debug, Clone, Serialize, Deserialize, Default)]
80#[serde(deny_unknown_fields)]
81pub struct SocialPlatform {
82    #[serde(rename = "type")]
83    pub platform_type: String,
84    #[serde(default)]
85    pub url: Option<String>,
86    #[serde(default)]
87    pub label: Option<String>,
88}