@contentful/experience-design-system-cli 2.37.1-dev-build-0b786a83.0 → 2.37.1-dev-build-35e4cab1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +519 -1184
- package/dist/index.js +591 -1325
- package/dist/package.json +1 -1
- package/dist/src/tui/home/home.theme.d.ts +0 -8
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +6 -6
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +16 -7
- package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +0 -1
- package/dist/src/tui/theme.d.ts +19 -0
- package/legacy/dist/src/index.js +0 -1
- package/legacy/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/help/file-locations.d.ts +0 -23
- package/dist/src/tui/import/steps/09-review/theme.d.ts +0 -9
- package/dist/src/tui/settings/agents/AgentDetail.d.ts +0 -13
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +0 -8
- package/dist/src/tui/settings/agents/AgentStatusBadge.d.ts +0 -9
- package/dist/src/tui/settings/agents/agent-status.d.ts +0 -44
- package/dist/src/tui/settings/agents/agent-store.d.ts +0 -17
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +0 -13
- package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +0 -5
- package/dist/src/tui/settings/shared/FieldForm.d.ts +0 -35
package/dist/app.js
CHANGED
|
@@ -837,7 +837,7 @@ async function runAgent(options) {
|
|
|
837
837
|
promptLen: prompt.length,
|
|
838
838
|
promptHead: prompt.slice(0, 500)
|
|
839
839
|
});
|
|
840
|
-
return new Promise((
|
|
840
|
+
return new Promise((resolve27) => {
|
|
841
841
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
842
842
|
const child = spawn(binary, args, {
|
|
843
843
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -886,7 +886,7 @@ async function runAgent(options) {
|
|
|
886
886
|
stderrLen: stderr.length,
|
|
887
887
|
stderrTail: stderr.slice(-1e3)
|
|
888
888
|
});
|
|
889
|
-
|
|
889
|
+
resolve27(result);
|
|
890
890
|
});
|
|
891
891
|
});
|
|
892
892
|
}
|
|
@@ -908,7 +908,7 @@ async function checkAgentAuth(agent) {
|
|
|
908
908
|
return "not-found";
|
|
909
909
|
if (agent !== "claude")
|
|
910
910
|
return "ok";
|
|
911
|
-
return new Promise((
|
|
911
|
+
return new Promise((resolve27) => {
|
|
912
912
|
const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
913
913
|
let stdout = "";
|
|
914
914
|
let done = false;
|
|
@@ -917,7 +917,7 @@ async function checkAgentAuth(agent) {
|
|
|
917
917
|
return;
|
|
918
918
|
done = true;
|
|
919
919
|
child.kill("SIGTERM");
|
|
920
|
-
|
|
920
|
+
resolve27("unauthenticated");
|
|
921
921
|
}, 5e3);
|
|
922
922
|
child.stdout?.on("data", (chunk) => {
|
|
923
923
|
stdout += chunk.toString();
|
|
@@ -928,14 +928,14 @@ async function checkAgentAuth(agent) {
|
|
|
928
928
|
done = true;
|
|
929
929
|
clearTimeout(timer);
|
|
930
930
|
if (code !== 0) {
|
|
931
|
-
|
|
931
|
+
resolve27("unauthenticated");
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
934
|
try {
|
|
935
935
|
const status = JSON.parse(stdout);
|
|
936
|
-
|
|
936
|
+
resolve27(status.loggedIn ? "ok" : "unauthenticated");
|
|
937
937
|
} catch {
|
|
938
|
-
|
|
938
|
+
resolve27("unauthenticated");
|
|
939
939
|
}
|
|
940
940
|
});
|
|
941
941
|
});
|
|
@@ -945,9 +945,9 @@ async function binaryIsOnPath(binary) {
|
|
|
945
945
|
const fs = await import("node:fs/promises");
|
|
946
946
|
return fs.access(binary).then(() => true, () => false);
|
|
947
947
|
}
|
|
948
|
-
return new Promise((
|
|
948
|
+
return new Promise((resolve27) => {
|
|
949
949
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
950
|
-
child.on("close", (code) =>
|
|
950
|
+
child.on("close", (code) => resolve27(code === 0));
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
953
|
var init_check_agent_auth = __esm({
|
|
@@ -2329,32 +2329,55 @@ var init_debug_store = __esm({
|
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
2331
|
// packages/experience-design-system-cli/app.tsx
|
|
2332
|
-
import { join as
|
|
2333
|
-
import { useEffect as
|
|
2332
|
+
import { join as join25 } from "node:path";
|
|
2333
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
2334
2334
|
|
|
2335
2335
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2336
2336
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
2337
2337
|
import { Box, Text as Text2, useApp, useInput } from "ink";
|
|
2338
2338
|
|
|
2339
|
-
// packages/experience-design-system-cli/src/tui/
|
|
2340
|
-
var
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2339
|
+
// packages/experience-design-system-cli/src/tui/theme.ts
|
|
2340
|
+
var DARK = {
|
|
2341
|
+
text: "#f7f9fa",
|
|
2342
|
+
// gray100
|
|
2343
|
+
muted: "#aec1cc",
|
|
2344
|
+
// gray400
|
|
2345
|
+
border: "#aec1cc",
|
|
2346
|
+
// gray400
|
|
2347
|
+
accent: "#40a0ff",
|
|
2348
|
+
// blue400
|
|
2349
|
+
error: "#ff707d",
|
|
2350
|
+
// red400
|
|
2351
|
+
success: "#5DB057",
|
|
2352
|
+
// green400
|
|
2353
|
+
warning: "#FFC835"
|
|
2354
|
+
// yellow500
|
|
2348
2355
|
};
|
|
2349
|
-
var
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
+
var LIGHT = {
|
|
2357
|
+
text: "#111b2b",
|
|
2358
|
+
// gray900
|
|
2359
|
+
muted: "#5a657c",
|
|
2360
|
+
// gray600
|
|
2361
|
+
border: "#5a657c",
|
|
2362
|
+
// gray600
|
|
2363
|
+
accent: "#0059c8",
|
|
2364
|
+
// semantic primary
|
|
2365
|
+
error: "#bd002a",
|
|
2366
|
+
// semantic negative
|
|
2367
|
+
success: "#006D23",
|
|
2368
|
+
// semantic positive
|
|
2369
|
+
warning: "#CC4500"
|
|
2370
|
+
// semantic warning
|
|
2356
2371
|
};
|
|
2357
|
-
|
|
2372
|
+
function detectColorMode(env = process.env) {
|
|
2373
|
+
const bg = env.COLORFGBG?.split(";").pop();
|
|
2374
|
+
if (bg === "7" || bg === "15") return "light";
|
|
2375
|
+
return "dark";
|
|
2376
|
+
}
|
|
2377
|
+
var PALETTE = detectColorMode() === "light" ? LIGHT : DARK;
|
|
2378
|
+
|
|
2379
|
+
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
2380
|
+
var BRAND_RAMP = [PALETTE.accent, PALETTE.error, PALETTE.warning];
|
|
2358
2381
|
var BAR_CELL = "\u2501";
|
|
2359
2382
|
function brandBar(width, ramp = BRAND_RAMP) {
|
|
2360
2383
|
if (width <= 0 || ramp.length === 0) return [];
|
|
@@ -4286,9 +4309,9 @@ async function resolveRelativeImport(specifier, fromDir) {
|
|
|
4286
4309
|
async function resolveImportSpecifiers(sourceText, fromDir) {
|
|
4287
4310
|
const resolvedPaths = [];
|
|
4288
4311
|
for (const specifier of extractRelativeImportPaths(sourceText)) {
|
|
4289
|
-
const
|
|
4290
|
-
if (
|
|
4291
|
-
resolvedPaths.push(
|
|
4312
|
+
const resolvedPath = await resolveRelativeImport(specifier, fromDir);
|
|
4313
|
+
if (resolvedPath)
|
|
4314
|
+
resolvedPaths.push(resolvedPath);
|
|
4292
4315
|
}
|
|
4293
4316
|
return resolvedPaths;
|
|
4294
4317
|
}
|
|
@@ -4302,20 +4325,20 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
4302
4325
|
if (discovered.length >= MAX_SIBLING_CANDIDATES_EXPLORED)
|
|
4303
4326
|
break;
|
|
4304
4327
|
const resolvedPaths = await resolveImportSpecifiers(node.text, node.dir);
|
|
4305
|
-
for (const
|
|
4306
|
-
if (visited.has(
|
|
4328
|
+
for (const resolvedPath of resolvedPaths) {
|
|
4329
|
+
if (visited.has(resolvedPath))
|
|
4307
4330
|
continue;
|
|
4308
|
-
visited.add(
|
|
4331
|
+
visited.add(resolvedPath);
|
|
4309
4332
|
if (discovered.length >= MAX_SIBLING_CANDIDATES_EXPLORED)
|
|
4310
4333
|
break;
|
|
4311
4334
|
let content;
|
|
4312
4335
|
try {
|
|
4313
|
-
content = await readFile4(
|
|
4336
|
+
content = await readFile4(resolvedPath, "utf8");
|
|
4314
4337
|
} catch {
|
|
4315
4338
|
continue;
|
|
4316
4339
|
}
|
|
4317
|
-
discovered.push({ path:
|
|
4318
|
-
nextFrontier.push({ text: content, dir: dirname4(
|
|
4340
|
+
discovered.push({ path: resolvedPath, content });
|
|
4341
|
+
nextFrontier.push({ text: content, dir: dirname4(resolvedPath) });
|
|
4319
4342
|
}
|
|
4320
4343
|
}
|
|
4321
4344
|
frontier = nextFrontier;
|
|
@@ -5280,11 +5303,11 @@ function isBareModuleSpecifier(moduleSpecifier) {
|
|
|
5280
5303
|
return !moduleSpecifier.startsWith(".") && !moduleSpecifier.startsWith("/");
|
|
5281
5304
|
}
|
|
5282
5305
|
function findRepoLocalAliasSourceFile(originSourceFile, moduleSpecifier) {
|
|
5283
|
-
const
|
|
5284
|
-
if (!
|
|
5306
|
+
const resolvedPath = resolveRepoLocalAliasImportPath(originSourceFile.getFilePath(), moduleSpecifier);
|
|
5307
|
+
if (!resolvedPath)
|
|
5285
5308
|
return void 0;
|
|
5286
5309
|
const project = originSourceFile.getProject();
|
|
5287
|
-
return findProjectSourceFileByImportPath(project,
|
|
5310
|
+
return findProjectSourceFileByImportPath(project, resolvedPath);
|
|
5288
5311
|
}
|
|
5289
5312
|
function resolveRepoLocalAliasImportPath(importingFilePath, moduleSpecifier) {
|
|
5290
5313
|
const nearestTsConfigPath = findNearestTsConfigPath(importingFilePath);
|
|
@@ -5299,8 +5322,8 @@ function resolveRepoLocalAliasImportPath(importingFilePath, moduleSpecifier) {
|
|
|
5299
5322
|
continue;
|
|
5300
5323
|
for (const targetPattern of targets) {
|
|
5301
5324
|
const substitutedTarget = substituteTsConfigPathTarget(targetPattern, match2.wildcard);
|
|
5302
|
-
const
|
|
5303
|
-
const sourceFilePath = resolveImportSourcePath(
|
|
5325
|
+
const resolvedPath = resolve7(tsConfigPaths.baseUrl, substitutedTarget);
|
|
5326
|
+
const sourceFilePath = resolveImportSourcePath(resolvedPath);
|
|
5304
5327
|
if (sourceFilePath)
|
|
5305
5328
|
return sourceFilePath;
|
|
5306
5329
|
}
|
|
@@ -5378,17 +5401,17 @@ function resolveImportSourcePath(basePath) {
|
|
|
5378
5401
|
];
|
|
5379
5402
|
return candidates.find((candidatePath) => existsSync3(candidatePath));
|
|
5380
5403
|
}
|
|
5381
|
-
function findProjectSourceFileByImportPath(project,
|
|
5404
|
+
function findProjectSourceFileByImportPath(project, resolvedPath) {
|
|
5382
5405
|
const candidatePaths = [
|
|
5383
|
-
|
|
5384
|
-
`${
|
|
5385
|
-
`${
|
|
5386
|
-
`${
|
|
5387
|
-
`${
|
|
5388
|
-
join5(
|
|
5389
|
-
join5(
|
|
5390
|
-
join5(
|
|
5391
|
-
join5(
|
|
5406
|
+
resolvedPath,
|
|
5407
|
+
`${resolvedPath}.ts`,
|
|
5408
|
+
`${resolvedPath}.tsx`,
|
|
5409
|
+
`${resolvedPath}.js`,
|
|
5410
|
+
`${resolvedPath}.jsx`,
|
|
5411
|
+
join5(resolvedPath, "index.ts"),
|
|
5412
|
+
join5(resolvedPath, "index.tsx"),
|
|
5413
|
+
join5(resolvedPath, "index.js"),
|
|
5414
|
+
join5(resolvedPath, "index.jsx")
|
|
5392
5415
|
];
|
|
5393
5416
|
for (const candidatePath of candidatePaths) {
|
|
5394
5417
|
const sourceFile = project.getSourceFile(candidatePath);
|
|
@@ -8431,10 +8454,10 @@ function extractVueSlotsFromSetup(options) {
|
|
|
8431
8454
|
if (!body)
|
|
8432
8455
|
return [];
|
|
8433
8456
|
const slotsByName = /* @__PURE__ */ new Map();
|
|
8434
|
-
for (const
|
|
8435
|
-
if (
|
|
8457
|
+
for (const access6 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
|
|
8458
|
+
if (access6.getExpression().getText() !== slotsName)
|
|
8436
8459
|
continue;
|
|
8437
|
-
const slotName =
|
|
8460
|
+
const slotName = access6.getName();
|
|
8438
8461
|
if (!slotsByName.has(slotName)) {
|
|
8439
8462
|
slotsByName.set(slotName, {
|
|
8440
8463
|
name: slotName,
|
|
@@ -9899,11 +9922,11 @@ function getElementTagNameFromFastDefinition(classDecl, project) {
|
|
|
9899
9922
|
}
|
|
9900
9923
|
function resolveImportSourcePath2(fromFilePath, specifier) {
|
|
9901
9924
|
if (specifier.startsWith(".")) {
|
|
9902
|
-
const
|
|
9903
|
-
if (
|
|
9904
|
-
return `${
|
|
9925
|
+
const resolvedPath = resolve10(dirname8(fromFilePath), specifier);
|
|
9926
|
+
if (resolvedPath.endsWith(".js")) {
|
|
9927
|
+
return `${resolvedPath.slice(0, -3)}.ts`;
|
|
9905
9928
|
}
|
|
9906
|
-
return
|
|
9929
|
+
return resolvedPath;
|
|
9907
9930
|
}
|
|
9908
9931
|
const spectrumPrefix = "@spectrum-web-components/core/components/";
|
|
9909
9932
|
if (!specifier.startsWith(spectrumPrefix)) {
|
|
@@ -13824,7 +13847,7 @@ function errorMessage(error) {
|
|
|
13824
13847
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
13825
13848
|
}
|
|
13826
13849
|
function defaultSleep(delayMs) {
|
|
13827
|
-
return new Promise((
|
|
13850
|
+
return new Promise((resolve27) => setTimeout(resolve27, delayMs));
|
|
13828
13851
|
}
|
|
13829
13852
|
|
|
13830
13853
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/sanitize-preview.js
|
|
@@ -14065,7 +14088,7 @@ var ApiClient = class {
|
|
|
14065
14088
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14066
14089
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14067
14090
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14068
|
-
await new Promise((
|
|
14091
|
+
await new Promise((resolve27) => setTimeout(resolve27, baseDelay + jitter));
|
|
14069
14092
|
}
|
|
14070
14093
|
}
|
|
14071
14094
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -14550,7 +14573,6 @@ function readTokensFromPath2(request) {
|
|
|
14550
14573
|
init_agents();
|
|
14551
14574
|
init_agent_name();
|
|
14552
14575
|
init_models();
|
|
14553
|
-
init_binaries();
|
|
14554
14576
|
init_is_agent_name();
|
|
14555
14577
|
init_agent_supports_bedrock();
|
|
14556
14578
|
init_check_agent_auth();
|
|
@@ -16375,7 +16397,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
16375
16397
|
const message = error instanceof Error ? error.message : String(error);
|
|
16376
16398
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
16377
16399
|
throw error;
|
|
16378
|
-
await new Promise((
|
|
16400
|
+
await new Promise((resolve27) => setTimeout(resolve27, Math.min(250 * attempt, 2e3)));
|
|
16379
16401
|
}
|
|
16380
16402
|
}
|
|
16381
16403
|
}
|
|
@@ -17126,15 +17148,15 @@ function PathValidationScreen({
|
|
|
17126
17148
|
onChangePath,
|
|
17127
17149
|
onBack
|
|
17128
17150
|
}) {
|
|
17129
|
-
const
|
|
17151
|
+
const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
17130
17152
|
const [scan, setScan] = useState5();
|
|
17131
17153
|
useEffect3(() => {
|
|
17132
|
-
setScan(scanFiles(
|
|
17133
|
-
}, [
|
|
17154
|
+
setScan(scanFiles(resolvedPath));
|
|
17155
|
+
}, [resolvedPath]);
|
|
17134
17156
|
const phase = phaseOf(scan);
|
|
17135
17157
|
usePathValidationControls(phase, {
|
|
17136
17158
|
onConfirm: () => {
|
|
17137
|
-
if (scan?.ok) onConfirm({ projectPath:
|
|
17159
|
+
if (scan?.ok) onConfirm({ projectPath: resolvedPath, filePaths: scan.filePaths });
|
|
17138
17160
|
},
|
|
17139
17161
|
onChangePath,
|
|
17140
17162
|
onBack
|
|
@@ -17142,11 +17164,11 @@ function PathValidationScreen({
|
|
|
17142
17164
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
17143
17165
|
scan === void 0 && /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
|
|
17144
17166
|
"Scanning ",
|
|
17145
|
-
/* @__PURE__ */ jsx6(Text6, { bold: true, children:
|
|
17167
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, children: resolvedPath }),
|
|
17146
17168
|
"..."
|
|
17147
17169
|
] }),
|
|
17148
|
-
scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path:
|
|
17149
|
-
scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path:
|
|
17170
|
+
scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path: resolvedPath }),
|
|
17171
|
+
scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path: resolvedPath }),
|
|
17150
17172
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, gap: 3, children: controlsFor(phase).map((control) => /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
|
|
17151
17173
|
"[",
|
|
17152
17174
|
control.keys,
|
|
@@ -17490,7 +17512,7 @@ var PROGRESS_THEME = extendTheme(defaultTheme, {
|
|
|
17490
17512
|
components: {
|
|
17491
17513
|
ProgressBar: {
|
|
17492
17514
|
styles: {
|
|
17493
|
-
completed: () => ({ color:
|
|
17515
|
+
completed: () => ({ color: PALETTE.accent })
|
|
17494
17516
|
}
|
|
17495
17517
|
}
|
|
17496
17518
|
}
|
|
@@ -21471,17 +21493,6 @@ function PreviewValidationErrorScreen({
|
|
|
21471
21493
|
import { useCallback as useCallback5, useEffect as useEffect16, useMemo as useMemo4, useRef as useRef11, useState as useState22 } from "react";
|
|
21472
21494
|
import figures7 from "figures";
|
|
21473
21495
|
|
|
21474
|
-
// packages/experience-design-system-cli/src/tui/import/steps/09-review/theme.ts
|
|
21475
|
-
var PALETTE3 = {
|
|
21476
|
-
info: PALETTE.accent,
|
|
21477
|
-
success: PALETTE.success,
|
|
21478
|
-
error: PALETTE.error,
|
|
21479
|
-
warning: PALETTE.warning,
|
|
21480
|
-
muted: PALETTE.muted,
|
|
21481
|
-
border: PALETTE.border,
|
|
21482
|
-
inverse: "#FFFFFF"
|
|
21483
|
-
};
|
|
21484
|
-
|
|
21485
21496
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
21486
21497
|
var HIDDEN_PROP_CATEGORIES = /* @__PURE__ */ new Set(["state", "unattached"]);
|
|
21487
21498
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
@@ -21912,13 +21923,13 @@ function serializeState(state2, originalJson) {
|
|
|
21912
21923
|
}
|
|
21913
21924
|
function Picker({ value, active }) {
|
|
21914
21925
|
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
21915
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
21916
|
-
/* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21917
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
21926
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u2039" }),
|
|
21927
|
+
/* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
21928
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u203A" })
|
|
21918
21929
|
] });
|
|
21919
21930
|
}
|
|
21920
21931
|
function Toggle({ value, active }) {
|
|
21921
|
-
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21932
|
+
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
21922
21933
|
}
|
|
21923
21934
|
function InlinePropField({
|
|
21924
21935
|
label,
|
|
@@ -21928,7 +21939,7 @@ function InlinePropField({
|
|
|
21928
21939
|
width
|
|
21929
21940
|
}) {
|
|
21930
21941
|
return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
21931
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21942
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
21932
21943
|
focused ? "\u203A " : " ",
|
|
21933
21944
|
label
|
|
21934
21945
|
] }),
|
|
@@ -21949,7 +21960,7 @@ function DefaultValueRow({
|
|
|
21949
21960
|
focused
|
|
21950
21961
|
}) {
|
|
21951
21962
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
21952
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21963
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21953
21964
|
focused ? "\u203A " : " ",
|
|
21954
21965
|
"default:"
|
|
21955
21966
|
] }),
|
|
@@ -21964,7 +21975,7 @@ function RowLabel({
|
|
|
21964
21975
|
return /* @__PURE__ */ jsxs22(
|
|
21965
21976
|
Text23,
|
|
21966
21977
|
{
|
|
21967
|
-
color: selected ?
|
|
21978
|
+
color: selected ? PALETTE.text : PALETTE.accent,
|
|
21968
21979
|
bold: selected,
|
|
21969
21980
|
backgroundColor: selected ? "blue" : void 0,
|
|
21970
21981
|
wrap: "truncate-end",
|
|
@@ -21982,7 +21993,7 @@ function ValueInputRow({
|
|
|
21982
21993
|
cursorVisible
|
|
21983
21994
|
}) {
|
|
21984
21995
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
|
|
21985
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
21996
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
21986
21997
|
/* @__PURE__ */ jsx27(Text23, { children: valueText }),
|
|
21987
21998
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
|
|
21988
21999
|
] });
|
|
@@ -21999,7 +22010,7 @@ function EditableListItem({
|
|
|
21999
22010
|
if (isBeingEdited) {
|
|
22000
22011
|
return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
22001
22012
|
}
|
|
22002
|
-
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
22013
|
+
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.accent : void 0, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
|
|
22003
22014
|
}
|
|
22004
22015
|
function EditableValueList({
|
|
22005
22016
|
values,
|
|
@@ -22013,7 +22024,7 @@ function EditableValueList({
|
|
|
22013
22024
|
showAddInput
|
|
22014
22025
|
}) {
|
|
22015
22026
|
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
22016
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22027
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx27(Box21, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: emptyMessage }) })),
|
|
22017
22028
|
values.map((value, index) => /* @__PURE__ */ jsx27(
|
|
22018
22029
|
EditableListItem,
|
|
22019
22030
|
{
|
|
@@ -22039,11 +22050,11 @@ function DefaultSubRow({
|
|
|
22039
22050
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22040
22051
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
22041
22052
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22042
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22053
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22043
22054
|
focused ? "\u203A " : " ",
|
|
22044
22055
|
"default:"
|
|
22045
22056
|
] }),
|
|
22046
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22057
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
|
|
22047
22058
|
] });
|
|
22048
22059
|
}
|
|
22049
22060
|
if (prop.type === "boolean") {
|
|
@@ -22053,11 +22064,11 @@ function DefaultSubRow({
|
|
|
22053
22064
|
if (prop.type === "enum") {
|
|
22054
22065
|
if (prop.values.length === 0) {
|
|
22055
22066
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22056
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22067
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22057
22068
|
focused ? "\u203A " : " ",
|
|
22058
22069
|
"default:"
|
|
22059
22070
|
] }),
|
|
22060
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22071
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
|
|
22061
22072
|
] });
|
|
22062
22073
|
}
|
|
22063
22074
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
@@ -22066,11 +22077,11 @@ function DefaultSubRow({
|
|
|
22066
22077
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
22067
22078
|
if (active) {
|
|
22068
22079
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
|
|
22069
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22080
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22070
22081
|
focused ? "\u203A " : " ",
|
|
22071
22082
|
"default:"
|
|
22072
22083
|
] }),
|
|
22073
|
-
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor:
|
|
22084
|
+
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
22074
22085
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
|
|
22075
22086
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
22076
22087
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
|
|
@@ -22078,11 +22089,11 @@ function DefaultSubRow({
|
|
|
22078
22089
|
] });
|
|
22079
22090
|
}
|
|
22080
22091
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22081
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22092
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22082
22093
|
focused ? "\u203A " : " ",
|
|
22083
22094
|
"default:"
|
|
22084
22095
|
] }),
|
|
22085
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 :
|
|
22096
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
|
|
22086
22097
|
] });
|
|
22087
22098
|
}
|
|
22088
22099
|
function DescriptionField({
|
|
@@ -22098,15 +22109,15 @@ function DescriptionField({
|
|
|
22098
22109
|
}) {
|
|
22099
22110
|
if (compact) {
|
|
22100
22111
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22101
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22112
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22102
22113
|
focused ? "\u203A " : " ",
|
|
22103
22114
|
label
|
|
22104
22115
|
] }),
|
|
22105
|
-
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 :
|
|
22116
|
+
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
22106
22117
|
] });
|
|
22107
22118
|
}
|
|
22108
22119
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
22109
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22120
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22110
22121
|
focused ? "\u203A " : " ",
|
|
22111
22122
|
label
|
|
22112
22123
|
] }),
|
|
@@ -22170,7 +22181,7 @@ function PropRow({
|
|
|
22170
22181
|
] }),
|
|
22171
22182
|
prop.type === "token" && /* @__PURE__ */ jsx27(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx27(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
22172
22183
|
prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22173
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ?
|
|
22184
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
22174
22185
|
activeField === "values" ? "\u203A " : " ",
|
|
22175
22186
|
"values:"
|
|
22176
22187
|
] }),
|
|
@@ -22191,27 +22202,27 @@ function PropRow({
|
|
|
22191
22202
|
}
|
|
22192
22203
|
),
|
|
22193
22204
|
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22194
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ?
|
|
22205
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
22195
22206
|
activeField === "allowed" ? "\u203A " : " ",
|
|
22196
22207
|
"allowed:"
|
|
22197
22208
|
] }),
|
|
22198
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor:
|
|
22209
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx27(Text23, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx27(
|
|
22199
22210
|
Text23,
|
|
22200
22211
|
{
|
|
22201
|
-
color: activeField !== "allowed" && prop.allowed.length === 0 ?
|
|
22212
|
+
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
22202
22213
|
wrap: "wrap",
|
|
22203
22214
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
22204
22215
|
}
|
|
22205
22216
|
)
|
|
22206
22217
|
] }),
|
|
22207
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
22218
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: (() => {
|
|
22208
22219
|
const max = Math.max(8, width - 8);
|
|
22209
22220
|
const text = `~ ${rationale}`;
|
|
22210
22221
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22211
22222
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22212
22223
|
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
|
|
22213
22224
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22214
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22225
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "values:" }),
|
|
22215
22226
|
activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22216
22227
|
] }),
|
|
22217
22228
|
/* @__PURE__ */ jsx27(
|
|
@@ -22272,7 +22283,7 @@ function SlotRow({
|
|
|
22272
22283
|
/* @__PURE__ */ jsxs22(
|
|
22273
22284
|
Text23,
|
|
22274
22285
|
{
|
|
22275
|
-
color: activeField === "allowedComponents" ?
|
|
22286
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
22276
22287
|
bold: activeField === "allowedComponents",
|
|
22277
22288
|
children: [
|
|
22278
22289
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22280,14 +22291,14 @@ function SlotRow({
|
|
|
22280
22291
|
]
|
|
22281
22292
|
}
|
|
22282
22293
|
),
|
|
22283
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22294
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
22284
22295
|
] }),
|
|
22285
22296
|
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22286
22297
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22287
22298
|
/* @__PURE__ */ jsxs22(
|
|
22288
22299
|
Text23,
|
|
22289
22300
|
{
|
|
22290
|
-
color: activeField === "allowedComponents" ?
|
|
22301
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
22291
22302
|
bold: activeField === "allowedComponents",
|
|
22292
22303
|
children: [
|
|
22293
22304
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22295,7 +22306,7 @@ function SlotRow({
|
|
|
22295
22306
|
]
|
|
22296
22307
|
}
|
|
22297
22308
|
),
|
|
22298
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color:
|
|
22309
|
+
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: slot.allowedComponents.length > 0 ? " [a] add [e] edit [r] remove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22299
22310
|
] }),
|
|
22300
22311
|
/* @__PURE__ */ jsx27(
|
|
22301
22312
|
EditableValueList,
|
|
@@ -22311,21 +22322,21 @@ function SlotRow({
|
|
|
22311
22322
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
22312
22323
|
}
|
|
22313
22324
|
),
|
|
22314
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22325
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
22315
22326
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22316
22327
|
if (filtered.length === 0) {
|
|
22317
|
-
return /* @__PURE__ */ jsx27(Text23, { color:
|
|
22328
|
+
return /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
22318
22329
|
}
|
|
22319
22330
|
const cursor = pickerCursor % filtered.length;
|
|
22320
22331
|
const MAX_VISIBLE = 5;
|
|
22321
22332
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
22322
22333
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22323
22334
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22324
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22335
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22325
22336
|
slice.map((name, i) => {
|
|
22326
22337
|
const absIdx = start + i;
|
|
22327
22338
|
const isCursor = absIdx === cursor;
|
|
22328
|
-
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ?
|
|
22339
|
+
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
22329
22340
|
})
|
|
22330
22341
|
] });
|
|
22331
22342
|
})() })
|
|
@@ -23154,18 +23165,18 @@ function FieldEditor({
|
|
|
23154
23165
|
});
|
|
23155
23166
|
const innerWidth = Math.max(1, width - 2);
|
|
23156
23167
|
if (parseErr) {
|
|
23157
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
23158
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23159
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23160
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23168
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
23169
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
23170
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: parseErr }),
|
|
23171
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
23161
23172
|
] });
|
|
23162
23173
|
}
|
|
23163
23174
|
if (props.length === 0 && slots.length === 0) {
|
|
23164
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
23165
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23166
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23167
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23168
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23175
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
23176
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
23177
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
23178
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
23179
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
23169
23180
|
] });
|
|
23170
23181
|
}
|
|
23171
23182
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -23294,7 +23305,7 @@ function FieldEditor({
|
|
|
23294
23305
|
const renderRow = (row, index) => {
|
|
23295
23306
|
const key = rowKey(row, index);
|
|
23296
23307
|
if (row.kind === "header") {
|
|
23297
|
-
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23308
|
+
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
23298
23309
|
}
|
|
23299
23310
|
if (row.kind === "component-description") {
|
|
23300
23311
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -23376,9 +23387,9 @@ function FieldEditor({
|
|
|
23376
23387
|
...fixedHeight ? { height } : { minHeight: height },
|
|
23377
23388
|
clipOverflow: fixedHeight,
|
|
23378
23389
|
borderStyle: "single",
|
|
23379
|
-
borderColor: hasEmptyProperties ?
|
|
23390
|
+
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.accent : PALETTE.border,
|
|
23380
23391
|
children: [
|
|
23381
|
-
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23392
|
+
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
23382
23393
|
header,
|
|
23383
23394
|
/* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
|
|
23384
23395
|
PropRow,
|
|
@@ -23429,7 +23440,7 @@ function FieldEditor({
|
|
|
23429
23440
|
`visible-${key}`
|
|
23430
23441
|
);
|
|
23431
23442
|
}) }),
|
|
23432
|
-
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23443
|
+
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
23433
23444
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
23434
23445
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
23435
23446
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -23439,20 +23450,20 @@ function FieldEditor({
|
|
|
23439
23450
|
const headerPath = path5 ?? "<unknown source path>";
|
|
23440
23451
|
if (!start || !end2 || !src) {
|
|
23441
23452
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23442
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23443
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23453
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
23454
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
23444
23455
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
|
|
23445
23456
|
] });
|
|
23446
23457
|
}
|
|
23447
23458
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
23448
23459
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23449
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23450
|
-
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color:
|
|
23460
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
23461
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
23451
23462
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
|
|
23452
23463
|
] });
|
|
23453
23464
|
})(),
|
|
23454
|
-
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
23455
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23465
|
+
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
23466
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
23456
23467
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23457
23468
|
/* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
|
|
23458
23469
|
/* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
|
|
@@ -23477,10 +23488,10 @@ function FieldEditor({
|
|
|
23477
23488
|
/* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
23478
23489
|
/* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
|
|
23479
23490
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23480
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23491
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
23481
23492
|
] }),
|
|
23482
|
-
validationError && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23483
|
-
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
23493
|
+
validationError && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
23494
|
+
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: modeLabel }) })
|
|
23484
23495
|
]
|
|
23485
23496
|
}
|
|
23486
23497
|
);
|
|
@@ -23532,16 +23543,16 @@ function RationaleLine({ line, active }) {
|
|
|
23532
23543
|
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
|
|
23533
23544
|
}
|
|
23534
23545
|
if (line.kind === "heading") {
|
|
23535
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ?
|
|
23546
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
23536
23547
|
}
|
|
23537
23548
|
if (line.kind === "label") {
|
|
23538
23549
|
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
23539
23550
|
line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
|
|
23540
|
-
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color :
|
|
23541
|
-
line.suffix && /* @__PURE__ */ jsx28(Text24, { color:
|
|
23551
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
23552
|
+
line.suffix && /* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: line.suffix })
|
|
23542
23553
|
] });
|
|
23543
23554
|
}
|
|
23544
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ?
|
|
23555
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
23545
23556
|
}
|
|
23546
23557
|
|
|
23547
23558
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
@@ -23620,9 +23631,9 @@ function ComponentRationalePanel({
|
|
|
23620
23631
|
width,
|
|
23621
23632
|
height: height + 2,
|
|
23622
23633
|
borderStyle: "single",
|
|
23623
|
-
borderColor: active ?
|
|
23634
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23624
23635
|
children: [
|
|
23625
|
-
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 :
|
|
23636
|
+
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
23626
23637
|
visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
|
|
23627
23638
|
/* @__PURE__ */ jsx29(Box23, { children: overflowed ? /* @__PURE__ */ jsx29(Text25, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx29(Text25, { children: "[I/Esc] close" }) })
|
|
23628
23639
|
]
|
|
@@ -23637,7 +23648,7 @@ import { Box as Box25 } from "ink";
|
|
|
23637
23648
|
import { Text as Text26 } from "ink";
|
|
23638
23649
|
import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
|
|
23639
23650
|
function HighlightedLine({ parts }) {
|
|
23640
|
-
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ?
|
|
23651
|
+
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
|
|
23641
23652
|
}
|
|
23642
23653
|
|
|
23643
23654
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
@@ -23657,10 +23668,10 @@ function ScrollablePanel({
|
|
|
23657
23668
|
const overflowed = totalLines > height;
|
|
23658
23669
|
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
23659
23670
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
23660
|
-
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 :
|
|
23671
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
23661
23672
|
overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
23662
23673
|
/* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
|
|
23663
|
-
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 :
|
|
23674
|
+
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
23664
23675
|
] })
|
|
23665
23676
|
] }),
|
|
23666
23677
|
children
|
|
@@ -23746,7 +23757,7 @@ function renderRationaleLines(rows, innerWidth) {
|
|
|
23746
23757
|
out.push({
|
|
23747
23758
|
kind: "label",
|
|
23748
23759
|
text: row.name,
|
|
23749
|
-
color:
|
|
23760
|
+
color: PALETTE.accent,
|
|
23750
23761
|
suffix: row.kind === "slot" ? " (slot)" : void 0
|
|
23751
23762
|
});
|
|
23752
23763
|
for (const line of wrapText(row.rationale, innerWidth)) {
|
|
@@ -23782,7 +23793,7 @@ function RationalePanel({
|
|
|
23782
23793
|
totalLines,
|
|
23783
23794
|
visibleStart,
|
|
23784
23795
|
visibleEnd,
|
|
23785
|
-
borderColor: active ?
|
|
23796
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23786
23797
|
children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
|
|
23787
23798
|
}
|
|
23788
23799
|
);
|
|
@@ -23817,21 +23828,29 @@ function TokenReviewPanel({
|
|
|
23817
23828
|
width,
|
|
23818
23829
|
height: height + 2,
|
|
23819
23830
|
borderStyle: "single",
|
|
23820
|
-
borderColor: active ?
|
|
23831
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23821
23832
|
children: [
|
|
23822
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23823
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23833
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
23834
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
23824
23835
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23825
|
-
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
23836
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
23826
23837
|
visiblePaths.map((path5, i) => {
|
|
23827
23838
|
const pathIndex = scrollStart + i;
|
|
23828
23839
|
const checked = editSelection.has(path5);
|
|
23829
23840
|
const focused = pathIndex === editCursor;
|
|
23830
|
-
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
23841
|
+
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
23842
|
+
Text28,
|
|
23843
|
+
{
|
|
23844
|
+
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
23845
|
+
bold: focused,
|
|
23846
|
+
wrap: "truncate",
|
|
23847
|
+
children: ` [${checked ? "x" : " "}] ${path5}`
|
|
23848
|
+
}
|
|
23849
|
+
) }, path5);
|
|
23831
23850
|
}),
|
|
23832
23851
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23833
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23834
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23852
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
23853
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
23835
23854
|
]
|
|
23836
23855
|
}
|
|
23837
23856
|
);
|
|
@@ -23843,16 +23862,16 @@ function TokenReviewPanel({
|
|
|
23843
23862
|
width,
|
|
23844
23863
|
height: height + 2,
|
|
23845
23864
|
borderStyle: "single",
|
|
23846
|
-
borderColor: active ?
|
|
23865
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23847
23866
|
children: [
|
|
23848
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23849
|
-
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
23867
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
23868
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
23850
23869
|
suggestions.map((s, i) => {
|
|
23851
23870
|
const focused = i === selectedRow;
|
|
23852
23871
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
23853
|
-
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ?
|
|
23854
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23855
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23872
|
+
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
|
|
23873
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
23874
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
23856
23875
|
] }, s.propName);
|
|
23857
23876
|
}),
|
|
23858
23877
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
@@ -23937,9 +23956,9 @@ function ReviewDetailsPanel({
|
|
|
23937
23956
|
const sourceLineCount = Math.max(1, height - 4);
|
|
23938
23957
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
23939
23958
|
return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
23940
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
23941
|
-
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color:
|
|
23942
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
23959
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
23960
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, children: "(no source captured)" }),
|
|
23961
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
23943
23962
|
] });
|
|
23944
23963
|
}
|
|
23945
23964
|
if (panelOpen === "token-review") {
|
|
@@ -24089,17 +24108,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
24089
24108
|
hidden
|
|
24090
24109
|
}) {
|
|
24091
24110
|
if (hidden || count === 0) return null;
|
|
24092
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24111
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
24093
24112
|
}
|
|
24094
24113
|
function ReviewNoSelection() {
|
|
24095
|
-
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
24114
|
+
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, children: "No component selected" }) });
|
|
24096
24115
|
}
|
|
24097
24116
|
function ReviewFinalizeError({
|
|
24098
24117
|
message,
|
|
24099
24118
|
hidden
|
|
24100
24119
|
}) {
|
|
24101
24120
|
if (hidden || !message) return null;
|
|
24102
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24121
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
24103
24122
|
}
|
|
24104
24123
|
function ReviewPanelFooter({
|
|
24105
24124
|
reviewEditor,
|
|
@@ -24123,7 +24142,7 @@ function ReviewComponentTitle({
|
|
|
24123
24142
|
return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
24124
24143
|
/* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
24125
24144
|
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
24126
|
-
/* @__PURE__ */ jsxs28(Text30, { color:
|
|
24145
|
+
/* @__PURE__ */ jsxs28(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
24127
24146
|
propCount,
|
|
24128
24147
|
" prop",
|
|
24129
24148
|
propCount !== 1 ? "s" : "",
|
|
@@ -24179,8 +24198,8 @@ function ReviewComponentPanel({
|
|
|
24179
24198
|
)
|
|
24180
24199
|
}
|
|
24181
24200
|
) }),
|
|
24182
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ?
|
|
24183
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
24201
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
24202
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx37(
|
|
24184
24203
|
ReviewPanelFooter,
|
|
24185
24204
|
{
|
|
24186
24205
|
reviewEditor,
|
|
@@ -24208,11 +24227,11 @@ function countReviewStatuses(entries) {
|
|
|
24208
24227
|
);
|
|
24209
24228
|
}
|
|
24210
24229
|
function ReviewLoadingState() {
|
|
24211
|
-
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color:
|
|
24230
|
+
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
24212
24231
|
}
|
|
24213
24232
|
function ReviewLoadError({ message }) {
|
|
24214
24233
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
24215
|
-
/* @__PURE__ */ jsx38(Text31, { color:
|
|
24234
|
+
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.error, children: message }),
|
|
24216
24235
|
/* @__PURE__ */ jsx38(Text31, { children: " " }),
|
|
24217
24236
|
/* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
|
|
24218
24237
|
] });
|
|
@@ -24448,41 +24467,41 @@ function FinalizeDialog({
|
|
|
24448
24467
|
/* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
24449
24468
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24450
24469
|
/* @__PURE__ */ jsxs30(Text32, { children: [
|
|
24451
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24470
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.success, children: [
|
|
24452
24471
|
accepted,
|
|
24453
24472
|
" accepted"
|
|
24454
24473
|
] }),
|
|
24455
24474
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24456
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24475
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.error, children: [
|
|
24457
24476
|
rejected,
|
|
24458
24477
|
" rejected"
|
|
24459
24478
|
] }),
|
|
24460
24479
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24461
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24480
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.muted, children: [
|
|
24462
24481
|
needsReview,
|
|
24463
24482
|
" unresolved"
|
|
24464
24483
|
] })
|
|
24465
24484
|
] }),
|
|
24466
24485
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24467
24486
|
noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24468
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24469
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24487
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
24488
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
24470
24489
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24471
24490
|
] }),
|
|
24472
24491
|
!allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24473
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24474
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24492
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
24493
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
24475
24494
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24476
24495
|
] }),
|
|
24477
24496
|
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
|
|
24478
|
-
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color:
|
|
24497
|
+
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24479
24498
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24480
24499
|
] }),
|
|
24481
24500
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24482
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24483
|
-
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color:
|
|
24484
|
-
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color:
|
|
24485
|
-
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color:
|
|
24501
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
24502
|
+
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2191 more above" }),
|
|
24503
|
+
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
24504
|
+
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2193 more below" }),
|
|
24486
24505
|
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
|
|
24487
24506
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24488
24507
|
] }),
|
|
@@ -24976,8 +24995,8 @@ function ReviewStepDialogs({
|
|
|
24976
24995
|
}
|
|
24977
24996
|
function ReviewReloadDialog({ open }) {
|
|
24978
24997
|
if (!open) return null;
|
|
24979
|
-
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
24980
|
-
/* @__PURE__ */ jsx41(Text34, { bold: true, color:
|
|
24998
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
24999
|
+
/* @__PURE__ */ jsx41(Text34, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
24981
25000
|
/* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
|
|
24982
25001
|
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
24983
25002
|
/* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
|
|
@@ -25363,19 +25382,19 @@ function LivePreviewSummary({
|
|
|
25363
25382
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25364
25383
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25365
25384
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25366
|
-
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
25367
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
25385
|
+
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
25386
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
25368
25387
|
if (!hasCounts) return null;
|
|
25369
25388
|
return /* @__PURE__ */ jsxs33(Box32, { children: [
|
|
25370
25389
|
/* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
|
|
25371
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25390
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
25372
25391
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25373
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25392
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
25374
25393
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25375
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25394
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `${counts.removed} removed` }),
|
|
25376
25395
|
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
|
|
25377
25396
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25378
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25397
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
25379
25398
|
] });
|
|
25380
25399
|
}
|
|
25381
25400
|
|
|
@@ -25421,10 +25440,10 @@ function CyclePathLine({
|
|
|
25421
25440
|
highlightComponents = false,
|
|
25422
25441
|
highlightLine = false
|
|
25423
25442
|
}) {
|
|
25424
|
-
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ?
|
|
25443
|
+
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
25425
25444
|
prefix,
|
|
25426
25445
|
segments.map(
|
|
25427
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
25446
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.accent, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: segment.text }, index) : /* @__PURE__ */ jsx43(Text36, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
|
|
25428
25447
|
)
|
|
25429
25448
|
] });
|
|
25430
25449
|
}
|
|
@@ -25436,9 +25455,9 @@ function CycleDetailPanel({
|
|
|
25436
25455
|
height
|
|
25437
25456
|
}) {
|
|
25438
25457
|
const lines = [
|
|
25439
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25440
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25441
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25458
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
25459
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
25460
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
25442
25461
|
/* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
|
|
25443
25462
|
];
|
|
25444
25463
|
cycles.forEach((cycle, index) => {
|
|
@@ -25450,7 +25469,7 @@ function CycleDetailPanel({
|
|
|
25450
25469
|
);
|
|
25451
25470
|
if (cycle.suggestedBreak) {
|
|
25452
25471
|
lines.push(
|
|
25453
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25472
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
25454
25473
|
);
|
|
25455
25474
|
}
|
|
25456
25475
|
lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
|
|
@@ -25458,9 +25477,9 @@ function CycleDetailPanel({
|
|
|
25458
25477
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
25459
25478
|
const viewportHeight = Math.max(1, height - 3);
|
|
25460
25479
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
25461
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25480
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
25462
25481
|
visible,
|
|
25463
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25482
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: footer })
|
|
25464
25483
|
] });
|
|
25465
25484
|
}
|
|
25466
25485
|
function BreakCyclePanel({
|
|
@@ -25471,14 +25490,14 @@ function BreakCyclePanel({
|
|
|
25471
25490
|
width,
|
|
25472
25491
|
height
|
|
25473
25492
|
}) {
|
|
25474
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25475
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25493
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
25494
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
25476
25495
|
cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
25477
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25496
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
25478
25497
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
25479
|
-
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
25498
|
+
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "remove slot edge:" }),
|
|
25480
25499
|
edges.map((edge, index) => /* @__PURE__ */ jsx43(Text36, { inverse: index === cursor, children: `${index === cursor ? figures7.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `${edge.fromComponent}-${edge.slotName}-${edge.toComponent}`)),
|
|
25481
|
-
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25500
|
+
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx43(Text36, { children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
|
|
25482
25501
|
] });
|
|
25483
25502
|
}
|
|
25484
25503
|
var HELP_SECTIONS2 = [
|
|
@@ -25584,7 +25603,7 @@ function deriveBreakingChanges(response) {
|
|
|
25584
25603
|
}
|
|
25585
25604
|
function GenerateReviewStep(props) {
|
|
25586
25605
|
if (!props.extractSessionId) {
|
|
25587
|
-
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color:
|
|
25606
|
+
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
25588
25607
|
}
|
|
25589
25608
|
return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
25590
25609
|
}
|
|
@@ -26501,8 +26520,8 @@ function GenerateReviewStepView({
|
|
|
26501
26520
|
}
|
|
26502
26521
|
),
|
|
26503
26522
|
/* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26504
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26505
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
26523
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26524
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26506
26525
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
26507
26526
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
26508
26527
|
removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
|
|
@@ -26511,7 +26530,7 @@ function GenerateReviewStepView({
|
|
|
26511
26530
|
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
|
|
26512
26531
|
Text36,
|
|
26513
26532
|
{
|
|
26514
|
-
color:
|
|
26533
|
+
color: PALETTE.warning,
|
|
26515
26534
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
26516
26535
|
}
|
|
26517
26536
|
) }),
|
|
@@ -26519,10 +26538,10 @@ function GenerateReviewStepView({
|
|
|
26519
26538
|
const row = breakingRows[breakingCursor];
|
|
26520
26539
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26521
26540
|
if (!comp) return null;
|
|
26522
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26523
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
26524
|
-
comp.impact && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26525
|
-
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
26541
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26542
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
26543
|
+
comp.impact && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
26544
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx43(Text36, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
26526
26545
|
/* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
|
|
26527
26546
|
] });
|
|
26528
26547
|
})(),
|
|
@@ -26545,11 +26564,11 @@ function GenerateReviewStepView({
|
|
|
26545
26564
|
const participantSet = cycleView.structural;
|
|
26546
26565
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26547
26566
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26548
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor:
|
|
26549
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26550
|
-
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26551
|
-
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26552
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26567
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26568
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
26569
|
+
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
26570
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
26571
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
26553
26572
|
] });
|
|
26554
26573
|
})(),
|
|
26555
26574
|
/* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
@@ -26665,7 +26684,7 @@ function GenerateReviewStepView({
|
|
|
26665
26684
|
) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
|
|
26666
26685
|
] }),
|
|
26667
26686
|
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
|
|
26668
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26687
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26669
26688
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
26670
26689
|
return /* @__PURE__ */ jsx43(
|
|
26671
26690
|
CyclePathLine,
|
|
@@ -26678,7 +26697,7 @@ function GenerateReviewStepView({
|
|
|
26678
26697
|
`cyc-banner-${idx}`
|
|
26679
26698
|
);
|
|
26680
26699
|
}),
|
|
26681
|
-
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26700
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
26682
26701
|
/* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
|
|
26683
26702
|
] }),
|
|
26684
26703
|
/* @__PURE__ */ jsx43(
|
|
@@ -26701,8 +26720,8 @@ import { Box as Box34, Text as Text37 } from "ink";
|
|
|
26701
26720
|
|
|
26702
26721
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
|
|
26703
26722
|
import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
|
|
26704
|
-
var
|
|
26705
|
-
...
|
|
26723
|
+
var PALETTE3 = {
|
|
26724
|
+
...PALETTE,
|
|
26706
26725
|
link: "#58A6FF"
|
|
26707
26726
|
};
|
|
26708
26727
|
var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
@@ -26710,7 +26729,7 @@ var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
|
26710
26729
|
ProgressBar: {
|
|
26711
26730
|
styles: {
|
|
26712
26731
|
completed: () => ({
|
|
26713
|
-
color:
|
|
26732
|
+
color: PALETTE3.accent
|
|
26714
26733
|
})
|
|
26715
26734
|
}
|
|
26716
26735
|
}
|
|
@@ -26721,13 +26740,13 @@ var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
|
26721
26740
|
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
26722
26741
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
26723
26742
|
if (!generatePromptPath) return null;
|
|
26724
|
-
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26725
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26726
|
-
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color:
|
|
26743
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
26744
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE3.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
26745
|
+
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color: PALETTE3.warning, children: [
|
|
26727
26746
|
"components: ",
|
|
26728
26747
|
generatePromptPath
|
|
26729
26748
|
] }) : null,
|
|
26730
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26749
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE3.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
26731
26750
|
] });
|
|
26732
26751
|
}
|
|
26733
26752
|
|
|
@@ -26752,10 +26771,10 @@ import { Box as Box35, Text as Text38 } from "ink";
|
|
|
26752
26771
|
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
26753
26772
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
26754
26773
|
return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
|
|
26755
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26774
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "Space:" }),
|
|
26756
26775
|
/* @__PURE__ */ jsx45(Text38, { children: spaceId }),
|
|
26757
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26758
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26776
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "/" }),
|
|
26777
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "Environment:" }),
|
|
26759
26778
|
/* @__PURE__ */ jsx45(Text38, { children: environmentId })
|
|
26760
26779
|
] });
|
|
26761
26780
|
}
|
|
@@ -26767,13 +26786,13 @@ function EntityRows({ entity, label }) {
|
|
|
26767
26786
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
26768
26787
|
return /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
26769
26788
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
|
|
26770
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26789
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.success, children: "\u2713" }),
|
|
26771
26790
|
" ",
|
|
26772
26791
|
plural3(entity[action]),
|
|
26773
26792
|
" ",
|
|
26774
26793
|
action
|
|
26775
26794
|
] }, action)),
|
|
26776
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26795
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
26777
26796
|
"\u2717 ",
|
|
26778
26797
|
plural3(entity.failed),
|
|
26779
26798
|
" failed \u2014 check logs above"
|
|
@@ -26782,8 +26801,8 @@ function EntityRows({ entity, label }) {
|
|
|
26782
26801
|
}
|
|
26783
26802
|
function LinkRow({ title, url }) {
|
|
26784
26803
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26785
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26786
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26804
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.muted, children: title }),
|
|
26805
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.link, children: url })
|
|
26787
26806
|
] });
|
|
26788
26807
|
}
|
|
26789
26808
|
function DoneStep({
|
|
@@ -26806,17 +26825,17 @@ function DoneStep({
|
|
|
26806
26825
|
const success = totalFailed === 0;
|
|
26807
26826
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
26808
26827
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
26809
|
-
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26810
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color:
|
|
26828
|
+
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.success, children: "Done!" }) : /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.warning, children: "\u26A0 Finished with errors" }),
|
|
26829
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE3.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26811
26830
|
/* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
26812
26831
|
/* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
26813
|
-
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26832
|
+
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.muted, children: [
|
|
26814
26833
|
"Push result: ",
|
|
26815
26834
|
summary.succeeded,
|
|
26816
26835
|
"/",
|
|
26817
26836
|
summary.total,
|
|
26818
26837
|
" succeeded",
|
|
26819
|
-
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26838
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
26820
26839
|
", ",
|
|
26821
26840
|
summary.failed,
|
|
26822
26841
|
" failed"
|
|
@@ -26824,8 +26843,8 @@ function DoneStep({
|
|
|
26824
26843
|
] }) })
|
|
26825
26844
|
] }),
|
|
26826
26845
|
failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26827
|
-
/* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26828
|
-
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26846
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.error, children: "Failure details" }),
|
|
26847
|
+
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
26829
26848
|
failure.entityType,
|
|
26830
26849
|
" ",
|
|
26831
26850
|
failure.entityId,
|
|
@@ -26835,7 +26854,7 @@ function DoneStep({
|
|
|
26835
26854
|
] }),
|
|
26836
26855
|
/* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
|
|
26837
26856
|
success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
|
|
26838
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26857
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.success, children: "Your design system is now in Contentful Experiences." }),
|
|
26839
26858
|
/* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
26840
26859
|
/* @__PURE__ */ jsx46(
|
|
26841
26860
|
LinkRow,
|
|
@@ -26949,7 +26968,7 @@ function PathPrompt({
|
|
|
26949
26968
|
label,
|
|
26950
26969
|
":"
|
|
26951
26970
|
] }),
|
|
26952
|
-
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ?
|
|
26971
|
+
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE3.muted : void 0, children: shown }),
|
|
26953
26972
|
/* @__PURE__ */ jsx47(Text40, { children: cursor })
|
|
26954
26973
|
] }),
|
|
26955
26974
|
/* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
|
|
@@ -27015,12 +27034,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27015
27034
|
/* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
27016
27035
|
/* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
27017
27036
|
operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27018
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27037
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE3.muted, children: "Operation:" }),
|
|
27019
27038
|
/* @__PURE__ */ jsx50(Text42, { children: operationId })
|
|
27020
27039
|
] }),
|
|
27021
27040
|
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
|
|
27022
27041
|
/* @__PURE__ */ jsx50(Box39, { width: 40, children: /* @__PURE__ */ jsx50(ThemeProvider2, { theme: INK_UI_THEME, children: /* @__PURE__ */ jsx50(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
27023
|
-
/* @__PURE__ */ jsxs40(Text42, { color:
|
|
27042
|
+
/* @__PURE__ */ jsxs40(Text42, { color: PALETTE3.muted, children: [
|
|
27024
27043
|
progress.processed,
|
|
27025
27044
|
"/",
|
|
27026
27045
|
progress.total,
|
|
@@ -27028,10 +27047,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27028
27047
|
] })
|
|
27029
27048
|
] }) }),
|
|
27030
27049
|
showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27031
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27050
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE3.muted, children: "Now processing:" }),
|
|
27032
27051
|
/* @__PURE__ */ jsx50(Text42, { children: showCurrent })
|
|
27033
27052
|
] }),
|
|
27034
|
-
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color:
|
|
27053
|
+
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE3.muted, children: [
|
|
27035
27054
|
"Elapsed: ",
|
|
27036
27055
|
elapsed
|
|
27037
27056
|
] }) })
|
|
@@ -27221,25 +27240,25 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27221
27240
|
if (components.new.length > 0) {
|
|
27222
27241
|
lines.push({
|
|
27223
27242
|
key: "summary-components-new",
|
|
27224
|
-
color:
|
|
27243
|
+
color: PALETTE3.success,
|
|
27225
27244
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
27226
27245
|
});
|
|
27227
27246
|
for (const [index, item] of components.new.entries()) {
|
|
27228
27247
|
const name = item.key ?? item.$name ?? "unknown";
|
|
27229
|
-
lines.push({ key: `summary-components-new-${index}`, color:
|
|
27248
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
27230
27249
|
}
|
|
27231
27250
|
}
|
|
27232
27251
|
if (components.changed.length > 0) {
|
|
27233
27252
|
lines.push({
|
|
27234
27253
|
key: "summary-components-changed",
|
|
27235
|
-
color:
|
|
27254
|
+
color: PALETTE3.warning,
|
|
27236
27255
|
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
27237
27256
|
});
|
|
27238
27257
|
for (const [index, item] of components.changed.entries()) {
|
|
27239
27258
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
27240
27259
|
lines.push({
|
|
27241
27260
|
key: `summary-components-changed-${index}`,
|
|
27242
|
-
color: isBreaking ?
|
|
27261
|
+
color: isBreaking ? PALETTE3.error : PALETTE3.warning,
|
|
27243
27262
|
text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
|
|
27244
27263
|
});
|
|
27245
27264
|
}
|
|
@@ -27247,11 +27266,11 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27247
27266
|
if (components.removed.length > 0) {
|
|
27248
27267
|
lines.push({
|
|
27249
27268
|
key: "summary-components-removed",
|
|
27250
|
-
color:
|
|
27269
|
+
color: PALETTE3.warning,
|
|
27251
27270
|
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
27252
27271
|
});
|
|
27253
27272
|
for (const [index, item] of components.removed.entries()) {
|
|
27254
|
-
lines.push({ key: `summary-components-removed-${index}`, color:
|
|
27273
|
+
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE3.warning, text: ` \u2298 ${item.name}` });
|
|
27255
27274
|
}
|
|
27256
27275
|
}
|
|
27257
27276
|
if (components.unchanged.length > 0) {
|
|
@@ -27264,21 +27283,21 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27264
27283
|
if (tokens.new.length > 0) {
|
|
27265
27284
|
lines.push({
|
|
27266
27285
|
key: "summary-tokens-new",
|
|
27267
|
-
color:
|
|
27286
|
+
color: PALETTE3.success,
|
|
27268
27287
|
text: ` \uFF0B ${tokens.new.length} design tokens will be created`
|
|
27269
27288
|
});
|
|
27270
27289
|
}
|
|
27271
27290
|
if (tokens.changed.length > 0) {
|
|
27272
27291
|
lines.push({
|
|
27273
27292
|
key: "summary-tokens-changed",
|
|
27274
|
-
color:
|
|
27293
|
+
color: PALETTE3.warning,
|
|
27275
27294
|
text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
|
|
27276
27295
|
});
|
|
27277
27296
|
}
|
|
27278
27297
|
if (tokens.removed.length > 0) {
|
|
27279
27298
|
lines.push({
|
|
27280
27299
|
key: "summary-tokens-removed",
|
|
27281
|
-
color:
|
|
27300
|
+
color: PALETTE3.warning,
|
|
27282
27301
|
text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
|
|
27283
27302
|
});
|
|
27284
27303
|
}
|
|
@@ -27322,12 +27341,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
27322
27341
|
function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
|
|
27323
27342
|
lines.push({
|
|
27324
27343
|
key: `${keyPrefix}-h-${name}`,
|
|
27325
|
-
color:
|
|
27344
|
+
color: PALETTE3.warning,
|
|
27326
27345
|
text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
27327
27346
|
});
|
|
27328
27347
|
if (changeClassification?.classification !== "breaking") return;
|
|
27329
27348
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
27330
|
-
lines.push({ key: `${keyPrefix}-b-${name}`, color:
|
|
27349
|
+
lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE3.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
27331
27350
|
}
|
|
27332
27351
|
function buildPreviewDiffLines(preview) {
|
|
27333
27352
|
const lines = [];
|
|
@@ -27335,12 +27354,12 @@ function buildPreviewDiffLines(preview) {
|
|
|
27335
27354
|
for (const item of components.new) {
|
|
27336
27355
|
const raw = item;
|
|
27337
27356
|
const name = raw.key ?? raw.$name ?? "unknown";
|
|
27338
|
-
lines.push({ key: `comp-new-${name}`, color:
|
|
27357
|
+
lines.push({ key: `comp-new-${name}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
27339
27358
|
const slots = raw.$slots ?? {};
|
|
27340
27359
|
for (const slotName of Object.keys(slots).sort()) {
|
|
27341
27360
|
lines.push({
|
|
27342
27361
|
key: `comp-new-${name}-slot-${slotName}`,
|
|
27343
|
-
color:
|
|
27362
|
+
color: PALETTE3.success,
|
|
27344
27363
|
text: ` slot: ${slotName}`
|
|
27345
27364
|
});
|
|
27346
27365
|
const allowed = slots[slotName]?.["$allowedComponents"];
|
|
@@ -27348,14 +27367,14 @@ function buildPreviewDiffLines(preview) {
|
|
|
27348
27367
|
const names = allowed.filter((n) => typeof n === "string");
|
|
27349
27368
|
lines.push({
|
|
27350
27369
|
key: `comp-new-${name}-slot-${slotName}-allow`,
|
|
27351
|
-
color:
|
|
27370
|
+
color: PALETTE3.success,
|
|
27352
27371
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
27353
27372
|
});
|
|
27354
27373
|
}
|
|
27355
27374
|
}
|
|
27356
27375
|
}
|
|
27357
27376
|
for (const item of components.removed) {
|
|
27358
|
-
lines.push({ key: `comp-rm-${item.name}`, color:
|
|
27377
|
+
lines.push({ key: `comp-rm-${item.name}`, color: PALETTE3.error, text: ` - ${item.name}` });
|
|
27359
27378
|
}
|
|
27360
27379
|
for (const item of components.changed) {
|
|
27361
27380
|
appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
|
|
@@ -27386,10 +27405,10 @@ function buildPreviewDiffLines(preview) {
|
|
|
27386
27405
|
for (const item of tokens.new) {
|
|
27387
27406
|
const raw = item;
|
|
27388
27407
|
const name = raw.name ?? raw.path ?? "unknown";
|
|
27389
|
-
lines.push({ key: `tok-new-${name}`, color:
|
|
27408
|
+
lines.push({ key: `tok-new-${name}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
27390
27409
|
}
|
|
27391
27410
|
for (const item of tokens.removed) {
|
|
27392
|
-
lines.push({ key: `tok-rm-${item.name}`, color:
|
|
27411
|
+
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE3.error, text: ` - ${item.name}` });
|
|
27393
27412
|
}
|
|
27394
27413
|
for (const item of tokens.changed) {
|
|
27395
27414
|
const tokenName = item.current.name;
|
|
@@ -27480,13 +27499,13 @@ function WizardPreviewStep({
|
|
|
27480
27499
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
27481
27500
|
focused: false,
|
|
27482
27501
|
children: [
|
|
27483
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ?
|
|
27484
|
-
/* @__PURE__ */ jsx51(Text43, { color:
|
|
27502
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ? PALETTE3.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
27503
|
+
/* @__PURE__ */ jsx51(Text43, { color: PALETTE3.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
27485
27504
|
]
|
|
27486
27505
|
}
|
|
27487
27506
|
)
|
|
27488
|
-
] }) : /* @__PURE__ */ jsx51(Text43, { color:
|
|
27489
|
-
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color:
|
|
27507
|
+
] }) : /* @__PURE__ */ jsx51(Text43, { color: PALETTE3.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
27508
|
+
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color: PALETTE3.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
27490
27509
|
/* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
|
|
27491
27510
|
/* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
|
|
27492
27511
|
/* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
|
|
@@ -28032,7 +28051,7 @@ var realSaveDeps = () => ({
|
|
|
28032
28051
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
28033
28052
|
appendRun,
|
|
28034
28053
|
buildSourceFingerprint,
|
|
28035
|
-
sleep: (ms) => new Promise((
|
|
28054
|
+
sleep: (ms) => new Promise((resolve27) => setTimeout(resolve27, ms)),
|
|
28036
28055
|
warn: (message) => process.stderr.write(message)
|
|
28037
28056
|
});
|
|
28038
28057
|
async function runPrintFiles(input, deps, onPatch) {
|
|
@@ -28422,44 +28441,12 @@ init_config();
|
|
|
28422
28441
|
init_debug_store();
|
|
28423
28442
|
init_debug_mode_store();
|
|
28424
28443
|
init_version();
|
|
28425
|
-
|
|
28426
|
-
// packages/experience-design-system-cli/src/tui/help/file-locations.ts
|
|
28427
|
-
import { join as join25, resolve as resolve27 } from "node:path";
|
|
28428
|
-
function describeFileLocations({
|
|
28429
|
-
contentfulBaseDir,
|
|
28430
|
-
debugModeEnabled,
|
|
28431
|
-
currentSessionDir: currentSessionDir2
|
|
28432
|
-
}) {
|
|
28433
|
-
if (!debugModeEnabled) {
|
|
28434
|
-
return {
|
|
28435
|
-
debugLogs: "none while Debug Mode is off",
|
|
28436
|
-
importFiles: `${join25("<project>", ".contentful")}/ (tokens.json, components.json)`
|
|
28437
|
-
};
|
|
28438
|
-
}
|
|
28439
|
-
const base = contentfulBaseDir ? resolve27(contentfulBaseDir) : "<project>";
|
|
28440
|
-
const session = currentSessionDir2 ?? join25(base, ".contentful", "<date>-session-<n>");
|
|
28441
|
-
return {
|
|
28442
|
-
debugLogs: join25(session, "debug"),
|
|
28443
|
-
importFiles: `${join25(session, "dsi-import-<n>")}/ (tokens.json, components.json)`
|
|
28444
|
-
};
|
|
28445
|
-
}
|
|
28446
|
-
|
|
28447
|
-
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
28448
28444
|
async function readHelpInfo() {
|
|
28449
|
-
const
|
|
28450
|
-
const base = settings["contentfulBaseDir"];
|
|
28451
|
-
const locations = describeFileLocations({
|
|
28452
|
-
contentfulBaseDir: typeof base === "string" ? base : "",
|
|
28453
|
-
debugModeEnabled: debugMode.enabled,
|
|
28454
|
-
currentSessionDir: currentSessionDir()
|
|
28455
|
-
});
|
|
28445
|
+
const debugMode = await readDebugModeSetting();
|
|
28456
28446
|
return {
|
|
28457
28447
|
storage: [
|
|
28458
28448
|
{ label: "Config folder", value: configRoot2() },
|
|
28459
|
-
{ label: "Settings file", value: configFilePath2() }
|
|
28460
|
-
{ label: "Agent settings", value: `${configFilePath2()} (keys: agent, agentModel, agents)` },
|
|
28461
|
-
{ label: "Debug logs", value: locations.debugLogs },
|
|
28462
|
-
{ label: "Import files", value: locations.importFiles }
|
|
28449
|
+
{ label: "Settings file", value: configFilePath2() }
|
|
28463
28450
|
],
|
|
28464
28451
|
troubleshooting: [
|
|
28465
28452
|
{ label: "CLI version", value: readPackageVersion() },
|
|
@@ -28480,7 +28467,7 @@ function Section({ title, rows }) {
|
|
|
28480
28467
|
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
28481
28468
|
/* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
|
|
28482
28469
|
rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
|
|
28483
|
-
/* @__PURE__ */ jsx53(Box42, { width:
|
|
28470
|
+
/* @__PURE__ */ jsx53(Box42, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
|
|
28484
28471
|
/* @__PURE__ */ jsx53(Text44, { children: row.value })
|
|
28485
28472
|
] }, row.label))
|
|
28486
28473
|
] });
|
|
@@ -28580,710 +28567,15 @@ function SettingsScreen({
|
|
|
28580
28567
|
}
|
|
28581
28568
|
|
|
28582
28569
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28583
|
-
import { useState as
|
|
28584
|
-
import { Box as
|
|
28585
|
-
|
|
28586
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
28587
|
-
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
28588
|
-
import { Box as Box45, Text as Text48, useInput as useInput12 } from "ink";
|
|
28589
|
-
init_debug_store();
|
|
28570
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
28571
|
+
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28572
|
+
import TextInput4 from "ink-text-input";
|
|
28590
28573
|
|
|
28591
28574
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
28592
28575
|
init_config();
|
|
28593
28576
|
var readV1Store = readSettings2;
|
|
28594
28577
|
var writeV1Store = writeSettings2;
|
|
28595
28578
|
|
|
28596
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/agent-store.ts
|
|
28597
|
-
var DEFAULT_AGENT3 = "claude";
|
|
28598
|
-
var AGENT_LABELS = {
|
|
28599
|
-
claude: "Claude Code",
|
|
28600
|
-
codex: "OpenAI Codex",
|
|
28601
|
-
opencode: "OpenCode",
|
|
28602
|
-
cursor: "Cursor",
|
|
28603
|
-
copilot: "GitHub Copilot"
|
|
28604
|
-
};
|
|
28605
|
-
var AGENT_HINTS = {
|
|
28606
|
-
claude: "claude",
|
|
28607
|
-
codex: "codex",
|
|
28608
|
-
opencode: "opencode",
|
|
28609
|
-
cursor: "cursor-agent",
|
|
28610
|
-
copilot: "copilot"
|
|
28611
|
-
};
|
|
28612
|
-
var asString = (value) => typeof value === "string" ? value : "";
|
|
28613
|
-
function emptyAgents() {
|
|
28614
|
-
return Object.fromEntries(AGENT_NAMES.map((name) => [name, { model: "", binary: "" }]));
|
|
28615
|
-
}
|
|
28616
|
-
async function readAgentConfig() {
|
|
28617
|
-
const store = await readV1Store();
|
|
28618
|
-
const stored = asString(store["agent"]);
|
|
28619
|
-
const defaultAgent = isAgentName(stored) ? stored : DEFAULT_AGENT3;
|
|
28620
|
-
const agents = emptyAgents();
|
|
28621
|
-
const saved = store["agents"];
|
|
28622
|
-
if (saved && typeof saved === "object") {
|
|
28623
|
-
for (const name of AGENT_NAMES) {
|
|
28624
|
-
const entry = saved[name];
|
|
28625
|
-
if (entry && typeof entry === "object") {
|
|
28626
|
-
const fields = entry;
|
|
28627
|
-
agents[name] = { model: asString(fields["model"]), binary: asString(fields["binary"]) };
|
|
28628
|
-
}
|
|
28629
|
-
}
|
|
28630
|
-
}
|
|
28631
|
-
const legacyModel = asString(store["agentModel"]);
|
|
28632
|
-
if (legacyModel && !agents[defaultAgent].model)
|
|
28633
|
-
agents[defaultAgent] = { ...agents[defaultAgent], model: legacyModel };
|
|
28634
|
-
return { defaultAgent, agents };
|
|
28635
|
-
}
|
|
28636
|
-
async function writeAgentConfig(config) {
|
|
28637
|
-
const existing = await readV1Store();
|
|
28638
|
-
const merged = { ...existing };
|
|
28639
|
-
const agents = {};
|
|
28640
|
-
for (const name of AGENT_NAMES) {
|
|
28641
|
-
const model = config.agents[name].model.trim();
|
|
28642
|
-
const binary = config.agents[name].binary.trim();
|
|
28643
|
-
if (model || binary) agents[name] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
28644
|
-
}
|
|
28645
|
-
merged["agent"] = config.defaultAgent;
|
|
28646
|
-
const defaultModel = agents[config.defaultAgent]?.model;
|
|
28647
|
-
if (defaultModel) merged["agentModel"] = defaultModel;
|
|
28648
|
-
else delete merged["agentModel"];
|
|
28649
|
-
if (Object.keys(agents).length > 0) merged["agents"] = agents;
|
|
28650
|
-
else delete merged["agents"];
|
|
28651
|
-
await writeV1Store(merged);
|
|
28652
|
-
}
|
|
28653
|
-
|
|
28654
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts
|
|
28655
|
-
import { execFile as execFile2 } from "node:child_process";
|
|
28656
|
-
import { access as access6, constants } from "node:fs/promises";
|
|
28657
|
-
var VERSION_TIMEOUT_MS = 5e3;
|
|
28658
|
-
var PROMPT_TIMEOUT_MS = 6e4;
|
|
28659
|
-
var TEST_PROMPT = "Reply with the single word: ok";
|
|
28660
|
-
var INSTALL_HINTS = {
|
|
28661
|
-
claude: "npm install -g @anthropic-ai/claude-code",
|
|
28662
|
-
codex: "npm install -g @openai/codex",
|
|
28663
|
-
opencode: "npm install -g opencode-ai",
|
|
28664
|
-
cursor: "install Cursor\u2019s `cursor-agent` command",
|
|
28665
|
-
copilot: "npm install -g @github/copilot"
|
|
28666
|
-
};
|
|
28667
|
-
var LOGIN_HINTS = {
|
|
28668
|
-
claude: "run `claude login`",
|
|
28669
|
-
codex: "set OPENAI_API_KEY, or sign in with a ChatGPT account",
|
|
28670
|
-
opencode: "run `opencode auth`",
|
|
28671
|
-
cursor: "sign in from Cursor",
|
|
28672
|
-
copilot: "run `copilot` and sign in"
|
|
28673
|
-
};
|
|
28674
|
-
function effectiveBinary(name, savedBinary) {
|
|
28675
|
-
return savedBinary.trim() || AGENT_BINARIES[name];
|
|
28676
|
-
}
|
|
28677
|
-
function defaultModelLabel(name) {
|
|
28678
|
-
const model = DEFAULT_MODELS[name];
|
|
28679
|
-
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
28680
|
-
}
|
|
28681
|
-
var fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
28682
|
-
var pass = (step, detail) => ({ step, ok: true, detail });
|
|
28683
|
-
function resolveOnPath(binary) {
|
|
28684
|
-
if (binary.includes("/")) {
|
|
28685
|
-
return access6(binary, constants.X_OK).then(
|
|
28686
|
-
() => binary,
|
|
28687
|
-
() => null
|
|
28688
|
-
);
|
|
28689
|
-
}
|
|
28690
|
-
return new Promise((resolve28) => {
|
|
28691
|
-
execFile2(
|
|
28692
|
-
process.platform === "win32" ? "where" : "which",
|
|
28693
|
-
[binary],
|
|
28694
|
-
(error, stdout) => resolve28(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
28695
|
-
);
|
|
28696
|
-
});
|
|
28697
|
-
}
|
|
28698
|
-
function readVersion(binary) {
|
|
28699
|
-
return new Promise((resolve28) => {
|
|
28700
|
-
execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
|
|
28701
|
-
const line = stdout.split("\n")[0]?.trim() ?? "";
|
|
28702
|
-
if (!error && line) resolve28(pass("version", line));
|
|
28703
|
-
else resolve28(fail3("version", "runs, but did not report a version"));
|
|
28704
|
-
});
|
|
28705
|
-
});
|
|
28706
|
-
}
|
|
28707
|
-
async function inspectAgent(name, binary) {
|
|
28708
|
-
const target = effectiveBinary(name, binary);
|
|
28709
|
-
const found = await resolveOnPath(target);
|
|
28710
|
-
if (!found) return [fail3("path", `\`${target}\` was not found or is not executable`)];
|
|
28711
|
-
const checks = [pass("path", found)];
|
|
28712
|
-
checks.push(await readVersion(found));
|
|
28713
|
-
if (name === "claude") {
|
|
28714
|
-
const auth = await withBinaryEnv(name, found, () => checkAgentAuth(name));
|
|
28715
|
-
checks.push(
|
|
28716
|
-
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
28717
|
-
);
|
|
28718
|
-
}
|
|
28719
|
-
return checks;
|
|
28720
|
-
}
|
|
28721
|
-
async function testAgent(name, binary, model) {
|
|
28722
|
-
const checks = await inspectAgent(name, binary);
|
|
28723
|
-
if (!checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
28724
|
-
const target = effectiveBinary(name, binary);
|
|
28725
|
-
const found = await resolveOnPath(target) ?? target;
|
|
28726
|
-
const started = Date.now();
|
|
28727
|
-
const result = await withBinaryEnv(
|
|
28728
|
-
name,
|
|
28729
|
-
found,
|
|
28730
|
-
() => createLocalCliAgentInvoker().invoke({
|
|
28731
|
-
agent: name,
|
|
28732
|
-
...model.trim() ? { model: model.trim() } : {},
|
|
28733
|
-
prompt: TEST_PROMPT,
|
|
28734
|
-
timeoutMs: PROMPT_TIMEOUT_MS
|
|
28735
|
-
})
|
|
28736
|
-
);
|
|
28737
|
-
const seconds = ((Date.now() - started) / 1e3).toFixed(1);
|
|
28738
|
-
if (result.timedOut) return [...checks, fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`)];
|
|
28739
|
-
if (result.exitCode !== 0) {
|
|
28740
|
-
const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
|
|
28741
|
-
return [...checks, fail3("prompt", reason)];
|
|
28742
|
-
}
|
|
28743
|
-
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
28744
|
-
}
|
|
28745
|
-
function statusFromChecks(name, checks, savedBinary) {
|
|
28746
|
-
if (checks.length === 0) return "checking";
|
|
28747
|
-
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
28748
|
-
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
28749
|
-
}
|
|
28750
|
-
const login = checks.find((check) => check.step === "login");
|
|
28751
|
-
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
28752
|
-
const prompt = checks.find((check) => check.step === "prompt");
|
|
28753
|
-
if (prompt) return prompt.ok ? "ready" : "not-logged-in";
|
|
28754
|
-
return name === "claude" ? "ready" : "unknown";
|
|
28755
|
-
}
|
|
28756
|
-
function nextStepHint(name, status) {
|
|
28757
|
-
if (status === "not-configured") return `${INSTALL_HINTS[name]}, or set the command path below`;
|
|
28758
|
-
if (status === "not-found") return `${INSTALL_HINTS[name]}, or fix the command path`;
|
|
28759
|
-
if (status === "not-logged-in") return LOGIN_HINTS[name];
|
|
28760
|
-
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
28761
|
-
return "";
|
|
28762
|
-
}
|
|
28763
|
-
function resolvedPath(checks) {
|
|
28764
|
-
const path5 = checks?.find((check) => check.step === "path");
|
|
28765
|
-
return path5?.ok ? path5.detail : "";
|
|
28766
|
-
}
|
|
28767
|
-
function statusRows(_name, checks, savedBinary) {
|
|
28768
|
-
if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
28769
|
-
const find = (step) => checks.find((check) => check.step === step);
|
|
28770
|
-
const path5 = find("path");
|
|
28771
|
-
if (!path5?.ok) {
|
|
28772
|
-
if (savedBinary.trim()) return [{ label: "Command", value: path5?.detail ?? "not found", tone: "bad" }];
|
|
28773
|
-
return [{ label: "Command", value: "not configured (not on the PATH)", tone: "muted" }];
|
|
28774
|
-
}
|
|
28775
|
-
const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
|
|
28776
|
-
const version = find("version");
|
|
28777
|
-
if (version) {
|
|
28778
|
-
rows.push({
|
|
28779
|
-
label: "Version",
|
|
28780
|
-
value: version.ok ? version.detail : "could not be read",
|
|
28781
|
-
tone: version.ok ? "ok" : "muted"
|
|
28782
|
-
});
|
|
28783
|
-
}
|
|
28784
|
-
const login = find("login");
|
|
28785
|
-
const prompt = find("prompt");
|
|
28786
|
-
if (login) {
|
|
28787
|
-
rows.push({ label: "Login", value: login.detail, tone: login.ok ? "ok" : "bad" });
|
|
28788
|
-
} else if (prompt) {
|
|
28789
|
-
rows.push({
|
|
28790
|
-
label: "Login",
|
|
28791
|
-
value: prompt.ok ? "confirmed by the test" : "see the test result",
|
|
28792
|
-
tone: prompt.ok ? "ok" : "bad"
|
|
28793
|
-
});
|
|
28794
|
-
} else {
|
|
28795
|
-
rows.push({ label: "Login", value: "not checked (use Run test)", tone: "muted" });
|
|
28796
|
-
}
|
|
28797
|
-
if (prompt) rows.push({ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" });
|
|
28798
|
-
return rows;
|
|
28799
|
-
}
|
|
28800
|
-
async function withBinaryEnv(name, binary, run) {
|
|
28801
|
-
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
28802
|
-
const previous = process.env[key];
|
|
28803
|
-
process.env[key] = binary;
|
|
28804
|
-
try {
|
|
28805
|
-
return await run();
|
|
28806
|
-
} finally {
|
|
28807
|
-
if (previous === void 0) delete process.env[key];
|
|
28808
|
-
else process.env[key] = previous;
|
|
28809
|
-
}
|
|
28810
|
-
}
|
|
28811
|
-
|
|
28812
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx
|
|
28813
|
-
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
28814
|
-
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28815
|
-
import TextInput4 from "ink-text-input";
|
|
28816
|
-
|
|
28817
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts
|
|
28818
|
-
var shellValues = /* @__PURE__ */ new Map();
|
|
28819
|
-
function applyBinaryOverrides(config) {
|
|
28820
|
-
for (const name of AGENT_NAMES) {
|
|
28821
|
-
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
28822
|
-
const binary = config.agents[name].binary.trim();
|
|
28823
|
-
if (binary) {
|
|
28824
|
-
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
28825
|
-
process.env[key] = binary;
|
|
28826
|
-
} else if (shellValues.has(key)) {
|
|
28827
|
-
const shellValue = shellValues.get(key);
|
|
28828
|
-
if (shellValue === void 0) delete process.env[key];
|
|
28829
|
-
else process.env[key] = shellValue;
|
|
28830
|
-
shellValues.delete(key);
|
|
28831
|
-
}
|
|
28832
|
-
}
|
|
28833
|
-
}
|
|
28834
|
-
|
|
28835
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx
|
|
28836
|
-
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
28837
|
-
var FOCUS_ORDER = ["binary", "model", "test"];
|
|
28838
|
-
var FIELDS2 = ["binary", "model"];
|
|
28839
|
-
var FIELD_LABEL = { binary: "Command path", model: "Model" };
|
|
28840
|
-
var LABEL_WIDTH = "Command path".length;
|
|
28841
|
-
var TONE_COLOR = {
|
|
28842
|
-
ok: PALETTE.success,
|
|
28843
|
-
bad: PALETTE.error,
|
|
28844
|
-
muted: PALETTE.muted
|
|
28845
|
-
};
|
|
28846
|
-
var fieldHint = (name, field) => field === "binary" ? `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` : `(empty: ${defaultModelLabel(name)})`;
|
|
28847
|
-
function Section2({ title, children }) {
|
|
28848
|
-
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", marginTop: 1, children: [
|
|
28849
|
-
/* @__PURE__ */ jsx55(Text46, { bold: true, color: PALETTE.muted, children: title }),
|
|
28850
|
-
children
|
|
28851
|
-
] });
|
|
28852
|
-
}
|
|
28853
|
-
function AgentDetail({
|
|
28854
|
-
name,
|
|
28855
|
-
config,
|
|
28856
|
-
setConfig,
|
|
28857
|
-
onBack
|
|
28858
|
-
}) {
|
|
28859
|
-
const settings = config.agents[name];
|
|
28860
|
-
const [focusIndex, setFocusIndex] = useState29(0);
|
|
28861
|
-
const [editing, setEditing] = useState29(false);
|
|
28862
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28863
|
-
const [saving, setSaving] = useState29(false);
|
|
28864
|
-
const [testing, setTesting] = useState29(false);
|
|
28865
|
-
const [notice, setNotice] = useState29(null);
|
|
28866
|
-
const [checks, setChecks] = useState29(void 0);
|
|
28867
|
-
useEffect22(() => {
|
|
28868
|
-
let active = true;
|
|
28869
|
-
setChecks(void 0);
|
|
28870
|
-
void inspectAgent(name, settings.binary).then((result) => active && setChecks(result));
|
|
28871
|
-
return () => {
|
|
28872
|
-
active = false;
|
|
28873
|
-
};
|
|
28874
|
-
}, [name, settings.binary]);
|
|
28875
|
-
const setField = (field, value) => {
|
|
28876
|
-
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [field]: value } } });
|
|
28877
|
-
setNotice(null);
|
|
28878
|
-
};
|
|
28879
|
-
const save = () => {
|
|
28880
|
-
setSaving(true);
|
|
28881
|
-
setNotice(null);
|
|
28882
|
-
writeAgentConfig(config).then(() => {
|
|
28883
|
-
applyBinaryOverrides(config);
|
|
28884
|
-
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` });
|
|
28885
|
-
}).catch(
|
|
28886
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
28887
|
-
).finally(() => setSaving(false));
|
|
28888
|
-
};
|
|
28889
|
-
const runTest = () => {
|
|
28890
|
-
setTesting(true);
|
|
28891
|
-
setNotice(null);
|
|
28892
|
-
setChecks(void 0);
|
|
28893
|
-
testAgent(name, settings.binary, settings.model).then(setChecks).catch(
|
|
28894
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "The test could not run" })
|
|
28895
|
-
).finally(() => setTesting(false));
|
|
28896
|
-
};
|
|
28897
|
-
const focused = FOCUS_ORDER[focusIndex];
|
|
28898
|
-
const focusedField = focused === "test" ? null : focused;
|
|
28899
|
-
useInput11((input, key) => {
|
|
28900
|
-
if (saving || testing) return;
|
|
28901
|
-
if (editing) {
|
|
28902
|
-
if (key.escape && focusedField) {
|
|
28903
|
-
setField(focusedField, valueBeforeEdit);
|
|
28904
|
-
setEditing(false);
|
|
28905
|
-
}
|
|
28906
|
-
return;
|
|
28907
|
-
}
|
|
28908
|
-
if (key.escape || input === "q") {
|
|
28909
|
-
onBack();
|
|
28910
|
-
return;
|
|
28911
|
-
}
|
|
28912
|
-
if (input === "s") {
|
|
28913
|
-
save();
|
|
28914
|
-
return;
|
|
28915
|
-
}
|
|
28916
|
-
if (key.upArrow) {
|
|
28917
|
-
setFocusIndex((i) => (i - 1 + FOCUS_ORDER.length) % FOCUS_ORDER.length);
|
|
28918
|
-
return;
|
|
28919
|
-
}
|
|
28920
|
-
if (key.downArrow || key.tab) {
|
|
28921
|
-
setFocusIndex((i) => (i + 1) % FOCUS_ORDER.length);
|
|
28922
|
-
return;
|
|
28923
|
-
}
|
|
28924
|
-
if (input === "c" && focusedField) {
|
|
28925
|
-
setField(focusedField, "");
|
|
28926
|
-
return;
|
|
28927
|
-
}
|
|
28928
|
-
if (key.return) {
|
|
28929
|
-
if (focusedField) {
|
|
28930
|
-
setValueBeforeEdit(settings[focusedField]);
|
|
28931
|
-
setEditing(true);
|
|
28932
|
-
} else {
|
|
28933
|
-
runTest();
|
|
28934
|
-
}
|
|
28935
|
-
}
|
|
28936
|
-
});
|
|
28937
|
-
const status = checks ? statusFromChecks(name, checks, settings.binary) : "checking";
|
|
28938
|
-
const hint = nextStepHint(name, status);
|
|
28939
|
-
const pointer = (isFocused) => /* @__PURE__ */ jsx55(Text46, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
28940
|
-
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28941
|
-
/* @__PURE__ */ jsx55(Text46, { bold: true, children: AGENT_LABELS[name] }),
|
|
28942
|
-
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: config.defaultAgent === name ? "This is the default agent." : `Runs the \`${AGENT_HINTS[name]}\` command.` }),
|
|
28943
|
-
/* @__PURE__ */ jsxs45(Section2, { title: "STATUS", children: [
|
|
28944
|
-
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsxs45(Box44, { gap: 1, paddingLeft: 2, children: [
|
|
28945
|
-
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: row.label }) }),
|
|
28946
|
-
/* @__PURE__ */ jsx55(Text46, { color: TONE_COLOR[row.tone], children: row.value })
|
|
28947
|
-
] }, row.label)),
|
|
28948
|
-
hint && /* @__PURE__ */ jsx55(Box44, { paddingLeft: 2, children: /* @__PURE__ */ jsxs45(Text46, { color: PALETTE.muted, children: [
|
|
28949
|
-
"Next: ",
|
|
28950
|
-
hint
|
|
28951
|
-
] }) })
|
|
28952
|
-
] }),
|
|
28953
|
-
/* @__PURE__ */ jsx55(Section2, { title: "SETTINGS", children: FIELDS2.map((field) => {
|
|
28954
|
-
const isFocused = focused === field;
|
|
28955
|
-
const value = settings[field];
|
|
28956
|
-
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28957
|
-
pointer(isFocused),
|
|
28958
|
-
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: FIELD_LABEL[field] }) }),
|
|
28959
|
-
isFocused && editing ? /* @__PURE__ */ jsx55(
|
|
28960
|
-
TextInput4,
|
|
28961
|
-
{
|
|
28962
|
-
value,
|
|
28963
|
-
onChange: (next) => setField(field, next),
|
|
28964
|
-
onSubmit: () => setEditing(false)
|
|
28965
|
-
}
|
|
28966
|
-
) : /* @__PURE__ */ jsx55(Text46, { bold: true, children: value }),
|
|
28967
|
-
!value && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: fieldHint(name, field) })
|
|
28968
|
-
] }, field);
|
|
28969
|
-
}) }),
|
|
28970
|
-
/* @__PURE__ */ jsx55(Section2, { title: "ACTIONS", children: /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28971
|
-
pointer(focused === "test"),
|
|
28972
|
-
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: focused === "test", color: focused === "test" ? PALETTE.accent : PALETTE.muted, children: "Run test" }) }),
|
|
28973
|
-
/* @__PURE__ */ jsx55(Text46, { color: testing ? PALETTE.accent : PALETTE.muted, children: testing ? "running..." : "sends one small prompt (uses a few tokens)" })
|
|
28974
|
-
] }) }),
|
|
28975
|
-
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
28976
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28977
|
-
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28978
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28979
|
-
" ",
|
|
28980
|
-
notice.text
|
|
28981
|
-
] })
|
|
28982
|
-
] }),
|
|
28983
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28984
|
-
/* @__PURE__ */ jsx55(
|
|
28985
|
-
ControlHints,
|
|
28986
|
-
{
|
|
28987
|
-
hints: editing ? [
|
|
28988
|
-
{ keys: "type", label: "edit" },
|
|
28989
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
28990
|
-
{ keys: "\u23CE", label: "done" },
|
|
28991
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
28992
|
-
] : [
|
|
28993
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
28994
|
-
{ keys: "\u23CE", label: focusedField ? "edit" : "run test" },
|
|
28995
|
-
...focusedField ? [{ keys: "c", label: "clear" }] : [],
|
|
28996
|
-
{ keys: "s", label: "save" },
|
|
28997
|
-
{ keys: "Esc/q", label: "back without saving" }
|
|
28998
|
-
]
|
|
28999
|
-
}
|
|
29000
|
-
)
|
|
29001
|
-
] });
|
|
29002
|
-
}
|
|
29003
|
-
|
|
29004
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusBadge.tsx
|
|
29005
|
-
import { Text as Text47 } from "ink";
|
|
29006
|
-
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
29007
|
-
var STATUS_TEXT = {
|
|
29008
|
-
checking: "checking...",
|
|
29009
|
-
ready: "ready",
|
|
29010
|
-
"not-configured": "not configured",
|
|
29011
|
-
"not-found": "not found",
|
|
29012
|
-
"not-logged-in": "not logged in",
|
|
29013
|
-
unknown: "found, login not checked"
|
|
29014
|
-
};
|
|
29015
|
-
var STATUS_COLOR = {
|
|
29016
|
-
checking: PALETTE.muted,
|
|
29017
|
-
ready: PALETTE.success,
|
|
29018
|
-
"not-configured": PALETTE.muted,
|
|
29019
|
-
"not-found": PALETTE.error,
|
|
29020
|
-
"not-logged-in": PALETTE.error,
|
|
29021
|
-
unknown: PALETTE.muted
|
|
29022
|
-
};
|
|
29023
|
-
function AgentStatusBadge({
|
|
29024
|
-
name,
|
|
29025
|
-
checks,
|
|
29026
|
-
binary
|
|
29027
|
-
}) {
|
|
29028
|
-
const status = checks ? statusFromChecks(name, checks, binary) : "checking";
|
|
29029
|
-
return /* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] });
|
|
29030
|
-
}
|
|
29031
|
-
|
|
29032
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
29033
|
-
import { Fragment as Fragment18, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
29034
|
-
var ROWS = [{ kind: "default" }, ...AGENT_NAMES.map((name) => ({ kind: "agent", name }))];
|
|
29035
|
-
var MAX_PATH_WIDTH = 44;
|
|
29036
|
-
var shortenPath = (path5) => path5.length > MAX_PATH_WIDTH ? `\u2026${path5.slice(-(MAX_PATH_WIDTH - 1))}` : path5;
|
|
29037
|
-
function AgentsScreen({ onDone }) {
|
|
29038
|
-
const [config, setConfig] = useState30(null);
|
|
29039
|
-
const [focus, setFocus] = useState30(0);
|
|
29040
|
-
const [open, setOpen] = useState30(null);
|
|
29041
|
-
const [notice, setNotice] = useState30(null);
|
|
29042
|
-
const [checks, setChecks] = useState30({});
|
|
29043
|
-
const inspectAll = (loaded) => {
|
|
29044
|
-
for (const name of AGENT_NAMES) {
|
|
29045
|
-
void inspectAgent(name, loaded.agents[name].binary).then(
|
|
29046
|
-
(result) => setChecks((previous) => ({ ...previous, [name]: result }))
|
|
29047
|
-
);
|
|
29048
|
-
}
|
|
29049
|
-
};
|
|
29050
|
-
useEffect23(() => {
|
|
29051
|
-
void readAgentConfig().then((loaded) => {
|
|
29052
|
-
setConfig(loaded);
|
|
29053
|
-
inspectAll(loaded);
|
|
29054
|
-
startDebugRun({
|
|
29055
|
-
flow: "settings/agents",
|
|
29056
|
-
step: "01-agents",
|
|
29057
|
-
menuOption: "Configuration > Agents",
|
|
29058
|
-
inputs: { default_agent: loaded.defaultAgent }
|
|
29059
|
-
});
|
|
29060
|
-
});
|
|
29061
|
-
}, []);
|
|
29062
|
-
const cycleDefault = (step) => {
|
|
29063
|
-
if (!config) return;
|
|
29064
|
-
const index = AGENT_NAMES.indexOf(config.defaultAgent);
|
|
29065
|
-
const next = { ...config, defaultAgent: AGENT_NAMES[(index + step + AGENT_NAMES.length) % AGENT_NAMES.length] };
|
|
29066
|
-
setConfig(next);
|
|
29067
|
-
writeAgentConfig(next).then(() => setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[next.defaultAgent]}` })).catch(
|
|
29068
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
29069
|
-
);
|
|
29070
|
-
};
|
|
29071
|
-
useInput12((input, key) => {
|
|
29072
|
-
if (!config || open) return;
|
|
29073
|
-
const row = ROWS[focus];
|
|
29074
|
-
if (key.upArrow) {
|
|
29075
|
-
setFocus((i) => (i - 1 + ROWS.length) % ROWS.length);
|
|
29076
|
-
return;
|
|
29077
|
-
}
|
|
29078
|
-
if (key.downArrow || key.tab) {
|
|
29079
|
-
setFocus((i) => (i + 1) % ROWS.length);
|
|
29080
|
-
return;
|
|
29081
|
-
}
|
|
29082
|
-
if (row.kind === "default" && key.leftArrow) {
|
|
29083
|
-
cycleDefault(-1);
|
|
29084
|
-
return;
|
|
29085
|
-
}
|
|
29086
|
-
if (row.kind === "default" && key.rightArrow) {
|
|
29087
|
-
cycleDefault(1);
|
|
29088
|
-
return;
|
|
29089
|
-
}
|
|
29090
|
-
if (key.return) {
|
|
29091
|
-
if (row.kind === "default") cycleDefault(1);
|
|
29092
|
-
else setOpen(row.name);
|
|
29093
|
-
return;
|
|
29094
|
-
}
|
|
29095
|
-
if (key.escape || input === "q") {
|
|
29096
|
-
void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
|
|
29097
|
-
onDone();
|
|
29098
|
-
}
|
|
29099
|
-
});
|
|
29100
|
-
if (!config) {
|
|
29101
|
-
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29102
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
29103
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29104
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
29105
|
-
] });
|
|
29106
|
-
}
|
|
29107
|
-
if (open) {
|
|
29108
|
-
return /* @__PURE__ */ jsx57(
|
|
29109
|
-
AgentDetail,
|
|
29110
|
-
{
|
|
29111
|
-
name: open,
|
|
29112
|
-
config,
|
|
29113
|
-
setConfig,
|
|
29114
|
-
onBack: () => {
|
|
29115
|
-
setOpen(null);
|
|
29116
|
-
void readAgentConfig().then((saved) => {
|
|
29117
|
-
setConfig(saved);
|
|
29118
|
-
inspectAll(saved);
|
|
29119
|
-
});
|
|
29120
|
-
}
|
|
29121
|
-
}
|
|
29122
|
-
);
|
|
29123
|
-
}
|
|
29124
|
-
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29125
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
29126
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
29127
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29128
|
-
ROWS.map((row, index) => {
|
|
29129
|
-
const isFocused = index === focus;
|
|
29130
|
-
const pointer = /* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
29131
|
-
if (row.kind === "default") {
|
|
29132
|
-
return /* @__PURE__ */ jsx57(Box45, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
29133
|
-
pointer,
|
|
29134
|
-
/* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: "Default agent" }),
|
|
29135
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: `\u2039 ${AGENT_LABELS[config.defaultAgent]} \u203A` })
|
|
29136
|
-
] }) }, "default");
|
|
29137
|
-
}
|
|
29138
|
-
const saved = config.agents[row.name].binary;
|
|
29139
|
-
return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
29140
|
-
pointer,
|
|
29141
|
-
/* @__PURE__ */ jsx57(Box45, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[row.name] }) }),
|
|
29142
|
-
/* @__PURE__ */ jsx57(Box45, { width: 26, flexShrink: 0, children: /* @__PURE__ */ jsx57(AgentStatusBadge, { name: row.name, checks: checks[row.name], binary: saved }) }),
|
|
29143
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: shortenPath(resolvedPath(checks[row.name]) || saved) }),
|
|
29144
|
-
row.name === config.defaultAgent && /* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: "(default)" })
|
|
29145
|
-
] }, row.name);
|
|
29146
|
-
}),
|
|
29147
|
-
notice && /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
29148
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29149
|
-
/* @__PURE__ */ jsxs46(Text48, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
29150
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
29151
|
-
" ",
|
|
29152
|
-
notice.text
|
|
29153
|
-
] })
|
|
29154
|
-
] }),
|
|
29155
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29156
|
-
/* @__PURE__ */ jsx57(
|
|
29157
|
-
ControlHints,
|
|
29158
|
-
{
|
|
29159
|
-
hints: ROWS[focus].kind === "default" ? [
|
|
29160
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
29161
|
-
{ keys: "\u2190/\u2192", label: "change default agent" },
|
|
29162
|
-
{ keys: "Esc/q", label: "back" }
|
|
29163
|
-
] : [
|
|
29164
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
29165
|
-
{ keys: "\u23CE", label: "open" },
|
|
29166
|
-
{ keys: "Esc/q", label: "back" }
|
|
29167
|
-
]
|
|
29168
|
-
}
|
|
29169
|
-
)
|
|
29170
|
-
] });
|
|
29171
|
-
}
|
|
29172
|
-
|
|
29173
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
29174
|
-
import { useEffect as useEffect24, useState as useState32 } from "react";
|
|
29175
|
-
import { Box as Box47, Text as Text50 } from "ink";
|
|
29176
|
-
init_debug_store();
|
|
29177
|
-
|
|
29178
|
-
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
29179
|
-
import { useState as useState31 } from "react";
|
|
29180
|
-
import { Box as Box46, Text as Text49, useInput as useInput13 } from "ink";
|
|
29181
|
-
import TextInput5 from "ink-text-input";
|
|
29182
|
-
import { Fragment as Fragment19, jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
29183
|
-
function FieldForm({
|
|
29184
|
-
title,
|
|
29185
|
-
subtitle,
|
|
29186
|
-
fields,
|
|
29187
|
-
values,
|
|
29188
|
-
onChange,
|
|
29189
|
-
onSave,
|
|
29190
|
-
onQuit,
|
|
29191
|
-
notice,
|
|
29192
|
-
busy = false,
|
|
29193
|
-
footer
|
|
29194
|
-
}) {
|
|
29195
|
-
const [active, setActive] = useState31(0);
|
|
29196
|
-
const [editing, setEditing] = useState31(false);
|
|
29197
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState31("");
|
|
29198
|
-
const labelWidth = Math.max(...fields.map((field) => field.label.length));
|
|
29199
|
-
const current = fields[active];
|
|
29200
|
-
useInput13((input, key) => {
|
|
29201
|
-
if (busy) return;
|
|
29202
|
-
if (editing) {
|
|
29203
|
-
if (key.escape) {
|
|
29204
|
-
onChange(current.key, valueBeforeEdit);
|
|
29205
|
-
setEditing(false);
|
|
29206
|
-
}
|
|
29207
|
-
return;
|
|
29208
|
-
}
|
|
29209
|
-
if (key.escape || input === "q") {
|
|
29210
|
-
onQuit();
|
|
29211
|
-
return;
|
|
29212
|
-
}
|
|
29213
|
-
if (input === "s") {
|
|
29214
|
-
onSave();
|
|
29215
|
-
return;
|
|
29216
|
-
}
|
|
29217
|
-
if (input === "c") {
|
|
29218
|
-
onChange(current.key, "");
|
|
29219
|
-
return;
|
|
29220
|
-
}
|
|
29221
|
-
if (key.tab || key.downArrow) {
|
|
29222
|
-
setActive((i) => (i + 1) % fields.length);
|
|
29223
|
-
return;
|
|
29224
|
-
}
|
|
29225
|
-
if (key.upArrow) {
|
|
29226
|
-
setActive((i) => (i - 1 + fields.length) % fields.length);
|
|
29227
|
-
return;
|
|
29228
|
-
}
|
|
29229
|
-
if (key.return) {
|
|
29230
|
-
setValueBeforeEdit(values[current.key]);
|
|
29231
|
-
setEditing(true);
|
|
29232
|
-
}
|
|
29233
|
-
});
|
|
29234
|
-
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29235
|
-
/* @__PURE__ */ jsx58(Text49, { bold: true, children: title }),
|
|
29236
|
-
subtitle && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: subtitle }),
|
|
29237
|
-
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29238
|
-
/* @__PURE__ */ jsx58(Box46, { flexDirection: "column", children: fields.map((field, index) => {
|
|
29239
|
-
const isActive = index === active;
|
|
29240
|
-
const value = values[field.key];
|
|
29241
|
-
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
29242
|
-
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
29243
|
-
/* @__PURE__ */ jsx58(Text49, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
29244
|
-
/* @__PURE__ */ jsx58(Box46, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx58(Text49, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
29245
|
-
isActive && editing ? /* @__PURE__ */ jsx58(
|
|
29246
|
-
TextInput5,
|
|
29247
|
-
{
|
|
29248
|
-
value,
|
|
29249
|
-
onChange: (next) => onChange(field.key, next),
|
|
29250
|
-
onSubmit: () => setEditing(false),
|
|
29251
|
-
mask: field.masked ? "\u2022" : void 0
|
|
29252
|
-
}
|
|
29253
|
-
) : /* @__PURE__ */ jsx58(Text49, { bold: !!display, children: display || (field.hint ? "" : /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
29254
|
-
field.hint && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: field.hint })
|
|
29255
|
-
] }, field.key);
|
|
29256
|
-
}) }),
|
|
29257
|
-
notice && /* @__PURE__ */ jsxs47(Fragment19, { children: [
|
|
29258
|
-
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29259
|
-
/* @__PURE__ */ jsxs47(Text49, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
29260
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
29261
|
-
" ",
|
|
29262
|
-
notice.text
|
|
29263
|
-
] })
|
|
29264
|
-
] }),
|
|
29265
|
-
footer,
|
|
29266
|
-
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29267
|
-
/* @__PURE__ */ jsx58(
|
|
29268
|
-
ControlHints,
|
|
29269
|
-
{
|
|
29270
|
-
hints: editing ? [
|
|
29271
|
-
{ keys: "type", label: "edit" },
|
|
29272
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
29273
|
-
{ keys: "\u23CE", label: "done" },
|
|
29274
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
29275
|
-
] : [
|
|
29276
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
29277
|
-
{ keys: "\u23CE", label: "edit" },
|
|
29278
|
-
{ keys: "c", label: "clear" },
|
|
29279
|
-
{ keys: "s", label: "save" },
|
|
29280
|
-
{ keys: "Esc/q", label: "back without saving" }
|
|
29281
|
-
]
|
|
29282
|
-
}
|
|
29283
|
-
)
|
|
29284
|
-
] });
|
|
29285
|
-
}
|
|
29286
|
-
|
|
29287
28579
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
29288
28580
|
async function readCredentials() {
|
|
29289
28581
|
const store = await readV1Store();
|
|
@@ -29309,16 +28601,17 @@ async function writeCredentials(config) {
|
|
|
29309
28601
|
await writeV1Store(merged);
|
|
29310
28602
|
}
|
|
29311
28603
|
|
|
29312
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/
|
|
29313
|
-
|
|
29314
|
-
|
|
29315
|
-
|
|
29316
|
-
|
|
29317
|
-
|
|
29318
|
-
|
|
29319
|
-
|
|
29320
|
-
|
|
29321
|
-
|
|
28604
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28605
|
+
init_debug_store();
|
|
28606
|
+
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
28607
|
+
var FIELD_ORDER = [
|
|
28608
|
+
"spaceId",
|
|
28609
|
+
"environmentId",
|
|
28610
|
+
"cmaToken",
|
|
28611
|
+
"host",
|
|
28612
|
+
"defaultComponentDir",
|
|
28613
|
+
"defaultTokenFile",
|
|
28614
|
+
"contentfulBaseDir"
|
|
29322
28615
|
];
|
|
29323
28616
|
function debugFields(config) {
|
|
29324
28617
|
return {
|
|
@@ -29331,114 +28624,156 @@ function debugFields(config) {
|
|
|
29331
28624
|
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
29332
28625
|
};
|
|
29333
28626
|
}
|
|
29334
|
-
var
|
|
29335
|
-
|
|
29336
|
-
|
|
29337
|
-
|
|
29338
|
-
|
|
29339
|
-
|
|
29340
|
-
|
|
29341
|
-
|
|
28627
|
+
var FIELD_LABELS = {
|
|
28628
|
+
spaceId: "Space ID",
|
|
28629
|
+
environmentId: "Environment ID",
|
|
28630
|
+
cmaToken: "CMA Token",
|
|
28631
|
+
host: "API Host",
|
|
28632
|
+
defaultComponentDir: "Default component directory",
|
|
28633
|
+
defaultTokenFile: "Default token file",
|
|
28634
|
+
contentfulBaseDir: "Root Project Directory"
|
|
28635
|
+
};
|
|
28636
|
+
var FIELD_HINTS = {
|
|
28637
|
+
contentfulBaseDir: "(where .contentful goes)"
|
|
28638
|
+
};
|
|
28639
|
+
var LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
|
|
28640
|
+
function ConfigurationScreen({ onDone }) {
|
|
28641
|
+
const [stage, setStage] = useState29("loading");
|
|
28642
|
+
const [config, setConfig] = useState29(null);
|
|
28643
|
+
const [activeField, setActiveField] = useState29("spaceId");
|
|
28644
|
+
const [notice, setNotice] = useState29(null);
|
|
28645
|
+
const [lastSaved, setLastSaved] = useState29(null);
|
|
28646
|
+
const [editing, setEditing] = useState29(false);
|
|
28647
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28648
|
+
useEffect22(() => {
|
|
28649
|
+
readCredentials().then((cfg) => {
|
|
29342
28650
|
setConfig(cfg);
|
|
28651
|
+
setStage("form");
|
|
29343
28652
|
startDebugRun({
|
|
29344
28653
|
flow: "settings/contentful-configuration",
|
|
29345
28654
|
step: "01-configuration",
|
|
29346
|
-
menuOption: "Configuration
|
|
28655
|
+
menuOption: "Configuration",
|
|
29347
28656
|
inputs: debugFields(cfg)
|
|
29348
28657
|
});
|
|
29349
28658
|
});
|
|
29350
28659
|
}, []);
|
|
29351
|
-
|
|
29352
|
-
|
|
29353
|
-
|
|
29354
|
-
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
29355
|
-
/* @__PURE__ */ jsx59(Text50, { color: PALETTE.accent, children: "Loading..." })
|
|
29356
|
-
] });
|
|
28660
|
+
function fieldValue(field) {
|
|
28661
|
+
if (!config) return "";
|
|
28662
|
+
return config[field] || "";
|
|
29357
28663
|
}
|
|
29358
|
-
|
|
29359
|
-
|
|
28664
|
+
function setFieldValue(field, value) {
|
|
28665
|
+
if (!config) return;
|
|
28666
|
+
setConfig({ ...config, [field]: value });
|
|
28667
|
+
setNotice(null);
|
|
28668
|
+
}
|
|
28669
|
+
function handleSave() {
|
|
28670
|
+
if (!config) return;
|
|
28671
|
+
setStage("saving");
|
|
29360
28672
|
setNotice(null);
|
|
29361
28673
|
writeCredentials(config).then(() => {
|
|
29362
28674
|
setLastSaved(config);
|
|
29363
28675
|
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
29364
|
-
setNotice({ kind: "success", text: "
|
|
28676
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
28677
|
+
setStage("form");
|
|
29365
28678
|
}).catch((err) => {
|
|
29366
28679
|
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
29367
|
-
|
|
29368
|
-
|
|
29369
|
-
|
|
28680
|
+
setStage("form");
|
|
28681
|
+
});
|
|
28682
|
+
}
|
|
28683
|
+
function quit() {
|
|
29370
28684
|
void finishDebugRun(
|
|
29371
28685
|
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
29372
28686
|
);
|
|
29373
28687
|
onDone();
|
|
29374
|
-
}
|
|
29375
|
-
|
|
29376
|
-
|
|
29377
|
-
{
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
setConfig({ ...config, [key]: value });
|
|
29384
|
-
setNotice(null);
|
|
29385
|
-
},
|
|
29386
|
-
onSave: save,
|
|
29387
|
-
onQuit: quit,
|
|
29388
|
-
notice,
|
|
29389
|
-
busy: saving
|
|
28688
|
+
}
|
|
28689
|
+
useInput11((input, key) => {
|
|
28690
|
+
if (stage === "loading" || stage === "saving") return;
|
|
28691
|
+
if (editing) {
|
|
28692
|
+
if (key.escape) {
|
|
28693
|
+
setFieldValue(activeField, valueBeforeEdit);
|
|
28694
|
+
setEditing(false);
|
|
28695
|
+
}
|
|
28696
|
+
return;
|
|
29390
28697
|
}
|
|
29391
|
-
|
|
29392
|
-
|
|
29393
|
-
|
|
29394
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
29395
|
-
import { jsx as jsx60, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
29396
|
-
var SECTIONS = [
|
|
29397
|
-
{
|
|
29398
|
-
id: "project",
|
|
29399
|
-
label: "Project",
|
|
29400
|
-
description: "Contentful space, credentials, defaults and where .contentful goes"
|
|
29401
|
-
},
|
|
29402
|
-
{ id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
|
|
29403
|
-
];
|
|
29404
|
-
function ConfigurationScreen({ onDone }) {
|
|
29405
|
-
const [focus, setFocus] = useState33(0);
|
|
29406
|
-
const [open, setOpen] = useState33(null);
|
|
29407
|
-
const close = () => setOpen(null);
|
|
29408
|
-
useInput14((input, key) => {
|
|
29409
|
-
if (open) return;
|
|
29410
|
-
if (key.upArrow) {
|
|
29411
|
-
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
28698
|
+
if (key.escape || input === "q") {
|
|
28699
|
+
quit();
|
|
29412
28700
|
return;
|
|
29413
28701
|
}
|
|
29414
|
-
if (
|
|
29415
|
-
|
|
28702
|
+
if (input === "s") {
|
|
28703
|
+
handleSave();
|
|
29416
28704
|
return;
|
|
29417
28705
|
}
|
|
29418
|
-
if (
|
|
29419
|
-
|
|
28706
|
+
if (input === "c") {
|
|
28707
|
+
setFieldValue(activeField, "");
|
|
29420
28708
|
return;
|
|
29421
28709
|
}
|
|
29422
|
-
if (key.
|
|
28710
|
+
if (key.tab || key.downArrow) {
|
|
28711
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
28712
|
+
setActiveField(FIELD_ORDER[(idx + 1) % FIELD_ORDER.length]);
|
|
28713
|
+
return;
|
|
28714
|
+
}
|
|
28715
|
+
if (key.upArrow) {
|
|
28716
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
28717
|
+
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
28718
|
+
return;
|
|
28719
|
+
}
|
|
28720
|
+
if (key.return) {
|
|
28721
|
+
setValueBeforeEdit(fieldValue(activeField));
|
|
28722
|
+
setEditing(true);
|
|
28723
|
+
}
|
|
29423
28724
|
});
|
|
29424
|
-
if (
|
|
29425
|
-
|
|
29426
|
-
|
|
29427
|
-
|
|
29428
|
-
|
|
29429
|
-
|
|
29430
|
-
|
|
29431
|
-
|
|
29432
|
-
|
|
29433
|
-
|
|
29434
|
-
/* @__PURE__ */
|
|
29435
|
-
|
|
28725
|
+
if (stage === "loading") {
|
|
28726
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28727
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
28728
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28729
|
+
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.accent, children: "Loading..." })
|
|
28730
|
+
] });
|
|
28731
|
+
}
|
|
28732
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28733
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
28734
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28735
|
+
/* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
28736
|
+
const isActive = activeField === field;
|
|
28737
|
+
const value = fieldValue(field);
|
|
28738
|
+
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
28739
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28740
|
+
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
28741
|
+
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
|
|
28742
|
+
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
28743
|
+
TextInput4,
|
|
28744
|
+
{
|
|
28745
|
+
value,
|
|
28746
|
+
onChange: (next) => setFieldValue(field, next),
|
|
28747
|
+
onSubmit: () => setEditing(false),
|
|
28748
|
+
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
28749
|
+
}
|
|
28750
|
+
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
28751
|
+
FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
|
|
28752
|
+
] }, field);
|
|
28753
|
+
}) }),
|
|
28754
|
+
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
28755
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28756
|
+
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28757
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28758
|
+
" ",
|
|
28759
|
+
notice.text
|
|
28760
|
+
] })
|
|
28761
|
+
] }),
|
|
28762
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28763
|
+
/* @__PURE__ */ jsx55(
|
|
29436
28764
|
ControlHints,
|
|
29437
28765
|
{
|
|
29438
|
-
hints: [
|
|
28766
|
+
hints: editing ? [
|
|
28767
|
+
{ keys: "type", label: "edit" },
|
|
28768
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
28769
|
+
{ keys: "\u23CE", label: "done" },
|
|
28770
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
28771
|
+
] : [
|
|
29439
28772
|
{ keys: "\u2191/\u2193", label: "move" },
|
|
29440
|
-
{ keys: "\u23CE", label: "
|
|
29441
|
-
{ keys: "
|
|
28773
|
+
{ keys: "\u23CE", label: "edit" },
|
|
28774
|
+
{ keys: "c", label: "clear" },
|
|
28775
|
+
{ keys: "s", label: "save" },
|
|
28776
|
+
{ keys: "Esc/q", label: "quit without saving" }
|
|
29442
28777
|
]
|
|
29443
28778
|
}
|
|
29444
28779
|
)
|
|
@@ -29446,8 +28781,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
29446
28781
|
}
|
|
29447
28782
|
|
|
29448
28783
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
29449
|
-
import { useEffect as
|
|
29450
|
-
import { Box as
|
|
28784
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
28785
|
+
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
29451
28786
|
|
|
29452
28787
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
29453
28788
|
async function readAnalyticsSetting() {
|
|
@@ -29466,11 +28801,11 @@ async function writeAnalyticsSetting(setting) {
|
|
|
29466
28801
|
|
|
29467
28802
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
29468
28803
|
init_debug_store();
|
|
29469
|
-
import { Fragment as
|
|
28804
|
+
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
29470
28805
|
function OptInAnalyticsScreen({ onDone }) {
|
|
29471
|
-
const [loading, setLoading] =
|
|
29472
|
-
const [enabled, setEnabled] =
|
|
29473
|
-
|
|
28806
|
+
const [loading, setLoading] = useState30(true);
|
|
28807
|
+
const [enabled, setEnabled] = useState30(true);
|
|
28808
|
+
useEffect23(() => {
|
|
29474
28809
|
readAnalyticsSetting().then((setting) => {
|
|
29475
28810
|
setEnabled(setting.enabled);
|
|
29476
28811
|
setLoading(false);
|
|
@@ -29482,7 +28817,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29482
28817
|
});
|
|
29483
28818
|
});
|
|
29484
28819
|
}, []);
|
|
29485
|
-
|
|
28820
|
+
useInput12((input, key) => {
|
|
29486
28821
|
if (loading) return;
|
|
29487
28822
|
if (key.return || input === " ") {
|
|
29488
28823
|
setEnabled((current) => {
|
|
@@ -29497,21 +28832,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29497
28832
|
onDone();
|
|
29498
28833
|
}
|
|
29499
28834
|
});
|
|
29500
|
-
return /* @__PURE__ */
|
|
29501
|
-
/* @__PURE__ */
|
|
29502
|
-
/* @__PURE__ */
|
|
29503
|
-
loading ? /* @__PURE__ */
|
|
29504
|
-
/* @__PURE__ */
|
|
28835
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28836
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
28837
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28838
|
+
loading ? /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
28839
|
+
/* @__PURE__ */ jsxs46(Text47, { children: [
|
|
29505
28840
|
"Share anonymous usage data:",
|
|
29506
28841
|
" ",
|
|
29507
|
-
/* @__PURE__ */
|
|
28842
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
29508
28843
|
] }),
|
|
29509
|
-
/* @__PURE__ */
|
|
29510
|
-
/* @__PURE__ */
|
|
29511
|
-
/* @__PURE__ */
|
|
28844
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28845
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
28846
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
29512
28847
|
] }),
|
|
29513
|
-
/* @__PURE__ */
|
|
29514
|
-
/* @__PURE__ */
|
|
28848
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28849
|
+
/* @__PURE__ */ jsx56(
|
|
29515
28850
|
ControlHints,
|
|
29516
28851
|
{
|
|
29517
28852
|
hints: [
|
|
@@ -29524,15 +28859,15 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29524
28859
|
}
|
|
29525
28860
|
|
|
29526
28861
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
29527
|
-
import { useEffect as
|
|
29528
|
-
import { Box as
|
|
28862
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
28863
|
+
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
29529
28864
|
init_version();
|
|
29530
28865
|
init_debug_store();
|
|
29531
|
-
import { jsx as
|
|
28866
|
+
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
29532
28867
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
29533
28868
|
function UpgradeScreen({ onDone }) {
|
|
29534
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
29535
|
-
|
|
28869
|
+
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
28870
|
+
useEffect24(() => {
|
|
29536
28871
|
startDebugRun({
|
|
29537
28872
|
flow: "upgrade",
|
|
29538
28873
|
step: "01-upgrade",
|
|
@@ -29541,7 +28876,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
29541
28876
|
});
|
|
29542
28877
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
29543
28878
|
}, []);
|
|
29544
|
-
|
|
28879
|
+
useInput13((_input, key) => {
|
|
29545
28880
|
if (key.return) {
|
|
29546
28881
|
void finishDebugRun({
|
|
29547
28882
|
outputs: upgradeCheck ?? {},
|
|
@@ -29552,12 +28887,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
29552
28887
|
return;
|
|
29553
28888
|
}
|
|
29554
28889
|
});
|
|
29555
|
-
return /* @__PURE__ */
|
|
29556
|
-
/* @__PURE__ */
|
|
29557
|
-
/* @__PURE__ */
|
|
28890
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28891
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Upgrade" }),
|
|
28892
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29558
28893
|
renderBody(upgradeCheck),
|
|
29559
|
-
/* @__PURE__ */
|
|
29560
|
-
/* @__PURE__ */
|
|
28894
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
28895
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.accent, children: [
|
|
29561
28896
|
FOCUS_MARKER,
|
|
29562
28897
|
" Go Back"
|
|
29563
28898
|
] })
|
|
@@ -29565,47 +28900,47 @@ function UpgradeScreen({ onDone }) {
|
|
|
29565
28900
|
}
|
|
29566
28901
|
function renderBody(upgradeCheck) {
|
|
29567
28902
|
if (!upgradeCheck) {
|
|
29568
|
-
return /* @__PURE__ */
|
|
28903
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
29569
28904
|
}
|
|
29570
28905
|
if (upgradeCheck.status === "error") {
|
|
29571
|
-
return /* @__PURE__ */
|
|
28906
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
29572
28907
|
}
|
|
29573
28908
|
if (upgradeCheck.status === "up-to-date") {
|
|
29574
|
-
return /* @__PURE__ */
|
|
28909
|
+
return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.success, children: [
|
|
29575
28910
|
"You're already on the latest version (v",
|
|
29576
28911
|
upgradeCheck.current,
|
|
29577
28912
|
")."
|
|
29578
28913
|
] });
|
|
29579
28914
|
}
|
|
29580
|
-
return /* @__PURE__ */
|
|
29581
|
-
/* @__PURE__ */
|
|
29582
|
-
/* @__PURE__ */
|
|
28915
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", children: [
|
|
28916
|
+
/* @__PURE__ */ jsxs47(Text48, { color: PALETTE.muted, children: [
|
|
28917
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.success, children: [
|
|
29583
28918
|
"v",
|
|
29584
28919
|
upgradeCheck.latest
|
|
29585
28920
|
] }),
|
|
29586
28921
|
" ",
|
|
29587
28922
|
"is available (you're on ",
|
|
29588
|
-
/* @__PURE__ */
|
|
28923
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, children: [
|
|
29589
28924
|
"v",
|
|
29590
28925
|
upgradeCheck.current
|
|
29591
28926
|
] }),
|
|
29592
28927
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
29593
28928
|
] }),
|
|
29594
|
-
/* @__PURE__ */
|
|
29595
|
-
/* @__PURE__ */
|
|
28929
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
28930
|
+
/* @__PURE__ */ jsx57(Box46, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx57(Text48, { bold: true, children: cmd }, cmd)) })
|
|
29596
28931
|
] });
|
|
29597
28932
|
}
|
|
29598
28933
|
|
|
29599
28934
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
29600
|
-
import { useEffect as
|
|
29601
|
-
import { Box as
|
|
28935
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
28936
|
+
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
29602
28937
|
init_debug_mode_store();
|
|
29603
28938
|
init_debug_store();
|
|
29604
|
-
import { jsx as
|
|
28939
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
29605
28940
|
function DebugModeScreen({ onDone }) {
|
|
29606
|
-
const [loading, setLoading] =
|
|
29607
|
-
const [enabled, setEnabled] =
|
|
29608
|
-
|
|
28941
|
+
const [loading, setLoading] = useState32(true);
|
|
28942
|
+
const [enabled, setEnabled] = useState32(true);
|
|
28943
|
+
useEffect25(() => {
|
|
29609
28944
|
readDebugModeSetting().then((setting) => {
|
|
29610
28945
|
setEnabled(setting.enabled);
|
|
29611
28946
|
setLoading(false);
|
|
@@ -29617,7 +28952,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
29617
28952
|
});
|
|
29618
28953
|
});
|
|
29619
28954
|
}, []);
|
|
29620
|
-
|
|
28955
|
+
useInput14((input, key) => {
|
|
29621
28956
|
if (loading) return;
|
|
29622
28957
|
if (key.return || input === " ") {
|
|
29623
28958
|
setEnabled((current) => {
|
|
@@ -29632,16 +28967,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
29632
28967
|
onDone();
|
|
29633
28968
|
}
|
|
29634
28969
|
});
|
|
29635
|
-
return /* @__PURE__ */
|
|
29636
|
-
/* @__PURE__ */
|
|
29637
|
-
/* @__PURE__ */
|
|
29638
|
-
loading ? /* @__PURE__ */
|
|
28970
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28971
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
28972
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
28973
|
+
loading ? /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs48(Text49, { children: [
|
|
29639
28974
|
"Debug logging:",
|
|
29640
28975
|
" ",
|
|
29641
|
-
/* @__PURE__ */
|
|
28976
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
29642
28977
|
] }),
|
|
29643
|
-
/* @__PURE__ */
|
|
29644
|
-
/* @__PURE__ */
|
|
28978
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
28979
|
+
/* @__PURE__ */ jsx58(
|
|
29645
28980
|
ControlHints,
|
|
29646
28981
|
{
|
|
29647
28982
|
hints: [
|
|
@@ -29654,18 +28989,18 @@ function DebugModeScreen({ onDone }) {
|
|
|
29654
28989
|
}
|
|
29655
28990
|
|
|
29656
28991
|
// packages/experience-design-system-cli/app.tsx
|
|
29657
|
-
import { Fragment as
|
|
28992
|
+
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
29658
28993
|
function App({ importOptions, inkClear }) {
|
|
29659
|
-
const [screen, setScreen] =
|
|
29660
|
-
const [importExitCode, setImportExitCode] =
|
|
28994
|
+
const [screen, setScreen] = useState33("start");
|
|
28995
|
+
const [importExitCode, setImportExitCode] = useState33();
|
|
29661
28996
|
const showImportResult = importExitCode !== void 0;
|
|
29662
|
-
const [projectPath, setProjectPath] =
|
|
29663
|
-
const [tokensPath, setTokensPath] =
|
|
29664
|
-
const [scannedFiles, setScannedFiles] =
|
|
29665
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
29666
|
-
const [extractionRun, setExtractionRun] =
|
|
28997
|
+
const [projectPath, setProjectPath] = useState33();
|
|
28998
|
+
const [tokensPath, setTokensPath] = useState33();
|
|
28999
|
+
const [scannedFiles, setScannedFiles] = useState33();
|
|
29000
|
+
const [pendingLaunch, setPendingLaunch] = useState33();
|
|
29001
|
+
const [extractionRun, setExtractionRun] = useState33();
|
|
29667
29002
|
const extraction = useExtraction(extractionRun?.input);
|
|
29668
|
-
const [scopeRun, setScopeRun] =
|
|
29003
|
+
const [scopeRun, setScopeRun] = useState33();
|
|
29669
29004
|
const scopeFlow = useScopeGateFlow(
|
|
29670
29005
|
scopeRun && {
|
|
29671
29006
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -29680,12 +29015,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29680
29015
|
}
|
|
29681
29016
|
}
|
|
29682
29017
|
);
|
|
29683
|
-
const [generationInput, setGenerationInput] =
|
|
29018
|
+
const [generationInput, setGenerationInput] = useState33();
|
|
29684
29019
|
const generation = useGeneration(generationInput);
|
|
29685
|
-
const [flowStart, setFlowStart] =
|
|
29020
|
+
const [flowStart, setFlowStart] = useState33();
|
|
29686
29021
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
29687
|
-
const [importDefaults, setImportDefaults] =
|
|
29688
|
-
|
|
29022
|
+
const [importDefaults, setImportDefaults] = useState33();
|
|
29023
|
+
useEffect26(() => {
|
|
29689
29024
|
if (screen !== "import") {
|
|
29690
29025
|
setImportDefaults(void 0);
|
|
29691
29026
|
return;
|
|
@@ -29703,7 +29038,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29703
29038
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
29704
29039
|
const state2 = await inspectTokens({
|
|
29705
29040
|
rawTokensPath: tokens,
|
|
29706
|
-
contentfulDir:
|
|
29041
|
+
contentfulDir: join25(resolveUserPath(projectPath2), ".contentful"),
|
|
29707
29042
|
cache: importOptions.cache
|
|
29708
29043
|
});
|
|
29709
29044
|
if (state2.kind === "cached") {
|
|
@@ -29745,12 +29080,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29745
29080
|
}
|
|
29746
29081
|
});
|
|
29747
29082
|
};
|
|
29748
|
-
|
|
29083
|
+
useEffect26(() => {
|
|
29749
29084
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
29750
29085
|
setExtractionRun(void 0);
|
|
29751
29086
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
29752
29087
|
}, [extraction, extractionRun]);
|
|
29753
|
-
|
|
29088
|
+
useEffect26(() => {
|
|
29754
29089
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
29755
29090
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29756
29091
|
setGenerationInput({
|
|
@@ -29768,7 +29103,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29768
29103
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
29769
29104
|
});
|
|
29770
29105
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
29771
|
-
|
|
29106
|
+
useEffect26(() => {
|
|
29772
29107
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
29773
29108
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29774
29109
|
inkClear();
|
|
@@ -29811,9 +29146,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29811
29146
|
};
|
|
29812
29147
|
switch (screen) {
|
|
29813
29148
|
case "import":
|
|
29814
|
-
if (showImportResult) return /* @__PURE__ */
|
|
29149
|
+
if (showImportResult) return /* @__PURE__ */ jsx59(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
29815
29150
|
if (flow && flowStart) {
|
|
29816
|
-
return /* @__PURE__ */
|
|
29151
|
+
return /* @__PURE__ */ jsx59(
|
|
29817
29152
|
FlowScreen,
|
|
29818
29153
|
{
|
|
29819
29154
|
state: flow.state,
|
|
@@ -29823,12 +29158,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29823
29158
|
}
|
|
29824
29159
|
);
|
|
29825
29160
|
}
|
|
29826
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
29161
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
29827
29162
|
if (projectPath === void 0) {
|
|
29828
|
-
return /* @__PURE__ */
|
|
29163
|
+
return /* @__PURE__ */ jsx59(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
29829
29164
|
}
|
|
29830
29165
|
if (tokensPath === void 0) {
|
|
29831
|
-
return /* @__PURE__ */
|
|
29166
|
+
return /* @__PURE__ */ jsx59(
|
|
29832
29167
|
TokenInputScreen,
|
|
29833
29168
|
{
|
|
29834
29169
|
initialPath: importDefaults.tokenFile,
|
|
@@ -29838,7 +29173,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29838
29173
|
);
|
|
29839
29174
|
}
|
|
29840
29175
|
if (scannedFiles === void 0) {
|
|
29841
|
-
return /* @__PURE__ */
|
|
29176
|
+
return /* @__PURE__ */ jsx59(
|
|
29842
29177
|
PathValidationScreen,
|
|
29843
29178
|
{
|
|
29844
29179
|
projectPath,
|
|
@@ -29850,10 +29185,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29850
29185
|
}
|
|
29851
29186
|
if (extractionRun) {
|
|
29852
29187
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
29853
|
-
return /* @__PURE__ */
|
|
29188
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
29854
29189
|
}
|
|
29855
29190
|
if (extraction?.status === "running") {
|
|
29856
|
-
return /* @__PURE__ */
|
|
29191
|
+
return /* @__PURE__ */ jsx59(
|
|
29857
29192
|
ExtractionScreen,
|
|
29858
29193
|
{
|
|
29859
29194
|
progress: extraction.progress,
|
|
@@ -29862,14 +29197,14 @@ function App({ importOptions, inkClear }) {
|
|
|
29862
29197
|
}
|
|
29863
29198
|
);
|
|
29864
29199
|
}
|
|
29865
|
-
return /* @__PURE__ */
|
|
29200
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
29866
29201
|
}
|
|
29867
29202
|
if (scopeRun && scopeFlow) {
|
|
29868
29203
|
if (scopeFlow.status === "failed") {
|
|
29869
|
-
return /* @__PURE__ */
|
|
29204
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
29870
29205
|
}
|
|
29871
29206
|
if (scopeFlow.status === "deciding") {
|
|
29872
|
-
return /* @__PURE__ */
|
|
29207
|
+
return /* @__PURE__ */ jsx59(
|
|
29873
29208
|
ScopeGateScreen,
|
|
29874
29209
|
{
|
|
29875
29210
|
components: scopeFlow.load.components,
|
|
@@ -29879,7 +29214,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29879
29214
|
);
|
|
29880
29215
|
}
|
|
29881
29216
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
29882
|
-
return /* @__PURE__ */
|
|
29217
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
29883
29218
|
}
|
|
29884
29219
|
if (generation?.status === "running") {
|
|
29885
29220
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -29887,7 +29222,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29887
29222
|
hasRawTokens,
|
|
29888
29223
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
29889
29224
|
});
|
|
29890
|
-
return /* @__PURE__ */
|
|
29225
|
+
return /* @__PURE__ */ jsx59(
|
|
29891
29226
|
GenerationScreen,
|
|
29892
29227
|
{
|
|
29893
29228
|
progress: generation.progress,
|
|
@@ -29899,10 +29234,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29899
29234
|
}
|
|
29900
29235
|
);
|
|
29901
29236
|
}
|
|
29902
|
-
return /* @__PURE__ */
|
|
29237
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
29903
29238
|
}
|
|
29904
29239
|
if (pendingLaunch?.cached) {
|
|
29905
|
-
return /* @__PURE__ */
|
|
29240
|
+
return /* @__PURE__ */ jsx59(
|
|
29906
29241
|
TokenReuseScreen,
|
|
29907
29242
|
{
|
|
29908
29243
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -29913,7 +29248,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29913
29248
|
}
|
|
29914
29249
|
);
|
|
29915
29250
|
}
|
|
29916
|
-
return /* @__PURE__ */
|
|
29251
|
+
return /* @__PURE__ */ jsx59(
|
|
29917
29252
|
CredentialsScreen,
|
|
29918
29253
|
{
|
|
29919
29254
|
initial: importDefaults.credentials,
|
|
@@ -29922,19 +29257,19 @@ function App({ importOptions, inkClear }) {
|
|
|
29922
29257
|
}
|
|
29923
29258
|
);
|
|
29924
29259
|
case "help":
|
|
29925
|
-
return /* @__PURE__ */
|
|
29260
|
+
return /* @__PURE__ */ jsx59(HelpScreen, { onDone: goToStart });
|
|
29926
29261
|
case "upgrade":
|
|
29927
|
-
return /* @__PURE__ */
|
|
29262
|
+
return /* @__PURE__ */ jsx59(UpgradeScreen, { onDone: goToStart });
|
|
29928
29263
|
case "settings":
|
|
29929
|
-
return /* @__PURE__ */
|
|
29264
|
+
return /* @__PURE__ */ jsx59(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
29930
29265
|
case "settings-configuration":
|
|
29931
|
-
return /* @__PURE__ */
|
|
29266
|
+
return /* @__PURE__ */ jsx59(ConfigurationScreen, { onDone: goToSettings });
|
|
29932
29267
|
case "settings-opt-in-analytics":
|
|
29933
|
-
return /* @__PURE__ */
|
|
29268
|
+
return /* @__PURE__ */ jsx59(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
29934
29269
|
case "settings-debug-mode":
|
|
29935
|
-
return /* @__PURE__ */
|
|
29270
|
+
return /* @__PURE__ */ jsx59(DebugModeScreen, { onDone: goToSettings });
|
|
29936
29271
|
case "start":
|
|
29937
|
-
return /* @__PURE__ */
|
|
29272
|
+
return /* @__PURE__ */ jsx59(HomeScreen, { onNavigate: setScreen });
|
|
29938
29273
|
}
|
|
29939
29274
|
}
|
|
29940
29275
|
async function runApp(renderApp, importOptions) {
|
|
@@ -29942,7 +29277,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
29942
29277
|
instance.clear?.();
|
|
29943
29278
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
29944
29279
|
};
|
|
29945
|
-
const instance = renderApp(/* @__PURE__ */
|
|
29280
|
+
const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear }));
|
|
29946
29281
|
await instance.waitUntilExit();
|
|
29947
29282
|
}
|
|
29948
29283
|
export {
|