@sushant-kum/ccstatus 0.3.5 → 0.4.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.
@@ -14,7 +14,7 @@ import {
14
14
  saveConfigFile,
15
15
  snapshotPath,
16
16
  writeLinkedLines
17
- } from "./chunk-YBBGXKRW.js";
17
+ } from "./chunk-WRDBB7IU.js";
18
18
 
19
19
  // src/app.tsx
20
20
  import { Box as Box12, Text as Text12, useApp, useInput as useInput10 } from "ink";
@@ -504,7 +504,27 @@ function toAnsi(model) {
504
504
 
505
505
  // ../core/src/theme/themes.ts
506
506
  var mk = (rows) => rows.map(([fg, bg]) => ({ fg: asIndex(fg), bg: asIndex(bg) }));
507
+ var zip = (fg, bg) => fg.map((f, i) => ({ fg: asIndex(f), bg: asIndex(bg[i] ?? f) }));
507
508
  var builtinThemes = {
509
+ default: mk([
510
+ [16, 44],
511
+ [231, 20],
512
+ [16, 226],
513
+ [231, 240],
514
+ [16, 40]
515
+ ]),
516
+ nord: zip([16, 254, 231, 231, 16], [73, 239, 25, 96, 152]),
517
+ "nord-aurora": zip([231, 16, 231, 16, 16], [131, 220, 68, 108, 176]),
518
+ monokai: zip([235, 255, 235, 16, 235], [148, 238, 186, 141, 81]),
519
+ solarized: zip([231, 234, 254, 16, 234], [33, 136, 240, 37, 254]),
520
+ minimal: zip([255, 232, 255, 232, 252], [240, 251, 233, 248, 236]),
521
+ dracula: zip([235, 235, 235, 235, 231], [141, 253, 204, 117, 236]),
522
+ catppuccin: zip([235, 255, 235, 235, 235], [176, 238, 150, 210, 111]),
523
+ gruvbox: zip([16, 235, 235, 16, 235], [167, 214, 246, 109, 142]),
524
+ onedark: zip([235, 251, 235, 16, 235], [75, 237, 114, 204, 180]),
525
+ tokyonight: zip([16, 234, 16, 234, 234], [111, 248, 176, 221, 80])
526
+ };
527
+ var legacyBuiltinThemes = {
508
528
  default: mk([
509
529
  [16, 44],
510
530
  [231, 20],
@@ -593,6 +613,30 @@ var builtinThemes = {
593
613
  [231, 16]
594
614
  ])
595
615
  };
616
+ var legacyThemeAliases = {
617
+ "one-dark": "onedark",
618
+ "tokyo-night": "tokyonight",
619
+ classic: "default"
620
+ };
621
+ function sameTheme(a, b) {
622
+ return a.length === b.length && a.every((s, i) => s.fg === b[i]?.fg && s.bg === b[i]?.bg);
623
+ }
624
+ function withBuiltinThemes(saved) {
625
+ const out = {};
626
+ for (const [name, theme] of Object.entries(saved)) {
627
+ const legacy2 = legacyBuiltinThemes[name];
628
+ if (legacy2 && sameTheme(theme, legacy2)) {
629
+ continue;
630
+ }
631
+ out[name] = theme;
632
+ }
633
+ for (const [name, theme] of Object.entries(builtinThemes)) {
634
+ if (!Object.hasOwn(out, name)) {
635
+ out[name] = theme.map((s) => ({ ...s }));
636
+ }
637
+ }
638
+ return out;
639
+ }
596
640
 
597
641
  // ../core/src/toast.ts
598
642
  var TOAST_FIELDS = {
@@ -4975,15 +5019,17 @@ function loadConfig(raw) {
4975
5019
  }
4976
5020
  return layout;
4977
5021
  };
4978
- const cleaned = cleanThemes(p.themes, warn);
4979
- const themes = Object.keys(cleaned).length ? cleaned : clone2(builtinThemes);
4980
- if (!Object.hasOwn(themes, "default")) {
4981
- themes["default"] = clone2(builtinThemes["default"] ?? []);
4982
- }
5022
+ const themes = withBuiltinThemes(cleanThemes(p.themes, warn));
4983
5023
  let theme = p.theme;
4984
5024
  if (!Object.hasOwn(themes, theme)) {
4985
- warn(`theme "${theme}" not found; using "default"`);
4986
- theme = "default";
5025
+ const alias = legacyThemeAliases[theme];
5026
+ if (alias && Object.hasOwn(themes, alias)) {
5027
+ warn(`theme "${theme}" was renamed; using "${alias}"`);
5028
+ theme = alias;
5029
+ } else {
5030
+ warn(`theme "${theme}" not found; using "default"`);
5031
+ theme = "default";
5032
+ }
4987
5033
  }
4988
5034
  const config = {
4989
5035
  version: 1,
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-OX52DYX2.js");
7
+ const { runStatusline } = await import("./statusline-cmd-AL2OWYAP.js");
8
8
  await runStatusline();
9
9
  } else {
10
10
  const { render } = await import("ink");
11
- const { App } = await import("./app-TAM7W557.js");
11
+ const { App } = await import("./app-BOF26BYJ.js");
12
12
  render(/* @__PURE__ */ jsx(App, {}));
13
13
  }
@@ -6,7 +6,7 @@ import {
6
6
  render,
7
7
  snapshotPath,
8
8
  toAnsi
9
- } from "./chunk-YBBGXKRW.js";
9
+ } from "./chunk-WRDBB7IU.js";
10
10
 
11
11
  // src/statusline-cmd.ts
12
12
  function renderStatuslineAnsi(config, snapshot) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sushant-kum/ccstatus",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
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",