claude-statusline-powerline
Version:
Beautiful powerline-style statusline for Claude Code with git integration, session tracking, and cost monitoring
46 lines • 1.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.create_styled_separator = create_styled_separator;
const font_profiles_1 = require("../font-profiles");
const ansi_1 = require("../utils/ansi");
// Mapping of styles to separator keys with fallback behavior
const SEPARATOR_STYLE_MAP = {
thin: { key: 'right_thin' },
thick: { key: 'right' },
flame: { key: 'angly2', fallback: 'right' },
wave: { key: 'curvy', fallback: 'right' },
lightning: { key: 'angly', fallback: 'right' },
curvy: { key: 'curvy', fallback: 'right' },
angly: { key: 'angly', fallback: 'right' },
angly2: { key: 'angly2', fallback: 'right' },
double_chevron: { key: 'double_chevron', fallback: 'right' },
none: { key: 'none' },
};
function get_separator_char(style, separators) {
if (style === 'none')
return '';
const mapping = SEPARATOR_STYLE_MAP[style];
if (!mapping)
return separators.basic.right;
// Try basic first for thin/thick
if (mapping.key === 'right_thin' || mapping.key === 'right') {
return separators.basic[mapping.key];
}
// Try extra separators with fallback
const separator = separators.extra[mapping.key];
if (separator)
return separator;
// Use fallback if available
if (mapping.fallback) {
return separators.basic[mapping.fallback];
}
return separators.basic.right;
}
function create_styled_separator(from_color, to_color = '', style = 'thick', font_profile_name) {
if (style === 'none')
return '';
const font_profile = (0, font_profiles_1.get_font_profile)(font_profile_name);
const separator_char = get_separator_char(style, font_profile.separators);
return `${to_color}${from_color}${separator_char}${ansi_1.ANSI_RESET}`;
}
//# sourceMappingURL=styles.js.map