osdy-pi 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,129 +6,130 @@ export const ANIMATION_ENABLED = true;
6
6
  export const ANIMATION_INTERVAL_MS = 30;
7
7
  export const INTRO_ANIMATION_FRAMES = 28;
8
8
  export const WORKING_SPINNER_FRAMES = [
9
- "⠋",
10
- "⠙",
11
- "⠹",
12
- "⠸",
13
- "⠼",
14
- "⠴",
15
- "⠦",
16
- "⠧",
17
- "⠇",
18
- "⠏",
9
+ "⠋",
10
+ "⠙",
11
+ "⠹",
12
+ "⠸",
13
+ "⠼",
14
+ "⠴",
15
+ "⠦",
16
+ "⠧",
17
+ "⠇",
18
+ "⠏",
19
19
  ];
20
20
  export const WORKING_WIDGET_KEY = "osdy-pi-working";
21
+ export const WORKING_TREE_WIDGET_KEY = "osdy-pi-working-tree";
21
22
  export const MASCOT_MIN_ROWS = 34;
22
23
  export const MASCOT_GAP = 0;
23
24
 
24
25
  const HTML_MASCOT = [
25
- " ▓▓▓▓▒ ",
26
- " ░ ▓▓▓ ▒▓ ",
27
- " ░░░▓▓▓ ▓▓ ",
28
- " ▒ ▒ ▒▒ ▒ ░░ ▓▓▓▓ ░▒▓▓ ",
29
- "▓▓▓▓▓▓▓▓░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ░░▒▓ ",
30
- "▓▓ ▓▓▓▓▓░░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░▒▒ ",
31
- "▓▓░ ▒▓▓▓▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▒▒▒▒▒▒▒░░ ░▒▒ ",
32
- " ▓▒░░ ▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█▓▓█▓▓▓▓▓▒▒▒░▒▒░ ",
33
- " ▓▒░░ ░▒▒▒▒▒▓▓▓▓▓▒█▒▒▒▒▒▓▓▓▓ ░░░ ▓▓▓▓▒▒▒░░ ",
34
- " ▒▒░░ ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▓▓ ░ ▓ ▒▒░░ ",
35
- " ▒▒▒▒░▒▒▓▓▓▓░ ░▓▒▒▒▒▒ ░▒▒█▓ ▒▓▓▓░▒ ",
36
- " ░ ░▒▒▓▓▒ ▓░░ ░░ ░ ▓▓▓▒ ",
37
- " ░░▒▓░ ░▒░▓▓ ░░ ░▓▓▒ ",
38
- " ░▒ ▒ ░▒▒▒ ▒▒▒▒ ░ ▒▒▒ ",
39
- " ░▒▓▓░ ▓▓░░░ █▓ ▒ ░▒▒▒ ",
40
- " ▒▓▓▓░ ▓▓ ▓▓▓▓▓▓▓▓▓ ░░▒ ",
41
- " ▓▓▓░ ░ ▓▓▓▓▓▓▒▓▓▓▓ ▓▓▓▓▓▓▓▒░░░░ ░ ",
42
- " ▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░ ",
43
- " ▓▒▒░░ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒░░ ▓ ",
44
- " ░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒ ░░░ ",
45
- " ░ ░░░░░░░░░░░▒▒░░ ░ ░ ░ ▓ ",
46
- " ░░░░░▒▒▒▒░░▒░ ▒▒▒▒▒░░ ░░▒▒▒░░░░░░░░ ",
47
- " ▒▒▒▒▒░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░ ▒░░▒▒▒▒▓▓▓▓░░░░ ",
48
- " ░▒▒▒▒▒░ ░░▒▒▒▒▒▒▒▒░░░ ░░▒▓▓▓▓▒▒░░ ",
49
- " ▓░░░░░░ ░ ░░░░░░░░░░░ ░░░░░░▓▒▒▒▒ ░",
50
- " ░░░▒▒▓▓▓▓▓▒░░░░░░░░░░ ░░▒▒▒▒░░░░░░░▒▒░░ ",
51
- " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒░░░ ░▒▒▒▓▓▒░░░ ░░░▒ ",
52
- " ▒░▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒░░░ ░▒▒▓▓▒░ ░ ",
53
- " ░░▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒░░░░ ░▒▒▒▒▒ ░ ",
54
- " ▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░ ▒▒░▒ ",
55
- " ░░░░░░░░░░▒░░▒░▒▒░░░░ ░ ░░░░ ",
56
- " ░░░░ ░░░░░░░░░░░ ░░░░ ",
57
- " ░ ░░░░░░ ▓ ",
58
- " ░░░░░ ░░░░░░ ",
59
- " ░ ░ ",
26
+ " ▓▓▓▓▒ ",
27
+ " ░ ▓▓▓ ▒▓ ",
28
+ " ░░░▓▓▓ ▓▓ ",
29
+ " ▒ ▒ ▒▒ ▒ ░░ ▓▓▓▓ ░▒▓▓ ",
30
+ "▓▓▓▓▓▓▓▓░░░░░ ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ░░▒▓ ",
31
+ "▓▓ ▓▓▓▓▓░░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░ ░░▒▒ ",
32
+ "▓▓░ ▒▓▓▓▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▒▒▒▒▒▒▒░░ ░▒▒ ",
33
+ " ▓▒░░ ▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█▓▓█▓▓▓▓▓▒▒▒░▒▒░ ",
34
+ " ▓▒░░ ░▒▒▒▒▒▓▓▓▓▓▒█▒▒▒▒▒▓▓▓▓ ░░░ ▓▓▓▓▒▒▒░░ ",
35
+ " ▒▒░░ ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▓▓ ░ ▓ ▒▒░░ ",
36
+ " ▒▒▒▒░▒▒▓▓▓▓░ ░▓▒▒▒▒▒ ░▒▒█▓ ▒▓▓▓░▒ ",
37
+ " ░ ░▒▒▓▓▒ ▓░░ ░░ ░ ▓▓▓▒ ",
38
+ " ░░▒▓░ ░▒░▓▓ ░░ ░▓▓▒ ",
39
+ " ░▒ ▒ ░▒▒▒ ▒▒▒▒ ░ ▒▒▒ ",
40
+ " ░▒▓▓░ ▓▓░░░ █▓ ▒ ░▒▒▒ ",
41
+ " ▒▓▓▓░ ▓▓ ▓▓▓▓▓▓▓▓▓ ░░▒ ",
42
+ " ▓▓▓░ ░ ▓▓▓▓▓▓▒▓▓▓▓ ▓▓▓▓▓▓▓▒░░░░ ░ ",
43
+ " ▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░ ",
44
+ " ▓▒▒░░ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒░░ ▓ ",
45
+ " ░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒ ░░░ ",
46
+ " ░ ░░░░░░░░░░░▒▒░░ ░ ░ ░ ▓ ",
47
+ " ░░░░░▒▒▒▒░░▒░ ▒▒▒▒▒░░ ░░▒▒▒░░░░░░░░ ",
48
+ " ▒▒▒▒▒░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░ ▒░░▒▒▒▒▓▓▓▓░░░░ ",
49
+ " ░▒▒▒▒▒░ ░░▒▒▒▒▒▒▒▒░░░ ░░▒▓▓▓▓▒▒░░ ",
50
+ " ▓░░░░░░ ░ ░░░░░░░░░░░ ░░░░░░▓▒▒▒▒ ░",
51
+ " ░░░▒▒▓▓▓▓▓▒░░░░░░░░░░ ░░▒▒▒▒░░░░░░░▒▒░░ ",
52
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒░░░ ░▒▒▒▓▓▒░░░ ░░░▒ ",
53
+ " ▒░▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒░░░ ░▒▒▓▓▒░ ░ ",
54
+ " ░░▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒░░░░ ░▒▒▒▒▒ ░ ",
55
+ " ▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░ ▒▒░▒ ",
56
+ " ░░░░░░░░░░▒░░▒░▒▒░░░░ ░ ░░░░ ",
57
+ " ░░░░ ░░░░░░░░░░░ ░░░░ ",
58
+ " ░ ░░░░░░ ▓ ",
59
+ " ░░░░░ ░░░░░░ ",
60
+ " ░ ░ ",
60
61
  ] as const;
61
62
 
62
63
  const HTML_MASCOT_MAP = [
63
- " hhhhl ",
64
- " dmmhhhmmlhm ",
65
- " dmmmhhhdmmmmhh ",
66
- " ldldllddmdldmmmmhhlhddmmmlhh ",
67
- "hhhhhhhhmmmlm llllllllllllllllllmlldddmmmll ",
68
- "hhmmmmlhhhhmmmdllllllllllllllllllllllllmddmmmll ",
69
- "hhmmmddlhhhlmlllllllllllllllllllhlllllllllmmlld ",
70
- " llmmmdddlmllllllllllllllllllhbhhbhhhhhllllllm ",
71
- " dllmmmddllllllhhhhhlblllllhhhhmmmmmmhhhhlllmm ",
72
- " dllmmmlllllhhhhhhhhhhllllhhmmmmmmmmmddddhdlllm ",
73
- " lllllllhhhhmmmmmmmhllllldmdlllbhmmmmddddlhhhlldd ",
74
- " mdlllhhlmmdhmmmddmmdmmddmmmmdldddddddddmmmhhhl ",
75
- " lllhmddmlmhhmmmmmddmmmddddddddddddddddmmdmmmhhl ",
76
- " mlldldddmlllddddddddlllldmddddddddddddmmmddmlll ",
77
- " llhhmddddmmdddddddddhhmmmdbhdldddddddddmmddmlll ",
78
- " llhhmmmdddddddddddddhhddddmhhhhhhhhhmmdddddlml ",
79
- " hhhmmmmmddddddddldhhhhhhlhhhhmhhhhhhhlmmmmmm ",
80
- " llllmddmddddddddhhhhhhhhhhlhhhhhhhlllmmmm ",
81
- " hllllmddddddmhhhhhhhhhhhhhllllllmmmh ",
82
- " dmmmmmmmmlllllllllllllmdmmm ",
83
- " mmmmmmmmmmmmmmmlllmm ",
84
- " dlmmmmllllmmlmmllllllm dmllllmmmmmmmm ",
85
- " lllllmmlllllllllllllmmm lmllllllllhlmmmmm ",
86
- " mlllllmdmlllllllllmmmd mddmmmmlhhhlllmmmmm ",
87
- " hmmmmmmdmdmmmmmmmmmmm dddmmmmmmmmlllllmmdmm",
88
- " mmmlllllhllllmmmmmmmm dmmllllmmmmmmmlllmdm ",
89
- " mlllhhhhhhhhlllllllmmdddmlllhllmmmmmmlmml ",
90
- " llllllhhhhhhhllllllllmmdddmmlllllmmmmdmmd ",
91
- " mllllllllhhllllllllllmmmddmmmlllllmdddmm ",
92
- " lmllmlllllllllllllllmmmmmddmmmllllmdddd ",
93
- " lmmmmmmllllmllllllmmmdmdddddmmmmmddmd ",
94
- " dmmmmmmd dmmmmmmmmmmmmddddmmmmmdd ",
95
- " dmmmmmd dmmmmmmd h ",
96
- " mmmmmmmm dmmmmmmm ",
97
- " dmmmmmm ",
64
+ " hhhhl ",
65
+ " dmmhhhmmlhm ",
66
+ " dmmmhhhdmmmmhh ",
67
+ " ldldllddmdldmmmmhhlhddmmmlhh ",
68
+ "hhhhhhhhmmmlm llllllllllllllllllmlldddmmmll ",
69
+ "hhmmmmlhhhhmmmdllllllllllllllllllllllllmddmmmll ",
70
+ "hhmmmddlhhhlmlllllllllllllllllllhlllllllllmmlld ",
71
+ " llmmmdddlmllllllllllllllllllhbhhbhhhhhllllllm ",
72
+ " dllmmmddllllllhhhhhlblllllhhhhmmmmmmhhhhlllmm ",
73
+ " dllmmmlllllhhhhhhhhhhllllhhmmmmmmmmmddddhdlllm ",
74
+ " lllllllhhhhmmmmmmmhllllldmdlllbhmmmmddddlhhhlldd ",
75
+ " mdlllhhlmmdhmmmddmmdmmddmmmmdldddddddddmmmhhhl ",
76
+ " lllhmddmlmhhmmmmmddmmmddddddddddddddddmmdmmmhhl ",
77
+ " mlldldddmlllddddddddlllldmddddddddddddmmmddmlll ",
78
+ " llhhmddddmmdddddddddhhmmmdbhdldddddddddmmddmlll ",
79
+ " llhhmmmdddddddddddddhhddddmhhhhhhhhhmmdddddlml ",
80
+ " hhhmmmmmddddddddldhhhhhhlhhhhmhhhhhhhlmmmmmm ",
81
+ " llllmddmddddddddhhhhhhhhhhlhhhhhhhlllmmmm ",
82
+ " hllllmddddddmhhhhhhhhhhhhhllllllmmmh ",
83
+ " dmmmmmmmmlllllllllllllmdmmm ",
84
+ " mmmmmmmmmmmmmmmlllmm ",
85
+ " dlmmmmllllmmlmmllllllm dmllllmmmmmmmm ",
86
+ " lllllmmlllllllllllllmmm lmllllllllhlmmmmm ",
87
+ " mlllllmdmlllllllllmmmd mddmmmmlhhhlllmmmmm ",
88
+ " hmmmmmmdmdmmmmmmmmmmm dddmmmmmmmmlllllmmdmm",
89
+ " mmmlllllhllllmmmmmmmm dmmllllmmmmmmmlllmdm ",
90
+ " mlllhhhhhhhhlllllllmmdddmlllhllmmmmmmlmml ",
91
+ " llllllhhhhhhhllllllllmmdddmmlllllmmmmdmmd ",
92
+ " mllllllllhhllllllllllmmmddmmmlllllmdddmm ",
93
+ " lmllmlllllllllllllllmmmmmddmmmllllmdddd ",
94
+ " lmmmmmmllllmllllllmmmdmdddddmmmmmddmd ",
95
+ " dmmmmmmd dmmmmmmmmmmmmddddmmmmmdd ",
96
+ " dmmmmmd dmmmmmmd h ",
97
+ " mmmmmmmm dmmmmmmm ",
98
+ " dmmmmmm ",
98
99
  ] as const;
99
100
 
100
101
  const HEADER_CLASSIC = [
101
- "░█████╗░░██████╗██████╗░██╗░░░██╗░░░░░░██████╗░██╗",
102
- "██╔══██╗██╔════╝██╔══██╗╚██╗░██╔╝░░░░░░██╔══██╗ ║",
103
- "██║░░██║╚█████╗░██║░░██║░╚████╔╝░█████╗██████╔╝██║",
104
- "██║░░██║░╚═══██╗██║░░██║░░╚██╔╝░░╚════╝██╔═══╝░██║",
105
- "╚█████╔╝██████╔╝██████╔╝░░░██║░░░░░░░░░██║░░░░░██║",
106
- "░╚════╝░╚═════╝░╚═════╝░░░░╚═╝░░░░░░░░░╚═╝░░░░░╚═╝",
107
- " ╭━╮╱╱╱╱╱╱╭╮╱╱╱╱╱╭╮╱╱╱╱╱╭╮╱╱╭╮╭╮╱╱╱╱╭━╮",
108
- " ┃╭╋━┳━━┳━╋╋╮╭━╮╭╯┣━┳┳╮╭╯┣━╮┣╋╯┣━┳━╮┃━┫",
109
- " ┃╰┫╋┃┃┃┃╋┃┃╰┫╋╰┫╋┃╋┃╭╯┃╋┃┻┫┃┃╋┃┻┫╋╰╋━┃",
110
- " ╰━┻━┻┻┻┫╭┻┻━┻━━┻━┻━┻╯╱╰━┻━╯╰┻━┻━┻━━┻━╯",
111
- " ╱╱╱╱╱╱╱╰╯ </>",
102
+ "░█████╗░░██████╗██████╗░██╗░░░██╗░░░░░░██████╗░██╗",
103
+ "██╔══██╗██╔════╝██╔══██╗╚██╗░██╔╝░░░░░░██╔══██╗ ║",
104
+ "██║░░██║╚█████╗░██║░░██║░╚████╔╝░█████╗██████╔╝██║",
105
+ "██║░░██║░╚═══██╗██║░░██║░░╚██╔╝░░╚════╝██╔═══╝░██║",
106
+ "╚█████╔╝██████╔╝██████╔╝░░░██║░░░░░░░░░██║░░░░░██║",
107
+ "░╚════╝░╚═════╝░╚═════╝░░░░╚═╝░░░░░░░░░╚═╝░░░░░╚═╝",
108
+ " ╭━╮╱╱╱╱╱╱╭╮╱╱╱╱╱╭╮╱╱╱╱╱╭╮╱╱╭╮╭╮╱╱╱╱╭━╮",
109
+ " ┃╭╋━┳━━┳━╋╋╮╭━╮╭╯┣━┳┳╮╭╯┣━╮┣╋╯┣━┳━╮┃━┫",
110
+ " ┃╰┫╋┃┃┃┃╋┃┃╰┫╋╰┫╋┃╋┃╭╯┃╋┃┻┫┃┃╋┃┻┫╋╰╋━┃",
111
+ " ╰━┻━┻┻┻┫╭┻┻━┻━━┻━┻━┻╯╱╰━┻━╯╰┻━┻━┻━━┻━╯",
112
+ " ╱╱╱╱╱╱╱╰╯ </>",
112
113
  ] as const;
113
114
 
114
115
  const HEADER_SIMPLE = [
115
- " ███████ █████ ███████████ ███ ",
116
- " ███░░░░░███ ░░███ ░░███░░░░░███ ░░░ ",
117
- " ███ ░░███ █████ ███████ █████ ████ ░███ ░███ ████ ",
118
- "░███ ░███ ███░░ ███░░███ ░░███ ░███ ██████████ ░██████████ ░░███ ",
119
- "░███ ░███░░█████ ░███ ░███ ░███ ░███ ░░░░░░░░░░ ░███░░░░░░ ░███ ",
120
- "░░███ ███ ░░░░███░███ ░███ ░███ ░███ ░███ ░███ ",
121
- " ░░░███████░ ██████ ░░████████ ░░███████ █████ █████",
122
- " ░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░███ ░░░░░ ░░░░░ ",
123
- " ███ ░███",
124
- " ░░██████",
125
- " ░░░░░░ </>",
116
+ " ███████ █████ ███████████ ███ ",
117
+ " ███░░░░░███ ░░███ ░░███░░░░░███ ░░░ ",
118
+ " ███ ░░███ █████ ███████ █████ ████ ░███ ░███ ████ ",
119
+ "░███ ░███ ███░░ ███░░███ ░░███ ░███ ██████████ ░██████████ ░░███ ",
120
+ "░███ ░███░░█████ ░███ ░███ ░███ ░███ ░░░░░░░░░░ ░███░░░░░░ ░███ ",
121
+ "░░███ ███ ░░░░███░███ ░███ ░███ ░███ ░███ ░███ ",
122
+ " ░░░███████░ ██████ ░░████████ ░░███████ █████ █████",
123
+ " ░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░███ ░░░░░ ░░░░░ ",
124
+ " ███ ░███",
125
+ " ░░██████",
126
+ " ░░░░░░ <ideas_compiler/>",
126
127
  ] as const;
127
128
 
128
129
  type HeaderPalette = {
129
- baseColor: string;
130
- highlightColor: string;
131
- trailColor: string;
130
+ baseColor: string;
131
+ highlightColor: string;
132
+ trailColor: string;
132
133
  };
133
134
 
134
135
  export type MascotToneKey = "b" | "h" | "l" | "m" | "d" | "p" | "c" | "v";
@@ -136,203 +137,203 @@ export type MascotToneKey = "b" | "h" | "l" | "m" | "d" | "p" | "c" | "v";
136
137
  export type MascotTonePalette = Record<MascotToneKey, string>;
137
138
 
138
139
  type HeaderVariantConfig = {
139
- label: string;
140
- header: readonly string[];
141
- headerMap?: readonly string[];
142
- headerTonePalette?: MascotTonePalette;
143
- minRowsForFull?: number;
144
- fallbackHeader?: readonly string[];
145
- fallbackLinePalette?: (lineIndex: number) => HeaderPalette;
146
- mascot?: readonly string[];
147
- mascotMap?: readonly string[];
148
- linePalette: (lineIndex: number) => HeaderPalette;
149
- mascotPalette: HeaderPalette;
150
- mascotTonePalette?: MascotTonePalette;
140
+ label: string;
141
+ header: readonly string[];
142
+ headerMap?: readonly string[];
143
+ headerTonePalette?: MascotTonePalette;
144
+ minRowsForFull?: number;
145
+ fallbackHeader?: readonly string[];
146
+ fallbackLinePalette?: (lineIndex: number) => HeaderPalette;
147
+ mascot?: readonly string[];
148
+ mascotMap?: readonly string[];
149
+ linePalette: (lineIndex: number) => HeaderPalette;
150
+ mascotPalette: HeaderPalette;
151
+ mascotTonePalette?: MascotTonePalette;
151
152
  };
152
153
 
153
154
  const CLASSIC_PALETTE: HeaderPalette = {
154
- baseColor: "accent",
155
- highlightColor: "mdHeading",
156
- trailColor: "mdLink",
155
+ baseColor: "accent",
156
+ highlightColor: "mdHeading",
157
+ trailColor: "mdLink",
157
158
  };
158
159
 
159
160
  const CLASSIC_LINK_PALETTE: HeaderPalette = {
160
- baseColor: "mdLink",
161
- highlightColor: "mdHeading",
162
- trailColor: "mdLink",
161
+ baseColor: "mdLink",
162
+ highlightColor: "mdHeading",
163
+ trailColor: "mdLink",
163
164
  };
164
165
 
165
166
  const OSDY_THEME_PINK_PALETTE: HeaderPalette = {
166
- baseColor: "accent",
167
- highlightColor: "mdHeading",
168
- trailColor: "mdLink",
167
+ baseColor: "accent",
168
+ highlightColor: "mdHeading",
169
+ trailColor: "mdLink",
169
170
  };
170
171
 
171
172
  const OSDY_THEME_CYAN_PALETTE: HeaderPalette = {
172
- baseColor: "mdLink",
173
- highlightColor: "accent",
174
- trailColor: "mdHeading",
173
+ baseColor: "mdLink",
174
+ highlightColor: "accent",
175
+ trailColor: "mdHeading",
175
176
  };
176
177
 
177
178
  const OSDY_THEME_PURPLE_PALETTE: HeaderPalette = {
178
- baseColor: "mdHeading",
179
- highlightColor: "mdLink",
180
- trailColor: "accent",
179
+ baseColor: "mdHeading",
180
+ highlightColor: "mdLink",
181
+ trailColor: "accent",
181
182
  };
182
183
 
183
184
  const OSDY_THEME_MASCOT_PALETTE: HeaderPalette = {
184
- baseColor: "mdLink",
185
- highlightColor: "accent",
186
- trailColor: "mdHeading",
185
+ baseColor: "mdLink",
186
+ highlightColor: "accent",
187
+ trailColor: "mdHeading",
187
188
  };
188
189
 
189
190
  const HTML_MASCOT_TONES: MascotTonePalette = {
190
- b: "mascotBg",
191
- h: "mascotBright",
192
- l: "mascotLight",
193
- m: "mascotMid",
194
- d: "mascotDark",
195
- p: "htmlPink",
196
- c: "mdLink",
197
- v: "mdHeading",
191
+ b: "mascotBg",
192
+ h: "mascotBright",
193
+ l: "mascotLight",
194
+ m: "mascotMid",
195
+ d: "mascotDark",
196
+ p: "htmlPink",
197
+ c: "mdLink",
198
+ v: "mdHeading",
198
199
  };
199
200
 
200
201
  type MascotArt = {
201
- mascot: readonly string[];
202
- toneMap: readonly string[];
202
+ mascot: readonly string[];
203
+ toneMap: readonly string[];
203
204
  };
204
205
 
205
206
  function sampleIndex(
206
- outputIndex: number,
207
- outputCount: number,
208
- inputCount: number,
207
+ outputIndex: number,
208
+ outputCount: number,
209
+ inputCount: number,
209
210
  ): number {
210
- if (outputCount <= 1) return 0;
211
- return Math.min(
212
- inputCount - 1,
213
- Math.round((outputIndex * (inputCount - 1)) / (outputCount - 1)),
214
- );
211
+ if (outputCount <= 1) return 0;
212
+ return Math.min(
213
+ inputCount - 1,
214
+ Math.round((outputIndex * (inputCount - 1)) / (outputCount - 1)),
215
+ );
215
216
  }
216
217
 
217
218
  function sampleLine(
218
- line: string,
219
- outputWidth: number,
220
- inputWidth: number,
219
+ line: string,
220
+ outputWidth: number,
221
+ inputWidth: number,
221
222
  ): string {
222
- const chars = Array.from(line.padEnd(inputWidth, " "));
223
- return Array.from({ length: outputWidth }, (_value, outputIndex) => {
224
- const inputIndex = sampleIndex(outputIndex, outputWidth, inputWidth);
225
- return chars[inputIndex] ?? " ";
226
- }).join("");
223
+ const chars = Array.from(line.padEnd(inputWidth, " "));
224
+ return Array.from({ length: outputWidth }, (_value, outputIndex) => {
225
+ const inputIndex = sampleIndex(outputIndex, outputWidth, inputWidth);
226
+ return chars[inputIndex] ?? " ";
227
+ }).join("");
227
228
  }
228
229
 
229
230
  function scaleMascotArt(
230
- mascot: readonly string[],
231
- toneMap: readonly string[],
232
- scale: number,
231
+ mascot: readonly string[],
232
+ toneMap: readonly string[],
233
+ scale: number,
233
234
  ): MascotArt {
234
- const inputRows = Math.min(mascot.length, toneMap.length);
235
- const inputWidth = Math.max(
236
- ...mascot.slice(0, inputRows).map((line) => Array.from(line).length),
237
- ...toneMap.slice(0, inputRows).map((line) => Array.from(line).length),
238
- );
239
- const outputRows = Math.max(1, Math.round(inputRows * scale));
240
- const outputWidth = Math.max(1, Math.round(inputWidth * scale));
235
+ const inputRows = Math.min(mascot.length, toneMap.length);
236
+ const inputWidth = Math.max(
237
+ ...mascot.slice(0, inputRows).map((line) => Array.from(line).length),
238
+ ...toneMap.slice(0, inputRows).map((line) => Array.from(line).length),
239
+ );
240
+ const outputRows = Math.max(1, Math.round(inputRows * scale));
241
+ const outputWidth = Math.max(1, Math.round(inputWidth * scale));
241
242
 
242
- return Array.from({ length: outputRows }, (_value, outputIndex) => {
243
- const inputIndex = sampleIndex(outputIndex, outputRows, inputRows);
244
- return {
245
- mascot: sampleLine(mascot[inputIndex] ?? "", outputWidth, inputWidth),
246
- toneMap: sampleLine(toneMap[inputIndex] ?? "", outputWidth, inputWidth),
247
- };
248
- }).reduce<MascotArt>(
249
- (accumulator, line) => ({
250
- mascot: [...accumulator.mascot, line.mascot],
251
- toneMap: [...accumulator.toneMap, line.toneMap],
252
- }),
253
- { mascot: [], toneMap: [] },
254
- );
243
+ return Array.from({ length: outputRows }, (_value, outputIndex) => {
244
+ const inputIndex = sampleIndex(outputIndex, outputRows, inputRows);
245
+ return {
246
+ mascot: sampleLine(mascot[inputIndex] ?? "", outputWidth, inputWidth),
247
+ toneMap: sampleLine(toneMap[inputIndex] ?? "", outputWidth, inputWidth),
248
+ };
249
+ }).reduce<MascotArt>(
250
+ (accumulator, line) => ({
251
+ mascot: [...accumulator.mascot, line.mascot],
252
+ toneMap: [...accumulator.toneMap, line.toneMap],
253
+ }),
254
+ { mascot: [], toneMap: [] },
255
+ );
255
256
  }
256
257
 
257
258
  function addRightEdgeGlow(
258
- mascot: readonly string[],
259
- toneMap: readonly string[],
259
+ mascot: readonly string[],
260
+ toneMap: readonly string[],
260
261
  ): readonly string[] {
261
- return toneMap.map((lineMap, lineIndex) => {
262
- const chars = Array.from(lineMap);
263
- const mascotLine = mascot[lineIndex] ?? "";
264
- const rightEdgeIndex = Math.max(
265
- ...Array.from(mascotLine).map((char, index) =>
266
- char === " " ? -1 : index,
267
- ),
268
- );
269
- if (rightEdgeIndex < 0) return lineMap;
270
- const glowTones = ["p", "c", "v"] as const;
271
- for (let offset = 0; offset < glowTones.length; offset += 1) {
272
- const glowTone = glowTones[offset];
273
- const index = rightEdgeIndex - offset;
274
- if (
275
- glowTone &&
276
- index >= 0 &&
277
- index < chars.length &&
278
- chars[index] !== " "
279
- ) {
280
- chars[index] = glowTone;
281
- }
282
- }
283
- return chars.join("");
284
- });
262
+ return toneMap.map((lineMap, lineIndex) => {
263
+ const chars = Array.from(lineMap);
264
+ const mascotLine = mascot[lineIndex] ?? "";
265
+ const rightEdgeIndex = Math.max(
266
+ ...Array.from(mascotLine).map((char, index) =>
267
+ char === " " ? -1 : index,
268
+ ),
269
+ );
270
+ if (rightEdgeIndex < 0) return lineMap;
271
+ const glowTones = ["p", "c", "v"] as const;
272
+ for (let offset = 0; offset < glowTones.length; offset += 1) {
273
+ const glowTone = glowTones[offset];
274
+ const index = rightEdgeIndex - offset;
275
+ if (
276
+ glowTone &&
277
+ index >= 0 &&
278
+ index < chars.length &&
279
+ chars[index] !== " "
280
+ ) {
281
+ chars[index] = glowTone;
282
+ }
283
+ }
284
+ return chars.join("");
285
+ });
285
286
  }
286
287
 
287
288
  const OSDY_THEME_MASCOT_ART = scaleMascotArt(HTML_MASCOT, HTML_MASCOT_MAP, 0.9);
288
289
  const OSDY_THEME_MASCOT_MAP = addRightEdgeGlow(
289
- OSDY_THEME_MASCOT_ART.mascot,
290
- OSDY_THEME_MASCOT_ART.toneMap,
290
+ OSDY_THEME_MASCOT_ART.mascot,
291
+ OSDY_THEME_MASCOT_ART.toneMap,
291
292
  );
292
293
 
293
294
  function osdyThemePalette(lineIndex: number): HeaderPalette {
294
- if (lineIndex < 4) return OSDY_THEME_PINK_PALETTE;
295
- if (lineIndex < 8) return OSDY_THEME_CYAN_PALETTE;
296
- return OSDY_THEME_PURPLE_PALETTE;
295
+ if (lineIndex < 4) return OSDY_THEME_PINK_PALETTE;
296
+ if (lineIndex < 8) return OSDY_THEME_CYAN_PALETTE;
297
+ return OSDY_THEME_PURPLE_PALETTE;
297
298
  }
298
299
 
299
300
  export const HEADER_VARIANTS: Record<HeaderVariant, HeaderVariantConfig> = {
300
- "osdy-theme": {
301
- label: "OsdyTheme",
302
- header: HEADER_SIMPLE,
303
- mascot: OSDY_THEME_MASCOT_ART.mascot,
304
- mascotMap: OSDY_THEME_MASCOT_MAP,
305
- linePalette: osdyThemePalette,
306
- mascotPalette: OSDY_THEME_MASCOT_PALETTE,
307
- mascotTonePalette: HTML_MASCOT_TONES,
308
- },
309
- classic: {
310
- label: "Classic",
311
- header: HEADER_CLASSIC,
312
- mascot: HTML_MASCOT,
313
- mascotMap: HTML_MASCOT_MAP,
314
- linePalette: (lineIndex) =>
315
- lineIndex >= 6 ? CLASSIC_LINK_PALETTE : CLASSIC_PALETTE,
316
- mascotPalette: OSDY_THEME_MASCOT_PALETTE,
317
- mascotTonePalette: HTML_MASCOT_TONES,
318
- },
301
+ "osdy-theme": {
302
+ label: "OsdyTheme",
303
+ header: HEADER_SIMPLE,
304
+ mascot: OSDY_THEME_MASCOT_ART.mascot,
305
+ mascotMap: OSDY_THEME_MASCOT_MAP,
306
+ linePalette: osdyThemePalette,
307
+ mascotPalette: OSDY_THEME_MASCOT_PALETTE,
308
+ mascotTonePalette: HTML_MASCOT_TONES,
309
+ },
310
+ classic: {
311
+ label: "Classic",
312
+ header: HEADER_CLASSIC,
313
+ mascot: HTML_MASCOT,
314
+ mascotMap: HTML_MASCOT_MAP,
315
+ linePalette: (lineIndex) =>
316
+ lineIndex >= 6 ? CLASSIC_LINK_PALETTE : CLASSIC_PALETTE,
317
+ mascotPalette: OSDY_THEME_MASCOT_PALETTE,
318
+ mascotTonePalette: HTML_MASCOT_TONES,
319
+ },
319
320
  };
320
321
 
321
322
  export function headerWidth(variant: HeaderVariant): number {
322
- return HEADER_VARIANTS[variant].header.reduce(
323
- (maxWidth, line) => Math.max(maxWidth, visibleWidth(line)),
324
- 0,
325
- );
323
+ return HEADER_VARIANTS[variant].header.reduce(
324
+ (maxWidth, line) => Math.max(maxWidth, visibleWidth(line)),
325
+ 0,
326
+ );
326
327
  }
327
328
 
328
329
  export function mascotWidth(variant: HeaderVariant): number {
329
- return (HEADER_VARIANTS[variant].mascot ?? []).reduce(
330
- (maxWidth, line) => Math.max(maxWidth, visibleWidth(line)),
331
- 0,
332
- );
330
+ return (HEADER_VARIANTS[variant].mascot ?? []).reduce(
331
+ (maxWidth, line) => Math.max(maxWidth, visibleWidth(line)),
332
+ 0,
333
+ );
333
334
  }
334
335
 
335
336
  export const HEADER_FALLBACK = [
336
- "OSDY - PI",
337
- "</> Compilador de ideas",
337
+ "OSDY - PI",
338
+ "</> Compilador de ideas",
338
339
  ] as const;