unicode-animations 1.0.0 → 1.0.1
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/package.json +4 -1
- package/scripts/postinstall.cjs +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unicode-animations",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Unicode spinner animations as raw frame data",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -61,5 +61,8 @@
|
|
|
61
61
|
"tsup": "^8.4.0",
|
|
62
62
|
"typescript": "^5.7.0",
|
|
63
63
|
"vitest": "^3.0.0"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"unicode-animations": "^1.0.0"
|
|
64
67
|
}
|
|
65
68
|
}
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -36,6 +36,7 @@ try {
|
|
|
36
36
|
const R = '\x1B[0m';
|
|
37
37
|
const HIDE = '\x1B[?25l';
|
|
38
38
|
const SHOW = '\x1B[?25h';
|
|
39
|
+
const CL = '\x1B[2K';
|
|
39
40
|
|
|
40
41
|
out.write(HIDE);
|
|
41
42
|
const cleanup = () => { try { out.write(SHOW); } catch {} };
|
|
@@ -114,21 +115,21 @@ try {
|
|
|
114
115
|
line += B + pad(frame, colFPad[c]) + R + ' ' + D + pad(name, NPAD) + R;
|
|
115
116
|
if (c < 2) line += ' ';
|
|
116
117
|
}
|
|
117
|
-
buf += line + '\n';
|
|
118
|
+
buf += CL + line + '\n';
|
|
118
119
|
}
|
|
119
120
|
return buf;
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
// ─── Print static top ───
|
|
123
124
|
let top = '\n';
|
|
124
|
-
top += topCrop + '\n';
|
|
125
|
-
top += '\n';
|
|
125
|
+
top += CL + topCrop + '\n';
|
|
126
|
+
top += CL + '\n';
|
|
126
127
|
for (let i = 0; i < titleLines.length; i++) {
|
|
127
128
|
const style = i === titleLines.length - 1 ? D : B;
|
|
128
|
-
top += contentPad + style + titleLines[i] + R + '\n';
|
|
129
|
+
top += CL + contentPad + style + titleLines[i] + R + '\n';
|
|
129
130
|
}
|
|
130
|
-
top += contentPad + D + 'BRAILLE ANIMATIONS' + R + '\n';
|
|
131
|
-
top += '\n';
|
|
131
|
+
top += CL + contentPad + D + 'BRAILLE ANIMATIONS' + R + '\n';
|
|
132
|
+
top += CL + '\n';
|
|
132
133
|
out.write(top);
|
|
133
134
|
|
|
134
135
|
// ─── Print first frame of spinners ───
|
|
@@ -142,7 +143,7 @@ try {
|
|
|
142
143
|
if (Date.now() - start >= DURATION) {
|
|
143
144
|
clearInterval(timer);
|
|
144
145
|
// Print static bottom
|
|
145
|
-
let bot = '\n';
|
|
146
|
+
let bot = CL + '\n';
|
|
146
147
|
const cmds = [
|
|
147
148
|
['npx unicode-animations', 'demo all spinners'],
|
|
148
149
|
['npx unicode-animations --list', 'list all spinners'],
|
|
@@ -150,10 +151,10 @@ try {
|
|
|
150
151
|
];
|
|
151
152
|
for (const [left, right] of cmds) {
|
|
152
153
|
const gap = ' '.repeat(Math.max(2, contentW - left.length - right.length));
|
|
153
|
-
bot += contentPad + D + left + R + gap + D + right + R + '\n';
|
|
154
|
+
bot += CL + contentPad + D + left + R + gap + D + right + R + '\n';
|
|
154
155
|
}
|
|
155
|
-
bot += '\n';
|
|
156
|
-
bot += botCrop + '\n\n';
|
|
156
|
+
bot += CL + '\n';
|
|
157
|
+
bot += CL + botCrop + '\n\n';
|
|
157
158
|
out.write(bot);
|
|
158
159
|
cleanup();
|
|
159
160
|
return;
|