@contentful/experience-design-system-cli 2.37.1-dev-build-8affe270.0 → 2.37.1-dev-build-ef8b693f.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 +509 -1225
- package/dist/index.js +590 -1379
- package/dist/package.json +1 -1
- package/dist/src/tui/home/home.theme.d.ts +0 -8
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +6 -6
- package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +0 -1
- package/dist/src/tui/theme.d.ts +19 -0
- package/legacy/dist/src/index.js +0 -1
- package/legacy/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/help/file-locations.d.ts +0 -23
- package/dist/src/tui/import/steps/09-review/theme.d.ts +0 -9
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +0 -13
- package/dist/src/tui/settings/agents/AgentDetail.d.ts +0 -13
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +0 -11
- package/dist/src/tui/settings/agents/AgentStatusBadge.d.ts +0 -10
- package/dist/src/tui/settings/agents/agent-status.d.ts +0 -70
- package/dist/src/tui/settings/agents/agent-store.d.ts +0 -17
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +0 -13
- package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +0 -5
- package/dist/src/tui/settings/shared/FieldForm.d.ts +0 -35
package/dist/index.js
CHANGED
|
@@ -1500,7 +1500,7 @@ async function runAgent(options) {
|
|
|
1500
1500
|
promptLen: prompt.length,
|
|
1501
1501
|
promptHead: prompt.slice(0, 500)
|
|
1502
1502
|
});
|
|
1503
|
-
return new Promise((
|
|
1503
|
+
return new Promise((resolve27) => {
|
|
1504
1504
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
1505
1505
|
const child = spawn(binary, args, {
|
|
1506
1506
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -1549,7 +1549,7 @@ async function runAgent(options) {
|
|
|
1549
1549
|
stderrLen: stderr.length,
|
|
1550
1550
|
stderrTail: stderr.slice(-1e3)
|
|
1551
1551
|
});
|
|
1552
|
-
|
|
1552
|
+
resolve27(result);
|
|
1553
1553
|
});
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
@@ -1571,7 +1571,7 @@ async function checkAgentAuth(agent) {
|
|
|
1571
1571
|
return "not-found";
|
|
1572
1572
|
if (agent !== "claude")
|
|
1573
1573
|
return "ok";
|
|
1574
|
-
return new Promise((
|
|
1574
|
+
return new Promise((resolve27) => {
|
|
1575
1575
|
const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
1576
1576
|
let stdout = "";
|
|
1577
1577
|
let done = false;
|
|
@@ -1580,7 +1580,7 @@ async function checkAgentAuth(agent) {
|
|
|
1580
1580
|
return;
|
|
1581
1581
|
done = true;
|
|
1582
1582
|
child.kill("SIGTERM");
|
|
1583
|
-
|
|
1583
|
+
resolve27("unauthenticated");
|
|
1584
1584
|
}, 5e3);
|
|
1585
1585
|
child.stdout?.on("data", (chunk) => {
|
|
1586
1586
|
stdout += chunk.toString();
|
|
@@ -1591,14 +1591,14 @@ async function checkAgentAuth(agent) {
|
|
|
1591
1591
|
done = true;
|
|
1592
1592
|
clearTimeout(timer);
|
|
1593
1593
|
if (code !== 0) {
|
|
1594
|
-
|
|
1594
|
+
resolve27("unauthenticated");
|
|
1595
1595
|
return;
|
|
1596
1596
|
}
|
|
1597
1597
|
try {
|
|
1598
1598
|
const status = JSON.parse(stdout);
|
|
1599
|
-
|
|
1599
|
+
resolve27(status.loggedIn ? "ok" : "unauthenticated");
|
|
1600
1600
|
} catch {
|
|
1601
|
-
|
|
1601
|
+
resolve27("unauthenticated");
|
|
1602
1602
|
}
|
|
1603
1603
|
});
|
|
1604
1604
|
});
|
|
@@ -1608,9 +1608,9 @@ async function binaryIsOnPath(binary) {
|
|
|
1608
1608
|
const fs = await import("node:fs/promises");
|
|
1609
1609
|
return fs.access(binary).then(() => true, () => false);
|
|
1610
1610
|
}
|
|
1611
|
-
return new Promise((
|
|
1611
|
+
return new Promise((resolve27) => {
|
|
1612
1612
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
1613
|
-
child.on("close", (code) =>
|
|
1613
|
+
child.on("close", (code) => resolve27(code === 0));
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
var init_check_agent_auth = __esm({
|
|
@@ -7916,10 +7916,10 @@ function extractVueSlotsFromSetup(options) {
|
|
|
7916
7916
|
if (!body)
|
|
7917
7917
|
return [];
|
|
7918
7918
|
const slotsByName = /* @__PURE__ */ new Map();
|
|
7919
|
-
for (const
|
|
7920
|
-
if (
|
|
7919
|
+
for (const access6 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
|
|
7920
|
+
if (access6.getExpression().getText() !== slotsName)
|
|
7921
7921
|
continue;
|
|
7922
|
-
const slotName =
|
|
7922
|
+
const slotName = access6.getName();
|
|
7923
7923
|
if (!slotsByName.has(slotName)) {
|
|
7924
7924
|
slotsByName.set(slotName, {
|
|
7925
7925
|
name: slotName,
|
|
@@ -14333,7 +14333,7 @@ function errorMessage(error) {
|
|
|
14333
14333
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
14334
14334
|
}
|
|
14335
14335
|
function defaultSleep(delayMs) {
|
|
14336
|
-
return new Promise((
|
|
14336
|
+
return new Promise((resolve27) => setTimeout(resolve27, delayMs));
|
|
14337
14337
|
}
|
|
14338
14338
|
var MAX_RETRY_AFTER_MS;
|
|
14339
14339
|
var init_http_utils = __esm({
|
|
@@ -14609,7 +14609,7 @@ var init_api_client = __esm({
|
|
|
14609
14609
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14610
14610
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14611
14611
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14612
|
-
await new Promise((
|
|
14612
|
+
await new Promise((resolve27) => setTimeout(resolve27, baseDelay + jitter));
|
|
14613
14613
|
}
|
|
14614
14614
|
}
|
|
14615
14615
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -18527,7 +18527,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
18527
18527
|
const message = error instanceof Error ? error.message : String(error);
|
|
18528
18528
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
18529
18529
|
throw error;
|
|
18530
|
-
await new Promise((
|
|
18530
|
+
await new Promise((resolve27) => setTimeout(resolve27, Math.min(250 * attempt, 2e3)));
|
|
18531
18531
|
}
|
|
18532
18532
|
}
|
|
18533
18533
|
}
|
|
@@ -19446,7 +19446,6 @@ var init_src4 = __esm({
|
|
|
19446
19446
|
init_agents();
|
|
19447
19447
|
init_agent_name();
|
|
19448
19448
|
init_models();
|
|
19449
|
-
init_binaries();
|
|
19450
19449
|
init_is_agent_name();
|
|
19451
19450
|
init_agent_supports_bedrock();
|
|
19452
19451
|
init_check_agent_auth();
|
|
@@ -19566,97 +19565,6 @@ var init_v1_store = __esm({
|
|
|
19566
19565
|
}
|
|
19567
19566
|
});
|
|
19568
19567
|
|
|
19569
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/agent-store.ts
|
|
19570
|
-
function emptyAgents() {
|
|
19571
|
-
return Object.fromEntries(AGENT_NAMES.map((name) => [name, { model: "", binary: "" }]));
|
|
19572
|
-
}
|
|
19573
|
-
async function readAgentConfig() {
|
|
19574
|
-
const store = await readV1Store();
|
|
19575
|
-
const stored = asString(store["agent"]);
|
|
19576
|
-
const defaultAgent = isAgentName(stored) ? stored : DEFAULT_AGENT3;
|
|
19577
|
-
const agents = emptyAgents();
|
|
19578
|
-
const saved = store["agents"];
|
|
19579
|
-
if (saved && typeof saved === "object") {
|
|
19580
|
-
for (const name of AGENT_NAMES) {
|
|
19581
|
-
const entry = saved[name];
|
|
19582
|
-
if (entry && typeof entry === "object") {
|
|
19583
|
-
const fields = entry;
|
|
19584
|
-
agents[name] = { model: asString(fields["model"]), binary: asString(fields["binary"]) };
|
|
19585
|
-
}
|
|
19586
|
-
}
|
|
19587
|
-
}
|
|
19588
|
-
const legacyModel = asString(store["agentModel"]);
|
|
19589
|
-
if (legacyModel && !agents[defaultAgent].model)
|
|
19590
|
-
agents[defaultAgent] = { ...agents[defaultAgent], model: legacyModel };
|
|
19591
|
-
return { defaultAgent, agents };
|
|
19592
|
-
}
|
|
19593
|
-
async function writeAgentConfig(config) {
|
|
19594
|
-
const existing = await readV1Store();
|
|
19595
|
-
const merged = { ...existing };
|
|
19596
|
-
const agents = {};
|
|
19597
|
-
for (const name of AGENT_NAMES) {
|
|
19598
|
-
const model = config.agents[name].model.trim();
|
|
19599
|
-
const binary = config.agents[name].binary.trim();
|
|
19600
|
-
if (model || binary) agents[name] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
19601
|
-
}
|
|
19602
|
-
merged["agent"] = config.defaultAgent;
|
|
19603
|
-
const defaultModel = agents[config.defaultAgent]?.model;
|
|
19604
|
-
if (defaultModel) merged["agentModel"] = defaultModel;
|
|
19605
|
-
else delete merged["agentModel"];
|
|
19606
|
-
if (Object.keys(agents).length > 0) merged["agents"] = agents;
|
|
19607
|
-
else delete merged["agents"];
|
|
19608
|
-
await writeV1Store(merged);
|
|
19609
|
-
}
|
|
19610
|
-
var DEFAULT_AGENT3, AGENT_LABELS, AGENT_HINTS, asString;
|
|
19611
|
-
var init_agent_store = __esm({
|
|
19612
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/agent-store.ts"() {
|
|
19613
|
-
"use strict";
|
|
19614
|
-
init_src4();
|
|
19615
|
-
init_v1_store();
|
|
19616
|
-
DEFAULT_AGENT3 = "claude";
|
|
19617
|
-
AGENT_LABELS = {
|
|
19618
|
-
claude: "Claude Code",
|
|
19619
|
-
codex: "OpenAI Codex",
|
|
19620
|
-
opencode: "OpenCode",
|
|
19621
|
-
cursor: "Cursor",
|
|
19622
|
-
copilot: "GitHub Copilot"
|
|
19623
|
-
};
|
|
19624
|
-
AGENT_HINTS = {
|
|
19625
|
-
claude: "claude",
|
|
19626
|
-
codex: "codex",
|
|
19627
|
-
opencode: "opencode",
|
|
19628
|
-
cursor: "cursor-agent",
|
|
19629
|
-
copilot: "copilot"
|
|
19630
|
-
};
|
|
19631
|
-
asString = (value) => typeof value === "string" ? value : "";
|
|
19632
|
-
}
|
|
19633
|
-
});
|
|
19634
|
-
|
|
19635
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts
|
|
19636
|
-
function applyBinaryOverrides(config) {
|
|
19637
|
-
for (const name of AGENT_NAMES) {
|
|
19638
|
-
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
19639
|
-
const binary = config.agents[name].binary.trim();
|
|
19640
|
-
if (binary) {
|
|
19641
|
-
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
19642
|
-
process.env[key] = binary;
|
|
19643
|
-
} else if (shellValues.has(key)) {
|
|
19644
|
-
const shellValue = shellValues.get(key);
|
|
19645
|
-
if (shellValue === void 0) delete process.env[key];
|
|
19646
|
-
else process.env[key] = shellValue;
|
|
19647
|
-
shellValues.delete(key);
|
|
19648
|
-
}
|
|
19649
|
-
}
|
|
19650
|
-
}
|
|
19651
|
-
var shellValues;
|
|
19652
|
-
var init_apply_binary_overrides = __esm({
|
|
19653
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts"() {
|
|
19654
|
-
"use strict";
|
|
19655
|
-
init_src4();
|
|
19656
|
-
shellValues = /* @__PURE__ */ new Map();
|
|
19657
|
-
}
|
|
19658
|
-
});
|
|
19659
|
-
|
|
19660
19568
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
19661
19569
|
async function readAnalyticsSetting() {
|
|
19662
19570
|
const store = await readV1Store();
|
|
@@ -19678,6 +19586,52 @@ var init_analytics_store = __esm({
|
|
|
19678
19586
|
}
|
|
19679
19587
|
});
|
|
19680
19588
|
|
|
19589
|
+
// packages/experience-design-system-cli/src/tui/theme.ts
|
|
19590
|
+
function detectColorMode(env = process.env) {
|
|
19591
|
+
const bg = env.COLORFGBG?.split(";").pop();
|
|
19592
|
+
if (bg === "7" || bg === "15") return "light";
|
|
19593
|
+
return "dark";
|
|
19594
|
+
}
|
|
19595
|
+
var DARK, LIGHT, PALETTE;
|
|
19596
|
+
var init_theme = __esm({
|
|
19597
|
+
"packages/experience-design-system-cli/src/tui/theme.ts"() {
|
|
19598
|
+
"use strict";
|
|
19599
|
+
DARK = {
|
|
19600
|
+
text: "#f7f9fa",
|
|
19601
|
+
// gray100
|
|
19602
|
+
muted: "#aec1cc",
|
|
19603
|
+
// gray400
|
|
19604
|
+
border: "#aec1cc",
|
|
19605
|
+
// gray400
|
|
19606
|
+
accent: "#40a0ff",
|
|
19607
|
+
// blue400
|
|
19608
|
+
error: "#ff707d",
|
|
19609
|
+
// red400
|
|
19610
|
+
success: "#5DB057",
|
|
19611
|
+
// green400
|
|
19612
|
+
warning: "#FFC835"
|
|
19613
|
+
// yellow500
|
|
19614
|
+
};
|
|
19615
|
+
LIGHT = {
|
|
19616
|
+
text: "#111B2B",
|
|
19617
|
+
// gray900
|
|
19618
|
+
muted: "#5A657C",
|
|
19619
|
+
// gray600
|
|
19620
|
+
border: "#5A657C",
|
|
19621
|
+
// gray600
|
|
19622
|
+
accent: "#0059c8",
|
|
19623
|
+
// semantic primary
|
|
19624
|
+
error: "#bd002a",
|
|
19625
|
+
// semantic negative
|
|
19626
|
+
success: "#006D23",
|
|
19627
|
+
// semantic positive
|
|
19628
|
+
warning: "#CC4500"
|
|
19629
|
+
// semantic warning
|
|
19630
|
+
};
|
|
19631
|
+
PALETTE = detectColorMode() === "light" ? LIGHT : DARK;
|
|
19632
|
+
}
|
|
19633
|
+
});
|
|
19634
|
+
|
|
19681
19635
|
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
19682
19636
|
function brandBar(width, ramp = BRAND_RAMP) {
|
|
19683
19637
|
if (width <= 0 || ramp.length === 0) return [];
|
|
@@ -19688,28 +19642,11 @@ function brandBar(width, ramp = BRAND_RAMP) {
|
|
|
19688
19642
|
color
|
|
19689
19643
|
})).filter((segment) => segment.text.length > 0);
|
|
19690
19644
|
}
|
|
19691
|
-
var
|
|
19645
|
+
var BRAND_RAMP, BAR_CELL, FOCUS_MARKER;
|
|
19692
19646
|
var init_home_theme = __esm({
|
|
19693
19647
|
"packages/experience-design-system-cli/src/tui/home/home.theme.ts"() {
|
|
19694
19648
|
"use strict";
|
|
19695
|
-
|
|
19696
|
-
blue: "#1773EB",
|
|
19697
|
-
green: "#00C459",
|
|
19698
|
-
orange: "#E44F20",
|
|
19699
|
-
yellow: "#FFDA00",
|
|
19700
|
-
white: "#FFFFFF",
|
|
19701
|
-
slate: "#8B8D91",
|
|
19702
|
-
steel: "#C4D1DE"
|
|
19703
|
-
};
|
|
19704
|
-
PALETTE = {
|
|
19705
|
-
accent: BRAND.blue,
|
|
19706
|
-
success: BRAND.green,
|
|
19707
|
-
error: BRAND.orange,
|
|
19708
|
-
warning: BRAND.yellow,
|
|
19709
|
-
muted: BRAND.slate,
|
|
19710
|
-
border: BRAND.steel
|
|
19711
|
-
};
|
|
19712
|
-
BRAND_RAMP = [BRAND.blue, BRAND.orange, BRAND.yellow];
|
|
19649
|
+
BRAND_RAMP = ["#1773EB", "#E44F20", "#FFDA00"];
|
|
19713
19650
|
BAR_CELL = "\u2501";
|
|
19714
19651
|
FOCUS_MARKER = "\u276F";
|
|
19715
19652
|
}
|
|
@@ -19789,11 +19726,12 @@ var init_use_terminal_width = __esm({
|
|
|
19789
19726
|
import { Text } from "ink";
|
|
19790
19727
|
import { jsx } from "react/jsx-runtime";
|
|
19791
19728
|
function ControlHints({ hints }) {
|
|
19792
|
-
return /* @__PURE__ */ jsx(Text, { children: hints.map((hint) => `[${hint.keys}] ${hint.label}`).join(" \xB7 ") });
|
|
19729
|
+
return /* @__PURE__ */ jsx(Text, { color: PALETTE.muted, children: hints.map((hint) => `[${hint.keys}] ${hint.label}`).join(" \xB7 ") });
|
|
19793
19730
|
}
|
|
19794
19731
|
var init_control_hints = __esm({
|
|
19795
19732
|
"packages/experience-design-system-cli/src/tui/control-hints.tsx"() {
|
|
19796
19733
|
"use strict";
|
|
19734
|
+
init_theme();
|
|
19797
19735
|
}
|
|
19798
19736
|
});
|
|
19799
19737
|
|
|
@@ -19891,6 +19829,7 @@ var VERSION, HEADING, SUBTITLE, MIN_TERMINAL_WIDTH, START_ITEMS;
|
|
|
19891
19829
|
var init_home = __esm({
|
|
19892
19830
|
"packages/experience-design-system-cli/src/tui/home/home.tsx"() {
|
|
19893
19831
|
"use strict";
|
|
19832
|
+
init_theme();
|
|
19894
19833
|
init_home_theme();
|
|
19895
19834
|
init_version();
|
|
19896
19835
|
init_use_terminal_width();
|
|
@@ -19931,7 +19870,7 @@ function ImportScreen({ exitCode, onDone }) {
|
|
|
19931
19870
|
var init_PageContainer = __esm({
|
|
19932
19871
|
"packages/experience-design-system-cli/src/tui/import/PageContainer.tsx"() {
|
|
19933
19872
|
"use strict";
|
|
19934
|
-
|
|
19873
|
+
init_theme();
|
|
19935
19874
|
}
|
|
19936
19875
|
});
|
|
19937
19876
|
|
|
@@ -19981,20 +19920,19 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
|
19981
19920
|
if (path5) onContinue(path5);
|
|
19982
19921
|
};
|
|
19983
19922
|
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
19984
|
-
/* @__PURE__ */ jsx4(Text4, { bold: true, color: PALETTE.success, children: "
|
|
19985
|
-
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: "I'll walk you through 5 steps to get your components into Contentful ExO." }),
|
|
19923
|
+
/* @__PURE__ */ jsx4(Text4, { bold: true, color: PALETTE.success, children: "Let's import your design system into Contentful." }),
|
|
19986
19924
|
/* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
|
|
19987
|
-
/* @__PURE__ */ jsx4(Text4, {
|
|
19925
|
+
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: RULE }),
|
|
19988
19926
|
OVERVIEW.map((item) => /* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
|
|
19989
19927
|
/* @__PURE__ */ jsx4(Text4, { bold: true, children: item.label }),
|
|
19990
19928
|
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: item.description })
|
|
19991
19929
|
] }, item.label)),
|
|
19992
|
-
/* @__PURE__ */ jsx4(Text4, {
|
|
19930
|
+
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: RULE })
|
|
19993
19931
|
] }),
|
|
19994
19932
|
/* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, children: [
|
|
19995
19933
|
/* @__PURE__ */ jsx4(Text4, { children: "Where is your component library?" }),
|
|
19996
|
-
/* @__PURE__ */ jsxs3(Box3, {
|
|
19997
|
-
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.
|
|
19934
|
+
/* @__PURE__ */ jsxs3(Box3, { children: [
|
|
19935
|
+
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.text, children: "?" }),
|
|
19998
19936
|
/* @__PURE__ */ jsx4(Text4, { children: "Project path:" }),
|
|
19999
19937
|
/* @__PURE__ */ jsx4(TextInput, { value: projectPath, onChange: setProjectPath, onSubmit: submit })
|
|
20000
19938
|
] })
|
|
@@ -20011,7 +19949,7 @@ var RULE, OVERVIEW;
|
|
|
20011
19949
|
var init_screen = __esm({
|
|
20012
19950
|
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx"() {
|
|
20013
19951
|
"use strict";
|
|
20014
|
-
|
|
19952
|
+
init_theme();
|
|
20015
19953
|
init_controls();
|
|
20016
19954
|
init_logic();
|
|
20017
19955
|
RULE = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
|
|
@@ -20160,7 +20098,7 @@ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
|
|
|
20160
20098
|
var init_screen2 = __esm({
|
|
20161
20099
|
"packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx"() {
|
|
20162
20100
|
"use strict";
|
|
20163
|
-
|
|
20101
|
+
init_theme();
|
|
20164
20102
|
init_controls2();
|
|
20165
20103
|
init_logic2();
|
|
20166
20104
|
init_validate_path();
|
|
@@ -20304,7 +20242,7 @@ import { useEffect as useEffect3, useMemo, useState as useState5 } from "react";
|
|
|
20304
20242
|
import { Box as Box5, Text as Text6 } from "ink";
|
|
20305
20243
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
20306
20244
|
function Row({ row }) {
|
|
20307
|
-
return /* @__PURE__ */ jsxs5(Text6, { color: row.tone === "accent" ? PALETTE.accent :
|
|
20245
|
+
return /* @__PURE__ */ jsxs5(Text6, { color: row.tone === "accent" ? PALETTE.accent : row.tone === "muted" ? PALETTE.muted : void 0, children: [
|
|
20308
20246
|
" \u2022 ",
|
|
20309
20247
|
String(row.count).padStart(3),
|
|
20310
20248
|
" ",
|
|
@@ -20318,7 +20256,7 @@ function Failure({ scan, path: path5 }) {
|
|
|
20318
20256
|
"\u2717 ",
|
|
20319
20257
|
headline
|
|
20320
20258
|
] }),
|
|
20321
|
-
hints.map((hint) => /* @__PURE__ */ jsx6(Text6, {
|
|
20259
|
+
hints.map((hint) => /* @__PURE__ */ jsx6(Text6, { color: PALETTE.muted, children: hint }, hint))
|
|
20322
20260
|
] });
|
|
20323
20261
|
}
|
|
20324
20262
|
function Summary({ scan, path: path5 }) {
|
|
@@ -20363,14 +20301,14 @@ function PathValidationScreen({
|
|
|
20363
20301
|
onBack
|
|
20364
20302
|
});
|
|
20365
20303
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
20366
|
-
scan === void 0 && /* @__PURE__ */ jsxs5(Text6, {
|
|
20304
|
+
scan === void 0 && /* @__PURE__ */ jsxs5(Text6, { color: PALETTE.muted, children: [
|
|
20367
20305
|
"Scanning ",
|
|
20368
20306
|
/* @__PURE__ */ jsx6(Text6, { bold: true, children: resolvedPath }),
|
|
20369
20307
|
"..."
|
|
20370
20308
|
] }),
|
|
20371
20309
|
scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path: resolvedPath }),
|
|
20372
20310
|
scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path: resolvedPath }),
|
|
20373
|
-
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, gap: 3, children: controlsFor(phase).map((control) => /* @__PURE__ */ jsxs5(Text6, {
|
|
20311
|
+
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, gap: 3, children: controlsFor(phase).map((control) => /* @__PURE__ */ jsxs5(Text6, { color: PALETTE.muted, children: [
|
|
20374
20312
|
"[",
|
|
20375
20313
|
control.keys,
|
|
20376
20314
|
"] ",
|
|
@@ -20381,7 +20319,7 @@ function PathValidationScreen({
|
|
|
20381
20319
|
var init_screen3 = __esm({
|
|
20382
20320
|
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx"() {
|
|
20383
20321
|
"use strict";
|
|
20384
|
-
|
|
20322
|
+
init_theme();
|
|
20385
20323
|
init_resolve_user_path();
|
|
20386
20324
|
init_controls3();
|
|
20387
20325
|
init_scan_files();
|
|
@@ -20549,8 +20487,8 @@ function CredentialsScreen({
|
|
|
20549
20487
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Contentful credentials" }),
|
|
20550
20488
|
/* @__PURE__ */ jsx7(Text7, { children: prefilled ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into." }),
|
|
20551
20489
|
!prefilled && /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
20552
|
-
/* @__PURE__ */ jsx7(Text7, {
|
|
20553
|
-
/* @__PURE__ */ jsx7(Text7, {
|
|
20490
|
+
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "We use it to check what components already exist and to push your import. If you skip, files are saved locally and nothing is pushed." }),
|
|
20491
|
+
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Tip: save these under Settings \u2192 Configuration so they pre-fill here." })
|
|
20554
20492
|
] })
|
|
20555
20493
|
] }),
|
|
20556
20494
|
/* @__PURE__ */ jsx7(Box6, { flexDirection: "column", children: FIELDS.map((field) => /* @__PURE__ */ jsxs6(Box6, { gap: 1, children: [
|
|
@@ -20571,14 +20509,14 @@ function CredentialsScreen({
|
|
|
20571
20509
|
}
|
|
20572
20510
|
)
|
|
20573
20511
|
] }, field)) }),
|
|
20574
|
-
active === "host" && /* @__PURE__ */ jsx7(Text7, {
|
|
20512
|
+
active === "host" && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com" }),
|
|
20575
20513
|
error && /* @__PURE__ */ jsxs6(Text7, { color: PALETTE.error, children: [
|
|
20576
20514
|
"\u2717 ",
|
|
20577
20515
|
error
|
|
20578
20516
|
] }),
|
|
20579
20517
|
validating && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Validating credentials..." }),
|
|
20580
|
-
!validating && !error && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsx7(Text7, {
|
|
20581
|
-
/* @__PURE__ */ jsx7(Box6, { marginTop: 1, gap: 3, children: CREDENTIALS_CONTROLS.map((control) => /* @__PURE__ */ jsxs6(Text7, {
|
|
20518
|
+
!validating && !error && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Changed values are saved after they validate." }),
|
|
20519
|
+
/* @__PURE__ */ jsx7(Box6, { marginTop: 1, gap: 3, children: CREDENTIALS_CONTROLS.map((control) => /* @__PURE__ */ jsxs6(Text7, { color: PALETTE.muted, children: [
|
|
20582
20520
|
"[",
|
|
20583
20521
|
control.keys,
|
|
20584
20522
|
"] ",
|
|
@@ -20590,7 +20528,7 @@ var LABELS;
|
|
|
20590
20528
|
var init_screen4 = __esm({
|
|
20591
20529
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx"() {
|
|
20592
20530
|
"use strict";
|
|
20593
|
-
|
|
20531
|
+
init_theme();
|
|
20594
20532
|
init_controls4();
|
|
20595
20533
|
init_src4();
|
|
20596
20534
|
init_logic4();
|
|
@@ -20666,7 +20604,7 @@ function ErrorStep({
|
|
|
20666
20604
|
" failed"
|
|
20667
20605
|
] }),
|
|
20668
20606
|
/* @__PURE__ */ jsx8(Text8, { color: PALETTE.error, children: message }),
|
|
20669
|
-
/* @__PURE__ */ jsx8(Box7, { marginTop: 1, gap: 3, children: controls.map((control) => /* @__PURE__ */ jsxs7(Text8, {
|
|
20607
|
+
/* @__PURE__ */ jsx8(Box7, { marginTop: 1, gap: 3, children: controls.map((control) => /* @__PURE__ */ jsxs7(Text8, { color: PALETTE.muted, children: [
|
|
20670
20608
|
"[",
|
|
20671
20609
|
control.keys,
|
|
20672
20610
|
"] ",
|
|
@@ -20677,7 +20615,7 @@ function ErrorStep({
|
|
|
20677
20615
|
var init_error_step = __esm({
|
|
20678
20616
|
"packages/experience-design-system-cli/src/tui/import/shared/error-step/error-step.tsx"() {
|
|
20679
20617
|
"use strict";
|
|
20680
|
-
|
|
20618
|
+
init_theme();
|
|
20681
20619
|
init_controls5();
|
|
20682
20620
|
init_logic5();
|
|
20683
20621
|
}
|
|
@@ -20746,7 +20684,7 @@ function GateStep({
|
|
|
20746
20684
|
] }),
|
|
20747
20685
|
summary && /* @__PURE__ */ jsx9(Text9, { color: PALETTE.muted, children: summary }),
|
|
20748
20686
|
context && /* @__PURE__ */ jsx9(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx9(Text9, { children: context }) }),
|
|
20749
|
-
/* @__PURE__ */ jsx9(Box8, { marginTop: 1, gap: 3, children: gateControls(continueLabel, skipLabel2, onSkip !== void 0).map((control) => /* @__PURE__ */ jsxs8(Text9, {
|
|
20687
|
+
/* @__PURE__ */ jsx9(Box8, { marginTop: 1, gap: 3, children: gateControls(continueLabel, skipLabel2, onSkip !== void 0).map((control) => /* @__PURE__ */ jsxs8(Text9, { color: PALETTE.muted, children: [
|
|
20750
20688
|
"[",
|
|
20751
20689
|
control.keys,
|
|
20752
20690
|
"] ",
|
|
@@ -20757,7 +20695,7 @@ function GateStep({
|
|
|
20757
20695
|
var init_gate_step = __esm({
|
|
20758
20696
|
"packages/experience-design-system-cli/src/tui/import/shared/gate-step/gate-step.tsx"() {
|
|
20759
20697
|
"use strict";
|
|
20760
|
-
|
|
20698
|
+
init_theme();
|
|
20761
20699
|
init_controls6();
|
|
20762
20700
|
init_logic6();
|
|
20763
20701
|
}
|
|
@@ -20785,14 +20723,15 @@ var init_logic7 = __esm({
|
|
|
20785
20723
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/theme.ts
|
|
20786
20724
|
import { defaultTheme, extendTheme } from "@inkjs/ui";
|
|
20787
20725
|
var PROGRESS_THEME;
|
|
20788
|
-
var
|
|
20726
|
+
var init_theme2 = __esm({
|
|
20789
20727
|
"packages/experience-design-system-cli/src/tui/import/shared/running-step/theme.ts"() {
|
|
20790
20728
|
"use strict";
|
|
20729
|
+
init_theme();
|
|
20791
20730
|
PROGRESS_THEME = extendTheme(defaultTheme, {
|
|
20792
20731
|
components: {
|
|
20793
20732
|
ProgressBar: {
|
|
20794
20733
|
styles: {
|
|
20795
|
-
completed: () => ({ color:
|
|
20734
|
+
completed: () => ({ color: PALETTE.accent })
|
|
20796
20735
|
}
|
|
20797
20736
|
}
|
|
20798
20737
|
}
|
|
@@ -20850,9 +20789,9 @@ function RunningStep({
|
|
|
20850
20789
|
const elapsed = useElapsed();
|
|
20851
20790
|
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
20852
20791
|
/* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
20853
|
-
/* @__PURE__ */ jsx10(Text10, {
|
|
20792
|
+
/* @__PURE__ */ jsx10(Text10, { color: PALETTE.muted, children: RULE2 }),
|
|
20854
20793
|
/* @__PURE__ */ jsx10(Text10, { bold: true, children: stepLabel(stepNumber, totalSteps, title) }),
|
|
20855
|
-
/* @__PURE__ */ jsx10(Text10, {
|
|
20794
|
+
/* @__PURE__ */ jsx10(Text10, { color: PALETTE.muted, children: RULE2 })
|
|
20856
20795
|
] }),
|
|
20857
20796
|
/* @__PURE__ */ jsx10(Text10, { children: description }),
|
|
20858
20797
|
/* @__PURE__ */ jsx10(Box9, { marginTop: 1, flexDirection: "column", gap: 1, children: lines.map((line, index) => /* @__PURE__ */ jsx10(Line, { line }, index)) }),
|
|
@@ -20866,9 +20805,9 @@ var RULE2;
|
|
|
20866
20805
|
var init_running_step = __esm({
|
|
20867
20806
|
"packages/experience-design-system-cli/src/tui/import/shared/running-step/running-step.tsx"() {
|
|
20868
20807
|
"use strict";
|
|
20869
|
-
init_home_theme();
|
|
20870
|
-
init_logic7();
|
|
20871
20808
|
init_theme();
|
|
20809
|
+
init_logic7();
|
|
20810
|
+
init_theme2();
|
|
20872
20811
|
init_use_elapsed();
|
|
20873
20812
|
RULE2 = "\u2500".repeat(40);
|
|
20874
20813
|
}
|
|
@@ -21415,10 +21354,10 @@ var init_use_extraction = __esm({
|
|
|
21415
21354
|
|
|
21416
21355
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/theme.ts
|
|
21417
21356
|
var PALETTE2;
|
|
21418
|
-
var
|
|
21357
|
+
var init_theme3 = __esm({
|
|
21419
21358
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/theme.ts"() {
|
|
21420
21359
|
"use strict";
|
|
21421
|
-
|
|
21360
|
+
init_theme();
|
|
21422
21361
|
PALETTE2 = {
|
|
21423
21362
|
info: PALETTE.accent,
|
|
21424
21363
|
success: PALETTE.success,
|
|
@@ -21530,7 +21469,7 @@ var TWO_COLUMN_MIN_WIDTH, SCOPE_GATE_MAIN_COLUMN_WIDTH, ACCEPTED_COMPONENTS_COLU
|
|
|
21530
21469
|
var init_columns = __esm({
|
|
21531
21470
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts"() {
|
|
21532
21471
|
"use strict";
|
|
21533
|
-
|
|
21472
|
+
init_theme3();
|
|
21534
21473
|
TWO_COLUMN_MIN_WIDTH = 100;
|
|
21535
21474
|
SCOPE_GATE_MAIN_COLUMN_WIDTH = 54;
|
|
21536
21475
|
ACCEPTED_COMPONENTS_COLUMN_WIDTH = 36;
|
|
@@ -21596,7 +21535,7 @@ function WindowedPanelHeader({
|
|
|
21596
21535
|
}) {
|
|
21597
21536
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
21598
21537
|
/* @__PURE__ */ jsx13(Text11, { bold: true, color: PALETTE2.info, inverse: focused, children: title }),
|
|
21599
|
-
/* @__PURE__ */ jsx13(Text11, {
|
|
21538
|
+
/* @__PURE__ */ jsx13(Text11, { color: PALETTE2.muted, children: "\u2500".repeat(Math.max(0, width - 2)) })
|
|
21600
21539
|
] });
|
|
21601
21540
|
}
|
|
21602
21541
|
function formatWindowIndicator(direction, count) {
|
|
@@ -21610,7 +21549,7 @@ var MIN_TERMINAL_PANEL_HEIGHT;
|
|
|
21610
21549
|
var init_windowed_panel = __esm({
|
|
21611
21550
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx"() {
|
|
21612
21551
|
"use strict";
|
|
21613
|
-
|
|
21552
|
+
init_theme3();
|
|
21614
21553
|
MIN_TERMINAL_PANEL_HEIGHT = 5;
|
|
21615
21554
|
}
|
|
21616
21555
|
});
|
|
@@ -21635,7 +21574,7 @@ function AddedColumn(props) {
|
|
|
21635
21574
|
const showSeparator = firstNonCycleIdx > 0 && i === firstNonCycleIdx;
|
|
21636
21575
|
const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
|
|
21637
21576
|
return /* @__PURE__ */ jsxs11(React6.Fragment, { children: [
|
|
21638
|
-
showSeparator && /* @__PURE__ */ jsx14(Text12, {
|
|
21577
|
+
showSeparator && /* @__PURE__ */ jsx14(Text12, { color: PALETTE2.muted, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
21639
21578
|
/* @__PURE__ */ jsxs11(Box11, { children: [
|
|
21640
21579
|
isCursor ? /* @__PURE__ */ jsx14(Text12, { color: PALETTE2.info, bold: true, children: figures.pointer }) : /* @__PURE__ */ jsx14(Text12, { children: " " }),
|
|
21641
21580
|
reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx14(Text12, { color: PALETTE2.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx14(Text12, { children: " " })),
|
|
@@ -21661,7 +21600,7 @@ var init_added_column = __esm({
|
|
|
21661
21600
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx"() {
|
|
21662
21601
|
"use strict";
|
|
21663
21602
|
init_columns();
|
|
21664
|
-
|
|
21603
|
+
init_theme3();
|
|
21665
21604
|
init_windowed_panel();
|
|
21666
21605
|
}
|
|
21667
21606
|
});
|
|
@@ -21696,7 +21635,7 @@ function CyclesPanel({ cycles, cursor }) {
|
|
|
21696
21635
|
var init_cycles_panel = __esm({
|
|
21697
21636
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx"() {
|
|
21698
21637
|
"use strict";
|
|
21699
|
-
|
|
21638
|
+
init_theme3();
|
|
21700
21639
|
}
|
|
21701
21640
|
});
|
|
21702
21641
|
|
|
@@ -21714,7 +21653,7 @@ function RejectPrompt({ pending }) {
|
|
|
21714
21653
|
var init_reject_prompt = __esm({
|
|
21715
21654
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx"() {
|
|
21716
21655
|
"use strict";
|
|
21717
|
-
|
|
21656
|
+
init_theme3();
|
|
21718
21657
|
}
|
|
21719
21658
|
});
|
|
21720
21659
|
|
|
@@ -21730,7 +21669,7 @@ function legendEntry(keyBracket, label, active = false) {
|
|
|
21730
21669
|
var init_LegendEntry = __esm({
|
|
21731
21670
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/LegendEntry.tsx"() {
|
|
21732
21671
|
"use strict";
|
|
21733
|
-
|
|
21672
|
+
init_theme3();
|
|
21734
21673
|
}
|
|
21735
21674
|
});
|
|
21736
21675
|
|
|
@@ -21751,7 +21690,7 @@ function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
|
21751
21690
|
var init_CompactControlBar = __esm({
|
|
21752
21691
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.tsx"() {
|
|
21753
21692
|
"use strict";
|
|
21754
|
-
|
|
21693
|
+
init_theme3();
|
|
21755
21694
|
init_LegendEntry();
|
|
21756
21695
|
}
|
|
21757
21696
|
});
|
|
@@ -21790,7 +21729,7 @@ function CounterStrip(props) {
|
|
|
21790
21729
|
var init_CounterStrip = __esm({
|
|
21791
21730
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx"() {
|
|
21792
21731
|
"use strict";
|
|
21793
|
-
|
|
21732
|
+
init_theme3();
|
|
21794
21733
|
}
|
|
21795
21734
|
});
|
|
21796
21735
|
|
|
@@ -21855,7 +21794,7 @@ var DEFAULT_MAX_ROWS;
|
|
|
21855
21794
|
var init_GotoBanner = __esm({
|
|
21856
21795
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx"() {
|
|
21857
21796
|
"use strict";
|
|
21858
|
-
|
|
21797
|
+
init_theme3();
|
|
21859
21798
|
DEFAULT_MAX_ROWS = 15;
|
|
21860
21799
|
}
|
|
21861
21800
|
});
|
|
@@ -22234,7 +22173,7 @@ function PreviewBadge({
|
|
|
22234
22173
|
var init_badge = __esm({
|
|
22235
22174
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/badge.tsx"() {
|
|
22236
22175
|
"use strict";
|
|
22237
|
-
|
|
22176
|
+
init_theme3();
|
|
22238
22177
|
}
|
|
22239
22178
|
});
|
|
22240
22179
|
|
|
@@ -22729,7 +22668,7 @@ var init_GroupedSidebar = __esm({
|
|
|
22729
22668
|
"use strict";
|
|
22730
22669
|
init_composite_closure();
|
|
22731
22670
|
init_badge();
|
|
22732
|
-
|
|
22671
|
+
init_theme3();
|
|
22733
22672
|
init_windowed_panel();
|
|
22734
22673
|
GLYPH_EXPAND_COLLAPSED = "\u25B8";
|
|
22735
22674
|
GLYPH_EXPAND_EXPANDED = "\u25BE";
|
|
@@ -23024,7 +22963,7 @@ function SearchMatchSummary({
|
|
|
23024
22963
|
var init_SearchMatchSummary = __esm({
|
|
23025
22964
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx"() {
|
|
23026
22965
|
"use strict";
|
|
23027
|
-
|
|
22966
|
+
init_theme3();
|
|
23028
22967
|
init_sidebar_input();
|
|
23029
22968
|
}
|
|
23030
22969
|
});
|
|
@@ -24392,7 +24331,7 @@ var init_screen7 = __esm({
|
|
|
24392
24331
|
init_HelpOverlay();
|
|
24393
24332
|
init_SearchMatchSummary();
|
|
24394
24333
|
init_sidebar_help();
|
|
24395
|
-
|
|
24334
|
+
init_theme3();
|
|
24396
24335
|
init_use_scope_gate();
|
|
24397
24336
|
HELP_SECTIONS = [
|
|
24398
24337
|
{
|
|
@@ -25280,24 +25219,6 @@ var init_screen9 = __esm({
|
|
|
25280
25219
|
}
|
|
25281
25220
|
});
|
|
25282
25221
|
|
|
25283
|
-
// packages/experience-design-system-cli/src/tui/import/steps/09-review/theme.ts
|
|
25284
|
-
var PALETTE3;
|
|
25285
|
-
var init_theme3 = __esm({
|
|
25286
|
-
"packages/experience-design-system-cli/src/tui/import/steps/09-review/theme.ts"() {
|
|
25287
|
-
"use strict";
|
|
25288
|
-
init_home_theme();
|
|
25289
|
-
PALETTE3 = {
|
|
25290
|
-
info: PALETTE.accent,
|
|
25291
|
-
success: PALETTE.success,
|
|
25292
|
-
error: PALETTE.error,
|
|
25293
|
-
warning: PALETTE.warning,
|
|
25294
|
-
muted: PALETTE.muted,
|
|
25295
|
-
border: PALETTE.border,
|
|
25296
|
-
inverse: "#FFFFFF"
|
|
25297
|
-
};
|
|
25298
|
-
}
|
|
25299
|
-
});
|
|
25300
|
-
|
|
25301
25222
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
25302
25223
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
25303
25224
|
if (!selected) return "";
|
|
@@ -25789,13 +25710,13 @@ function serializeState(state2, originalJson) {
|
|
|
25789
25710
|
}
|
|
25790
25711
|
function Picker({ value, active }) {
|
|
25791
25712
|
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
25792
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
25793
|
-
/* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
25794
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
25713
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u2039" }),
|
|
25714
|
+
/* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
25715
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u203A" })
|
|
25795
25716
|
] });
|
|
25796
25717
|
}
|
|
25797
25718
|
function Toggle({ value, active }) {
|
|
25798
|
-
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
25719
|
+
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
25799
25720
|
}
|
|
25800
25721
|
function InlinePropField({
|
|
25801
25722
|
label,
|
|
@@ -25805,7 +25726,7 @@ function InlinePropField({
|
|
|
25805
25726
|
width
|
|
25806
25727
|
}) {
|
|
25807
25728
|
return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
25808
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25729
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
25809
25730
|
focused ? "\u203A " : " ",
|
|
25810
25731
|
label
|
|
25811
25732
|
] }),
|
|
@@ -25826,7 +25747,7 @@ function DefaultValueRow({
|
|
|
25826
25747
|
focused
|
|
25827
25748
|
}) {
|
|
25828
25749
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
25829
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25750
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25830
25751
|
focused ? "\u203A " : " ",
|
|
25831
25752
|
"default:"
|
|
25832
25753
|
] }),
|
|
@@ -25841,9 +25762,9 @@ function RowLabel({
|
|
|
25841
25762
|
return /* @__PURE__ */ jsxs22(
|
|
25842
25763
|
Text23,
|
|
25843
25764
|
{
|
|
25844
|
-
color: selected ?
|
|
25765
|
+
color: selected ? "#FFFFFF" : PALETTE.accent,
|
|
25845
25766
|
bold: selected,
|
|
25846
|
-
backgroundColor: selected ?
|
|
25767
|
+
backgroundColor: selected ? PALETTE.accent : void 0,
|
|
25847
25768
|
wrap: "truncate-end",
|
|
25848
25769
|
children: [
|
|
25849
25770
|
" ",
|
|
@@ -25859,7 +25780,7 @@ function ValueInputRow({
|
|
|
25859
25780
|
cursorVisible
|
|
25860
25781
|
}) {
|
|
25861
25782
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
|
|
25862
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
25783
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
25863
25784
|
/* @__PURE__ */ jsx27(Text23, { children: valueText }),
|
|
25864
25785
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
|
|
25865
25786
|
] });
|
|
@@ -25876,7 +25797,7 @@ function EditableListItem({
|
|
|
25876
25797
|
if (isBeingEdited) {
|
|
25877
25798
|
return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
25878
25799
|
}
|
|
25879
|
-
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
25800
|
+
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.accent : void 0, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
|
|
25880
25801
|
}
|
|
25881
25802
|
function EditableValueList({
|
|
25882
25803
|
values,
|
|
@@ -25890,7 +25811,7 @@ function EditableValueList({
|
|
|
25890
25811
|
showAddInput
|
|
25891
25812
|
}) {
|
|
25892
25813
|
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
25893
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
25814
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx27(Box21, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: emptyMessage }) })),
|
|
25894
25815
|
values.map((value, index) => /* @__PURE__ */ jsx27(
|
|
25895
25816
|
EditableListItem,
|
|
25896
25817
|
{
|
|
@@ -25916,11 +25837,11 @@ function DefaultSubRow({
|
|
|
25916
25837
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
25917
25838
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
25918
25839
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25919
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25840
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25920
25841
|
focused ? "\u203A " : " ",
|
|
25921
25842
|
"default:"
|
|
25922
25843
|
] }),
|
|
25923
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
25844
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
|
|
25924
25845
|
] });
|
|
25925
25846
|
}
|
|
25926
25847
|
if (prop.type === "boolean") {
|
|
@@ -25930,11 +25851,11 @@ function DefaultSubRow({
|
|
|
25930
25851
|
if (prop.type === "enum") {
|
|
25931
25852
|
if (prop.values.length === 0) {
|
|
25932
25853
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25933
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25854
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25934
25855
|
focused ? "\u203A " : " ",
|
|
25935
25856
|
"default:"
|
|
25936
25857
|
] }),
|
|
25937
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
25858
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
|
|
25938
25859
|
] });
|
|
25939
25860
|
}
|
|
25940
25861
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
@@ -25943,11 +25864,11 @@ function DefaultSubRow({
|
|
|
25943
25864
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
25944
25865
|
if (active) {
|
|
25945
25866
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
|
|
25946
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25867
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25947
25868
|
focused ? "\u203A " : " ",
|
|
25948
25869
|
"default:"
|
|
25949
25870
|
] }),
|
|
25950
|
-
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor:
|
|
25871
|
+
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
25951
25872
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
|
|
25952
25873
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
25953
25874
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
|
|
@@ -25955,11 +25876,11 @@ function DefaultSubRow({
|
|
|
25955
25876
|
] });
|
|
25956
25877
|
}
|
|
25957
25878
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25958
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25879
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25959
25880
|
focused ? "\u203A " : " ",
|
|
25960
25881
|
"default:"
|
|
25961
25882
|
] }),
|
|
25962
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 :
|
|
25883
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
|
|
25963
25884
|
] });
|
|
25964
25885
|
}
|
|
25965
25886
|
function DescriptionField({
|
|
@@ -25975,15 +25896,15 @@ function DescriptionField({
|
|
|
25975
25896
|
}) {
|
|
25976
25897
|
if (compact) {
|
|
25977
25898
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25978
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25899
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25979
25900
|
focused ? "\u203A " : " ",
|
|
25980
25901
|
label
|
|
25981
25902
|
] }),
|
|
25982
|
-
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 :
|
|
25903
|
+
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
25983
25904
|
] });
|
|
25984
25905
|
}
|
|
25985
25906
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
25986
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25907
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25987
25908
|
focused ? "\u203A " : " ",
|
|
25988
25909
|
label
|
|
25989
25910
|
] }),
|
|
@@ -26047,7 +25968,7 @@ function PropRow({
|
|
|
26047
25968
|
] }),
|
|
26048
25969
|
prop.type === "token" && /* @__PURE__ */ jsx27(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx27(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
26049
25970
|
prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
26050
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ?
|
|
25971
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
26051
25972
|
activeField === "values" ? "\u203A " : " ",
|
|
26052
25973
|
"values:"
|
|
26053
25974
|
] }),
|
|
@@ -26068,27 +25989,27 @@ function PropRow({
|
|
|
26068
25989
|
}
|
|
26069
25990
|
),
|
|
26070
25991
|
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
26071
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ?
|
|
25992
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
26072
25993
|
activeField === "allowed" ? "\u203A " : " ",
|
|
26073
25994
|
"allowed:"
|
|
26074
25995
|
] }),
|
|
26075
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor:
|
|
25996
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx27(Text23, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx27(
|
|
26076
25997
|
Text23,
|
|
26077
25998
|
{
|
|
26078
|
-
color: activeField !== "allowed" && prop.allowed.length === 0 ?
|
|
25999
|
+
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
26079
26000
|
wrap: "wrap",
|
|
26080
26001
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
26081
26002
|
}
|
|
26082
26003
|
)
|
|
26083
26004
|
] }),
|
|
26084
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
26005
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: (() => {
|
|
26085
26006
|
const max = Math.max(8, width - 8);
|
|
26086
26007
|
const text = `~ ${rationale}`;
|
|
26087
26008
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
26088
26009
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
26089
26010
|
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
|
|
26090
26011
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
26091
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26012
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "values:" }),
|
|
26092
26013
|
activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
26093
26014
|
] }),
|
|
26094
26015
|
/* @__PURE__ */ jsx27(
|
|
@@ -26149,7 +26070,7 @@ function SlotRow({
|
|
|
26149
26070
|
/* @__PURE__ */ jsxs22(
|
|
26150
26071
|
Text23,
|
|
26151
26072
|
{
|
|
26152
|
-
color: activeField === "allowedComponents" ?
|
|
26073
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
26153
26074
|
bold: activeField === "allowedComponents",
|
|
26154
26075
|
children: [
|
|
26155
26076
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -26157,14 +26078,14 @@ function SlotRow({
|
|
|
26157
26078
|
]
|
|
26158
26079
|
}
|
|
26159
26080
|
),
|
|
26160
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
26081
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
26161
26082
|
] }),
|
|
26162
26083
|
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
26163
26084
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
26164
26085
|
/* @__PURE__ */ jsxs22(
|
|
26165
26086
|
Text23,
|
|
26166
26087
|
{
|
|
26167
|
-
color: activeField === "allowedComponents" ?
|
|
26088
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
26168
26089
|
bold: activeField === "allowedComponents",
|
|
26169
26090
|
children: [
|
|
26170
26091
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -26172,7 +26093,7 @@ function SlotRow({
|
|
|
26172
26093
|
]
|
|
26173
26094
|
}
|
|
26174
26095
|
),
|
|
26175
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color:
|
|
26096
|
+
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: slot.allowedComponents.length > 0 ? " [a] add [e] edit [r] remove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
26176
26097
|
] }),
|
|
26177
26098
|
/* @__PURE__ */ jsx27(
|
|
26178
26099
|
EditableValueList,
|
|
@@ -26188,21 +26109,21 @@ function SlotRow({
|
|
|
26188
26109
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
26189
26110
|
}
|
|
26190
26111
|
),
|
|
26191
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
26112
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
26192
26113
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
26193
26114
|
if (filtered.length === 0) {
|
|
26194
|
-
return /* @__PURE__ */ jsx27(Text23, { color:
|
|
26115
|
+
return /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
26195
26116
|
}
|
|
26196
26117
|
const cursor = pickerCursor % filtered.length;
|
|
26197
26118
|
const MAX_VISIBLE = 5;
|
|
26198
26119
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
26199
26120
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
26200
26121
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
26201
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26122
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
26202
26123
|
slice.map((name, i) => {
|
|
26203
26124
|
const absIdx = start + i;
|
|
26204
26125
|
const isCursor = absIdx === cursor;
|
|
26205
|
-
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ?
|
|
26126
|
+
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
26206
26127
|
})
|
|
26207
26128
|
] });
|
|
26208
26129
|
})() })
|
|
@@ -27030,18 +26951,18 @@ function FieldEditor({
|
|
|
27030
26951
|
});
|
|
27031
26952
|
const innerWidth = Math.max(1, width - 2);
|
|
27032
26953
|
if (parseErr) {
|
|
27033
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
27034
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27035
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27036
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26954
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
26955
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
26956
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: parseErr }),
|
|
26957
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
27037
26958
|
] });
|
|
27038
26959
|
}
|
|
27039
26960
|
if (props.length === 0 && slots.length === 0) {
|
|
27040
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
27041
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27042
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27043
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27044
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26961
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
26962
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
26963
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
26964
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
26965
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
27045
26966
|
] });
|
|
27046
26967
|
}
|
|
27047
26968
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -27170,7 +27091,7 @@ function FieldEditor({
|
|
|
27170
27091
|
const renderRow = (row, index) => {
|
|
27171
27092
|
const key = rowKey(row, index);
|
|
27172
27093
|
if (row.kind === "header") {
|
|
27173
|
-
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27094
|
+
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
27174
27095
|
}
|
|
27175
27096
|
if (row.kind === "component-description") {
|
|
27176
27097
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -27252,9 +27173,9 @@ function FieldEditor({
|
|
|
27252
27173
|
...fixedHeight ? { height } : { minHeight: height },
|
|
27253
27174
|
clipOverflow: fixedHeight,
|
|
27254
27175
|
borderStyle: "single",
|
|
27255
|
-
borderColor: hasEmptyProperties ?
|
|
27176
|
+
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.accent : PALETTE.border,
|
|
27256
27177
|
children: [
|
|
27257
|
-
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27178
|
+
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
27258
27179
|
header,
|
|
27259
27180
|
/* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
|
|
27260
27181
|
PropRow,
|
|
@@ -27305,7 +27226,7 @@ function FieldEditor({
|
|
|
27305
27226
|
`visible-${key}`
|
|
27306
27227
|
);
|
|
27307
27228
|
}) }),
|
|
27308
|
-
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27229
|
+
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
27309
27230
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
27310
27231
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
27311
27232
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -27315,20 +27236,20 @@ function FieldEditor({
|
|
|
27315
27236
|
const headerPath = path5 ?? "<unknown source path>";
|
|
27316
27237
|
if (!start || !end2 || !src) {
|
|
27317
27238
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27318
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27319
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27239
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
27240
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
27320
27241
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
|
|
27321
27242
|
] });
|
|
27322
27243
|
}
|
|
27323
27244
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
27324
27245
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27325
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27326
|
-
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color:
|
|
27246
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
27247
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
27327
27248
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
|
|
27328
27249
|
] });
|
|
27329
27250
|
})(),
|
|
27330
|
-
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
27331
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27251
|
+
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
27252
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
27332
27253
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
27333
27254
|
/* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
|
|
27334
27255
|
/* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
|
|
@@ -27353,10 +27274,10 @@ function FieldEditor({
|
|
|
27353
27274
|
/* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
27354
27275
|
/* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
|
|
27355
27276
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
27356
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27277
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
27357
27278
|
] }),
|
|
27358
|
-
validationError && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27359
|
-
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
27279
|
+
validationError && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
27280
|
+
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: modeLabel }) })
|
|
27360
27281
|
]
|
|
27361
27282
|
}
|
|
27362
27283
|
);
|
|
@@ -27365,7 +27286,7 @@ var SLOT_FIELDS;
|
|
|
27365
27286
|
var init_FieldEditor = __esm({
|
|
27366
27287
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx"() {
|
|
27367
27288
|
"use strict";
|
|
27368
|
-
|
|
27289
|
+
init_theme();
|
|
27369
27290
|
init_src5();
|
|
27370
27291
|
init_useImmediateInput();
|
|
27371
27292
|
init_scroll_offset();
|
|
@@ -27420,21 +27341,21 @@ function RationaleLine({ line, active }) {
|
|
|
27420
27341
|
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
|
|
27421
27342
|
}
|
|
27422
27343
|
if (line.kind === "heading") {
|
|
27423
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ?
|
|
27344
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
27424
27345
|
}
|
|
27425
27346
|
if (line.kind === "label") {
|
|
27426
27347
|
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
27427
27348
|
line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
|
|
27428
|
-
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color :
|
|
27429
|
-
line.suffix && /* @__PURE__ */ jsx28(Text24, { color:
|
|
27349
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
27350
|
+
line.suffix && /* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: line.suffix })
|
|
27430
27351
|
] });
|
|
27431
27352
|
}
|
|
27432
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ?
|
|
27353
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
27433
27354
|
}
|
|
27434
27355
|
var init_RationaleLine = __esm({
|
|
27435
27356
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx"() {
|
|
27436
27357
|
"use strict";
|
|
27437
|
-
|
|
27358
|
+
init_theme();
|
|
27438
27359
|
}
|
|
27439
27360
|
});
|
|
27440
27361
|
|
|
@@ -27514,9 +27435,9 @@ function ComponentRationalePanel({
|
|
|
27514
27435
|
width,
|
|
27515
27436
|
height: height + 2,
|
|
27516
27437
|
borderStyle: "single",
|
|
27517
|
-
borderColor: active ?
|
|
27438
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27518
27439
|
children: [
|
|
27519
|
-
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 :
|
|
27440
|
+
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
27520
27441
|
visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
|
|
27521
27442
|
/* @__PURE__ */ jsx29(Box23, { children: overflowed ? /* @__PURE__ */ jsx29(Text25, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx29(Text25, { children: "[I/Esc] close" }) })
|
|
27522
27443
|
]
|
|
@@ -27527,7 +27448,7 @@ var PLACEHOLDER;
|
|
|
27527
27448
|
var init_ComponentRationalePanel = __esm({
|
|
27528
27449
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx"() {
|
|
27529
27450
|
"use strict";
|
|
27530
|
-
|
|
27451
|
+
init_theme();
|
|
27531
27452
|
init_wrap_text();
|
|
27532
27453
|
init_RationaleLine();
|
|
27533
27454
|
PLACEHOLDER = "(no rationale captured)";
|
|
@@ -27538,12 +27459,12 @@ var init_ComponentRationalePanel = __esm({
|
|
|
27538
27459
|
import { Text as Text26 } from "ink";
|
|
27539
27460
|
import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
|
|
27540
27461
|
function HighlightedLine({ parts }) {
|
|
27541
|
-
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ?
|
|
27462
|
+
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
|
|
27542
27463
|
}
|
|
27543
27464
|
var init_HighlightedLine = __esm({
|
|
27544
27465
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/HighlightedLine.tsx"() {
|
|
27545
27466
|
"use strict";
|
|
27546
|
-
|
|
27467
|
+
init_theme();
|
|
27547
27468
|
}
|
|
27548
27469
|
});
|
|
27549
27470
|
|
|
@@ -27564,10 +27485,10 @@ function ScrollablePanel({
|
|
|
27564
27485
|
const overflowed = totalLines > height;
|
|
27565
27486
|
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
27566
27487
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
27567
|
-
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 :
|
|
27488
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
27568
27489
|
overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
27569
27490
|
/* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
|
|
27570
|
-
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 :
|
|
27491
|
+
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
27571
27492
|
] })
|
|
27572
27493
|
] }),
|
|
27573
27494
|
children
|
|
@@ -27576,7 +27497,7 @@ function ScrollablePanel({
|
|
|
27576
27497
|
var init_ScrollablePanel = __esm({
|
|
27577
27498
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx"() {
|
|
27578
27499
|
"use strict";
|
|
27579
|
-
|
|
27500
|
+
init_theme();
|
|
27580
27501
|
}
|
|
27581
27502
|
});
|
|
27582
27503
|
|
|
@@ -27667,7 +27588,7 @@ function renderRationaleLines(rows, innerWidth) {
|
|
|
27667
27588
|
out.push({
|
|
27668
27589
|
kind: "label",
|
|
27669
27590
|
text: row.name,
|
|
27670
|
-
color:
|
|
27591
|
+
color: PALETTE.accent,
|
|
27671
27592
|
suffix: row.kind === "slot" ? " (slot)" : void 0
|
|
27672
27593
|
});
|
|
27673
27594
|
for (const line of wrapText(row.rationale, innerWidth)) {
|
|
@@ -27703,7 +27624,7 @@ function RationalePanel({
|
|
|
27703
27624
|
totalLines,
|
|
27704
27625
|
visibleStart,
|
|
27705
27626
|
visibleEnd,
|
|
27706
|
-
borderColor: active ?
|
|
27627
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27707
27628
|
children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
|
|
27708
27629
|
}
|
|
27709
27630
|
);
|
|
@@ -27711,7 +27632,7 @@ function RationalePanel({
|
|
|
27711
27632
|
var init_RationalePanel = __esm({
|
|
27712
27633
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationalePanel.tsx"() {
|
|
27713
27634
|
"use strict";
|
|
27714
|
-
|
|
27635
|
+
init_theme();
|
|
27715
27636
|
init_wrap_text();
|
|
27716
27637
|
init_RationaleLine();
|
|
27717
27638
|
init_ScrollablePanel();
|
|
@@ -27747,21 +27668,29 @@ function TokenReviewPanel({
|
|
|
27747
27668
|
width,
|
|
27748
27669
|
height: height + 2,
|
|
27749
27670
|
borderStyle: "single",
|
|
27750
|
-
borderColor: active ?
|
|
27671
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27751
27672
|
children: [
|
|
27752
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
27753
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27673
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
27674
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
27754
27675
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
27755
|
-
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
27676
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
27756
27677
|
visiblePaths.map((path5, i) => {
|
|
27757
27678
|
const pathIndex = scrollStart + i;
|
|
27758
27679
|
const checked = editSelection.has(path5);
|
|
27759
27680
|
const focused = pathIndex === editCursor;
|
|
27760
|
-
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
27681
|
+
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
27682
|
+
Text28,
|
|
27683
|
+
{
|
|
27684
|
+
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
27685
|
+
bold: focused,
|
|
27686
|
+
wrap: "truncate",
|
|
27687
|
+
children: ` [${checked ? "x" : " "}] ${path5}`
|
|
27688
|
+
}
|
|
27689
|
+
) }, path5);
|
|
27761
27690
|
}),
|
|
27762
27691
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
27763
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27764
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27692
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
27693
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
27765
27694
|
]
|
|
27766
27695
|
}
|
|
27767
27696
|
);
|
|
@@ -27773,16 +27702,16 @@ function TokenReviewPanel({
|
|
|
27773
27702
|
width,
|
|
27774
27703
|
height: height + 2,
|
|
27775
27704
|
borderStyle: "single",
|
|
27776
|
-
borderColor: active ?
|
|
27705
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27777
27706
|
children: [
|
|
27778
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
27779
|
-
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
27707
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
27708
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
27780
27709
|
suggestions.map((s, i) => {
|
|
27781
27710
|
const focused = i === selectedRow;
|
|
27782
27711
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
27783
|
-
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ?
|
|
27784
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27785
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27712
|
+
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
|
|
27713
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
27714
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
27786
27715
|
] }, s.propName);
|
|
27787
27716
|
}),
|
|
27788
27717
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
@@ -27794,7 +27723,7 @@ function TokenReviewPanel({
|
|
|
27794
27723
|
var init_TokenReviewPanel = __esm({
|
|
27795
27724
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx"() {
|
|
27796
27725
|
"use strict";
|
|
27797
|
-
|
|
27726
|
+
init_theme();
|
|
27798
27727
|
}
|
|
27799
27728
|
});
|
|
27800
27729
|
|
|
@@ -27874,9 +27803,9 @@ function ReviewDetailsPanel({
|
|
|
27874
27803
|
const sourceLineCount = Math.max(1, height - 4);
|
|
27875
27804
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
27876
27805
|
return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
27877
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
27878
|
-
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color:
|
|
27879
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
27806
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
27807
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, children: "(no source captured)" }),
|
|
27808
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
27880
27809
|
] });
|
|
27881
27810
|
}
|
|
27882
27811
|
if (panelOpen === "token-review") {
|
|
@@ -27918,7 +27847,7 @@ var init_review_details_panel = __esm({
|
|
|
27918
27847
|
init_RationalePanel();
|
|
27919
27848
|
init_TokenReviewPanel();
|
|
27920
27849
|
init_windowed_panel();
|
|
27921
|
-
|
|
27850
|
+
init_theme();
|
|
27922
27851
|
}
|
|
27923
27852
|
});
|
|
27924
27853
|
|
|
@@ -28045,17 +27974,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
28045
27974
|
hidden
|
|
28046
27975
|
}) {
|
|
28047
27976
|
if (hidden || count === 0) return null;
|
|
28048
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
27977
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
28049
27978
|
}
|
|
28050
27979
|
function ReviewNoSelection() {
|
|
28051
|
-
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
27980
|
+
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, children: "No component selected" }) });
|
|
28052
27981
|
}
|
|
28053
27982
|
function ReviewFinalizeError({
|
|
28054
27983
|
message,
|
|
28055
27984
|
hidden
|
|
28056
27985
|
}) {
|
|
28057
27986
|
if (hidden || !message) return null;
|
|
28058
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
27987
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
28059
27988
|
}
|
|
28060
27989
|
function ReviewPanelFooter({
|
|
28061
27990
|
reviewEditor,
|
|
@@ -28079,7 +28008,7 @@ function ReviewComponentTitle({
|
|
|
28079
28008
|
return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
28080
28009
|
/* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
28081
28010
|
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
28082
|
-
/* @__PURE__ */ jsxs28(Text30, { color:
|
|
28011
|
+
/* @__PURE__ */ jsxs28(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
28083
28012
|
propCount,
|
|
28084
28013
|
" prop",
|
|
28085
28014
|
propCount !== 1 ? "s" : "",
|
|
@@ -28135,8 +28064,8 @@ function ReviewComponentPanel({
|
|
|
28135
28064
|
)
|
|
28136
28065
|
}
|
|
28137
28066
|
) }),
|
|
28138
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ?
|
|
28139
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
28067
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
28068
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx37(
|
|
28140
28069
|
ReviewPanelFooter,
|
|
28141
28070
|
{
|
|
28142
28071
|
reviewEditor,
|
|
@@ -28151,7 +28080,7 @@ function ReviewComponentPanel({
|
|
|
28151
28080
|
var init_ReviewComponentPanel = __esm({
|
|
28152
28081
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx"() {
|
|
28153
28082
|
"use strict";
|
|
28154
|
-
|
|
28083
|
+
init_theme();
|
|
28155
28084
|
init_review_json_panel();
|
|
28156
28085
|
init_ReviewDetailsEditor();
|
|
28157
28086
|
init_windowed_panel();
|
|
@@ -28173,11 +28102,11 @@ function countReviewStatuses(entries) {
|
|
|
28173
28102
|
);
|
|
28174
28103
|
}
|
|
28175
28104
|
function ReviewLoadingState() {
|
|
28176
|
-
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color:
|
|
28105
|
+
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
28177
28106
|
}
|
|
28178
28107
|
function ReviewLoadError({ message }) {
|
|
28179
28108
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28180
|
-
/* @__PURE__ */ jsx38(Text31, { color:
|
|
28109
|
+
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.error, children: message }),
|
|
28181
28110
|
/* @__PURE__ */ jsx38(Text31, { children: " " }),
|
|
28182
28111
|
/* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
|
|
28183
28112
|
] });
|
|
@@ -28185,7 +28114,7 @@ function ReviewLoadError({ message }) {
|
|
|
28185
28114
|
var init_ReviewStatus = __esm({
|
|
28186
28115
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx"() {
|
|
28187
28116
|
"use strict";
|
|
28188
|
-
|
|
28117
|
+
init_theme();
|
|
28189
28118
|
}
|
|
28190
28119
|
});
|
|
28191
28120
|
|
|
@@ -28435,41 +28364,41 @@ function FinalizeDialog({
|
|
|
28435
28364
|
/* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
28436
28365
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
28437
28366
|
/* @__PURE__ */ jsxs30(Text32, { children: [
|
|
28438
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28367
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.success, children: [
|
|
28439
28368
|
accepted,
|
|
28440
28369
|
" accepted"
|
|
28441
28370
|
] }),
|
|
28442
28371
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
28443
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28372
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.error, children: [
|
|
28444
28373
|
rejected,
|
|
28445
28374
|
" rejected"
|
|
28446
28375
|
] }),
|
|
28447
28376
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
28448
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28377
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.muted, children: [
|
|
28449
28378
|
needsReview,
|
|
28450
28379
|
" unresolved"
|
|
28451
28380
|
] })
|
|
28452
28381
|
] }),
|
|
28453
28382
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
28454
28383
|
noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28455
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
28456
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
28384
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
28385
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
28457
28386
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28458
28387
|
] }),
|
|
28459
28388
|
!allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28460
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
28461
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
28389
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
28390
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
28462
28391
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28463
28392
|
] }),
|
|
28464
28393
|
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
|
|
28465
|
-
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color:
|
|
28394
|
+
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
28466
28395
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28467
28396
|
] }),
|
|
28468
28397
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28469
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
28470
|
-
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color:
|
|
28471
|
-
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color:
|
|
28472
|
-
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color:
|
|
28398
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
28399
|
+
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2191 more above" }),
|
|
28400
|
+
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
28401
|
+
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2193 more below" }),
|
|
28473
28402
|
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
|
|
28474
28403
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28475
28404
|
] }),
|
|
@@ -28482,7 +28411,7 @@ var FINALIZE_REMOVED_WINDOW;
|
|
|
28482
28411
|
var init_FinalizeDialog = __esm({
|
|
28483
28412
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx"() {
|
|
28484
28413
|
"use strict";
|
|
28485
|
-
|
|
28414
|
+
init_theme();
|
|
28486
28415
|
init_useImmediateInput();
|
|
28487
28416
|
init_removed_components_text();
|
|
28488
28417
|
FINALIZE_REMOVED_WINDOW = 6;
|
|
@@ -29010,8 +28939,8 @@ function ReviewStepDialogs({
|
|
|
29010
28939
|
}
|
|
29011
28940
|
function ReviewReloadDialog({ open }) {
|
|
29012
28941
|
if (!open) return null;
|
|
29013
|
-
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
29014
|
-
/* @__PURE__ */ jsx41(Text34, { bold: true, color:
|
|
28942
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
28943
|
+
/* @__PURE__ */ jsx41(Text34, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
29015
28944
|
/* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
|
|
29016
28945
|
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
29017
28946
|
/* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
|
|
@@ -29021,7 +28950,7 @@ function ReviewReloadDialog({ open }) {
|
|
|
29021
28950
|
var init_ReviewDialogs = __esm({
|
|
29022
28951
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx"() {
|
|
29023
28952
|
"use strict";
|
|
29024
|
-
|
|
28953
|
+
init_theme();
|
|
29025
28954
|
init_FinalizeDialog();
|
|
29026
28955
|
init_QuitDialog();
|
|
29027
28956
|
init_ReviewStatus();
|
|
@@ -29432,25 +29361,25 @@ function LivePreviewSummary({
|
|
|
29432
29361
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
29433
29362
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
29434
29363
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
29435
|
-
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
29436
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
29364
|
+
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
29365
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
29437
29366
|
if (!hasCounts) return null;
|
|
29438
29367
|
return /* @__PURE__ */ jsxs33(Box32, { children: [
|
|
29439
29368
|
/* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
|
|
29440
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29369
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
29441
29370
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29442
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29371
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
29443
29372
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29444
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29373
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `${counts.removed} removed` }),
|
|
29445
29374
|
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
|
|
29446
29375
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29447
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29376
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
29448
29377
|
] });
|
|
29449
29378
|
}
|
|
29450
29379
|
var init_LivePreviewSummary = __esm({
|
|
29451
29380
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx"() {
|
|
29452
29381
|
"use strict";
|
|
29453
|
-
|
|
29382
|
+
init_theme();
|
|
29454
29383
|
}
|
|
29455
29384
|
});
|
|
29456
29385
|
|
|
@@ -29499,10 +29428,10 @@ function CyclePathLine({
|
|
|
29499
29428
|
highlightComponents = false,
|
|
29500
29429
|
highlightLine = false
|
|
29501
29430
|
}) {
|
|
29502
|
-
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ?
|
|
29431
|
+
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
29503
29432
|
prefix,
|
|
29504
29433
|
segments.map(
|
|
29505
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
29434
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.accent, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: segment.text }, index) : /* @__PURE__ */ jsx43(Text36, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
|
|
29506
29435
|
)
|
|
29507
29436
|
] });
|
|
29508
29437
|
}
|
|
@@ -29514,9 +29443,9 @@ function CycleDetailPanel({
|
|
|
29514
29443
|
height
|
|
29515
29444
|
}) {
|
|
29516
29445
|
const lines = [
|
|
29517
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
29518
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29519
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29446
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
29447
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
29448
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
29520
29449
|
/* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
|
|
29521
29450
|
];
|
|
29522
29451
|
cycles.forEach((cycle, index) => {
|
|
@@ -29528,7 +29457,7 @@ function CycleDetailPanel({
|
|
|
29528
29457
|
);
|
|
29529
29458
|
if (cycle.suggestedBreak) {
|
|
29530
29459
|
lines.push(
|
|
29531
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29460
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
29532
29461
|
);
|
|
29533
29462
|
}
|
|
29534
29463
|
lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
|
|
@@ -29536,9 +29465,9 @@ function CycleDetailPanel({
|
|
|
29536
29465
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
29537
29466
|
const viewportHeight = Math.max(1, height - 3);
|
|
29538
29467
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
29539
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
29468
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
29540
29469
|
visible,
|
|
29541
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29470
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: footer })
|
|
29542
29471
|
] });
|
|
29543
29472
|
}
|
|
29544
29473
|
function BreakCyclePanel({
|
|
@@ -29549,14 +29478,14 @@ function BreakCyclePanel({
|
|
|
29549
29478
|
width,
|
|
29550
29479
|
height
|
|
29551
29480
|
}) {
|
|
29552
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
29553
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
29481
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
29482
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
29554
29483
|
cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
29555
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29484
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
29556
29485
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
29557
|
-
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
29486
|
+
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "remove slot edge:" }),
|
|
29558
29487
|
edges.map((edge, index) => /* @__PURE__ */ jsx43(Text36, { inverse: index === cursor, children: `${index === cursor ? figures7.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `${edge.fromComponent}-${edge.slotName}-${edge.toComponent}`)),
|
|
29559
|
-
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
29488
|
+
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx43(Text36, { children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
|
|
29560
29489
|
] });
|
|
29561
29490
|
}
|
|
29562
29491
|
function buildBreakingRows(breakingChanges) {
|
|
@@ -29602,7 +29531,7 @@ function deriveBreakingChanges(response) {
|
|
|
29602
29531
|
}
|
|
29603
29532
|
function GenerateReviewStep(props) {
|
|
29604
29533
|
if (!props.extractSessionId) {
|
|
29605
|
-
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color:
|
|
29534
|
+
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
29606
29535
|
}
|
|
29607
29536
|
return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
29608
29537
|
}
|
|
@@ -30519,8 +30448,8 @@ function GenerateReviewStepView({
|
|
|
30519
30448
|
}
|
|
30520
30449
|
),
|
|
30521
30450
|
/* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
30522
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30523
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
30451
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
30452
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
30524
30453
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
30525
30454
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
30526
30455
|
removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
|
|
@@ -30529,7 +30458,7 @@ function GenerateReviewStepView({
|
|
|
30529
30458
|
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
|
|
30530
30459
|
Text36,
|
|
30531
30460
|
{
|
|
30532
|
-
color:
|
|
30461
|
+
color: PALETTE.warning,
|
|
30533
30462
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
30534
30463
|
}
|
|
30535
30464
|
) }),
|
|
@@ -30537,10 +30466,10 @@ function GenerateReviewStepView({
|
|
|
30537
30466
|
const row = breakingRows[breakingCursor];
|
|
30538
30467
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
30539
30468
|
if (!comp) return null;
|
|
30540
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30541
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
30542
|
-
comp.impact && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30543
|
-
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
30469
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
30470
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
30471
|
+
comp.impact && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
30472
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx43(Text36, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
30544
30473
|
/* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
|
|
30545
30474
|
] });
|
|
30546
30475
|
})(),
|
|
@@ -30563,11 +30492,11 @@ function GenerateReviewStepView({
|
|
|
30563
30492
|
const participantSet = cycleView.structural;
|
|
30564
30493
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
30565
30494
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
30566
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor:
|
|
30567
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
30568
|
-
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30569
|
-
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30570
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
30495
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
30496
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
30497
|
+
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
30498
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
30499
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
30571
30500
|
] });
|
|
30572
30501
|
})(),
|
|
30573
30502
|
/* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
@@ -30683,7 +30612,7 @@ function GenerateReviewStepView({
|
|
|
30683
30612
|
) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
|
|
30684
30613
|
] }),
|
|
30685
30614
|
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
|
|
30686
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
30615
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
30687
30616
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
30688
30617
|
return /* @__PURE__ */ jsx43(
|
|
30689
30618
|
CyclePathLine,
|
|
@@ -30696,7 +30625,7 @@ function GenerateReviewStepView({
|
|
|
30696
30625
|
`cyc-banner-${idx}`
|
|
30697
30626
|
);
|
|
30698
30627
|
}),
|
|
30699
|
-
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30628
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
30700
30629
|
/* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
|
|
30701
30630
|
] }),
|
|
30702
30631
|
/* @__PURE__ */ jsx43(
|
|
@@ -30717,7 +30646,7 @@ var HELP_SECTIONS2;
|
|
|
30717
30646
|
var init_generate_review_step = __esm({
|
|
30718
30647
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx"() {
|
|
30719
30648
|
"use strict";
|
|
30720
|
-
|
|
30649
|
+
init_theme();
|
|
30721
30650
|
init_review_json_panel();
|
|
30722
30651
|
init_GroupedSidebar();
|
|
30723
30652
|
init_composite_closure();
|
|
@@ -30824,49 +30753,24 @@ var init_generate_review_step = __esm({
|
|
|
30824
30753
|
}
|
|
30825
30754
|
});
|
|
30826
30755
|
|
|
30827
|
-
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
|
|
30828
|
-
import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
|
|
30829
|
-
var PALETTE4, INK_UI_THEME;
|
|
30830
|
-
var init_theme4 = __esm({
|
|
30831
|
-
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts"() {
|
|
30832
|
-
"use strict";
|
|
30833
|
-
init_theme3();
|
|
30834
|
-
PALETTE4 = {
|
|
30835
|
-
...PALETTE3,
|
|
30836
|
-
link: "#58A6FF"
|
|
30837
|
-
};
|
|
30838
|
-
INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
30839
|
-
components: {
|
|
30840
|
-
ProgressBar: {
|
|
30841
|
-
styles: {
|
|
30842
|
-
completed: () => ({
|
|
30843
|
-
color: "blue"
|
|
30844
|
-
})
|
|
30845
|
-
}
|
|
30846
|
-
}
|
|
30847
|
-
}
|
|
30848
|
-
});
|
|
30849
|
-
}
|
|
30850
|
-
});
|
|
30851
|
-
|
|
30852
30756
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
|
|
30853
30757
|
import { Box as Box34, Text as Text37 } from "ink";
|
|
30854
30758
|
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
30855
30759
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
30856
30760
|
if (!generatePromptPath) return null;
|
|
30857
|
-
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30858
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
30859
|
-
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color:
|
|
30761
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
30762
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
30763
|
+
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color: PALETTE.warning, children: [
|
|
30860
30764
|
"components: ",
|
|
30861
30765
|
generatePromptPath
|
|
30862
30766
|
] }) : null,
|
|
30863
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
30767
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
30864
30768
|
] });
|
|
30865
30769
|
}
|
|
30866
30770
|
var init_CustomPromptBanner = __esm({
|
|
30867
30771
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx"() {
|
|
30868
30772
|
"use strict";
|
|
30869
|
-
|
|
30773
|
+
init_theme();
|
|
30870
30774
|
}
|
|
30871
30775
|
});
|
|
30872
30776
|
|
|
@@ -30893,17 +30797,17 @@ import { Box as Box35, Text as Text38 } from "ink";
|
|
|
30893
30797
|
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
30894
30798
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
30895
30799
|
return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
|
|
30896
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30800
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: "Space:" }),
|
|
30897
30801
|
/* @__PURE__ */ jsx45(Text38, { children: spaceId }),
|
|
30898
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30899
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30802
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: "/" }),
|
|
30803
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: "Environment:" }),
|
|
30900
30804
|
/* @__PURE__ */ jsx45(Text38, { children: environmentId })
|
|
30901
30805
|
] });
|
|
30902
30806
|
}
|
|
30903
30807
|
var init_SpaceEnvironment = __esm({
|
|
30904
30808
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/SpaceEnvironment.tsx"() {
|
|
30905
30809
|
"use strict";
|
|
30906
|
-
|
|
30810
|
+
init_theme();
|
|
30907
30811
|
}
|
|
30908
30812
|
});
|
|
30909
30813
|
|
|
@@ -30914,13 +30818,13 @@ function EntityRows({ entity, label }) {
|
|
|
30914
30818
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
30915
30819
|
return /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
30916
30820
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
|
|
30917
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30821
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.success, children: "\u2713" }),
|
|
30918
30822
|
" ",
|
|
30919
30823
|
plural3(entity[action]),
|
|
30920
30824
|
" ",
|
|
30921
30825
|
action
|
|
30922
30826
|
] }, action)),
|
|
30923
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30827
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.error, children: [
|
|
30924
30828
|
"\u2717 ",
|
|
30925
30829
|
plural3(entity.failed),
|
|
30926
30830
|
" failed \u2014 check logs above"
|
|
@@ -30929,8 +30833,8 @@ function EntityRows({ entity, label }) {
|
|
|
30929
30833
|
}
|
|
30930
30834
|
function LinkRow({ title, url }) {
|
|
30931
30835
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30932
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30933
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30836
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: title }),
|
|
30837
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.accent, children: url })
|
|
30934
30838
|
] });
|
|
30935
30839
|
}
|
|
30936
30840
|
function DoneStep({
|
|
@@ -30953,17 +30857,17 @@ function DoneStep({
|
|
|
30953
30857
|
const success = totalFailed === 0;
|
|
30954
30858
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
30955
30859
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
30956
|
-
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
30957
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color:
|
|
30860
|
+
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
30861
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30958
30862
|
/* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
30959
30863
|
/* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
30960
|
-
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30864
|
+
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.muted, children: [
|
|
30961
30865
|
"Push result: ",
|
|
30962
30866
|
summary.succeeded,
|
|
30963
30867
|
"/",
|
|
30964
30868
|
summary.total,
|
|
30965
30869
|
" succeeded",
|
|
30966
|
-
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30870
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.error, children: [
|
|
30967
30871
|
", ",
|
|
30968
30872
|
summary.failed,
|
|
30969
30873
|
" failed"
|
|
@@ -30971,8 +30875,8 @@ function DoneStep({
|
|
|
30971
30875
|
] }) })
|
|
30972
30876
|
] }),
|
|
30973
30877
|
failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30974
|
-
/* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
30975
|
-
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30878
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
30879
|
+
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.error, children: [
|
|
30976
30880
|
failure.entityType,
|
|
30977
30881
|
" ",
|
|
30978
30882
|
failure.entityId,
|
|
@@ -30982,7 +30886,7 @@ function DoneStep({
|
|
|
30982
30886
|
] }),
|
|
30983
30887
|
/* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
|
|
30984
30888
|
success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
|
|
30985
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30889
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
30986
30890
|
/* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
30987
30891
|
/* @__PURE__ */ jsx46(
|
|
30988
30892
|
LinkRow,
|
|
@@ -30999,7 +30903,7 @@ var ACTIONS;
|
|
|
30999
30903
|
var init_DoneStep = __esm({
|
|
31000
30904
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/DoneStep.tsx"() {
|
|
31001
30905
|
"use strict";
|
|
31002
|
-
|
|
30906
|
+
init_theme();
|
|
31003
30907
|
init_useImmediateInput();
|
|
31004
30908
|
init_contentful_urls2();
|
|
31005
30909
|
init_SpaceEnvironment();
|
|
@@ -31110,12 +31014,12 @@ function PathPrompt({
|
|
|
31110
31014
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
31111
31015
|
return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
31112
31016
|
/* @__PURE__ */ jsxs38(Box37, { gap: 1, children: [
|
|
31113
|
-
/* @__PURE__ */ jsx47(Text40, { color:
|
|
31017
|
+
/* @__PURE__ */ jsx47(Text40, { color: PALETTE.accent, children: "?" }),
|
|
31114
31018
|
/* @__PURE__ */ jsxs38(Text40, { bold: true, children: [
|
|
31115
31019
|
label,
|
|
31116
31020
|
":"
|
|
31117
31021
|
] }),
|
|
31118
|
-
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ?
|
|
31022
|
+
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE.muted : void 0, children: shown }),
|
|
31119
31023
|
/* @__PURE__ */ jsx47(Text40, { children: cursor })
|
|
31120
31024
|
] }),
|
|
31121
31025
|
/* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
|
|
@@ -31131,7 +31035,7 @@ var init_PathPrompt = __esm({
|
|
|
31131
31035
|
init_useImmediateInput();
|
|
31132
31036
|
init_path_utils();
|
|
31133
31037
|
init_use_blinking_cursor();
|
|
31134
|
-
|
|
31038
|
+
init_theme();
|
|
31135
31039
|
}
|
|
31136
31040
|
});
|
|
31137
31041
|
|
|
@@ -31140,7 +31044,7 @@ import { Box as Box38, Text as Text41 } from "ink";
|
|
|
31140
31044
|
import { jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
31141
31045
|
function StepHeader({ stepNumber, totalSteps, title }) {
|
|
31142
31046
|
return /* @__PURE__ */ jsxs39(Box38, { flexDirection: "column", gap: 0, children: [
|
|
31143
|
-
/* @__PURE__ */ jsx48(Text41, {
|
|
31047
|
+
/* @__PURE__ */ jsx48(Text41, { color: PALETTE.muted, children: "\u2500".repeat(40) }),
|
|
31144
31048
|
/* @__PURE__ */ jsxs39(Box38, { gap: 1, children: [
|
|
31145
31049
|
/* @__PURE__ */ jsxs39(Text41, { bold: true, children: [
|
|
31146
31050
|
"Step ",
|
|
@@ -31151,12 +31055,13 @@ function StepHeader({ stepNumber, totalSteps, title }) {
|
|
|
31151
31055
|
/* @__PURE__ */ jsx48(Text41, { bold: true, children: "\u2014" }),
|
|
31152
31056
|
/* @__PURE__ */ jsx48(Text41, { bold: true, children: title })
|
|
31153
31057
|
] }),
|
|
31154
|
-
/* @__PURE__ */ jsx48(Text41, {
|
|
31058
|
+
/* @__PURE__ */ jsx48(Text41, { color: PALETTE.muted, children: "\u2500".repeat(40) })
|
|
31155
31059
|
] });
|
|
31156
31060
|
}
|
|
31157
31061
|
var init_StepHeader = __esm({
|
|
31158
31062
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/StepHeader.tsx"() {
|
|
31159
31063
|
"use strict";
|
|
31064
|
+
init_theme();
|
|
31160
31065
|
}
|
|
31161
31066
|
});
|
|
31162
31067
|
|
|
@@ -31198,12 +31103,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
31198
31103
|
/* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
31199
31104
|
/* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
31200
31105
|
operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
31201
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
31106
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: "Operation:" }),
|
|
31202
31107
|
/* @__PURE__ */ jsx50(Text42, { children: operationId })
|
|
31203
31108
|
] }),
|
|
31204
31109
|
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
|
|
31205
|
-
/* @__PURE__ */ jsx50(Box39, { width: 40, children: /* @__PURE__ */ jsx50(ThemeProvider2, { theme:
|
|
31206
|
-
/* @__PURE__ */ jsxs40(Text42, { color:
|
|
31110
|
+
/* @__PURE__ */ jsx50(Box39, { width: 40, children: /* @__PURE__ */ jsx50(ThemeProvider2, { theme: PROGRESS_THEME, children: /* @__PURE__ */ jsx50(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
31111
|
+
/* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
|
|
31207
31112
|
progress.processed,
|
|
31208
31113
|
"/",
|
|
31209
31114
|
progress.total,
|
|
@@ -31211,10 +31116,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
31211
31116
|
] })
|
|
31212
31117
|
] }) }),
|
|
31213
31118
|
showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
31214
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
31119
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: "Now processing:" }),
|
|
31215
31120
|
/* @__PURE__ */ jsx50(Text42, { children: showCurrent })
|
|
31216
31121
|
] }),
|
|
31217
|
-
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color:
|
|
31122
|
+
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
|
|
31218
31123
|
"Elapsed: ",
|
|
31219
31124
|
elapsed
|
|
31220
31125
|
] }) })
|
|
@@ -31225,8 +31130,8 @@ var init_PushingStep = __esm({
|
|
|
31225
31130
|
"use strict";
|
|
31226
31131
|
init_StepHeader();
|
|
31227
31132
|
init_use_timed_spinner();
|
|
31228
|
-
|
|
31229
|
-
|
|
31133
|
+
init_theme2();
|
|
31134
|
+
init_theme();
|
|
31230
31135
|
}
|
|
31231
31136
|
});
|
|
31232
31137
|
|
|
@@ -31421,25 +31326,25 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31421
31326
|
if (components.new.length > 0) {
|
|
31422
31327
|
lines.push({
|
|
31423
31328
|
key: "summary-components-new",
|
|
31424
|
-
color:
|
|
31329
|
+
color: PALETTE.success,
|
|
31425
31330
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
31426
31331
|
});
|
|
31427
31332
|
for (const [index, item] of components.new.entries()) {
|
|
31428
31333
|
const name = item.key ?? item.$name ?? "unknown";
|
|
31429
|
-
lines.push({ key: `summary-components-new-${index}`, color:
|
|
31334
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${name}` });
|
|
31430
31335
|
}
|
|
31431
31336
|
}
|
|
31432
31337
|
if (components.changed.length > 0) {
|
|
31433
31338
|
lines.push({
|
|
31434
31339
|
key: "summary-components-changed",
|
|
31435
|
-
color:
|
|
31340
|
+
color: PALETTE.warning,
|
|
31436
31341
|
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
31437
31342
|
});
|
|
31438
31343
|
for (const [index, item] of components.changed.entries()) {
|
|
31439
31344
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
31440
31345
|
lines.push({
|
|
31441
31346
|
key: `summary-components-changed-${index}`,
|
|
31442
|
-
color: isBreaking ?
|
|
31347
|
+
color: isBreaking ? PALETTE.error : PALETTE.warning,
|
|
31443
31348
|
text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
|
|
31444
31349
|
});
|
|
31445
31350
|
}
|
|
@@ -31447,11 +31352,11 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31447
31352
|
if (components.removed.length > 0) {
|
|
31448
31353
|
lines.push({
|
|
31449
31354
|
key: "summary-components-removed",
|
|
31450
|
-
color:
|
|
31355
|
+
color: PALETTE.warning,
|
|
31451
31356
|
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
31452
31357
|
});
|
|
31453
31358
|
for (const [index, item] of components.removed.entries()) {
|
|
31454
|
-
lines.push({ key: `summary-components-removed-${index}`, color:
|
|
31359
|
+
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE.warning, text: ` \u2298 ${item.name}` });
|
|
31455
31360
|
}
|
|
31456
31361
|
}
|
|
31457
31362
|
if (components.unchanged.length > 0) {
|
|
@@ -31464,21 +31369,21 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31464
31369
|
if (tokens.new.length > 0) {
|
|
31465
31370
|
lines.push({
|
|
31466
31371
|
key: "summary-tokens-new",
|
|
31467
|
-
color:
|
|
31372
|
+
color: PALETTE.success,
|
|
31468
31373
|
text: ` \uFF0B ${tokens.new.length} design tokens will be created`
|
|
31469
31374
|
});
|
|
31470
31375
|
}
|
|
31471
31376
|
if (tokens.changed.length > 0) {
|
|
31472
31377
|
lines.push({
|
|
31473
31378
|
key: "summary-tokens-changed",
|
|
31474
|
-
color:
|
|
31379
|
+
color: PALETTE.warning,
|
|
31475
31380
|
text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
|
|
31476
31381
|
});
|
|
31477
31382
|
}
|
|
31478
31383
|
if (tokens.removed.length > 0) {
|
|
31479
31384
|
lines.push({
|
|
31480
31385
|
key: "summary-tokens-removed",
|
|
31481
|
-
color:
|
|
31386
|
+
color: PALETTE.warning,
|
|
31482
31387
|
text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
|
|
31483
31388
|
});
|
|
31484
31389
|
}
|
|
@@ -31522,12 +31427,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
31522
31427
|
function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
|
|
31523
31428
|
lines.push({
|
|
31524
31429
|
key: `${keyPrefix}-h-${name}`,
|
|
31525
|
-
color:
|
|
31430
|
+
color: PALETTE.warning,
|
|
31526
31431
|
text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
31527
31432
|
});
|
|
31528
31433
|
if (changeClassification?.classification !== "breaking") return;
|
|
31529
31434
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
31530
|
-
lines.push({ key: `${keyPrefix}-b-${name}`, color:
|
|
31435
|
+
lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
31531
31436
|
}
|
|
31532
31437
|
function buildPreviewDiffLines(preview) {
|
|
31533
31438
|
const lines = [];
|
|
@@ -31535,12 +31440,12 @@ function buildPreviewDiffLines(preview) {
|
|
|
31535
31440
|
for (const item of components.new) {
|
|
31536
31441
|
const raw = item;
|
|
31537
31442
|
const name = raw.key ?? raw.$name ?? "unknown";
|
|
31538
|
-
lines.push({ key: `comp-new-${name}`, color:
|
|
31443
|
+
lines.push({ key: `comp-new-${name}`, color: PALETTE.success, text: ` + ${name}` });
|
|
31539
31444
|
const slots = raw.$slots ?? {};
|
|
31540
31445
|
for (const slotName of Object.keys(slots).sort()) {
|
|
31541
31446
|
lines.push({
|
|
31542
31447
|
key: `comp-new-${name}-slot-${slotName}`,
|
|
31543
|
-
color:
|
|
31448
|
+
color: PALETTE.success,
|
|
31544
31449
|
text: ` slot: ${slotName}`
|
|
31545
31450
|
});
|
|
31546
31451
|
const allowed = slots[slotName]?.["$allowedComponents"];
|
|
@@ -31548,14 +31453,14 @@ function buildPreviewDiffLines(preview) {
|
|
|
31548
31453
|
const names = allowed.filter((n) => typeof n === "string");
|
|
31549
31454
|
lines.push({
|
|
31550
31455
|
key: `comp-new-${name}-slot-${slotName}-allow`,
|
|
31551
|
-
color:
|
|
31456
|
+
color: PALETTE.success,
|
|
31552
31457
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
31553
31458
|
});
|
|
31554
31459
|
}
|
|
31555
31460
|
}
|
|
31556
31461
|
}
|
|
31557
31462
|
for (const item of components.removed) {
|
|
31558
|
-
lines.push({ key: `comp-rm-${item.name}`, color:
|
|
31463
|
+
lines.push({ key: `comp-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
|
|
31559
31464
|
}
|
|
31560
31465
|
for (const item of components.changed) {
|
|
31561
31466
|
appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
|
|
@@ -31586,10 +31491,10 @@ function buildPreviewDiffLines(preview) {
|
|
|
31586
31491
|
for (const item of tokens.new) {
|
|
31587
31492
|
const raw = item;
|
|
31588
31493
|
const name = raw.name ?? raw.path ?? "unknown";
|
|
31589
|
-
lines.push({ key: `tok-new-${name}`, color:
|
|
31494
|
+
lines.push({ key: `tok-new-${name}`, color: PALETTE.success, text: ` + ${name}` });
|
|
31590
31495
|
}
|
|
31591
31496
|
for (const item of tokens.removed) {
|
|
31592
|
-
lines.push({ key: `tok-rm-${item.name}`, color:
|
|
31497
|
+
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
|
|
31593
31498
|
}
|
|
31594
31499
|
for (const item of tokens.changed) {
|
|
31595
31500
|
const tokenName = item.current.name;
|
|
@@ -31680,13 +31585,13 @@ function WizardPreviewStep({
|
|
|
31680
31585
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
31681
31586
|
focused: false,
|
|
31682
31587
|
children: [
|
|
31683
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ?
|
|
31684
|
-
/* @__PURE__ */ jsx51(Text43, { color:
|
|
31588
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ? PALETTE.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
31589
|
+
/* @__PURE__ */ jsx51(Text43, { color: PALETTE.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
31685
31590
|
]
|
|
31686
31591
|
}
|
|
31687
31592
|
)
|
|
31688
|
-
] }) : /* @__PURE__ */ jsx51(Text43, { color:
|
|
31689
|
-
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color:
|
|
31593
|
+
] }) : /* @__PURE__ */ jsx51(Text43, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
31594
|
+
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
31690
31595
|
/* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
|
|
31691
31596
|
/* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
|
|
31692
31597
|
/* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
|
|
@@ -31704,7 +31609,7 @@ function WizardPreviewStep({
|
|
|
31704
31609
|
var init_WizardPreviewStep = __esm({
|
|
31705
31610
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx"() {
|
|
31706
31611
|
"use strict";
|
|
31707
|
-
|
|
31612
|
+
init_theme();
|
|
31708
31613
|
init_useImmediateInput();
|
|
31709
31614
|
init_use_terminal_size();
|
|
31710
31615
|
init_src4();
|
|
@@ -32368,7 +32273,7 @@ var init_save = __esm({
|
|
|
32368
32273
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
32369
32274
|
appendRun,
|
|
32370
32275
|
buildSourceFingerprint,
|
|
32371
|
-
sleep: (ms) => new Promise((
|
|
32276
|
+
sleep: (ms) => new Promise((resolve27) => setTimeout(resolve27, ms)),
|
|
32372
32277
|
warn: (message) => process.stderr.write(message)
|
|
32373
32278
|
});
|
|
32374
32279
|
}
|
|
@@ -32919,48 +32824,13 @@ var init_debug_store = __esm({
|
|
|
32919
32824
|
}
|
|
32920
32825
|
});
|
|
32921
32826
|
|
|
32922
|
-
// packages/experience-design-system-cli/src/tui/help/file-locations.ts
|
|
32923
|
-
import { join as join27, resolve as resolve27 } from "node:path";
|
|
32924
|
-
function describeFileLocations({
|
|
32925
|
-
contentfulBaseDir,
|
|
32926
|
-
debugModeEnabled,
|
|
32927
|
-
currentSessionDir: currentSessionDir2
|
|
32928
|
-
}) {
|
|
32929
|
-
if (!debugModeEnabled) {
|
|
32930
|
-
return {
|
|
32931
|
-
debugLogs: "none while Debug Mode is off",
|
|
32932
|
-
importFiles: `${join27("<project>", ".contentful")}/ (tokens.json, components.json)`
|
|
32933
|
-
};
|
|
32934
|
-
}
|
|
32935
|
-
const base = contentfulBaseDir ? resolve27(contentfulBaseDir) : "<project>";
|
|
32936
|
-
const session = currentSessionDir2 ?? join27(base, ".contentful", "<date>-session-<n>");
|
|
32937
|
-
return {
|
|
32938
|
-
debugLogs: join27(session, "debug"),
|
|
32939
|
-
importFiles: `${join27(session, "dsi-import-<n>")}/ (tokens.json, components.json)`
|
|
32940
|
-
};
|
|
32941
|
-
}
|
|
32942
|
-
var init_file_locations = __esm({
|
|
32943
|
-
"packages/experience-design-system-cli/src/tui/help/file-locations.ts"() {
|
|
32944
|
-
"use strict";
|
|
32945
|
-
}
|
|
32946
|
-
});
|
|
32947
|
-
|
|
32948
32827
|
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
32949
32828
|
async function readHelpInfo() {
|
|
32950
|
-
const
|
|
32951
|
-
const base = settings["contentfulBaseDir"];
|
|
32952
|
-
const locations = describeFileLocations({
|
|
32953
|
-
contentfulBaseDir: typeof base === "string" ? base : "",
|
|
32954
|
-
debugModeEnabled: debugMode.enabled,
|
|
32955
|
-
currentSessionDir: currentSessionDir()
|
|
32956
|
-
});
|
|
32829
|
+
const debugMode = await readDebugModeSetting();
|
|
32957
32830
|
return {
|
|
32958
32831
|
storage: [
|
|
32959
32832
|
{ label: "Config folder", value: configRoot2() },
|
|
32960
|
-
{ label: "Settings file", value: configFilePath2() }
|
|
32961
|
-
{ label: "Agent settings", value: `${configFilePath2()} (keys: agent, agentModel, agents)` },
|
|
32962
|
-
{ label: "Debug logs", value: locations.debugLogs },
|
|
32963
|
-
{ label: "Import files", value: locations.importFiles }
|
|
32833
|
+
{ label: "Settings file", value: configFilePath2() }
|
|
32964
32834
|
],
|
|
32965
32835
|
troubleshooting: [
|
|
32966
32836
|
{ label: "CLI version", value: readPackageVersion() },
|
|
@@ -32981,7 +32851,6 @@ var init_help_info = __esm({
|
|
|
32981
32851
|
init_debug_store();
|
|
32982
32852
|
init_debug_mode_store();
|
|
32983
32853
|
init_version();
|
|
32984
|
-
init_file_locations();
|
|
32985
32854
|
}
|
|
32986
32855
|
});
|
|
32987
32856
|
|
|
@@ -32993,7 +32862,7 @@ function Section({ title, rows }) {
|
|
|
32993
32862
|
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
32994
32863
|
/* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
|
|
32995
32864
|
rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
|
|
32996
|
-
/* @__PURE__ */ jsx53(Box42, { width:
|
|
32865
|
+
/* @__PURE__ */ jsx53(Box42, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
|
|
32997
32866
|
/* @__PURE__ */ jsx53(Text44, { children: row.value })
|
|
32998
32867
|
] }, row.label))
|
|
32999
32868
|
] });
|
|
@@ -33039,7 +32908,7 @@ function HelpScreen({ onDone }) {
|
|
|
33039
32908
|
var init_PageContainer2 = __esm({
|
|
33040
32909
|
"packages/experience-design-system-cli/src/tui/help/PageContainer.tsx"() {
|
|
33041
32910
|
"use strict";
|
|
33042
|
-
|
|
32911
|
+
init_theme();
|
|
33043
32912
|
init_debug_store();
|
|
33044
32913
|
init_control_hints();
|
|
33045
32914
|
init_help_info();
|
|
@@ -33082,8 +32951,8 @@ function SettingsScreen({
|
|
|
33082
32951
|
});
|
|
33083
32952
|
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33084
32953
|
/* @__PURE__ */ jsx54(Text45, { bold: true, children: "Settings" }),
|
|
33085
|
-
/* @__PURE__ */ jsx54(Text45, { children: " " }),
|
|
33086
|
-
items.map((item, i) => /* @__PURE__ */ jsxs44(Text45, { color: i === focusIdx ?
|
|
32954
|
+
/* @__PURE__ */ jsx54(Text45, { color: PALETTE.muted, children: " " }),
|
|
32955
|
+
items.map((item, i) => /* @__PURE__ */ jsxs44(Text45, { color: i === focusIdx ? PALETTE.accent : void 0, children: [
|
|
33087
32956
|
i === focusIdx ? "> " : " ",
|
|
33088
32957
|
item.label
|
|
33089
32958
|
] }, item.label)),
|
|
@@ -33104,671 +32973,181 @@ var init_PageContainer3 = __esm({
|
|
|
33104
32973
|
"packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx"() {
|
|
33105
32974
|
"use strict";
|
|
33106
32975
|
init_control_hints();
|
|
32976
|
+
init_theme();
|
|
33107
32977
|
}
|
|
33108
32978
|
});
|
|
33109
32979
|
|
|
33110
|
-
// packages/experience-design-system-cli/src/tui/settings/
|
|
33111
|
-
|
|
33112
|
-
|
|
33113
|
-
|
|
33114
|
-
|
|
33115
|
-
|
|
33116
|
-
|
|
33117
|
-
|
|
33118
|
-
|
|
33119
|
-
|
|
33120
|
-
|
|
33121
|
-
|
|
33122
|
-
return access6(binary, constants.X_OK).then(
|
|
33123
|
-
() => binary,
|
|
33124
|
-
() => null
|
|
33125
|
-
);
|
|
33126
|
-
}
|
|
33127
|
-
return new Promise((resolve28) => {
|
|
33128
|
-
execFile2(
|
|
33129
|
-
process.platform === "win32" ? "where" : "which",
|
|
33130
|
-
[binary],
|
|
33131
|
-
(error, stdout) => resolve28(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
33132
|
-
);
|
|
33133
|
-
});
|
|
32980
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
32981
|
+
async function readCredentials() {
|
|
32982
|
+
const store = await readV1Store();
|
|
32983
|
+
return {
|
|
32984
|
+
spaceId: store.spaceId || "",
|
|
32985
|
+
environmentId: store.environmentId || "",
|
|
32986
|
+
cmaToken: store.cmaToken || "",
|
|
32987
|
+
host: store.host || "",
|
|
32988
|
+
defaultComponentDir: store.defaultComponentDir || "",
|
|
32989
|
+
defaultTokenFile: store.defaultTokenFile || "",
|
|
32990
|
+
contentfulBaseDir: store.contentfulBaseDir || ""
|
|
32991
|
+
};
|
|
33134
32992
|
}
|
|
33135
|
-
function
|
|
33136
|
-
|
|
33137
|
-
|
|
33138
|
-
|
|
33139
|
-
|
|
33140
|
-
|
|
33141
|
-
|
|
32993
|
+
async function writeCredentials(config) {
|
|
32994
|
+
const existing = await readV1Store();
|
|
32995
|
+
const merged = {
|
|
32996
|
+
...existing,
|
|
32997
|
+
...config
|
|
32998
|
+
};
|
|
32999
|
+
Object.keys(merged).forEach((k) => {
|
|
33000
|
+
if (!merged[k]) delete merged[k];
|
|
33142
33001
|
});
|
|
33002
|
+
await writeV1Store(merged);
|
|
33143
33003
|
}
|
|
33144
|
-
|
|
33145
|
-
|
|
33146
|
-
const found = await resolveOnPath(target);
|
|
33147
|
-
if (!found) return [fail3("path", `\`${target}\` was not found or is not executable`)];
|
|
33148
|
-
const checks = [pass("path", found)];
|
|
33149
|
-
checks.push(await readVersion(found));
|
|
33150
|
-
if (name === "claude") {
|
|
33151
|
-
const auth = await withBinaryEnv(name, found, () => checkAgentAuth(name));
|
|
33152
|
-
checks.push(
|
|
33153
|
-
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
33154
|
-
);
|
|
33155
|
-
}
|
|
33156
|
-
return checks;
|
|
33157
|
-
}
|
|
33158
|
-
async function testAgent(name, binary, model) {
|
|
33159
|
-
const checks = await inspectAgent(name, binary);
|
|
33160
|
-
if (!checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
33161
|
-
const target = effectiveBinary(name, binary);
|
|
33162
|
-
const found = await resolveOnPath(target) ?? target;
|
|
33163
|
-
const started = Date.now();
|
|
33164
|
-
const result = await withBinaryEnv(
|
|
33165
|
-
name,
|
|
33166
|
-
found,
|
|
33167
|
-
() => createLocalCliAgentInvoker().invoke({
|
|
33168
|
-
agent: name,
|
|
33169
|
-
...model.trim() ? { model: model.trim() } : {},
|
|
33170
|
-
prompt: TEST_PROMPT,
|
|
33171
|
-
timeoutMs: PROMPT_TIMEOUT_MS
|
|
33172
|
-
})
|
|
33173
|
-
);
|
|
33174
|
-
const seconds = ((Date.now() - started) / 1e3).toFixed(1);
|
|
33175
|
-
if (result.timedOut) return [...checks, fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`)];
|
|
33176
|
-
if (result.exitCode !== 0) {
|
|
33177
|
-
const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
|
|
33178
|
-
return [...checks, fail3("prompt", reason)];
|
|
33179
|
-
}
|
|
33180
|
-
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
33181
|
-
}
|
|
33182
|
-
function statusFromChecks(name, checks, savedBinary) {
|
|
33183
|
-
if (checks.length === 0) return "checking";
|
|
33184
|
-
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
33185
|
-
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
33186
|
-
}
|
|
33187
|
-
const login = checks.find((check) => check.step === "login");
|
|
33188
|
-
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
33189
|
-
const prompt = checks.find((check) => check.step === "prompt");
|
|
33190
|
-
if (prompt) return prompt.ok ? "ready" : "not-logged-in";
|
|
33191
|
-
return name === "claude" ? "ready" : "unknown";
|
|
33192
|
-
}
|
|
33193
|
-
function setupHint(name, status) {
|
|
33194
|
-
if (status === "not-configured") return `${INSTALL_HINTS[name]}, or set its command path in settings`;
|
|
33195
|
-
if (status === "not-found") return `${INSTALL_HINTS[name]}, or correct the command path in settings`;
|
|
33196
|
-
if (status === "not-logged-in") return LOGIN_HINTS[name];
|
|
33197
|
-
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
33198
|
-
return "";
|
|
33199
|
-
}
|
|
33200
|
-
function modelLine(name, savedModel) {
|
|
33201
|
-
const model = savedModel.trim();
|
|
33202
|
-
return model ? model : `${defaultModelLabel(name)} (built-in default)`;
|
|
33203
|
-
}
|
|
33204
|
-
function panelRows(name, checks, settings) {
|
|
33205
|
-
if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
33206
|
-
const status = statusFromChecks(name, checks, settings.binary);
|
|
33207
|
-
const path5 = checks.find((check) => check.step === "path");
|
|
33208
|
-
if (!path5?.ok) {
|
|
33209
|
-
const rows2 = [
|
|
33210
|
-
{
|
|
33211
|
-
label: "Command",
|
|
33212
|
-
value: settings.binary.trim() ? path5?.detail ?? "not found" : "not found on your PATH",
|
|
33213
|
-
tone: settings.binary.trim() ? "bad" : "muted"
|
|
33214
|
-
}
|
|
33215
|
-
];
|
|
33216
|
-
const hint2 = setupHint(name, status);
|
|
33217
|
-
if (hint2) rows2.push({ label: "Setup", value: hint2, tone: "muted" });
|
|
33218
|
-
return rows2;
|
|
33219
|
-
}
|
|
33220
|
-
const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
|
|
33221
|
-
const version = checks.find((check) => check.step === "version");
|
|
33222
|
-
if (version?.ok) rows.push({ label: "Version", value: version.detail, tone: "ok" });
|
|
33223
|
-
rows.push({ label: "Model", value: modelLine(name, settings.model), tone: "muted" });
|
|
33224
|
-
const hint = setupHint(name, status);
|
|
33225
|
-
if (hint) rows.push({ label: "Setup", value: hint, tone: "muted" });
|
|
33226
|
-
return rows;
|
|
33227
|
-
}
|
|
33228
|
-
function statusRows(_name, checks, savedBinary) {
|
|
33229
|
-
if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
33230
|
-
const find = (step) => checks.find((check) => check.step === step);
|
|
33231
|
-
const path5 = find("path");
|
|
33232
|
-
if (!path5?.ok) {
|
|
33233
|
-
if (savedBinary.trim()) return [{ label: "Command", value: path5?.detail ?? "not found", tone: "bad" }];
|
|
33234
|
-
return [{ label: "Command", value: "not configured (not on the PATH)", tone: "muted" }];
|
|
33235
|
-
}
|
|
33236
|
-
const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
|
|
33237
|
-
const version = find("version");
|
|
33238
|
-
if (version) {
|
|
33239
|
-
rows.push({
|
|
33240
|
-
label: "Version",
|
|
33241
|
-
value: version.ok ? version.detail : "could not be read",
|
|
33242
|
-
tone: version.ok ? "ok" : "muted"
|
|
33243
|
-
});
|
|
33244
|
-
}
|
|
33245
|
-
const login = find("login");
|
|
33246
|
-
const prompt = find("prompt");
|
|
33247
|
-
if (login) {
|
|
33248
|
-
rows.push({ label: "Login", value: login.detail, tone: login.ok ? "ok" : "bad" });
|
|
33249
|
-
} else if (prompt) {
|
|
33250
|
-
rows.push({
|
|
33251
|
-
label: "Login",
|
|
33252
|
-
value: prompt.ok ? "confirmed by the test" : "see the test result",
|
|
33253
|
-
tone: prompt.ok ? "ok" : "bad"
|
|
33254
|
-
});
|
|
33255
|
-
} else {
|
|
33256
|
-
rows.push({ label: "Login", value: "not checked (use Run test)", tone: "muted" });
|
|
33257
|
-
}
|
|
33258
|
-
if (prompt) rows.push({ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" });
|
|
33259
|
-
return rows;
|
|
33260
|
-
}
|
|
33261
|
-
async function withBinaryEnv(name, binary, run) {
|
|
33262
|
-
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
33263
|
-
const previous = process.env[key];
|
|
33264
|
-
process.env[key] = binary;
|
|
33265
|
-
try {
|
|
33266
|
-
return await run();
|
|
33267
|
-
} finally {
|
|
33268
|
-
if (previous === void 0) delete process.env[key];
|
|
33269
|
-
else process.env[key] = previous;
|
|
33270
|
-
}
|
|
33271
|
-
}
|
|
33272
|
-
var VERSION_TIMEOUT_MS, PROMPT_TIMEOUT_MS, TEST_PROMPT, INSTALL_HINTS, LOGIN_HINTS, fail3, pass, LIST_STATUS;
|
|
33273
|
-
var init_agent_status = __esm({
|
|
33274
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts"() {
|
|
33275
|
-
"use strict";
|
|
33276
|
-
init_src4();
|
|
33277
|
-
VERSION_TIMEOUT_MS = 5e3;
|
|
33278
|
-
PROMPT_TIMEOUT_MS = 6e4;
|
|
33279
|
-
TEST_PROMPT = "Reply with the single word: ok";
|
|
33280
|
-
INSTALL_HINTS = {
|
|
33281
|
-
claude: "npm install -g @anthropic-ai/claude-code",
|
|
33282
|
-
codex: "npm install -g @openai/codex",
|
|
33283
|
-
opencode: "npm install -g opencode-ai",
|
|
33284
|
-
cursor: "install Cursor\u2019s `cursor-agent` command",
|
|
33285
|
-
copilot: "npm install -g @github/copilot"
|
|
33286
|
-
};
|
|
33287
|
-
LOGIN_HINTS = {
|
|
33288
|
-
claude: "run `claude login`",
|
|
33289
|
-
codex: "set OPENAI_API_KEY, or sign in with a ChatGPT account",
|
|
33290
|
-
opencode: "run `opencode auth`",
|
|
33291
|
-
cursor: "sign in from Cursor",
|
|
33292
|
-
copilot: "run `copilot` and sign in"
|
|
33293
|
-
};
|
|
33294
|
-
fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
33295
|
-
pass = (step, detail) => ({ step, ok: true, detail });
|
|
33296
|
-
LIST_STATUS = {
|
|
33297
|
-
checking: { symbol: "\u2026", text: "checking", tone: "muted" },
|
|
33298
|
-
ready: { symbol: "\u25CF", text: "ready", tone: "ok" },
|
|
33299
|
-
"not-configured": { symbol: "\u25CB", text: "not installed", tone: "muted" },
|
|
33300
|
-
"not-found": { symbol: "\u25CB", text: "not installed", tone: "bad" },
|
|
33301
|
-
"not-logged-in": { symbol: "\u25D0", text: "not logged in", tone: "bad" },
|
|
33302
|
-
unknown: { symbol: "\u25D0", text: "installed, login unknown", tone: "muted" }
|
|
33303
|
-
};
|
|
33304
|
-
}
|
|
33305
|
-
});
|
|
33306
|
-
|
|
33307
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusBadge.tsx
|
|
33308
|
-
import { Text as Text46 } from "ink";
|
|
33309
|
-
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
33310
|
-
function AgentStatusBadge({
|
|
33311
|
-
name,
|
|
33312
|
-
checks,
|
|
33313
|
-
binary
|
|
33314
|
-
}) {
|
|
33315
|
-
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name, checks, binary) : "checking"];
|
|
33316
|
-
return /* @__PURE__ */ jsx55(Text46, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
33317
|
-
}
|
|
33318
|
-
var TONE_COLOR;
|
|
33319
|
-
var init_AgentStatusBadge = __esm({
|
|
33320
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusBadge.tsx"() {
|
|
33004
|
+
var init_config_store = __esm({
|
|
33005
|
+
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts"() {
|
|
33321
33006
|
"use strict";
|
|
33322
|
-
|
|
33323
|
-
init_agent_status();
|
|
33324
|
-
TONE_COLOR = {
|
|
33325
|
-
ok: PALETTE.success,
|
|
33326
|
-
bad: PALETTE.error,
|
|
33327
|
-
muted: PALETTE.muted
|
|
33328
|
-
};
|
|
33007
|
+
init_v1_store();
|
|
33329
33008
|
}
|
|
33330
33009
|
});
|
|
33331
33010
|
|
|
33332
|
-
// packages/experience-design-system-cli/src/tui/settings/
|
|
33011
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
33333
33012
|
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
33334
|
-
import { Box as Box44, Text as
|
|
33013
|
+
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
33335
33014
|
import TextInput4 from "ink-text-input";
|
|
33336
|
-
import { Fragment as Fragment17, jsx as
|
|
33337
|
-
function
|
|
33338
|
-
|
|
33339
|
-
|
|
33340
|
-
|
|
33341
|
-
|
|
33342
|
-
|
|
33343
|
-
|
|
33344
|
-
|
|
33345
|
-
|
|
33346
|
-
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: `\xB7 ${note}` })
|
|
33347
|
-
] }),
|
|
33348
|
-
children
|
|
33349
|
-
] });
|
|
33350
|
-
}
|
|
33351
|
-
function AgentDetail({
|
|
33352
|
-
name,
|
|
33353
|
-
config,
|
|
33354
|
-
setConfig,
|
|
33355
|
-
onBack
|
|
33356
|
-
}) {
|
|
33357
|
-
const settings = config.agents[name];
|
|
33358
|
-
const [focusIndex, setFocusIndex] = useState29(0);
|
|
33359
|
-
const [editing, setEditing] = useState29(false);
|
|
33360
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33361
|
-
const [saving, setSaving] = useState29(false);
|
|
33362
|
-
const [testing, setTesting] = useState29(false);
|
|
33363
|
-
const [notice, setNotice] = useState29(null);
|
|
33364
|
-
const [checks, setChecks] = useState29(void 0);
|
|
33365
|
-
useEffect22(() => {
|
|
33366
|
-
let active = true;
|
|
33367
|
-
setChecks(void 0);
|
|
33368
|
-
void inspectAgent(name, settings.binary).then((result) => active && setChecks(result));
|
|
33369
|
-
return () => {
|
|
33370
|
-
active = false;
|
|
33371
|
-
};
|
|
33372
|
-
}, [name, settings.binary]);
|
|
33373
|
-
const setField = (field, value) => {
|
|
33374
|
-
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [field]: value } } });
|
|
33375
|
-
setNotice(null);
|
|
33376
|
-
};
|
|
33377
|
-
const save = () => {
|
|
33378
|
-
setSaving(true);
|
|
33379
|
-
setNotice(null);
|
|
33380
|
-
writeAgentConfig(config).then(() => {
|
|
33381
|
-
applyBinaryOverrides(config);
|
|
33382
|
-
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` });
|
|
33383
|
-
}).catch(
|
|
33384
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33385
|
-
).finally(() => setSaving(false));
|
|
33386
|
-
};
|
|
33387
|
-
const runTest = () => {
|
|
33388
|
-
setTesting(true);
|
|
33389
|
-
setNotice(null);
|
|
33390
|
-
setChecks(void 0);
|
|
33391
|
-
testAgent(name, settings.binary, settings.model).then(setChecks).catch(
|
|
33392
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "The test could not run" })
|
|
33393
|
-
).finally(() => setTesting(false));
|
|
33015
|
+
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
33016
|
+
function debugFields(config) {
|
|
33017
|
+
return {
|
|
33018
|
+
space_id: config?.spaceId ?? "",
|
|
33019
|
+
environment_id: config?.environmentId ?? "",
|
|
33020
|
+
cma_token: config?.cmaToken ?? "",
|
|
33021
|
+
host: config?.host ?? "",
|
|
33022
|
+
default_component_dir: config?.defaultComponentDir ?? "",
|
|
33023
|
+
default_token_file: config?.defaultTokenFile ?? "",
|
|
33024
|
+
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
33394
33025
|
};
|
|
33395
|
-
const focused = FOCUS_ORDER[focusIndex];
|
|
33396
|
-
const focusedField = focused === "test" ? null : focused;
|
|
33397
|
-
useInput11((input, key) => {
|
|
33398
|
-
if (saving || testing) return;
|
|
33399
|
-
if (editing) {
|
|
33400
|
-
if (key.escape && focusedField) {
|
|
33401
|
-
setField(focusedField, valueBeforeEdit);
|
|
33402
|
-
setEditing(false);
|
|
33403
|
-
}
|
|
33404
|
-
return;
|
|
33405
|
-
}
|
|
33406
|
-
if (key.escape || input === "q") {
|
|
33407
|
-
onBack();
|
|
33408
|
-
return;
|
|
33409
|
-
}
|
|
33410
|
-
if (input === "s") {
|
|
33411
|
-
save();
|
|
33412
|
-
return;
|
|
33413
|
-
}
|
|
33414
|
-
if (key.upArrow) {
|
|
33415
|
-
setFocusIndex((i) => (i - 1 + FOCUS_ORDER.length) % FOCUS_ORDER.length);
|
|
33416
|
-
return;
|
|
33417
|
-
}
|
|
33418
|
-
if (key.downArrow || key.tab) {
|
|
33419
|
-
setFocusIndex((i) => (i + 1) % FOCUS_ORDER.length);
|
|
33420
|
-
return;
|
|
33421
|
-
}
|
|
33422
|
-
if (input === "c" && focusedField) {
|
|
33423
|
-
setField(focusedField, "");
|
|
33424
|
-
return;
|
|
33425
|
-
}
|
|
33426
|
-
if (key.return) {
|
|
33427
|
-
if (focusedField) {
|
|
33428
|
-
setValueBeforeEdit(settings[focusedField]);
|
|
33429
|
-
setEditing(true);
|
|
33430
|
-
} else {
|
|
33431
|
-
runTest();
|
|
33432
|
-
}
|
|
33433
|
-
}
|
|
33434
|
-
});
|
|
33435
|
-
const status = checks ? statusFromChecks(name, checks, settings.binary) : "checking";
|
|
33436
|
-
const hint = setupHint(name, status);
|
|
33437
|
-
const pointer = (isFocused) => /* @__PURE__ */ jsx56(Text47, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
33438
|
-
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33439
|
-
/* @__PURE__ */ jsx56(Text47, { bold: true, children: AGENT_LABELS[name] }),
|
|
33440
|
-
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: config.defaultAgent === name ? "This is the default agent." : `Runs the \`${AGENT_HINTS[name]}\` command.` }),
|
|
33441
|
-
/* @__PURE__ */ jsxs45(Section2, { title: "CONFIGURE", note: "you can change these", interactive: true, children: [
|
|
33442
|
-
FIELDS2.map((field) => {
|
|
33443
|
-
const isFocused = focused === field;
|
|
33444
|
-
const value = settings[field];
|
|
33445
|
-
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33446
|
-
pointer(isFocused),
|
|
33447
|
-
/* @__PURE__ */ jsx56(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: FIELD_LABEL[field] }) }),
|
|
33448
|
-
isFocused && editing ? /* @__PURE__ */ jsx56(
|
|
33449
|
-
TextInput4,
|
|
33450
|
-
{
|
|
33451
|
-
value,
|
|
33452
|
-
onChange: (next) => setField(field, next),
|
|
33453
|
-
onSubmit: () => setEditing(false)
|
|
33454
|
-
}
|
|
33455
|
-
) : /* @__PURE__ */ jsx56(Text47, { bold: true, children: value }),
|
|
33456
|
-
!value && /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: fieldHint(name, field) })
|
|
33457
|
-
] }, field);
|
|
33458
|
-
}),
|
|
33459
|
-
/* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33460
|
-
pointer(focused === "test"),
|
|
33461
|
-
/* @__PURE__ */ jsx56(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { bold: focused === "test", color: focused === "test" ? PALETTE.accent : PALETTE.muted, children: "Run test" }) }),
|
|
33462
|
-
/* @__PURE__ */ jsx56(Text47, { color: testing ? PALETTE.accent : PALETTE.muted, children: testing ? "running..." : "sends one small prompt (uses a few tokens)" })
|
|
33463
|
-
] })
|
|
33464
|
-
] }),
|
|
33465
|
-
/* @__PURE__ */ jsxs45(Section2, { title: "STATUS", note: "read only", children: [
|
|
33466
|
-
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsxs45(Box44, { gap: 1, paddingLeft: 2, children: [
|
|
33467
|
-
/* @__PURE__ */ jsx56(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: row.label }) }),
|
|
33468
|
-
/* @__PURE__ */ jsx56(Text47, { color: TONE_COLOR[row.tone], children: row.value })
|
|
33469
|
-
] }, row.label)),
|
|
33470
|
-
hint && /* @__PURE__ */ jsx56(Box44, { paddingLeft: 2, children: /* @__PURE__ */ jsxs45(Text47, { color: PALETTE.muted, children: [
|
|
33471
|
-
"Setup: ",
|
|
33472
|
-
hint
|
|
33473
|
-
] }) })
|
|
33474
|
-
] }),
|
|
33475
|
-
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
33476
|
-
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33477
|
-
/* @__PURE__ */ jsxs45(Text47, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33478
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33479
|
-
" ",
|
|
33480
|
-
notice.text
|
|
33481
|
-
] })
|
|
33482
|
-
] }),
|
|
33483
|
-
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33484
|
-
/* @__PURE__ */ jsx56(
|
|
33485
|
-
ControlHints,
|
|
33486
|
-
{
|
|
33487
|
-
hints: editing ? [
|
|
33488
|
-
{ keys: "type", label: "edit" },
|
|
33489
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
33490
|
-
{ keys: "\u23CE", label: "done" },
|
|
33491
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
33492
|
-
] : [
|
|
33493
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
33494
|
-
{ keys: "\u23CE", label: focusedField ? "edit" : "run test" },
|
|
33495
|
-
...focusedField ? [{ keys: "c", label: "clear" }] : [],
|
|
33496
|
-
{ keys: "s", label: "save" },
|
|
33497
|
-
{ keys: "Esc/q", label: "back without saving" }
|
|
33498
|
-
]
|
|
33499
|
-
}
|
|
33500
|
-
)
|
|
33501
|
-
] });
|
|
33502
33026
|
}
|
|
33503
|
-
|
|
33504
|
-
|
|
33505
|
-
|
|
33506
|
-
|
|
33507
|
-
|
|
33508
|
-
|
|
33509
|
-
|
|
33510
|
-
|
|
33511
|
-
|
|
33512
|
-
|
|
33513
|
-
|
|
33514
|
-
|
|
33515
|
-
FIELD_LABEL = { binary: "Command path", model: "Model" };
|
|
33516
|
-
LABEL_WIDTH = "Command path".length;
|
|
33517
|
-
fieldHint = (name, field) => field === "binary" ? `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` : `(empty: ${defaultModelLabel(name)})`;
|
|
33518
|
-
}
|
|
33519
|
-
});
|
|
33520
|
-
|
|
33521
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
33522
|
-
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
33523
|
-
import { Box as Box45, Text as Text48, useInput as useInput12 } from "ink";
|
|
33524
|
-
import { Fragment as Fragment18, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33525
|
-
function AgentsScreen({ onDone }) {
|
|
33526
|
-
const [config, setConfig] = useState30(null);
|
|
33527
|
-
const [focus, setFocus] = useState30(0);
|
|
33528
|
-
const [open, setOpen] = useState30(null);
|
|
33529
|
-
const [notice, setNotice] = useState30(null);
|
|
33530
|
-
const [checks, setChecks] = useState30({});
|
|
33531
|
-
const inspectAll = (loaded) => {
|
|
33532
|
-
for (const name of AGENT_NAMES) {
|
|
33533
|
-
void inspectAgent(name, loaded.agents[name].binary).then(
|
|
33534
|
-
(result) => setChecks((previous) => ({ ...previous, [name]: result }))
|
|
33535
|
-
);
|
|
33536
|
-
}
|
|
33537
|
-
};
|
|
33538
|
-
useEffect23(() => {
|
|
33539
|
-
void readAgentConfig().then((loaded) => {
|
|
33540
|
-
setConfig(loaded);
|
|
33541
|
-
inspectAll(loaded);
|
|
33027
|
+
function ConfigurationScreen({ onDone }) {
|
|
33028
|
+
const [stage, setStage] = useState29("loading");
|
|
33029
|
+
const [config, setConfig] = useState29(null);
|
|
33030
|
+
const [activeField, setActiveField] = useState29("spaceId");
|
|
33031
|
+
const [notice, setNotice] = useState29(null);
|
|
33032
|
+
const [lastSaved, setLastSaved] = useState29(null);
|
|
33033
|
+
const [editing, setEditing] = useState29(false);
|
|
33034
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33035
|
+
useEffect22(() => {
|
|
33036
|
+
readCredentials().then((cfg) => {
|
|
33037
|
+
setConfig(cfg);
|
|
33038
|
+
setStage("form");
|
|
33542
33039
|
startDebugRun({
|
|
33543
|
-
flow: "settings/
|
|
33544
|
-
step: "01-
|
|
33545
|
-
menuOption: "Configuration
|
|
33546
|
-
inputs:
|
|
33040
|
+
flow: "settings/contentful-configuration",
|
|
33041
|
+
step: "01-configuration",
|
|
33042
|
+
menuOption: "Configuration",
|
|
33043
|
+
inputs: debugFields(cfg)
|
|
33547
33044
|
});
|
|
33548
33045
|
});
|
|
33549
33046
|
}, []);
|
|
33550
|
-
|
|
33047
|
+
function fieldValue(field) {
|
|
33048
|
+
if (!config) return "";
|
|
33049
|
+
return config[field] || "";
|
|
33050
|
+
}
|
|
33051
|
+
function setFieldValue(field, value) {
|
|
33551
33052
|
if (!config) return;
|
|
33552
|
-
|
|
33553
|
-
|
|
33554
|
-
return;
|
|
33555
|
-
}
|
|
33556
|
-
const next = { ...config, defaultAgent: name };
|
|
33557
|
-
setConfig(next);
|
|
33558
|
-
writeAgentConfig(next).then(() => setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name]}` })).catch(
|
|
33559
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33560
|
-
);
|
|
33561
|
-
};
|
|
33562
|
-
useInput12((input, key) => {
|
|
33563
|
-
if (!config || open) return;
|
|
33564
|
-
const focused = AGENT_NAMES[focus];
|
|
33565
|
-
if (key.upArrow || key.downArrow || key.tab) setNotice(null);
|
|
33566
|
-
if (key.upArrow) {
|
|
33567
|
-
setFocus((i) => (i - 1 + AGENT_NAMES.length) % AGENT_NAMES.length);
|
|
33568
|
-
return;
|
|
33569
|
-
}
|
|
33570
|
-
if (key.downArrow || key.tab) {
|
|
33571
|
-
setFocus((i) => (i + 1) % AGENT_NAMES.length);
|
|
33572
|
-
return;
|
|
33573
|
-
}
|
|
33574
|
-
if (key.return) {
|
|
33575
|
-
makeDefault(focused);
|
|
33576
|
-
return;
|
|
33577
|
-
}
|
|
33578
|
-
if (key.rightArrow) {
|
|
33579
|
-
setNotice(null);
|
|
33580
|
-
setOpen(focused);
|
|
33581
|
-
return;
|
|
33582
|
-
}
|
|
33583
|
-
if (key.escape || input === "q") {
|
|
33584
|
-
void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
|
|
33585
|
-
onDone();
|
|
33586
|
-
}
|
|
33587
|
-
});
|
|
33588
|
-
if (!config) {
|
|
33589
|
-
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33590
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
33591
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33592
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
33593
|
-
] });
|
|
33053
|
+
setConfig({ ...config, [field]: value });
|
|
33054
|
+
setNotice(null);
|
|
33594
33055
|
}
|
|
33595
|
-
|
|
33596
|
-
|
|
33597
|
-
|
|
33598
|
-
|
|
33599
|
-
|
|
33600
|
-
|
|
33601
|
-
|
|
33602
|
-
|
|
33603
|
-
|
|
33604
|
-
|
|
33605
|
-
|
|
33606
|
-
|
|
33607
|
-
|
|
33608
|
-
}
|
|
33609
|
-
}
|
|
33610
|
-
);
|
|
33056
|
+
function handleSave() {
|
|
33057
|
+
if (!config) return;
|
|
33058
|
+
setStage("saving");
|
|
33059
|
+
setNotice(null);
|
|
33060
|
+
writeCredentials(config).then(() => {
|
|
33061
|
+
setLastSaved(config);
|
|
33062
|
+
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
33063
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
33064
|
+
setStage("form");
|
|
33065
|
+
}).catch((err) => {
|
|
33066
|
+
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
33067
|
+
setStage("form");
|
|
33068
|
+
});
|
|
33611
33069
|
}
|
|
33612
|
-
|
|
33613
|
-
|
|
33614
|
-
|
|
33615
|
-
|
|
33616
|
-
|
|
33617
|
-
/* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
33618
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Default agent" }),
|
|
33619
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: AGENT_LABELS[config.defaultAgent] })
|
|
33620
|
-
] }),
|
|
33621
|
-
/* @__PURE__ */ jsxs46(Box45, { marginTop: 1, gap: 1, children: [
|
|
33622
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33623
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33624
|
-
/* @__PURE__ */ jsx57(Box45, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
33625
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "STATUS" })
|
|
33626
|
-
] }),
|
|
33627
|
-
AGENT_NAMES.map((name) => {
|
|
33628
|
-
const isFocused = focusedAgent === name;
|
|
33629
|
-
return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
33630
|
-
/* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
33631
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
|
|
33632
|
-
/* @__PURE__ */ jsx57(Box45, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
|
|
33633
|
-
/* @__PURE__ */ jsx57(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
|
|
33634
|
-
] }, name);
|
|
33635
|
-
}),
|
|
33636
|
-
/* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
|
|
33637
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
33638
|
-
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs46(Box45, { gap: 1, paddingLeft: 1, children: [
|
|
33639
|
-
/* @__PURE__ */ jsx57(Box45, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: row.label }) }),
|
|
33640
|
-
/* @__PURE__ */ jsx57(Text48, { color: TONE_COLOR[row.tone], children: row.value })
|
|
33641
|
-
] }, row.label))
|
|
33642
|
-
] }),
|
|
33643
|
-
notice && /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
33644
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33645
|
-
/* @__PURE__ */ jsxs46(Text48, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33646
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33647
|
-
" ",
|
|
33648
|
-
notice.text
|
|
33649
|
-
] })
|
|
33650
|
-
] }),
|
|
33651
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33652
|
-
/* @__PURE__ */ jsx57(
|
|
33653
|
-
ControlHints,
|
|
33654
|
-
{
|
|
33655
|
-
hints: [
|
|
33656
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
33657
|
-
{ keys: "\u23CE", label: "make default" },
|
|
33658
|
-
{ keys: "\u2192", label: "settings and test" },
|
|
33659
|
-
{ keys: "Esc/q", label: "back" }
|
|
33660
|
-
]
|
|
33661
|
-
}
|
|
33662
|
-
)
|
|
33663
|
-
] });
|
|
33664
|
-
}
|
|
33665
|
-
var NAME_WIDTH, PANEL_LABEL_WIDTH;
|
|
33666
|
-
var init_AgentScreens = __esm({
|
|
33667
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx"() {
|
|
33668
|
-
"use strict";
|
|
33669
|
-
init_src4();
|
|
33670
|
-
init_home_theme();
|
|
33671
|
-
init_control_hints();
|
|
33672
|
-
init_debug_store();
|
|
33673
|
-
init_agent_store();
|
|
33674
|
-
init_agent_status();
|
|
33675
|
-
init_AgentDetail();
|
|
33676
|
-
init_AgentStatusBadge();
|
|
33677
|
-
NAME_WIDTH = 16;
|
|
33678
|
-
PANEL_LABEL_WIDTH = "Command".length;
|
|
33070
|
+
function quit() {
|
|
33071
|
+
void finishDebugRun(
|
|
33072
|
+
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
33073
|
+
);
|
|
33074
|
+
onDone();
|
|
33679
33075
|
}
|
|
33680
|
-
|
|
33681
|
-
|
|
33682
|
-
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
33683
|
-
import { useState as useState31 } from "react";
|
|
33684
|
-
import { Box as Box46, Text as Text49, useInput as useInput13 } from "ink";
|
|
33685
|
-
import TextInput5 from "ink-text-input";
|
|
33686
|
-
import { Fragment as Fragment19, jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
33687
|
-
function FieldForm({
|
|
33688
|
-
title,
|
|
33689
|
-
subtitle,
|
|
33690
|
-
fields,
|
|
33691
|
-
values,
|
|
33692
|
-
onChange,
|
|
33693
|
-
onSave,
|
|
33694
|
-
onQuit,
|
|
33695
|
-
notice,
|
|
33696
|
-
busy = false,
|
|
33697
|
-
footer
|
|
33698
|
-
}) {
|
|
33699
|
-
const [active, setActive] = useState31(0);
|
|
33700
|
-
const [editing, setEditing] = useState31(false);
|
|
33701
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState31("");
|
|
33702
|
-
const labelWidth = Math.max(...fields.map((field) => field.label.length));
|
|
33703
|
-
const current = fields[active];
|
|
33704
|
-
useInput13((input, key) => {
|
|
33705
|
-
if (busy) return;
|
|
33076
|
+
useInput11((input, key) => {
|
|
33077
|
+
if (stage === "loading" || stage === "saving") return;
|
|
33706
33078
|
if (editing) {
|
|
33707
33079
|
if (key.escape) {
|
|
33708
|
-
|
|
33080
|
+
setFieldValue(activeField, valueBeforeEdit);
|
|
33709
33081
|
setEditing(false);
|
|
33710
33082
|
}
|
|
33711
33083
|
return;
|
|
33712
33084
|
}
|
|
33713
33085
|
if (key.escape || input === "q") {
|
|
33714
|
-
|
|
33086
|
+
quit();
|
|
33715
33087
|
return;
|
|
33716
33088
|
}
|
|
33717
33089
|
if (input === "s") {
|
|
33718
|
-
|
|
33090
|
+
handleSave();
|
|
33719
33091
|
return;
|
|
33720
33092
|
}
|
|
33721
33093
|
if (input === "c") {
|
|
33722
|
-
|
|
33094
|
+
setFieldValue(activeField, "");
|
|
33723
33095
|
return;
|
|
33724
33096
|
}
|
|
33725
33097
|
if (key.tab || key.downArrow) {
|
|
33726
|
-
|
|
33098
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
33099
|
+
setActiveField(FIELD_ORDER[(idx + 1) % FIELD_ORDER.length]);
|
|
33727
33100
|
return;
|
|
33728
33101
|
}
|
|
33729
33102
|
if (key.upArrow) {
|
|
33730
|
-
|
|
33103
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
33104
|
+
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
33731
33105
|
return;
|
|
33732
33106
|
}
|
|
33733
33107
|
if (key.return) {
|
|
33734
|
-
setValueBeforeEdit(
|
|
33108
|
+
setValueBeforeEdit(fieldValue(activeField));
|
|
33735
33109
|
setEditing(true);
|
|
33736
33110
|
}
|
|
33737
33111
|
});
|
|
33738
|
-
|
|
33739
|
-
/* @__PURE__ */
|
|
33740
|
-
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33744
|
-
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
33750
|
-
|
|
33112
|
+
if (stage === "loading") {
|
|
33113
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33114
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
33115
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33116
|
+
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.accent, children: "Loading..." })
|
|
33117
|
+
] });
|
|
33118
|
+
}
|
|
33119
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33120
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
33121
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33122
|
+
/* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
33123
|
+
const isActive = activeField === field;
|
|
33124
|
+
const value = fieldValue(field);
|
|
33125
|
+
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
33126
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33127
|
+
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
33128
|
+
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
|
|
33129
|
+
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
33130
|
+
TextInput4,
|
|
33751
33131
|
{
|
|
33752
33132
|
value,
|
|
33753
|
-
onChange: (next) =>
|
|
33133
|
+
onChange: (next) => setFieldValue(field, next),
|
|
33754
33134
|
onSubmit: () => setEditing(false),
|
|
33755
|
-
mask: field
|
|
33135
|
+
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
33756
33136
|
}
|
|
33757
|
-
) : /* @__PURE__ */
|
|
33758
|
-
field
|
|
33759
|
-
] }, field
|
|
33137
|
+
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
33138
|
+
FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
|
|
33139
|
+
] }, field);
|
|
33760
33140
|
}) }),
|
|
33761
|
-
notice && /* @__PURE__ */
|
|
33762
|
-
/* @__PURE__ */
|
|
33763
|
-
/* @__PURE__ */
|
|
33141
|
+
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
33142
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33143
|
+
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33764
33144
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33765
33145
|
" ",
|
|
33766
33146
|
notice.text
|
|
33767
33147
|
] })
|
|
33768
33148
|
] }),
|
|
33769
|
-
|
|
33770
|
-
/* @__PURE__ */
|
|
33771
|
-
/* @__PURE__ */ jsx58(
|
|
33149
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33150
|
+
/* @__PURE__ */ jsx55(
|
|
33772
33151
|
ControlHints,
|
|
33773
33152
|
{
|
|
33774
33153
|
hints: editing ? [
|
|
@@ -33781,219 +33160,53 @@ function FieldForm({
|
|
|
33781
33160
|
{ keys: "\u23CE", label: "edit" },
|
|
33782
33161
|
{ keys: "c", label: "clear" },
|
|
33783
33162
|
{ keys: "s", label: "save" },
|
|
33784
|
-
{ keys: "Esc/q", label: "
|
|
33163
|
+
{ keys: "Esc/q", label: "quit without saving" }
|
|
33785
33164
|
]
|
|
33786
33165
|
}
|
|
33787
33166
|
)
|
|
33788
33167
|
] });
|
|
33789
33168
|
}
|
|
33790
|
-
var
|
|
33791
|
-
"packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx"() {
|
|
33792
|
-
"use strict";
|
|
33793
|
-
init_home_theme();
|
|
33794
|
-
init_control_hints();
|
|
33795
|
-
}
|
|
33796
|
-
});
|
|
33797
|
-
|
|
33798
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
33799
|
-
async function readCredentials() {
|
|
33800
|
-
const store = await readV1Store();
|
|
33801
|
-
return {
|
|
33802
|
-
spaceId: store.spaceId || "",
|
|
33803
|
-
environmentId: store.environmentId || "",
|
|
33804
|
-
cmaToken: store.cmaToken || "",
|
|
33805
|
-
host: store.host || "",
|
|
33806
|
-
defaultComponentDir: store.defaultComponentDir || "",
|
|
33807
|
-
defaultTokenFile: store.defaultTokenFile || "",
|
|
33808
|
-
contentfulBaseDir: store.contentfulBaseDir || ""
|
|
33809
|
-
};
|
|
33810
|
-
}
|
|
33811
|
-
async function writeCredentials(config) {
|
|
33812
|
-
const existing = await readV1Store();
|
|
33813
|
-
const merged = {
|
|
33814
|
-
...existing,
|
|
33815
|
-
...config
|
|
33816
|
-
};
|
|
33817
|
-
Object.keys(merged).forEach((k) => {
|
|
33818
|
-
if (!merged[k]) delete merged[k];
|
|
33819
|
-
});
|
|
33820
|
-
await writeV1Store(merged);
|
|
33821
|
-
}
|
|
33822
|
-
var init_config_store = __esm({
|
|
33823
|
-
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts"() {
|
|
33824
|
-
"use strict";
|
|
33825
|
-
init_v1_store();
|
|
33826
|
-
}
|
|
33827
|
-
});
|
|
33828
|
-
|
|
33829
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
33830
|
-
import { useEffect as useEffect24, useState as useState32 } from "react";
|
|
33831
|
-
import { Box as Box47, Text as Text50 } from "ink";
|
|
33832
|
-
import { jsx as jsx59, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
33833
|
-
function debugFields(config) {
|
|
33834
|
-
return {
|
|
33835
|
-
space_id: config?.spaceId ?? "",
|
|
33836
|
-
environment_id: config?.environmentId ?? "",
|
|
33837
|
-
cma_token: config?.cmaToken ?? "",
|
|
33838
|
-
host: config?.host ?? "",
|
|
33839
|
-
default_component_dir: config?.defaultComponentDir ?? "",
|
|
33840
|
-
default_token_file: config?.defaultTokenFile ?? "",
|
|
33841
|
-
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
33842
|
-
};
|
|
33843
|
-
}
|
|
33844
|
-
function ProjectConfigScreen({ onDone }) {
|
|
33845
|
-
const [config, setConfig] = useState32(null);
|
|
33846
|
-
const [saving, setSaving] = useState32(false);
|
|
33847
|
-
const [notice, setNotice] = useState32(null);
|
|
33848
|
-
const [lastSaved, setLastSaved] = useState32(null);
|
|
33849
|
-
useEffect24(() => {
|
|
33850
|
-
void readCredentials().then((cfg) => {
|
|
33851
|
-
setConfig(cfg);
|
|
33852
|
-
startDebugRun({
|
|
33853
|
-
flow: "settings/contentful-configuration",
|
|
33854
|
-
step: "01-configuration",
|
|
33855
|
-
menuOption: "Configuration > Project",
|
|
33856
|
-
inputs: debugFields(cfg)
|
|
33857
|
-
});
|
|
33858
|
-
});
|
|
33859
|
-
}, []);
|
|
33860
|
-
if (!config) {
|
|
33861
|
-
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33862
|
-
/* @__PURE__ */ jsx59(Text50, { bold: true, children: "Project" }),
|
|
33863
|
-
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
33864
|
-
/* @__PURE__ */ jsx59(Text50, { color: PALETTE.accent, children: "Loading..." })
|
|
33865
|
-
] });
|
|
33866
|
-
}
|
|
33867
|
-
const save = () => {
|
|
33868
|
-
setSaving(true);
|
|
33869
|
-
setNotice(null);
|
|
33870
|
-
writeCredentials(config).then(() => {
|
|
33871
|
-
setLastSaved(config);
|
|
33872
|
-
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
33873
|
-
setNotice({ kind: "success", text: "Project settings saved" });
|
|
33874
|
-
}).catch((err) => {
|
|
33875
|
-
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
33876
|
-
}).finally(() => setSaving(false));
|
|
33877
|
-
};
|
|
33878
|
-
const quit = () => {
|
|
33879
|
-
void finishDebugRun(
|
|
33880
|
-
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
33881
|
-
);
|
|
33882
|
-
onDone();
|
|
33883
|
-
};
|
|
33884
|
-
return /* @__PURE__ */ jsx59(
|
|
33885
|
-
FieldForm,
|
|
33886
|
-
{
|
|
33887
|
-
title: "Project",
|
|
33888
|
-
subtitle: "The Contentful space and where the CLI keeps its files.",
|
|
33889
|
-
fields: FIELDS3,
|
|
33890
|
-
values: valuesOf(config),
|
|
33891
|
-
onChange: (key, value) => {
|
|
33892
|
-
setConfig({ ...config, [key]: value });
|
|
33893
|
-
setNotice(null);
|
|
33894
|
-
},
|
|
33895
|
-
onSave: save,
|
|
33896
|
-
onQuit: quit,
|
|
33897
|
-
notice,
|
|
33898
|
-
busy: saving
|
|
33899
|
-
}
|
|
33900
|
-
);
|
|
33901
|
-
}
|
|
33902
|
-
var FIELDS3, valuesOf;
|
|
33903
|
-
var init_ProjectConfigScreen = __esm({
|
|
33904
|
-
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx"() {
|
|
33905
|
-
"use strict";
|
|
33906
|
-
init_home_theme();
|
|
33907
|
-
init_debug_store();
|
|
33908
|
-
init_FieldForm();
|
|
33909
|
-
init_config_store();
|
|
33910
|
-
FIELDS3 = [
|
|
33911
|
-
{ key: "spaceId", label: "Space ID" },
|
|
33912
|
-
{ key: "environmentId", label: "Environment ID" },
|
|
33913
|
-
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
33914
|
-
{ key: "host", label: "API Host" },
|
|
33915
|
-
{ key: "defaultComponentDir", label: "Default component directory" },
|
|
33916
|
-
{ key: "defaultTokenFile", label: "Default token file" },
|
|
33917
|
-
{ key: "contentfulBaseDir", label: "Root Project Directory", hint: "(where .contentful goes)" }
|
|
33918
|
-
];
|
|
33919
|
-
valuesOf = (config) => Object.fromEntries(FIELDS3.map(({ key }) => [key, config[key] || ""]));
|
|
33920
|
-
}
|
|
33921
|
-
});
|
|
33922
|
-
|
|
33923
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
33924
|
-
import { useState as useState33 } from "react";
|
|
33925
|
-
import { Box as Box48, Text as Text51, useInput as useInput14 } from "ink";
|
|
33926
|
-
import { jsx as jsx60, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
33927
|
-
function ConfigurationScreen({ onDone }) {
|
|
33928
|
-
const [focus, setFocus] = useState33(0);
|
|
33929
|
-
const [open, setOpen] = useState33(null);
|
|
33930
|
-
const close = () => setOpen(null);
|
|
33931
|
-
useInput14((input, key) => {
|
|
33932
|
-
if (open) return;
|
|
33933
|
-
if (key.upArrow) {
|
|
33934
|
-
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
33935
|
-
return;
|
|
33936
|
-
}
|
|
33937
|
-
if (key.downArrow || key.tab) {
|
|
33938
|
-
setFocus((i) => (i + 1) % SECTIONS.length);
|
|
33939
|
-
return;
|
|
33940
|
-
}
|
|
33941
|
-
if (key.return) {
|
|
33942
|
-
setOpen(SECTIONS[focus].id);
|
|
33943
|
-
return;
|
|
33944
|
-
}
|
|
33945
|
-
if (key.escape || input === "q") onDone();
|
|
33946
|
-
});
|
|
33947
|
-
if (open === "project") return /* @__PURE__ */ jsx60(ProjectConfigScreen, { onDone: close });
|
|
33948
|
-
if (open === "agents") return /* @__PURE__ */ jsx60(AgentsScreen, { onDone: close });
|
|
33949
|
-
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33950
|
-
/* @__PURE__ */ jsx60(Text51, { bold: true, children: "Configuration" }),
|
|
33951
|
-
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
33952
|
-
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs49(Box48, { gap: 1, children: [
|
|
33953
|
-
/* @__PURE__ */ jsx60(Text51, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
33954
|
-
/* @__PURE__ */ jsx60(Box48, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text51, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
33955
|
-
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: section.description })
|
|
33956
|
-
] }, section.id)),
|
|
33957
|
-
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
33958
|
-
/* @__PURE__ */ jsx60(
|
|
33959
|
-
ControlHints,
|
|
33960
|
-
{
|
|
33961
|
-
hints: [
|
|
33962
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
33963
|
-
{ keys: "\u23CE", label: "open" },
|
|
33964
|
-
{ keys: "Esc/q", label: "back" }
|
|
33965
|
-
]
|
|
33966
|
-
}
|
|
33967
|
-
)
|
|
33968
|
-
] });
|
|
33969
|
-
}
|
|
33970
|
-
var SECTIONS;
|
|
33169
|
+
var FIELD_ORDER, FIELD_LABELS, FIELD_HINTS, LABEL_WIDTH;
|
|
33971
33170
|
var init_ContentfulConfigScreen = __esm({
|
|
33972
33171
|
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx"() {
|
|
33973
33172
|
"use strict";
|
|
33974
|
-
|
|
33173
|
+
init_theme();
|
|
33174
|
+
init_config_store();
|
|
33175
|
+
init_debug_store();
|
|
33975
33176
|
init_control_hints();
|
|
33976
|
-
|
|
33977
|
-
|
|
33978
|
-
|
|
33979
|
-
|
|
33980
|
-
|
|
33981
|
-
|
|
33982
|
-
|
|
33983
|
-
|
|
33984
|
-
{ id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
|
|
33177
|
+
FIELD_ORDER = [
|
|
33178
|
+
"spaceId",
|
|
33179
|
+
"environmentId",
|
|
33180
|
+
"cmaToken",
|
|
33181
|
+
"host",
|
|
33182
|
+
"defaultComponentDir",
|
|
33183
|
+
"defaultTokenFile",
|
|
33184
|
+
"contentfulBaseDir"
|
|
33985
33185
|
];
|
|
33186
|
+
FIELD_LABELS = {
|
|
33187
|
+
spaceId: "Space ID",
|
|
33188
|
+
environmentId: "Environment ID",
|
|
33189
|
+
cmaToken: "CMA Token",
|
|
33190
|
+
host: "API Host",
|
|
33191
|
+
defaultComponentDir: "Default component directory",
|
|
33192
|
+
defaultTokenFile: "Default token file",
|
|
33193
|
+
contentfulBaseDir: "Root Project Directory"
|
|
33194
|
+
};
|
|
33195
|
+
FIELD_HINTS = {
|
|
33196
|
+
contentfulBaseDir: "(where .contentful goes)"
|
|
33197
|
+
};
|
|
33198
|
+
LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
|
|
33986
33199
|
}
|
|
33987
33200
|
});
|
|
33988
33201
|
|
|
33989
33202
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
33990
|
-
import { useEffect as
|
|
33991
|
-
import { Box as
|
|
33992
|
-
import { Fragment as
|
|
33203
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
33204
|
+
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
33205
|
+
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33993
33206
|
function OptInAnalyticsScreen({ onDone }) {
|
|
33994
|
-
const [loading, setLoading] =
|
|
33995
|
-
const [enabled, setEnabled] =
|
|
33996
|
-
|
|
33207
|
+
const [loading, setLoading] = useState30(true);
|
|
33208
|
+
const [enabled, setEnabled] = useState30(true);
|
|
33209
|
+
useEffect23(() => {
|
|
33997
33210
|
readAnalyticsSetting().then((setting) => {
|
|
33998
33211
|
setEnabled(setting.enabled);
|
|
33999
33212
|
setLoading(false);
|
|
@@ -34005,7 +33218,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
34005
33218
|
});
|
|
34006
33219
|
});
|
|
34007
33220
|
}, []);
|
|
34008
|
-
|
|
33221
|
+
useInput12((input, key) => {
|
|
34009
33222
|
if (loading) return;
|
|
34010
33223
|
if (key.return || input === " ") {
|
|
34011
33224
|
setEnabled((current) => {
|
|
@@ -34020,21 +33233,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
34020
33233
|
onDone();
|
|
34021
33234
|
}
|
|
34022
33235
|
});
|
|
34023
|
-
return /* @__PURE__ */
|
|
34024
|
-
/* @__PURE__ */
|
|
34025
|
-
/* @__PURE__ */
|
|
34026
|
-
loading ? /* @__PURE__ */
|
|
34027
|
-
/* @__PURE__ */
|
|
33236
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33237
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
33238
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33239
|
+
loading ? /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
33240
|
+
/* @__PURE__ */ jsxs46(Text47, { children: [
|
|
34028
33241
|
"Share anonymous usage data:",
|
|
34029
33242
|
" ",
|
|
34030
|
-
/* @__PURE__ */
|
|
33243
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
34031
33244
|
] }),
|
|
34032
|
-
/* @__PURE__ */
|
|
34033
|
-
/* @__PURE__ */
|
|
34034
|
-
/* @__PURE__ */
|
|
33245
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33246
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
33247
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
34035
33248
|
] }),
|
|
34036
|
-
/* @__PURE__ */
|
|
34037
|
-
/* @__PURE__ */
|
|
33249
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33250
|
+
/* @__PURE__ */ jsx56(
|
|
34038
33251
|
ControlHints,
|
|
34039
33252
|
{
|
|
34040
33253
|
hints: [
|
|
@@ -34048,7 +33261,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
34048
33261
|
var init_screen11 = __esm({
|
|
34049
33262
|
"packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx"() {
|
|
34050
33263
|
"use strict";
|
|
34051
|
-
|
|
33264
|
+
init_theme();
|
|
34052
33265
|
init_analytics_store();
|
|
34053
33266
|
init_debug_store();
|
|
34054
33267
|
init_control_hints();
|
|
@@ -34056,12 +33269,12 @@ var init_screen11 = __esm({
|
|
|
34056
33269
|
});
|
|
34057
33270
|
|
|
34058
33271
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
34059
|
-
import { useEffect as
|
|
34060
|
-
import { Box as
|
|
34061
|
-
import { jsx as
|
|
33272
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
33273
|
+
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
33274
|
+
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
34062
33275
|
function UpgradeScreen({ onDone }) {
|
|
34063
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
34064
|
-
|
|
33276
|
+
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
33277
|
+
useEffect24(() => {
|
|
34065
33278
|
startDebugRun({
|
|
34066
33279
|
flow: "upgrade",
|
|
34067
33280
|
step: "01-upgrade",
|
|
@@ -34070,7 +33283,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
34070
33283
|
});
|
|
34071
33284
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
34072
33285
|
}, []);
|
|
34073
|
-
|
|
33286
|
+
useInput13((_input, key) => {
|
|
34074
33287
|
if (key.return) {
|
|
34075
33288
|
void finishDebugRun({
|
|
34076
33289
|
outputs: upgradeCheck ?? {},
|
|
@@ -34081,12 +33294,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
34081
33294
|
return;
|
|
34082
33295
|
}
|
|
34083
33296
|
});
|
|
34084
|
-
return /* @__PURE__ */
|
|
34085
|
-
/* @__PURE__ */
|
|
34086
|
-
/* @__PURE__ */
|
|
33297
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33298
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Upgrade" }),
|
|
33299
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
34087
33300
|
renderBody(upgradeCheck),
|
|
34088
|
-
/* @__PURE__ */
|
|
34089
|
-
/* @__PURE__ */
|
|
33301
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33302
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.accent, children: [
|
|
34090
33303
|
FOCUS_MARKER,
|
|
34091
33304
|
" Go Back"
|
|
34092
33305
|
] })
|
|
@@ -34094,40 +33307,41 @@ function UpgradeScreen({ onDone }) {
|
|
|
34094
33307
|
}
|
|
34095
33308
|
function renderBody(upgradeCheck) {
|
|
34096
33309
|
if (!upgradeCheck) {
|
|
34097
|
-
return /* @__PURE__ */
|
|
33310
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
34098
33311
|
}
|
|
34099
33312
|
if (upgradeCheck.status === "error") {
|
|
34100
|
-
return /* @__PURE__ */
|
|
33313
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
34101
33314
|
}
|
|
34102
33315
|
if (upgradeCheck.status === "up-to-date") {
|
|
34103
|
-
return /* @__PURE__ */
|
|
33316
|
+
return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.success, children: [
|
|
34104
33317
|
"You're already on the latest version (v",
|
|
34105
33318
|
upgradeCheck.current,
|
|
34106
33319
|
")."
|
|
34107
33320
|
] });
|
|
34108
33321
|
}
|
|
34109
|
-
return /* @__PURE__ */
|
|
34110
|
-
/* @__PURE__ */
|
|
34111
|
-
/* @__PURE__ */
|
|
33322
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", children: [
|
|
33323
|
+
/* @__PURE__ */ jsxs47(Text48, { color: PALETTE.muted, children: [
|
|
33324
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.success, children: [
|
|
34112
33325
|
"v",
|
|
34113
33326
|
upgradeCheck.latest
|
|
34114
33327
|
] }),
|
|
34115
33328
|
" ",
|
|
34116
33329
|
"is available (you're on ",
|
|
34117
|
-
/* @__PURE__ */
|
|
33330
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, children: [
|
|
34118
33331
|
"v",
|
|
34119
33332
|
upgradeCheck.current
|
|
34120
33333
|
] }),
|
|
34121
33334
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
34122
33335
|
] }),
|
|
34123
|
-
/* @__PURE__ */
|
|
34124
|
-
/* @__PURE__ */
|
|
33336
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33337
|
+
/* @__PURE__ */ jsx57(Box46, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx57(Text48, { bold: true, children: cmd }, cmd)) })
|
|
34125
33338
|
] });
|
|
34126
33339
|
}
|
|
34127
33340
|
var UPGRADE_COMMANDS;
|
|
34128
33341
|
var init_PageContainer4 = __esm({
|
|
34129
33342
|
"packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx"() {
|
|
34130
33343
|
"use strict";
|
|
33344
|
+
init_theme();
|
|
34131
33345
|
init_home_theme();
|
|
34132
33346
|
init_version();
|
|
34133
33347
|
init_debug_store();
|
|
@@ -34136,13 +33350,13 @@ var init_PageContainer4 = __esm({
|
|
|
34136
33350
|
});
|
|
34137
33351
|
|
|
34138
33352
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
34139
|
-
import { useEffect as
|
|
34140
|
-
import { Box as
|
|
34141
|
-
import { jsx as
|
|
33353
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
33354
|
+
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
33355
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
34142
33356
|
function DebugModeScreen({ onDone }) {
|
|
34143
|
-
const [loading, setLoading] =
|
|
34144
|
-
const [enabled, setEnabled] =
|
|
34145
|
-
|
|
33357
|
+
const [loading, setLoading] = useState32(true);
|
|
33358
|
+
const [enabled, setEnabled] = useState32(true);
|
|
33359
|
+
useEffect25(() => {
|
|
34146
33360
|
readDebugModeSetting().then((setting) => {
|
|
34147
33361
|
setEnabled(setting.enabled);
|
|
34148
33362
|
setLoading(false);
|
|
@@ -34154,7 +33368,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
34154
33368
|
});
|
|
34155
33369
|
});
|
|
34156
33370
|
}, []);
|
|
34157
|
-
|
|
33371
|
+
useInput14((input, key) => {
|
|
34158
33372
|
if (loading) return;
|
|
34159
33373
|
if (key.return || input === " ") {
|
|
34160
33374
|
setEnabled((current) => {
|
|
@@ -34169,16 +33383,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
34169
33383
|
onDone();
|
|
34170
33384
|
}
|
|
34171
33385
|
});
|
|
34172
|
-
return /* @__PURE__ */
|
|
34173
|
-
/* @__PURE__ */
|
|
34174
|
-
/* @__PURE__ */
|
|
34175
|
-
loading ? /* @__PURE__ */
|
|
33386
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33387
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
33388
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33389
|
+
loading ? /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs48(Text49, { children: [
|
|
34176
33390
|
"Debug logging:",
|
|
34177
33391
|
" ",
|
|
34178
|
-
/* @__PURE__ */
|
|
33392
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
34179
33393
|
] }),
|
|
34180
|
-
/* @__PURE__ */
|
|
34181
|
-
/* @__PURE__ */
|
|
33394
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33395
|
+
/* @__PURE__ */ jsx58(
|
|
34182
33396
|
ControlHints,
|
|
34183
33397
|
{
|
|
34184
33398
|
hints: [
|
|
@@ -34192,7 +33406,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
34192
33406
|
var init_screen12 = __esm({
|
|
34193
33407
|
"packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx"() {
|
|
34194
33408
|
"use strict";
|
|
34195
|
-
|
|
33409
|
+
init_theme();
|
|
34196
33410
|
init_debug_mode_store();
|
|
34197
33411
|
init_debug_store();
|
|
34198
33412
|
init_control_hints();
|
|
@@ -34204,20 +33418,20 @@ var app_exports = {};
|
|
|
34204
33418
|
__export(app_exports, {
|
|
34205
33419
|
runApp: () => runApp
|
|
34206
33420
|
});
|
|
34207
|
-
import { join as
|
|
34208
|
-
import { useEffect as
|
|
34209
|
-
import { Fragment as
|
|
33421
|
+
import { join as join27 } from "node:path";
|
|
33422
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
33423
|
+
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
34210
33424
|
function App({ importOptions, inkClear }) {
|
|
34211
|
-
const [screen, setScreen] =
|
|
34212
|
-
const [importExitCode, setImportExitCode] =
|
|
33425
|
+
const [screen, setScreen] = useState33("start");
|
|
33426
|
+
const [importExitCode, setImportExitCode] = useState33();
|
|
34213
33427
|
const showImportResult = importExitCode !== void 0;
|
|
34214
|
-
const [projectPath, setProjectPath] =
|
|
34215
|
-
const [tokensPath, setTokensPath] =
|
|
34216
|
-
const [scannedFiles, setScannedFiles] =
|
|
34217
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
34218
|
-
const [extractionRun, setExtractionRun] =
|
|
33428
|
+
const [projectPath, setProjectPath] = useState33();
|
|
33429
|
+
const [tokensPath, setTokensPath] = useState33();
|
|
33430
|
+
const [scannedFiles, setScannedFiles] = useState33();
|
|
33431
|
+
const [pendingLaunch, setPendingLaunch] = useState33();
|
|
33432
|
+
const [extractionRun, setExtractionRun] = useState33();
|
|
34219
33433
|
const extraction = useExtraction(extractionRun?.input);
|
|
34220
|
-
const [scopeRun, setScopeRun] =
|
|
33434
|
+
const [scopeRun, setScopeRun] = useState33();
|
|
34221
33435
|
const scopeFlow = useScopeGateFlow(
|
|
34222
33436
|
scopeRun && {
|
|
34223
33437
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -34232,12 +33446,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34232
33446
|
}
|
|
34233
33447
|
}
|
|
34234
33448
|
);
|
|
34235
|
-
const [generationInput, setGenerationInput] =
|
|
33449
|
+
const [generationInput, setGenerationInput] = useState33();
|
|
34236
33450
|
const generation = useGeneration(generationInput);
|
|
34237
|
-
const [flowStart, setFlowStart] =
|
|
33451
|
+
const [flowStart, setFlowStart] = useState33();
|
|
34238
33452
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
34239
|
-
const [importDefaults, setImportDefaults] =
|
|
34240
|
-
|
|
33453
|
+
const [importDefaults, setImportDefaults] = useState33();
|
|
33454
|
+
useEffect26(() => {
|
|
34241
33455
|
if (screen !== "import") {
|
|
34242
33456
|
setImportDefaults(void 0);
|
|
34243
33457
|
return;
|
|
@@ -34255,7 +33469,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34255
33469
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
34256
33470
|
const state2 = await inspectTokens({
|
|
34257
33471
|
rawTokensPath: tokens,
|
|
34258
|
-
contentfulDir:
|
|
33472
|
+
contentfulDir: join27(resolveUserPath(projectPath2), ".contentful"),
|
|
34259
33473
|
cache: importOptions.cache
|
|
34260
33474
|
});
|
|
34261
33475
|
if (state2.kind === "cached") {
|
|
@@ -34297,12 +33511,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34297
33511
|
}
|
|
34298
33512
|
});
|
|
34299
33513
|
};
|
|
34300
|
-
|
|
33514
|
+
useEffect26(() => {
|
|
34301
33515
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
34302
33516
|
setExtractionRun(void 0);
|
|
34303
33517
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
34304
33518
|
}, [extraction, extractionRun]);
|
|
34305
|
-
|
|
33519
|
+
useEffect26(() => {
|
|
34306
33520
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
34307
33521
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34308
33522
|
setGenerationInput({
|
|
@@ -34320,7 +33534,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34320
33534
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
34321
33535
|
});
|
|
34322
33536
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
34323
|
-
|
|
33537
|
+
useEffect26(() => {
|
|
34324
33538
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
34325
33539
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34326
33540
|
inkClear();
|
|
@@ -34363,9 +33577,9 @@ function App({ importOptions, inkClear }) {
|
|
|
34363
33577
|
};
|
|
34364
33578
|
switch (screen) {
|
|
34365
33579
|
case "import":
|
|
34366
|
-
if (showImportResult) return /* @__PURE__ */
|
|
33580
|
+
if (showImportResult) return /* @__PURE__ */ jsx59(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
34367
33581
|
if (flow && flowStart) {
|
|
34368
|
-
return /* @__PURE__ */
|
|
33582
|
+
return /* @__PURE__ */ jsx59(
|
|
34369
33583
|
FlowScreen,
|
|
34370
33584
|
{
|
|
34371
33585
|
state: flow.state,
|
|
@@ -34375,12 +33589,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34375
33589
|
}
|
|
34376
33590
|
);
|
|
34377
33591
|
}
|
|
34378
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
33592
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
34379
33593
|
if (projectPath === void 0) {
|
|
34380
|
-
return /* @__PURE__ */
|
|
33594
|
+
return /* @__PURE__ */ jsx59(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
34381
33595
|
}
|
|
34382
33596
|
if (tokensPath === void 0) {
|
|
34383
|
-
return /* @__PURE__ */
|
|
33597
|
+
return /* @__PURE__ */ jsx59(
|
|
34384
33598
|
TokenInputScreen,
|
|
34385
33599
|
{
|
|
34386
33600
|
initialPath: importDefaults.tokenFile,
|
|
@@ -34390,7 +33604,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34390
33604
|
);
|
|
34391
33605
|
}
|
|
34392
33606
|
if (scannedFiles === void 0) {
|
|
34393
|
-
return /* @__PURE__ */
|
|
33607
|
+
return /* @__PURE__ */ jsx59(
|
|
34394
33608
|
PathValidationScreen,
|
|
34395
33609
|
{
|
|
34396
33610
|
projectPath,
|
|
@@ -34402,10 +33616,10 @@ function App({ importOptions, inkClear }) {
|
|
|
34402
33616
|
}
|
|
34403
33617
|
if (extractionRun) {
|
|
34404
33618
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
34405
|
-
return /* @__PURE__ */
|
|
33619
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
34406
33620
|
}
|
|
34407
33621
|
if (extraction?.status === "running") {
|
|
34408
|
-
return /* @__PURE__ */
|
|
33622
|
+
return /* @__PURE__ */ jsx59(
|
|
34409
33623
|
ExtractionScreen,
|
|
34410
33624
|
{
|
|
34411
33625
|
progress: extraction.progress,
|
|
@@ -34414,14 +33628,14 @@ function App({ importOptions, inkClear }) {
|
|
|
34414
33628
|
}
|
|
34415
33629
|
);
|
|
34416
33630
|
}
|
|
34417
|
-
return /* @__PURE__ */
|
|
33631
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
34418
33632
|
}
|
|
34419
33633
|
if (scopeRun && scopeFlow) {
|
|
34420
33634
|
if (scopeFlow.status === "failed") {
|
|
34421
|
-
return /* @__PURE__ */
|
|
33635
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
34422
33636
|
}
|
|
34423
33637
|
if (scopeFlow.status === "deciding") {
|
|
34424
|
-
return /* @__PURE__ */
|
|
33638
|
+
return /* @__PURE__ */ jsx59(
|
|
34425
33639
|
ScopeGateScreen,
|
|
34426
33640
|
{
|
|
34427
33641
|
components: scopeFlow.load.components,
|
|
@@ -34431,7 +33645,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34431
33645
|
);
|
|
34432
33646
|
}
|
|
34433
33647
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
34434
|
-
return /* @__PURE__ */
|
|
33648
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
34435
33649
|
}
|
|
34436
33650
|
if (generation?.status === "running") {
|
|
34437
33651
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -34439,7 +33653,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34439
33653
|
hasRawTokens,
|
|
34440
33654
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
34441
33655
|
});
|
|
34442
|
-
return /* @__PURE__ */
|
|
33656
|
+
return /* @__PURE__ */ jsx59(
|
|
34443
33657
|
GenerationScreen,
|
|
34444
33658
|
{
|
|
34445
33659
|
progress: generation.progress,
|
|
@@ -34451,10 +33665,10 @@ function App({ importOptions, inkClear }) {
|
|
|
34451
33665
|
}
|
|
34452
33666
|
);
|
|
34453
33667
|
}
|
|
34454
|
-
return /* @__PURE__ */
|
|
33668
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
34455
33669
|
}
|
|
34456
33670
|
if (pendingLaunch?.cached) {
|
|
34457
|
-
return /* @__PURE__ */
|
|
33671
|
+
return /* @__PURE__ */ jsx59(
|
|
34458
33672
|
TokenReuseScreen,
|
|
34459
33673
|
{
|
|
34460
33674
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -34465,7 +33679,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34465
33679
|
}
|
|
34466
33680
|
);
|
|
34467
33681
|
}
|
|
34468
|
-
return /* @__PURE__ */
|
|
33682
|
+
return /* @__PURE__ */ jsx59(
|
|
34469
33683
|
CredentialsScreen,
|
|
34470
33684
|
{
|
|
34471
33685
|
initial: importDefaults.credentials,
|
|
@@ -34474,19 +33688,19 @@ function App({ importOptions, inkClear }) {
|
|
|
34474
33688
|
}
|
|
34475
33689
|
);
|
|
34476
33690
|
case "help":
|
|
34477
|
-
return /* @__PURE__ */
|
|
33691
|
+
return /* @__PURE__ */ jsx59(HelpScreen, { onDone: goToStart });
|
|
34478
33692
|
case "upgrade":
|
|
34479
|
-
return /* @__PURE__ */
|
|
33693
|
+
return /* @__PURE__ */ jsx59(UpgradeScreen, { onDone: goToStart });
|
|
34480
33694
|
case "settings":
|
|
34481
|
-
return /* @__PURE__ */
|
|
33695
|
+
return /* @__PURE__ */ jsx59(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
34482
33696
|
case "settings-configuration":
|
|
34483
|
-
return /* @__PURE__ */
|
|
33697
|
+
return /* @__PURE__ */ jsx59(ConfigurationScreen, { onDone: goToSettings });
|
|
34484
33698
|
case "settings-opt-in-analytics":
|
|
34485
|
-
return /* @__PURE__ */
|
|
33699
|
+
return /* @__PURE__ */ jsx59(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
34486
33700
|
case "settings-debug-mode":
|
|
34487
|
-
return /* @__PURE__ */
|
|
33701
|
+
return /* @__PURE__ */ jsx59(DebugModeScreen, { onDone: goToSettings });
|
|
34488
33702
|
case "start":
|
|
34489
|
-
return /* @__PURE__ */
|
|
33703
|
+
return /* @__PURE__ */ jsx59(HomeScreen, { onNavigate: setScreen });
|
|
34490
33704
|
}
|
|
34491
33705
|
}
|
|
34492
33706
|
async function runApp(renderApp, importOptions) {
|
|
@@ -34494,7 +33708,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
34494
33708
|
instance.clear?.();
|
|
34495
33709
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
34496
33710
|
};
|
|
34497
|
-
const instance = renderApp(/* @__PURE__ */
|
|
33711
|
+
const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear }));
|
|
34498
33712
|
await instance.waitUntilExit();
|
|
34499
33713
|
}
|
|
34500
33714
|
var init_app = __esm({
|
|
@@ -34529,7 +33743,7 @@ var init_app = __esm({
|
|
|
34529
33743
|
// packages/experience-design-system-cli/program.ts
|
|
34530
33744
|
init_src4();
|
|
34531
33745
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
34532
|
-
import { join as
|
|
33746
|
+
import { join as join28 } from "node:path";
|
|
34533
33747
|
import { Command } from "commander";
|
|
34534
33748
|
|
|
34535
33749
|
// packages/experience-design-system-cli/src/legacy/run-legacy.ts
|
|
@@ -34633,14 +33847,14 @@ function runDevWatch(args) {
|
|
|
34633
33847
|
process.stderr.write("--watch only works from a checkout of the repo (scripts/dev.mjs is not in the package).\n");
|
|
34634
33848
|
return Promise.resolve(1);
|
|
34635
33849
|
}
|
|
34636
|
-
return new Promise((
|
|
33850
|
+
return new Promise((resolve27) => {
|
|
34637
33851
|
const child = spawn4(process.execPath, [script, ...args], { stdio: "inherit" });
|
|
34638
33852
|
process.on("SIGINT", () => void 0);
|
|
34639
|
-
child.on("exit", (code) =>
|
|
33853
|
+
child.on("exit", (code) => resolve27(code ?? 0));
|
|
34640
33854
|
child.on("error", (err) => {
|
|
34641
33855
|
process.stderr.write(`${err.message}
|
|
34642
33856
|
`);
|
|
34643
|
-
|
|
33857
|
+
resolve27(1);
|
|
34644
33858
|
});
|
|
34645
33859
|
});
|
|
34646
33860
|
}
|
|
@@ -34662,13 +33876,11 @@ function registerImportCommand(program, openTui) {
|
|
|
34662
33876
|
}
|
|
34663
33877
|
|
|
34664
33878
|
// packages/experience-design-system-cli/program.ts
|
|
34665
|
-
init_agent_store();
|
|
34666
|
-
init_apply_binary_overrides();
|
|
34667
33879
|
init_analytics_store();
|
|
34668
33880
|
init_package_root();
|
|
34669
33881
|
var pkg = JSON.parse(
|
|
34670
33882
|
readFileSync9(
|
|
34671
|
-
|
|
33883
|
+
join28(findPackageRoot(import.meta.url, "@contentful/experience-design-system-cli"), "package.json"),
|
|
34672
33884
|
"utf8"
|
|
34673
33885
|
)
|
|
34674
33886
|
);
|
|
@@ -34686,7 +33898,6 @@ function createProgram() {
|
|
|
34686
33898
|
const commandChain = chain.join(" ") || actionCommand.name();
|
|
34687
33899
|
const { enabled } = await readAnalyticsSetting();
|
|
34688
33900
|
setPersistedAnalyticsDisabled(!enabled);
|
|
34689
|
-
await readAgentConfig().then(applyBinaryOverrides, () => void 0);
|
|
34690
33901
|
setCliVersion(pkg.version);
|
|
34691
33902
|
noteCommandStart(commandChain);
|
|
34692
33903
|
});
|
|
@@ -34710,7 +33921,7 @@ init_config();
|
|
|
34710
33921
|
init_package_root();
|
|
34711
33922
|
import { existsSync as existsSync12 } from "node:fs";
|
|
34712
33923
|
import { mkdir as mkdir10, readFile as readFile19, rename as rename3, rmdir, unlink } from "node:fs/promises";
|
|
34713
|
-
import { dirname as dirname16, join as
|
|
33924
|
+
import { dirname as dirname16, join as join29 } from "node:path";
|
|
34714
33925
|
var PACKAGE_NAME4 = "@contentful/experience-design-system-cli";
|
|
34715
33926
|
async function readJson(path5) {
|
|
34716
33927
|
try {
|
|
@@ -34721,9 +33932,9 @@ async function readJson(path5) {
|
|
|
34721
33932
|
}
|
|
34722
33933
|
async function migrateOldConfig() {
|
|
34723
33934
|
try {
|
|
34724
|
-
const oldCredentials =
|
|
34725
|
-
const oldRuns =
|
|
34726
|
-
const oldDebugMode =
|
|
33935
|
+
const oldCredentials = join29(oldConfigDir2(), "credentials.json");
|
|
33936
|
+
const oldRuns = join29(oldConfigDir2(), "runs.json");
|
|
33937
|
+
const oldDebugMode = join29(
|
|
34727
33938
|
findPackageRoot(import.meta.url, PACKAGE_NAME4),
|
|
34728
33939
|
".contentful",
|
|
34729
33940
|
"config",
|