create-flow-os 0.0.47-dev.1772043837 → 0.0.47-dev.1772043899
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 +15 -14
package/package.json
CHANGED
package/src/init/ui.ts
CHANGED
|
@@ -9,7 +9,7 @@ const E = "\x1b[91m";
|
|
|
9
9
|
const R = "\x1b[0m";
|
|
10
10
|
const B = "\x1b[1m";
|
|
11
11
|
const DIM = "\x1b[2m";
|
|
12
|
-
const W = "\x1b[97m"; // bianco
|
|
12
|
+
const W = "\x1b[97m"; // bianco (solo per headerLogo)
|
|
13
13
|
|
|
14
14
|
const FRAMES = "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏";
|
|
15
15
|
|
|
@@ -22,24 +22,27 @@ export function pad(s: string, w: number): string {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** Riquadro con Flow OS centrato in grassetto nel bordo superiore, linea singola ─ */
|
|
25
|
-
export function bannerBox(title: string, lines: string[], color: string, w =
|
|
25
|
+
export function bannerBox(title: string, lines: string[], color: string, w = 50): string {
|
|
26
26
|
const c = color;
|
|
27
27
|
const inner = " " + c + B + title + R + " ";
|
|
28
28
|
const innerLen = stripAnsi(inner).length;
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
29
|
+
const innerW = w - 4;
|
|
30
|
+
const half = Math.max(0, Math.floor((innerW - innerLen) / 2));
|
|
31
|
+
const rest = innerW - half - innerLen;
|
|
32
|
+
const top = c + "╭" + "─".repeat(half) + inner + "─".repeat(rest) + "╮" + R;
|
|
33
|
+
const bottom = c + "╰" + "─".repeat(innerW) + "╯" + R;
|
|
34
|
+
const emptyLine = c + "│" + R + " " + " ".repeat(innerW - 2) + c + "│" + R;
|
|
35
|
+
const bodyLines = lines.map((l) => c + "│" + R + " " + pad(l, innerW - 2) + c + "│" + R);
|
|
34
36
|
return "\n" + top + "\n" + emptyLine + "\n" + bodyLines.join("\n") + "\n" + bottom + "\n";
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
export function box(lines: string[], color: string, w =
|
|
39
|
+
export function box(lines: string[], color: string, w = 50): string {
|
|
38
40
|
const c = color;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
41
|
+
const innerW = w - 4;
|
|
42
|
+
const top = c + "╭" + "─".repeat(innerW) + "╮" + R;
|
|
43
|
+
const bottom = c + "╰" + "─".repeat(innerW) + "╯" + R;
|
|
44
|
+
const emptyLine = c + "│" + R + " " + " ".repeat(innerW - 2) + c + "│" + R;
|
|
45
|
+
const body = lines.map((l) => c + "│" + R + " " + pad(l, innerW - 2) + c + "│" + R).join("\n");
|
|
43
46
|
return "\n" + top + "\n" + emptyLine + "\n" + body + "\n" + bottom + "\n";
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -90,8 +93,6 @@ export async function withLoading<T>(
|
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
const W = "\x1b[97m"; // bianco
|
|
94
|
-
|
|
95
96
|
export const colors = { V, V_LIGHT, Y, E, R, B, DIM, W };
|
|
96
97
|
|
|
97
98
|
/** Icona layers: 3 quadrati arrotondati sovrapposti, vista isometrica con shading ▓▒░ */
|