pyre-cli 9.1.0 → 9.3.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/dist/index.js CHANGED
@@ -2491,6 +2491,7 @@ var state = {
2491
2491
  splashEnabled: config.splashEnabled,
2492
2492
  splashColorScheme: config.splashColorScheme,
2493
2493
  splashAnimation: config.splashAnimation,
2494
+ menuSelectionIndex: 0,
2494
2495
  readmeScrollOffset: 0
2495
2496
  };
2496
2497
  function setStatus(msg, ms = 3e3) {
@@ -3105,37 +3106,39 @@ function checkAlerts(data) {
3105
3106
  }
3106
3107
  function renderSplashMenu(cols, rows) {
3107
3108
  const out = [];
3109
+ const contentLines = [];
3108
3110
  const logo = [
3109
- chalk4.hex("#ff6004").bold(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"),
3110
- chalk4.hex("#ff8004").bold(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D"),
3111
- chalk4.hex("#ffa004").bold(" \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 "),
3112
- chalk4.hex("#ffc004").bold(" \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u255A\u2588\u2588\u2554\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D "),
3113
- chalk4.hex("#ffe004").bold(" \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"),
3114
- chalk4.hex("#ffff40").bold(" \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D")
3111
+ chalk4.hex("#ff6004").bold("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"),
3112
+ chalk4.hex("#ff8004").bold("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D"),
3113
+ chalk4.hex("#ffa004").bold("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 "),
3114
+ chalk4.hex("#ffc004").bold("\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u255A\u2588\u2588\u2554\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D "),
3115
+ chalk4.hex("#ffe004").bold("\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"),
3116
+ chalk4.hex("#ffff40").bold("\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D")
3115
3117
  ];
3116
3118
  const menuTop = Math.max(0, Math.floor(rows / 2) - 8);
3117
3119
  for (let i = 0; i < menuTop; i++) out.push("");
3118
- const padding = Math.max(0, Math.floor((cols - 50) / 2));
3119
- const padStr = " ".repeat(padding);
3120
- for (const line of logo) {
3121
- out.push(padStr + line);
3122
- }
3123
- out.push("");
3124
- out.push(padStr + chalk4.dim(" system monitor v9.0.0"));
3125
- out.push("");
3126
- out.push("");
3120
+ for (const line of logo) contentLines.push(line);
3121
+ contentLines.push("");
3122
+ contentLines.push(chalk4.dim("system monitor v9.0.0"));
3123
+ contentLines.push("");
3124
+ contentLines.push("");
3127
3125
  for (let i = 0; i < MENU_OPTIONS.length; i++) {
3128
3126
  const isSelected = i === state.menuSelectionIndex;
3129
3127
  const opt = MENU_OPTIONS[i];
3130
3128
  const prefix = isSelected ? chalk4.cyan.bold(" \u25B6 ") : " ";
3131
3129
  const text = isSelected ? chalk4.bgCyan.black(` ${opt} `) : chalk4.dim(` ${opt} `);
3132
- out.push(padStr + " " + prefix + text);
3133
- }
3134
- out.push("");
3135
- out.push("");
3136
- out.push(padStr + chalk4.dim(" Use \u2191/\u2193 to navigate, Enter to select"));
3137
- while (out.length < rows) out.push("");
3138
- return out.map((l) => fitVisible(l, cols));
3130
+ contentLines.push(prefix + text);
3131
+ }
3132
+ contentLines.push("");
3133
+ contentLines.push("");
3134
+ contentLines.push(chalk4.dim("Use \u2191/\u2193 to navigate, Enter to select"));
3135
+ while (contentLines.length + menuTop < rows) contentLines.push("");
3136
+ const maxWidth = Math.max(...contentLines.map(visLen));
3137
+ const padding = Math.max(0, Math.floor((cols - maxWidth) / 2));
3138
+ const padStr = " ".repeat(padding);
3139
+ const fit = (l) => padStr + fitVisible(l, cols - padding);
3140
+ for (const line of contentLines) out.push(fit(line));
3141
+ return out;
3139
3142
  }
3140
3143
  var cachedReadmeLines = null;
3141
3144
  function getReadmeLines() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyre-cli",
3
- "version": "9.1.0",
3
+ "version": "9.3.0",
4
4
  "description": "CLI Mac monitoring tool: temps, system stats, live dashboard, packet monitor, battery predictor, export",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -463,21 +463,20 @@ function renderSplashMenu(cols: number, rows: number): string[] {
463
463
  const out: string[] = [];
464
464
  const contentLines: string[] = [];
465
465
  const logo = [
466
- chalk.hex('#ff6004').bold(' ██████╗ ██╗ ██╗██████╗ ███████╗'),
467
- chalk.hex('#ff8004').bold(' ██╔══██╗╚██╗ ██╔╝██╔══██╗██╔════╝'),
468
- chalk.hex('#ffa004').bold(' ██████╔╝ ╚████╔╝ ██████╔╝█████╗ '),
469
- chalk.hex('#ffc004').bold(' ██╔═══╝ ╚██╔╝ ██╔══██╗██╔══╝ '),
470
- chalk.hex('#ffe004').bold(' ██║ ██║ ██║ ██║███████╗'),
471
- chalk.hex('#ffff40').bold(' ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝')
466
+ chalk.hex('#ff6004').bold('██████╗ ██╗ ██╗██████╗ ███████╗'),
467
+ chalk.hex('#ff8004').bold('██╔══██╗╚██╗ ██╔╝██╔══██╗██╔════╝'),
468
+ chalk.hex('#ffa004').bold('██████╔╝ ╚████╔╝ ██████╔╝█████╗ '),
469
+ chalk.hex('#ffc004').bold('██╔═══╝ ╚██╔╝ ██╔══██╗██╔══╝ '),
470
+ chalk.hex('#ffe004').bold('██║ ██║ ██║ ██║███████╗'),
471
+ chalk.hex('#ffff40').bold('╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝')
472
472
  ];
473
473
 
474
474
  const menuTop = Math.max(0, Math.floor(rows / 2) - 8);
475
475
  for (let i = 0; i < menuTop; i++) out.push('');
476
476
 
477
- const strip = (s: string) => s.replace(/^(\x1b\[[0-9;]*m)+( +)/, '$1');
478
- for (const line of logo) contentLines.push(strip(line));
477
+ for (const line of logo) contentLines.push(line);
479
478
  contentLines.push('');
480
- contentLines.push(strip(chalk.dim(' system monitor v9.0.0')));
479
+ contentLines.push(chalk.dim('system monitor v9.0.0'));
481
480
  contentLines.push('');
482
481
  contentLines.push('');
483
482
 
@@ -491,13 +490,14 @@ function renderSplashMenu(cols: number, rows: number): string[] {
491
490
 
492
491
  contentLines.push('');
493
492
  contentLines.push('');
494
- contentLines.push(strip(chalk.dim(' Use ↑/↓ to navigate, Enter to select')));
493
+ contentLines.push(chalk.dim('Use ↑/↓ to navigate, Enter to select'));
495
494
 
496
- while (contentLines.length < rows) contentLines.push('');
495
+ while (contentLines.length + menuTop < rows) contentLines.push('');
497
496
  const maxWidth = Math.max(...contentLines.map(visLen));
498
497
  const padding = Math.max(0, Math.floor((cols - maxWidth) / 2));
499
498
  const padStr = ' '.repeat(padding);
500
- for (const line of contentLines) out.push(padStr + fitVisible(line, cols));
499
+ const fit = (l: string) => padStr + fitVisible(l, cols - padding);
500
+ for (const line of contentLines) out.push(fit(line));
501
501
  return out;
502
502
  }
503
503
 
package/src/live/state.ts CHANGED
@@ -132,6 +132,7 @@ const state = {
132
132
  splashEnabled: config.splashEnabled,
133
133
  splashColorScheme: config.splashColorScheme as SplashColorScheme,
134
134
  splashAnimation: config.splashAnimation as SplashAnimation,
135
+ menuSelectionIndex: 0,
135
136
  readmeScrollOffset: 0,
136
137
  };
137
138