ccstatusline 2.2.2 → 2.2.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.
- package/dist/ccstatusline.js +1354 -1230
- package/package.json +1 -1
package/dist/ccstatusline.js
CHANGED
|
@@ -56103,7 +56103,7 @@ function getTerminalWidth() {
|
|
|
56103
56103
|
function canDetectTerminalWidth() {
|
|
56104
56104
|
return probeTerminalWidth() !== null;
|
|
56105
56105
|
}
|
|
56106
|
-
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.
|
|
56106
|
+
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.3";
|
|
56107
56107
|
var init_terminal = () => {};
|
|
56108
56108
|
|
|
56109
56109
|
// src/utils/renderer.ts
|
|
@@ -58939,7 +58939,7 @@ var init_usage_types = __esm(() => {
|
|
|
58939
58939
|
init_zod();
|
|
58940
58940
|
FIVE_HOUR_BLOCK_MS = 5 * 60 * 60 * 1000;
|
|
58941
58941
|
SEVEN_DAY_WINDOW_MS = 7 * 24 * 60 * 60 * 1000;
|
|
58942
|
-
UsageErrorSchema = exports_external.enum(["no-credentials", "timeout", "api-error", "parse-error"]);
|
|
58942
|
+
UsageErrorSchema = exports_external.enum(["no-credentials", "timeout", "rate-limited", "api-error", "parse-error"]);
|
|
58943
58943
|
});
|
|
58944
58944
|
|
|
58945
58945
|
// src/utils/usage-fetch.ts
|
|
@@ -58994,20 +58994,30 @@ function parseUsageApiResponse(rawJson) {
|
|
|
58994
58994
|
extraUsageUtilization: parsed.extra_usage?.utilization ?? undefined
|
|
58995
58995
|
};
|
|
58996
58996
|
}
|
|
58997
|
-
function
|
|
58997
|
+
function ensureCacheDirExists() {
|
|
58998
|
+
if (!fs3.existsSync(CACHE_DIR)) {
|
|
58999
|
+
fs3.mkdirSync(CACHE_DIR, { recursive: true });
|
|
59000
|
+
}
|
|
59001
|
+
}
|
|
59002
|
+
function setCachedUsageError(error48, now2, maxAge = LOCK_MAX_AGE) {
|
|
58998
59003
|
const errorData = { error: error48 };
|
|
58999
59004
|
cachedUsageData = errorData;
|
|
59000
59005
|
usageCacheTime = now2;
|
|
59006
|
+
usageErrorCacheMaxAge = maxAge;
|
|
59001
59007
|
return errorData;
|
|
59002
59008
|
}
|
|
59003
|
-
function
|
|
59009
|
+
function cacheUsageData(data, now2) {
|
|
59010
|
+
cachedUsageData = data;
|
|
59011
|
+
usageCacheTime = now2;
|
|
59012
|
+
usageErrorCacheMaxAge = LOCK_MAX_AGE;
|
|
59013
|
+
return data;
|
|
59014
|
+
}
|
|
59015
|
+
function getStaleUsageOrError(error48, now2, errorCacheMaxAge = LOCK_MAX_AGE) {
|
|
59004
59016
|
const stale = readStaleUsageCache();
|
|
59005
59017
|
if (stale && !stale.error) {
|
|
59006
|
-
|
|
59007
|
-
usageCacheTime = now2;
|
|
59008
|
-
return stale;
|
|
59018
|
+
return cacheUsageData(stale, now2);
|
|
59009
59019
|
}
|
|
59010
|
-
return setCachedUsageError(error48, now2);
|
|
59020
|
+
return setCachedUsageError(error48, now2, errorCacheMaxAge);
|
|
59011
59021
|
}
|
|
59012
59022
|
function getUsageToken() {
|
|
59013
59023
|
const now2 = Math.floor(Date.now() / 1000);
|
|
@@ -59043,6 +59053,60 @@ function readStaleUsageCache() {
|
|
|
59043
59053
|
return null;
|
|
59044
59054
|
}
|
|
59045
59055
|
}
|
|
59056
|
+
function writeUsageLock(blockedUntil, error48) {
|
|
59057
|
+
try {
|
|
59058
|
+
ensureCacheDirExists();
|
|
59059
|
+
fs3.writeFileSync(LOCK_FILE, JSON.stringify({ blockedUntil, error: error48 }));
|
|
59060
|
+
} catch {}
|
|
59061
|
+
}
|
|
59062
|
+
function readActiveUsageLock(now2) {
|
|
59063
|
+
let hasValidJsonLock = false;
|
|
59064
|
+
try {
|
|
59065
|
+
const parsed = parseJsonWithSchema(fs3.readFileSync(LOCK_FILE, "utf8"), UsageLockSchema);
|
|
59066
|
+
if (parsed) {
|
|
59067
|
+
hasValidJsonLock = true;
|
|
59068
|
+
if (parsed.blockedUntil > now2) {
|
|
59069
|
+
return {
|
|
59070
|
+
blockedUntil: parsed.blockedUntil,
|
|
59071
|
+
error: parsed.error ?? "timeout"
|
|
59072
|
+
};
|
|
59073
|
+
}
|
|
59074
|
+
return null;
|
|
59075
|
+
}
|
|
59076
|
+
} catch {}
|
|
59077
|
+
if (hasValidJsonLock) {
|
|
59078
|
+
return null;
|
|
59079
|
+
}
|
|
59080
|
+
try {
|
|
59081
|
+
const lockStat = fs3.statSync(LOCK_FILE);
|
|
59082
|
+
const lockMtime = Math.floor(lockStat.mtimeMs / 1000);
|
|
59083
|
+
const blockedUntil = lockMtime + LOCK_MAX_AGE;
|
|
59084
|
+
if (blockedUntil > now2) {
|
|
59085
|
+
return {
|
|
59086
|
+
blockedUntil,
|
|
59087
|
+
error: "timeout"
|
|
59088
|
+
};
|
|
59089
|
+
}
|
|
59090
|
+
} catch {}
|
|
59091
|
+
return null;
|
|
59092
|
+
}
|
|
59093
|
+
function parseRetryAfterSeconds(headerValue, nowMs = Date.now()) {
|
|
59094
|
+
const rawValue = Array.isArray(headerValue) ? headerValue[0] : headerValue;
|
|
59095
|
+
const trimmedValue = rawValue?.trim();
|
|
59096
|
+
if (!trimmedValue) {
|
|
59097
|
+
return null;
|
|
59098
|
+
}
|
|
59099
|
+
if (/^\d+$/.test(trimmedValue)) {
|
|
59100
|
+
const seconds = Number.parseInt(trimmedValue, 10);
|
|
59101
|
+
return seconds > 0 ? seconds : null;
|
|
59102
|
+
}
|
|
59103
|
+
const retryAtMs = Date.parse(trimmedValue);
|
|
59104
|
+
if (Number.isNaN(retryAtMs)) {
|
|
59105
|
+
return null;
|
|
59106
|
+
}
|
|
59107
|
+
const retryAfterSeconds = Math.ceil((retryAtMs - nowMs) / 1000);
|
|
59108
|
+
return retryAfterSeconds > 0 ? retryAfterSeconds : null;
|
|
59109
|
+
}
|
|
59046
59110
|
function getUsageApiProxyUrl() {
|
|
59047
59111
|
const proxyUrl = process.env.HTTPS_PROXY?.trim();
|
|
59048
59112
|
if (proxyUrl === "") {
|
|
@@ -59080,7 +59144,7 @@ async function fetchFromUsageApi(token) {
|
|
|
59080
59144
|
};
|
|
59081
59145
|
const requestOptions = getUsageApiRequestOptions(token);
|
|
59082
59146
|
if (!requestOptions) {
|
|
59083
|
-
finish(
|
|
59147
|
+
finish({ kind: "error" });
|
|
59084
59148
|
return;
|
|
59085
59149
|
}
|
|
59086
59150
|
const request2 = https.request(requestOptions, (response) => {
|
|
@@ -59091,18 +59155,25 @@ async function fetchFromUsageApi(token) {
|
|
|
59091
59155
|
});
|
|
59092
59156
|
response.on("end", () => {
|
|
59093
59157
|
if (response.statusCode === 200 && data) {
|
|
59094
|
-
finish(data);
|
|
59158
|
+
finish({ kind: "success", body: data });
|
|
59159
|
+
return;
|
|
59160
|
+
}
|
|
59161
|
+
if (response.statusCode === 429) {
|
|
59162
|
+
finish({
|
|
59163
|
+
kind: "rate-limited",
|
|
59164
|
+
retryAfterSeconds: parseRetryAfterSeconds(response.headers["retry-after"]) ?? DEFAULT_RATE_LIMIT_BACKOFF
|
|
59165
|
+
});
|
|
59095
59166
|
return;
|
|
59096
59167
|
}
|
|
59097
|
-
finish(
|
|
59168
|
+
finish({ kind: "error" });
|
|
59098
59169
|
});
|
|
59099
59170
|
});
|
|
59100
59171
|
request2.on("error", () => {
|
|
59101
|
-
finish(
|
|
59172
|
+
finish({ kind: "error" });
|
|
59102
59173
|
});
|
|
59103
59174
|
request2.on("timeout", () => {
|
|
59104
59175
|
request2.destroy();
|
|
59105
|
-
finish(
|
|
59176
|
+
finish({ kind: "error" });
|
|
59106
59177
|
});
|
|
59107
59178
|
request2.end();
|
|
59108
59179
|
});
|
|
@@ -59114,7 +59185,7 @@ async function fetchUsageData() {
|
|
|
59114
59185
|
if (!cachedUsageData.error && cacheAge < CACHE_MAX_AGE) {
|
|
59115
59186
|
return cachedUsageData;
|
|
59116
59187
|
}
|
|
59117
|
-
if (cachedUsageData.error && cacheAge <
|
|
59188
|
+
if (cachedUsageData.error && cacheAge < usageErrorCacheMaxAge) {
|
|
59118
59189
|
return cachedUsageData;
|
|
59119
59190
|
}
|
|
59120
59191
|
}
|
|
@@ -59124,9 +59195,7 @@ async function fetchUsageData() {
|
|
|
59124
59195
|
if (fileAge < CACHE_MAX_AGE) {
|
|
59125
59196
|
const fileData = parseCachedUsageData(fs3.readFileSync(CACHE_FILE, "utf8"));
|
|
59126
59197
|
if (fileData && !fileData.error) {
|
|
59127
|
-
|
|
59128
|
-
usageCacheTime = now2;
|
|
59129
|
-
return fileData;
|
|
59198
|
+
return cacheUsageData(fileData, now2);
|
|
59130
59199
|
}
|
|
59131
59200
|
}
|
|
59132
59201
|
} catch {}
|
|
@@ -59134,29 +59203,21 @@ async function fetchUsageData() {
|
|
|
59134
59203
|
if (!token) {
|
|
59135
59204
|
return getStaleUsageOrError("no-credentials", now2);
|
|
59136
59205
|
}
|
|
59137
|
-
|
|
59138
|
-
|
|
59139
|
-
|
|
59140
|
-
|
|
59141
|
-
|
|
59142
|
-
if (stale && !stale.error)
|
|
59143
|
-
return stale;
|
|
59144
|
-
return { error: "timeout" };
|
|
59145
|
-
}
|
|
59146
|
-
} catch {}
|
|
59147
|
-
try {
|
|
59148
|
-
const lockDir = path2.dirname(LOCK_FILE);
|
|
59149
|
-
if (!fs3.existsSync(lockDir)) {
|
|
59150
|
-
fs3.mkdirSync(lockDir, { recursive: true });
|
|
59151
|
-
}
|
|
59152
|
-
fs3.writeFileSync(LOCK_FILE, "");
|
|
59153
|
-
} catch {}
|
|
59206
|
+
const activeLock = readActiveUsageLock(now2);
|
|
59207
|
+
if (activeLock) {
|
|
59208
|
+
return getStaleUsageOrError(activeLock.error, now2, Math.max(1, activeLock.blockedUntil - now2));
|
|
59209
|
+
}
|
|
59210
|
+
writeUsageLock(now2 + LOCK_MAX_AGE, "timeout");
|
|
59154
59211
|
try {
|
|
59155
59212
|
const response = await fetchFromUsageApi(token);
|
|
59156
|
-
if (
|
|
59213
|
+
if (response.kind === "rate-limited") {
|
|
59214
|
+
writeUsageLock(now2 + response.retryAfterSeconds, "rate-limited");
|
|
59215
|
+
return getStaleUsageOrError("rate-limited", now2, response.retryAfterSeconds);
|
|
59216
|
+
}
|
|
59217
|
+
if (response.kind === "error") {
|
|
59157
59218
|
return getStaleUsageOrError("api-error", now2);
|
|
59158
59219
|
}
|
|
59159
|
-
const usageData = parseUsageApiResponse(response);
|
|
59220
|
+
const usageData = parseUsageApiResponse(response.body);
|
|
59160
59221
|
if (!usageData) {
|
|
59161
59222
|
return getStaleUsageOrError("parse-error", now2);
|
|
59162
59223
|
}
|
|
@@ -59164,19 +59225,15 @@ async function fetchUsageData() {
|
|
|
59164
59225
|
return getStaleUsageOrError("parse-error", now2);
|
|
59165
59226
|
}
|
|
59166
59227
|
try {
|
|
59167
|
-
|
|
59168
|
-
fs3.mkdirSync(CACHE_DIR, { recursive: true });
|
|
59169
|
-
}
|
|
59228
|
+
ensureCacheDirExists();
|
|
59170
59229
|
fs3.writeFileSync(CACHE_FILE, JSON.stringify(usageData));
|
|
59171
59230
|
} catch {}
|
|
59172
|
-
|
|
59173
|
-
usageCacheTime = now2;
|
|
59174
|
-
return usageData;
|
|
59231
|
+
return cacheUsageData(usageData, now2);
|
|
59175
59232
|
} catch {
|
|
59176
59233
|
return getStaleUsageOrError("parse-error", now2);
|
|
59177
59234
|
}
|
|
59178
59235
|
}
|
|
59179
|
-
var import_https_proxy_agent, CACHE_DIR, CACHE_FILE, LOCK_FILE, CACHE_MAX_AGE = 180, LOCK_MAX_AGE = 30, TOKEN_CACHE_MAX_AGE = 3600, UsageCredentialsSchema, CachedUsageDataSchema, UsageApiResponseSchema, cachedUsageData = null, usageCacheTime = 0, cachedUsageToken = null, usageTokenCacheTime = 0, USAGE_API_HOST = "api.anthropic.com", USAGE_API_PATH = "/api/oauth/usage", USAGE_API_TIMEOUT_MS = 5000;
|
|
59236
|
+
var import_https_proxy_agent, CACHE_DIR, CACHE_FILE, LOCK_FILE, CACHE_MAX_AGE = 180, LOCK_MAX_AGE = 30, DEFAULT_RATE_LIMIT_BACKOFF = 300, TOKEN_CACHE_MAX_AGE = 3600, UsageCredentialsSchema, UsageLockErrorSchema, UsageLockSchema, CachedUsageDataSchema, UsageApiResponseSchema, cachedUsageData = null, usageCacheTime = 0, cachedUsageToken = null, usageTokenCacheTime = 0, usageErrorCacheMaxAge, USAGE_API_HOST = "api.anthropic.com", USAGE_API_PATH = "/api/oauth/usage", USAGE_API_TIMEOUT_MS = 5000;
|
|
59180
59237
|
var init_usage_fetch = __esm(() => {
|
|
59181
59238
|
init_zod();
|
|
59182
59239
|
init_claude_settings();
|
|
@@ -59186,6 +59243,11 @@ var init_usage_fetch = __esm(() => {
|
|
|
59186
59243
|
CACHE_FILE = path2.join(CACHE_DIR, "usage.json");
|
|
59187
59244
|
LOCK_FILE = path2.join(CACHE_DIR, "usage.lock");
|
|
59188
59245
|
UsageCredentialsSchema = exports_external.object({ claudeAiOauth: exports_external.object({ accessToken: exports_external.string().nullable().optional() }).optional() });
|
|
59246
|
+
UsageLockErrorSchema = exports_external.enum(["timeout", "rate-limited"]);
|
|
59247
|
+
UsageLockSchema = exports_external.object({
|
|
59248
|
+
blockedUntil: exports_external.number(),
|
|
59249
|
+
error: UsageLockErrorSchema.optional()
|
|
59250
|
+
});
|
|
59189
59251
|
CachedUsageDataSchema = exports_external.object({
|
|
59190
59252
|
sessionUsage: exports_external.number().nullable().optional(),
|
|
59191
59253
|
sessionResetAt: exports_external.string().nullable().optional(),
|
|
@@ -59213,11 +59275,12 @@ var init_usage_fetch = __esm(() => {
|
|
|
59213
59275
|
utilization: exports_external.number().nullable().optional()
|
|
59214
59276
|
}).optional()
|
|
59215
59277
|
});
|
|
59278
|
+
usageErrorCacheMaxAge = LOCK_MAX_AGE;
|
|
59216
59279
|
});
|
|
59217
59280
|
|
|
59218
59281
|
// node_modules/fdir/dist/index.mjs
|
|
59219
59282
|
import { createRequire as createRequire2 } from "module";
|
|
59220
|
-
import { basename, dirname
|
|
59283
|
+
import { basename, dirname, normalize, relative, resolve, sep } from "path";
|
|
59221
59284
|
import * as nativeFs from "fs";
|
|
59222
59285
|
function cleanPath(path3) {
|
|
59223
59286
|
let normalized = normalize(path3);
|
|
@@ -59310,7 +59373,7 @@ function build$2(options, isSynchronous) {
|
|
|
59310
59373
|
function isRecursive(path3, resolved, state) {
|
|
59311
59374
|
if (state.options.useRealPaths)
|
|
59312
59375
|
return isRecursiveUsingRealPaths(resolved, state);
|
|
59313
|
-
let parent =
|
|
59376
|
+
let parent = dirname(path3);
|
|
59314
59377
|
let depth = 1;
|
|
59315
59378
|
while (parent !== state.root && depth < 2) {
|
|
59316
59379
|
const resolvedPath = state.symlinks.get(parent);
|
|
@@ -59318,7 +59381,7 @@ function isRecursive(path3, resolved, state) {
|
|
|
59318
59381
|
if (isSameRoot)
|
|
59319
59382
|
depth++;
|
|
59320
59383
|
else
|
|
59321
|
-
parent =
|
|
59384
|
+
parent = dirname(parent);
|
|
59322
59385
|
}
|
|
59323
59386
|
state.symlinks.set(path3, resolved);
|
|
59324
59387
|
return depth > 1;
|
|
@@ -59571,7 +59634,7 @@ var __require2, SLASHES_REGEX, WINDOWS_ROOT_DIR_REGEX, pushDirectory = (director
|
|
|
59571
59634
|
} else {
|
|
59572
59635
|
resolvedPath = useRealPaths ? resolvedPath : path3;
|
|
59573
59636
|
const filename = basename(resolvedPath);
|
|
59574
|
-
const directoryPath$1 = normalizePath(
|
|
59637
|
+
const directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);
|
|
59575
59638
|
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
59576
59639
|
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
59577
59640
|
}
|
|
@@ -62180,10 +62243,13 @@ function getWeeklyUsageWindowFromResetAt(weeklyResetAt, nowMs = Date.now()) {
|
|
|
62180
62243
|
function resolveWeeklyUsageWindow(usageData, nowMs = Date.now()) {
|
|
62181
62244
|
return getWeeklyUsageWindowFromResetAt(usageData.weeklyResetAt, nowMs);
|
|
62182
62245
|
}
|
|
62183
|
-
function formatUsageDuration(durationMs) {
|
|
62246
|
+
function formatUsageDuration(durationMs, compact2 = false) {
|
|
62184
62247
|
const clampedMs = Math.max(0, durationMs);
|
|
62185
62248
|
const elapsedHours = Math.floor(clampedMs / (1000 * 60 * 60));
|
|
62186
62249
|
const elapsedMinutes = Math.floor(clampedMs % (1000 * 60 * 60) / (1000 * 60));
|
|
62250
|
+
if (compact2) {
|
|
62251
|
+
return elapsedMinutes === 0 ? `${elapsedHours}h` : `${elapsedHours}h${elapsedMinutes}m`;
|
|
62252
|
+
}
|
|
62187
62253
|
if (elapsedMinutes === 0) {
|
|
62188
62254
|
return `${elapsedHours}hr`;
|
|
62189
62255
|
}
|
|
@@ -62195,6 +62261,8 @@ function getUsageErrorMessage(error48) {
|
|
|
62195
62261
|
return "[No credentials]";
|
|
62196
62262
|
case "timeout":
|
|
62197
62263
|
return "[Timeout]";
|
|
62264
|
+
case "rate-limited":
|
|
62265
|
+
return "[Rate limited]";
|
|
62198
62266
|
case "api-error":
|
|
62199
62267
|
return "[API Error]";
|
|
62200
62268
|
case "parse-error":
|
|
@@ -62235,7 +62303,13 @@ function getUsageProgressBarWidth(mode) {
|
|
|
62235
62303
|
function isUsageInverted(item) {
|
|
62236
62304
|
return isMetadataFlagEnabled(item, "invert");
|
|
62237
62305
|
}
|
|
62238
|
-
function
|
|
62306
|
+
function isUsageCompact(item) {
|
|
62307
|
+
return isMetadataFlagEnabled(item, "compact");
|
|
62308
|
+
}
|
|
62309
|
+
function toggleUsageCompact(item) {
|
|
62310
|
+
return toggleMetadataFlag(item, "compact");
|
|
62311
|
+
}
|
|
62312
|
+
function getUsageDisplayModifierText(item, options = {}) {
|
|
62239
62313
|
const mode = getUsageDisplayMode(item);
|
|
62240
62314
|
const modifiers = [];
|
|
62241
62315
|
if (mode === "progress") {
|
|
@@ -62246,6 +62320,9 @@ function getUsageDisplayModifierText(item) {
|
|
|
62246
62320
|
if (isUsageInverted(item)) {
|
|
62247
62321
|
modifiers.push("inverted");
|
|
62248
62322
|
}
|
|
62323
|
+
if (options.includeCompact && isUsageCompact(item)) {
|
|
62324
|
+
modifiers.push("compact");
|
|
62325
|
+
}
|
|
62249
62326
|
return makeModifierText(modifiers);
|
|
62250
62327
|
}
|
|
62251
62328
|
function cycleUsageDisplayMode(item) {
|
|
@@ -62292,7 +62369,7 @@ class BlockTimerWidget {
|
|
|
62292
62369
|
getEditorDisplay(item) {
|
|
62293
62370
|
return {
|
|
62294
62371
|
displayText: this.getDisplayName(),
|
|
62295
|
-
modifierText: getUsageDisplayModifierText(item)
|
|
62372
|
+
modifierText: getUsageDisplayModifierText(item, { includeCompact: true })
|
|
62296
62373
|
};
|
|
62297
62374
|
}
|
|
62298
62375
|
handleEditorAction(action, item) {
|
|
@@ -62302,11 +62379,15 @@ class BlockTimerWidget {
|
|
|
62302
62379
|
if (action === "toggle-invert") {
|
|
62303
62380
|
return toggleUsageInverted(item);
|
|
62304
62381
|
}
|
|
62382
|
+
if (action === "toggle-compact") {
|
|
62383
|
+
return toggleUsageCompact(item);
|
|
62384
|
+
}
|
|
62305
62385
|
return null;
|
|
62306
62386
|
}
|
|
62307
62387
|
render(item, context, settings) {
|
|
62308
62388
|
const displayMode = getUsageDisplayMode(item);
|
|
62309
62389
|
const inverted = isUsageInverted(item);
|
|
62390
|
+
const compact2 = isUsageCompact(item);
|
|
62310
62391
|
if (context.isPreview) {
|
|
62311
62392
|
const previewPercent = inverted ? 26.1 : 73.9;
|
|
62312
62393
|
if (isUsageProgressMode(displayMode)) {
|
|
@@ -62314,7 +62395,7 @@ class BlockTimerWidget {
|
|
|
62314
62395
|
const progressBar = makeTimerProgressBar(previewPercent, barWidth);
|
|
62315
62396
|
return formatRawOrLabeledValue(item, "Block ", `[${progressBar}] ${previewPercent.toFixed(1)}%`);
|
|
62316
62397
|
}
|
|
62317
|
-
return formatRawOrLabeledValue(item, "Block: ", "3hr 45m");
|
|
62398
|
+
return formatRawOrLabeledValue(item, "Block: ", compact2 ? "3h45m" : "3hr 45m");
|
|
62318
62399
|
}
|
|
62319
62400
|
const usageData = context.usageData ?? {};
|
|
62320
62401
|
const window2 = resolveUsageWindowWithFallback(usageData, context.blockMetrics);
|
|
@@ -62324,7 +62405,7 @@ class BlockTimerWidget {
|
|
|
62324
62405
|
const emptyBar = "░".repeat(barWidth);
|
|
62325
62406
|
return formatRawOrLabeledValue(item, "Block ", `[${emptyBar}] 0.0%`);
|
|
62326
62407
|
}
|
|
62327
|
-
return formatRawOrLabeledValue(item, "Block: ", "0hr 0m");
|
|
62408
|
+
return formatRawOrLabeledValue(item, "Block: ", compact2 ? "0h" : "0hr 0m");
|
|
62328
62409
|
}
|
|
62329
62410
|
if (isUsageProgressMode(displayMode)) {
|
|
62330
62411
|
const barWidth = getUsageProgressBarWidth(displayMode);
|
|
@@ -62333,13 +62414,14 @@ class BlockTimerWidget {
|
|
|
62333
62414
|
const percentage = percent.toFixed(1);
|
|
62334
62415
|
return formatRawOrLabeledValue(item, "Block ", `[${progressBar}] ${percentage}%`);
|
|
62335
62416
|
}
|
|
62336
|
-
const elapsedTime = formatUsageDuration(window2.elapsedMs);
|
|
62417
|
+
const elapsedTime = formatUsageDuration(window2.elapsedMs, compact2);
|
|
62337
62418
|
return formatRawOrLabeledValue(item, "Block: ", elapsedTime);
|
|
62338
62419
|
}
|
|
62339
62420
|
getCustomKeybinds() {
|
|
62340
62421
|
return [
|
|
62341
62422
|
{ key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
|
|
62342
|
-
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" }
|
|
62423
|
+
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" },
|
|
62424
|
+
{ key: "s", label: "(s)hort time", action: "toggle-compact" }
|
|
62343
62425
|
];
|
|
62344
62426
|
}
|
|
62345
62427
|
supportsRawValue() {
|
|
@@ -63285,7 +63367,7 @@ class BlockResetTimerWidget {
|
|
|
63285
63367
|
getEditorDisplay(item) {
|
|
63286
63368
|
return {
|
|
63287
63369
|
displayText: this.getDisplayName(),
|
|
63288
|
-
modifierText: getUsageDisplayModifierText(item)
|
|
63370
|
+
modifierText: getUsageDisplayModifierText(item, { includeCompact: true })
|
|
63289
63371
|
};
|
|
63290
63372
|
}
|
|
63291
63373
|
handleEditorAction(action, item) {
|
|
@@ -63295,11 +63377,15 @@ class BlockResetTimerWidget {
|
|
|
63295
63377
|
if (action === "toggle-invert") {
|
|
63296
63378
|
return toggleUsageInverted(item);
|
|
63297
63379
|
}
|
|
63380
|
+
if (action === "toggle-compact") {
|
|
63381
|
+
return toggleUsageCompact(item);
|
|
63382
|
+
}
|
|
63298
63383
|
return null;
|
|
63299
63384
|
}
|
|
63300
63385
|
render(item, context, settings) {
|
|
63301
63386
|
const displayMode = getUsageDisplayMode(item);
|
|
63302
63387
|
const inverted = isUsageInverted(item);
|
|
63388
|
+
const compact2 = isUsageCompact(item);
|
|
63303
63389
|
if (context.isPreview) {
|
|
63304
63390
|
const previewPercent = inverted ? 90 : 10;
|
|
63305
63391
|
if (isUsageProgressMode(displayMode)) {
|
|
@@ -63307,7 +63393,7 @@ class BlockResetTimerWidget {
|
|
|
63307
63393
|
const progressBar = makeTimerProgressBar2(previewPercent, barWidth);
|
|
63308
63394
|
return formatRawOrLabeledValue(item, "Reset ", `[${progressBar}] ${previewPercent.toFixed(1)}%`);
|
|
63309
63395
|
}
|
|
63310
|
-
return formatRawOrLabeledValue(item, "Reset: ", "4hr 30m");
|
|
63396
|
+
return formatRawOrLabeledValue(item, "Reset: ", compact2 ? "4h30m" : "4hr 30m");
|
|
63311
63397
|
}
|
|
63312
63398
|
const usageData = context.usageData ?? {};
|
|
63313
63399
|
const window2 = resolveUsageWindowWithFallback(usageData, context.blockMetrics);
|
|
@@ -63324,13 +63410,14 @@ class BlockResetTimerWidget {
|
|
|
63324
63410
|
const percentage = percent.toFixed(1);
|
|
63325
63411
|
return formatRawOrLabeledValue(item, "Reset ", `[${progressBar}] ${percentage}%`);
|
|
63326
63412
|
}
|
|
63327
|
-
const remainingTime = formatUsageDuration(window2.remainingMs);
|
|
63413
|
+
const remainingTime = formatUsageDuration(window2.remainingMs, compact2);
|
|
63328
63414
|
return formatRawOrLabeledValue(item, "Reset: ", remainingTime);
|
|
63329
63415
|
}
|
|
63330
63416
|
getCustomKeybinds() {
|
|
63331
63417
|
return [
|
|
63332
63418
|
{ key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
|
|
63333
|
-
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" }
|
|
63419
|
+
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" },
|
|
63420
|
+
{ key: "s", label: "(s)hort time", action: "toggle-compact" }
|
|
63334
63421
|
];
|
|
63335
63422
|
}
|
|
63336
63423
|
supportsRawValue() {
|
|
@@ -63369,7 +63456,7 @@ class WeeklyResetTimerWidget {
|
|
|
63369
63456
|
getEditorDisplay(item) {
|
|
63370
63457
|
return {
|
|
63371
63458
|
displayText: this.getDisplayName(),
|
|
63372
|
-
modifierText: getUsageDisplayModifierText(item)
|
|
63459
|
+
modifierText: getUsageDisplayModifierText(item, { includeCompact: true })
|
|
63373
63460
|
};
|
|
63374
63461
|
}
|
|
63375
63462
|
handleEditorAction(action, item) {
|
|
@@ -63379,11 +63466,15 @@ class WeeklyResetTimerWidget {
|
|
|
63379
63466
|
if (action === "toggle-invert") {
|
|
63380
63467
|
return toggleUsageInverted(item);
|
|
63381
63468
|
}
|
|
63469
|
+
if (action === "toggle-compact") {
|
|
63470
|
+
return toggleUsageCompact(item);
|
|
63471
|
+
}
|
|
63382
63472
|
return null;
|
|
63383
63473
|
}
|
|
63384
63474
|
render(item, context, settings) {
|
|
63385
63475
|
const displayMode = getUsageDisplayMode(item);
|
|
63386
63476
|
const inverted = isUsageInverted(item);
|
|
63477
|
+
const compact2 = isUsageCompact(item);
|
|
63387
63478
|
if (context.isPreview) {
|
|
63388
63479
|
const previewPercent = inverted ? 90 : 10;
|
|
63389
63480
|
if (isUsageProgressMode(displayMode)) {
|
|
@@ -63391,7 +63482,7 @@ class WeeklyResetTimerWidget {
|
|
|
63391
63482
|
const progressBar = makeTimerProgressBar3(previewPercent, barWidth);
|
|
63392
63483
|
return formatRawOrLabeledValue(item, "Weekly Reset ", `[${progressBar}] ${previewPercent.toFixed(1)}%`);
|
|
63393
63484
|
}
|
|
63394
|
-
return formatRawOrLabeledValue(item, "Weekly Reset: ", "36hr 30m");
|
|
63485
|
+
return formatRawOrLabeledValue(item, "Weekly Reset: ", compact2 ? "36h30m" : "36hr 30m");
|
|
63395
63486
|
}
|
|
63396
63487
|
const usageData = context.usageData ?? {};
|
|
63397
63488
|
const window2 = resolveWeeklyUsageWindow(usageData);
|
|
@@ -63408,13 +63499,14 @@ class WeeklyResetTimerWidget {
|
|
|
63408
63499
|
const percentage = percent.toFixed(1);
|
|
63409
63500
|
return formatRawOrLabeledValue(item, "Weekly Reset ", `[${progressBar}] ${percentage}%`);
|
|
63410
63501
|
}
|
|
63411
|
-
const remainingTime = formatUsageDuration(window2.remainingMs);
|
|
63502
|
+
const remainingTime = formatUsageDuration(window2.remainingMs, compact2);
|
|
63412
63503
|
return formatRawOrLabeledValue(item, "Weekly Reset: ", remainingTime);
|
|
63413
63504
|
}
|
|
63414
63505
|
getCustomKeybinds() {
|
|
63415
63506
|
return [
|
|
63416
63507
|
{ key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
|
|
63417
|
-
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" }
|
|
63508
|
+
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" },
|
|
63509
|
+
{ key: "s", label: "(s)hort time", action: "toggle-compact" }
|
|
63418
63510
|
];
|
|
63419
63511
|
}
|
|
63420
63512
|
supportsRawValue() {
|
|
@@ -64879,7 +64971,7 @@ var dist_default4 = Gradient;
|
|
|
64879
64971
|
|
|
64880
64972
|
// src/tui/App.tsx
|
|
64881
64973
|
init_claude_settings();
|
|
64882
|
-
var
|
|
64974
|
+
var import_react46 = __toESM(require_react(), 1);
|
|
64883
64975
|
|
|
64884
64976
|
// src/utils/clone-settings.ts
|
|
64885
64977
|
function cloneSettings(settings) {
|
|
@@ -65626,60 +65718,184 @@ var import_react36 = __toESM(require_react(), 1);
|
|
|
65626
65718
|
|
|
65627
65719
|
// src/tui/components/ConfirmDialog.tsx
|
|
65628
65720
|
await init_build2();
|
|
65721
|
+
|
|
65722
|
+
// src/tui/components/List.tsx
|
|
65723
|
+
await init_build2();
|
|
65629
65724
|
var import_react35 = __toESM(require_react(), 1);
|
|
65630
65725
|
var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
|
|
65631
|
-
|
|
65632
|
-
|
|
65633
|
-
|
|
65726
|
+
function List({
|
|
65727
|
+
items,
|
|
65728
|
+
onSelect,
|
|
65729
|
+
onSelectionChange,
|
|
65730
|
+
initialSelection = 0,
|
|
65731
|
+
showBackButton,
|
|
65732
|
+
color,
|
|
65733
|
+
wrapNavigation = false,
|
|
65734
|
+
...boxProps
|
|
65735
|
+
}) {
|
|
65736
|
+
const [selectedIndex, setSelectedIndex] = import_react35.useState(initialSelection);
|
|
65737
|
+
const latestOnSelectionChangeRef = import_react35.useRef(onSelectionChange);
|
|
65738
|
+
const _items = import_react35.useMemo(() => {
|
|
65739
|
+
if (showBackButton) {
|
|
65740
|
+
return [...items, "-", { label: "← Back", value: "back" }];
|
|
65741
|
+
}
|
|
65742
|
+
return items;
|
|
65743
|
+
}, [items, showBackButton]);
|
|
65744
|
+
const selectableItems = _items.filter((item) => item !== "-" && !item.disabled);
|
|
65745
|
+
const selectedItem = selectableItems[selectedIndex];
|
|
65746
|
+
const selectedValue = selectedItem?.value;
|
|
65747
|
+
const actualIndex = _items.findIndex((item) => item === selectedItem);
|
|
65748
|
+
import_react35.useEffect(() => {
|
|
65749
|
+
latestOnSelectionChangeRef.current = onSelectionChange;
|
|
65750
|
+
}, [onSelectionChange]);
|
|
65751
|
+
import_react35.useEffect(() => {
|
|
65752
|
+
const maxIndex = Math.max(selectableItems.length - 1, 0);
|
|
65753
|
+
setSelectedIndex(Math.min(initialSelection, maxIndex));
|
|
65754
|
+
}, [initialSelection, selectableItems.length]);
|
|
65755
|
+
import_react35.useEffect(() => {
|
|
65756
|
+
if (selectedValue !== undefined) {
|
|
65757
|
+
latestOnSelectionChangeRef.current?.(selectedValue, selectedIndex);
|
|
65758
|
+
}
|
|
65759
|
+
}, [selectedIndex, selectedValue]);
|
|
65760
|
+
use_input_default((_, key) => {
|
|
65634
65761
|
if (key.upArrow) {
|
|
65635
|
-
|
|
65636
|
-
|
|
65637
|
-
setSelectedIndex(
|
|
65638
|
-
|
|
65639
|
-
|
|
65640
|
-
|
|
65641
|
-
|
|
65642
|
-
|
|
65643
|
-
|
|
65644
|
-
|
|
65645
|
-
|
|
65762
|
+
const prev = selectedIndex - 1;
|
|
65763
|
+
const prevIndex = prev < 0 ? wrapNavigation ? selectableItems.length - 1 : 0 : prev;
|
|
65764
|
+
setSelectedIndex(prevIndex);
|
|
65765
|
+
return;
|
|
65766
|
+
}
|
|
65767
|
+
if (key.downArrow) {
|
|
65768
|
+
const next = selectedIndex + 1;
|
|
65769
|
+
const nextIndex = next > selectableItems.length - 1 ? wrapNavigation ? 0 : selectableItems.length - 1 : next;
|
|
65770
|
+
setSelectedIndex(nextIndex);
|
|
65771
|
+
return;
|
|
65772
|
+
}
|
|
65773
|
+
if (key.return && selectedItem) {
|
|
65774
|
+
onSelect(selectedItem.value, selectedIndex);
|
|
65775
|
+
return;
|
|
65646
65776
|
}
|
|
65647
65777
|
});
|
|
65648
|
-
|
|
65649
|
-
|
|
65650
|
-
|
|
65651
|
-
|
|
65652
|
-
|
|
65778
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
65779
|
+
flexDirection: "column",
|
|
65780
|
+
...boxProps,
|
|
65781
|
+
children: [
|
|
65782
|
+
_items.map((item, index) => {
|
|
65783
|
+
if (item === "-") {
|
|
65784
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ListSeparator, {}, index, false, undefined, this);
|
|
65785
|
+
}
|
|
65786
|
+
const isSelected = index === actualIndex;
|
|
65787
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ListItem, {
|
|
65788
|
+
isSelected,
|
|
65789
|
+
color,
|
|
65790
|
+
disabled: item.disabled,
|
|
65791
|
+
...item.props,
|
|
65792
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65793
|
+
children: [
|
|
65794
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65795
|
+
children: item.label
|
|
65796
|
+
}, undefined, false, undefined, this),
|
|
65797
|
+
item.sublabel && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65798
|
+
dimColor: !isSelected,
|
|
65799
|
+
children: [
|
|
65800
|
+
" ",
|
|
65801
|
+
item.sublabel
|
|
65802
|
+
]
|
|
65803
|
+
}, undefined, true, undefined, this)
|
|
65804
|
+
]
|
|
65805
|
+
}, undefined, true, undefined, this)
|
|
65806
|
+
}, index, false, undefined, this);
|
|
65807
|
+
}),
|
|
65808
|
+
selectedItem?.description && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
65809
|
+
marginTop: 1,
|
|
65810
|
+
paddingLeft: 2,
|
|
65811
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65812
|
+
dimColor: true,
|
|
65813
|
+
wrap: "wrap",
|
|
65814
|
+
children: selectedItem.description
|
|
65815
|
+
}, undefined, false, undefined, this)
|
|
65816
|
+
}, undefined, false, undefined, this)
|
|
65817
|
+
]
|
|
65818
|
+
}, undefined, true, undefined, this);
|
|
65819
|
+
}
|
|
65820
|
+
function ListItem({
|
|
65821
|
+
children,
|
|
65822
|
+
isSelected,
|
|
65823
|
+
color = "green",
|
|
65824
|
+
disabled,
|
|
65825
|
+
...boxProps
|
|
65826
|
+
}) {
|
|
65827
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
65828
|
+
...boxProps,
|
|
65829
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65830
|
+
color: isSelected ? color : undefined,
|
|
65831
|
+
dimColor: disabled,
|
|
65653
65832
|
children: [
|
|
65654
65833
|
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65655
|
-
|
|
65656
|
-
|
|
65657
|
-
selectedIndex === 0 ? "▶ " : " ",
|
|
65658
|
-
"Yes"
|
|
65659
|
-
]
|
|
65660
|
-
}, undefined, true, undefined, this),
|
|
65834
|
+
children: isSelected ? "▶ " : " "
|
|
65835
|
+
}, undefined, false, undefined, this),
|
|
65661
65836
|
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65662
|
-
|
|
65663
|
-
|
|
65664
|
-
selectedIndex === 1 ? "▶ " : " ",
|
|
65665
|
-
"No"
|
|
65666
|
-
]
|
|
65667
|
-
}, undefined, true, undefined, this)
|
|
65837
|
+
children
|
|
65838
|
+
}, undefined, false, undefined, this)
|
|
65668
65839
|
]
|
|
65669
|
-
}, undefined, true, undefined, this)
|
|
65670
|
-
};
|
|
65840
|
+
}, undefined, true, undefined, this)
|
|
65841
|
+
}, undefined, false, undefined, this);
|
|
65842
|
+
}
|
|
65843
|
+
function ListSeparator() {
|
|
65844
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
|
|
65845
|
+
children: " "
|
|
65846
|
+
}, undefined, false, undefined, this);
|
|
65847
|
+
}
|
|
65848
|
+
|
|
65849
|
+
// src/tui/components/ConfirmDialog.tsx
|
|
65850
|
+
var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
|
|
65851
|
+
var CONFIRM_OPTIONS = [
|
|
65852
|
+
{
|
|
65853
|
+
label: "Yes",
|
|
65854
|
+
value: true
|
|
65855
|
+
},
|
|
65856
|
+
{
|
|
65857
|
+
label: "No",
|
|
65858
|
+
value: false
|
|
65859
|
+
}
|
|
65860
|
+
];
|
|
65861
|
+
var ConfirmDialog = ({ message, onConfirm, onCancel, inline = false }) => {
|
|
65862
|
+
use_input_default((_, key) => {
|
|
65863
|
+
if (key.escape) {
|
|
65864
|
+
onCancel();
|
|
65865
|
+
}
|
|
65866
|
+
});
|
|
65671
65867
|
if (inline) {
|
|
65672
|
-
return
|
|
65868
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(List, {
|
|
65869
|
+
items: CONFIRM_OPTIONS,
|
|
65870
|
+
onSelect: (confirmed) => {
|
|
65871
|
+
if (confirmed) {
|
|
65872
|
+
onConfirm();
|
|
65873
|
+
return;
|
|
65874
|
+
}
|
|
65875
|
+
onCancel();
|
|
65876
|
+
},
|
|
65877
|
+
color: "cyan"
|
|
65878
|
+
}, undefined, false, undefined, this);
|
|
65673
65879
|
}
|
|
65674
|
-
return /* @__PURE__ */
|
|
65880
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
65675
65881
|
flexDirection: "column",
|
|
65676
65882
|
children: [
|
|
65677
|
-
/* @__PURE__ */
|
|
65883
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
65678
65884
|
children: message
|
|
65679
65885
|
}, undefined, false, undefined, this),
|
|
65680
|
-
/* @__PURE__ */
|
|
65886
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
65681
65887
|
marginTop: 1,
|
|
65682
|
-
children:
|
|
65888
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(List, {
|
|
65889
|
+
items: CONFIRM_OPTIONS,
|
|
65890
|
+
onSelect: (confirmed) => {
|
|
65891
|
+
if (confirmed) {
|
|
65892
|
+
onConfirm();
|
|
65893
|
+
return;
|
|
65894
|
+
}
|
|
65895
|
+
onCancel();
|
|
65896
|
+
},
|
|
65897
|
+
color: "cyan"
|
|
65898
|
+
}, undefined, false, undefined, this)
|
|
65683
65899
|
}, undefined, false, undefined, this)
|
|
65684
65900
|
]
|
|
65685
65901
|
}, undefined, true, undefined, this);
|
|
@@ -65792,7 +66008,7 @@ function cycleWidgetColor({
|
|
|
65792
66008
|
}
|
|
65793
66009
|
|
|
65794
66010
|
// src/tui/components/ColorMenu.tsx
|
|
65795
|
-
var
|
|
66011
|
+
var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
65796
66012
|
var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
65797
66013
|
const [showSeparators, setShowSeparators] = import_react36.useState(false);
|
|
65798
66014
|
const [hexInputMode, setHexInputMode] = import_react36.useState(false);
|
|
@@ -65942,30 +66158,30 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
65942
66158
|
}
|
|
65943
66159
|
});
|
|
65944
66160
|
if (hasNoItems) {
|
|
65945
|
-
return /* @__PURE__ */
|
|
66161
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
65946
66162
|
flexDirection: "column",
|
|
65947
66163
|
children: [
|
|
65948
|
-
/* @__PURE__ */
|
|
66164
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
65949
66165
|
bold: true,
|
|
65950
66166
|
children: [
|
|
65951
66167
|
"Configure Colors",
|
|
65952
66168
|
lineIndex !== undefined ? ` - Line ${lineIndex + 1}` : ""
|
|
65953
66169
|
]
|
|
65954
66170
|
}, undefined, true, undefined, this),
|
|
65955
|
-
/* @__PURE__ */
|
|
66171
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
65956
66172
|
marginTop: 1,
|
|
65957
|
-
children: /* @__PURE__ */
|
|
66173
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
65958
66174
|
dimColor: true,
|
|
65959
66175
|
children: "No colorable widgets in the status line."
|
|
65960
66176
|
}, undefined, false, undefined, this)
|
|
65961
66177
|
}, undefined, false, undefined, this),
|
|
65962
|
-
/* @__PURE__ */
|
|
66178
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
65963
66179
|
dimColor: true,
|
|
65964
66180
|
children: "Add a widget first to continue."
|
|
65965
66181
|
}, undefined, false, undefined, this),
|
|
65966
|
-
/* @__PURE__ */
|
|
66182
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
65967
66183
|
marginTop: 1,
|
|
65968
|
-
children: /* @__PURE__ */
|
|
66184
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
65969
66185
|
children: "Press any key to go back..."
|
|
65970
66186
|
}, undefined, false, undefined, this)
|
|
65971
66187
|
}, undefined, false, undefined, this)
|
|
@@ -66058,36 +66274,36 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
66058
66274
|
}
|
|
66059
66275
|
}
|
|
66060
66276
|
if (showClearConfirm) {
|
|
66061
|
-
return /* @__PURE__ */
|
|
66277
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66062
66278
|
flexDirection: "column",
|
|
66063
66279
|
children: [
|
|
66064
|
-
/* @__PURE__ */
|
|
66280
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66065
66281
|
bold: true,
|
|
66066
66282
|
color: "yellow",
|
|
66067
66283
|
children: "⚠ Confirm Clear All Colors"
|
|
66068
66284
|
}, undefined, false, undefined, this),
|
|
66069
|
-
/* @__PURE__ */
|
|
66285
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66070
66286
|
marginTop: 1,
|
|
66071
66287
|
flexDirection: "column",
|
|
66072
66288
|
children: [
|
|
66073
|
-
/* @__PURE__ */
|
|
66289
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66074
66290
|
children: "This will reset all colors for all widgets to their defaults."
|
|
66075
66291
|
}, undefined, false, undefined, this),
|
|
66076
|
-
/* @__PURE__ */
|
|
66292
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66077
66293
|
color: "red",
|
|
66078
66294
|
children: "This action cannot be undone!"
|
|
66079
66295
|
}, undefined, false, undefined, this)
|
|
66080
66296
|
]
|
|
66081
66297
|
}, undefined, true, undefined, this),
|
|
66082
|
-
/* @__PURE__ */
|
|
66298
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66083
66299
|
marginTop: 2,
|
|
66084
|
-
children: /* @__PURE__ */
|
|
66300
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66085
66301
|
children: "Continue?"
|
|
66086
66302
|
}, undefined, false, undefined, this)
|
|
66087
66303
|
}, undefined, false, undefined, this),
|
|
66088
|
-
/* @__PURE__ */
|
|
66304
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66089
66305
|
marginTop: 1,
|
|
66090
|
-
children: /* @__PURE__ */
|
|
66306
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ConfirmDialog, {
|
|
66091
66307
|
inline: true,
|
|
66092
66308
|
onConfirm: () => {
|
|
66093
66309
|
const newItems = clearAllWidgetStyling(widgets);
|
|
@@ -66105,12 +66321,12 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
66105
66321
|
const hasGlobalFgOverride = !!settings.overrideForegroundColor;
|
|
66106
66322
|
const hasGlobalBgOverride = !!settings.overrideBackgroundColor && !powerlineEnabled;
|
|
66107
66323
|
const globalOverrideMessage = hasGlobalFgOverride && hasGlobalBgOverride ? "⚠ Global override for FG and BG active" : hasGlobalFgOverride ? "⚠ Global override for FG active" : hasGlobalBgOverride ? "⚠ Global override for BG active" : null;
|
|
66108
|
-
return /* @__PURE__ */
|
|
66324
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66109
66325
|
flexDirection: "column",
|
|
66110
66326
|
children: [
|
|
66111
|
-
/* @__PURE__ */
|
|
66327
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66112
66328
|
children: [
|
|
66113
|
-
/* @__PURE__ */
|
|
66329
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66114
66330
|
bold: true,
|
|
66115
66331
|
children: [
|
|
66116
66332
|
"Configure Colors",
|
|
@@ -66118,7 +66334,7 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
66118
66334
|
editingBackground && source_default.yellow(" [Background Mode]")
|
|
66119
66335
|
]
|
|
66120
66336
|
}, undefined, true, undefined, this),
|
|
66121
|
-
globalOverrideMessage && /* @__PURE__ */
|
|
66337
|
+
globalOverrideMessage && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66122
66338
|
color: "yellow",
|
|
66123
66339
|
dimColor: true,
|
|
66124
66340
|
children: [
|
|
@@ -66128,56 +66344,56 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
66128
66344
|
}, undefined, true, undefined, this)
|
|
66129
66345
|
]
|
|
66130
66346
|
}, undefined, true, undefined, this),
|
|
66131
|
-
hexInputMode ? /* @__PURE__ */
|
|
66347
|
+
hexInputMode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66132
66348
|
flexDirection: "column",
|
|
66133
66349
|
children: [
|
|
66134
|
-
/* @__PURE__ */
|
|
66350
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66135
66351
|
children: "Enter 6-digit hex color code (without #):"
|
|
66136
66352
|
}, undefined, false, undefined, this),
|
|
66137
|
-
/* @__PURE__ */
|
|
66353
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66138
66354
|
children: [
|
|
66139
66355
|
"#",
|
|
66140
66356
|
hexInput,
|
|
66141
|
-
/* @__PURE__ */
|
|
66357
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66142
66358
|
dimColor: true,
|
|
66143
66359
|
children: hexInput.length < 6 ? "_".repeat(6 - hexInput.length) : ""
|
|
66144
66360
|
}, undefined, false, undefined, this)
|
|
66145
66361
|
]
|
|
66146
66362
|
}, undefined, true, undefined, this),
|
|
66147
|
-
/* @__PURE__ */
|
|
66363
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66148
66364
|
children: " "
|
|
66149
66365
|
}, undefined, false, undefined, this),
|
|
66150
|
-
/* @__PURE__ */
|
|
66366
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66151
66367
|
dimColor: true,
|
|
66152
66368
|
children: "Press Enter when done, ESC to cancel"
|
|
66153
66369
|
}, undefined, false, undefined, this)
|
|
66154
66370
|
]
|
|
66155
|
-
}, undefined, true, undefined, this) : ansi256InputMode ? /* @__PURE__ */
|
|
66371
|
+
}, undefined, true, undefined, this) : ansi256InputMode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66156
66372
|
flexDirection: "column",
|
|
66157
66373
|
children: [
|
|
66158
|
-
/* @__PURE__ */
|
|
66374
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66159
66375
|
children: "Enter ANSI 256 color code (0-255):"
|
|
66160
66376
|
}, undefined, false, undefined, this),
|
|
66161
|
-
/* @__PURE__ */
|
|
66377
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66162
66378
|
children: [
|
|
66163
66379
|
ansi256Input,
|
|
66164
|
-
/* @__PURE__ */
|
|
66380
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66165
66381
|
dimColor: true,
|
|
66166
66382
|
children: ansi256Input.length === 0 ? "___" : ansi256Input.length === 1 ? "__" : ansi256Input.length === 2 ? "_" : ""
|
|
66167
66383
|
}, undefined, false, undefined, this)
|
|
66168
66384
|
]
|
|
66169
66385
|
}, undefined, true, undefined, this),
|
|
66170
|
-
/* @__PURE__ */
|
|
66386
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66171
66387
|
children: " "
|
|
66172
66388
|
}, undefined, false, undefined, this),
|
|
66173
|
-
/* @__PURE__ */
|
|
66389
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66174
66390
|
dimColor: true,
|
|
66175
66391
|
children: "Press Enter when done, ESC to cancel"
|
|
66176
66392
|
}, undefined, false, undefined, this)
|
|
66177
66393
|
]
|
|
66178
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
66394
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
|
|
66179
66395
|
children: [
|
|
66180
|
-
/* @__PURE__ */
|
|
66396
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66181
66397
|
dimColor: true,
|
|
66182
66398
|
children: [
|
|
66183
66399
|
"↑↓ to select, ←→ to cycle",
|
|
@@ -66189,16 +66405,16 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
66189
66405
|
"(r)eset, (c)lear all, ESC to go back"
|
|
66190
66406
|
]
|
|
66191
66407
|
}, undefined, true, undefined, this),
|
|
66192
|
-
!settings.powerline.enabled && !settings.defaultSeparator && /* @__PURE__ */
|
|
66408
|
+
!settings.powerline.enabled && !settings.defaultSeparator && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66193
66409
|
dimColor: true,
|
|
66194
66410
|
children: [
|
|
66195
66411
|
"(s)how separators:",
|
|
66196
66412
|
showSeparators ? source_default.green("ON") : source_default.gray("OFF")
|
|
66197
66413
|
]
|
|
66198
66414
|
}, undefined, true, undefined, this),
|
|
66199
|
-
selectedWidget ? /* @__PURE__ */
|
|
66415
|
+
selectedWidget ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66200
66416
|
marginTop: 1,
|
|
66201
|
-
children: /* @__PURE__ */
|
|
66417
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66202
66418
|
children: [
|
|
66203
66419
|
"Current",
|
|
66204
66420
|
" ",
|
|
@@ -66212,19 +66428,19 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
66212
66428
|
selectedWidget.bold && source_default.bold(" [BOLD]")
|
|
66213
66429
|
]
|
|
66214
66430
|
}, undefined, true, undefined, this)
|
|
66215
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
66431
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66216
66432
|
marginTop: 1,
|
|
66217
|
-
children: /* @__PURE__ */
|
|
66433
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66218
66434
|
children: " "
|
|
66219
66435
|
}, undefined, false, undefined, this)
|
|
66220
66436
|
}, undefined, false, undefined, this)
|
|
66221
66437
|
]
|
|
66222
66438
|
}, undefined, true, undefined, this),
|
|
66223
|
-
/* @__PURE__ */
|
|
66439
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66224
66440
|
marginTop: 1,
|
|
66225
|
-
children: hexInputMode || ansi256InputMode ? /* @__PURE__ */
|
|
66441
|
+
children: hexInputMode || ansi256InputMode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66226
66442
|
flexDirection: "column",
|
|
66227
|
-
children: menuItems.map((item) => /* @__PURE__ */
|
|
66443
|
+
children: menuItems.map((item) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66228
66444
|
color: item.value === highlightedItemId ? "cyan" : "white",
|
|
66229
66445
|
bold: item.value === highlightedItemId,
|
|
66230
66446
|
children: [
|
|
@@ -66232,28 +66448,28 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
66232
66448
|
item.label
|
|
66233
66449
|
]
|
|
66234
66450
|
}, item.value, true, undefined, this))
|
|
66235
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
66451
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(SelectInput_default, {
|
|
66236
66452
|
items: menuItems,
|
|
66237
66453
|
onSelect: handleSelect,
|
|
66238
66454
|
onHighlight: handleHighlight,
|
|
66239
66455
|
initialIndex: Math.max(0, menuItems.findIndex((item) => item.value === highlightedItemId)),
|
|
66240
|
-
indicatorComponent: ({ isSelected }) => /* @__PURE__ */
|
|
66456
|
+
indicatorComponent: ({ isSelected }) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66241
66457
|
children: isSelected ? "▶" : " "
|
|
66242
66458
|
}, undefined, false, undefined, this),
|
|
66243
|
-
itemComponent: ({ isSelected, label }) => /* @__PURE__ */
|
|
66459
|
+
itemComponent: ({ isSelected, label }) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66244
66460
|
children: ` ${label}`
|
|
66245
66461
|
}, undefined, false, undefined, this)
|
|
66246
66462
|
}, `${showSeparators}-${highlightedItemId}`, false, undefined, this)
|
|
66247
66463
|
}, undefined, false, undefined, this),
|
|
66248
|
-
/* @__PURE__ */
|
|
66464
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
66249
66465
|
marginTop: 1,
|
|
66250
66466
|
flexDirection: "column",
|
|
66251
66467
|
children: [
|
|
66252
|
-
/* @__PURE__ */
|
|
66468
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66253
66469
|
color: "yellow",
|
|
66254
66470
|
children: "⚠ VSCode Users: "
|
|
66255
66471
|
}, undefined, false, undefined, this),
|
|
66256
|
-
/* @__PURE__ */
|
|
66472
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
66257
66473
|
dimColor: true,
|
|
66258
66474
|
wrap: "wrap",
|
|
66259
66475
|
children: 'If colors appear incorrect in the VSCode integrated terminal, the "Terminal › Integrated: Minimum Contrast Ratio" (`terminal.integrated.minimumContrastRatio`) setting is forcing a minimum contrast between foreground and background colors. You can adjust this setting to 1 to disable the contrast enforcement, or use a standalone terminal for accurate colors.'
|
|
@@ -66268,7 +66484,7 @@ init_colors();
|
|
|
66268
66484
|
init_input_guards();
|
|
66269
66485
|
await init_build2();
|
|
66270
66486
|
var import_react37 = __toESM(require_react(), 1);
|
|
66271
|
-
var
|
|
66487
|
+
var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
|
|
66272
66488
|
var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
66273
66489
|
const [editingPadding, setEditingPadding] = import_react37.useState(false);
|
|
66274
66490
|
const [editingSeparator, setEditingSeparator] = import_react37.useState(false);
|
|
@@ -66378,95 +66594,95 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66378
66594
|
}
|
|
66379
66595
|
}
|
|
66380
66596
|
});
|
|
66381
|
-
return /* @__PURE__ */
|
|
66597
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66382
66598
|
flexDirection: "column",
|
|
66383
66599
|
children: [
|
|
66384
|
-
/* @__PURE__ */
|
|
66600
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66385
66601
|
bold: true,
|
|
66386
66602
|
children: "Global Overrides"
|
|
66387
66603
|
}, undefined, false, undefined, this),
|
|
66388
|
-
/* @__PURE__ */
|
|
66604
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66389
66605
|
dimColor: true,
|
|
66390
66606
|
children: "Configure automatic padding and separators between widgets"
|
|
66391
66607
|
}, undefined, false, undefined, this),
|
|
66392
|
-
isPowerlineEnabled && /* @__PURE__ */
|
|
66608
|
+
isPowerlineEnabled && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66393
66609
|
marginTop: 1,
|
|
66394
|
-
children: /* @__PURE__ */
|
|
66610
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66395
66611
|
color: "yellow",
|
|
66396
66612
|
children: "⚠ Some options are disabled while Powerline mode is active"
|
|
66397
66613
|
}, undefined, false, undefined, this)
|
|
66398
66614
|
}, undefined, false, undefined, this),
|
|
66399
|
-
/* @__PURE__ */
|
|
66615
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66400
66616
|
marginTop: 1
|
|
66401
66617
|
}, undefined, false, undefined, this),
|
|
66402
|
-
editingPadding ? /* @__PURE__ */
|
|
66618
|
+
editingPadding ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66403
66619
|
flexDirection: "column",
|
|
66404
66620
|
children: [
|
|
66405
|
-
/* @__PURE__ */
|
|
66621
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66406
66622
|
children: [
|
|
66407
|
-
/* @__PURE__ */
|
|
66623
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66408
66624
|
children: "Enter default padding (applied to left and right of each widget): "
|
|
66409
66625
|
}, undefined, false, undefined, this),
|
|
66410
|
-
/* @__PURE__ */
|
|
66626
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66411
66627
|
color: "cyan",
|
|
66412
66628
|
children: paddingInput ? `"${paddingInput}"` : "(empty)"
|
|
66413
66629
|
}, undefined, false, undefined, this)
|
|
66414
66630
|
]
|
|
66415
66631
|
}, undefined, true, undefined, this),
|
|
66416
|
-
/* @__PURE__ */
|
|
66632
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66417
66633
|
dimColor: true,
|
|
66418
66634
|
children: "Press Enter to save, ESC to cancel"
|
|
66419
66635
|
}, undefined, false, undefined, this)
|
|
66420
66636
|
]
|
|
66421
|
-
}, undefined, true, undefined, this) : editingSeparator ? /* @__PURE__ */
|
|
66637
|
+
}, undefined, true, undefined, this) : editingSeparator ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66422
66638
|
flexDirection: "column",
|
|
66423
66639
|
children: [
|
|
66424
|
-
/* @__PURE__ */
|
|
66640
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66425
66641
|
children: [
|
|
66426
|
-
/* @__PURE__ */
|
|
66642
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66427
66643
|
children: "Enter default separator (placed between widgets): "
|
|
66428
66644
|
}, undefined, false, undefined, this),
|
|
66429
|
-
/* @__PURE__ */
|
|
66645
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66430
66646
|
color: "cyan",
|
|
66431
66647
|
children: separatorInput ? `"${separatorInput}"` : "(empty - no separator will be added)"
|
|
66432
66648
|
}, undefined, false, undefined, this)
|
|
66433
66649
|
]
|
|
66434
66650
|
}, undefined, true, undefined, this),
|
|
66435
|
-
/* @__PURE__ */
|
|
66651
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66436
66652
|
dimColor: true,
|
|
66437
66653
|
children: "Press Enter to save, ESC to cancel"
|
|
66438
66654
|
}, undefined, false, undefined, this)
|
|
66439
66655
|
]
|
|
66440
|
-
}, undefined, true, undefined, this) : confirmingSeparator ? /* @__PURE__ */
|
|
66656
|
+
}, undefined, true, undefined, this) : confirmingSeparator ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66441
66657
|
flexDirection: "column",
|
|
66442
66658
|
children: [
|
|
66443
|
-
/* @__PURE__ */
|
|
66659
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66444
66660
|
marginBottom: 1,
|
|
66445
|
-
children: /* @__PURE__ */
|
|
66661
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66446
66662
|
color: "yellow",
|
|
66447
66663
|
children: "⚠ Warning: Setting a default separator will remove all existing manual separators from your status lines."
|
|
66448
66664
|
}, undefined, false, undefined, this)
|
|
66449
66665
|
}, undefined, false, undefined, this),
|
|
66450
|
-
/* @__PURE__ */
|
|
66666
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66451
66667
|
children: [
|
|
66452
|
-
/* @__PURE__ */
|
|
66668
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66453
66669
|
children: "New default separator: "
|
|
66454
66670
|
}, undefined, false, undefined, this),
|
|
66455
|
-
/* @__PURE__ */
|
|
66671
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66456
66672
|
color: "cyan",
|
|
66457
66673
|
children: separatorInput ? `"${separatorInput}"` : "(empty)"
|
|
66458
66674
|
}, undefined, false, undefined, this)
|
|
66459
66675
|
]
|
|
66460
66676
|
}, undefined, true, undefined, this),
|
|
66461
|
-
/* @__PURE__ */
|
|
66677
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66462
66678
|
marginTop: 1,
|
|
66463
|
-
children: /* @__PURE__ */
|
|
66679
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66464
66680
|
children: "Do you want to continue? "
|
|
66465
66681
|
}, undefined, false, undefined, this)
|
|
66466
66682
|
}, undefined, false, undefined, this),
|
|
66467
|
-
/* @__PURE__ */
|
|
66683
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66468
66684
|
marginTop: 1,
|
|
66469
|
-
children: /* @__PURE__ */
|
|
66685
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ConfirmDialog, {
|
|
66470
66686
|
inline: true,
|
|
66471
66687
|
onConfirm: () => {
|
|
66472
66688
|
const updatedSettings = {
|
|
@@ -66484,47 +66700,47 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66484
66700
|
}, undefined, false, undefined, this)
|
|
66485
66701
|
}, undefined, false, undefined, this)
|
|
66486
66702
|
]
|
|
66487
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
66703
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
66488
66704
|
children: [
|
|
66489
|
-
/* @__PURE__ */
|
|
66705
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66490
66706
|
children: [
|
|
66491
|
-
/* @__PURE__ */
|
|
66707
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66492
66708
|
children: " Global Bold: "
|
|
66493
66709
|
}, undefined, false, undefined, this),
|
|
66494
|
-
/* @__PURE__ */
|
|
66710
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66495
66711
|
color: globalBold ? "green" : "red",
|
|
66496
66712
|
children: globalBold ? "✓ Enabled" : "✗ Disabled"
|
|
66497
66713
|
}, undefined, false, undefined, this),
|
|
66498
|
-
/* @__PURE__ */
|
|
66714
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66499
66715
|
dimColor: true,
|
|
66500
66716
|
children: " - Press (o) to toggle"
|
|
66501
66717
|
}, undefined, false, undefined, this)
|
|
66502
66718
|
]
|
|
66503
66719
|
}, undefined, true, undefined, this),
|
|
66504
|
-
/* @__PURE__ */
|
|
66720
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66505
66721
|
children: [
|
|
66506
|
-
/* @__PURE__ */
|
|
66722
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66507
66723
|
children: " Default Padding: "
|
|
66508
66724
|
}, undefined, false, undefined, this),
|
|
66509
|
-
/* @__PURE__ */
|
|
66725
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66510
66726
|
color: "cyan",
|
|
66511
66727
|
children: settings.defaultPadding ? `"${settings.defaultPadding}"` : "(none)"
|
|
66512
66728
|
}, undefined, false, undefined, this),
|
|
66513
|
-
/* @__PURE__ */
|
|
66729
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66514
66730
|
dimColor: true,
|
|
66515
66731
|
children: " - Press (p) to edit"
|
|
66516
66732
|
}, undefined, false, undefined, this)
|
|
66517
66733
|
]
|
|
66518
66734
|
}, undefined, true, undefined, this),
|
|
66519
|
-
/* @__PURE__ */
|
|
66735
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66520
66736
|
children: [
|
|
66521
|
-
/* @__PURE__ */
|
|
66737
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66522
66738
|
children: "Override FG Color: "
|
|
66523
66739
|
}, undefined, false, undefined, this),
|
|
66524
66740
|
(() => {
|
|
66525
66741
|
const fgColor = settings.overrideForegroundColor ?? "none";
|
|
66526
66742
|
if (fgColor === "none") {
|
|
66527
|
-
return /* @__PURE__ */
|
|
66743
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66528
66744
|
color: "gray",
|
|
66529
66745
|
children: "(none)"
|
|
66530
66746
|
}, undefined, false, undefined, this);
|
|
@@ -66532,31 +66748,31 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66532
66748
|
const displayName = getColorDisplayName(fgColor);
|
|
66533
66749
|
const fgChalk = getChalkColor(fgColor, "ansi16", false);
|
|
66534
66750
|
const display = fgChalk ? fgChalk(displayName) : displayName;
|
|
66535
|
-
return /* @__PURE__ */
|
|
66751
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66536
66752
|
children: display
|
|
66537
66753
|
}, undefined, false, undefined, this);
|
|
66538
66754
|
}
|
|
66539
66755
|
})(),
|
|
66540
|
-
/* @__PURE__ */
|
|
66756
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66541
66757
|
dimColor: true,
|
|
66542
66758
|
children: " - (f) cycle, (g) clear"
|
|
66543
66759
|
}, undefined, false, undefined, this)
|
|
66544
66760
|
]
|
|
66545
66761
|
}, undefined, true, undefined, this),
|
|
66546
|
-
/* @__PURE__ */
|
|
66762
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66547
66763
|
children: [
|
|
66548
|
-
/* @__PURE__ */
|
|
66764
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66549
66765
|
children: "Override BG Color: "
|
|
66550
66766
|
}, undefined, false, undefined, this),
|
|
66551
|
-
isPowerlineEnabled ? /* @__PURE__ */
|
|
66767
|
+
isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66552
66768
|
dimColor: true,
|
|
66553
66769
|
children: "[disabled - Powerline active]"
|
|
66554
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
66770
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
66555
66771
|
children: [
|
|
66556
66772
|
(() => {
|
|
66557
66773
|
const bgColor = settings.overrideBackgroundColor ?? "none";
|
|
66558
66774
|
if (bgColor === "none") {
|
|
66559
|
-
return /* @__PURE__ */
|
|
66775
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66560
66776
|
color: "gray",
|
|
66561
66777
|
children: "(none)"
|
|
66562
66778
|
}, undefined, false, undefined, this);
|
|
@@ -66564,12 +66780,12 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66564
66780
|
const displayName = getColorDisplayName(bgColor);
|
|
66565
66781
|
const bgChalk = getChalkColor(bgColor, "ansi16", true);
|
|
66566
66782
|
const display = bgChalk ? bgChalk(` ${displayName} `) : displayName;
|
|
66567
|
-
return /* @__PURE__ */
|
|
66783
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66568
66784
|
children: display
|
|
66569
66785
|
}, undefined, false, undefined, this);
|
|
66570
66786
|
}
|
|
66571
66787
|
})(),
|
|
66572
|
-
/* @__PURE__ */
|
|
66788
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66573
66789
|
dimColor: true,
|
|
66574
66790
|
children: " - (b) cycle, (c) clear"
|
|
66575
66791
|
}, undefined, false, undefined, this)
|
|
@@ -66577,21 +66793,21 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66577
66793
|
}, undefined, true, undefined, this)
|
|
66578
66794
|
]
|
|
66579
66795
|
}, undefined, true, undefined, this),
|
|
66580
|
-
/* @__PURE__ */
|
|
66796
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66581
66797
|
children: [
|
|
66582
|
-
/* @__PURE__ */
|
|
66798
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66583
66799
|
children: " Inherit Colors: "
|
|
66584
66800
|
}, undefined, false, undefined, this),
|
|
66585
|
-
isPowerlineEnabled ? /* @__PURE__ */
|
|
66801
|
+
isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66586
66802
|
dimColor: true,
|
|
66587
66803
|
children: "[disabled - Powerline active]"
|
|
66588
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
66804
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
66589
66805
|
children: [
|
|
66590
|
-
/* @__PURE__ */
|
|
66806
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66591
66807
|
color: inheritColors ? "green" : "red",
|
|
66592
66808
|
children: inheritColors ? "✓ Enabled" : "✗ Disabled"
|
|
66593
66809
|
}, undefined, false, undefined, this),
|
|
66594
|
-
/* @__PURE__ */
|
|
66810
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66595
66811
|
dimColor: true,
|
|
66596
66812
|
children: " - Press (i) to toggle"
|
|
66597
66813
|
}, undefined, false, undefined, this)
|
|
@@ -66599,21 +66815,21 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66599
66815
|
}, undefined, true, undefined, this)
|
|
66600
66816
|
]
|
|
66601
66817
|
}, undefined, true, undefined, this),
|
|
66602
|
-
/* @__PURE__ */
|
|
66818
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66603
66819
|
children: [
|
|
66604
|
-
/* @__PURE__ */
|
|
66820
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66605
66821
|
children: "Default Separator: "
|
|
66606
66822
|
}, undefined, false, undefined, this),
|
|
66607
|
-
isPowerlineEnabled ? /* @__PURE__ */
|
|
66823
|
+
isPowerlineEnabled ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66608
66824
|
dimColor: true,
|
|
66609
66825
|
children: "[disabled - Powerline active]"
|
|
66610
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
66826
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
66611
66827
|
children: [
|
|
66612
|
-
/* @__PURE__ */
|
|
66828
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66613
66829
|
color: "cyan",
|
|
66614
66830
|
children: settings.defaultSeparator ? `"${settings.defaultSeparator}"` : "(none)"
|
|
66615
66831
|
}, undefined, false, undefined, this),
|
|
66616
|
-
/* @__PURE__ */
|
|
66832
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66617
66833
|
dimColor: true,
|
|
66618
66834
|
children: " - Press (s) to edit"
|
|
66619
66835
|
}, undefined, false, undefined, this)
|
|
@@ -66621,33 +66837,33 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66621
66837
|
}, undefined, true, undefined, this)
|
|
66622
66838
|
]
|
|
66623
66839
|
}, undefined, true, undefined, this),
|
|
66624
|
-
/* @__PURE__ */
|
|
66840
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66625
66841
|
marginTop: 2,
|
|
66626
|
-
children: /* @__PURE__ */
|
|
66842
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66627
66843
|
dimColor: true,
|
|
66628
66844
|
children: "Press ESC to go back"
|
|
66629
66845
|
}, undefined, false, undefined, this)
|
|
66630
66846
|
}, undefined, false, undefined, this),
|
|
66631
|
-
/* @__PURE__ */
|
|
66847
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66632
66848
|
marginTop: 1,
|
|
66633
66849
|
flexDirection: "column",
|
|
66634
66850
|
children: [
|
|
66635
|
-
/* @__PURE__ */
|
|
66851
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66636
66852
|
dimColor: true,
|
|
66637
66853
|
wrap: "wrap",
|
|
66638
66854
|
children: "Note: These settings are applied during rendering and don't add widgets to your widget list."
|
|
66639
66855
|
}, undefined, false, undefined, this),
|
|
66640
|
-
/* @__PURE__ */
|
|
66856
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66641
66857
|
dimColor: true,
|
|
66642
66858
|
wrap: "wrap",
|
|
66643
66859
|
children: "• Inherit colors: Separators will use colors from the preceding widget"
|
|
66644
66860
|
}, undefined, false, undefined, this),
|
|
66645
|
-
/* @__PURE__ */
|
|
66861
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66646
66862
|
dimColor: true,
|
|
66647
66863
|
wrap: "wrap",
|
|
66648
66864
|
children: "• Global Bold: Makes all text bold regardless of individual settings"
|
|
66649
66865
|
}, undefined, false, undefined, this),
|
|
66650
|
-
/* @__PURE__ */
|
|
66866
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66651
66867
|
dimColor: true,
|
|
66652
66868
|
wrap: "wrap",
|
|
66653
66869
|
children: "• Override colors: All widgets will use these colors instead of their configured colors"
|
|
@@ -66662,54 +66878,57 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
66662
66878
|
// src/tui/components/InstallMenu.tsx
|
|
66663
66879
|
init_claude_settings();
|
|
66664
66880
|
await init_build2();
|
|
66665
|
-
var
|
|
66666
|
-
var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
|
|
66881
|
+
var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
|
|
66667
66882
|
var InstallMenu = ({
|
|
66668
66883
|
bunxAvailable,
|
|
66669
66884
|
existingStatusLine,
|
|
66670
66885
|
onSelectNpx,
|
|
66671
66886
|
onSelectBunx,
|
|
66672
|
-
onCancel
|
|
66887
|
+
onCancel,
|
|
66888
|
+
initialSelection = 0
|
|
66673
66889
|
}) => {
|
|
66674
|
-
|
|
66675
|
-
const maxIndex = 2;
|
|
66676
|
-
use_input_default((input, key) => {
|
|
66890
|
+
use_input_default((_, key) => {
|
|
66677
66891
|
if (key.escape) {
|
|
66678
66892
|
onCancel();
|
|
66679
|
-
}
|
|
66680
|
-
|
|
66681
|
-
|
|
66682
|
-
|
|
66683
|
-
|
|
66684
|
-
}
|
|
66685
|
-
} else if (key.downArrow) {
|
|
66686
|
-
if (selectedIndex === 0) {
|
|
66687
|
-
setSelectedIndex(bunxAvailable ? 1 : 2);
|
|
66688
|
-
} else if (selectedIndex === 1 && bunxAvailable) {
|
|
66689
|
-
setSelectedIndex(2);
|
|
66690
|
-
} else {
|
|
66691
|
-
setSelectedIndex(Math.min(maxIndex, selectedIndex + 1));
|
|
66692
|
-
}
|
|
66693
|
-
} else if (key.return) {
|
|
66694
|
-
if (selectedIndex === 0) {
|
|
66893
|
+
}
|
|
66894
|
+
});
|
|
66895
|
+
function onSelect(value) {
|
|
66896
|
+
switch (value) {
|
|
66897
|
+
case "npx":
|
|
66695
66898
|
onSelectNpx();
|
|
66696
|
-
|
|
66697
|
-
|
|
66698
|
-
|
|
66899
|
+
break;
|
|
66900
|
+
case "bunx":
|
|
66901
|
+
if (bunxAvailable) {
|
|
66902
|
+
onSelectBunx();
|
|
66903
|
+
}
|
|
66904
|
+
break;
|
|
66905
|
+
case "back":
|
|
66699
66906
|
onCancel();
|
|
66700
|
-
|
|
66907
|
+
break;
|
|
66701
66908
|
}
|
|
66702
|
-
}
|
|
66703
|
-
|
|
66909
|
+
}
|
|
66910
|
+
const listItems = [
|
|
66911
|
+
{
|
|
66912
|
+
label: "npx - Node Package Execute",
|
|
66913
|
+
value: "npx"
|
|
66914
|
+
},
|
|
66915
|
+
{
|
|
66916
|
+
label: "bunx - Bun Package Execute",
|
|
66917
|
+
sublabel: bunxAvailable ? undefined : "(not installed)",
|
|
66918
|
+
value: "bunx",
|
|
66919
|
+
disabled: !bunxAvailable
|
|
66920
|
+
}
|
|
66921
|
+
];
|
|
66922
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
66704
66923
|
flexDirection: "column",
|
|
66705
66924
|
children: [
|
|
66706
|
-
/* @__PURE__ */
|
|
66925
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
66707
66926
|
bold: true,
|
|
66708
66927
|
children: "Install ccstatusline to Claude Code"
|
|
66709
66928
|
}, undefined, false, undefined, this),
|
|
66710
|
-
existingStatusLine && /* @__PURE__ */
|
|
66929
|
+
existingStatusLine && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
66711
66930
|
marginBottom: 1,
|
|
66712
|
-
children: /* @__PURE__ */
|
|
66931
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
66713
66932
|
color: "yellow",
|
|
66714
66933
|
children: [
|
|
66715
66934
|
'⚠ Current status line: "',
|
|
@@ -66718,51 +66937,29 @@ var InstallMenu = ({
|
|
|
66718
66937
|
]
|
|
66719
66938
|
}, undefined, true, undefined, this)
|
|
66720
66939
|
}, undefined, false, undefined, this),
|
|
66721
|
-
/* @__PURE__ */
|
|
66722
|
-
children: /* @__PURE__ */
|
|
66940
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
66941
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
66723
66942
|
dimColor: true,
|
|
66724
66943
|
children: "Select package manager to use:"
|
|
66725
66944
|
}, undefined, false, undefined, this)
|
|
66726
66945
|
}, undefined, false, undefined, this),
|
|
66727
|
-
/* @__PURE__ */
|
|
66946
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(List, {
|
|
66947
|
+
color: "blue",
|
|
66728
66948
|
marginTop: 1,
|
|
66729
|
-
|
|
66730
|
-
|
|
66731
|
-
|
|
66732
|
-
|
|
66733
|
-
|
|
66734
|
-
|
|
66735
|
-
|
|
66736
|
-
|
|
66737
|
-
|
|
66738
|
-
|
|
66739
|
-
|
|
66740
|
-
|
|
66741
|
-
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66742
|
-
color: selectedIndex === 1 && bunxAvailable ? "blue" : undefined,
|
|
66743
|
-
dimColor: !bunxAvailable,
|
|
66744
|
-
children: [
|
|
66745
|
-
selectedIndex === 1 && bunxAvailable ? "▶ " : " ",
|
|
66746
|
-
"bunx - Bun Package Execute",
|
|
66747
|
-
!bunxAvailable && " (not installed)"
|
|
66748
|
-
]
|
|
66749
|
-
}, undefined, true, undefined, this)
|
|
66750
|
-
}, undefined, false, undefined, this),
|
|
66751
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66752
|
-
marginTop: 1,
|
|
66753
|
-
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
66754
|
-
color: selectedIndex === 2 ? "blue" : undefined,
|
|
66755
|
-
children: [
|
|
66756
|
-
selectedIndex === 2 ? "▶ " : " ",
|
|
66757
|
-
"← Back"
|
|
66758
|
-
]
|
|
66759
|
-
}, undefined, true, undefined, this)
|
|
66760
|
-
}, undefined, false, undefined, this)
|
|
66761
|
-
]
|
|
66762
|
-
}, undefined, true, undefined, this),
|
|
66763
|
-
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
66949
|
+
items: listItems,
|
|
66950
|
+
onSelect: (line) => {
|
|
66951
|
+
if (line === "back") {
|
|
66952
|
+
onCancel();
|
|
66953
|
+
return;
|
|
66954
|
+
}
|
|
66955
|
+
onSelect(line);
|
|
66956
|
+
},
|
|
66957
|
+
initialSelection,
|
|
66958
|
+
showBackButton: true
|
|
66959
|
+
}, undefined, false, undefined, this),
|
|
66960
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
66764
66961
|
marginTop: 2,
|
|
66765
|
-
children: /* @__PURE__ */
|
|
66962
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
66766
66963
|
dimColor: true,
|
|
66767
66964
|
children: [
|
|
66768
66965
|
"The selected command will be written to",
|
|
@@ -66771,9 +66968,9 @@ var InstallMenu = ({
|
|
|
66771
66968
|
]
|
|
66772
66969
|
}, undefined, true, undefined, this)
|
|
66773
66970
|
}, undefined, false, undefined, this),
|
|
66774
|
-
/* @__PURE__ */
|
|
66971
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
66775
66972
|
marginTop: 1,
|
|
66776
|
-
children: /* @__PURE__ */
|
|
66973
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
66777
66974
|
dimColor: true,
|
|
66778
66975
|
children: "Press Enter to select, ESC to cancel"
|
|
66779
66976
|
}, undefined, false, undefined, this)
|
|
@@ -66788,7 +66985,7 @@ await __promiseAll([
|
|
|
66788
66985
|
init_build2(),
|
|
66789
66986
|
init_widgets2()
|
|
66790
66987
|
]);
|
|
66791
|
-
var
|
|
66988
|
+
var import_react38 = __toESM(require_react(), 1);
|
|
66792
66989
|
|
|
66793
66990
|
// src/tui/components/items-editor/input-handlers.ts
|
|
66794
66991
|
await init_widgets2();
|
|
@@ -67100,14 +67297,32 @@ function handleNormalInputMode({
|
|
|
67100
67297
|
}
|
|
67101
67298
|
}
|
|
67102
67299
|
|
|
67300
|
+
// src/tui/components/items-editor/keybind-visibility.ts
|
|
67301
|
+
function isProgressMode(widget) {
|
|
67302
|
+
const mode = widget.metadata?.display;
|
|
67303
|
+
return mode === "progress" || mode === "progress-short";
|
|
67304
|
+
}
|
|
67305
|
+
function shouldShowCustomKeybind(widget, keybind) {
|
|
67306
|
+
if (keybind.action === "edit-list-limit") {
|
|
67307
|
+
return widget.type === "skills" && widget.metadata?.mode === "list";
|
|
67308
|
+
}
|
|
67309
|
+
if (keybind.action === "toggle-invert") {
|
|
67310
|
+
return isProgressMode(widget);
|
|
67311
|
+
}
|
|
67312
|
+
if (keybind.action === "toggle-compact") {
|
|
67313
|
+
return !isProgressMode(widget);
|
|
67314
|
+
}
|
|
67315
|
+
return true;
|
|
67316
|
+
}
|
|
67317
|
+
|
|
67103
67318
|
// src/tui/components/ItemsEditor.tsx
|
|
67104
|
-
var
|
|
67319
|
+
var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
|
|
67105
67320
|
var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
67106
|
-
const [selectedIndex, setSelectedIndex] =
|
|
67107
|
-
const [moveMode, setMoveMode] =
|
|
67108
|
-
const [customEditorWidget, setCustomEditorWidget] =
|
|
67109
|
-
const [widgetPicker, setWidgetPicker] =
|
|
67110
|
-
const [showClearConfirm, setShowClearConfirm] =
|
|
67321
|
+
const [selectedIndex, setSelectedIndex] = import_react38.useState(0);
|
|
67322
|
+
const [moveMode, setMoveMode] = import_react38.useState(false);
|
|
67323
|
+
const [customEditorWidget, setCustomEditorWidget] = import_react38.useState(null);
|
|
67324
|
+
const [widgetPicker, setWidgetPicker] = import_react38.useState(null);
|
|
67325
|
+
const [showClearConfirm, setShowClearConfirm] = import_react38.useState(false);
|
|
67111
67326
|
const separatorChars = ["|", "-", ",", " "];
|
|
67112
67327
|
const widgetCatalog = getWidgetCatalog(settings);
|
|
67113
67328
|
const widgetCategories = ["All", ...getWidgetCatalogCategories(widgetCatalog)];
|
|
@@ -67136,16 +67351,6 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67136
67351
|
const handleEditorCancel = () => {
|
|
67137
67352
|
setCustomEditorWidget(null);
|
|
67138
67353
|
};
|
|
67139
|
-
const shouldShowCustomKeybind = (widget, keybind) => {
|
|
67140
|
-
if (keybind.action !== "toggle-invert") {
|
|
67141
|
-
if (keybind.action === "edit-list-limit") {
|
|
67142
|
-
return widget.type === "skills" && widget.metadata?.mode === "list";
|
|
67143
|
-
}
|
|
67144
|
-
return true;
|
|
67145
|
-
}
|
|
67146
|
-
const mode = widget.metadata?.display;
|
|
67147
|
-
return mode === "progress" || mode === "progress-short";
|
|
67148
|
-
};
|
|
67149
67354
|
const getVisibleCustomKeybinds = (widgetImpl, widget) => {
|
|
67150
67355
|
if (!widgetImpl.getCustomKeybinds) {
|
|
67151
67356
|
return [];
|
|
@@ -67304,19 +67509,19 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67304
67509
|
});
|
|
67305
67510
|
}
|
|
67306
67511
|
if (showClearConfirm) {
|
|
67307
|
-
return /* @__PURE__ */
|
|
67512
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67308
67513
|
flexDirection: "column",
|
|
67309
67514
|
children: [
|
|
67310
|
-
/* @__PURE__ */
|
|
67515
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67311
67516
|
bold: true,
|
|
67312
67517
|
color: "yellow",
|
|
67313
67518
|
children: "⚠ Confirm Clear Line"
|
|
67314
67519
|
}, undefined, false, undefined, this),
|
|
67315
|
-
/* @__PURE__ */
|
|
67520
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67316
67521
|
marginTop: 1,
|
|
67317
67522
|
flexDirection: "column",
|
|
67318
67523
|
children: [
|
|
67319
|
-
/* @__PURE__ */
|
|
67524
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67320
67525
|
children: [
|
|
67321
67526
|
"This will remove all widgets from Line",
|
|
67322
67527
|
" ",
|
|
@@ -67324,21 +67529,21 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67324
67529
|
"."
|
|
67325
67530
|
]
|
|
67326
67531
|
}, undefined, true, undefined, this),
|
|
67327
|
-
/* @__PURE__ */
|
|
67532
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67328
67533
|
color: "red",
|
|
67329
67534
|
children: "This action cannot be undone!"
|
|
67330
67535
|
}, undefined, false, undefined, this)
|
|
67331
67536
|
]
|
|
67332
67537
|
}, undefined, true, undefined, this),
|
|
67333
|
-
/* @__PURE__ */
|
|
67538
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67334
67539
|
marginTop: 2,
|
|
67335
|
-
children: /* @__PURE__ */
|
|
67540
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67336
67541
|
children: "Continue?"
|
|
67337
67542
|
}, undefined, false, undefined, this)
|
|
67338
67543
|
}, undefined, false, undefined, this),
|
|
67339
|
-
/* @__PURE__ */
|
|
67544
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67340
67545
|
marginTop: 1,
|
|
67341
|
-
children: /* @__PURE__ */
|
|
67546
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ConfirmDialog, {
|
|
67342
67547
|
inline: true,
|
|
67343
67548
|
onConfirm: () => {
|
|
67344
67549
|
onUpdate([]);
|
|
@@ -67353,12 +67558,12 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67353
67558
|
]
|
|
67354
67559
|
}, undefined, true, undefined, this);
|
|
67355
67560
|
}
|
|
67356
|
-
return /* @__PURE__ */
|
|
67561
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67357
67562
|
flexDirection: "column",
|
|
67358
67563
|
children: [
|
|
67359
|
-
/* @__PURE__ */
|
|
67564
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67360
67565
|
children: [
|
|
67361
|
-
/* @__PURE__ */
|
|
67566
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67362
67567
|
bold: true,
|
|
67363
67568
|
children: [
|
|
67364
67569
|
"Edit Line",
|
|
@@ -67367,17 +67572,17 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67367
67572
|
" "
|
|
67368
67573
|
]
|
|
67369
67574
|
}, undefined, true, undefined, this),
|
|
67370
|
-
moveMode && /* @__PURE__ */
|
|
67575
|
+
moveMode && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67371
67576
|
color: "blue",
|
|
67372
67577
|
children: "[MOVE MODE]"
|
|
67373
67578
|
}, undefined, false, undefined, this),
|
|
67374
|
-
widgetPicker && /* @__PURE__ */
|
|
67579
|
+
widgetPicker && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67375
67580
|
color: "cyan",
|
|
67376
67581
|
children: `[${pickerActionLabel.toUpperCase()}]`
|
|
67377
67582
|
}, undefined, false, undefined, this),
|
|
67378
|
-
(settings.powerline.enabled || Boolean(settings.defaultSeparator)) && /* @__PURE__ */
|
|
67583
|
+
(settings.powerline.enabled || Boolean(settings.defaultSeparator)) && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67379
67584
|
marginLeft: 2,
|
|
67380
|
-
children: /* @__PURE__ */
|
|
67585
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67381
67586
|
color: "yellow",
|
|
67382
67587
|
children: [
|
|
67383
67588
|
"⚠",
|
|
@@ -67388,46 +67593,46 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67388
67593
|
}, undefined, false, undefined, this)
|
|
67389
67594
|
]
|
|
67390
67595
|
}, undefined, true, undefined, this),
|
|
67391
|
-
moveMode ? /* @__PURE__ */
|
|
67596
|
+
moveMode ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67392
67597
|
flexDirection: "column",
|
|
67393
67598
|
marginBottom: 1,
|
|
67394
|
-
children: /* @__PURE__ */
|
|
67599
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67395
67600
|
dimColor: true,
|
|
67396
67601
|
children: "↑↓ to move widget, ESC or Enter to exit move mode"
|
|
67397
67602
|
}, undefined, false, undefined, this)
|
|
67398
|
-
}, undefined, false, undefined, this) : widgetPicker ? /* @__PURE__ */
|
|
67603
|
+
}, undefined, false, undefined, this) : widgetPicker ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67399
67604
|
flexDirection: "column",
|
|
67400
|
-
children: widgetPicker.level === "category" ? /* @__PURE__ */
|
|
67605
|
+
children: widgetPicker.level === "category" ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
|
|
67401
67606
|
children: [
|
|
67402
|
-
widgetPicker.categoryQuery.trim().length > 0 ? /* @__PURE__ */
|
|
67607
|
+
widgetPicker.categoryQuery.trim().length > 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67403
67608
|
dimColor: true,
|
|
67404
67609
|
children: "↑↓ select widget match, Enter apply, ESC clear/cancel"
|
|
67405
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
67610
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67406
67611
|
dimColor: true,
|
|
67407
67612
|
children: "↑↓ select category, type to search all widgets, Enter continue, ESC cancel"
|
|
67408
67613
|
}, undefined, false, undefined, this),
|
|
67409
|
-
/* @__PURE__ */
|
|
67614
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67410
67615
|
children: [
|
|
67411
|
-
/* @__PURE__ */
|
|
67616
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67412
67617
|
dimColor: true,
|
|
67413
67618
|
children: "Search: "
|
|
67414
67619
|
}, undefined, false, undefined, this),
|
|
67415
|
-
/* @__PURE__ */
|
|
67620
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67416
67621
|
color: "cyan",
|
|
67417
67622
|
children: widgetPicker.categoryQuery || "(none)"
|
|
67418
67623
|
}, undefined, false, undefined, this)
|
|
67419
67624
|
]
|
|
67420
67625
|
}, undefined, true, undefined, this)
|
|
67421
67626
|
]
|
|
67422
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
67627
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
|
|
67423
67628
|
children: [
|
|
67424
|
-
/* @__PURE__ */
|
|
67629
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67425
67630
|
dimColor: true,
|
|
67426
67631
|
children: "↑↓ select widget, type to search widgets, Enter apply, ESC back"
|
|
67427
67632
|
}, undefined, false, undefined, this),
|
|
67428
|
-
/* @__PURE__ */
|
|
67633
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67429
67634
|
children: [
|
|
67430
|
-
/* @__PURE__ */
|
|
67635
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67431
67636
|
dimColor: true,
|
|
67432
67637
|
children: [
|
|
67433
67638
|
"Category:",
|
|
@@ -67438,7 +67643,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67438
67643
|
" "
|
|
67439
67644
|
]
|
|
67440
67645
|
}, undefined, true, undefined, this),
|
|
67441
|
-
/* @__PURE__ */
|
|
67646
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67442
67647
|
color: "cyan",
|
|
67443
67648
|
children: widgetPicker.widgetQuery || "(none)"
|
|
67444
67649
|
}, undefined, false, undefined, this)
|
|
@@ -67446,132 +67651,132 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67446
67651
|
}, undefined, true, undefined, this)
|
|
67447
67652
|
]
|
|
67448
67653
|
}, undefined, true, undefined, this)
|
|
67449
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
67654
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67450
67655
|
flexDirection: "column",
|
|
67451
67656
|
children: [
|
|
67452
|
-
/* @__PURE__ */
|
|
67657
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67453
67658
|
dimColor: true,
|
|
67454
67659
|
children: helpText
|
|
67455
67660
|
}, undefined, false, undefined, this),
|
|
67456
|
-
/* @__PURE__ */
|
|
67661
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67457
67662
|
dimColor: true,
|
|
67458
67663
|
children: customKeybindsText || " "
|
|
67459
67664
|
}, undefined, false, undefined, this)
|
|
67460
67665
|
]
|
|
67461
67666
|
}, undefined, true, undefined, this),
|
|
67462
|
-
hasFlexSeparator && !widthDetectionAvailable && /* @__PURE__ */
|
|
67667
|
+
hasFlexSeparator && !widthDetectionAvailable && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67463
67668
|
marginTop: 1,
|
|
67464
67669
|
children: [
|
|
67465
|
-
/* @__PURE__ */
|
|
67670
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67466
67671
|
color: "yellow",
|
|
67467
67672
|
children: "⚠ Note: Terminal width detection is currently unavailable in your environment."
|
|
67468
67673
|
}, undefined, false, undefined, this),
|
|
67469
|
-
/* @__PURE__ */
|
|
67674
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67470
67675
|
dimColor: true,
|
|
67471
67676
|
children: " Flex separators will act as normal separators until width detection is available."
|
|
67472
67677
|
}, undefined, false, undefined, this)
|
|
67473
67678
|
]
|
|
67474
67679
|
}, undefined, true, undefined, this),
|
|
67475
|
-
widgetPicker && /* @__PURE__ */
|
|
67680
|
+
widgetPicker && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67476
67681
|
marginTop: 1,
|
|
67477
67682
|
flexDirection: "column",
|
|
67478
|
-
children: widgetPicker.level === "category" ? widgetPicker.categoryQuery.trim().length > 0 ? topLevelSearchEntries.length === 0 ? /* @__PURE__ */
|
|
67683
|
+
children: widgetPicker.level === "category" ? widgetPicker.categoryQuery.trim().length > 0 ? topLevelSearchEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67479
67684
|
dimColor: true,
|
|
67480
67685
|
children: "No widgets match the search."
|
|
67481
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
67686
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
|
|
67482
67687
|
children: [
|
|
67483
67688
|
topLevelSearchEntries.map((entry, index) => {
|
|
67484
67689
|
const isSelected = entry.type === selectedTopLevelSearchEntry?.type;
|
|
67485
|
-
return /* @__PURE__ */
|
|
67690
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67486
67691
|
flexDirection: "row",
|
|
67487
67692
|
flexWrap: "nowrap",
|
|
67488
67693
|
children: [
|
|
67489
|
-
/* @__PURE__ */
|
|
67694
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67490
67695
|
width: 3,
|
|
67491
|
-
children: /* @__PURE__ */
|
|
67696
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67492
67697
|
color: isSelected ? "green" : undefined,
|
|
67493
67698
|
children: isSelected ? "▶ " : " "
|
|
67494
67699
|
}, undefined, false, undefined, this)
|
|
67495
67700
|
}, undefined, false, undefined, this),
|
|
67496
|
-
/* @__PURE__ */
|
|
67701
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67497
67702
|
color: isSelected ? "green" : undefined,
|
|
67498
67703
|
children: `${index + 1}. ${entry.displayName}`
|
|
67499
67704
|
}, undefined, false, undefined, this)
|
|
67500
67705
|
]
|
|
67501
67706
|
}, entry.type, true, undefined, this);
|
|
67502
67707
|
}),
|
|
67503
|
-
selectedTopLevelSearchEntry && /* @__PURE__ */
|
|
67708
|
+
selectedTopLevelSearchEntry && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67504
67709
|
marginTop: 1,
|
|
67505
67710
|
paddingLeft: 2,
|
|
67506
|
-
children: /* @__PURE__ */
|
|
67711
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67507
67712
|
dimColor: true,
|
|
67508
67713
|
children: selectedTopLevelSearchEntry.description
|
|
67509
67714
|
}, undefined, false, undefined, this)
|
|
67510
67715
|
}, undefined, false, undefined, this)
|
|
67511
67716
|
]
|
|
67512
|
-
}, undefined, true, undefined, this) : pickerCategories.length === 0 ? /* @__PURE__ */
|
|
67717
|
+
}, undefined, true, undefined, this) : pickerCategories.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67513
67718
|
dimColor: true,
|
|
67514
67719
|
children: "No categories available."
|
|
67515
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
67720
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
|
|
67516
67721
|
children: [
|
|
67517
67722
|
pickerCategories.map((category, index) => {
|
|
67518
67723
|
const isSelected = category === selectedPickerCategory;
|
|
67519
|
-
return /* @__PURE__ */
|
|
67724
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67520
67725
|
flexDirection: "row",
|
|
67521
67726
|
flexWrap: "nowrap",
|
|
67522
67727
|
children: [
|
|
67523
|
-
/* @__PURE__ */
|
|
67728
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67524
67729
|
width: 3,
|
|
67525
|
-
children: /* @__PURE__ */
|
|
67730
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67526
67731
|
color: isSelected ? "green" : undefined,
|
|
67527
67732
|
children: isSelected ? "▶ " : " "
|
|
67528
67733
|
}, undefined, false, undefined, this)
|
|
67529
67734
|
}, undefined, false, undefined, this),
|
|
67530
|
-
/* @__PURE__ */
|
|
67735
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67531
67736
|
color: isSelected ? "green" : undefined,
|
|
67532
67737
|
children: `${index + 1}. ${category}`
|
|
67533
67738
|
}, undefined, false, undefined, this)
|
|
67534
67739
|
]
|
|
67535
67740
|
}, category, true, undefined, this);
|
|
67536
67741
|
}),
|
|
67537
|
-
selectedPickerCategory === "All" && /* @__PURE__ */
|
|
67742
|
+
selectedPickerCategory === "All" && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67538
67743
|
marginTop: 1,
|
|
67539
67744
|
paddingLeft: 2,
|
|
67540
|
-
children: /* @__PURE__ */
|
|
67745
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67541
67746
|
dimColor: true,
|
|
67542
67747
|
children: "Search across all widget categories."
|
|
67543
67748
|
}, undefined, false, undefined, this)
|
|
67544
67749
|
}, undefined, false, undefined, this)
|
|
67545
67750
|
]
|
|
67546
|
-
}, undefined, true, undefined, this) : pickerEntries.length === 0 ? /* @__PURE__ */
|
|
67751
|
+
}, undefined, true, undefined, this) : pickerEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67547
67752
|
dimColor: true,
|
|
67548
67753
|
children: "No widgets match the current category/search."
|
|
67549
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
67754
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
|
|
67550
67755
|
children: [
|
|
67551
67756
|
pickerEntries.map((entry, index) => {
|
|
67552
67757
|
const isSelected = entry.type === selectedPickerEntry?.type;
|
|
67553
|
-
return /* @__PURE__ */
|
|
67758
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67554
67759
|
flexDirection: "row",
|
|
67555
67760
|
flexWrap: "nowrap",
|
|
67556
67761
|
children: [
|
|
67557
|
-
/* @__PURE__ */
|
|
67762
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67558
67763
|
width: 3,
|
|
67559
|
-
children: /* @__PURE__ */
|
|
67764
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67560
67765
|
color: isSelected ? "green" : undefined,
|
|
67561
67766
|
children: isSelected ? "▶ " : " "
|
|
67562
67767
|
}, undefined, false, undefined, this)
|
|
67563
67768
|
}, undefined, false, undefined, this),
|
|
67564
|
-
/* @__PURE__ */
|
|
67769
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67565
67770
|
color: isSelected ? "green" : undefined,
|
|
67566
67771
|
children: `${index + 1}. ${entry.displayName}`
|
|
67567
67772
|
}, undefined, false, undefined, this)
|
|
67568
67773
|
]
|
|
67569
67774
|
}, entry.type, true, undefined, this);
|
|
67570
67775
|
}),
|
|
67571
|
-
selectedPickerEntry && /* @__PURE__ */
|
|
67776
|
+
selectedPickerEntry && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67572
67777
|
marginTop: 1,
|
|
67573
67778
|
paddingLeft: 2,
|
|
67574
|
-
children: /* @__PURE__ */
|
|
67779
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67575
67780
|
dimColor: true,
|
|
67576
67781
|
children: selectedPickerEntry.description
|
|
67577
67782
|
}, undefined, false, undefined, this)
|
|
@@ -67579,60 +67784,60 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67579
67784
|
]
|
|
67580
67785
|
}, undefined, true, undefined, this)
|
|
67581
67786
|
}, undefined, false, undefined, this),
|
|
67582
|
-
!widgetPicker && /* @__PURE__ */
|
|
67787
|
+
!widgetPicker && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67583
67788
|
marginTop: 1,
|
|
67584
67789
|
flexDirection: "column",
|
|
67585
|
-
children: widgets.length === 0 ? /* @__PURE__ */
|
|
67790
|
+
children: widgets.length === 0 ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67586
67791
|
dimColor: true,
|
|
67587
67792
|
children: "No widgets. Press 'a' to add one."
|
|
67588
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
67793
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(jsx_dev_runtime12.Fragment, {
|
|
67589
67794
|
children: [
|
|
67590
67795
|
widgets.map((widget, index) => {
|
|
67591
67796
|
const isSelected = index === selectedIndex;
|
|
67592
67797
|
const widgetImpl = widget.type !== "separator" && widget.type !== "flex-separator" ? getWidget(widget.type) : null;
|
|
67593
67798
|
const { displayText, modifierText } = widgetImpl?.getEditorDisplay(widget) ?? { displayText: getWidgetDisplay(widget) };
|
|
67594
67799
|
const supportsRawValue = widgetImpl?.supportsRawValue() ?? false;
|
|
67595
|
-
return /* @__PURE__ */
|
|
67800
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67596
67801
|
flexDirection: "row",
|
|
67597
67802
|
flexWrap: "nowrap",
|
|
67598
67803
|
children: [
|
|
67599
|
-
/* @__PURE__ */
|
|
67804
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67600
67805
|
width: 3,
|
|
67601
|
-
children: /* @__PURE__ */
|
|
67806
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67602
67807
|
color: isSelected ? moveMode ? "blue" : "green" : undefined,
|
|
67603
67808
|
children: isSelected ? moveMode ? "◆ " : "▶ " : " "
|
|
67604
67809
|
}, undefined, false, undefined, this)
|
|
67605
67810
|
}, undefined, false, undefined, this),
|
|
67606
|
-
/* @__PURE__ */
|
|
67811
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67607
67812
|
color: isSelected ? moveMode ? "blue" : "green" : undefined,
|
|
67608
67813
|
children: `${index + 1}. ${displayText || getWidgetDisplay(widget)}`
|
|
67609
67814
|
}, undefined, false, undefined, this),
|
|
67610
|
-
modifierText && /* @__PURE__ */
|
|
67815
|
+
modifierText && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67611
67816
|
dimColor: true,
|
|
67612
67817
|
children: [
|
|
67613
67818
|
" ",
|
|
67614
67819
|
modifierText
|
|
67615
67820
|
]
|
|
67616
67821
|
}, undefined, true, undefined, this),
|
|
67617
|
-
supportsRawValue && widget.rawValue && /* @__PURE__ */
|
|
67822
|
+
supportsRawValue && widget.rawValue && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67618
67823
|
dimColor: true,
|
|
67619
67824
|
children: " (raw value)"
|
|
67620
67825
|
}, undefined, false, undefined, this),
|
|
67621
|
-
widget.merge === true && /* @__PURE__ */
|
|
67826
|
+
widget.merge === true && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67622
67827
|
dimColor: true,
|
|
67623
67828
|
children: " (merged→)"
|
|
67624
67829
|
}, undefined, false, undefined, this),
|
|
67625
|
-
widget.merge === "no-padding" && /* @__PURE__ */
|
|
67830
|
+
widget.merge === "no-padding" && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67626
67831
|
dimColor: true,
|
|
67627
67832
|
children: " (merged-no-pad→)"
|
|
67628
67833
|
}, undefined, false, undefined, this)
|
|
67629
67834
|
]
|
|
67630
67835
|
}, widget.id, true, undefined, this);
|
|
67631
67836
|
}),
|
|
67632
|
-
currentWidget && /* @__PURE__ */
|
|
67837
|
+
currentWidget && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67633
67838
|
marginTop: 1,
|
|
67634
67839
|
paddingLeft: 2,
|
|
67635
|
-
children: /* @__PURE__ */
|
|
67840
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67636
67841
|
dimColor: true,
|
|
67637
67842
|
children: (() => {
|
|
67638
67843
|
if (currentWidget.type === "separator") {
|
|
@@ -67655,8 +67860,8 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67655
67860
|
// src/tui/components/LineSelector.tsx
|
|
67656
67861
|
await init_build2();
|
|
67657
67862
|
var import_pluralize = __toESM(require_pluralize(), 1);
|
|
67658
|
-
var
|
|
67659
|
-
var
|
|
67863
|
+
var import_react39 = __toESM(require_react(), 1);
|
|
67864
|
+
var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
|
|
67660
67865
|
var LineSelector = ({
|
|
67661
67866
|
lines,
|
|
67662
67867
|
onSelect,
|
|
@@ -67668,14 +67873,17 @@ var LineSelector = ({
|
|
|
67668
67873
|
settings,
|
|
67669
67874
|
allowEditing = false
|
|
67670
67875
|
}) => {
|
|
67671
|
-
const [selectedIndex, setSelectedIndex] =
|
|
67672
|
-
const [showDeleteDialog, setShowDeleteDialog] =
|
|
67673
|
-
const [moveMode, setMoveMode] =
|
|
67674
|
-
const [localLines, setLocalLines] =
|
|
67675
|
-
|
|
67876
|
+
const [selectedIndex, setSelectedIndex] = import_react39.useState(initialSelection);
|
|
67877
|
+
const [showDeleteDialog, setShowDeleteDialog] = import_react39.useState(false);
|
|
67878
|
+
const [moveMode, setMoveMode] = import_react39.useState(false);
|
|
67879
|
+
const [localLines, setLocalLines] = import_react39.useState(lines);
|
|
67880
|
+
import_react39.useEffect(() => {
|
|
67676
67881
|
setLocalLines(lines);
|
|
67677
67882
|
}, [lines]);
|
|
67678
|
-
|
|
67883
|
+
import_react39.useEffect(() => {
|
|
67884
|
+
setSelectedIndex(initialSelection);
|
|
67885
|
+
}, [initialSelection]);
|
|
67886
|
+
const selectedLine = import_react39.useMemo(() => localLines[selectedIndex], [localLines, selectedIndex]);
|
|
67679
67887
|
const appendLine = () => {
|
|
67680
67888
|
const newLines = [...localLines, []];
|
|
67681
67889
|
setLocalLines(newLines);
|
|
@@ -67735,7 +67943,7 @@ var LineSelector = ({
|
|
|
67735
67943
|
}
|
|
67736
67944
|
return;
|
|
67737
67945
|
case "d":
|
|
67738
|
-
if (allowEditing && localLines.length > 1) {
|
|
67946
|
+
if (allowEditing && localLines.length > 1 && selectedIndex < localLines.length) {
|
|
67739
67947
|
setShowDeleteDialog(true);
|
|
67740
67948
|
}
|
|
67741
67949
|
return;
|
|
@@ -67747,29 +67955,19 @@ var LineSelector = ({
|
|
|
67747
67955
|
}
|
|
67748
67956
|
if (key.escape) {
|
|
67749
67957
|
onBack();
|
|
67750
|
-
} else if (key.upArrow) {
|
|
67751
|
-
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
67752
|
-
} else if (key.downArrow) {
|
|
67753
|
-
setSelectedIndex(Math.min(localLines.length, selectedIndex + 1));
|
|
67754
|
-
} else if (key.return) {
|
|
67755
|
-
if (selectedIndex === localLines.length) {
|
|
67756
|
-
onBack();
|
|
67757
|
-
} else {
|
|
67758
|
-
onSelect(selectedIndex);
|
|
67759
|
-
}
|
|
67760
67958
|
}
|
|
67761
67959
|
});
|
|
67762
67960
|
if (isThemeManaged) {
|
|
67763
|
-
return /* @__PURE__ */
|
|
67961
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67764
67962
|
flexDirection: "column",
|
|
67765
67963
|
children: [
|
|
67766
|
-
/* @__PURE__ */
|
|
67964
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67767
67965
|
bold: true,
|
|
67768
67966
|
children: title ?? "Select Line"
|
|
67769
67967
|
}, undefined, false, undefined, this),
|
|
67770
|
-
/* @__PURE__ */
|
|
67968
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67771
67969
|
marginTop: 1,
|
|
67772
|
-
children: /* @__PURE__ */
|
|
67970
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67773
67971
|
color: "yellow",
|
|
67774
67972
|
children: [
|
|
67775
67973
|
"⚠ Colors are currently managed by the Powerline theme:",
|
|
@@ -67777,30 +67975,30 @@ var LineSelector = ({
|
|
|
67777
67975
|
]
|
|
67778
67976
|
}, undefined, true, undefined, this)
|
|
67779
67977
|
}, undefined, false, undefined, this),
|
|
67780
|
-
/* @__PURE__ */
|
|
67978
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67781
67979
|
marginTop: 1,
|
|
67782
|
-
children: /* @__PURE__ */
|
|
67980
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67783
67981
|
dimColor: true,
|
|
67784
67982
|
children: "To customize colors, either:"
|
|
67785
67983
|
}, undefined, false, undefined, this)
|
|
67786
67984
|
}, undefined, false, undefined, this),
|
|
67787
|
-
/* @__PURE__ */
|
|
67985
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67788
67986
|
marginLeft: 2,
|
|
67789
|
-
children: /* @__PURE__ */
|
|
67987
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67790
67988
|
dimColor: true,
|
|
67791
67989
|
children: "• Change to 'Custom' theme in Powerline Configuration → Themes"
|
|
67792
67990
|
}, undefined, false, undefined, this)
|
|
67793
67991
|
}, undefined, false, undefined, this),
|
|
67794
|
-
/* @__PURE__ */
|
|
67992
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67795
67993
|
marginLeft: 2,
|
|
67796
|
-
children: /* @__PURE__ */
|
|
67994
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67797
67995
|
dimColor: true,
|
|
67798
67996
|
children: "• Disable Powerline mode in Powerline Configuration"
|
|
67799
67997
|
}, undefined, false, undefined, this)
|
|
67800
67998
|
}, undefined, false, undefined, this),
|
|
67801
|
-
/* @__PURE__ */
|
|
67999
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67802
68000
|
marginTop: 2,
|
|
67803
|
-
children: /* @__PURE__ */
|
|
68001
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67804
68002
|
children: "Press any key to go back..."
|
|
67805
68003
|
}, undefined, false, undefined, this)
|
|
67806
68004
|
}, undefined, false, undefined, this)
|
|
@@ -67809,26 +68007,25 @@ var LineSelector = ({
|
|
|
67809
68007
|
}
|
|
67810
68008
|
if (showDeleteDialog && selectedLine) {
|
|
67811
68009
|
const suffix = selectedLine.length > 0 ? import_pluralize.default("widget", selectedLine.length, true) : "empty";
|
|
67812
|
-
return /* @__PURE__ */
|
|
68010
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67813
68011
|
flexDirection: "column",
|
|
67814
68012
|
children: [
|
|
67815
|
-
/* @__PURE__ */
|
|
68013
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67816
68014
|
flexDirection: "column",
|
|
67817
68015
|
gap: 1,
|
|
67818
68016
|
children: [
|
|
67819
|
-
/* @__PURE__ */
|
|
68017
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67820
68018
|
bold: true,
|
|
67821
|
-
children: /* @__PURE__ */
|
|
68019
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67822
68020
|
children: [
|
|
67823
|
-
/* @__PURE__ */
|
|
68021
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67824
68022
|
children: [
|
|
67825
68023
|
"☰ Line",
|
|
67826
|
-
" ",
|
|
67827
68024
|
selectedIndex + 1
|
|
67828
68025
|
]
|
|
67829
68026
|
}, undefined, true, undefined, this),
|
|
67830
68027
|
" ",
|
|
67831
|
-
/* @__PURE__ */
|
|
68028
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67832
68029
|
dimColor: true,
|
|
67833
68030
|
children: [
|
|
67834
68031
|
"(",
|
|
@@ -67839,15 +68036,15 @@ var LineSelector = ({
|
|
|
67839
68036
|
]
|
|
67840
68037
|
}, undefined, true, undefined, this)
|
|
67841
68038
|
}, undefined, false, undefined, this),
|
|
67842
|
-
/* @__PURE__ */
|
|
68039
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67843
68040
|
bold: true,
|
|
67844
68041
|
children: "Are you sure you want to delete line?"
|
|
67845
68042
|
}, undefined, false, undefined, this)
|
|
67846
68043
|
]
|
|
67847
68044
|
}, undefined, true, undefined, this),
|
|
67848
|
-
/* @__PURE__ */
|
|
68045
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67849
68046
|
marginTop: 1,
|
|
67850
|
-
children: /* @__PURE__ */
|
|
68047
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ConfirmDialog, {
|
|
67851
68048
|
inline: true,
|
|
67852
68049
|
onConfirm: () => {
|
|
67853
68050
|
deleteLine(selectedIndex);
|
|
@@ -67862,190 +68059,201 @@ var LineSelector = ({
|
|
|
67862
68059
|
]
|
|
67863
68060
|
}, undefined, true, undefined, this);
|
|
67864
68061
|
}
|
|
67865
|
-
|
|
67866
|
-
|
|
68062
|
+
const lineItems = localLines.map((line, index) => ({
|
|
68063
|
+
label: `☰ Line ${index + 1}`,
|
|
68064
|
+
sublabel: `(${line.length > 0 ? import_pluralize.default("widget", line.length, true) : "empty"})`,
|
|
68065
|
+
value: index
|
|
68066
|
+
}));
|
|
68067
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
|
|
68068
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67867
68069
|
flexDirection: "column",
|
|
67868
68070
|
children: [
|
|
67869
|
-
/* @__PURE__ */
|
|
68071
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67870
68072
|
children: [
|
|
67871
|
-
/* @__PURE__ */
|
|
68073
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67872
68074
|
bold: true,
|
|
67873
68075
|
children: [
|
|
67874
68076
|
title ?? "Select Line to Edit",
|
|
67875
68077
|
" "
|
|
67876
68078
|
]
|
|
67877
68079
|
}, undefined, true, undefined, this),
|
|
67878
|
-
moveMode && /* @__PURE__ */
|
|
68080
|
+
moveMode && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67879
68081
|
color: "blue",
|
|
67880
68082
|
children: "[MOVE MODE]"
|
|
67881
68083
|
}, undefined, false, undefined, this)
|
|
67882
68084
|
]
|
|
67883
68085
|
}, undefined, true, undefined, this),
|
|
67884
|
-
/* @__PURE__ */
|
|
68086
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67885
68087
|
dimColor: true,
|
|
67886
68088
|
children: "Choose which status line to configure"
|
|
67887
68089
|
}, undefined, false, undefined, this),
|
|
67888
|
-
moveMode ? /* @__PURE__ */
|
|
68090
|
+
moveMode ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67889
68091
|
dimColor: true,
|
|
67890
68092
|
children: "↑↓ to move line, ESC or Enter to exit move mode"
|
|
67891
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
68093
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
67892
68094
|
dimColor: true,
|
|
67893
68095
|
children: allowEditing ? localLines.length > 1 ? "(a) to append new line, (d) to delete line, (m) to move line, ESC to go back" : "(a) to append new line, ESC to go back" : "ESC to go back"
|
|
67894
68096
|
}, undefined, false, undefined, this),
|
|
67895
|
-
/* @__PURE__ */
|
|
68097
|
+
moveMode ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
67896
68098
|
marginTop: 1,
|
|
67897
68099
|
flexDirection: "column",
|
|
67898
|
-
children:
|
|
67899
|
-
|
|
67900
|
-
|
|
67901
|
-
|
|
67902
|
-
|
|
67903
|
-
|
|
67904
|
-
color: isSelected ? moveMode ? "blue" : "green" : undefined,
|
|
67905
|
-
children: [
|
|
67906
|
-
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67907
|
-
children: isSelected ? moveMode ? "◆ " : "▶ " : " "
|
|
67908
|
-
}, undefined, false, undefined, this),
|
|
67909
|
-
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67910
|
-
children: [
|
|
67911
|
-
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67912
|
-
children: [
|
|
67913
|
-
"☰ Line",
|
|
67914
|
-
" ",
|
|
67915
|
-
index + 1
|
|
67916
|
-
]
|
|
67917
|
-
}, undefined, true, undefined, this),
|
|
67918
|
-
" ",
|
|
67919
|
-
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67920
|
-
dimColor: !isSelected,
|
|
67921
|
-
children: [
|
|
67922
|
-
"(",
|
|
67923
|
-
suffix,
|
|
67924
|
-
")"
|
|
67925
|
-
]
|
|
67926
|
-
}, undefined, true, undefined, this)
|
|
67927
|
-
]
|
|
67928
|
-
}, undefined, true, undefined, this)
|
|
67929
|
-
]
|
|
67930
|
-
}, undefined, true, undefined, this)
|
|
67931
|
-
}, index, false, undefined, this);
|
|
67932
|
-
}),
|
|
67933
|
-
!moveMode && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
67934
|
-
marginTop: 1,
|
|
67935
|
-
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
67936
|
-
color: selectedIndex === localLines.length ? "green" : undefined,
|
|
68100
|
+
children: localLines.map((line, index) => {
|
|
68101
|
+
const isSelected = selectedIndex === index;
|
|
68102
|
+
const suffix = line.length ? import_pluralize.default("widget", line.length, true) : "empty";
|
|
68103
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
68104
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
68105
|
+
color: isSelected ? "blue" : undefined,
|
|
67937
68106
|
children: [
|
|
67938
|
-
|
|
67939
|
-
|
|
68107
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
68108
|
+
children: isSelected ? "◆ " : " "
|
|
68109
|
+
}, undefined, false, undefined, this),
|
|
68110
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
68111
|
+
children: [
|
|
68112
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
68113
|
+
children: [
|
|
68114
|
+
"☰ Line",
|
|
68115
|
+
" ",
|
|
68116
|
+
index + 1
|
|
68117
|
+
]
|
|
68118
|
+
}, undefined, true, undefined, this),
|
|
68119
|
+
" ",
|
|
68120
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
68121
|
+
dimColor: !isSelected,
|
|
68122
|
+
children: [
|
|
68123
|
+
"(",
|
|
68124
|
+
suffix,
|
|
68125
|
+
")"
|
|
68126
|
+
]
|
|
68127
|
+
}, undefined, true, undefined, this)
|
|
68128
|
+
]
|
|
68129
|
+
}, undefined, true, undefined, this)
|
|
67940
68130
|
]
|
|
67941
68131
|
}, undefined, true, undefined, this)
|
|
67942
|
-
},
|
|
67943
|
-
|
|
67944
|
-
}, undefined,
|
|
68132
|
+
}, index, false, undefined, this);
|
|
68133
|
+
})
|
|
68134
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(List, {
|
|
68135
|
+
marginTop: 1,
|
|
68136
|
+
items: lineItems,
|
|
68137
|
+
onSelect: (line) => {
|
|
68138
|
+
if (line === "back") {
|
|
68139
|
+
onBack();
|
|
68140
|
+
return;
|
|
68141
|
+
}
|
|
68142
|
+
onSelect(line);
|
|
68143
|
+
},
|
|
68144
|
+
onSelectionChange: (_, index) => {
|
|
68145
|
+
setSelectedIndex(index);
|
|
68146
|
+
},
|
|
68147
|
+
initialSelection: selectedIndex,
|
|
68148
|
+
showBackButton: true
|
|
68149
|
+
}, undefined, false, undefined, this)
|
|
67945
68150
|
]
|
|
67946
68151
|
}, undefined, true, undefined, this)
|
|
67947
68152
|
}, undefined, false, undefined, this);
|
|
67948
68153
|
};
|
|
67949
68154
|
// src/tui/components/MainMenu.tsx
|
|
67950
68155
|
await init_build2();
|
|
67951
|
-
var
|
|
67952
|
-
var
|
|
67953
|
-
|
|
67954
|
-
|
|
68156
|
+
var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68157
|
+
var MainMenu = ({
|
|
68158
|
+
onSelect,
|
|
68159
|
+
isClaudeInstalled,
|
|
68160
|
+
hasChanges,
|
|
68161
|
+
initialSelection = 0,
|
|
68162
|
+
powerlineFontStatus,
|
|
68163
|
+
settings,
|
|
68164
|
+
previewIsTruncated
|
|
68165
|
+
}) => {
|
|
67955
68166
|
const menuItems = [
|
|
67956
|
-
{
|
|
67957
|
-
|
|
67958
|
-
|
|
67959
|
-
|
|
67960
|
-
|
|
67961
|
-
{
|
|
67962
|
-
|
|
67963
|
-
|
|
68167
|
+
{
|
|
68168
|
+
label: "\uD83D\uDCDD Edit Lines",
|
|
68169
|
+
value: "lines",
|
|
68170
|
+
description: "Configure any number of status lines with various widgets like model info, git status, and token usage"
|
|
68171
|
+
},
|
|
68172
|
+
{
|
|
68173
|
+
label: "\uD83C\uDFA8 Edit Colors",
|
|
68174
|
+
value: "colors",
|
|
68175
|
+
description: "Customize colors for each widget including foreground, background, and bold styling"
|
|
68176
|
+
},
|
|
68177
|
+
{
|
|
68178
|
+
label: "⚡ Powerline Setup",
|
|
68179
|
+
value: "powerline",
|
|
68180
|
+
description: "Install Powerline fonts for enhanced visual separators and symbols in your status line"
|
|
68181
|
+
},
|
|
68182
|
+
"-",
|
|
68183
|
+
{
|
|
68184
|
+
label: "\uD83D\uDCBB Terminal Options",
|
|
68185
|
+
value: "terminalConfig",
|
|
68186
|
+
description: "Configure terminal-specific settings for optimal display"
|
|
68187
|
+
},
|
|
68188
|
+
{
|
|
68189
|
+
label: "\uD83C\uDF10 Global Overrides",
|
|
68190
|
+
value: "globalOverrides",
|
|
68191
|
+
description: "Set global padding, separators, and color overrides that apply to all widgets"
|
|
68192
|
+
},
|
|
68193
|
+
"-",
|
|
68194
|
+
{
|
|
68195
|
+
label: isClaudeInstalled ? "\uD83D\uDD0C Uninstall from Claude Code" : "\uD83D\uDCE6 Install to Claude Code",
|
|
68196
|
+
value: "install",
|
|
68197
|
+
description: isClaudeInstalled ? "Remove ccstatusline from your Claude Code settings" : "Add ccstatusline to your Claude Code settings for automatic status line rendering"
|
|
68198
|
+
}
|
|
67964
68199
|
];
|
|
67965
68200
|
if (hasChanges) {
|
|
67966
|
-
menuItems.push({
|
|
68201
|
+
menuItems.push({
|
|
68202
|
+
label: "\uD83D\uDCBE Save & Exit",
|
|
68203
|
+
value: "save",
|
|
68204
|
+
description: "Save all changes and exit the configuration tool"
|
|
68205
|
+
}, {
|
|
68206
|
+
label: "❌ Exit without saving",
|
|
68207
|
+
value: "exit",
|
|
68208
|
+
description: "Exit without saving your changes"
|
|
68209
|
+
}, "-", {
|
|
68210
|
+
label: "⭐ Like ccstatusline? Star us on GitHub",
|
|
68211
|
+
value: "starGithub",
|
|
68212
|
+
description: "Open the ccstatusline GitHub repository in your browser so you can star the project"
|
|
68213
|
+
});
|
|
67967
68214
|
} else {
|
|
67968
|
-
menuItems.push({
|
|
68215
|
+
menuItems.push({
|
|
68216
|
+
label: "\uD83D\uDEAA Exit",
|
|
68217
|
+
value: "exit",
|
|
68218
|
+
description: "Exit the configuration tool"
|
|
68219
|
+
}, "-", {
|
|
68220
|
+
label: "⭐ Like ccstatusline? Star us on GitHub",
|
|
68221
|
+
value: "starGithub",
|
|
68222
|
+
description: "Open the ccstatusline GitHub repository in your browser so you can star the project"
|
|
68223
|
+
});
|
|
67969
68224
|
}
|
|
67970
|
-
const selectableItems = menuItems.filter((item) => item.selectable);
|
|
67971
|
-
use_input_default((input, key) => {
|
|
67972
|
-
if (key.upArrow) {
|
|
67973
|
-
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
67974
|
-
} else if (key.downArrow) {
|
|
67975
|
-
setSelectedIndex(Math.min(selectableItems.length - 1, selectedIndex + 1));
|
|
67976
|
-
} else if (key.return) {
|
|
67977
|
-
const item = selectableItems[selectedIndex];
|
|
67978
|
-
if (item) {
|
|
67979
|
-
onSelect(item.value);
|
|
67980
|
-
}
|
|
67981
|
-
}
|
|
67982
|
-
});
|
|
67983
|
-
const getDescription = (value) => {
|
|
67984
|
-
const descriptions = {
|
|
67985
|
-
lines: "Configure any number of status lines with various widgets like model info, git status, and token usage",
|
|
67986
|
-
colors: "Customize colors for each widget including foreground, background, and bold styling",
|
|
67987
|
-
powerline: "Install Powerline fonts for enhanced visual separators and symbols in your status line",
|
|
67988
|
-
globalOverrides: "Set global padding, separators, and color overrides that apply to all widgets",
|
|
67989
|
-
install: isClaudeInstalled ? "Remove ccstatusline from your Claude Code settings" : "Add ccstatusline to your Claude Code settings for automatic status line rendering",
|
|
67990
|
-
terminalConfig: "Configure terminal-specific settings for optimal display",
|
|
67991
|
-
starGithub: "Open the ccstatusline GitHub repository in your browser so you can star the project",
|
|
67992
|
-
save: "Save all changes and exit the configuration tool",
|
|
67993
|
-
exit: hasChanges ? "Exit without saving your changes" : "Exit the configuration tool"
|
|
67994
|
-
};
|
|
67995
|
-
return descriptions[value] ?? "";
|
|
67996
|
-
};
|
|
67997
|
-
const selectedItem = selectableItems[selectedIndex];
|
|
67998
|
-
const description = selectedItem ? getDescription(selectedItem.value) : "";
|
|
67999
68225
|
const showTruncationWarning = previewIsTruncated && settings?.flexMode === "full-minus-40";
|
|
68000
|
-
return /* @__PURE__ */
|
|
68226
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68001
68227
|
flexDirection: "column",
|
|
68002
68228
|
children: [
|
|
68003
|
-
showTruncationWarning && /* @__PURE__ */
|
|
68229
|
+
showTruncationWarning && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
68004
68230
|
marginBottom: 1,
|
|
68005
|
-
children: /* @__PURE__ */
|
|
68231
|
+
children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
68006
68232
|
color: "yellow",
|
|
68007
68233
|
children: "⚠ Some lines are truncated, see Terminal Options → Terminal Width for info"
|
|
68008
68234
|
}, undefined, false, undefined, this)
|
|
68009
68235
|
}, undefined, false, undefined, this),
|
|
68010
|
-
/* @__PURE__ */
|
|
68236
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
68011
68237
|
bold: true,
|
|
68012
68238
|
children: "Main Menu"
|
|
68013
68239
|
}, undefined, false, undefined, this),
|
|
68014
|
-
/* @__PURE__ */
|
|
68240
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(List, {
|
|
68241
|
+
items: menuItems,
|
|
68015
68242
|
marginTop: 1,
|
|
68016
|
-
|
|
68017
|
-
|
|
68018
|
-
|
|
68019
|
-
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
68020
|
-
children: " "
|
|
68021
|
-
}, item.value, false, undefined, this);
|
|
68243
|
+
onSelect: (value, index) => {
|
|
68244
|
+
if (value === "back") {
|
|
68245
|
+
return;
|
|
68022
68246
|
}
|
|
68023
|
-
|
|
68024
|
-
|
|
68025
|
-
|
|
68026
|
-
color: isSelected ? "green" : undefined,
|
|
68027
|
-
children: [
|
|
68028
|
-
isSelected ? "▶ " : " ",
|
|
68029
|
-
item.label
|
|
68030
|
-
]
|
|
68031
|
-
}, item.value, true, undefined, this);
|
|
68032
|
-
})
|
|
68033
|
-
}, undefined, false, undefined, this),
|
|
68034
|
-
description && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
68035
|
-
marginTop: 1,
|
|
68036
|
-
paddingLeft: 2,
|
|
68037
|
-
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
68038
|
-
dimColor: true,
|
|
68039
|
-
wrap: "wrap",
|
|
68040
|
-
children: description
|
|
68041
|
-
}, undefined, false, undefined, this)
|
|
68247
|
+
onSelect(value, index);
|
|
68248
|
+
},
|
|
68249
|
+
initialSelection
|
|
68042
68250
|
}, undefined, false, undefined, this)
|
|
68043
68251
|
]
|
|
68044
68252
|
}, undefined, true, undefined, this);
|
|
68045
68253
|
};
|
|
68046
68254
|
// src/tui/components/PowerlineSetup.tsx
|
|
68047
68255
|
await init_build2();
|
|
68048
|
-
var
|
|
68256
|
+
var import_react42 = __toESM(require_react(), 1);
|
|
68049
68257
|
import * as os11 from "os";
|
|
68050
68258
|
|
|
68051
68259
|
// src/utils/powerline-settings.ts
|
|
@@ -68076,8 +68284,8 @@ function buildEnabledPowerlineSettings(settings, removeManualSeparators) {
|
|
|
68076
68284
|
// src/tui/components/PowerlineSeparatorEditor.tsx
|
|
68077
68285
|
init_input_guards();
|
|
68078
68286
|
await init_build2();
|
|
68079
|
-
var
|
|
68080
|
-
var
|
|
68287
|
+
var import_react40 = __toESM(require_react(), 1);
|
|
68288
|
+
var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68081
68289
|
var PowerlineSeparatorEditor = ({
|
|
68082
68290
|
settings,
|
|
68083
68291
|
mode,
|
|
@@ -68097,10 +68305,10 @@ var PowerlineSeparatorEditor = ({
|
|
|
68097
68305
|
};
|
|
68098
68306
|
const separators = getItems();
|
|
68099
68307
|
const invertBgs = mode === "separator" ? powerlineConfig.separatorInvertBackground : [];
|
|
68100
|
-
const [selectedIndex, setSelectedIndex] =
|
|
68101
|
-
const [hexInputMode, setHexInputMode] =
|
|
68102
|
-
const [hexInput, setHexInput] =
|
|
68103
|
-
const [cursorPos, setCursorPos] =
|
|
68308
|
+
const [selectedIndex, setSelectedIndex] = import_react40.useState(0);
|
|
68309
|
+
const [hexInputMode, setHexInputMode] = import_react40.useState(false);
|
|
68310
|
+
const [hexInput, setHexInput] = import_react40.useState("");
|
|
68311
|
+
const [cursorPos, setCursorPos] = import_react40.useState(0);
|
|
68104
68312
|
const getPresets = () => {
|
|
68105
68313
|
if (mode === "separator") {
|
|
68106
68314
|
return [
|
|
@@ -68293,18 +68501,18 @@ var PowerlineSeparatorEditor = ({
|
|
|
68293
68501
|
};
|
|
68294
68502
|
const canAdd = mode === "separator" || separators.length < 3;
|
|
68295
68503
|
const canDelete = mode !== "separator" || separators.length > 1;
|
|
68296
|
-
return /* @__PURE__ */
|
|
68504
|
+
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68297
68505
|
flexDirection: "column",
|
|
68298
68506
|
children: [
|
|
68299
|
-
/* @__PURE__ */
|
|
68507
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68300
68508
|
bold: true,
|
|
68301
68509
|
children: getTitle()
|
|
68302
68510
|
}, undefined, false, undefined, this),
|
|
68303
|
-
hexInputMode ? /* @__PURE__ */
|
|
68511
|
+
hexInputMode ? /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68304
68512
|
marginTop: 2,
|
|
68305
68513
|
flexDirection: "column",
|
|
68306
68514
|
children: [
|
|
68307
|
-
/* @__PURE__ */
|
|
68515
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68308
68516
|
children: [
|
|
68309
68517
|
"Enter hex code (4-6 digits) for",
|
|
68310
68518
|
" ",
|
|
@@ -68313,51 +68521,51 @@ var PowerlineSeparatorEditor = ({
|
|
|
68313
68521
|
":"
|
|
68314
68522
|
]
|
|
68315
68523
|
}, undefined, true, undefined, this),
|
|
68316
|
-
/* @__PURE__ */
|
|
68524
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68317
68525
|
children: [
|
|
68318
68526
|
"U+",
|
|
68319
68527
|
hexInput.slice(0, cursorPos),
|
|
68320
|
-
/* @__PURE__ */
|
|
68528
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68321
68529
|
backgroundColor: "gray",
|
|
68322
68530
|
color: "black",
|
|
68323
68531
|
children: hexInput[cursorPos] ?? "_"
|
|
68324
68532
|
}, undefined, false, undefined, this),
|
|
68325
68533
|
hexInput.slice(cursorPos + 1),
|
|
68326
|
-
hexInput.length < 6 && hexInput.length === cursorPos && /* @__PURE__ */
|
|
68534
|
+
hexInput.length < 6 && hexInput.length === cursorPos && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68327
68535
|
dimColor: true,
|
|
68328
68536
|
children: "_".repeat(6 - hexInput.length - 1)
|
|
68329
68537
|
}, undefined, false, undefined, this)
|
|
68330
68538
|
]
|
|
68331
68539
|
}, undefined, true, undefined, this),
|
|
68332
|
-
/* @__PURE__ */
|
|
68540
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68333
68541
|
dimColor: true,
|
|
68334
68542
|
children: "Enter 4-6 hex digits (0-9, A-F) for a Unicode code point, then press Enter. ESC to cancel."
|
|
68335
68543
|
}, undefined, false, undefined, this),
|
|
68336
|
-
/* @__PURE__ */
|
|
68544
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68337
68545
|
dimColor: true,
|
|
68338
68546
|
children: "Examples: E0B0 (powerline), 1F984 (\uD83E\uDD84), 2764 (❤)"
|
|
68339
68547
|
}, undefined, false, undefined, this)
|
|
68340
68548
|
]
|
|
68341
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
68549
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
|
|
68342
68550
|
children: [
|
|
68343
|
-
/* @__PURE__ */
|
|
68344
|
-
children: /* @__PURE__ */
|
|
68551
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68552
|
+
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68345
68553
|
dimColor: true,
|
|
68346
68554
|
children: `↑↓ select, ← → cycle${canAdd ? ", (a)dd, (i)nsert" : ""}${canDelete ? ", (d)elete" : ""}, (c)lear, (h)ex${mode === "separator" ? ", (t)oggle invert" : ""}, ESC back`
|
|
68347
68555
|
}, undefined, false, undefined, this)
|
|
68348
68556
|
}, undefined, false, undefined, this),
|
|
68349
|
-
/* @__PURE__ */
|
|
68557
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68350
68558
|
marginTop: 2,
|
|
68351
68559
|
flexDirection: "column",
|
|
68352
|
-
children: separators.length > 0 ? separators.map((sep2, index) => /* @__PURE__ */
|
|
68353
|
-
children: /* @__PURE__ */
|
|
68560
|
+
children: separators.length > 0 ? separators.map((sep2, index) => /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68561
|
+
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68354
68562
|
color: index === selectedIndex ? "green" : undefined,
|
|
68355
68563
|
children: [
|
|
68356
68564
|
index === selectedIndex ? "▶ " : " ",
|
|
68357
68565
|
`${index + 1}: ${getSeparatorDisplay(sep2, index)}`
|
|
68358
68566
|
]
|
|
68359
68567
|
}, undefined, true, undefined, this)
|
|
68360
|
-
}, index, false, undefined, this)) : /* @__PURE__ */
|
|
68568
|
+
}, index, false, undefined, this)) : /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68361
68569
|
dimColor: true,
|
|
68362
68570
|
children: "(none configured - press 'a' to add)"
|
|
68363
68571
|
}, undefined, false, undefined, this)
|
|
@@ -68372,143 +68580,150 @@ var PowerlineSeparatorEditor = ({
|
|
|
68372
68580
|
init_ColorLevel();
|
|
68373
68581
|
init_colors();
|
|
68374
68582
|
await init_build2();
|
|
68375
|
-
var
|
|
68376
|
-
var
|
|
68583
|
+
var import_react41 = __toESM(require_react(), 1);
|
|
68584
|
+
var jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68585
|
+
function buildPowerlineThemeItems(themes, originalTheme) {
|
|
68586
|
+
return themes.map((themeName) => {
|
|
68587
|
+
const theme = getPowerlineTheme(themeName);
|
|
68588
|
+
return {
|
|
68589
|
+
label: theme?.name ?? themeName,
|
|
68590
|
+
sublabel: themeName === originalTheme ? "(original)" : undefined,
|
|
68591
|
+
value: themeName,
|
|
68592
|
+
description: theme?.description ?? ""
|
|
68593
|
+
};
|
|
68594
|
+
});
|
|
68595
|
+
}
|
|
68596
|
+
function applyCustomPowerlineTheme(settings, themeName) {
|
|
68597
|
+
const theme = getPowerlineTheme(themeName);
|
|
68598
|
+
if (!theme || themeName === "custom") {
|
|
68599
|
+
return null;
|
|
68600
|
+
}
|
|
68601
|
+
const colorLevel = getColorLevelString(settings.colorLevel);
|
|
68602
|
+
const colorLevelKey = colorLevel === "ansi16" ? "1" : colorLevel === "ansi256" ? "2" : "3";
|
|
68603
|
+
const themeColors = theme[colorLevelKey];
|
|
68604
|
+
if (!themeColors) {
|
|
68605
|
+
return null;
|
|
68606
|
+
}
|
|
68607
|
+
const lines = settings.lines.map((line) => {
|
|
68608
|
+
let widgetColorIndex = 0;
|
|
68609
|
+
return line.map((widget) => {
|
|
68610
|
+
if (widget.type === "separator" || widget.type === "flex-separator") {
|
|
68611
|
+
return widget;
|
|
68612
|
+
}
|
|
68613
|
+
const fgColor = themeColors.fg[widgetColorIndex % themeColors.fg.length];
|
|
68614
|
+
const bgColor = themeColors.bg[widgetColorIndex % themeColors.bg.length];
|
|
68615
|
+
widgetColorIndex++;
|
|
68616
|
+
return {
|
|
68617
|
+
...widget,
|
|
68618
|
+
color: fgColor,
|
|
68619
|
+
backgroundColor: bgColor
|
|
68620
|
+
};
|
|
68621
|
+
});
|
|
68622
|
+
});
|
|
68623
|
+
return {
|
|
68624
|
+
...settings,
|
|
68625
|
+
powerline: {
|
|
68626
|
+
...settings.powerline,
|
|
68627
|
+
theme: "custom"
|
|
68628
|
+
},
|
|
68629
|
+
lines
|
|
68630
|
+
};
|
|
68631
|
+
}
|
|
68377
68632
|
var PowerlineThemeSelector = ({
|
|
68378
68633
|
settings,
|
|
68379
68634
|
onUpdate,
|
|
68380
68635
|
onBack
|
|
68381
68636
|
}) => {
|
|
68382
|
-
const themes = getPowerlineThemes();
|
|
68637
|
+
const themes = import_react41.useMemo(() => getPowerlineThemes(), []);
|
|
68383
68638
|
const currentTheme = settings.powerline.theme ?? "custom";
|
|
68384
|
-
const [selectedIndex, setSelectedIndex] =
|
|
68385
|
-
const [showCustomizeConfirm, setShowCustomizeConfirm] =
|
|
68386
|
-
const originalThemeRef =
|
|
68387
|
-
const originalSettingsRef =
|
|
68388
|
-
const
|
|
68389
|
-
|
|
68390
|
-
|
|
68391
|
-
|
|
68392
|
-
|
|
68393
|
-
|
|
68394
|
-
|
|
68395
|
-
|
|
68396
|
-
|
|
68397
|
-
|
|
68398
|
-
const customizeTheme = () => {
|
|
68399
|
-
const currentThemeName = themes[selectedIndex];
|
|
68400
|
-
if (!currentThemeName) {
|
|
68639
|
+
const [selectedIndex, setSelectedIndex] = import_react41.useState(Math.max(0, themes.indexOf(currentTheme)));
|
|
68640
|
+
const [showCustomizeConfirm, setShowCustomizeConfirm] = import_react41.useState(false);
|
|
68641
|
+
const originalThemeRef = import_react41.useRef(currentTheme);
|
|
68642
|
+
const originalSettingsRef = import_react41.useRef(settings);
|
|
68643
|
+
const latestSettingsRef = import_react41.useRef(settings);
|
|
68644
|
+
const latestOnUpdateRef = import_react41.useRef(onUpdate);
|
|
68645
|
+
const didHandleInitialSelectionRef = import_react41.useRef(false);
|
|
68646
|
+
import_react41.useEffect(() => {
|
|
68647
|
+
latestSettingsRef.current = settings;
|
|
68648
|
+
latestOnUpdateRef.current = onUpdate;
|
|
68649
|
+
}, [settings, onUpdate]);
|
|
68650
|
+
import_react41.useEffect(() => {
|
|
68651
|
+
const themeName = themes[selectedIndex];
|
|
68652
|
+
if (!themeName) {
|
|
68401
68653
|
return;
|
|
68402
68654
|
}
|
|
68403
|
-
|
|
68404
|
-
|
|
68405
|
-
onBack();
|
|
68655
|
+
if (!didHandleInitialSelectionRef.current) {
|
|
68656
|
+
didHandleInitialSelectionRef.current = true;
|
|
68406
68657
|
return;
|
|
68407
68658
|
}
|
|
68408
|
-
|
|
68409
|
-
|
|
68410
|
-
|
|
68411
|
-
|
|
68412
|
-
|
|
68413
|
-
|
|
68414
|
-
|
|
68415
|
-
|
|
68416
|
-
return widget;
|
|
68417
|
-
}
|
|
68418
|
-
const fgColor = themeColors.fg[widgetColorIndex % themeColors.fg.length];
|
|
68419
|
-
const bgColor = themeColors.bg[widgetColorIndex % themeColors.bg.length];
|
|
68420
|
-
widgetColorIndex++;
|
|
68421
|
-
return {
|
|
68422
|
-
...widget,
|
|
68423
|
-
color: fgColor,
|
|
68424
|
-
backgroundColor: bgColor
|
|
68425
|
-
};
|
|
68426
|
-
});
|
|
68427
|
-
});
|
|
68428
|
-
const updatedSettings = {
|
|
68429
|
-
...settings,
|
|
68430
|
-
powerline: {
|
|
68431
|
-
...settings.powerline,
|
|
68432
|
-
theme: "custom"
|
|
68433
|
-
},
|
|
68434
|
-
lines: newLines
|
|
68435
|
-
};
|
|
68436
|
-
onUpdate(updatedSettings);
|
|
68437
|
-
}
|
|
68438
|
-
onBack();
|
|
68439
|
-
};
|
|
68659
|
+
latestOnUpdateRef.current({
|
|
68660
|
+
...latestSettingsRef.current,
|
|
68661
|
+
powerline: {
|
|
68662
|
+
...latestSettingsRef.current.powerline,
|
|
68663
|
+
theme: themeName
|
|
68664
|
+
}
|
|
68665
|
+
});
|
|
68666
|
+
}, [selectedIndex, themes]);
|
|
68440
68667
|
use_input_default((input, key) => {
|
|
68441
68668
|
if (showCustomizeConfirm) {
|
|
68442
68669
|
return;
|
|
68443
68670
|
}
|
|
68444
|
-
{
|
|
68445
|
-
|
|
68446
|
-
|
|
68447
|
-
|
|
68448
|
-
|
|
68449
|
-
|
|
68450
|
-
|
|
68451
|
-
const newTheme = themes[newIndex];
|
|
68452
|
-
if (newTheme) {
|
|
68453
|
-
applyTheme(newTheme);
|
|
68454
|
-
}
|
|
68455
|
-
} else if (key.downArrow) {
|
|
68456
|
-
const newIndex = Math.min(themes.length - 1, selectedIndex + 1);
|
|
68457
|
-
setSelectedIndex(newIndex);
|
|
68458
|
-
const newTheme = themes[newIndex];
|
|
68459
|
-
if (newTheme) {
|
|
68460
|
-
applyTheme(newTheme);
|
|
68461
|
-
}
|
|
68462
|
-
} else if (key.return) {
|
|
68463
|
-
onBack();
|
|
68464
|
-
} else if (input === "c" || input === "C") {
|
|
68465
|
-
const currentThemeName = themes[selectedIndex];
|
|
68466
|
-
if (currentThemeName && currentThemeName !== "custom") {
|
|
68467
|
-
setShowCustomizeConfirm(true);
|
|
68468
|
-
}
|
|
68671
|
+
if (key.escape) {
|
|
68672
|
+
onUpdate(originalSettingsRef.current);
|
|
68673
|
+
onBack();
|
|
68674
|
+
} else if (input === "c" || input === "C") {
|
|
68675
|
+
const currentThemeName = themes[selectedIndex];
|
|
68676
|
+
if (currentThemeName && currentThemeName !== "custom") {
|
|
68677
|
+
setShowCustomizeConfirm(true);
|
|
68469
68678
|
}
|
|
68470
68679
|
}
|
|
68471
68680
|
});
|
|
68472
68681
|
const selectedThemeName = themes[selectedIndex];
|
|
68473
|
-
const
|
|
68682
|
+
const themeItems = import_react41.useMemo(() => buildPowerlineThemeItems(themes, originalThemeRef.current), [themes]);
|
|
68474
68683
|
if (showCustomizeConfirm) {
|
|
68475
|
-
return /* @__PURE__ */
|
|
68684
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68476
68685
|
flexDirection: "column",
|
|
68477
68686
|
children: [
|
|
68478
|
-
/* @__PURE__ */
|
|
68687
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68479
68688
|
bold: true,
|
|
68480
68689
|
color: "yellow",
|
|
68481
68690
|
children: "⚠ Confirm Customization"
|
|
68482
68691
|
}, undefined, false, undefined, this),
|
|
68483
|
-
/* @__PURE__ */
|
|
68692
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68484
68693
|
marginTop: 1,
|
|
68485
68694
|
flexDirection: "column",
|
|
68486
68695
|
children: [
|
|
68487
|
-
/* @__PURE__ */
|
|
68696
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68488
68697
|
children: "This will copy the current theme colors to your widgets"
|
|
68489
68698
|
}, undefined, false, undefined, this),
|
|
68490
|
-
/* @__PURE__ */
|
|
68699
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68491
68700
|
children: "and switch to Custom theme mode."
|
|
68492
68701
|
}, undefined, false, undefined, this),
|
|
68493
|
-
/* @__PURE__ */
|
|
68702
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68494
68703
|
color: "red",
|
|
68495
68704
|
children: "This will overwrite any existing custom colors!"
|
|
68496
68705
|
}, undefined, false, undefined, this)
|
|
68497
68706
|
]
|
|
68498
68707
|
}, undefined, true, undefined, this),
|
|
68499
|
-
/* @__PURE__ */
|
|
68708
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68500
68709
|
marginTop: 2,
|
|
68501
|
-
children: /* @__PURE__ */
|
|
68710
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68502
68711
|
children: "Continue?"
|
|
68503
68712
|
}, undefined, false, undefined, this)
|
|
68504
68713
|
}, undefined, false, undefined, this),
|
|
68505
|
-
/* @__PURE__ */
|
|
68714
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68506
68715
|
marginTop: 1,
|
|
68507
|
-
children: /* @__PURE__ */
|
|
68716
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ConfirmDialog, {
|
|
68508
68717
|
inline: true,
|
|
68509
68718
|
onConfirm: () => {
|
|
68510
|
-
|
|
68719
|
+
if (selectedThemeName) {
|
|
68720
|
+
const updatedSettings = applyCustomPowerlineTheme(settings, selectedThemeName);
|
|
68721
|
+
if (updatedSettings) {
|
|
68722
|
+
onUpdate(updatedSettings);
|
|
68723
|
+
}
|
|
68724
|
+
}
|
|
68511
68725
|
setShowCustomizeConfirm(false);
|
|
68726
|
+
onBack();
|
|
68512
68727
|
},
|
|
68513
68728
|
onCancel: () => {
|
|
68514
68729
|
setShowCustomizeConfirm(false);
|
|
@@ -68518,82 +68733,150 @@ var PowerlineThemeSelector = ({
|
|
|
68518
68733
|
]
|
|
68519
68734
|
}, undefined, true, undefined, this);
|
|
68520
68735
|
}
|
|
68521
|
-
return /* @__PURE__ */
|
|
68736
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68522
68737
|
flexDirection: "column",
|
|
68523
68738
|
children: [
|
|
68524
|
-
/* @__PURE__ */
|
|
68739
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68525
68740
|
bold: true,
|
|
68526
68741
|
children: [
|
|
68527
68742
|
`Powerline Theme Selection | `,
|
|
68528
|
-
/* @__PURE__ */
|
|
68743
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68529
68744
|
dimColor: true,
|
|
68530
68745
|
children: `Original: ${originalThemeRef.current}`
|
|
68531
68746
|
}, undefined, false, undefined, this)
|
|
68532
68747
|
]
|
|
68533
68748
|
}, undefined, true, undefined, this),
|
|
68534
|
-
/* @__PURE__ */
|
|
68535
|
-
children: /* @__PURE__ */
|
|
68749
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68750
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68536
68751
|
dimColor: true,
|
|
68537
68752
|
children: `↑↓ navigate, Enter apply${selectedThemeName && selectedThemeName !== "custom" ? ", (c)ustomize theme" : ""}, ESC cancel`
|
|
68538
68753
|
}, undefined, false, undefined, this)
|
|
68539
68754
|
}, undefined, false, undefined, this),
|
|
68540
|
-
/* @__PURE__ */
|
|
68755
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(List, {
|
|
68541
68756
|
marginTop: 1,
|
|
68542
|
-
|
|
68543
|
-
|
|
68544
|
-
|
|
68545
|
-
|
|
68546
|
-
|
|
68547
|
-
|
|
68548
|
-
|
|
68549
|
-
|
|
68550
|
-
|
|
68551
|
-
|
|
68552
|
-
|
|
68553
|
-
isOriginal && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68554
|
-
dimColor: true,
|
|
68555
|
-
children: " (original)"
|
|
68556
|
-
}, undefined, false, undefined, this)
|
|
68557
|
-
]
|
|
68558
|
-
}, undefined, true, undefined, this)
|
|
68559
|
-
}, themeName, false, undefined, this);
|
|
68560
|
-
})
|
|
68757
|
+
items: themeItems,
|
|
68758
|
+
onSelect: () => {
|
|
68759
|
+
onBack();
|
|
68760
|
+
},
|
|
68761
|
+
onSelectionChange: (themeName, index) => {
|
|
68762
|
+
if (themeName === "back") {
|
|
68763
|
+
return;
|
|
68764
|
+
}
|
|
68765
|
+
setSelectedIndex(index);
|
|
68766
|
+
},
|
|
68767
|
+
initialSelection: selectedIndex
|
|
68561
68768
|
}, undefined, false, undefined, this),
|
|
68562
|
-
|
|
68563
|
-
marginTop:
|
|
68564
|
-
|
|
68565
|
-
|
|
68566
|
-
|
|
68567
|
-
|
|
68568
|
-
|
|
68569
|
-
|
|
68570
|
-
|
|
68571
|
-
|
|
68572
|
-
|
|
68573
|
-
|
|
68574
|
-
|
|
68575
|
-
|
|
68576
|
-
selectedThemeName && selectedThemeName !== "custom" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68577
|
-
marginTop: 1,
|
|
68578
|
-
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68579
|
-
dimColor: true,
|
|
68580
|
-
children: "Press (c) to customize this theme - copies colors to widgets"
|
|
68581
|
-
}, undefined, false, undefined, this)
|
|
68582
|
-
}, undefined, false, undefined, this),
|
|
68583
|
-
settings.colorLevel === 1 && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
68584
|
-
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
68585
|
-
color: "yellow",
|
|
68586
|
-
children: "⚠ 16 color mode themes have a very limited palette, we recommend switching color level in Terminal Options"
|
|
68587
|
-
}, undefined, false, undefined, this)
|
|
68588
|
-
}, undefined, false, undefined, this)
|
|
68589
|
-
]
|
|
68590
|
-
}, undefined, true, undefined, this)
|
|
68769
|
+
selectedThemeName && selectedThemeName !== "custom" && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68770
|
+
marginTop: 1,
|
|
68771
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68772
|
+
dimColor: true,
|
|
68773
|
+
children: "Press (c) to customize this theme - copies colors to widgets"
|
|
68774
|
+
}, undefined, false, undefined, this)
|
|
68775
|
+
}, undefined, false, undefined, this),
|
|
68776
|
+
settings.colorLevel === 1 && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
68777
|
+
marginTop: 1,
|
|
68778
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
68779
|
+
color: "yellow",
|
|
68780
|
+
children: "⚠ 16 color mode themes have a very limited palette, we recommend switching color level in Terminal Options"
|
|
68781
|
+
}, undefined, false, undefined, this)
|
|
68782
|
+
}, undefined, false, undefined, this)
|
|
68591
68783
|
]
|
|
68592
68784
|
}, undefined, true, undefined, this);
|
|
68593
68785
|
};
|
|
68594
68786
|
|
|
68595
68787
|
// src/tui/components/PowerlineSetup.tsx
|
|
68596
|
-
var
|
|
68788
|
+
var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68789
|
+
var POWERLINE_MENU_LABEL_WIDTH = 11;
|
|
68790
|
+
function formatPowerlineMenuLabel(label) {
|
|
68791
|
+
return label.padEnd(POWERLINE_MENU_LABEL_WIDTH, " ");
|
|
68792
|
+
}
|
|
68793
|
+
function getSeparatorDisplay(powerlineConfig) {
|
|
68794
|
+
const seps = powerlineConfig.separators;
|
|
68795
|
+
if (seps.length > 1) {
|
|
68796
|
+
return "multiple";
|
|
68797
|
+
}
|
|
68798
|
+
const sep2 = seps[0] ?? "";
|
|
68799
|
+
const presets = [
|
|
68800
|
+
{ char: "", name: "Triangle Right" },
|
|
68801
|
+
{ char: "", name: "Triangle Left" },
|
|
68802
|
+
{ char: "", name: "Round Right" },
|
|
68803
|
+
{ char: "", name: "Round Left" }
|
|
68804
|
+
];
|
|
68805
|
+
const preset = presets.find((item) => item.char === sep2);
|
|
68806
|
+
if (preset) {
|
|
68807
|
+
return `${preset.char} - ${preset.name}`;
|
|
68808
|
+
}
|
|
68809
|
+
return `${sep2} - Custom`;
|
|
68810
|
+
}
|
|
68811
|
+
function getCapDisplay(powerlineConfig, type) {
|
|
68812
|
+
const caps = type === "start" ? powerlineConfig.startCaps : powerlineConfig.endCaps;
|
|
68813
|
+
if (caps.length === 0) {
|
|
68814
|
+
return "none";
|
|
68815
|
+
}
|
|
68816
|
+
if (caps.length > 1) {
|
|
68817
|
+
return "multiple";
|
|
68818
|
+
}
|
|
68819
|
+
const cap = caps[0];
|
|
68820
|
+
if (!cap) {
|
|
68821
|
+
return "none";
|
|
68822
|
+
}
|
|
68823
|
+
const presets = type === "start" ? [
|
|
68824
|
+
{ char: "", name: "Triangle" },
|
|
68825
|
+
{ char: "", name: "Round" },
|
|
68826
|
+
{ char: "", name: "Lower Triangle" },
|
|
68827
|
+
{ char: "", name: "Diagonal" }
|
|
68828
|
+
] : [
|
|
68829
|
+
{ char: "", name: "Triangle" },
|
|
68830
|
+
{ char: "", name: "Round" },
|
|
68831
|
+
{ char: "", name: "Lower Triangle" },
|
|
68832
|
+
{ char: "", name: "Diagonal" }
|
|
68833
|
+
];
|
|
68834
|
+
const preset = presets.find((item) => item.char === cap);
|
|
68835
|
+
if (preset) {
|
|
68836
|
+
return `${preset.char} - ${preset.name}`;
|
|
68837
|
+
}
|
|
68838
|
+
return `${cap} - Custom`;
|
|
68839
|
+
}
|
|
68840
|
+
function getThemeDisplay(powerlineConfig) {
|
|
68841
|
+
const theme = powerlineConfig.theme;
|
|
68842
|
+
if (!theme || theme === "custom") {
|
|
68843
|
+
return "Custom";
|
|
68844
|
+
}
|
|
68845
|
+
return theme.charAt(0).toUpperCase() + theme.slice(1);
|
|
68846
|
+
}
|
|
68847
|
+
function buildPowerlineSetupMenuItems(powerlineConfig) {
|
|
68848
|
+
const disabled = !powerlineConfig.enabled;
|
|
68849
|
+
return [
|
|
68850
|
+
{
|
|
68851
|
+
label: formatPowerlineMenuLabel("Separator"),
|
|
68852
|
+
sublabel: `(${getSeparatorDisplay(powerlineConfig)})`,
|
|
68853
|
+
value: "separator",
|
|
68854
|
+
disabled,
|
|
68855
|
+
description: "Choose the glyph used between powerline segments."
|
|
68856
|
+
},
|
|
68857
|
+
{
|
|
68858
|
+
label: formatPowerlineMenuLabel("Start Cap"),
|
|
68859
|
+
sublabel: `(${getCapDisplay(powerlineConfig, "start")})`,
|
|
68860
|
+
value: "startCap",
|
|
68861
|
+
disabled,
|
|
68862
|
+
description: "Configure the cap glyph that appears at the start of each powerline line."
|
|
68863
|
+
},
|
|
68864
|
+
{
|
|
68865
|
+
label: formatPowerlineMenuLabel("End Cap"),
|
|
68866
|
+
sublabel: `(${getCapDisplay(powerlineConfig, "end")})`,
|
|
68867
|
+
value: "endCap",
|
|
68868
|
+
disabled,
|
|
68869
|
+
description: "Configure the cap glyph that appears at the end of each powerline line."
|
|
68870
|
+
},
|
|
68871
|
+
{
|
|
68872
|
+
label: formatPowerlineMenuLabel("Themes"),
|
|
68873
|
+
sublabel: `(${getThemeDisplay(powerlineConfig)})`,
|
|
68874
|
+
value: "themes",
|
|
68875
|
+
disabled,
|
|
68876
|
+
description: "Preview built-in powerline themes or copy a theme into custom widget colors."
|
|
68877
|
+
}
|
|
68878
|
+
];
|
|
68879
|
+
}
|
|
68597
68880
|
var PowerlineSetup = ({
|
|
68598
68881
|
settings,
|
|
68599
68882
|
powerlineFontStatus,
|
|
@@ -68605,68 +68888,11 @@ var PowerlineSetup = ({
|
|
|
68605
68888
|
onClearMessage
|
|
68606
68889
|
}) => {
|
|
68607
68890
|
const powerlineConfig = settings.powerline;
|
|
68608
|
-
const [screen, setScreen] =
|
|
68609
|
-
const [selectedMenuItem, setSelectedMenuItem] =
|
|
68610
|
-
const [confirmingEnable, setConfirmingEnable] =
|
|
68611
|
-
const [confirmingFontInstall, setConfirmingFontInstall] =
|
|
68891
|
+
const [screen, setScreen] = import_react42.useState("menu");
|
|
68892
|
+
const [selectedMenuItem, setSelectedMenuItem] = import_react42.useState(0);
|
|
68893
|
+
const [confirmingEnable, setConfirmingEnable] = import_react42.useState(false);
|
|
68894
|
+
const [confirmingFontInstall, setConfirmingFontInstall] = import_react42.useState(false);
|
|
68612
68895
|
const hasSeparatorItems = settings.lines.some((line) => line.some((item) => item.type === "separator" || item.type === "flex-separator"));
|
|
68613
|
-
const menuItems = [
|
|
68614
|
-
{ label: "Separator", value: "separator" },
|
|
68615
|
-
{ label: "Start Cap", value: "startCap" },
|
|
68616
|
-
{ label: "End Cap", value: "endCap" },
|
|
68617
|
-
{ label: "Themes", value: "themes" },
|
|
68618
|
-
{ label: "← Back", value: "back" }
|
|
68619
|
-
];
|
|
68620
|
-
const getSeparatorDisplay = () => {
|
|
68621
|
-
const seps = powerlineConfig.separators;
|
|
68622
|
-
if (seps.length > 1) {
|
|
68623
|
-
return "multiple";
|
|
68624
|
-
}
|
|
68625
|
-
const sep2 = seps[0] ?? "";
|
|
68626
|
-
const presets = [
|
|
68627
|
-
{ char: "", name: "Triangle Right" },
|
|
68628
|
-
{ char: "", name: "Triangle Left" },
|
|
68629
|
-
{ char: "", name: "Round Right" },
|
|
68630
|
-
{ char: "", name: "Round Left" }
|
|
68631
|
-
];
|
|
68632
|
-
const preset = presets.find((p) => p.char === sep2);
|
|
68633
|
-
if (preset) {
|
|
68634
|
-
return `${preset.char} - ${preset.name}`;
|
|
68635
|
-
}
|
|
68636
|
-
return `${sep2} - Custom`;
|
|
68637
|
-
};
|
|
68638
|
-
const getCapDisplay = (type) => {
|
|
68639
|
-
const caps = type === "start" ? powerlineConfig.startCaps : powerlineConfig.endCaps;
|
|
68640
|
-
if (caps.length === 0)
|
|
68641
|
-
return "none";
|
|
68642
|
-
if (caps.length > 1)
|
|
68643
|
-
return "multiple";
|
|
68644
|
-
const cap = caps[0];
|
|
68645
|
-
if (!cap)
|
|
68646
|
-
return "none";
|
|
68647
|
-
const presets = type === "start" ? [
|
|
68648
|
-
{ char: "", name: "Triangle" },
|
|
68649
|
-
{ char: "", name: "Round" },
|
|
68650
|
-
{ char: "", name: "Lower Triangle" },
|
|
68651
|
-
{ char: "", name: "Diagonal" }
|
|
68652
|
-
] : [
|
|
68653
|
-
{ char: "", name: "Triangle" },
|
|
68654
|
-
{ char: "", name: "Round" },
|
|
68655
|
-
{ char: "", name: "Lower Triangle" },
|
|
68656
|
-
{ char: "", name: "Diagonal" }
|
|
68657
|
-
];
|
|
68658
|
-
const preset = presets.find((c) => c.char === cap);
|
|
68659
|
-
if (preset) {
|
|
68660
|
-
return `${preset.char} - ${preset.name}`;
|
|
68661
|
-
}
|
|
68662
|
-
return `${cap} - Custom`;
|
|
68663
|
-
};
|
|
68664
|
-
const getThemeDisplay = () => {
|
|
68665
|
-
const theme = powerlineConfig.theme;
|
|
68666
|
-
if (!theme || theme === "custom")
|
|
68667
|
-
return "Custom";
|
|
68668
|
-
return theme.charAt(0).toUpperCase() + theme.slice(1);
|
|
68669
|
-
};
|
|
68670
68896
|
use_input_default((input, key) => {
|
|
68671
68897
|
if (fontInstallMessage || installingFonts) {
|
|
68672
68898
|
if (fontInstallMessage && !key.escape) {
|
|
@@ -68680,19 +68906,6 @@ var PowerlineSetup = ({
|
|
|
68680
68906
|
if (screen === "menu") {
|
|
68681
68907
|
if (key.escape) {
|
|
68682
68908
|
onBack();
|
|
68683
|
-
} else if (key.upArrow) {
|
|
68684
|
-
setSelectedMenuItem(Math.max(0, selectedMenuItem - 1));
|
|
68685
|
-
} else if (key.downArrow) {
|
|
68686
|
-
setSelectedMenuItem(Math.min(menuItems.length - 1, selectedMenuItem + 1));
|
|
68687
|
-
} else if (key.return) {
|
|
68688
|
-
const selected = menuItems[selectedMenuItem];
|
|
68689
|
-
if (selected) {
|
|
68690
|
-
if (selected.value === "back") {
|
|
68691
|
-
onBack();
|
|
68692
|
-
} else if (powerlineConfig.enabled) {
|
|
68693
|
-
setScreen(selected.value);
|
|
68694
|
-
}
|
|
68695
|
-
}
|
|
68696
68909
|
} else if (input === "t" || input === "T") {
|
|
68697
68910
|
if (!powerlineConfig.enabled) {
|
|
68698
68911
|
if (hasSeparatorItems) {
|
|
@@ -68701,19 +68914,29 @@ var PowerlineSetup = ({
|
|
|
68701
68914
|
onUpdate(buildEnabledPowerlineSettings(settings, false));
|
|
68702
68915
|
}
|
|
68703
68916
|
} else {
|
|
68704
|
-
|
|
68705
|
-
|
|
68917
|
+
onUpdate({
|
|
68918
|
+
...settings,
|
|
68919
|
+
powerline: {
|
|
68920
|
+
...powerlineConfig,
|
|
68921
|
+
enabled: false
|
|
68922
|
+
}
|
|
68923
|
+
});
|
|
68706
68924
|
}
|
|
68707
68925
|
} else if (input === "i" || input === "I") {
|
|
68708
68926
|
setConfirmingFontInstall(true);
|
|
68709
68927
|
} else if ((input === "a" || input === "A") && powerlineConfig.enabled) {
|
|
68710
|
-
|
|
68711
|
-
|
|
68928
|
+
onUpdate({
|
|
68929
|
+
...settings,
|
|
68930
|
+
powerline: {
|
|
68931
|
+
...powerlineConfig,
|
|
68932
|
+
autoAlign: !powerlineConfig.autoAlign
|
|
68933
|
+
}
|
|
68934
|
+
});
|
|
68712
68935
|
}
|
|
68713
68936
|
}
|
|
68714
68937
|
});
|
|
68715
68938
|
if (screen === "separator") {
|
|
68716
|
-
return /* @__PURE__ */
|
|
68939
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineSeparatorEditor, {
|
|
68717
68940
|
settings,
|
|
68718
68941
|
mode: "separator",
|
|
68719
68942
|
onUpdate,
|
|
@@ -68723,7 +68946,7 @@ var PowerlineSetup = ({
|
|
|
68723
68946
|
}, undefined, false, undefined, this);
|
|
68724
68947
|
}
|
|
68725
68948
|
if (screen === "startCap") {
|
|
68726
|
-
return /* @__PURE__ */
|
|
68949
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineSeparatorEditor, {
|
|
68727
68950
|
settings,
|
|
68728
68951
|
mode: "startCap",
|
|
68729
68952
|
onUpdate,
|
|
@@ -68733,7 +68956,7 @@ var PowerlineSetup = ({
|
|
|
68733
68956
|
}, undefined, false, undefined, this);
|
|
68734
68957
|
}
|
|
68735
68958
|
if (screen === "endCap") {
|
|
68736
|
-
return /* @__PURE__ */
|
|
68959
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineSeparatorEditor, {
|
|
68737
68960
|
settings,
|
|
68738
68961
|
mode: "endCap",
|
|
68739
68962
|
onUpdate,
|
|
@@ -68743,7 +68966,7 @@ var PowerlineSetup = ({
|
|
|
68743
68966
|
}, undefined, false, undefined, this);
|
|
68744
68967
|
}
|
|
68745
68968
|
if (screen === "themes") {
|
|
68746
|
-
return /* @__PURE__ */
|
|
68969
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(PowerlineThemeSelector, {
|
|
68747
68970
|
settings,
|
|
68748
68971
|
onUpdate,
|
|
68749
68972
|
onBack: () => {
|
|
@@ -68751,140 +68974,140 @@ var PowerlineSetup = ({
|
|
|
68751
68974
|
}
|
|
68752
68975
|
}, undefined, false, undefined, this);
|
|
68753
68976
|
}
|
|
68754
|
-
return /* @__PURE__ */
|
|
68977
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68755
68978
|
flexDirection: "column",
|
|
68756
68979
|
children: [
|
|
68757
|
-
!confirmingFontInstall && !installingFonts && !fontInstallMessage && /* @__PURE__ */
|
|
68980
|
+
!confirmingFontInstall && !installingFonts && !fontInstallMessage && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68758
68981
|
bold: true,
|
|
68759
68982
|
children: "Powerline Setup"
|
|
68760
68983
|
}, undefined, false, undefined, this),
|
|
68761
|
-
confirmingFontInstall ? /* @__PURE__ */
|
|
68984
|
+
confirmingFontInstall ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68762
68985
|
flexDirection: "column",
|
|
68763
68986
|
children: [
|
|
68764
|
-
/* @__PURE__ */
|
|
68987
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68765
68988
|
marginBottom: 1,
|
|
68766
|
-
children: /* @__PURE__ */
|
|
68989
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68767
68990
|
color: "cyan",
|
|
68768
68991
|
bold: true,
|
|
68769
68992
|
children: "Font Installation"
|
|
68770
68993
|
}, undefined, false, undefined, this)
|
|
68771
68994
|
}, undefined, false, undefined, this),
|
|
68772
|
-
/* @__PURE__ */
|
|
68995
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68773
68996
|
marginBottom: 1,
|
|
68774
68997
|
flexDirection: "column",
|
|
68775
68998
|
children: [
|
|
68776
|
-
/* @__PURE__ */
|
|
68999
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68777
69000
|
bold: true,
|
|
68778
69001
|
children: "What will happen:"
|
|
68779
69002
|
}, undefined, false, undefined, this),
|
|
68780
|
-
/* @__PURE__ */
|
|
69003
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68781
69004
|
children: [
|
|
68782
|
-
/* @__PURE__ */
|
|
69005
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68783
69006
|
dimColor: true,
|
|
68784
69007
|
children: "• Clone fonts from "
|
|
68785
69008
|
}, undefined, false, undefined, this),
|
|
68786
|
-
/* @__PURE__ */
|
|
69009
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68787
69010
|
color: "blue",
|
|
68788
69011
|
children: "https://github.com/powerline/fonts"
|
|
68789
69012
|
}, undefined, false, undefined, this)
|
|
68790
69013
|
]
|
|
68791
69014
|
}, undefined, true, undefined, this),
|
|
68792
|
-
os11.platform() === "darwin" && /* @__PURE__ */
|
|
69015
|
+
os11.platform() === "darwin" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
68793
69016
|
children: [
|
|
68794
|
-
/* @__PURE__ */
|
|
69017
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68795
69018
|
dimColor: true,
|
|
68796
69019
|
children: "• Run install.sh script which will:"
|
|
68797
69020
|
}, undefined, false, undefined, this),
|
|
68798
|
-
/* @__PURE__ */
|
|
69021
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68799
69022
|
dimColor: true,
|
|
68800
69023
|
children: " - Copy all .ttf/.otf files to ~/Library/Fonts"
|
|
68801
69024
|
}, undefined, false, undefined, this),
|
|
68802
|
-
/* @__PURE__ */
|
|
69025
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68803
69026
|
dimColor: true,
|
|
68804
69027
|
children: " - Register fonts with macOS"
|
|
68805
69028
|
}, undefined, false, undefined, this)
|
|
68806
69029
|
]
|
|
68807
69030
|
}, undefined, true, undefined, this),
|
|
68808
|
-
os11.platform() === "linux" && /* @__PURE__ */
|
|
69031
|
+
os11.platform() === "linux" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
68809
69032
|
children: [
|
|
68810
|
-
/* @__PURE__ */
|
|
69033
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68811
69034
|
dimColor: true,
|
|
68812
69035
|
children: "• Run install.sh script which will:"
|
|
68813
69036
|
}, undefined, false, undefined, this),
|
|
68814
|
-
/* @__PURE__ */
|
|
69037
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68815
69038
|
dimColor: true,
|
|
68816
69039
|
children: " - Copy all .ttf/.otf files to ~/.local/share/fonts"
|
|
68817
69040
|
}, undefined, false, undefined, this),
|
|
68818
|
-
/* @__PURE__ */
|
|
69041
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68819
69042
|
dimColor: true,
|
|
68820
69043
|
children: " - Run fc-cache to update font cache"
|
|
68821
69044
|
}, undefined, false, undefined, this)
|
|
68822
69045
|
]
|
|
68823
69046
|
}, undefined, true, undefined, this),
|
|
68824
|
-
os11.platform() === "win32" && /* @__PURE__ */
|
|
69047
|
+
os11.platform() === "win32" && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
68825
69048
|
children: [
|
|
68826
|
-
/* @__PURE__ */
|
|
69049
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68827
69050
|
dimColor: true,
|
|
68828
69051
|
children: "• Copy Powerline .ttf/.otf files to:"
|
|
68829
69052
|
}, undefined, false, undefined, this),
|
|
68830
|
-
/* @__PURE__ */
|
|
69053
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68831
69054
|
dimColor: true,
|
|
68832
69055
|
children: " AppData\\Local\\Microsoft\\Windows\\Fonts"
|
|
68833
69056
|
}, undefined, false, undefined, this)
|
|
68834
69057
|
]
|
|
68835
69058
|
}, undefined, true, undefined, this),
|
|
68836
|
-
/* @__PURE__ */
|
|
69059
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68837
69060
|
dimColor: true,
|
|
68838
69061
|
children: "• Clean up temporary files"
|
|
68839
69062
|
}, undefined, false, undefined, this)
|
|
68840
69063
|
]
|
|
68841
69064
|
}, undefined, true, undefined, this),
|
|
68842
|
-
/* @__PURE__ */
|
|
69065
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68843
69066
|
marginBottom: 1,
|
|
68844
69067
|
children: [
|
|
68845
|
-
/* @__PURE__ */
|
|
69068
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68846
69069
|
color: "yellow",
|
|
68847
69070
|
bold: true,
|
|
68848
69071
|
children: "Requirements: "
|
|
68849
69072
|
}, undefined, false, undefined, this),
|
|
68850
|
-
/* @__PURE__ */
|
|
69073
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68851
69074
|
dimColor: true,
|
|
68852
69075
|
children: "Git installed, Internet connection, Write permissions"
|
|
68853
69076
|
}, undefined, false, undefined, this)
|
|
68854
69077
|
]
|
|
68855
69078
|
}, undefined, true, undefined, this),
|
|
68856
|
-
/* @__PURE__ */
|
|
69079
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68857
69080
|
marginBottom: 1,
|
|
68858
69081
|
flexDirection: "column",
|
|
68859
69082
|
children: [
|
|
68860
|
-
/* @__PURE__ */
|
|
69083
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68861
69084
|
color: "green",
|
|
68862
69085
|
bold: true,
|
|
68863
69086
|
children: "After install:"
|
|
68864
69087
|
}, undefined, false, undefined, this),
|
|
68865
|
-
/* @__PURE__ */
|
|
69088
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68866
69089
|
dimColor: true,
|
|
68867
69090
|
children: "• Restart terminal"
|
|
68868
69091
|
}, undefined, false, undefined, this),
|
|
68869
|
-
/* @__PURE__ */
|
|
69092
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68870
69093
|
dimColor: true,
|
|
68871
69094
|
children: "• Select a Powerline font"
|
|
68872
69095
|
}, undefined, false, undefined, this),
|
|
68873
|
-
/* @__PURE__ */
|
|
69096
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68874
69097
|
dimColor: true,
|
|
68875
69098
|
children: ' (e.g. "Meslo LG S for Powerline")'
|
|
68876
69099
|
}, undefined, false, undefined, this)
|
|
68877
69100
|
]
|
|
68878
69101
|
}, undefined, true, undefined, this),
|
|
68879
|
-
/* @__PURE__ */
|
|
69102
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68880
69103
|
marginTop: 1,
|
|
68881
|
-
children: /* @__PURE__ */
|
|
69104
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68882
69105
|
children: "Proceed? "
|
|
68883
69106
|
}, undefined, false, undefined, this)
|
|
68884
69107
|
}, undefined, false, undefined, this),
|
|
68885
|
-
/* @__PURE__ */
|
|
69108
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68886
69109
|
marginTop: 1,
|
|
68887
|
-
children: /* @__PURE__ */
|
|
69110
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ConfirmDialog, {
|
|
68888
69111
|
inline: true,
|
|
68889
69112
|
onConfirm: () => {
|
|
68890
69113
|
setConfirmingFontInstall(false);
|
|
@@ -68896,36 +69119,36 @@ var PowerlineSetup = ({
|
|
|
68896
69119
|
}, undefined, false, undefined, this)
|
|
68897
69120
|
}, undefined, false, undefined, this)
|
|
68898
69121
|
]
|
|
68899
|
-
}, undefined, true, undefined, this) : confirmingEnable ? /* @__PURE__ */
|
|
69122
|
+
}, undefined, true, undefined, this) : confirmingEnable ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68900
69123
|
flexDirection: "column",
|
|
68901
69124
|
marginTop: 1,
|
|
68902
69125
|
children: [
|
|
68903
|
-
hasSeparatorItems && /* @__PURE__ */
|
|
69126
|
+
hasSeparatorItems && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
68904
69127
|
children: [
|
|
68905
|
-
/* @__PURE__ */
|
|
68906
|
-
children: /* @__PURE__ */
|
|
69128
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69129
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68907
69130
|
color: "yellow",
|
|
68908
69131
|
children: "⚠ Warning: Enabling Powerline mode will remove all existing separators and flex-separators from your status lines."
|
|
68909
69132
|
}, undefined, false, undefined, this)
|
|
68910
69133
|
}, undefined, false, undefined, this),
|
|
68911
|
-
/* @__PURE__ */
|
|
69134
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68912
69135
|
marginBottom: 1,
|
|
68913
|
-
children: /* @__PURE__ */
|
|
69136
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68914
69137
|
dimColor: true,
|
|
68915
69138
|
children: "Powerline mode uses its own separator system and is incompatible with manual separators."
|
|
68916
69139
|
}, undefined, false, undefined, this)
|
|
68917
69140
|
}, undefined, false, undefined, this)
|
|
68918
69141
|
]
|
|
68919
69142
|
}, undefined, true, undefined, this),
|
|
68920
|
-
/* @__PURE__ */
|
|
69143
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68921
69144
|
marginTop: hasSeparatorItems ? 1 : 0,
|
|
68922
|
-
children: /* @__PURE__ */
|
|
69145
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68923
69146
|
children: "Do you want to continue? "
|
|
68924
69147
|
}, undefined, false, undefined, this)
|
|
68925
69148
|
}, undefined, false, undefined, this),
|
|
68926
|
-
/* @__PURE__ */
|
|
69149
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68927
69150
|
marginTop: 1,
|
|
68928
|
-
children: /* @__PURE__ */
|
|
69151
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ConfirmDialog, {
|
|
68929
69152
|
inline: true,
|
|
68930
69153
|
onConfirm: () => {
|
|
68931
69154
|
onUpdate(buildEnabledPowerlineSettings(settings, true));
|
|
@@ -68937,51 +69160,51 @@ var PowerlineSetup = ({
|
|
|
68937
69160
|
}, undefined, false, undefined, this)
|
|
68938
69161
|
}, undefined, false, undefined, this)
|
|
68939
69162
|
]
|
|
68940
|
-
}, undefined, true, undefined, this) : installingFonts ? /* @__PURE__ */
|
|
68941
|
-
children: /* @__PURE__ */
|
|
69163
|
+
}, undefined, true, undefined, this) : installingFonts ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69164
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68942
69165
|
color: "yellow",
|
|
68943
69166
|
children: "Installing Powerline fonts... This may take a moment."
|
|
68944
69167
|
}, undefined, false, undefined, this)
|
|
68945
|
-
}, undefined, false, undefined, this) : fontInstallMessage ? /* @__PURE__ */
|
|
69168
|
+
}, undefined, false, undefined, this) : fontInstallMessage ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68946
69169
|
flexDirection: "column",
|
|
68947
69170
|
children: [
|
|
68948
|
-
/* @__PURE__ */
|
|
69171
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68949
69172
|
color: fontInstallMessage.includes("success") ? "green" : "red",
|
|
68950
69173
|
children: fontInstallMessage
|
|
68951
69174
|
}, undefined, false, undefined, this),
|
|
68952
|
-
/* @__PURE__ */
|
|
69175
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68953
69176
|
marginTop: 1,
|
|
68954
|
-
children: /* @__PURE__ */
|
|
69177
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68955
69178
|
dimColor: true,
|
|
68956
69179
|
children: "Press any key to continue..."
|
|
68957
69180
|
}, undefined, false, undefined, this)
|
|
68958
69181
|
}, undefined, false, undefined, this)
|
|
68959
69182
|
]
|
|
68960
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
69183
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
68961
69184
|
children: [
|
|
68962
|
-
/* @__PURE__ */
|
|
69185
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68963
69186
|
flexDirection: "column",
|
|
68964
|
-
children: /* @__PURE__ */
|
|
69187
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68965
69188
|
children: [
|
|
68966
69189
|
" Font Status: ",
|
|
68967
|
-
powerlineFontStatus.installed ? /* @__PURE__ */
|
|
69190
|
+
powerlineFontStatus.installed ? /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
68968
69191
|
children: [
|
|
68969
|
-
/* @__PURE__ */
|
|
69192
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68970
69193
|
color: "green",
|
|
68971
69194
|
children: "✓ Installed"
|
|
68972
69195
|
}, undefined, false, undefined, this),
|
|
68973
|
-
/* @__PURE__ */
|
|
69196
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68974
69197
|
dimColor: true,
|
|
68975
69198
|
children: " - Ensure fonts are active in your terminal"
|
|
68976
69199
|
}, undefined, false, undefined, this)
|
|
68977
69200
|
]
|
|
68978
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
69201
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
68979
69202
|
children: [
|
|
68980
|
-
/* @__PURE__ */
|
|
69203
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68981
69204
|
color: "yellow",
|
|
68982
69205
|
children: "✗ Not Installed"
|
|
68983
69206
|
}, undefined, false, undefined, this),
|
|
68984
|
-
/* @__PURE__ */
|
|
69207
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68985
69208
|
dimColor: true,
|
|
68986
69209
|
children: " - Press (i) to install Powerline fonts"
|
|
68987
69210
|
}, undefined, false, undefined, this)
|
|
@@ -68990,105 +69213,70 @@ var PowerlineSetup = ({
|
|
|
68990
69213
|
]
|
|
68991
69214
|
}, undefined, true, undefined, this)
|
|
68992
69215
|
}, undefined, false, undefined, this),
|
|
68993
|
-
/* @__PURE__ */
|
|
69216
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
68994
69217
|
children: [
|
|
68995
|
-
/* @__PURE__ */
|
|
69218
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68996
69219
|
children: " Powerline Mode: "
|
|
68997
69220
|
}, undefined, false, undefined, this),
|
|
68998
|
-
/* @__PURE__ */
|
|
69221
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
68999
69222
|
color: powerlineConfig.enabled ? "green" : "red",
|
|
69000
69223
|
children: powerlineConfig.enabled ? "✓ Enabled " : "✗ Disabled "
|
|
69001
69224
|
}, undefined, false, undefined, this),
|
|
69002
|
-
/* @__PURE__ */
|
|
69225
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69003
69226
|
dimColor: true,
|
|
69004
69227
|
children: " - Press (t) to toggle"
|
|
69005
69228
|
}, undefined, false, undefined, this)
|
|
69006
69229
|
]
|
|
69007
69230
|
}, undefined, true, undefined, this),
|
|
69008
|
-
powerlineConfig.enabled && /* @__PURE__ */
|
|
69231
|
+
powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
|
|
69009
69232
|
children: [
|
|
69010
|
-
/* @__PURE__ */
|
|
69233
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69011
69234
|
children: [
|
|
69012
|
-
/* @__PURE__ */
|
|
69235
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69013
69236
|
children: " Align Widgets: "
|
|
69014
69237
|
}, undefined, false, undefined, this),
|
|
69015
|
-
/* @__PURE__ */
|
|
69238
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69016
69239
|
color: powerlineConfig.autoAlign ? "green" : "red",
|
|
69017
69240
|
children: powerlineConfig.autoAlign ? "✓ Enabled " : "✗ Disabled "
|
|
69018
69241
|
}, undefined, false, undefined, this),
|
|
69019
|
-
/* @__PURE__ */
|
|
69242
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69020
69243
|
dimColor: true,
|
|
69021
69244
|
children: " - Press (a) to toggle"
|
|
69022
69245
|
}, undefined, false, undefined, this)
|
|
69023
69246
|
]
|
|
69024
69247
|
}, undefined, true, undefined, this),
|
|
69025
|
-
/* @__PURE__ */
|
|
69248
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69026
69249
|
flexDirection: "column",
|
|
69027
69250
|
marginTop: 1,
|
|
69028
|
-
children: /* @__PURE__ */
|
|
69251
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69029
69252
|
dimColor: true,
|
|
69030
69253
|
children: "When enabled, global overrides are disabled and powerline separators are used"
|
|
69031
69254
|
}, undefined, false, undefined, this)
|
|
69032
69255
|
}, undefined, false, undefined, this)
|
|
69033
69256
|
]
|
|
69034
69257
|
}, undefined, true, undefined, this),
|
|
69035
|
-
/* @__PURE__ */
|
|
69258
|
+
!powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
69036
69259
|
marginTop: 1,
|
|
69037
|
-
|
|
69038
|
-
|
|
69039
|
-
children:
|
|
69040
|
-
const isSelected = index === selectedMenuItem;
|
|
69041
|
-
let displayValue = "";
|
|
69042
|
-
switch (item.value) {
|
|
69043
|
-
case "separator":
|
|
69044
|
-
displayValue = getSeparatorDisplay();
|
|
69045
|
-
break;
|
|
69046
|
-
case "startCap":
|
|
69047
|
-
displayValue = getCapDisplay("start");
|
|
69048
|
-
break;
|
|
69049
|
-
case "endCap":
|
|
69050
|
-
displayValue = getCapDisplay("end");
|
|
69051
|
-
break;
|
|
69052
|
-
case "themes":
|
|
69053
|
-
displayValue = getThemeDisplay();
|
|
69054
|
-
break;
|
|
69055
|
-
case "back":
|
|
69056
|
-
displayValue = "";
|
|
69057
|
-
break;
|
|
69058
|
-
}
|
|
69059
|
-
if (item.value === "back") {
|
|
69060
|
-
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
69061
|
-
marginTop: 1,
|
|
69062
|
-
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
69063
|
-
color: isSelected ? "green" : undefined,
|
|
69064
|
-
children: [
|
|
69065
|
-
isSelected ? "▶ " : " ",
|
|
69066
|
-
item.label
|
|
69067
|
-
]
|
|
69068
|
-
}, undefined, true, undefined, this)
|
|
69069
|
-
}, item.value, false, undefined, this);
|
|
69070
|
-
}
|
|
69071
|
-
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
69072
|
-
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
69073
|
-
color: isSelected ? "green" : undefined,
|
|
69074
|
-
children: [
|
|
69075
|
-
isSelected ? "▶ " : " ",
|
|
69076
|
-
item.label.padEnd(11, " "),
|
|
69077
|
-
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
69078
|
-
dimColor: true,
|
|
69079
|
-
children: displayValue && `(${displayValue})`
|
|
69080
|
-
}, undefined, false, undefined, this)
|
|
69081
|
-
]
|
|
69082
|
-
}, undefined, true, undefined, this)
|
|
69083
|
-
}, item.value, false, undefined, this);
|
|
69084
|
-
})
|
|
69085
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
69086
|
-
marginTop: 1,
|
|
69087
|
-
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Text, {
|
|
69088
|
-
dimColor: true,
|
|
69089
|
-
children: "Press ESC to go back"
|
|
69090
|
-
}, undefined, false, undefined, this)
|
|
69260
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
69261
|
+
dimColor: true,
|
|
69262
|
+
children: "Enable Powerline mode to configure separators, caps, and themes."
|
|
69091
69263
|
}, undefined, false, undefined, this)
|
|
69264
|
+
}, undefined, false, undefined, this),
|
|
69265
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(List, {
|
|
69266
|
+
marginTop: 1,
|
|
69267
|
+
items: buildPowerlineSetupMenuItems(powerlineConfig),
|
|
69268
|
+
onSelect: (value) => {
|
|
69269
|
+
if (value === "back") {
|
|
69270
|
+
onBack();
|
|
69271
|
+
return;
|
|
69272
|
+
}
|
|
69273
|
+
setScreen(value);
|
|
69274
|
+
},
|
|
69275
|
+
onSelectionChange: (_, index) => {
|
|
69276
|
+
setSelectedMenuItem(index);
|
|
69277
|
+
},
|
|
69278
|
+
initialSelection: selectedMenuItem,
|
|
69279
|
+
showBackButton: true
|
|
69092
69280
|
}, undefined, false, undefined, this)
|
|
69093
69281
|
]
|
|
69094
69282
|
}, undefined, true, undefined, this)
|
|
@@ -69101,7 +69289,7 @@ await __promiseAll([
|
|
|
69101
69289
|
init_build2(),
|
|
69102
69290
|
init_renderer2()
|
|
69103
69291
|
]);
|
|
69104
|
-
var
|
|
69292
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
69105
69293
|
|
|
69106
69294
|
// src/utils/separator-index.ts
|
|
69107
69295
|
function countSeparatorSlots(widgets) {
|
|
@@ -69113,7 +69301,7 @@ function advanceGlobalSeparatorIndex(currentIndex, widgets) {
|
|
|
69113
69301
|
}
|
|
69114
69302
|
|
|
69115
69303
|
// src/tui/components/StatusLinePreview.tsx
|
|
69116
|
-
var
|
|
69304
|
+
var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69117
69305
|
var renderSingleLine = (widgets, terminalWidth, settings, lineIndex, globalSeparatorIndex, preRenderedWidgets, preCalculatedMaxWidths) => {
|
|
69118
69306
|
const context = {
|
|
69119
69307
|
terminalWidth,
|
|
@@ -69124,7 +69312,7 @@ var renderSingleLine = (widgets, terminalWidth, settings, lineIndex, globalSepar
|
|
|
69124
69312
|
return renderStatusLineWithInfo(widgets, settings, context, preRenderedWidgets, preCalculatedMaxWidths);
|
|
69125
69313
|
};
|
|
69126
69314
|
var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange }) => {
|
|
69127
|
-
const { renderedLines, anyTruncated } =
|
|
69315
|
+
const { renderedLines, anyTruncated } = import_react43.default.useMemo(() => {
|
|
69128
69316
|
if (!settings)
|
|
69129
69317
|
return { renderedLines: [], anyTruncated: false };
|
|
69130
69318
|
const preRenderedLines = preRenderAllWidgets(lines, settings, { terminalWidth, isPreview: true });
|
|
@@ -69146,29 +69334,29 @@ var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange })
|
|
|
69146
69334
|
}
|
|
69147
69335
|
return { renderedLines: result2, anyTruncated: truncated };
|
|
69148
69336
|
}, [lines, terminalWidth, settings]);
|
|
69149
|
-
|
|
69337
|
+
import_react43.default.useEffect(() => {
|
|
69150
69338
|
onTruncationChange?.(anyTruncated);
|
|
69151
69339
|
}, [anyTruncated, onTruncationChange]);
|
|
69152
|
-
return /* @__PURE__ */
|
|
69340
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69153
69341
|
flexDirection: "column",
|
|
69154
69342
|
children: [
|
|
69155
|
-
/* @__PURE__ */
|
|
69343
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69156
69344
|
borderStyle: "round",
|
|
69157
69345
|
borderColor: "gray",
|
|
69158
69346
|
borderDimColor: true,
|
|
69159
69347
|
width: "100%",
|
|
69160
69348
|
paddingLeft: 1,
|
|
69161
|
-
children: /* @__PURE__ */
|
|
69349
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69162
69350
|
children: [
|
|
69163
69351
|
">",
|
|
69164
|
-
/* @__PURE__ */
|
|
69352
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69165
69353
|
dimColor: true,
|
|
69166
69354
|
children: " Preview (ctrl+s to save configuration at any time)"
|
|
69167
69355
|
}, undefined, false, undefined, this)
|
|
69168
69356
|
]
|
|
69169
69357
|
}, undefined, true, undefined, this)
|
|
69170
69358
|
}, undefined, false, undefined, this),
|
|
69171
|
-
renderedLines.map((line, index) => /* @__PURE__ */
|
|
69359
|
+
renderedLines.map((line, index) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69172
69360
|
children: [
|
|
69173
69361
|
" ",
|
|
69174
69362
|
line,
|
|
@@ -69181,7 +69369,7 @@ var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange })
|
|
|
69181
69369
|
// src/tui/components/TerminalOptionsMenu.tsx
|
|
69182
69370
|
init_source();
|
|
69183
69371
|
await init_build2();
|
|
69184
|
-
var
|
|
69372
|
+
var import_react44 = __toESM(require_react(), 1);
|
|
69185
69373
|
|
|
69186
69374
|
// src/utils/color-sanitize.ts
|
|
69187
69375
|
await init_widgets2();
|
|
@@ -69236,33 +69424,66 @@ function sanitizeLinesForColorLevel(lines, nextLevel) {
|
|
|
69236
69424
|
}
|
|
69237
69425
|
|
|
69238
69426
|
// src/tui/components/TerminalOptionsMenu.tsx
|
|
69239
|
-
var
|
|
69240
|
-
|
|
69241
|
-
|
|
69242
|
-
|
|
69243
|
-
|
|
69244
|
-
|
|
69245
|
-
|
|
69427
|
+
var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69428
|
+
function getNextColorLevel(level) {
|
|
69429
|
+
return (level + 1) % 4;
|
|
69430
|
+
}
|
|
69431
|
+
function shouldWarnOnColorLevelChange(currentLevel, nextLevel, hasCustomColors) {
|
|
69432
|
+
return hasCustomColors && (currentLevel === 2 && nextLevel !== 2 || currentLevel === 3 && nextLevel !== 3);
|
|
69433
|
+
}
|
|
69434
|
+
function buildTerminalOptionsItems(colorLevel) {
|
|
69435
|
+
return [
|
|
69436
|
+
{
|
|
69437
|
+
label: "◱ Terminal Width",
|
|
69438
|
+
value: "width",
|
|
69439
|
+
description: "Configure how the status line uses available terminal width and when it should compact."
|
|
69440
|
+
},
|
|
69441
|
+
{
|
|
69442
|
+
label: "▓ Color Level",
|
|
69443
|
+
sublabel: `(${getColorLevelLabel(colorLevel)})`,
|
|
69444
|
+
value: "colorLevel",
|
|
69445
|
+
description: [
|
|
69446
|
+
"Color level affects how colors are rendered:",
|
|
69447
|
+
"• Truecolor: Full 24-bit RGB colors (16.7M colors)",
|
|
69448
|
+
"• 256 Color: Extended color palette (256 colors)",
|
|
69449
|
+
"• Basic: Standard 16-color terminal palette",
|
|
69450
|
+
"• No Color: Disables all color output"
|
|
69451
|
+
].join(`
|
|
69452
|
+
`)
|
|
69453
|
+
}
|
|
69454
|
+
];
|
|
69455
|
+
}
|
|
69456
|
+
var TerminalOptionsMenu = ({
|
|
69457
|
+
settings,
|
|
69458
|
+
onUpdate,
|
|
69459
|
+
onBack
|
|
69460
|
+
}) => {
|
|
69461
|
+
const [showColorWarning, setShowColorWarning] = import_react44.useState(false);
|
|
69462
|
+
const [pendingColorLevel, setPendingColorLevel] = import_react44.useState(null);
|
|
69463
|
+
const handleSelect = (value) => {
|
|
69464
|
+
if (value === "back") {
|
|
69246
69465
|
onBack();
|
|
69247
|
-
|
|
69466
|
+
return;
|
|
69467
|
+
}
|
|
69468
|
+
if (value === "width") {
|
|
69248
69469
|
onBack("width");
|
|
69249
|
-
|
|
69250
|
-
const hasCustomColors = hasCustomWidgetColors(settings.lines);
|
|
69251
|
-
const currentLevel = settings.colorLevel;
|
|
69252
|
-
const nextLevel = (currentLevel + 1) % 4;
|
|
69253
|
-
if (hasCustomColors && (currentLevel === 2 && nextLevel !== 2 || currentLevel === 3 && nextLevel !== 3)) {
|
|
69254
|
-
setShowColorWarning(true);
|
|
69255
|
-
setPendingColorLevel(nextLevel);
|
|
69256
|
-
} else {
|
|
69257
|
-
source_default.level = nextLevel;
|
|
69258
|
-
const cleanedLines = sanitizeLinesForColorLevel(settings.lines, nextLevel);
|
|
69259
|
-
onUpdate({
|
|
69260
|
-
...settings,
|
|
69261
|
-
lines: cleanedLines,
|
|
69262
|
-
colorLevel: nextLevel
|
|
69263
|
-
});
|
|
69264
|
-
}
|
|
69470
|
+
return;
|
|
69265
69471
|
}
|
|
69472
|
+
const hasCustomColors = hasCustomWidgetColors(settings.lines);
|
|
69473
|
+
const currentLevel = settings.colorLevel;
|
|
69474
|
+
const nextLevel = getNextColorLevel(currentLevel);
|
|
69475
|
+
if (shouldWarnOnColorLevelChange(currentLevel, nextLevel, hasCustomColors)) {
|
|
69476
|
+
setShowColorWarning(true);
|
|
69477
|
+
setPendingColorLevel(nextLevel);
|
|
69478
|
+
return;
|
|
69479
|
+
}
|
|
69480
|
+
source_default.level = nextLevel;
|
|
69481
|
+
const cleanedLines = sanitizeLinesForColorLevel(settings.lines, nextLevel);
|
|
69482
|
+
onUpdate({
|
|
69483
|
+
...settings,
|
|
69484
|
+
lines: cleanedLines,
|
|
69485
|
+
colorLevel: nextLevel
|
|
69486
|
+
});
|
|
69266
69487
|
};
|
|
69267
69488
|
const handleColorConfirm = () => {
|
|
69268
69489
|
if (pendingColorLevel !== null) {
|
|
@@ -69281,42 +69502,32 @@ var TerminalOptionsMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
69281
69502
|
setShowColorWarning(false);
|
|
69282
69503
|
setPendingColorLevel(null);
|
|
69283
69504
|
};
|
|
69284
|
-
use_input_default((
|
|
69285
|
-
if (key.escape) {
|
|
69286
|
-
|
|
69287
|
-
onBack();
|
|
69288
|
-
}
|
|
69289
|
-
} else if (!showColorWarning) {
|
|
69290
|
-
if (key.upArrow) {
|
|
69291
|
-
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
69292
|
-
} else if (key.downArrow) {
|
|
69293
|
-
setSelectedIndex(Math.min(2, selectedIndex + 1));
|
|
69294
|
-
} else if (key.return) {
|
|
69295
|
-
handleSelect();
|
|
69296
|
-
}
|
|
69505
|
+
use_input_default((_, key) => {
|
|
69506
|
+
if (key.escape && !showColorWarning) {
|
|
69507
|
+
onBack();
|
|
69297
69508
|
}
|
|
69298
69509
|
});
|
|
69299
|
-
return /* @__PURE__ */
|
|
69510
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69300
69511
|
flexDirection: "column",
|
|
69301
69512
|
children: [
|
|
69302
|
-
/* @__PURE__ */
|
|
69513
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69303
69514
|
bold: true,
|
|
69304
69515
|
children: "Terminal Options"
|
|
69305
69516
|
}, undefined, false, undefined, this),
|
|
69306
|
-
showColorWarning ? /* @__PURE__ */
|
|
69517
|
+
showColorWarning ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69307
69518
|
flexDirection: "column",
|
|
69308
69519
|
marginTop: 1,
|
|
69309
69520
|
children: [
|
|
69310
|
-
/* @__PURE__ */
|
|
69521
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69311
69522
|
color: "yellow",
|
|
69312
69523
|
children: "⚠ Warning: Custom colors detected!"
|
|
69313
69524
|
}, undefined, false, undefined, this),
|
|
69314
|
-
/* @__PURE__ */
|
|
69525
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69315
69526
|
children: "Switching color modes will reset custom ansi256 or hex colors to defaults."
|
|
69316
69527
|
}, undefined, false, undefined, this),
|
|
69317
|
-
/* @__PURE__ */
|
|
69528
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69318
69529
|
marginTop: 1,
|
|
69319
|
-
children: /* @__PURE__ */
|
|
69530
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ConfirmDialog, {
|
|
69320
69531
|
message: "Continue?",
|
|
69321
69532
|
onConfirm: handleColorConfirm,
|
|
69322
69533
|
onCancel: handleColorCancel,
|
|
@@ -69324,74 +69535,18 @@ var TerminalOptionsMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
69324
69535
|
}, undefined, false, undefined, this)
|
|
69325
69536
|
}, undefined, false, undefined, this)
|
|
69326
69537
|
]
|
|
69327
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
69538
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
|
|
69328
69539
|
children: [
|
|
69329
|
-
/* @__PURE__ */
|
|
69540
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69330
69541
|
color: "white",
|
|
69331
69542
|
children: "Configure terminal-specific settings for optimal display"
|
|
69332
69543
|
}, undefined, false, undefined, this),
|
|
69333
|
-
/* @__PURE__ */
|
|
69334
|
-
marginTop: 1,
|
|
69335
|
-
flexDirection: "column",
|
|
69336
|
-
children: [
|
|
69337
|
-
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69338
|
-
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69339
|
-
color: selectedIndex === 0 ? "green" : undefined,
|
|
69340
|
-
children: [
|
|
69341
|
-
selectedIndex === 0 ? "▶ " : " ",
|
|
69342
|
-
"◱ Terminal Width"
|
|
69343
|
-
]
|
|
69344
|
-
}, undefined, true, undefined, this)
|
|
69345
|
-
}, undefined, false, undefined, this),
|
|
69346
|
-
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69347
|
-
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69348
|
-
color: selectedIndex === 1 ? "green" : undefined,
|
|
69349
|
-
children: [
|
|
69350
|
-
selectedIndex === 1 ? "▶ " : " ",
|
|
69351
|
-
"▓ Color Level:",
|
|
69352
|
-
" ",
|
|
69353
|
-
getColorLevelLabel(settings.colorLevel)
|
|
69354
|
-
]
|
|
69355
|
-
}, undefined, true, undefined, this)
|
|
69356
|
-
}, undefined, false, undefined, this),
|
|
69357
|
-
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69358
|
-
marginTop: 1,
|
|
69359
|
-
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69360
|
-
color: selectedIndex === 2 ? "green" : undefined,
|
|
69361
|
-
children: [
|
|
69362
|
-
selectedIndex === 2 ? "▶ " : " ",
|
|
69363
|
-
"← Back"
|
|
69364
|
-
]
|
|
69365
|
-
}, undefined, true, undefined, this)
|
|
69366
|
-
}, undefined, false, undefined, this)
|
|
69367
|
-
]
|
|
69368
|
-
}, undefined, true, undefined, this),
|
|
69369
|
-
selectedIndex === 1 && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
|
|
69544
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(List, {
|
|
69370
69545
|
marginTop: 1,
|
|
69371
|
-
|
|
69372
|
-
|
|
69373
|
-
|
|
69374
|
-
|
|
69375
|
-
children: "Color level affects how colors are rendered:"
|
|
69376
|
-
}, undefined, false, undefined, this),
|
|
69377
|
-
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69378
|
-
dimColor: true,
|
|
69379
|
-
children: "• Truecolor: Full 24-bit RGB colors (16.7M colors)"
|
|
69380
|
-
}, undefined, false, undefined, this),
|
|
69381
|
-
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69382
|
-
dimColor: true,
|
|
69383
|
-
children: "• 256 Color: Extended color palette (256 colors)"
|
|
69384
|
-
}, undefined, false, undefined, this),
|
|
69385
|
-
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69386
|
-
dimColor: true,
|
|
69387
|
-
children: "• Basic: Standard 16-color terminal palette"
|
|
69388
|
-
}, undefined, false, undefined, this),
|
|
69389
|
-
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
69390
|
-
dimColor: true,
|
|
69391
|
-
children: "• No Color: Disables all color output"
|
|
69392
|
-
}, undefined, false, undefined, this)
|
|
69393
|
-
]
|
|
69394
|
-
}, undefined, true, undefined, this)
|
|
69546
|
+
items: buildTerminalOptionsItems(settings.colorLevel),
|
|
69547
|
+
onSelect: handleSelect,
|
|
69548
|
+
showBackButton: true
|
|
69549
|
+
}, undefined, false, undefined, this)
|
|
69395
69550
|
]
|
|
69396
69551
|
}, undefined, true, undefined, this)
|
|
69397
69552
|
]
|
|
@@ -69415,28 +69570,67 @@ var getColorLevelLabel = (level) => {
|
|
|
69415
69570
|
// src/tui/components/TerminalWidthMenu.tsx
|
|
69416
69571
|
init_input_guards();
|
|
69417
69572
|
await init_build2();
|
|
69418
|
-
var
|
|
69419
|
-
var
|
|
69420
|
-
var
|
|
69421
|
-
|
|
69422
|
-
const
|
|
69423
|
-
|
|
69424
|
-
|
|
69425
|
-
|
|
69426
|
-
const
|
|
69427
|
-
|
|
69428
|
-
return
|
|
69429
|
-
}
|
|
69430
|
-
|
|
69573
|
+
var import_react45 = __toESM(require_react(), 1);
|
|
69574
|
+
var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69575
|
+
var TERMINAL_WIDTH_OPTIONS = ["full", "full-minus-40", "full-until-compact"];
|
|
69576
|
+
function getTerminalWidthSelectionIndex(selectedOption) {
|
|
69577
|
+
const selectedIndex = TERMINAL_WIDTH_OPTIONS.indexOf(selectedOption);
|
|
69578
|
+
return selectedIndex >= 0 ? selectedIndex : 0;
|
|
69579
|
+
}
|
|
69580
|
+
function validateCompactThresholdInput(value) {
|
|
69581
|
+
const parsedValue = parseInt(value, 10);
|
|
69582
|
+
if (isNaN(parsedValue)) {
|
|
69583
|
+
return "Please enter a valid number";
|
|
69584
|
+
}
|
|
69585
|
+
if (parsedValue < 1 || parsedValue > 99) {
|
|
69586
|
+
return `Value must be between 1 and 99 (you entered ${parsedValue})`;
|
|
69587
|
+
}
|
|
69588
|
+
return null;
|
|
69589
|
+
}
|
|
69590
|
+
function buildTerminalWidthItems(selectedOption, compactThreshold) {
|
|
69591
|
+
return [
|
|
69592
|
+
{
|
|
69593
|
+
value: "full",
|
|
69594
|
+
label: "Full width always",
|
|
69595
|
+
sublabel: selectedOption === "full" ? "(active)" : undefined,
|
|
69596
|
+
description: `Uses the full terminal width minus 4 characters for terminal padding. If the auto-compact message appears, it may cause the line to wrap.
|
|
69597
|
+
|
|
69598
|
+
NOTE: If /ide integration is enabled, it is not recommended to use this mode.`
|
|
69599
|
+
},
|
|
69600
|
+
{
|
|
69601
|
+
value: "full-minus-40",
|
|
69602
|
+
label: "Full width minus 40",
|
|
69603
|
+
sublabel: selectedOption === "full-minus-40" ? "(active)" : "(default)",
|
|
69604
|
+
description: "Leaves a gap to the right of the status line to accommodate the auto-compact message. This prevents wrapping but may leave unused space. This limitation exists because we cannot detect when the message will appear."
|
|
69605
|
+
},
|
|
69606
|
+
{
|
|
69607
|
+
value: "full-until-compact",
|
|
69608
|
+
label: "Full width until compact",
|
|
69609
|
+
sublabel: selectedOption === "full-until-compact" ? `(threshold ${compactThreshold}%, active)` : `(threshold ${compactThreshold}%)`,
|
|
69610
|
+
description: `Dynamically adjusts width based on context usage. When context reaches ${compactThreshold}%, it switches to leaving space for the auto-compact message.
|
|
69611
|
+
|
|
69612
|
+
NOTE: If /ide integration is enabled, it is not recommended to use this mode.`
|
|
69613
|
+
}
|
|
69614
|
+
];
|
|
69615
|
+
}
|
|
69616
|
+
var TerminalWidthMenu = ({
|
|
69617
|
+
settings,
|
|
69618
|
+
onUpdate,
|
|
69619
|
+
onBack
|
|
69620
|
+
}) => {
|
|
69621
|
+
const [selectedOption, setSelectedOption] = import_react45.useState(settings.flexMode);
|
|
69622
|
+
const [compactThreshold, setCompactThreshold] = import_react45.useState(settings.compactThreshold);
|
|
69623
|
+
const [editingThreshold, setEditingThreshold] = import_react45.useState(false);
|
|
69624
|
+
const [thresholdInput, setThresholdInput] = import_react45.useState(String(settings.compactThreshold));
|
|
69625
|
+
const [validationError, setValidationError] = import_react45.useState(null);
|
|
69431
69626
|
use_input_default((input, key) => {
|
|
69432
69627
|
if (editingThreshold) {
|
|
69433
69628
|
if (key.return) {
|
|
69434
|
-
const
|
|
69435
|
-
if (
|
|
69436
|
-
setValidationError(
|
|
69437
|
-
} else if (value < 1 || value > 99) {
|
|
69438
|
-
setValidationError(`Value must be between 1 and 99 (you entered ${value})`);
|
|
69629
|
+
const error48 = validateCompactThresholdInput(thresholdInput);
|
|
69630
|
+
if (error48) {
|
|
69631
|
+
setValidationError(error48);
|
|
69439
69632
|
} else {
|
|
69633
|
+
const value = parseInt(thresholdInput, 10);
|
|
69440
69634
|
setCompactThreshold(value);
|
|
69441
69635
|
const updatedSettings = {
|
|
69442
69636
|
...settings,
|
|
@@ -69461,77 +69655,33 @@ var TerminalWidthMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
69461
69655
|
setValidationError(null);
|
|
69462
69656
|
}
|
|
69463
69657
|
}
|
|
69464
|
-
|
|
69465
|
-
if (key.escape) {
|
|
69466
|
-
onBack();
|
|
69467
|
-
} else if (key.upArrow) {
|
|
69468
|
-
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
69469
|
-
} else if (key.downArrow) {
|
|
69470
|
-
setSelectedIndex(Math.min(3, selectedIndex + 1));
|
|
69471
|
-
} else if (key.return) {
|
|
69472
|
-
if (selectedIndex === 3) {
|
|
69473
|
-
onBack();
|
|
69474
|
-
} else if (selectedIndex >= 0 && selectedIndex < options.length) {
|
|
69475
|
-
const mode = options[selectedIndex];
|
|
69476
|
-
if (mode) {
|
|
69477
|
-
setSelectedOption(mode);
|
|
69478
|
-
const updatedSettings = {
|
|
69479
|
-
...settings,
|
|
69480
|
-
flexMode: mode,
|
|
69481
|
-
compactThreshold
|
|
69482
|
-
};
|
|
69483
|
-
onUpdate(updatedSettings);
|
|
69484
|
-
if (mode === "full-until-compact") {
|
|
69485
|
-
setEditingThreshold(true);
|
|
69486
|
-
}
|
|
69487
|
-
}
|
|
69488
|
-
}
|
|
69489
|
-
}
|
|
69658
|
+
return;
|
|
69490
69659
|
}
|
|
69491
|
-
|
|
69492
|
-
|
|
69493
|
-
{
|
|
69494
|
-
value: "full",
|
|
69495
|
-
label: "Full width always",
|
|
69496
|
-
description: `Uses the full terminal width minus 4 characters for terminal padding. If the auto-compact message appears, it may cause the line to wrap.
|
|
69497
|
-
|
|
69498
|
-
NOTE: If /ide integration is enabled, it's not recommended to use this mode.`
|
|
69499
|
-
},
|
|
69500
|
-
{
|
|
69501
|
-
value: "full-minus-40",
|
|
69502
|
-
label: "Full width minus 40 (default)",
|
|
69503
|
-
description: "Leaves a gap to the right of the status line to accommodate the auto-compact message. This prevents wrapping but may leave unused space. This limitation exists because we cannot detect when the message will appear."
|
|
69504
|
-
},
|
|
69505
|
-
{
|
|
69506
|
-
value: "full-until-compact",
|
|
69507
|
-
label: "Full width until compact",
|
|
69508
|
-
description: `Dynamically adjusts width based on context usage. When context reaches ${compactThreshold}%, it switches to leaving space for the auto-compact message.
|
|
69509
|
-
|
|
69510
|
-
NOTE: If /ide integration is enabled, it's not recommended to use this mode.`
|
|
69660
|
+
if (key.escape) {
|
|
69661
|
+
onBack();
|
|
69511
69662
|
}
|
|
69512
|
-
|
|
69513
|
-
|
|
69514
|
-
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69663
|
+
});
|
|
69664
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
69515
69665
|
flexDirection: "column",
|
|
69516
69666
|
children: [
|
|
69517
|
-
/* @__PURE__ */
|
|
69667
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69518
69668
|
bold: true,
|
|
69519
69669
|
children: "Terminal Width"
|
|
69520
69670
|
}, undefined, false, undefined, this),
|
|
69521
|
-
/* @__PURE__ */
|
|
69671
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69522
69672
|
color: "white",
|
|
69523
69673
|
children: "These settings affect where long lines are truncated, and where right-alignment occurs when using flex separators"
|
|
69524
69674
|
}, undefined, false, undefined, this),
|
|
69525
|
-
/* @__PURE__ */
|
|
69675
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69526
69676
|
dimColor: true,
|
|
69527
69677
|
wrap: "wrap",
|
|
69528
69678
|
children: "Claude code does not currently provide an available width variable for the statusline and features like IDE integration, auto-compaction notices, etc all cause the statusline to wrap if we do not truncate it"
|
|
69529
69679
|
}, undefined, false, undefined, this),
|
|
69530
|
-
editingThreshold ? /* @__PURE__ */
|
|
69680
|
+
editingThreshold ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
69531
69681
|
marginTop: 1,
|
|
69532
69682
|
flexDirection: "column",
|
|
69533
69683
|
children: [
|
|
69534
|
-
/* @__PURE__ */
|
|
69684
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69535
69685
|
children: [
|
|
69536
69686
|
"Enter compact threshold (1-99):",
|
|
69537
69687
|
" ",
|
|
@@ -69539,94 +69689,71 @@ NOTE: If /ide integration is enabled, it's not recommended to use this mode.`
|
|
|
69539
69689
|
"%"
|
|
69540
69690
|
]
|
|
69541
69691
|
}, undefined, true, undefined, this),
|
|
69542
|
-
validationError ? /* @__PURE__ */
|
|
69692
|
+
validationError ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69543
69693
|
color: "red",
|
|
69544
69694
|
children: validationError
|
|
69545
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
69695
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
69546
69696
|
dimColor: true,
|
|
69547
69697
|
children: "Press Enter to confirm, ESC to cancel"
|
|
69548
69698
|
}, undefined, false, undefined, this)
|
|
69549
69699
|
]
|
|
69550
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
69551
|
-
|
|
69552
|
-
|
|
69553
|
-
|
|
69554
|
-
|
|
69555
|
-
|
|
69556
|
-
|
|
69557
|
-
|
|
69558
|
-
|
|
69559
|
-
|
|
69560
|
-
|
|
69561
|
-
|
|
69562
|
-
|
|
69563
|
-
|
|
69564
|
-
|
|
69565
|
-
|
|
69566
|
-
|
|
69567
|
-
|
|
69568
|
-
|
|
69569
|
-
|
|
69570
|
-
|
|
69571
|
-
|
|
69572
|
-
"← Back"
|
|
69573
|
-
]
|
|
69574
|
-
}, undefined, true, undefined, this)
|
|
69575
|
-
}, undefined, false, undefined, this)
|
|
69576
|
-
]
|
|
69577
|
-
}, undefined, true, undefined, this),
|
|
69578
|
-
currentOption && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69579
|
-
marginTop: 1,
|
|
69580
|
-
marginBottom: 1,
|
|
69581
|
-
borderStyle: "round",
|
|
69582
|
-
borderColor: "dim",
|
|
69583
|
-
paddingX: 1,
|
|
69584
|
-
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
69585
|
-
flexDirection: "column",
|
|
69586
|
-
children: [
|
|
69587
|
-
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69588
|
-
children: [
|
|
69589
|
-
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69590
|
-
color: "yellow",
|
|
69591
|
-
children: currentOption.label
|
|
69592
|
-
}, undefined, false, undefined, this),
|
|
69593
|
-
currentOption.value === "full-until-compact" && ` | Current threshold: ${compactThreshold}%`
|
|
69594
|
-
]
|
|
69595
|
-
}, undefined, true, undefined, this),
|
|
69596
|
-
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
69597
|
-
dimColor: true,
|
|
69598
|
-
wrap: "wrap",
|
|
69599
|
-
children: currentOption.description
|
|
69600
|
-
}, undefined, false, undefined, this)
|
|
69601
|
-
]
|
|
69602
|
-
}, undefined, true, undefined, this)
|
|
69603
|
-
}, undefined, false, undefined, this)
|
|
69604
|
-
]
|
|
69605
|
-
}, undefined, true, undefined, this)
|
|
69700
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(List, {
|
|
69701
|
+
marginTop: 1,
|
|
69702
|
+
items: buildTerminalWidthItems(selectedOption, compactThreshold),
|
|
69703
|
+
initialSelection: getTerminalWidthSelectionIndex(selectedOption),
|
|
69704
|
+
onSelect: (value) => {
|
|
69705
|
+
if (value === "back") {
|
|
69706
|
+
onBack();
|
|
69707
|
+
return;
|
|
69708
|
+
}
|
|
69709
|
+
setSelectedOption(value);
|
|
69710
|
+
const updatedSettings = {
|
|
69711
|
+
...settings,
|
|
69712
|
+
flexMode: value,
|
|
69713
|
+
compactThreshold
|
|
69714
|
+
};
|
|
69715
|
+
onUpdate(updatedSettings);
|
|
69716
|
+
if (value === "full-until-compact") {
|
|
69717
|
+
setEditingThreshold(true);
|
|
69718
|
+
}
|
|
69719
|
+
},
|
|
69720
|
+
showBackButton: true
|
|
69721
|
+
}, undefined, false, undefined, this)
|
|
69606
69722
|
]
|
|
69607
69723
|
}, undefined, true, undefined, this);
|
|
69608
69724
|
};
|
|
69609
69725
|
// src/tui/App.tsx
|
|
69610
|
-
var
|
|
69726
|
+
var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69611
69727
|
var GITHUB_REPO_URL = "https://github.com/sirmalloc/ccstatusline";
|
|
69728
|
+
function getConfirmCancelScreen(confirmDialog) {
|
|
69729
|
+
return confirmDialog?.cancelScreen ?? "main";
|
|
69730
|
+
}
|
|
69731
|
+
function clearInstallMenuSelection(menuSelections) {
|
|
69732
|
+
if (menuSelections.install === undefined) {
|
|
69733
|
+
return menuSelections;
|
|
69734
|
+
}
|
|
69735
|
+
const next = { ...menuSelections };
|
|
69736
|
+
delete next.install;
|
|
69737
|
+
return next;
|
|
69738
|
+
}
|
|
69612
69739
|
var App2 = () => {
|
|
69613
69740
|
const { exit } = use_app_default();
|
|
69614
|
-
const [settings, setSettings] =
|
|
69615
|
-
const [originalSettings, setOriginalSettings] =
|
|
69616
|
-
const [hasChanges, setHasChanges] =
|
|
69617
|
-
const [screen, setScreen] =
|
|
69618
|
-
const [selectedLine, setSelectedLine] =
|
|
69619
|
-
const [menuSelections, setMenuSelections] =
|
|
69620
|
-
const [confirmDialog, setConfirmDialog] =
|
|
69621
|
-
const [isClaudeInstalled, setIsClaudeInstalled] =
|
|
69622
|
-
const [terminalWidth, setTerminalWidth] =
|
|
69623
|
-
const [powerlineFontStatus, setPowerlineFontStatus] =
|
|
69624
|
-
const [installingFonts, setInstallingFonts] =
|
|
69625
|
-
const [fontInstallMessage, setFontInstallMessage] =
|
|
69626
|
-
const [existingStatusLine, setExistingStatusLine] =
|
|
69627
|
-
const [flashMessage, setFlashMessage] =
|
|
69628
|
-
const [previewIsTruncated, setPreviewIsTruncated] =
|
|
69629
|
-
|
|
69741
|
+
const [settings, setSettings] = import_react46.useState(null);
|
|
69742
|
+
const [originalSettings, setOriginalSettings] = import_react46.useState(null);
|
|
69743
|
+
const [hasChanges, setHasChanges] = import_react46.useState(false);
|
|
69744
|
+
const [screen, setScreen] = import_react46.useState("main");
|
|
69745
|
+
const [selectedLine, setSelectedLine] = import_react46.useState(0);
|
|
69746
|
+
const [menuSelections, setMenuSelections] = import_react46.useState({});
|
|
69747
|
+
const [confirmDialog, setConfirmDialog] = import_react46.useState(null);
|
|
69748
|
+
const [isClaudeInstalled, setIsClaudeInstalled] = import_react46.useState(false);
|
|
69749
|
+
const [terminalWidth, setTerminalWidth] = import_react46.useState(process.stdout.columns || 80);
|
|
69750
|
+
const [powerlineFontStatus, setPowerlineFontStatus] = import_react46.useState({ installed: false });
|
|
69751
|
+
const [installingFonts, setInstallingFonts] = import_react46.useState(false);
|
|
69752
|
+
const [fontInstallMessage, setFontInstallMessage] = import_react46.useState(null);
|
|
69753
|
+
const [existingStatusLine, setExistingStatusLine] = import_react46.useState(null);
|
|
69754
|
+
const [flashMessage, setFlashMessage] = import_react46.useState(null);
|
|
69755
|
+
const [previewIsTruncated, setPreviewIsTruncated] = import_react46.useState(false);
|
|
69756
|
+
import_react46.useEffect(() => {
|
|
69630
69757
|
getExistingStatusLine().then(setExistingStatusLine);
|
|
69631
69758
|
loadSettings().then((loadedSettings) => {
|
|
69632
69759
|
source_default.level = loadedSettings.colorLevel;
|
|
@@ -69647,13 +69774,13 @@ var App2 = () => {
|
|
|
69647
69774
|
process.stdout.off("resize", handleResize);
|
|
69648
69775
|
};
|
|
69649
69776
|
}, []);
|
|
69650
|
-
|
|
69777
|
+
import_react46.useEffect(() => {
|
|
69651
69778
|
if (originalSettings) {
|
|
69652
69779
|
const hasAnyChanges = JSON.stringify(settings) !== JSON.stringify(originalSettings);
|
|
69653
69780
|
setHasChanges(hasAnyChanges);
|
|
69654
69781
|
}
|
|
69655
69782
|
}, [settings, originalSettings]);
|
|
69656
|
-
|
|
69783
|
+
import_react46.useEffect(() => {
|
|
69657
69784
|
if (flashMessage) {
|
|
69658
69785
|
const timer = setTimeout(() => {
|
|
69659
69786
|
setFlashMessage(null);
|
|
@@ -69679,7 +69806,7 @@ var App2 = () => {
|
|
|
69679
69806
|
})();
|
|
69680
69807
|
}
|
|
69681
69808
|
});
|
|
69682
|
-
const handleInstallSelection =
|
|
69809
|
+
const handleInstallSelection = import_react46.useCallback((command, displayName, useBunx) => {
|
|
69683
69810
|
getExistingStatusLine().then((existing) => {
|
|
69684
69811
|
const isAlreadyInstalled = isKnownCommand(existing ?? "");
|
|
69685
69812
|
let message;
|
|
@@ -69697,6 +69824,7 @@ Continue?`;
|
|
|
69697
69824
|
}
|
|
69698
69825
|
setConfirmDialog({
|
|
69699
69826
|
message,
|
|
69827
|
+
cancelScreen: "install",
|
|
69700
69828
|
action: async () => {
|
|
69701
69829
|
await installStatusLine(useBunx);
|
|
69702
69830
|
setIsClaudeInstalled(true);
|
|
@@ -69708,14 +69836,20 @@ Continue?`;
|
|
|
69708
69836
|
setScreen("confirm");
|
|
69709
69837
|
});
|
|
69710
69838
|
}, []);
|
|
69711
|
-
const handleNpxInstall =
|
|
69839
|
+
const handleNpxInstall = import_react46.useCallback(() => {
|
|
69840
|
+
setMenuSelections((prev) => ({ ...prev, install: 0 }));
|
|
69712
69841
|
handleInstallSelection(CCSTATUSLINE_COMMANDS.NPM, "npx", false);
|
|
69713
69842
|
}, [handleInstallSelection]);
|
|
69714
|
-
const handleBunxInstall =
|
|
69843
|
+
const handleBunxInstall = import_react46.useCallback(() => {
|
|
69844
|
+
setMenuSelections((prev) => ({ ...prev, install: 1 }));
|
|
69715
69845
|
handleInstallSelection(CCSTATUSLINE_COMMANDS.BUNX, "bunx", true);
|
|
69716
69846
|
}, [handleInstallSelection]);
|
|
69847
|
+
const handleInstallMenuCancel = import_react46.useCallback(() => {
|
|
69848
|
+
setMenuSelections(clearInstallMenuSelection);
|
|
69849
|
+
setScreen("main");
|
|
69850
|
+
}, []);
|
|
69717
69851
|
if (!settings) {
|
|
69718
|
-
return /* @__PURE__ */
|
|
69852
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69719
69853
|
children: "Loading settings..."
|
|
69720
69854
|
}, undefined, false, undefined, this);
|
|
69721
69855
|
}
|
|
@@ -69804,56 +69938,47 @@ ${GITHUB_REPO_URL}`,
|
|
|
69804
69938
|
setSelectedLine(lineIndex);
|
|
69805
69939
|
setScreen("items");
|
|
69806
69940
|
};
|
|
69807
|
-
return /* @__PURE__ */
|
|
69941
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
69808
69942
|
flexDirection: "column",
|
|
69809
69943
|
children: [
|
|
69810
|
-
/* @__PURE__ */
|
|
69944
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
69811
69945
|
marginBottom: 1,
|
|
69812
69946
|
children: [
|
|
69813
|
-
/* @__PURE__ */
|
|
69947
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69814
69948
|
bold: true,
|
|
69815
|
-
children: /* @__PURE__ */
|
|
69949
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(dist_default4, {
|
|
69816
69950
|
name: "retro",
|
|
69817
69951
|
children: "CCStatusline Configuration"
|
|
69818
69952
|
}, undefined, false, undefined, this)
|
|
69819
69953
|
}, undefined, false, undefined, this),
|
|
69820
|
-
/* @__PURE__ */
|
|
69954
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69821
69955
|
bold: true,
|
|
69822
69956
|
children: ` | ${getPackageVersion() && `v${getPackageVersion()}`}`
|
|
69823
69957
|
}, undefined, false, undefined, this),
|
|
69824
|
-
flashMessage && /* @__PURE__ */
|
|
69958
|
+
flashMessage && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69825
69959
|
color: flashMessage.color,
|
|
69826
69960
|
bold: true,
|
|
69827
69961
|
children: ` ${flashMessage.text}`
|
|
69828
69962
|
}, undefined, false, undefined, this)
|
|
69829
69963
|
]
|
|
69830
69964
|
}, undefined, true, undefined, this),
|
|
69831
|
-
isCustomConfigPath() && /* @__PURE__ */
|
|
69965
|
+
isCustomConfigPath() && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
69832
69966
|
dimColor: true,
|
|
69833
69967
|
children: `Config: ${getConfigPath()}`
|
|
69834
69968
|
}, undefined, false, undefined, this),
|
|
69835
|
-
/* @__PURE__ */
|
|
69969
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StatusLinePreview, {
|
|
69836
69970
|
lines: settings.lines,
|
|
69837
69971
|
terminalWidth,
|
|
69838
69972
|
settings,
|
|
69839
69973
|
onTruncationChange: setPreviewIsTruncated
|
|
69840
69974
|
}, undefined, false, undefined, this),
|
|
69841
|
-
/* @__PURE__ */
|
|
69975
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
69842
69976
|
marginTop: 1,
|
|
69843
69977
|
children: [
|
|
69844
|
-
screen === "main" && /* @__PURE__ */
|
|
69845
|
-
onSelect: (value) => {
|
|
69978
|
+
screen === "main" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(MainMenu, {
|
|
69979
|
+
onSelect: (value, index) => {
|
|
69846
69980
|
if (value !== "save" && value !== "exit") {
|
|
69847
|
-
|
|
69848
|
-
lines: 0,
|
|
69849
|
-
colors: 1,
|
|
69850
|
-
powerline: 2,
|
|
69851
|
-
terminalConfig: 3,
|
|
69852
|
-
globalOverrides: 4,
|
|
69853
|
-
install: 5,
|
|
69854
|
-
starGithub: hasChanges ? 8 : 7
|
|
69855
|
-
};
|
|
69856
|
-
setMenuSelections((prev) => ({ ...prev, main: menuMap[value] ?? 0 }));
|
|
69981
|
+
setMenuSelections((prev) => ({ ...prev, main: index }));
|
|
69857
69982
|
}
|
|
69858
69983
|
handleMainMenuSelect(value);
|
|
69859
69984
|
},
|
|
@@ -69864,7 +69989,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
69864
69989
|
settings,
|
|
69865
69990
|
previewIsTruncated
|
|
69866
69991
|
}, undefined, false, undefined, this),
|
|
69867
|
-
screen === "lines" && /* @__PURE__ */
|
|
69992
|
+
screen === "lines" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(LineSelector, {
|
|
69868
69993
|
lines: settings.lines,
|
|
69869
69994
|
onSelect: (line) => {
|
|
69870
69995
|
setMenuSelections((prev) => ({ ...prev, lines: line }));
|
|
@@ -69879,7 +70004,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
69879
70004
|
title: "Select Line to Edit Items",
|
|
69880
70005
|
allowEditing: true
|
|
69881
70006
|
}, undefined, false, undefined, this),
|
|
69882
|
-
screen === "items" && /* @__PURE__ */
|
|
70007
|
+
screen === "items" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ItemsEditor, {
|
|
69883
70008
|
widgets: settings.lines[selectedLine] ?? [],
|
|
69884
70009
|
onUpdate: (widgets) => {
|
|
69885
70010
|
updateLine(selectedLine, widgets);
|
|
@@ -69891,7 +70016,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
69891
70016
|
lineNumber: selectedLine + 1,
|
|
69892
70017
|
settings
|
|
69893
70018
|
}, undefined, false, undefined, this),
|
|
69894
|
-
screen === "colorLines" && /* @__PURE__ */
|
|
70019
|
+
screen === "colorLines" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(LineSelector, {
|
|
69895
70020
|
lines: settings.lines,
|
|
69896
70021
|
onLinesUpdate: updateLines,
|
|
69897
70022
|
onSelect: (line) => {
|
|
@@ -69909,7 +70034,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
69909
70034
|
settings,
|
|
69910
70035
|
allowEditing: false
|
|
69911
70036
|
}, undefined, false, undefined, this),
|
|
69912
|
-
screen === "colors" && /* @__PURE__ */
|
|
70037
|
+
screen === "colors" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ColorMenu, {
|
|
69913
70038
|
widgets: settings.lines[selectedLine] ?? [],
|
|
69914
70039
|
lineIndex: selectedLine,
|
|
69915
70040
|
settings,
|
|
@@ -69922,7 +70047,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
69922
70047
|
setScreen("colorLines");
|
|
69923
70048
|
}
|
|
69924
70049
|
}, undefined, false, undefined, this),
|
|
69925
|
-
screen === "terminalConfig" && /* @__PURE__ */
|
|
70050
|
+
screen === "terminalConfig" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(TerminalOptionsMenu, {
|
|
69926
70051
|
settings,
|
|
69927
70052
|
onUpdate: (updatedSettings) => {
|
|
69928
70053
|
setSettings(updatedSettings);
|
|
@@ -69936,7 +70061,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
69936
70061
|
}
|
|
69937
70062
|
}
|
|
69938
70063
|
}, undefined, false, undefined, this),
|
|
69939
|
-
screen === "terminalWidth" && /* @__PURE__ */
|
|
70064
|
+
screen === "terminalWidth" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(TerminalWidthMenu, {
|
|
69940
70065
|
settings,
|
|
69941
70066
|
onUpdate: (updatedSettings) => {
|
|
69942
70067
|
setSettings(updatedSettings);
|
|
@@ -69945,7 +70070,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
69945
70070
|
setScreen("terminalConfig");
|
|
69946
70071
|
}
|
|
69947
70072
|
}, undefined, false, undefined, this),
|
|
69948
|
-
screen === "globalOverrides" && /* @__PURE__ */
|
|
70073
|
+
screen === "globalOverrides" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(GlobalOverridesMenu, {
|
|
69949
70074
|
settings,
|
|
69950
70075
|
onUpdate: (updatedSettings) => {
|
|
69951
70076
|
setSettings(updatedSettings);
|
|
@@ -69955,24 +70080,23 @@ ${GITHUB_REPO_URL}`,
|
|
|
69955
70080
|
setScreen("main");
|
|
69956
70081
|
}
|
|
69957
70082
|
}, undefined, false, undefined, this),
|
|
69958
|
-
screen === "confirm" && confirmDialog && /* @__PURE__ */
|
|
70083
|
+
screen === "confirm" && confirmDialog && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ConfirmDialog, {
|
|
69959
70084
|
message: confirmDialog.message,
|
|
69960
70085
|
onConfirm: () => void confirmDialog.action(),
|
|
69961
70086
|
onCancel: () => {
|
|
69962
|
-
setScreen(
|
|
70087
|
+
setScreen(getConfirmCancelScreen(confirmDialog));
|
|
69963
70088
|
setConfirmDialog(null);
|
|
69964
70089
|
}
|
|
69965
70090
|
}, undefined, false, undefined, this),
|
|
69966
|
-
screen === "install" && /* @__PURE__ */
|
|
70091
|
+
screen === "install" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(InstallMenu, {
|
|
69967
70092
|
bunxAvailable: isBunxAvailable(),
|
|
69968
70093
|
existingStatusLine,
|
|
69969
70094
|
onSelectNpx: handleNpxInstall,
|
|
69970
70095
|
onSelectBunx: handleBunxInstall,
|
|
69971
|
-
onCancel:
|
|
69972
|
-
|
|
69973
|
-
}
|
|
70096
|
+
onCancel: handleInstallMenuCancel,
|
|
70097
|
+
initialSelection: menuSelections.install
|
|
69974
70098
|
}, undefined, false, undefined, this),
|
|
69975
|
-
screen === "powerline" && /* @__PURE__ */
|
|
70099
|
+
screen === "powerline" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(PowerlineSetup, {
|
|
69976
70100
|
settings,
|
|
69977
70101
|
powerlineFontStatus,
|
|
69978
70102
|
onUpdate: (updatedSettings) => {
|
|
@@ -70006,7 +70130,7 @@ ${GITHUB_REPO_URL}`,
|
|
|
70006
70130
|
};
|
|
70007
70131
|
function runTUI() {
|
|
70008
70132
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
70009
|
-
render_default(/* @__PURE__ */
|
|
70133
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(App2, {}, undefined, false, undefined, this));
|
|
70010
70134
|
}
|
|
70011
70135
|
// src/types/StatusJSON.ts
|
|
70012
70136
|
init_zod();
|