commitshow 0.3.9 → 0.3.10
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.
- package/dist/lib/render.js +94 -99
- package/package.json +1 -1
package/dist/lib/render.js
CHANGED
|
@@ -23,137 +23,132 @@ function scoreBar(value, max) {
|
|
|
23
23
|
const tone = scoreTone(Math.round((value / max) * 100));
|
|
24
24
|
return tone('▰'.repeat(filled)) + c.muted('▱'.repeat(empty));
|
|
25
25
|
}
|
|
26
|
+
// ANSI Shadow figlet font · transcribed via oh-my-logo --filled. CEO
|
|
27
|
+
// referenced the Claude Code style; Claude Code itself doesn't embed a
|
|
28
|
+
// text-as-ASCII logo (only the Clawd mascot lives in its bundle), but
|
|
29
|
+
// oh-my-logo is the open-source library that imitates the look and ANSI
|
|
30
|
+
// Shadow is the free figlet font it uses. 6 rows tall, variable width per
|
|
31
|
+
// glyph (4 to 10 cols), pre-padded so bigText concats cleanly.
|
|
26
32
|
const BIG_DIGITS = {
|
|
27
33
|
"0": [
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"11111",
|
|
34
|
+
" ██████╗ ",
|
|
35
|
+
" ██╔═████╗",
|
|
36
|
+
" ██║██╔██║",
|
|
37
|
+
" ████╔╝██║",
|
|
38
|
+
" ╚██████╔╝",
|
|
39
|
+
" ╚═════╝ ",
|
|
35
40
|
],
|
|
36
41
|
"1": [
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"01110",
|
|
42
|
+
" ██╗",
|
|
43
|
+
" ███║",
|
|
44
|
+
" ╚██║",
|
|
45
|
+
" ██║",
|
|
46
|
+
" ██║",
|
|
47
|
+
" ╚═╝",
|
|
44
48
|
],
|
|
45
49
|
"2": [
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"11111",
|
|
50
|
+
" ██████╗ ",
|
|
51
|
+
" ╚════██╗",
|
|
52
|
+
" █████╔╝",
|
|
53
|
+
" ██╔═══╝ ",
|
|
54
|
+
" ███████╗",
|
|
55
|
+
" ╚══════╝",
|
|
53
56
|
],
|
|
54
57
|
"3": [
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"11111",
|
|
58
|
+
" ██████╗ ",
|
|
59
|
+
" ╚════██╗",
|
|
60
|
+
" █████╔╝",
|
|
61
|
+
" ╚═══██╗",
|
|
62
|
+
" ██████╔╝",
|
|
63
|
+
" ╚═════╝ ",
|
|
62
64
|
],
|
|
63
65
|
"4": [
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"00001",
|
|
66
|
+
" ██╗ ██╗",
|
|
67
|
+
" ██║ ██║",
|
|
68
|
+
" ███████║",
|
|
69
|
+
" ╚════██║",
|
|
70
|
+
" ██║",
|
|
71
|
+
" ╚═╝",
|
|
71
72
|
],
|
|
72
73
|
"5": [
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"11111",
|
|
74
|
+
" ███████╗",
|
|
75
|
+
" ██╔════╝",
|
|
76
|
+
" ███████╗",
|
|
77
|
+
" ╚════██║",
|
|
78
|
+
" ███████║",
|
|
79
|
+
" ╚══════╝",
|
|
80
80
|
],
|
|
81
81
|
"6": [
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"11111",
|
|
82
|
+
" ██████╗ ",
|
|
83
|
+
" ██╔════╝ ",
|
|
84
|
+
" ███████╗ ",
|
|
85
|
+
" ██╔═══██╗",
|
|
86
|
+
" ╚██████╔╝",
|
|
87
|
+
" ╚═════╝ ",
|
|
89
88
|
],
|
|
90
89
|
"7": [
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"00001",
|
|
90
|
+
" ███████╗",
|
|
91
|
+
" ╚════██║",
|
|
92
|
+
" ██╔╝",
|
|
93
|
+
" ██╔╝ ",
|
|
94
|
+
" ██║ ",
|
|
95
|
+
" ╚═╝ ",
|
|
98
96
|
],
|
|
99
97
|
"8": [
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"11111",
|
|
98
|
+
" █████╗ ",
|
|
99
|
+
" ██╔══██╗",
|
|
100
|
+
" ╚█████╔╝",
|
|
101
|
+
" ██╔══██╗",
|
|
102
|
+
" ╚█████╔╝",
|
|
103
|
+
" ╚════╝ ",
|
|
107
104
|
],
|
|
108
105
|
"9": [
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"11111",
|
|
106
|
+
" █████╗ ",
|
|
107
|
+
" ██╔══██╗",
|
|
108
|
+
" ╚██████║",
|
|
109
|
+
" ╚═══██║",
|
|
110
|
+
" █████╔╝",
|
|
111
|
+
" ╚════╝ ",
|
|
116
112
|
],
|
|
117
113
|
"/": [
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"10000",
|
|
114
|
+
" ██╗",
|
|
115
|
+
" ██╔╝",
|
|
116
|
+
" ██╔╝ ",
|
|
117
|
+
" ██╔╝ ",
|
|
118
|
+
" ██╔╝ ",
|
|
119
|
+
" ╚═╝ ",
|
|
125
120
|
],
|
|
126
121
|
" ": [
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"00000",
|
|
122
|
+
" ",
|
|
123
|
+
" ",
|
|
124
|
+
" ",
|
|
125
|
+
" ",
|
|
126
|
+
" ",
|
|
127
|
+
" ",
|
|
134
128
|
],
|
|
135
129
|
};
|
|
136
|
-
const BIG_ROWS =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return m.map(row => row.split("").map(c => c === "1" ? PIXEL_FILL : PIXEL_BLANK).join(PIXEL_GAP));
|
|
144
|
-
}
|
|
145
|
-
/** Render a string ("68", "100", "82/100") as a pixel-grid block numeral. */
|
|
130
|
+
const BIG_ROWS = 6;
|
|
131
|
+
/** Render a string ("68", "100", "82/100") in ANSI Shadow figlet font.
|
|
132
|
+
* Each glyph already carries 1 col of leading + 1 col of trailing space,
|
|
133
|
+
* so a 1-space gutter is enough to separate adjacent digits without the
|
|
134
|
+
* tracking looking gappy. Variable-width glyphs are NOT padded — the
|
|
135
|
+
* font is a proportional shadow font and looks best when concatenated
|
|
136
|
+
* natively, exactly as `figlet` and oh-my-logo render it. */
|
|
146
137
|
function bigText(text) {
|
|
147
|
-
const rows = Array.from({ length: BIG_ROWS }, () =>
|
|
148
|
-
const
|
|
149
|
-
for (let i = 0; i <
|
|
150
|
-
const
|
|
138
|
+
const rows = Array.from({ length: BIG_ROWS }, () => '');
|
|
139
|
+
const GAP = ' ';
|
|
140
|
+
for (let i = 0; i < text.length; i++) {
|
|
141
|
+
const ch = text[i];
|
|
142
|
+
const glyph = BIG_DIGITS[ch] ?? BIG_DIGITS[' '];
|
|
151
143
|
for (let r = 0; r < BIG_ROWS; r++) {
|
|
152
|
-
rows[r] += glyph[r] + (i <
|
|
144
|
+
rows[r] += glyph[r] + (i < text.length - 1 ? GAP : '');
|
|
153
145
|
}
|
|
154
146
|
}
|
|
155
147
|
return rows;
|
|
156
148
|
}
|
|
149
|
+
/** Visible (rune) length — counts Unicode code points so the centering math
|
|
150
|
+
* treats `█` and `╔` as one column each, matching how monospace terminals
|
|
151
|
+
* render the ANSI Shadow font. */
|
|
157
152
|
function bigTextWidth(text) {
|
|
158
153
|
if (text.length === 0)
|
|
159
154
|
return 0;
|