create-flow-os 0.0.47-dev.1772043547 → 0.0.47-dev.1772043683
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 +1 -1
- package/src/init/ui.ts +6 -4
package/package.json
CHANGED
package/src/init/ui.ts
CHANGED
|
@@ -21,23 +21,25 @@ export function pad(s: string, w: number): string {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/** Riquadro con Flow OS centrato in grassetto nel bordo superiore, linea singola ─ */
|
|
24
|
-
export function bannerBox(title: string, lines: string[], color: string, w =
|
|
24
|
+
export function bannerBox(title: string, lines: string[], color: string, w = 46): string {
|
|
25
25
|
const c = color;
|
|
26
26
|
const inner = " " + c + B + title + R + " ";
|
|
27
27
|
const innerLen = stripAnsi(inner).length;
|
|
28
28
|
const half = Math.max(0, Math.floor((w - 2 - innerLen) / 2));
|
|
29
29
|
const top = c + "╭" + "─".repeat(half) + inner + "─".repeat(w - 2 - half - innerLen) + "╮" + R;
|
|
30
30
|
const bottom = c + "╰" + "─".repeat(w - 2) + "╯" + R;
|
|
31
|
+
const emptyLine = c + "│" + R + " " + " ".repeat(w - 2) + c + "│" + R;
|
|
31
32
|
const bodyLines = lines.map((l) => c + "│" + R + " " + pad(l, w - 2) + c + "│" + R);
|
|
32
|
-
return "\n" + top + "\n" + bodyLines.join("\n") + "\n" + bottom + "\n";
|
|
33
|
+
return "\n" + top + "\n" + emptyLine + "\n" + bodyLines.join("\n") + "\n" + bottom + "\n";
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
export function box(lines: string[], color: string, w =
|
|
36
|
+
export function box(lines: string[], color: string, w = 46): string {
|
|
36
37
|
const c = color;
|
|
37
38
|
const top = c + "╭" + "─".repeat(w) + "╮" + R;
|
|
38
39
|
const bottom = c + "╰" + "─".repeat(w) + "╯" + R;
|
|
40
|
+
const emptyLine = c + "│" + R + " " + " ".repeat(w - 2) + c + "│" + R;
|
|
39
41
|
const body = lines.map((l) => c + "│" + R + " " + pad(l, w - 2) + c + "│" + R).join("\n");
|
|
40
|
-
return "\n" + top + "\n" + body + "\n" + bottom + "\n";
|
|
42
|
+
return "\n" + top + "\n" + emptyLine + "\n" + body + "\n" + bottom + "\n";
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
import type { InitProgressStep } from "./scaffold";
|