@freesyntax/notch-cli 0.5.1 → 0.5.12
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 +18 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4301,7 +4301,7 @@ import os4 from "os";
|
|
|
4301
4301
|
import { execSync as execSync3 } from "child_process";
|
|
4302
4302
|
import chalk8 from "chalk";
|
|
4303
4303
|
var CACHE_FILE = path18.join(os4.homedir(), ".notch", "update-check.json");
|
|
4304
|
-
var CHECK_INTERVAL =
|
|
4304
|
+
var CHECK_INTERVAL = 0;
|
|
4305
4305
|
var PACKAGE_NAME = "@freesyntax/notch-cli";
|
|
4306
4306
|
var REGISTRY_URL = `https://registry.npmjs.org/${encodeURIComponent(PACKAGE_NAME)}/latest`;
|
|
4307
4307
|
async function checkForUpdates(currentVersion) {
|
|
@@ -6337,14 +6337,28 @@ function menuDismiss(state) {
|
|
|
6337
6337
|
}
|
|
6338
6338
|
function renderMenu(state) {
|
|
6339
6339
|
if (!state.visible || state.filtered.length === 0) return "";
|
|
6340
|
-
const
|
|
6341
|
-
|
|
6340
|
+
const total = state.filtered.length;
|
|
6341
|
+
let scrollTop = 0;
|
|
6342
|
+
if (state.selected >= MAX_VISIBLE) {
|
|
6343
|
+
scrollTop = state.selected - MAX_VISIBLE + 1;
|
|
6344
|
+
}
|
|
6345
|
+
if (scrollTop + MAX_VISIBLE > total) {
|
|
6346
|
+
scrollTop = Math.max(0, total - MAX_VISIBLE);
|
|
6347
|
+
}
|
|
6348
|
+
const items = state.filtered.slice(scrollTop, scrollTop + MAX_VISIBLE);
|
|
6349
|
+
const hasMore = scrollTop + MAX_VISIBLE < total;
|
|
6350
|
+
const hasAbove = scrollTop > 0;
|
|
6342
6351
|
let currentCategory = "";
|
|
6343
6352
|
const lines = [];
|
|
6344
6353
|
lines.push(chalk26.gray(" \u250C\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
6354
|
+
if (hasAbove) {
|
|
6355
|
+
const above = scrollTop;
|
|
6356
|
+
lines.push(chalk26.gray(` \u2502 ${chalk26.dim(`\u2191 ${above} more\u2026`)}${"".padEnd(40 - String(above).length)}\u2502`));
|
|
6357
|
+
}
|
|
6345
6358
|
for (let i = 0; i < items.length; i++) {
|
|
6346
6359
|
const cmd = items[i];
|
|
6347
|
-
const
|
|
6360
|
+
const absoluteIndex = scrollTop + i;
|
|
6361
|
+
const isSelected = absoluteIndex === state.selected;
|
|
6348
6362
|
if (cmd.category !== currentCategory) {
|
|
6349
6363
|
currentCategory = cmd.category;
|
|
6350
6364
|
if (i > 0) {
|