@contentful/experience-design-system-cli 2.37.1-dev-build-8a9493aa.0 → 2.37.1-dev-build-c5c89a0c.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 +1239 -365
- package/dist/index.js +1366 -381
- package/dist/package.json +1 -1
- package/dist/src/tui/shared/components/FieldForm.d.ts +4 -2
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -821,6 +821,16 @@ var init_parse_map_token_prop_tool_calls = __esm({
|
|
|
821
821
|
|
|
822
822
|
// packages/experience-design-system-backend-pipeline/dist/src/agents/services/run-agent.js
|
|
823
823
|
import { spawn } from "node:child_process";
|
|
824
|
+
function killProcessTree(pid, signal) {
|
|
825
|
+
try {
|
|
826
|
+
process.kill(-pid, signal);
|
|
827
|
+
} catch {
|
|
828
|
+
try {
|
|
829
|
+
process.kill(pid, signal);
|
|
830
|
+
} catch {
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
824
834
|
async function runAgent(options) {
|
|
825
835
|
const { agent, prompt, timeoutMs, model, onOutput, promptViaStdin, onDebugEvent } = options;
|
|
826
836
|
const bedrock = options.bedrock ?? process.env.EDS_BEDROCK === "1";
|
|
@@ -837,10 +847,11 @@ async function runAgent(options) {
|
|
|
837
847
|
promptLen: prompt.length,
|
|
838
848
|
promptHead: prompt.slice(0, 500)
|
|
839
849
|
});
|
|
840
|
-
return new Promise((
|
|
850
|
+
return new Promise((resolve29) => {
|
|
841
851
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
842
852
|
const child = spawn(binary, args, {
|
|
843
853
|
stdio: ["pipe", "pipe", "pipe"],
|
|
854
|
+
detached: true,
|
|
844
855
|
...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
|
|
845
856
|
});
|
|
846
857
|
if (useStdin2 && child.stdin) {
|
|
@@ -852,50 +863,87 @@ async function runAgent(options) {
|
|
|
852
863
|
} else {
|
|
853
864
|
child.stdin?.end();
|
|
854
865
|
}
|
|
855
|
-
|
|
856
|
-
|
|
866
|
+
const stdoutChunks = [];
|
|
867
|
+
const stderrChunks = [];
|
|
857
868
|
let timedOut = false;
|
|
858
|
-
|
|
869
|
+
let settled = false;
|
|
870
|
+
const pid = child.pid;
|
|
871
|
+
const settle = (result) => {
|
|
872
|
+
if (settled)
|
|
873
|
+
return;
|
|
874
|
+
settled = true;
|
|
875
|
+
clearTimeout(softTimer);
|
|
876
|
+
clearTimeout(hardTimer);
|
|
877
|
+
onDebugEvent?.("run.end", {
|
|
878
|
+
agent,
|
|
879
|
+
model,
|
|
880
|
+
durationMs: Date.now() - startedAt,
|
|
881
|
+
exitCode: result.exitCode,
|
|
882
|
+
timedOut: result.timedOut,
|
|
883
|
+
stdoutLen: result.stdout.length,
|
|
884
|
+
stderrLen: result.stderr.length,
|
|
885
|
+
stderrTail: result.stderr.slice(-1e3)
|
|
886
|
+
});
|
|
887
|
+
resolve29(result);
|
|
888
|
+
};
|
|
889
|
+
const softTimer = setTimeout(() => {
|
|
859
890
|
timedOut = true;
|
|
860
|
-
|
|
891
|
+
if (pid)
|
|
892
|
+
killProcessTree(pid, "SIGTERM");
|
|
861
893
|
}, timeoutMs);
|
|
894
|
+
const hardTimer = setTimeout(() => {
|
|
895
|
+
if (settled)
|
|
896
|
+
return;
|
|
897
|
+
if (pid)
|
|
898
|
+
killProcessTree(pid, "SIGKILL");
|
|
899
|
+
try {
|
|
900
|
+
child.stdout?.destroy();
|
|
901
|
+
child.stderr?.destroy();
|
|
902
|
+
child.stdin?.destroy();
|
|
903
|
+
} catch {
|
|
904
|
+
}
|
|
905
|
+
settle({
|
|
906
|
+
exitCode: 1,
|
|
907
|
+
stdout: Buffer.concat(stdoutChunks).toString("utf8"),
|
|
908
|
+
stderr: Buffer.concat(stderrChunks).toString("utf8"),
|
|
909
|
+
timedOut: true
|
|
910
|
+
});
|
|
911
|
+
}, timeoutMs + WATCHDOG_GRACE_MS);
|
|
862
912
|
child.stdout?.on("data", (chunk) => {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
913
|
+
stdoutChunks.push(chunk);
|
|
914
|
+
if (onOutput)
|
|
915
|
+
onOutput(chunk.toString("utf8"));
|
|
866
916
|
});
|
|
867
917
|
child.stderr?.on("data", (chunk) => {
|
|
868
|
-
|
|
918
|
+
stderrChunks.push(chunk);
|
|
919
|
+
});
|
|
920
|
+
child.on("error", (err) => {
|
|
921
|
+
settle({
|
|
922
|
+
exitCode: 1,
|
|
923
|
+
stdout: Buffer.concat(stdoutChunks).toString("utf8"),
|
|
924
|
+
stderr: `${err instanceof Error ? err.message : String(err)}
|
|
925
|
+
${Buffer.concat(stderrChunks).toString("utf8")}`,
|
|
926
|
+
timedOut
|
|
927
|
+
});
|
|
869
928
|
});
|
|
870
929
|
child.on("close", (code, signal) => {
|
|
871
|
-
|
|
872
|
-
const result = {
|
|
930
|
+
settle({
|
|
873
931
|
exitCode: signal ? 1 : code ?? 1,
|
|
874
|
-
stdout,
|
|
875
|
-
stderr,
|
|
932
|
+
stdout: Buffer.concat(stdoutChunks).toString("utf8"),
|
|
933
|
+
stderr: Buffer.concat(stderrChunks).toString("utf8"),
|
|
876
934
|
timedOut
|
|
877
|
-
};
|
|
878
|
-
onDebugEvent?.("run.end", {
|
|
879
|
-
agent,
|
|
880
|
-
model,
|
|
881
|
-
durationMs: Date.now() - startedAt,
|
|
882
|
-
exitCode: result.exitCode,
|
|
883
|
-
signal,
|
|
884
|
-
timedOut,
|
|
885
|
-
stdoutLen: stdout.length,
|
|
886
|
-
stderrLen: stderr.length,
|
|
887
|
-
stderrTail: stderr.slice(-1e3)
|
|
888
935
|
});
|
|
889
|
-
resolve28(result);
|
|
890
936
|
});
|
|
891
937
|
});
|
|
892
938
|
}
|
|
939
|
+
var WATCHDOG_GRACE_MS;
|
|
893
940
|
var init_run_agent = __esm({
|
|
894
941
|
"packages/experience-design-system-backend-pipeline/dist/src/agents/services/run-agent.js"() {
|
|
895
942
|
"use strict";
|
|
896
943
|
init_bedrock();
|
|
897
944
|
init_build_agent_args();
|
|
898
945
|
init_resolve_binary();
|
|
946
|
+
WATCHDOG_GRACE_MS = 10 * 1e3;
|
|
899
947
|
}
|
|
900
948
|
});
|
|
901
949
|
|
|
@@ -908,7 +956,7 @@ async function checkAgentAuth(agent) {
|
|
|
908
956
|
return "not-found";
|
|
909
957
|
if (agent !== "claude")
|
|
910
958
|
return "ok";
|
|
911
|
-
return new Promise((
|
|
959
|
+
return new Promise((resolve29) => {
|
|
912
960
|
const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
913
961
|
let stdout = "";
|
|
914
962
|
let done = false;
|
|
@@ -917,7 +965,7 @@ async function checkAgentAuth(agent) {
|
|
|
917
965
|
return;
|
|
918
966
|
done = true;
|
|
919
967
|
child.kill("SIGTERM");
|
|
920
|
-
|
|
968
|
+
resolve29("unauthenticated");
|
|
921
969
|
}, 5e3);
|
|
922
970
|
child.stdout?.on("data", (chunk) => {
|
|
923
971
|
stdout += chunk.toString();
|
|
@@ -928,14 +976,14 @@ async function checkAgentAuth(agent) {
|
|
|
928
976
|
done = true;
|
|
929
977
|
clearTimeout(timer);
|
|
930
978
|
if (code !== 0) {
|
|
931
|
-
|
|
979
|
+
resolve29("unauthenticated");
|
|
932
980
|
return;
|
|
933
981
|
}
|
|
934
982
|
try {
|
|
935
983
|
const status = JSON.parse(stdout);
|
|
936
|
-
|
|
984
|
+
resolve29(status.loggedIn ? "ok" : "unauthenticated");
|
|
937
985
|
} catch {
|
|
938
|
-
|
|
986
|
+
resolve29("unauthenticated");
|
|
939
987
|
}
|
|
940
988
|
});
|
|
941
989
|
});
|
|
@@ -945,9 +993,9 @@ async function binaryIsOnPath(binary) {
|
|
|
945
993
|
const fs = await import("node:fs/promises");
|
|
946
994
|
return fs.access(binary).then(() => true, () => false);
|
|
947
995
|
}
|
|
948
|
-
return new Promise((
|
|
996
|
+
return new Promise((resolve29) => {
|
|
949
997
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
950
|
-
child.on("close", (code) =>
|
|
998
|
+
child.on("close", (code) => resolve29(code === 0));
|
|
951
999
|
});
|
|
952
1000
|
}
|
|
953
1001
|
var init_check_agent_auth = __esm({
|
|
@@ -1584,7 +1632,8 @@ var init_infer_fence_lang = __esm({
|
|
|
1584
1632
|
sass: "scss",
|
|
1585
1633
|
css: "css",
|
|
1586
1634
|
json: "json",
|
|
1587
|
-
json5: "json"
|
|
1635
|
+
json5: "json",
|
|
1636
|
+
html: "html"
|
|
1588
1637
|
};
|
|
1589
1638
|
}
|
|
1590
1639
|
});
|
|
@@ -2083,22 +2132,22 @@ var init_cache_keys = __esm({
|
|
|
2083
2132
|
|
|
2084
2133
|
// packages/experience-design-system-types/dist/src/config/index.js
|
|
2085
2134
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
2086
|
-
import { mkdir as mkdir6, readFile as
|
|
2135
|
+
import { mkdir as mkdir6, readFile as readFile20, rename as rename2, writeFile as writeFile6 } from "node:fs/promises";
|
|
2087
2136
|
import { homedir as homedir3 } from "node:os";
|
|
2088
|
-
import { dirname as
|
|
2137
|
+
import { dirname as dirname14, join as join16 } from "node:path";
|
|
2089
2138
|
function configRoot2() {
|
|
2090
2139
|
return process.env["EDS_HOME"] || join16(homedir3(), ".contentful", "experience-design-system-cli");
|
|
2091
2140
|
}
|
|
2092
2141
|
async function readSettings2() {
|
|
2093
2142
|
try {
|
|
2094
|
-
return JSON.parse(await
|
|
2143
|
+
return JSON.parse(await readFile20(configFilePath2(), "utf8"));
|
|
2095
2144
|
} catch {
|
|
2096
2145
|
return {};
|
|
2097
2146
|
}
|
|
2098
2147
|
}
|
|
2099
2148
|
async function writeSettings2(settings) {
|
|
2100
2149
|
const path5 = configFilePath2();
|
|
2101
|
-
await mkdir6(
|
|
2150
|
+
await mkdir6(dirname14(path5), { recursive: true });
|
|
2102
2151
|
const tmp = `${path5}.${process.pid}.${randomBytes4(4).toString("hex")}.tmp`;
|
|
2103
2152
|
await writeFile6(tmp, `${JSON.stringify(settings, null, 2)}
|
|
2104
2153
|
`, { mode: 384 });
|
|
@@ -2142,7 +2191,7 @@ var init_debug_mode_store = __esm({
|
|
|
2142
2191
|
|
|
2143
2192
|
// packages/experience-design-system-cli/src/tui/debug-prune.ts
|
|
2144
2193
|
import { readdir as readdir2, rm, rmdir, stat as stat4 } from "node:fs/promises";
|
|
2145
|
-
import { dirname as
|
|
2194
|
+
import { dirname as dirname17, join as join23 } from "node:path";
|
|
2146
2195
|
async function logFilesIn(dir) {
|
|
2147
2196
|
const entries = await readdir2(dir, { withFileTypes: true });
|
|
2148
2197
|
const nested = await Promise.all(
|
|
@@ -2165,7 +2214,7 @@ async function removeEmptyFolders(from, stop) {
|
|
|
2165
2214
|
}
|
|
2166
2215
|
removed += 1;
|
|
2167
2216
|
if (dir === stop) return removed;
|
|
2168
|
-
dir =
|
|
2217
|
+
dir = dirname17(dir);
|
|
2169
2218
|
}
|
|
2170
2219
|
}
|
|
2171
2220
|
async function pruneExpiredLogs(base, retentionDays, now = Date.now()) {
|
|
@@ -2181,7 +2230,7 @@ async function pruneExpiredLogs(base, retentionDays, now = Date.now()) {
|
|
|
2181
2230
|
if ((await stat4(file)).mtimeMs >= cutoff) continue;
|
|
2182
2231
|
await rm(file);
|
|
2183
2232
|
result.logs += 1;
|
|
2184
|
-
result.folders += await removeEmptyFolders(
|
|
2233
|
+
result.folders += await removeEmptyFolders(dirname17(file), join23(contentfulDir, session));
|
|
2185
2234
|
} catch {
|
|
2186
2235
|
}
|
|
2187
2236
|
}
|
|
@@ -2211,7 +2260,7 @@ __export(debug_store_exports, {
|
|
|
2211
2260
|
});
|
|
2212
2261
|
import { mkdir as mkdir9, writeFile as writeFile8 } from "node:fs/promises";
|
|
2213
2262
|
import { existsSync as existsSync9, readdirSync as readdirSync4 } from "node:fs";
|
|
2214
|
-
import { join as join24, resolve as
|
|
2263
|
+
import { join as join24, resolve as resolve27 } from "node:path";
|
|
2215
2264
|
function generateRunId() {
|
|
2216
2265
|
const now = /* @__PURE__ */ new Date();
|
|
2217
2266
|
const pad = (n) => String(n).padStart(2, "0");
|
|
@@ -2227,7 +2276,7 @@ function slugify(value) {
|
|
|
2227
2276
|
async function readBaseDir() {
|
|
2228
2277
|
try {
|
|
2229
2278
|
const dir = (await readSettings2())["contentfulBaseDir"];
|
|
2230
|
-
return typeof dir === "string" && dir !== "" ?
|
|
2279
|
+
return typeof dir === "string" && dir !== "" ? resolve27(dir) : void 0;
|
|
2231
2280
|
} catch {
|
|
2232
2281
|
return void 0;
|
|
2233
2282
|
}
|
|
@@ -2256,7 +2305,7 @@ function currentSessionDir() {
|
|
|
2256
2305
|
async function startDebugSessionIn(base, { replace = false } = {}) {
|
|
2257
2306
|
try {
|
|
2258
2307
|
if (!await isDebugModeEnabled()) return;
|
|
2259
|
-
await mkdir9(join24(startSession(
|
|
2308
|
+
await mkdir9(join24(startSession(resolve27(base), { replace }), "debug"), { recursive: true });
|
|
2260
2309
|
} catch {
|
|
2261
2310
|
}
|
|
2262
2311
|
}
|
|
@@ -2270,7 +2319,7 @@ function nextImportRunDir(session) {
|
|
|
2270
2319
|
}
|
|
2271
2320
|
async function startImportRun(projectPath) {
|
|
2272
2321
|
await startDebugSessionIn(projectPath);
|
|
2273
|
-
if (!sessionDir) return join24(
|
|
2322
|
+
if (!sessionDir) return join24(resolve27(projectPath), ".contentful");
|
|
2274
2323
|
const dir = nextImportRunDir(sessionDir);
|
|
2275
2324
|
await mkdir9(dir, { recursive: true });
|
|
2276
2325
|
return dir;
|
|
@@ -2519,7 +2568,7 @@ function ControlHints({ hints }) {
|
|
|
2519
2568
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2520
2569
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2521
2570
|
var VERSION = readPackageVersion();
|
|
2522
|
-
var HEADING = "
|
|
2571
|
+
var HEADING = "Design System Import";
|
|
2523
2572
|
var MIN_TERMINAL_WIDTH = 164;
|
|
2524
2573
|
var START_ITEMS = [
|
|
2525
2574
|
{ label: "Import", screen: "import" },
|
|
@@ -2849,6 +2898,7 @@ function StepHeader({ step }) {
|
|
|
2849
2898
|
{
|
|
2850
2899
|
justifyContent: "space-between",
|
|
2851
2900
|
paddingX: 2,
|
|
2901
|
+
paddingTop: 1,
|
|
2852
2902
|
marginBottom: 1,
|
|
2853
2903
|
borderStyle: "single",
|
|
2854
2904
|
borderColor: PALETTE.border,
|
|
@@ -3120,17 +3170,19 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
|
3120
3170
|
const path5 = toProjectPath(value);
|
|
3121
3171
|
if (path5) onContinue(path5);
|
|
3122
3172
|
};
|
|
3123
|
-
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column",
|
|
3124
|
-
/* @__PURE__ */ jsx11(
|
|
3125
|
-
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, children: [
|
|
3126
|
-
/* @__PURE__ */
|
|
3127
|
-
|
|
3128
|
-
/* @__PURE__ */
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3173
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
3174
|
+
/* @__PURE__ */ jsx11(StepHeader, { step: "setup" }),
|
|
3175
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
3176
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", gap: 1, children: [
|
|
3177
|
+
/* @__PURE__ */ jsx11(Text10, { color: PALETTE.text, children: "Where is your component library?" }),
|
|
3178
|
+
/* @__PURE__ */ jsxs10(Box10, { children: [
|
|
3179
|
+
/* @__PURE__ */ jsx11(Text10, { color: PALETTE.accent, children: "? " }),
|
|
3180
|
+
/* @__PURE__ */ jsx11(Text10, { children: "Project path: " }),
|
|
3181
|
+
/* @__PURE__ */ jsx11(ClearableTextInput, { value: projectPath, onChange: setProjectPath, onSubmit: submit })
|
|
3182
|
+
] })
|
|
3183
|
+
] }),
|
|
3184
|
+
/* @__PURE__ */ jsx11(Box10, { children: /* @__PURE__ */ jsx11(ControlHints, { hints: WELCOME_CONTROLS }) })
|
|
3185
|
+
] })
|
|
3134
3186
|
] });
|
|
3135
3187
|
}
|
|
3136
3188
|
|
|
@@ -11979,6 +12031,690 @@ function mergeSlots2(fromSnippetProps, fromTemplate) {
|
|
|
11979
12031
|
return { slots: [...byName.values()], mixedWarning: mixed };
|
|
11980
12032
|
}
|
|
11981
12033
|
|
|
12034
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/extract-angular-components.js
|
|
12035
|
+
import { readFile as readFile8 } from "node:fs/promises";
|
|
12036
|
+
import { ModuleKind as ModuleKind2, Project as Project7, ScriptTarget as ScriptTarget2 } from "ts-morph";
|
|
12037
|
+
|
|
12038
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/find-component-decorator.js
|
|
12039
|
+
import { Node as Node10 } from "ts-morph";
|
|
12040
|
+
function resolveToObjectLiteral(expr, depth = 0) {
|
|
12041
|
+
if (!expr || depth > 3)
|
|
12042
|
+
return null;
|
|
12043
|
+
if (Node10.isObjectLiteralExpression(expr))
|
|
12044
|
+
return expr;
|
|
12045
|
+
if (Node10.isIdentifier(expr)) {
|
|
12046
|
+
const defs = expr.getDefinitions();
|
|
12047
|
+
for (const def of defs) {
|
|
12048
|
+
const node = def.getDeclarationNode();
|
|
12049
|
+
if (node && Node10.isVariableDeclaration(node)) {
|
|
12050
|
+
const init = node.getInitializer();
|
|
12051
|
+
const resolved = resolveToObjectLiteral(init, depth + 1);
|
|
12052
|
+
if (resolved)
|
|
12053
|
+
return resolved;
|
|
12054
|
+
}
|
|
12055
|
+
}
|
|
12056
|
+
}
|
|
12057
|
+
return null;
|
|
12058
|
+
}
|
|
12059
|
+
function findComponentDecorator(cls) {
|
|
12060
|
+
const decorator = cls.getDecorator("Component");
|
|
12061
|
+
if (!decorator)
|
|
12062
|
+
return null;
|
|
12063
|
+
const [arg] = decorator.getArguments();
|
|
12064
|
+
return resolveToObjectLiteral(arg);
|
|
12065
|
+
}
|
|
12066
|
+
function hasComponentDecorator(cls) {
|
|
12067
|
+
return cls.getDecorator("Component") !== void 0;
|
|
12068
|
+
}
|
|
12069
|
+
|
|
12070
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-decorator-input.js
|
|
12071
|
+
import { Node as Node12 } from "ts-morph";
|
|
12072
|
+
|
|
12073
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/resolve-prop-type.js
|
|
12074
|
+
import { Node as Node11 } from "ts-morph";
|
|
12075
|
+
function resolvePropType(typeNode) {
|
|
12076
|
+
if (!typeNode) {
|
|
12077
|
+
return { text: "any", allowedValues: null, isTemplateRef: false };
|
|
12078
|
+
}
|
|
12079
|
+
const text = typeNode.getText();
|
|
12080
|
+
const members = extractStringLiteralUnion(typeNode);
|
|
12081
|
+
const isTemplateRef = containsTemplateRef(typeNode);
|
|
12082
|
+
return {
|
|
12083
|
+
text,
|
|
12084
|
+
allowedValues: members.length > 0 ? members : null,
|
|
12085
|
+
isTemplateRef
|
|
12086
|
+
};
|
|
12087
|
+
}
|
|
12088
|
+
function extractStringLiteralUnion(typeNode) {
|
|
12089
|
+
if (Node11.isLiteralTypeNode(typeNode)) {
|
|
12090
|
+
const lit = typeNode.getLiteral();
|
|
12091
|
+
if (Node11.isStringLiteral(lit) || Node11.isNoSubstitutionTemplateLiteral(lit)) {
|
|
12092
|
+
return [lit.getLiteralText()];
|
|
12093
|
+
}
|
|
12094
|
+
return [];
|
|
12095
|
+
}
|
|
12096
|
+
if (Node11.isUnionTypeNode(typeNode)) {
|
|
12097
|
+
const out = [];
|
|
12098
|
+
for (const member of typeNode.getTypeNodes()) {
|
|
12099
|
+
const sub = extractStringLiteralUnion(member);
|
|
12100
|
+
if (sub.length === 0 && !isNullOrUndefinedLiteral(member)) {
|
|
12101
|
+
return [];
|
|
12102
|
+
}
|
|
12103
|
+
out.push(...sub);
|
|
12104
|
+
}
|
|
12105
|
+
return out;
|
|
12106
|
+
}
|
|
12107
|
+
return [];
|
|
12108
|
+
}
|
|
12109
|
+
function isNullOrUndefinedLiteral(typeNode) {
|
|
12110
|
+
if (Node11.isLiteralTypeNode(typeNode)) {
|
|
12111
|
+
const lit = typeNode.getLiteral();
|
|
12112
|
+
if (Node11.isNullLiteral(lit))
|
|
12113
|
+
return true;
|
|
12114
|
+
}
|
|
12115
|
+
const t = typeNode.getText();
|
|
12116
|
+
return t === "null" || t === "undefined";
|
|
12117
|
+
}
|
|
12118
|
+
function containsTemplateRef(typeNode) {
|
|
12119
|
+
const text = typeNode.getText();
|
|
12120
|
+
return /\bTemplateRef\b/.test(text);
|
|
12121
|
+
}
|
|
12122
|
+
|
|
12123
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-decorator-input.js
|
|
12124
|
+
function extractDecoratorInput(field) {
|
|
12125
|
+
const decorator = field.getDecorator("Input");
|
|
12126
|
+
if (!decorator)
|
|
12127
|
+
return null;
|
|
12128
|
+
const fieldName = field.getName();
|
|
12129
|
+
const args = decorator.getArguments();
|
|
12130
|
+
let alias = null;
|
|
12131
|
+
let required = false;
|
|
12132
|
+
let transformIsBoolean = false;
|
|
12133
|
+
let transformIsNumber = false;
|
|
12134
|
+
if (args.length === 1) {
|
|
12135
|
+
const arg = args[0];
|
|
12136
|
+
if (Node12.isStringLiteral(arg) || Node12.isNoSubstitutionTemplateLiteral(arg)) {
|
|
12137
|
+
alias = arg.getLiteralText();
|
|
12138
|
+
} else if (Node12.isObjectLiteralExpression(arg)) {
|
|
12139
|
+
const aliasProp = arg.getProperty("alias");
|
|
12140
|
+
if (aliasProp && Node12.isPropertyAssignment(aliasProp)) {
|
|
12141
|
+
const init = aliasProp.getInitializer();
|
|
12142
|
+
if (init && (Node12.isStringLiteral(init) || Node12.isNoSubstitutionTemplateLiteral(init))) {
|
|
12143
|
+
alias = init.getLiteralText();
|
|
12144
|
+
}
|
|
12145
|
+
}
|
|
12146
|
+
const requiredProp = arg.getProperty("required");
|
|
12147
|
+
if (requiredProp && Node12.isPropertyAssignment(requiredProp)) {
|
|
12148
|
+
const init = requiredProp.getInitializer();
|
|
12149
|
+
if (init?.getText() === "true")
|
|
12150
|
+
required = true;
|
|
12151
|
+
}
|
|
12152
|
+
const transformProp = arg.getProperty("transform");
|
|
12153
|
+
if (transformProp && Node12.isPropertyAssignment(transformProp)) {
|
|
12154
|
+
const transformText = transformProp.getInitializer()?.getText() ?? "";
|
|
12155
|
+
if (/\bbooleanAttribute\b/.test(transformText))
|
|
12156
|
+
transformIsBoolean = true;
|
|
12157
|
+
if (/\bnumberAttribute\b/.test(transformText))
|
|
12158
|
+
transformIsNumber = true;
|
|
12159
|
+
}
|
|
12160
|
+
}
|
|
12161
|
+
}
|
|
12162
|
+
let typeNode;
|
|
12163
|
+
let defaultValue;
|
|
12164
|
+
if (Node12.isSetAccessorDeclaration(field)) {
|
|
12165
|
+
const param = field.getParameters()[0];
|
|
12166
|
+
typeNode = param?.getTypeNode();
|
|
12167
|
+
} else if (Node12.isGetAccessorDeclaration(field)) {
|
|
12168
|
+
const parent = field.getParent();
|
|
12169
|
+
const companionSetter = parent && Node12.isClassDeclaration(parent) ? parent.getSetAccessor(fieldName) : void 0;
|
|
12170
|
+
if (companionSetter) {
|
|
12171
|
+
typeNode = companionSetter.getParameters()[0]?.getTypeNode();
|
|
12172
|
+
}
|
|
12173
|
+
if (!typeNode)
|
|
12174
|
+
typeNode = field.getReturnTypeNode();
|
|
12175
|
+
} else {
|
|
12176
|
+
typeNode = field.getTypeNode();
|
|
12177
|
+
const initializer = field.getInitializer();
|
|
12178
|
+
if (initializer)
|
|
12179
|
+
defaultValue = initializer.getText();
|
|
12180
|
+
}
|
|
12181
|
+
const resolved = resolvePropType(typeNode);
|
|
12182
|
+
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
12183
|
+
const name = alias ?? fieldName;
|
|
12184
|
+
const prop = {
|
|
12185
|
+
name,
|
|
12186
|
+
type: typeText,
|
|
12187
|
+
required,
|
|
12188
|
+
sourceStartLine: field.getStartLineNumber(),
|
|
12189
|
+
sourceEndLine: field.getEndLineNumber()
|
|
12190
|
+
};
|
|
12191
|
+
if (defaultValue !== void 0)
|
|
12192
|
+
prop.defaultValue = defaultValue;
|
|
12193
|
+
if (resolved.allowedValues && !transformIsBoolean && !transformIsNumber) {
|
|
12194
|
+
prop.allowedValues = resolved.allowedValues;
|
|
12195
|
+
}
|
|
12196
|
+
return prop;
|
|
12197
|
+
}
|
|
12198
|
+
|
|
12199
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-signal-input.js
|
|
12200
|
+
import { Node as Node13 } from "ts-morph";
|
|
12201
|
+
function extractSignalInput(field) {
|
|
12202
|
+
const init = field.getInitializer();
|
|
12203
|
+
if (!init || !Node13.isCallExpression(init))
|
|
12204
|
+
return null;
|
|
12205
|
+
const callee = init.getExpression();
|
|
12206
|
+
let required = false;
|
|
12207
|
+
if (Node13.isIdentifier(callee)) {
|
|
12208
|
+
if (callee.getText() !== "input")
|
|
12209
|
+
return null;
|
|
12210
|
+
} else if (Node13.isPropertyAccessExpression(callee)) {
|
|
12211
|
+
const left = callee.getExpression();
|
|
12212
|
+
const right = callee.getName();
|
|
12213
|
+
if (!Node13.isIdentifier(left) || left.getText() !== "input" || right !== "required")
|
|
12214
|
+
return null;
|
|
12215
|
+
required = true;
|
|
12216
|
+
} else {
|
|
12217
|
+
return null;
|
|
12218
|
+
}
|
|
12219
|
+
const fieldName = field.getName();
|
|
12220
|
+
const args = init.getArguments();
|
|
12221
|
+
let defaultValue;
|
|
12222
|
+
let configArg;
|
|
12223
|
+
if (required) {
|
|
12224
|
+
configArg = args[0];
|
|
12225
|
+
} else {
|
|
12226
|
+
const first = args[0];
|
|
12227
|
+
if (first) {
|
|
12228
|
+
defaultValue = first.getText();
|
|
12229
|
+
configArg = args[1];
|
|
12230
|
+
}
|
|
12231
|
+
}
|
|
12232
|
+
let alias = null;
|
|
12233
|
+
let transformIsBoolean = false;
|
|
12234
|
+
let transformIsNumber = false;
|
|
12235
|
+
if (configArg && Node13.isObjectLiteralExpression(configArg)) {
|
|
12236
|
+
const aliasProp = configArg.getProperty("alias");
|
|
12237
|
+
if (aliasProp && Node13.isPropertyAssignment(aliasProp)) {
|
|
12238
|
+
const aliasInit = aliasProp.getInitializer();
|
|
12239
|
+
if (aliasInit && (Node13.isStringLiteral(aliasInit) || Node13.isNoSubstitutionTemplateLiteral(aliasInit))) {
|
|
12240
|
+
alias = aliasInit.getLiteralText();
|
|
12241
|
+
}
|
|
12242
|
+
}
|
|
12243
|
+
const transformProp = configArg.getProperty("transform");
|
|
12244
|
+
if (transformProp && Node13.isPropertyAssignment(transformProp)) {
|
|
12245
|
+
const transformText = transformProp.getInitializer()?.getText() ?? "";
|
|
12246
|
+
if (/\bbooleanAttribute\b/.test(transformText))
|
|
12247
|
+
transformIsBoolean = true;
|
|
12248
|
+
if (/\bnumberAttribute\b/.test(transformText))
|
|
12249
|
+
transformIsNumber = true;
|
|
12250
|
+
}
|
|
12251
|
+
}
|
|
12252
|
+
const typeArg = init.getTypeArguments()[0];
|
|
12253
|
+
const resolved = resolvePropType(typeArg);
|
|
12254
|
+
const typeText = transformIsBoolean ? "boolean" : transformIsNumber ? "number" : resolved.text;
|
|
12255
|
+
const name = alias ?? fieldName;
|
|
12256
|
+
const prop = {
|
|
12257
|
+
name,
|
|
12258
|
+
type: typeText,
|
|
12259
|
+
required,
|
|
12260
|
+
sourceStartLine: field.getStartLineNumber(),
|
|
12261
|
+
sourceEndLine: field.getEndLineNumber()
|
|
12262
|
+
};
|
|
12263
|
+
if (defaultValue !== void 0)
|
|
12264
|
+
prop.defaultValue = defaultValue;
|
|
12265
|
+
if (resolved.allowedValues && !transformIsBoolean && !transformIsNumber) {
|
|
12266
|
+
prop.allowedValues = resolved.allowedValues;
|
|
12267
|
+
}
|
|
12268
|
+
return prop;
|
|
12269
|
+
}
|
|
12270
|
+
|
|
12271
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/parse-inputs-array-entry.js
|
|
12272
|
+
function parseInputsArrayEntry(entry) {
|
|
12273
|
+
const trimmed = entry.trim();
|
|
12274
|
+
if (!trimmed)
|
|
12275
|
+
return null;
|
|
12276
|
+
const parts = trimmed.split(":");
|
|
12277
|
+
if (parts.length === 1) {
|
|
12278
|
+
return { fieldName: parts[0].trim(), alias: null };
|
|
12279
|
+
}
|
|
12280
|
+
if (parts.length === 2) {
|
|
12281
|
+
const field = parts[0].trim();
|
|
12282
|
+
const alias = parts[1].trim();
|
|
12283
|
+
if (!field || !alias)
|
|
12284
|
+
return null;
|
|
12285
|
+
return { fieldName: field, alias };
|
|
12286
|
+
}
|
|
12287
|
+
return null;
|
|
12288
|
+
}
|
|
12289
|
+
|
|
12290
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/props/extract-props.js
|
|
12291
|
+
var MAX_BASE_CHAIN = 10;
|
|
12292
|
+
function collectClassChain(cls) {
|
|
12293
|
+
const chain = [cls];
|
|
12294
|
+
const seen = /* @__PURE__ */ new Set([cls]);
|
|
12295
|
+
let current = cls;
|
|
12296
|
+
for (let i = 0; i < MAX_BASE_CHAIN; i++) {
|
|
12297
|
+
let base;
|
|
12298
|
+
try {
|
|
12299
|
+
base = current.getBaseClass();
|
|
12300
|
+
} catch {
|
|
12301
|
+
break;
|
|
12302
|
+
}
|
|
12303
|
+
if (!base || seen.has(base))
|
|
12304
|
+
break;
|
|
12305
|
+
chain.push(base);
|
|
12306
|
+
seen.add(base);
|
|
12307
|
+
current = base;
|
|
12308
|
+
}
|
|
12309
|
+
return chain;
|
|
12310
|
+
}
|
|
12311
|
+
function extractProps2(cls, meta) {
|
|
12312
|
+
const byName = /* @__PURE__ */ new Map();
|
|
12313
|
+
const chain = collectClassChain(cls);
|
|
12314
|
+
for (const klass of chain) {
|
|
12315
|
+
for (const field of klass.getProperties()) {
|
|
12316
|
+
const prop = extractDecoratorInput(field);
|
|
12317
|
+
if (prop && !byName.has(prop.name))
|
|
12318
|
+
byName.set(prop.name, prop);
|
|
12319
|
+
}
|
|
12320
|
+
for (const setter of klass.getSetAccessors()) {
|
|
12321
|
+
const prop = extractDecoratorInput(setter);
|
|
12322
|
+
if (prop && !byName.has(prop.name))
|
|
12323
|
+
byName.set(prop.name, prop);
|
|
12324
|
+
}
|
|
12325
|
+
for (const getter of klass.getGetAccessors()) {
|
|
12326
|
+
const prop = extractDecoratorInput(getter);
|
|
12327
|
+
if (prop && !byName.has(prop.name))
|
|
12328
|
+
byName.set(prop.name, prop);
|
|
12329
|
+
}
|
|
12330
|
+
for (const field of klass.getProperties()) {
|
|
12331
|
+
const prop = extractSignalInput(field);
|
|
12332
|
+
if (prop && !byName.has(prop.name))
|
|
12333
|
+
byName.set(prop.name, prop);
|
|
12334
|
+
}
|
|
12335
|
+
}
|
|
12336
|
+
for (const entry of meta.inputsArray) {
|
|
12337
|
+
const parsed = parseInputsArrayEntry(entry);
|
|
12338
|
+
if (!parsed)
|
|
12339
|
+
continue;
|
|
12340
|
+
const name = parsed.alias ?? parsed.fieldName;
|
|
12341
|
+
if (byName.has(name))
|
|
12342
|
+
continue;
|
|
12343
|
+
byName.set(name, { name, type: "any", required: false });
|
|
12344
|
+
}
|
|
12345
|
+
return [...byName.values()];
|
|
12346
|
+
}
|
|
12347
|
+
|
|
12348
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-component-metadata.js
|
|
12349
|
+
import { dirname as dirname10, resolve as resolve12 } from "node:path";
|
|
12350
|
+
|
|
12351
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/normalize-component-name.js
|
|
12352
|
+
var SUFFIXES = ["Component", "Directive"];
|
|
12353
|
+
function normalizeComponentName2(className) {
|
|
12354
|
+
for (const suffix of SUFFIXES) {
|
|
12355
|
+
if (className.endsWith(suffix) && className.length > suffix.length) {
|
|
12356
|
+
return className.slice(0, -suffix.length);
|
|
12357
|
+
}
|
|
12358
|
+
}
|
|
12359
|
+
return className;
|
|
12360
|
+
}
|
|
12361
|
+
|
|
12362
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-decorator-string.js
|
|
12363
|
+
import { Node as Node14 } from "ts-morph";
|
|
12364
|
+
function readDecoratorString(obj, propName) {
|
|
12365
|
+
const prop = obj.getProperty(propName);
|
|
12366
|
+
if (!prop || !Node14.isPropertyAssignment(prop))
|
|
12367
|
+
return null;
|
|
12368
|
+
const init = prop.getInitializer();
|
|
12369
|
+
if (!init)
|
|
12370
|
+
return null;
|
|
12371
|
+
if (Node14.isStringLiteral(init) || Node14.isNoSubstitutionTemplateLiteral(init)) {
|
|
12372
|
+
return init.getLiteralText();
|
|
12373
|
+
}
|
|
12374
|
+
return null;
|
|
12375
|
+
}
|
|
12376
|
+
function readDecoratorStringArray(obj, propName) {
|
|
12377
|
+
const prop = obj.getProperty(propName);
|
|
12378
|
+
if (!prop || !Node14.isPropertyAssignment(prop))
|
|
12379
|
+
return [];
|
|
12380
|
+
const init = prop.getInitializer();
|
|
12381
|
+
if (!init || !Node14.isArrayLiteralExpression(init))
|
|
12382
|
+
return [];
|
|
12383
|
+
const out = [];
|
|
12384
|
+
for (const el of init.getElements()) {
|
|
12385
|
+
if (Node14.isStringLiteral(el) || Node14.isNoSubstitutionTemplateLiteral(el)) {
|
|
12386
|
+
out.push(el.getLiteralText());
|
|
12387
|
+
}
|
|
12388
|
+
}
|
|
12389
|
+
return out;
|
|
12390
|
+
}
|
|
12391
|
+
|
|
12392
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/read-component-metadata.js
|
|
12393
|
+
function readComponentMetadata(cls, sourceFilePath) {
|
|
12394
|
+
const obj = findComponentDecorator(cls);
|
|
12395
|
+
if (!obj)
|
|
12396
|
+
return null;
|
|
12397
|
+
const className = cls.getName();
|
|
12398
|
+
if (!className)
|
|
12399
|
+
return null;
|
|
12400
|
+
const rawSelector = readDecoratorString(obj, "selector");
|
|
12401
|
+
const inlineTemplate = readDecoratorString(obj, "template");
|
|
12402
|
+
const templateUrlRel = readDecoratorString(obj, "templateUrl");
|
|
12403
|
+
const inputsArray = readDecoratorStringArray(obj, "inputs");
|
|
12404
|
+
const templatePath = templateUrlRel ? resolve12(dirname10(sourceFilePath), templateUrlRel) : null;
|
|
12405
|
+
const decorator = cls.getDecorator("Component");
|
|
12406
|
+
const decoratorLine = decorator?.getStartLineNumber() ?? cls.getStartLineNumber();
|
|
12407
|
+
return {
|
|
12408
|
+
className,
|
|
12409
|
+
normalizedName: normalizeComponentName2(className),
|
|
12410
|
+
rawSelector,
|
|
12411
|
+
inlineTemplate,
|
|
12412
|
+
templatePath,
|
|
12413
|
+
inputsArray,
|
|
12414
|
+
decoratorLine
|
|
12415
|
+
};
|
|
12416
|
+
}
|
|
12417
|
+
|
|
12418
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/template/parse-ng-content-elements.js
|
|
12419
|
+
function parseNgContentElements(templateHtml) {
|
|
12420
|
+
const out = [];
|
|
12421
|
+
const tagRe = /<ng-content\b([^>]*?)\/?>/gi;
|
|
12422
|
+
for (const match2 of templateHtml.matchAll(tagRe)) {
|
|
12423
|
+
const attrs = match2[1] ?? "";
|
|
12424
|
+
const selectMatch = attrs.match(/\bselect\s*=\s*(?:"([^"]*)"|'([^']*)')/);
|
|
12425
|
+
const rawSelect = selectMatch ? selectMatch[1] ?? selectMatch[2] ?? null : null;
|
|
12426
|
+
const sourceLine = countLines(templateHtml, match2.index ?? 0);
|
|
12427
|
+
out.push({ rawSelect, sourceLine });
|
|
12428
|
+
}
|
|
12429
|
+
return out;
|
|
12430
|
+
}
|
|
12431
|
+
function countLines(text, offset) {
|
|
12432
|
+
let line = 1;
|
|
12433
|
+
for (let i = 0; i < offset && i < text.length; i++) {
|
|
12434
|
+
if (text.charCodeAt(i) === 10)
|
|
12435
|
+
line++;
|
|
12436
|
+
}
|
|
12437
|
+
return line;
|
|
12438
|
+
}
|
|
12439
|
+
|
|
12440
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/template/resolve-template-source.js
|
|
12441
|
+
import { readFile as readFile7 } from "node:fs/promises";
|
|
12442
|
+
async function resolveTemplateSource(meta) {
|
|
12443
|
+
if (meta.inlineTemplate !== null)
|
|
12444
|
+
return meta.inlineTemplate;
|
|
12445
|
+
if (meta.templatePath === null)
|
|
12446
|
+
return null;
|
|
12447
|
+
try {
|
|
12448
|
+
return await readFile7(meta.templatePath, "utf8");
|
|
12449
|
+
} catch {
|
|
12450
|
+
return null;
|
|
12451
|
+
}
|
|
12452
|
+
}
|
|
12453
|
+
|
|
12454
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/resolution/strip-library-prefix.js
|
|
12455
|
+
var KNOWN_PREFIXES = ["Mat", "Cdk", "Nz", "Cds", "Ibm", "Clr", "Hlm", "Brn", "Tui", "Nb", "Fd", "P", "Ng"];
|
|
12456
|
+
function stripLibraryPrefix(name) {
|
|
12457
|
+
for (const prefix of KNOWN_PREFIXES) {
|
|
12458
|
+
if (name.startsWith(prefix) && name.length > prefix.length) {
|
|
12459
|
+
const rest = name.slice(prefix.length);
|
|
12460
|
+
if (rest[0] && rest[0] === rest[0].toUpperCase()) {
|
|
12461
|
+
return rest;
|
|
12462
|
+
}
|
|
12463
|
+
}
|
|
12464
|
+
}
|
|
12465
|
+
return name;
|
|
12466
|
+
}
|
|
12467
|
+
|
|
12468
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/derive-slot-name.js
|
|
12469
|
+
function deriveSlotName(rawSelect, parentNormalizedName) {
|
|
12470
|
+
if (!rawSelect || rawSelect.trim() === "")
|
|
12471
|
+
return "children";
|
|
12472
|
+
if (rawSelect.includes(",")) {
|
|
12473
|
+
const first = rawSelect.split(",")[0].trim();
|
|
12474
|
+
return deriveSingleSelectorName(first, parentNormalizedName);
|
|
12475
|
+
}
|
|
12476
|
+
return deriveSingleSelectorName(rawSelect.trim(), parentNormalizedName);
|
|
12477
|
+
}
|
|
12478
|
+
function deriveSingleSelectorName(sel, parentNormalizedName) {
|
|
12479
|
+
const slotAttrMatch = sel.match(/^\[\s*slot\s*=\s*['"]?([^'"\]]+)['"]?\s*\]$/);
|
|
12480
|
+
if (slotAttrMatch)
|
|
12481
|
+
return slotAttrMatch[1].trim();
|
|
12482
|
+
if (sel.startsWith(".")) {
|
|
12483
|
+
const last = sel.slice(1).split("-").pop() ?? sel.slice(1);
|
|
12484
|
+
return kebabToCamel2(last);
|
|
12485
|
+
}
|
|
12486
|
+
const attrMatch = sel.match(/^\[([^=\]]+)\]$/);
|
|
12487
|
+
if (attrMatch) {
|
|
12488
|
+
const attr = attrMatch[1].trim();
|
|
12489
|
+
const stripped = tryStripSubComponentOrLibraryPrefix(attr, parentNormalizedName);
|
|
12490
|
+
return stripped || kebabToCamel2(attr);
|
|
12491
|
+
}
|
|
12492
|
+
const elMatch = sel.match(/^([a-zA-Z][a-zA-Z0-9-]*)/);
|
|
12493
|
+
if (elMatch) {
|
|
12494
|
+
const tag = elMatch[1];
|
|
12495
|
+
const stripped = tryStripSubComponentOrLibraryPrefix(tag, parentNormalizedName);
|
|
12496
|
+
return stripped || kebabToCamel2(tag);
|
|
12497
|
+
}
|
|
12498
|
+
return sel.replace(/\s+/g, "");
|
|
12499
|
+
}
|
|
12500
|
+
function tryStripSubComponentOrLibraryPrefix(ident, parentNormalizedName) {
|
|
12501
|
+
const parentKebab = pascalToKebab(parentNormalizedName);
|
|
12502
|
+
if (parentKebab && ident.startsWith(`${parentKebab}-`)) {
|
|
12503
|
+
return kebabToCamel2(ident.slice(parentKebab.length + 1));
|
|
12504
|
+
}
|
|
12505
|
+
const asPascal = kebabToPascal2(ident);
|
|
12506
|
+
const stripped = stripLibraryPrefix(asPascal);
|
|
12507
|
+
if (stripped !== asPascal) {
|
|
12508
|
+
return stripped.charAt(0).toLowerCase() + stripped.slice(1);
|
|
12509
|
+
}
|
|
12510
|
+
return null;
|
|
12511
|
+
}
|
|
12512
|
+
function kebabToCamel2(s) {
|
|
12513
|
+
return s.replace(/-([a-z])/g, (_, c2) => c2.toUpperCase());
|
|
12514
|
+
}
|
|
12515
|
+
function kebabToPascal2(s) {
|
|
12516
|
+
const camel = kebabToCamel2(s);
|
|
12517
|
+
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
|
12518
|
+
}
|
|
12519
|
+
function pascalToKebab(s) {
|
|
12520
|
+
return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
12521
|
+
}
|
|
12522
|
+
|
|
12523
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-content-child-queries.js
|
|
12524
|
+
import { Node as Node15 } from "ts-morph";
|
|
12525
|
+
function extractContentChildQueries(cls) {
|
|
12526
|
+
const out = [];
|
|
12527
|
+
for (const field of cls.getProperties()) {
|
|
12528
|
+
const fieldName = field.getName();
|
|
12529
|
+
const init = field.getInitializer();
|
|
12530
|
+
if (init && Node15.isCallExpression(init)) {
|
|
12531
|
+
const callee = init.getExpression();
|
|
12532
|
+
if (Node15.isIdentifier(callee)) {
|
|
12533
|
+
const name = callee.getText();
|
|
12534
|
+
if (name === "contentChild" || name === "contentChildren") {
|
|
12535
|
+
const first = init.getArguments()[0];
|
|
12536
|
+
const allowed = resolveClassIdentifierArg(first);
|
|
12537
|
+
out.push(buildSlot(fieldName, allowed));
|
|
12538
|
+
continue;
|
|
12539
|
+
}
|
|
12540
|
+
}
|
|
12541
|
+
}
|
|
12542
|
+
for (const decName of ["ContentChild", "ContentChildren"]) {
|
|
12543
|
+
const dec = field.getDecorator(decName);
|
|
12544
|
+
if (dec) {
|
|
12545
|
+
const first = dec.getArguments()[0];
|
|
12546
|
+
const allowed = resolveClassIdentifierArg(first);
|
|
12547
|
+
out.push(buildSlot(fieldName, allowed));
|
|
12548
|
+
break;
|
|
12549
|
+
}
|
|
12550
|
+
}
|
|
12551
|
+
}
|
|
12552
|
+
return out;
|
|
12553
|
+
}
|
|
12554
|
+
function resolveClassIdentifierArg(arg) {
|
|
12555
|
+
if (!arg)
|
|
12556
|
+
return [];
|
|
12557
|
+
if (Node15.isStringLiteral(arg) || Node15.isNoSubstitutionTemplateLiteral(arg))
|
|
12558
|
+
return [];
|
|
12559
|
+
if (Node15.isIdentifier(arg))
|
|
12560
|
+
return [arg.getText()];
|
|
12561
|
+
return [];
|
|
12562
|
+
}
|
|
12563
|
+
function buildSlot(name, allowed) {
|
|
12564
|
+
const slot = {
|
|
12565
|
+
name,
|
|
12566
|
+
isDefault: false
|
|
12567
|
+
};
|
|
12568
|
+
if (allowed.length > 0)
|
|
12569
|
+
slot.allowedComponents = allowed;
|
|
12570
|
+
return slot;
|
|
12571
|
+
}
|
|
12572
|
+
|
|
12573
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-template-ref-slots.js
|
|
12574
|
+
function extractTemplateRefSlots(props) {
|
|
12575
|
+
const nextProps = [];
|
|
12576
|
+
const slots = [];
|
|
12577
|
+
for (const prop of props) {
|
|
12578
|
+
const type = prop.type;
|
|
12579
|
+
const hasTemplateRef = /\bTemplateRef\b/.test(type);
|
|
12580
|
+
if (!hasTemplateRef) {
|
|
12581
|
+
nextProps.push(prop);
|
|
12582
|
+
continue;
|
|
12583
|
+
}
|
|
12584
|
+
const isPureTemplateRef = /^\s*TemplateRef<[^>]*>\s*(\|\s*(null|undefined)\s*)*$/.test(type);
|
|
12585
|
+
if (!isPureTemplateRef) {
|
|
12586
|
+
nextProps.push(prop);
|
|
12587
|
+
}
|
|
12588
|
+
slots.push({ name: prop.name, isDefault: false });
|
|
12589
|
+
}
|
|
12590
|
+
return { props: nextProps, slots };
|
|
12591
|
+
}
|
|
12592
|
+
|
|
12593
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/slots/extract-slots.js
|
|
12594
|
+
async function extractSlots3(cls, meta, props) {
|
|
12595
|
+
const byName = /* @__PURE__ */ new Map();
|
|
12596
|
+
const template = await resolveTemplateSource(meta);
|
|
12597
|
+
if (template) {
|
|
12598
|
+
for (const el of parseNgContentElements(template)) {
|
|
12599
|
+
const name = deriveSlotName(el.rawSelect, meta.normalizedName);
|
|
12600
|
+
if (byName.has(name))
|
|
12601
|
+
continue;
|
|
12602
|
+
byName.set(name, {
|
|
12603
|
+
name,
|
|
12604
|
+
isDefault: el.rawSelect === null
|
|
12605
|
+
});
|
|
12606
|
+
}
|
|
12607
|
+
}
|
|
12608
|
+
for (const slot of extractContentChildQueries(cls)) {
|
|
12609
|
+
if (!byName.has(slot.name))
|
|
12610
|
+
byName.set(slot.name, slot);
|
|
12611
|
+
}
|
|
12612
|
+
const split = extractTemplateRefSlots(props);
|
|
12613
|
+
for (const slot of split.slots) {
|
|
12614
|
+
if (!byName.has(slot.name))
|
|
12615
|
+
byName.set(slot.name, slot);
|
|
12616
|
+
}
|
|
12617
|
+
return { props: split.props, slots: [...byName.values()] };
|
|
12618
|
+
}
|
|
12619
|
+
|
|
12620
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/extract-angular-components.js
|
|
12621
|
+
async function extractAngularComponents(filePaths, onProgress, _opts) {
|
|
12622
|
+
const components = [];
|
|
12623
|
+
const warnings = [];
|
|
12624
|
+
let filesProcessed = 0;
|
|
12625
|
+
const project = new Project7({
|
|
12626
|
+
useInMemoryFileSystem: false,
|
|
12627
|
+
skipAddingFilesFromTsConfig: true,
|
|
12628
|
+
compilerOptions: {
|
|
12629
|
+
target: ScriptTarget2.ES2022,
|
|
12630
|
+
module: ModuleKind2.ESNext,
|
|
12631
|
+
experimentalDecorators: true,
|
|
12632
|
+
emitDecoratorMetadata: false,
|
|
12633
|
+
allowJs: false
|
|
12634
|
+
}
|
|
12635
|
+
});
|
|
12636
|
+
for (const filePath of filePaths) {
|
|
12637
|
+
try {
|
|
12638
|
+
const source = await readFile8(filePath, "utf8");
|
|
12639
|
+
const sourceFile = project.createSourceFile(filePath, source, { overwrite: true });
|
|
12640
|
+
for (const cls of sourceFile.getClasses()) {
|
|
12641
|
+
if (!hasComponentDecorator(cls))
|
|
12642
|
+
continue;
|
|
12643
|
+
if (!findComponentDecorator(cls)) {
|
|
12644
|
+
warnings.push(`${filePath}: ${cls.getName() ?? "<anonymous>"} has @Component with a non-literal argument; skipped.`);
|
|
12645
|
+
continue;
|
|
12646
|
+
}
|
|
12647
|
+
const meta = readComponentMetadata(cls, filePath);
|
|
12648
|
+
if (!meta)
|
|
12649
|
+
continue;
|
|
12650
|
+
const propsOnly = extractProps2(cls, meta);
|
|
12651
|
+
const { props, slots } = await extractSlots3(cls, meta, propsOnly);
|
|
12652
|
+
const partial = {
|
|
12653
|
+
name: meta.className,
|
|
12654
|
+
source: filePath,
|
|
12655
|
+
framework: "angular",
|
|
12656
|
+
props,
|
|
12657
|
+
slots: normalizeSlots(slots),
|
|
12658
|
+
sourcePath: filePath
|
|
12659
|
+
};
|
|
12660
|
+
const score = computeExtractionScore(partial);
|
|
12661
|
+
partial.extractionConfidence = score.confidence;
|
|
12662
|
+
partial.reviewReasons = score.reasons;
|
|
12663
|
+
partial.needsReview = deriveNeedsReview(score.confidence);
|
|
12664
|
+
components.push(partial);
|
|
12665
|
+
}
|
|
12666
|
+
sourceFile.forget();
|
|
12667
|
+
} catch (err) {
|
|
12668
|
+
warnings.push(`${filePath}: Angular extractor failed \u2014 ${err instanceof Error ? err.message : String(err)}`);
|
|
12669
|
+
} finally {
|
|
12670
|
+
filesProcessed++;
|
|
12671
|
+
if (onProgress)
|
|
12672
|
+
onProgress({ filesProcessed, componentsFound: components.length });
|
|
12673
|
+
}
|
|
12674
|
+
}
|
|
12675
|
+
return {
|
|
12676
|
+
components: components.sort((a, b) => a.name.localeCompare(b.name)),
|
|
12677
|
+
warnings
|
|
12678
|
+
};
|
|
12679
|
+
}
|
|
12680
|
+
function normalizeSlots(slots) {
|
|
12681
|
+
let fallbackIndex = 0;
|
|
12682
|
+
return slots.map((slot) => {
|
|
12683
|
+
if (slot.name.trim())
|
|
12684
|
+
return slot;
|
|
12685
|
+
const name = fallbackIndex === 0 ? "children" : `slot_${fallbackIndex}`;
|
|
12686
|
+
fallbackIndex++;
|
|
12687
|
+
return { ...slot, name };
|
|
12688
|
+
});
|
|
12689
|
+
}
|
|
12690
|
+
|
|
12691
|
+
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/framework-adapters/angular/helpers/is-angular-source-file.js
|
|
12692
|
+
import { openSync, readSync, closeSync, statSync as statSync4 } from "node:fs";
|
|
12693
|
+
var HEAD_BYTES = 32 * 1024;
|
|
12694
|
+
var buffer = Buffer.alloc(HEAD_BYTES);
|
|
12695
|
+
function isAngularSourceFile(filePath) {
|
|
12696
|
+
if (!/\.[cm]?ts$/.test(filePath))
|
|
12697
|
+
return false;
|
|
12698
|
+
if (filePath.endsWith(".d.ts"))
|
|
12699
|
+
return false;
|
|
12700
|
+
try {
|
|
12701
|
+
const stats = statSync4(filePath);
|
|
12702
|
+
const toRead = Math.min(HEAD_BYTES, stats.size);
|
|
12703
|
+
if (toRead === 0)
|
|
12704
|
+
return false;
|
|
12705
|
+
const fd = openSync(filePath, "r");
|
|
12706
|
+
try {
|
|
12707
|
+
const bytesRead = readSync(fd, buffer, 0, toRead, 0);
|
|
12708
|
+
const head = buffer.subarray(0, bytesRead).toString("utf8");
|
|
12709
|
+
return head.includes("@angular/core");
|
|
12710
|
+
} finally {
|
|
12711
|
+
closeSync(fd);
|
|
12712
|
+
}
|
|
12713
|
+
} catch {
|
|
12714
|
+
return false;
|
|
12715
|
+
}
|
|
12716
|
+
}
|
|
12717
|
+
|
|
11982
12718
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/services/run-extraction-service.js
|
|
11983
12719
|
var extractors = [
|
|
11984
12720
|
{
|
|
@@ -12006,6 +12742,13 @@ var extractors = [
|
|
|
12006
12742
|
fileFilter: (f) => f.endsWith(".astro"),
|
|
12007
12743
|
extract: extractAstroComponents
|
|
12008
12744
|
},
|
|
12745
|
+
{
|
|
12746
|
+
// Must run BEFORE web-components (both claim bare .ts). The sniff reads
|
|
12747
|
+
// the file head looking for `@angular/core` so we only claim real Angular files.
|
|
12748
|
+
name: "angular",
|
|
12749
|
+
fileFilter: (f) => isAngularSourceFile(f),
|
|
12750
|
+
extract: extractAngularComponents
|
|
12751
|
+
},
|
|
12009
12752
|
{
|
|
12010
12753
|
name: "web-components",
|
|
12011
12754
|
fileFilter: (f) => /\.[jt]s$/.test(f) && !/\.[jt]sx$/.test(f) && !f.endsWith(".d.ts"),
|
|
@@ -12481,16 +13224,16 @@ function applyCompositionEdges(components, edges) {
|
|
|
12481
13224
|
|
|
12482
13225
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/prompt/prompt-loader.js
|
|
12483
13226
|
import { existsSync as existsSync7, readFileSync as readFileSync7 } from "node:fs";
|
|
12484
|
-
import { dirname as
|
|
13227
|
+
import { dirname as dirname11, join as join10, resolve as resolve13 } from "node:path";
|
|
12485
13228
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
12486
13229
|
function resolvePromptPath(fileName) {
|
|
12487
|
-
const thisDir =
|
|
13230
|
+
const thisDir = dirname11(fileURLToPath3(import.meta.url));
|
|
12488
13231
|
let dir = thisDir;
|
|
12489
13232
|
for (; ; ) {
|
|
12490
13233
|
const candidate = join10(dir, "prompts");
|
|
12491
13234
|
if (existsSync7(candidate))
|
|
12492
13235
|
return join10(candidate, fileName);
|
|
12493
|
-
const parent =
|
|
13236
|
+
const parent = resolve13(dir, "..");
|
|
12494
13237
|
if (parent === dir) {
|
|
12495
13238
|
throw new Error(`prompt file missing from package installation (could not locate prompts/ directory from: ${thisDir})`);
|
|
12496
13239
|
}
|
|
@@ -12570,14 +13313,31 @@ ${f.content}`).join("\n\n");
|
|
|
12570
13313
|
}
|
|
12571
13314
|
|
|
12572
13315
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/constants/candidate-files.js
|
|
12573
|
-
var CANDIDATE_NAME_PATTERNS = [
|
|
13316
|
+
var CANDIDATE_NAME_PATTERNS = [
|
|
13317
|
+
/mapping/i,
|
|
13318
|
+
/meta/i,
|
|
13319
|
+
/registry/i,
|
|
13320
|
+
/schema/i,
|
|
13321
|
+
/composition/i,
|
|
13322
|
+
/\.module\.ts$/i,
|
|
13323
|
+
/\.component\.ts$/i,
|
|
13324
|
+
/public[-_]api\.ts$/i,
|
|
13325
|
+
/^index\.ts$/i
|
|
13326
|
+
];
|
|
12574
13327
|
var CANDIDATE_CONTENT_MARKERS = [
|
|
12575
13328
|
"requiredParent",
|
|
12576
13329
|
"withParentType",
|
|
12577
13330
|
"allowedTagNames",
|
|
12578
13331
|
"createContext",
|
|
12579
13332
|
"MappingContext",
|
|
12580
|
-
"allowedComponents"
|
|
13333
|
+
"allowedComponents",
|
|
13334
|
+
"TemplateRef",
|
|
13335
|
+
"NG_VALUE_ACCESSOR",
|
|
13336
|
+
"ContentChild",
|
|
13337
|
+
"contentChild",
|
|
13338
|
+
"ng-content",
|
|
13339
|
+
"@NgModule",
|
|
13340
|
+
"standalone: true"
|
|
12581
13341
|
];
|
|
12582
13342
|
var PROMPT_CANDIDATE_TOKEN_BUDGET = 8e4;
|
|
12583
13343
|
|
|
@@ -12638,8 +13398,8 @@ ${fileDigest}`);
|
|
|
12638
13398
|
}
|
|
12639
13399
|
|
|
12640
13400
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/composition/src/helpers/edges/manifest-doc-evidence.js
|
|
12641
|
-
import { dirname as
|
|
12642
|
-
function
|
|
13401
|
+
import { dirname as dirname12 } from "node:path";
|
|
13402
|
+
function kebabToPascal3(name) {
|
|
12643
13403
|
return name.split("-").filter(Boolean).map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1)).join("");
|
|
12644
13404
|
}
|
|
12645
13405
|
function collectManifestEdges(files, componentNames) {
|
|
@@ -12661,7 +13421,7 @@ function collectManifestEdges(files, componentNames) {
|
|
|
12661
13421
|
const rawParentName = typeof component === "object" && component !== null && typeof component.name === "string" ? component.name : void 0;
|
|
12662
13422
|
if (!rawParentName)
|
|
12663
13423
|
continue;
|
|
12664
|
-
const parent =
|
|
13424
|
+
const parent = kebabToPascal3(rawParentName);
|
|
12665
13425
|
if (!componentNames.has(parent))
|
|
12666
13426
|
continue;
|
|
12667
13427
|
const variantsMeta = root.variantsMeta;
|
|
@@ -12681,7 +13441,7 @@ function collectManifestEdges(files, componentNames) {
|
|
|
12681
13441
|
const rawChildName = value.name;
|
|
12682
13442
|
if (typeof rawChildName !== "string")
|
|
12683
13443
|
continue;
|
|
12684
|
-
const child =
|
|
13444
|
+
const child = kebabToPascal3(rawChildName);
|
|
12685
13445
|
if (!componentNames.has(child) || child === parent)
|
|
12686
13446
|
continue;
|
|
12687
13447
|
const key = `${parent}::${child}`;
|
|
@@ -12702,8 +13462,8 @@ function collectAgentsDocEdges(files, components, componentNames) {
|
|
|
12702
13462
|
for (const file of files) {
|
|
12703
13463
|
if (!file.path.endsWith("AGENTS.md"))
|
|
12704
13464
|
continue;
|
|
12705
|
-
const docDir =
|
|
12706
|
-
const parent = components.find((c2) => c2.sourcePath &&
|
|
13465
|
+
const docDir = dirname12(file.path);
|
|
13466
|
+
const parent = components.find((c2) => c2.sourcePath && dirname12(c2.sourcePath) === docDir)?.name;
|
|
12707
13467
|
if (!parent || !componentNames.has(parent))
|
|
12708
13468
|
continue;
|
|
12709
13469
|
for (const line of file.content.split("\n")) {
|
|
@@ -12712,7 +13472,7 @@ function collectAgentsDocEdges(files, components, componentNames) {
|
|
|
12712
13472
|
continue;
|
|
12713
13473
|
for (const match2 of line.matchAll(BOLD_BACKTICK)) {
|
|
12714
13474
|
const raw = match2[1];
|
|
12715
|
-
const candidate = componentNames.has(raw) ? raw :
|
|
13475
|
+
const candidate = componentNames.has(raw) ? raw : kebabToPascal3(raw);
|
|
12716
13476
|
if (!componentNames.has(candidate) || candidate === parent)
|
|
12717
13477
|
continue;
|
|
12718
13478
|
const key = `${parent}::${candidate}`;
|
|
@@ -13028,7 +13788,7 @@ function validateExtractedComponents(components) {
|
|
|
13028
13788
|
}
|
|
13029
13789
|
|
|
13030
13790
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/load-review-input.js
|
|
13031
|
-
import { resolve as
|
|
13791
|
+
import { resolve as resolve15 } from "node:path";
|
|
13032
13792
|
|
|
13033
13793
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/create-component-id.js
|
|
13034
13794
|
import { createHash as createHash7 } from "node:crypto";
|
|
@@ -13039,7 +13799,7 @@ function createComponentId(name, resolvedSourcePath) {
|
|
|
13039
13799
|
|
|
13040
13800
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/resolve-component-source-path.js
|
|
13041
13801
|
import { access } from "node:fs/promises";
|
|
13042
|
-
import { isAbsolute, relative, resolve as
|
|
13802
|
+
import { isAbsolute, relative, resolve as resolve14 } from "node:path";
|
|
13043
13803
|
async function resolveComponentSourcePath(source, reviewRoot) {
|
|
13044
13804
|
if (isAbsolute(source)) {
|
|
13045
13805
|
try {
|
|
@@ -13049,7 +13809,7 @@ async function resolveComponentSourcePath(source, reviewRoot) {
|
|
|
13049
13809
|
throw new Error(`Unable to access component source at ${source}`);
|
|
13050
13810
|
}
|
|
13051
13811
|
}
|
|
13052
|
-
const candidate =
|
|
13812
|
+
const candidate = resolve14(reviewRoot, source);
|
|
13053
13813
|
const relativeToRoot = relative(reviewRoot, candidate);
|
|
13054
13814
|
if (relativeToRoot.startsWith("..") || relativeToRoot === ".." || isAbsolute(relativeToRoot)) {
|
|
13055
13815
|
throw new Error(`Resolved component source is outside the review root: ${source}. Pass --project-root <path> to set the correct base.`);
|
|
@@ -13064,7 +13824,7 @@ async function resolveComponentSourcePath(source, reviewRoot) {
|
|
|
13064
13824
|
|
|
13065
13825
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/helpers/load-review-input.js
|
|
13066
13826
|
async function loadReviewInput(components, options = {}) {
|
|
13067
|
-
const reviewRoot =
|
|
13827
|
+
const reviewRoot = resolve15(options.reviewRoot ?? process.cwd());
|
|
13068
13828
|
const records = await Promise.all(components.map(async (component) => {
|
|
13069
13829
|
let resolvedSourcePath;
|
|
13070
13830
|
try {
|
|
@@ -13099,19 +13859,19 @@ async function loadAndValidateForReview(sessionId, projectRoot) {
|
|
|
13099
13859
|
}
|
|
13100
13860
|
|
|
13101
13861
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/selection/src/controller/review/merge-preview-validation-errors-into-review-session.js
|
|
13102
|
-
import { access as access3, readFile as
|
|
13862
|
+
import { access as access3, readFile as readFile10 } from "node:fs/promises";
|
|
13103
13863
|
|
|
13104
13864
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/ensure-review-session.js
|
|
13105
|
-
import { access as access2, mkdir, readFile as
|
|
13865
|
+
import { access as access2, mkdir, readFile as readFile9, writeFile } from "node:fs/promises";
|
|
13106
13866
|
|
|
13107
13867
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/review-session-paths.js
|
|
13108
|
-
import { resolve as
|
|
13868
|
+
import { resolve as resolve16 } from "node:path";
|
|
13109
13869
|
async function getRefineSessionPaths(sessionId, artifactsRoot) {
|
|
13110
|
-
const sessionDir2 =
|
|
13870
|
+
const sessionDir2 = resolve16(artifactsRoot, sessionId);
|
|
13111
13871
|
return {
|
|
13112
13872
|
sessionDir: sessionDir2,
|
|
13113
|
-
eventsPath:
|
|
13114
|
-
statePath:
|
|
13873
|
+
eventsPath: resolve16(sessionDir2, "events.jsonl"),
|
|
13874
|
+
statePath: resolve16(sessionDir2, "current-review-state.json")
|
|
13115
13875
|
};
|
|
13116
13876
|
}
|
|
13117
13877
|
|
|
@@ -13121,7 +13881,7 @@ async function ensureRefineSession(sessionId, artifactsRoot, initialSnapshot) {
|
|
|
13121
13881
|
await mkdir(paths.sessionDir, { recursive: true });
|
|
13122
13882
|
try {
|
|
13123
13883
|
await access2(paths.statePath);
|
|
13124
|
-
const savedState = await
|
|
13884
|
+
const savedState = await readFile9(paths.statePath, "utf8");
|
|
13125
13885
|
return JSON.parse(savedState);
|
|
13126
13886
|
} catch {
|
|
13127
13887
|
await writeFile(paths.statePath, JSON.stringify(initialSnapshot, null, 2), "utf8");
|
|
@@ -13131,12 +13891,12 @@ async function ensureRefineSession(sessionId, artifactsRoot, initialSnapshot) {
|
|
|
13131
13891
|
}
|
|
13132
13892
|
|
|
13133
13893
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/review-artifacts-root.js
|
|
13134
|
-
import { resolve as
|
|
13894
|
+
import { resolve as resolve17 } from "node:path";
|
|
13135
13895
|
function getRefineArtifactsRoot() {
|
|
13136
13896
|
if (process.env["EDS_REVIEW_ARTIFACTS_DIR"]) {
|
|
13137
|
-
return
|
|
13897
|
+
return resolve17(process.env["EDS_REVIEW_ARTIFACTS_DIR"]);
|
|
13138
13898
|
}
|
|
13139
|
-
return
|
|
13899
|
+
return resolve17(configRoot(), "reviews");
|
|
13140
13900
|
}
|
|
13141
13901
|
|
|
13142
13902
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/save-review-state.js
|
|
@@ -13152,7 +13912,7 @@ async function mergePreviewValidationErrorsIntoReviewSession(sessionId, errors,
|
|
|
13152
13912
|
let snapshot;
|
|
13153
13913
|
try {
|
|
13154
13914
|
await access3(paths.statePath);
|
|
13155
|
-
snapshot = JSON.parse(await
|
|
13915
|
+
snapshot = JSON.parse(await readFile10(paths.statePath, "utf8"));
|
|
13156
13916
|
} catch {
|
|
13157
13917
|
snapshot = await loadAndValidateForReview(sessionId, void 0);
|
|
13158
13918
|
snapshot = await ensureRefineSession(sessionId, artifactsRoot, snapshot);
|
|
@@ -13190,7 +13950,7 @@ async function mergePreviewValidationErrorsIntoReviewSession(sessionId, errors,
|
|
|
13190
13950
|
}
|
|
13191
13951
|
|
|
13192
13952
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/selection/src/controller/review/reject-components-by-name.js
|
|
13193
|
-
import { readFile as
|
|
13953
|
+
import { readFile as readFile11 } from "node:fs/promises";
|
|
13194
13954
|
async function rejectComponentsByName(sessionId, names, opts = {}) {
|
|
13195
13955
|
if (names.length === 0)
|
|
13196
13956
|
return;
|
|
@@ -13206,7 +13966,7 @@ async function rejectComponentsByName(sessionId, names, opts = {}) {
|
|
|
13206
13966
|
const nameSet = new Set(names);
|
|
13207
13967
|
let snapshot;
|
|
13208
13968
|
try {
|
|
13209
|
-
snapshot = JSON.parse(await
|
|
13969
|
+
snapshot = JSON.parse(await readFile11(paths.statePath, "utf8"));
|
|
13210
13970
|
} catch {
|
|
13211
13971
|
return;
|
|
13212
13972
|
}
|
|
@@ -13215,7 +13975,7 @@ async function rejectComponentsByName(sessionId, names, opts = {}) {
|
|
|
13215
13975
|
}
|
|
13216
13976
|
|
|
13217
13977
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/collect-files.js
|
|
13218
|
-
import { statSync as
|
|
13978
|
+
import { statSync as statSync5 } from "node:fs";
|
|
13219
13979
|
import path4 from "node:path";
|
|
13220
13980
|
|
|
13221
13981
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/helpers/collect-files/build-scan-warnings.js
|
|
@@ -13270,7 +14030,9 @@ var EXCLUDED_SUFFIXES = [
|
|
|
13270
14030
|
".spec.ts",
|
|
13271
14031
|
".spec.tsx",
|
|
13272
14032
|
".test.ts",
|
|
13273
|
-
".test.tsx"
|
|
14033
|
+
".test.tsx",
|
|
14034
|
+
".harness.ts",
|
|
14035
|
+
".harness.tsx"
|
|
13274
14036
|
];
|
|
13275
14037
|
var IGNORED_DIRS = /* @__PURE__ */ new Set([
|
|
13276
14038
|
".changeset",
|
|
@@ -13288,9 +14050,12 @@ var IGNORED_DIRS = /* @__PURE__ */ new Set([
|
|
|
13288
14050
|
"dist",
|
|
13289
14051
|
"example",
|
|
13290
14052
|
"examples",
|
|
14053
|
+
"harness",
|
|
14054
|
+
"harnesses",
|
|
13291
14055
|
"node_modules",
|
|
13292
14056
|
"out",
|
|
13293
|
-
"storybook-static"
|
|
14057
|
+
"storybook-static",
|
|
14058
|
+
"testing"
|
|
13294
14059
|
]);
|
|
13295
14060
|
var DENYLISTED_EXACT_FILE_NAMES = /* @__PURE__ */ new Set([
|
|
13296
14061
|
"package.json",
|
|
@@ -13402,7 +14167,7 @@ function collectFiles(root, options = {}) {
|
|
|
13402
14167
|
const resolved = path4.resolve(root);
|
|
13403
14168
|
let stat5;
|
|
13404
14169
|
try {
|
|
13405
|
-
stat5 =
|
|
14170
|
+
stat5 = statSync5(resolved);
|
|
13406
14171
|
} catch (err) {
|
|
13407
14172
|
return { ok: false, failure: classifyStatError(err.code), rootPath: resolved };
|
|
13408
14173
|
}
|
|
@@ -13458,7 +14223,7 @@ function generateUlid(now = Date.now()) {
|
|
|
13458
14223
|
}
|
|
13459
14224
|
|
|
13460
14225
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/read-runs-file.js
|
|
13461
|
-
import { readFile as
|
|
14226
|
+
import { readFile as readFile12 } from "node:fs/promises";
|
|
13462
14227
|
|
|
13463
14228
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/helpers/migrate-record.js
|
|
13464
14229
|
function migrateRecord(rec) {
|
|
@@ -13477,7 +14242,7 @@ var READABLE_VERSIONS = /* @__PURE__ */ new Set([1, 2, 3]);
|
|
|
13477
14242
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/read-runs-file.js
|
|
13478
14243
|
async function readRunsFileMaybe() {
|
|
13479
14244
|
try {
|
|
13480
|
-
const raw = await
|
|
14245
|
+
const raw = await readFile12(runsFilePath(), "utf8");
|
|
13481
14246
|
const parsed = JSON.parse(raw);
|
|
13482
14247
|
if (!READABLE_VERSIONS.has(parsed.version)) {
|
|
13483
14248
|
throw new Error(`runs.json version mismatch: file is v${parsed.version}, this CLI expects v${RUNS_FILE_VERSION} (also reads: ${[...READABLE_VERSIONS].join(", ")}). Back up and remove the file to start fresh.`);
|
|
@@ -13494,9 +14259,9 @@ async function readRunsFileMaybe() {
|
|
|
13494
14259
|
|
|
13495
14260
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/repositories/write-runs-file.js
|
|
13496
14261
|
import { mkdir as mkdir2, rename, writeFile as writeFile3 } from "node:fs/promises";
|
|
13497
|
-
import { dirname as
|
|
14262
|
+
import { dirname as dirname13 } from "node:path";
|
|
13498
14263
|
async function writeRunsFileAtomic(file) {
|
|
13499
|
-
await mkdir2(
|
|
14264
|
+
await mkdir2(dirname13(runsFilePath()), { recursive: true });
|
|
13500
14265
|
const body = JSON.stringify(file, null, 2) + "\n";
|
|
13501
14266
|
const tmp = `${runsFilePath()}.${process.pid}.${Date.now()}.tmp`;
|
|
13502
14267
|
await writeFile3(tmp, body, { mode: 384 });
|
|
@@ -13536,8 +14301,8 @@ async function updateRun(id, patch) {
|
|
|
13536
14301
|
}
|
|
13537
14302
|
|
|
13538
14303
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/services/build-source-fingerprint.js
|
|
13539
|
-
import { readFile as
|
|
13540
|
-
import { resolve as
|
|
14304
|
+
import { readFile as readFile13, stat } from "node:fs/promises";
|
|
14305
|
+
import { resolve as resolve18 } from "node:path";
|
|
13541
14306
|
|
|
13542
14307
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/runs/helpers/sha256-hex.js
|
|
13543
14308
|
import { createHash as createHash8 } from "node:crypto";
|
|
@@ -13559,7 +14324,7 @@ async function buildSourceFingerprint(opts) {
|
|
|
13559
14324
|
const name = rowField(row, "name");
|
|
13560
14325
|
if (!sourcePath)
|
|
13561
14326
|
continue;
|
|
13562
|
-
const abs =
|
|
14327
|
+
const abs = resolve18(sourcePath);
|
|
13563
14328
|
if (seen.has(abs))
|
|
13564
14329
|
continue;
|
|
13565
14330
|
seen.add(abs);
|
|
@@ -13576,10 +14341,10 @@ async function buildSourceFingerprint(opts) {
|
|
|
13576
14341
|
let rawTokensMtime = null;
|
|
13577
14342
|
let rawTokensContentHash = null;
|
|
13578
14343
|
if (opts.rawTokensPath) {
|
|
13579
|
-
const abs =
|
|
14344
|
+
const abs = resolve18(opts.rawTokensPath);
|
|
13580
14345
|
rawTokensPath = abs;
|
|
13581
14346
|
try {
|
|
13582
|
-
const [st, buf] = await Promise.all([stat(abs),
|
|
14347
|
+
const [st, buf] = await Promise.all([stat(abs), readFile13(abs)]);
|
|
13583
14348
|
rawTokensMtime = st.mtime.toISOString();
|
|
13584
14349
|
rawTokensContentHash = sha256Hex(buf);
|
|
13585
14350
|
} catch {
|
|
@@ -13661,12 +14426,12 @@ async function writeScopeDecisionsSnapshot(db, sessionId, decisions) {
|
|
|
13661
14426
|
}
|
|
13662
14427
|
|
|
13663
14428
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/review-session/repositories/load-accepted-names.js
|
|
13664
|
-
import { readFile as
|
|
14429
|
+
import { readFile as readFile14 } from "node:fs/promises";
|
|
13665
14430
|
async function loadAcceptedNames(sessionId) {
|
|
13666
14431
|
try {
|
|
13667
14432
|
const artifactsRoot = getRefineArtifactsRoot();
|
|
13668
14433
|
const paths = await getRefineSessionPaths(sessionId, artifactsRoot);
|
|
13669
|
-
const raw = await
|
|
14434
|
+
const raw = await readFile14(paths.statePath, "utf8");
|
|
13670
14435
|
const snapshot = JSON.parse(raw);
|
|
13671
14436
|
const accepted = snapshot.components.filter((c2) => c2.status === "accepted").map((c2) => c2.name);
|
|
13672
14437
|
if (accepted.length === 0)
|
|
@@ -14364,7 +15129,7 @@ function errorMessage(error) {
|
|
|
14364
15129
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
14365
15130
|
}
|
|
14366
15131
|
function defaultSleep(delayMs) {
|
|
14367
|
-
return new Promise((
|
|
15132
|
+
return new Promise((resolve29) => setTimeout(resolve29, delayMs));
|
|
14368
15133
|
}
|
|
14369
15134
|
|
|
14370
15135
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/sanitize-preview.js
|
|
@@ -14605,7 +15370,7 @@ var ApiClient = class {
|
|
|
14605
15370
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14606
15371
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14607
15372
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14608
|
-
await new Promise((
|
|
15373
|
+
await new Promise((resolve29) => setTimeout(resolve29, baseDelay + jitter));
|
|
14609
15374
|
}
|
|
14610
15375
|
}
|
|
14611
15376
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -14992,7 +15757,7 @@ function formatApiError2(request) {
|
|
|
14992
15757
|
|
|
14993
15758
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/tokens/read-tokens-from-path.js
|
|
14994
15759
|
init_shared();
|
|
14995
|
-
import { readFile as
|
|
15760
|
+
import { readFile as readFile15, stat as stat3 } from "node:fs/promises";
|
|
14996
15761
|
|
|
14997
15762
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/tokens/collect-json-files.js
|
|
14998
15763
|
import { readdir, stat as stat2 } from "node:fs/promises";
|
|
@@ -15051,7 +15816,7 @@ async function readMergedFromDir(flag, dir) {
|
|
|
15051
15816
|
const merged = {};
|
|
15052
15817
|
for (const file of files.sort()) {
|
|
15053
15818
|
try {
|
|
15054
|
-
const text = await
|
|
15819
|
+
const text = await readFile15(file, "utf8");
|
|
15055
15820
|
const parsed = JSON.parse(text);
|
|
15056
15821
|
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
15057
15822
|
Object.assign(merged, parsed);
|
|
@@ -15065,7 +15830,7 @@ async function readMergedFromDir(flag, dir) {
|
|
|
15065
15830
|
async function readSingleFile(flag, p) {
|
|
15066
15831
|
let text;
|
|
15067
15832
|
try {
|
|
15068
|
-
text = await
|
|
15833
|
+
text = await readFile15(p, "utf8");
|
|
15069
15834
|
} catch {
|
|
15070
15835
|
throw new Error(`file not found: ${p} (from ${flag})`);
|
|
15071
15836
|
}
|
|
@@ -15156,12 +15921,12 @@ async function fetchAndPersistExistingContentfulEntities(request) {
|
|
|
15156
15921
|
}
|
|
15157
15922
|
|
|
15158
15923
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/generation/src/controller/existing-entities/read-from-session.js
|
|
15159
|
-
import { readFile as
|
|
15924
|
+
import { readFile as readFile16 } from "node:fs/promises";
|
|
15160
15925
|
async function readExistingContentfulEntitiesFromSession(request) {
|
|
15161
15926
|
if (!request.path)
|
|
15162
15927
|
return void 0;
|
|
15163
15928
|
try {
|
|
15164
|
-
const raw = await
|
|
15929
|
+
const raw = await readFile16(request.path, "utf8");
|
|
15165
15930
|
const parsed = JSON.parse(raw);
|
|
15166
15931
|
if (!Array.isArray(parsed.components) || !Array.isArray(parsed.tokens))
|
|
15167
15932
|
return void 0;
|
|
@@ -15501,7 +16266,7 @@ init_describe_agent_failure();
|
|
|
15501
16266
|
init_resolve_binary();
|
|
15502
16267
|
init_resolve_skill_path();
|
|
15503
16268
|
init_parse_map_token_prop_tool_calls();
|
|
15504
|
-
import { resolve as
|
|
16269
|
+
import { resolve as resolve19 } from "node:path";
|
|
15505
16270
|
init_cache_keys();
|
|
15506
16271
|
|
|
15507
16272
|
// packages/experience-design-system-backend-pipeline/dist/src/agents/helpers/resolution/binary-exists.js
|
|
@@ -15556,6 +16321,7 @@ function analyticsEnabled() {
|
|
|
15556
16321
|
import { Analytics } from "@segment/analytics-node";
|
|
15557
16322
|
var DEFAULT_WRITE_KEY = "6DmxiEPN3SV1vbRTTMcNqDzCvkfwT06N";
|
|
15558
16323
|
var analyticsClient = null;
|
|
16324
|
+
var flushChain = Promise.resolve();
|
|
15559
16325
|
function resolveWriteKey() {
|
|
15560
16326
|
const key = (process.env["SEGMENT_WRITE_KEY"] ?? "").trim();
|
|
15561
16327
|
return key.length > 0 ? key : DEFAULT_WRITE_KEY;
|
|
@@ -15590,14 +16356,17 @@ async function trackEvent(event, properties, anonymousId, options) {
|
|
|
15590
16356
|
}
|
|
15591
16357
|
}
|
|
15592
16358
|
async function flushAnalytics() {
|
|
15593
|
-
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15597
|
-
} catch {
|
|
15598
|
-
} finally {
|
|
16359
|
+
flushChain = flushChain.then(async () => {
|
|
16360
|
+
const client2 = analyticsClient;
|
|
16361
|
+
if (!client2)
|
|
16362
|
+
return;
|
|
15599
16363
|
analyticsClient = null;
|
|
15600
|
-
|
|
16364
|
+
try {
|
|
16365
|
+
await client2.closeAndFlush();
|
|
16366
|
+
} catch {
|
|
16367
|
+
}
|
|
16368
|
+
});
|
|
16369
|
+
return flushChain;
|
|
15601
16370
|
}
|
|
15602
16371
|
|
|
15603
16372
|
// packages/experience-design-system-backend-pipeline/dist/src/analytics/constants.js
|
|
@@ -15806,7 +16575,7 @@ async function runMapTokens(request) {
|
|
|
15806
16575
|
outDir: process.cwd(),
|
|
15807
16576
|
existingTokensInline: request.existingEntitiesInline,
|
|
15808
16577
|
...request.skillContentOverride !== void 0 ? { skillContentOverride: request.skillContentOverride } : {},
|
|
15809
|
-
...request.skillContentOverride === void 0 && request.skillPathOverride ? { skillPathOverride:
|
|
16578
|
+
...request.skillContentOverride === void 0 && request.skillPathOverride ? { skillPathOverride: resolve19(request.skillPathOverride) } : {}
|
|
15810
16579
|
});
|
|
15811
16580
|
if (request.printPrompt) {
|
|
15812
16581
|
const prompt2 = await buildMapPrompt();
|
|
@@ -15922,7 +16691,7 @@ function hasNoAuthoringSurface(component) {
|
|
|
15922
16691
|
}
|
|
15923
16692
|
|
|
15924
16693
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/helpers/evidence/source-inspection.js
|
|
15925
|
-
import { readFile as
|
|
16694
|
+
import { readFile as readFile17 } from "node:fs/promises";
|
|
15926
16695
|
|
|
15927
16696
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/extraction/src/constants/review-reasons.js
|
|
15928
16697
|
var HIGH_CONFIDENCE_DATA_FETCH_WRAPPER_REASON = "data-fetch-wrapper";
|
|
@@ -15994,7 +16763,14 @@ function hasSiblingForwardRender(sourceText, siblingImports) {
|
|
|
15994
16763
|
});
|
|
15995
16764
|
}
|
|
15996
16765
|
function hasVisibleUiRender(sourceText) {
|
|
15997
|
-
|
|
16766
|
+
if (/return\s*(?:\(|<)/.test(sourceText) && VISIBLE_UI_TAG_PATTERN.test(sourceText))
|
|
16767
|
+
return true;
|
|
16768
|
+
if (/template\s*:\s*[`'"][\s\S]*?[`'"]/.test(sourceText)) {
|
|
16769
|
+
const inlineMatch = sourceText.match(/template\s*:\s*[`'"]([\s\S]*?)[`'"]/);
|
|
16770
|
+
if (inlineMatch && VISIBLE_UI_TAG_PATTERN.test(inlineMatch[1]))
|
|
16771
|
+
return true;
|
|
16772
|
+
}
|
|
16773
|
+
return /templateUrl\s*:\s*['"]/.test(sourceText);
|
|
15998
16774
|
}
|
|
15999
16775
|
function infraPropNames(component) {
|
|
16000
16776
|
const props = component.props.map((prop) => prop.name);
|
|
@@ -16017,7 +16793,7 @@ function dedupeReasons(reasons) {
|
|
|
16017
16793
|
async function inspectComponentSource(component) {
|
|
16018
16794
|
let sourceText = "";
|
|
16019
16795
|
try {
|
|
16020
|
-
sourceText = await
|
|
16796
|
+
sourceText = await readFile17(component.source, "utf8");
|
|
16021
16797
|
} catch {
|
|
16022
16798
|
return {
|
|
16023
16799
|
wrapperConfidence: 0,
|
|
@@ -16424,7 +17200,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
16424
17200
|
const message = error instanceof Error ? error.message : String(error);
|
|
16425
17201
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
16426
17202
|
throw error;
|
|
16427
|
-
await new Promise((
|
|
17203
|
+
await new Promise((resolve29) => setTimeout(resolve29, Math.min(250 * attempt, 2e3)));
|
|
16428
17204
|
}
|
|
16429
17205
|
}
|
|
16430
17206
|
}
|
|
@@ -16456,7 +17232,7 @@ function resolveCompositionAgentName(flagValue) {
|
|
|
16456
17232
|
}
|
|
16457
17233
|
|
|
16458
17234
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-extract-and-compose-session/helpers/read-candidate-files.js
|
|
16459
|
-
import { readFile as
|
|
17235
|
+
import { readFile as readFile18 } from "node:fs/promises";
|
|
16460
17236
|
async function readCandidateFiles(components, extraFiles = []) {
|
|
16461
17237
|
const paths = new Set(extraFiles);
|
|
16462
17238
|
for (const c2 of components) {
|
|
@@ -16466,7 +17242,7 @@ async function readCandidateFiles(components, extraFiles = []) {
|
|
|
16466
17242
|
const out = [];
|
|
16467
17243
|
await Promise.all([...paths].map(async (p) => {
|
|
16468
17244
|
try {
|
|
16469
|
-
const content = await
|
|
17245
|
+
const content = await readFile18(p, "utf8");
|
|
16470
17246
|
out.push({ path: p, content });
|
|
16471
17247
|
} catch {
|
|
16472
17248
|
}
|
|
@@ -16637,7 +17413,7 @@ init_build_prompt();
|
|
|
16637
17413
|
init_create_local_cli_agent_invoker();
|
|
16638
17414
|
init_invoke_agent_with_output();
|
|
16639
17415
|
init_parse_token_tool_calls();
|
|
16640
|
-
import { readFile as
|
|
17416
|
+
import { readFile as readFile19 } from "node:fs/promises";
|
|
16641
17417
|
import { basename as basename5, resolve as pathResolve } from "node:path";
|
|
16642
17418
|
init_cache_keys();
|
|
16643
17419
|
init_parse_prompt_overrides();
|
|
@@ -16670,7 +17446,7 @@ async function runGenerateTokensSession(request) {
|
|
|
16670
17446
|
throw new Error(`Prompt override error(s): ${promptErrors.join("; ")}`);
|
|
16671
17447
|
const tokensOverride = overridesMap.get("tokens");
|
|
16672
17448
|
const skillContentOverride = tokensOverride ? await resolvePromptOverride(tokensOverride) : void 0;
|
|
16673
|
-
const rawTokensInline = await
|
|
17449
|
+
const rawTokensInline = await readFile19(pathResolve(rawTokensPath), "utf8");
|
|
16674
17450
|
const tokenInputHash = hashTokenContent(rawTokensInline);
|
|
16675
17451
|
const db = openPipelineDb();
|
|
16676
17452
|
try {
|
|
@@ -16787,7 +17563,7 @@ async function readExistingEntities(request) {
|
|
|
16787
17563
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/resolve-generate-prompt.js
|
|
16788
17564
|
init_parse_prompt_overrides();
|
|
16789
17565
|
init_resolve_prompt_override();
|
|
16790
|
-
import { resolve as
|
|
17566
|
+
import { resolve as resolve20 } from "node:path";
|
|
16791
17567
|
async function resolveGeneratePrompt(overrides) {
|
|
16792
17568
|
const { overrides: parsed, errors } = parsePromptOverrides(overrides);
|
|
16793
17569
|
if (errors.length > 0)
|
|
@@ -16798,7 +17574,7 @@ async function resolveGeneratePrompt(overrides) {
|
|
|
16798
17574
|
const text = await resolvePromptOverride(entry);
|
|
16799
17575
|
if (entry.kind === "text")
|
|
16800
17576
|
return { text };
|
|
16801
|
-
return { path:
|
|
17577
|
+
return { path: resolve20(entry.value), text };
|
|
16802
17578
|
}
|
|
16803
17579
|
|
|
16804
17580
|
// packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/run-one-generate-component.js
|
|
@@ -17210,7 +17986,7 @@ function PathValidationScreen({
|
|
|
17210
17986
|
|
|
17211
17987
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
17212
17988
|
import { useRef as useRef2, useState as useState9 } from "react";
|
|
17213
|
-
import { Text as Text14 } from "ink";
|
|
17989
|
+
import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
|
|
17214
17990
|
|
|
17215
17991
|
// packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
|
|
17216
17992
|
import { useState as useState8 } from "react";
|
|
@@ -17239,6 +18015,9 @@ function FieldForm({
|
|
|
17239
18015
|
onChange,
|
|
17240
18016
|
onSave,
|
|
17241
18017
|
saveLabel = "save",
|
|
18018
|
+
enterAdvances = false,
|
|
18019
|
+
onSkip,
|
|
18020
|
+
skipLabel: skipLabel2 = "skip",
|
|
17242
18021
|
onQuit,
|
|
17243
18022
|
quitLabel = "back without saving",
|
|
17244
18023
|
actions = [],
|
|
@@ -17270,6 +18049,10 @@ function FieldForm({
|
|
|
17270
18049
|
onSave();
|
|
17271
18050
|
return;
|
|
17272
18051
|
}
|
|
18052
|
+
if (input === "k" && onSkip) {
|
|
18053
|
+
onSkip();
|
|
18054
|
+
return;
|
|
18055
|
+
}
|
|
17273
18056
|
if (isClearKey(input, key) && currentField) {
|
|
17274
18057
|
onChange(currentField.key, "");
|
|
17275
18058
|
return;
|
|
@@ -17291,6 +18074,21 @@ function FieldForm({
|
|
|
17291
18074
|
}
|
|
17292
18075
|
}
|
|
17293
18076
|
});
|
|
18077
|
+
const isLastField = active === fields2.length - 1;
|
|
18078
|
+
const submitField = () => {
|
|
18079
|
+
if (!enterAdvances) {
|
|
18080
|
+
setEditing(false);
|
|
18081
|
+
return;
|
|
18082
|
+
}
|
|
18083
|
+
if (isLastField) {
|
|
18084
|
+
setEditing(false);
|
|
18085
|
+
onSave();
|
|
18086
|
+
return;
|
|
18087
|
+
}
|
|
18088
|
+
const next = fields2[active + 1];
|
|
18089
|
+
setValueBeforeEdit(values[next.key]);
|
|
18090
|
+
setActive(active + 1);
|
|
18091
|
+
};
|
|
17294
18092
|
const pointer = (isActive) => /* @__PURE__ */ jsx14(Text13, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " });
|
|
17295
18093
|
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
17296
18094
|
header,
|
|
@@ -17312,7 +18110,7 @@ function FieldForm({
|
|
|
17312
18110
|
{
|
|
17313
18111
|
value,
|
|
17314
18112
|
onChange: (next) => onChange(field.key, next),
|
|
17315
|
-
onSubmit:
|
|
18113
|
+
onSubmit: submitField,
|
|
17316
18114
|
mask: field.masked ? "\u2022" : void 0
|
|
17317
18115
|
}
|
|
17318
18116
|
) : display ? /* @__PURE__ */ jsx14(Text13, { bold: true, children: display }) : (
|
|
@@ -17348,7 +18146,7 @@ function FieldForm({
|
|
|
17348
18146
|
hints: editing ? [
|
|
17349
18147
|
{ keys: "type", label: "edit" },
|
|
17350
18148
|
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
17351
|
-
{ keys: "\u23CE", label: "done" },
|
|
18149
|
+
{ keys: "\u23CE", label: enterAdvances ? isLastField ? saveLabel : "next" : "done" },
|
|
17352
18150
|
{ keys: "Ctrl+D", label: "clear" },
|
|
17353
18151
|
{ keys: "Esc", label: "cancel edit" }
|
|
17354
18152
|
] : [
|
|
@@ -17356,6 +18154,7 @@ function FieldForm({
|
|
|
17356
18154
|
{ keys: "\u23CE", label: currentAction ? currentAction.hint : "edit" },
|
|
17357
18155
|
...currentField ? [{ keys: "Ctrl+D", label: "clear" }] : [],
|
|
17358
18156
|
{ keys: "s", label: saveLabel },
|
|
18157
|
+
...onSkip ? [{ keys: "k", label: skipLabel2 }] : [],
|
|
17359
18158
|
{ keys: "Esc/q", label: quitLabel }
|
|
17360
18159
|
]
|
|
17361
18160
|
}
|
|
@@ -17427,6 +18226,75 @@ var FIELDS2 = [
|
|
|
17427
18226
|
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
17428
18227
|
{ key: "host", label: "API Host", hint: "(default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com)" }
|
|
17429
18228
|
];
|
|
18229
|
+
var MENU = [
|
|
18230
|
+
{ choice: "continue", label: "Continue", description: "Check the credentials and go on" },
|
|
18231
|
+
{ choice: "edit", label: "Edit", description: "Change the credentials" },
|
|
18232
|
+
{ choice: "skip", label: "Skip", description: "Save files only, nothing is pushed" },
|
|
18233
|
+
{ choice: "quit", label: "Quit", description: "Go back" }
|
|
18234
|
+
];
|
|
18235
|
+
function CredentialsReview({
|
|
18236
|
+
values,
|
|
18237
|
+
subtitle,
|
|
18238
|
+
notice,
|
|
18239
|
+
validating,
|
|
18240
|
+
onChoose,
|
|
18241
|
+
children
|
|
18242
|
+
}) {
|
|
18243
|
+
const [focus, setFocus] = useState9(0);
|
|
18244
|
+
useInput11((_input, key) => {
|
|
18245
|
+
if (validating) return;
|
|
18246
|
+
if (key.escape) onChoose("quit");
|
|
18247
|
+
else if (key.return) onChoose(MENU[focus].choice);
|
|
18248
|
+
else if (key.upArrow) setFocus((current) => (current - 1 + MENU.length) % MENU.length);
|
|
18249
|
+
else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % MENU.length);
|
|
18250
|
+
});
|
|
18251
|
+
const labelWidth = formLabelWidth([...FIELDS2, ...MENU]);
|
|
18252
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
18253
|
+
/* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
18254
|
+
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
18255
|
+
/* @__PURE__ */ jsx15(Text14, { bold: true, children: "Contentful Credentials" }),
|
|
18256
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18257
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: subtitle }),
|
|
18258
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18259
|
+
MENU.map((item, index) => {
|
|
18260
|
+
const focused = index === focus;
|
|
18261
|
+
return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
|
|
18262
|
+
/* @__PURE__ */ jsx15(Text14, { color: focused ? PALETTE.accent : void 0, children: focused ? "\u276F" : " " }),
|
|
18263
|
+
/* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: focused, color: focused ? PALETTE.accent : PALETTE.muted, children: item.label }) }),
|
|
18264
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: item.description })
|
|
18265
|
+
] }, item.choice);
|
|
18266
|
+
}),
|
|
18267
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18268
|
+
FIELDS2.map((field) => {
|
|
18269
|
+
const value = values[field.key];
|
|
18270
|
+
return /* @__PURE__ */ jsx15(FormReadOnlyRow, { label: field.label, labelWidth, children: /* @__PURE__ */ jsx15(Text14, { bold: value !== "", children: field.masked ? "\u2022".repeat(value.length) : value || "(empty)" }) }, field.key);
|
|
18271
|
+
}),
|
|
18272
|
+
notice && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
18273
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18274
|
+
/* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
|
|
18275
|
+
"\u2717 ",
|
|
18276
|
+
notice.text
|
|
18277
|
+
] })
|
|
18278
|
+
] }),
|
|
18279
|
+
validating && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
18280
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18281
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
18282
|
+
] }),
|
|
18283
|
+
children,
|
|
18284
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18285
|
+
/* @__PURE__ */ jsx15(
|
|
18286
|
+
ControlHints,
|
|
18287
|
+
{
|
|
18288
|
+
hints: [
|
|
18289
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
18290
|
+
{ keys: "\u23CE", label: MENU[focus].label.toLowerCase() },
|
|
18291
|
+
{ keys: "Esc", label: "back" }
|
|
18292
|
+
]
|
|
18293
|
+
}
|
|
18294
|
+
)
|
|
18295
|
+
] })
|
|
18296
|
+
] });
|
|
18297
|
+
}
|
|
17430
18298
|
function CredentialsScreen({
|
|
17431
18299
|
onDone,
|
|
17432
18300
|
onBack,
|
|
@@ -17446,6 +18314,7 @@ function CredentialsScreen({
|
|
|
17446
18314
|
const [notice, setNotice] = useState9(null);
|
|
17447
18315
|
const [validating, setValidating] = useState9(false);
|
|
17448
18316
|
const prefilled = initialValues.spaceId !== "" && initialValues.cmaToken !== "";
|
|
18317
|
+
const [editing, setEditing] = useState9(!prefilled);
|
|
17449
18318
|
const submit = async () => {
|
|
17450
18319
|
const credentials = normalize(values);
|
|
17451
18320
|
if (missingField(credentials)) {
|
|
@@ -17458,38 +18327,38 @@ function CredentialsScreen({
|
|
|
17458
18327
|
if (result.ok) onDone({ skipped: false, credentials });
|
|
17459
18328
|
else setNotice({ kind: "error", text: result.error });
|
|
17460
18329
|
};
|
|
18330
|
+
const subtitle = prefilled ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into.";
|
|
18331
|
+
const choose = (choice) => {
|
|
18332
|
+
if (choice === "continue") void submit();
|
|
18333
|
+
else if (choice === "edit") {
|
|
18334
|
+
setNotice(null);
|
|
18335
|
+
setEditing(true);
|
|
18336
|
+
} else if (choice === "skip") onDone({ skipped: true });
|
|
18337
|
+
else onBack();
|
|
18338
|
+
};
|
|
18339
|
+
if (!editing) {
|
|
18340
|
+
return /* @__PURE__ */ jsx15(CredentialsReview, { values, subtitle, notice, validating, onChoose: choose, children: !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
18341
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18342
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
18343
|
+
] }) });
|
|
18344
|
+
}
|
|
17461
18345
|
return /* @__PURE__ */ jsxs14(
|
|
17462
18346
|
FieldForm,
|
|
17463
18347
|
{
|
|
17464
18348
|
header: /* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
17465
18349
|
title: "Contentful Credentials",
|
|
17466
|
-
subtitle
|
|
18350
|
+
subtitle,
|
|
17467
18351
|
fields: FIELDS2,
|
|
17468
18352
|
values,
|
|
17469
18353
|
onChange: (key, value) => {
|
|
17470
18354
|
setValues((current) => ({ ...current, [key]: value }));
|
|
17471
18355
|
setNotice(null);
|
|
17472
18356
|
},
|
|
17473
|
-
|
|
17474
|
-
{
|
|
17475
|
-
label: "Continue",
|
|
17476
|
-
description: "Check the credentials and go on",
|
|
17477
|
-
runningText: "Validating credentials...",
|
|
17478
|
-
running: validating,
|
|
17479
|
-
hint: "continue",
|
|
17480
|
-
onRun: () => void submit()
|
|
17481
|
-
},
|
|
17482
|
-
{
|
|
17483
|
-
label: "Skip",
|
|
17484
|
-
description: "Save files only, nothing is pushed",
|
|
17485
|
-
hint: "skip",
|
|
17486
|
-
onRun: () => onDone({ skipped: true })
|
|
17487
|
-
}
|
|
17488
|
-
],
|
|
18357
|
+
enterAdvances: true,
|
|
17489
18358
|
onSave: () => void submit(),
|
|
17490
18359
|
saveLabel: "continue",
|
|
17491
|
-
onQuit: onBack,
|
|
17492
|
-
quitLabel: "back",
|
|
18360
|
+
onQuit: prefilled ? () => setEditing(false) : onBack,
|
|
18361
|
+
quitLabel: prefilled ? "stop editing" : "back",
|
|
17493
18362
|
notice,
|
|
17494
18363
|
busy: validating,
|
|
17495
18364
|
children: [
|
|
@@ -17498,6 +18367,10 @@ function CredentialsScreen({
|
|
|
17498
18367
|
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: credentialsPurpose(tokensOnly) }),
|
|
17499
18368
|
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: "Tip: save these under Settings \u2192 Configuration so they pre-fill here." })
|
|
17500
18369
|
] }),
|
|
18370
|
+
validating && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
18371
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18372
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
18373
|
+
] }),
|
|
17501
18374
|
!validating && !notice && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
17502
18375
|
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
17503
18376
|
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
@@ -17609,19 +18482,19 @@ import { useEffect as useEffect5, useRef as useRef3, useState as useState10 } fr
|
|
|
17609
18482
|
|
|
17610
18483
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run.ts
|
|
17611
18484
|
import { mkdir as mkdir7 } from "node:fs/promises";
|
|
17612
|
-
import { join as join18, resolve as
|
|
18485
|
+
import { join as join18, resolve as resolve23 } from "node:path";
|
|
17613
18486
|
|
|
17614
18487
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/find-skill-path.ts
|
|
17615
18488
|
import { existsSync as existsSync8 } from "node:fs";
|
|
17616
|
-
import { dirname as
|
|
18489
|
+
import { dirname as dirname15, join as join17, resolve as resolve21 } from "node:path";
|
|
17617
18490
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
17618
18491
|
function findSkillPath(fileName) {
|
|
17619
|
-
const thisDir =
|
|
18492
|
+
const thisDir = dirname15(fileURLToPath4(import.meta.url));
|
|
17620
18493
|
let dir = thisDir;
|
|
17621
18494
|
for (; ; ) {
|
|
17622
18495
|
const candidate = join17(dir, "skills", fileName);
|
|
17623
18496
|
if (existsSync8(candidate)) return candidate;
|
|
17624
|
-
const parent =
|
|
18497
|
+
const parent = resolve21(dir, "..");
|
|
17625
18498
|
if (parent === dir) {
|
|
17626
18499
|
throw new Error(`skill file not found (looked for skills/${fileName} from ${thisDir})`);
|
|
17627
18500
|
}
|
|
@@ -17630,11 +18503,11 @@ function findSkillPath(fileName) {
|
|
|
17630
18503
|
}
|
|
17631
18504
|
|
|
17632
18505
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/selection.ts
|
|
17633
|
-
import { resolve as
|
|
18506
|
+
import { resolve as resolve22 } from "node:path";
|
|
17634
18507
|
var SELECT_SKILL_PATH = findSkillPath("select-components.md");
|
|
17635
18508
|
var DEFAULT_TIMEOUT_MS5 = Number(process.env.EDS_AGENT_TIMEOUT_MS ?? 5 * 60 * 1e3);
|
|
17636
18509
|
async function hashSelectPrompt(options) {
|
|
17637
|
-
const promptHash = options.promptText ? hashContent(options.promptText) : options.promptPath ? await hashFile(
|
|
18510
|
+
const promptHash = options.promptText ? hashContent(options.promptText) : options.promptPath ? await hashFile(resolve22(options.promptPath)) : await hashFile(SELECT_SKILL_PATH);
|
|
17638
18511
|
return hashContent(`${promptHash}|${options.agent}|${options.model ?? ""}`);
|
|
17639
18512
|
}
|
|
17640
18513
|
async function runSelection(options) {
|
|
@@ -17729,7 +18602,7 @@ var realDeps = {
|
|
|
17729
18602
|
var fail = (step, message) => ({ ok: false, step, message });
|
|
17730
18603
|
var errorMessage2 = (error) => error instanceof Error ? error.message : String(error);
|
|
17731
18604
|
async function runExtraction(input, onProgress, deps = realDeps) {
|
|
17732
|
-
const outDir = input.outDir ?? join18(
|
|
18605
|
+
const outDir = input.outDir ?? join18(resolve23(input.projectPath), ".contentful");
|
|
17733
18606
|
let progress = initialProgress({
|
|
17734
18607
|
hasCredentials: input.credentials !== null,
|
|
17735
18608
|
hasRawTokens: input.rawTokensPath !== ""
|
|
@@ -17853,7 +18726,7 @@ async function resolveSelectionPrompt(overrides) {
|
|
|
17853
18726
|
if (select?.kind === "text") return { promptText: select.value };
|
|
17854
18727
|
if (select?.kind === "path") {
|
|
17855
18728
|
await resolvePromptOverride(select);
|
|
17856
|
-
return { promptPath:
|
|
18729
|
+
return { promptPath: resolve23(select.value) };
|
|
17857
18730
|
}
|
|
17858
18731
|
return {};
|
|
17859
18732
|
}
|
|
@@ -17941,11 +18814,11 @@ function useTokensOnly(input) {
|
|
|
17941
18814
|
}
|
|
17942
18815
|
|
|
17943
18816
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/screen.tsx
|
|
17944
|
-
import { Box as
|
|
18817
|
+
import { Box as Box24, Text as Text25 } from "ink";
|
|
17945
18818
|
|
|
17946
18819
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx
|
|
17947
18820
|
import React10 from "react";
|
|
17948
|
-
import { Box as
|
|
18821
|
+
import { Box as Box16, Text as Text16 } from "ink";
|
|
17949
18822
|
import figures2 from "figures";
|
|
17950
18823
|
|
|
17951
18824
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts
|
|
@@ -18052,7 +18925,7 @@ function computeColumnWindow(total, cursor, visibleCount) {
|
|
|
18052
18925
|
}
|
|
18053
18926
|
|
|
18054
18927
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx
|
|
18055
|
-
import { Box as
|
|
18928
|
+
import { Box as Box15, Text as Text15 } from "ink";
|
|
18056
18929
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
18057
18930
|
var MIN_TERMINAL_PANEL_HEIGHT = 5;
|
|
18058
18931
|
function terminalPanelHeight(rows, reservedRows = 4) {
|
|
@@ -18070,7 +18943,7 @@ function FixedPanel({
|
|
|
18070
18943
|
children
|
|
18071
18944
|
}) {
|
|
18072
18945
|
return /* @__PURE__ */ jsx17(
|
|
18073
|
-
|
|
18946
|
+
Box15,
|
|
18074
18947
|
{
|
|
18075
18948
|
flexDirection: "column",
|
|
18076
18949
|
width,
|
|
@@ -18106,7 +18979,7 @@ function WindowedPanelHeader({
|
|
|
18106
18979
|
width,
|
|
18107
18980
|
focused
|
|
18108
18981
|
}) {
|
|
18109
|
-
return /* @__PURE__ */ jsxs15(
|
|
18982
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", children: [
|
|
18110
18983
|
/* @__PURE__ */ jsx17(Text15, { bold: true, color: PALETTE.accent, inverse: focused, children: title }),
|
|
18111
18984
|
/* @__PURE__ */ jsx17(Text15, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) })
|
|
18112
18985
|
] });
|
|
@@ -18141,7 +19014,7 @@ function AddedColumn(props) {
|
|
|
18141
19014
|
const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
|
|
18142
19015
|
return /* @__PURE__ */ jsxs16(React10.Fragment, { children: [
|
|
18143
19016
|
showSeparator && /* @__PURE__ */ jsx18(Text16, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
18144
|
-
/* @__PURE__ */ jsxs16(
|
|
19017
|
+
/* @__PURE__ */ jsxs16(Box16, { children: [
|
|
18145
19018
|
isCursor ? /* @__PURE__ */ jsx18(Text16, { color: PALETTE.accent, bold: true, children: figures2.pointer }) : /* @__PURE__ */ jsx18(Text16, { children: " " }),
|
|
18146
19019
|
reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx18(Text16, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx18(Text16, { children: " " })),
|
|
18147
19020
|
entry.isCycle && /* @__PURE__ */ jsx18(Text16, { color: isCursor ? PALETTE.accent : PALETTE.warning, bold: true, underline: style.nameUnderline, children: " \u26A0" }),
|
|
@@ -18164,7 +19037,7 @@ function AddedColumn(props) {
|
|
|
18164
19037
|
}
|
|
18165
19038
|
|
|
18166
19039
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx
|
|
18167
|
-
import { Box as
|
|
19040
|
+
import { Box as Box17, Text as Text17 } from "ink";
|
|
18168
19041
|
import figures3 from "figures";
|
|
18169
19042
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
18170
19043
|
function cycleLabel(cycle, index) {
|
|
@@ -18177,7 +19050,7 @@ function cycleLabel(cycle, index) {
|
|
|
18177
19050
|
return `Cycle ${index + 1}: ${parts.join(" \u2192 ")}`;
|
|
18178
19051
|
}
|
|
18179
19052
|
function CyclesPanel({ cycles, cursor }) {
|
|
18180
|
-
return /* @__PURE__ */ jsxs17(
|
|
19053
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
18181
19054
|
/* @__PURE__ */ jsx19(Text17, { bold: true, color: PALETTE.warning, children: `Cycles detected (${cycles.length}):` }),
|
|
18182
19055
|
/* @__PURE__ */ jsx19(Text17, { children: " " }),
|
|
18183
19056
|
cycles.map((cycle, i) => {
|
|
@@ -18192,10 +19065,10 @@ function CyclesPanel({ cycles, cursor }) {
|
|
|
18192
19065
|
}
|
|
18193
19066
|
|
|
18194
19067
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx
|
|
18195
|
-
import { Box as
|
|
19068
|
+
import { Box as Box18, Text as Text18 } from "ink";
|
|
18196
19069
|
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
18197
19070
|
function RejectPrompt({ pending }) {
|
|
18198
|
-
return /* @__PURE__ */ jsxs18(
|
|
19071
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
18199
19072
|
/* @__PURE__ */ jsx20(Text18, { bold: true, color: PALETTE.warning, children: `Rejecting ${pending.target} will:` }),
|
|
18200
19073
|
pending.ancestors.length > 0 && /* @__PURE__ */ jsx20(Text18, { children: `- Reject ancestors: ${pending.ancestors.join(", ")}` }),
|
|
18201
19074
|
pending.descendants.length > 0 && /* @__PURE__ */ jsx20(Text18, { children: `- Deselect descendants: ${pending.descendants.join(", ")}` }),
|
|
@@ -18223,7 +19096,7 @@ function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
|
18223
19096
|
}
|
|
18224
19097
|
|
|
18225
19098
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx
|
|
18226
|
-
import { Box as
|
|
19099
|
+
import { Box as Box19, Text as Text19 } from "ink";
|
|
18227
19100
|
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
18228
19101
|
function CounterStrip(props) {
|
|
18229
19102
|
const { counters, totalWidth } = props;
|
|
@@ -18232,7 +19105,7 @@ function CounterStrip(props) {
|
|
|
18232
19105
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
18233
19106
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
18234
19107
|
const sep = condensed ? " | " : " ";
|
|
18235
|
-
return /* @__PURE__ */ jsx22(
|
|
19108
|
+
return /* @__PURE__ */ jsx22(Box19, { children: /* @__PURE__ */ jsxs19(Text19, { children: [
|
|
18236
19109
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
18237
19110
|
labelGrp,
|
|
18238
19111
|
" "
|
|
@@ -18256,7 +19129,7 @@ function CounterStrip(props) {
|
|
|
18256
19129
|
|
|
18257
19130
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx
|
|
18258
19131
|
import figures4 from "figures";
|
|
18259
|
-
import { Box as
|
|
19132
|
+
import { Box as Box20, Text as Text20 } from "ink";
|
|
18260
19133
|
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
18261
19134
|
var DEFAULT_MAX_ROWS = 15;
|
|
18262
19135
|
function windowStart(rowCount, highlightIndex, maxRows) {
|
|
@@ -18290,7 +19163,7 @@ function GotoBanner({
|
|
|
18290
19163
|
const moreAbove = start;
|
|
18291
19164
|
const moreBelow = rows.length - end;
|
|
18292
19165
|
return /* @__PURE__ */ jsxs20(
|
|
18293
|
-
|
|
19166
|
+
Box20,
|
|
18294
19167
|
{
|
|
18295
19168
|
flexDirection: "column",
|
|
18296
19169
|
borderStyle: "single",
|
|
@@ -18315,7 +19188,7 @@ function GotoBanner({
|
|
|
18315
19188
|
|
|
18316
19189
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.tsx
|
|
18317
19190
|
import figures5 from "figures";
|
|
18318
|
-
import { Box as
|
|
19191
|
+
import { Box as Box21, Text as Text22 } from "ink";
|
|
18319
19192
|
|
|
18320
19193
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/graph/cycle-detection.ts
|
|
18321
19194
|
function buildGraph(components) {
|
|
@@ -19135,7 +20008,7 @@ function GroupedSidebar(props) {
|
|
|
19135
20008
|
isOwn: rs?.isOwn ?? false,
|
|
19136
20009
|
isCursor
|
|
19137
20010
|
});
|
|
19138
|
-
return /* @__PURE__ */ jsxs21(
|
|
20011
|
+
return /* @__PURE__ */ jsxs21(Box21, { children: [
|
|
19139
20012
|
isCursor ? /* @__PURE__ */ jsx25(Text22, { color: PALETTE.accent, bold: true, children: figures5.pointer }) : /* @__PURE__ */ jsx25(Text22, { children: " " }),
|
|
19140
20013
|
/* @__PURE__ */ jsx25(PreviewBadge, { badge, highlighted: isSelected }),
|
|
19141
20014
|
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */ jsx25(Text22, { color: !isSelected && selDim ? PALETTE.muted : selColor, bold: selBold, children: " " + selGlyph }) : /* @__PURE__ */ jsx25(Text22, { children: " " })),
|
|
@@ -19163,7 +20036,7 @@ function GroupedSidebar(props) {
|
|
|
19163
20036
|
|
|
19164
20037
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.tsx
|
|
19165
20038
|
import React11 from "react";
|
|
19166
|
-
import { Box as
|
|
20039
|
+
import { Box as Box22, Text as Text23 } from "ink";
|
|
19167
20040
|
|
|
19168
20041
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.ts
|
|
19169
20042
|
import { useLayoutEffect, useRef as useRef5 } from "react";
|
|
@@ -19274,7 +20147,7 @@ function HelpOverlay(props) {
|
|
|
19274
20147
|
}, props.handleInput !== false);
|
|
19275
20148
|
if (props.sections) {
|
|
19276
20149
|
return /* @__PURE__ */ jsxs22(
|
|
19277
|
-
|
|
20150
|
+
Box22,
|
|
19278
20151
|
{
|
|
19279
20152
|
flexDirection: "column",
|
|
19280
20153
|
borderStyle: "round",
|
|
@@ -19295,7 +20168,7 @@ function HelpOverlay(props) {
|
|
|
19295
20168
|
}
|
|
19296
20169
|
const mode = props.mode;
|
|
19297
20170
|
return /* @__PURE__ */ jsxs22(
|
|
19298
|
-
|
|
20171
|
+
Box22,
|
|
19299
20172
|
{
|
|
19300
20173
|
flexDirection: "column",
|
|
19301
20174
|
borderStyle: "round",
|
|
@@ -19335,7 +20208,7 @@ function HelpOverlay(props) {
|
|
|
19335
20208
|
}
|
|
19336
20209
|
|
|
19337
20210
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx
|
|
19338
|
-
import { Box as
|
|
20211
|
+
import { Box as Box23, Text as Text24 } from "ink";
|
|
19339
20212
|
|
|
19340
20213
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/autocomplete.ts
|
|
19341
20214
|
function longestCommonPrefix(names) {
|
|
@@ -19404,7 +20277,7 @@ function SearchMatchSummary({
|
|
|
19404
20277
|
}) {
|
|
19405
20278
|
if (hidden) return null;
|
|
19406
20279
|
return /* @__PURE__ */ jsxs23(Fragment4, { children: [
|
|
19407
|
-
open && /* @__PURE__ */ jsxs23(
|
|
20280
|
+
open && /* @__PURE__ */ jsxs23(Box23, { marginTop, flexDirection: "column", children: [
|
|
19408
20281
|
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
19409
20282
|
`/${query}`,
|
|
19410
20283
|
/* @__PURE__ */ jsx27(Text24, { color: PALETTE.accent, children: "\u258E" }),
|
|
@@ -19413,7 +20286,7 @@ function SearchMatchSummary({
|
|
|
19413
20286
|
] }),
|
|
19414
20287
|
autocompleteCandidates.length > 1 && /* @__PURE__ */ jsx27(Text24, { color: PALETTE.muted, children: ` possibilities: ${autocompleteCandidates.join(" \xB7 ").slice(0, 120)}` })
|
|
19415
20288
|
] }),
|
|
19416
|
-
!open && query && /* @__PURE__ */ jsx27(
|
|
20289
|
+
!open && query && /* @__PURE__ */ jsx27(Box23, { marginTop, children: /* @__PURE__ */ jsx27(Text24, { children: `/${query}${formatSearchMatchSummary(matches, total)} \xB7 [Esc] clear` }) })
|
|
19417
20290
|
] });
|
|
19418
20291
|
}
|
|
19419
20292
|
|
|
@@ -20591,7 +21464,7 @@ var HELP_SECTIONS = [
|
|
|
20591
21464
|
];
|
|
20592
21465
|
function ScopeGateScreen(props) {
|
|
20593
21466
|
if (props.components.length === 0) {
|
|
20594
|
-
return /* @__PURE__ */ jsx28(
|
|
21467
|
+
return /* @__PURE__ */ jsx28(Box24, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx28(Text25, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
20595
21468
|
}
|
|
20596
21469
|
return /* @__PURE__ */ jsx28(ScopeGateView, { ...props });
|
|
20597
21470
|
}
|
|
@@ -20601,18 +21474,18 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
20601
21474
|
if (gate.showHelp) {
|
|
20602
21475
|
return /* @__PURE__ */ jsx28(HelpOverlay, { sections: HELP_SECTIONS, handleInput: false, onClose: gate.closeHelp });
|
|
20603
21476
|
}
|
|
20604
|
-
return /* @__PURE__ */ jsxs24(
|
|
21477
|
+
return /* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", children: [
|
|
20605
21478
|
/* @__PURE__ */ jsx28(StepHeader, { step: "scope-gate" }),
|
|
20606
|
-
/* @__PURE__ */ jsxs24(
|
|
20607
|
-
/* @__PURE__ */ jsxs24(
|
|
21479
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", paddingX: 2, children: [
|
|
21480
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "row", flexWrap: "wrap", children: [
|
|
20608
21481
|
/* @__PURE__ */ jsx28(CounterStrip, { counters, totalWidth: gate.totalWidth }),
|
|
20609
21482
|
gate.aiExcludedCount > 0 && /* @__PURE__ */ jsxs24(Text25, { color: PALETTE.muted, children: [
|
|
20610
21483
|
`${gate.aiExcludedCount} component${gate.aiExcludedCount === 1 ? "" : "s"} flagged by AI`,
|
|
20611
21484
|
gate.aiRows.length > 0 && /* @__PURE__ */ jsx28(Text25, { color: PALETTE.accent, children: " \u2014 press [x] to see why" })
|
|
20612
21485
|
] })
|
|
20613
21486
|
] }),
|
|
20614
|
-
graph.cycles.length > 0 && /* @__PURE__ */ jsx28(
|
|
20615
|
-
/* @__PURE__ */ jsxs24(
|
|
21487
|
+
graph.cycles.length > 0 && /* @__PURE__ */ jsx28(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx28(Text25, { color: PALETTE.muted, children: "If you must have components with cycles, select them together into the generate step and then use the editor to fix them." }) }),
|
|
21488
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "row", alignItems: "stretch", children: [
|
|
20616
21489
|
gate.aiRationalePanelOpen ? /* @__PURE__ */ jsx28(
|
|
20617
21490
|
GotoBanner,
|
|
20618
21491
|
{
|
|
@@ -20652,7 +21525,7 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
20652
21525
|
}
|
|
20653
21526
|
),
|
|
20654
21527
|
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
20655
|
-
/* @__PURE__ */ jsx28(
|
|
21528
|
+
/* @__PURE__ */ jsx28(Box24, { width: 2, flexShrink: 0 }),
|
|
20656
21529
|
/* @__PURE__ */ jsx28(
|
|
20657
21530
|
AddedColumn,
|
|
20658
21531
|
{
|
|
@@ -20769,7 +21642,7 @@ var capitalize = (name) => name.charAt(0).toUpperCase() + name.slice(1);
|
|
|
20769
21642
|
function describeGeneration(input) {
|
|
20770
21643
|
const agent = capitalize(input.agent);
|
|
20771
21644
|
return `${formatAcceptanceSummary({ accepted: input.acceptedCount, autoRejected: 0 })}
|
|
20772
|
-
${agent} is
|
|
21645
|
+
${agent} is reading each selected component and writing a Contentful component definition for it${input.hasTokens ? " Using your design tokens for prop resolution." : ""}`;
|
|
20773
21646
|
}
|
|
20774
21647
|
function progressRows2(progress, agent) {
|
|
20775
21648
|
const name = capitalize(agent);
|
|
@@ -20812,7 +21685,7 @@ function GenerationScreen({
|
|
|
20812
21685
|
import { useEffect as useEffect10, useRef as useRef8, useState as useState17 } from "react";
|
|
20813
21686
|
|
|
20814
21687
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/run.ts
|
|
20815
|
-
import { resolve as
|
|
21688
|
+
import { resolve as resolve24 } from "node:path";
|
|
20816
21689
|
|
|
20817
21690
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/map-tokens.ts
|
|
20818
21691
|
async function prepareMapTokens(input, generatedSessionId) {
|
|
@@ -20947,7 +21820,7 @@ async function buildMapTokensOptions(input) {
|
|
|
20947
21820
|
if (mapOverride?.kind === "text") prompt.skillContentOverride = mapOverride.value;
|
|
20948
21821
|
if (mapOverride?.kind === "path") {
|
|
20949
21822
|
await resolvePromptOverride(mapOverride);
|
|
20950
|
-
prompt.skillPathOverride =
|
|
21823
|
+
prompt.skillPathOverride = resolve24(mapOverride.value);
|
|
20951
21824
|
}
|
|
20952
21825
|
if (input.existingEntitiesPath) {
|
|
20953
21826
|
const entities = await readExistingContentfulEntitiesFromSession({ path: input.existingEntitiesPath });
|
|
@@ -21022,7 +21895,7 @@ function buildFlowStart(input) {
|
|
|
21022
21895
|
}
|
|
21023
21896
|
|
|
21024
21897
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
21025
|
-
import { Box as
|
|
21898
|
+
import { Box as Box44 } from "ink";
|
|
21026
21899
|
|
|
21027
21900
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
21028
21901
|
import { Ajv as Ajv2 } from "ajv";
|
|
@@ -21387,7 +22260,7 @@ function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
|
21387
22260
|
}
|
|
21388
22261
|
|
|
21389
22262
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
21390
|
-
import { Box as
|
|
22263
|
+
import { Box as Box37, Text as Text39 } from "ink";
|
|
21391
22264
|
|
|
21392
22265
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/graph/cycle-view.ts
|
|
21393
22266
|
function computeCycleView(components) {
|
|
@@ -21626,12 +22499,12 @@ function enumerateCycleBreaks(cycle, components) {
|
|
|
21626
22499
|
}
|
|
21627
22500
|
|
|
21628
22501
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx
|
|
21629
|
-
import { Box as
|
|
22502
|
+
import { Box as Box31, Text as Text33 } from "ink";
|
|
21630
22503
|
|
|
21631
22504
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
21632
22505
|
import React12, { useEffect as useEffect11, useLayoutEffect as useLayoutEffect2, useState as useState18 } from "react";
|
|
21633
22506
|
import figures6 from "figures";
|
|
21634
|
-
import { Box as
|
|
22507
|
+
import { Box as Box25, measureElement, Text as Text26 } from "ink";
|
|
21635
22508
|
|
|
21636
22509
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/scroll-offset.ts
|
|
21637
22510
|
function computeNextScrollOffset(current, input, key, totalLines, panelHeight) {
|
|
@@ -21800,14 +22673,14 @@ function serializeState(state2, originalJson) {
|
|
|
21800
22673
|
return JSON.stringify(entry, null, 2);
|
|
21801
22674
|
}
|
|
21802
22675
|
function Picker({ value, active }) {
|
|
21803
|
-
return /* @__PURE__ */ jsxs25(
|
|
22676
|
+
return /* @__PURE__ */ jsxs25(Box25, { children: [
|
|
21804
22677
|
active && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u2039" }),
|
|
21805
22678
|
/* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
21806
22679
|
active && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u203A" })
|
|
21807
22680
|
] });
|
|
21808
22681
|
}
|
|
21809
22682
|
function Toggle({ value, active }) {
|
|
21810
|
-
return /* @__PURE__ */ jsx31(
|
|
22683
|
+
return /* @__PURE__ */ jsx31(Box25, { children: /* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
21811
22684
|
}
|
|
21812
22685
|
function InlinePropField({
|
|
21813
22686
|
label,
|
|
@@ -21816,7 +22689,7 @@ function InlinePropField({
|
|
|
21816
22689
|
flexible = false,
|
|
21817
22690
|
width
|
|
21818
22691
|
}) {
|
|
21819
|
-
return /* @__PURE__ */ jsxs25(
|
|
22692
|
+
return /* @__PURE__ */ jsxs25(Box25, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
21820
22693
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
21821
22694
|
focused ? "\u203A " : " ",
|
|
21822
22695
|
label
|
|
@@ -21837,7 +22710,7 @@ function DefaultValueRow({
|
|
|
21837
22710
|
active,
|
|
21838
22711
|
focused
|
|
21839
22712
|
}) {
|
|
21840
|
-
return /* @__PURE__ */ jsxs25(
|
|
22713
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
21841
22714
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21842
22715
|
focused ? "\u203A " : " ",
|
|
21843
22716
|
"default:"
|
|
@@ -21870,7 +22743,7 @@ function ValueInputRow({
|
|
|
21870
22743
|
valueText,
|
|
21871
22744
|
cursorVisible
|
|
21872
22745
|
}) {
|
|
21873
|
-
return /* @__PURE__ */ jsxs25(
|
|
22746
|
+
return /* @__PURE__ */ jsxs25(Box25, { paddingLeft: 2, children: [
|
|
21874
22747
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
21875
22748
|
/* @__PURE__ */ jsx31(Text26, { children: valueText }),
|
|
21876
22749
|
/* @__PURE__ */ jsx31(Text26, { inverse: cursorVisible, children: " " })
|
|
@@ -21888,7 +22761,7 @@ function EditableListItem({
|
|
|
21888
22761
|
if (isBeingEdited) {
|
|
21889
22762
|
return /* @__PURE__ */ jsx31(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
21890
22763
|
}
|
|
21891
|
-
return /* @__PURE__ */ jsx31(
|
|
22764
|
+
return /* @__PURE__ */ jsx31(Box25, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.accent : void 0, children: active ? `${figures6.pointer} ${value}` : ` ${value}` }) });
|
|
21892
22765
|
}
|
|
21893
22766
|
function EditableValueList({
|
|
21894
22767
|
values,
|
|
@@ -21902,7 +22775,7 @@ function EditableValueList({
|
|
|
21902
22775
|
showAddInput
|
|
21903
22776
|
}) {
|
|
21904
22777
|
return /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
21905
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx31(
|
|
22778
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx31(Box25, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) })),
|
|
21906
22779
|
values.map((value, index) => /* @__PURE__ */ jsx31(
|
|
21907
22780
|
EditableListItem,
|
|
21908
22781
|
{
|
|
@@ -21927,7 +22800,7 @@ function DefaultSubRow({
|
|
|
21927
22800
|
}) {
|
|
21928
22801
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
21929
22802
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
21930
|
-
return /* @__PURE__ */ jsxs25(
|
|
22803
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
21931
22804
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21932
22805
|
focused ? "\u203A " : " ",
|
|
21933
22806
|
"default:"
|
|
@@ -21941,7 +22814,7 @@ function DefaultSubRow({
|
|
|
21941
22814
|
}
|
|
21942
22815
|
if (prop.type === "enum") {
|
|
21943
22816
|
if (prop.values.length === 0) {
|
|
21944
|
-
return /* @__PURE__ */ jsxs25(
|
|
22817
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
21945
22818
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21946
22819
|
focused ? "\u203A " : " ",
|
|
21947
22820
|
"default:"
|
|
@@ -21954,19 +22827,19 @@ function DefaultSubRow({
|
|
|
21954
22827
|
}
|
|
21955
22828
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
21956
22829
|
if (active) {
|
|
21957
|
-
return /* @__PURE__ */ jsxs25(
|
|
22830
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "row", flexShrink: 0, children: [
|
|
21958
22831
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21959
22832
|
focused ? "\u203A " : " ",
|
|
21960
22833
|
"default:"
|
|
21961
22834
|
] }),
|
|
21962
|
-
/* @__PURE__ */ jsxs25(
|
|
22835
|
+
/* @__PURE__ */ jsxs25(Box25, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
21963
22836
|
/* @__PURE__ */ jsx31(Text26, { children: value.slice(0, textCursor) }),
|
|
21964
22837
|
/* @__PURE__ */ jsx31(Text26, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
21965
22838
|
/* @__PURE__ */ jsx31(Text26, { children: value.slice(textCursor + 1) })
|
|
21966
22839
|
] })
|
|
21967
22840
|
] });
|
|
21968
22841
|
}
|
|
21969
|
-
return /* @__PURE__ */ jsxs25(
|
|
22842
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
21970
22843
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21971
22844
|
focused ? "\u203A " : " ",
|
|
21972
22845
|
"default:"
|
|
@@ -21986,7 +22859,7 @@ function DescriptionField({
|
|
|
21986
22859
|
paddingLeft = 2
|
|
21987
22860
|
}) {
|
|
21988
22861
|
if (compact) {
|
|
21989
|
-
return /* @__PURE__ */ jsxs25(
|
|
22862
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
21990
22863
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21991
22864
|
focused ? "\u203A " : " ",
|
|
21992
22865
|
label
|
|
@@ -21994,7 +22867,7 @@ function DescriptionField({
|
|
|
21994
22867
|
/* @__PURE__ */ jsx31(Text26, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
21995
22868
|
] });
|
|
21996
22869
|
}
|
|
21997
|
-
return /* @__PURE__ */ jsxs25(
|
|
22870
|
+
return /* @__PURE__ */ jsxs25(Box25, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
21998
22871
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21999
22872
|
focused ? "\u203A " : " ",
|
|
22000
22873
|
label
|
|
@@ -22030,8 +22903,8 @@ function PropRow({
|
|
|
22030
22903
|
}) {
|
|
22031
22904
|
const descFocused = activeField === "description";
|
|
22032
22905
|
const descActive = editingField && descFocused;
|
|
22033
|
-
return /* @__PURE__ */ jsxs25(
|
|
22034
|
-
/* @__PURE__ */ jsx31(
|
|
22906
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
22907
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(RowLabel, { name: prop.name, selected }) }),
|
|
22035
22908
|
/* @__PURE__ */ jsx31(
|
|
22036
22909
|
DescriptionField,
|
|
22037
22910
|
{
|
|
@@ -22045,7 +22918,7 @@ function PropRow({
|
|
|
22045
22918
|
paddingLeft: 0
|
|
22046
22919
|
}
|
|
22047
22920
|
),
|
|
22048
|
-
/* @__PURE__ */ jsxs25(
|
|
22921
|
+
/* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
22049
22922
|
/* @__PURE__ */ jsx31(
|
|
22050
22923
|
RequiredField,
|
|
22051
22924
|
{
|
|
@@ -22058,7 +22931,7 @@ function PropRow({
|
|
|
22058
22931
|
/* @__PURE__ */ jsx31(InlinePropField, { label: "type:", focused: activeField === "type", children: editingField && activeField === "type" ? /* @__PURE__ */ jsx31(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx31(Text26, { children: prop.type }) })
|
|
22059
22932
|
] }),
|
|
22060
22933
|
prop.type === "token" && /* @__PURE__ */ jsx31(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx31(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx31(Text26, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
22061
|
-
prop.type === "enum" && /* @__PURE__ */ jsxs25(
|
|
22934
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22062
22935
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
22063
22936
|
activeField === "values" ? "\u203A " : " ",
|
|
22064
22937
|
"values:"
|
|
@@ -22079,12 +22952,12 @@ function PropRow({
|
|
|
22079
22952
|
cursorVisible
|
|
22080
22953
|
}
|
|
22081
22954
|
),
|
|
22082
|
-
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(
|
|
22955
|
+
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22083
22956
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
22084
22957
|
activeField === "allowed" ? "\u203A " : " ",
|
|
22085
22958
|
"allowed:"
|
|
22086
22959
|
] }),
|
|
22087
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx31(
|
|
22960
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx31(Box25, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx31(Text26, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx31(
|
|
22088
22961
|
Text26,
|
|
22089
22962
|
{
|
|
22090
22963
|
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
@@ -22093,13 +22966,13 @@ function PropRow({
|
|
|
22093
22966
|
}
|
|
22094
22967
|
)
|
|
22095
22968
|
] }),
|
|
22096
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx31(
|
|
22969
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx31(Box25, { paddingLeft: 2, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: (() => {
|
|
22097
22970
|
const max = Math.max(8, width - 8);
|
|
22098
22971
|
const text = `~ ${rationale}`;
|
|
22099
22972
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22100
22973
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22101
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(
|
|
22102
|
-
/* @__PURE__ */ jsxs25(
|
|
22974
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(Box25, { paddingLeft: 2, flexDirection: "column", children: [
|
|
22975
|
+
/* @__PURE__ */ jsxs25(Box25, { children: [
|
|
22103
22976
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "values:" }),
|
|
22104
22977
|
activeField === "values" && /* @__PURE__ */ jsx31(Text26, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22105
22978
|
] }),
|
|
@@ -22133,8 +23006,8 @@ function SlotRow({
|
|
|
22133
23006
|
pickerCandidates,
|
|
22134
23007
|
pickerCursor
|
|
22135
23008
|
}) {
|
|
22136
|
-
return /* @__PURE__ */ jsxs25(
|
|
22137
|
-
/* @__PURE__ */ jsx31(
|
|
23009
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
23010
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(RowLabel, { name: slot.name, selected, trailing: false }) }),
|
|
22138
23011
|
/* @__PURE__ */ jsx31(
|
|
22139
23012
|
DescriptionField,
|
|
22140
23013
|
{
|
|
@@ -22148,7 +23021,7 @@ function SlotRow({
|
|
|
22148
23021
|
paddingLeft: 0
|
|
22149
23022
|
}
|
|
22150
23023
|
),
|
|
22151
|
-
/* @__PURE__ */ jsx31(
|
|
23024
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(
|
|
22152
23025
|
RequiredField,
|
|
22153
23026
|
{
|
|
22154
23027
|
value: slot.required,
|
|
@@ -22157,7 +23030,7 @@ function SlotRow({
|
|
|
22157
23030
|
activeField
|
|
22158
23031
|
}
|
|
22159
23032
|
) }),
|
|
22160
|
-
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(
|
|
23033
|
+
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22161
23034
|
/* @__PURE__ */ jsxs25(
|
|
22162
23035
|
Text26,
|
|
22163
23036
|
{
|
|
@@ -22171,8 +23044,8 @@ function SlotRow({
|
|
|
22171
23044
|
),
|
|
22172
23045
|
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx31(Text26, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
22173
23046
|
] }),
|
|
22174
|
-
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(
|
|
22175
|
-
/* @__PURE__ */ jsxs25(
|
|
23047
|
+
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", children: [
|
|
23048
|
+
/* @__PURE__ */ jsxs25(Box25, { children: [
|
|
22176
23049
|
/* @__PURE__ */ jsxs25(
|
|
22177
23050
|
Text26,
|
|
22178
23051
|
{
|
|
@@ -22200,7 +23073,7 @@ function SlotRow({
|
|
|
22200
23073
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
22201
23074
|
}
|
|
22202
23075
|
),
|
|
22203
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx31(
|
|
23076
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx31(Box25, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
22204
23077
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22205
23078
|
if (filtered.length === 0) {
|
|
22206
23079
|
return /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
@@ -22209,7 +23082,7 @@ function SlotRow({
|
|
|
22209
23082
|
const MAX_VISIBLE = 5;
|
|
22210
23083
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
22211
23084
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22212
|
-
return /* @__PURE__ */ jsxs25(
|
|
23085
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", children: [
|
|
22213
23086
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22214
23087
|
slice.map((name, i) => {
|
|
22215
23088
|
const absIdx = start + i;
|
|
@@ -23043,14 +23916,14 @@ function FieldEditor({
|
|
|
23043
23916
|
});
|
|
23044
23917
|
const innerWidth = Math.max(1, width - 2);
|
|
23045
23918
|
if (parseErr) {
|
|
23046
|
-
return /* @__PURE__ */ jsxs25(
|
|
23919
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
23047
23920
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
23048
23921
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.error, children: parseErr }),
|
|
23049
23922
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
23050
23923
|
] });
|
|
23051
23924
|
}
|
|
23052
23925
|
if (props.length === 0 && slots.length === 0) {
|
|
23053
|
-
return /* @__PURE__ */ jsxs25(
|
|
23926
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
23054
23927
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
23055
23928
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
23056
23929
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
@@ -23183,7 +24056,7 @@ function FieldEditor({
|
|
|
23183
24056
|
const renderRow = (row, index) => {
|
|
23184
24057
|
const key = rowKey(row, index);
|
|
23185
24058
|
if (row.kind === "header") {
|
|
23186
|
-
return /* @__PURE__ */ jsx31(
|
|
24059
|
+
return /* @__PURE__ */ jsx31(Box25, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
23187
24060
|
}
|
|
23188
24061
|
if (row.kind === "component-description") {
|
|
23189
24062
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -23269,7 +24142,7 @@ function FieldEditor({
|
|
|
23269
24142
|
children: [
|
|
23270
24143
|
hasEmptyProperties && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
23271
24144
|
header,
|
|
23272
|
-
/* @__PURE__ */ jsx31(
|
|
24145
|
+
/* @__PURE__ */ jsx31(Box25, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx31(
|
|
23273
24146
|
PropRow,
|
|
23274
24147
|
{
|
|
23275
24148
|
prop: currentProp,
|
|
@@ -23305,7 +24178,7 @@ function FieldEditor({
|
|
|
23305
24178
|
const absoluteIndex = scrollStart + index;
|
|
23306
24179
|
const key = rowKey(row, absoluteIndex);
|
|
23307
24180
|
return /* @__PURE__ */ jsx31(
|
|
23308
|
-
|
|
24181
|
+
Box25,
|
|
23309
24182
|
{
|
|
23310
24183
|
ref: (node) => {
|
|
23311
24184
|
if (node) rowMeasureRefs.current.set(key, node);
|
|
@@ -23327,20 +24200,20 @@ function FieldEditor({
|
|
|
23327
24200
|
const src = metadata?.componentSource ?? null;
|
|
23328
24201
|
const headerPath = path5 ?? "<unknown source path>";
|
|
23329
24202
|
if (!start || !end2 || !src) {
|
|
23330
|
-
return /* @__PURE__ */ jsxs25(
|
|
24203
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23331
24204
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
23332
24205
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
23333
24206
|
/* @__PURE__ */ jsx31(Text26, { children: "[s] close" })
|
|
23334
24207
|
] });
|
|
23335
24208
|
}
|
|
23336
24209
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
23337
|
-
return /* @__PURE__ */ jsxs25(
|
|
24210
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23338
24211
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
23339
24212
|
lines.map((ln, i) => /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
23340
24213
|
/* @__PURE__ */ jsx31(Text26, { children: "[s] close \xB7 [Esc] close" })
|
|
23341
24214
|
] });
|
|
23342
24215
|
})(),
|
|
23343
|
-
showHelp && /* @__PURE__ */ jsxs25(
|
|
24216
|
+
showHelp && /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
23344
24217
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
23345
24218
|
/* @__PURE__ */ jsx31(Text26, { children: " " }),
|
|
23346
24219
|
/* @__PURE__ */ jsx31(Text26, { bold: true, children: "Row navigation" }),
|
|
@@ -23369,7 +24242,7 @@ function FieldEditor({
|
|
|
23369
24242
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
23370
24243
|
] }),
|
|
23371
24244
|
validationError && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
23372
|
-
/* @__PURE__ */ jsx31(
|
|
24245
|
+
/* @__PURE__ */ jsx31(Box25, { paddingTop: 1, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: modeLabel }) })
|
|
23373
24246
|
]
|
|
23374
24247
|
}
|
|
23375
24248
|
);
|
|
@@ -23379,7 +24252,7 @@ function FieldEditor({
|
|
|
23379
24252
|
import { Text as Text32 } from "ink";
|
|
23380
24253
|
|
|
23381
24254
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
23382
|
-
import { Box as
|
|
24255
|
+
import { Box as Box27, Text as Text28 } from "ink";
|
|
23383
24256
|
|
|
23384
24257
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/wrap-text.ts
|
|
23385
24258
|
function appendLongWordChunks(word, width, lines) {
|
|
@@ -23414,23 +24287,23 @@ function wrapText(text, innerWidth) {
|
|
|
23414
24287
|
}
|
|
23415
24288
|
|
|
23416
24289
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx
|
|
23417
|
-
import { Box as
|
|
24290
|
+
import { Box as Box26, Text as Text27 } from "ink";
|
|
23418
24291
|
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
23419
24292
|
function RationaleLine({ line, active }) {
|
|
23420
24293
|
if (line.kind === "blank") {
|
|
23421
|
-
return /* @__PURE__ */ jsx32(
|
|
24294
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { children: " " }) });
|
|
23422
24295
|
}
|
|
23423
24296
|
if (line.kind === "heading") {
|
|
23424
|
-
return /* @__PURE__ */ jsx32(
|
|
24297
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
23425
24298
|
}
|
|
23426
24299
|
if (line.kind === "label") {
|
|
23427
|
-
return /* @__PURE__ */ jsxs26(
|
|
24300
|
+
return /* @__PURE__ */ jsxs26(Box26, { children: [
|
|
23428
24301
|
line.prefix && /* @__PURE__ */ jsx32(Text27, { children: line.prefix }),
|
|
23429
24302
|
/* @__PURE__ */ jsx32(Text27, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
23430
24303
|
line.suffix && /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: line.suffix })
|
|
23431
24304
|
] });
|
|
23432
24305
|
}
|
|
23433
|
-
return /* @__PURE__ */ jsx32(
|
|
24306
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
23434
24307
|
}
|
|
23435
24308
|
|
|
23436
24309
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
@@ -23503,7 +24376,7 @@ function ComponentRationalePanel({
|
|
|
23503
24376
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
23504
24377
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
23505
24378
|
return /* @__PURE__ */ jsxs27(
|
|
23506
|
-
|
|
24379
|
+
Box27,
|
|
23507
24380
|
{
|
|
23508
24381
|
flexDirection: "column",
|
|
23509
24382
|
width,
|
|
@@ -23511,16 +24384,16 @@ function ComponentRationalePanel({
|
|
|
23511
24384
|
borderStyle: "single",
|
|
23512
24385
|
borderColor: active ? PALETTE.text : void 0,
|
|
23513
24386
|
children: [
|
|
23514
|
-
/* @__PURE__ */ jsx33(
|
|
24387
|
+
/* @__PURE__ */ jsx33(Box27, { children: /* @__PURE__ */ jsx33(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
23515
24388
|
visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i)),
|
|
23516
|
-
/* @__PURE__ */ jsx33(
|
|
24389
|
+
/* @__PURE__ */ jsx33(Box27, { children: overflowed ? /* @__PURE__ */ jsx33(Text28, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx33(Text28, { children: "[I/Esc] close" }) })
|
|
23517
24390
|
]
|
|
23518
24391
|
}
|
|
23519
24392
|
);
|
|
23520
24393
|
}
|
|
23521
24394
|
|
|
23522
24395
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/JsonPanel.tsx
|
|
23523
|
-
import { Box as
|
|
24396
|
+
import { Box as Box29 } from "ink";
|
|
23524
24397
|
|
|
23525
24398
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/HighlightedLine.tsx
|
|
23526
24399
|
import { Text as Text29 } from "ink";
|
|
@@ -23530,7 +24403,7 @@ function HighlightedLine({ parts }) {
|
|
|
23530
24403
|
}
|
|
23531
24404
|
|
|
23532
24405
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
23533
|
-
import { Box as
|
|
24406
|
+
import { Box as Box28, Text as Text30 } from "ink";
|
|
23534
24407
|
import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
23535
24408
|
function ScrollablePanel({
|
|
23536
24409
|
title,
|
|
@@ -23544,11 +24417,11 @@ function ScrollablePanel({
|
|
|
23544
24417
|
children
|
|
23545
24418
|
}) {
|
|
23546
24419
|
const overflowed = totalLines > height;
|
|
23547
|
-
return /* @__PURE__ */ jsxs28(
|
|
23548
|
-
/* @__PURE__ */ jsxs28(
|
|
24420
|
+
return /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
24421
|
+
/* @__PURE__ */ jsxs28(Box28, { children: [
|
|
23549
24422
|
/* @__PURE__ */ jsx35(Text30, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
23550
24423
|
overflowed && /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
23551
|
-
/* @__PURE__ */ jsx35(
|
|
24424
|
+
/* @__PURE__ */ jsx35(Box28, { flexGrow: 1 }),
|
|
23552
24425
|
/* @__PURE__ */ jsx35(Text30, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
23553
24426
|
] })
|
|
23554
24427
|
] }),
|
|
@@ -23621,7 +24494,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
23621
24494
|
borderColor: active ? "white" : void 0,
|
|
23622
24495
|
children: visibleLines.map((line, i) => {
|
|
23623
24496
|
const truncated = truncateLine(line, innerWidth);
|
|
23624
|
-
return /* @__PURE__ */ jsx36(
|
|
24497
|
+
return /* @__PURE__ */ jsx36(Box29, { children: highlightJson(truncated) }, i);
|
|
23625
24498
|
})
|
|
23626
24499
|
}
|
|
23627
24500
|
);
|
|
@@ -23679,7 +24552,7 @@ function RationalePanel({
|
|
|
23679
24552
|
|
|
23680
24553
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx
|
|
23681
24554
|
import figures7 from "figures";
|
|
23682
|
-
import { Box as
|
|
24555
|
+
import { Box as Box30, Text as Text31 } from "ink";
|
|
23683
24556
|
import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
23684
24557
|
function TokenReviewPanel({
|
|
23685
24558
|
componentName,
|
|
@@ -23700,7 +24573,7 @@ function TokenReviewPanel({
|
|
|
23700
24573
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
23701
24574
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
23702
24575
|
return /* @__PURE__ */ jsxs29(
|
|
23703
|
-
|
|
24576
|
+
Box30,
|
|
23704
24577
|
{
|
|
23705
24578
|
flexDirection: "column",
|
|
23706
24579
|
width,
|
|
@@ -23716,7 +24589,7 @@ function TokenReviewPanel({
|
|
|
23716
24589
|
const pathIndex = scrollStart + i;
|
|
23717
24590
|
const checked = editSelection.has(path5);
|
|
23718
24591
|
const focused = pathIndex === editCursor;
|
|
23719
|
-
return /* @__PURE__ */ jsx38(
|
|
24592
|
+
return /* @__PURE__ */ jsx38(Box30, { children: /* @__PURE__ */ jsx38(
|
|
23720
24593
|
Text31,
|
|
23721
24594
|
{
|
|
23722
24595
|
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
@@ -23734,7 +24607,7 @@ function TokenReviewPanel({
|
|
|
23734
24607
|
);
|
|
23735
24608
|
}
|
|
23736
24609
|
return /* @__PURE__ */ jsxs29(
|
|
23737
|
-
|
|
24610
|
+
Box30,
|
|
23738
24611
|
{
|
|
23739
24612
|
flexDirection: "column",
|
|
23740
24613
|
width,
|
|
@@ -23746,8 +24619,8 @@ function TokenReviewPanel({
|
|
|
23746
24619
|
suggestions.length === 0 && /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
23747
24620
|
suggestions.map((s, i) => {
|
|
23748
24621
|
const focused = i === selectedRow;
|
|
23749
|
-
return /* @__PURE__ */ jsxs29(
|
|
23750
|
-
/* @__PURE__ */ jsx38(
|
|
24622
|
+
return /* @__PURE__ */ jsxs29(Box30, { flexDirection: "column", children: [
|
|
24623
|
+
/* @__PURE__ */ jsx38(Box30, { children: /* @__PURE__ */ jsx38(Text31, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
|
|
23751
24624
|
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
23752
24625
|
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
23753
24626
|
] }, s.propName);
|
|
@@ -23989,7 +24862,7 @@ function ReviewEmptyComponentsWarning({
|
|
|
23989
24862
|
return /* @__PURE__ */ jsx41(Text33, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
23990
24863
|
}
|
|
23991
24864
|
function ReviewNoSelection() {
|
|
23992
|
-
return /* @__PURE__ */ jsx41(
|
|
24865
|
+
return /* @__PURE__ */ jsx41(Box31, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx41(Text33, { color: PALETTE.muted, children: "No component selected" }) });
|
|
23993
24866
|
}
|
|
23994
24867
|
function ReviewFinalizeError({
|
|
23995
24868
|
message,
|
|
@@ -24017,9 +24890,9 @@ function ReviewComponentTitle({
|
|
|
24017
24890
|
slotCount,
|
|
24018
24891
|
sidebarFocused
|
|
24019
24892
|
}) {
|
|
24020
|
-
return /* @__PURE__ */ jsxs31(
|
|
24893
|
+
return /* @__PURE__ */ jsxs31(Box31, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
24021
24894
|
/* @__PURE__ */ jsx41(Text33, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
24022
|
-
/* @__PURE__ */ jsx41(
|
|
24895
|
+
/* @__PURE__ */ jsx41(Box31, { flexGrow: 1 }),
|
|
24023
24896
|
/* @__PURE__ */ jsxs31(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
24024
24897
|
propCount,
|
|
24025
24898
|
" prop",
|
|
@@ -24051,8 +24924,8 @@ function ReviewComponentPanel({
|
|
|
24051
24924
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
24052
24925
|
const contentHeight = Math.max(1, height - 2);
|
|
24053
24926
|
const contentWidth = Math.max(1, width - 1);
|
|
24054
|
-
return /* @__PURE__ */ jsx41(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs31(
|
|
24055
|
-
/* @__PURE__ */ jsx41(
|
|
24927
|
+
return /* @__PURE__ */ jsx41(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", width: contentWidth, height, flexShrink: 0, overflowY: "hidden", children: [
|
|
24928
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx41(
|
|
24056
24929
|
ReviewDetailsEditor,
|
|
24057
24930
|
{
|
|
24058
24931
|
selectedKey,
|
|
@@ -24076,8 +24949,8 @@ function ReviewComponentPanel({
|
|
|
24076
24949
|
)
|
|
24077
24950
|
}
|
|
24078
24951
|
) }),
|
|
24079
|
-
/* @__PURE__ */ jsx41(
|
|
24080
|
-
/* @__PURE__ */ jsx41(
|
|
24952
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx41(Text33, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
24953
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx41(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx41(
|
|
24081
24954
|
ReviewPanelFooter,
|
|
24082
24955
|
{
|
|
24083
24956
|
reviewEditor,
|
|
@@ -24091,7 +24964,7 @@ function ReviewComponentPanel({
|
|
|
24091
24964
|
}
|
|
24092
24965
|
|
|
24093
24966
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx
|
|
24094
|
-
import { Box as
|
|
24967
|
+
import { Box as Box32, Text as Text34 } from "ink";
|
|
24095
24968
|
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
24096
24969
|
function countReviewStatuses(entries) {
|
|
24097
24970
|
return entries.reduce(
|
|
@@ -24105,10 +24978,10 @@ function countReviewStatuses(entries) {
|
|
|
24105
24978
|
);
|
|
24106
24979
|
}
|
|
24107
24980
|
function ReviewLoadingState() {
|
|
24108
|
-
return /* @__PURE__ */ jsx42(
|
|
24981
|
+
return /* @__PURE__ */ jsx42(Box32, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx42(Text34, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
24109
24982
|
}
|
|
24110
24983
|
function ReviewLoadError({ message }) {
|
|
24111
|
-
return /* @__PURE__ */ jsxs32(
|
|
24984
|
+
return /* @__PURE__ */ jsxs32(Box32, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
24112
24985
|
/* @__PURE__ */ jsx42(Text34, { color: PALETTE.error, children: message }),
|
|
24113
24986
|
/* @__PURE__ */ jsx42(Text34, { children: " " }),
|
|
24114
24987
|
/* @__PURE__ */ jsx42(ControlHints, { hints: [{ keys: "q / Enter / Esc", label: "Quit" }] })
|
|
@@ -24311,7 +25184,7 @@ async function runLivePreview(opts) {
|
|
|
24311
25184
|
}
|
|
24312
25185
|
|
|
24313
25186
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx
|
|
24314
|
-
import { Box as
|
|
25187
|
+
import { Box as Box33, Text as Text35 } from "ink";
|
|
24315
25188
|
import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
24316
25189
|
var FINALIZE_REMOVED_WINDOW = 6;
|
|
24317
25190
|
function FinalizeDialog({
|
|
@@ -24341,7 +25214,7 @@ function FinalizeDialog({
|
|
|
24341
25214
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
24342
25215
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
24343
25216
|
const hasMoreAbove = offset > 0;
|
|
24344
|
-
return /* @__PURE__ */ jsx43(
|
|
25217
|
+
return /* @__PURE__ */ jsx43(Box33, { width: "100%", paddingX: 2, children: /* @__PURE__ */ jsxs33(Box33, { flexDirection: "column", alignItems: "flex-start", children: [
|
|
24345
25218
|
/* @__PURE__ */ jsx43(Text35, { bold: true, children: "Finalize" }),
|
|
24346
25219
|
/* @__PURE__ */ jsx43(Text35, { children: " " }),
|
|
24347
25220
|
/* @__PURE__ */ jsxs33(Text35, { children: [
|
|
@@ -24371,7 +25244,7 @@ function FinalizeDialog({
|
|
|
24371
25244
|
/* @__PURE__ */ jsx43(Text35, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
24372
25245
|
/* @__PURE__ */ jsx43(Text35, { children: " " })
|
|
24373
25246
|
] }),
|
|
24374
|
-
/* @__PURE__ */ jsxs33(
|
|
25247
|
+
/* @__PURE__ */ jsxs33(Box33, { flexDirection: "column", height: 2, children: [
|
|
24375
25248
|
previewStatus === "running" ? /* @__PURE__ */ jsx43(Text35, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx43(Text35, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx43(Text35, { children: " " }),
|
|
24376
25249
|
/* @__PURE__ */ jsx43(Text35, { children: " " })
|
|
24377
25250
|
] }),
|
|
@@ -24798,10 +25671,10 @@ function useReviewSurfaceState(initialFinalizeError = null) {
|
|
|
24798
25671
|
}
|
|
24799
25672
|
|
|
24800
25673
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx
|
|
24801
|
-
import { Box as
|
|
25674
|
+
import { Box as Box35, Text as Text37 } from "ink";
|
|
24802
25675
|
|
|
24803
25676
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/QuitDialog.tsx
|
|
24804
|
-
import { Box as
|
|
25677
|
+
import { Box as Box34, Text as Text36 } from "ink";
|
|
24805
25678
|
import { Fragment as Fragment12, jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
24806
25679
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
24807
25680
|
useImmediateInput((input, key) => {
|
|
@@ -24811,7 +25684,7 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
24811
25684
|
onCancel();
|
|
24812
25685
|
}
|
|
24813
25686
|
});
|
|
24814
|
-
return /* @__PURE__ */ jsxs34(
|
|
25687
|
+
return /* @__PURE__ */ jsxs34(Box34, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
24815
25688
|
/* @__PURE__ */ jsx44(Text36, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
24816
25689
|
/* @__PURE__ */ jsx44(Text36, { children: " " }),
|
|
24817
25690
|
hasUnsavedDrafts ? /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
@@ -24889,7 +25762,7 @@ function ReviewStepDialogs({
|
|
|
24889
25762
|
}
|
|
24890
25763
|
function ReviewReloadDialog({ open }) {
|
|
24891
25764
|
if (!open) return null;
|
|
24892
|
-
return /* @__PURE__ */ jsxs35(
|
|
25765
|
+
return /* @__PURE__ */ jsxs35(Box35, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
24893
25766
|
/* @__PURE__ */ jsx45(Text37, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
24894
25767
|
/* @__PURE__ */ jsx45(Text37, { children: "Unsaved in-memory changes will be lost." }),
|
|
24895
25768
|
/* @__PURE__ */ jsx45(Text37, { children: " " }),
|
|
@@ -25261,7 +26134,7 @@ function useReviewPreview({
|
|
|
25261
26134
|
}
|
|
25262
26135
|
|
|
25263
26136
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx
|
|
25264
|
-
import { Box as
|
|
26137
|
+
import { Box as Box36, Text as Text38 } from "ink";
|
|
25265
26138
|
import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
25266
26139
|
function LivePreviewSummary({
|
|
25267
26140
|
enabled,
|
|
@@ -25279,7 +26152,7 @@ function LivePreviewSummary({
|
|
|
25279
26152
|
if (disabled) return /* @__PURE__ */ jsx46(Text38, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
25280
26153
|
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx46(Text38, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
25281
26154
|
if (!hasCounts) return null;
|
|
25282
|
-
return /* @__PURE__ */ jsxs36(
|
|
26155
|
+
return /* @__PURE__ */ jsxs36(Box36, { children: [
|
|
25283
26156
|
/* @__PURE__ */ jsx46(Text38, { children: "Preview: " }),
|
|
25284
26157
|
/* @__PURE__ */ jsx46(Text38, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
25285
26158
|
/* @__PURE__ */ jsx46(Text38, { children: " \xB7 " }),
|
|
@@ -25497,7 +26370,7 @@ function deriveBreakingChanges(response) {
|
|
|
25497
26370
|
}
|
|
25498
26371
|
function GenerateReviewStep(props) {
|
|
25499
26372
|
if (!props.extractSessionId) {
|
|
25500
|
-
return /* @__PURE__ */ jsx47(
|
|
26373
|
+
return /* @__PURE__ */ jsx47(Box37, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
25501
26374
|
}
|
|
25502
26375
|
return /* @__PURE__ */ jsx47(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
25503
26376
|
}
|
|
@@ -26402,7 +27275,7 @@ function GenerateReviewStepView({
|
|
|
26402
27275
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
26403
27276
|
return false;
|
|
26404
27277
|
})();
|
|
26405
|
-
return /* @__PURE__ */ jsxs37(
|
|
27278
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", children: [
|
|
26406
27279
|
/* @__PURE__ */ jsx47(StepHeader, { step: "review" }),
|
|
26407
27280
|
/* @__PURE__ */ jsx47(
|
|
26408
27281
|
ReviewStepDialogs,
|
|
@@ -26415,14 +27288,14 @@ function GenerateReviewStepView({
|
|
|
26415
27288
|
}
|
|
26416
27289
|
),
|
|
26417
27290
|
/* @__PURE__ */ jsx47(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26418
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(
|
|
27291
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26419
27292
|
/* @__PURE__ */ jsx47(Text39, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26420
27293
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
26421
27294
|
/* @__PURE__ */ jsx47(Text39, { children: " " }),
|
|
26422
27295
|
removedComponents.map((rc) => /* @__PURE__ */ jsx47(Text39, { children: removedComponentLine(rc) }, rc.id))
|
|
26423
27296
|
] })
|
|
26424
27297
|
] }),
|
|
26425
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx47(
|
|
27298
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx47(Box37, { paddingX: 1, children: /* @__PURE__ */ jsx47(
|
|
26426
27299
|
Text39,
|
|
26427
27300
|
{
|
|
26428
27301
|
color: PALETTE.warning,
|
|
@@ -26433,7 +27306,7 @@ function GenerateReviewStepView({
|
|
|
26433
27306
|
const row = breakingRows[breakingCursor];
|
|
26434
27307
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26435
27308
|
if (!comp) return null;
|
|
26436
|
-
return /* @__PURE__ */ jsxs37(
|
|
27309
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26437
27310
|
/* @__PURE__ */ jsx47(Text39, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
26438
27311
|
comp.impact && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
26439
27312
|
comp.changes.length === 0 ? /* @__PURE__ */ jsx47(Text39, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx47(Text39, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
@@ -26459,7 +27332,7 @@ function GenerateReviewStepView({
|
|
|
26459
27332
|
const participantSet = cycleView.structural;
|
|
26460
27333
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26461
27334
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26462
|
-
return /* @__PURE__ */ jsxs37(
|
|
27335
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26463
27336
|
/* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
26464
27337
|
members.length > 0 && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
26465
27338
|
ancestors.length > 0 && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
@@ -26489,7 +27362,7 @@ function GenerateReviewStepView({
|
|
|
26489
27362
|
height: panelHeight
|
|
26490
27363
|
}
|
|
26491
27364
|
),
|
|
26492
|
-
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
27365
|
+
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box37, { children: [
|
|
26493
27366
|
breakingPanel.isOpen ? /* @__PURE__ */ jsx47(
|
|
26494
27367
|
GotoBanner,
|
|
26495
27368
|
{
|
|
@@ -26578,7 +27451,7 @@ function GenerateReviewStepView({
|
|
|
26578
27451
|
}
|
|
26579
27452
|
) : /* @__PURE__ */ jsx47(ReviewNoSelection, {})
|
|
26580
27453
|
] }),
|
|
26581
|
-
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
27454
|
+
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", children: [
|
|
26582
27455
|
/* @__PURE__ */ jsx47(Text39, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26583
27456
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
26584
27457
|
return /* @__PURE__ */ jsx47(
|
|
@@ -26611,11 +27484,11 @@ function GenerateReviewStepView({
|
|
|
26611
27484
|
}
|
|
26612
27485
|
|
|
26613
27486
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
|
|
26614
|
-
import { Box as
|
|
27487
|
+
import { Box as Box38, Text as Text40 } from "ink";
|
|
26615
27488
|
import { jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
26616
27489
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
26617
27490
|
if (!generatePromptPath) return null;
|
|
26618
|
-
return /* @__PURE__ */ jsxs38(
|
|
27491
|
+
return /* @__PURE__ */ jsxs38(Box38, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26619
27492
|
/* @__PURE__ */ jsx48(Text40, { color: PALETTE.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
26620
27493
|
generatePromptPath ? /* @__PURE__ */ jsxs38(Text40, { color: PALETTE.warning, children: [
|
|
26621
27494
|
"components: ",
|
|
@@ -26626,7 +27499,7 @@ function CustomPromptBanner({ generatePromptPath }) {
|
|
|
26626
27499
|
}
|
|
26627
27500
|
|
|
26628
27501
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/DoneStep.tsx
|
|
26629
|
-
import { Box as
|
|
27502
|
+
import { Box as Box40, Text as Text42 } from "ink";
|
|
26630
27503
|
|
|
26631
27504
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/contentful-urls.ts
|
|
26632
27505
|
function normalizeHost(host) {
|
|
@@ -26642,10 +27515,10 @@ function buildPostPushUrl2({ host, spaceId, environmentId, view = "components" }
|
|
|
26642
27515
|
}
|
|
26643
27516
|
|
|
26644
27517
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/SpaceEnvironment.tsx
|
|
26645
|
-
import { Box as
|
|
27518
|
+
import { Box as Box39, Text as Text41 } from "ink";
|
|
26646
27519
|
import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
26647
27520
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
26648
|
-
return /* @__PURE__ */ jsxs39(
|
|
27521
|
+
return /* @__PURE__ */ jsxs39(Box39, { gap: 1, marginTop: 1, children: [
|
|
26649
27522
|
/* @__PURE__ */ jsx49(Text41, { color: PALETTE.muted, children: "Space:" }),
|
|
26650
27523
|
/* @__PURE__ */ jsx49(Text41, { children: spaceId }),
|
|
26651
27524
|
/* @__PURE__ */ jsx49(Text41, { color: PALETTE.muted, children: "/" }),
|
|
@@ -26675,7 +27548,7 @@ function EntityRows({ entity, label }) {
|
|
|
26675
27548
|
] });
|
|
26676
27549
|
}
|
|
26677
27550
|
function LinkRow({ title, url }) {
|
|
26678
|
-
return /* @__PURE__ */ jsxs40(
|
|
27551
|
+
return /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
26679
27552
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: title }),
|
|
26680
27553
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.accent, children: url })
|
|
26681
27554
|
] });
|
|
@@ -26701,14 +27574,14 @@ function DoneStep({
|
|
|
26701
27574
|
const totalPushed = componentTypes.created + componentTypes.updated + componentTypes.removed + designTokens.created + designTokens.updated + designTokens.removed;
|
|
26702
27575
|
const success = totalFailed === 0;
|
|
26703
27576
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
26704
|
-
return /* @__PURE__ */ jsxs40(
|
|
27577
|
+
return /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
26705
27578
|
/* @__PURE__ */ jsx50(StepHeader, { step: "done" }),
|
|
26706
|
-
/* @__PURE__ */ jsxs40(
|
|
27579
|
+
/* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
26707
27580
|
success ? /* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
26708
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: credentialsSkipped ? "Nothing was pushed \u2014 you skipped the Contentful credentials, so the files were only saved locally." : "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs40(
|
|
26709
|
-
/* @__PURE__ */ jsx50(EntityRows, { entity: componentTypes, label: "Component
|
|
27581
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: credentialsSkipped ? "Nothing was pushed \u2014 you skipped the Contentful credentials, so the files were only saved locally." : "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
27582
|
+
/* @__PURE__ */ jsx50(EntityRows, { entity: componentTypes, label: "Component" }),
|
|
26710
27583
|
/* @__PURE__ */ jsx50(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
26711
|
-
summary && /* @__PURE__ */ jsx50(
|
|
27584
|
+
summary && /* @__PURE__ */ jsx50(Box40, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
|
|
26712
27585
|
"Push result: ",
|
|
26713
27586
|
summary.succeeded,
|
|
26714
27587
|
"/",
|
|
@@ -26721,7 +27594,7 @@ function DoneStep({
|
|
|
26721
27594
|
] })
|
|
26722
27595
|
] }) })
|
|
26723
27596
|
] }),
|
|
26724
|
-
failures.length > 0 && /* @__PURE__ */ jsxs40(
|
|
27597
|
+
failures.length > 0 && /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
26725
27598
|
/* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
26726
27599
|
failures.map((failure) => /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.error, children: [
|
|
26727
27600
|
failure.entityType,
|
|
@@ -26732,7 +27605,7 @@ function DoneStep({
|
|
|
26732
27605
|
] }, `${failure.entityType}:${failure.entityId}`))
|
|
26733
27606
|
] }),
|
|
26734
27607
|
/* @__PURE__ */ jsx50(SpaceEnvironment, { spaceId, environmentId }),
|
|
26735
|
-
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(
|
|
27608
|
+
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", gap: 1, children: [
|
|
26736
27609
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
26737
27610
|
produced.components && /* @__PURE__ */ jsx50(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
26738
27611
|
produced.tokens && /* @__PURE__ */ jsx50(
|
|
@@ -26750,12 +27623,12 @@ function DoneStep({
|
|
|
26750
27623
|
|
|
26751
27624
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PathPrompt.tsx
|
|
26752
27625
|
import { useState as useState27 } from "react";
|
|
26753
|
-
import { Box as
|
|
27626
|
+
import { Box as Box41, Text as Text43 } from "ink";
|
|
26754
27627
|
import { readdirSync as readdirSync3 } from "node:fs";
|
|
26755
|
-
import { dirname as
|
|
27628
|
+
import { dirname as dirname16, basename as basename6, join as join20 } from "node:path";
|
|
26756
27629
|
|
|
26757
27630
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/path-utils.ts
|
|
26758
|
-
import { resolve as
|
|
27631
|
+
import { resolve as resolve25 } from "node:path";
|
|
26759
27632
|
import { homedir as homedir4 } from "node:os";
|
|
26760
27633
|
function expandTilde(input) {
|
|
26761
27634
|
if (input === "~" || input.startsWith("~/") || input.startsWith("~\\")) {
|
|
@@ -26769,7 +27642,7 @@ function normalizePath(input) {
|
|
|
26769
27642
|
p = p.slice(1, -1);
|
|
26770
27643
|
}
|
|
26771
27644
|
p = expandTilde(p);
|
|
26772
|
-
return
|
|
27645
|
+
return resolve25(p);
|
|
26773
27646
|
}
|
|
26774
27647
|
|
|
26775
27648
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
|
|
@@ -26788,7 +27661,7 @@ import { jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
|
26788
27661
|
function autocomplete(partial) {
|
|
26789
27662
|
if (!partial) return null;
|
|
26790
27663
|
const normalized = normalizePath(partial);
|
|
26791
|
-
const dir =
|
|
27664
|
+
const dir = dirname16(normalized);
|
|
26792
27665
|
const base = basename6(normalized);
|
|
26793
27666
|
let entries;
|
|
26794
27667
|
try {
|
|
@@ -26841,10 +27714,10 @@ function PathPrompt({
|
|
|
26841
27714
|
const shown = input || defaultPath;
|
|
26842
27715
|
const isPlaceholder = input === "";
|
|
26843
27716
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
26844
|
-
return /* @__PURE__ */ jsxs41(
|
|
27717
|
+
return /* @__PURE__ */ jsxs41(Box41, { flexDirection: "column", children: [
|
|
26845
27718
|
/* @__PURE__ */ jsx51(StepHeader, { step: "push" }),
|
|
26846
|
-
/* @__PURE__ */ jsxs41(
|
|
26847
|
-
/* @__PURE__ */ jsxs41(
|
|
27719
|
+
/* @__PURE__ */ jsxs41(Box41, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
27720
|
+
/* @__PURE__ */ jsxs41(Box41, { gap: 1, children: [
|
|
26848
27721
|
/* @__PURE__ */ jsx51(Text43, { color: PALETTE.accent, children: "?" }),
|
|
26849
27722
|
/* @__PURE__ */ jsxs41(Text43, { bold: true, children: [
|
|
26850
27723
|
label,
|
|
@@ -26868,7 +27741,7 @@ function PathPrompt({
|
|
|
26868
27741
|
}
|
|
26869
27742
|
|
|
26870
27743
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PushingStep.tsx
|
|
26871
|
-
import { Box as
|
|
27744
|
+
import { Box as Box42, Text as Text44 } from "ink";
|
|
26872
27745
|
import { ProgressBar as ProgressBar2, ThemeProvider as ThemeProvider2 } from "@inkjs/ui";
|
|
26873
27746
|
|
|
26874
27747
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/produced.ts
|
|
@@ -26910,20 +27783,20 @@ function PushingStep({ progress, produced }) {
|
|
|
26910
27783
|
const operationId = progress && progress.kind === "queued" ? progress.operationId : null;
|
|
26911
27784
|
const showGlobal = progress && progress.kind === "progress";
|
|
26912
27785
|
const showCurrent = progress && progress.kind === "progress" && progress.current ? progress.current : null;
|
|
26913
|
-
return /* @__PURE__ */ jsxs42(
|
|
27786
|
+
return /* @__PURE__ */ jsxs42(Box42, { flexDirection: "column", children: [
|
|
26914
27787
|
/* @__PURE__ */ jsx53(StepHeader, { step: "push" }),
|
|
26915
|
-
/* @__PURE__ */ jsxs42(
|
|
27788
|
+
/* @__PURE__ */ jsxs42(Box42, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
26916
27789
|
/* @__PURE__ */ jsxs42(Text44, { children: [
|
|
26917
27790
|
"Writing ",
|
|
26918
27791
|
writtenThings(produced),
|
|
26919
27792
|
" to your Contentful space..."
|
|
26920
27793
|
] }),
|
|
26921
|
-
operationId && /* @__PURE__ */ jsxs42(
|
|
27794
|
+
operationId && /* @__PURE__ */ jsxs42(Box42, { gap: 1, children: [
|
|
26922
27795
|
/* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: "Operation:" }),
|
|
26923
27796
|
/* @__PURE__ */ jsx53(Text44, { children: operationId })
|
|
26924
27797
|
] }),
|
|
26925
|
-
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx53(
|
|
26926
|
-
/* @__PURE__ */ jsx53(
|
|
27798
|
+
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx53(Box42, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs42(Box42, { gap: 2, children: [
|
|
27799
|
+
/* @__PURE__ */ jsx53(Box42, { width: 40, children: /* @__PURE__ */ jsx53(ThemeProvider2, { theme: PROGRESS_THEME, children: /* @__PURE__ */ jsx53(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
26927
27800
|
/* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
26928
27801
|
progress.processed,
|
|
26929
27802
|
"/",
|
|
@@ -26931,11 +27804,11 @@ function PushingStep({ progress, produced }) {
|
|
|
26931
27804
|
" entities"
|
|
26932
27805
|
] })
|
|
26933
27806
|
] }) }),
|
|
26934
|
-
showCurrent && /* @__PURE__ */ jsxs42(
|
|
27807
|
+
showCurrent && /* @__PURE__ */ jsxs42(Box42, { gap: 1, children: [
|
|
26935
27808
|
/* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: "Now processing:" }),
|
|
26936
27809
|
/* @__PURE__ */ jsx53(Text44, { children: showCurrent })
|
|
26937
27810
|
] }),
|
|
26938
|
-
/* @__PURE__ */ jsx53(
|
|
27811
|
+
/* @__PURE__ */ jsx53(Box42, { marginTop: 1, children: /* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
26939
27812
|
"Elapsed: ",
|
|
26940
27813
|
elapsed
|
|
26941
27814
|
] }) })
|
|
@@ -26945,7 +27818,7 @@ function PushingStep({ progress, produced }) {
|
|
|
26945
27818
|
|
|
26946
27819
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
26947
27820
|
import { useEffect as useEffect20, useState as useState29, useMemo as useMemo5 } from "react";
|
|
26948
|
-
import { Box as
|
|
27821
|
+
import { Box as Box43, Text as Text45 } from "ink";
|
|
26949
27822
|
|
|
26950
27823
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/preview-diff.ts
|
|
26951
27824
|
function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
@@ -27375,9 +28248,9 @@ function WizardPreviewStep({
|
|
|
27375
28248
|
return;
|
|
27376
28249
|
}
|
|
27377
28250
|
});
|
|
27378
|
-
return /* @__PURE__ */ jsxs43(
|
|
28251
|
+
return /* @__PURE__ */ jsxs43(Box43, { flexDirection: "column", children: [
|
|
27379
28252
|
/* @__PURE__ */ jsx54(StepHeader, { step: "push" }),
|
|
27380
|
-
/* @__PURE__ */ jsxs43(
|
|
28253
|
+
/* @__PURE__ */ jsxs43(Box43, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 2, children: [
|
|
27381
28254
|
hasAnything ? /* @__PURE__ */ jsxs43(Fragment16, { children: [
|
|
27382
28255
|
/* @__PURE__ */ jsx54(Text45, { children: "Here's what will happen in your space:" }),
|
|
27383
28256
|
/* @__PURE__ */ jsxs43(
|
|
@@ -27394,9 +28267,9 @@ function WizardPreviewStep({
|
|
|
27394
28267
|
}
|
|
27395
28268
|
)
|
|
27396
28269
|
] }) : /* @__PURE__ */ jsx54(Text45, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
27397
|
-
breakingWithImpact && /* @__PURE__ */ jsx54(
|
|
28270
|
+
breakingWithImpact && /* @__PURE__ */ jsx54(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx54(Text45, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
27398
28271
|
/* @__PURE__ */ jsx54(SpaceEnvironment, { spaceId, environmentId }),
|
|
27399
|
-
/* @__PURE__ */ jsx54(
|
|
28272
|
+
/* @__PURE__ */ jsx54(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx54(
|
|
27400
28273
|
ControlHints,
|
|
27401
28274
|
{
|
|
27402
28275
|
hints: [
|
|
@@ -27539,7 +28412,7 @@ function FlowScreen({
|
|
|
27539
28412
|
);
|
|
27540
28413
|
}
|
|
27541
28414
|
})();
|
|
27542
|
-
return /* @__PURE__ */ jsxs44(
|
|
28415
|
+
return /* @__PURE__ */ jsxs44(Box44, { flexDirection: "column", children: [
|
|
27543
28416
|
/* @__PURE__ */ jsx55(CustomPromptBanner, { generatePromptPath }),
|
|
27544
28417
|
content
|
|
27545
28418
|
] });
|
|
@@ -27552,7 +28425,7 @@ import { useEffect as useEffect21, useRef as useRef14, useSyncExternalStore } fr
|
|
|
27552
28425
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
27553
28426
|
import { mkdir as mkdir8 } from "node:fs/promises";
|
|
27554
28427
|
import { tmpdir } from "node:os";
|
|
27555
|
-
import { join as join22, resolve as
|
|
28428
|
+
import { join as join22, resolve as resolve26 } from "node:path";
|
|
27556
28429
|
|
|
27557
28430
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/wizard-state-transitions.ts
|
|
27558
28431
|
function shouldBypassPreview(state2) {
|
|
@@ -27926,7 +28799,7 @@ var realSaveDeps = () => ({
|
|
|
27926
28799
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
27927
28800
|
appendRun,
|
|
27928
28801
|
buildSourceFingerprint,
|
|
27929
|
-
sleep: (ms) => new Promise((
|
|
28802
|
+
sleep: (ms) => new Promise((resolve29) => setTimeout(resolve29, ms)),
|
|
27930
28803
|
warn: (message) => process.stderr.write(message)
|
|
27931
28804
|
});
|
|
27932
28805
|
async function runPrintFiles(input, deps, onPatch) {
|
|
@@ -28265,7 +29138,7 @@ function createFlowController(start, deps) {
|
|
|
28265
29138
|
},
|
|
28266
29139
|
async submitPath(submitted) {
|
|
28267
29140
|
await deps.mkdir(submitted);
|
|
28268
|
-
if (
|
|
29141
|
+
if (resolve26(submitted) !== resolve26(state2.outDir) && await deps.detectSaveConflict(submitted)) {
|
|
28269
29142
|
const subdir = deps.buildTimestampedSubdir(submitted);
|
|
28270
29143
|
await deps.mkdir(subdir);
|
|
28271
29144
|
await proceedToWrite(subdir);
|
|
@@ -28313,7 +29186,7 @@ function useFlow(start, options = {}) {
|
|
|
28313
29186
|
|
|
28314
29187
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
28315
29188
|
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
28316
|
-
import { Box as
|
|
29189
|
+
import { Box as Box45, Text as Text46, useInput as useInput12 } from "ink";
|
|
28317
29190
|
init_debug_store();
|
|
28318
29191
|
|
|
28319
29192
|
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
@@ -28323,7 +29196,7 @@ init_debug_mode_store();
|
|
|
28323
29196
|
init_version();
|
|
28324
29197
|
|
|
28325
29198
|
// packages/experience-design-system-cli/src/tui/help/file-locations.ts
|
|
28326
|
-
import { join as join25, resolve as
|
|
29199
|
+
import { join as join25, resolve as resolve28 } from "node:path";
|
|
28327
29200
|
function describeFileLocations({
|
|
28328
29201
|
contentfulBaseDir,
|
|
28329
29202
|
debugModeEnabled,
|
|
@@ -28335,7 +29208,7 @@ function describeFileLocations({
|
|
|
28335
29208
|
importFiles: `${join25("<project>", ".contentful")}/ (tokens.json, components.json)`
|
|
28336
29209
|
};
|
|
28337
29210
|
}
|
|
28338
|
-
const base = contentfulBaseDir ?
|
|
29211
|
+
const base = contentfulBaseDir ? resolve28(contentfulBaseDir) : "<project>";
|
|
28339
29212
|
const session = currentSessionDir2 ?? join25(base, ".contentful", "<date>-session-<n>");
|
|
28340
29213
|
return {
|
|
28341
29214
|
debugLogs: join25(session, "debug"),
|
|
@@ -28376,10 +29249,10 @@ async function readHelpInfo() {
|
|
|
28376
29249
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
28377
29250
|
import { Fragment as Fragment17, jsx as jsx56, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
28378
29251
|
function Section({ title, rows }) {
|
|
28379
|
-
return /* @__PURE__ */ jsxs45(
|
|
29252
|
+
return /* @__PURE__ */ jsxs45(Box45, { flexDirection: "column", children: [
|
|
28380
29253
|
/* @__PURE__ */ jsx56(Text46, { bold: true, color: PALETTE.accent, children: title }),
|
|
28381
|
-
rows.map((row) => /* @__PURE__ */ jsxs45(
|
|
28382
|
-
/* @__PURE__ */ jsx56(
|
|
29254
|
+
rows.map((row) => /* @__PURE__ */ jsxs45(Box45, { gap: 1, children: [
|
|
29255
|
+
/* @__PURE__ */ jsx56(Box45, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text46, { color: PALETTE.muted, children: row.label }) }),
|
|
28383
29256
|
/* @__PURE__ */ jsx56(Text46, { children: row.value })
|
|
28384
29257
|
] }, row.label))
|
|
28385
29258
|
] });
|
|
@@ -28394,7 +29267,7 @@ function HelpScreen({ onDone }) {
|
|
|
28394
29267
|
void finishDebugRun({ outputs: {}, status: "success", exitMethod });
|
|
28395
29268
|
onDone();
|
|
28396
29269
|
};
|
|
28397
|
-
|
|
29270
|
+
useInput12((input, key) => {
|
|
28398
29271
|
if (key.return) {
|
|
28399
29272
|
leave("saved");
|
|
28400
29273
|
return;
|
|
@@ -28404,7 +29277,7 @@ function HelpScreen({ onDone }) {
|
|
|
28404
29277
|
return;
|
|
28405
29278
|
}
|
|
28406
29279
|
});
|
|
28407
|
-
return /* @__PURE__ */ jsxs45(
|
|
29280
|
+
return /* @__PURE__ */ jsxs45(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
28408
29281
|
/* @__PURE__ */ jsx56(Text46, { bold: true, children: "Help" }),
|
|
28409
29282
|
info ? /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
28410
29283
|
/* @__PURE__ */ jsx56(Section, { title: "Where things are stored", rows: info.storage }),
|
|
@@ -28425,7 +29298,7 @@ function HelpScreen({ onDone }) {
|
|
|
28425
29298
|
|
|
28426
29299
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
28427
29300
|
import { useState as useState31 } from "react";
|
|
28428
|
-
import { Box as
|
|
29301
|
+
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
28429
29302
|
import { jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
28430
29303
|
function SettingsScreen({
|
|
28431
29304
|
onNavigate,
|
|
@@ -28437,7 +29310,7 @@ function SettingsScreen({
|
|
|
28437
29310
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
28438
29311
|
{ label: "Debug Mode", screen: "settings-debug-mode" }
|
|
28439
29312
|
];
|
|
28440
|
-
|
|
29313
|
+
useInput13((input, key) => {
|
|
28441
29314
|
if (key.upArrow) {
|
|
28442
29315
|
setFocusIdx((i) => (i - 1 + items.length) % items.length);
|
|
28443
29316
|
return;
|
|
@@ -28457,7 +29330,7 @@ function SettingsScreen({
|
|
|
28457
29330
|
onBack();
|
|
28458
29331
|
}
|
|
28459
29332
|
});
|
|
28460
|
-
return /* @__PURE__ */ jsxs46(
|
|
29333
|
+
return /* @__PURE__ */ jsxs46(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28461
29334
|
/* @__PURE__ */ jsx57(Text47, { bold: true, children: "Settings" }),
|
|
28462
29335
|
/* @__PURE__ */ jsx57(Text47, { color: PALETTE.muted, children: " " }),
|
|
28463
29336
|
items.map((item, i) => /* @__PURE__ */ jsxs46(Text47, { color: i === focusIdx ? PALETTE.accent : void 0, children: [
|
|
@@ -28480,11 +29353,11 @@ function SettingsScreen({
|
|
|
28480
29353
|
|
|
28481
29354
|
// packages/experience-design-system-cli/src/tui/settings/configuration/ConfigurationScreen.tsx
|
|
28482
29355
|
import { useState as useState35 } from "react";
|
|
28483
|
-
import { Box as
|
|
29356
|
+
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
28484
29357
|
|
|
28485
29358
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
28486
29359
|
import { useEffect as useEffect24, useRef as useRef15, useState as useState33 } from "react";
|
|
28487
|
-
import { Box as
|
|
29360
|
+
import { Box as Box48, Text as Text50, useInput as useInput14 } from "ink";
|
|
28488
29361
|
init_debug_store();
|
|
28489
29362
|
|
|
28490
29363
|
// packages/experience-design-system-cli/src/tui/settings/shared/debug-trail.ts
|
|
@@ -28556,20 +29429,20 @@ function resolveOnPath(binary) {
|
|
|
28556
29429
|
() => null
|
|
28557
29430
|
);
|
|
28558
29431
|
}
|
|
28559
|
-
return new Promise((
|
|
29432
|
+
return new Promise((resolve29) => {
|
|
28560
29433
|
execFile2(
|
|
28561
29434
|
process.platform === "win32" ? "where" : "which",
|
|
28562
29435
|
[binary],
|
|
28563
|
-
(error, stdout) =>
|
|
29436
|
+
(error, stdout) => resolve29(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
28564
29437
|
);
|
|
28565
29438
|
});
|
|
28566
29439
|
}
|
|
28567
29440
|
function readVersion(binary) {
|
|
28568
|
-
return new Promise((
|
|
29441
|
+
return new Promise((resolve29) => {
|
|
28569
29442
|
execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
|
|
28570
29443
|
const line = stdout.split("\n")[0]?.trim() ?? "";
|
|
28571
|
-
if (!error && line)
|
|
28572
|
-
else
|
|
29444
|
+
if (!error && line) resolve29(pass("version", line));
|
|
29445
|
+
else resolve29(fail3("version", "runs, but did not report a version"));
|
|
28573
29446
|
});
|
|
28574
29447
|
});
|
|
28575
29448
|
}
|
|
@@ -28813,7 +29686,7 @@ async function writeAgentConfig(config) {
|
|
|
28813
29686
|
|
|
28814
29687
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
28815
29688
|
import { useEffect as useEffect23, useState as useState32 } from "react";
|
|
28816
|
-
import { Box as
|
|
29689
|
+
import { Box as Box47, Text as Text49 } from "ink";
|
|
28817
29690
|
|
|
28818
29691
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentStatusBadge.tsx
|
|
28819
29692
|
import { Text as Text48 } from "ink";
|
|
@@ -28858,7 +29731,7 @@ var fields = (name) => [
|
|
|
28858
29731
|
];
|
|
28859
29732
|
var INSPECT_DELAY_MS = 400;
|
|
28860
29733
|
function StatusHeading() {
|
|
28861
|
-
return /* @__PURE__ */ jsxs47(
|
|
29734
|
+
return /* @__PURE__ */ jsxs47(Box47, { gap: 1, children: [
|
|
28862
29735
|
/* @__PURE__ */ jsx59(Text49, { bold: true, color: PALETTE.muted, children: "STATUS" }),
|
|
28863
29736
|
/* @__PURE__ */ jsx59(Text49, { color: PALETTE.muted, children: "\xB7 read only" })
|
|
28864
29737
|
] });
|
|
@@ -28940,7 +29813,7 @@ function AgentDetail({
|
|
|
28940
29813
|
actions: [action],
|
|
28941
29814
|
notice: testing ? null : notice,
|
|
28942
29815
|
busy: saving || testing,
|
|
28943
|
-
children: /* @__PURE__ */ jsxs47(
|
|
29816
|
+
children: /* @__PURE__ */ jsxs47(Box47, { flexDirection: "column", marginTop: 1, children: [
|
|
28944
29817
|
/* @__PURE__ */ jsx59(StatusHeading, {}),
|
|
28945
29818
|
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx59(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx59(Text49, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
28946
29819
|
] })
|
|
@@ -29027,7 +29900,7 @@ function AgentsScreen({ onDone }) {
|
|
|
29027
29900
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
29028
29901
|
}).finally(() => setSaving(false));
|
|
29029
29902
|
};
|
|
29030
|
-
|
|
29903
|
+
useInput14((input, key) => {
|
|
29031
29904
|
if (loadError && (key.escape || input === "q")) {
|
|
29032
29905
|
endVisit(null);
|
|
29033
29906
|
onDone();
|
|
@@ -29059,7 +29932,7 @@ function AgentsScreen({ onDone }) {
|
|
|
29059
29932
|
}
|
|
29060
29933
|
});
|
|
29061
29934
|
if (!config) {
|
|
29062
|
-
return /* @__PURE__ */ jsxs48(
|
|
29935
|
+
return /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29063
29936
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
29064
29937
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
29065
29938
|
loadError ? /* @__PURE__ */ jsxs48(Fragment18, { children: [
|
|
@@ -29094,35 +29967,35 @@ function AgentsScreen({ onDone }) {
|
|
|
29094
29967
|
);
|
|
29095
29968
|
}
|
|
29096
29969
|
const focusedAgent = AGENT_NAMES[focus];
|
|
29097
|
-
return /* @__PURE__ */ jsxs48(
|
|
29970
|
+
return /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29098
29971
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
29099
29972
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
29100
29973
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
29101
29974
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
29102
|
-
/* @__PURE__ */ jsxs48(
|
|
29975
|
+
/* @__PURE__ */ jsxs48(Box48, { gap: 1, children: [
|
|
29103
29976
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "Default agent" }),
|
|
29104
29977
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: AGENT_LABELS[config.defaultAgent] }),
|
|
29105
29978
|
saving && /* @__PURE__ */ jsx60(Text50, { color: PALETTE.accent, children: "\u2026 saving" })
|
|
29106
29979
|
] }),
|
|
29107
|
-
/* @__PURE__ */ jsxs48(
|
|
29980
|
+
/* @__PURE__ */ jsxs48(Box48, { marginTop: 1, gap: 1, children: [
|
|
29108
29981
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
29109
29982
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
29110
|
-
/* @__PURE__ */ jsx60(
|
|
29983
|
+
/* @__PURE__ */ jsx60(Box48, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
29111
29984
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "STATUS" })
|
|
29112
29985
|
] }),
|
|
29113
29986
|
AGENT_NAMES.map((name) => {
|
|
29114
29987
|
const isFocused = focusedAgent === name;
|
|
29115
|
-
return /* @__PURE__ */ jsxs48(
|
|
29988
|
+
return /* @__PURE__ */ jsxs48(Box48, { gap: 1, children: [
|
|
29116
29989
|
/* @__PURE__ */ jsx60(Text50, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
29117
29990
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
|
|
29118
|
-
/* @__PURE__ */ jsx60(
|
|
29991
|
+
/* @__PURE__ */ jsx60(Box48, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
|
|
29119
29992
|
/* @__PURE__ */ jsx60(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
|
|
29120
29993
|
] }, name);
|
|
29121
29994
|
}),
|
|
29122
|
-
/* @__PURE__ */ jsxs48(
|
|
29995
|
+
/* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
29123
29996
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
29124
|
-
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(
|
|
29125
|
-
/* @__PURE__ */ jsx60(
|
|
29997
|
+
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(Box48, { gap: 1, paddingLeft: 1, children: [
|
|
29998
|
+
/* @__PURE__ */ jsx60(Box48, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: row.label }) }),
|
|
29126
29999
|
/* @__PURE__ */ jsx60(Text50, { color: TONE_COLOR[row.tone], children: row.value })
|
|
29127
30000
|
] }, row.label))
|
|
29128
30001
|
] }),
|
|
@@ -29151,7 +30024,7 @@ function AgentsScreen({ onDone }) {
|
|
|
29151
30024
|
|
|
29152
30025
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
29153
30026
|
import { useEffect as useEffect25, useRef as useRef16, useState as useState34 } from "react";
|
|
29154
|
-
import { Box as
|
|
30027
|
+
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
29155
30028
|
init_debug_store();
|
|
29156
30029
|
|
|
29157
30030
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/project-store.ts
|
|
@@ -29253,14 +30126,14 @@ function ProjectScreen({ onDone }) {
|
|
|
29253
30126
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
29254
30127
|
});
|
|
29255
30128
|
};
|
|
29256
|
-
|
|
30129
|
+
useInput15((input, key) => {
|
|
29257
30130
|
if (!config && loadError && (key.escape || input === "q")) {
|
|
29258
30131
|
endVisit(null);
|
|
29259
30132
|
onDone();
|
|
29260
30133
|
}
|
|
29261
30134
|
});
|
|
29262
30135
|
if (!config) {
|
|
29263
|
-
return /* @__PURE__ */ jsxs49(
|
|
30136
|
+
return /* @__PURE__ */ jsxs49(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29264
30137
|
/* @__PURE__ */ jsx61(Text51, { bold: true, children: "Settings \u203A Configuration \u203A Project" }),
|
|
29265
30138
|
/* @__PURE__ */ jsx61(Text51, { children: " " }),
|
|
29266
30139
|
loadError ? /* @__PURE__ */ jsxs49(Fragment19, { children: [
|
|
@@ -29303,6 +30176,7 @@ function ProjectScreen({ onDone }) {
|
|
|
29303
30176
|
setNotice(null);
|
|
29304
30177
|
visit.trail.record(`edited ${key}`);
|
|
29305
30178
|
},
|
|
30179
|
+
enterAdvances: true,
|
|
29306
30180
|
onSave: save,
|
|
29307
30181
|
onQuit: quit,
|
|
29308
30182
|
notice,
|
|
@@ -29325,7 +30199,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
29325
30199
|
const [focus, setFocus] = useState35(0);
|
|
29326
30200
|
const [open, setOpen] = useState35(null);
|
|
29327
30201
|
const close = () => setOpen(null);
|
|
29328
|
-
|
|
30202
|
+
useInput16((input, key) => {
|
|
29329
30203
|
if (open) return;
|
|
29330
30204
|
if (key.upArrow) {
|
|
29331
30205
|
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
@@ -29343,12 +30217,12 @@ function ConfigurationScreen({ onDone }) {
|
|
|
29343
30217
|
});
|
|
29344
30218
|
if (open === "project") return /* @__PURE__ */ jsx62(ProjectScreen, { onDone: close });
|
|
29345
30219
|
if (open === "agents") return /* @__PURE__ */ jsx62(AgentsScreen, { onDone: close });
|
|
29346
|
-
return /* @__PURE__ */ jsxs50(
|
|
30220
|
+
return /* @__PURE__ */ jsxs50(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29347
30221
|
/* @__PURE__ */ jsx62(Text52, { bold: true, children: "Settings \u203A Configuration" }),
|
|
29348
30222
|
/* @__PURE__ */ jsx62(Text52, { children: " " }),
|
|
29349
|
-
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(
|
|
30223
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(Box50, { gap: 1, children: [
|
|
29350
30224
|
/* @__PURE__ */ jsx62(Text52, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
29351
|
-
/* @__PURE__ */ jsx62(
|
|
30225
|
+
/* @__PURE__ */ jsx62(Box50, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text52, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
29352
30226
|
/* @__PURE__ */ jsx62(Text52, { color: PALETTE.muted, children: section.description })
|
|
29353
30227
|
] }, section.id)),
|
|
29354
30228
|
/* @__PURE__ */ jsx62(Text52, { children: " " }),
|
|
@@ -29367,7 +30241,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
29367
30241
|
|
|
29368
30242
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
29369
30243
|
import { useEffect as useEffect26, useState as useState36 } from "react";
|
|
29370
|
-
import { Box as
|
|
30244
|
+
import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
|
|
29371
30245
|
|
|
29372
30246
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
29373
30247
|
async function readAnalyticsSetting() {
|
|
@@ -29402,7 +30276,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29402
30276
|
});
|
|
29403
30277
|
});
|
|
29404
30278
|
}, []);
|
|
29405
|
-
|
|
30279
|
+
useInput17((input, key) => {
|
|
29406
30280
|
if (loading) return;
|
|
29407
30281
|
if (key.return || input === " ") {
|
|
29408
30282
|
setEnabled((current) => {
|
|
@@ -29417,7 +30291,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29417
30291
|
onDone();
|
|
29418
30292
|
}
|
|
29419
30293
|
});
|
|
29420
|
-
return /* @__PURE__ */ jsxs51(
|
|
30294
|
+
return /* @__PURE__ */ jsxs51(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29421
30295
|
/* @__PURE__ */ jsx63(Text53, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
29422
30296
|
/* @__PURE__ */ jsx63(Text53, { children: " " }),
|
|
29423
30297
|
loading ? /* @__PURE__ */ jsx63(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs51(Fragment20, { children: [
|
|
@@ -29445,7 +30319,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29445
30319
|
|
|
29446
30320
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
29447
30321
|
import { useEffect as useEffect27, useRef as useRef17, useState as useState37 } from "react";
|
|
29448
|
-
import { Box as
|
|
30322
|
+
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
29449
30323
|
init_debug_mode_store();
|
|
29450
30324
|
init_debug_store();
|
|
29451
30325
|
import { Fragment as Fragment21, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
@@ -29502,7 +30376,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
29502
30376
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
29503
30377
|
});
|
|
29504
30378
|
};
|
|
29505
|
-
|
|
30379
|
+
useInput18((input, key) => {
|
|
29506
30380
|
if (!setting) return;
|
|
29507
30381
|
if (key.upArrow || key.downArrow) {
|
|
29508
30382
|
setFocus((current) => ROWS[(ROWS.indexOf(current) + (key.downArrow ? 1 : ROWS.length - 1)) % ROWS.length]);
|
|
@@ -29531,16 +30405,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
29531
30405
|
});
|
|
29532
30406
|
const marker = (row) => /* @__PURE__ */ jsx64(Text54, { color: focus === row ? PALETTE.accent : void 0, children: focus === row ? "\u276F" : " " });
|
|
29533
30407
|
const label = (row, text) => /* @__PURE__ */ jsx64(Text54, { bold: focus === row, color: focus === row ? PALETTE.accent : PALETTE.muted, children: text });
|
|
29534
|
-
return /* @__PURE__ */ jsxs52(
|
|
30408
|
+
return /* @__PURE__ */ jsxs52(Box52, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29535
30409
|
/* @__PURE__ */ jsx64(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
29536
30410
|
/* @__PURE__ */ jsx64(Text54, { children: " " }),
|
|
29537
30411
|
setting ? /* @__PURE__ */ jsxs52(Fragment21, { children: [
|
|
29538
|
-
/* @__PURE__ */ jsxs52(
|
|
30412
|
+
/* @__PURE__ */ jsxs52(Box52, { gap: 1, children: [
|
|
29539
30413
|
marker("enabled"),
|
|
29540
30414
|
label("enabled", "Debug logging:"),
|
|
29541
30415
|
/* @__PURE__ */ jsx64(Text54, { bold: true, color: setting.enabled ? PALETTE.success : PALETTE.muted, children: setting.enabled ? "On" : "Off" })
|
|
29542
30416
|
] }),
|
|
29543
|
-
/* @__PURE__ */ jsxs52(
|
|
30417
|
+
/* @__PURE__ */ jsxs52(Box52, { gap: 1, children: [
|
|
29544
30418
|
marker("retentionDays"),
|
|
29545
30419
|
label("retentionDays", "Delete logs after:"),
|
|
29546
30420
|
RETENTION_CHOICES.map((days) => {
|