@contentful/experience-design-system-cli 2.37.1-dev-build-d5797739.0 → 2.37.1-dev-build-1cd1ccfb.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 +473 -769
- package/dist/index.js +542 -872
- 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 +4 -4
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +14 -5
- package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +0 -1
- package/dist/src/tui/theme.d.ts +19 -0
- package/legacy/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/help/file-locations.d.ts +0 -23
- package/dist/src/tui/import/steps/09-review/theme.d.ts +0 -9
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +0 -8
- package/dist/src/tui/settings/agents/agent-store.d.ts +0 -14
- package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +0 -5
- package/dist/src/tui/settings/shared/FieldForm.d.ts +0 -35
package/dist/app.js
CHANGED
|
@@ -837,7 +837,7 @@ async function runAgent(options) {
|
|
|
837
837
|
promptLen: prompt.length,
|
|
838
838
|
promptHead: prompt.slice(0, 500)
|
|
839
839
|
});
|
|
840
|
-
return new Promise((
|
|
840
|
+
return new Promise((resolve27) => {
|
|
841
841
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
842
842
|
const child = spawn(binary, args, {
|
|
843
843
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -886,7 +886,7 @@ async function runAgent(options) {
|
|
|
886
886
|
stderrLen: stderr.length,
|
|
887
887
|
stderrTail: stderr.slice(-1e3)
|
|
888
888
|
});
|
|
889
|
-
|
|
889
|
+
resolve27(result);
|
|
890
890
|
});
|
|
891
891
|
});
|
|
892
892
|
}
|
|
@@ -908,7 +908,7 @@ async function checkAgentAuth(agent) {
|
|
|
908
908
|
return "not-found";
|
|
909
909
|
if (agent !== "claude")
|
|
910
910
|
return "ok";
|
|
911
|
-
return new Promise((
|
|
911
|
+
return new Promise((resolve27) => {
|
|
912
912
|
const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
913
913
|
let stdout = "";
|
|
914
914
|
let done = false;
|
|
@@ -917,7 +917,7 @@ async function checkAgentAuth(agent) {
|
|
|
917
917
|
return;
|
|
918
918
|
done = true;
|
|
919
919
|
child.kill("SIGTERM");
|
|
920
|
-
|
|
920
|
+
resolve27("unauthenticated");
|
|
921
921
|
}, 5e3);
|
|
922
922
|
child.stdout?.on("data", (chunk) => {
|
|
923
923
|
stdout += chunk.toString();
|
|
@@ -928,14 +928,14 @@ async function checkAgentAuth(agent) {
|
|
|
928
928
|
done = true;
|
|
929
929
|
clearTimeout(timer);
|
|
930
930
|
if (code !== 0) {
|
|
931
|
-
|
|
931
|
+
resolve27("unauthenticated");
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
934
|
try {
|
|
935
935
|
const status = JSON.parse(stdout);
|
|
936
|
-
|
|
936
|
+
resolve27(status.loggedIn ? "ok" : "unauthenticated");
|
|
937
937
|
} catch {
|
|
938
|
-
|
|
938
|
+
resolve27("unauthenticated");
|
|
939
939
|
}
|
|
940
940
|
});
|
|
941
941
|
});
|
|
@@ -945,9 +945,9 @@ async function binaryIsOnPath(binary) {
|
|
|
945
945
|
const fs = await import("node:fs/promises");
|
|
946
946
|
return fs.access(binary).then(() => true, () => false);
|
|
947
947
|
}
|
|
948
|
-
return new Promise((
|
|
948
|
+
return new Promise((resolve27) => {
|
|
949
949
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
950
|
-
child.on("close", (code) =>
|
|
950
|
+
child.on("close", (code) => resolve27(code === 0));
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
953
|
var init_check_agent_auth = __esm({
|
|
@@ -2329,32 +2329,51 @@ var init_debug_store = __esm({
|
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
2331
|
// packages/experience-design-system-cli/app.tsx
|
|
2332
|
-
import { join as
|
|
2333
|
-
import { useEffect as
|
|
2332
|
+
import { join as join25 } from "node:path";
|
|
2333
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
2334
2334
|
|
|
2335
2335
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
2336
2336
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
2337
2337
|
import { Box, Text as Text2, useApp, useInput } from "ink";
|
|
2338
2338
|
|
|
2339
|
-
// packages/experience-design-system-cli/src/tui/
|
|
2340
|
-
var
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2339
|
+
// packages/experience-design-system-cli/src/tui/theme.ts
|
|
2340
|
+
var DARK = {
|
|
2341
|
+
text: "#f7f9fa",
|
|
2342
|
+
// gray/100
|
|
2343
|
+
muted: "#aec1cc",
|
|
2344
|
+
// gray/400
|
|
2345
|
+
border: "#aec1cc",
|
|
2346
|
+
// gray/400
|
|
2347
|
+
accent: "#40a0ff",
|
|
2348
|
+
// blue/400
|
|
2349
|
+
error: "#ff707d",
|
|
2350
|
+
// red/400
|
|
2351
|
+
success: "#00C459",
|
|
2352
|
+
warning: "#FFDA00"
|
|
2348
2353
|
};
|
|
2349
|
-
var
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2354
|
+
var LIGHT = {
|
|
2355
|
+
text: "#111b2b",
|
|
2356
|
+
// gray/900
|
|
2357
|
+
muted: "#5a657c",
|
|
2358
|
+
// gray/600
|
|
2359
|
+
border: "#5a657c",
|
|
2360
|
+
// gray/600
|
|
2361
|
+
accent: "#0059c8",
|
|
2362
|
+
// blue/600, semantic primary
|
|
2363
|
+
error: "#bd002a",
|
|
2364
|
+
// semantic negative
|
|
2365
|
+
success: "#00C459",
|
|
2366
|
+
warning: "#FFDA00"
|
|
2356
2367
|
};
|
|
2357
|
-
|
|
2368
|
+
function detectColorMode(env = process.env) {
|
|
2369
|
+
const bg = env.COLORFGBG?.split(";").pop();
|
|
2370
|
+
if (bg === "7" || bg === "15") return "light";
|
|
2371
|
+
return "dark";
|
|
2372
|
+
}
|
|
2373
|
+
var PALETTE = detectColorMode() === "light" ? LIGHT : DARK;
|
|
2374
|
+
|
|
2375
|
+
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
2376
|
+
var BRAND_RAMP = [PALETTE.accent, PALETTE.error, PALETTE.warning];
|
|
2358
2377
|
var BAR_CELL = "\u2501";
|
|
2359
2378
|
function brandBar(width, ramp = BRAND_RAMP) {
|
|
2360
2379
|
if (width <= 0 || ramp.length === 0) return [];
|
|
@@ -13824,7 +13843,7 @@ function errorMessage(error) {
|
|
|
13824
13843
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
13825
13844
|
}
|
|
13826
13845
|
function defaultSleep(delayMs) {
|
|
13827
|
-
return new Promise((
|
|
13846
|
+
return new Promise((resolve27) => setTimeout(resolve27, delayMs));
|
|
13828
13847
|
}
|
|
13829
13848
|
|
|
13830
13849
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/sanitize-preview.js
|
|
@@ -14065,7 +14084,7 @@ var ApiClient = class {
|
|
|
14065
14084
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14066
14085
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14067
14086
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14068
|
-
await new Promise((
|
|
14087
|
+
await new Promise((resolve27) => setTimeout(resolve27, baseDelay + jitter));
|
|
14069
14088
|
}
|
|
14070
14089
|
}
|
|
14071
14090
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -16374,7 +16393,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
16374
16393
|
const message = error instanceof Error ? error.message : String(error);
|
|
16375
16394
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
16376
16395
|
throw error;
|
|
16377
|
-
await new Promise((
|
|
16396
|
+
await new Promise((resolve27) => setTimeout(resolve27, Math.min(250 * attempt, 2e3)));
|
|
16378
16397
|
}
|
|
16379
16398
|
}
|
|
16380
16399
|
}
|
|
@@ -21470,17 +21489,6 @@ function PreviewValidationErrorScreen({
|
|
|
21470
21489
|
import { useCallback as useCallback5, useEffect as useEffect16, useMemo as useMemo4, useRef as useRef11, useState as useState22 } from "react";
|
|
21471
21490
|
import figures7 from "figures";
|
|
21472
21491
|
|
|
21473
|
-
// packages/experience-design-system-cli/src/tui/import/steps/09-review/theme.ts
|
|
21474
|
-
var PALETTE3 = {
|
|
21475
|
-
info: PALETTE.accent,
|
|
21476
|
-
success: PALETTE.success,
|
|
21477
|
-
error: PALETTE.error,
|
|
21478
|
-
warning: PALETTE.warning,
|
|
21479
|
-
muted: PALETTE.muted,
|
|
21480
|
-
border: PALETTE.border,
|
|
21481
|
-
inverse: "#FFFFFF"
|
|
21482
|
-
};
|
|
21483
|
-
|
|
21484
21492
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
21485
21493
|
var HIDDEN_PROP_CATEGORIES = /* @__PURE__ */ new Set(["state", "unattached"]);
|
|
21486
21494
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
@@ -21911,13 +21919,13 @@ function serializeState(state2, originalJson) {
|
|
|
21911
21919
|
}
|
|
21912
21920
|
function Picker({ value, active }) {
|
|
21913
21921
|
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
21914
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
21915
|
-
/* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21916
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
21922
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u2039" }),
|
|
21923
|
+
/* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
21924
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u203A" })
|
|
21917
21925
|
] });
|
|
21918
21926
|
}
|
|
21919
21927
|
function Toggle({ value, active }) {
|
|
21920
|
-
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21928
|
+
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
21921
21929
|
}
|
|
21922
21930
|
function InlinePropField({
|
|
21923
21931
|
label,
|
|
@@ -21927,7 +21935,7 @@ function InlinePropField({
|
|
|
21927
21935
|
width
|
|
21928
21936
|
}) {
|
|
21929
21937
|
return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
21930
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21938
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
21931
21939
|
focused ? "\u203A " : " ",
|
|
21932
21940
|
label
|
|
21933
21941
|
] }),
|
|
@@ -21948,7 +21956,7 @@ function DefaultValueRow({
|
|
|
21948
21956
|
focused
|
|
21949
21957
|
}) {
|
|
21950
21958
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
21951
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21959
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
21952
21960
|
focused ? "\u203A " : " ",
|
|
21953
21961
|
"default:"
|
|
21954
21962
|
] }),
|
|
@@ -21963,7 +21971,7 @@ function RowLabel({
|
|
|
21963
21971
|
return /* @__PURE__ */ jsxs22(
|
|
21964
21972
|
Text23,
|
|
21965
21973
|
{
|
|
21966
|
-
color: selected ?
|
|
21974
|
+
color: selected ? PALETTE.text : PALETTE.accent,
|
|
21967
21975
|
bold: selected,
|
|
21968
21976
|
backgroundColor: selected ? "blue" : void 0,
|
|
21969
21977
|
wrap: "truncate-end",
|
|
@@ -21981,7 +21989,7 @@ function ValueInputRow({
|
|
|
21981
21989
|
cursorVisible
|
|
21982
21990
|
}) {
|
|
21983
21991
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
|
|
21984
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
21992
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
21985
21993
|
/* @__PURE__ */ jsx27(Text23, { children: valueText }),
|
|
21986
21994
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
|
|
21987
21995
|
] });
|
|
@@ -21998,7 +22006,7 @@ function EditableListItem({
|
|
|
21998
22006
|
if (isBeingEdited) {
|
|
21999
22007
|
return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
22000
22008
|
}
|
|
22001
|
-
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
22009
|
+
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.accent : void 0, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
|
|
22002
22010
|
}
|
|
22003
22011
|
function EditableValueList({
|
|
22004
22012
|
values,
|
|
@@ -22012,7 +22020,7 @@ function EditableValueList({
|
|
|
22012
22020
|
showAddInput
|
|
22013
22021
|
}) {
|
|
22014
22022
|
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
22015
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22023
|
+
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 }) })),
|
|
22016
22024
|
values.map((value, index) => /* @__PURE__ */ jsx27(
|
|
22017
22025
|
EditableListItem,
|
|
22018
22026
|
{
|
|
@@ -22038,11 +22046,11 @@ function DefaultSubRow({
|
|
|
22038
22046
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22039
22047
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
22040
22048
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22041
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22049
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22042
22050
|
focused ? "\u203A " : " ",
|
|
22043
22051
|
"default:"
|
|
22044
22052
|
] }),
|
|
22045
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22053
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
|
|
22046
22054
|
] });
|
|
22047
22055
|
}
|
|
22048
22056
|
if (prop.type === "boolean") {
|
|
@@ -22052,11 +22060,11 @@ function DefaultSubRow({
|
|
|
22052
22060
|
if (prop.type === "enum") {
|
|
22053
22061
|
if (prop.values.length === 0) {
|
|
22054
22062
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22055
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22063
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22056
22064
|
focused ? "\u203A " : " ",
|
|
22057
22065
|
"default:"
|
|
22058
22066
|
] }),
|
|
22059
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22067
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
|
|
22060
22068
|
] });
|
|
22061
22069
|
}
|
|
22062
22070
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
@@ -22065,11 +22073,11 @@ function DefaultSubRow({
|
|
|
22065
22073
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
22066
22074
|
if (active) {
|
|
22067
22075
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
|
|
22068
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22076
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22069
22077
|
focused ? "\u203A " : " ",
|
|
22070
22078
|
"default:"
|
|
22071
22079
|
] }),
|
|
22072
|
-
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor:
|
|
22080
|
+
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
22073
22081
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
|
|
22074
22082
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
22075
22083
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
|
|
@@ -22077,11 +22085,11 @@ function DefaultSubRow({
|
|
|
22077
22085
|
] });
|
|
22078
22086
|
}
|
|
22079
22087
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22080
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22088
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22081
22089
|
focused ? "\u203A " : " ",
|
|
22082
22090
|
"default:"
|
|
22083
22091
|
] }),
|
|
22084
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 :
|
|
22092
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
|
|
22085
22093
|
] });
|
|
22086
22094
|
}
|
|
22087
22095
|
function DescriptionField({
|
|
@@ -22097,15 +22105,15 @@ function DescriptionField({
|
|
|
22097
22105
|
}) {
|
|
22098
22106
|
if (compact) {
|
|
22099
22107
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22100
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22108
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22101
22109
|
focused ? "\u203A " : " ",
|
|
22102
22110
|
label
|
|
22103
22111
|
] }),
|
|
22104
|
-
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 :
|
|
22112
|
+
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
22105
22113
|
] });
|
|
22106
22114
|
}
|
|
22107
22115
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
22108
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22116
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22109
22117
|
focused ? "\u203A " : " ",
|
|
22110
22118
|
label
|
|
22111
22119
|
] }),
|
|
@@ -22169,7 +22177,7 @@ function PropRow({
|
|
|
22169
22177
|
] }),
|
|
22170
22178
|
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" }) }),
|
|
22171
22179
|
prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22172
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ?
|
|
22180
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
22173
22181
|
activeField === "values" ? "\u203A " : " ",
|
|
22174
22182
|
"values:"
|
|
22175
22183
|
] }),
|
|
@@ -22190,27 +22198,27 @@ function PropRow({
|
|
|
22190
22198
|
}
|
|
22191
22199
|
),
|
|
22192
22200
|
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22193
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ?
|
|
22201
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
22194
22202
|
activeField === "allowed" ? "\u203A " : " ",
|
|
22195
22203
|
"allowed:"
|
|
22196
22204
|
] }),
|
|
22197
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor:
|
|
22205
|
+
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(
|
|
22198
22206
|
Text23,
|
|
22199
22207
|
{
|
|
22200
|
-
color: activeField !== "allowed" && prop.allowed.length === 0 ?
|
|
22208
|
+
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
22201
22209
|
wrap: "wrap",
|
|
22202
22210
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
22203
22211
|
}
|
|
22204
22212
|
)
|
|
22205
22213
|
] }),
|
|
22206
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
22214
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: (() => {
|
|
22207
22215
|
const max = Math.max(8, width - 8);
|
|
22208
22216
|
const text = `~ ${rationale}`;
|
|
22209
22217
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22210
22218
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22211
22219
|
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
|
|
22212
22220
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22213
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22221
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "values:" }),
|
|
22214
22222
|
activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22215
22223
|
] }),
|
|
22216
22224
|
/* @__PURE__ */ jsx27(
|
|
@@ -22271,7 +22279,7 @@ function SlotRow({
|
|
|
22271
22279
|
/* @__PURE__ */ jsxs22(
|
|
22272
22280
|
Text23,
|
|
22273
22281
|
{
|
|
22274
|
-
color: activeField === "allowedComponents" ?
|
|
22282
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
22275
22283
|
bold: activeField === "allowedComponents",
|
|
22276
22284
|
children: [
|
|
22277
22285
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22279,14 +22287,14 @@ function SlotRow({
|
|
|
22279
22287
|
]
|
|
22280
22288
|
}
|
|
22281
22289
|
),
|
|
22282
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22290
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
22283
22291
|
] }),
|
|
22284
22292
|
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22285
22293
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22286
22294
|
/* @__PURE__ */ jsxs22(
|
|
22287
22295
|
Text23,
|
|
22288
22296
|
{
|
|
22289
|
-
color: activeField === "allowedComponents" ?
|
|
22297
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
22290
22298
|
bold: activeField === "allowedComponents",
|
|
22291
22299
|
children: [
|
|
22292
22300
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22294,7 +22302,7 @@ function SlotRow({
|
|
|
22294
22302
|
]
|
|
22295
22303
|
}
|
|
22296
22304
|
),
|
|
22297
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color:
|
|
22305
|
+
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" })
|
|
22298
22306
|
] }),
|
|
22299
22307
|
/* @__PURE__ */ jsx27(
|
|
22300
22308
|
EditableValueList,
|
|
@@ -22310,21 +22318,21 @@ function SlotRow({
|
|
|
22310
22318
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
22311
22319
|
}
|
|
22312
22320
|
),
|
|
22313
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22321
|
+
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)" }) : (() => {
|
|
22314
22322
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22315
22323
|
if (filtered.length === 0) {
|
|
22316
|
-
return /* @__PURE__ */ jsx27(Text23, { color:
|
|
22324
|
+
return /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
22317
22325
|
}
|
|
22318
22326
|
const cursor = pickerCursor % filtered.length;
|
|
22319
22327
|
const MAX_VISIBLE = 5;
|
|
22320
22328
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
22321
22329
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22322
22330
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22323
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22331
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22324
22332
|
slice.map((name, i) => {
|
|
22325
22333
|
const absIdx = start + i;
|
|
22326
22334
|
const isCursor = absIdx === cursor;
|
|
22327
|
-
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ?
|
|
22335
|
+
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
22328
22336
|
})
|
|
22329
22337
|
] });
|
|
22330
22338
|
})() })
|
|
@@ -23153,18 +23161,18 @@ function FieldEditor({
|
|
|
23153
23161
|
});
|
|
23154
23162
|
const innerWidth = Math.max(1, width - 2);
|
|
23155
23163
|
if (parseErr) {
|
|
23156
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
23157
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23158
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23159
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23164
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
23165
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
23166
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: parseErr }),
|
|
23167
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
23160
23168
|
] });
|
|
23161
23169
|
}
|
|
23162
23170
|
if (props.length === 0 && slots.length === 0) {
|
|
23163
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
23164
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23165
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23166
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23167
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23171
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
23172
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
23173
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
23174
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
23175
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
23168
23176
|
] });
|
|
23169
23177
|
}
|
|
23170
23178
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -23293,7 +23301,7 @@ function FieldEditor({
|
|
|
23293
23301
|
const renderRow = (row, index) => {
|
|
23294
23302
|
const key = rowKey(row, index);
|
|
23295
23303
|
if (row.kind === "header") {
|
|
23296
|
-
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23304
|
+
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
23297
23305
|
}
|
|
23298
23306
|
if (row.kind === "component-description") {
|
|
23299
23307
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -23375,9 +23383,9 @@ function FieldEditor({
|
|
|
23375
23383
|
...fixedHeight ? { height } : { minHeight: height },
|
|
23376
23384
|
clipOverflow: fixedHeight,
|
|
23377
23385
|
borderStyle: "single",
|
|
23378
|
-
borderColor: hasEmptyProperties ?
|
|
23386
|
+
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.accent : PALETTE.border,
|
|
23379
23387
|
children: [
|
|
23380
|
-
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23388
|
+
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." }),
|
|
23381
23389
|
header,
|
|
23382
23390
|
/* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
|
|
23383
23391
|
PropRow,
|
|
@@ -23428,7 +23436,7 @@ function FieldEditor({
|
|
|
23428
23436
|
`visible-${key}`
|
|
23429
23437
|
);
|
|
23430
23438
|
}) }),
|
|
23431
|
-
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23439
|
+
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
23432
23440
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
23433
23441
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
23434
23442
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -23438,20 +23446,20 @@ function FieldEditor({
|
|
|
23438
23446
|
const headerPath = path5 ?? "<unknown source path>";
|
|
23439
23447
|
if (!start || !end2 || !src) {
|
|
23440
23448
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23441
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23442
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23449
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
23450
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
23443
23451
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
|
|
23444
23452
|
] });
|
|
23445
23453
|
}
|
|
23446
23454
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
23447
23455
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23448
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23449
|
-
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color:
|
|
23456
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
23457
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
23450
23458
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
|
|
23451
23459
|
] });
|
|
23452
23460
|
})(),
|
|
23453
|
-
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
23454
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23461
|
+
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
23462
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
23455
23463
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23456
23464
|
/* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
|
|
23457
23465
|
/* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
|
|
@@ -23476,10 +23484,10 @@ function FieldEditor({
|
|
|
23476
23484
|
/* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
23477
23485
|
/* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
|
|
23478
23486
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23479
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23487
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
23480
23488
|
] }),
|
|
23481
|
-
validationError && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23482
|
-
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
23489
|
+
validationError && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
23490
|
+
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: modeLabel }) })
|
|
23483
23491
|
]
|
|
23484
23492
|
}
|
|
23485
23493
|
);
|
|
@@ -23531,16 +23539,16 @@ function RationaleLine({ line, active }) {
|
|
|
23531
23539
|
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
|
|
23532
23540
|
}
|
|
23533
23541
|
if (line.kind === "heading") {
|
|
23534
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ?
|
|
23542
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
23535
23543
|
}
|
|
23536
23544
|
if (line.kind === "label") {
|
|
23537
23545
|
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
23538
23546
|
line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
|
|
23539
|
-
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color :
|
|
23540
|
-
line.suffix && /* @__PURE__ */ jsx28(Text24, { color:
|
|
23547
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
23548
|
+
line.suffix && /* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: line.suffix })
|
|
23541
23549
|
] });
|
|
23542
23550
|
}
|
|
23543
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ?
|
|
23551
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
23544
23552
|
}
|
|
23545
23553
|
|
|
23546
23554
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
@@ -23619,9 +23627,9 @@ function ComponentRationalePanel({
|
|
|
23619
23627
|
width,
|
|
23620
23628
|
height: height + 2,
|
|
23621
23629
|
borderStyle: "single",
|
|
23622
|
-
borderColor: active ?
|
|
23630
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23623
23631
|
children: [
|
|
23624
|
-
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 :
|
|
23632
|
+
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
23625
23633
|
visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
|
|
23626
23634
|
/* @__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" }) })
|
|
23627
23635
|
]
|
|
@@ -23636,7 +23644,7 @@ import { Box as Box25 } from "ink";
|
|
|
23636
23644
|
import { Text as Text26 } from "ink";
|
|
23637
23645
|
import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
|
|
23638
23646
|
function HighlightedLine({ parts }) {
|
|
23639
|
-
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ?
|
|
23647
|
+
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
|
|
23640
23648
|
}
|
|
23641
23649
|
|
|
23642
23650
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
@@ -23656,10 +23664,10 @@ function ScrollablePanel({
|
|
|
23656
23664
|
const overflowed = totalLines > height;
|
|
23657
23665
|
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
23658
23666
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
23659
|
-
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 :
|
|
23667
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
23660
23668
|
overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
23661
23669
|
/* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
|
|
23662
|
-
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 :
|
|
23670
|
+
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
23663
23671
|
] })
|
|
23664
23672
|
] }),
|
|
23665
23673
|
children
|
|
@@ -23745,7 +23753,7 @@ function renderRationaleLines(rows, innerWidth) {
|
|
|
23745
23753
|
out.push({
|
|
23746
23754
|
kind: "label",
|
|
23747
23755
|
text: row.name,
|
|
23748
|
-
color:
|
|
23756
|
+
color: PALETTE.accent,
|
|
23749
23757
|
suffix: row.kind === "slot" ? " (slot)" : void 0
|
|
23750
23758
|
});
|
|
23751
23759
|
for (const line of wrapText(row.rationale, innerWidth)) {
|
|
@@ -23781,7 +23789,7 @@ function RationalePanel({
|
|
|
23781
23789
|
totalLines,
|
|
23782
23790
|
visibleStart,
|
|
23783
23791
|
visibleEnd,
|
|
23784
|
-
borderColor: active ?
|
|
23792
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23785
23793
|
children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
|
|
23786
23794
|
}
|
|
23787
23795
|
);
|
|
@@ -23816,21 +23824,29 @@ function TokenReviewPanel({
|
|
|
23816
23824
|
width,
|
|
23817
23825
|
height: height + 2,
|
|
23818
23826
|
borderStyle: "single",
|
|
23819
|
-
borderColor: active ?
|
|
23827
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23820
23828
|
children: [
|
|
23821
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23822
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23829
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
23830
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
23823
23831
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23824
|
-
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
23832
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
23825
23833
|
visiblePaths.map((path5, i) => {
|
|
23826
23834
|
const pathIndex = scrollStart + i;
|
|
23827
23835
|
const checked = editSelection.has(path5);
|
|
23828
23836
|
const focused = pathIndex === editCursor;
|
|
23829
|
-
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
23837
|
+
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
23838
|
+
Text28,
|
|
23839
|
+
{
|
|
23840
|
+
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
23841
|
+
bold: focused,
|
|
23842
|
+
wrap: "truncate",
|
|
23843
|
+
children: ` [${checked ? "x" : " "}] ${path5}`
|
|
23844
|
+
}
|
|
23845
|
+
) }, path5);
|
|
23830
23846
|
}),
|
|
23831
23847
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23832
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23833
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23848
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
23849
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
23834
23850
|
]
|
|
23835
23851
|
}
|
|
23836
23852
|
);
|
|
@@ -23842,16 +23858,16 @@ function TokenReviewPanel({
|
|
|
23842
23858
|
width,
|
|
23843
23859
|
height: height + 2,
|
|
23844
23860
|
borderStyle: "single",
|
|
23845
|
-
borderColor: active ?
|
|
23861
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
23846
23862
|
children: [
|
|
23847
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23848
|
-
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
23863
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
23864
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
23849
23865
|
suggestions.map((s, i) => {
|
|
23850
23866
|
const focused = i === selectedRow;
|
|
23851
23867
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
23852
|
-
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ?
|
|
23853
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23854
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23868
|
+
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
|
|
23869
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
23870
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
23855
23871
|
] }, s.propName);
|
|
23856
23872
|
}),
|
|
23857
23873
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
@@ -23936,9 +23952,9 @@ function ReviewDetailsPanel({
|
|
|
23936
23952
|
const sourceLineCount = Math.max(1, height - 4);
|
|
23937
23953
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
23938
23954
|
return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
23939
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
23940
|
-
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color:
|
|
23941
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
23955
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
23956
|
+
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)" }),
|
|
23957
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
23942
23958
|
] });
|
|
23943
23959
|
}
|
|
23944
23960
|
if (panelOpen === "token-review") {
|
|
@@ -24088,17 +24104,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
24088
24104
|
hidden
|
|
24089
24105
|
}) {
|
|
24090
24106
|
if (hidden || count === 0) return null;
|
|
24091
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24107
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
24092
24108
|
}
|
|
24093
24109
|
function ReviewNoSelection() {
|
|
24094
|
-
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
24110
|
+
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, children: "No component selected" }) });
|
|
24095
24111
|
}
|
|
24096
24112
|
function ReviewFinalizeError({
|
|
24097
24113
|
message,
|
|
24098
24114
|
hidden
|
|
24099
24115
|
}) {
|
|
24100
24116
|
if (hidden || !message) return null;
|
|
24101
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24117
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
24102
24118
|
}
|
|
24103
24119
|
function ReviewPanelFooter({
|
|
24104
24120
|
reviewEditor,
|
|
@@ -24122,7 +24138,7 @@ function ReviewComponentTitle({
|
|
|
24122
24138
|
return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
24123
24139
|
/* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
24124
24140
|
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
24125
|
-
/* @__PURE__ */ jsxs28(Text30, { color:
|
|
24141
|
+
/* @__PURE__ */ jsxs28(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
24126
24142
|
propCount,
|
|
24127
24143
|
" prop",
|
|
24128
24144
|
propCount !== 1 ? "s" : "",
|
|
@@ -24178,8 +24194,8 @@ function ReviewComponentPanel({
|
|
|
24178
24194
|
)
|
|
24179
24195
|
}
|
|
24180
24196
|
) }),
|
|
24181
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ?
|
|
24182
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
24197
|
+
/* @__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 : " " }) }),
|
|
24198
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx37(
|
|
24183
24199
|
ReviewPanelFooter,
|
|
24184
24200
|
{
|
|
24185
24201
|
reviewEditor,
|
|
@@ -24207,11 +24223,11 @@ function countReviewStatuses(entries) {
|
|
|
24207
24223
|
);
|
|
24208
24224
|
}
|
|
24209
24225
|
function ReviewLoadingState() {
|
|
24210
|
-
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color:
|
|
24226
|
+
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
24211
24227
|
}
|
|
24212
24228
|
function ReviewLoadError({ message }) {
|
|
24213
24229
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
24214
|
-
/* @__PURE__ */ jsx38(Text31, { color:
|
|
24230
|
+
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.error, children: message }),
|
|
24215
24231
|
/* @__PURE__ */ jsx38(Text31, { children: " " }),
|
|
24216
24232
|
/* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
|
|
24217
24233
|
] });
|
|
@@ -24447,41 +24463,41 @@ function FinalizeDialog({
|
|
|
24447
24463
|
/* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
24448
24464
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24449
24465
|
/* @__PURE__ */ jsxs30(Text32, { children: [
|
|
24450
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24466
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.success, children: [
|
|
24451
24467
|
accepted,
|
|
24452
24468
|
" accepted"
|
|
24453
24469
|
] }),
|
|
24454
24470
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24455
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24471
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.error, children: [
|
|
24456
24472
|
rejected,
|
|
24457
24473
|
" rejected"
|
|
24458
24474
|
] }),
|
|
24459
24475
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24460
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24476
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.muted, children: [
|
|
24461
24477
|
needsReview,
|
|
24462
24478
|
" unresolved"
|
|
24463
24479
|
] })
|
|
24464
24480
|
] }),
|
|
24465
24481
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24466
24482
|
noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24467
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24468
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24483
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
24484
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
24469
24485
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24470
24486
|
] }),
|
|
24471
24487
|
!allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24472
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24473
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24488
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
24489
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
24474
24490
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24475
24491
|
] }),
|
|
24476
24492
|
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
|
|
24477
|
-
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color:
|
|
24493
|
+
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: " " }),
|
|
24478
24494
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24479
24495
|
] }),
|
|
24480
24496
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24481
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24482
|
-
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color:
|
|
24483
|
-
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color:
|
|
24484
|
-
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color:
|
|
24497
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
24498
|
+
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2191 more above" }),
|
|
24499
|
+
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
24500
|
+
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2193 more below" }),
|
|
24485
24501
|
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
|
|
24486
24502
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24487
24503
|
] }),
|
|
@@ -24975,8 +24991,8 @@ function ReviewStepDialogs({
|
|
|
24975
24991
|
}
|
|
24976
24992
|
function ReviewReloadDialog({ open }) {
|
|
24977
24993
|
if (!open) return null;
|
|
24978
|
-
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
24979
|
-
/* @__PURE__ */ jsx41(Text34, { bold: true, color:
|
|
24994
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
24995
|
+
/* @__PURE__ */ jsx41(Text34, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
24980
24996
|
/* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
|
|
24981
24997
|
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
24982
24998
|
/* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
|
|
@@ -25362,19 +25378,19 @@ function LivePreviewSummary({
|
|
|
25362
25378
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25363
25379
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25364
25380
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25365
|
-
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
25366
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
25381
|
+
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
25382
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
25367
25383
|
if (!hasCounts) return null;
|
|
25368
25384
|
return /* @__PURE__ */ jsxs33(Box32, { children: [
|
|
25369
25385
|
/* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
|
|
25370
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25386
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
25371
25387
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25372
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25388
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
25373
25389
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25374
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25390
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `${counts.removed} removed` }),
|
|
25375
25391
|
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
|
|
25376
25392
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25377
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25393
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
25378
25394
|
] });
|
|
25379
25395
|
}
|
|
25380
25396
|
|
|
@@ -25420,10 +25436,10 @@ function CyclePathLine({
|
|
|
25420
25436
|
highlightComponents = false,
|
|
25421
25437
|
highlightLine = false
|
|
25422
25438
|
}) {
|
|
25423
|
-
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ?
|
|
25439
|
+
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
25424
25440
|
prefix,
|
|
25425
25441
|
segments.map(
|
|
25426
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
25442
|
+
(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)
|
|
25427
25443
|
)
|
|
25428
25444
|
] });
|
|
25429
25445
|
}
|
|
@@ -25435,9 +25451,9 @@ function CycleDetailPanel({
|
|
|
25435
25451
|
height
|
|
25436
25452
|
}) {
|
|
25437
25453
|
const lines = [
|
|
25438
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25439
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25440
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25454
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
25455
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
25456
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
25441
25457
|
/* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
|
|
25442
25458
|
];
|
|
25443
25459
|
cycles.forEach((cycle, index) => {
|
|
@@ -25449,7 +25465,7 @@ function CycleDetailPanel({
|
|
|
25449
25465
|
);
|
|
25450
25466
|
if (cycle.suggestedBreak) {
|
|
25451
25467
|
lines.push(
|
|
25452
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25468
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
25453
25469
|
);
|
|
25454
25470
|
}
|
|
25455
25471
|
lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
|
|
@@ -25457,9 +25473,9 @@ function CycleDetailPanel({
|
|
|
25457
25473
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
25458
25474
|
const viewportHeight = Math.max(1, height - 3);
|
|
25459
25475
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
25460
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25476
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
25461
25477
|
visible,
|
|
25462
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25478
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: footer })
|
|
25463
25479
|
] });
|
|
25464
25480
|
}
|
|
25465
25481
|
function BreakCyclePanel({
|
|
@@ -25470,14 +25486,14 @@ function BreakCyclePanel({
|
|
|
25470
25486
|
width,
|
|
25471
25487
|
height
|
|
25472
25488
|
}) {
|
|
25473
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25474
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25489
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
25490
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
25475
25491
|
cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
25476
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25492
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
25477
25493
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
25478
|
-
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
25494
|
+
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "remove slot edge:" }),
|
|
25479
25495
|
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}`)),
|
|
25480
|
-
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25496
|
+
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" })
|
|
25481
25497
|
] });
|
|
25482
25498
|
}
|
|
25483
25499
|
var HELP_SECTIONS2 = [
|
|
@@ -25583,7 +25599,7 @@ function deriveBreakingChanges(response) {
|
|
|
25583
25599
|
}
|
|
25584
25600
|
function GenerateReviewStep(props) {
|
|
25585
25601
|
if (!props.extractSessionId) {
|
|
25586
|
-
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color:
|
|
25602
|
+
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." }) });
|
|
25587
25603
|
}
|
|
25588
25604
|
return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
25589
25605
|
}
|
|
@@ -26500,8 +26516,8 @@ function GenerateReviewStepView({
|
|
|
26500
26516
|
}
|
|
26501
26517
|
),
|
|
26502
26518
|
/* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26503
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26504
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
26519
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26520
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26505
26521
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
26506
26522
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
26507
26523
|
removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
|
|
@@ -26510,7 +26526,7 @@ function GenerateReviewStepView({
|
|
|
26510
26526
|
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
|
|
26511
26527
|
Text36,
|
|
26512
26528
|
{
|
|
26513
|
-
color:
|
|
26529
|
+
color: PALETTE.warning,
|
|
26514
26530
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
26515
26531
|
}
|
|
26516
26532
|
) }),
|
|
@@ -26518,10 +26534,10 @@ function GenerateReviewStepView({
|
|
|
26518
26534
|
const row = breakingRows[breakingCursor];
|
|
26519
26535
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26520
26536
|
if (!comp) return null;
|
|
26521
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26522
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
26523
|
-
comp.impact && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26524
|
-
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
26537
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26538
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
26539
|
+
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"}` }),
|
|
26540
|
+
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}`)),
|
|
26525
26541
|
/* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
|
|
26526
26542
|
] });
|
|
26527
26543
|
})(),
|
|
@@ -26544,11 +26560,11 @@ function GenerateReviewStepView({
|
|
|
26544
26560
|
const participantSet = cycleView.structural;
|
|
26545
26561
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26546
26562
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26547
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor:
|
|
26548
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26549
|
-
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26550
|
-
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26551
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26563
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26564
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
26565
|
+
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
26566
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
26567
|
+
/* @__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" })
|
|
26552
26568
|
] });
|
|
26553
26569
|
})(),
|
|
26554
26570
|
/* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
@@ -26664,7 +26680,7 @@ function GenerateReviewStepView({
|
|
|
26664
26680
|
) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
|
|
26665
26681
|
] }),
|
|
26666
26682
|
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
|
|
26667
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26683
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26668
26684
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
26669
26685
|
return /* @__PURE__ */ jsx43(
|
|
26670
26686
|
CyclePathLine,
|
|
@@ -26677,7 +26693,7 @@ function GenerateReviewStepView({
|
|
|
26677
26693
|
`cyc-banner-${idx}`
|
|
26678
26694
|
);
|
|
26679
26695
|
}),
|
|
26680
|
-
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26696
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
26681
26697
|
/* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
|
|
26682
26698
|
] }),
|
|
26683
26699
|
/* @__PURE__ */ jsx43(
|
|
@@ -26700,8 +26716,8 @@ import { Box as Box34, Text as Text37 } from "ink";
|
|
|
26700
26716
|
|
|
26701
26717
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
|
|
26702
26718
|
import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
|
|
26703
|
-
var
|
|
26704
|
-
...
|
|
26719
|
+
var PALETTE3 = {
|
|
26720
|
+
...PALETTE,
|
|
26705
26721
|
link: "#58A6FF"
|
|
26706
26722
|
};
|
|
26707
26723
|
var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
@@ -26720,13 +26736,13 @@ var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
|
26720
26736
|
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
26721
26737
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
26722
26738
|
if (!generatePromptPath) return null;
|
|
26723
|
-
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26724
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26725
|
-
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color:
|
|
26739
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
26740
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE3.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
26741
|
+
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color: PALETTE3.warning, children: [
|
|
26726
26742
|
"components: ",
|
|
26727
26743
|
generatePromptPath
|
|
26728
26744
|
] }) : null,
|
|
26729
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26745
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE3.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
26730
26746
|
] });
|
|
26731
26747
|
}
|
|
26732
26748
|
|
|
@@ -26751,10 +26767,10 @@ import { Box as Box35, Text as Text38 } from "ink";
|
|
|
26751
26767
|
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
26752
26768
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
26753
26769
|
return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
|
|
26754
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26770
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "Space:" }),
|
|
26755
26771
|
/* @__PURE__ */ jsx45(Text38, { children: spaceId }),
|
|
26756
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26757
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26772
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "/" }),
|
|
26773
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "Environment:" }),
|
|
26758
26774
|
/* @__PURE__ */ jsx45(Text38, { children: environmentId })
|
|
26759
26775
|
] });
|
|
26760
26776
|
}
|
|
@@ -26766,13 +26782,13 @@ function EntityRows({ entity, label }) {
|
|
|
26766
26782
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
26767
26783
|
return /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
26768
26784
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
|
|
26769
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26785
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.success, children: "\u2713" }),
|
|
26770
26786
|
" ",
|
|
26771
26787
|
plural3(entity[action]),
|
|
26772
26788
|
" ",
|
|
26773
26789
|
action
|
|
26774
26790
|
] }, action)),
|
|
26775
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26791
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
26776
26792
|
"\u2717 ",
|
|
26777
26793
|
plural3(entity.failed),
|
|
26778
26794
|
" failed \u2014 check logs above"
|
|
@@ -26781,8 +26797,8 @@ function EntityRows({ entity, label }) {
|
|
|
26781
26797
|
}
|
|
26782
26798
|
function LinkRow({ title, url }) {
|
|
26783
26799
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26784
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26785
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26800
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.muted, children: title }),
|
|
26801
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.link, children: url })
|
|
26786
26802
|
] });
|
|
26787
26803
|
}
|
|
26788
26804
|
function DoneStep({
|
|
@@ -26805,17 +26821,17 @@ function DoneStep({
|
|
|
26805
26821
|
const success = totalFailed === 0;
|
|
26806
26822
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
26807
26823
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
26808
|
-
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26809
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color:
|
|
26824
|
+
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.success, children: "Done!" }) : /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.warning, children: "\u26A0 Finished with errors" }),
|
|
26825
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE3.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26810
26826
|
/* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
26811
26827
|
/* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
26812
|
-
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26828
|
+
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.muted, children: [
|
|
26813
26829
|
"Push result: ",
|
|
26814
26830
|
summary.succeeded,
|
|
26815
26831
|
"/",
|
|
26816
26832
|
summary.total,
|
|
26817
26833
|
" succeeded",
|
|
26818
|
-
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26834
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
26819
26835
|
", ",
|
|
26820
26836
|
summary.failed,
|
|
26821
26837
|
" failed"
|
|
@@ -26823,8 +26839,8 @@ function DoneStep({
|
|
|
26823
26839
|
] }) })
|
|
26824
26840
|
] }),
|
|
26825
26841
|
failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26826
|
-
/* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26827
|
-
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26842
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.error, children: "Failure details" }),
|
|
26843
|
+
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
26828
26844
|
failure.entityType,
|
|
26829
26845
|
" ",
|
|
26830
26846
|
failure.entityId,
|
|
@@ -26834,7 +26850,7 @@ function DoneStep({
|
|
|
26834
26850
|
] }),
|
|
26835
26851
|
/* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
|
|
26836
26852
|
success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
|
|
26837
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26853
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.success, children: "Your design system is now in Contentful Experiences." }),
|
|
26838
26854
|
/* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
26839
26855
|
/* @__PURE__ */ jsx46(
|
|
26840
26856
|
LinkRow,
|
|
@@ -26948,7 +26964,7 @@ function PathPrompt({
|
|
|
26948
26964
|
label,
|
|
26949
26965
|
":"
|
|
26950
26966
|
] }),
|
|
26951
|
-
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ?
|
|
26967
|
+
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE3.muted : void 0, children: shown }),
|
|
26952
26968
|
/* @__PURE__ */ jsx47(Text40, { children: cursor })
|
|
26953
26969
|
] }),
|
|
26954
26970
|
/* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
|
|
@@ -27014,12 +27030,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27014
27030
|
/* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
27015
27031
|
/* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
27016
27032
|
operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27017
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27033
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE3.muted, children: "Operation:" }),
|
|
27018
27034
|
/* @__PURE__ */ jsx50(Text42, { children: operationId })
|
|
27019
27035
|
] }),
|
|
27020
27036
|
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
|
|
27021
27037
|
/* @__PURE__ */ jsx50(Box39, { width: 40, children: /* @__PURE__ */ jsx50(ThemeProvider2, { theme: INK_UI_THEME, children: /* @__PURE__ */ jsx50(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
27022
|
-
/* @__PURE__ */ jsxs40(Text42, { color:
|
|
27038
|
+
/* @__PURE__ */ jsxs40(Text42, { color: PALETTE3.muted, children: [
|
|
27023
27039
|
progress.processed,
|
|
27024
27040
|
"/",
|
|
27025
27041
|
progress.total,
|
|
@@ -27027,10 +27043,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27027
27043
|
] })
|
|
27028
27044
|
] }) }),
|
|
27029
27045
|
showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27030
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27046
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE3.muted, children: "Now processing:" }),
|
|
27031
27047
|
/* @__PURE__ */ jsx50(Text42, { children: showCurrent })
|
|
27032
27048
|
] }),
|
|
27033
|
-
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color:
|
|
27049
|
+
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE3.muted, children: [
|
|
27034
27050
|
"Elapsed: ",
|
|
27035
27051
|
elapsed
|
|
27036
27052
|
] }) })
|
|
@@ -27220,25 +27236,25 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27220
27236
|
if (components.new.length > 0) {
|
|
27221
27237
|
lines.push({
|
|
27222
27238
|
key: "summary-components-new",
|
|
27223
|
-
color:
|
|
27239
|
+
color: PALETTE3.success,
|
|
27224
27240
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
27225
27241
|
});
|
|
27226
27242
|
for (const [index, item] of components.new.entries()) {
|
|
27227
27243
|
const name = item.key ?? item.$name ?? "unknown";
|
|
27228
|
-
lines.push({ key: `summary-components-new-${index}`, color:
|
|
27244
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
27229
27245
|
}
|
|
27230
27246
|
}
|
|
27231
27247
|
if (components.changed.length > 0) {
|
|
27232
27248
|
lines.push({
|
|
27233
27249
|
key: "summary-components-changed",
|
|
27234
|
-
color:
|
|
27250
|
+
color: PALETTE3.warning,
|
|
27235
27251
|
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
27236
27252
|
});
|
|
27237
27253
|
for (const [index, item] of components.changed.entries()) {
|
|
27238
27254
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
27239
27255
|
lines.push({
|
|
27240
27256
|
key: `summary-components-changed-${index}`,
|
|
27241
|
-
color: isBreaking ?
|
|
27257
|
+
color: isBreaking ? PALETTE3.error : PALETTE3.warning,
|
|
27242
27258
|
text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
|
|
27243
27259
|
});
|
|
27244
27260
|
}
|
|
@@ -27246,11 +27262,11 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27246
27262
|
if (components.removed.length > 0) {
|
|
27247
27263
|
lines.push({
|
|
27248
27264
|
key: "summary-components-removed",
|
|
27249
|
-
color:
|
|
27265
|
+
color: PALETTE3.warning,
|
|
27250
27266
|
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
27251
27267
|
});
|
|
27252
27268
|
for (const [index, item] of components.removed.entries()) {
|
|
27253
|
-
lines.push({ key: `summary-components-removed-${index}`, color:
|
|
27269
|
+
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE3.warning, text: ` \u2298 ${item.name}` });
|
|
27254
27270
|
}
|
|
27255
27271
|
}
|
|
27256
27272
|
if (components.unchanged.length > 0) {
|
|
@@ -27263,21 +27279,21 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27263
27279
|
if (tokens.new.length > 0) {
|
|
27264
27280
|
lines.push({
|
|
27265
27281
|
key: "summary-tokens-new",
|
|
27266
|
-
color:
|
|
27282
|
+
color: PALETTE3.success,
|
|
27267
27283
|
text: ` \uFF0B ${tokens.new.length} design tokens will be created`
|
|
27268
27284
|
});
|
|
27269
27285
|
}
|
|
27270
27286
|
if (tokens.changed.length > 0) {
|
|
27271
27287
|
lines.push({
|
|
27272
27288
|
key: "summary-tokens-changed",
|
|
27273
|
-
color:
|
|
27289
|
+
color: PALETTE3.warning,
|
|
27274
27290
|
text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
|
|
27275
27291
|
});
|
|
27276
27292
|
}
|
|
27277
27293
|
if (tokens.removed.length > 0) {
|
|
27278
27294
|
lines.push({
|
|
27279
27295
|
key: "summary-tokens-removed",
|
|
27280
|
-
color:
|
|
27296
|
+
color: PALETTE3.warning,
|
|
27281
27297
|
text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
|
|
27282
27298
|
});
|
|
27283
27299
|
}
|
|
@@ -27321,12 +27337,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
27321
27337
|
function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
|
|
27322
27338
|
lines.push({
|
|
27323
27339
|
key: `${keyPrefix}-h-${name}`,
|
|
27324
|
-
color:
|
|
27340
|
+
color: PALETTE3.warning,
|
|
27325
27341
|
text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
27326
27342
|
});
|
|
27327
27343
|
if (changeClassification?.classification !== "breaking") return;
|
|
27328
27344
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
27329
|
-
lines.push({ key: `${keyPrefix}-b-${name}`, color:
|
|
27345
|
+
lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE3.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
27330
27346
|
}
|
|
27331
27347
|
function buildPreviewDiffLines(preview) {
|
|
27332
27348
|
const lines = [];
|
|
@@ -27334,12 +27350,12 @@ function buildPreviewDiffLines(preview) {
|
|
|
27334
27350
|
for (const item of components.new) {
|
|
27335
27351
|
const raw = item;
|
|
27336
27352
|
const name = raw.key ?? raw.$name ?? "unknown";
|
|
27337
|
-
lines.push({ key: `comp-new-${name}`, color:
|
|
27353
|
+
lines.push({ key: `comp-new-${name}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
27338
27354
|
const slots = raw.$slots ?? {};
|
|
27339
27355
|
for (const slotName of Object.keys(slots).sort()) {
|
|
27340
27356
|
lines.push({
|
|
27341
27357
|
key: `comp-new-${name}-slot-${slotName}`,
|
|
27342
|
-
color:
|
|
27358
|
+
color: PALETTE3.success,
|
|
27343
27359
|
text: ` slot: ${slotName}`
|
|
27344
27360
|
});
|
|
27345
27361
|
const allowed = slots[slotName]?.["$allowedComponents"];
|
|
@@ -27347,14 +27363,14 @@ function buildPreviewDiffLines(preview) {
|
|
|
27347
27363
|
const names = allowed.filter((n) => typeof n === "string");
|
|
27348
27364
|
lines.push({
|
|
27349
27365
|
key: `comp-new-${name}-slot-${slotName}-allow`,
|
|
27350
|
-
color:
|
|
27366
|
+
color: PALETTE3.success,
|
|
27351
27367
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
27352
27368
|
});
|
|
27353
27369
|
}
|
|
27354
27370
|
}
|
|
27355
27371
|
}
|
|
27356
27372
|
for (const item of components.removed) {
|
|
27357
|
-
lines.push({ key: `comp-rm-${item.name}`, color:
|
|
27373
|
+
lines.push({ key: `comp-rm-${item.name}`, color: PALETTE3.error, text: ` - ${item.name}` });
|
|
27358
27374
|
}
|
|
27359
27375
|
for (const item of components.changed) {
|
|
27360
27376
|
appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
|
|
@@ -27385,10 +27401,10 @@ function buildPreviewDiffLines(preview) {
|
|
|
27385
27401
|
for (const item of tokens.new) {
|
|
27386
27402
|
const raw = item;
|
|
27387
27403
|
const name = raw.name ?? raw.path ?? "unknown";
|
|
27388
|
-
lines.push({ key: `tok-new-${name}`, color:
|
|
27404
|
+
lines.push({ key: `tok-new-${name}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
27389
27405
|
}
|
|
27390
27406
|
for (const item of tokens.removed) {
|
|
27391
|
-
lines.push({ key: `tok-rm-${item.name}`, color:
|
|
27407
|
+
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE3.error, text: ` - ${item.name}` });
|
|
27392
27408
|
}
|
|
27393
27409
|
for (const item of tokens.changed) {
|
|
27394
27410
|
const tokenName = item.current.name;
|
|
@@ -27479,13 +27495,13 @@ function WizardPreviewStep({
|
|
|
27479
27495
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
27480
27496
|
focused: false,
|
|
27481
27497
|
children: [
|
|
27482
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ?
|
|
27483
|
-
/* @__PURE__ */ jsx51(Text43, { color:
|
|
27498
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ? PALETTE3.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
27499
|
+
/* @__PURE__ */ jsx51(Text43, { color: PALETTE3.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
27484
27500
|
]
|
|
27485
27501
|
}
|
|
27486
27502
|
)
|
|
27487
|
-
] }) : /* @__PURE__ */ jsx51(Text43, { color:
|
|
27488
|
-
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color:
|
|
27503
|
+
] }) : /* @__PURE__ */ jsx51(Text43, { color: PALETTE3.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
27504
|
+
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color: PALETTE3.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
27489
27505
|
/* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
|
|
27490
27506
|
/* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
|
|
27491
27507
|
/* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
|
|
@@ -28031,7 +28047,7 @@ var realSaveDeps = () => ({
|
|
|
28031
28047
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
28032
28048
|
appendRun,
|
|
28033
28049
|
buildSourceFingerprint,
|
|
28034
|
-
sleep: (ms) => new Promise((
|
|
28050
|
+
sleep: (ms) => new Promise((resolve27) => setTimeout(resolve27, ms)),
|
|
28035
28051
|
warn: (message) => process.stderr.write(message)
|
|
28036
28052
|
});
|
|
28037
28053
|
async function runPrintFiles(input, deps, onPatch) {
|
|
@@ -28421,44 +28437,12 @@ init_config();
|
|
|
28421
28437
|
init_debug_store();
|
|
28422
28438
|
init_debug_mode_store();
|
|
28423
28439
|
init_version();
|
|
28424
|
-
|
|
28425
|
-
// packages/experience-design-system-cli/src/tui/help/file-locations.ts
|
|
28426
|
-
import { join as join25, resolve as resolve27 } from "node:path";
|
|
28427
|
-
function describeFileLocations({
|
|
28428
|
-
contentfulBaseDir,
|
|
28429
|
-
debugModeEnabled,
|
|
28430
|
-
currentSessionDir: currentSessionDir2
|
|
28431
|
-
}) {
|
|
28432
|
-
if (!debugModeEnabled) {
|
|
28433
|
-
return {
|
|
28434
|
-
debugLogs: "none while Debug Mode is off",
|
|
28435
|
-
importFiles: `${join25("<project>", ".contentful")}/ (tokens.json, components.json)`
|
|
28436
|
-
};
|
|
28437
|
-
}
|
|
28438
|
-
const base = contentfulBaseDir ? resolve27(contentfulBaseDir) : "<project>";
|
|
28439
|
-
const session = currentSessionDir2 ?? join25(base, ".contentful", "<date>-session-<n>");
|
|
28440
|
-
return {
|
|
28441
|
-
debugLogs: join25(session, "debug"),
|
|
28442
|
-
importFiles: `${join25(session, "dsi-import-<n>")}/ (tokens.json, components.json)`
|
|
28443
|
-
};
|
|
28444
|
-
}
|
|
28445
|
-
|
|
28446
|
-
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
28447
28440
|
async function readHelpInfo() {
|
|
28448
|
-
const
|
|
28449
|
-
const base = settings["contentfulBaseDir"];
|
|
28450
|
-
const locations = describeFileLocations({
|
|
28451
|
-
contentfulBaseDir: typeof base === "string" ? base : "",
|
|
28452
|
-
debugModeEnabled: debugMode.enabled,
|
|
28453
|
-
currentSessionDir: currentSessionDir()
|
|
28454
|
-
});
|
|
28441
|
+
const debugMode = await readDebugModeSetting();
|
|
28455
28442
|
return {
|
|
28456
28443
|
storage: [
|
|
28457
28444
|
{ label: "Config folder", value: configRoot2() },
|
|
28458
|
-
{ label: "Settings file", value: configFilePath2() }
|
|
28459
|
-
{ label: "Agent settings", value: `${configFilePath2()} (keys: agent, agentModel, agents)` },
|
|
28460
|
-
{ label: "Debug logs", value: locations.debugLogs },
|
|
28461
|
-
{ label: "Import files", value: locations.importFiles }
|
|
28445
|
+
{ label: "Settings file", value: configFilePath2() }
|
|
28462
28446
|
],
|
|
28463
28447
|
troubleshooting: [
|
|
28464
28448
|
{ label: "CLI version", value: readPackageVersion() },
|
|
@@ -28479,7 +28463,7 @@ function Section({ title, rows }) {
|
|
|
28479
28463
|
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
28480
28464
|
/* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
|
|
28481
28465
|
rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
|
|
28482
|
-
/* @__PURE__ */ jsx53(Box42, { width:
|
|
28466
|
+
/* @__PURE__ */ jsx53(Box42, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
|
|
28483
28467
|
/* @__PURE__ */ jsx53(Text44, { children: row.value })
|
|
28484
28468
|
] }, row.label))
|
|
28485
28469
|
] });
|
|
@@ -28579,338 +28563,15 @@ function SettingsScreen({
|
|
|
28579
28563
|
}
|
|
28580
28564
|
|
|
28581
28565
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28582
|
-
import { useState as
|
|
28583
|
-
import { Box as Box47, Text as Text49, useInput as useInput13 } from "ink";
|
|
28584
|
-
|
|
28585
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
28586
|
-
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
28587
|
-
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
28588
|
-
init_debug_store();
|
|
28589
|
-
|
|
28590
|
-
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
28591
|
-
import { useState as useState29 } from "react";
|
|
28566
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
28592
28567
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28593
28568
|
import TextInput4 from "ink-text-input";
|
|
28594
|
-
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
28595
|
-
function FieldForm({
|
|
28596
|
-
title,
|
|
28597
|
-
subtitle,
|
|
28598
|
-
fields,
|
|
28599
|
-
values,
|
|
28600
|
-
onChange,
|
|
28601
|
-
onSave,
|
|
28602
|
-
onQuit,
|
|
28603
|
-
notice,
|
|
28604
|
-
busy = false,
|
|
28605
|
-
footer
|
|
28606
|
-
}) {
|
|
28607
|
-
const [active, setActive] = useState29(0);
|
|
28608
|
-
const [editing, setEditing] = useState29(false);
|
|
28609
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28610
|
-
const labelWidth = Math.max(...fields.map((field) => field.label.length));
|
|
28611
|
-
const current = fields[active];
|
|
28612
|
-
useInput11((input, key) => {
|
|
28613
|
-
if (busy) return;
|
|
28614
|
-
if (editing) {
|
|
28615
|
-
if (key.escape) {
|
|
28616
|
-
onChange(current.key, valueBeforeEdit);
|
|
28617
|
-
setEditing(false);
|
|
28618
|
-
}
|
|
28619
|
-
return;
|
|
28620
|
-
}
|
|
28621
|
-
if (key.escape || input === "q") {
|
|
28622
|
-
onQuit();
|
|
28623
|
-
return;
|
|
28624
|
-
}
|
|
28625
|
-
if (input === "s") {
|
|
28626
|
-
onSave();
|
|
28627
|
-
return;
|
|
28628
|
-
}
|
|
28629
|
-
if (input === "c") {
|
|
28630
|
-
onChange(current.key, "");
|
|
28631
|
-
return;
|
|
28632
|
-
}
|
|
28633
|
-
if (key.tab || key.downArrow) {
|
|
28634
|
-
setActive((i) => (i + 1) % fields.length);
|
|
28635
|
-
return;
|
|
28636
|
-
}
|
|
28637
|
-
if (key.upArrow) {
|
|
28638
|
-
setActive((i) => (i - 1 + fields.length) % fields.length);
|
|
28639
|
-
return;
|
|
28640
|
-
}
|
|
28641
|
-
if (key.return) {
|
|
28642
|
-
setValueBeforeEdit(values[current.key]);
|
|
28643
|
-
setEditing(true);
|
|
28644
|
-
}
|
|
28645
|
-
});
|
|
28646
|
-
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28647
|
-
/* @__PURE__ */ jsx55(Text46, { bold: true, children: title }),
|
|
28648
|
-
subtitle && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: subtitle }),
|
|
28649
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28650
|
-
/* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: fields.map((field, index) => {
|
|
28651
|
-
const isActive = index === active;
|
|
28652
|
-
const value = values[field.key];
|
|
28653
|
-
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
28654
|
-
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28655
|
-
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
28656
|
-
/* @__PURE__ */ jsx55(Box44, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
28657
|
-
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
28658
|
-
TextInput4,
|
|
28659
|
-
{
|
|
28660
|
-
value,
|
|
28661
|
-
onChange: (next) => onChange(field.key, next),
|
|
28662
|
-
onSubmit: () => setEditing(false),
|
|
28663
|
-
mask: field.masked ? "\u2022" : void 0
|
|
28664
|
-
}
|
|
28665
|
-
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (field.hint ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
28666
|
-
field.hint && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: field.hint })
|
|
28667
|
-
] }, field.key);
|
|
28668
|
-
}) }),
|
|
28669
|
-
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
28670
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28671
|
-
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28672
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28673
|
-
" ",
|
|
28674
|
-
notice.text
|
|
28675
|
-
] })
|
|
28676
|
-
] }),
|
|
28677
|
-
footer,
|
|
28678
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28679
|
-
/* @__PURE__ */ jsx55(
|
|
28680
|
-
ControlHints,
|
|
28681
|
-
{
|
|
28682
|
-
hints: editing ? [
|
|
28683
|
-
{ keys: "type", label: "edit" },
|
|
28684
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
28685
|
-
{ keys: "\u23CE", label: "done" },
|
|
28686
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
28687
|
-
] : [
|
|
28688
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
28689
|
-
{ keys: "\u23CE", label: "edit" },
|
|
28690
|
-
{ keys: "c", label: "clear" },
|
|
28691
|
-
{ keys: "s", label: "save" },
|
|
28692
|
-
{ keys: "Esc/q", label: "back without saving" }
|
|
28693
|
-
]
|
|
28694
|
-
}
|
|
28695
|
-
)
|
|
28696
|
-
] });
|
|
28697
|
-
}
|
|
28698
28569
|
|
|
28699
28570
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
28700
28571
|
init_config();
|
|
28701
28572
|
var readV1Store = readSettings2;
|
|
28702
28573
|
var writeV1Store = writeSettings2;
|
|
28703
28574
|
|
|
28704
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/agent-store.ts
|
|
28705
|
-
var DEFAULT_AGENT3 = "claude";
|
|
28706
|
-
var AGENT_LABELS = {
|
|
28707
|
-
claude: "Claude Code",
|
|
28708
|
-
codex: "OpenAI Codex",
|
|
28709
|
-
opencode: "OpenCode",
|
|
28710
|
-
cursor: "Cursor",
|
|
28711
|
-
copilot: "GitHub Copilot"
|
|
28712
|
-
};
|
|
28713
|
-
var AGENT_HINTS = {
|
|
28714
|
-
claude: "claude",
|
|
28715
|
-
codex: "codex",
|
|
28716
|
-
opencode: "opencode",
|
|
28717
|
-
cursor: "cursor-agent",
|
|
28718
|
-
copilot: "copilot"
|
|
28719
|
-
};
|
|
28720
|
-
var asString = (value) => typeof value === "string" ? value : "";
|
|
28721
|
-
function emptyAgents() {
|
|
28722
|
-
return Object.fromEntries(AGENT_NAMES.map((name) => [name, { model: "" }]));
|
|
28723
|
-
}
|
|
28724
|
-
async function readAgentConfig() {
|
|
28725
|
-
const store = await readV1Store();
|
|
28726
|
-
const stored = asString(store["agent"]);
|
|
28727
|
-
const defaultAgent = isAgentName(stored) ? stored : DEFAULT_AGENT3;
|
|
28728
|
-
const agents = emptyAgents();
|
|
28729
|
-
const saved = store["agents"];
|
|
28730
|
-
if (saved && typeof saved === "object") {
|
|
28731
|
-
for (const name of AGENT_NAMES) {
|
|
28732
|
-
const entry = saved[name];
|
|
28733
|
-
if (entry && typeof entry === "object")
|
|
28734
|
-
agents[name] = { model: asString(entry["model"]) };
|
|
28735
|
-
}
|
|
28736
|
-
}
|
|
28737
|
-
const legacyModel = asString(store["agentModel"]);
|
|
28738
|
-
if (legacyModel && !agents[defaultAgent].model) agents[defaultAgent] = { model: legacyModel };
|
|
28739
|
-
return { defaultAgent, agents };
|
|
28740
|
-
}
|
|
28741
|
-
async function writeAgentConfig(config) {
|
|
28742
|
-
const existing = await readV1Store();
|
|
28743
|
-
const merged = { ...existing };
|
|
28744
|
-
const agents = {};
|
|
28745
|
-
for (const name of AGENT_NAMES) {
|
|
28746
|
-
const model = config.agents[name].model.trim();
|
|
28747
|
-
if (model) agents[name] = { model };
|
|
28748
|
-
}
|
|
28749
|
-
merged["agent"] = config.defaultAgent;
|
|
28750
|
-
const defaultModel = agents[config.defaultAgent]?.model;
|
|
28751
|
-
if (defaultModel) merged["agentModel"] = defaultModel;
|
|
28752
|
-
else delete merged["agentModel"];
|
|
28753
|
-
if (Object.keys(agents).length > 0) merged["agents"] = agents;
|
|
28754
|
-
else delete merged["agents"];
|
|
28755
|
-
await writeV1Store(merged);
|
|
28756
|
-
}
|
|
28757
|
-
|
|
28758
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
28759
|
-
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
28760
|
-
var MODEL_FIELDS = [
|
|
28761
|
-
{ key: "model", label: "Model", hint: "(empty: the agent\u2019s own default)" }
|
|
28762
|
-
];
|
|
28763
|
-
var ROWS = [{ kind: "default" }, ...AGENT_NAMES.map((name) => ({ kind: "agent", name }))];
|
|
28764
|
-
function AgentForm({
|
|
28765
|
-
name,
|
|
28766
|
-
config,
|
|
28767
|
-
setConfig,
|
|
28768
|
-
onBack
|
|
28769
|
-
}) {
|
|
28770
|
-
const [saving, setSaving] = useState30(false);
|
|
28771
|
-
const [notice, setNotice] = useState30(null);
|
|
28772
|
-
const save = () => {
|
|
28773
|
-
setSaving(true);
|
|
28774
|
-
setNotice(null);
|
|
28775
|
-
writeAgentConfig(config).then(() => setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` })).catch(
|
|
28776
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
28777
|
-
).finally(() => setSaving(false));
|
|
28778
|
-
};
|
|
28779
|
-
return /* @__PURE__ */ jsx56(
|
|
28780
|
-
FieldForm,
|
|
28781
|
-
{
|
|
28782
|
-
title: AGENT_LABELS[name],
|
|
28783
|
-
subtitle: `Runs the \`${AGENT_HINTS[name]}\` command. ${config.defaultAgent === name ? "This is the default agent." : ""}`.trim(),
|
|
28784
|
-
fields: MODEL_FIELDS,
|
|
28785
|
-
values: { model: config.agents[name].model },
|
|
28786
|
-
onChange: (_key, value) => {
|
|
28787
|
-
setConfig({ ...config, agents: { ...config.agents, [name]: { model: value } } });
|
|
28788
|
-
setNotice(null);
|
|
28789
|
-
},
|
|
28790
|
-
onSave: save,
|
|
28791
|
-
onQuit: onBack,
|
|
28792
|
-
notice,
|
|
28793
|
-
busy: saving
|
|
28794
|
-
}
|
|
28795
|
-
);
|
|
28796
|
-
}
|
|
28797
|
-
function AgentsScreen({ onDone }) {
|
|
28798
|
-
const [config, setConfig] = useState30(null);
|
|
28799
|
-
const [focus, setFocus] = useState30(0);
|
|
28800
|
-
const [open, setOpen] = useState30(null);
|
|
28801
|
-
const [notice, setNotice] = useState30(null);
|
|
28802
|
-
useEffect22(() => {
|
|
28803
|
-
void readAgentConfig().then((loaded) => {
|
|
28804
|
-
setConfig(loaded);
|
|
28805
|
-
startDebugRun({
|
|
28806
|
-
flow: "settings/agents",
|
|
28807
|
-
step: "01-agents",
|
|
28808
|
-
menuOption: "Configuration > Agents",
|
|
28809
|
-
inputs: { default_agent: loaded.defaultAgent }
|
|
28810
|
-
});
|
|
28811
|
-
});
|
|
28812
|
-
}, []);
|
|
28813
|
-
const cycleDefault = (step) => {
|
|
28814
|
-
if (!config) return;
|
|
28815
|
-
const index = AGENT_NAMES.indexOf(config.defaultAgent);
|
|
28816
|
-
const next = { ...config, defaultAgent: AGENT_NAMES[(index + step + AGENT_NAMES.length) % AGENT_NAMES.length] };
|
|
28817
|
-
setConfig(next);
|
|
28818
|
-
writeAgentConfig(next).then(() => setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[next.defaultAgent]}` })).catch(
|
|
28819
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
28820
|
-
);
|
|
28821
|
-
};
|
|
28822
|
-
useInput12((input, key) => {
|
|
28823
|
-
if (!config || open) return;
|
|
28824
|
-
const row = ROWS[focus];
|
|
28825
|
-
if (key.upArrow) {
|
|
28826
|
-
setFocus((i) => (i - 1 + ROWS.length) % ROWS.length);
|
|
28827
|
-
return;
|
|
28828
|
-
}
|
|
28829
|
-
if (key.downArrow || key.tab) {
|
|
28830
|
-
setFocus((i) => (i + 1) % ROWS.length);
|
|
28831
|
-
return;
|
|
28832
|
-
}
|
|
28833
|
-
if (row.kind === "default" && key.leftArrow) {
|
|
28834
|
-
cycleDefault(-1);
|
|
28835
|
-
return;
|
|
28836
|
-
}
|
|
28837
|
-
if (row.kind === "default" && key.rightArrow) {
|
|
28838
|
-
cycleDefault(1);
|
|
28839
|
-
return;
|
|
28840
|
-
}
|
|
28841
|
-
if (key.return) {
|
|
28842
|
-
if (row.kind === "default") cycleDefault(1);
|
|
28843
|
-
else setOpen(row.name);
|
|
28844
|
-
return;
|
|
28845
|
-
}
|
|
28846
|
-
if (key.escape || input === "q") {
|
|
28847
|
-
void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
|
|
28848
|
-
onDone();
|
|
28849
|
-
}
|
|
28850
|
-
});
|
|
28851
|
-
if (!config) {
|
|
28852
|
-
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28853
|
-
/* @__PURE__ */ jsx56(Text47, { bold: true, children: "Agents" }),
|
|
28854
|
-
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28855
|
-
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.accent, children: "Loading..." })
|
|
28856
|
-
] });
|
|
28857
|
-
}
|
|
28858
|
-
if (open) {
|
|
28859
|
-
return /* @__PURE__ */ jsx56(AgentForm, { name: open, config, setConfig, onBack: () => setOpen(null) });
|
|
28860
|
-
}
|
|
28861
|
-
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28862
|
-
/* @__PURE__ */ jsx56(Text47, { bold: true, children: "Agents" }),
|
|
28863
|
-
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "The coding agent the CLI runs, and the settings for each one." }),
|
|
28864
|
-
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28865
|
-
ROWS.map((row, index) => {
|
|
28866
|
-
const isFocused = index === focus;
|
|
28867
|
-
const pointer = /* @__PURE__ */ jsx56(Text47, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
28868
|
-
if (row.kind === "default") {
|
|
28869
|
-
return /* @__PURE__ */ jsx56(Box45, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
28870
|
-
pointer,
|
|
28871
|
-
/* @__PURE__ */ jsx56(Text47, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: "Default agent" }),
|
|
28872
|
-
/* @__PURE__ */ jsx56(Text47, { bold: true, children: `\u2039 ${AGENT_LABELS[config.defaultAgent]} \u203A` })
|
|
28873
|
-
] }) }, "default");
|
|
28874
|
-
}
|
|
28875
|
-
const model = config.agents[row.name].model;
|
|
28876
|
-
return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
28877
|
-
pointer,
|
|
28878
|
-
/* @__PURE__ */ jsx56(Box45, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[row.name] }) }),
|
|
28879
|
-
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: model ? `model: ${model}` : "model: default" }),
|
|
28880
|
-
row.name === config.defaultAgent && /* @__PURE__ */ jsx56(Text47, { color: PALETTE.success, children: "(default)" })
|
|
28881
|
-
] }, row.name);
|
|
28882
|
-
}),
|
|
28883
|
-
notice && /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
28884
|
-
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28885
|
-
/* @__PURE__ */ jsxs46(Text47, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28886
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28887
|
-
" ",
|
|
28888
|
-
notice.text
|
|
28889
|
-
] })
|
|
28890
|
-
] }),
|
|
28891
|
-
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28892
|
-
/* @__PURE__ */ jsx56(
|
|
28893
|
-
ControlHints,
|
|
28894
|
-
{
|
|
28895
|
-
hints: ROWS[focus].kind === "default" ? [
|
|
28896
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
28897
|
-
{ keys: "\u2190/\u2192", label: "change default agent" },
|
|
28898
|
-
{ keys: "Esc/q", label: "back" }
|
|
28899
|
-
] : [
|
|
28900
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
28901
|
-
{ keys: "\u23CE", label: "open" },
|
|
28902
|
-
{ keys: "Esc/q", label: "back" }
|
|
28903
|
-
]
|
|
28904
|
-
}
|
|
28905
|
-
)
|
|
28906
|
-
] });
|
|
28907
|
-
}
|
|
28908
|
-
|
|
28909
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
28910
|
-
import { useEffect as useEffect23, useState as useState31 } from "react";
|
|
28911
|
-
import { Box as Box46, Text as Text48 } from "ink";
|
|
28912
|
-
init_debug_store();
|
|
28913
|
-
|
|
28914
28575
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
28915
28576
|
async function readCredentials() {
|
|
28916
28577
|
const store = await readV1Store();
|
|
@@ -28936,16 +28597,17 @@ async function writeCredentials(config) {
|
|
|
28936
28597
|
await writeV1Store(merged);
|
|
28937
28598
|
}
|
|
28938
28599
|
|
|
28939
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/
|
|
28940
|
-
|
|
28941
|
-
|
|
28942
|
-
|
|
28943
|
-
|
|
28944
|
-
|
|
28945
|
-
|
|
28946
|
-
|
|
28947
|
-
|
|
28948
|
-
|
|
28600
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28601
|
+
init_debug_store();
|
|
28602
|
+
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
28603
|
+
var FIELD_ORDER = [
|
|
28604
|
+
"spaceId",
|
|
28605
|
+
"environmentId",
|
|
28606
|
+
"cmaToken",
|
|
28607
|
+
"host",
|
|
28608
|
+
"defaultComponentDir",
|
|
28609
|
+
"defaultTokenFile",
|
|
28610
|
+
"contentfulBaseDir"
|
|
28949
28611
|
];
|
|
28950
28612
|
function debugFields(config) {
|
|
28951
28613
|
return {
|
|
@@ -28958,114 +28620,156 @@ function debugFields(config) {
|
|
|
28958
28620
|
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
28959
28621
|
};
|
|
28960
28622
|
}
|
|
28961
|
-
var
|
|
28962
|
-
|
|
28963
|
-
|
|
28964
|
-
|
|
28965
|
-
|
|
28966
|
-
|
|
28967
|
-
|
|
28968
|
-
|
|
28623
|
+
var FIELD_LABELS = {
|
|
28624
|
+
spaceId: "Space ID",
|
|
28625
|
+
environmentId: "Environment ID",
|
|
28626
|
+
cmaToken: "CMA Token",
|
|
28627
|
+
host: "API Host",
|
|
28628
|
+
defaultComponentDir: "Default component directory",
|
|
28629
|
+
defaultTokenFile: "Default token file",
|
|
28630
|
+
contentfulBaseDir: "Root Project Directory"
|
|
28631
|
+
};
|
|
28632
|
+
var FIELD_HINTS = {
|
|
28633
|
+
contentfulBaseDir: "(where .contentful goes)"
|
|
28634
|
+
};
|
|
28635
|
+
var LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
|
|
28636
|
+
function ConfigurationScreen({ onDone }) {
|
|
28637
|
+
const [stage, setStage] = useState29("loading");
|
|
28638
|
+
const [config, setConfig] = useState29(null);
|
|
28639
|
+
const [activeField, setActiveField] = useState29("spaceId");
|
|
28640
|
+
const [notice, setNotice] = useState29(null);
|
|
28641
|
+
const [lastSaved, setLastSaved] = useState29(null);
|
|
28642
|
+
const [editing, setEditing] = useState29(false);
|
|
28643
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28644
|
+
useEffect22(() => {
|
|
28645
|
+
readCredentials().then((cfg) => {
|
|
28969
28646
|
setConfig(cfg);
|
|
28647
|
+
setStage("form");
|
|
28970
28648
|
startDebugRun({
|
|
28971
28649
|
flow: "settings/contentful-configuration",
|
|
28972
28650
|
step: "01-configuration",
|
|
28973
|
-
menuOption: "Configuration
|
|
28651
|
+
menuOption: "Configuration",
|
|
28974
28652
|
inputs: debugFields(cfg)
|
|
28975
28653
|
});
|
|
28976
28654
|
});
|
|
28977
28655
|
}, []);
|
|
28978
|
-
|
|
28979
|
-
|
|
28980
|
-
|
|
28981
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
28982
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
28983
|
-
] });
|
|
28656
|
+
function fieldValue(field) {
|
|
28657
|
+
if (!config) return "";
|
|
28658
|
+
return config[field] || "";
|
|
28984
28659
|
}
|
|
28985
|
-
|
|
28986
|
-
|
|
28660
|
+
function setFieldValue(field, value) {
|
|
28661
|
+
if (!config) return;
|
|
28662
|
+
setConfig({ ...config, [field]: value });
|
|
28663
|
+
setNotice(null);
|
|
28664
|
+
}
|
|
28665
|
+
function handleSave() {
|
|
28666
|
+
if (!config) return;
|
|
28667
|
+
setStage("saving");
|
|
28987
28668
|
setNotice(null);
|
|
28988
28669
|
writeCredentials(config).then(() => {
|
|
28989
28670
|
setLastSaved(config);
|
|
28990
28671
|
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
28991
|
-
setNotice({ kind: "success", text: "
|
|
28672
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
28673
|
+
setStage("form");
|
|
28992
28674
|
}).catch((err) => {
|
|
28993
28675
|
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
28994
|
-
|
|
28995
|
-
|
|
28996
|
-
|
|
28676
|
+
setStage("form");
|
|
28677
|
+
});
|
|
28678
|
+
}
|
|
28679
|
+
function quit() {
|
|
28997
28680
|
void finishDebugRun(
|
|
28998
28681
|
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
28999
28682
|
);
|
|
29000
28683
|
onDone();
|
|
29001
|
-
}
|
|
29002
|
-
|
|
29003
|
-
|
|
29004
|
-
{
|
|
29005
|
-
|
|
29006
|
-
|
|
29007
|
-
|
|
29008
|
-
|
|
29009
|
-
|
|
29010
|
-
setConfig({ ...config, [key]: value });
|
|
29011
|
-
setNotice(null);
|
|
29012
|
-
},
|
|
29013
|
-
onSave: save,
|
|
29014
|
-
onQuit: quit,
|
|
29015
|
-
notice,
|
|
29016
|
-
busy: saving
|
|
28684
|
+
}
|
|
28685
|
+
useInput11((input, key) => {
|
|
28686
|
+
if (stage === "loading" || stage === "saving") return;
|
|
28687
|
+
if (editing) {
|
|
28688
|
+
if (key.escape) {
|
|
28689
|
+
setFieldValue(activeField, valueBeforeEdit);
|
|
28690
|
+
setEditing(false);
|
|
28691
|
+
}
|
|
28692
|
+
return;
|
|
29017
28693
|
}
|
|
29018
|
-
|
|
29019
|
-
|
|
29020
|
-
|
|
29021
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
29022
|
-
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
29023
|
-
var SECTIONS = [
|
|
29024
|
-
{
|
|
29025
|
-
id: "project",
|
|
29026
|
-
label: "Project",
|
|
29027
|
-
description: "Contentful space, credentials, defaults and where .contentful goes"
|
|
29028
|
-
},
|
|
29029
|
-
{ id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
|
|
29030
|
-
];
|
|
29031
|
-
function ConfigurationScreen({ onDone }) {
|
|
29032
|
-
const [focus, setFocus] = useState32(0);
|
|
29033
|
-
const [open, setOpen] = useState32(null);
|
|
29034
|
-
const close = () => setOpen(null);
|
|
29035
|
-
useInput13((input, key) => {
|
|
29036
|
-
if (open) return;
|
|
29037
|
-
if (key.upArrow) {
|
|
29038
|
-
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
28694
|
+
if (key.escape || input === "q") {
|
|
28695
|
+
quit();
|
|
29039
28696
|
return;
|
|
29040
28697
|
}
|
|
29041
|
-
if (
|
|
29042
|
-
|
|
28698
|
+
if (input === "s") {
|
|
28699
|
+
handleSave();
|
|
29043
28700
|
return;
|
|
29044
28701
|
}
|
|
29045
|
-
if (
|
|
29046
|
-
|
|
28702
|
+
if (input === "c") {
|
|
28703
|
+
setFieldValue(activeField, "");
|
|
29047
28704
|
return;
|
|
29048
28705
|
}
|
|
29049
|
-
if (key.
|
|
28706
|
+
if (key.tab || key.downArrow) {
|
|
28707
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
28708
|
+
setActiveField(FIELD_ORDER[(idx + 1) % FIELD_ORDER.length]);
|
|
28709
|
+
return;
|
|
28710
|
+
}
|
|
28711
|
+
if (key.upArrow) {
|
|
28712
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
28713
|
+
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
28714
|
+
return;
|
|
28715
|
+
}
|
|
28716
|
+
if (key.return) {
|
|
28717
|
+
setValueBeforeEdit(fieldValue(activeField));
|
|
28718
|
+
setEditing(true);
|
|
28719
|
+
}
|
|
29050
28720
|
});
|
|
29051
|
-
if (
|
|
29052
|
-
|
|
29053
|
-
|
|
29054
|
-
|
|
29055
|
-
|
|
29056
|
-
|
|
29057
|
-
|
|
29058
|
-
|
|
29059
|
-
|
|
29060
|
-
|
|
29061
|
-
/* @__PURE__ */
|
|
29062
|
-
|
|
28721
|
+
if (stage === "loading") {
|
|
28722
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28723
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
28724
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28725
|
+
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.accent, children: "Loading..." })
|
|
28726
|
+
] });
|
|
28727
|
+
}
|
|
28728
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28729
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
28730
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28731
|
+
/* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
28732
|
+
const isActive = activeField === field;
|
|
28733
|
+
const value = fieldValue(field);
|
|
28734
|
+
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
28735
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28736
|
+
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
28737
|
+
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
|
|
28738
|
+
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
28739
|
+
TextInput4,
|
|
28740
|
+
{
|
|
28741
|
+
value,
|
|
28742
|
+
onChange: (next) => setFieldValue(field, next),
|
|
28743
|
+
onSubmit: () => setEditing(false),
|
|
28744
|
+
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
28745
|
+
}
|
|
28746
|
+
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
28747
|
+
FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
|
|
28748
|
+
] }, field);
|
|
28749
|
+
}) }),
|
|
28750
|
+
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
28751
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28752
|
+
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28753
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28754
|
+
" ",
|
|
28755
|
+
notice.text
|
|
28756
|
+
] })
|
|
28757
|
+
] }),
|
|
28758
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28759
|
+
/* @__PURE__ */ jsx55(
|
|
29063
28760
|
ControlHints,
|
|
29064
28761
|
{
|
|
29065
|
-
hints: [
|
|
28762
|
+
hints: editing ? [
|
|
28763
|
+
{ keys: "type", label: "edit" },
|
|
28764
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
28765
|
+
{ keys: "\u23CE", label: "done" },
|
|
28766
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
28767
|
+
] : [
|
|
29066
28768
|
{ keys: "\u2191/\u2193", label: "move" },
|
|
29067
|
-
{ keys: "\u23CE", label: "
|
|
29068
|
-
{ keys: "
|
|
28769
|
+
{ keys: "\u23CE", label: "edit" },
|
|
28770
|
+
{ keys: "c", label: "clear" },
|
|
28771
|
+
{ keys: "s", label: "save" },
|
|
28772
|
+
{ keys: "Esc/q", label: "quit without saving" }
|
|
29069
28773
|
]
|
|
29070
28774
|
}
|
|
29071
28775
|
)
|
|
@@ -29073,8 +28777,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
29073
28777
|
}
|
|
29074
28778
|
|
|
29075
28779
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
29076
|
-
import { useEffect as
|
|
29077
|
-
import { Box as
|
|
28780
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
28781
|
+
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
29078
28782
|
|
|
29079
28783
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
29080
28784
|
async function readAnalyticsSetting() {
|
|
@@ -29093,11 +28797,11 @@ async function writeAnalyticsSetting(setting) {
|
|
|
29093
28797
|
|
|
29094
28798
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
29095
28799
|
init_debug_store();
|
|
29096
|
-
import { Fragment as
|
|
28800
|
+
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
29097
28801
|
function OptInAnalyticsScreen({ onDone }) {
|
|
29098
|
-
const [loading, setLoading] =
|
|
29099
|
-
const [enabled, setEnabled] =
|
|
29100
|
-
|
|
28802
|
+
const [loading, setLoading] = useState30(true);
|
|
28803
|
+
const [enabled, setEnabled] = useState30(true);
|
|
28804
|
+
useEffect23(() => {
|
|
29101
28805
|
readAnalyticsSetting().then((setting) => {
|
|
29102
28806
|
setEnabled(setting.enabled);
|
|
29103
28807
|
setLoading(false);
|
|
@@ -29109,7 +28813,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29109
28813
|
});
|
|
29110
28814
|
});
|
|
29111
28815
|
}, []);
|
|
29112
|
-
|
|
28816
|
+
useInput12((input, key) => {
|
|
29113
28817
|
if (loading) return;
|
|
29114
28818
|
if (key.return || input === " ") {
|
|
29115
28819
|
setEnabled((current) => {
|
|
@@ -29124,21 +28828,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29124
28828
|
onDone();
|
|
29125
28829
|
}
|
|
29126
28830
|
});
|
|
29127
|
-
return /* @__PURE__ */
|
|
29128
|
-
/* @__PURE__ */
|
|
29129
|
-
/* @__PURE__ */
|
|
29130
|
-
loading ? /* @__PURE__ */
|
|
29131
|
-
/* @__PURE__ */
|
|
28831
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28832
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
28833
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28834
|
+
loading ? /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
28835
|
+
/* @__PURE__ */ jsxs46(Text47, { children: [
|
|
29132
28836
|
"Share anonymous usage data:",
|
|
29133
28837
|
" ",
|
|
29134
|
-
/* @__PURE__ */
|
|
28838
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
29135
28839
|
] }),
|
|
29136
|
-
/* @__PURE__ */
|
|
29137
|
-
/* @__PURE__ */
|
|
29138
|
-
/* @__PURE__ */
|
|
28840
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28841
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
28842
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
29139
28843
|
] }),
|
|
29140
|
-
/* @__PURE__ */
|
|
29141
|
-
/* @__PURE__ */
|
|
28844
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
28845
|
+
/* @__PURE__ */ jsx56(
|
|
29142
28846
|
ControlHints,
|
|
29143
28847
|
{
|
|
29144
28848
|
hints: [
|
|
@@ -29151,15 +28855,15 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29151
28855
|
}
|
|
29152
28856
|
|
|
29153
28857
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
29154
|
-
import { useEffect as
|
|
29155
|
-
import { Box as
|
|
28858
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
28859
|
+
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
29156
28860
|
init_version();
|
|
29157
28861
|
init_debug_store();
|
|
29158
|
-
import { jsx as
|
|
28862
|
+
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
29159
28863
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
29160
28864
|
function UpgradeScreen({ onDone }) {
|
|
29161
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
29162
|
-
|
|
28865
|
+
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
28866
|
+
useEffect24(() => {
|
|
29163
28867
|
startDebugRun({
|
|
29164
28868
|
flow: "upgrade",
|
|
29165
28869
|
step: "01-upgrade",
|
|
@@ -29168,7 +28872,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
29168
28872
|
});
|
|
29169
28873
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
29170
28874
|
}, []);
|
|
29171
|
-
|
|
28875
|
+
useInput13((_input, key) => {
|
|
29172
28876
|
if (key.return) {
|
|
29173
28877
|
void finishDebugRun({
|
|
29174
28878
|
outputs: upgradeCheck ?? {},
|
|
@@ -29179,12 +28883,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
29179
28883
|
return;
|
|
29180
28884
|
}
|
|
29181
28885
|
});
|
|
29182
|
-
return /* @__PURE__ */
|
|
29183
|
-
/* @__PURE__ */
|
|
29184
|
-
/* @__PURE__ */
|
|
28886
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28887
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Upgrade" }),
|
|
28888
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29185
28889
|
renderBody(upgradeCheck),
|
|
29186
|
-
/* @__PURE__ */
|
|
29187
|
-
/* @__PURE__ */
|
|
28890
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
28891
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.accent, children: [
|
|
29188
28892
|
FOCUS_MARKER,
|
|
29189
28893
|
" Go Back"
|
|
29190
28894
|
] })
|
|
@@ -29192,47 +28896,47 @@ function UpgradeScreen({ onDone }) {
|
|
|
29192
28896
|
}
|
|
29193
28897
|
function renderBody(upgradeCheck) {
|
|
29194
28898
|
if (!upgradeCheck) {
|
|
29195
|
-
return /* @__PURE__ */
|
|
28899
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
29196
28900
|
}
|
|
29197
28901
|
if (upgradeCheck.status === "error") {
|
|
29198
|
-
return /* @__PURE__ */
|
|
28902
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
29199
28903
|
}
|
|
29200
28904
|
if (upgradeCheck.status === "up-to-date") {
|
|
29201
|
-
return /* @__PURE__ */
|
|
28905
|
+
return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.success, children: [
|
|
29202
28906
|
"You're already on the latest version (v",
|
|
29203
28907
|
upgradeCheck.current,
|
|
29204
28908
|
")."
|
|
29205
28909
|
] });
|
|
29206
28910
|
}
|
|
29207
|
-
return /* @__PURE__ */
|
|
29208
|
-
/* @__PURE__ */
|
|
29209
|
-
/* @__PURE__ */
|
|
28911
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", children: [
|
|
28912
|
+
/* @__PURE__ */ jsxs47(Text48, { color: PALETTE.muted, children: [
|
|
28913
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.success, children: [
|
|
29210
28914
|
"v",
|
|
29211
28915
|
upgradeCheck.latest
|
|
29212
28916
|
] }),
|
|
29213
28917
|
" ",
|
|
29214
28918
|
"is available (you're on ",
|
|
29215
|
-
/* @__PURE__ */
|
|
28919
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, children: [
|
|
29216
28920
|
"v",
|
|
29217
28921
|
upgradeCheck.current
|
|
29218
28922
|
] }),
|
|
29219
28923
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
29220
28924
|
] }),
|
|
29221
|
-
/* @__PURE__ */
|
|
29222
|
-
/* @__PURE__ */
|
|
28925
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
28926
|
+
/* @__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)) })
|
|
29223
28927
|
] });
|
|
29224
28928
|
}
|
|
29225
28929
|
|
|
29226
28930
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
29227
|
-
import { useEffect as
|
|
29228
|
-
import { Box as
|
|
28931
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
28932
|
+
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
29229
28933
|
init_debug_mode_store();
|
|
29230
28934
|
init_debug_store();
|
|
29231
|
-
import { jsx as
|
|
28935
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
29232
28936
|
function DebugModeScreen({ onDone }) {
|
|
29233
|
-
const [loading, setLoading] =
|
|
29234
|
-
const [enabled, setEnabled] =
|
|
29235
|
-
|
|
28937
|
+
const [loading, setLoading] = useState32(true);
|
|
28938
|
+
const [enabled, setEnabled] = useState32(true);
|
|
28939
|
+
useEffect25(() => {
|
|
29236
28940
|
readDebugModeSetting().then((setting) => {
|
|
29237
28941
|
setEnabled(setting.enabled);
|
|
29238
28942
|
setLoading(false);
|
|
@@ -29244,7 +28948,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
29244
28948
|
});
|
|
29245
28949
|
});
|
|
29246
28950
|
}, []);
|
|
29247
|
-
|
|
28951
|
+
useInput14((input, key) => {
|
|
29248
28952
|
if (loading) return;
|
|
29249
28953
|
if (key.return || input === " ") {
|
|
29250
28954
|
setEnabled((current) => {
|
|
@@ -29259,16 +28963,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
29259
28963
|
onDone();
|
|
29260
28964
|
}
|
|
29261
28965
|
});
|
|
29262
|
-
return /* @__PURE__ */
|
|
29263
|
-
/* @__PURE__ */
|
|
29264
|
-
/* @__PURE__ */
|
|
29265
|
-
loading ? /* @__PURE__ */
|
|
28966
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28967
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
28968
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
28969
|
+
loading ? /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs48(Text49, { children: [
|
|
29266
28970
|
"Debug logging:",
|
|
29267
28971
|
" ",
|
|
29268
|
-
/* @__PURE__ */
|
|
28972
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
29269
28973
|
] }),
|
|
29270
|
-
/* @__PURE__ */
|
|
29271
|
-
/* @__PURE__ */
|
|
28974
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
28975
|
+
/* @__PURE__ */ jsx58(
|
|
29272
28976
|
ControlHints,
|
|
29273
28977
|
{
|
|
29274
28978
|
hints: [
|
|
@@ -29281,18 +28985,18 @@ function DebugModeScreen({ onDone }) {
|
|
|
29281
28985
|
}
|
|
29282
28986
|
|
|
29283
28987
|
// packages/experience-design-system-cli/app.tsx
|
|
29284
|
-
import { Fragment as
|
|
28988
|
+
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
29285
28989
|
function App({ importOptions, inkClear }) {
|
|
29286
|
-
const [screen, setScreen] =
|
|
29287
|
-
const [importExitCode, setImportExitCode] =
|
|
28990
|
+
const [screen, setScreen] = useState33("start");
|
|
28991
|
+
const [importExitCode, setImportExitCode] = useState33();
|
|
29288
28992
|
const showImportResult = importExitCode !== void 0;
|
|
29289
|
-
const [projectPath, setProjectPath] =
|
|
29290
|
-
const [tokensPath, setTokensPath] =
|
|
29291
|
-
const [scannedFiles, setScannedFiles] =
|
|
29292
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
29293
|
-
const [extractionRun, setExtractionRun] =
|
|
28993
|
+
const [projectPath, setProjectPath] = useState33();
|
|
28994
|
+
const [tokensPath, setTokensPath] = useState33();
|
|
28995
|
+
const [scannedFiles, setScannedFiles] = useState33();
|
|
28996
|
+
const [pendingLaunch, setPendingLaunch] = useState33();
|
|
28997
|
+
const [extractionRun, setExtractionRun] = useState33();
|
|
29294
28998
|
const extraction = useExtraction(extractionRun?.input);
|
|
29295
|
-
const [scopeRun, setScopeRun] =
|
|
28999
|
+
const [scopeRun, setScopeRun] = useState33();
|
|
29296
29000
|
const scopeFlow = useScopeGateFlow(
|
|
29297
29001
|
scopeRun && {
|
|
29298
29002
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -29307,12 +29011,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29307
29011
|
}
|
|
29308
29012
|
}
|
|
29309
29013
|
);
|
|
29310
|
-
const [generationInput, setGenerationInput] =
|
|
29014
|
+
const [generationInput, setGenerationInput] = useState33();
|
|
29311
29015
|
const generation = useGeneration(generationInput);
|
|
29312
|
-
const [flowStart, setFlowStart] =
|
|
29016
|
+
const [flowStart, setFlowStart] = useState33();
|
|
29313
29017
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
29314
|
-
const [importDefaults, setImportDefaults] =
|
|
29315
|
-
|
|
29018
|
+
const [importDefaults, setImportDefaults] = useState33();
|
|
29019
|
+
useEffect26(() => {
|
|
29316
29020
|
if (screen !== "import") {
|
|
29317
29021
|
setImportDefaults(void 0);
|
|
29318
29022
|
return;
|
|
@@ -29330,7 +29034,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29330
29034
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
29331
29035
|
const state2 = await inspectTokens({
|
|
29332
29036
|
rawTokensPath: tokens,
|
|
29333
|
-
contentfulDir:
|
|
29037
|
+
contentfulDir: join25(resolveUserPath(projectPath2), ".contentful"),
|
|
29334
29038
|
cache: importOptions.cache
|
|
29335
29039
|
});
|
|
29336
29040
|
if (state2.kind === "cached") {
|
|
@@ -29372,12 +29076,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29372
29076
|
}
|
|
29373
29077
|
});
|
|
29374
29078
|
};
|
|
29375
|
-
|
|
29079
|
+
useEffect26(() => {
|
|
29376
29080
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
29377
29081
|
setExtractionRun(void 0);
|
|
29378
29082
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
29379
29083
|
}, [extraction, extractionRun]);
|
|
29380
|
-
|
|
29084
|
+
useEffect26(() => {
|
|
29381
29085
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
29382
29086
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29383
29087
|
setGenerationInput({
|
|
@@ -29395,7 +29099,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29395
29099
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
29396
29100
|
});
|
|
29397
29101
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
29398
|
-
|
|
29102
|
+
useEffect26(() => {
|
|
29399
29103
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
29400
29104
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29401
29105
|
inkClear();
|
|
@@ -29438,9 +29142,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29438
29142
|
};
|
|
29439
29143
|
switch (screen) {
|
|
29440
29144
|
case "import":
|
|
29441
|
-
if (showImportResult) return /* @__PURE__ */
|
|
29145
|
+
if (showImportResult) return /* @__PURE__ */ jsx59(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
29442
29146
|
if (flow && flowStart) {
|
|
29443
|
-
return /* @__PURE__ */
|
|
29147
|
+
return /* @__PURE__ */ jsx59(
|
|
29444
29148
|
FlowScreen,
|
|
29445
29149
|
{
|
|
29446
29150
|
state: flow.state,
|
|
@@ -29450,12 +29154,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29450
29154
|
}
|
|
29451
29155
|
);
|
|
29452
29156
|
}
|
|
29453
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
29157
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
29454
29158
|
if (projectPath === void 0) {
|
|
29455
|
-
return /* @__PURE__ */
|
|
29159
|
+
return /* @__PURE__ */ jsx59(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
29456
29160
|
}
|
|
29457
29161
|
if (tokensPath === void 0) {
|
|
29458
|
-
return /* @__PURE__ */
|
|
29162
|
+
return /* @__PURE__ */ jsx59(
|
|
29459
29163
|
TokenInputScreen,
|
|
29460
29164
|
{
|
|
29461
29165
|
initialPath: importDefaults.tokenFile,
|
|
@@ -29465,7 +29169,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29465
29169
|
);
|
|
29466
29170
|
}
|
|
29467
29171
|
if (scannedFiles === void 0) {
|
|
29468
|
-
return /* @__PURE__ */
|
|
29172
|
+
return /* @__PURE__ */ jsx59(
|
|
29469
29173
|
PathValidationScreen,
|
|
29470
29174
|
{
|
|
29471
29175
|
projectPath,
|
|
@@ -29477,10 +29181,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29477
29181
|
}
|
|
29478
29182
|
if (extractionRun) {
|
|
29479
29183
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
29480
|
-
return /* @__PURE__ */
|
|
29184
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
29481
29185
|
}
|
|
29482
29186
|
if (extraction?.status === "running") {
|
|
29483
|
-
return /* @__PURE__ */
|
|
29187
|
+
return /* @__PURE__ */ jsx59(
|
|
29484
29188
|
ExtractionScreen,
|
|
29485
29189
|
{
|
|
29486
29190
|
progress: extraction.progress,
|
|
@@ -29489,14 +29193,14 @@ function App({ importOptions, inkClear }) {
|
|
|
29489
29193
|
}
|
|
29490
29194
|
);
|
|
29491
29195
|
}
|
|
29492
|
-
return /* @__PURE__ */
|
|
29196
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
29493
29197
|
}
|
|
29494
29198
|
if (scopeRun && scopeFlow) {
|
|
29495
29199
|
if (scopeFlow.status === "failed") {
|
|
29496
|
-
return /* @__PURE__ */
|
|
29200
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
29497
29201
|
}
|
|
29498
29202
|
if (scopeFlow.status === "deciding") {
|
|
29499
|
-
return /* @__PURE__ */
|
|
29203
|
+
return /* @__PURE__ */ jsx59(
|
|
29500
29204
|
ScopeGateScreen,
|
|
29501
29205
|
{
|
|
29502
29206
|
components: scopeFlow.load.components,
|
|
@@ -29506,7 +29210,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29506
29210
|
);
|
|
29507
29211
|
}
|
|
29508
29212
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
29509
|
-
return /* @__PURE__ */
|
|
29213
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
29510
29214
|
}
|
|
29511
29215
|
if (generation?.status === "running") {
|
|
29512
29216
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -29514,7 +29218,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29514
29218
|
hasRawTokens,
|
|
29515
29219
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
29516
29220
|
});
|
|
29517
|
-
return /* @__PURE__ */
|
|
29221
|
+
return /* @__PURE__ */ jsx59(
|
|
29518
29222
|
GenerationScreen,
|
|
29519
29223
|
{
|
|
29520
29224
|
progress: generation.progress,
|
|
@@ -29526,10 +29230,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29526
29230
|
}
|
|
29527
29231
|
);
|
|
29528
29232
|
}
|
|
29529
|
-
return /* @__PURE__ */
|
|
29233
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
29530
29234
|
}
|
|
29531
29235
|
if (pendingLaunch?.cached) {
|
|
29532
|
-
return /* @__PURE__ */
|
|
29236
|
+
return /* @__PURE__ */ jsx59(
|
|
29533
29237
|
TokenReuseScreen,
|
|
29534
29238
|
{
|
|
29535
29239
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -29540,7 +29244,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29540
29244
|
}
|
|
29541
29245
|
);
|
|
29542
29246
|
}
|
|
29543
|
-
return /* @__PURE__ */
|
|
29247
|
+
return /* @__PURE__ */ jsx59(
|
|
29544
29248
|
CredentialsScreen,
|
|
29545
29249
|
{
|
|
29546
29250
|
initial: importDefaults.credentials,
|
|
@@ -29549,19 +29253,19 @@ function App({ importOptions, inkClear }) {
|
|
|
29549
29253
|
}
|
|
29550
29254
|
);
|
|
29551
29255
|
case "help":
|
|
29552
|
-
return /* @__PURE__ */
|
|
29256
|
+
return /* @__PURE__ */ jsx59(HelpScreen, { onDone: goToStart });
|
|
29553
29257
|
case "upgrade":
|
|
29554
|
-
return /* @__PURE__ */
|
|
29258
|
+
return /* @__PURE__ */ jsx59(UpgradeScreen, { onDone: goToStart });
|
|
29555
29259
|
case "settings":
|
|
29556
|
-
return /* @__PURE__ */
|
|
29260
|
+
return /* @__PURE__ */ jsx59(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
29557
29261
|
case "settings-configuration":
|
|
29558
|
-
return /* @__PURE__ */
|
|
29262
|
+
return /* @__PURE__ */ jsx59(ConfigurationScreen, { onDone: goToSettings });
|
|
29559
29263
|
case "settings-opt-in-analytics":
|
|
29560
|
-
return /* @__PURE__ */
|
|
29264
|
+
return /* @__PURE__ */ jsx59(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
29561
29265
|
case "settings-debug-mode":
|
|
29562
|
-
return /* @__PURE__ */
|
|
29266
|
+
return /* @__PURE__ */ jsx59(DebugModeScreen, { onDone: goToSettings });
|
|
29563
29267
|
case "start":
|
|
29564
|
-
return /* @__PURE__ */
|
|
29268
|
+
return /* @__PURE__ */ jsx59(HomeScreen, { onNavigate: setScreen });
|
|
29565
29269
|
}
|
|
29566
29270
|
}
|
|
29567
29271
|
async function runApp(renderApp, importOptions) {
|
|
@@ -29569,7 +29273,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
29569
29273
|
instance.clear?.();
|
|
29570
29274
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
29571
29275
|
};
|
|
29572
|
-
const instance = renderApp(/* @__PURE__ */
|
|
29276
|
+
const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear }));
|
|
29573
29277
|
await instance.waitUntilExit();
|
|
29574
29278
|
}
|
|
29575
29279
|
export {
|