Skip to main content

euv_ui/component/code_block/view/
enum.rs

1use super::*;
2
3/// The surface a code block is drawn on.
4///
5/// The reference publishes two: the plain code block and the one that
6/// says the snippet does not run.
7#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8pub enum EuvCodeBlockVariant {
9    /// The code block is drawn on the page surface.
10    #[default]
11    Default,
12    /// The code block says the snippet does not run.
13    Destructive,
14}
15
16/// The size of a code block.
17///
18/// The reference publishes two: the default block and the small one.
19#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20pub enum EuvCodeBlockSize {
21    /// The block stands at the default size.
22    #[default]
23    Default,
24    /// The block stands at the small size.
25    Sm,
26}
27
28/// The state of one line of a code block.
29///
30/// The reference publishes four: the plain line, the line that was
31/// added, the line that was removed and the line that is called out.
32#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
33pub enum EuvCodeBlockLineVariant {
34    /// The line is an ordinary line of the snippet.
35    #[default]
36    Default,
37    /// The line was added by the change the snippet shows.
38    Added,
39    /// The line was removed by the change the snippet shows.
40    Removed,
41    /// The line is called out.
42    Highlighted,
43}