pi-arsenal 0.1.4 → 0.2.0
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/extensions/startup-splash.ts +7 -7
- package/extensions/workspace-drawer.ts +793 -510
- package/package.json +1 -1
|
@@ -142,13 +142,13 @@ function paint(line: string, colors: string, theme: Theme): string {
|
|
|
142
142
|
|
|
143
143
|
function splash(theme: Theme, width: number): string[] {
|
|
144
144
|
const label = `${theme.bold(theme.fg("error", "◆"))}${theme.fg("text", " ID: 沫路")} ${theme.fg("dim", "// PI ARSENAL")}`;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
return ["", ...PORTRAIT.map((line, index) => center(paint(line, COLOR_MASK[index] || "", theme))), "", ...ARSENAL_LOGO.map(
|
|
145
|
+
// Use a single block width so PORTRAIT, ARSENAL_LOGO, and label all share
|
|
146
|
+
// the same centre point and never drift apart on wide terminals.
|
|
147
|
+
const blockWidth = Math.max(...PORTRAIT.map(visibleWidth), ...ARSENAL_LOGO.map(visibleWidth), visibleWidth(label));
|
|
148
|
+
if (width < blockWidth) return [truncateToWidth(label, width)];
|
|
149
|
+
const pad = " ".repeat(Math.max(0, Math.floor((width - blockWidth) / 2)));
|
|
150
|
+
const center = (line: string) => pad + line;
|
|
151
|
+
return ["", ...PORTRAIT.map((line, index) => center(paint(line, COLOR_MASK[index] || "", theme))), "", ...ARSENAL_LOGO.map((line) => center(theme.fg("error", line))), center(label), ""];
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
export default function startupSplash(pi: ExtensionAPI) {
|