@contentful/experience-design-system-cli 2.37.1-dev-build-1cd1ccfb.0 → 2.37.1-dev-build-0b786a83.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 +1182 -513
- package/dist/index.js +1323 -584
- package/dist/package.json +1 -1
- package/dist/src/tui/help/file-locations.d.ts +23 -0
- package/dist/src/tui/home/home.theme.d.ts +8 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +4 -4
- package/dist/src/tui/import/steps/09-review/theme.d.ts +9 -0
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +5 -14
- package/dist/src/tui/settings/agents/AgentDetail.d.ts +13 -0
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +8 -0
- package/dist/src/tui/settings/agents/AgentStatusBadge.d.ts +9 -0
- package/dist/src/tui/settings/agents/agent-status.d.ts +44 -0
- package/dist/src/tui/settings/agents/agent-store.d.ts +17 -0
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +13 -0
- package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +1 -0
- package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +5 -0
- package/dist/src/tui/settings/shared/FieldForm.d.ts +35 -0
- package/legacy/dist/src/index.js +1 -0
- package/legacy/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/theme.d.ts +0 -19
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((resolve28) => {
|
|
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
|
+
resolve28(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((resolve28) => {
|
|
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
|
+
resolve28("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
|
+
resolve28("unauthenticated");
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
934
|
try {
|
|
935
935
|
const status = JSON.parse(stdout);
|
|
936
|
-
|
|
936
|
+
resolve28(status.loggedIn ? "ok" : "unauthenticated");
|
|
937
937
|
} catch {
|
|
938
|
-
|
|
938
|
+
resolve28("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((resolve28) => {
|
|
949
949
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
950
|
-
child.on("close", (code) =>
|
|
950
|
+
child.on("close", (code) => resolve28(code === 0));
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
953
|
var init_check_agent_auth = __esm({
|
|
@@ -2329,51 +2329,32 @@ 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 join26 } from "node:path";
|
|
2333
|
+
import { useEffect as useEffect28, useState as useState37 } 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/theme.ts
|
|
2340
|
-
var
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
// blue/400
|
|
2349
|
-
error: "#ff707d",
|
|
2350
|
-
// red/400
|
|
2351
|
-
success: "#00C459",
|
|
2352
|
-
warning: "#FFDA00"
|
|
2339
|
+
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
2340
|
+
var BRAND = {
|
|
2341
|
+
blue: "#1773EB",
|
|
2342
|
+
green: "#00C459",
|
|
2343
|
+
orange: "#E44F20",
|
|
2344
|
+
yellow: "#FFDA00",
|
|
2345
|
+
white: "#FFFFFF",
|
|
2346
|
+
slate: "#8B8D91",
|
|
2347
|
+
steel: "#C4D1DE"
|
|
2353
2348
|
};
|
|
2354
|
-
var
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
accent: "#0059c8",
|
|
2362
|
-
// blue/600, semantic primary
|
|
2363
|
-
error: "#bd002a",
|
|
2364
|
-
// semantic negative
|
|
2365
|
-
success: "#00C459",
|
|
2366
|
-
warning: "#FFDA00"
|
|
2349
|
+
var PALETTE = {
|
|
2350
|
+
accent: BRAND.blue,
|
|
2351
|
+
success: BRAND.green,
|
|
2352
|
+
error: BRAND.orange,
|
|
2353
|
+
warning: BRAND.yellow,
|
|
2354
|
+
muted: BRAND.slate,
|
|
2355
|
+
border: BRAND.steel
|
|
2367
2356
|
};
|
|
2368
|
-
|
|
2369
|
-
const bg = env.COLORFGBG?.split(";").pop();
|
|
2370
|
-
if (bg === "7" || bg === "15") return "light";
|
|
2371
|
-
return "dark";
|
|
2372
|
-
}
|
|
2373
|
-
var PALETTE = detectColorMode() === "light" ? LIGHT : DARK;
|
|
2374
|
-
|
|
2375
|
-
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
2376
|
-
var BRAND_RAMP = [PALETTE.accent, PALETTE.error, PALETTE.warning];
|
|
2357
|
+
var BRAND_RAMP = [BRAND.blue, BRAND.orange, BRAND.yellow];
|
|
2377
2358
|
var BAR_CELL = "\u2501";
|
|
2378
2359
|
function brandBar(width, ramp = BRAND_RAMP) {
|
|
2379
2360
|
if (width <= 0 || ramp.length === 0) return [];
|
|
@@ -4305,9 +4286,9 @@ async function resolveRelativeImport(specifier, fromDir) {
|
|
|
4305
4286
|
async function resolveImportSpecifiers(sourceText, fromDir) {
|
|
4306
4287
|
const resolvedPaths = [];
|
|
4307
4288
|
for (const specifier of extractRelativeImportPaths(sourceText)) {
|
|
4308
|
-
const
|
|
4309
|
-
if (
|
|
4310
|
-
resolvedPaths.push(
|
|
4289
|
+
const resolvedPath2 = await resolveRelativeImport(specifier, fromDir);
|
|
4290
|
+
if (resolvedPath2)
|
|
4291
|
+
resolvedPaths.push(resolvedPath2);
|
|
4311
4292
|
}
|
|
4312
4293
|
return resolvedPaths;
|
|
4313
4294
|
}
|
|
@@ -4321,20 +4302,20 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
4321
4302
|
if (discovered.length >= MAX_SIBLING_CANDIDATES_EXPLORED)
|
|
4322
4303
|
break;
|
|
4323
4304
|
const resolvedPaths = await resolveImportSpecifiers(node.text, node.dir);
|
|
4324
|
-
for (const
|
|
4325
|
-
if (visited.has(
|
|
4305
|
+
for (const resolvedPath2 of resolvedPaths) {
|
|
4306
|
+
if (visited.has(resolvedPath2))
|
|
4326
4307
|
continue;
|
|
4327
|
-
visited.add(
|
|
4308
|
+
visited.add(resolvedPath2);
|
|
4328
4309
|
if (discovered.length >= MAX_SIBLING_CANDIDATES_EXPLORED)
|
|
4329
4310
|
break;
|
|
4330
4311
|
let content;
|
|
4331
4312
|
try {
|
|
4332
|
-
content = await readFile4(
|
|
4313
|
+
content = await readFile4(resolvedPath2, "utf8");
|
|
4333
4314
|
} catch {
|
|
4334
4315
|
continue;
|
|
4335
4316
|
}
|
|
4336
|
-
discovered.push({ path:
|
|
4337
|
-
nextFrontier.push({ text: content, dir: dirname4(
|
|
4317
|
+
discovered.push({ path: resolvedPath2, content });
|
|
4318
|
+
nextFrontier.push({ text: content, dir: dirname4(resolvedPath2) });
|
|
4338
4319
|
}
|
|
4339
4320
|
}
|
|
4340
4321
|
frontier = nextFrontier;
|
|
@@ -5299,11 +5280,11 @@ function isBareModuleSpecifier(moduleSpecifier) {
|
|
|
5299
5280
|
return !moduleSpecifier.startsWith(".") && !moduleSpecifier.startsWith("/");
|
|
5300
5281
|
}
|
|
5301
5282
|
function findRepoLocalAliasSourceFile(originSourceFile, moduleSpecifier) {
|
|
5302
|
-
const
|
|
5303
|
-
if (!
|
|
5283
|
+
const resolvedPath2 = resolveRepoLocalAliasImportPath(originSourceFile.getFilePath(), moduleSpecifier);
|
|
5284
|
+
if (!resolvedPath2)
|
|
5304
5285
|
return void 0;
|
|
5305
5286
|
const project = originSourceFile.getProject();
|
|
5306
|
-
return findProjectSourceFileByImportPath(project,
|
|
5287
|
+
return findProjectSourceFileByImportPath(project, resolvedPath2);
|
|
5307
5288
|
}
|
|
5308
5289
|
function resolveRepoLocalAliasImportPath(importingFilePath, moduleSpecifier) {
|
|
5309
5290
|
const nearestTsConfigPath = findNearestTsConfigPath(importingFilePath);
|
|
@@ -5318,8 +5299,8 @@ function resolveRepoLocalAliasImportPath(importingFilePath, moduleSpecifier) {
|
|
|
5318
5299
|
continue;
|
|
5319
5300
|
for (const targetPattern of targets) {
|
|
5320
5301
|
const substitutedTarget = substituteTsConfigPathTarget(targetPattern, match2.wildcard);
|
|
5321
|
-
const
|
|
5322
|
-
const sourceFilePath = resolveImportSourcePath(
|
|
5302
|
+
const resolvedPath2 = resolve7(tsConfigPaths.baseUrl, substitutedTarget);
|
|
5303
|
+
const sourceFilePath = resolveImportSourcePath(resolvedPath2);
|
|
5323
5304
|
if (sourceFilePath)
|
|
5324
5305
|
return sourceFilePath;
|
|
5325
5306
|
}
|
|
@@ -5397,17 +5378,17 @@ function resolveImportSourcePath(basePath) {
|
|
|
5397
5378
|
];
|
|
5398
5379
|
return candidates.find((candidatePath) => existsSync3(candidatePath));
|
|
5399
5380
|
}
|
|
5400
|
-
function findProjectSourceFileByImportPath(project,
|
|
5381
|
+
function findProjectSourceFileByImportPath(project, resolvedPath2) {
|
|
5401
5382
|
const candidatePaths = [
|
|
5402
|
-
|
|
5403
|
-
`${
|
|
5404
|
-
`${
|
|
5405
|
-
`${
|
|
5406
|
-
`${
|
|
5407
|
-
join5(
|
|
5408
|
-
join5(
|
|
5409
|
-
join5(
|
|
5410
|
-
join5(
|
|
5383
|
+
resolvedPath2,
|
|
5384
|
+
`${resolvedPath2}.ts`,
|
|
5385
|
+
`${resolvedPath2}.tsx`,
|
|
5386
|
+
`${resolvedPath2}.js`,
|
|
5387
|
+
`${resolvedPath2}.jsx`,
|
|
5388
|
+
join5(resolvedPath2, "index.ts"),
|
|
5389
|
+
join5(resolvedPath2, "index.tsx"),
|
|
5390
|
+
join5(resolvedPath2, "index.js"),
|
|
5391
|
+
join5(resolvedPath2, "index.jsx")
|
|
5411
5392
|
];
|
|
5412
5393
|
for (const candidatePath of candidatePaths) {
|
|
5413
5394
|
const sourceFile = project.getSourceFile(candidatePath);
|
|
@@ -8450,10 +8431,10 @@ function extractVueSlotsFromSetup(options) {
|
|
|
8450
8431
|
if (!body)
|
|
8451
8432
|
return [];
|
|
8452
8433
|
const slotsByName = /* @__PURE__ */ new Map();
|
|
8453
|
-
for (const
|
|
8454
|
-
if (
|
|
8434
|
+
for (const access7 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
|
|
8435
|
+
if (access7.getExpression().getText() !== slotsName)
|
|
8455
8436
|
continue;
|
|
8456
|
-
const slotName =
|
|
8437
|
+
const slotName = access7.getName();
|
|
8457
8438
|
if (!slotsByName.has(slotName)) {
|
|
8458
8439
|
slotsByName.set(slotName, {
|
|
8459
8440
|
name: slotName,
|
|
@@ -9918,11 +9899,11 @@ function getElementTagNameFromFastDefinition(classDecl, project) {
|
|
|
9918
9899
|
}
|
|
9919
9900
|
function resolveImportSourcePath2(fromFilePath, specifier) {
|
|
9920
9901
|
if (specifier.startsWith(".")) {
|
|
9921
|
-
const
|
|
9922
|
-
if (
|
|
9923
|
-
return `${
|
|
9902
|
+
const resolvedPath2 = resolve10(dirname8(fromFilePath), specifier);
|
|
9903
|
+
if (resolvedPath2.endsWith(".js")) {
|
|
9904
|
+
return `${resolvedPath2.slice(0, -3)}.ts`;
|
|
9924
9905
|
}
|
|
9925
|
-
return
|
|
9906
|
+
return resolvedPath2;
|
|
9926
9907
|
}
|
|
9927
9908
|
const spectrumPrefix = "@spectrum-web-components/core/components/";
|
|
9928
9909
|
if (!specifier.startsWith(spectrumPrefix)) {
|
|
@@ -13843,7 +13824,7 @@ function errorMessage(error) {
|
|
|
13843
13824
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
13844
13825
|
}
|
|
13845
13826
|
function defaultSleep(delayMs) {
|
|
13846
|
-
return new Promise((
|
|
13827
|
+
return new Promise((resolve28) => setTimeout(resolve28, delayMs));
|
|
13847
13828
|
}
|
|
13848
13829
|
|
|
13849
13830
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/sanitize-preview.js
|
|
@@ -14084,7 +14065,7 @@ var ApiClient = class {
|
|
|
14084
14065
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14085
14066
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14086
14067
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14087
|
-
await new Promise((
|
|
14068
|
+
await new Promise((resolve28) => setTimeout(resolve28, baseDelay + jitter));
|
|
14088
14069
|
}
|
|
14089
14070
|
}
|
|
14090
14071
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -14569,6 +14550,7 @@ function readTokensFromPath2(request) {
|
|
|
14569
14550
|
init_agents();
|
|
14570
14551
|
init_agent_name();
|
|
14571
14552
|
init_models();
|
|
14553
|
+
init_binaries();
|
|
14572
14554
|
init_is_agent_name();
|
|
14573
14555
|
init_agent_supports_bedrock();
|
|
14574
14556
|
init_check_agent_auth();
|
|
@@ -16393,7 +16375,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
16393
16375
|
const message = error instanceof Error ? error.message : String(error);
|
|
16394
16376
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
16395
16377
|
throw error;
|
|
16396
|
-
await new Promise((
|
|
16378
|
+
await new Promise((resolve28) => setTimeout(resolve28, Math.min(250 * attempt, 2e3)));
|
|
16397
16379
|
}
|
|
16398
16380
|
}
|
|
16399
16381
|
}
|
|
@@ -17144,15 +17126,15 @@ function PathValidationScreen({
|
|
|
17144
17126
|
onChangePath,
|
|
17145
17127
|
onBack
|
|
17146
17128
|
}) {
|
|
17147
|
-
const
|
|
17129
|
+
const resolvedPath2 = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
17148
17130
|
const [scan, setScan] = useState5();
|
|
17149
17131
|
useEffect3(() => {
|
|
17150
|
-
setScan(scanFiles(
|
|
17151
|
-
}, [
|
|
17132
|
+
setScan(scanFiles(resolvedPath2));
|
|
17133
|
+
}, [resolvedPath2]);
|
|
17152
17134
|
const phase = phaseOf(scan);
|
|
17153
17135
|
usePathValidationControls(phase, {
|
|
17154
17136
|
onConfirm: () => {
|
|
17155
|
-
if (scan?.ok) onConfirm({ projectPath:
|
|
17137
|
+
if (scan?.ok) onConfirm({ projectPath: resolvedPath2, filePaths: scan.filePaths });
|
|
17156
17138
|
},
|
|
17157
17139
|
onChangePath,
|
|
17158
17140
|
onBack
|
|
@@ -17160,11 +17142,11 @@ function PathValidationScreen({
|
|
|
17160
17142
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
17161
17143
|
scan === void 0 && /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
|
|
17162
17144
|
"Scanning ",
|
|
17163
|
-
/* @__PURE__ */ jsx6(Text6, { bold: true, children:
|
|
17145
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, children: resolvedPath2 }),
|
|
17164
17146
|
"..."
|
|
17165
17147
|
] }),
|
|
17166
|
-
scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path:
|
|
17167
|
-
scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path:
|
|
17148
|
+
scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path: resolvedPath2 }),
|
|
17149
|
+
scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path: resolvedPath2 }),
|
|
17168
17150
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, gap: 3, children: controlsFor(phase).map((control) => /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
|
|
17169
17151
|
"[",
|
|
17170
17152
|
control.keys,
|
|
@@ -21489,6 +21471,17 @@ function PreviewValidationErrorScreen({
|
|
|
21489
21471
|
import { useCallback as useCallback5, useEffect as useEffect16, useMemo as useMemo4, useRef as useRef11, useState as useState22 } from "react";
|
|
21490
21472
|
import figures7 from "figures";
|
|
21491
21473
|
|
|
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
|
+
|
|
21492
21485
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
21493
21486
|
var HIDDEN_PROP_CATEGORIES = /* @__PURE__ */ new Set(["state", "unattached"]);
|
|
21494
21487
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
@@ -21919,13 +21912,13 @@ function serializeState(state2, originalJson) {
|
|
|
21919
21912
|
}
|
|
21920
21913
|
function Picker({ value, active }) {
|
|
21921
21914
|
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
21922
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
21923
|
-
/* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21924
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
21915
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u2039" }),
|
|
21916
|
+
/* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE3.warning : void 0, bold: active, children: value }),
|
|
21917
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u203A" })
|
|
21925
21918
|
] });
|
|
21926
21919
|
}
|
|
21927
21920
|
function Toggle({ value, active }) {
|
|
21928
|
-
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21921
|
+
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE3.warning : value ? PALETTE3.success : PALETTE3.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
21929
21922
|
}
|
|
21930
21923
|
function InlinePropField({
|
|
21931
21924
|
label,
|
|
@@ -21935,7 +21928,7 @@ function InlinePropField({
|
|
|
21935
21928
|
width
|
|
21936
21929
|
}) {
|
|
21937
21930
|
return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
21938
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21931
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, wrap: "truncate-end", children: [
|
|
21939
21932
|
focused ? "\u203A " : " ",
|
|
21940
21933
|
label
|
|
21941
21934
|
] }),
|
|
@@ -21956,7 +21949,7 @@ function DefaultValueRow({
|
|
|
21956
21949
|
focused
|
|
21957
21950
|
}) {
|
|
21958
21951
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
21959
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21952
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
21960
21953
|
focused ? "\u203A " : " ",
|
|
21961
21954
|
"default:"
|
|
21962
21955
|
] }),
|
|
@@ -21971,7 +21964,7 @@ function RowLabel({
|
|
|
21971
21964
|
return /* @__PURE__ */ jsxs22(
|
|
21972
21965
|
Text23,
|
|
21973
21966
|
{
|
|
21974
|
-
color: selected ?
|
|
21967
|
+
color: selected ? PALETTE3.inverse : PALETTE3.info,
|
|
21975
21968
|
bold: selected,
|
|
21976
21969
|
backgroundColor: selected ? "blue" : void 0,
|
|
21977
21970
|
wrap: "truncate-end",
|
|
@@ -21989,7 +21982,7 @@ function ValueInputRow({
|
|
|
21989
21982
|
cursorVisible
|
|
21990
21983
|
}) {
|
|
21991
21984
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
|
|
21992
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
21985
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.info, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
21993
21986
|
/* @__PURE__ */ jsx27(Text23, { children: valueText }),
|
|
21994
21987
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
|
|
21995
21988
|
] });
|
|
@@ -22006,7 +21999,7 @@ function EditableListItem({
|
|
|
22006
21999
|
if (isBeingEdited) {
|
|
22007
22000
|
return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
22008
22001
|
}
|
|
22009
|
-
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
22002
|
+
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE3.info : void 0, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
|
|
22010
22003
|
}
|
|
22011
22004
|
function EditableValueList({
|
|
22012
22005
|
values,
|
|
@@ -22020,7 +22013,7 @@ function EditableValueList({
|
|
|
22020
22013
|
showAddInput
|
|
22021
22014
|
}) {
|
|
22022
22015
|
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
22023
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22016
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: emptyMessage }) : /* @__PURE__ */ jsx27(Box21, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: emptyMessage }) })),
|
|
22024
22017
|
values.map((value, index) => /* @__PURE__ */ jsx27(
|
|
22025
22018
|
EditableListItem,
|
|
22026
22019
|
{
|
|
@@ -22046,11 +22039,11 @@ function DefaultSubRow({
|
|
|
22046
22039
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22047
22040
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
22048
22041
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22049
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22042
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22050
22043
|
focused ? "\u203A " : " ",
|
|
22051
22044
|
"default:"
|
|
22052
22045
|
] }),
|
|
22053
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22046
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(not applicable)" })
|
|
22054
22047
|
] });
|
|
22055
22048
|
}
|
|
22056
22049
|
if (prop.type === "boolean") {
|
|
@@ -22060,11 +22053,11 @@ function DefaultSubRow({
|
|
|
22060
22053
|
if (prop.type === "enum") {
|
|
22061
22054
|
if (prop.values.length === 0) {
|
|
22062
22055
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22063
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22056
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22064
22057
|
focused ? "\u203A " : " ",
|
|
22065
22058
|
"default:"
|
|
22066
22059
|
] }),
|
|
22067
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22060
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(no values defined)" })
|
|
22068
22061
|
] });
|
|
22069
22062
|
}
|
|
22070
22063
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
@@ -22073,11 +22066,11 @@ function DefaultSubRow({
|
|
|
22073
22066
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
22074
22067
|
if (active) {
|
|
22075
22068
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
|
|
22076
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22069
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22077
22070
|
focused ? "\u203A " : " ",
|
|
22078
22071
|
"default:"
|
|
22079
22072
|
] }),
|
|
22080
|
-
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor:
|
|
22073
|
+
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
22081
22074
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
|
|
22082
22075
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
22083
22076
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
|
|
@@ -22085,11 +22078,11 @@ function DefaultSubRow({
|
|
|
22085
22078
|
] });
|
|
22086
22079
|
}
|
|
22087
22080
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22088
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22081
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22089
22082
|
focused ? "\u203A " : " ",
|
|
22090
22083
|
"default:"
|
|
22091
22084
|
] }),
|
|
22092
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 :
|
|
22085
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE3.muted, children: value || "(none)" })
|
|
22093
22086
|
] });
|
|
22094
22087
|
}
|
|
22095
22088
|
function DescriptionField({
|
|
@@ -22105,15 +22098,15 @@ function DescriptionField({
|
|
|
22105
22098
|
}) {
|
|
22106
22099
|
if (compact) {
|
|
22107
22100
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22108
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22101
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22109
22102
|
focused ? "\u203A " : " ",
|
|
22110
22103
|
label
|
|
22111
22104
|
] }),
|
|
22112
|
-
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 :
|
|
22105
|
+
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE3.muted, children: value || "\u2014" })
|
|
22113
22106
|
] });
|
|
22114
22107
|
}
|
|
22115
22108
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
22116
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22109
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22117
22110
|
focused ? "\u203A " : " ",
|
|
22118
22111
|
label
|
|
22119
22112
|
] }),
|
|
@@ -22177,7 +22170,7 @@ function PropRow({
|
|
|
22177
22170
|
] }),
|
|
22178
22171
|
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" }) }),
|
|
22179
22172
|
prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22180
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ?
|
|
22173
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "values", children: [
|
|
22181
22174
|
activeField === "values" ? "\u203A " : " ",
|
|
22182
22175
|
"values:"
|
|
22183
22176
|
] }),
|
|
@@ -22198,27 +22191,27 @@ function PropRow({
|
|
|
22198
22191
|
}
|
|
22199
22192
|
),
|
|
22200
22193
|
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22201
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ?
|
|
22194
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "allowed", children: [
|
|
22202
22195
|
activeField === "allowed" ? "\u203A " : " ",
|
|
22203
22196
|
"allowed:"
|
|
22204
22197
|
] }),
|
|
22205
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor:
|
|
22198
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: /* @__PURE__ */ jsx27(Text23, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx27(
|
|
22206
22199
|
Text23,
|
|
22207
22200
|
{
|
|
22208
|
-
color: activeField !== "allowed" && prop.allowed.length === 0 ?
|
|
22201
|
+
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE3.muted : void 0,
|
|
22209
22202
|
wrap: "wrap",
|
|
22210
22203
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
22211
22204
|
}
|
|
22212
22205
|
)
|
|
22213
22206
|
] }),
|
|
22214
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
22207
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: (() => {
|
|
22215
22208
|
const max = Math.max(8, width - 8);
|
|
22216
22209
|
const text = `~ ${rationale}`;
|
|
22217
22210
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22218
22211
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22219
22212
|
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
|
|
22220
22213
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22221
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22214
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "values:" }),
|
|
22222
22215
|
activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22223
22216
|
] }),
|
|
22224
22217
|
/* @__PURE__ */ jsx27(
|
|
@@ -22279,7 +22272,7 @@ function SlotRow({
|
|
|
22279
22272
|
/* @__PURE__ */ jsxs22(
|
|
22280
22273
|
Text23,
|
|
22281
22274
|
{
|
|
22282
|
-
color: activeField === "allowedComponents" ?
|
|
22275
|
+
color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
|
|
22283
22276
|
bold: activeField === "allowedComponents",
|
|
22284
22277
|
children: [
|
|
22285
22278
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22287,14 +22280,14 @@ function SlotRow({
|
|
|
22287
22280
|
]
|
|
22288
22281
|
}
|
|
22289
22282
|
),
|
|
22290
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22283
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
22291
22284
|
] }),
|
|
22292
22285
|
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22293
22286
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22294
22287
|
/* @__PURE__ */ jsxs22(
|
|
22295
22288
|
Text23,
|
|
22296
22289
|
{
|
|
22297
|
-
color: activeField === "allowedComponents" ?
|
|
22290
|
+
color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
|
|
22298
22291
|
bold: activeField === "allowedComponents",
|
|
22299
22292
|
children: [
|
|
22300
22293
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22302,7 +22295,7 @@ function SlotRow({
|
|
|
22302
22295
|
]
|
|
22303
22296
|
}
|
|
22304
22297
|
),
|
|
22305
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color:
|
|
22298
|
+
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.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" })
|
|
22306
22299
|
] }),
|
|
22307
22300
|
/* @__PURE__ */ jsx27(
|
|
22308
22301
|
EditableValueList,
|
|
@@ -22318,21 +22311,21 @@ function SlotRow({
|
|
|
22318
22311
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
22319
22312
|
}
|
|
22320
22313
|
),
|
|
22321
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22314
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
22322
22315
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22323
22316
|
if (filtered.length === 0) {
|
|
22324
|
-
return /* @__PURE__ */ jsx27(Text23, { color:
|
|
22317
|
+
return /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
22325
22318
|
}
|
|
22326
22319
|
const cursor = pickerCursor % filtered.length;
|
|
22327
22320
|
const MAX_VISIBLE = 5;
|
|
22328
22321
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
22329
22322
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22330
22323
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22331
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22324
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22332
22325
|
slice.map((name, i) => {
|
|
22333
22326
|
const absIdx = start + i;
|
|
22334
22327
|
const isCursor = absIdx === cursor;
|
|
22335
|
-
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ?
|
|
22328
|
+
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE3.info : PALETTE3.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
22336
22329
|
})
|
|
22337
22330
|
] });
|
|
22338
22331
|
})() })
|
|
@@ -23161,18 +23154,18 @@ function FieldEditor({
|
|
|
23161
23154
|
});
|
|
23162
23155
|
const innerWidth = Math.max(1, width - 2);
|
|
23163
23156
|
if (parseErr) {
|
|
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:
|
|
23157
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE3.error, children: [
|
|
23158
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
23159
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.error, children: parseErr }),
|
|
23160
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
23168
23161
|
] });
|
|
23169
23162
|
}
|
|
23170
23163
|
if (props.length === 0 && slots.length === 0) {
|
|
23171
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
23172
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23173
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23174
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23175
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23164
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE3.warning, children: [
|
|
23165
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
23166
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
23167
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "You can add fields manually below or reject this component." }),
|
|
23168
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
23176
23169
|
] });
|
|
23177
23170
|
}
|
|
23178
23171
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -23301,7 +23294,7 @@ function FieldEditor({
|
|
|
23301
23294
|
const renderRow = (row, index) => {
|
|
23302
23295
|
const key = rowKey(row, index);
|
|
23303
23296
|
if (row.kind === "header") {
|
|
23304
|
-
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23297
|
+
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.success, children: row.label }) }, key);
|
|
23305
23298
|
}
|
|
23306
23299
|
if (row.kind === "component-description") {
|
|
23307
23300
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -23383,9 +23376,9 @@ function FieldEditor({
|
|
|
23383
23376
|
...fixedHeight ? { height } : { minHeight: height },
|
|
23384
23377
|
clipOverflow: fixedHeight,
|
|
23385
23378
|
borderStyle: "single",
|
|
23386
|
-
borderColor: hasEmptyProperties ?
|
|
23379
|
+
borderColor: hasEmptyProperties ? PALETTE3.warning : active ? PALETTE3.info : PALETTE3.border,
|
|
23387
23380
|
children: [
|
|
23388
|
-
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23381
|
+
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
23389
23382
|
header,
|
|
23390
23383
|
/* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
|
|
23391
23384
|
PropRow,
|
|
@@ -23436,7 +23429,7 @@ function FieldEditor({
|
|
|
23436
23429
|
`visible-${key}`
|
|
23437
23430
|
);
|
|
23438
23431
|
}) }),
|
|
23439
|
-
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23432
|
+
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
23440
23433
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
23441
23434
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
23442
23435
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -23446,20 +23439,20 @@ function FieldEditor({
|
|
|
23446
23439
|
const headerPath = path5 ?? "<unknown source path>";
|
|
23447
23440
|
if (!start || !end2 || !src) {
|
|
23448
23441
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23449
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23450
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23442
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, bold: true, children: `source: ${headerPath}` }),
|
|
23443
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no source location captured for this prop)" }),
|
|
23451
23444
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
|
|
23452
23445
|
] });
|
|
23453
23446
|
}
|
|
23454
23447
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
23455
23448
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23456
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23457
|
-
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color:
|
|
23449
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
23450
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: ln }, `source-line-${i}`)),
|
|
23458
23451
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
|
|
23459
23452
|
] });
|
|
23460
23453
|
})(),
|
|
23461
|
-
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
23462
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23454
|
+
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.info, paddingX: 1, children: [
|
|
23455
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.info, children: "Keybindings" }),
|
|
23463
23456
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23464
23457
|
/* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
|
|
23465
23458
|
/* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
|
|
@@ -23484,10 +23477,10 @@ function FieldEditor({
|
|
|
23484
23477
|
/* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
23485
23478
|
/* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
|
|
23486
23479
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23487
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23480
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "press ? or Esc to close" })
|
|
23488
23481
|
] }),
|
|
23489
|
-
validationError && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23490
|
-
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
23482
|
+
validationError && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.error, children: "\u2717 " + validationError }),
|
|
23483
|
+
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: modeLabel }) })
|
|
23491
23484
|
]
|
|
23492
23485
|
}
|
|
23493
23486
|
);
|
|
@@ -23539,16 +23532,16 @@ function RationaleLine({ line, active }) {
|
|
|
23539
23532
|
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
|
|
23540
23533
|
}
|
|
23541
23534
|
if (line.kind === "heading") {
|
|
23542
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ?
|
|
23535
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE3.info : PALETTE3.muted, children: line.text }) });
|
|
23543
23536
|
}
|
|
23544
23537
|
if (line.kind === "label") {
|
|
23545
23538
|
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
23546
23539
|
line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
|
|
23547
|
-
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color :
|
|
23548
|
-
line.suffix && /* @__PURE__ */ jsx28(Text24, { color:
|
|
23540
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color : PALETTE3.muted, children: line.text }),
|
|
23541
|
+
line.suffix && /* @__PURE__ */ jsx28(Text24, { color: PALETTE3.muted, children: line.suffix })
|
|
23549
23542
|
] });
|
|
23550
23543
|
}
|
|
23551
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ?
|
|
23544
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE3.muted : void 0, children: line.text }) });
|
|
23552
23545
|
}
|
|
23553
23546
|
|
|
23554
23547
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
@@ -23627,9 +23620,9 @@ function ComponentRationalePanel({
|
|
|
23627
23620
|
width,
|
|
23628
23621
|
height: height + 2,
|
|
23629
23622
|
borderStyle: "single",
|
|
23630
|
-
borderColor: active ?
|
|
23623
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23631
23624
|
children: [
|
|
23632
|
-
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 :
|
|
23625
|
+
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE3.muted, children: `Component rationale: ${data.name}` }) }),
|
|
23633
23626
|
visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
|
|
23634
23627
|
/* @__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" }) })
|
|
23635
23628
|
]
|
|
@@ -23644,7 +23637,7 @@ import { Box as Box25 } from "ink";
|
|
|
23644
23637
|
import { Text as Text26 } from "ink";
|
|
23645
23638
|
import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
|
|
23646
23639
|
function HighlightedLine({ parts }) {
|
|
23647
|
-
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ?
|
|
23640
|
+
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE3.muted : part.color, children: part.text }, i)) });
|
|
23648
23641
|
}
|
|
23649
23642
|
|
|
23650
23643
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
@@ -23664,10 +23657,10 @@ function ScrollablePanel({
|
|
|
23664
23657
|
const overflowed = totalLines > height;
|
|
23665
23658
|
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
23666
23659
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
23667
|
-
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 :
|
|
23660
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE3.muted, children: title }),
|
|
23668
23661
|
overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
23669
23662
|
/* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
|
|
23670
|
-
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 :
|
|
23663
|
+
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE3.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
23671
23664
|
] })
|
|
23672
23665
|
] }),
|
|
23673
23666
|
children
|
|
@@ -23753,7 +23746,7 @@ function renderRationaleLines(rows, innerWidth) {
|
|
|
23753
23746
|
out.push({
|
|
23754
23747
|
kind: "label",
|
|
23755
23748
|
text: row.name,
|
|
23756
|
-
color:
|
|
23749
|
+
color: PALETTE3.info,
|
|
23757
23750
|
suffix: row.kind === "slot" ? " (slot)" : void 0
|
|
23758
23751
|
});
|
|
23759
23752
|
for (const line of wrapText(row.rationale, innerWidth)) {
|
|
@@ -23789,7 +23782,7 @@ function RationalePanel({
|
|
|
23789
23782
|
totalLines,
|
|
23790
23783
|
visibleStart,
|
|
23791
23784
|
visibleEnd,
|
|
23792
|
-
borderColor: active ?
|
|
23785
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23793
23786
|
children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
|
|
23794
23787
|
}
|
|
23795
23788
|
);
|
|
@@ -23824,29 +23817,21 @@ function TokenReviewPanel({
|
|
|
23824
23817
|
width,
|
|
23825
23818
|
height: height + 2,
|
|
23826
23819
|
borderStyle: "single",
|
|
23827
|
-
borderColor: active ?
|
|
23820
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23828
23821
|
children: [
|
|
23829
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23830
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23822
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE3.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
23823
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
23831
23824
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23832
|
-
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
23825
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
23833
23826
|
visiblePaths.map((path5, i) => {
|
|
23834
23827
|
const pathIndex = scrollStart + i;
|
|
23835
23828
|
const checked = editSelection.has(path5);
|
|
23836
23829
|
const focused = pathIndex === editCursor;
|
|
23837
|
-
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
23838
|
-
Text28,
|
|
23839
|
-
{
|
|
23840
|
-
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
23841
|
-
bold: focused,
|
|
23842
|
-
wrap: "truncate",
|
|
23843
|
-
children: ` [${checked ? "x" : " "}] ${path5}`
|
|
23844
|
-
}
|
|
23845
|
-
) }, path5);
|
|
23830
|
+
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE3.info : active ? void 0 : PALETTE3.muted, bold: focused, wrap: "truncate", children: ` [${checked ? "x" : " "}] ${path5}` }) }, path5);
|
|
23846
23831
|
}),
|
|
23847
23832
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23848
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23849
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23833
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
23834
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
23850
23835
|
]
|
|
23851
23836
|
}
|
|
23852
23837
|
);
|
|
@@ -23858,16 +23843,16 @@ function TokenReviewPanel({
|
|
|
23858
23843
|
width,
|
|
23859
23844
|
height: height + 2,
|
|
23860
23845
|
borderStyle: "single",
|
|
23861
|
-
borderColor: active ?
|
|
23846
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23862
23847
|
children: [
|
|
23863
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23864
|
-
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
23848
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE3.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
23849
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: "(no token suggestions for this component)" }),
|
|
23865
23850
|
suggestions.map((s, i) => {
|
|
23866
23851
|
const focused = i === selectedRow;
|
|
23867
23852
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
23868
|
-
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ?
|
|
23869
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23870
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23853
|
+
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE3.info : active ? void 0 : PALETTE3.muted, bold: focused, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
|
|
23854
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
23855
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
23871
23856
|
] }, s.propName);
|
|
23872
23857
|
}),
|
|
23873
23858
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
@@ -23952,9 +23937,9 @@ function ReviewDetailsPanel({
|
|
|
23952
23937
|
const sourceLineCount = Math.max(1, height - 4);
|
|
23953
23938
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
23954
23939
|
return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
23955
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
23956
|
-
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color:
|
|
23957
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
23940
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
23941
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, children: "(no source captured)" }),
|
|
23942
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
23958
23943
|
] });
|
|
23959
23944
|
}
|
|
23960
23945
|
if (panelOpen === "token-review") {
|
|
@@ -24104,17 +24089,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
24104
24089
|
hidden
|
|
24105
24090
|
}) {
|
|
24106
24091
|
if (hidden || count === 0) return null;
|
|
24107
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24092
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
24108
24093
|
}
|
|
24109
24094
|
function ReviewNoSelection() {
|
|
24110
|
-
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
24095
|
+
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.muted, children: "No component selected" }) });
|
|
24111
24096
|
}
|
|
24112
24097
|
function ReviewFinalizeError({
|
|
24113
24098
|
message,
|
|
24114
24099
|
hidden
|
|
24115
24100
|
}) {
|
|
24116
24101
|
if (hidden || !message) return null;
|
|
24117
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24102
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.error, children: `\u26A0 ${message}` });
|
|
24118
24103
|
}
|
|
24119
24104
|
function ReviewPanelFooter({
|
|
24120
24105
|
reviewEditor,
|
|
@@ -24138,7 +24123,7 @@ function ReviewComponentTitle({
|
|
|
24138
24123
|
return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
24139
24124
|
/* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
24140
24125
|
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
24141
|
-
/* @__PURE__ */ jsxs28(Text30, { color:
|
|
24126
|
+
/* @__PURE__ */ jsxs28(Text30, { color: PALETTE3.muted, wrap: "truncate-end", children: [
|
|
24142
24127
|
propCount,
|
|
24143
24128
|
" prop",
|
|
24144
24129
|
propCount !== 1 ? "s" : "",
|
|
@@ -24194,8 +24179,8 @@ function ReviewComponentPanel({
|
|
|
24194
24179
|
)
|
|
24195
24180
|
}
|
|
24196
24181
|
) }),
|
|
24197
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ?
|
|
24198
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
24182
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ? PALETTE3.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
24183
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx37(
|
|
24199
24184
|
ReviewPanelFooter,
|
|
24200
24185
|
{
|
|
24201
24186
|
reviewEditor,
|
|
@@ -24223,11 +24208,11 @@ function countReviewStatuses(entries) {
|
|
|
24223
24208
|
);
|
|
24224
24209
|
}
|
|
24225
24210
|
function ReviewLoadingState() {
|
|
24226
|
-
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color:
|
|
24211
|
+
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE3.muted, children: "Loading generated definitions..." }) });
|
|
24227
24212
|
}
|
|
24228
24213
|
function ReviewLoadError({ message }) {
|
|
24229
24214
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
24230
|
-
/* @__PURE__ */ jsx38(Text31, { color:
|
|
24215
|
+
/* @__PURE__ */ jsx38(Text31, { color: PALETTE3.error, children: message }),
|
|
24231
24216
|
/* @__PURE__ */ jsx38(Text31, { children: " " }),
|
|
24232
24217
|
/* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
|
|
24233
24218
|
] });
|
|
@@ -24463,41 +24448,41 @@ function FinalizeDialog({
|
|
|
24463
24448
|
/* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
24464
24449
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24465
24450
|
/* @__PURE__ */ jsxs30(Text32, { children: [
|
|
24466
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24451
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.success, children: [
|
|
24467
24452
|
accepted,
|
|
24468
24453
|
" accepted"
|
|
24469
24454
|
] }),
|
|
24470
24455
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24471
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24456
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.error, children: [
|
|
24472
24457
|
rejected,
|
|
24473
24458
|
" rejected"
|
|
24474
24459
|
] }),
|
|
24475
24460
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24476
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24461
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.muted, children: [
|
|
24477
24462
|
needsReview,
|
|
24478
24463
|
" unresolved"
|
|
24479
24464
|
] })
|
|
24480
24465
|
] }),
|
|
24481
24466
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24482
24467
|
noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24483
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24484
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24468
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE3.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
24469
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
24485
24470
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24486
24471
|
] }),
|
|
24487
24472
|
!allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24488
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24489
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24473
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
24474
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "Only explicitly accepted components ship." }),
|
|
24490
24475
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24491
24476
|
] }),
|
|
24492
24477
|
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
|
|
24493
|
-
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color:
|
|
24478
|
+
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24494
24479
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24495
24480
|
] }),
|
|
24496
24481
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24497
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24498
|
-
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color:
|
|
24499
|
-
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color:
|
|
24500
|
-
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color:
|
|
24482
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE3.error, children: removedComponentsHeader(removed.length, false) }),
|
|
24483
|
+
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.muted, children: "\u2191 more above" }),
|
|
24484
|
+
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.error, children: removedComponentLine(rc) }, rc.id)),
|
|
24485
|
+
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.muted, children: "\u2193 more below" }),
|
|
24501
24486
|
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
|
|
24502
24487
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24503
24488
|
] }),
|
|
@@ -24991,8 +24976,8 @@ function ReviewStepDialogs({
|
|
|
24991
24976
|
}
|
|
24992
24977
|
function ReviewReloadDialog({ open }) {
|
|
24993
24978
|
if (!open) return null;
|
|
24994
|
-
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
24995
|
-
/* @__PURE__ */ jsx41(Text34, { bold: true, color:
|
|
24979
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
24980
|
+
/* @__PURE__ */ jsx41(Text34, { bold: true, color: PALETTE3.warning, children: "Reload from saved state?" }),
|
|
24996
24981
|
/* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
|
|
24997
24982
|
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
24998
24983
|
/* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
|
|
@@ -25378,19 +25363,19 @@ function LivePreviewSummary({
|
|
|
25378
25363
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25379
25364
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25380
25365
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25381
|
-
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
25382
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
25366
|
+
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: "Preview: disabled (creds rejected)" });
|
|
25367
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: `Preview: ${spinner} running...` });
|
|
25383
25368
|
if (!hasCounts) return null;
|
|
25384
25369
|
return /* @__PURE__ */ jsxs33(Box32, { children: [
|
|
25385
25370
|
/* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
|
|
25386
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25371
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.success, children: `${counts.new} new` }),
|
|
25387
25372
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25388
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25373
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.warning, children: `${counts.changed} changed` }),
|
|
25389
25374
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25390
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25375
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: `${counts.removed} removed` }),
|
|
25391
25376
|
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
|
|
25392
25377
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25393
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25378
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.error, bold: true, children: `${counts.breaking} breaking` })
|
|
25394
25379
|
] });
|
|
25395
25380
|
}
|
|
25396
25381
|
|
|
@@ -25436,10 +25421,10 @@ function CyclePathLine({
|
|
|
25436
25421
|
highlightComponents = false,
|
|
25437
25422
|
highlightLine = false
|
|
25438
25423
|
}) {
|
|
25439
|
-
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ?
|
|
25424
|
+
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE3.warning : void 0, children: [
|
|
25440
25425
|
prefix,
|
|
25441
25426
|
segments.map(
|
|
25442
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
25427
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.info, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: segment.text }, index) : /* @__PURE__ */ jsx43(Text36, { color: highlightComponents ? PALETTE3.warning : void 0, children: segment.text }, index)
|
|
25443
25428
|
)
|
|
25444
25429
|
] });
|
|
25445
25430
|
}
|
|
@@ -25451,9 +25436,9 @@ function CycleDetailPanel({
|
|
|
25451
25436
|
height
|
|
25452
25437
|
}) {
|
|
25453
25438
|
const lines = [
|
|
25454
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25455
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25456
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25439
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
25440
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
25441
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
25457
25442
|
/* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
|
|
25458
25443
|
];
|
|
25459
25444
|
cycles.forEach((cycle, index) => {
|
|
@@ -25465,7 +25450,7 @@ function CycleDetailPanel({
|
|
|
25465
25450
|
);
|
|
25466
25451
|
if (cycle.suggestedBreak) {
|
|
25467
25452
|
lines.push(
|
|
25468
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25453
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
25469
25454
|
);
|
|
25470
25455
|
}
|
|
25471
25456
|
lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
|
|
@@ -25473,9 +25458,9 @@ function CycleDetailPanel({
|
|
|
25473
25458
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
25474
25459
|
const viewportHeight = Math.max(1, height - 3);
|
|
25475
25460
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
25476
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25461
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE3.warning, paddingLeft: 1, children: [
|
|
25477
25462
|
visible,
|
|
25478
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25463
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: footer })
|
|
25479
25464
|
] });
|
|
25480
25465
|
}
|
|
25481
25466
|
function BreakCyclePanel({
|
|
@@ -25486,14 +25471,14 @@ function BreakCyclePanel({
|
|
|
25486
25471
|
width,
|
|
25487
25472
|
height
|
|
25488
25473
|
}) {
|
|
25489
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25490
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25474
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE3.warning, paddingLeft: 1, children: [
|
|
25475
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
25491
25476
|
cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
25492
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25477
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
25493
25478
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
25494
|
-
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
25479
|
+
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "remove slot edge:" }),
|
|
25495
25480
|
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}`)),
|
|
25496
|
-
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25481
|
+
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx43(Text36, { children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
|
|
25497
25482
|
] });
|
|
25498
25483
|
}
|
|
25499
25484
|
var HELP_SECTIONS2 = [
|
|
@@ -25599,7 +25584,7 @@ function deriveBreakingChanges(response) {
|
|
|
25599
25584
|
}
|
|
25600
25585
|
function GenerateReviewStep(props) {
|
|
25601
25586
|
if (!props.extractSessionId) {
|
|
25602
|
-
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color:
|
|
25587
|
+
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
25603
25588
|
}
|
|
25604
25589
|
return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
25605
25590
|
}
|
|
@@ -26516,8 +26501,8 @@ function GenerateReviewStepView({
|
|
|
26516
26501
|
}
|
|
26517
26502
|
),
|
|
26518
26503
|
/* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26519
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26520
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
26504
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.error, paddingX: 1, children: [
|
|
26505
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26521
26506
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
26522
26507
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
26523
26508
|
removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
|
|
@@ -26526,7 +26511,7 @@ function GenerateReviewStepView({
|
|
|
26526
26511
|
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
|
|
26527
26512
|
Text36,
|
|
26528
26513
|
{
|
|
26529
|
-
color:
|
|
26514
|
+
color: PALETTE3.warning,
|
|
26530
26515
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
26531
26516
|
}
|
|
26532
26517
|
) }),
|
|
@@ -26534,10 +26519,10 @@ function GenerateReviewStepView({
|
|
|
26534
26519
|
const row = breakingRows[breakingCursor];
|
|
26535
26520
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26536
26521
|
if (!comp) return null;
|
|
26537
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26538
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
26539
|
-
comp.impact && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26540
|
-
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
26522
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
26523
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
26524
|
+
comp.impact && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
26525
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx43(Text36, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
26541
26526
|
/* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
|
|
26542
26527
|
] });
|
|
26543
26528
|
})(),
|
|
@@ -26560,11 +26545,11 @@ function GenerateReviewStepView({
|
|
|
26560
26545
|
const participantSet = cycleView.structural;
|
|
26561
26546
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26562
26547
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26563
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor:
|
|
26564
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26565
|
-
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26566
|
-
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26567
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26548
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE3.error, paddingX: 1, children: [
|
|
26549
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
26550
|
+
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
26551
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
26552
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
26568
26553
|
] });
|
|
26569
26554
|
})(),
|
|
26570
26555
|
/* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
@@ -26680,7 +26665,7 @@ function GenerateReviewStepView({
|
|
|
26680
26665
|
) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
|
|
26681
26666
|
] }),
|
|
26682
26667
|
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
|
|
26683
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26668
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26684
26669
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
26685
26670
|
return /* @__PURE__ */ jsx43(
|
|
26686
26671
|
CyclePathLine,
|
|
@@ -26693,7 +26678,7 @@ function GenerateReviewStepView({
|
|
|
26693
26678
|
`cyc-banner-${idx}`
|
|
26694
26679
|
);
|
|
26695
26680
|
}),
|
|
26696
|
-
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26681
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
26697
26682
|
/* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
|
|
26698
26683
|
] }),
|
|
26699
26684
|
/* @__PURE__ */ jsx43(
|
|
@@ -26716,8 +26701,8 @@ import { Box as Box34, Text as Text37 } from "ink";
|
|
|
26716
26701
|
|
|
26717
26702
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
|
|
26718
26703
|
import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
|
|
26719
|
-
var
|
|
26720
|
-
...
|
|
26704
|
+
var PALETTE4 = {
|
|
26705
|
+
...PALETTE3,
|
|
26721
26706
|
link: "#58A6FF"
|
|
26722
26707
|
};
|
|
26723
26708
|
var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
@@ -26736,13 +26721,13 @@ var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
|
26736
26721
|
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
26737
26722
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
26738
26723
|
if (!generatePromptPath) return null;
|
|
26739
|
-
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26740
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26741
|
-
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color:
|
|
26724
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE4.warning, paddingX: 1, children: [
|
|
26725
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE4.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
26726
|
+
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color: PALETTE4.warning, children: [
|
|
26742
26727
|
"components: ",
|
|
26743
26728
|
generatePromptPath
|
|
26744
26729
|
] }) : null,
|
|
26745
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26730
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE4.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
26746
26731
|
] });
|
|
26747
26732
|
}
|
|
26748
26733
|
|
|
@@ -26767,10 +26752,10 @@ import { Box as Box35, Text as Text38 } from "ink";
|
|
|
26767
26752
|
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
26768
26753
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
26769
26754
|
return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
|
|
26770
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26755
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Space:" }),
|
|
26771
26756
|
/* @__PURE__ */ jsx45(Text38, { children: spaceId }),
|
|
26772
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26773
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26757
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "/" }),
|
|
26758
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Environment:" }),
|
|
26774
26759
|
/* @__PURE__ */ jsx45(Text38, { children: environmentId })
|
|
26775
26760
|
] });
|
|
26776
26761
|
}
|
|
@@ -26782,13 +26767,13 @@ function EntityRows({ entity, label }) {
|
|
|
26782
26767
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
26783
26768
|
return /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
26784
26769
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
|
|
26785
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26770
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "\u2713" }),
|
|
26786
26771
|
" ",
|
|
26787
26772
|
plural3(entity[action]),
|
|
26788
26773
|
" ",
|
|
26789
26774
|
action
|
|
26790
26775
|
] }, action)),
|
|
26791
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26776
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
26792
26777
|
"\u2717 ",
|
|
26793
26778
|
plural3(entity.failed),
|
|
26794
26779
|
" failed \u2014 check logs above"
|
|
@@ -26797,8 +26782,8 @@ function EntityRows({ entity, label }) {
|
|
|
26797
26782
|
}
|
|
26798
26783
|
function LinkRow({ title, url }) {
|
|
26799
26784
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26800
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26801
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26785
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.muted, children: title }),
|
|
26786
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.link, children: url })
|
|
26802
26787
|
] });
|
|
26803
26788
|
}
|
|
26804
26789
|
function DoneStep({
|
|
@@ -26821,17 +26806,17 @@ function DoneStep({
|
|
|
26821
26806
|
const success = totalFailed === 0;
|
|
26822
26807
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
26823
26808
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
26824
|
-
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26825
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color:
|
|
26809
|
+
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE4.success, children: "Done!" }) : /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE4.warning, children: "\u26A0 Finished with errors" }),
|
|
26810
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE4.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26826
26811
|
/* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
26827
26812
|
/* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
26828
|
-
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26813
|
+
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.muted, children: [
|
|
26829
26814
|
"Push result: ",
|
|
26830
26815
|
summary.succeeded,
|
|
26831
26816
|
"/",
|
|
26832
26817
|
summary.total,
|
|
26833
26818
|
" succeeded",
|
|
26834
|
-
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26819
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
26835
26820
|
", ",
|
|
26836
26821
|
summary.failed,
|
|
26837
26822
|
" failed"
|
|
@@ -26839,8 +26824,8 @@ function DoneStep({
|
|
|
26839
26824
|
] }) })
|
|
26840
26825
|
] }),
|
|
26841
26826
|
failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26842
|
-
/* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26843
|
-
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26827
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE4.error, children: "Failure details" }),
|
|
26828
|
+
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
26844
26829
|
failure.entityType,
|
|
26845
26830
|
" ",
|
|
26846
26831
|
failure.entityId,
|
|
@@ -26850,7 +26835,7 @@ function DoneStep({
|
|
|
26850
26835
|
] }),
|
|
26851
26836
|
/* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
|
|
26852
26837
|
success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
|
|
26853
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26838
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "Your design system is now in Contentful Experiences." }),
|
|
26854
26839
|
/* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
26855
26840
|
/* @__PURE__ */ jsx46(
|
|
26856
26841
|
LinkRow,
|
|
@@ -26964,7 +26949,7 @@ function PathPrompt({
|
|
|
26964
26949
|
label,
|
|
26965
26950
|
":"
|
|
26966
26951
|
] }),
|
|
26967
|
-
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ?
|
|
26952
|
+
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE4.muted : void 0, children: shown }),
|
|
26968
26953
|
/* @__PURE__ */ jsx47(Text40, { children: cursor })
|
|
26969
26954
|
] }),
|
|
26970
26955
|
/* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
|
|
@@ -27030,12 +27015,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27030
27015
|
/* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
27031
27016
|
/* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
27032
27017
|
operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27033
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27018
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Operation:" }),
|
|
27034
27019
|
/* @__PURE__ */ jsx50(Text42, { children: operationId })
|
|
27035
27020
|
] }),
|
|
27036
27021
|
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
|
|
27037
27022
|
/* @__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) }) }) }),
|
|
27038
|
-
/* @__PURE__ */ jsxs40(Text42, { color:
|
|
27023
|
+
/* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
|
|
27039
27024
|
progress.processed,
|
|
27040
27025
|
"/",
|
|
27041
27026
|
progress.total,
|
|
@@ -27043,10 +27028,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27043
27028
|
] })
|
|
27044
27029
|
] }) }),
|
|
27045
27030
|
showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27046
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27031
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Now processing:" }),
|
|
27047
27032
|
/* @__PURE__ */ jsx50(Text42, { children: showCurrent })
|
|
27048
27033
|
] }),
|
|
27049
|
-
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color:
|
|
27034
|
+
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
|
|
27050
27035
|
"Elapsed: ",
|
|
27051
27036
|
elapsed
|
|
27052
27037
|
] }) })
|
|
@@ -27236,25 +27221,25 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27236
27221
|
if (components.new.length > 0) {
|
|
27237
27222
|
lines.push({
|
|
27238
27223
|
key: "summary-components-new",
|
|
27239
|
-
color:
|
|
27224
|
+
color: PALETTE4.success,
|
|
27240
27225
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
27241
27226
|
});
|
|
27242
27227
|
for (const [index, item] of components.new.entries()) {
|
|
27243
27228
|
const name = item.key ?? item.$name ?? "unknown";
|
|
27244
|
-
lines.push({ key: `summary-components-new-${index}`, color:
|
|
27229
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
27245
27230
|
}
|
|
27246
27231
|
}
|
|
27247
27232
|
if (components.changed.length > 0) {
|
|
27248
27233
|
lines.push({
|
|
27249
27234
|
key: "summary-components-changed",
|
|
27250
|
-
color:
|
|
27235
|
+
color: PALETTE4.warning,
|
|
27251
27236
|
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
27252
27237
|
});
|
|
27253
27238
|
for (const [index, item] of components.changed.entries()) {
|
|
27254
27239
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
27255
27240
|
lines.push({
|
|
27256
27241
|
key: `summary-components-changed-${index}`,
|
|
27257
|
-
color: isBreaking ?
|
|
27242
|
+
color: isBreaking ? PALETTE4.error : PALETTE4.warning,
|
|
27258
27243
|
text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
|
|
27259
27244
|
});
|
|
27260
27245
|
}
|
|
@@ -27262,11 +27247,11 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27262
27247
|
if (components.removed.length > 0) {
|
|
27263
27248
|
lines.push({
|
|
27264
27249
|
key: "summary-components-removed",
|
|
27265
|
-
color:
|
|
27250
|
+
color: PALETTE4.warning,
|
|
27266
27251
|
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
27267
27252
|
});
|
|
27268
27253
|
for (const [index, item] of components.removed.entries()) {
|
|
27269
|
-
lines.push({ key: `summary-components-removed-${index}`, color:
|
|
27254
|
+
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE4.warning, text: ` \u2298 ${item.name}` });
|
|
27270
27255
|
}
|
|
27271
27256
|
}
|
|
27272
27257
|
if (components.unchanged.length > 0) {
|
|
@@ -27279,21 +27264,21 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27279
27264
|
if (tokens.new.length > 0) {
|
|
27280
27265
|
lines.push({
|
|
27281
27266
|
key: "summary-tokens-new",
|
|
27282
|
-
color:
|
|
27267
|
+
color: PALETTE4.success,
|
|
27283
27268
|
text: ` \uFF0B ${tokens.new.length} design tokens will be created`
|
|
27284
27269
|
});
|
|
27285
27270
|
}
|
|
27286
27271
|
if (tokens.changed.length > 0) {
|
|
27287
27272
|
lines.push({
|
|
27288
27273
|
key: "summary-tokens-changed",
|
|
27289
|
-
color:
|
|
27274
|
+
color: PALETTE4.warning,
|
|
27290
27275
|
text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
|
|
27291
27276
|
});
|
|
27292
27277
|
}
|
|
27293
27278
|
if (tokens.removed.length > 0) {
|
|
27294
27279
|
lines.push({
|
|
27295
27280
|
key: "summary-tokens-removed",
|
|
27296
|
-
color:
|
|
27281
|
+
color: PALETTE4.warning,
|
|
27297
27282
|
text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
|
|
27298
27283
|
});
|
|
27299
27284
|
}
|
|
@@ -27337,12 +27322,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
27337
27322
|
function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
|
|
27338
27323
|
lines.push({
|
|
27339
27324
|
key: `${keyPrefix}-h-${name}`,
|
|
27340
|
-
color:
|
|
27325
|
+
color: PALETTE4.warning,
|
|
27341
27326
|
text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
27342
27327
|
});
|
|
27343
27328
|
if (changeClassification?.classification !== "breaking") return;
|
|
27344
27329
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
27345
|
-
lines.push({ key: `${keyPrefix}-b-${name}`, color:
|
|
27330
|
+
lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE4.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
27346
27331
|
}
|
|
27347
27332
|
function buildPreviewDiffLines(preview) {
|
|
27348
27333
|
const lines = [];
|
|
@@ -27350,12 +27335,12 @@ function buildPreviewDiffLines(preview) {
|
|
|
27350
27335
|
for (const item of components.new) {
|
|
27351
27336
|
const raw = item;
|
|
27352
27337
|
const name = raw.key ?? raw.$name ?? "unknown";
|
|
27353
|
-
lines.push({ key: `comp-new-${name}`, color:
|
|
27338
|
+
lines.push({ key: `comp-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
27354
27339
|
const slots = raw.$slots ?? {};
|
|
27355
27340
|
for (const slotName of Object.keys(slots).sort()) {
|
|
27356
27341
|
lines.push({
|
|
27357
27342
|
key: `comp-new-${name}-slot-${slotName}`,
|
|
27358
|
-
color:
|
|
27343
|
+
color: PALETTE4.success,
|
|
27359
27344
|
text: ` slot: ${slotName}`
|
|
27360
27345
|
});
|
|
27361
27346
|
const allowed = slots[slotName]?.["$allowedComponents"];
|
|
@@ -27363,14 +27348,14 @@ function buildPreviewDiffLines(preview) {
|
|
|
27363
27348
|
const names = allowed.filter((n) => typeof n === "string");
|
|
27364
27349
|
lines.push({
|
|
27365
27350
|
key: `comp-new-${name}-slot-${slotName}-allow`,
|
|
27366
|
-
color:
|
|
27351
|
+
color: PALETTE4.success,
|
|
27367
27352
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
27368
27353
|
});
|
|
27369
27354
|
}
|
|
27370
27355
|
}
|
|
27371
27356
|
}
|
|
27372
27357
|
for (const item of components.removed) {
|
|
27373
|
-
lines.push({ key: `comp-rm-${item.name}`, color:
|
|
27358
|
+
lines.push({ key: `comp-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
|
|
27374
27359
|
}
|
|
27375
27360
|
for (const item of components.changed) {
|
|
27376
27361
|
appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
|
|
@@ -27401,10 +27386,10 @@ function buildPreviewDiffLines(preview) {
|
|
|
27401
27386
|
for (const item of tokens.new) {
|
|
27402
27387
|
const raw = item;
|
|
27403
27388
|
const name = raw.name ?? raw.path ?? "unknown";
|
|
27404
|
-
lines.push({ key: `tok-new-${name}`, color:
|
|
27389
|
+
lines.push({ key: `tok-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
27405
27390
|
}
|
|
27406
27391
|
for (const item of tokens.removed) {
|
|
27407
|
-
lines.push({ key: `tok-rm-${item.name}`, color:
|
|
27392
|
+
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
|
|
27408
27393
|
}
|
|
27409
27394
|
for (const item of tokens.changed) {
|
|
27410
27395
|
const tokenName = item.current.name;
|
|
@@ -27495,13 +27480,13 @@ function WizardPreviewStep({
|
|
|
27495
27480
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
27496
27481
|
focused: false,
|
|
27497
27482
|
children: [
|
|
27498
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ?
|
|
27499
|
-
/* @__PURE__ */ jsx51(Text43, { color:
|
|
27483
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ? PALETTE4.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
27484
|
+
/* @__PURE__ */ jsx51(Text43, { color: PALETTE4.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
27500
27485
|
]
|
|
27501
27486
|
}
|
|
27502
27487
|
)
|
|
27503
|
-
] }) : /* @__PURE__ */ jsx51(Text43, { color:
|
|
27504
|
-
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color:
|
|
27488
|
+
] }) : /* @__PURE__ */ jsx51(Text43, { color: PALETTE4.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
27489
|
+
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color: PALETTE4.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
27505
27490
|
/* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
|
|
27506
27491
|
/* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
|
|
27507
27492
|
/* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
|
|
@@ -28047,7 +28032,7 @@ var realSaveDeps = () => ({
|
|
|
28047
28032
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
28048
28033
|
appendRun,
|
|
28049
28034
|
buildSourceFingerprint,
|
|
28050
|
-
sleep: (ms) => new Promise((
|
|
28035
|
+
sleep: (ms) => new Promise((resolve28) => setTimeout(resolve28, ms)),
|
|
28051
28036
|
warn: (message) => process.stderr.write(message)
|
|
28052
28037
|
});
|
|
28053
28038
|
async function runPrintFiles(input, deps, onPatch) {
|
|
@@ -28437,12 +28422,44 @@ init_config();
|
|
|
28437
28422
|
init_debug_store();
|
|
28438
28423
|
init_debug_mode_store();
|
|
28439
28424
|
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
|
|
28440
28448
|
async function readHelpInfo() {
|
|
28441
|
-
const debugMode = await readDebugModeSetting();
|
|
28449
|
+
const [debugMode, settings] = await Promise.all([readDebugModeSetting(), readSettings2()]);
|
|
28450
|
+
const base = settings["contentfulBaseDir"];
|
|
28451
|
+
const locations = describeFileLocations({
|
|
28452
|
+
contentfulBaseDir: typeof base === "string" ? base : "",
|
|
28453
|
+
debugModeEnabled: debugMode.enabled,
|
|
28454
|
+
currentSessionDir: currentSessionDir()
|
|
28455
|
+
});
|
|
28442
28456
|
return {
|
|
28443
28457
|
storage: [
|
|
28444
28458
|
{ label: "Config folder", value: configRoot2() },
|
|
28445
|
-
{ label: "Settings file", value: configFilePath2() }
|
|
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 }
|
|
28446
28463
|
],
|
|
28447
28464
|
troubleshooting: [
|
|
28448
28465
|
{ label: "CLI version", value: readPackageVersion() },
|
|
@@ -28463,7 +28480,7 @@ function Section({ title, rows }) {
|
|
|
28463
28480
|
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
28464
28481
|
/* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
|
|
28465
28482
|
rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
|
|
28466
|
-
/* @__PURE__ */ jsx53(Box42, { width:
|
|
28483
|
+
/* @__PURE__ */ jsx53(Box42, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
|
|
28467
28484
|
/* @__PURE__ */ jsx53(Text44, { children: row.value })
|
|
28468
28485
|
] }, row.label))
|
|
28469
28486
|
] });
|
|
@@ -28563,15 +28580,710 @@ function SettingsScreen({
|
|
|
28563
28580
|
}
|
|
28564
28581
|
|
|
28565
28582
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28566
|
-
import {
|
|
28567
|
-
import { Box as
|
|
28568
|
-
|
|
28583
|
+
import { useState as useState33 } from "react";
|
|
28584
|
+
import { Box as Box48, Text as Text51, useInput as useInput14 } from "ink";
|
|
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();
|
|
28569
28590
|
|
|
28570
28591
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
28571
28592
|
init_config();
|
|
28572
28593
|
var readV1Store = readSettings2;
|
|
28573
28594
|
var writeV1Store = writeSettings2;
|
|
28574
28595
|
|
|
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
|
+
|
|
28575
29287
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
28576
29288
|
async function readCredentials() {
|
|
28577
29289
|
const store = await readV1Store();
|
|
@@ -28597,17 +29309,16 @@ async function writeCredentials(config) {
|
|
|
28597
29309
|
await writeV1Store(merged);
|
|
28598
29310
|
}
|
|
28599
29311
|
|
|
28600
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/
|
|
28601
|
-
|
|
28602
|
-
|
|
28603
|
-
|
|
28604
|
-
"
|
|
28605
|
-
"
|
|
28606
|
-
"
|
|
28607
|
-
"
|
|
28608
|
-
"
|
|
28609
|
-
"
|
|
28610
|
-
"contentfulBaseDir"
|
|
29312
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
29313
|
+
import { jsx as jsx59, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
29314
|
+
var FIELDS3 = [
|
|
29315
|
+
{ key: "spaceId", label: "Space ID" },
|
|
29316
|
+
{ key: "environmentId", label: "Environment ID" },
|
|
29317
|
+
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
29318
|
+
{ key: "host", label: "API Host" },
|
|
29319
|
+
{ key: "defaultComponentDir", label: "Default component directory" },
|
|
29320
|
+
{ key: "defaultTokenFile", label: "Default token file" },
|
|
29321
|
+
{ key: "contentfulBaseDir", label: "Root Project Directory", hint: "(where .contentful goes)" }
|
|
28611
29322
|
];
|
|
28612
29323
|
function debugFields(config) {
|
|
28613
29324
|
return {
|
|
@@ -28620,156 +29331,114 @@ function debugFields(config) {
|
|
|
28620
29331
|
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
28621
29332
|
};
|
|
28622
29333
|
}
|
|
28623
|
-
var
|
|
28624
|
-
|
|
28625
|
-
|
|
28626
|
-
|
|
28627
|
-
|
|
28628
|
-
|
|
28629
|
-
|
|
28630
|
-
|
|
28631
|
-
};
|
|
28632
|
-
var FIELD_HINTS = {
|
|
28633
|
-
contentfulBaseDir: "(where .contentful goes)"
|
|
28634
|
-
};
|
|
28635
|
-
var LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
|
|
28636
|
-
function ConfigurationScreen({ onDone }) {
|
|
28637
|
-
const [stage, setStage] = useState29("loading");
|
|
28638
|
-
const [config, setConfig] = useState29(null);
|
|
28639
|
-
const [activeField, setActiveField] = useState29("spaceId");
|
|
28640
|
-
const [notice, setNotice] = useState29(null);
|
|
28641
|
-
const [lastSaved, setLastSaved] = useState29(null);
|
|
28642
|
-
const [editing, setEditing] = useState29(false);
|
|
28643
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28644
|
-
useEffect22(() => {
|
|
28645
|
-
readCredentials().then((cfg) => {
|
|
29334
|
+
var valuesOf = (config) => Object.fromEntries(FIELDS3.map(({ key }) => [key, config[key] || ""]));
|
|
29335
|
+
function ProjectConfigScreen({ onDone }) {
|
|
29336
|
+
const [config, setConfig] = useState32(null);
|
|
29337
|
+
const [saving, setSaving] = useState32(false);
|
|
29338
|
+
const [notice, setNotice] = useState32(null);
|
|
29339
|
+
const [lastSaved, setLastSaved] = useState32(null);
|
|
29340
|
+
useEffect24(() => {
|
|
29341
|
+
void readCredentials().then((cfg) => {
|
|
28646
29342
|
setConfig(cfg);
|
|
28647
|
-
setStage("form");
|
|
28648
29343
|
startDebugRun({
|
|
28649
29344
|
flow: "settings/contentful-configuration",
|
|
28650
29345
|
step: "01-configuration",
|
|
28651
|
-
menuOption: "Configuration",
|
|
29346
|
+
menuOption: "Configuration > Project",
|
|
28652
29347
|
inputs: debugFields(cfg)
|
|
28653
29348
|
});
|
|
28654
29349
|
});
|
|
28655
29350
|
}, []);
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
|
|
28659
|
-
|
|
28660
|
-
|
|
28661
|
-
|
|
28662
|
-
setConfig({ ...config, [field]: value });
|
|
28663
|
-
setNotice(null);
|
|
29351
|
+
if (!config) {
|
|
29352
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29353
|
+
/* @__PURE__ */ jsx59(Text50, { bold: true, children: "Project" }),
|
|
29354
|
+
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
29355
|
+
/* @__PURE__ */ jsx59(Text50, { color: PALETTE.accent, children: "Loading..." })
|
|
29356
|
+
] });
|
|
28664
29357
|
}
|
|
28665
|
-
|
|
28666
|
-
|
|
28667
|
-
setStage("saving");
|
|
29358
|
+
const save = () => {
|
|
29359
|
+
setSaving(true);
|
|
28668
29360
|
setNotice(null);
|
|
28669
29361
|
writeCredentials(config).then(() => {
|
|
28670
29362
|
setLastSaved(config);
|
|
28671
29363
|
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
28672
|
-
setNotice({ kind: "success", text: "
|
|
28673
|
-
setStage("form");
|
|
29364
|
+
setNotice({ kind: "success", text: "Project settings saved" });
|
|
28674
29365
|
}).catch((err) => {
|
|
28675
29366
|
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
28676
|
-
|
|
28677
|
-
|
|
28678
|
-
|
|
28679
|
-
function quit() {
|
|
29367
|
+
}).finally(() => setSaving(false));
|
|
29368
|
+
};
|
|
29369
|
+
const quit = () => {
|
|
28680
29370
|
void finishDebugRun(
|
|
28681
29371
|
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
28682
29372
|
);
|
|
28683
29373
|
onDone();
|
|
28684
|
-
}
|
|
28685
|
-
|
|
28686
|
-
|
|
28687
|
-
|
|
28688
|
-
|
|
28689
|
-
|
|
28690
|
-
|
|
28691
|
-
|
|
28692
|
-
|
|
28693
|
-
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
28700
|
-
return;
|
|
28701
|
-
}
|
|
28702
|
-
if (input === "c") {
|
|
28703
|
-
setFieldValue(activeField, "");
|
|
28704
|
-
return;
|
|
29374
|
+
};
|
|
29375
|
+
return /* @__PURE__ */ jsx59(
|
|
29376
|
+
FieldForm,
|
|
29377
|
+
{
|
|
29378
|
+
title: "Project",
|
|
29379
|
+
subtitle: "The Contentful space and where the CLI keeps its files.",
|
|
29380
|
+
fields: FIELDS3,
|
|
29381
|
+
values: valuesOf(config),
|
|
29382
|
+
onChange: (key, value) => {
|
|
29383
|
+
setConfig({ ...config, [key]: value });
|
|
29384
|
+
setNotice(null);
|
|
29385
|
+
},
|
|
29386
|
+
onSave: save,
|
|
29387
|
+
onQuit: quit,
|
|
29388
|
+
notice,
|
|
29389
|
+
busy: saving
|
|
28705
29390
|
}
|
|
28706
|
-
|
|
28707
|
-
|
|
28708
|
-
|
|
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);
|
|
28709
29412
|
return;
|
|
28710
29413
|
}
|
|
28711
|
-
if (key.
|
|
28712
|
-
|
|
28713
|
-
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
29414
|
+
if (key.downArrow || key.tab) {
|
|
29415
|
+
setFocus((i) => (i + 1) % SECTIONS.length);
|
|
28714
29416
|
return;
|
|
28715
29417
|
}
|
|
28716
29418
|
if (key.return) {
|
|
28717
|
-
|
|
28718
|
-
|
|
29419
|
+
setOpen(SECTIONS[focus].id);
|
|
29420
|
+
return;
|
|
28719
29421
|
}
|
|
29422
|
+
if (key.escape || input === "q") onDone();
|
|
28720
29423
|
});
|
|
28721
|
-
if (
|
|
28722
|
-
|
|
28723
|
-
|
|
28724
|
-
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
|
|
28730
|
-
|
|
28731
|
-
/* @__PURE__ */
|
|
28732
|
-
|
|
28733
|
-
const value = fieldValue(field);
|
|
28734
|
-
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
28735
|
-
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28736
|
-
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
28737
|
-
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
|
|
28738
|
-
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
28739
|
-
TextInput4,
|
|
28740
|
-
{
|
|
28741
|
-
value,
|
|
28742
|
-
onChange: (next) => setFieldValue(field, next),
|
|
28743
|
-
onSubmit: () => setEditing(false),
|
|
28744
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
28745
|
-
}
|
|
28746
|
-
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
28747
|
-
FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
|
|
28748
|
-
] }, field);
|
|
28749
|
-
}) }),
|
|
28750
|
-
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
28751
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28752
|
-
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28753
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28754
|
-
" ",
|
|
28755
|
-
notice.text
|
|
28756
|
-
] })
|
|
28757
|
-
] }),
|
|
28758
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28759
|
-
/* @__PURE__ */ jsx55(
|
|
29424
|
+
if (open === "project") return /* @__PURE__ */ jsx60(ProjectConfigScreen, { onDone: close });
|
|
29425
|
+
if (open === "agents") return /* @__PURE__ */ jsx60(AgentsScreen, { onDone: close });
|
|
29426
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29427
|
+
/* @__PURE__ */ jsx60(Text51, { bold: true, children: "Configuration" }),
|
|
29428
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
29429
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs49(Box48, { gap: 1, children: [
|
|
29430
|
+
/* @__PURE__ */ jsx60(Text51, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
29431
|
+
/* @__PURE__ */ jsx60(Box48, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text51, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
29432
|
+
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: section.description })
|
|
29433
|
+
] }, section.id)),
|
|
29434
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
29435
|
+
/* @__PURE__ */ jsx60(
|
|
28760
29436
|
ControlHints,
|
|
28761
29437
|
{
|
|
28762
|
-
hints:
|
|
28763
|
-
{ keys: "type", label: "edit" },
|
|
28764
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
28765
|
-
{ keys: "\u23CE", label: "done" },
|
|
28766
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
28767
|
-
] : [
|
|
29438
|
+
hints: [
|
|
28768
29439
|
{ keys: "\u2191/\u2193", label: "move" },
|
|
28769
|
-
{ keys: "\u23CE", label: "
|
|
28770
|
-
{ keys: "
|
|
28771
|
-
{ keys: "s", label: "save" },
|
|
28772
|
-
{ keys: "Esc/q", label: "quit without saving" }
|
|
29440
|
+
{ keys: "\u23CE", label: "open" },
|
|
29441
|
+
{ keys: "Esc/q", label: "back" }
|
|
28773
29442
|
]
|
|
28774
29443
|
}
|
|
28775
29444
|
)
|
|
@@ -28777,8 +29446,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28777
29446
|
}
|
|
28778
29447
|
|
|
28779
29448
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28780
|
-
import { useEffect as
|
|
28781
|
-
import { Box as
|
|
29449
|
+
import { useEffect as useEffect25, useState as useState34 } from "react";
|
|
29450
|
+
import { Box as Box49, Text as Text52, useInput as useInput15 } from "ink";
|
|
28782
29451
|
|
|
28783
29452
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
28784
29453
|
async function readAnalyticsSetting() {
|
|
@@ -28797,11 +29466,11 @@ async function writeAnalyticsSetting(setting) {
|
|
|
28797
29466
|
|
|
28798
29467
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28799
29468
|
init_debug_store();
|
|
28800
|
-
import { Fragment as
|
|
29469
|
+
import { Fragment as Fragment20, jsx as jsx61, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
28801
29470
|
function OptInAnalyticsScreen({ onDone }) {
|
|
28802
|
-
const [loading, setLoading] =
|
|
28803
|
-
const [enabled, setEnabled] =
|
|
28804
|
-
|
|
29471
|
+
const [loading, setLoading] = useState34(true);
|
|
29472
|
+
const [enabled, setEnabled] = useState34(true);
|
|
29473
|
+
useEffect25(() => {
|
|
28805
29474
|
readAnalyticsSetting().then((setting) => {
|
|
28806
29475
|
setEnabled(setting.enabled);
|
|
28807
29476
|
setLoading(false);
|
|
@@ -28813,7 +29482,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28813
29482
|
});
|
|
28814
29483
|
});
|
|
28815
29484
|
}, []);
|
|
28816
|
-
|
|
29485
|
+
useInput15((input, key) => {
|
|
28817
29486
|
if (loading) return;
|
|
28818
29487
|
if (key.return || input === " ") {
|
|
28819
29488
|
setEnabled((current) => {
|
|
@@ -28828,21 +29497,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28828
29497
|
onDone();
|
|
28829
29498
|
}
|
|
28830
29499
|
});
|
|
28831
|
-
return /* @__PURE__ */
|
|
28832
|
-
/* @__PURE__ */
|
|
28833
|
-
/* @__PURE__ */
|
|
28834
|
-
loading ? /* @__PURE__ */
|
|
28835
|
-
/* @__PURE__ */
|
|
29500
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29501
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
29502
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29503
|
+
loading ? /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs50(Fragment20, { children: [
|
|
29504
|
+
/* @__PURE__ */ jsxs50(Text52, { children: [
|
|
28836
29505
|
"Share anonymous usage data:",
|
|
28837
29506
|
" ",
|
|
28838
|
-
/* @__PURE__ */
|
|
29507
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
28839
29508
|
] }),
|
|
28840
|
-
/* @__PURE__ */
|
|
28841
|
-
/* @__PURE__ */
|
|
28842
|
-
/* @__PURE__ */
|
|
29509
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29510
|
+
/* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
29511
|
+
/* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
28843
29512
|
] }),
|
|
28844
|
-
/* @__PURE__ */
|
|
28845
|
-
/* @__PURE__ */
|
|
29513
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29514
|
+
/* @__PURE__ */ jsx61(
|
|
28846
29515
|
ControlHints,
|
|
28847
29516
|
{
|
|
28848
29517
|
hints: [
|
|
@@ -28855,15 +29524,15 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28855
29524
|
}
|
|
28856
29525
|
|
|
28857
29526
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
28858
|
-
import { useEffect as
|
|
28859
|
-
import { Box as
|
|
29527
|
+
import { useEffect as useEffect26, useState as useState35 } from "react";
|
|
29528
|
+
import { Box as Box50, Text as Text53, useInput as useInput16 } from "ink";
|
|
28860
29529
|
init_version();
|
|
28861
29530
|
init_debug_store();
|
|
28862
|
-
import { jsx as
|
|
29531
|
+
import { jsx as jsx62, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
28863
29532
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
28864
29533
|
function UpgradeScreen({ onDone }) {
|
|
28865
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
28866
|
-
|
|
29534
|
+
const [upgradeCheck, setUpgradeCheck] = useState35();
|
|
29535
|
+
useEffect26(() => {
|
|
28867
29536
|
startDebugRun({
|
|
28868
29537
|
flow: "upgrade",
|
|
28869
29538
|
step: "01-upgrade",
|
|
@@ -28872,7 +29541,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
28872
29541
|
});
|
|
28873
29542
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
28874
29543
|
}, []);
|
|
28875
|
-
|
|
29544
|
+
useInput16((_input, key) => {
|
|
28876
29545
|
if (key.return) {
|
|
28877
29546
|
void finishDebugRun({
|
|
28878
29547
|
outputs: upgradeCheck ?? {},
|
|
@@ -28883,12 +29552,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
28883
29552
|
return;
|
|
28884
29553
|
}
|
|
28885
29554
|
});
|
|
28886
|
-
return /* @__PURE__ */
|
|
28887
|
-
/* @__PURE__ */
|
|
28888
|
-
/* @__PURE__ */
|
|
29555
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29556
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Upgrade" }),
|
|
29557
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
28889
29558
|
renderBody(upgradeCheck),
|
|
28890
|
-
/* @__PURE__ */
|
|
28891
|
-
/* @__PURE__ */
|
|
29559
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29560
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.accent, children: [
|
|
28892
29561
|
FOCUS_MARKER,
|
|
28893
29562
|
" Go Back"
|
|
28894
29563
|
] })
|
|
@@ -28896,47 +29565,47 @@ function UpgradeScreen({ onDone }) {
|
|
|
28896
29565
|
}
|
|
28897
29566
|
function renderBody(upgradeCheck) {
|
|
28898
29567
|
if (!upgradeCheck) {
|
|
28899
|
-
return /* @__PURE__ */
|
|
29568
|
+
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
28900
29569
|
}
|
|
28901
29570
|
if (upgradeCheck.status === "error") {
|
|
28902
|
-
return /* @__PURE__ */
|
|
29571
|
+
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
28903
29572
|
}
|
|
28904
29573
|
if (upgradeCheck.status === "up-to-date") {
|
|
28905
|
-
return /* @__PURE__ */
|
|
29574
|
+
return /* @__PURE__ */ jsxs51(Text53, { color: PALETTE.success, children: [
|
|
28906
29575
|
"You're already on the latest version (v",
|
|
28907
29576
|
upgradeCheck.current,
|
|
28908
29577
|
")."
|
|
28909
29578
|
] });
|
|
28910
29579
|
}
|
|
28911
|
-
return /* @__PURE__ */
|
|
28912
|
-
/* @__PURE__ */
|
|
28913
|
-
/* @__PURE__ */
|
|
29580
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
|
|
29581
|
+
/* @__PURE__ */ jsxs51(Text53, { color: PALETTE.muted, children: [
|
|
29582
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.success, children: [
|
|
28914
29583
|
"v",
|
|
28915
29584
|
upgradeCheck.latest
|
|
28916
29585
|
] }),
|
|
28917
29586
|
" ",
|
|
28918
29587
|
"is available (you're on ",
|
|
28919
|
-
/* @__PURE__ */
|
|
29588
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, children: [
|
|
28920
29589
|
"v",
|
|
28921
29590
|
upgradeCheck.current
|
|
28922
29591
|
] }),
|
|
28923
29592
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
28924
29593
|
] }),
|
|
28925
|
-
/* @__PURE__ */
|
|
28926
|
-
/* @__PURE__ */
|
|
29594
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29595
|
+
/* @__PURE__ */ jsx62(Box50, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx62(Text53, { bold: true, children: cmd }, cmd)) })
|
|
28927
29596
|
] });
|
|
28928
29597
|
}
|
|
28929
29598
|
|
|
28930
29599
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
28931
|
-
import { useEffect as
|
|
28932
|
-
import { Box as
|
|
29600
|
+
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
29601
|
+
import { Box as Box51, Text as Text54, useInput as useInput17 } from "ink";
|
|
28933
29602
|
init_debug_mode_store();
|
|
28934
29603
|
init_debug_store();
|
|
28935
|
-
import { jsx as
|
|
29604
|
+
import { jsx as jsx63, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
28936
29605
|
function DebugModeScreen({ onDone }) {
|
|
28937
|
-
const [loading, setLoading] =
|
|
28938
|
-
const [enabled, setEnabled] =
|
|
28939
|
-
|
|
29606
|
+
const [loading, setLoading] = useState36(true);
|
|
29607
|
+
const [enabled, setEnabled] = useState36(true);
|
|
29608
|
+
useEffect27(() => {
|
|
28940
29609
|
readDebugModeSetting().then((setting) => {
|
|
28941
29610
|
setEnabled(setting.enabled);
|
|
28942
29611
|
setLoading(false);
|
|
@@ -28948,7 +29617,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
28948
29617
|
});
|
|
28949
29618
|
});
|
|
28950
29619
|
}, []);
|
|
28951
|
-
|
|
29620
|
+
useInput17((input, key) => {
|
|
28952
29621
|
if (loading) return;
|
|
28953
29622
|
if (key.return || input === " ") {
|
|
28954
29623
|
setEnabled((current) => {
|
|
@@ -28963,16 +29632,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
28963
29632
|
onDone();
|
|
28964
29633
|
}
|
|
28965
29634
|
});
|
|
28966
|
-
return /* @__PURE__ */
|
|
28967
|
-
/* @__PURE__ */
|
|
28968
|
-
/* @__PURE__ */
|
|
28969
|
-
loading ? /* @__PURE__ */
|
|
29635
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29636
|
+
/* @__PURE__ */ jsx63(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
29637
|
+
/* @__PURE__ */ jsx63(Text54, { children: " " }),
|
|
29638
|
+
loading ? /* @__PURE__ */ jsx63(Text54, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs52(Text54, { children: [
|
|
28970
29639
|
"Debug logging:",
|
|
28971
29640
|
" ",
|
|
28972
|
-
/* @__PURE__ */
|
|
29641
|
+
/* @__PURE__ */ jsx63(Text54, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
28973
29642
|
] }),
|
|
28974
|
-
/* @__PURE__ */
|
|
28975
|
-
/* @__PURE__ */
|
|
29643
|
+
/* @__PURE__ */ jsx63(Text54, { children: " " }),
|
|
29644
|
+
/* @__PURE__ */ jsx63(
|
|
28976
29645
|
ControlHints,
|
|
28977
29646
|
{
|
|
28978
29647
|
hints: [
|
|
@@ -28985,18 +29654,18 @@ function DebugModeScreen({ onDone }) {
|
|
|
28985
29654
|
}
|
|
28986
29655
|
|
|
28987
29656
|
// packages/experience-design-system-cli/app.tsx
|
|
28988
|
-
import { Fragment as
|
|
29657
|
+
import { Fragment as Fragment21, jsx as jsx64 } from "react/jsx-runtime";
|
|
28989
29658
|
function App({ importOptions, inkClear }) {
|
|
28990
|
-
const [screen, setScreen] =
|
|
28991
|
-
const [importExitCode, setImportExitCode] =
|
|
29659
|
+
const [screen, setScreen] = useState37("start");
|
|
29660
|
+
const [importExitCode, setImportExitCode] = useState37();
|
|
28992
29661
|
const showImportResult = importExitCode !== void 0;
|
|
28993
|
-
const [projectPath, setProjectPath] =
|
|
28994
|
-
const [tokensPath, setTokensPath] =
|
|
28995
|
-
const [scannedFiles, setScannedFiles] =
|
|
28996
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
28997
|
-
const [extractionRun, setExtractionRun] =
|
|
29662
|
+
const [projectPath, setProjectPath] = useState37();
|
|
29663
|
+
const [tokensPath, setTokensPath] = useState37();
|
|
29664
|
+
const [scannedFiles, setScannedFiles] = useState37();
|
|
29665
|
+
const [pendingLaunch, setPendingLaunch] = useState37();
|
|
29666
|
+
const [extractionRun, setExtractionRun] = useState37();
|
|
28998
29667
|
const extraction = useExtraction(extractionRun?.input);
|
|
28999
|
-
const [scopeRun, setScopeRun] =
|
|
29668
|
+
const [scopeRun, setScopeRun] = useState37();
|
|
29000
29669
|
const scopeFlow = useScopeGateFlow(
|
|
29001
29670
|
scopeRun && {
|
|
29002
29671
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -29011,12 +29680,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29011
29680
|
}
|
|
29012
29681
|
}
|
|
29013
29682
|
);
|
|
29014
|
-
const [generationInput, setGenerationInput] =
|
|
29683
|
+
const [generationInput, setGenerationInput] = useState37();
|
|
29015
29684
|
const generation = useGeneration(generationInput);
|
|
29016
|
-
const [flowStart, setFlowStart] =
|
|
29685
|
+
const [flowStart, setFlowStart] = useState37();
|
|
29017
29686
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
29018
|
-
const [importDefaults, setImportDefaults] =
|
|
29019
|
-
|
|
29687
|
+
const [importDefaults, setImportDefaults] = useState37();
|
|
29688
|
+
useEffect28(() => {
|
|
29020
29689
|
if (screen !== "import") {
|
|
29021
29690
|
setImportDefaults(void 0);
|
|
29022
29691
|
return;
|
|
@@ -29034,7 +29703,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29034
29703
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
29035
29704
|
const state2 = await inspectTokens({
|
|
29036
29705
|
rawTokensPath: tokens,
|
|
29037
|
-
contentfulDir:
|
|
29706
|
+
contentfulDir: join26(resolveUserPath(projectPath2), ".contentful"),
|
|
29038
29707
|
cache: importOptions.cache
|
|
29039
29708
|
});
|
|
29040
29709
|
if (state2.kind === "cached") {
|
|
@@ -29076,12 +29745,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29076
29745
|
}
|
|
29077
29746
|
});
|
|
29078
29747
|
};
|
|
29079
|
-
|
|
29748
|
+
useEffect28(() => {
|
|
29080
29749
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
29081
29750
|
setExtractionRun(void 0);
|
|
29082
29751
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
29083
29752
|
}, [extraction, extractionRun]);
|
|
29084
|
-
|
|
29753
|
+
useEffect28(() => {
|
|
29085
29754
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
29086
29755
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29087
29756
|
setGenerationInput({
|
|
@@ -29099,7 +29768,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29099
29768
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
29100
29769
|
});
|
|
29101
29770
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
29102
|
-
|
|
29771
|
+
useEffect28(() => {
|
|
29103
29772
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
29104
29773
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29105
29774
|
inkClear();
|
|
@@ -29142,9 +29811,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29142
29811
|
};
|
|
29143
29812
|
switch (screen) {
|
|
29144
29813
|
case "import":
|
|
29145
|
-
if (showImportResult) return /* @__PURE__ */
|
|
29814
|
+
if (showImportResult) return /* @__PURE__ */ jsx64(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
29146
29815
|
if (flow && flowStart) {
|
|
29147
|
-
return /* @__PURE__ */
|
|
29816
|
+
return /* @__PURE__ */ jsx64(
|
|
29148
29817
|
FlowScreen,
|
|
29149
29818
|
{
|
|
29150
29819
|
state: flow.state,
|
|
@@ -29154,12 +29823,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29154
29823
|
}
|
|
29155
29824
|
);
|
|
29156
29825
|
}
|
|
29157
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
29826
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
29158
29827
|
if (projectPath === void 0) {
|
|
29159
|
-
return /* @__PURE__ */
|
|
29828
|
+
return /* @__PURE__ */ jsx64(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
29160
29829
|
}
|
|
29161
29830
|
if (tokensPath === void 0) {
|
|
29162
|
-
return /* @__PURE__ */
|
|
29831
|
+
return /* @__PURE__ */ jsx64(
|
|
29163
29832
|
TokenInputScreen,
|
|
29164
29833
|
{
|
|
29165
29834
|
initialPath: importDefaults.tokenFile,
|
|
@@ -29169,7 +29838,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29169
29838
|
);
|
|
29170
29839
|
}
|
|
29171
29840
|
if (scannedFiles === void 0) {
|
|
29172
|
-
return /* @__PURE__ */
|
|
29841
|
+
return /* @__PURE__ */ jsx64(
|
|
29173
29842
|
PathValidationScreen,
|
|
29174
29843
|
{
|
|
29175
29844
|
projectPath,
|
|
@@ -29181,10 +29850,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29181
29850
|
}
|
|
29182
29851
|
if (extractionRun) {
|
|
29183
29852
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
29184
|
-
return /* @__PURE__ */
|
|
29853
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
29185
29854
|
}
|
|
29186
29855
|
if (extraction?.status === "running") {
|
|
29187
|
-
return /* @__PURE__ */
|
|
29856
|
+
return /* @__PURE__ */ jsx64(
|
|
29188
29857
|
ExtractionScreen,
|
|
29189
29858
|
{
|
|
29190
29859
|
progress: extraction.progress,
|
|
@@ -29193,14 +29862,14 @@ function App({ importOptions, inkClear }) {
|
|
|
29193
29862
|
}
|
|
29194
29863
|
);
|
|
29195
29864
|
}
|
|
29196
|
-
return /* @__PURE__ */
|
|
29865
|
+
return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
29197
29866
|
}
|
|
29198
29867
|
if (scopeRun && scopeFlow) {
|
|
29199
29868
|
if (scopeFlow.status === "failed") {
|
|
29200
|
-
return /* @__PURE__ */
|
|
29869
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
29201
29870
|
}
|
|
29202
29871
|
if (scopeFlow.status === "deciding") {
|
|
29203
|
-
return /* @__PURE__ */
|
|
29872
|
+
return /* @__PURE__ */ jsx64(
|
|
29204
29873
|
ScopeGateScreen,
|
|
29205
29874
|
{
|
|
29206
29875
|
components: scopeFlow.load.components,
|
|
@@ -29210,7 +29879,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29210
29879
|
);
|
|
29211
29880
|
}
|
|
29212
29881
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
29213
|
-
return /* @__PURE__ */
|
|
29882
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
29214
29883
|
}
|
|
29215
29884
|
if (generation?.status === "running") {
|
|
29216
29885
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -29218,7 +29887,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29218
29887
|
hasRawTokens,
|
|
29219
29888
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
29220
29889
|
});
|
|
29221
|
-
return /* @__PURE__ */
|
|
29890
|
+
return /* @__PURE__ */ jsx64(
|
|
29222
29891
|
GenerationScreen,
|
|
29223
29892
|
{
|
|
29224
29893
|
progress: generation.progress,
|
|
@@ -29230,10 +29899,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29230
29899
|
}
|
|
29231
29900
|
);
|
|
29232
29901
|
}
|
|
29233
|
-
return /* @__PURE__ */
|
|
29902
|
+
return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
29234
29903
|
}
|
|
29235
29904
|
if (pendingLaunch?.cached) {
|
|
29236
|
-
return /* @__PURE__ */
|
|
29905
|
+
return /* @__PURE__ */ jsx64(
|
|
29237
29906
|
TokenReuseScreen,
|
|
29238
29907
|
{
|
|
29239
29908
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -29244,7 +29913,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29244
29913
|
}
|
|
29245
29914
|
);
|
|
29246
29915
|
}
|
|
29247
|
-
return /* @__PURE__ */
|
|
29916
|
+
return /* @__PURE__ */ jsx64(
|
|
29248
29917
|
CredentialsScreen,
|
|
29249
29918
|
{
|
|
29250
29919
|
initial: importDefaults.credentials,
|
|
@@ -29253,19 +29922,19 @@ function App({ importOptions, inkClear }) {
|
|
|
29253
29922
|
}
|
|
29254
29923
|
);
|
|
29255
29924
|
case "help":
|
|
29256
|
-
return /* @__PURE__ */
|
|
29925
|
+
return /* @__PURE__ */ jsx64(HelpScreen, { onDone: goToStart });
|
|
29257
29926
|
case "upgrade":
|
|
29258
|
-
return /* @__PURE__ */
|
|
29927
|
+
return /* @__PURE__ */ jsx64(UpgradeScreen, { onDone: goToStart });
|
|
29259
29928
|
case "settings":
|
|
29260
|
-
return /* @__PURE__ */
|
|
29929
|
+
return /* @__PURE__ */ jsx64(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
29261
29930
|
case "settings-configuration":
|
|
29262
|
-
return /* @__PURE__ */
|
|
29931
|
+
return /* @__PURE__ */ jsx64(ConfigurationScreen, { onDone: goToSettings });
|
|
29263
29932
|
case "settings-opt-in-analytics":
|
|
29264
|
-
return /* @__PURE__ */
|
|
29933
|
+
return /* @__PURE__ */ jsx64(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
29265
29934
|
case "settings-debug-mode":
|
|
29266
|
-
return /* @__PURE__ */
|
|
29935
|
+
return /* @__PURE__ */ jsx64(DebugModeScreen, { onDone: goToSettings });
|
|
29267
29936
|
case "start":
|
|
29268
|
-
return /* @__PURE__ */
|
|
29937
|
+
return /* @__PURE__ */ jsx64(HomeScreen, { onNavigate: setScreen });
|
|
29269
29938
|
}
|
|
29270
29939
|
}
|
|
29271
29940
|
async function runApp(renderApp, importOptions) {
|
|
@@ -29273,7 +29942,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
29273
29942
|
instance.clear?.();
|
|
29274
29943
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
29275
29944
|
};
|
|
29276
|
-
const instance = renderApp(/* @__PURE__ */
|
|
29945
|
+
const instance = renderApp(/* @__PURE__ */ jsx64(App, { importOptions, inkClear }));
|
|
29277
29946
|
await instance.waitUntilExit();
|
|
29278
29947
|
}
|
|
29279
29948
|
export {
|