1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: blog.pckt.theme
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8///Theme configuration for a blog publication
9#[jacquard_derive::lexicon]
10#[derive(
11 serde::Serialize,
12 serde::Deserialize,
13 Debug,
14 Clone,
15 PartialEq,
16 Eq,
17 jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20pub struct Theme<'a> {
21 ///Dark mode color palette
22 #[serde(borrow)]
23 pub dark: crate::blog_pckt::theme::Palette<'a>,
24 ///Font family name (optional)
25 #[serde(skip_serializing_if = "std::option::Option::is_none")]
26 #[serde(borrow)]
27 pub font: std::option::Option<jacquard_common::CowStr<'a>>,
28 ///Light mode color palette
29 #[serde(borrow)]
30 pub light: crate::blog_pckt::theme::Palette<'a>,
31}
32
33/// Typed wrapper for GetRecord response with this collection's record type.
34#[derive(
35 serde::Serialize,
36 serde::Deserialize,
37 Debug,
38 Clone,
39 PartialEq,
40 Eq,
41 jacquard_derive::IntoStatic
42)]
43#[serde(rename_all = "camelCase")]
44pub struct ThemeGetRecordOutput<'a> {
45 #[serde(skip_serializing_if = "std::option::Option::is_none")]
46 #[serde(borrow)]
47 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
48 #[serde(borrow)]
49 pub uri: jacquard_common::types::string::AtUri<'a>,
50 #[serde(borrow)]
51 pub value: Theme<'a>,
52}
53
54/// Marker type for deserializing records from this collection.
55pub struct ThemeRecord;
56impl jacquard_common::xrpc::XrpcResp for ThemeRecord {
57 const NSID: &'static str = "blog.pckt.theme";
58 const ENCODING: &'static str = "application/json";
59 type Output<'de> = ThemeGetRecordOutput<'de>;
60 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
61}
62
63impl jacquard_common::types::collection::Collection for Theme<'_> {
64 const NSID: &'static str = "blog.pckt.theme";
65 type Record = ThemeRecord;
66}
67
68impl From<ThemeGetRecordOutput<'_>> for Theme<'_> {
69 fn from(output: ThemeGetRecordOutput<'_>) -> Self {
70 use jacquard_common::IntoStatic;
71 output.value.into_static()
72 }
73}
74
75///Color palette with CSS hex values
76#[jacquard_derive::lexicon]
77#[derive(
78 serde::Serialize,
79 serde::Deserialize,
80 Debug,
81 Clone,
82 PartialEq,
83 Eq,
84 jacquard_derive::IntoStatic
85)]
86#[serde(rename_all = "camelCase")]
87pub struct Palette<'a> {
88 ///Accent color (hex value)
89 #[serde(borrow)]
90 pub accent: jacquard_common::CowStr<'a>,
91 ///Background color (hex value)
92 #[serde(borrow)]
93 pub background: jacquard_common::CowStr<'a>,
94 ///Link color (hex value)
95 #[serde(borrow)]
96 pub link: jacquard_common::CowStr<'a>,
97 ///Surface hover color (hex value)
98 #[serde(borrow)]
99 pub surface_hover: jacquard_common::CowStr<'a>,
100 ///Primary text color (hex value)
101 #[serde(borrow)]
102 pub text: jacquard_common::CowStr<'a>,
103}