@contentful/experience-design-system-cli 2.37.1-dev-build-c299dd61.0 → 2.37.1-dev-build-2aacedbd.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 +1284 -1229
- package/dist/index.js +1284 -1234
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/01-welcome/logic.d.ts +0 -5
- package/dist/src/tui/import/steps/02-token-input/logic.d.ts +0 -5
- package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +0 -6
- package/dist/src/tui/shared/components/MenuScreen.d.ts +34 -0
- package/dist/src/tui/shared/components/PathStepScreen.d.ts +28 -0
- package/package.json +3 -3
- package/dist/src/tui/import/steps/01-welcome/controls.d.ts +0 -11
- package/dist/src/tui/import/steps/02-token-input/controls.d.ts +0 -11
- package/dist/src/tui/import/steps/03-path-validation/controls.d.ts +0 -13
package/dist/index.js
CHANGED
|
@@ -19981,109 +19981,441 @@ var init_ClearableTextInput = __esm({
|
|
|
19981
19981
|
}
|
|
19982
19982
|
});
|
|
19983
19983
|
|
|
19984
|
-
// packages/experience-design-system-cli/src/tui/
|
|
19985
|
-
|
|
19986
|
-
|
|
19984
|
+
// packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
|
|
19985
|
+
import { useState as useState5 } from "react";
|
|
19986
|
+
import { Box as Box10, Text as Text10, useInput as useInput7 } from "ink";
|
|
19987
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
19988
|
+
function formLabelWidth(rows) {
|
|
19989
|
+
return Math.max(...rows.map((row) => row.label.length));
|
|
19987
19990
|
}
|
|
19988
|
-
function
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
+
function FormReadOnlyRow({
|
|
19992
|
+
label,
|
|
19993
|
+
labelWidth,
|
|
19994
|
+
children
|
|
19995
|
+
}) {
|
|
19996
|
+
return /* @__PURE__ */ jsxs10(Box10, { gap: 1, children: [
|
|
19997
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
19998
|
+
/* @__PURE__ */ jsx11(Box10, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: label }) }),
|
|
19999
|
+
children
|
|
20000
|
+
] });
|
|
19991
20001
|
}
|
|
19992
|
-
|
|
19993
|
-
|
|
20002
|
+
function FieldForm({
|
|
20003
|
+
header,
|
|
20004
|
+
title,
|
|
20005
|
+
subtitle,
|
|
20006
|
+
fields: fields2,
|
|
20007
|
+
values,
|
|
20008
|
+
onChange,
|
|
20009
|
+
onSave,
|
|
20010
|
+
saveLabel = "save",
|
|
20011
|
+
enterAdvances = false,
|
|
20012
|
+
onSkip,
|
|
20013
|
+
skipLabel: skipLabel2 = "skip",
|
|
20014
|
+
onQuit,
|
|
20015
|
+
quitLabel = "back without saving",
|
|
20016
|
+
actions = [],
|
|
20017
|
+
notice,
|
|
20018
|
+
busy = false,
|
|
20019
|
+
children
|
|
20020
|
+
}) {
|
|
20021
|
+
const [active, setActive] = useState5(0);
|
|
20022
|
+
const [editing, setEditing] = useState5(false);
|
|
20023
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState5("");
|
|
20024
|
+
const rowCount = fields2.length + actions.length;
|
|
20025
|
+
const labelWidth = formLabelWidth([...fields2, ...actions]);
|
|
20026
|
+
const currentField = active < fields2.length ? fields2[active] : void 0;
|
|
20027
|
+
const currentAction = currentField ? void 0 : actions[active - fields2.length];
|
|
20028
|
+
useInput7((input, key) => {
|
|
20029
|
+
if (busy) return;
|
|
20030
|
+
if (editing) {
|
|
20031
|
+
if (key.escape && currentField) {
|
|
20032
|
+
onChange(currentField.key, valueBeforeEdit);
|
|
20033
|
+
setEditing(false);
|
|
20034
|
+
}
|
|
20035
|
+
return;
|
|
20036
|
+
}
|
|
20037
|
+
if (key.escape || input === "q") {
|
|
20038
|
+
onQuit();
|
|
20039
|
+
return;
|
|
20040
|
+
}
|
|
20041
|
+
if (input === "s") {
|
|
20042
|
+
onSave();
|
|
20043
|
+
return;
|
|
20044
|
+
}
|
|
20045
|
+
if (input === "k" && onSkip) {
|
|
20046
|
+
onSkip();
|
|
20047
|
+
return;
|
|
20048
|
+
}
|
|
20049
|
+
if (isClearKey(input, key) && currentField) {
|
|
20050
|
+
onChange(currentField.key, "");
|
|
20051
|
+
return;
|
|
20052
|
+
}
|
|
20053
|
+
if (key.tab || key.downArrow) {
|
|
20054
|
+
setActive((i) => (i + 1) % rowCount);
|
|
20055
|
+
return;
|
|
20056
|
+
}
|
|
20057
|
+
if (key.upArrow) {
|
|
20058
|
+
setActive((i) => (i - 1 + rowCount) % rowCount);
|
|
20059
|
+
return;
|
|
20060
|
+
}
|
|
20061
|
+
if (key.return) {
|
|
20062
|
+
if (currentField) {
|
|
20063
|
+
setValueBeforeEdit(values[currentField.key]);
|
|
20064
|
+
setEditing(true);
|
|
20065
|
+
} else {
|
|
20066
|
+
currentAction?.onRun();
|
|
20067
|
+
}
|
|
20068
|
+
}
|
|
20069
|
+
});
|
|
20070
|
+
const isLastField = active === fields2.length - 1;
|
|
20071
|
+
const submitField = () => {
|
|
20072
|
+
if (!enterAdvances) {
|
|
20073
|
+
setEditing(false);
|
|
20074
|
+
return;
|
|
20075
|
+
}
|
|
20076
|
+
if (isLastField) {
|
|
20077
|
+
setEditing(false);
|
|
20078
|
+
onSave();
|
|
20079
|
+
return;
|
|
20080
|
+
}
|
|
20081
|
+
const next = fields2[active + 1];
|
|
20082
|
+
setValueBeforeEdit(values[next.key]);
|
|
20083
|
+
setActive(active + 1);
|
|
20084
|
+
};
|
|
20085
|
+
const pointer = (isActive) => /* @__PURE__ */ jsx11(Text10, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " });
|
|
20086
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
20087
|
+
header,
|
|
20088
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 2, paddingTop: header ? 0 : 1, paddingBottom: 1, children: [
|
|
20089
|
+
/* @__PURE__ */ jsx11(Text10, { bold: true, children: title }),
|
|
20090
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
20091
|
+
subtitle && /* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: subtitle }),
|
|
20092
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
20093
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
20094
|
+
fields2.map((field, index) => {
|
|
20095
|
+
const isActive = index === active;
|
|
20096
|
+
const value = values[field.key];
|
|
20097
|
+
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
20098
|
+
return /* @__PURE__ */ jsxs10(Box10, { gap: 1, children: [
|
|
20099
|
+
pointer(isActive),
|
|
20100
|
+
/* @__PURE__ */ jsx11(Box10, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text10, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
20101
|
+
isActive && editing ? /* @__PURE__ */ jsx11(
|
|
20102
|
+
ClearableTextInput,
|
|
20103
|
+
{
|
|
20104
|
+
value,
|
|
20105
|
+
onChange: (next) => onChange(field.key, next),
|
|
20106
|
+
onSubmit: submitField,
|
|
20107
|
+
mask: field.masked ? "\u2022" : void 0
|
|
20108
|
+
}
|
|
20109
|
+
) : display ? /* @__PURE__ */ jsx11(Text10, { bold: true, children: display }) : (
|
|
20110
|
+
// An empty value shows its hint (or "(empty)") in the value's place, not after an empty element, so the
|
|
20111
|
+
// text starts in the same column as every other row's.
|
|
20112
|
+
/* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: field.hint ?? "(empty)" })
|
|
20113
|
+
),
|
|
20114
|
+
display && field.hint && /* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: field.hint })
|
|
20115
|
+
] }, field.key);
|
|
20116
|
+
}),
|
|
20117
|
+
actions.map((action, index) => {
|
|
20118
|
+
const isActive = fields2.length + index === active;
|
|
20119
|
+
return /* @__PURE__ */ jsxs10(Box10, { gap: 1, children: [
|
|
20120
|
+
pointer(isActive),
|
|
20121
|
+
/* @__PURE__ */ jsx11(Box10, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text10, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: action.label }) }),
|
|
20122
|
+
/* @__PURE__ */ jsx11(Text10, { color: action.running ? PALETTE.accent : PALETTE.muted, children: action.running ? action.runningText ?? "running..." : action.description })
|
|
20123
|
+
] }, action.label);
|
|
20124
|
+
})
|
|
20125
|
+
] }),
|
|
20126
|
+
notice && /* @__PURE__ */ jsxs10(Fragment, { children: [
|
|
20127
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
20128
|
+
/* @__PURE__ */ jsxs10(Text10, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
20129
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
20130
|
+
" ",
|
|
20131
|
+
notice.text
|
|
20132
|
+
] })
|
|
20133
|
+
] }),
|
|
20134
|
+
children,
|
|
20135
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
20136
|
+
/* @__PURE__ */ jsx11(
|
|
20137
|
+
ControlHints,
|
|
20138
|
+
{
|
|
20139
|
+
hints: editing ? [
|
|
20140
|
+
{ keys: "type", label: "edit" },
|
|
20141
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
20142
|
+
{ keys: "\u23CE", label: enterAdvances ? isLastField ? saveLabel : "next" : "done" },
|
|
20143
|
+
{ keys: "Ctrl+D", label: "clear" },
|
|
20144
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
20145
|
+
] : [
|
|
20146
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
20147
|
+
{ keys: "\u23CE", label: currentAction ? currentAction.hint : "edit" },
|
|
20148
|
+
...currentField ? [{ keys: "Ctrl+D", label: "clear" }] : [],
|
|
20149
|
+
{ keys: "s", label: saveLabel },
|
|
20150
|
+
...onSkip ? [{ keys: "k", label: skipLabel2 }] : [],
|
|
20151
|
+
{ keys: "Esc/q", label: quitLabel }
|
|
20152
|
+
]
|
|
20153
|
+
}
|
|
20154
|
+
)
|
|
20155
|
+
] })
|
|
20156
|
+
] });
|
|
20157
|
+
}
|
|
20158
|
+
var init_FieldForm = __esm({
|
|
20159
|
+
"packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx"() {
|
|
19994
20160
|
"use strict";
|
|
20161
|
+
init_theme();
|
|
20162
|
+
init_ControlHints();
|
|
20163
|
+
init_ClearableTextInput();
|
|
19995
20164
|
}
|
|
19996
20165
|
});
|
|
19997
20166
|
|
|
19998
|
-
// packages/experience-design-system-cli/src/tui/
|
|
19999
|
-
import {
|
|
20000
|
-
|
|
20001
|
-
|
|
20002
|
-
|
|
20167
|
+
// packages/experience-design-system-cli/src/tui/shared/components/MenuScreen.tsx
|
|
20168
|
+
import { useState as useState6 } from "react";
|
|
20169
|
+
import { Box as Box11, Text as Text11, useInput as useInput8 } from "ink";
|
|
20170
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
20171
|
+
function MenuScreen({
|
|
20172
|
+
title,
|
|
20173
|
+
subtitle,
|
|
20174
|
+
menu,
|
|
20175
|
+
rows = [],
|
|
20176
|
+
onChoose,
|
|
20177
|
+
onEscape,
|
|
20178
|
+
dataTitle = "Details",
|
|
20179
|
+
busy = false,
|
|
20180
|
+
children
|
|
20181
|
+
}) {
|
|
20182
|
+
const [focus, setFocus] = useState6(0);
|
|
20183
|
+
useInput8((_input, key) => {
|
|
20184
|
+
if (busy) return;
|
|
20185
|
+
if (key.escape) onEscape();
|
|
20186
|
+
else if (key.return) onChoose(menu[focus].choice);
|
|
20187
|
+
else if (key.upArrow) setFocus((current) => (current - 1 + menu.length) % menu.length);
|
|
20188
|
+
else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % menu.length);
|
|
20003
20189
|
});
|
|
20190
|
+
const labelWidth = formLabelWidth([...menu, ...rows]);
|
|
20191
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
20192
|
+
/* @__PURE__ */ jsx12(StepHeader, { step: "setup" }),
|
|
20193
|
+
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
20194
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.text, children: title }),
|
|
20195
|
+
/* @__PURE__ */ jsx12(Text11, { children: " " }),
|
|
20196
|
+
subtitle && /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
20197
|
+
/* @__PURE__ */ jsx12(Text11, { color: PALETTE.muted, children: subtitle }),
|
|
20198
|
+
/* @__PURE__ */ jsx12(Text11, { children: " " })
|
|
20199
|
+
] }),
|
|
20200
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.accent, children: "ACTIONS" }),
|
|
20201
|
+
menu.map((item, index) => {
|
|
20202
|
+
const focused = index === focus;
|
|
20203
|
+
return /* @__PURE__ */ jsxs11(Box11, { gap: 1, children: [
|
|
20204
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.accent, children: focused ? "\u276F" : " " }),
|
|
20205
|
+
/* @__PURE__ */ jsx12(Box11, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text11, { bold: focused, color: focused ? PALETTE.accent : PALETTE.text, children: item.label }) }),
|
|
20206
|
+
/* @__PURE__ */ jsx12(Text11, { color: PALETTE.muted, children: item.description })
|
|
20207
|
+
] }, item.choice);
|
|
20208
|
+
}),
|
|
20209
|
+
(rows.length > 0 || children) && /* @__PURE__ */ jsxs11(
|
|
20210
|
+
Box11,
|
|
20211
|
+
{
|
|
20212
|
+
flexDirection: "column",
|
|
20213
|
+
marginTop: 1,
|
|
20214
|
+
borderStyle: "single",
|
|
20215
|
+
borderColor: PALETTE.border,
|
|
20216
|
+
borderBottom: false,
|
|
20217
|
+
borderLeft: false,
|
|
20218
|
+
borderRight: false,
|
|
20219
|
+
children: [
|
|
20220
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.muted, children: dataTitle.toUpperCase() }),
|
|
20221
|
+
rows.map((row) => /* @__PURE__ */ jsx12(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx12(Text11, { color: row.value ? PALETTE.text : PALETTE.muted, children: row.value || "(empty)" }) }, row.label)),
|
|
20222
|
+
children
|
|
20223
|
+
]
|
|
20224
|
+
}
|
|
20225
|
+
)
|
|
20226
|
+
] })
|
|
20227
|
+
] });
|
|
20004
20228
|
}
|
|
20005
|
-
var
|
|
20006
|
-
|
|
20007
|
-
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/controls.ts"() {
|
|
20229
|
+
var init_MenuScreen = __esm({
|
|
20230
|
+
"packages/experience-design-system-cli/src/tui/shared/components/MenuScreen.tsx"() {
|
|
20008
20231
|
"use strict";
|
|
20009
|
-
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
{ keys: "Ctrl+D", label: "Clear" },
|
|
20013
|
-
{ keys: "Esc", label: "Back" }
|
|
20014
|
-
];
|
|
20232
|
+
init_theme();
|
|
20233
|
+
init_FieldForm();
|
|
20234
|
+
init_StepHeader();
|
|
20015
20235
|
}
|
|
20016
20236
|
});
|
|
20017
20237
|
|
|
20018
|
-
// packages/experience-design-system-cli/src/tui/
|
|
20019
|
-
import { useState as
|
|
20020
|
-
import { Box as
|
|
20021
|
-
import { jsx as
|
|
20022
|
-
function
|
|
20023
|
-
|
|
20024
|
-
|
|
20025
|
-
|
|
20026
|
-
|
|
20027
|
-
|
|
20238
|
+
// packages/experience-design-system-cli/src/tui/shared/components/PathStepScreen.tsx
|
|
20239
|
+
import { useState as useState7 } from "react";
|
|
20240
|
+
import { Box as Box12, Text as Text12, useInput as useInput9 } from "ink";
|
|
20241
|
+
import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
20242
|
+
function PathStepScreen({
|
|
20243
|
+
title,
|
|
20244
|
+
subtitle,
|
|
20245
|
+
label,
|
|
20246
|
+
initialPath = "",
|
|
20247
|
+
toPath,
|
|
20248
|
+
check,
|
|
20249
|
+
onContinue,
|
|
20250
|
+
onBack
|
|
20251
|
+
}) {
|
|
20252
|
+
const [value, setValue] = useState7(initialPath);
|
|
20253
|
+
const [savedValue, setSavedValue] = useState7(toPath(initialPath) === null ? "" : initialPath);
|
|
20254
|
+
const [editing, setEditing] = useState7(toPath(initialPath) === null);
|
|
20255
|
+
const [failure, setFailure] = useState7(null);
|
|
20256
|
+
useInput9(
|
|
20257
|
+
(_input, key) => {
|
|
20258
|
+
if (!key.escape) return;
|
|
20259
|
+
if (savedValue === "") {
|
|
20260
|
+
onBack();
|
|
20261
|
+
return;
|
|
20262
|
+
}
|
|
20263
|
+
setValue(savedValue);
|
|
20264
|
+
setFailure(null);
|
|
20265
|
+
setEditing(false);
|
|
20266
|
+
},
|
|
20267
|
+
{ isActive: editing }
|
|
20268
|
+
);
|
|
20269
|
+
const choose = (choice) => {
|
|
20270
|
+
if (choice === "edit") {
|
|
20271
|
+
setFailure(null);
|
|
20272
|
+
setEditing(true);
|
|
20273
|
+
return;
|
|
20274
|
+
}
|
|
20275
|
+
if (choice === "back") {
|
|
20276
|
+
onBack();
|
|
20277
|
+
return;
|
|
20278
|
+
}
|
|
20279
|
+
const path5 = toPath(value);
|
|
20280
|
+
if (path5 === null) return;
|
|
20281
|
+
const result = check(path5);
|
|
20282
|
+
if (result.ok) onContinue(result.path);
|
|
20283
|
+
else setFailure({ error: result.error, resolvedPath: result.resolvedPath });
|
|
20028
20284
|
};
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20033
|
-
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20285
|
+
const submit = (typed) => {
|
|
20286
|
+
if (toPath(typed) === null) {
|
|
20287
|
+
setFailure({ error: `Enter the ${label.toLowerCase()}.` });
|
|
20288
|
+
return;
|
|
20289
|
+
}
|
|
20290
|
+
setSavedValue(typed);
|
|
20291
|
+
setEditing(false);
|
|
20292
|
+
};
|
|
20293
|
+
const failureLines = failure && /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
20294
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
20295
|
+
/* @__PURE__ */ jsxs12(Text12, { color: PALETTE.error, children: [
|
|
20296
|
+
"\u2717 ",
|
|
20297
|
+
failure.error
|
|
20298
|
+
] }),
|
|
20299
|
+
failure.resolvedPath && /* @__PURE__ */ jsxs12(Text12, { color: PALETTE.muted, children: [
|
|
20300
|
+
" Resolved to: ",
|
|
20301
|
+
failure.resolvedPath
|
|
20302
|
+
] })
|
|
20303
|
+
] });
|
|
20304
|
+
if (!editing) {
|
|
20305
|
+
return /* @__PURE__ */ jsx13(
|
|
20306
|
+
MenuScreen,
|
|
20307
|
+
{
|
|
20308
|
+
title,
|
|
20309
|
+
subtitle,
|
|
20310
|
+
menu: MENU,
|
|
20311
|
+
rows: [{ label, value: savedValue }],
|
|
20312
|
+
onChoose: choose,
|
|
20313
|
+
onEscape: onBack,
|
|
20314
|
+
children: failureLines
|
|
20315
|
+
}
|
|
20316
|
+
);
|
|
20317
|
+
}
|
|
20318
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", children: [
|
|
20319
|
+
/* @__PURE__ */ jsx13(StepHeader, { step: "setup" }),
|
|
20320
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
20321
|
+
/* @__PURE__ */ jsx13(Text12, { bold: true, children: title }),
|
|
20322
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
20323
|
+
/* @__PURE__ */ jsx13(Text12, { color: PALETTE.muted, children: subtitle }),
|
|
20324
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
20325
|
+
/* @__PURE__ */ jsxs12(Box12, { gap: 1, children: [
|
|
20326
|
+
/* @__PURE__ */ jsx13(Text12, { color: PALETTE.accent, children: "?" }),
|
|
20327
|
+
/* @__PURE__ */ jsxs12(Text12, { children: [
|
|
20328
|
+
label,
|
|
20329
|
+
":"
|
|
20330
|
+
] }),
|
|
20331
|
+
/* @__PURE__ */ jsx13(
|
|
20332
|
+
ClearableTextInput,
|
|
20333
|
+
{
|
|
20334
|
+
value,
|
|
20335
|
+
onChange: (next) => {
|
|
20336
|
+
setValue(next);
|
|
20337
|
+
setFailure(null);
|
|
20338
|
+
},
|
|
20339
|
+
onSubmit: submit
|
|
20340
|
+
}
|
|
20341
|
+
)
|
|
20039
20342
|
] }),
|
|
20040
|
-
|
|
20343
|
+
failureLines,
|
|
20344
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
20345
|
+
/* @__PURE__ */ jsx13(
|
|
20346
|
+
ControlHints,
|
|
20347
|
+
{
|
|
20348
|
+
hints: [
|
|
20349
|
+
{ keys: "\u23CE", label: "done" },
|
|
20350
|
+
{ keys: "Ctrl+D", label: "clear" },
|
|
20351
|
+
{ keys: "Esc", label: savedValue === "" ? "back" : "cancel edit" }
|
|
20352
|
+
]
|
|
20353
|
+
}
|
|
20354
|
+
)
|
|
20041
20355
|
] })
|
|
20042
20356
|
] });
|
|
20043
20357
|
}
|
|
20044
|
-
var
|
|
20045
|
-
|
|
20358
|
+
var MENU;
|
|
20359
|
+
var init_PathStepScreen = __esm({
|
|
20360
|
+
"packages/experience-design-system-cli/src/tui/shared/components/PathStepScreen.tsx"() {
|
|
20046
20361
|
"use strict";
|
|
20047
20362
|
init_theme();
|
|
20048
20363
|
init_ClearableTextInput();
|
|
20049
|
-
init_controls4();
|
|
20050
|
-
init_logic5();
|
|
20051
20364
|
init_ControlHints();
|
|
20365
|
+
init_MenuScreen();
|
|
20052
20366
|
init_StepHeader();
|
|
20367
|
+
MENU = [
|
|
20368
|
+
{ choice: "continue", label: "Continue", description: "Use this path and go on" },
|
|
20369
|
+
{ choice: "edit", label: "Edit", description: "Change the path" },
|
|
20370
|
+
{ choice: "back", label: "Back", description: "Go back" }
|
|
20371
|
+
];
|
|
20053
20372
|
}
|
|
20054
20373
|
});
|
|
20055
20374
|
|
|
20056
|
-
// packages/experience-design-system-cli/src/tui/import/steps/
|
|
20057
|
-
function
|
|
20058
|
-
|
|
20375
|
+
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/logic.ts
|
|
20376
|
+
function toProjectPath(value) {
|
|
20377
|
+
const projectPath = value.trim();
|
|
20378
|
+
return projectPath === "" ? null : projectPath;
|
|
20059
20379
|
}
|
|
20060
|
-
|
|
20061
|
-
|
|
20062
|
-
|
|
20380
|
+
var init_logic5 = __esm({
|
|
20381
|
+
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/logic.ts"() {
|
|
20382
|
+
"use strict";
|
|
20383
|
+
}
|
|
20384
|
+
});
|
|
20385
|
+
|
|
20386
|
+
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
20387
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
20388
|
+
function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
20389
|
+
return /* @__PURE__ */ jsx14(
|
|
20390
|
+
PathStepScreen,
|
|
20391
|
+
{
|
|
20392
|
+
title: "Where is your component library?",
|
|
20393
|
+
subtitle: "The folder with your components. You can use ~, relative, or absolute paths.",
|
|
20394
|
+
label: "Project path",
|
|
20395
|
+
initialPath,
|
|
20396
|
+
toPath: toProjectPath,
|
|
20397
|
+
check: (path5) => ({ ok: true, path: path5 }),
|
|
20398
|
+
onContinue,
|
|
20399
|
+
onBack: onQuit
|
|
20400
|
+
}
|
|
20401
|
+
);
|
|
20063
20402
|
}
|
|
20064
|
-
var
|
|
20065
|
-
"packages/experience-design-system-cli/src/tui/import/steps/
|
|
20403
|
+
var init_screen2 = __esm({
|
|
20404
|
+
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx"() {
|
|
20066
20405
|
"use strict";
|
|
20406
|
+
init_PathStepScreen();
|
|
20407
|
+
init_logic5();
|
|
20067
20408
|
}
|
|
20068
20409
|
});
|
|
20069
20410
|
|
|
20070
|
-
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
|
|
20074
|
-
if (shouldGoBack(key)) onBack();
|
|
20075
|
-
});
|
|
20411
|
+
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/logic.ts
|
|
20412
|
+
function toTokenPath(value) {
|
|
20413
|
+
const tokenPath = value.trim();
|
|
20414
|
+
return tokenPath === "" ? null : tokenPath;
|
|
20076
20415
|
}
|
|
20077
|
-
var
|
|
20078
|
-
|
|
20079
|
-
"packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts"() {
|
|
20416
|
+
var init_logic6 = __esm({
|
|
20417
|
+
"packages/experience-design-system-cli/src/tui/import/steps/02-token-input/logic.ts"() {
|
|
20080
20418
|
"use strict";
|
|
20081
|
-
init_logic6();
|
|
20082
|
-
TOKEN_INPUT_CONTROLS = [
|
|
20083
|
-
{ keys: "Enter", label: "Continue" },
|
|
20084
|
-
{ keys: "Ctrl+D", label: "Clear" },
|
|
20085
|
-
{ keys: "Esc", label: "Back" }
|
|
20086
|
-
];
|
|
20087
20419
|
}
|
|
20088
20420
|
});
|
|
20089
20421
|
|
|
@@ -20136,63 +20468,52 @@ var init_validate_path = __esm({
|
|
|
20136
20468
|
});
|
|
20137
20469
|
|
|
20138
20470
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
|
|
20139
|
-
import {
|
|
20140
|
-
import { Box as Box11, Text as Text11 } from "ink";
|
|
20141
|
-
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
20471
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
20142
20472
|
function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
|
|
20143
|
-
|
|
20144
|
-
|
|
20145
|
-
|
|
20146
|
-
|
|
20147
|
-
|
|
20148
|
-
|
|
20149
|
-
|
|
20150
|
-
|
|
20151
|
-
|
|
20152
|
-
|
|
20153
|
-
|
|
20154
|
-
return;
|
|
20473
|
+
return /* @__PURE__ */ jsx15(
|
|
20474
|
+
PathStepScreen,
|
|
20475
|
+
{
|
|
20476
|
+
title: "Design tokens",
|
|
20477
|
+
subtitle: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to Design Token Group Format (DTCG).",
|
|
20478
|
+
label: "Token path",
|
|
20479
|
+
initialPath,
|
|
20480
|
+
toPath: toTokenPath,
|
|
20481
|
+
check: validateTokenPath,
|
|
20482
|
+
onContinue: onConfirm,
|
|
20483
|
+
onBack
|
|
20155
20484
|
}
|
|
20156
|
-
|
|
20157
|
-
if (check.ok) onConfirm(check.path);
|
|
20158
|
-
else setFailure({ error: check.error, resolvedPath: check.resolvedPath });
|
|
20159
|
-
};
|
|
20160
|
-
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
20161
|
-
/* @__PURE__ */ jsx12(StepHeader, { step: "setup" }),
|
|
20162
|
-
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
20163
|
-
/* @__PURE__ */ jsx12(Text11, { bold: true, children: "Design tokens" }),
|
|
20164
|
-
/* @__PURE__ */ jsx12(Text11, { color: PALETTE.muted, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to Design Token Group Format (DTCG)." }),
|
|
20165
|
-
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
20166
|
-
/* @__PURE__ */ jsxs11(Box11, { gap: 1, children: [
|
|
20167
|
-
/* @__PURE__ */ jsx12(Text11, { color: PALETTE.accent, children: "?" }),
|
|
20168
|
-
/* @__PURE__ */ jsx12(Text11, { children: "Token path:" }),
|
|
20169
|
-
/* @__PURE__ */ jsx12(ClearableTextInput, { value: tokenPath, onChange: change, onSubmit: submit })
|
|
20170
|
-
] }),
|
|
20171
|
-
failure && /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
20172
|
-
/* @__PURE__ */ jsxs11(Text11, { color: PALETTE.error, children: [
|
|
20173
|
-
"\u2717 ",
|
|
20174
|
-
failure.error
|
|
20175
|
-
] }),
|
|
20176
|
-
failure.resolvedPath && /* @__PURE__ */ jsxs11(Text11, { color: PALETTE.muted, children: [
|
|
20177
|
-
" Resolved to: ",
|
|
20178
|
-
failure.resolvedPath
|
|
20179
|
-
] })
|
|
20180
|
-
] })
|
|
20181
|
-
] }),
|
|
20182
|
-
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx12(ControlHints, { hints: TOKEN_INPUT_CONTROLS }) })
|
|
20183
|
-
] })
|
|
20184
|
-
] });
|
|
20485
|
+
);
|
|
20185
20486
|
}
|
|
20186
20487
|
var init_screen3 = __esm({
|
|
20187
20488
|
"packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx"() {
|
|
20188
20489
|
"use strict";
|
|
20189
|
-
|
|
20190
|
-
init_ClearableTextInput();
|
|
20191
|
-
init_controls5();
|
|
20490
|
+
init_PathStepScreen();
|
|
20192
20491
|
init_logic6();
|
|
20193
20492
|
init_validate_path();
|
|
20194
|
-
|
|
20195
|
-
|
|
20493
|
+
}
|
|
20494
|
+
});
|
|
20495
|
+
|
|
20496
|
+
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/helpers/scan-files.ts
|
|
20497
|
+
function scanFiles(directory) {
|
|
20498
|
+
return toScanResult(collectFiles(directory));
|
|
20499
|
+
}
|
|
20500
|
+
function toScanResult(outcome) {
|
|
20501
|
+
if (!outcome.ok) return { ok: false, failure: outcome.failure };
|
|
20502
|
+
return {
|
|
20503
|
+
ok: true,
|
|
20504
|
+
counts: foldSvelteAndMdIntoOther(outcome.result.counts),
|
|
20505
|
+
filePaths: outcome.result.filePaths,
|
|
20506
|
+
warnings: outcome.result.warnings
|
|
20507
|
+
};
|
|
20508
|
+
}
|
|
20509
|
+
function foldSvelteAndMdIntoOther(counts) {
|
|
20510
|
+
const { svelte, md, ...rest } = counts;
|
|
20511
|
+
return { ...rest, other: rest.other + svelte + md };
|
|
20512
|
+
}
|
|
20513
|
+
var init_scan_files = __esm({
|
|
20514
|
+
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/helpers/scan-files.ts"() {
|
|
20515
|
+
"use strict";
|
|
20516
|
+
init_src3();
|
|
20196
20517
|
}
|
|
20197
20518
|
});
|
|
20198
20519
|
|
|
@@ -20238,103 +20559,37 @@ function summarize(counts, { hasTokens = true } = {}) {
|
|
|
20238
20559
|
total: counts.total,
|
|
20239
20560
|
rows,
|
|
20240
20561
|
warning: hasTokens ? "No component or token files found. Try a different path." : "No component files found. Try a different path."
|
|
20241
|
-
};
|
|
20242
|
-
}
|
|
20243
|
-
function phaseOf(scan) {
|
|
20244
|
-
if (scan === void 0) return "scanning";
|
|
20245
|
-
return scan.ok ? "ready" : "failed";
|
|
20246
|
-
}
|
|
20247
|
-
function keyAction(phase, input, key) {
|
|
20248
|
-
if (key.escape) return "back";
|
|
20249
|
-
if (phase === "ready") {
|
|
20250
|
-
if (key.return) return "confirm";
|
|
20251
|
-
if (input === "e") return "change-path";
|
|
20252
|
-
}
|
|
20253
|
-
if (phase === "failed" && (key.return || input === "e")) return "change-path";
|
|
20254
|
-
return void 0;
|
|
20255
|
-
}
|
|
20256
|
-
var COMPONENT_CATEGORIES, ROW_LABELS, ROW_ORDER;
|
|
20257
|
-
var init_logic7 = __esm({
|
|
20258
|
-
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/logic.ts"() {
|
|
20259
|
-
"use strict";
|
|
20260
|
-
COMPONENT_CATEGORIES = ["tsx", "ts", "vue", "astro", "jsx", "js"];
|
|
20261
|
-
ROW_LABELS = {
|
|
20262
|
-
tsx: ".tsx files",
|
|
20263
|
-
ts: ".ts files",
|
|
20264
|
-
vue: ".vue files",
|
|
20265
|
-
astro: ".astro files",
|
|
20266
|
-
jsx: ".jsx files",
|
|
20267
|
-
js: ".js files",
|
|
20268
|
-
json: ".json files (design tokens)",
|
|
20269
|
-
other: "other (ignored)"
|
|
20270
|
-
};
|
|
20271
|
-
ROW_ORDER = ["tsx", "ts", "vue", "astro", "jsx", "js", "json", "other"];
|
|
20272
|
-
}
|
|
20273
|
-
});
|
|
20274
|
-
|
|
20275
|
-
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/controls.ts
|
|
20276
|
-
import { useInput as useInput9 } from "ink";
|
|
20277
|
-
function controlsFor(phase) {
|
|
20278
|
-
return CONTROLS[phase];
|
|
20279
|
-
}
|
|
20280
|
-
function usePathValidationControls(phase, handlers) {
|
|
20281
|
-
useInput9((input, key) => {
|
|
20282
|
-
const action = keyAction(phase, input, key);
|
|
20283
|
-
if (action === "confirm") handlers.onConfirm();
|
|
20284
|
-
else if (action === "change-path") handlers.onChangePath();
|
|
20285
|
-
else if (action === "back") handlers.onBack();
|
|
20286
|
-
});
|
|
20287
|
-
}
|
|
20288
|
-
var CONTROLS;
|
|
20289
|
-
var init_controls6 = __esm({
|
|
20290
|
-
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/controls.ts"() {
|
|
20291
|
-
"use strict";
|
|
20292
|
-
init_logic7();
|
|
20293
|
-
CONTROLS = {
|
|
20294
|
-
scanning: [{ keys: "Esc", label: "Back" }],
|
|
20295
|
-
ready: [
|
|
20296
|
-
{ keys: "Enter", label: "Yes, continue" },
|
|
20297
|
-
{ keys: "e", label: "Change path" },
|
|
20298
|
-
{ keys: "Esc", label: "Back" }
|
|
20299
|
-
],
|
|
20300
|
-
failed: [
|
|
20301
|
-
{ keys: "Enter/e", label: "Try a different path" },
|
|
20302
|
-
{ keys: "Esc", label: "Back" }
|
|
20303
|
-
]
|
|
20304
|
-
};
|
|
20305
|
-
}
|
|
20306
|
-
});
|
|
20307
|
-
|
|
20308
|
-
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/helpers/scan-files.ts
|
|
20309
|
-
function scanFiles(directory) {
|
|
20310
|
-
return toScanResult(collectFiles(directory));
|
|
20311
|
-
}
|
|
20312
|
-
function toScanResult(outcome) {
|
|
20313
|
-
if (!outcome.ok) return { ok: false, failure: outcome.failure };
|
|
20314
|
-
return {
|
|
20315
|
-
ok: true,
|
|
20316
|
-
counts: foldSvelteAndMdIntoOther(outcome.result.counts),
|
|
20317
|
-
filePaths: outcome.result.filePaths,
|
|
20318
|
-
warnings: outcome.result.warnings
|
|
20319
|
-
};
|
|
20320
|
-
}
|
|
20321
|
-
function foldSvelteAndMdIntoOther(counts) {
|
|
20322
|
-
const { svelte, md, ...rest } = counts;
|
|
20323
|
-
return { ...rest, other: rest.other + svelte + md };
|
|
20562
|
+
};
|
|
20324
20563
|
}
|
|
20325
|
-
|
|
20326
|
-
|
|
20564
|
+
function phaseOf(scan) {
|
|
20565
|
+
if (scan === void 0) return "scanning";
|
|
20566
|
+
return scan.ok ? "ready" : "failed";
|
|
20567
|
+
}
|
|
20568
|
+
var COMPONENT_CATEGORIES, ROW_LABELS, ROW_ORDER;
|
|
20569
|
+
var init_logic7 = __esm({
|
|
20570
|
+
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/logic.ts"() {
|
|
20327
20571
|
"use strict";
|
|
20328
|
-
|
|
20572
|
+
COMPONENT_CATEGORIES = ["tsx", "ts", "vue", "astro", "jsx", "js"];
|
|
20573
|
+
ROW_LABELS = {
|
|
20574
|
+
tsx: ".tsx files",
|
|
20575
|
+
ts: ".ts files",
|
|
20576
|
+
vue: ".vue files",
|
|
20577
|
+
astro: ".astro files",
|
|
20578
|
+
jsx: ".jsx files",
|
|
20579
|
+
js: ".js files",
|
|
20580
|
+
json: ".json files (design tokens)",
|
|
20581
|
+
other: "other (ignored)"
|
|
20582
|
+
};
|
|
20583
|
+
ROW_ORDER = ["tsx", "ts", "vue", "astro", "jsx", "js", "json", "other"];
|
|
20329
20584
|
}
|
|
20330
20585
|
});
|
|
20331
20586
|
|
|
20332
20587
|
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
|
|
20333
|
-
import { useEffect as useEffect4, useMemo, useState as
|
|
20334
|
-
import { Box as
|
|
20335
|
-
import { jsx as
|
|
20588
|
+
import { useEffect as useEffect4, useMemo, useState as useState8 } from "react";
|
|
20589
|
+
import { Box as Box13, Text as Text13 } from "ink";
|
|
20590
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
20336
20591
|
function Row({ row }) {
|
|
20337
|
-
return /* @__PURE__ */
|
|
20592
|
+
return /* @__PURE__ */ jsxs13(Text13, { color: row.tone === "accent" ? PALETTE.accent : row.tone === "muted" ? PALETTE.muted : PALETTE.text, children: [
|
|
20338
20593
|
" \u2022 ",
|
|
20339
20594
|
String(row.count).padStart(3),
|
|
20340
20595
|
" ",
|
|
@@ -20343,12 +20598,12 @@ function Row({ row }) {
|
|
|
20343
20598
|
}
|
|
20344
20599
|
function Failure({ scan, path: path5 }) {
|
|
20345
20600
|
const { headline, hints } = describeFailure(scan.failure, path5);
|
|
20346
|
-
return /* @__PURE__ */
|
|
20347
|
-
/* @__PURE__ */
|
|
20601
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
20602
|
+
/* @__PURE__ */ jsxs13(Text13, { color: PALETTE.error, children: [
|
|
20348
20603
|
"\u2717 ",
|
|
20349
20604
|
headline
|
|
20350
20605
|
] }),
|
|
20351
|
-
hints.map((hint) => /* @__PURE__ */
|
|
20606
|
+
hints.map((hint) => /* @__PURE__ */ jsx16(Text13, { color: PALETTE.muted, children: hint }, hint))
|
|
20352
20607
|
] });
|
|
20353
20608
|
}
|
|
20354
20609
|
function Summary({
|
|
@@ -20357,24 +20612,23 @@ function Summary({
|
|
|
20357
20612
|
hasTokens
|
|
20358
20613
|
}) {
|
|
20359
20614
|
const { total, rows, warning } = summarize(scan.counts, { hasTokens });
|
|
20360
|
-
return /* @__PURE__ */
|
|
20361
|
-
/* @__PURE__ */
|
|
20362
|
-
"Scanned ",
|
|
20363
|
-
/* @__PURE__ */
|
|
20615
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", gap: 1, children: [
|
|
20616
|
+
/* @__PURE__ */ jsxs13(Text13, { children: [
|
|
20617
|
+
/* @__PURE__ */ jsx16(Text13, { color: PALETTE.muted, children: "Scanned " }),
|
|
20618
|
+
/* @__PURE__ */ jsx16(Text13, { color: PALETTE.text, children: path5 })
|
|
20364
20619
|
] }),
|
|
20365
|
-
/* @__PURE__ */
|
|
20366
|
-
/* @__PURE__ */
|
|
20620
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
20621
|
+
/* @__PURE__ */ jsxs13(Text13, { color: PALETTE.success, children: [
|
|
20367
20622
|
"\u2713 Found ",
|
|
20368
20623
|
total,
|
|
20369
20624
|
" files:"
|
|
20370
20625
|
] }),
|
|
20371
|
-
rows.map((row) => /* @__PURE__ */
|
|
20626
|
+
rows.map((row) => /* @__PURE__ */ jsx16(Row, { row }, row.label))
|
|
20372
20627
|
] }),
|
|
20373
|
-
warning && /* @__PURE__ */
|
|
20628
|
+
warning && /* @__PURE__ */ jsxs13(Text13, { color: PALETTE.warning, children: [
|
|
20374
20629
|
"\u26A0 ",
|
|
20375
20630
|
warning
|
|
20376
|
-
] })
|
|
20377
|
-
/* @__PURE__ */ jsx13(Text12, { children: "Does this look right?" })
|
|
20631
|
+
] })
|
|
20378
20632
|
] });
|
|
20379
20633
|
}
|
|
20380
20634
|
function PathValidationScreen({
|
|
@@ -20385,225 +20639,56 @@ function PathValidationScreen({
|
|
|
20385
20639
|
hasTokens = true
|
|
20386
20640
|
}) {
|
|
20387
20641
|
const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
20388
|
-
const [scan, setScan] =
|
|
20642
|
+
const [scan, setScan] = useState8();
|
|
20389
20643
|
useEffect4(() => {
|
|
20390
20644
|
setScan(scanFiles(resolvedPath));
|
|
20391
20645
|
}, [resolvedPath]);
|
|
20392
20646
|
const phase = phaseOf(scan);
|
|
20393
|
-
|
|
20394
|
-
|
|
20647
|
+
const choose = (choice) => {
|
|
20648
|
+
if (choice === "continue") {
|
|
20395
20649
|
if (scan?.ok) onConfirm({ projectPath: resolvedPath, filePaths: scan.filePaths });
|
|
20396
|
-
}
|
|
20397
|
-
|
|
20398
|
-
|
|
20399
|
-
|
|
20400
|
-
|
|
20401
|
-
/* @__PURE__ */
|
|
20402
|
-
|
|
20403
|
-
|
|
20404
|
-
|
|
20405
|
-
|
|
20406
|
-
|
|
20407
|
-
|
|
20408
|
-
|
|
20409
|
-
|
|
20410
|
-
|
|
20411
|
-
|
|
20412
|
-
|
|
20650
|
+
} else if (choice === "change-path") onChangePath();
|
|
20651
|
+
else onBack();
|
|
20652
|
+
};
|
|
20653
|
+
return (
|
|
20654
|
+
// keyed by phase: the menu changes length, so its focus starts over
|
|
20655
|
+
/* @__PURE__ */ jsxs13(
|
|
20656
|
+
MenuScreen,
|
|
20657
|
+
{
|
|
20658
|
+
title: "Scan",
|
|
20659
|
+
dataTitle: "Scan result",
|
|
20660
|
+
menu: MENUS[phase],
|
|
20661
|
+
onChoose: choose,
|
|
20662
|
+
onEscape: onBack,
|
|
20663
|
+
children: [
|
|
20664
|
+
scan === void 0 && /* @__PURE__ */ jsxs13(Text13, { color: PALETTE.muted, children: [
|
|
20665
|
+
"Scanning ",
|
|
20666
|
+
/* @__PURE__ */ jsx16(Text13, { bold: true, children: resolvedPath }),
|
|
20667
|
+
"..."
|
|
20668
|
+
] }),
|
|
20669
|
+
scan?.ok === false && /* @__PURE__ */ jsx16(Failure, { scan, path: resolvedPath }),
|
|
20670
|
+
scan?.ok === true && /* @__PURE__ */ jsx16(Summary, { scan, path: resolvedPath, hasTokens })
|
|
20671
|
+
]
|
|
20672
|
+
},
|
|
20673
|
+
phase
|
|
20674
|
+
)
|
|
20675
|
+
);
|
|
20413
20676
|
}
|
|
20677
|
+
var BACK, MENUS;
|
|
20414
20678
|
var init_screen4 = __esm({
|
|
20415
20679
|
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx"() {
|
|
20416
20680
|
"use strict";
|
|
20417
20681
|
init_theme();
|
|
20418
20682
|
init_resolve_user_path();
|
|
20419
|
-
init_controls6();
|
|
20420
20683
|
init_scan_files();
|
|
20421
20684
|
init_logic7();
|
|
20422
|
-
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
|
|
20427
|
-
|
|
20428
|
-
|
|
20429
|
-
import { Box as Box13, Text as Text13, useInput as useInput10 } from "ink";
|
|
20430
|
-
import { Fragment, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
20431
|
-
function formLabelWidth(rows) {
|
|
20432
|
-
return Math.max(...rows.map((row) => row.label.length));
|
|
20433
|
-
}
|
|
20434
|
-
function FormReadOnlyRow({
|
|
20435
|
-
label,
|
|
20436
|
-
labelWidth,
|
|
20437
|
-
children
|
|
20438
|
-
}) {
|
|
20439
|
-
return /* @__PURE__ */ jsxs13(Box13, { gap: 1, children: [
|
|
20440
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
20441
|
-
/* @__PURE__ */ jsx14(Box13, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: label }) }),
|
|
20442
|
-
children
|
|
20443
|
-
] });
|
|
20444
|
-
}
|
|
20445
|
-
function FieldForm({
|
|
20446
|
-
header,
|
|
20447
|
-
title,
|
|
20448
|
-
subtitle,
|
|
20449
|
-
fields: fields2,
|
|
20450
|
-
values,
|
|
20451
|
-
onChange,
|
|
20452
|
-
onSave,
|
|
20453
|
-
saveLabel = "save",
|
|
20454
|
-
enterAdvances = false,
|
|
20455
|
-
onSkip,
|
|
20456
|
-
skipLabel: skipLabel2 = "skip",
|
|
20457
|
-
onQuit,
|
|
20458
|
-
quitLabel = "back without saving",
|
|
20459
|
-
actions = [],
|
|
20460
|
-
notice,
|
|
20461
|
-
busy = false,
|
|
20462
|
-
children
|
|
20463
|
-
}) {
|
|
20464
|
-
const [active, setActive] = useState8(0);
|
|
20465
|
-
const [editing, setEditing] = useState8(false);
|
|
20466
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState8("");
|
|
20467
|
-
const rowCount = fields2.length + actions.length;
|
|
20468
|
-
const labelWidth = formLabelWidth([...fields2, ...actions]);
|
|
20469
|
-
const currentField = active < fields2.length ? fields2[active] : void 0;
|
|
20470
|
-
const currentAction = currentField ? void 0 : actions[active - fields2.length];
|
|
20471
|
-
useInput10((input, key) => {
|
|
20472
|
-
if (busy) return;
|
|
20473
|
-
if (editing) {
|
|
20474
|
-
if (key.escape && currentField) {
|
|
20475
|
-
onChange(currentField.key, valueBeforeEdit);
|
|
20476
|
-
setEditing(false);
|
|
20477
|
-
}
|
|
20478
|
-
return;
|
|
20479
|
-
}
|
|
20480
|
-
if (key.escape || input === "q") {
|
|
20481
|
-
onQuit();
|
|
20482
|
-
return;
|
|
20483
|
-
}
|
|
20484
|
-
if (input === "s") {
|
|
20485
|
-
onSave();
|
|
20486
|
-
return;
|
|
20487
|
-
}
|
|
20488
|
-
if (input === "k" && onSkip) {
|
|
20489
|
-
onSkip();
|
|
20490
|
-
return;
|
|
20491
|
-
}
|
|
20492
|
-
if (isClearKey(input, key) && currentField) {
|
|
20493
|
-
onChange(currentField.key, "");
|
|
20494
|
-
return;
|
|
20495
|
-
}
|
|
20496
|
-
if (key.tab || key.downArrow) {
|
|
20497
|
-
setActive((i) => (i + 1) % rowCount);
|
|
20498
|
-
return;
|
|
20499
|
-
}
|
|
20500
|
-
if (key.upArrow) {
|
|
20501
|
-
setActive((i) => (i - 1 + rowCount) % rowCount);
|
|
20502
|
-
return;
|
|
20503
|
-
}
|
|
20504
|
-
if (key.return) {
|
|
20505
|
-
if (currentField) {
|
|
20506
|
-
setValueBeforeEdit(values[currentField.key]);
|
|
20507
|
-
setEditing(true);
|
|
20508
|
-
} else {
|
|
20509
|
-
currentAction?.onRun();
|
|
20510
|
-
}
|
|
20511
|
-
}
|
|
20512
|
-
});
|
|
20513
|
-
const isLastField = active === fields2.length - 1;
|
|
20514
|
-
const submitField = () => {
|
|
20515
|
-
if (!enterAdvances) {
|
|
20516
|
-
setEditing(false);
|
|
20517
|
-
return;
|
|
20518
|
-
}
|
|
20519
|
-
if (isLastField) {
|
|
20520
|
-
setEditing(false);
|
|
20521
|
-
onSave();
|
|
20522
|
-
return;
|
|
20523
|
-
}
|
|
20524
|
-
const next = fields2[active + 1];
|
|
20525
|
-
setValueBeforeEdit(values[next.key]);
|
|
20526
|
-
setActive(active + 1);
|
|
20527
|
-
};
|
|
20528
|
-
const pointer = (isActive) => /* @__PURE__ */ jsx14(Text13, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " });
|
|
20529
|
-
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
20530
|
-
header,
|
|
20531
|
-
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", paddingX: 2, paddingTop: header ? 0 : 1, paddingBottom: 1, children: [
|
|
20532
|
-
/* @__PURE__ */ jsx14(Text13, { bold: true, children: title }),
|
|
20533
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
20534
|
-
subtitle && /* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: subtitle }),
|
|
20535
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
20536
|
-
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
20537
|
-
fields2.map((field, index) => {
|
|
20538
|
-
const isActive = index === active;
|
|
20539
|
-
const value = values[field.key];
|
|
20540
|
-
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
20541
|
-
return /* @__PURE__ */ jsxs13(Box13, { gap: 1, children: [
|
|
20542
|
-
pointer(isActive),
|
|
20543
|
-
/* @__PURE__ */ jsx14(Box13, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx14(Text13, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
20544
|
-
isActive && editing ? /* @__PURE__ */ jsx14(
|
|
20545
|
-
ClearableTextInput,
|
|
20546
|
-
{
|
|
20547
|
-
value,
|
|
20548
|
-
onChange: (next) => onChange(field.key, next),
|
|
20549
|
-
onSubmit: submitField,
|
|
20550
|
-
mask: field.masked ? "\u2022" : void 0
|
|
20551
|
-
}
|
|
20552
|
-
) : display ? /* @__PURE__ */ jsx14(Text13, { bold: true, children: display }) : (
|
|
20553
|
-
// An empty value shows its hint (or "(empty)") in the value's place, not after an empty element, so the
|
|
20554
|
-
// text starts in the same column as every other row's.
|
|
20555
|
-
/* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: field.hint ?? "(empty)" })
|
|
20556
|
-
),
|
|
20557
|
-
display && field.hint && /* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: field.hint })
|
|
20558
|
-
] }, field.key);
|
|
20559
|
-
}),
|
|
20560
|
-
actions.map((action, index) => {
|
|
20561
|
-
const isActive = fields2.length + index === active;
|
|
20562
|
-
return /* @__PURE__ */ jsxs13(Box13, { gap: 1, children: [
|
|
20563
|
-
pointer(isActive),
|
|
20564
|
-
/* @__PURE__ */ jsx14(Box13, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx14(Text13, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: action.label }) }),
|
|
20565
|
-
/* @__PURE__ */ jsx14(Text13, { color: action.running ? PALETTE.accent : PALETTE.muted, children: action.running ? action.runningText ?? "running..." : action.description })
|
|
20566
|
-
] }, action.label);
|
|
20567
|
-
})
|
|
20568
|
-
] }),
|
|
20569
|
-
notice && /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
20570
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
20571
|
-
/* @__PURE__ */ jsxs13(Text13, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
20572
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
20573
|
-
" ",
|
|
20574
|
-
notice.text
|
|
20575
|
-
] })
|
|
20576
|
-
] }),
|
|
20577
|
-
children,
|
|
20578
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
20579
|
-
/* @__PURE__ */ jsx14(
|
|
20580
|
-
ControlHints,
|
|
20581
|
-
{
|
|
20582
|
-
hints: editing ? [
|
|
20583
|
-
{ keys: "type", label: "edit" },
|
|
20584
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
20585
|
-
{ keys: "\u23CE", label: enterAdvances ? isLastField ? saveLabel : "next" : "done" },
|
|
20586
|
-
{ keys: "Ctrl+D", label: "clear" },
|
|
20587
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
20588
|
-
] : [
|
|
20589
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
20590
|
-
{ keys: "\u23CE", label: currentAction ? currentAction.hint : "edit" },
|
|
20591
|
-
...currentField ? [{ keys: "Ctrl+D", label: "clear" }] : [],
|
|
20592
|
-
{ keys: "s", label: saveLabel },
|
|
20593
|
-
...onSkip ? [{ keys: "k", label: skipLabel2 }] : [],
|
|
20594
|
-
{ keys: "Esc/q", label: quitLabel }
|
|
20595
|
-
]
|
|
20596
|
-
}
|
|
20597
|
-
)
|
|
20598
|
-
] })
|
|
20599
|
-
] });
|
|
20600
|
-
}
|
|
20601
|
-
var init_FieldForm = __esm({
|
|
20602
|
-
"packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx"() {
|
|
20603
|
-
"use strict";
|
|
20604
|
-
init_theme();
|
|
20605
|
-
init_ControlHints();
|
|
20606
|
-
init_ClearableTextInput();
|
|
20685
|
+
init_MenuScreen();
|
|
20686
|
+
BACK = { choice: "back", label: "Back", description: "Go back" };
|
|
20687
|
+
MENUS = {
|
|
20688
|
+
scanning: [BACK],
|
|
20689
|
+
ready: [{ choice: "continue", label: "Continue", description: "Use these files and go on" }, BACK],
|
|
20690
|
+
failed: [{ choice: "change-path", label: "Try a different path", description: "Pick a different folder" }, BACK]
|
|
20691
|
+
};
|
|
20607
20692
|
}
|
|
20608
20693
|
});
|
|
20609
20694
|
|
|
@@ -20684,71 +20769,8 @@ var init_validate4 = __esm({
|
|
|
20684
20769
|
|
|
20685
20770
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
20686
20771
|
import { useRef as useRef2, useState as useState9 } from "react";
|
|
20687
|
-
import {
|
|
20688
|
-
import { Fragment as
|
|
20689
|
-
function CredentialsReview({
|
|
20690
|
-
values,
|
|
20691
|
-
subtitle,
|
|
20692
|
-
notice,
|
|
20693
|
-
validating,
|
|
20694
|
-
onChoose,
|
|
20695
|
-
children
|
|
20696
|
-
}) {
|
|
20697
|
-
const [focus, setFocus] = useState9(0);
|
|
20698
|
-
useInput11((_input, key) => {
|
|
20699
|
-
if (validating) return;
|
|
20700
|
-
if (key.escape) onChoose("quit");
|
|
20701
|
-
else if (key.return) onChoose(MENU[focus].choice);
|
|
20702
|
-
else if (key.upArrow) setFocus((current) => (current - 1 + MENU.length) % MENU.length);
|
|
20703
|
-
else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % MENU.length);
|
|
20704
|
-
});
|
|
20705
|
-
const labelWidth = formLabelWidth([...FIELDS2, ...MENU]);
|
|
20706
|
-
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
20707
|
-
/* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
20708
|
-
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
20709
|
-
/* @__PURE__ */ jsx15(Text14, { bold: true, children: "Contentful Credentials" }),
|
|
20710
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20711
|
-
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: subtitle }),
|
|
20712
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20713
|
-
MENU.map((item, index) => {
|
|
20714
|
-
const focused = index === focus;
|
|
20715
|
-
return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
|
|
20716
|
-
/* @__PURE__ */ jsx15(Text14, { color: focused ? PALETTE.accent : void 0, children: focused ? "\u276F" : " " }),
|
|
20717
|
-
/* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: focused, color: focused ? PALETTE.accent : PALETTE.muted, children: item.label }) }),
|
|
20718
|
-
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: item.description })
|
|
20719
|
-
] }, item.choice);
|
|
20720
|
-
}),
|
|
20721
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20722
|
-
FIELDS2.map((field) => {
|
|
20723
|
-
const value = values[field.key];
|
|
20724
|
-
return /* @__PURE__ */ jsx15(FormReadOnlyRow, { label: field.label, labelWidth, children: /* @__PURE__ */ jsx15(Text14, { bold: value !== "", children: field.masked ? "\u2022".repeat(value.length) : value || "(empty)" }) }, field.key);
|
|
20725
|
-
}),
|
|
20726
|
-
notice && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
20727
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20728
|
-
/* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
|
|
20729
|
-
"\u2717 ",
|
|
20730
|
-
notice.text
|
|
20731
|
-
] })
|
|
20732
|
-
] }),
|
|
20733
|
-
validating && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
20734
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20735
|
-
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
20736
|
-
] }),
|
|
20737
|
-
children,
|
|
20738
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
20739
|
-
/* @__PURE__ */ jsx15(
|
|
20740
|
-
ControlHints,
|
|
20741
|
-
{
|
|
20742
|
-
hints: [
|
|
20743
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
20744
|
-
{ keys: "\u23CE", label: MENU[focus].label.toLowerCase() },
|
|
20745
|
-
{ keys: "Esc", label: "back" }
|
|
20746
|
-
]
|
|
20747
|
-
}
|
|
20748
|
-
)
|
|
20749
|
-
] })
|
|
20750
|
-
] });
|
|
20751
|
-
}
|
|
20772
|
+
import { Text as Text14 } from "ink";
|
|
20773
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
20752
20774
|
function CredentialsScreen({
|
|
20753
20775
|
onDone,
|
|
20754
20776
|
onBack,
|
|
@@ -20791,15 +20813,43 @@ function CredentialsScreen({
|
|
|
20791
20813
|
else onBack();
|
|
20792
20814
|
};
|
|
20793
20815
|
if (!editing) {
|
|
20794
|
-
return /* @__PURE__ */
|
|
20795
|
-
|
|
20796
|
-
|
|
20797
|
-
|
|
20816
|
+
return /* @__PURE__ */ jsxs14(
|
|
20817
|
+
MenuScreen,
|
|
20818
|
+
{
|
|
20819
|
+
title: "Contentful Credentials",
|
|
20820
|
+
subtitle,
|
|
20821
|
+
menu: MENU2,
|
|
20822
|
+
rows: FIELDS2.map((field) => ({
|
|
20823
|
+
label: field.label,
|
|
20824
|
+
value: field.masked ? "\u2022".repeat(values[field.key].length) : values[field.key]
|
|
20825
|
+
})),
|
|
20826
|
+
onChoose: choose,
|
|
20827
|
+
onEscape: onBack,
|
|
20828
|
+
busy: validating,
|
|
20829
|
+
children: [
|
|
20830
|
+
notice && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
20831
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
20832
|
+
/* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
|
|
20833
|
+
"\u2717 ",
|
|
20834
|
+
notice.text
|
|
20835
|
+
] })
|
|
20836
|
+
] }),
|
|
20837
|
+
validating && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
20838
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
20839
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
20840
|
+
] }),
|
|
20841
|
+
!isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
20842
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
20843
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
20844
|
+
] })
|
|
20845
|
+
]
|
|
20846
|
+
}
|
|
20847
|
+
);
|
|
20798
20848
|
}
|
|
20799
20849
|
return /* @__PURE__ */ jsxs14(
|
|
20800
20850
|
FieldForm,
|
|
20801
20851
|
{
|
|
20802
|
-
header: /* @__PURE__ */
|
|
20852
|
+
header: /* @__PURE__ */ jsx17(StepHeader, { step: "setup" }),
|
|
20803
20853
|
title: "Contentful Credentials",
|
|
20804
20854
|
subtitle,
|
|
20805
20855
|
fields: FIELDS2,
|
|
@@ -20816,30 +20866,30 @@ function CredentialsScreen({
|
|
|
20816
20866
|
notice,
|
|
20817
20867
|
busy: validating,
|
|
20818
20868
|
children: [
|
|
20819
|
-
!prefilled && /* @__PURE__ */ jsxs14(
|
|
20820
|
-
/* @__PURE__ */
|
|
20821
|
-
/* @__PURE__ */
|
|
20822
|
-
/* @__PURE__ */
|
|
20869
|
+
!prefilled && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
20870
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
20871
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: credentialsPurpose(tokensOnly) }),
|
|
20872
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: "Tip: save these under Settings \u2192 Configuration so they pre-fill here." })
|
|
20823
20873
|
] }),
|
|
20824
|
-
validating && /* @__PURE__ */ jsxs14(
|
|
20825
|
-
/* @__PURE__ */
|
|
20826
|
-
/* @__PURE__ */
|
|
20874
|
+
validating && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
20875
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
20876
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
20827
20877
|
] }),
|
|
20828
|
-
!validating && !notice && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(
|
|
20829
|
-
/* @__PURE__ */
|
|
20830
|
-
/* @__PURE__ */
|
|
20878
|
+
!validating && !notice && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
20879
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
20880
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
20831
20881
|
] })
|
|
20832
20882
|
]
|
|
20833
20883
|
}
|
|
20834
20884
|
);
|
|
20835
20885
|
}
|
|
20836
|
-
var FIELDS2,
|
|
20886
|
+
var FIELDS2, MENU2;
|
|
20837
20887
|
var init_screen5 = __esm({
|
|
20838
20888
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx"() {
|
|
20839
20889
|
"use strict";
|
|
20840
20890
|
init_theme();
|
|
20841
20891
|
init_FieldForm();
|
|
20842
|
-
|
|
20892
|
+
init_MenuScreen();
|
|
20843
20893
|
init_StepHeader();
|
|
20844
20894
|
init_logic8();
|
|
20845
20895
|
init_validate4();
|
|
@@ -20849,7 +20899,7 @@ var init_screen5 = __esm({
|
|
|
20849
20899
|
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
20850
20900
|
{ key: "host", label: "API Host", hint: "(default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com)" }
|
|
20851
20901
|
];
|
|
20852
|
-
|
|
20902
|
+
MENU2 = [
|
|
20853
20903
|
{ choice: "continue", label: "Continue", description: "Check the credentials and go on" },
|
|
20854
20904
|
{ choice: "edit", label: "Edit", description: "Change the credentials" },
|
|
20855
20905
|
{ choice: "skip", label: "Skip", description: "Save files only, nothing is pushed" },
|
|
@@ -20946,9 +20996,9 @@ var init_logic9 = __esm({
|
|
|
20946
20996
|
});
|
|
20947
20997
|
|
|
20948
20998
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/screen.tsx
|
|
20949
|
-
import { jsx as
|
|
20999
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
20950
21000
|
function ExtractionScreen({ progress, agent }) {
|
|
20951
|
-
return /* @__PURE__ */
|
|
21001
|
+
return /* @__PURE__ */ jsx18(
|
|
20952
21002
|
RunningStep,
|
|
20953
21003
|
{
|
|
20954
21004
|
step: "extraction",
|
|
@@ -21464,8 +21514,8 @@ var init_columns = __esm({
|
|
|
21464
21514
|
});
|
|
21465
21515
|
|
|
21466
21516
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx
|
|
21467
|
-
import { Box as
|
|
21468
|
-
import { jsx as
|
|
21517
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
21518
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
21469
21519
|
function terminalPanelHeight(rows, reservedRows = 4) {
|
|
21470
21520
|
return Math.max(MIN_TERMINAL_PANEL_HEIGHT, rows - reservedRows);
|
|
21471
21521
|
}
|
|
@@ -21480,8 +21530,8 @@ function FixedPanel({
|
|
|
21480
21530
|
clipOverflow = true,
|
|
21481
21531
|
children
|
|
21482
21532
|
}) {
|
|
21483
|
-
return /* @__PURE__ */
|
|
21484
|
-
|
|
21533
|
+
return /* @__PURE__ */ jsx19(
|
|
21534
|
+
Box14,
|
|
21485
21535
|
{
|
|
21486
21536
|
flexDirection: "column",
|
|
21487
21537
|
width,
|
|
@@ -21506,7 +21556,7 @@ function WindowedPanel({ width, height, title, focused, children }) {
|
|
|
21506
21556
|
...height === void 0 ? {} : { height },
|
|
21507
21557
|
focused,
|
|
21508
21558
|
children: [
|
|
21509
|
-
title && /* @__PURE__ */
|
|
21559
|
+
title && /* @__PURE__ */ jsx19(WindowedPanelHeader, { title, width, focused }),
|
|
21510
21560
|
children
|
|
21511
21561
|
]
|
|
21512
21562
|
}
|
|
@@ -21517,9 +21567,9 @@ function WindowedPanelHeader({
|
|
|
21517
21567
|
width,
|
|
21518
21568
|
focused
|
|
21519
21569
|
}) {
|
|
21520
|
-
return /* @__PURE__ */ jsxs15(
|
|
21521
|
-
/* @__PURE__ */
|
|
21522
|
-
/* @__PURE__ */
|
|
21570
|
+
return /* @__PURE__ */ jsxs15(Box14, { flexDirection: "column", children: [
|
|
21571
|
+
/* @__PURE__ */ jsx19(Text15, { bold: true, color: PALETTE.accent, inverse: focused, children: title }),
|
|
21572
|
+
/* @__PURE__ */ jsx19(Text15, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) })
|
|
21523
21573
|
] });
|
|
21524
21574
|
}
|
|
21525
21575
|
function formatWindowIndicator(direction, count) {
|
|
@@ -21528,10 +21578,10 @@ function formatWindowIndicator(direction, count) {
|
|
|
21528
21578
|
}
|
|
21529
21579
|
function WindowFooter({ above, below }) {
|
|
21530
21580
|
const parts = [above > 0 ? `\u2191 ${above}` : "", below > 0 ? `\u2193 ${below}` : ""].filter(Boolean);
|
|
21531
|
-
return /* @__PURE__ */
|
|
21581
|
+
return /* @__PURE__ */ jsx19(Text15, { color: PALETTE.muted, children: parts.length === 0 ? " " : `${parts.join(" \xB7 ")} more` });
|
|
21532
21582
|
}
|
|
21533
21583
|
function WindowIndicator({ direction, count }) {
|
|
21534
|
-
return /* @__PURE__ */
|
|
21584
|
+
return /* @__PURE__ */ jsx19(Text15, { color: PALETTE.muted, children: formatWindowIndicator(direction, count) });
|
|
21535
21585
|
}
|
|
21536
21586
|
var MIN_TERMINAL_PANEL_HEIGHT;
|
|
21537
21587
|
var init_windowed_panel = __esm({
|
|
@@ -21544,17 +21594,17 @@ var init_windowed_panel = __esm({
|
|
|
21544
21594
|
|
|
21545
21595
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx
|
|
21546
21596
|
import React10 from "react";
|
|
21547
|
-
import { Box as
|
|
21597
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
21548
21598
|
import figures2 from "figures";
|
|
21549
|
-
import { jsx as
|
|
21599
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
21550
21600
|
function AddedColumn(props) {
|
|
21551
21601
|
const { title, width, height, entries, cursor, focused, aiFlaggedByKey, visibleCount } = props;
|
|
21552
21602
|
const reserveAiBadge = entries.some((e) => aiFlaggedByKey?.get(e.name) === true);
|
|
21553
21603
|
const firstNonCycleIdx = entries.findIndex((e) => !e.isCycle);
|
|
21554
21604
|
const window = computeColumnWindow(entries.length, cursor, Math.max(1, visibleCount));
|
|
21555
21605
|
return /* @__PURE__ */ jsxs16(WindowedPanel, { width, height, title, focused, children: [
|
|
21556
|
-
/* @__PURE__ */
|
|
21557
|
-
entries.length === 0 ? /* @__PURE__ */
|
|
21606
|
+
/* @__PURE__ */ jsx20(WindowIndicator, { direction: "up", count: window.above }),
|
|
21607
|
+
entries.length === 0 ? /* @__PURE__ */ jsx20(Text16, { color: PALETTE.muted, children: "(none)" }) : entries.slice(window.start, window.end).map((entry, vi) => {
|
|
21558
21608
|
const i = window.start + vi;
|
|
21559
21609
|
const isSelected = i === cursor;
|
|
21560
21610
|
const isCursor = focused && isSelected;
|
|
@@ -21562,12 +21612,12 @@ function AddedColumn(props) {
|
|
|
21562
21612
|
const showSeparator = firstNonCycleIdx > 0 && i === firstNonCycleIdx;
|
|
21563
21613
|
const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
|
|
21564
21614
|
return /* @__PURE__ */ jsxs16(React10.Fragment, { children: [
|
|
21565
|
-
showSeparator && /* @__PURE__ */
|
|
21566
|
-
/* @__PURE__ */ jsxs16(
|
|
21567
|
-
isCursor ? /* @__PURE__ */
|
|
21568
|
-
reserveAiBadge && (aiFlagged ? /* @__PURE__ */
|
|
21569
|
-
entry.isCycle && /* @__PURE__ */
|
|
21570
|
-
/* @__PURE__ */
|
|
21615
|
+
showSeparator && /* @__PURE__ */ jsx20(Text16, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
21616
|
+
/* @__PURE__ */ jsxs16(Box15, { children: [
|
|
21617
|
+
isCursor ? /* @__PURE__ */ jsx20(Text16, { color: PALETTE.accent, bold: true, children: figures2.pointer }) : /* @__PURE__ */ jsx20(Text16, { children: " " }),
|
|
21618
|
+
reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx20(Text16, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx20(Text16, { children: " " })),
|
|
21619
|
+
entry.isCycle && /* @__PURE__ */ jsx20(Text16, { color: isCursor ? PALETTE.accent : PALETTE.warning, bold: true, underline: style.nameUnderline, children: " \u26A0" }),
|
|
21620
|
+
/* @__PURE__ */ jsx20(
|
|
21571
21621
|
Text16,
|
|
21572
21622
|
{
|
|
21573
21623
|
color: style.nameColor,
|
|
@@ -21581,7 +21631,7 @@ function AddedColumn(props) {
|
|
|
21581
21631
|
] })
|
|
21582
21632
|
] }, entry.name);
|
|
21583
21633
|
}),
|
|
21584
|
-
/* @__PURE__ */
|
|
21634
|
+
/* @__PURE__ */ jsx20(WindowIndicator, { direction: "down", count: window.below })
|
|
21585
21635
|
] });
|
|
21586
21636
|
}
|
|
21587
21637
|
var init_added_column = __esm({
|
|
@@ -21594,9 +21644,9 @@ var init_added_column = __esm({
|
|
|
21594
21644
|
});
|
|
21595
21645
|
|
|
21596
21646
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx
|
|
21597
|
-
import { Box as
|
|
21647
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
21598
21648
|
import figures3 from "figures";
|
|
21599
|
-
import { jsx as
|
|
21649
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
21600
21650
|
function cycleLabel(cycle, index) {
|
|
21601
21651
|
const parts = [];
|
|
21602
21652
|
for (let i = 0; i < cycle.edges.length; i++) {
|
|
@@ -21607,17 +21657,17 @@ function cycleLabel(cycle, index) {
|
|
|
21607
21657
|
return `Cycle ${index + 1}: ${parts.join(" \u2192 ")}`;
|
|
21608
21658
|
}
|
|
21609
21659
|
function CyclesPanel({ cycles, cursor }) {
|
|
21610
|
-
return /* @__PURE__ */ jsxs17(
|
|
21611
|
-
/* @__PURE__ */
|
|
21612
|
-
/* @__PURE__ */
|
|
21660
|
+
return /* @__PURE__ */ jsxs17(Box16, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
21661
|
+
/* @__PURE__ */ jsx21(Text17, { bold: true, color: PALETTE.warning, children: `Cycles detected (${cycles.length}):` }),
|
|
21662
|
+
/* @__PURE__ */ jsx21(Text17, { children: " " }),
|
|
21613
21663
|
cycles.map((cycle, i) => {
|
|
21614
21664
|
const isCursor = i === cursor;
|
|
21615
21665
|
return /* @__PURE__ */ jsxs17(Text17, { children: [
|
|
21616
|
-
isCursor ? /* @__PURE__ */
|
|
21617
|
-
/* @__PURE__ */
|
|
21666
|
+
isCursor ? /* @__PURE__ */ jsx21(Text17, { color: PALETTE.accent, bold: true, children: figures3.pointer }) : /* @__PURE__ */ jsx21(Text17, { children: " " }),
|
|
21667
|
+
/* @__PURE__ */ jsx21(Text17, { color: PALETTE.warning, inverse: isCursor, children: " " + cycleLabel(cycle, i) })
|
|
21618
21668
|
] }, i);
|
|
21619
21669
|
}),
|
|
21620
|
-
/* @__PURE__ */
|
|
21670
|
+
/* @__PURE__ */ jsx21(Text17, { children: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [c/Esc] close" })
|
|
21621
21671
|
] });
|
|
21622
21672
|
}
|
|
21623
21673
|
var init_cycles_panel = __esm({
|
|
@@ -21628,14 +21678,14 @@ var init_cycles_panel = __esm({
|
|
|
21628
21678
|
});
|
|
21629
21679
|
|
|
21630
21680
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx
|
|
21631
|
-
import { Box as
|
|
21632
|
-
import { jsx as
|
|
21681
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
21682
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
21633
21683
|
function RejectPrompt({ pending }) {
|
|
21634
|
-
return /* @__PURE__ */ jsxs18(
|
|
21635
|
-
/* @__PURE__ */
|
|
21636
|
-
pending.ancestors.length > 0 && /* @__PURE__ */
|
|
21637
|
-
pending.descendants.length > 0 && /* @__PURE__ */
|
|
21638
|
-
/* @__PURE__ */
|
|
21684
|
+
return /* @__PURE__ */ jsxs18(Box17, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
21685
|
+
/* @__PURE__ */ jsx22(Text18, { bold: true, color: PALETTE.warning, children: `Rejecting ${pending.target} will:` }),
|
|
21686
|
+
pending.ancestors.length > 0 && /* @__PURE__ */ jsx22(Text18, { children: `- Reject ancestors: ${pending.ancestors.join(", ")}` }),
|
|
21687
|
+
pending.descendants.length > 0 && /* @__PURE__ */ jsx22(Text18, { children: `- Deselect descendants: ${pending.descendants.join(", ")}` }),
|
|
21688
|
+
/* @__PURE__ */ jsx22(Text18, { children: "[y] confirm \xB7 [n]/[Esc] cancel" })
|
|
21639
21689
|
] });
|
|
21640
21690
|
}
|
|
21641
21691
|
var init_reject_prompt = __esm({
|
|
@@ -21646,9 +21696,9 @@ var init_reject_prompt = __esm({
|
|
|
21646
21696
|
});
|
|
21647
21697
|
|
|
21648
21698
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.tsx
|
|
21649
|
-
import { jsx as
|
|
21699
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
21650
21700
|
function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
21651
|
-
return /* @__PURE__ */
|
|
21701
|
+
return /* @__PURE__ */ jsx23(
|
|
21652
21702
|
ControlHints,
|
|
21653
21703
|
{
|
|
21654
21704
|
hints: [
|
|
@@ -21671,8 +21721,8 @@ var init_CompactControlBar = __esm({
|
|
|
21671
21721
|
});
|
|
21672
21722
|
|
|
21673
21723
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx
|
|
21674
|
-
import { Box as
|
|
21675
|
-
import { jsx as
|
|
21724
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
21725
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
21676
21726
|
function CounterStrip(props) {
|
|
21677
21727
|
const { counters, totalWidth } = props;
|
|
21678
21728
|
const condensed = totalWidth < 60;
|
|
@@ -21680,25 +21730,25 @@ function CounterStrip(props) {
|
|
|
21680
21730
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
21681
21731
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
21682
21732
|
const sep = condensed ? " | " : " ";
|
|
21683
|
-
return /* @__PURE__ */
|
|
21733
|
+
return /* @__PURE__ */ jsx24(Box18, { children: /* @__PURE__ */ jsxs19(Text19, { children: [
|
|
21684
21734
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
21685
21735
|
labelGrp,
|
|
21686
21736
|
" "
|
|
21687
21737
|
] }),
|
|
21688
|
-
/* @__PURE__ */
|
|
21689
|
-
/* @__PURE__ */
|
|
21738
|
+
/* @__PURE__ */ jsx24(Text19, { bold: true, children: counters.groups }),
|
|
21739
|
+
/* @__PURE__ */ jsx24(Text19, { color: PALETTE.muted, children: sep }),
|
|
21690
21740
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
21691
21741
|
labelRej,
|
|
21692
21742
|
" "
|
|
21693
21743
|
] }),
|
|
21694
|
-
/* @__PURE__ */
|
|
21695
|
-
/* @__PURE__ */
|
|
21744
|
+
/* @__PURE__ */ jsx24(Text19, { bold: true, children: counters.rejected }),
|
|
21745
|
+
/* @__PURE__ */ jsx24(Text19, { color: PALETTE.muted, children: sep }),
|
|
21696
21746
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
21697
21747
|
labelUnd,
|
|
21698
21748
|
" "
|
|
21699
21749
|
] }),
|
|
21700
|
-
/* @__PURE__ */
|
|
21701
|
-
/* @__PURE__ */
|
|
21750
|
+
/* @__PURE__ */ jsx24(Text19, { bold: true, children: counters.undecided }),
|
|
21751
|
+
/* @__PURE__ */ jsx24(Text19, { color: PALETTE.muted, children: sep })
|
|
21702
21752
|
] }) });
|
|
21703
21753
|
}
|
|
21704
21754
|
var init_CounterStrip = __esm({
|
|
@@ -21710,8 +21760,8 @@ var init_CounterStrip = __esm({
|
|
|
21710
21760
|
|
|
21711
21761
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx
|
|
21712
21762
|
import figures4 from "figures";
|
|
21713
|
-
import { Box as
|
|
21714
|
-
import { jsx as
|
|
21763
|
+
import { Box as Box19, Text as Text20 } from "ink";
|
|
21764
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
21715
21765
|
function windowStart(rowCount, highlightIndex, maxRows) {
|
|
21716
21766
|
if (rowCount <= maxRows) return 0;
|
|
21717
21767
|
const maxStart = rowCount - maxRows;
|
|
@@ -21722,8 +21772,8 @@ function windowStart(rowCount, highlightIndex, maxRows) {
|
|
|
21722
21772
|
}
|
|
21723
21773
|
function defaultRenderRow(row, index, isCursor) {
|
|
21724
21774
|
return /* @__PURE__ */ jsxs20(Text20, { children: [
|
|
21725
|
-
isCursor ? /* @__PURE__ */
|
|
21726
|
-
/* @__PURE__ */
|
|
21775
|
+
isCursor ? /* @__PURE__ */ jsx25(Text20, { color: PALETTE.accent, bold: true, children: figures4.pointer }) : /* @__PURE__ */ jsx25(Text20, { children: " " }),
|
|
21776
|
+
/* @__PURE__ */ jsx25(Text20, { inverse: isCursor, children: " " + row.label })
|
|
21727
21777
|
] }, index);
|
|
21728
21778
|
}
|
|
21729
21779
|
function GotoBanner({
|
|
@@ -21743,7 +21793,7 @@ function GotoBanner({
|
|
|
21743
21793
|
const moreAbove = start;
|
|
21744
21794
|
const moreBelow = rows.length - end;
|
|
21745
21795
|
return /* @__PURE__ */ jsxs20(
|
|
21746
|
-
|
|
21796
|
+
Box19,
|
|
21747
21797
|
{
|
|
21748
21798
|
flexDirection: "column",
|
|
21749
21799
|
borderStyle: "single",
|
|
@@ -21753,14 +21803,14 @@ function GotoBanner({
|
|
|
21753
21803
|
width,
|
|
21754
21804
|
flexShrink: 0,
|
|
21755
21805
|
children: [
|
|
21756
|
-
/* @__PURE__ */
|
|
21757
|
-
moreAbove > 0 && /* @__PURE__ */
|
|
21806
|
+
/* @__PURE__ */ jsx25(Text20, { bold: true, children: title }),
|
|
21807
|
+
moreAbove > 0 && /* @__PURE__ */ jsx25(Text20, { color: PALETTE.muted, children: ` \u25B2 ${moreAbove} more` }),
|
|
21758
21808
|
visible.map((row, vi) => {
|
|
21759
21809
|
const i = start + vi;
|
|
21760
21810
|
return renderRow(row, i, i === highlightIndex);
|
|
21761
21811
|
}),
|
|
21762
|
-
moreBelow > 0 && /* @__PURE__ */
|
|
21763
|
-
footerHint !== void 0 && /* @__PURE__ */
|
|
21812
|
+
moreBelow > 0 && /* @__PURE__ */ jsx25(Text20, { color: PALETTE.muted, children: ` \u25BC ${moreBelow} more` }),
|
|
21813
|
+
footerHint !== void 0 && /* @__PURE__ */ jsx25(Text20, { color: PALETTE.muted, children: footerHint })
|
|
21764
21814
|
]
|
|
21765
21815
|
}
|
|
21766
21816
|
);
|
|
@@ -22124,7 +22174,7 @@ var init_composite_closure = __esm({
|
|
|
22124
22174
|
|
|
22125
22175
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/badge.tsx
|
|
22126
22176
|
import { Text as Text21 } from "ink";
|
|
22127
|
-
import { jsx as
|
|
22177
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
22128
22178
|
function previewBadge(annotation) {
|
|
22129
22179
|
switch (annotation) {
|
|
22130
22180
|
case "new":
|
|
@@ -22143,7 +22193,7 @@ function PreviewBadge({
|
|
|
22143
22193
|
badge,
|
|
22144
22194
|
highlighted = false
|
|
22145
22195
|
}) {
|
|
22146
|
-
return badge ? /* @__PURE__ */
|
|
22196
|
+
return badge ? /* @__PURE__ */ jsx26(Text21, { color: !highlighted && badge.dim ? PALETTE.muted : badge.color, bold: badge.bold, children: badge.char }) : /* @__PURE__ */ jsx26(Text21, { children: " " });
|
|
22147
22197
|
}
|
|
22148
22198
|
var init_badge = __esm({
|
|
22149
22199
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/badge.tsx"() {
|
|
@@ -22154,8 +22204,8 @@ var init_badge = __esm({
|
|
|
22154
22204
|
|
|
22155
22205
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.tsx
|
|
22156
22206
|
import figures5 from "figures";
|
|
22157
|
-
import { Box as
|
|
22158
|
-
import { jsx as
|
|
22207
|
+
import { Box as Box20, Text as Text22 } from "ink";
|
|
22208
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
22159
22209
|
function hasDirectChild(node) {
|
|
22160
22210
|
return node.slots.some((slot) => (slot.allowedComponents ?? []).some((target) => target !== node.name));
|
|
22161
22211
|
}
|
|
@@ -22605,11 +22655,11 @@ function GroupedSidebar(props) {
|
|
|
22605
22655
|
isOwn: rs?.isOwn ?? false,
|
|
22606
22656
|
isCursor
|
|
22607
22657
|
});
|
|
22608
|
-
return /* @__PURE__ */ jsxs21(
|
|
22609
|
-
isCursor ? /* @__PURE__ */
|
|
22610
|
-
/* @__PURE__ */
|
|
22611
|
-
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */
|
|
22612
|
-
aiFlaggedByKey !== void 0 && (aiFlagged ? /* @__PURE__ */
|
|
22658
|
+
return /* @__PURE__ */ jsxs21(Box20, { children: [
|
|
22659
|
+
isCursor ? /* @__PURE__ */ jsx27(Text22, { color: PALETTE.accent, bold: true, children: figures5.pointer }) : /* @__PURE__ */ jsx27(Text22, { children: " " }),
|
|
22660
|
+
/* @__PURE__ */ jsx27(PreviewBadge, { badge, highlighted: isSelected }),
|
|
22661
|
+
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */ jsx27(Text22, { color: !isSelected && selDim ? PALETTE.muted : selColor, bold: selBold, children: " " + selGlyph }) : /* @__PURE__ */ jsx27(Text22, { children: " " })),
|
|
22662
|
+
aiFlaggedByKey !== void 0 && (aiFlagged ? /* @__PURE__ */ jsx27(Text22, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx27(Text22, { children: " " })),
|
|
22613
22663
|
/* @__PURE__ */ jsxs21(
|
|
22614
22664
|
Text22,
|
|
22615
22665
|
{
|
|
@@ -22624,10 +22674,10 @@ function GroupedSidebar(props) {
|
|
|
22624
22674
|
]
|
|
22625
22675
|
}
|
|
22626
22676
|
),
|
|
22627
|
-
inheritanceStyle.glyph && /* @__PURE__ */
|
|
22677
|
+
inheritanceStyle.glyph && /* @__PURE__ */ jsx27(Text22, { color: inheritanceStyle.dim ? PALETTE.muted : inheritanceStyle.color, bold: inheritanceStyle.bold, children: " " + inheritanceStyle.glyph })
|
|
22628
22678
|
] }, row.key);
|
|
22629
22679
|
}),
|
|
22630
|
-
windowed && /* @__PURE__ */
|
|
22680
|
+
windowed && /* @__PURE__ */ jsx27(WindowFooter, { above: start, below: Math.max(0, allRows.length - end) })
|
|
22631
22681
|
] });
|
|
22632
22682
|
}
|
|
22633
22683
|
var GLYPH_EXPAND_COLLAPSED, GLYPH_EXPAND_EXPANDED, GLYPH_TREE_MID, GLYPH_TREE_LAST, GLYPH_WARN, GLYPH_ERROR;
|
|
@@ -22756,8 +22806,8 @@ var init_use_terminal_size = __esm({
|
|
|
22756
22806
|
|
|
22757
22807
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.tsx
|
|
22758
22808
|
import React11 from "react";
|
|
22759
|
-
import { Box as
|
|
22760
|
-
import { Fragment as
|
|
22809
|
+
import { Box as Box21, Text as Text23 } from "ink";
|
|
22810
|
+
import { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
22761
22811
|
function HelpOverlay(props) {
|
|
22762
22812
|
const { onClose } = props;
|
|
22763
22813
|
const { columns: terminalColumns, rows: terminalRows } = useTerminalSize();
|
|
@@ -22769,7 +22819,7 @@ function HelpOverlay(props) {
|
|
|
22769
22819
|
}, props.handleInput !== false);
|
|
22770
22820
|
if (props.sections) {
|
|
22771
22821
|
return /* @__PURE__ */ jsxs22(
|
|
22772
|
-
|
|
22822
|
+
Box21,
|
|
22773
22823
|
{
|
|
22774
22824
|
flexDirection: "column",
|
|
22775
22825
|
borderStyle: "round",
|
|
@@ -22778,11 +22828,11 @@ function HelpOverlay(props) {
|
|
|
22778
22828
|
height: panelHeight,
|
|
22779
22829
|
overflowY: "hidden",
|
|
22780
22830
|
children: [
|
|
22781
|
-
/* @__PURE__ */
|
|
22831
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "\u2500".repeat(titleRule) + " Help " + "\u2500".repeat(titleRule) }),
|
|
22782
22832
|
props.sections.map((section) => /* @__PURE__ */ jsxs22(React11.Fragment, { children: [
|
|
22783
|
-
/* @__PURE__ */
|
|
22784
|
-
/* @__PURE__ */
|
|
22785
|
-
section.entries.map((entry) => /* @__PURE__ */
|
|
22833
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
22834
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: section.title }),
|
|
22835
|
+
section.entries.map((entry) => /* @__PURE__ */ jsx28(Text23, { children: entry.keys ? " " + entry.keys.padEnd(16) + " " + entry.label : " " + entry.label }, entry.keys + entry.label))
|
|
22786
22836
|
] }, section.title))
|
|
22787
22837
|
]
|
|
22788
22838
|
}
|
|
@@ -22790,7 +22840,7 @@ function HelpOverlay(props) {
|
|
|
22790
22840
|
}
|
|
22791
22841
|
const mode = props.mode;
|
|
22792
22842
|
return /* @__PURE__ */ jsxs22(
|
|
22793
|
-
|
|
22843
|
+
Box21,
|
|
22794
22844
|
{
|
|
22795
22845
|
flexDirection: "column",
|
|
22796
22846
|
borderStyle: "round",
|
|
@@ -22799,31 +22849,31 @@ function HelpOverlay(props) {
|
|
|
22799
22849
|
height: panelHeight,
|
|
22800
22850
|
overflowY: "hidden",
|
|
22801
22851
|
children: [
|
|
22802
|
-
/* @__PURE__ */
|
|
22803
|
-
/* @__PURE__ */
|
|
22804
|
-
/* @__PURE__ */
|
|
22805
|
-
/* @__PURE__ */
|
|
22806
|
-
/* @__PURE__ */
|
|
22807
|
-
/* @__PURE__ */
|
|
22808
|
-
/* @__PURE__ */
|
|
22809
|
-
mode === "review" && /* @__PURE__ */ jsxs22(
|
|
22810
|
-
/* @__PURE__ */
|
|
22811
|
-
/* @__PURE__ */
|
|
22812
|
-
/* @__PURE__ */
|
|
22813
|
-
/* @__PURE__ */
|
|
22814
|
-
/* @__PURE__ */
|
|
22815
|
-
/* @__PURE__ */
|
|
22816
|
-
/* @__PURE__ */
|
|
22817
|
-
/* @__PURE__ */
|
|
22818
|
-
/* @__PURE__ */
|
|
22819
|
-
/* @__PURE__ */
|
|
22820
|
-
/* @__PURE__ */
|
|
22821
|
-
/* @__PURE__ */
|
|
22822
|
-
/* @__PURE__ */
|
|
22852
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "\u2500".repeat(titleRule) + " Help " + "\u2500".repeat(titleRule) }),
|
|
22853
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
22854
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "Navigation" }),
|
|
22855
|
+
/* @__PURE__ */ jsx28(Text23, { children: " \u2191 / k / PgUp Scroll up" }),
|
|
22856
|
+
/* @__PURE__ */ jsx28(Text23, { children: " \u2193 / j / PgDn Scroll down" }),
|
|
22857
|
+
/* @__PURE__ */ jsx28(Text23, { children: " g / Home Jump to top" }),
|
|
22858
|
+
/* @__PURE__ */ jsx28(Text23, { children: " G / End Jump to bottom" }),
|
|
22859
|
+
mode === "review" && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
22860
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
22861
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "[Review mode only]" }),
|
|
22862
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Tab Toggle sidebar/detail" }),
|
|
22863
|
+
/* @__PURE__ */ jsx28(Text23, { children: " a Accept component" }),
|
|
22864
|
+
/* @__PURE__ */ jsx28(Text23, { children: " r Reject component" }),
|
|
22865
|
+
/* @__PURE__ */ jsx28(Text23, { children: " e Edit proposal" }),
|
|
22866
|
+
/* @__PURE__ */ jsx28(Text23, { children: " s Toggle source code" }),
|
|
22867
|
+
/* @__PURE__ */ jsx28(Text23, { children: " A Approve all" }),
|
|
22868
|
+
/* @__PURE__ */ jsx28(Text23, { children: " F Open finalize dialog" }),
|
|
22869
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Ctrl+S Save draft" }),
|
|
22870
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Ctrl+Z Undo" }),
|
|
22871
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Ctrl+Y Redo" }),
|
|
22872
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Esc Exit edit / close" })
|
|
22823
22873
|
] }),
|
|
22824
|
-
/* @__PURE__ */
|
|
22825
|
-
/* @__PURE__ */
|
|
22826
|
-
/* @__PURE__ */
|
|
22874
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
22875
|
+
/* @__PURE__ */ jsx28(Text23, { children: " h Close help" }),
|
|
22876
|
+
/* @__PURE__ */ jsx28(Text23, { children: " q Quit" })
|
|
22827
22877
|
]
|
|
22828
22878
|
}
|
|
22829
22879
|
);
|
|
@@ -22903,8 +22953,8 @@ var init_sidebar_input = __esm({
|
|
|
22903
22953
|
});
|
|
22904
22954
|
|
|
22905
22955
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx
|
|
22906
|
-
import { Box as
|
|
22907
|
-
import { Fragment as
|
|
22956
|
+
import { Box as Box22, Text as Text24 } from "ink";
|
|
22957
|
+
import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
22908
22958
|
function SearchMatchSummary({
|
|
22909
22959
|
open,
|
|
22910
22960
|
query,
|
|
@@ -22915,17 +22965,17 @@ function SearchMatchSummary({
|
|
|
22915
22965
|
marginTop
|
|
22916
22966
|
}) {
|
|
22917
22967
|
if (hidden) return null;
|
|
22918
|
-
return /* @__PURE__ */ jsxs23(
|
|
22919
|
-
open && /* @__PURE__ */ jsxs23(
|
|
22968
|
+
return /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
22969
|
+
open && /* @__PURE__ */ jsxs23(Box22, { marginTop, flexDirection: "column", children: [
|
|
22920
22970
|
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
22921
22971
|
`/${query}`,
|
|
22922
|
-
/* @__PURE__ */
|
|
22923
|
-
query && /* @__PURE__ */
|
|
22924
|
-
/* @__PURE__ */
|
|
22972
|
+
/* @__PURE__ */ jsx29(Text24, { color: PALETTE.accent, children: "\u258E" }),
|
|
22973
|
+
query && /* @__PURE__ */ jsx29(Text24, { color: PALETTE.muted, children: formatSearchMatchSummary(matches, total) }),
|
|
22974
|
+
/* @__PURE__ */ jsx29(Text24, { children: " \xB7 [Esc] leave" })
|
|
22925
22975
|
] }),
|
|
22926
|
-
autocompleteCandidates.length > 1 && /* @__PURE__ */
|
|
22976
|
+
autocompleteCandidates.length > 1 && /* @__PURE__ */ jsx29(Text24, { color: PALETTE.muted, children: ` possibilities: ${autocompleteCandidates.join(" \xB7 ").slice(0, 120)}` })
|
|
22927
22977
|
] }),
|
|
22928
|
-
!open && query && /* @__PURE__ */
|
|
22978
|
+
!open && query && /* @__PURE__ */ jsx29(Box22, { marginTop, children: /* @__PURE__ */ jsx29(Text24, { children: `/${query}${formatSearchMatchSummary(matches, total)} \xB7 [Esc] clear` }) })
|
|
22929
22979
|
] });
|
|
22930
22980
|
}
|
|
22931
22981
|
var init_SearchMatchSummary = __esm({
|
|
@@ -24185,33 +24235,33 @@ var init_use_scope_gate = __esm({
|
|
|
24185
24235
|
});
|
|
24186
24236
|
|
|
24187
24237
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/screen.tsx
|
|
24188
|
-
import { Box as
|
|
24189
|
-
import { Fragment as
|
|
24238
|
+
import { Box as Box23, Text as Text25 } from "ink";
|
|
24239
|
+
import { Fragment as Fragment7, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
24190
24240
|
function ScopeGateScreen(props) {
|
|
24191
24241
|
if (props.components.length === 0) {
|
|
24192
|
-
return /* @__PURE__ */
|
|
24242
|
+
return /* @__PURE__ */ jsx30(Box23, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx30(Text25, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
24193
24243
|
}
|
|
24194
|
-
return /* @__PURE__ */
|
|
24244
|
+
return /* @__PURE__ */ jsx30(ScopeGateView, { ...props });
|
|
24195
24245
|
}
|
|
24196
24246
|
function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
24197
24247
|
const gate = useScopeGate({ components, onConfirm, onQuit });
|
|
24198
24248
|
const { search, graph, columnPlan, panelLayout, counters } = gate;
|
|
24199
24249
|
if (gate.showHelp) {
|
|
24200
|
-
return /* @__PURE__ */
|
|
24250
|
+
return /* @__PURE__ */ jsx30(HelpOverlay, { sections: HELP_SECTIONS, handleInput: false, onClose: gate.closeHelp });
|
|
24201
24251
|
}
|
|
24202
|
-
return /* @__PURE__ */ jsxs24(
|
|
24203
|
-
/* @__PURE__ */
|
|
24204
|
-
/* @__PURE__ */ jsxs24(
|
|
24205
|
-
/* @__PURE__ */ jsxs24(
|
|
24206
|
-
/* @__PURE__ */
|
|
24252
|
+
return /* @__PURE__ */ jsxs24(Box23, { flexDirection: "column", children: [
|
|
24253
|
+
/* @__PURE__ */ jsx30(StepHeader, { step: "scope-gate" }),
|
|
24254
|
+
/* @__PURE__ */ jsxs24(Box23, { flexDirection: "column", paddingX: 2, children: [
|
|
24255
|
+
/* @__PURE__ */ jsxs24(Box23, { flexDirection: "row", flexWrap: "wrap", children: [
|
|
24256
|
+
/* @__PURE__ */ jsx30(CounterStrip, { counters, totalWidth: gate.totalWidth }),
|
|
24207
24257
|
gate.aiExcludedCount > 0 && /* @__PURE__ */ jsxs24(Text25, { color: PALETTE.muted, children: [
|
|
24208
24258
|
`${gate.aiExcludedCount} component${gate.aiExcludedCount === 1 ? "" : "s"} flagged by AI`,
|
|
24209
|
-
gate.aiRows.length > 0 && /* @__PURE__ */
|
|
24259
|
+
gate.aiRows.length > 0 && /* @__PURE__ */ jsx30(Text25, { color: PALETTE.accent, children: " \u2014 press [x] to see why" })
|
|
24210
24260
|
] })
|
|
24211
24261
|
] }),
|
|
24212
|
-
graph.cycles.length > 0 && /* @__PURE__ */
|
|
24213
|
-
/* @__PURE__ */ jsxs24(
|
|
24214
|
-
gate.aiRationalePanelOpen ? /* @__PURE__ */
|
|
24262
|
+
graph.cycles.length > 0 && /* @__PURE__ */ jsx30(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx30(Text25, { color: PALETTE.muted, children: "If you must have components with cycles, select them together into the generate step and then use the editor to fix them." }) }),
|
|
24263
|
+
/* @__PURE__ */ jsxs24(Box23, { flexDirection: "row", alignItems: "stretch", children: [
|
|
24264
|
+
gate.aiRationalePanelOpen ? /* @__PURE__ */ jsx30(
|
|
24215
24265
|
GotoBanner,
|
|
24216
24266
|
{
|
|
24217
24267
|
title: `Review flags (${gate.aiExcludedCount})`,
|
|
@@ -24221,7 +24271,7 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
24221
24271
|
width: columnPlan.main,
|
|
24222
24272
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [x/Esc] close"
|
|
24223
24273
|
}
|
|
24224
|
-
) : /* @__PURE__ */
|
|
24274
|
+
) : /* @__PURE__ */ jsx30(
|
|
24225
24275
|
GroupedSidebar,
|
|
24226
24276
|
{
|
|
24227
24277
|
items: gate.groupedItems,
|
|
@@ -24249,9 +24299,9 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
24249
24299
|
graph: graph.nodes
|
|
24250
24300
|
}
|
|
24251
24301
|
),
|
|
24252
|
-
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs24(
|
|
24253
|
-
/* @__PURE__ */
|
|
24254
|
-
/* @__PURE__ */
|
|
24302
|
+
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
24303
|
+
/* @__PURE__ */ jsx30(Box23, { width: 2, flexShrink: 0 }),
|
|
24304
|
+
/* @__PURE__ */ jsx30(
|
|
24255
24305
|
AddedColumn,
|
|
24256
24306
|
{
|
|
24257
24307
|
width: columnPlan.added,
|
|
@@ -24266,9 +24316,9 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
24266
24316
|
)
|
|
24267
24317
|
] })
|
|
24268
24318
|
] }),
|
|
24269
|
-
gate.cyclesPanelOpen && /* @__PURE__ */
|
|
24270
|
-
gate.pendingRejectCascade && /* @__PURE__ */
|
|
24271
|
-
/* @__PURE__ */
|
|
24319
|
+
gate.cyclesPanelOpen && /* @__PURE__ */ jsx30(CyclesPanel, { cycles: gate.slotCycles, cursor: gate.cyclesCursor }),
|
|
24320
|
+
gate.pendingRejectCascade && /* @__PURE__ */ jsx30(RejectPrompt, { pending: gate.pendingRejectCascade }),
|
|
24321
|
+
/* @__PURE__ */ jsx30(
|
|
24272
24322
|
SearchMatchSummary,
|
|
24273
24323
|
{
|
|
24274
24324
|
open: search.searchOpen,
|
|
@@ -24279,7 +24329,7 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
24279
24329
|
marginTop: 1
|
|
24280
24330
|
}
|
|
24281
24331
|
),
|
|
24282
|
-
/* @__PURE__ */
|
|
24332
|
+
/* @__PURE__ */ jsx30(
|
|
24283
24333
|
CompactControlBar,
|
|
24284
24334
|
{
|
|
24285
24335
|
hasGroupRoots: gate.hasGroupRoots,
|
|
@@ -24469,14 +24519,14 @@ var init_logic10 = __esm({
|
|
|
24469
24519
|
});
|
|
24470
24520
|
|
|
24471
24521
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/screen.tsx
|
|
24472
|
-
import { jsx as
|
|
24522
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
24473
24523
|
function GenerationScreen({
|
|
24474
24524
|
progress,
|
|
24475
24525
|
agent,
|
|
24476
24526
|
acceptedCount,
|
|
24477
24527
|
hasTokens
|
|
24478
24528
|
}) {
|
|
24479
|
-
return /* @__PURE__ */
|
|
24529
|
+
return /* @__PURE__ */ jsx31(
|
|
24480
24530
|
RunningStep,
|
|
24481
24531
|
{
|
|
24482
24532
|
step: "generation",
|
|
@@ -25157,7 +25207,7 @@ var init_logic11 = __esm({
|
|
|
25157
25207
|
});
|
|
25158
25208
|
|
|
25159
25209
|
// packages/experience-design-system-cli/src/tui/import/steps/preview-validation-error/screen.tsx
|
|
25160
|
-
import { jsx as
|
|
25210
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
25161
25211
|
function PreviewValidationErrorScreen({
|
|
25162
25212
|
errors,
|
|
25163
25213
|
missingNames,
|
|
@@ -25166,7 +25216,7 @@ function PreviewValidationErrorScreen({
|
|
|
25166
25216
|
onQuit
|
|
25167
25217
|
}) {
|
|
25168
25218
|
const matchedNames = matchedComponentNames(errors, missingNames);
|
|
25169
|
-
return /* @__PURE__ */
|
|
25219
|
+
return /* @__PURE__ */ jsx32(
|
|
25170
25220
|
GateStep,
|
|
25171
25221
|
{
|
|
25172
25222
|
intent: "error",
|
|
@@ -25540,8 +25590,8 @@ var init_scroll_offset = __esm({
|
|
|
25540
25590
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
25541
25591
|
import React12, { useEffect as useEffect11, useLayoutEffect as useLayoutEffect2, useState as useState18 } from "react";
|
|
25542
25592
|
import figures6 from "figures";
|
|
25543
|
-
import { Box as
|
|
25544
|
-
import { Fragment as
|
|
25593
|
+
import { Box as Box24, measureElement, Text as Text26 } from "ink";
|
|
25594
|
+
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
25545
25595
|
function createCommonRowProps(selected, focusLevel, editingField, textCursor, valueCursor, cursorVisible, editingValue, valueText, width) {
|
|
25546
25596
|
return {
|
|
25547
25597
|
selected,
|
|
@@ -25679,14 +25729,14 @@ function serializeState(state2, originalJson) {
|
|
|
25679
25729
|
return JSON.stringify(entry, null, 2);
|
|
25680
25730
|
}
|
|
25681
25731
|
function Picker({ value, active }) {
|
|
25682
|
-
return /* @__PURE__ */ jsxs25(
|
|
25683
|
-
active && /* @__PURE__ */
|
|
25684
|
-
/* @__PURE__ */
|
|
25685
|
-
active && /* @__PURE__ */
|
|
25732
|
+
return /* @__PURE__ */ jsxs25(Box24, { children: [
|
|
25733
|
+
active && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.warning, children: "\u2039" }),
|
|
25734
|
+
/* @__PURE__ */ jsx33(Text26, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
25735
|
+
active && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.warning, children: "\u203A" })
|
|
25686
25736
|
] });
|
|
25687
25737
|
}
|
|
25688
25738
|
function Toggle({ value, active }) {
|
|
25689
|
-
return /* @__PURE__ */
|
|
25739
|
+
return /* @__PURE__ */ jsx33(Box24, { children: /* @__PURE__ */ jsx33(Text26, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
25690
25740
|
}
|
|
25691
25741
|
function InlinePropField({
|
|
25692
25742
|
label,
|
|
@@ -25695,7 +25745,7 @@ function InlinePropField({
|
|
|
25695
25745
|
flexible = false,
|
|
25696
25746
|
width
|
|
25697
25747
|
}) {
|
|
25698
|
-
return /* @__PURE__ */ jsxs25(
|
|
25748
|
+
return /* @__PURE__ */ jsxs25(Box24, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
25699
25749
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
25700
25750
|
focused ? "\u203A " : " ",
|
|
25701
25751
|
label
|
|
@@ -25709,19 +25759,19 @@ function RequiredField({
|
|
|
25709
25759
|
editingField,
|
|
25710
25760
|
activeField
|
|
25711
25761
|
}) {
|
|
25712
|
-
return /* @__PURE__ */
|
|
25762
|
+
return /* @__PURE__ */ jsx33(InlinePropField, { label: "req:", focused, children: /* @__PURE__ */ jsx33(Toggle, { value, active: editingField && activeField === "required" }) });
|
|
25713
25763
|
}
|
|
25714
25764
|
function DefaultValueRow({
|
|
25715
25765
|
display,
|
|
25716
25766
|
active,
|
|
25717
25767
|
focused
|
|
25718
25768
|
}) {
|
|
25719
|
-
return /* @__PURE__ */ jsxs25(
|
|
25769
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
25720
25770
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25721
25771
|
focused ? "\u203A " : " ",
|
|
25722
25772
|
"default:"
|
|
25723
25773
|
] }),
|
|
25724
|
-
active ? /* @__PURE__ */
|
|
25774
|
+
active ? /* @__PURE__ */ jsx33(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx33(Text26, { wrap: "wrap", children: display })
|
|
25725
25775
|
] });
|
|
25726
25776
|
}
|
|
25727
25777
|
function RowLabel({
|
|
@@ -25749,10 +25799,10 @@ function ValueInputRow({
|
|
|
25749
25799
|
valueText,
|
|
25750
25800
|
cursorVisible
|
|
25751
25801
|
}) {
|
|
25752
|
-
return /* @__PURE__ */ jsxs25(
|
|
25753
|
-
/* @__PURE__ */
|
|
25754
|
-
/* @__PURE__ */
|
|
25755
|
-
/* @__PURE__ */
|
|
25802
|
+
return /* @__PURE__ */ jsxs25(Box24, { paddingLeft: 2, children: [
|
|
25803
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
25804
|
+
/* @__PURE__ */ jsx33(Text26, { children: valueText }),
|
|
25805
|
+
/* @__PURE__ */ jsx33(Text26, { inverse: cursorVisible, children: " " })
|
|
25756
25806
|
] });
|
|
25757
25807
|
}
|
|
25758
25808
|
function EditableListItem({
|
|
@@ -25765,9 +25815,9 @@ function EditableListItem({
|
|
|
25765
25815
|
}) {
|
|
25766
25816
|
const isBeingEdited = editingValue?.mode === "edit" && editingValue.index === index;
|
|
25767
25817
|
if (isBeingEdited) {
|
|
25768
|
-
return /* @__PURE__ */
|
|
25818
|
+
return /* @__PURE__ */ jsx33(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
25769
25819
|
}
|
|
25770
|
-
return /* @__PURE__ */
|
|
25820
|
+
return /* @__PURE__ */ jsx33(Box24, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx33(Text26, { color: active ? PALETTE.accent : void 0, children: active ? `${figures6.pointer} ${value}` : ` ${value}` }) });
|
|
25771
25821
|
}
|
|
25772
25822
|
function EditableValueList({
|
|
25773
25823
|
values,
|
|
@@ -25780,9 +25830,9 @@ function EditableValueList({
|
|
|
25780
25830
|
emptyPaddingLeft,
|
|
25781
25831
|
showAddInput
|
|
25782
25832
|
}) {
|
|
25783
|
-
return /* @__PURE__ */ jsxs25(
|
|
25784
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */
|
|
25785
|
-
values.map((value, index) => /* @__PURE__ */
|
|
25833
|
+
return /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
25834
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx33(Box24, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: emptyMessage }) })),
|
|
25835
|
+
values.map((value, index) => /* @__PURE__ */ jsx33(
|
|
25786
25836
|
EditableListItem,
|
|
25787
25837
|
{
|
|
25788
25838
|
value,
|
|
@@ -25794,7 +25844,7 @@ function EditableValueList({
|
|
|
25794
25844
|
},
|
|
25795
25845
|
index
|
|
25796
25846
|
)),
|
|
25797
|
-
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */
|
|
25847
|
+
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx33(ValueInputRow, { mode: "add", valueText, cursorVisible })
|
|
25798
25848
|
] });
|
|
25799
25849
|
}
|
|
25800
25850
|
function DefaultSubRow({
|
|
@@ -25806,51 +25856,51 @@ function DefaultSubRow({
|
|
|
25806
25856
|
}) {
|
|
25807
25857
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
25808
25858
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
25809
|
-
return /* @__PURE__ */ jsxs25(
|
|
25859
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexShrink: 0, children: [
|
|
25810
25860
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25811
25861
|
focused ? "\u203A " : " ",
|
|
25812
25862
|
"default:"
|
|
25813
25863
|
] }),
|
|
25814
|
-
/* @__PURE__ */
|
|
25864
|
+
/* @__PURE__ */ jsx33(Text26, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
|
|
25815
25865
|
] });
|
|
25816
25866
|
}
|
|
25817
25867
|
if (prop.type === "boolean") {
|
|
25818
25868
|
const display = prop.default === true ? "true" : prop.default === false ? "false" : "(unset)";
|
|
25819
|
-
return /* @__PURE__ */
|
|
25869
|
+
return /* @__PURE__ */ jsx33(DefaultValueRow, { display, active, focused });
|
|
25820
25870
|
}
|
|
25821
25871
|
if (prop.type === "enum") {
|
|
25822
25872
|
if (prop.values.length === 0) {
|
|
25823
|
-
return /* @__PURE__ */ jsxs25(
|
|
25873
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexShrink: 0, children: [
|
|
25824
25874
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25825
25875
|
focused ? "\u203A " : " ",
|
|
25826
25876
|
"default:"
|
|
25827
25877
|
] }),
|
|
25828
|
-
/* @__PURE__ */
|
|
25878
|
+
/* @__PURE__ */ jsx33(Text26, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
|
|
25829
25879
|
] });
|
|
25830
25880
|
}
|
|
25831
25881
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
25832
|
-
return /* @__PURE__ */
|
|
25882
|
+
return /* @__PURE__ */ jsx33(DefaultValueRow, { display, active, focused });
|
|
25833
25883
|
}
|
|
25834
25884
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
25835
25885
|
if (active) {
|
|
25836
|
-
return /* @__PURE__ */ jsxs25(
|
|
25886
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "row", flexShrink: 0, children: [
|
|
25837
25887
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25838
25888
|
focused ? "\u203A " : " ",
|
|
25839
25889
|
"default:"
|
|
25840
25890
|
] }),
|
|
25841
|
-
/* @__PURE__ */ jsxs25(
|
|
25842
|
-
/* @__PURE__ */
|
|
25843
|
-
/* @__PURE__ */
|
|
25844
|
-
/* @__PURE__ */
|
|
25891
|
+
/* @__PURE__ */ jsxs25(Box24, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
25892
|
+
/* @__PURE__ */ jsx33(Text26, { children: value.slice(0, textCursor) }),
|
|
25893
|
+
/* @__PURE__ */ jsx33(Text26, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
25894
|
+
/* @__PURE__ */ jsx33(Text26, { children: value.slice(textCursor + 1) })
|
|
25845
25895
|
] })
|
|
25846
25896
|
] });
|
|
25847
25897
|
}
|
|
25848
|
-
return /* @__PURE__ */ jsxs25(
|
|
25898
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexShrink: 0, children: [
|
|
25849
25899
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25850
25900
|
focused ? "\u203A " : " ",
|
|
25851
25901
|
"default:"
|
|
25852
25902
|
] }),
|
|
25853
|
-
/* @__PURE__ */
|
|
25903
|
+
/* @__PURE__ */ jsx33(Text26, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
|
|
25854
25904
|
] });
|
|
25855
25905
|
}
|
|
25856
25906
|
function DescriptionField({
|
|
@@ -25865,20 +25915,20 @@ function DescriptionField({
|
|
|
25865
25915
|
paddingLeft = 2
|
|
25866
25916
|
}) {
|
|
25867
25917
|
if (compact) {
|
|
25868
|
-
return /* @__PURE__ */ jsxs25(
|
|
25918
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25869
25919
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25870
25920
|
focused ? "\u203A " : " ",
|
|
25871
25921
|
label
|
|
25872
25922
|
] }),
|
|
25873
|
-
/* @__PURE__ */
|
|
25923
|
+
/* @__PURE__ */ jsx33(Text26, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
25874
25924
|
] });
|
|
25875
25925
|
}
|
|
25876
|
-
return /* @__PURE__ */ jsxs25(
|
|
25926
|
+
return /* @__PURE__ */ jsxs25(Box24, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
25877
25927
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25878
25928
|
focused ? "\u203A " : " ",
|
|
25879
25929
|
label
|
|
25880
25930
|
] }),
|
|
25881
|
-
editing ? /* @__PURE__ */
|
|
25931
|
+
editing ? /* @__PURE__ */ jsx33(EditableDescription, { cursorVisible, value, textCursor }) : /* @__PURE__ */ jsx33(Text26, { wrap: "wrap", children: value || "\u2014" })
|
|
25882
25932
|
] });
|
|
25883
25933
|
}
|
|
25884
25934
|
function EditableDescription({
|
|
@@ -25888,7 +25938,7 @@ function EditableDescription({
|
|
|
25888
25938
|
}) {
|
|
25889
25939
|
return /* @__PURE__ */ jsxs25(Text26, { wrap: "wrap", children: [
|
|
25890
25940
|
value.slice(0, textCursor),
|
|
25891
|
-
/* @__PURE__ */
|
|
25941
|
+
/* @__PURE__ */ jsx33(Text26, { inverse: cursorVisible, children: value[textCursor] ?? " " }),
|
|
25892
25942
|
value.slice(textCursor + 1)
|
|
25893
25943
|
] });
|
|
25894
25944
|
}
|
|
@@ -25909,9 +25959,9 @@ function PropRow({
|
|
|
25909
25959
|
}) {
|
|
25910
25960
|
const descFocused = activeField === "description";
|
|
25911
25961
|
const descActive = editingField && descFocused;
|
|
25912
|
-
return /* @__PURE__ */ jsxs25(
|
|
25913
|
-
/* @__PURE__ */
|
|
25914
|
-
/* @__PURE__ */
|
|
25962
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
25963
|
+
/* @__PURE__ */ jsx33(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx33(RowLabel, { name: prop.name, selected }) }),
|
|
25964
|
+
/* @__PURE__ */ jsx33(
|
|
25915
25965
|
DescriptionField,
|
|
25916
25966
|
{
|
|
25917
25967
|
value: prop.description,
|
|
@@ -25924,8 +25974,8 @@ function PropRow({
|
|
|
25924
25974
|
paddingLeft: 0
|
|
25925
25975
|
}
|
|
25926
25976
|
),
|
|
25927
|
-
/* @__PURE__ */ jsxs25(
|
|
25928
|
-
/* @__PURE__ */
|
|
25977
|
+
/* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
25978
|
+
/* @__PURE__ */ jsx33(
|
|
25929
25979
|
RequiredField,
|
|
25930
25980
|
{
|
|
25931
25981
|
value: prop.required,
|
|
@@ -25934,10 +25984,10 @@ function PropRow({
|
|
|
25934
25984
|
activeField
|
|
25935
25985
|
}
|
|
25936
25986
|
),
|
|
25937
|
-
/* @__PURE__ */
|
|
25987
|
+
/* @__PURE__ */ jsx33(InlinePropField, { label: "type:", focused: activeField === "type", children: editingField && activeField === "type" ? /* @__PURE__ */ jsx33(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx33(Text26, { children: prop.type }) })
|
|
25938
25988
|
] }),
|
|
25939
|
-
prop.type === "token" && /* @__PURE__ */
|
|
25940
|
-
prop.type === "enum" && /* @__PURE__ */ jsxs25(
|
|
25989
|
+
prop.type === "token" && /* @__PURE__ */ jsx33(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx33(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx33(Text26, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
25990
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25941
25991
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
25942
25992
|
activeField === "values" ? "\u203A " : " ",
|
|
25943
25993
|
"values:"
|
|
@@ -25948,7 +25998,7 @@ function PropRow({
|
|
|
25948
25998
|
"]"
|
|
25949
25999
|
] })
|
|
25950
26000
|
] }),
|
|
25951
|
-
/* @__PURE__ */
|
|
26001
|
+
/* @__PURE__ */ jsx33(
|
|
25952
26002
|
DefaultSubRow,
|
|
25953
26003
|
{
|
|
25954
26004
|
prop,
|
|
@@ -25958,12 +26008,12 @@ function PropRow({
|
|
|
25958
26008
|
cursorVisible
|
|
25959
26009
|
}
|
|
25960
26010
|
),
|
|
25961
|
-
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(
|
|
26011
|
+
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25962
26012
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
25963
26013
|
activeField === "allowed" ? "\u203A " : " ",
|
|
25964
26014
|
"allowed:"
|
|
25965
26015
|
] }),
|
|
25966
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */
|
|
26016
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx33(Box24, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx33(Text26, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx33(
|
|
25967
26017
|
Text26,
|
|
25968
26018
|
{
|
|
25969
26019
|
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
@@ -25972,17 +26022,17 @@ function PropRow({
|
|
|
25972
26022
|
}
|
|
25973
26023
|
)
|
|
25974
26024
|
] }),
|
|
25975
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */
|
|
26025
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx33(Box24, { paddingLeft: 2, children: /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: (() => {
|
|
25976
26026
|
const max = Math.max(8, width - 8);
|
|
25977
26027
|
const text = `~ ${rationale}`;
|
|
25978
26028
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
25979
26029
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
25980
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(
|
|
25981
|
-
/* @__PURE__ */ jsxs25(
|
|
25982
|
-
/* @__PURE__ */
|
|
25983
|
-
activeField === "values" && /* @__PURE__ */
|
|
26030
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(Box24, { paddingLeft: 2, flexDirection: "column", children: [
|
|
26031
|
+
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
26032
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "values:" }),
|
|
26033
|
+
activeField === "values" && /* @__PURE__ */ jsx33(Text26, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
25984
26034
|
] }),
|
|
25985
|
-
/* @__PURE__ */
|
|
26035
|
+
/* @__PURE__ */ jsx33(
|
|
25986
26036
|
EditableValueList,
|
|
25987
26037
|
{
|
|
25988
26038
|
values: prop.values,
|
|
@@ -26012,9 +26062,9 @@ function SlotRow({
|
|
|
26012
26062
|
pickerCandidates,
|
|
26013
26063
|
pickerCursor
|
|
26014
26064
|
}) {
|
|
26015
|
-
return /* @__PURE__ */ jsxs25(
|
|
26016
|
-
/* @__PURE__ */
|
|
26017
|
-
/* @__PURE__ */
|
|
26065
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
26066
|
+
/* @__PURE__ */ jsx33(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx33(RowLabel, { name: slot.name, selected, trailing: false }) }),
|
|
26067
|
+
/* @__PURE__ */ jsx33(
|
|
26018
26068
|
DescriptionField,
|
|
26019
26069
|
{
|
|
26020
26070
|
value: slot.description,
|
|
@@ -26027,7 +26077,7 @@ function SlotRow({
|
|
|
26027
26077
|
paddingLeft: 0
|
|
26028
26078
|
}
|
|
26029
26079
|
),
|
|
26030
|
-
/* @__PURE__ */
|
|
26080
|
+
/* @__PURE__ */ jsx33(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx33(
|
|
26031
26081
|
RequiredField,
|
|
26032
26082
|
{
|
|
26033
26083
|
value: slot.required,
|
|
@@ -26036,7 +26086,7 @@ function SlotRow({
|
|
|
26036
26086
|
activeField
|
|
26037
26087
|
}
|
|
26038
26088
|
) }),
|
|
26039
|
-
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(
|
|
26089
|
+
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
26040
26090
|
/* @__PURE__ */ jsxs25(
|
|
26041
26091
|
Text26,
|
|
26042
26092
|
{
|
|
@@ -26048,10 +26098,10 @@ function SlotRow({
|
|
|
26048
26098
|
]
|
|
26049
26099
|
}
|
|
26050
26100
|
),
|
|
26051
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */
|
|
26101
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx33(Text26, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
26052
26102
|
] }),
|
|
26053
|
-
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(
|
|
26054
|
-
/* @__PURE__ */ jsxs25(
|
|
26103
|
+
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", children: [
|
|
26104
|
+
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
26055
26105
|
/* @__PURE__ */ jsxs25(
|
|
26056
26106
|
Text26,
|
|
26057
26107
|
{
|
|
@@ -26063,9 +26113,9 @@ function SlotRow({
|
|
|
26063
26113
|
]
|
|
26064
26114
|
}
|
|
26065
26115
|
),
|
|
26066
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */
|
|
26116
|
+
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx33(Text26, { 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" })
|
|
26067
26117
|
] }),
|
|
26068
|
-
/* @__PURE__ */
|
|
26118
|
+
/* @__PURE__ */ jsx33(
|
|
26069
26119
|
EditableValueList,
|
|
26070
26120
|
{
|
|
26071
26121
|
values: slot.allowedComponents,
|
|
@@ -26079,21 +26129,21 @@ function SlotRow({
|
|
|
26079
26129
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
26080
26130
|
}
|
|
26081
26131
|
),
|
|
26082
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */
|
|
26132
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx33(Box24, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
26083
26133
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
26084
26134
|
if (filtered.length === 0) {
|
|
26085
|
-
return /* @__PURE__ */
|
|
26135
|
+
return /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
26086
26136
|
}
|
|
26087
26137
|
const cursor = pickerCursor % filtered.length;
|
|
26088
26138
|
const MAX_VISIBLE = 5;
|
|
26089
26139
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
26090
26140
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
26091
|
-
return /* @__PURE__ */ jsxs25(
|
|
26092
|
-
/* @__PURE__ */
|
|
26141
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", children: [
|
|
26142
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
26093
26143
|
slice.map((name, i) => {
|
|
26094
26144
|
const absIdx = start + i;
|
|
26095
26145
|
const isCursor = absIdx === cursor;
|
|
26096
|
-
return /* @__PURE__ */
|
|
26146
|
+
return /* @__PURE__ */ jsx33(Text26, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${name}` : ` ${name}` }, name);
|
|
26097
26147
|
})
|
|
26098
26148
|
] });
|
|
26099
26149
|
})() })
|
|
@@ -26921,18 +26971,18 @@ function FieldEditor({
|
|
|
26921
26971
|
});
|
|
26922
26972
|
const innerWidth = Math.max(1, width - 2);
|
|
26923
26973
|
if (parseErr) {
|
|
26924
|
-
return /* @__PURE__ */ jsxs25(
|
|
26925
|
-
/* @__PURE__ */
|
|
26926
|
-
/* @__PURE__ */
|
|
26927
|
-
/* @__PURE__ */
|
|
26974
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
26975
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
26976
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.error, children: parseErr }),
|
|
26977
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
26928
26978
|
] });
|
|
26929
26979
|
}
|
|
26930
26980
|
if (props.length === 0 && slots.length === 0) {
|
|
26931
|
-
return /* @__PURE__ */ jsxs25(
|
|
26932
|
-
/* @__PURE__ */
|
|
26933
|
-
/* @__PURE__ */
|
|
26934
|
-
/* @__PURE__ */
|
|
26935
|
-
/* @__PURE__ */
|
|
26981
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
26982
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
26983
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
26984
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
26985
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
26936
26986
|
] });
|
|
26937
26987
|
}
|
|
26938
26988
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -27061,12 +27111,12 @@ function FieldEditor({
|
|
|
27061
27111
|
const renderRow = (row, index) => {
|
|
27062
27112
|
const key = rowKey(row, index);
|
|
27063
27113
|
if (row.kind === "header") {
|
|
27064
|
-
return /* @__PURE__ */
|
|
27114
|
+
return /* @__PURE__ */ jsx33(Box24, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
27065
27115
|
}
|
|
27066
27116
|
if (row.kind === "component-description") {
|
|
27067
27117
|
const isSelected2 = inComponentDesc && active;
|
|
27068
27118
|
const isEditing = isSelected2 && focusLevel === "field" && editingField && activeField === "description";
|
|
27069
|
-
return /* @__PURE__ */
|
|
27119
|
+
return /* @__PURE__ */ jsx33(
|
|
27070
27120
|
DescriptionField,
|
|
27071
27121
|
{
|
|
27072
27122
|
value: editorState.componentDescription,
|
|
@@ -27097,7 +27147,7 @@ function FieldEditor({
|
|
|
27097
27147
|
valueText,
|
|
27098
27148
|
innerWidth
|
|
27099
27149
|
);
|
|
27100
|
-
return /* @__PURE__ */
|
|
27150
|
+
return /* @__PURE__ */ jsx33(
|
|
27101
27151
|
PropRow,
|
|
27102
27152
|
{
|
|
27103
27153
|
prop: p,
|
|
@@ -27124,7 +27174,7 @@ function FieldEditor({
|
|
|
27124
27174
|
valueText,
|
|
27125
27175
|
innerWidth
|
|
27126
27176
|
);
|
|
27127
|
-
return /* @__PURE__ */
|
|
27177
|
+
return /* @__PURE__ */ jsx33(
|
|
27128
27178
|
SlotRow,
|
|
27129
27179
|
{
|
|
27130
27180
|
slot: s,
|
|
@@ -27145,9 +27195,9 @@ function FieldEditor({
|
|
|
27145
27195
|
borderStyle: "single",
|
|
27146
27196
|
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.accent : PALETTE.border,
|
|
27147
27197
|
children: [
|
|
27148
|
-
hasEmptyProperties && /* @__PURE__ */
|
|
27198
|
+
hasEmptyProperties && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
27149
27199
|
header,
|
|
27150
|
-
/* @__PURE__ */
|
|
27200
|
+
/* @__PURE__ */ jsx33(Box24, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx33(
|
|
27151
27201
|
PropRow,
|
|
27152
27202
|
{
|
|
27153
27203
|
prop: currentProp,
|
|
@@ -27163,7 +27213,7 @@ function FieldEditor({
|
|
|
27163
27213
|
rationale: metadata?.props?.[currentProp.name]?.rationale ?? null,
|
|
27164
27214
|
showRationale: showInlineRationales
|
|
27165
27215
|
}
|
|
27166
|
-
) : focusLevel === "field" && inSlots && currentSlot ? /* @__PURE__ */
|
|
27216
|
+
) : focusLevel === "field" && inSlots && currentSlot ? /* @__PURE__ */ jsx33(
|
|
27167
27217
|
SlotRow,
|
|
27168
27218
|
{
|
|
27169
27219
|
slot: currentSlot,
|
|
@@ -27182,8 +27232,8 @@ function FieldEditor({
|
|
|
27182
27232
|
) : visibleRowSlice.map((row, index) => {
|
|
27183
27233
|
const absoluteIndex = scrollStart + index;
|
|
27184
27234
|
const key = rowKey(row, absoluteIndex);
|
|
27185
|
-
return /* @__PURE__ */
|
|
27186
|
-
|
|
27235
|
+
return /* @__PURE__ */ jsx33(
|
|
27236
|
+
Box24,
|
|
27187
27237
|
{
|
|
27188
27238
|
ref: (node) => {
|
|
27189
27239
|
if (node) rowMeasureRefs.current.set(key, node);
|
|
@@ -27196,7 +27246,7 @@ function FieldEditor({
|
|
|
27196
27246
|
`visible-${key}`
|
|
27197
27247
|
);
|
|
27198
27248
|
}) }),
|
|
27199
|
-
categoryBelow && /* @__PURE__ */
|
|
27249
|
+
categoryBelow && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
27200
27250
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
27201
27251
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
27202
27252
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -27205,49 +27255,49 @@ function FieldEditor({
|
|
|
27205
27255
|
const src = metadata?.componentSource ?? null;
|
|
27206
27256
|
const headerPath = path5 ?? "<unknown source path>";
|
|
27207
27257
|
if (!start || !end2 || !src) {
|
|
27208
|
-
return /* @__PURE__ */ jsxs25(
|
|
27209
|
-
/* @__PURE__ */
|
|
27210
|
-
/* @__PURE__ */
|
|
27211
|
-
/* @__PURE__ */
|
|
27258
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27259
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
27260
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
27261
|
+
/* @__PURE__ */ jsx33(Text26, { children: "[s] close" })
|
|
27212
27262
|
] });
|
|
27213
27263
|
}
|
|
27214
27264
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
27215
|
-
return /* @__PURE__ */ jsxs25(
|
|
27216
|
-
/* @__PURE__ */
|
|
27217
|
-
lines.map((ln, i) => /* @__PURE__ */
|
|
27218
|
-
/* @__PURE__ */
|
|
27265
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27266
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
27267
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
27268
|
+
/* @__PURE__ */ jsx33(Text26, { children: "[s] close \xB7 [Esc] close" })
|
|
27219
27269
|
] });
|
|
27220
27270
|
})(),
|
|
27221
|
-
showHelp && /* @__PURE__ */ jsxs25(
|
|
27222
|
-
/* @__PURE__ */
|
|
27223
|
-
/* @__PURE__ */
|
|
27224
|
-
/* @__PURE__ */
|
|
27225
|
-
/* @__PURE__ */
|
|
27226
|
-
/* @__PURE__ */
|
|
27227
|
-
/* @__PURE__ */
|
|
27228
|
-
/* @__PURE__ */
|
|
27229
|
-
/* @__PURE__ */
|
|
27230
|
-
/* @__PURE__ */
|
|
27231
|
-
/* @__PURE__ */
|
|
27232
|
-
/* @__PURE__ */
|
|
27233
|
-
/* @__PURE__ */
|
|
27234
|
-
/* @__PURE__ */
|
|
27235
|
-
/* @__PURE__ */
|
|
27236
|
-
/* @__PURE__ */
|
|
27237
|
-
/* @__PURE__ */
|
|
27238
|
-
/* @__PURE__ */
|
|
27239
|
-
/* @__PURE__ */
|
|
27240
|
-
/* @__PURE__ */
|
|
27241
|
-
/* @__PURE__ */
|
|
27242
|
-
/* @__PURE__ */
|
|
27243
|
-
/* @__PURE__ */
|
|
27244
|
-
/* @__PURE__ */
|
|
27245
|
-
/* @__PURE__ */
|
|
27246
|
-
/* @__PURE__ */
|
|
27247
|
-
/* @__PURE__ */
|
|
27271
|
+
showHelp && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
27272
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
27273
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
27274
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Row navigation" }),
|
|
27275
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2191/\u2193 move between rows" }),
|
|
27276
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Enter edit fields on the current row" }),
|
|
27277
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Esc exit the panel" }),
|
|
27278
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
27279
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Field editing" }),
|
|
27280
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2191/\u2193/\u2190\u2192 cycle through fields" }),
|
|
27281
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2190/\u2192 cycle picker values \xB7 move cursor in text inputs" }),
|
|
27282
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Space/Enter toggle required" }),
|
|
27283
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Type edit description / string default" }),
|
|
27284
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Esc exit field-edit back to the row" }),
|
|
27285
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
27286
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Values / allowedComponents" }),
|
|
27287
|
+
/* @__PURE__ */ jsx33(Text26, { children: " a / e / r add \xB7 edit \xB7 remove" }),
|
|
27288
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2191\u2193 navigate the list" }),
|
|
27289
|
+
/* @__PURE__ */ jsx33(Text26, { children: " K / J reorder up \xB7 down" }),
|
|
27290
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
27291
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Panels" }),
|
|
27292
|
+
/* @__PURE__ */ jsx33(Text26, { children: " s toggle source-view for the current prop" }),
|
|
27293
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " + propRationaleKey.padEnd(16) + " toggle prop rationale panel" }),
|
|
27294
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
27295
|
+
/* @__PURE__ */ jsx33(Text26, { children: " ? toggle this overlay" }),
|
|
27296
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
27297
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
27248
27298
|
] }),
|
|
27249
|
-
validationError && /* @__PURE__ */
|
|
27250
|
-
/* @__PURE__ */
|
|
27299
|
+
validationError && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
27300
|
+
/* @__PURE__ */ jsx33(Box24, { paddingTop: 1, children: /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: modeLabel }) })
|
|
27251
27301
|
]
|
|
27252
27302
|
}
|
|
27253
27303
|
);
|
|
@@ -27304,23 +27354,23 @@ var init_wrap_text = __esm({
|
|
|
27304
27354
|
});
|
|
27305
27355
|
|
|
27306
27356
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx
|
|
27307
|
-
import { Box as
|
|
27308
|
-
import { jsx as
|
|
27357
|
+
import { Box as Box25, Text as Text27 } from "ink";
|
|
27358
|
+
import { jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
27309
27359
|
function RationaleLine({ line, active }) {
|
|
27310
27360
|
if (line.kind === "blank") {
|
|
27311
|
-
return /* @__PURE__ */
|
|
27361
|
+
return /* @__PURE__ */ jsx34(Box25, { children: /* @__PURE__ */ jsx34(Text27, { children: " " }) });
|
|
27312
27362
|
}
|
|
27313
27363
|
if (line.kind === "heading") {
|
|
27314
|
-
return /* @__PURE__ */
|
|
27364
|
+
return /* @__PURE__ */ jsx34(Box25, { children: /* @__PURE__ */ jsx34(Text27, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
27315
27365
|
}
|
|
27316
27366
|
if (line.kind === "label") {
|
|
27317
|
-
return /* @__PURE__ */ jsxs26(
|
|
27318
|
-
line.prefix && /* @__PURE__ */
|
|
27319
|
-
/* @__PURE__ */
|
|
27320
|
-
line.suffix && /* @__PURE__ */
|
|
27367
|
+
return /* @__PURE__ */ jsxs26(Box25, { children: [
|
|
27368
|
+
line.prefix && /* @__PURE__ */ jsx34(Text27, { children: line.prefix }),
|
|
27369
|
+
/* @__PURE__ */ jsx34(Text27, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
27370
|
+
line.suffix && /* @__PURE__ */ jsx34(Text27, { color: PALETTE.muted, children: line.suffix })
|
|
27321
27371
|
] });
|
|
27322
27372
|
}
|
|
27323
|
-
return /* @__PURE__ */
|
|
27373
|
+
return /* @__PURE__ */ jsx34(Box25, { children: /* @__PURE__ */ jsx34(Text27, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
27324
27374
|
}
|
|
27325
27375
|
var init_RationaleLine = __esm({
|
|
27326
27376
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx"() {
|
|
@@ -27330,8 +27380,8 @@ var init_RationaleLine = __esm({
|
|
|
27330
27380
|
});
|
|
27331
27381
|
|
|
27332
27382
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
27333
|
-
import { Box as
|
|
27334
|
-
import { jsx as
|
|
27383
|
+
import { Box as Box26, Text as Text28 } from "ink";
|
|
27384
|
+
import { jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
27335
27385
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
27336
27386
|
const out = [];
|
|
27337
27387
|
const pushSection = (heading, body) => {
|
|
@@ -27399,7 +27449,7 @@ function ComponentRationalePanel({
|
|
|
27399
27449
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
27400
27450
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
27401
27451
|
return /* @__PURE__ */ jsxs27(
|
|
27402
|
-
|
|
27452
|
+
Box26,
|
|
27403
27453
|
{
|
|
27404
27454
|
flexDirection: "column",
|
|
27405
27455
|
width,
|
|
@@ -27407,9 +27457,9 @@ function ComponentRationalePanel({
|
|
|
27407
27457
|
borderStyle: "single",
|
|
27408
27458
|
borderColor: active ? PALETTE.text : void 0,
|
|
27409
27459
|
children: [
|
|
27410
|
-
/* @__PURE__ */
|
|
27411
|
-
visible.map((line, i) => /* @__PURE__ */
|
|
27412
|
-
/* @__PURE__ */
|
|
27460
|
+
/* @__PURE__ */ jsx35(Box26, { children: /* @__PURE__ */ jsx35(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
27461
|
+
visible.map((line, i) => /* @__PURE__ */ jsx35(RationaleLine, { line, active }, i)),
|
|
27462
|
+
/* @__PURE__ */ jsx35(Box26, { children: overflowed ? /* @__PURE__ */ jsx35(Text28, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx35(Text28, { children: "[I/Esc] close" }) })
|
|
27413
27463
|
]
|
|
27414
27464
|
}
|
|
27415
27465
|
);
|
|
@@ -27427,9 +27477,9 @@ var init_ComponentRationalePanel = __esm({
|
|
|
27427
27477
|
|
|
27428
27478
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/HighlightedLine.tsx
|
|
27429
27479
|
import { Text as Text29 } from "ink";
|
|
27430
|
-
import { Fragment as
|
|
27480
|
+
import { Fragment as Fragment9, jsx as jsx36 } from "react/jsx-runtime";
|
|
27431
27481
|
function HighlightedLine({ parts }) {
|
|
27432
|
-
return /* @__PURE__ */
|
|
27482
|
+
return /* @__PURE__ */ jsx36(Fragment9, { children: parts.map((part, i) => /* @__PURE__ */ jsx36(Text29, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
|
|
27433
27483
|
}
|
|
27434
27484
|
var init_HighlightedLine = __esm({
|
|
27435
27485
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/HighlightedLine.tsx"() {
|
|
@@ -27439,8 +27489,8 @@ var init_HighlightedLine = __esm({
|
|
|
27439
27489
|
});
|
|
27440
27490
|
|
|
27441
27491
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
27442
|
-
import { Box as
|
|
27443
|
-
import { Fragment as
|
|
27492
|
+
import { Box as Box27, Text as Text30 } from "ink";
|
|
27493
|
+
import { Fragment as Fragment10, jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
27444
27494
|
function ScrollablePanel({
|
|
27445
27495
|
title,
|
|
27446
27496
|
width,
|
|
@@ -27453,12 +27503,12 @@ function ScrollablePanel({
|
|
|
27453
27503
|
children
|
|
27454
27504
|
}) {
|
|
27455
27505
|
const overflowed = totalLines > height;
|
|
27456
|
-
return /* @__PURE__ */ jsxs28(
|
|
27457
|
-
/* @__PURE__ */ jsxs28(
|
|
27458
|
-
/* @__PURE__ */
|
|
27459
|
-
overflowed && /* @__PURE__ */ jsxs28(
|
|
27460
|
-
/* @__PURE__ */
|
|
27461
|
-
/* @__PURE__ */
|
|
27506
|
+
return /* @__PURE__ */ jsxs28(Box27, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
27507
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
27508
|
+
/* @__PURE__ */ jsx37(Text30, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
27509
|
+
overflowed && /* @__PURE__ */ jsxs28(Fragment10, { children: [
|
|
27510
|
+
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
27511
|
+
/* @__PURE__ */ jsx37(Text30, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
27462
27512
|
] })
|
|
27463
27513
|
] }),
|
|
27464
27514
|
children
|
|
@@ -27472,8 +27522,8 @@ var init_ScrollablePanel = __esm({
|
|
|
27472
27522
|
});
|
|
27473
27523
|
|
|
27474
27524
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/JsonPanel.tsx
|
|
27475
|
-
import { Box as
|
|
27476
|
-
import { jsx as
|
|
27525
|
+
import { Box as Box28 } from "ink";
|
|
27526
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
27477
27527
|
function highlightJson(line) {
|
|
27478
27528
|
const parts = [];
|
|
27479
27529
|
let remaining = line;
|
|
@@ -27511,7 +27561,7 @@ function highlightJson(line) {
|
|
|
27511
27561
|
parts.push({ text: remaining[0] });
|
|
27512
27562
|
remaining = remaining.slice(1);
|
|
27513
27563
|
}
|
|
27514
|
-
return /* @__PURE__ */
|
|
27564
|
+
return /* @__PURE__ */ jsx38(HighlightedLine, { parts });
|
|
27515
27565
|
}
|
|
27516
27566
|
function truncateLine(line, maxWidth) {
|
|
27517
27567
|
if (line.length <= maxWidth) return line;
|
|
@@ -27524,7 +27574,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
27524
27574
|
const totalLines = allLines.length;
|
|
27525
27575
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
27526
27576
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
27527
|
-
return /* @__PURE__ */
|
|
27577
|
+
return /* @__PURE__ */ jsx38(
|
|
27528
27578
|
ScrollablePanel,
|
|
27529
27579
|
{
|
|
27530
27580
|
title: label,
|
|
@@ -27537,7 +27587,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
27537
27587
|
borderColor: active ? "white" : void 0,
|
|
27538
27588
|
children: visibleLines.map((line, i) => {
|
|
27539
27589
|
const truncated = truncateLine(line, innerWidth);
|
|
27540
|
-
return /* @__PURE__ */
|
|
27590
|
+
return /* @__PURE__ */ jsx38(Box28, { children: highlightJson(truncated) }, i);
|
|
27541
27591
|
})
|
|
27542
27592
|
}
|
|
27543
27593
|
);
|
|
@@ -27551,7 +27601,7 @@ var init_JsonPanel = __esm({
|
|
|
27551
27601
|
});
|
|
27552
27602
|
|
|
27553
27603
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationalePanel.tsx
|
|
27554
|
-
import { jsx as
|
|
27604
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
27555
27605
|
function renderRationaleLines(rows, innerWidth) {
|
|
27556
27606
|
const out = [];
|
|
27557
27607
|
rows.forEach((row, idx) => {
|
|
@@ -27584,7 +27634,7 @@ function RationalePanel({
|
|
|
27584
27634
|
const visible = allLines.slice(scrollOffset, scrollOffset + height);
|
|
27585
27635
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
27586
27636
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
27587
|
-
return /* @__PURE__ */
|
|
27637
|
+
return /* @__PURE__ */ jsx39(
|
|
27588
27638
|
ScrollablePanel,
|
|
27589
27639
|
{
|
|
27590
27640
|
title: `RATIONALE \u2014 ${componentName}`,
|
|
@@ -27595,7 +27645,7 @@ function RationalePanel({
|
|
|
27595
27645
|
visibleStart,
|
|
27596
27646
|
visibleEnd,
|
|
27597
27647
|
borderColor: active ? PALETTE.text : void 0,
|
|
27598
|
-
children: visible.map((line, i) => /* @__PURE__ */
|
|
27648
|
+
children: visible.map((line, i) => /* @__PURE__ */ jsx39(RationaleLine, { line, active }, i))
|
|
27599
27649
|
}
|
|
27600
27650
|
);
|
|
27601
27651
|
}
|
|
@@ -27611,8 +27661,8 @@ var init_RationalePanel = __esm({
|
|
|
27611
27661
|
|
|
27612
27662
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx
|
|
27613
27663
|
import figures7 from "figures";
|
|
27614
|
-
import { Box as
|
|
27615
|
-
import { jsx as
|
|
27664
|
+
import { Box as Box29, Text as Text31 } from "ink";
|
|
27665
|
+
import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
27616
27666
|
function TokenReviewPanel({
|
|
27617
27667
|
componentName,
|
|
27618
27668
|
suggestions,
|
|
@@ -27632,7 +27682,7 @@ function TokenReviewPanel({
|
|
|
27632
27682
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
27633
27683
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
27634
27684
|
return /* @__PURE__ */ jsxs29(
|
|
27635
|
-
|
|
27685
|
+
Box29,
|
|
27636
27686
|
{
|
|
27637
27687
|
flexDirection: "column",
|
|
27638
27688
|
width,
|
|
@@ -27640,15 +27690,15 @@ function TokenReviewPanel({
|
|
|
27640
27690
|
borderStyle: "single",
|
|
27641
27691
|
borderColor: active ? PALETTE.text : void 0,
|
|
27642
27692
|
children: [
|
|
27643
|
-
/* @__PURE__ */
|
|
27644
|
-
/* @__PURE__ */
|
|
27645
|
-
/* @__PURE__ */
|
|
27646
|
-
current.paths.length === 0 && /* @__PURE__ */
|
|
27693
|
+
/* @__PURE__ */ jsx40(Text31, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
27694
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
27695
|
+
/* @__PURE__ */ jsx40(Text31, { children: " " }),
|
|
27696
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
27647
27697
|
visiblePaths.map((path5, i) => {
|
|
27648
27698
|
const pathIndex = scrollStart + i;
|
|
27649
27699
|
const checked = editSelection.has(path5);
|
|
27650
27700
|
const focused = pathIndex === editCursor;
|
|
27651
|
-
return /* @__PURE__ */
|
|
27701
|
+
return /* @__PURE__ */ jsx40(Box29, { children: /* @__PURE__ */ jsx40(
|
|
27652
27702
|
Text31,
|
|
27653
27703
|
{
|
|
27654
27704
|
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
@@ -27658,15 +27708,15 @@ function TokenReviewPanel({
|
|
|
27658
27708
|
}
|
|
27659
27709
|
) }, path5);
|
|
27660
27710
|
}),
|
|
27661
|
-
/* @__PURE__ */
|
|
27662
|
-
/* @__PURE__ */
|
|
27663
|
-
/* @__PURE__ */
|
|
27711
|
+
/* @__PURE__ */ jsx40(Text31, { children: " " }),
|
|
27712
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
27713
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
27664
27714
|
]
|
|
27665
27715
|
}
|
|
27666
27716
|
);
|
|
27667
27717
|
}
|
|
27668
27718
|
return /* @__PURE__ */ jsxs29(
|
|
27669
|
-
|
|
27719
|
+
Box29,
|
|
27670
27720
|
{
|
|
27671
27721
|
flexDirection: "column",
|
|
27672
27722
|
width,
|
|
@@ -27674,18 +27724,18 @@ function TokenReviewPanel({
|
|
|
27674
27724
|
borderStyle: "single",
|
|
27675
27725
|
borderColor: active ? PALETTE.text : void 0,
|
|
27676
27726
|
children: [
|
|
27677
|
-
/* @__PURE__ */
|
|
27678
|
-
suggestions.length === 0 && /* @__PURE__ */
|
|
27727
|
+
/* @__PURE__ */ jsx40(Text31, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
27728
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
27679
27729
|
suggestions.map((s, i) => {
|
|
27680
27730
|
const focused = i === selectedRow;
|
|
27681
|
-
return /* @__PURE__ */ jsxs29(
|
|
27682
|
-
/* @__PURE__ */
|
|
27683
|
-
/* @__PURE__ */
|
|
27684
|
-
/* @__PURE__ */
|
|
27731
|
+
return /* @__PURE__ */ jsxs29(Box29, { flexDirection: "column", children: [
|
|
27732
|
+
/* @__PURE__ */ jsx40(Box29, { children: /* @__PURE__ */ jsx40(Text31, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
|
|
27733
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
27734
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
27685
27735
|
] }, s.propName);
|
|
27686
27736
|
}),
|
|
27687
|
-
/* @__PURE__ */
|
|
27688
|
-
/* @__PURE__ */
|
|
27737
|
+
/* @__PURE__ */ jsx40(Text31, { children: " " }),
|
|
27738
|
+
/* @__PURE__ */ jsx40(Text31, { children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
|
|
27689
27739
|
]
|
|
27690
27740
|
}
|
|
27691
27741
|
);
|
|
@@ -27699,7 +27749,7 @@ var init_TokenReviewPanel = __esm({
|
|
|
27699
27749
|
|
|
27700
27750
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-details-panel.tsx
|
|
27701
27751
|
import { Text as Text32 } from "ink";
|
|
27702
|
-
import { Fragment as
|
|
27752
|
+
import { Fragment as Fragment11, jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
27703
27753
|
function ReviewDetailsPanel({
|
|
27704
27754
|
selectedKey,
|
|
27705
27755
|
panelOpen,
|
|
@@ -27734,7 +27784,7 @@ function ReviewDetailsPanel({
|
|
|
27734
27784
|
rationale: s.rationale ?? ""
|
|
27735
27785
|
}))
|
|
27736
27786
|
];
|
|
27737
|
-
return /* @__PURE__ */
|
|
27787
|
+
return /* @__PURE__ */ jsx41(
|
|
27738
27788
|
RationalePanel,
|
|
27739
27789
|
{
|
|
27740
27790
|
componentName: componentRationale?.name ?? selectedKey,
|
|
@@ -27747,7 +27797,7 @@ function ReviewDetailsPanel({
|
|
|
27747
27797
|
);
|
|
27748
27798
|
}
|
|
27749
27799
|
if (panelOpen === "component-rationale") {
|
|
27750
|
-
return /* @__PURE__ */
|
|
27800
|
+
return /* @__PURE__ */ jsx41(
|
|
27751
27801
|
ComponentRationalePanel,
|
|
27752
27802
|
{
|
|
27753
27803
|
data: componentRationale ?? {
|
|
@@ -27773,13 +27823,13 @@ function ReviewDetailsPanel({
|
|
|
27773
27823
|
const sourceLineCount = Math.max(1, height - 4);
|
|
27774
27824
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
27775
27825
|
return /* @__PURE__ */ jsxs30(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
27776
|
-
/* @__PURE__ */
|
|
27777
|
-
source ? lines.map((line, index) => /* @__PURE__ */
|
|
27778
|
-
/* @__PURE__ */
|
|
27826
|
+
/* @__PURE__ */ jsx41(Text32, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
27827
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx41(Text32, { color: PALETTE.muted, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx41(Text32, { color: PALETTE.muted, children: "(no source captured)" }),
|
|
27828
|
+
/* @__PURE__ */ jsx41(Text32, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
27779
27829
|
] });
|
|
27780
27830
|
}
|
|
27781
27831
|
if (panelOpen === "token-review") {
|
|
27782
|
-
return /* @__PURE__ */
|
|
27832
|
+
return /* @__PURE__ */ jsx41(
|
|
27783
27833
|
TokenReviewPanel,
|
|
27784
27834
|
{
|
|
27785
27835
|
componentName: selectedKey,
|
|
@@ -27795,7 +27845,7 @@ function ReviewDetailsPanel({
|
|
|
27795
27845
|
);
|
|
27796
27846
|
}
|
|
27797
27847
|
if (showJson) {
|
|
27798
|
-
return /* @__PURE__ */
|
|
27848
|
+
return /* @__PURE__ */ jsx41(
|
|
27799
27849
|
JsonPanel,
|
|
27800
27850
|
{
|
|
27801
27851
|
label: "GENERATED DEFINITION (read-only)",
|
|
@@ -27807,7 +27857,7 @@ function ReviewDetailsPanel({
|
|
|
27807
27857
|
}
|
|
27808
27858
|
);
|
|
27809
27859
|
}
|
|
27810
|
-
return /* @__PURE__ */
|
|
27860
|
+
return /* @__PURE__ */ jsx41(Fragment11, { children: editor });
|
|
27811
27861
|
}
|
|
27812
27862
|
var init_review_details_panel = __esm({
|
|
27813
27863
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/review-details-panel.tsx"() {
|
|
@@ -27822,7 +27872,7 @@ var init_review_details_panel = __esm({
|
|
|
27822
27872
|
});
|
|
27823
27873
|
|
|
27824
27874
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDetailsEditor.tsx
|
|
27825
|
-
import { jsx as
|
|
27875
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
27826
27876
|
import { createElement } from "react";
|
|
27827
27877
|
function toFieldEditorMetadata(reviewMetadata) {
|
|
27828
27878
|
if (!reviewMetadata) return void 0;
|
|
@@ -27856,7 +27906,7 @@ function ReviewDetailsEditor({
|
|
|
27856
27906
|
jsonScrollOffset,
|
|
27857
27907
|
currentTokenSuggestions
|
|
27858
27908
|
} = reviewEditor;
|
|
27859
|
-
return /* @__PURE__ */
|
|
27909
|
+
return /* @__PURE__ */ jsx42(
|
|
27860
27910
|
ReviewDetailsPanel,
|
|
27861
27911
|
{
|
|
27862
27912
|
selectedKey,
|
|
@@ -27903,8 +27953,8 @@ var init_ReviewDetailsEditor = __esm({
|
|
|
27903
27953
|
});
|
|
27904
27954
|
|
|
27905
27955
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx
|
|
27906
|
-
import { Box as
|
|
27907
|
-
import { Fragment as
|
|
27956
|
+
import { Box as Box30, Text as Text33 } from "ink";
|
|
27957
|
+
import { Fragment as Fragment12, jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
27908
27958
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
27909
27959
|
return {
|
|
27910
27960
|
value: reviewEditor.draftValue || selectedJson,
|
|
@@ -27944,17 +27994,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
27944
27994
|
hidden
|
|
27945
27995
|
}) {
|
|
27946
27996
|
if (hidden || count === 0) return null;
|
|
27947
|
-
return /* @__PURE__ */
|
|
27997
|
+
return /* @__PURE__ */ jsx43(Text33, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
27948
27998
|
}
|
|
27949
27999
|
function ReviewNoSelection() {
|
|
27950
|
-
return /* @__PURE__ */
|
|
28000
|
+
return /* @__PURE__ */ jsx43(Box30, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx43(Text33, { color: PALETTE.muted, children: "No component selected" }) });
|
|
27951
28001
|
}
|
|
27952
28002
|
function ReviewFinalizeError({
|
|
27953
28003
|
message,
|
|
27954
28004
|
hidden
|
|
27955
28005
|
}) {
|
|
27956
28006
|
if (hidden || !message) return null;
|
|
27957
|
-
return /* @__PURE__ */
|
|
28007
|
+
return /* @__PURE__ */ jsx43(Text33, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
27958
28008
|
}
|
|
27959
28009
|
function ReviewPanelFooter({
|
|
27960
28010
|
reviewEditor,
|
|
@@ -27963,10 +28013,10 @@ function ReviewPanelFooter({
|
|
|
27963
28013
|
livePreview,
|
|
27964
28014
|
livePreviewSpinner
|
|
27965
28015
|
}) {
|
|
27966
|
-
return /* @__PURE__ */ jsxs31(
|
|
28016
|
+
return /* @__PURE__ */ jsxs31(Fragment12, { children: [
|
|
27967
28017
|
reviewEditor.panelOpen === "token-review" ? " [\u2191/\u2193] move [Enter] edit allowed [Esc] close" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [\u2191\u2193] scroll [Ctrl+u/d] half-page [gg/G] top/bottom [Tab] focus list" : " [Tab] focus list (edit fields)" + (reviewEditor.currentTokenSuggestions().length > 0 ? " [t] token review" : ""),
|
|
27968
|
-
livePreview.status === "running" && /* @__PURE__ */
|
|
27969
|
-
livePreview.disabled && /* @__PURE__ */
|
|
28018
|
+
livePreview.status === "running" && /* @__PURE__ */ jsx43(Text33, { children: ` ${livePreviewSpinner} live preview` }),
|
|
28019
|
+
livePreview.disabled && /* @__PURE__ */ jsx43(Text33, { children: " \xB7 live preview disabled" })
|
|
27970
28020
|
] });
|
|
27971
28021
|
}
|
|
27972
28022
|
function ReviewComponentTitle({
|
|
@@ -27975,9 +28025,9 @@ function ReviewComponentTitle({
|
|
|
27975
28025
|
slotCount,
|
|
27976
28026
|
sidebarFocused
|
|
27977
28027
|
}) {
|
|
27978
|
-
return /* @__PURE__ */ jsxs31(
|
|
27979
|
-
/* @__PURE__ */
|
|
27980
|
-
/* @__PURE__ */
|
|
28028
|
+
return /* @__PURE__ */ jsxs31(Box30, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
28029
|
+
/* @__PURE__ */ jsx43(Text33, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
28030
|
+
/* @__PURE__ */ jsx43(Box30, { flexGrow: 1 }),
|
|
27981
28031
|
/* @__PURE__ */ jsxs31(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
27982
28032
|
propCount,
|
|
27983
28033
|
" prop",
|
|
@@ -28009,8 +28059,8 @@ function ReviewComponentPanel({
|
|
|
28009
28059
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
28010
28060
|
const contentHeight = Math.max(1, height - 2);
|
|
28011
28061
|
const contentWidth = Math.max(1, width - 1);
|
|
28012
|
-
return /* @__PURE__ */
|
|
28013
|
-
/* @__PURE__ */
|
|
28062
|
+
return /* @__PURE__ */ jsx43(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs31(Box30, { flexDirection: "column", width: contentWidth, height, flexShrink: 0, overflowY: "hidden", children: [
|
|
28063
|
+
/* @__PURE__ */ jsx43(Box30, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx43(
|
|
28014
28064
|
ReviewDetailsEditor,
|
|
28015
28065
|
{
|
|
28016
28066
|
selectedKey,
|
|
@@ -28023,7 +28073,7 @@ function ReviewComponentPanel({
|
|
|
28023
28073
|
jsonValue,
|
|
28024
28074
|
sidebarFocused,
|
|
28025
28075
|
fieldEditor,
|
|
28026
|
-
header: /* @__PURE__ */
|
|
28076
|
+
header: /* @__PURE__ */ jsx43(
|
|
28027
28077
|
ReviewComponentTitle,
|
|
28028
28078
|
{
|
|
28029
28079
|
selectedKey,
|
|
@@ -28034,8 +28084,8 @@ function ReviewComponentPanel({
|
|
|
28034
28084
|
)
|
|
28035
28085
|
}
|
|
28036
28086
|
) }),
|
|
28037
|
-
/* @__PURE__ */
|
|
28038
|
-
/* @__PURE__ */
|
|
28087
|
+
/* @__PURE__ */ jsx43(Box30, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx43(Text33, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
28088
|
+
/* @__PURE__ */ jsx43(Box30, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx43(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx43(
|
|
28039
28089
|
ReviewPanelFooter,
|
|
28040
28090
|
{
|
|
28041
28091
|
reviewEditor,
|
|
@@ -28058,8 +28108,8 @@ var init_ReviewComponentPanel = __esm({
|
|
|
28058
28108
|
});
|
|
28059
28109
|
|
|
28060
28110
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx
|
|
28061
|
-
import { Box as
|
|
28062
|
-
import { jsx as
|
|
28111
|
+
import { Box as Box31, Text as Text34 } from "ink";
|
|
28112
|
+
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
28063
28113
|
function countReviewStatuses(entries) {
|
|
28064
28114
|
return entries.reduce(
|
|
28065
28115
|
(counts, entry) => {
|
|
@@ -28072,13 +28122,13 @@ function countReviewStatuses(entries) {
|
|
|
28072
28122
|
);
|
|
28073
28123
|
}
|
|
28074
28124
|
function ReviewLoadingState() {
|
|
28075
|
-
return /* @__PURE__ */
|
|
28125
|
+
return /* @__PURE__ */ jsx44(Box31, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx44(Text34, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
28076
28126
|
}
|
|
28077
28127
|
function ReviewLoadError({ message }) {
|
|
28078
|
-
return /* @__PURE__ */ jsxs32(
|
|
28079
|
-
/* @__PURE__ */
|
|
28080
|
-
/* @__PURE__ */
|
|
28081
|
-
/* @__PURE__ */
|
|
28128
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28129
|
+
/* @__PURE__ */ jsx44(Text34, { color: PALETTE.error, children: message }),
|
|
28130
|
+
/* @__PURE__ */ jsx44(Text34, { children: " " }),
|
|
28131
|
+
/* @__PURE__ */ jsx44(ControlHints, { hints: [{ keys: "q / Enter / Esc", label: "Quit" }] })
|
|
28082
28132
|
] });
|
|
28083
28133
|
}
|
|
28084
28134
|
var init_ReviewStatus = __esm({
|
|
@@ -28302,8 +28352,8 @@ var init_run_live_preview = __esm({
|
|
|
28302
28352
|
});
|
|
28303
28353
|
|
|
28304
28354
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx
|
|
28305
|
-
import { Box as
|
|
28306
|
-
import { Fragment as
|
|
28355
|
+
import { Box as Box32, Text as Text35 } from "ink";
|
|
28356
|
+
import { Fragment as Fragment13, jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
28307
28357
|
function FinalizeDialog({
|
|
28308
28358
|
accepted,
|
|
28309
28359
|
rejected,
|
|
@@ -28331,51 +28381,51 @@ function FinalizeDialog({
|
|
|
28331
28381
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
28332
28382
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
28333
28383
|
const hasMoreAbove = offset > 0;
|
|
28334
|
-
return /* @__PURE__ */
|
|
28335
|
-
/* @__PURE__ */
|
|
28336
|
-
/* @__PURE__ */
|
|
28384
|
+
return /* @__PURE__ */ jsx45(Box32, { width: "100%", paddingX: 2, children: /* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", alignItems: "flex-start", children: [
|
|
28385
|
+
/* @__PURE__ */ jsx45(Text35, { bold: true, children: "Finalize" }),
|
|
28386
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " }),
|
|
28337
28387
|
/* @__PURE__ */ jsxs33(Text35, { children: [
|
|
28338
28388
|
/* @__PURE__ */ jsxs33(Text35, { color: PALETTE.success, children: [
|
|
28339
28389
|
accepted,
|
|
28340
28390
|
" accepted"
|
|
28341
28391
|
] }),
|
|
28342
|
-
/* @__PURE__ */
|
|
28392
|
+
/* @__PURE__ */ jsx45(Text35, { children: " \xB7 " }),
|
|
28343
28393
|
/* @__PURE__ */ jsxs33(Text35, { color: PALETTE.error, children: [
|
|
28344
28394
|
rejected,
|
|
28345
28395
|
" rejected"
|
|
28346
28396
|
] }),
|
|
28347
|
-
/* @__PURE__ */
|
|
28397
|
+
/* @__PURE__ */ jsx45(Text35, { children: " \xB7 " }),
|
|
28348
28398
|
/* @__PURE__ */ jsxs33(Text35, { color: PALETTE.muted, children: [
|
|
28349
28399
|
needsReview,
|
|
28350
28400
|
" unresolved"
|
|
28351
28401
|
] })
|
|
28352
28402
|
] }),
|
|
28353
|
-
/* @__PURE__ */
|
|
28354
|
-
noneAccepted && /* @__PURE__ */ jsxs33(
|
|
28355
|
-
/* @__PURE__ */
|
|
28356
|
-
/* @__PURE__ */
|
|
28357
|
-
/* @__PURE__ */
|
|
28403
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " }),
|
|
28404
|
+
noneAccepted && /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
28405
|
+
/* @__PURE__ */ jsx45(Text35, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
28406
|
+
/* @__PURE__ */ jsx45(Text35, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
28407
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
28358
28408
|
] }),
|
|
28359
|
-
!allResolved && /* @__PURE__ */ jsxs33(
|
|
28360
|
-
/* @__PURE__ */
|
|
28361
|
-
/* @__PURE__ */
|
|
28362
|
-
/* @__PURE__ */
|
|
28409
|
+
!allResolved && /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
28410
|
+
/* @__PURE__ */ jsx45(Text35, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
28411
|
+
/* @__PURE__ */ jsx45(Text35, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
28412
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
28363
28413
|
] }),
|
|
28364
|
-
/* @__PURE__ */ jsxs33(
|
|
28365
|
-
previewStatus === "running" ? /* @__PURE__ */
|
|
28366
|
-
/* @__PURE__ */
|
|
28414
|
+
/* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", height: 2, children: [
|
|
28415
|
+
previewStatus === "running" ? /* @__PURE__ */ jsx45(Text35, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx45(Text35, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx45(Text35, { children: " " }),
|
|
28416
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
28367
28417
|
] }),
|
|
28368
|
-
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs33(
|
|
28369
|
-
/* @__PURE__ */
|
|
28370
|
-
hasMoreAbove && /* @__PURE__ */
|
|
28371
|
-
windowed.map((rc) => /* @__PURE__ */
|
|
28372
|
-
hasMoreBelow && /* @__PURE__ */
|
|
28373
|
-
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */
|
|
28374
|
-
/* @__PURE__ */
|
|
28418
|
+
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
28419
|
+
/* @__PURE__ */ jsx45(Text35, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
28420
|
+
hasMoreAbove && /* @__PURE__ */ jsx45(Text35, { color: PALETTE.muted, children: "\u2191 more above" }),
|
|
28421
|
+
windowed.map((rc) => /* @__PURE__ */ jsx45(Text35, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
28422
|
+
hasMoreBelow && /* @__PURE__ */ jsx45(Text35, { color: PALETTE.muted, children: "\u2193 more below" }),
|
|
28423
|
+
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx45(Text35, { children: "[\u2191\u2193] scroll deletions" }),
|
|
28424
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
28375
28425
|
] }),
|
|
28376
|
-
/* @__PURE__ */
|
|
28377
|
-
/* @__PURE__ */
|
|
28378
|
-
/* @__PURE__ */
|
|
28426
|
+
/* @__PURE__ */ jsx45(Text35, { children: noneAccepted ? "Confirm exit with nothing accepted?" : allResolved ? "Save decisions and exit? All components resolved." : "Save decisions and exit?" }),
|
|
28427
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " }),
|
|
28428
|
+
/* @__PURE__ */ jsx45(
|
|
28379
28429
|
ControlHints,
|
|
28380
28430
|
{
|
|
28381
28431
|
hints: [
|
|
@@ -28832,8 +28882,8 @@ var init_use_review_surface_state = __esm({
|
|
|
28832
28882
|
});
|
|
28833
28883
|
|
|
28834
28884
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/QuitDialog.tsx
|
|
28835
|
-
import { Box as
|
|
28836
|
-
import { Fragment as
|
|
28885
|
+
import { Box as Box33, Text as Text36 } from "ink";
|
|
28886
|
+
import { Fragment as Fragment14, jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
28837
28887
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
28838
28888
|
useImmediateInput((input, key) => {
|
|
28839
28889
|
if (input === "y" || key.return) {
|
|
@@ -28842,16 +28892,16 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
28842
28892
|
onCancel();
|
|
28843
28893
|
}
|
|
28844
28894
|
});
|
|
28845
|
-
return /* @__PURE__ */ jsxs34(
|
|
28846
|
-
/* @__PURE__ */
|
|
28847
|
-
/* @__PURE__ */
|
|
28848
|
-
hasUnsavedDrafts ? /* @__PURE__ */ jsxs34(
|
|
28849
|
-
/* @__PURE__ */
|
|
28850
|
-
/* @__PURE__ */
|
|
28851
|
-
/* @__PURE__ */
|
|
28852
|
-
] }) : /* @__PURE__ */
|
|
28853
|
-
/* @__PURE__ */
|
|
28854
|
-
/* @__PURE__ */
|
|
28895
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
28896
|
+
/* @__PURE__ */ jsx46(Text36, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
28897
|
+
/* @__PURE__ */ jsx46(Text36, { children: " " }),
|
|
28898
|
+
hasUnsavedDrafts ? /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
28899
|
+
/* @__PURE__ */ jsx46(Text36, { children: "You have unsaved draft edits." }),
|
|
28900
|
+
/* @__PURE__ */ jsx46(Text36, { children: "Session state is preserved \u2014 you can resume" }),
|
|
28901
|
+
/* @__PURE__ */ jsx46(Text36, { children: "by running the same review command again." })
|
|
28902
|
+
] }) : /* @__PURE__ */ jsx46(Text36, { children: "Session is saved. Quit without finalizing?" }),
|
|
28903
|
+
/* @__PURE__ */ jsx46(Text36, { children: " " }),
|
|
28904
|
+
/* @__PURE__ */ jsx46(
|
|
28855
28905
|
ControlHints,
|
|
28856
28906
|
{
|
|
28857
28907
|
hints: [
|
|
@@ -28871,8 +28921,8 @@ var init_QuitDialog = __esm({
|
|
|
28871
28921
|
});
|
|
28872
28922
|
|
|
28873
28923
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx
|
|
28874
|
-
import { Box as
|
|
28875
|
-
import { Fragment as
|
|
28924
|
+
import { Box as Box34, Text as Text37 } from "ink";
|
|
28925
|
+
import { Fragment as Fragment15, jsx as jsx47, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
28876
28926
|
function ReviewFinalizeDialogs({
|
|
28877
28927
|
showFinalize,
|
|
28878
28928
|
showQuit,
|
|
@@ -28886,8 +28936,8 @@ function ReviewFinalizeDialogs({
|
|
|
28886
28936
|
onQuitCancel
|
|
28887
28937
|
}) {
|
|
28888
28938
|
const { accepted, rejected, needsReview } = countReviewStatuses(components);
|
|
28889
|
-
return /* @__PURE__ */ jsxs35(
|
|
28890
|
-
showFinalize && /* @__PURE__ */
|
|
28939
|
+
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
28940
|
+
showFinalize && /* @__PURE__ */ jsx47(
|
|
28891
28941
|
FinalizeDialog,
|
|
28892
28942
|
{
|
|
28893
28943
|
accepted,
|
|
@@ -28900,7 +28950,7 @@ function ReviewFinalizeDialogs({
|
|
|
28900
28950
|
onCancel: onFinalizeCancel
|
|
28901
28951
|
}
|
|
28902
28952
|
),
|
|
28903
|
-
showQuit && /* @__PURE__ */
|
|
28953
|
+
showQuit && /* @__PURE__ */ jsx47(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
|
|
28904
28954
|
] });
|
|
28905
28955
|
}
|
|
28906
28956
|
function ReviewStepDialogs({
|
|
@@ -28910,7 +28960,7 @@ function ReviewStepDialogs({
|
|
|
28910
28960
|
onFinalize,
|
|
28911
28961
|
onQuit
|
|
28912
28962
|
}) {
|
|
28913
|
-
return /* @__PURE__ */
|
|
28963
|
+
return /* @__PURE__ */ jsx47(
|
|
28914
28964
|
ReviewFinalizeDialogs,
|
|
28915
28965
|
{
|
|
28916
28966
|
showFinalize: surfaceState.showFinalize,
|
|
@@ -28928,12 +28978,12 @@ function ReviewStepDialogs({
|
|
|
28928
28978
|
}
|
|
28929
28979
|
function ReviewReloadDialog({ open }) {
|
|
28930
28980
|
if (!open) return null;
|
|
28931
|
-
return /* @__PURE__ */ jsxs35(
|
|
28932
|
-
/* @__PURE__ */
|
|
28933
|
-
/* @__PURE__ */
|
|
28934
|
-
/* @__PURE__ */
|
|
28935
|
-
/* @__PURE__ */
|
|
28936
|
-
/* @__PURE__ */
|
|
28981
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
28982
|
+
/* @__PURE__ */ jsx47(Text37, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
28983
|
+
/* @__PURE__ */ jsx47(Text37, { children: "Unsaved in-memory changes will be lost." }),
|
|
28984
|
+
/* @__PURE__ */ jsx47(Text37, { children: " " }),
|
|
28985
|
+
/* @__PURE__ */ jsx47(Text37, { children: " [Enter] Confirm" }),
|
|
28986
|
+
/* @__PURE__ */ jsx47(Text37, { children: " [Esc] Cancel" })
|
|
28937
28987
|
] });
|
|
28938
28988
|
}
|
|
28939
28989
|
var init_ReviewDialogs = __esm({
|
|
@@ -29335,8 +29385,8 @@ var init_use_review_preview = __esm({
|
|
|
29335
29385
|
});
|
|
29336
29386
|
|
|
29337
29387
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx
|
|
29338
|
-
import { Box as
|
|
29339
|
-
import { jsx as
|
|
29388
|
+
import { Box as Box35, Text as Text38 } from "ink";
|
|
29389
|
+
import { jsx as jsx48, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
29340
29390
|
function LivePreviewSummary({
|
|
29341
29391
|
enabled,
|
|
29342
29392
|
previewAnnotations,
|
|
@@ -29350,19 +29400,19 @@ function LivePreviewSummary({
|
|
|
29350
29400
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
29351
29401
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
29352
29402
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
29353
|
-
if (disabled) return /* @__PURE__ */
|
|
29354
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */
|
|
29403
|
+
if (disabled) return /* @__PURE__ */ jsx48(Text38, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
29404
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx48(Text38, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
29355
29405
|
if (!hasCounts) return null;
|
|
29356
|
-
return /* @__PURE__ */ jsxs36(
|
|
29357
|
-
/* @__PURE__ */
|
|
29358
|
-
/* @__PURE__ */
|
|
29359
|
-
/* @__PURE__ */
|
|
29360
|
-
/* @__PURE__ */
|
|
29361
|
-
/* @__PURE__ */
|
|
29362
|
-
/* @__PURE__ */
|
|
29363
|
-
showRemovedListHint && removedCount > 0 && /* @__PURE__ */
|
|
29364
|
-
/* @__PURE__ */
|
|
29365
|
-
/* @__PURE__ */
|
|
29406
|
+
return /* @__PURE__ */ jsxs36(Box35, { children: [
|
|
29407
|
+
/* @__PURE__ */ jsx48(Text38, { children: "Preview: " }),
|
|
29408
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
29409
|
+
/* @__PURE__ */ jsx48(Text38, { children: " \xB7 " }),
|
|
29410
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
29411
|
+
/* @__PURE__ */ jsx48(Text38, { children: " \xB7 " }),
|
|
29412
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.muted, children: `${counts.removed} removed` }),
|
|
29413
|
+
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx48(Text38, { children: " ([d] removed list)" }),
|
|
29414
|
+
/* @__PURE__ */ jsx48(Text38, { children: " \xB7 " }),
|
|
29415
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
29366
29416
|
] });
|
|
29367
29417
|
}
|
|
29368
29418
|
var init_LivePreviewSummary = __esm({
|
|
@@ -29375,8 +29425,8 @@ var init_LivePreviewSummary = __esm({
|
|
|
29375
29425
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
29376
29426
|
import { useCallback as useCallback5, useEffect as useEffect17, useMemo as useMemo4, useRef as useRef13, useState as useState25 } from "react";
|
|
29377
29427
|
import figures8 from "figures";
|
|
29378
|
-
import { Box as
|
|
29379
|
-
import { Fragment as
|
|
29428
|
+
import { Box as Box36, Text as Text39 } from "ink";
|
|
29429
|
+
import { Fragment as Fragment16, jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
29380
29430
|
function sortComponentsForSidebar(components, cycleParticipants) {
|
|
29381
29431
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
29382
29432
|
const tier = (c2) => {
|
|
@@ -29420,7 +29470,7 @@ function CyclePathLine({
|
|
|
29420
29470
|
return /* @__PURE__ */ jsxs37(Text39, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
29421
29471
|
prefix,
|
|
29422
29472
|
segments.map(
|
|
29423
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */
|
|
29473
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx49(Text39, { color: PALETTE.accent, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: segment.text }, index) : /* @__PURE__ */ jsx49(Text39, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
|
|
29424
29474
|
)
|
|
29425
29475
|
] });
|
|
29426
29476
|
}
|
|
@@ -29432,31 +29482,31 @@ function CycleDetailPanel({
|
|
|
29432
29482
|
height
|
|
29433
29483
|
}) {
|
|
29434
29484
|
const lines = [
|
|
29435
|
-
/* @__PURE__ */
|
|
29436
|
-
/* @__PURE__ */
|
|
29437
|
-
/* @__PURE__ */
|
|
29438
|
-
/* @__PURE__ */
|
|
29485
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
29486
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
29487
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
29488
|
+
/* @__PURE__ */ jsx49(Text39, { children: " " }, "cyc-space")
|
|
29439
29489
|
];
|
|
29440
29490
|
cycles.forEach((cycle, index) => {
|
|
29441
29491
|
const nodeCount = new Set(cycle.path).size;
|
|
29442
29492
|
const isCursor = index === cursor;
|
|
29443
29493
|
lines.push(
|
|
29444
|
-
/* @__PURE__ */
|
|
29445
|
-
/* @__PURE__ */
|
|
29494
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, inverse: isCursor, children: `${isCursor ? figures8.pointer : " "} Cycle ${index + 1} (${nodeCount} component${nodeCount === 1 ? "" : "s"}):` }, `cyc-h-${index}`),
|
|
29495
|
+
/* @__PURE__ */ jsx49(CyclePathLine, { segments: formatCyclePathSegments2(cycle, 16), prefix: " " }, `cyc-p-${index}`)
|
|
29446
29496
|
);
|
|
29447
29497
|
if (cycle.suggestedBreak) {
|
|
29448
29498
|
lines.push(
|
|
29449
|
-
/* @__PURE__ */
|
|
29499
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
29450
29500
|
);
|
|
29451
29501
|
}
|
|
29452
|
-
lines.push(/* @__PURE__ */
|
|
29502
|
+
lines.push(/* @__PURE__ */ jsx49(Text39, { children: " " }, `cyc-s-${index}`));
|
|
29453
29503
|
});
|
|
29454
29504
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
29455
29505
|
const viewportHeight = Math.max(1, height - 3);
|
|
29456
29506
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
29457
29507
|
return /* @__PURE__ */ jsxs37(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
29458
29508
|
visible,
|
|
29459
|
-
/* @__PURE__ */
|
|
29509
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: footer })
|
|
29460
29510
|
] });
|
|
29461
29511
|
}
|
|
29462
29512
|
function BreakCyclePanel({
|
|
@@ -29468,13 +29518,13 @@ function BreakCyclePanel({
|
|
|
29468
29518
|
height
|
|
29469
29519
|
}) {
|
|
29470
29520
|
return /* @__PURE__ */ jsxs37(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
29471
|
-
/* @__PURE__ */
|
|
29472
|
-
cycle && /* @__PURE__ */
|
|
29473
|
-
/* @__PURE__ */
|
|
29474
|
-
/* @__PURE__ */
|
|
29475
|
-
edges.length > 0 && /* @__PURE__ */
|
|
29476
|
-
edges.map((edge, index) => /* @__PURE__ */
|
|
29477
|
-
confirming ? /* @__PURE__ */
|
|
29521
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
29522
|
+
cycle && /* @__PURE__ */ jsx49(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
29523
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
29524
|
+
/* @__PURE__ */ jsx49(Text39, { children: " " }),
|
|
29525
|
+
edges.length > 0 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: "remove slot edge:" }),
|
|
29526
|
+
edges.map((edge, index) => /* @__PURE__ */ jsx49(Text39, { inverse: index === cursor, children: `${index === cursor ? figures8.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `${edge.fromComponent}-${edge.slotName}-${edge.toComponent}`)),
|
|
29527
|
+
confirming ? /* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx49(Text39, { children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
|
|
29478
29528
|
] });
|
|
29479
29529
|
}
|
|
29480
29530
|
function buildBreakingRows(breakingChanges) {
|
|
@@ -29520,9 +29570,9 @@ function deriveBreakingChanges(response) {
|
|
|
29520
29570
|
}
|
|
29521
29571
|
function GenerateReviewStep(props) {
|
|
29522
29572
|
if (!props.extractSessionId) {
|
|
29523
|
-
return /* @__PURE__ */
|
|
29573
|
+
return /* @__PURE__ */ jsx49(Box36, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx49(Text39, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
29524
29574
|
}
|
|
29525
|
-
return /* @__PURE__ */
|
|
29575
|
+
return /* @__PURE__ */ jsx49(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
29526
29576
|
}
|
|
29527
29577
|
function GenerateReviewStepView({
|
|
29528
29578
|
extractSessionId,
|
|
@@ -30379,13 +30429,13 @@ function GenerateReviewStepView({
|
|
|
30379
30429
|
}
|
|
30380
30430
|
});
|
|
30381
30431
|
if (loading) {
|
|
30382
|
-
return /* @__PURE__ */
|
|
30432
|
+
return /* @__PURE__ */ jsx49(ReviewLoadingState, {});
|
|
30383
30433
|
}
|
|
30384
30434
|
if (loadError) {
|
|
30385
|
-
return /* @__PURE__ */
|
|
30435
|
+
return /* @__PURE__ */ jsx49(ReviewLoadError, { message: loadError });
|
|
30386
30436
|
}
|
|
30387
30437
|
if (showHelp) {
|
|
30388
|
-
return /* @__PURE__ */
|
|
30438
|
+
return /* @__PURE__ */ jsx49(HelpOverlay, { sections: HELP_SECTIONS2, handleInput: false, onClose: () => setShowHelp(false) });
|
|
30389
30439
|
}
|
|
30390
30440
|
const { selected, selectedJson, visibleJsonPanelValue } = getReviewSelectionState(
|
|
30391
30441
|
components,
|
|
@@ -30425,9 +30475,9 @@ function GenerateReviewStepView({
|
|
|
30425
30475
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
30426
30476
|
return false;
|
|
30427
30477
|
})();
|
|
30428
|
-
return /* @__PURE__ */ jsxs37(
|
|
30429
|
-
/* @__PURE__ */
|
|
30430
|
-
/* @__PURE__ */
|
|
30478
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30479
|
+
/* @__PURE__ */ jsx49(StepHeader, { step: "review" }),
|
|
30480
|
+
/* @__PURE__ */ jsx49(
|
|
30431
30481
|
ReviewStepDialogs,
|
|
30432
30482
|
{
|
|
30433
30483
|
surfaceState: reviewSurface,
|
|
@@ -30437,15 +30487,15 @@ function GenerateReviewStepView({
|
|
|
30437
30487
|
onQuit
|
|
30438
30488
|
}
|
|
30439
30489
|
),
|
|
30440
|
-
/* @__PURE__ */
|
|
30441
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(
|
|
30442
|
-
/* @__PURE__ */
|
|
30443
|
-
!removedBannerCollapsed && /* @__PURE__ */ jsxs37(
|
|
30444
|
-
/* @__PURE__ */
|
|
30445
|
-
removedComponents.map((rc) => /* @__PURE__ */
|
|
30490
|
+
/* @__PURE__ */ jsx49(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
30491
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
30492
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
30493
|
+
!removedBannerCollapsed && /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
30494
|
+
/* @__PURE__ */ jsx49(Text39, { children: " " }),
|
|
30495
|
+
removedComponents.map((rc) => /* @__PURE__ */ jsx49(Text39, { children: removedComponentLine(rc) }, rc.id))
|
|
30446
30496
|
] })
|
|
30447
30497
|
] }),
|
|
30448
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
30498
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx49(Box36, { paddingX: 1, children: /* @__PURE__ */ jsx49(
|
|
30449
30499
|
Text39,
|
|
30450
30500
|
{
|
|
30451
30501
|
color: PALETTE.warning,
|
|
@@ -30456,14 +30506,14 @@ function GenerateReviewStepView({
|
|
|
30456
30506
|
const row = breakingRows[breakingCursor];
|
|
30457
30507
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
30458
30508
|
if (!comp) return null;
|
|
30459
|
-
return /* @__PURE__ */ jsxs37(
|
|
30460
|
-
/* @__PURE__ */
|
|
30461
|
-
comp.impact && /* @__PURE__ */
|
|
30462
|
-
comp.changes.length === 0 ? /* @__PURE__ */
|
|
30463
|
-
/* @__PURE__ */
|
|
30509
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
30510
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
30511
|
+
comp.impact && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
30512
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx49(Text39, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
30513
|
+
/* @__PURE__ */ jsx49(Text39, { children: "[D/Esc] close detail" })
|
|
30464
30514
|
] });
|
|
30465
30515
|
})(),
|
|
30466
|
-
!dialogOpen && /* @__PURE__ */
|
|
30516
|
+
!dialogOpen && /* @__PURE__ */ jsx49(
|
|
30467
30517
|
LivePreviewSummary,
|
|
30468
30518
|
{
|
|
30469
30519
|
enabled: livePreview,
|
|
@@ -30482,16 +30532,16 @@ function GenerateReviewStepView({
|
|
|
30482
30532
|
const participantSet = cycleView.structural;
|
|
30483
30533
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
30484
30534
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
30485
|
-
return /* @__PURE__ */ jsxs37(
|
|
30486
|
-
/* @__PURE__ */
|
|
30487
|
-
members.length > 0 && /* @__PURE__ */
|
|
30488
|
-
ancestors.length > 0 && /* @__PURE__ */
|
|
30489
|
-
/* @__PURE__ */
|
|
30535
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
30536
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
30537
|
+
members.length > 0 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
30538
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
30539
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
30490
30540
|
] });
|
|
30491
30541
|
})(),
|
|
30492
|
-
/* @__PURE__ */
|
|
30493
|
-
/* @__PURE__ */
|
|
30494
|
-
!dialogOpen && breakPanel.isOpen && /* @__PURE__ */
|
|
30542
|
+
/* @__PURE__ */ jsx49(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
30543
|
+
/* @__PURE__ */ jsx49(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
|
|
30544
|
+
!dialogOpen && breakPanel.isOpen && /* @__PURE__ */ jsx49(
|
|
30495
30545
|
BreakCyclePanel,
|
|
30496
30546
|
{
|
|
30497
30547
|
cycle: cycleRows[cyclesCursor],
|
|
@@ -30502,7 +30552,7 @@ function GenerateReviewStepView({
|
|
|
30502
30552
|
height: panelHeight
|
|
30503
30553
|
}
|
|
30504
30554
|
),
|
|
30505
|
-
!dialogOpen && cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */
|
|
30555
|
+
!dialogOpen && cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsx49(
|
|
30506
30556
|
CycleDetailPanel,
|
|
30507
30557
|
{
|
|
30508
30558
|
cycles: cycleRows,
|
|
@@ -30512,8 +30562,8 @@ function GenerateReviewStepView({
|
|
|
30512
30562
|
height: panelHeight
|
|
30513
30563
|
}
|
|
30514
30564
|
),
|
|
30515
|
-
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
30516
|
-
breakingPanel.isOpen ? /* @__PURE__ */
|
|
30565
|
+
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box36, { children: [
|
|
30566
|
+
breakingPanel.isOpen ? /* @__PURE__ */ jsx49(
|
|
30517
30567
|
GotoBanner,
|
|
30518
30568
|
{
|
|
30519
30569
|
title: `Breaking changes \u2014 ${breakingRows[breakingCursor]?.componentName ?? "unknown component"}`,
|
|
@@ -30526,7 +30576,7 @@ function GenerateReviewStepView({
|
|
|
30526
30576
|
width: sidebarWidth,
|
|
30527
30577
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
|
|
30528
30578
|
}
|
|
30529
|
-
) : /* @__PURE__ */
|
|
30579
|
+
) : /* @__PURE__ */ jsx49(
|
|
30530
30580
|
GroupedSidebar,
|
|
30531
30581
|
{
|
|
30532
30582
|
items: groupedItems,
|
|
@@ -30567,7 +30617,7 @@ function GenerateReviewStepView({
|
|
|
30567
30617
|
graph: sidebarGraph
|
|
30568
30618
|
}
|
|
30569
30619
|
),
|
|
30570
|
-
selected ? /* @__PURE__ */
|
|
30620
|
+
selected ? /* @__PURE__ */ jsx49(
|
|
30571
30621
|
ReviewComponentPanel,
|
|
30572
30622
|
{
|
|
30573
30623
|
selectedKey: selected.key,
|
|
@@ -30599,12 +30649,12 @@ function GenerateReviewStepView({
|
|
|
30599
30649
|
livePreview: livePreviewHook,
|
|
30600
30650
|
livePreviewSpinner
|
|
30601
30651
|
}
|
|
30602
|
-
) : /* @__PURE__ */
|
|
30652
|
+
) : /* @__PURE__ */ jsx49(ReviewNoSelection, {})
|
|
30603
30653
|
] }),
|
|
30604
|
-
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
30605
|
-
/* @__PURE__ */
|
|
30654
|
+
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30655
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
30606
30656
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
30607
|
-
return /* @__PURE__ */
|
|
30657
|
+
return /* @__PURE__ */ jsx49(
|
|
30608
30658
|
CyclePathLine,
|
|
30609
30659
|
{
|
|
30610
30660
|
segments: formatCyclePathSegments2(cycle),
|
|
@@ -30615,10 +30665,10 @@ function GenerateReviewStepView({
|
|
|
30615
30665
|
`cyc-banner-${idx}`
|
|
30616
30666
|
);
|
|
30617
30667
|
}),
|
|
30618
|
-
cycleRows.length > 3 && /* @__PURE__ */
|
|
30619
|
-
/* @__PURE__ */
|
|
30668
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
30669
|
+
/* @__PURE__ */ jsx49(Text39, { children: " press [c] for detail" })
|
|
30620
30670
|
] }),
|
|
30621
|
-
/* @__PURE__ */
|
|
30671
|
+
/* @__PURE__ */ jsx49(
|
|
30622
30672
|
SearchMatchSummary,
|
|
30623
30673
|
{
|
|
30624
30674
|
open: searchOpen,
|
|
@@ -30629,7 +30679,7 @@ function GenerateReviewStepView({
|
|
|
30629
30679
|
hidden: dialogOpen
|
|
30630
30680
|
}
|
|
30631
30681
|
),
|
|
30632
|
-
!dialogOpen && sidebarFocused && /* @__PURE__ */
|
|
30682
|
+
!dialogOpen && sidebarFocused && /* @__PURE__ */ jsx49(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
|
|
30633
30683
|
] });
|
|
30634
30684
|
}
|
|
30635
30685
|
var HELP_SECTIONS2;
|
|
@@ -30745,17 +30795,17 @@ var init_generate_review_step = __esm({
|
|
|
30745
30795
|
});
|
|
30746
30796
|
|
|
30747
30797
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
|
|
30748
|
-
import { Box as
|
|
30749
|
-
import { jsx as
|
|
30798
|
+
import { Box as Box37, Text as Text40 } from "ink";
|
|
30799
|
+
import { jsx as jsx50, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
30750
30800
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
30751
30801
|
if (!generatePromptPath) return null;
|
|
30752
|
-
return /* @__PURE__ */ jsxs38(
|
|
30753
|
-
/* @__PURE__ */
|
|
30802
|
+
return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
30803
|
+
/* @__PURE__ */ jsx50(Text40, { color: PALETTE.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
30754
30804
|
generatePromptPath ? /* @__PURE__ */ jsxs38(Text40, { color: PALETTE.warning, children: [
|
|
30755
30805
|
"components: ",
|
|
30756
30806
|
generatePromptPath
|
|
30757
30807
|
] }) : null,
|
|
30758
|
-
/* @__PURE__ */
|
|
30808
|
+
/* @__PURE__ */ jsx50(Text40, { color: PALETTE.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
30759
30809
|
] });
|
|
30760
30810
|
}
|
|
30761
30811
|
var init_CustomPromptBanner = __esm({
|
|
@@ -30784,15 +30834,15 @@ var init_contentful_urls2 = __esm({
|
|
|
30784
30834
|
});
|
|
30785
30835
|
|
|
30786
30836
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/SpaceEnvironment.tsx
|
|
30787
|
-
import { Box as
|
|
30788
|
-
import { jsx as
|
|
30837
|
+
import { Box as Box38, Text as Text41 } from "ink";
|
|
30838
|
+
import { jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
30789
30839
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
30790
|
-
return /* @__PURE__ */ jsxs39(
|
|
30791
|
-
/* @__PURE__ */
|
|
30792
|
-
/* @__PURE__ */
|
|
30793
|
-
/* @__PURE__ */
|
|
30794
|
-
/* @__PURE__ */
|
|
30795
|
-
/* @__PURE__ */
|
|
30840
|
+
return /* @__PURE__ */ jsxs39(Box38, { gap: 1, marginTop: 1, children: [
|
|
30841
|
+
/* @__PURE__ */ jsx51(Text41, { color: PALETTE.muted, children: "Space:" }),
|
|
30842
|
+
/* @__PURE__ */ jsx51(Text41, { children: spaceId }),
|
|
30843
|
+
/* @__PURE__ */ jsx51(Text41, { color: PALETTE.muted, children: "/" }),
|
|
30844
|
+
/* @__PURE__ */ jsx51(Text41, { color: PALETTE.muted, children: "Environment:" }),
|
|
30845
|
+
/* @__PURE__ */ jsx51(Text41, { children: environmentId })
|
|
30796
30846
|
] });
|
|
30797
30847
|
}
|
|
30798
30848
|
var init_SpaceEnvironment = __esm({
|
|
@@ -30803,13 +30853,13 @@ var init_SpaceEnvironment = __esm({
|
|
|
30803
30853
|
});
|
|
30804
30854
|
|
|
30805
30855
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/DoneStep.tsx
|
|
30806
|
-
import { Box as
|
|
30807
|
-
import { Fragment as
|
|
30856
|
+
import { Box as Box39, Text as Text42 } from "ink";
|
|
30857
|
+
import { Fragment as Fragment17, jsx as jsx52, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
30808
30858
|
function EntityRows({ entity, label }) {
|
|
30809
30859
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
30810
|
-
return /* @__PURE__ */ jsxs40(
|
|
30860
|
+
return /* @__PURE__ */ jsxs40(Fragment17, { children: [
|
|
30811
30861
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs40(Text42, { children: [
|
|
30812
|
-
/* @__PURE__ */
|
|
30862
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.success, children: "\u2713" }),
|
|
30813
30863
|
" ",
|
|
30814
30864
|
plural3(entity[action]),
|
|
30815
30865
|
" ",
|
|
@@ -30823,9 +30873,9 @@ function EntityRows({ entity, label }) {
|
|
|
30823
30873
|
] });
|
|
30824
30874
|
}
|
|
30825
30875
|
function LinkRow({ title, url }) {
|
|
30826
|
-
return /* @__PURE__ */ jsxs40(
|
|
30827
|
-
/* @__PURE__ */
|
|
30828
|
-
/* @__PURE__ */
|
|
30876
|
+
return /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", children: [
|
|
30877
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.muted, children: title }),
|
|
30878
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.accent, children: url })
|
|
30829
30879
|
] });
|
|
30830
30880
|
}
|
|
30831
30881
|
function DoneStep({
|
|
@@ -30849,14 +30899,14 @@ function DoneStep({
|
|
|
30849
30899
|
const totalPushed = componentTypes.created + componentTypes.updated + componentTypes.removed + designTokens.created + designTokens.updated + designTokens.removed;
|
|
30850
30900
|
const success = totalFailed === 0;
|
|
30851
30901
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
30852
|
-
return /* @__PURE__ */ jsxs40(
|
|
30853
|
-
/* @__PURE__ */
|
|
30854
|
-
/* @__PURE__ */ jsxs40(
|
|
30855
|
-
success ? /* @__PURE__ */
|
|
30856
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */
|
|
30857
|
-
/* @__PURE__ */
|
|
30858
|
-
/* @__PURE__ */
|
|
30859
|
-
summary && /* @__PURE__ */
|
|
30902
|
+
return /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", children: [
|
|
30903
|
+
/* @__PURE__ */ jsx52(StepHeader, { step: "done" }),
|
|
30904
|
+
/* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
30905
|
+
success ? /* @__PURE__ */ jsx52(Text42, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx52(Text42, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
30906
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx52(Text42, { color: PALETTE.muted, children: credentialsSkipped ? "Nothing was pushed \u2014 you skipped the Contentful credentials, so the files were only saved locally." : "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", children: [
|
|
30907
|
+
/* @__PURE__ */ jsx52(EntityRows, { entity: componentTypes, label: "Component" }),
|
|
30908
|
+
/* @__PURE__ */ jsx52(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
30909
|
+
summary && /* @__PURE__ */ jsx52(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
|
|
30860
30910
|
"Push result: ",
|
|
30861
30911
|
summary.succeeded,
|
|
30862
30912
|
"/",
|
|
@@ -30869,8 +30919,8 @@ function DoneStep({
|
|
|
30869
30919
|
] })
|
|
30870
30920
|
] }) })
|
|
30871
30921
|
] }),
|
|
30872
|
-
failures.length > 0 && /* @__PURE__ */ jsxs40(
|
|
30873
|
-
/* @__PURE__ */
|
|
30922
|
+
failures.length > 0 && /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", children: [
|
|
30923
|
+
/* @__PURE__ */ jsx52(Text42, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
30874
30924
|
failures.map((failure) => /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.error, children: [
|
|
30875
30925
|
failure.entityType,
|
|
30876
30926
|
" ",
|
|
@@ -30879,11 +30929,11 @@ function DoneStep({
|
|
|
30879
30929
|
failure.message
|
|
30880
30930
|
] }, `${failure.entityType}:${failure.entityId}`))
|
|
30881
30931
|
] }),
|
|
30882
|
-
/* @__PURE__ */
|
|
30883
|
-
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(
|
|
30884
|
-
/* @__PURE__ */
|
|
30885
|
-
produced.components && /* @__PURE__ */
|
|
30886
|
-
produced.tokens && /* @__PURE__ */
|
|
30932
|
+
/* @__PURE__ */ jsx52(SpaceEnvironment, { spaceId, environmentId }),
|
|
30933
|
+
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", gap: 1, children: [
|
|
30934
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
30935
|
+
produced.components && /* @__PURE__ */ jsx52(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
30936
|
+
produced.tokens && /* @__PURE__ */ jsx52(
|
|
30887
30937
|
LinkRow,
|
|
30888
30938
|
{
|
|
30889
30939
|
title: "View your design tokens here:",
|
|
@@ -30891,7 +30941,7 @@ function DoneStep({
|
|
|
30891
30941
|
}
|
|
30892
30942
|
)
|
|
30893
30943
|
] }),
|
|
30894
|
-
/* @__PURE__ */
|
|
30944
|
+
/* @__PURE__ */ jsx52(ControlHints, { hints: [{ keys: "Enter / q", label: "Exit" }] })
|
|
30895
30945
|
] })
|
|
30896
30946
|
] });
|
|
30897
30947
|
}
|
|
@@ -30950,10 +31000,10 @@ var init_use_blinking_cursor = __esm({
|
|
|
30950
31000
|
|
|
30951
31001
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PathPrompt.tsx
|
|
30952
31002
|
import { useState as useState27 } from "react";
|
|
30953
|
-
import { Box as
|
|
31003
|
+
import { Box as Box40, Text as Text43 } from "ink";
|
|
30954
31004
|
import { readdirSync as readdirSync3 } from "node:fs";
|
|
30955
31005
|
import { dirname as dirname16, basename as basename6, join as join21 } from "node:path";
|
|
30956
|
-
import { jsx as
|
|
31006
|
+
import { jsx as jsx53, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
30957
31007
|
function autocomplete(partial) {
|
|
30958
31008
|
if (!partial) return null;
|
|
30959
31009
|
const normalized = normalizePath(partial);
|
|
@@ -31010,19 +31060,19 @@ function PathPrompt({
|
|
|
31010
31060
|
const shown = input || defaultPath;
|
|
31011
31061
|
const isPlaceholder = input === "";
|
|
31012
31062
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
31013
|
-
return /* @__PURE__ */ jsxs41(
|
|
31014
|
-
/* @__PURE__ */
|
|
31015
|
-
/* @__PURE__ */ jsxs41(
|
|
31016
|
-
/* @__PURE__ */ jsxs41(
|
|
31017
|
-
/* @__PURE__ */
|
|
31063
|
+
return /* @__PURE__ */ jsxs41(Box40, { flexDirection: "column", children: [
|
|
31064
|
+
/* @__PURE__ */ jsx53(StepHeader, { step: "push" }),
|
|
31065
|
+
/* @__PURE__ */ jsxs41(Box40, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
31066
|
+
/* @__PURE__ */ jsxs41(Box40, { gap: 1, children: [
|
|
31067
|
+
/* @__PURE__ */ jsx53(Text43, { color: PALETTE.accent, children: "?" }),
|
|
31018
31068
|
/* @__PURE__ */ jsxs41(Text43, { bold: true, children: [
|
|
31019
31069
|
label,
|
|
31020
31070
|
":"
|
|
31021
31071
|
] }),
|
|
31022
|
-
/* @__PURE__ */
|
|
31023
|
-
/* @__PURE__ */
|
|
31072
|
+
/* @__PURE__ */ jsx53(Text43, { color: isPlaceholder ? PALETTE.muted : void 0, children: shown }),
|
|
31073
|
+
/* @__PURE__ */ jsx53(Text43, { children: cursor })
|
|
31024
31074
|
] }),
|
|
31025
|
-
/* @__PURE__ */
|
|
31075
|
+
/* @__PURE__ */ jsx53(
|
|
31026
31076
|
ControlHints,
|
|
31027
31077
|
{
|
|
31028
31078
|
hints: [
|
|
@@ -31067,7 +31117,7 @@ var init_produced = __esm({
|
|
|
31067
31117
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
31068
31118
|
import { useEffect as useEffect19, useState as useState28 } from "react";
|
|
31069
31119
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
31070
|
-
import { jsx as
|
|
31120
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
31071
31121
|
function useTimedSpinner() {
|
|
31072
31122
|
const [elapsedSeconds, setElapsedSeconds] = useState28(0);
|
|
31073
31123
|
useEffect19(() => {
|
|
@@ -31079,7 +31129,7 @@ function useTimedSpinner() {
|
|
|
31079
31129
|
const mins = Math.floor(elapsedSeconds / 60);
|
|
31080
31130
|
const secs = elapsedSeconds % 60;
|
|
31081
31131
|
return {
|
|
31082
|
-
spinner: /* @__PURE__ */
|
|
31132
|
+
spinner: /* @__PURE__ */ jsx54(Spinner2, {}),
|
|
31083
31133
|
elapsed: mins > 0 ? `${mins}m ${secs}s` : `${secs}s`
|
|
31084
31134
|
};
|
|
31085
31135
|
}
|
|
@@ -31090,28 +31140,28 @@ var init_use_timed_spinner = __esm({
|
|
|
31090
31140
|
});
|
|
31091
31141
|
|
|
31092
31142
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PushingStep.tsx
|
|
31093
|
-
import { Box as
|
|
31143
|
+
import { Box as Box41, Text as Text44 } from "ink";
|
|
31094
31144
|
import { ProgressBar as ProgressBar2, ThemeProvider as ThemeProvider2 } from "@inkjs/ui";
|
|
31095
|
-
import { jsx as
|
|
31145
|
+
import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
31096
31146
|
function PushingStep({ progress, produced }) {
|
|
31097
31147
|
const { elapsed } = useTimedSpinner();
|
|
31098
31148
|
const operationId = progress && progress.kind === "queued" ? progress.operationId : null;
|
|
31099
31149
|
const showGlobal = progress && progress.kind === "progress";
|
|
31100
31150
|
const showCurrent = progress && progress.kind === "progress" && progress.current ? progress.current : null;
|
|
31101
|
-
return /* @__PURE__ */ jsxs42(
|
|
31102
|
-
/* @__PURE__ */
|
|
31103
|
-
/* @__PURE__ */ jsxs42(
|
|
31151
|
+
return /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", children: [
|
|
31152
|
+
/* @__PURE__ */ jsx55(StepHeader, { step: "push" }),
|
|
31153
|
+
/* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
31104
31154
|
/* @__PURE__ */ jsxs42(Text44, { children: [
|
|
31105
31155
|
"Writing ",
|
|
31106
31156
|
writtenThings(produced),
|
|
31107
31157
|
" to your Contentful space..."
|
|
31108
31158
|
] }),
|
|
31109
|
-
operationId && /* @__PURE__ */ jsxs42(
|
|
31110
|
-
/* @__PURE__ */
|
|
31111
|
-
/* @__PURE__ */
|
|
31159
|
+
operationId && /* @__PURE__ */ jsxs42(Box41, { gap: 1, children: [
|
|
31160
|
+
/* @__PURE__ */ jsx55(Text44, { color: PALETTE.muted, children: "Operation:" }),
|
|
31161
|
+
/* @__PURE__ */ jsx55(Text44, { children: operationId })
|
|
31112
31162
|
] }),
|
|
31113
|
-
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */
|
|
31114
|
-
/* @__PURE__ */
|
|
31163
|
+
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx55(Box41, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs42(Box41, { gap: 2, children: [
|
|
31164
|
+
/* @__PURE__ */ jsx55(Box41, { width: 40, children: /* @__PURE__ */ jsx55(ThemeProvider2, { theme: PROGRESS_THEME, children: /* @__PURE__ */ jsx55(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
31115
31165
|
/* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
31116
31166
|
progress.processed,
|
|
31117
31167
|
"/",
|
|
@@ -31119,11 +31169,11 @@ function PushingStep({ progress, produced }) {
|
|
|
31119
31169
|
" entities"
|
|
31120
31170
|
] })
|
|
31121
31171
|
] }) }),
|
|
31122
|
-
showCurrent && /* @__PURE__ */ jsxs42(
|
|
31123
|
-
/* @__PURE__ */
|
|
31124
|
-
/* @__PURE__ */
|
|
31172
|
+
showCurrent && /* @__PURE__ */ jsxs42(Box41, { gap: 1, children: [
|
|
31173
|
+
/* @__PURE__ */ jsx55(Text44, { color: PALETTE.muted, children: "Now processing:" }),
|
|
31174
|
+
/* @__PURE__ */ jsx55(Text44, { children: showCurrent })
|
|
31125
31175
|
] }),
|
|
31126
|
-
/* @__PURE__ */
|
|
31176
|
+
/* @__PURE__ */ jsx55(Box41, { marginTop: 1, children: /* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
31127
31177
|
"Elapsed: ",
|
|
31128
31178
|
elapsed
|
|
31129
31179
|
] }) })
|
|
@@ -31329,8 +31379,8 @@ var init_preview_confirmation_input = __esm({
|
|
|
31329
31379
|
|
|
31330
31380
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
31331
31381
|
import { useEffect as useEffect20, useState as useState29, useMemo as useMemo5 } from "react";
|
|
31332
|
-
import { Box as
|
|
31333
|
-
import { Fragment as
|
|
31382
|
+
import { Box as Box42, Text as Text45 } from "ink";
|
|
31383
|
+
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
31334
31384
|
function buildPreviewSummaryLines(preview) {
|
|
31335
31385
|
const lines = [];
|
|
31336
31386
|
const { components, tokens } = preview;
|
|
@@ -31582,11 +31632,11 @@ function WizardPreviewStep({
|
|
|
31582
31632
|
return;
|
|
31583
31633
|
}
|
|
31584
31634
|
});
|
|
31585
|
-
return /* @__PURE__ */ jsxs43(
|
|
31586
|
-
/* @__PURE__ */
|
|
31587
|
-
/* @__PURE__ */ jsxs43(
|
|
31588
|
-
hasAnything ? /* @__PURE__ */ jsxs43(
|
|
31589
|
-
/* @__PURE__ */
|
|
31635
|
+
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
31636
|
+
/* @__PURE__ */ jsx56(StepHeader, { step: "push" }),
|
|
31637
|
+
/* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 2, children: [
|
|
31638
|
+
hasAnything ? /* @__PURE__ */ jsxs43(Fragment18, { children: [
|
|
31639
|
+
/* @__PURE__ */ jsx56(Text45, { children: "Here's what will happen in your space:" }),
|
|
31590
31640
|
/* @__PURE__ */ jsxs43(
|
|
31591
31641
|
WindowedPanel,
|
|
31592
31642
|
{
|
|
@@ -31595,15 +31645,15 @@ function WizardPreviewStep({
|
|
|
31595
31645
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
31596
31646
|
focused: false,
|
|
31597
31647
|
children: [
|
|
31598
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */
|
|
31599
|
-
/* @__PURE__ */
|
|
31648
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx56(Text45, { color: line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
31649
|
+
/* @__PURE__ */ jsx56(Text45, { color: PALETTE.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
31600
31650
|
]
|
|
31601
31651
|
}
|
|
31602
31652
|
)
|
|
31603
|
-
] }) : /* @__PURE__ */
|
|
31604
|
-
breakingWithImpact && /* @__PURE__ */
|
|
31605
|
-
/* @__PURE__ */
|
|
31606
|
-
/* @__PURE__ */
|
|
31653
|
+
] }) : /* @__PURE__ */ jsx56(Text45, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
31654
|
+
breakingWithImpact && /* @__PURE__ */ jsx56(Box42, { marginTop: 1, children: /* @__PURE__ */ jsx56(Text45, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
31655
|
+
/* @__PURE__ */ jsx56(SpaceEnvironment, { spaceId, environmentId }),
|
|
31656
|
+
/* @__PURE__ */ jsx56(Box42, { marginTop: 1, children: /* @__PURE__ */ jsx56(
|
|
31607
31657
|
ControlHints,
|
|
31608
31658
|
{
|
|
31609
31659
|
hints: [
|
|
@@ -31649,8 +31699,8 @@ var init_run_teaser = __esm({
|
|
|
31649
31699
|
});
|
|
31650
31700
|
|
|
31651
31701
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
31652
|
-
import { Box as
|
|
31653
|
-
import { jsx as
|
|
31702
|
+
import { Box as Box43 } from "ink";
|
|
31703
|
+
import { jsx as jsx57, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
31654
31704
|
function canEditFromPreview(cdf) {
|
|
31655
31705
|
if (!cdf) return false;
|
|
31656
31706
|
return parseCDFComponents(cdf).components.length > 0;
|
|
@@ -31667,7 +31717,7 @@ function FlowScreen({
|
|
|
31667
31717
|
const content = (() => {
|
|
31668
31718
|
switch (state2.step) {
|
|
31669
31719
|
case "final-review":
|
|
31670
|
-
return /* @__PURE__ */
|
|
31720
|
+
return /* @__PURE__ */ jsx57(
|
|
31671
31721
|
GenerateReviewStep,
|
|
31672
31722
|
{
|
|
31673
31723
|
extractSessionId: state2.extractSessionId,
|
|
@@ -31684,10 +31734,10 @@ function FlowScreen({
|
|
|
31684
31734
|
}
|
|
31685
31735
|
);
|
|
31686
31736
|
case "previewing":
|
|
31687
|
-
return /* @__PURE__ */
|
|
31737
|
+
return /* @__PURE__ */ jsx57(RunningStep, { step: "push", description: "Computing diff against your Contentful space..." });
|
|
31688
31738
|
case "preview-gate":
|
|
31689
31739
|
if (!state2.serverPreview) return null;
|
|
31690
|
-
return /* @__PURE__ */
|
|
31740
|
+
return /* @__PURE__ */ jsx57(
|
|
31691
31741
|
WizardPreviewStep,
|
|
31692
31742
|
{
|
|
31693
31743
|
preview: state2.serverPreview,
|
|
@@ -31699,9 +31749,9 @@ function FlowScreen({
|
|
|
31699
31749
|
}
|
|
31700
31750
|
);
|
|
31701
31751
|
case "pushing":
|
|
31702
|
-
return /* @__PURE__ */
|
|
31752
|
+
return /* @__PURE__ */ jsx57(PushingStep, { progress: state2.pushProgress, produced });
|
|
31703
31753
|
case "path-prompt":
|
|
31704
|
-
return /* @__PURE__ */
|
|
31754
|
+
return /* @__PURE__ */ jsx57(
|
|
31705
31755
|
PathPrompt,
|
|
31706
31756
|
{
|
|
31707
31757
|
defaultPath: state2.outDir,
|
|
@@ -31710,10 +31760,10 @@ function FlowScreen({
|
|
|
31710
31760
|
}
|
|
31711
31761
|
);
|
|
31712
31762
|
case "printing":
|
|
31713
|
-
return /* @__PURE__ */
|
|
31763
|
+
return /* @__PURE__ */ jsx57(RunningStep, { step: "push", description: "Writing output files to disk..." });
|
|
31714
31764
|
case "print-gate": {
|
|
31715
31765
|
const teaser = buildRunTeaserLine(state2.lastRunId);
|
|
31716
|
-
return /* @__PURE__ */
|
|
31766
|
+
return /* @__PURE__ */ jsx57(
|
|
31717
31767
|
GateStep,
|
|
31718
31768
|
{
|
|
31719
31769
|
step: "push",
|
|
@@ -31728,7 +31778,7 @@ function FlowScreen({
|
|
|
31728
31778
|
}
|
|
31729
31779
|
case "done": {
|
|
31730
31780
|
const totalFailed = state2.pushResult.componentTypes.failed + state2.pushResult.designTokens.failed;
|
|
31731
|
-
return /* @__PURE__ */
|
|
31781
|
+
return /* @__PURE__ */ jsx57(
|
|
31732
31782
|
DoneStep,
|
|
31733
31783
|
{
|
|
31734
31784
|
componentTypes: state2.pushResult.componentTypes,
|
|
@@ -31745,7 +31795,7 @@ function FlowScreen({
|
|
|
31745
31795
|
);
|
|
31746
31796
|
}
|
|
31747
31797
|
case "preview-validation-error":
|
|
31748
|
-
return /* @__PURE__ */
|
|
31798
|
+
return /* @__PURE__ */ jsx57(
|
|
31749
31799
|
PreviewValidationErrorScreen,
|
|
31750
31800
|
{
|
|
31751
31801
|
errors: state2.previewValidationErrors,
|
|
@@ -31756,7 +31806,7 @@ function FlowScreen({
|
|
|
31756
31806
|
}
|
|
31757
31807
|
);
|
|
31758
31808
|
case "error":
|
|
31759
|
-
return /* @__PURE__ */
|
|
31809
|
+
return /* @__PURE__ */ jsx57(
|
|
31760
31810
|
ErrorStep,
|
|
31761
31811
|
{
|
|
31762
31812
|
stepName: state2.errorStep,
|
|
@@ -31767,8 +31817,8 @@ function FlowScreen({
|
|
|
31767
31817
|
);
|
|
31768
31818
|
}
|
|
31769
31819
|
})();
|
|
31770
|
-
return /* @__PURE__ */ jsxs44(
|
|
31771
|
-
/* @__PURE__ */
|
|
31820
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", children: [
|
|
31821
|
+
/* @__PURE__ */ jsx57(CustomPromptBanner, { generatePromptPath }),
|
|
31772
31822
|
content
|
|
31773
31823
|
] });
|
|
31774
31824
|
}
|
|
@@ -32978,14 +33028,14 @@ var init_help_info = __esm({
|
|
|
32978
33028
|
|
|
32979
33029
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
32980
33030
|
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
32981
|
-
import { Box as
|
|
32982
|
-
import { Fragment as
|
|
33031
|
+
import { Box as Box44, Text as Text46, useInput as useInput10 } from "ink";
|
|
33032
|
+
import { Fragment as Fragment19, jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
32983
33033
|
function Section({ title, rows }) {
|
|
32984
|
-
return /* @__PURE__ */ jsxs45(
|
|
32985
|
-
/* @__PURE__ */
|
|
32986
|
-
rows.map((row) => /* @__PURE__ */ jsxs45(
|
|
32987
|
-
/* @__PURE__ */
|
|
32988
|
-
/* @__PURE__ */
|
|
33034
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", children: [
|
|
33035
|
+
/* @__PURE__ */ jsx58(Text46, { bold: true, color: PALETTE.accent, children: title }),
|
|
33036
|
+
rows.map((row) => /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33037
|
+
/* @__PURE__ */ jsx58(Box44, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx58(Text46, { color: PALETTE.muted, children: row.label }) }),
|
|
33038
|
+
/* @__PURE__ */ jsx58(Text46, { children: row.value })
|
|
32989
33039
|
] }, row.label))
|
|
32990
33040
|
] });
|
|
32991
33041
|
}
|
|
@@ -32999,7 +33049,7 @@ function HelpScreen({ onDone }) {
|
|
|
32999
33049
|
void finishDebugRun({ outputs: {}, status: "success", exitMethod });
|
|
33000
33050
|
onDone();
|
|
33001
33051
|
};
|
|
33002
|
-
|
|
33052
|
+
useInput10((input, key) => {
|
|
33003
33053
|
if (key.return) {
|
|
33004
33054
|
leave("saved");
|
|
33005
33055
|
return;
|
|
@@ -33009,14 +33059,14 @@ function HelpScreen({ onDone }) {
|
|
|
33009
33059
|
return;
|
|
33010
33060
|
}
|
|
33011
33061
|
});
|
|
33012
|
-
return /* @__PURE__ */ jsxs45(
|
|
33013
|
-
/* @__PURE__ */
|
|
33014
|
-
info ? /* @__PURE__ */ jsxs45(
|
|
33015
|
-
/* @__PURE__ */
|
|
33016
|
-
/* @__PURE__ */
|
|
33017
|
-
/* @__PURE__ */
|
|
33018
|
-
] }) : /* @__PURE__ */
|
|
33019
|
-
/* @__PURE__ */
|
|
33062
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
33063
|
+
/* @__PURE__ */ jsx58(Text46, { bold: true, children: "Help" }),
|
|
33064
|
+
info ? /* @__PURE__ */ jsxs45(Fragment19, { children: [
|
|
33065
|
+
/* @__PURE__ */ jsx58(Section, { title: "Where things are stored", rows: info.storage }),
|
|
33066
|
+
/* @__PURE__ */ jsx58(Section, { title: "Troubleshooting", rows: info.troubleshooting }),
|
|
33067
|
+
/* @__PURE__ */ jsx58(Text46, { color: PALETTE.muted, children: "Hit a problem? Turn on Debug Mode in Settings, reproduce it, then share the session folder above. The CMA token is redacted from those logs." })
|
|
33068
|
+
] }) : /* @__PURE__ */ jsx58(Text46, { color: PALETTE.accent, children: "Loading..." }),
|
|
33069
|
+
/* @__PURE__ */ jsx58(
|
|
33020
33070
|
ControlHints,
|
|
33021
33071
|
{
|
|
33022
33072
|
hints: [
|
|
@@ -33039,8 +33089,8 @@ var init_PageContainer2 = __esm({
|
|
|
33039
33089
|
|
|
33040
33090
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
33041
33091
|
import { useState as useState31 } from "react";
|
|
33042
|
-
import { Box as
|
|
33043
|
-
import { jsx as
|
|
33092
|
+
import { Box as Box45, Text as Text47, useInput as useInput11 } from "ink";
|
|
33093
|
+
import { jsx as jsx59, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33044
33094
|
function SettingsScreen({
|
|
33045
33095
|
onNavigate,
|
|
33046
33096
|
onBack
|
|
@@ -33051,7 +33101,7 @@ function SettingsScreen({
|
|
|
33051
33101
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
33052
33102
|
{ label: "Debug Mode", screen: "settings-debug-mode" }
|
|
33053
33103
|
];
|
|
33054
|
-
|
|
33104
|
+
useInput11((input, key) => {
|
|
33055
33105
|
if (key.upArrow) {
|
|
33056
33106
|
setFocusIdx((i) => (i - 1 + items.length) % items.length);
|
|
33057
33107
|
return;
|
|
@@ -33071,15 +33121,15 @@ function SettingsScreen({
|
|
|
33071
33121
|
onBack();
|
|
33072
33122
|
}
|
|
33073
33123
|
});
|
|
33074
|
-
return /* @__PURE__ */ jsxs46(
|
|
33075
|
-
/* @__PURE__ */
|
|
33076
|
-
/* @__PURE__ */
|
|
33124
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33125
|
+
/* @__PURE__ */ jsx59(Text47, { bold: true, children: "Settings" }),
|
|
33126
|
+
/* @__PURE__ */ jsx59(Text47, { color: PALETTE.muted, children: " " }),
|
|
33077
33127
|
items.map((item, i) => /* @__PURE__ */ jsxs46(Text47, { color: i === focusIdx ? PALETTE.accent : void 0, children: [
|
|
33078
33128
|
i === focusIdx ? "> " : " ",
|
|
33079
33129
|
item.label
|
|
33080
33130
|
] }, item.label)),
|
|
33081
|
-
/* @__PURE__ */
|
|
33082
|
-
/* @__PURE__ */
|
|
33131
|
+
/* @__PURE__ */ jsx59(Text47, { children: " " }),
|
|
33132
|
+
/* @__PURE__ */ jsx59(
|
|
33083
33133
|
ControlHints,
|
|
33084
33134
|
{
|
|
33085
33135
|
hints: [
|
|
@@ -33388,14 +33438,14 @@ var init_agent_debug = __esm({
|
|
|
33388
33438
|
|
|
33389
33439
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentStatusBadge.tsx
|
|
33390
33440
|
import { Text as Text48 } from "ink";
|
|
33391
|
-
import { jsx as
|
|
33441
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
33392
33442
|
function AgentStatusBadge({
|
|
33393
33443
|
name,
|
|
33394
33444
|
checks,
|
|
33395
33445
|
binary
|
|
33396
33446
|
}) {
|
|
33397
33447
|
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name, checks, binary) : "checking"];
|
|
33398
|
-
return /* @__PURE__ */
|
|
33448
|
+
return /* @__PURE__ */ jsx60(Text48, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
33399
33449
|
}
|
|
33400
33450
|
var TONE_COLOR;
|
|
33401
33451
|
var init_AgentStatusBadge = __esm({
|
|
@@ -33413,12 +33463,12 @@ var init_AgentStatusBadge = __esm({
|
|
|
33413
33463
|
|
|
33414
33464
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
33415
33465
|
import { useEffect as useEffect23, useState as useState32 } from "react";
|
|
33416
|
-
import { Box as
|
|
33417
|
-
import { jsx as
|
|
33466
|
+
import { Box as Box46, Text as Text49 } from "ink";
|
|
33467
|
+
import { jsx as jsx61, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
33418
33468
|
function StatusHeading() {
|
|
33419
|
-
return /* @__PURE__ */ jsxs47(
|
|
33420
|
-
/* @__PURE__ */
|
|
33421
|
-
/* @__PURE__ */
|
|
33469
|
+
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
33470
|
+
/* @__PURE__ */ jsx61(Text49, { bold: true, color: PALETTE.muted, children: "STATUS" }),
|
|
33471
|
+
/* @__PURE__ */ jsx61(Text49, { color: PALETTE.muted, children: "\xB7 read only" })
|
|
33422
33472
|
] });
|
|
33423
33473
|
}
|
|
33424
33474
|
function AgentDetail({
|
|
@@ -33481,7 +33531,7 @@ function AgentDetail({
|
|
|
33481
33531
|
};
|
|
33482
33532
|
const formFields = fields(name);
|
|
33483
33533
|
const labelWidth = formLabelWidth([...formFields, action]);
|
|
33484
|
-
return /* @__PURE__ */
|
|
33534
|
+
return /* @__PURE__ */ jsx61(
|
|
33485
33535
|
FieldForm,
|
|
33486
33536
|
{
|
|
33487
33537
|
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[name]}`,
|
|
@@ -33498,9 +33548,9 @@ function AgentDetail({
|
|
|
33498
33548
|
actions: [action],
|
|
33499
33549
|
notice: testing ? null : notice,
|
|
33500
33550
|
busy: saving || testing,
|
|
33501
|
-
children: /* @__PURE__ */ jsxs47(
|
|
33502
|
-
/* @__PURE__ */
|
|
33503
|
-
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */
|
|
33551
|
+
children: /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", marginTop: 1, children: [
|
|
33552
|
+
/* @__PURE__ */ jsx61(StatusHeading, {}),
|
|
33553
|
+
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx61(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx61(Text49, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
33504
33554
|
] })
|
|
33505
33555
|
}
|
|
33506
33556
|
);
|
|
@@ -33526,8 +33576,8 @@ var init_AgentDetail = __esm({
|
|
|
33526
33576
|
|
|
33527
33577
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
33528
33578
|
import { useEffect as useEffect24, useRef as useRef15, useState as useState33 } from "react";
|
|
33529
|
-
import { Box as
|
|
33530
|
-
import { Fragment as
|
|
33579
|
+
import { Box as Box47, Text as Text50, useInput as useInput12 } from "ink";
|
|
33580
|
+
import { Fragment as Fragment20, jsx as jsx62, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
33531
33581
|
function AgentsScreen({ onDone }) {
|
|
33532
33582
|
const [config, setConfig] = useState33(null);
|
|
33533
33583
|
const [focus, setFocus] = useState33(0);
|
|
@@ -33603,7 +33653,7 @@ function AgentsScreen({ onDone }) {
|
|
|
33603
33653
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
33604
33654
|
}).finally(() => setSaving(false));
|
|
33605
33655
|
};
|
|
33606
|
-
|
|
33656
|
+
useInput12((input, key) => {
|
|
33607
33657
|
if (loadError && (key.escape || input === "q")) {
|
|
33608
33658
|
endVisit(null);
|
|
33609
33659
|
onDone();
|
|
@@ -33635,21 +33685,21 @@ function AgentsScreen({ onDone }) {
|
|
|
33635
33685
|
}
|
|
33636
33686
|
});
|
|
33637
33687
|
if (!config) {
|
|
33638
|
-
return /* @__PURE__ */ jsxs48(
|
|
33639
|
-
/* @__PURE__ */
|
|
33640
|
-
/* @__PURE__ */
|
|
33641
|
-
loadError ? /* @__PURE__ */ jsxs48(
|
|
33688
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33689
|
+
/* @__PURE__ */ jsx62(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
33690
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33691
|
+
loadError ? /* @__PURE__ */ jsxs48(Fragment20, { children: [
|
|
33642
33692
|
/* @__PURE__ */ jsxs48(Text50, { color: PALETTE.error, children: [
|
|
33643
33693
|
"\u2717 Could not read the settings: ",
|
|
33644
33694
|
loadError
|
|
33645
33695
|
] }),
|
|
33646
|
-
/* @__PURE__ */
|
|
33647
|
-
/* @__PURE__ */
|
|
33648
|
-
] }) : /* @__PURE__ */
|
|
33696
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33697
|
+
/* @__PURE__ */ jsx62(ControlHints, { hints: [{ keys: "Esc/q", label: "back" }] })
|
|
33698
|
+
] }) : /* @__PURE__ */ jsx62(Text50, { color: PALETTE.accent, children: "Loading..." })
|
|
33649
33699
|
] });
|
|
33650
33700
|
}
|
|
33651
33701
|
if (open) {
|
|
33652
|
-
return /* @__PURE__ */
|
|
33702
|
+
return /* @__PURE__ */ jsx62(
|
|
33653
33703
|
AgentDetail,
|
|
33654
33704
|
{
|
|
33655
33705
|
name: open,
|
|
@@ -33670,48 +33720,48 @@ function AgentsScreen({ onDone }) {
|
|
|
33670
33720
|
);
|
|
33671
33721
|
}
|
|
33672
33722
|
const focusedAgent = AGENT_NAMES[focus];
|
|
33673
|
-
return /* @__PURE__ */ jsxs48(
|
|
33674
|
-
/* @__PURE__ */
|
|
33675
|
-
/* @__PURE__ */
|
|
33676
|
-
/* @__PURE__ */
|
|
33677
|
-
/* @__PURE__ */
|
|
33678
|
-
/* @__PURE__ */ jsxs48(
|
|
33679
|
-
/* @__PURE__ */
|
|
33680
|
-
/* @__PURE__ */
|
|
33681
|
-
saving && /* @__PURE__ */
|
|
33723
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33724
|
+
/* @__PURE__ */ jsx62(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
33725
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33726
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
33727
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33728
|
+
/* @__PURE__ */ jsxs48(Box47, { gap: 1, children: [
|
|
33729
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "Default agent" }),
|
|
33730
|
+
/* @__PURE__ */ jsx62(Text50, { bold: true, children: AGENT_LABELS[config.defaultAgent] }),
|
|
33731
|
+
saving && /* @__PURE__ */ jsx62(Text50, { color: PALETTE.accent, children: "\u2026 saving" })
|
|
33682
33732
|
] }),
|
|
33683
|
-
/* @__PURE__ */ jsxs48(
|
|
33684
|
-
/* @__PURE__ */
|
|
33685
|
-
/* @__PURE__ */
|
|
33686
|
-
/* @__PURE__ */
|
|
33687
|
-
/* @__PURE__ */
|
|
33733
|
+
/* @__PURE__ */ jsxs48(Box47, { marginTop: 1, gap: 1, children: [
|
|
33734
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33735
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33736
|
+
/* @__PURE__ */ jsx62(Box47, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
33737
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "STATUS" })
|
|
33688
33738
|
] }),
|
|
33689
33739
|
AGENT_NAMES.map((name) => {
|
|
33690
33740
|
const isFocused = focusedAgent === name;
|
|
33691
|
-
return /* @__PURE__ */ jsxs48(
|
|
33692
|
-
/* @__PURE__ */
|
|
33693
|
-
/* @__PURE__ */
|
|
33694
|
-
/* @__PURE__ */
|
|
33695
|
-
/* @__PURE__ */
|
|
33741
|
+
return /* @__PURE__ */ jsxs48(Box47, { gap: 1, children: [
|
|
33742
|
+
/* @__PURE__ */ jsx62(Text50, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
33743
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
|
|
33744
|
+
/* @__PURE__ */ jsx62(Box47, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text50, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
|
|
33745
|
+
/* @__PURE__ */ jsx62(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
|
|
33696
33746
|
] }, name);
|
|
33697
33747
|
}),
|
|
33698
|
-
/* @__PURE__ */ jsxs48(
|
|
33699
|
-
/* @__PURE__ */
|
|
33700
|
-
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(
|
|
33701
|
-
/* @__PURE__ */
|
|
33702
|
-
/* @__PURE__ */
|
|
33748
|
+
/* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", marginTop: 1, children: [
|
|
33749
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
33750
|
+
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(Box47, { gap: 1, paddingLeft: 1, children: [
|
|
33751
|
+
/* @__PURE__ */ jsx62(Box47, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: row.label }) }),
|
|
33752
|
+
/* @__PURE__ */ jsx62(Text50, { color: TONE_COLOR[row.tone], children: row.value })
|
|
33703
33753
|
] }, row.label))
|
|
33704
33754
|
] }),
|
|
33705
|
-
notice && /* @__PURE__ */ jsxs48(
|
|
33706
|
-
/* @__PURE__ */
|
|
33755
|
+
notice && /* @__PURE__ */ jsxs48(Fragment20, { children: [
|
|
33756
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33707
33757
|
/* @__PURE__ */ jsxs48(Text50, { bold: true, color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33708
33758
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33709
33759
|
" ",
|
|
33710
33760
|
notice.text
|
|
33711
33761
|
] })
|
|
33712
33762
|
] }),
|
|
33713
|
-
/* @__PURE__ */
|
|
33714
|
-
/* @__PURE__ */
|
|
33763
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
33764
|
+
/* @__PURE__ */ jsx62(
|
|
33715
33765
|
ControlHints,
|
|
33716
33766
|
{
|
|
33717
33767
|
hints: [
|
|
@@ -33776,8 +33826,8 @@ var init_project_store = __esm({
|
|
|
33776
33826
|
|
|
33777
33827
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
33778
33828
|
import { useEffect as useEffect25, useRef as useRef16, useState as useState34 } from "react";
|
|
33779
|
-
import { Box as
|
|
33780
|
-
import { Fragment as
|
|
33829
|
+
import { Box as Box48, Text as Text51, useInput as useInput13 } from "ink";
|
|
33830
|
+
import { Fragment as Fragment21, jsx as jsx63, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
33781
33831
|
function debugFields(config) {
|
|
33782
33832
|
return {
|
|
33783
33833
|
space_id: config?.spaceId ?? "",
|
|
@@ -33839,24 +33889,24 @@ function ProjectScreen({ onDone }) {
|
|
|
33839
33889
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
33840
33890
|
});
|
|
33841
33891
|
};
|
|
33842
|
-
|
|
33892
|
+
useInput13((input, key) => {
|
|
33843
33893
|
if (!config && loadError && (key.escape || input === "q")) {
|
|
33844
33894
|
endVisit(null);
|
|
33845
33895
|
onDone();
|
|
33846
33896
|
}
|
|
33847
33897
|
});
|
|
33848
33898
|
if (!config) {
|
|
33849
|
-
return /* @__PURE__ */ jsxs49(
|
|
33850
|
-
/* @__PURE__ */
|
|
33851
|
-
/* @__PURE__ */
|
|
33852
|
-
loadError ? /* @__PURE__ */ jsxs49(
|
|
33899
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33900
|
+
/* @__PURE__ */ jsx63(Text51, { bold: true, children: "Settings \u203A Configuration \u203A Project" }),
|
|
33901
|
+
/* @__PURE__ */ jsx63(Text51, { children: " " }),
|
|
33902
|
+
loadError ? /* @__PURE__ */ jsxs49(Fragment21, { children: [
|
|
33853
33903
|
/* @__PURE__ */ jsxs49(Text51, { color: PALETTE.error, children: [
|
|
33854
33904
|
"\u2717 Could not read the settings: ",
|
|
33855
33905
|
loadError
|
|
33856
33906
|
] }),
|
|
33857
|
-
/* @__PURE__ */
|
|
33858
|
-
/* @__PURE__ */
|
|
33859
|
-
] }) : /* @__PURE__ */
|
|
33907
|
+
/* @__PURE__ */ jsx63(Text51, { children: " " }),
|
|
33908
|
+
/* @__PURE__ */ jsx63(ControlHints, { hints: [{ keys: "Esc/q", label: "back" }] })
|
|
33909
|
+
] }) : /* @__PURE__ */ jsx63(Text51, { color: PALETTE.accent, children: "Loading..." })
|
|
33860
33910
|
] });
|
|
33861
33911
|
}
|
|
33862
33912
|
const save = () => {
|
|
@@ -33877,7 +33927,7 @@ function ProjectScreen({ onDone }) {
|
|
|
33877
33927
|
endVisit(config);
|
|
33878
33928
|
onDone();
|
|
33879
33929
|
};
|
|
33880
|
-
return /* @__PURE__ */
|
|
33930
|
+
return /* @__PURE__ */ jsx63(
|
|
33881
33931
|
FieldForm,
|
|
33882
33932
|
{
|
|
33883
33933
|
title: "Settings \u203A Configuration \u203A Project",
|
|
@@ -33923,13 +33973,13 @@ var init_ProjectScreen = __esm({
|
|
|
33923
33973
|
|
|
33924
33974
|
// packages/experience-design-system-cli/src/tui/settings/configuration/ConfigurationScreen.tsx
|
|
33925
33975
|
import { useState as useState35 } from "react";
|
|
33926
|
-
import { Box as
|
|
33927
|
-
import { jsx as
|
|
33976
|
+
import { Box as Box49, Text as Text52, useInput as useInput14 } from "ink";
|
|
33977
|
+
import { jsx as jsx64, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
33928
33978
|
function ConfigurationScreen({ onDone }) {
|
|
33929
33979
|
const [focus, setFocus] = useState35(0);
|
|
33930
33980
|
const [open, setOpen] = useState35(null);
|
|
33931
33981
|
const close = () => setOpen(null);
|
|
33932
|
-
|
|
33982
|
+
useInput14((input, key) => {
|
|
33933
33983
|
if (open) return;
|
|
33934
33984
|
if (key.upArrow) {
|
|
33935
33985
|
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
@@ -33945,18 +33995,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
33945
33995
|
}
|
|
33946
33996
|
if (key.escape || input === "q") onDone();
|
|
33947
33997
|
});
|
|
33948
|
-
if (open === "project") return /* @__PURE__ */
|
|
33949
|
-
if (open === "agents") return /* @__PURE__ */
|
|
33950
|
-
return /* @__PURE__ */ jsxs50(
|
|
33951
|
-
/* @__PURE__ */
|
|
33952
|
-
/* @__PURE__ */
|
|
33953
|
-
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(
|
|
33954
|
-
/* @__PURE__ */
|
|
33955
|
-
/* @__PURE__ */
|
|
33956
|
-
/* @__PURE__ */
|
|
33998
|
+
if (open === "project") return /* @__PURE__ */ jsx64(ProjectScreen, { onDone: close });
|
|
33999
|
+
if (open === "agents") return /* @__PURE__ */ jsx64(AgentsScreen, { onDone: close });
|
|
34000
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
34001
|
+
/* @__PURE__ */ jsx64(Text52, { bold: true, children: "Settings \u203A Configuration" }),
|
|
34002
|
+
/* @__PURE__ */ jsx64(Text52, { children: " " }),
|
|
34003
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(Box49, { gap: 1, children: [
|
|
34004
|
+
/* @__PURE__ */ jsx64(Text52, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
34005
|
+
/* @__PURE__ */ jsx64(Box49, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx64(Text52, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
34006
|
+
/* @__PURE__ */ jsx64(Text52, { color: PALETTE.muted, children: section.description })
|
|
33957
34007
|
] }, section.id)),
|
|
33958
|
-
/* @__PURE__ */
|
|
33959
|
-
/* @__PURE__ */
|
|
34008
|
+
/* @__PURE__ */ jsx64(Text52, { children: " " }),
|
|
34009
|
+
/* @__PURE__ */ jsx64(
|
|
33960
34010
|
ControlHints,
|
|
33961
34011
|
{
|
|
33962
34012
|
hints: [
|
|
@@ -33989,8 +34039,8 @@ var init_ConfigurationScreen = __esm({
|
|
|
33989
34039
|
|
|
33990
34040
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
33991
34041
|
import { useEffect as useEffect26, useState as useState36 } from "react";
|
|
33992
|
-
import { Box as
|
|
33993
|
-
import { Fragment as
|
|
34042
|
+
import { Box as Box50, Text as Text53, useInput as useInput15 } from "ink";
|
|
34043
|
+
import { Fragment as Fragment22, jsx as jsx65, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
33994
34044
|
function OptInAnalyticsScreen({ onDone }) {
|
|
33995
34045
|
const [loading, setLoading] = useState36(true);
|
|
33996
34046
|
const [enabled, setEnabled] = useState36(true);
|
|
@@ -34006,7 +34056,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
34006
34056
|
});
|
|
34007
34057
|
});
|
|
34008
34058
|
}, []);
|
|
34009
|
-
|
|
34059
|
+
useInput15((input, key) => {
|
|
34010
34060
|
if (loading) return;
|
|
34011
34061
|
if (key.return || input === " ") {
|
|
34012
34062
|
setEnabled((current) => {
|
|
@@ -34021,21 +34071,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
34021
34071
|
onDone();
|
|
34022
34072
|
}
|
|
34023
34073
|
});
|
|
34024
|
-
return /* @__PURE__ */ jsxs51(
|
|
34025
|
-
/* @__PURE__ */
|
|
34026
|
-
/* @__PURE__ */
|
|
34027
|
-
loading ? /* @__PURE__ */
|
|
34074
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
34075
|
+
/* @__PURE__ */ jsx65(Text53, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
34076
|
+
/* @__PURE__ */ jsx65(Text53, { children: " " }),
|
|
34077
|
+
loading ? /* @__PURE__ */ jsx65(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs51(Fragment22, { children: [
|
|
34028
34078
|
/* @__PURE__ */ jsxs51(Text53, { children: [
|
|
34029
34079
|
"Share anonymous usage data:",
|
|
34030
34080
|
" ",
|
|
34031
|
-
/* @__PURE__ */
|
|
34081
|
+
/* @__PURE__ */ jsx65(Text53, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
34032
34082
|
] }),
|
|
34033
|
-
/* @__PURE__ */
|
|
34034
|
-
/* @__PURE__ */
|
|
34035
|
-
/* @__PURE__ */
|
|
34083
|
+
/* @__PURE__ */ jsx65(Text53, { children: " " }),
|
|
34084
|
+
/* @__PURE__ */ jsx65(Text53, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
34085
|
+
/* @__PURE__ */ jsx65(Text53, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
34036
34086
|
] }),
|
|
34037
|
-
/* @__PURE__ */
|
|
34038
|
-
/* @__PURE__ */
|
|
34087
|
+
/* @__PURE__ */ jsx65(Text53, { children: " " }),
|
|
34088
|
+
/* @__PURE__ */ jsx65(
|
|
34039
34089
|
ControlHints,
|
|
34040
34090
|
{
|
|
34041
34091
|
hints: [
|
|
@@ -34058,8 +34108,8 @@ var init_screen11 = __esm({
|
|
|
34058
34108
|
|
|
34059
34109
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
34060
34110
|
import { useEffect as useEffect27, useRef as useRef17, useState as useState37 } from "react";
|
|
34061
|
-
import { Box as
|
|
34062
|
-
import { Fragment as
|
|
34111
|
+
import { Box as Box51, Text as Text54, useInput as useInput16 } from "ink";
|
|
34112
|
+
import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
34063
34113
|
function DebugModeScreen({ onDone }) {
|
|
34064
34114
|
const [setting, setSetting] = useState37(null);
|
|
34065
34115
|
const [focus, setFocus] = useState37("enabled");
|
|
@@ -34108,7 +34158,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
34108
34158
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
34109
34159
|
});
|
|
34110
34160
|
};
|
|
34111
|
-
|
|
34161
|
+
useInput16((input, key) => {
|
|
34112
34162
|
if (!setting) return;
|
|
34113
34163
|
if (key.upArrow || key.downArrow) {
|
|
34114
34164
|
setFocus((current) => ROWS[(ROWS.indexOf(current) + (key.downArrow ? 1 : ROWS.length - 1)) % ROWS.length]);
|
|
@@ -34135,24 +34185,24 @@ function DebugModeScreen({ onDone }) {
|
|
|
34135
34185
|
onDone();
|
|
34136
34186
|
}
|
|
34137
34187
|
});
|
|
34138
|
-
const marker = (row) => /* @__PURE__ */
|
|
34139
|
-
const label = (row, text) => /* @__PURE__ */
|
|
34140
|
-
return /* @__PURE__ */ jsxs52(
|
|
34141
|
-
/* @__PURE__ */
|
|
34142
|
-
/* @__PURE__ */
|
|
34143
|
-
setting ? /* @__PURE__ */ jsxs52(
|
|
34144
|
-
/* @__PURE__ */ jsxs52(
|
|
34188
|
+
const marker = (row) => /* @__PURE__ */ jsx66(Text54, { color: focus === row ? PALETTE.accent : void 0, children: focus === row ? "\u276F" : " " });
|
|
34189
|
+
const label = (row, text) => /* @__PURE__ */ jsx66(Text54, { bold: focus === row, color: focus === row ? PALETTE.accent : PALETTE.muted, children: text });
|
|
34190
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
34191
|
+
/* @__PURE__ */ jsx66(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
34192
|
+
/* @__PURE__ */ jsx66(Text54, { children: " " }),
|
|
34193
|
+
setting ? /* @__PURE__ */ jsxs52(Fragment23, { children: [
|
|
34194
|
+
/* @__PURE__ */ jsxs52(Box51, { gap: 1, children: [
|
|
34145
34195
|
marker("enabled"),
|
|
34146
34196
|
label("enabled", "Debug logging:"),
|
|
34147
|
-
/* @__PURE__ */
|
|
34197
|
+
/* @__PURE__ */ jsx66(Text54, { bold: true, color: setting.enabled ? PALETTE.success : PALETTE.muted, children: setting.enabled ? "On" : "Off" })
|
|
34148
34198
|
] }),
|
|
34149
|
-
/* @__PURE__ */ jsxs52(
|
|
34199
|
+
/* @__PURE__ */ jsxs52(Box51, { gap: 1, children: [
|
|
34150
34200
|
marker("retentionDays"),
|
|
34151
34201
|
label("retentionDays", "Delete logs after:"),
|
|
34152
34202
|
RETENTION_CHOICES.map((days) => {
|
|
34153
34203
|
const highlighted = focus === "retentionDays" && days === pending;
|
|
34154
34204
|
const saved = days === setting.retentionDays;
|
|
34155
|
-
return /* @__PURE__ */
|
|
34205
|
+
return /* @__PURE__ */ jsx66(
|
|
34156
34206
|
Text54,
|
|
34157
34207
|
{
|
|
34158
34208
|
bold: highlighted || saved,
|
|
@@ -34164,15 +34214,15 @@ function DebugModeScreen({ onDone }) {
|
|
|
34164
34214
|
);
|
|
34165
34215
|
})
|
|
34166
34216
|
] }),
|
|
34167
|
-
/* @__PURE__ */
|
|
34217
|
+
/* @__PURE__ */ jsx66(Text54, { children: " " }),
|
|
34168
34218
|
notice ? /* @__PURE__ */ jsxs52(Text54, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
34169
34219
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
34170
34220
|
" ",
|
|
34171
34221
|
notice.text
|
|
34172
|
-
] }) : /* @__PURE__ */
|
|
34173
|
-
] }) : /* @__PURE__ */
|
|
34174
|
-
/* @__PURE__ */
|
|
34175
|
-
/* @__PURE__ */
|
|
34222
|
+
] }) : /* @__PURE__ */ jsx66(Text54, { color: PALETTE.muted, children: "\u2713 marks what is saved. Older logs are deleted the next time the CLI starts." })
|
|
34223
|
+
] }) : /* @__PURE__ */ jsx66(Text54, { color: PALETTE.muted, children: "Loading\u2026" }),
|
|
34224
|
+
/* @__PURE__ */ jsx66(Text54, { children: " " }),
|
|
34225
|
+
/* @__PURE__ */ jsx66(
|
|
34176
34226
|
ControlHints,
|
|
34177
34227
|
{
|
|
34178
34228
|
hints: [
|
|
@@ -34210,7 +34260,7 @@ __export(app_exports, {
|
|
|
34210
34260
|
runApp: () => runApp
|
|
34211
34261
|
});
|
|
34212
34262
|
import { useEffect as useEffect28, useState as useState38 } from "react";
|
|
34213
|
-
import { Fragment as
|
|
34263
|
+
import { Fragment as Fragment24, jsx as jsx67 } from "react/jsx-runtime";
|
|
34214
34264
|
function App({ importOptions, inkClear }) {
|
|
34215
34265
|
const [screen, setScreen] = useState38("start");
|
|
34216
34266
|
const [importExitCode, setImportExitCode] = useState38();
|
|
@@ -34401,9 +34451,9 @@ function App({ importOptions, inkClear }) {
|
|
|
34401
34451
|
};
|
|
34402
34452
|
switch (screen) {
|
|
34403
34453
|
case "import":
|
|
34404
|
-
if (showImportResult) return /* @__PURE__ */
|
|
34454
|
+
if (showImportResult) return /* @__PURE__ */ jsx67(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
34405
34455
|
if (flow && flowStart) {
|
|
34406
|
-
return /* @__PURE__ */
|
|
34456
|
+
return /* @__PURE__ */ jsx67(
|
|
34407
34457
|
FlowScreen,
|
|
34408
34458
|
{
|
|
34409
34459
|
state: flow.state,
|
|
@@ -34413,15 +34463,15 @@ function App({ importOptions, inkClear }) {
|
|
|
34413
34463
|
}
|
|
34414
34464
|
);
|
|
34415
34465
|
}
|
|
34416
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
34466
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx67(Fragment24, {});
|
|
34417
34467
|
if (target === void 0) {
|
|
34418
|
-
return /* @__PURE__ */
|
|
34468
|
+
return /* @__PURE__ */ jsx67(PreflightScreen, { onChoose: setTarget, onQuit: leaveImport });
|
|
34419
34469
|
}
|
|
34420
34470
|
const inputStep = currentInputStep(target, answers);
|
|
34421
34471
|
if (!extractionRun && !tokensOnlyRun && inputStep !== "credentials") {
|
|
34422
34472
|
switch (inputStep) {
|
|
34423
34473
|
case "project":
|
|
34424
|
-
return /* @__PURE__ */
|
|
34474
|
+
return /* @__PURE__ */ jsx67(
|
|
34425
34475
|
WelcomeScreen,
|
|
34426
34476
|
{
|
|
34427
34477
|
onContinue: (projectPath) => answer({ projectPath }),
|
|
@@ -34430,7 +34480,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34430
34480
|
}
|
|
34431
34481
|
);
|
|
34432
34482
|
case "token-file":
|
|
34433
|
-
return /* @__PURE__ */
|
|
34483
|
+
return /* @__PURE__ */ jsx67(
|
|
34434
34484
|
TokenInputScreen,
|
|
34435
34485
|
{
|
|
34436
34486
|
initialPath: importDefaults.tokenFile,
|
|
@@ -34439,7 +34489,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34439
34489
|
}
|
|
34440
34490
|
);
|
|
34441
34491
|
case "path-validation":
|
|
34442
|
-
return /* @__PURE__ */
|
|
34492
|
+
return /* @__PURE__ */ jsx67(
|
|
34443
34493
|
PathValidationScreen,
|
|
34444
34494
|
{
|
|
34445
34495
|
projectPath: answers.projectPath ?? "",
|
|
@@ -34453,9 +34503,9 @@ function App({ importOptions, inkClear }) {
|
|
|
34453
34503
|
}
|
|
34454
34504
|
if (tokensOnlyRun) {
|
|
34455
34505
|
if (tokensOnly?.status === "done" && !tokensOnly.result.ok) {
|
|
34456
|
-
return /* @__PURE__ */
|
|
34506
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: tokensOnly.result.step, message: tokensOnly.result.message, onExit: leaveImport });
|
|
34457
34507
|
}
|
|
34458
|
-
return /* @__PURE__ */
|
|
34508
|
+
return /* @__PURE__ */ jsx67(
|
|
34459
34509
|
RunningStep,
|
|
34460
34510
|
{
|
|
34461
34511
|
step: "generation",
|
|
@@ -34466,19 +34516,19 @@ function App({ importOptions, inkClear }) {
|
|
|
34466
34516
|
}
|
|
34467
34517
|
if (extractionRun) {
|
|
34468
34518
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
34469
|
-
return /* @__PURE__ */
|
|
34519
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
34470
34520
|
}
|
|
34471
34521
|
if (extraction?.status === "running") {
|
|
34472
|
-
return /* @__PURE__ */
|
|
34522
|
+
return /* @__PURE__ */ jsx67(ExtractionScreen, { progress: extraction.progress, agent: extractionRun.input.agent });
|
|
34473
34523
|
}
|
|
34474
|
-
return /* @__PURE__ */
|
|
34524
|
+
return /* @__PURE__ */ jsx67(Fragment24, {});
|
|
34475
34525
|
}
|
|
34476
34526
|
if (scopeRun && scopeFlow) {
|
|
34477
34527
|
if (scopeFlow.status === "failed") {
|
|
34478
|
-
return /* @__PURE__ */
|
|
34528
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
34479
34529
|
}
|
|
34480
34530
|
if (scopeFlow.status === "deciding") {
|
|
34481
|
-
return /* @__PURE__ */
|
|
34531
|
+
return /* @__PURE__ */ jsx67(
|
|
34482
34532
|
ScopeGateScreen,
|
|
34483
34533
|
{
|
|
34484
34534
|
components: scopeFlow.load.components,
|
|
@@ -34488,10 +34538,10 @@ function App({ importOptions, inkClear }) {
|
|
|
34488
34538
|
);
|
|
34489
34539
|
}
|
|
34490
34540
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
34491
|
-
return /* @__PURE__ */
|
|
34541
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
34492
34542
|
}
|
|
34493
34543
|
if (generation?.status === "running") {
|
|
34494
|
-
return /* @__PURE__ */
|
|
34544
|
+
return /* @__PURE__ */ jsx67(
|
|
34495
34545
|
GenerationScreen,
|
|
34496
34546
|
{
|
|
34497
34547
|
progress: generation.progress,
|
|
@@ -34501,9 +34551,9 @@ function App({ importOptions, inkClear }) {
|
|
|
34501
34551
|
}
|
|
34502
34552
|
);
|
|
34503
34553
|
}
|
|
34504
|
-
return /* @__PURE__ */
|
|
34554
|
+
return /* @__PURE__ */ jsx67(Fragment24, {});
|
|
34505
34555
|
}
|
|
34506
|
-
return /* @__PURE__ */
|
|
34556
|
+
return /* @__PURE__ */ jsx67(
|
|
34507
34557
|
CredentialsScreen,
|
|
34508
34558
|
{
|
|
34509
34559
|
initial: importDefaults.credentials,
|
|
@@ -34513,17 +34563,17 @@ function App({ importOptions, inkClear }) {
|
|
|
34513
34563
|
}
|
|
34514
34564
|
);
|
|
34515
34565
|
case "help":
|
|
34516
|
-
return /* @__PURE__ */
|
|
34566
|
+
return /* @__PURE__ */ jsx67(HelpScreen, { onDone: goToStart });
|
|
34517
34567
|
case "settings":
|
|
34518
|
-
return /* @__PURE__ */
|
|
34568
|
+
return /* @__PURE__ */ jsx67(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
34519
34569
|
case "settings-configuration":
|
|
34520
|
-
return /* @__PURE__ */
|
|
34570
|
+
return /* @__PURE__ */ jsx67(ConfigurationScreen, { onDone: goToSettings });
|
|
34521
34571
|
case "settings-opt-in-analytics":
|
|
34522
|
-
return /* @__PURE__ */
|
|
34572
|
+
return /* @__PURE__ */ jsx67(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
34523
34573
|
case "settings-debug-mode":
|
|
34524
|
-
return /* @__PURE__ */
|
|
34574
|
+
return /* @__PURE__ */ jsx67(DebugModeScreen, { onDone: goToSettings });
|
|
34525
34575
|
case "start":
|
|
34526
|
-
return /* @__PURE__ */
|
|
34576
|
+
return /* @__PURE__ */ jsx67(HomeScreen, { onNavigate: setScreen });
|
|
34527
34577
|
}
|
|
34528
34578
|
}
|
|
34529
34579
|
async function runApp(renderApp, importOptions) {
|
|
@@ -34531,7 +34581,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
34531
34581
|
instance.clear?.();
|
|
34532
34582
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
34533
34583
|
};
|
|
34534
|
-
const instance = renderApp(/* @__PURE__ */
|
|
34584
|
+
const instance = renderApp(/* @__PURE__ */ jsx67(App, { importOptions, inkClear }));
|
|
34535
34585
|
await instance.waitUntilExit();
|
|
34536
34586
|
}
|
|
34537
34587
|
var init_app = __esm({
|