spirewise 1.9.3 → 1.9.4
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/bin/cli.js +5 -4
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -225,7 +225,7 @@ const live = (s) => { if (IS_TTY) process.stdout.write('\r\x1b[2K' + s); };
|
|
|
225
225
|
const liveEnd = (s) => { if (IS_TTY) process.stdout.write('\r\x1b[2K' + s + '\n'); else console.log(s); };
|
|
226
226
|
|
|
227
227
|
// --- Interactive prompt (Clack / Appwrite style) ---------------------------
|
|
228
|
-
function interactiveSelect({ title, subtitle, items, multi = true, preselected = [], pageSize =
|
|
228
|
+
function interactiveSelect({ title, subtitle, items, multi = true, preselected = [], pageSize = 5, step = 1 }) {
|
|
229
229
|
return new Promise((resolve) => {
|
|
230
230
|
const stdin = process.stdin, stdout = process.stdout;
|
|
231
231
|
if (!stdin.isTTY) { resolve(null); return; }
|
|
@@ -256,7 +256,6 @@ function interactiveSelect({ title, subtitle, items, multi = true, preselected =
|
|
|
256
256
|
if (subtitle) lines.push(railLn(paint(RAW.dim, subtitle)));
|
|
257
257
|
lines.push(railLn(paint(RAW.dim, nav)));
|
|
258
258
|
lines.push(rail()); // space before the list
|
|
259
|
-
if (items.length > PAGE && start > 0) lines.push(railLn(paint(RAW.dim, '↑ more')));
|
|
260
259
|
for (let i = start; i < end; i++) {
|
|
261
260
|
const it = items[i];
|
|
262
261
|
const on = i === index;
|
|
@@ -269,8 +268,10 @@ function interactiveSelect({ title, subtitle, items, multi = true, preselected =
|
|
|
269
268
|
lines.push(`${rail()} ${ptr} ${mark} ${label}${hint}`);
|
|
270
269
|
}
|
|
271
270
|
if (items.length > PAGE) {
|
|
272
|
-
lines.push(rail()); // space
|
|
273
|
-
|
|
271
|
+
lines.push(rail()); // space below the list
|
|
272
|
+
const atEnd = end >= items.length;
|
|
273
|
+
const note = atEnd ? 'end of list · move up' : '↓ more · move up / down';
|
|
274
|
+
lines.push(railLn(paint(RAW.dim, `${note} ${index + 1}/${items.length}`)));
|
|
274
275
|
}
|
|
275
276
|
lines.push(rail()); // trailing space below the step
|
|
276
277
|
|
package/package.json
CHANGED