@sushant-kum/ccstatus 0.4.2 → 0.4.3
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.
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
saveConfigFile,
|
|
15
15
|
snapshotPath,
|
|
16
16
|
writeLinkedLines
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WRVJLKMW.js";
|
|
18
18
|
|
|
19
19
|
// src/app.tsx
|
|
20
20
|
import { Box as Box12, Text as Text12, useApp, useInput as useInput10 } from "ink";
|
|
@@ -677,7 +677,7 @@ var LOGO_ART = [
|
|
|
677
677
|
];
|
|
678
678
|
|
|
679
679
|
// src/version.ts
|
|
680
|
-
var VERSION = "0.4.
|
|
680
|
+
var VERSION = "0.4.3";
|
|
681
681
|
|
|
682
682
|
// src/screens/menu.tsx
|
|
683
683
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
@@ -43,7 +43,14 @@ function justify(text, width, align2) {
|
|
|
43
43
|
}
|
|
44
44
|
return text + " ".repeat(deficit);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function willMerge(cells, index) {
|
|
47
|
+
const cell = cells[index];
|
|
48
|
+
if (!cell || !cell.merge || cell.flex || index === 0) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return !(cells[index - 1]?.flex ?? true);
|
|
52
|
+
}
|
|
53
|
+
function alignColumns(lines, align2, sepWidth) {
|
|
47
54
|
const widths = [];
|
|
48
55
|
for (const cells of lines) {
|
|
49
56
|
cells.forEach((c, i) => {
|
|
@@ -53,23 +60,27 @@ function alignColumns(lines, align2) {
|
|
|
53
60
|
});
|
|
54
61
|
}
|
|
55
62
|
return lines.map(
|
|
56
|
-
(cells) => cells.map(
|
|
57
|
-
(c
|
|
58
|
-
|
|
63
|
+
(cells) => cells.map((c, i) => {
|
|
64
|
+
if (c.flex) {
|
|
65
|
+
return c;
|
|
66
|
+
}
|
|
67
|
+
const padded = justify(c.text, widths[i] ?? c.text.length, align2);
|
|
68
|
+
return { ...c, text: willMerge(cells, i) ? " ".repeat(sepWidth) + padded : padded };
|
|
69
|
+
})
|
|
59
70
|
);
|
|
60
71
|
}
|
|
61
72
|
|
|
62
73
|
// ../core/src/layout/compose.ts
|
|
63
74
|
function mergeCells(cells) {
|
|
64
75
|
const out = [];
|
|
65
|
-
|
|
76
|
+
cells.forEach((c, i) => {
|
|
66
77
|
const prev = out[out.length - 1];
|
|
67
|
-
if (
|
|
78
|
+
if (willMerge(cells, i) && prev) {
|
|
68
79
|
prev.text = `${prev.text}${c.text}`;
|
|
69
80
|
} else {
|
|
70
81
|
out.push({ ...c });
|
|
71
82
|
}
|
|
72
|
-
}
|
|
83
|
+
});
|
|
73
84
|
return out;
|
|
74
85
|
}
|
|
75
86
|
function truncate(segs, width) {
|
|
@@ -508,7 +519,8 @@ function render(config, snapshot, opts) {
|
|
|
508
519
|
const theme = Object.hasOwn(config.themes, config.theme) ? config.themes[config.theme] ?? [] : [];
|
|
509
520
|
let lineCells = surface.lines.map((items) => lineToCells(items, config, snapshot, outputs)).filter((cells) => cells.length > 0);
|
|
510
521
|
if (config.defaults.alignColumns) {
|
|
511
|
-
|
|
522
|
+
const sepWidth = config.defaults.separator === "none" ? 0 : 1;
|
|
523
|
+
lineCells = alignColumns(lineCells, config.defaults.align, sepWidth);
|
|
512
524
|
}
|
|
513
525
|
const lines = lineCells.map((cells) => assignPaletteColors(cells, theme)).map((cells) => ({
|
|
514
526
|
segments: composeLine(cells, config.defaults.separator, opts.width, config.defaults.glyph)
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
var sub = process.argv[2];
|
|
6
6
|
if (sub === "statusline") {
|
|
7
|
-
const { runStatusline } = await import("./statusline-cmd-
|
|
7
|
+
const { runStatusline } = await import("./statusline-cmd-APRACBI7.js");
|
|
8
8
|
await runStatusline();
|
|
9
9
|
} else {
|
|
10
10
|
const { render } = await import("ink");
|
|
11
|
-
const { App } = await import("./app-
|
|
11
|
+
const { App } = await import("./app-UUOO5VUF.js");
|
|
12
12
|
render(/* @__PURE__ */ jsx(App, {}));
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sushant-kum/ccstatus",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Interactive configurator (npx @sushant-kum/ccstatus) for the ccstatus Claude Code status bar — band, status line, pane, and threshold toasts from one config.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sushant Kumar",
|