@sushant-kum/ccstatus 0.4.1 → 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";
|
|
@@ -663,6 +663,23 @@ function Items({ config, setConfig, goHome }) {
|
|
|
663
663
|
// src/screens/menu.tsx
|
|
664
664
|
import { Box as Box6, Text as Text6, useInput as useInput4 } from "ink";
|
|
665
665
|
import { useState as useState4 } from "react";
|
|
666
|
+
|
|
667
|
+
// src/logo-art.ts
|
|
668
|
+
var LOGO_ART = [
|
|
669
|
+
[[null, "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], [null, "#14171c"]],
|
|
670
|
+
[["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#1a191d"], ["#14171c", "#693a2c"], ["#14171c", "#322422"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#707275"], ["#14171c", "#5d5f63"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"]],
|
|
671
|
+
[["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#1a191d"], ["#1a191d", "#924b33"], ["#924b33", "#c15f3c"], ["#c15f3c", "#a15236"], ["#76402e", "#211c1e"], ["#14171c", "#8d8e91"], ["#8d8e91", "#ffffff"], ["#ffffff", "#f0f0f0"], ["#d4d4d5", "#44464a"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"]],
|
|
672
|
+
[["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#1a191d", "#874731"], ["#924b33", "#c15f3c"], ["#c15f3c", "#a15236"], ["#a15236", "#211c1e"], ["#211c1e", "#76787b"], ["#8d8f91", "#ffffff"], ["#ffffff", "#f0f0f0"], ["#f0f0f0", "#44464a"], ["#44464a", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"]],
|
|
673
|
+
[["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#874731", "#1a191d"], ["#c15f3c", "#924b33"], ["#a15236", "#c15f3c"], ["#211c1e", "#a15236"], ["#76787b", "#211c1e"], ["#ffffff", "#8d8e91"], ["#f0f0f0", "#ffffff"], ["#44464a", "#f0f0f0"], ["#14171c", "#44464a"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"]],
|
|
674
|
+
[["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#1a191d", "#14171c"], ["#924b33", "#1a191d"], ["#c15f3c", "#924b33"], ["#a15236", "#c15f3c"], ["#211c1e", "#76402e"], ["#8d8e91", "#14171c"], ["#ffffff", "#8d8e91"], ["#f0f0f0", "#ffffff"], ["#44464a", "#d4d4d5"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"]],
|
|
675
|
+
[["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#1a191d", "#14171c"], ["#693a2c", "#14171c"], ["#332422", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#707275", "#14171c"], ["#5d5f63", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"]],
|
|
676
|
+
[["#14171c", null], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", "#14171c"], ["#14171c", null]]
|
|
677
|
+
];
|
|
678
|
+
|
|
679
|
+
// src/version.ts
|
|
680
|
+
var VERSION = "0.4.3";
|
|
681
|
+
|
|
682
|
+
// src/screens/menu.tsx
|
|
666
683
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
667
684
|
var ITEMS = [
|
|
668
685
|
["items", "Edit items"],
|
|
@@ -676,9 +693,32 @@ var ITEMS = [
|
|
|
676
693
|
["save", "Save & quit"],
|
|
677
694
|
["quit", "Quit without saving"]
|
|
678
695
|
];
|
|
696
|
+
function isTrueColor() {
|
|
697
|
+
const ct = process.env.COLORTERM;
|
|
698
|
+
return ct === "truecolor" || ct === "24bit";
|
|
699
|
+
}
|
|
700
|
+
function Cell({ cell }) {
|
|
701
|
+
const [top, bottom] = cell;
|
|
702
|
+
if (top && bottom) {
|
|
703
|
+
return /* @__PURE__ */ jsx5(Text6, { color: top, backgroundColor: bottom, children: "\u2580" });
|
|
704
|
+
}
|
|
705
|
+
if (top) {
|
|
706
|
+
return /* @__PURE__ */ jsx5(Text6, { color: top, children: "\u2580" });
|
|
707
|
+
}
|
|
708
|
+
if (bottom) {
|
|
709
|
+
return /* @__PURE__ */ jsx5(Text6, { color: bottom, children: "\u2584" });
|
|
710
|
+
}
|
|
711
|
+
return /* @__PURE__ */ jsx5(Text6, { children: " " });
|
|
712
|
+
}
|
|
713
|
+
function Logo() {
|
|
714
|
+
if (!isTrueColor()) {
|
|
715
|
+
return /* @__PURE__ */ jsx5(Text6, { color: "#c15f3c", children: "\u25C0\u25C0" });
|
|
716
|
+
}
|
|
717
|
+
return /* @__PURE__ */ jsx5(Box6, { flexDirection: "column", children: LOGO_ART.map((row, r) => /* @__PURE__ */ jsx5(Box6, { children: row.map((cell, c) => /* @__PURE__ */ jsx5(Cell, { cell }, c)) }, r)) });
|
|
718
|
+
}
|
|
679
719
|
function Menu({ onSelect }) {
|
|
680
720
|
const [i, setI] = useState4(0);
|
|
681
|
-
useInput4((
|
|
721
|
+
useInput4((_input, key) => {
|
|
682
722
|
if (key.upArrow) {
|
|
683
723
|
setI((v) => Math.max(0, v - 1));
|
|
684
724
|
} else if (key.downArrow) {
|
|
@@ -691,7 +731,19 @@ function Menu({ onSelect }) {
|
|
|
691
731
|
}
|
|
692
732
|
});
|
|
693
733
|
return /* @__PURE__ */ jsxs5(Box6, { flexDirection: "column", children: [
|
|
694
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ jsxs5(Box6, { marginBottom: 1, children: [
|
|
735
|
+
/* @__PURE__ */ jsx5(Logo, {}),
|
|
736
|
+
/* @__PURE__ */ jsxs5(Box6, { flexDirection: "column", marginLeft: 2, children: [
|
|
737
|
+
/* @__PURE__ */ jsxs5(Text6, { children: [
|
|
738
|
+
/* @__PURE__ */ jsx5(Text6, { bold: true, children: "ccstatus" }),
|
|
739
|
+
/* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
|
|
740
|
+
" v",
|
|
741
|
+
VERSION
|
|
742
|
+
] })
|
|
743
|
+
] }),
|
|
744
|
+
/* @__PURE__ */ jsx5(Text6, { dimColor: true, children: "configurator" })
|
|
745
|
+
] })
|
|
746
|
+
] }),
|
|
695
747
|
ITEMS.map(([id, label], idx) => /* @__PURE__ */ jsxs5(Text6, { color: idx === i ? "cyan" : void 0, children: [
|
|
696
748
|
idx === i ? "\u25B8 " : " ",
|
|
697
749
|
label
|
|
@@ -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",
|