ccstatusline 2.1.8 → 2.1.9

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/README.md CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  ## 🆕 Recent Updates
48
48
 
49
- ### v2.1.0 - v2.1.8 - Usage widgets, links, new git insertions / deletions widgets, and reliability fixes
49
+ ### v2.1.0 - v2.1.9 - Usage widgets, links, new git insertions / deletions widgets, and reliability fixes
50
50
 
51
51
  - **🧩 New Usage widgets (v2.1.0)** - Added **Session Usage**, **Weekly Usage**, **Block Reset Timer**, and **Context Bar** widgets.
52
52
  - **📊 More accurate counts (v2.1.0)** - Usage/context widgets now use new statusline JSON metrics when available for more accurate token and context counts.
@@ -57,6 +57,7 @@
57
57
  - **🧠 Context format fallback fix (v2.1.6)** - When `context_window_size` is missing, context widgets now infer 1M models from long-context labels such as `[1m]` and `1M context` in model identifiers.
58
58
  - **⏳ Weekly reset timer split (v2.1.7)** - Added a separate `Weekly Reset Timer` widget.
59
59
  - **⚙️ Custom config file flag (v2.1.8)** - Added `--config <path>` support so ccstatusline can load/save settings from a custom file location.
60
+ - **🔣 Unicode separator hex input upgrade (v2.1.9)** - Powerline separator hex input now supports 4-6 digits (full Unicode code points up to `U+10FFFF`).
60
61
 
61
62
  ### v2.0.26 - v2.0.29 - Performance, git internals, and workflow improvements
62
63
 
@@ -51584,7 +51584,7 @@ import { execSync as execSync3 } from "child_process";
51584
51584
  import * as fs5 from "fs";
51585
51585
  import * as path4 from "path";
51586
51586
  var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
51587
- var PACKAGE_VERSION = "2.1.8";
51587
+ var PACKAGE_VERSION = "2.1.9";
51588
51588
  function getPackageVersion() {
51589
51589
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
51590
51590
  return PACKAGE_VERSION;
@@ -52138,23 +52138,27 @@ function applyColors(text, foregroundColor, backgroundColor, bold, colorLevel =
52138
52138
  if (!foregroundColor && !backgroundColor && !bold) {
52139
52139
  return text;
52140
52140
  }
52141
- let result = text;
52141
+ let prefix = "";
52142
+ let suffix = "";
52143
+ if (bold) {
52144
+ prefix += "\x1B[1m";
52145
+ suffix = "\x1B[22m" + suffix;
52146
+ }
52142
52147
  if (backgroundColor) {
52143
- const bgChalk = getChalkColor(backgroundColor, colorLevel, true);
52144
- if (bgChalk) {
52145
- result = bgChalk(result);
52148
+ const bgCode = getColorAnsiCode(backgroundColor, colorLevel, true);
52149
+ if (bgCode) {
52150
+ prefix += bgCode;
52151
+ suffix = "\x1B[49m" + suffix;
52146
52152
  }
52147
52153
  }
52148
52154
  if (foregroundColor) {
52149
- const fgChalk = getChalkColor(foregroundColor, colorLevel, false);
52150
- if (fgChalk) {
52151
- result = fgChalk(result);
52155
+ const fgCode = getColorAnsiCode(foregroundColor, colorLevel, false);
52156
+ if (fgCode) {
52157
+ prefix += fgCode;
52158
+ suffix = "\x1B[39m" + suffix;
52152
52159
  }
52153
52160
  }
52154
- if (bold) {
52155
- result = source_default.bold(result);
52156
- }
52157
- return result;
52161
+ return prefix + text + suffix;
52158
52162
  }
52159
52163
  function getColorAnsiCode(colorName, colorLevel = "ansi16", isBackground = false) {
52160
52164
  if (!colorName)
@@ -59901,8 +59905,9 @@ var PowerlineSeparatorEditor = ({
59901
59905
  const inversionText = mode === "separator" && invertBg ? " [Inverted]" : "";
59902
59906
  return `${preset.char} - ${preset.name}${inversionText}`;
59903
59907
  }
59904
- const hexCode = char.charCodeAt(0).toString(16).toUpperCase().padStart(4, "0");
59905
- return `${char} - Custom (\\u${hexCode})${invertBg ? " [Inverted]" : ""}`;
59908
+ const codePoint = char.codePointAt(0) ?? 0;
59909
+ const hexCode = codePoint.toString(16).toUpperCase().padStart(4, "0");
59910
+ return `${char} - Custom (U+${hexCode})${invertBg ? " [Inverted]" : ""}`;
59906
59911
  };
59907
59912
  const updateSeparators = (newSeparators, newInvertBgs) => {
59908
59913
  const updatedPowerline = { ...powerlineConfig };
@@ -59930,23 +59935,26 @@ var PowerlineSeparatorEditor = ({
59930
59935
  setHexInput("");
59931
59936
  setCursorPos(0);
59932
59937
  } else if (key.return) {
59933
- if (hexInput.length === 4) {
59934
- const char = String.fromCharCode(parseInt(hexInput, 16));
59935
- const newSeparators = [...separators];
59936
- if (separators.length === 0) {
59937
- newSeparators.push(char);
59938
- } else {
59939
- newSeparators[selectedIndex] = char;
59938
+ if (hexInput.length >= 4 && hexInput.length <= 6) {
59939
+ const codePoint = parseInt(hexInput, 16);
59940
+ if (codePoint >= 0 && codePoint <= 1114111) {
59941
+ const char = String.fromCodePoint(codePoint);
59942
+ const newSeparators = [...separators];
59943
+ if (separators.length === 0) {
59944
+ newSeparators.push(char);
59945
+ } else {
59946
+ newSeparators[selectedIndex] = char;
59947
+ }
59948
+ updateSeparators(newSeparators);
59949
+ setHexInputMode(false);
59950
+ setHexInput("");
59951
+ setCursorPos(0);
59940
59952
  }
59941
- updateSeparators(newSeparators);
59942
- setHexInputMode(false);
59943
- setHexInput("");
59944
- setCursorPos(0);
59945
59953
  }
59946
59954
  } else if (key.backspace && cursorPos > 0) {
59947
59955
  setHexInput(hexInput.slice(0, cursorPos - 1) + hexInput.slice(cursorPos));
59948
59956
  setCursorPos(cursorPos - 1);
59949
- } else if (shouldInsertInput(input, key) && /[0-9a-fA-F]/.test(input) && hexInput.length < 4) {
59957
+ } else if (shouldInsertInput(input, key) && /[0-9a-fA-F]/.test(input) && hexInput.length < 6) {
59950
59958
  setHexInput(hexInput.slice(0, cursorPos) + input.toUpperCase() + hexInput.slice(cursorPos));
59951
59959
  setCursorPos(cursorPos + 1);
59952
59960
  }
@@ -60070,7 +60078,7 @@ var PowerlineSeparatorEditor = ({
60070
60078
  children: [
60071
60079
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
60072
60080
  children: [
60073
- "Enter 4-digit hex code for",
60081
+ "Enter hex code (4-6 digits) for",
60074
60082
  " ",
60075
60083
  mode === "separator" ? "separator" : "cap",
60076
60084
  separators.length > 0 ? ` ${selectedIndex + 1}` : "",
@@ -60079,7 +60087,7 @@ var PowerlineSeparatorEditor = ({
60079
60087
  }, undefined, true, undefined, this),
60080
60088
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
60081
60089
  children: [
60082
- "\\u",
60090
+ "U+",
60083
60091
  hexInput.slice(0, cursorPos),
60084
60092
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
60085
60093
  backgroundColor: "gray",
@@ -60087,15 +60095,19 @@ var PowerlineSeparatorEditor = ({
60087
60095
  children: hexInput[cursorPos] ?? "_"
60088
60096
  }, undefined, false, undefined, this),
60089
60097
  hexInput.slice(cursorPos + 1),
60090
- hexInput.length < 4 && hexInput.length === cursorPos && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
60098
+ hexInput.length < 6 && hexInput.length === cursorPos && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
60091
60099
  dimColor: true,
60092
- children: "_".repeat(4 - hexInput.length - 1)
60100
+ children: "_".repeat(6 - hexInput.length - 1)
60093
60101
  }, undefined, false, undefined, this)
60094
60102
  ]
60095
60103
  }, undefined, true, undefined, this),
60096
60104
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
60097
60105
  dimColor: true,
60098
- children: "Enter 4 hex digits (0-9, A-F), then press Enter. ESC to cancel."
60106
+ children: "Enter 4-6 hex digits (0-9, A-F) for a Unicode code point, then press Enter. ESC to cancel."
60107
+ }, undefined, false, undefined, this),
60108
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
60109
+ dimColor: true,
60110
+ children: "Examples: E0B0 (powerline), 1F984 (\uD83E\uDD84), 2764 (❤)"
60099
60111
  }, undefined, false, undefined, this)
60100
60112
  ]
60101
60113
  }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",