@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/app.js
CHANGED
|
@@ -3104,9 +3104,9 @@ function PreflightScreen({ onChoose, onQuit }) {
|
|
|
3104
3104
|
] });
|
|
3105
3105
|
}
|
|
3106
3106
|
|
|
3107
|
-
// packages/experience-design-system-cli/src/tui/
|
|
3108
|
-
import { useState as
|
|
3109
|
-
import { Box as
|
|
3107
|
+
// packages/experience-design-system-cli/src/tui/shared/components/PathStepScreen.tsx
|
|
3108
|
+
import { useState as useState7 } from "react";
|
|
3109
|
+
import { Box as Box12, Text as Text12, useInput as useInput9 } from "ink";
|
|
3110
3110
|
|
|
3111
3111
|
// packages/experience-design-system-cli/src/tui/shared/components/ClearableTextInput.tsx
|
|
3112
3112
|
import { useRef } from "react";
|
|
@@ -3137,83 +3137,400 @@ function ClearableTextInput({ onChange, ...props }) {
|
|
|
3137
3137
|
);
|
|
3138
3138
|
}
|
|
3139
3139
|
|
|
3140
|
-
// packages/experience-design-system-cli/src/tui/
|
|
3141
|
-
import {
|
|
3140
|
+
// packages/experience-design-system-cli/src/tui/shared/components/MenuScreen.tsx
|
|
3141
|
+
import { useState as useState6 } from "react";
|
|
3142
|
+
import { Box as Box11, Text as Text11, useInput as useInput8 } from "ink";
|
|
3142
3143
|
|
|
3143
|
-
// packages/experience-design-system-cli/src/tui/
|
|
3144
|
-
|
|
3145
|
-
|
|
3144
|
+
// packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
|
|
3145
|
+
import { useState as useState5 } from "react";
|
|
3146
|
+
import { Box as Box10, Text as Text10, useInput as useInput7 } from "ink";
|
|
3147
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3148
|
+
function formLabelWidth(rows) {
|
|
3149
|
+
return Math.max(...rows.map((row) => row.label.length));
|
|
3146
3150
|
}
|
|
3147
|
-
function
|
|
3148
|
-
|
|
3149
|
-
|
|
3151
|
+
function FormReadOnlyRow({
|
|
3152
|
+
label,
|
|
3153
|
+
labelWidth,
|
|
3154
|
+
children
|
|
3155
|
+
}) {
|
|
3156
|
+
return /* @__PURE__ */ jsxs10(Box10, { gap: 1, children: [
|
|
3157
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
3158
|
+
/* @__PURE__ */ jsx11(Box10, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: label }) }),
|
|
3159
|
+
children
|
|
3160
|
+
] });
|
|
3161
|
+
}
|
|
3162
|
+
function FieldForm({
|
|
3163
|
+
header,
|
|
3164
|
+
title,
|
|
3165
|
+
subtitle,
|
|
3166
|
+
fields: fields2,
|
|
3167
|
+
values,
|
|
3168
|
+
onChange,
|
|
3169
|
+
onSave,
|
|
3170
|
+
saveLabel = "save",
|
|
3171
|
+
enterAdvances = false,
|
|
3172
|
+
onSkip,
|
|
3173
|
+
skipLabel: skipLabel2 = "skip",
|
|
3174
|
+
onQuit,
|
|
3175
|
+
quitLabel = "back without saving",
|
|
3176
|
+
actions = [],
|
|
3177
|
+
notice,
|
|
3178
|
+
busy = false,
|
|
3179
|
+
children
|
|
3180
|
+
}) {
|
|
3181
|
+
const [active, setActive] = useState5(0);
|
|
3182
|
+
const [editing, setEditing] = useState5(false);
|
|
3183
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState5("");
|
|
3184
|
+
const rowCount = fields2.length + actions.length;
|
|
3185
|
+
const labelWidth = formLabelWidth([...fields2, ...actions]);
|
|
3186
|
+
const currentField = active < fields2.length ? fields2[active] : void 0;
|
|
3187
|
+
const currentAction = currentField ? void 0 : actions[active - fields2.length];
|
|
3188
|
+
useInput7((input, key) => {
|
|
3189
|
+
if (busy) return;
|
|
3190
|
+
if (editing) {
|
|
3191
|
+
if (key.escape && currentField) {
|
|
3192
|
+
onChange(currentField.key, valueBeforeEdit);
|
|
3193
|
+
setEditing(false);
|
|
3194
|
+
}
|
|
3195
|
+
return;
|
|
3196
|
+
}
|
|
3197
|
+
if (key.escape || input === "q") {
|
|
3198
|
+
onQuit();
|
|
3199
|
+
return;
|
|
3200
|
+
}
|
|
3201
|
+
if (input === "s") {
|
|
3202
|
+
onSave();
|
|
3203
|
+
return;
|
|
3204
|
+
}
|
|
3205
|
+
if (input === "k" && onSkip) {
|
|
3206
|
+
onSkip();
|
|
3207
|
+
return;
|
|
3208
|
+
}
|
|
3209
|
+
if (isClearKey(input, key) && currentField) {
|
|
3210
|
+
onChange(currentField.key, "");
|
|
3211
|
+
return;
|
|
3212
|
+
}
|
|
3213
|
+
if (key.tab || key.downArrow) {
|
|
3214
|
+
setActive((i) => (i + 1) % rowCount);
|
|
3215
|
+
return;
|
|
3216
|
+
}
|
|
3217
|
+
if (key.upArrow) {
|
|
3218
|
+
setActive((i) => (i - 1 + rowCount) % rowCount);
|
|
3219
|
+
return;
|
|
3220
|
+
}
|
|
3221
|
+
if (key.return) {
|
|
3222
|
+
if (currentField) {
|
|
3223
|
+
setValueBeforeEdit(values[currentField.key]);
|
|
3224
|
+
setEditing(true);
|
|
3225
|
+
} else {
|
|
3226
|
+
currentAction?.onRun();
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
});
|
|
3230
|
+
const isLastField = active === fields2.length - 1;
|
|
3231
|
+
const submitField = () => {
|
|
3232
|
+
if (!enterAdvances) {
|
|
3233
|
+
setEditing(false);
|
|
3234
|
+
return;
|
|
3235
|
+
}
|
|
3236
|
+
if (isLastField) {
|
|
3237
|
+
setEditing(false);
|
|
3238
|
+
onSave();
|
|
3239
|
+
return;
|
|
3240
|
+
}
|
|
3241
|
+
const next = fields2[active + 1];
|
|
3242
|
+
setValueBeforeEdit(values[next.key]);
|
|
3243
|
+
setActive(active + 1);
|
|
3244
|
+
};
|
|
3245
|
+
const pointer = (isActive) => /* @__PURE__ */ jsx11(Text10, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " });
|
|
3246
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
3247
|
+
header,
|
|
3248
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 2, paddingTop: header ? 0 : 1, paddingBottom: 1, children: [
|
|
3249
|
+
/* @__PURE__ */ jsx11(Text10, { bold: true, children: title }),
|
|
3250
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
3251
|
+
subtitle && /* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: subtitle }),
|
|
3252
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
3253
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
3254
|
+
fields2.map((field, index) => {
|
|
3255
|
+
const isActive = index === active;
|
|
3256
|
+
const value = values[field.key];
|
|
3257
|
+
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
3258
|
+
return /* @__PURE__ */ jsxs10(Box10, { gap: 1, children: [
|
|
3259
|
+
pointer(isActive),
|
|
3260
|
+
/* @__PURE__ */ jsx11(Box10, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text10, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
3261
|
+
isActive && editing ? /* @__PURE__ */ jsx11(
|
|
3262
|
+
ClearableTextInput,
|
|
3263
|
+
{
|
|
3264
|
+
value,
|
|
3265
|
+
onChange: (next) => onChange(field.key, next),
|
|
3266
|
+
onSubmit: submitField,
|
|
3267
|
+
mask: field.masked ? "\u2022" : void 0
|
|
3268
|
+
}
|
|
3269
|
+
) : display ? /* @__PURE__ */ jsx11(Text10, { bold: true, children: display }) : (
|
|
3270
|
+
// An empty value shows its hint (or "(empty)") in the value's place, not after an empty element, so the
|
|
3271
|
+
// text starts in the same column as every other row's.
|
|
3272
|
+
/* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: field.hint ?? "(empty)" })
|
|
3273
|
+
),
|
|
3274
|
+
display && field.hint && /* @__PURE__ */ jsx11(Text10, { color: PALETTE.muted, children: field.hint })
|
|
3275
|
+
] }, field.key);
|
|
3276
|
+
}),
|
|
3277
|
+
actions.map((action, index) => {
|
|
3278
|
+
const isActive = fields2.length + index === active;
|
|
3279
|
+
return /* @__PURE__ */ jsxs10(Box10, { gap: 1, children: [
|
|
3280
|
+
pointer(isActive),
|
|
3281
|
+
/* @__PURE__ */ jsx11(Box10, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text10, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: action.label }) }),
|
|
3282
|
+
/* @__PURE__ */ jsx11(Text10, { color: action.running ? PALETTE.accent : PALETTE.muted, children: action.running ? action.runningText ?? "running..." : action.description })
|
|
3283
|
+
] }, action.label);
|
|
3284
|
+
})
|
|
3285
|
+
] }),
|
|
3286
|
+
notice && /* @__PURE__ */ jsxs10(Fragment, { children: [
|
|
3287
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
3288
|
+
/* @__PURE__ */ jsxs10(Text10, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
3289
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
3290
|
+
" ",
|
|
3291
|
+
notice.text
|
|
3292
|
+
] })
|
|
3293
|
+
] }),
|
|
3294
|
+
children,
|
|
3295
|
+
/* @__PURE__ */ jsx11(Text10, { children: " " }),
|
|
3296
|
+
/* @__PURE__ */ jsx11(
|
|
3297
|
+
ControlHints,
|
|
3298
|
+
{
|
|
3299
|
+
hints: editing ? [
|
|
3300
|
+
{ keys: "type", label: "edit" },
|
|
3301
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
3302
|
+
{ keys: "\u23CE", label: enterAdvances ? isLastField ? saveLabel : "next" : "done" },
|
|
3303
|
+
{ keys: "Ctrl+D", label: "clear" },
|
|
3304
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
3305
|
+
] : [
|
|
3306
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
3307
|
+
{ keys: "\u23CE", label: currentAction ? currentAction.hint : "edit" },
|
|
3308
|
+
...currentField ? [{ keys: "Ctrl+D", label: "clear" }] : [],
|
|
3309
|
+
{ keys: "s", label: saveLabel },
|
|
3310
|
+
...onSkip ? [{ keys: "k", label: skipLabel2 }] : [],
|
|
3311
|
+
{ keys: "Esc/q", label: quitLabel }
|
|
3312
|
+
]
|
|
3313
|
+
}
|
|
3314
|
+
)
|
|
3315
|
+
] })
|
|
3316
|
+
] });
|
|
3150
3317
|
}
|
|
3151
3318
|
|
|
3152
|
-
// packages/experience-design-system-cli/src/tui/
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3319
|
+
// packages/experience-design-system-cli/src/tui/shared/components/MenuScreen.tsx
|
|
3320
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3321
|
+
function MenuScreen({
|
|
3322
|
+
title,
|
|
3323
|
+
subtitle,
|
|
3324
|
+
menu,
|
|
3325
|
+
rows = [],
|
|
3326
|
+
onChoose,
|
|
3327
|
+
onEscape,
|
|
3328
|
+
dataTitle = "Details",
|
|
3329
|
+
busy = false,
|
|
3330
|
+
children
|
|
3331
|
+
}) {
|
|
3332
|
+
const [focus, setFocus] = useState6(0);
|
|
3333
|
+
useInput8((_input, key) => {
|
|
3334
|
+
if (busy) return;
|
|
3335
|
+
if (key.escape) onEscape();
|
|
3336
|
+
else if (key.return) onChoose(menu[focus].choice);
|
|
3337
|
+
else if (key.upArrow) setFocus((current) => (current - 1 + menu.length) % menu.length);
|
|
3338
|
+
else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % menu.length);
|
|
3161
3339
|
});
|
|
3340
|
+
const labelWidth = formLabelWidth([...menu, ...rows]);
|
|
3341
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
3342
|
+
/* @__PURE__ */ jsx12(StepHeader, { step: "setup" }),
|
|
3343
|
+
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
3344
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.text, children: title }),
|
|
3345
|
+
/* @__PURE__ */ jsx12(Text11, { children: " " }),
|
|
3346
|
+
subtitle && /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
3347
|
+
/* @__PURE__ */ jsx12(Text11, { color: PALETTE.muted, children: subtitle }),
|
|
3348
|
+
/* @__PURE__ */ jsx12(Text11, { children: " " })
|
|
3349
|
+
] }),
|
|
3350
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.accent, children: "ACTIONS" }),
|
|
3351
|
+
menu.map((item, index) => {
|
|
3352
|
+
const focused = index === focus;
|
|
3353
|
+
return /* @__PURE__ */ jsxs11(Box11, { gap: 1, children: [
|
|
3354
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.accent, children: focused ? "\u276F" : " " }),
|
|
3355
|
+
/* @__PURE__ */ jsx12(Box11, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text11, { bold: focused, color: focused ? PALETTE.accent : PALETTE.text, children: item.label }) }),
|
|
3356
|
+
/* @__PURE__ */ jsx12(Text11, { color: PALETTE.muted, children: item.description })
|
|
3357
|
+
] }, item.choice);
|
|
3358
|
+
}),
|
|
3359
|
+
(rows.length > 0 || children) && /* @__PURE__ */ jsxs11(
|
|
3360
|
+
Box11,
|
|
3361
|
+
{
|
|
3362
|
+
flexDirection: "column",
|
|
3363
|
+
marginTop: 1,
|
|
3364
|
+
borderStyle: "single",
|
|
3365
|
+
borderColor: PALETTE.border,
|
|
3366
|
+
borderBottom: false,
|
|
3367
|
+
borderLeft: false,
|
|
3368
|
+
borderRight: false,
|
|
3369
|
+
children: [
|
|
3370
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, color: PALETTE.muted, children: dataTitle.toUpperCase() }),
|
|
3371
|
+
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)),
|
|
3372
|
+
children
|
|
3373
|
+
]
|
|
3374
|
+
}
|
|
3375
|
+
)
|
|
3376
|
+
] })
|
|
3377
|
+
] });
|
|
3162
3378
|
}
|
|
3163
3379
|
|
|
3164
|
-
// packages/experience-design-system-cli/src/tui/
|
|
3165
|
-
import { jsx as
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3380
|
+
// packages/experience-design-system-cli/src/tui/shared/components/PathStepScreen.tsx
|
|
3381
|
+
import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3382
|
+
var MENU = [
|
|
3383
|
+
{ choice: "continue", label: "Continue", description: "Use this path and go on" },
|
|
3384
|
+
{ choice: "edit", label: "Edit", description: "Change the path" },
|
|
3385
|
+
{ choice: "back", label: "Back", description: "Go back" }
|
|
3386
|
+
];
|
|
3387
|
+
function PathStepScreen({
|
|
3388
|
+
title,
|
|
3389
|
+
subtitle,
|
|
3390
|
+
label,
|
|
3391
|
+
initialPath = "",
|
|
3392
|
+
toPath,
|
|
3393
|
+
check,
|
|
3394
|
+
onContinue,
|
|
3395
|
+
onBack
|
|
3396
|
+
}) {
|
|
3397
|
+
const [value, setValue] = useState7(initialPath);
|
|
3398
|
+
const [savedValue, setSavedValue] = useState7(toPath(initialPath) === null ? "" : initialPath);
|
|
3399
|
+
const [editing, setEditing] = useState7(toPath(initialPath) === null);
|
|
3400
|
+
const [failure, setFailure] = useState7(null);
|
|
3401
|
+
useInput9(
|
|
3402
|
+
(_input, key) => {
|
|
3403
|
+
if (!key.escape) return;
|
|
3404
|
+
if (savedValue === "") {
|
|
3405
|
+
onBack();
|
|
3406
|
+
return;
|
|
3407
|
+
}
|
|
3408
|
+
setValue(savedValue);
|
|
3409
|
+
setFailure(null);
|
|
3410
|
+
setEditing(false);
|
|
3411
|
+
},
|
|
3412
|
+
{ isActive: editing }
|
|
3413
|
+
);
|
|
3414
|
+
const choose = (choice) => {
|
|
3415
|
+
if (choice === "edit") {
|
|
3416
|
+
setFailure(null);
|
|
3417
|
+
setEditing(true);
|
|
3418
|
+
return;
|
|
3419
|
+
}
|
|
3420
|
+
if (choice === "back") {
|
|
3421
|
+
onBack();
|
|
3422
|
+
return;
|
|
3423
|
+
}
|
|
3424
|
+
const path5 = toPath(value);
|
|
3425
|
+
if (path5 === null) return;
|
|
3426
|
+
const result = check(path5);
|
|
3427
|
+
if (result.ok) onContinue(result.path);
|
|
3428
|
+
else setFailure({ error: result.error, resolvedPath: result.resolvedPath });
|
|
3172
3429
|
};
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3430
|
+
const submit = (typed) => {
|
|
3431
|
+
if (toPath(typed) === null) {
|
|
3432
|
+
setFailure({ error: `Enter the ${label.toLowerCase()}.` });
|
|
3433
|
+
return;
|
|
3434
|
+
}
|
|
3435
|
+
setSavedValue(typed);
|
|
3436
|
+
setEditing(false);
|
|
3437
|
+
};
|
|
3438
|
+
const failureLines = failure && /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
3439
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
3440
|
+
/* @__PURE__ */ jsxs12(Text12, { color: PALETTE.error, children: [
|
|
3441
|
+
"\u2717 ",
|
|
3442
|
+
failure.error
|
|
3443
|
+
] }),
|
|
3444
|
+
failure.resolvedPath && /* @__PURE__ */ jsxs12(Text12, { color: PALETTE.muted, children: [
|
|
3445
|
+
" Resolved to: ",
|
|
3446
|
+
failure.resolvedPath
|
|
3447
|
+
] })
|
|
3448
|
+
] });
|
|
3449
|
+
if (!editing) {
|
|
3450
|
+
return /* @__PURE__ */ jsx13(
|
|
3451
|
+
MenuScreen,
|
|
3452
|
+
{
|
|
3453
|
+
title,
|
|
3454
|
+
subtitle,
|
|
3455
|
+
menu: MENU,
|
|
3456
|
+
rows: [{ label, value: savedValue }],
|
|
3457
|
+
onChoose: choose,
|
|
3458
|
+
onEscape: onBack,
|
|
3459
|
+
children: failureLines
|
|
3460
|
+
}
|
|
3461
|
+
);
|
|
3462
|
+
}
|
|
3463
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", children: [
|
|
3464
|
+
/* @__PURE__ */ jsx13(StepHeader, { step: "setup" }),
|
|
3465
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
3466
|
+
/* @__PURE__ */ jsx13(Text12, { bold: true, children: title }),
|
|
3467
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
3468
|
+
/* @__PURE__ */ jsx13(Text12, { color: PALETTE.muted, children: subtitle }),
|
|
3469
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
3470
|
+
/* @__PURE__ */ jsxs12(Box12, { gap: 1, children: [
|
|
3471
|
+
/* @__PURE__ */ jsx13(Text12, { color: PALETTE.accent, children: "?" }),
|
|
3472
|
+
/* @__PURE__ */ jsxs12(Text12, { children: [
|
|
3473
|
+
label,
|
|
3474
|
+
":"
|
|
3475
|
+
] }),
|
|
3476
|
+
/* @__PURE__ */ jsx13(
|
|
3477
|
+
ClearableTextInput,
|
|
3478
|
+
{
|
|
3479
|
+
value,
|
|
3480
|
+
onChange: (next) => {
|
|
3481
|
+
setValue(next);
|
|
3482
|
+
setFailure(null);
|
|
3483
|
+
},
|
|
3484
|
+
onSubmit: submit
|
|
3485
|
+
}
|
|
3486
|
+
)
|
|
3183
3487
|
] }),
|
|
3184
|
-
|
|
3488
|
+
failureLines,
|
|
3489
|
+
/* @__PURE__ */ jsx13(Text12, { children: " " }),
|
|
3490
|
+
/* @__PURE__ */ jsx13(
|
|
3491
|
+
ControlHints,
|
|
3492
|
+
{
|
|
3493
|
+
hints: [
|
|
3494
|
+
{ keys: "\u23CE", label: "done" },
|
|
3495
|
+
{ keys: "Ctrl+D", label: "clear" },
|
|
3496
|
+
{ keys: "Esc", label: savedValue === "" ? "back" : "cancel edit" }
|
|
3497
|
+
]
|
|
3498
|
+
}
|
|
3499
|
+
)
|
|
3185
3500
|
] })
|
|
3186
3501
|
] });
|
|
3187
3502
|
}
|
|
3188
3503
|
|
|
3189
|
-
// packages/experience-design-system-cli/src/tui/import/steps/
|
|
3190
|
-
|
|
3191
|
-
|
|
3504
|
+
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/logic.ts
|
|
3505
|
+
function toProjectPath(value) {
|
|
3506
|
+
const projectPath = value.trim();
|
|
3507
|
+
return projectPath === "" ? null : projectPath;
|
|
3508
|
+
}
|
|
3192
3509
|
|
|
3193
|
-
// packages/experience-design-system-cli/src/tui/import/steps/
|
|
3194
|
-
import {
|
|
3510
|
+
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
3511
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
3512
|
+
function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
3513
|
+
return /* @__PURE__ */ jsx14(
|
|
3514
|
+
PathStepScreen,
|
|
3515
|
+
{
|
|
3516
|
+
title: "Where is your component library?",
|
|
3517
|
+
subtitle: "The folder with your components. You can use ~, relative, or absolute paths.",
|
|
3518
|
+
label: "Project path",
|
|
3519
|
+
initialPath,
|
|
3520
|
+
toPath: toProjectPath,
|
|
3521
|
+
check: (path5) => ({ ok: true, path: path5 }),
|
|
3522
|
+
onContinue,
|
|
3523
|
+
onBack: onQuit
|
|
3524
|
+
}
|
|
3525
|
+
);
|
|
3526
|
+
}
|
|
3195
3527
|
|
|
3196
3528
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/logic.ts
|
|
3197
|
-
function shouldGoBack(key) {
|
|
3198
|
-
return key.escape;
|
|
3199
|
-
}
|
|
3200
3529
|
function toTokenPath(value) {
|
|
3201
3530
|
const tokenPath = value.trim();
|
|
3202
3531
|
return tokenPath === "" ? null : tokenPath;
|
|
3203
3532
|
}
|
|
3204
3533
|
|
|
3205
|
-
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
|
|
3206
|
-
var TOKEN_INPUT_CONTROLS = [
|
|
3207
|
-
{ keys: "Enter", label: "Continue" },
|
|
3208
|
-
{ keys: "Ctrl+D", label: "Clear" },
|
|
3209
|
-
{ keys: "Esc", label: "Back" }
|
|
3210
|
-
];
|
|
3211
|
-
function useTokenInputControls(onBack) {
|
|
3212
|
-
useInput8((_input, key) => {
|
|
3213
|
-
if (shouldGoBack(key)) onBack();
|
|
3214
|
-
});
|
|
3215
|
-
}
|
|
3216
|
-
|
|
3217
3534
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/validate-path.ts
|
|
3218
3535
|
import { statSync } from "node:fs";
|
|
3219
3536
|
|
|
@@ -3254,153 +3571,26 @@ function validateTokenPath(rawPath) {
|
|
|
3254
3571
|
}
|
|
3255
3572
|
|
|
3256
3573
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
|
|
3257
|
-
import { jsx as
|
|
3574
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3258
3575
|
function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
return;
|
|
3576
|
+
return /* @__PURE__ */ jsx15(
|
|
3577
|
+
PathStepScreen,
|
|
3578
|
+
{
|
|
3579
|
+
title: "Design tokens",
|
|
3580
|
+
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).",
|
|
3581
|
+
label: "Token path",
|
|
3582
|
+
initialPath,
|
|
3583
|
+
toPath: toTokenPath,
|
|
3584
|
+
check: validateTokenPath,
|
|
3585
|
+
onContinue: onConfirm,
|
|
3586
|
+
onBack
|
|
3271
3587
|
}
|
|
3272
|
-
|
|
3273
|
-
if (check.ok) onConfirm(check.path);
|
|
3274
|
-
else setFailure({ error: check.error, resolvedPath: check.resolvedPath });
|
|
3275
|
-
};
|
|
3276
|
-
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
3277
|
-
/* @__PURE__ */ jsx12(StepHeader, { step: "setup" }),
|
|
3278
|
-
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
3279
|
-
/* @__PURE__ */ jsx12(Text11, { bold: true, children: "Design tokens" }),
|
|
3280
|
-
/* @__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)." }),
|
|
3281
|
-
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
3282
|
-
/* @__PURE__ */ jsxs11(Box11, { gap: 1, children: [
|
|
3283
|
-
/* @__PURE__ */ jsx12(Text11, { color: PALETTE.accent, children: "?" }),
|
|
3284
|
-
/* @__PURE__ */ jsx12(Text11, { children: "Token path:" }),
|
|
3285
|
-
/* @__PURE__ */ jsx12(ClearableTextInput, { value: tokenPath, onChange: change, onSubmit: submit })
|
|
3286
|
-
] }),
|
|
3287
|
-
failure && /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
3288
|
-
/* @__PURE__ */ jsxs11(Text11, { color: PALETTE.error, children: [
|
|
3289
|
-
"\u2717 ",
|
|
3290
|
-
failure.error
|
|
3291
|
-
] }),
|
|
3292
|
-
failure.resolvedPath && /* @__PURE__ */ jsxs11(Text11, { color: PALETTE.muted, children: [
|
|
3293
|
-
" Resolved to: ",
|
|
3294
|
-
failure.resolvedPath
|
|
3295
|
-
] })
|
|
3296
|
-
] })
|
|
3297
|
-
] }),
|
|
3298
|
-
/* @__PURE__ */ jsx12(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx12(ControlHints, { hints: TOKEN_INPUT_CONTROLS }) })
|
|
3299
|
-
] })
|
|
3300
|
-
] });
|
|
3588
|
+
);
|
|
3301
3589
|
}
|
|
3302
3590
|
|
|
3303
3591
|
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
|
|
3304
|
-
import { useEffect as useEffect4, useMemo, useState as
|
|
3305
|
-
import { Box as
|
|
3306
|
-
|
|
3307
|
-
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/controls.ts
|
|
3308
|
-
import { useInput as useInput9 } from "ink";
|
|
3309
|
-
|
|
3310
|
-
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/logic.ts
|
|
3311
|
-
var COMPONENT_CATEGORIES = ["tsx", "ts", "vue", "astro", "jsx", "js"];
|
|
3312
|
-
var ROW_LABELS = {
|
|
3313
|
-
tsx: ".tsx files",
|
|
3314
|
-
ts: ".ts files",
|
|
3315
|
-
vue: ".vue files",
|
|
3316
|
-
astro: ".astro files",
|
|
3317
|
-
jsx: ".jsx files",
|
|
3318
|
-
js: ".js files",
|
|
3319
|
-
json: ".json files (design tokens)",
|
|
3320
|
-
other: "other (ignored)"
|
|
3321
|
-
};
|
|
3322
|
-
var ROW_ORDER = ["tsx", "ts", "vue", "astro", "jsx", "js", "json", "other"];
|
|
3323
|
-
function describeFailure(failure, path5) {
|
|
3324
|
-
switch (failure) {
|
|
3325
|
-
case "is-file":
|
|
3326
|
-
return {
|
|
3327
|
-
headline: "That's a file, not a directory.",
|
|
3328
|
-
hints: [
|
|
3329
|
-
"Provide the path to your component library's root folder, not a specific file.",
|
|
3330
|
-
"Example: ~/projects/my-design-system"
|
|
3331
|
-
]
|
|
3332
|
-
};
|
|
3333
|
-
case "not-found":
|
|
3334
|
-
return {
|
|
3335
|
-
headline: `Directory not found: ${path5}`,
|
|
3336
|
-
hints: ["Double-check the path and try again. Tip: you can use ~, relative, or absolute paths."]
|
|
3337
|
-
};
|
|
3338
|
-
case "permission-denied":
|
|
3339
|
-
return {
|
|
3340
|
-
headline: `Permission denied: ${path5}`,
|
|
3341
|
-
hints: ["You don't have read access to this directory."]
|
|
3342
|
-
};
|
|
3343
|
-
case "not-directory":
|
|
3344
|
-
return { headline: `Not a directory: ${path5}`, hints: [] };
|
|
3345
|
-
case "unreadable":
|
|
3346
|
-
return { headline: `Cannot access: ${path5}`, hints: [] };
|
|
3347
|
-
}
|
|
3348
|
-
}
|
|
3349
|
-
function summarize(counts, { hasTokens = true } = {}) {
|
|
3350
|
-
const rows = ROW_ORDER.filter((category) => counts[category] > 0).map((category) => {
|
|
3351
|
-
if (category === "json" && !hasTokens) return { label: ".json files (ignored)", count: counts.json, tone: "muted" };
|
|
3352
|
-
const tone = category === "json" ? "accent" : category === "other" ? "muted" : "default";
|
|
3353
|
-
return { label: ROW_LABELS[category], count: counts[category], tone };
|
|
3354
|
-
});
|
|
3355
|
-
const componentFiles = COMPONENT_CATEGORIES.reduce((sum, category) => sum + counts[category], 0);
|
|
3356
|
-
if (componentFiles > 0) return { total: counts.total, rows };
|
|
3357
|
-
if (hasTokens && counts.json > 0) {
|
|
3358
|
-
return { total: counts.total, rows, warning: "No component files found \u2014 only token files detected." };
|
|
3359
|
-
}
|
|
3360
|
-
return {
|
|
3361
|
-
total: counts.total,
|
|
3362
|
-
rows,
|
|
3363
|
-
warning: hasTokens ? "No component or token files found. Try a different path." : "No component files found. Try a different path."
|
|
3364
|
-
};
|
|
3365
|
-
}
|
|
3366
|
-
function phaseOf(scan) {
|
|
3367
|
-
if (scan === void 0) return "scanning";
|
|
3368
|
-
return scan.ok ? "ready" : "failed";
|
|
3369
|
-
}
|
|
3370
|
-
function keyAction(phase, input, key) {
|
|
3371
|
-
if (key.escape) return "back";
|
|
3372
|
-
if (phase === "ready") {
|
|
3373
|
-
if (key.return) return "confirm";
|
|
3374
|
-
if (input === "e") return "change-path";
|
|
3375
|
-
}
|
|
3376
|
-
if (phase === "failed" && (key.return || input === "e")) return "change-path";
|
|
3377
|
-
return void 0;
|
|
3378
|
-
}
|
|
3379
|
-
|
|
3380
|
-
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/controls.ts
|
|
3381
|
-
var CONTROLS = {
|
|
3382
|
-
scanning: [{ keys: "Esc", label: "Back" }],
|
|
3383
|
-
ready: [
|
|
3384
|
-
{ keys: "Enter", label: "Yes, continue" },
|
|
3385
|
-
{ keys: "e", label: "Change path" },
|
|
3386
|
-
{ keys: "Esc", label: "Back" }
|
|
3387
|
-
],
|
|
3388
|
-
failed: [
|
|
3389
|
-
{ keys: "Enter/e", label: "Try a different path" },
|
|
3390
|
-
{ keys: "Esc", label: "Back" }
|
|
3391
|
-
]
|
|
3392
|
-
};
|
|
3393
|
-
function controlsFor(phase) {
|
|
3394
|
-
return CONTROLS[phase];
|
|
3395
|
-
}
|
|
3396
|
-
function usePathValidationControls(phase, handlers) {
|
|
3397
|
-
useInput9((input, key) => {
|
|
3398
|
-
const action = keyAction(phase, input, key);
|
|
3399
|
-
if (action === "confirm") handlers.onConfirm();
|
|
3400
|
-
else if (action === "change-path") handlers.onChangePath();
|
|
3401
|
-
else if (action === "back") handlers.onBack();
|
|
3402
|
-
});
|
|
3403
|
-
}
|
|
3592
|
+
import { useEffect as useEffect4, useMemo, useState as useState8 } from "react";
|
|
3593
|
+
import { Box as Box13, Text as Text13 } from "ink";
|
|
3404
3594
|
|
|
3405
3595
|
// packages/experience-design-system-backend-pipeline/dist/src/persistence/src/session/repositories/db.js
|
|
3406
3596
|
import { DatabaseSync } from "node:sqlite";
|
|
@@ -17884,29 +18074,96 @@ async function runGenerateComponentsSession(request) {
|
|
|
17884
18074
|
db.close();
|
|
17885
18075
|
}
|
|
17886
18076
|
}
|
|
17887
|
-
|
|
17888
|
-
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/helpers/scan-files.ts
|
|
17889
|
-
function scanFiles(directory) {
|
|
17890
|
-
return toScanResult(collectFiles(directory));
|
|
17891
|
-
}
|
|
17892
|
-
function toScanResult(outcome) {
|
|
17893
|
-
if (!outcome.ok) return { ok: false, failure: outcome.failure };
|
|
18077
|
+
|
|
18078
|
+
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/helpers/scan-files.ts
|
|
18079
|
+
function scanFiles(directory) {
|
|
18080
|
+
return toScanResult(collectFiles(directory));
|
|
18081
|
+
}
|
|
18082
|
+
function toScanResult(outcome) {
|
|
18083
|
+
if (!outcome.ok) return { ok: false, failure: outcome.failure };
|
|
18084
|
+
return {
|
|
18085
|
+
ok: true,
|
|
18086
|
+
counts: foldSvelteAndMdIntoOther(outcome.result.counts),
|
|
18087
|
+
filePaths: outcome.result.filePaths,
|
|
18088
|
+
warnings: outcome.result.warnings
|
|
18089
|
+
};
|
|
18090
|
+
}
|
|
18091
|
+
function foldSvelteAndMdIntoOther(counts) {
|
|
18092
|
+
const { svelte, md, ...rest } = counts;
|
|
18093
|
+
return { ...rest, other: rest.other + svelte + md };
|
|
18094
|
+
}
|
|
18095
|
+
|
|
18096
|
+
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/logic.ts
|
|
18097
|
+
var COMPONENT_CATEGORIES = ["tsx", "ts", "vue", "astro", "jsx", "js"];
|
|
18098
|
+
var ROW_LABELS = {
|
|
18099
|
+
tsx: ".tsx files",
|
|
18100
|
+
ts: ".ts files",
|
|
18101
|
+
vue: ".vue files",
|
|
18102
|
+
astro: ".astro files",
|
|
18103
|
+
jsx: ".jsx files",
|
|
18104
|
+
js: ".js files",
|
|
18105
|
+
json: ".json files (design tokens)",
|
|
18106
|
+
other: "other (ignored)"
|
|
18107
|
+
};
|
|
18108
|
+
var ROW_ORDER = ["tsx", "ts", "vue", "astro", "jsx", "js", "json", "other"];
|
|
18109
|
+
function describeFailure(failure, path5) {
|
|
18110
|
+
switch (failure) {
|
|
18111
|
+
case "is-file":
|
|
18112
|
+
return {
|
|
18113
|
+
headline: "That's a file, not a directory.",
|
|
18114
|
+
hints: [
|
|
18115
|
+
"Provide the path to your component library's root folder, not a specific file.",
|
|
18116
|
+
"Example: ~/projects/my-design-system"
|
|
18117
|
+
]
|
|
18118
|
+
};
|
|
18119
|
+
case "not-found":
|
|
18120
|
+
return {
|
|
18121
|
+
headline: `Directory not found: ${path5}`,
|
|
18122
|
+
hints: ["Double-check the path and try again. Tip: you can use ~, relative, or absolute paths."]
|
|
18123
|
+
};
|
|
18124
|
+
case "permission-denied":
|
|
18125
|
+
return {
|
|
18126
|
+
headline: `Permission denied: ${path5}`,
|
|
18127
|
+
hints: ["You don't have read access to this directory."]
|
|
18128
|
+
};
|
|
18129
|
+
case "not-directory":
|
|
18130
|
+
return { headline: `Not a directory: ${path5}`, hints: [] };
|
|
18131
|
+
case "unreadable":
|
|
18132
|
+
return { headline: `Cannot access: ${path5}`, hints: [] };
|
|
18133
|
+
}
|
|
18134
|
+
}
|
|
18135
|
+
function summarize(counts, { hasTokens = true } = {}) {
|
|
18136
|
+
const rows = ROW_ORDER.filter((category) => counts[category] > 0).map((category) => {
|
|
18137
|
+
if (category === "json" && !hasTokens) return { label: ".json files (ignored)", count: counts.json, tone: "muted" };
|
|
18138
|
+
const tone = category === "json" ? "accent" : category === "other" ? "muted" : "default";
|
|
18139
|
+
return { label: ROW_LABELS[category], count: counts[category], tone };
|
|
18140
|
+
});
|
|
18141
|
+
const componentFiles = COMPONENT_CATEGORIES.reduce((sum, category) => sum + counts[category], 0);
|
|
18142
|
+
if (componentFiles > 0) return { total: counts.total, rows };
|
|
18143
|
+
if (hasTokens && counts.json > 0) {
|
|
18144
|
+
return { total: counts.total, rows, warning: "No component files found \u2014 only token files detected." };
|
|
18145
|
+
}
|
|
17894
18146
|
return {
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
|
|
17898
|
-
warnings: outcome.result.warnings
|
|
18147
|
+
total: counts.total,
|
|
18148
|
+
rows,
|
|
18149
|
+
warning: hasTokens ? "No component or token files found. Try a different path." : "No component files found. Try a different path."
|
|
17899
18150
|
};
|
|
17900
18151
|
}
|
|
17901
|
-
function
|
|
17902
|
-
|
|
17903
|
-
return
|
|
18152
|
+
function phaseOf(scan) {
|
|
18153
|
+
if (scan === void 0) return "scanning";
|
|
18154
|
+
return scan.ok ? "ready" : "failed";
|
|
17904
18155
|
}
|
|
17905
18156
|
|
|
17906
18157
|
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
|
|
17907
|
-
import { jsx as
|
|
18158
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
18159
|
+
var BACK = { choice: "back", label: "Back", description: "Go back" };
|
|
18160
|
+
var MENUS = {
|
|
18161
|
+
scanning: [BACK],
|
|
18162
|
+
ready: [{ choice: "continue", label: "Continue", description: "Use these files and go on" }, BACK],
|
|
18163
|
+
failed: [{ choice: "change-path", label: "Try a different path", description: "Pick a different folder" }, BACK]
|
|
18164
|
+
};
|
|
17908
18165
|
function Row({ row }) {
|
|
17909
|
-
return /* @__PURE__ */
|
|
18166
|
+
return /* @__PURE__ */ jsxs13(Text13, { color: row.tone === "accent" ? PALETTE.accent : row.tone === "muted" ? PALETTE.muted : PALETTE.text, children: [
|
|
17910
18167
|
" \u2022 ",
|
|
17911
18168
|
String(row.count).padStart(3),
|
|
17912
18169
|
" ",
|
|
@@ -17915,12 +18172,12 @@ function Row({ row }) {
|
|
|
17915
18172
|
}
|
|
17916
18173
|
function Failure({ scan, path: path5 }) {
|
|
17917
18174
|
const { headline, hints } = describeFailure(scan.failure, path5);
|
|
17918
|
-
return /* @__PURE__ */
|
|
17919
|
-
/* @__PURE__ */
|
|
18175
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
18176
|
+
/* @__PURE__ */ jsxs13(Text13, { color: PALETTE.error, children: [
|
|
17920
18177
|
"\u2717 ",
|
|
17921
18178
|
headline
|
|
17922
18179
|
] }),
|
|
17923
|
-
hints.map((hint) => /* @__PURE__ */
|
|
18180
|
+
hints.map((hint) => /* @__PURE__ */ jsx16(Text13, { color: PALETTE.muted, children: hint }, hint))
|
|
17924
18181
|
] });
|
|
17925
18182
|
}
|
|
17926
18183
|
function Summary({
|
|
@@ -17929,24 +18186,23 @@ function Summary({
|
|
|
17929
18186
|
hasTokens
|
|
17930
18187
|
}) {
|
|
17931
18188
|
const { total, rows, warning } = summarize(scan.counts, { hasTokens });
|
|
17932
|
-
return /* @__PURE__ */
|
|
17933
|
-
/* @__PURE__ */
|
|
17934
|
-
"Scanned ",
|
|
17935
|
-
/* @__PURE__ */
|
|
18189
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", gap: 1, children: [
|
|
18190
|
+
/* @__PURE__ */ jsxs13(Text13, { children: [
|
|
18191
|
+
/* @__PURE__ */ jsx16(Text13, { color: PALETTE.muted, children: "Scanned " }),
|
|
18192
|
+
/* @__PURE__ */ jsx16(Text13, { color: PALETTE.text, children: path5 })
|
|
17936
18193
|
] }),
|
|
17937
|
-
/* @__PURE__ */
|
|
17938
|
-
/* @__PURE__ */
|
|
18194
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
18195
|
+
/* @__PURE__ */ jsxs13(Text13, { color: PALETTE.success, children: [
|
|
17939
18196
|
"\u2713 Found ",
|
|
17940
18197
|
total,
|
|
17941
18198
|
" files:"
|
|
17942
18199
|
] }),
|
|
17943
|
-
rows.map((row) => /* @__PURE__ */
|
|
18200
|
+
rows.map((row) => /* @__PURE__ */ jsx16(Row, { row }, row.label))
|
|
17944
18201
|
] }),
|
|
17945
|
-
warning && /* @__PURE__ */
|
|
18202
|
+
warning && /* @__PURE__ */ jsxs13(Text13, { color: PALETTE.warning, children: [
|
|
17946
18203
|
"\u26A0 ",
|
|
17947
18204
|
warning
|
|
17948
|
-
] })
|
|
17949
|
-
/* @__PURE__ */ jsx13(Text12, { children: "Does this look right?" })
|
|
18205
|
+
] })
|
|
17950
18206
|
] });
|
|
17951
18207
|
}
|
|
17952
18208
|
function PathValidationScreen({
|
|
@@ -17957,211 +18213,45 @@ function PathValidationScreen({
|
|
|
17957
18213
|
hasTokens = true
|
|
17958
18214
|
}) {
|
|
17959
18215
|
const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
17960
|
-
const [scan, setScan] =
|
|
18216
|
+
const [scan, setScan] = useState8();
|
|
17961
18217
|
useEffect4(() => {
|
|
17962
18218
|
setScan(scanFiles(resolvedPath));
|
|
17963
18219
|
}, [resolvedPath]);
|
|
17964
18220
|
const phase = phaseOf(scan);
|
|
17965
|
-
|
|
17966
|
-
|
|
18221
|
+
const choose = (choice) => {
|
|
18222
|
+
if (choice === "continue") {
|
|
17967
18223
|
if (scan?.ok) onConfirm({ projectPath: resolvedPath, filePaths: scan.filePaths });
|
|
17968
|
-
}
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
17973
|
-
/* @__PURE__ */
|
|
17974
|
-
|
|
17975
|
-
|
|
17976
|
-
|
|
17977
|
-
|
|
17978
|
-
|
|
17979
|
-
|
|
17980
|
-
|
|
17981
|
-
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
|
|
18224
|
+
} else if (choice === "change-path") onChangePath();
|
|
18225
|
+
else onBack();
|
|
18226
|
+
};
|
|
18227
|
+
return (
|
|
18228
|
+
// keyed by phase: the menu changes length, so its focus starts over
|
|
18229
|
+
/* @__PURE__ */ jsxs13(
|
|
18230
|
+
MenuScreen,
|
|
18231
|
+
{
|
|
18232
|
+
title: "Scan",
|
|
18233
|
+
dataTitle: "Scan result",
|
|
18234
|
+
menu: MENUS[phase],
|
|
18235
|
+
onChoose: choose,
|
|
18236
|
+
onEscape: onBack,
|
|
18237
|
+
children: [
|
|
18238
|
+
scan === void 0 && /* @__PURE__ */ jsxs13(Text13, { color: PALETTE.muted, children: [
|
|
18239
|
+
"Scanning ",
|
|
18240
|
+
/* @__PURE__ */ jsx16(Text13, { bold: true, children: resolvedPath }),
|
|
18241
|
+
"..."
|
|
18242
|
+
] }),
|
|
18243
|
+
scan?.ok === false && /* @__PURE__ */ jsx16(Failure, { scan, path: resolvedPath }),
|
|
18244
|
+
scan?.ok === true && /* @__PURE__ */ jsx16(Summary, { scan, path: resolvedPath, hasTokens })
|
|
18245
|
+
]
|
|
18246
|
+
},
|
|
18247
|
+
phase
|
|
18248
|
+
)
|
|
18249
|
+
);
|
|
17985
18250
|
}
|
|
17986
18251
|
|
|
17987
18252
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
17988
18253
|
import { useRef as useRef2, useState as useState9 } from "react";
|
|
17989
|
-
import {
|
|
17990
|
-
|
|
17991
|
-
// packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
|
|
17992
|
-
import { useState as useState8 } from "react";
|
|
17993
|
-
import { Box as Box13, Text as Text13, useInput as useInput10 } from "ink";
|
|
17994
|
-
import { Fragment, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
17995
|
-
function formLabelWidth(rows) {
|
|
17996
|
-
return Math.max(...rows.map((row) => row.label.length));
|
|
17997
|
-
}
|
|
17998
|
-
function FormReadOnlyRow({
|
|
17999
|
-
label,
|
|
18000
|
-
labelWidth,
|
|
18001
|
-
children
|
|
18002
|
-
}) {
|
|
18003
|
-
return /* @__PURE__ */ jsxs13(Box13, { gap: 1, children: [
|
|
18004
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
18005
|
-
/* @__PURE__ */ jsx14(Box13, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: label }) }),
|
|
18006
|
-
children
|
|
18007
|
-
] });
|
|
18008
|
-
}
|
|
18009
|
-
function FieldForm({
|
|
18010
|
-
header,
|
|
18011
|
-
title,
|
|
18012
|
-
subtitle,
|
|
18013
|
-
fields: fields2,
|
|
18014
|
-
values,
|
|
18015
|
-
onChange,
|
|
18016
|
-
onSave,
|
|
18017
|
-
saveLabel = "save",
|
|
18018
|
-
enterAdvances = false,
|
|
18019
|
-
onSkip,
|
|
18020
|
-
skipLabel: skipLabel2 = "skip",
|
|
18021
|
-
onQuit,
|
|
18022
|
-
quitLabel = "back without saving",
|
|
18023
|
-
actions = [],
|
|
18024
|
-
notice,
|
|
18025
|
-
busy = false,
|
|
18026
|
-
children
|
|
18027
|
-
}) {
|
|
18028
|
-
const [active, setActive] = useState8(0);
|
|
18029
|
-
const [editing, setEditing] = useState8(false);
|
|
18030
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState8("");
|
|
18031
|
-
const rowCount = fields2.length + actions.length;
|
|
18032
|
-
const labelWidth = formLabelWidth([...fields2, ...actions]);
|
|
18033
|
-
const currentField = active < fields2.length ? fields2[active] : void 0;
|
|
18034
|
-
const currentAction = currentField ? void 0 : actions[active - fields2.length];
|
|
18035
|
-
useInput10((input, key) => {
|
|
18036
|
-
if (busy) return;
|
|
18037
|
-
if (editing) {
|
|
18038
|
-
if (key.escape && currentField) {
|
|
18039
|
-
onChange(currentField.key, valueBeforeEdit);
|
|
18040
|
-
setEditing(false);
|
|
18041
|
-
}
|
|
18042
|
-
return;
|
|
18043
|
-
}
|
|
18044
|
-
if (key.escape || input === "q") {
|
|
18045
|
-
onQuit();
|
|
18046
|
-
return;
|
|
18047
|
-
}
|
|
18048
|
-
if (input === "s") {
|
|
18049
|
-
onSave();
|
|
18050
|
-
return;
|
|
18051
|
-
}
|
|
18052
|
-
if (input === "k" && onSkip) {
|
|
18053
|
-
onSkip();
|
|
18054
|
-
return;
|
|
18055
|
-
}
|
|
18056
|
-
if (isClearKey(input, key) && currentField) {
|
|
18057
|
-
onChange(currentField.key, "");
|
|
18058
|
-
return;
|
|
18059
|
-
}
|
|
18060
|
-
if (key.tab || key.downArrow) {
|
|
18061
|
-
setActive((i) => (i + 1) % rowCount);
|
|
18062
|
-
return;
|
|
18063
|
-
}
|
|
18064
|
-
if (key.upArrow) {
|
|
18065
|
-
setActive((i) => (i - 1 + rowCount) % rowCount);
|
|
18066
|
-
return;
|
|
18067
|
-
}
|
|
18068
|
-
if (key.return) {
|
|
18069
|
-
if (currentField) {
|
|
18070
|
-
setValueBeforeEdit(values[currentField.key]);
|
|
18071
|
-
setEditing(true);
|
|
18072
|
-
} else {
|
|
18073
|
-
currentAction?.onRun();
|
|
18074
|
-
}
|
|
18075
|
-
}
|
|
18076
|
-
});
|
|
18077
|
-
const isLastField = active === fields2.length - 1;
|
|
18078
|
-
const submitField = () => {
|
|
18079
|
-
if (!enterAdvances) {
|
|
18080
|
-
setEditing(false);
|
|
18081
|
-
return;
|
|
18082
|
-
}
|
|
18083
|
-
if (isLastField) {
|
|
18084
|
-
setEditing(false);
|
|
18085
|
-
onSave();
|
|
18086
|
-
return;
|
|
18087
|
-
}
|
|
18088
|
-
const next = fields2[active + 1];
|
|
18089
|
-
setValueBeforeEdit(values[next.key]);
|
|
18090
|
-
setActive(active + 1);
|
|
18091
|
-
};
|
|
18092
|
-
const pointer = (isActive) => /* @__PURE__ */ jsx14(Text13, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " });
|
|
18093
|
-
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
18094
|
-
header,
|
|
18095
|
-
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", paddingX: 2, paddingTop: header ? 0 : 1, paddingBottom: 1, children: [
|
|
18096
|
-
/* @__PURE__ */ jsx14(Text13, { bold: true, children: title }),
|
|
18097
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
18098
|
-
subtitle && /* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: subtitle }),
|
|
18099
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
18100
|
-
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
18101
|
-
fields2.map((field, index) => {
|
|
18102
|
-
const isActive = index === active;
|
|
18103
|
-
const value = values[field.key];
|
|
18104
|
-
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
18105
|
-
return /* @__PURE__ */ jsxs13(Box13, { gap: 1, children: [
|
|
18106
|
-
pointer(isActive),
|
|
18107
|
-
/* @__PURE__ */ jsx14(Box13, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx14(Text13, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
18108
|
-
isActive && editing ? /* @__PURE__ */ jsx14(
|
|
18109
|
-
ClearableTextInput,
|
|
18110
|
-
{
|
|
18111
|
-
value,
|
|
18112
|
-
onChange: (next) => onChange(field.key, next),
|
|
18113
|
-
onSubmit: submitField,
|
|
18114
|
-
mask: field.masked ? "\u2022" : void 0
|
|
18115
|
-
}
|
|
18116
|
-
) : display ? /* @__PURE__ */ jsx14(Text13, { bold: true, children: display }) : (
|
|
18117
|
-
// An empty value shows its hint (or "(empty)") in the value's place, not after an empty element, so the
|
|
18118
|
-
// text starts in the same column as every other row's.
|
|
18119
|
-
/* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: field.hint ?? "(empty)" })
|
|
18120
|
-
),
|
|
18121
|
-
display && field.hint && /* @__PURE__ */ jsx14(Text13, { color: PALETTE.muted, children: field.hint })
|
|
18122
|
-
] }, field.key);
|
|
18123
|
-
}),
|
|
18124
|
-
actions.map((action, index) => {
|
|
18125
|
-
const isActive = fields2.length + index === active;
|
|
18126
|
-
return /* @__PURE__ */ jsxs13(Box13, { gap: 1, children: [
|
|
18127
|
-
pointer(isActive),
|
|
18128
|
-
/* @__PURE__ */ jsx14(Box13, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx14(Text13, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: action.label }) }),
|
|
18129
|
-
/* @__PURE__ */ jsx14(Text13, { color: action.running ? PALETTE.accent : PALETTE.muted, children: action.running ? action.runningText ?? "running..." : action.description })
|
|
18130
|
-
] }, action.label);
|
|
18131
|
-
})
|
|
18132
|
-
] }),
|
|
18133
|
-
notice && /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
18134
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
18135
|
-
/* @__PURE__ */ jsxs13(Text13, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
18136
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
18137
|
-
" ",
|
|
18138
|
-
notice.text
|
|
18139
|
-
] })
|
|
18140
|
-
] }),
|
|
18141
|
-
children,
|
|
18142
|
-
/* @__PURE__ */ jsx14(Text13, { children: " " }),
|
|
18143
|
-
/* @__PURE__ */ jsx14(
|
|
18144
|
-
ControlHints,
|
|
18145
|
-
{
|
|
18146
|
-
hints: editing ? [
|
|
18147
|
-
{ keys: "type", label: "edit" },
|
|
18148
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
18149
|
-
{ keys: "\u23CE", label: enterAdvances ? isLastField ? saveLabel : "next" : "done" },
|
|
18150
|
-
{ keys: "Ctrl+D", label: "clear" },
|
|
18151
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
18152
|
-
] : [
|
|
18153
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
18154
|
-
{ keys: "\u23CE", label: currentAction ? currentAction.hint : "edit" },
|
|
18155
|
-
...currentField ? [{ keys: "Ctrl+D", label: "clear" }] : [],
|
|
18156
|
-
{ keys: "s", label: saveLabel },
|
|
18157
|
-
...onSkip ? [{ keys: "k", label: skipLabel2 }] : [],
|
|
18158
|
-
{ keys: "Esc/q", label: quitLabel }
|
|
18159
|
-
]
|
|
18160
|
-
}
|
|
18161
|
-
)
|
|
18162
|
-
] })
|
|
18163
|
-
] });
|
|
18164
|
-
}
|
|
18254
|
+
import { Text as Text14 } from "ink";
|
|
18165
18255
|
|
|
18166
18256
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/logic.ts
|
|
18167
18257
|
var FIELDS = ["spaceId", "environmentId", "cmaToken", "host"];
|
|
@@ -18219,82 +18309,19 @@ function toUserError(error, host) {
|
|
|
18219
18309
|
}
|
|
18220
18310
|
|
|
18221
18311
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
18222
|
-
import { Fragment as
|
|
18312
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
18223
18313
|
var FIELDS2 = [
|
|
18224
18314
|
{ key: "spaceId", label: "Space ID" },
|
|
18225
18315
|
{ key: "environmentId", label: "Environment ID" },
|
|
18226
18316
|
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
18227
18317
|
{ key: "host", label: "API Host", hint: "(default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com)" }
|
|
18228
18318
|
];
|
|
18229
|
-
var
|
|
18319
|
+
var MENU2 = [
|
|
18230
18320
|
{ choice: "continue", label: "Continue", description: "Check the credentials and go on" },
|
|
18231
18321
|
{ choice: "edit", label: "Edit", description: "Change the credentials" },
|
|
18232
18322
|
{ choice: "skip", label: "Skip", description: "Save files only, nothing is pushed" },
|
|
18233
18323
|
{ choice: "quit", label: "Quit", description: "Go back" }
|
|
18234
18324
|
];
|
|
18235
|
-
function CredentialsReview({
|
|
18236
|
-
values,
|
|
18237
|
-
subtitle,
|
|
18238
|
-
notice,
|
|
18239
|
-
validating,
|
|
18240
|
-
onChoose,
|
|
18241
|
-
children
|
|
18242
|
-
}) {
|
|
18243
|
-
const [focus, setFocus] = useState9(0);
|
|
18244
|
-
useInput11((_input, key) => {
|
|
18245
|
-
if (validating) return;
|
|
18246
|
-
if (key.escape) onChoose("quit");
|
|
18247
|
-
else if (key.return) onChoose(MENU[focus].choice);
|
|
18248
|
-
else if (key.upArrow) setFocus((current) => (current - 1 + MENU.length) % MENU.length);
|
|
18249
|
-
else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % MENU.length);
|
|
18250
|
-
});
|
|
18251
|
-
const labelWidth = formLabelWidth([...FIELDS2, ...MENU]);
|
|
18252
|
-
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
18253
|
-
/* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
18254
|
-
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
18255
|
-
/* @__PURE__ */ jsx15(Text14, { bold: true, children: "Contentful Credentials" }),
|
|
18256
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18257
|
-
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: subtitle }),
|
|
18258
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18259
|
-
MENU.map((item, index) => {
|
|
18260
|
-
const focused = index === focus;
|
|
18261
|
-
return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
|
|
18262
|
-
/* @__PURE__ */ jsx15(Text14, { color: focused ? PALETTE.accent : void 0, children: focused ? "\u276F" : " " }),
|
|
18263
|
-
/* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: focused, color: focused ? PALETTE.accent : PALETTE.muted, children: item.label }) }),
|
|
18264
|
-
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: item.description })
|
|
18265
|
-
] }, item.choice);
|
|
18266
|
-
}),
|
|
18267
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18268
|
-
FIELDS2.map((field) => {
|
|
18269
|
-
const value = values[field.key];
|
|
18270
|
-
return /* @__PURE__ */ jsx15(FormReadOnlyRow, { label: field.label, labelWidth, children: /* @__PURE__ */ jsx15(Text14, { bold: value !== "", children: field.masked ? "\u2022".repeat(value.length) : value || "(empty)" }) }, field.key);
|
|
18271
|
-
}),
|
|
18272
|
-
notice && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
18273
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18274
|
-
/* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
|
|
18275
|
-
"\u2717 ",
|
|
18276
|
-
notice.text
|
|
18277
|
-
] })
|
|
18278
|
-
] }),
|
|
18279
|
-
validating && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
18280
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18281
|
-
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
18282
|
-
] }),
|
|
18283
|
-
children,
|
|
18284
|
-
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
18285
|
-
/* @__PURE__ */ jsx15(
|
|
18286
|
-
ControlHints,
|
|
18287
|
-
{
|
|
18288
|
-
hints: [
|
|
18289
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
18290
|
-
{ keys: "\u23CE", label: MENU[focus].label.toLowerCase() },
|
|
18291
|
-
{ keys: "Esc", label: "back" }
|
|
18292
|
-
]
|
|
18293
|
-
}
|
|
18294
|
-
)
|
|
18295
|
-
] })
|
|
18296
|
-
] });
|
|
18297
|
-
}
|
|
18298
18325
|
function CredentialsScreen({
|
|
18299
18326
|
onDone,
|
|
18300
18327
|
onBack,
|
|
@@ -18337,15 +18364,43 @@ function CredentialsScreen({
|
|
|
18337
18364
|
else onBack();
|
|
18338
18365
|
};
|
|
18339
18366
|
if (!editing) {
|
|
18340
|
-
return /* @__PURE__ */
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18367
|
+
return /* @__PURE__ */ jsxs14(
|
|
18368
|
+
MenuScreen,
|
|
18369
|
+
{
|
|
18370
|
+
title: "Contentful Credentials",
|
|
18371
|
+
subtitle,
|
|
18372
|
+
menu: MENU2,
|
|
18373
|
+
rows: FIELDS2.map((field) => ({
|
|
18374
|
+
label: field.label,
|
|
18375
|
+
value: field.masked ? "\u2022".repeat(values[field.key].length) : values[field.key]
|
|
18376
|
+
})),
|
|
18377
|
+
onChoose: choose,
|
|
18378
|
+
onEscape: onBack,
|
|
18379
|
+
busy: validating,
|
|
18380
|
+
children: [
|
|
18381
|
+
notice && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
18382
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
18383
|
+
/* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
|
|
18384
|
+
"\u2717 ",
|
|
18385
|
+
notice.text
|
|
18386
|
+
] })
|
|
18387
|
+
] }),
|
|
18388
|
+
validating && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
18389
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
18390
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
18391
|
+
] }),
|
|
18392
|
+
!isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
18393
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
18394
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
18395
|
+
] })
|
|
18396
|
+
]
|
|
18397
|
+
}
|
|
18398
|
+
);
|
|
18344
18399
|
}
|
|
18345
18400
|
return /* @__PURE__ */ jsxs14(
|
|
18346
18401
|
FieldForm,
|
|
18347
18402
|
{
|
|
18348
|
-
header: /* @__PURE__ */
|
|
18403
|
+
header: /* @__PURE__ */ jsx17(StepHeader, { step: "setup" }),
|
|
18349
18404
|
title: "Contentful Credentials",
|
|
18350
18405
|
subtitle,
|
|
18351
18406
|
fields: FIELDS2,
|
|
@@ -18362,18 +18417,18 @@ function CredentialsScreen({
|
|
|
18362
18417
|
notice,
|
|
18363
18418
|
busy: validating,
|
|
18364
18419
|
children: [
|
|
18365
|
-
!prefilled && /* @__PURE__ */ jsxs14(
|
|
18366
|
-
/* @__PURE__ */
|
|
18367
|
-
/* @__PURE__ */
|
|
18368
|
-
/* @__PURE__ */
|
|
18420
|
+
!prefilled && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
18421
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
18422
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: credentialsPurpose(tokensOnly) }),
|
|
18423
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: "Tip: save these under Settings \u2192 Configuration so they pre-fill here." })
|
|
18369
18424
|
] }),
|
|
18370
|
-
validating && /* @__PURE__ */ jsxs14(
|
|
18371
|
-
/* @__PURE__ */
|
|
18372
|
-
/* @__PURE__ */
|
|
18425
|
+
validating && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
18426
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
18427
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
18373
18428
|
] }),
|
|
18374
|
-
!validating && !notice && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(
|
|
18375
|
-
/* @__PURE__ */
|
|
18376
|
-
/* @__PURE__ */
|
|
18429
|
+
!validating && !notice && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
18430
|
+
/* @__PURE__ */ jsx17(Text14, { children: " " }),
|
|
18431
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
18377
18432
|
] })
|
|
18378
18433
|
]
|
|
18379
18434
|
}
|
|
@@ -18462,9 +18517,9 @@ function resolveAgentChoice(flag, stored) {
|
|
|
18462
18517
|
}
|
|
18463
18518
|
|
|
18464
18519
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/screen.tsx
|
|
18465
|
-
import { jsx as
|
|
18520
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
18466
18521
|
function ExtractionScreen({ progress, agent }) {
|
|
18467
|
-
return /* @__PURE__ */
|
|
18522
|
+
return /* @__PURE__ */ jsx18(
|
|
18468
18523
|
RunningStep,
|
|
18469
18524
|
{
|
|
18470
18525
|
step: "extraction",
|
|
@@ -18814,11 +18869,11 @@ function useTokensOnly(input) {
|
|
|
18814
18869
|
}
|
|
18815
18870
|
|
|
18816
18871
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/screen.tsx
|
|
18817
|
-
import { Box as
|
|
18872
|
+
import { Box as Box23, Text as Text25 } from "ink";
|
|
18818
18873
|
|
|
18819
18874
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx
|
|
18820
18875
|
import React10 from "react";
|
|
18821
|
-
import { Box as
|
|
18876
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
18822
18877
|
import figures2 from "figures";
|
|
18823
18878
|
|
|
18824
18879
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts
|
|
@@ -18925,8 +18980,8 @@ function computeColumnWindow(total, cursor, visibleCount) {
|
|
|
18925
18980
|
}
|
|
18926
18981
|
|
|
18927
18982
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx
|
|
18928
|
-
import { Box as
|
|
18929
|
-
import { jsx as
|
|
18983
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
18984
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
18930
18985
|
var MIN_TERMINAL_PANEL_HEIGHT = 5;
|
|
18931
18986
|
function terminalPanelHeight(rows, reservedRows = 4) {
|
|
18932
18987
|
return Math.max(MIN_TERMINAL_PANEL_HEIGHT, rows - reservedRows);
|
|
@@ -18942,8 +18997,8 @@ function FixedPanel({
|
|
|
18942
18997
|
clipOverflow = true,
|
|
18943
18998
|
children
|
|
18944
18999
|
}) {
|
|
18945
|
-
return /* @__PURE__ */
|
|
18946
|
-
|
|
19000
|
+
return /* @__PURE__ */ jsx19(
|
|
19001
|
+
Box14,
|
|
18947
19002
|
{
|
|
18948
19003
|
flexDirection: "column",
|
|
18949
19004
|
width,
|
|
@@ -18968,7 +19023,7 @@ function WindowedPanel({ width, height, title, focused, children }) {
|
|
|
18968
19023
|
...height === void 0 ? {} : { height },
|
|
18969
19024
|
focused,
|
|
18970
19025
|
children: [
|
|
18971
|
-
title && /* @__PURE__ */
|
|
19026
|
+
title && /* @__PURE__ */ jsx19(WindowedPanelHeader, { title, width, focused }),
|
|
18972
19027
|
children
|
|
18973
19028
|
]
|
|
18974
19029
|
}
|
|
@@ -18979,9 +19034,9 @@ function WindowedPanelHeader({
|
|
|
18979
19034
|
width,
|
|
18980
19035
|
focused
|
|
18981
19036
|
}) {
|
|
18982
|
-
return /* @__PURE__ */ jsxs15(
|
|
18983
|
-
/* @__PURE__ */
|
|
18984
|
-
/* @__PURE__ */
|
|
19037
|
+
return /* @__PURE__ */ jsxs15(Box14, { flexDirection: "column", children: [
|
|
19038
|
+
/* @__PURE__ */ jsx19(Text15, { bold: true, color: PALETTE.accent, inverse: focused, children: title }),
|
|
19039
|
+
/* @__PURE__ */ jsx19(Text15, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) })
|
|
18985
19040
|
] });
|
|
18986
19041
|
}
|
|
18987
19042
|
function formatWindowIndicator(direction, count) {
|
|
@@ -18990,22 +19045,22 @@ function formatWindowIndicator(direction, count) {
|
|
|
18990
19045
|
}
|
|
18991
19046
|
function WindowFooter({ above, below }) {
|
|
18992
19047
|
const parts = [above > 0 ? `\u2191 ${above}` : "", below > 0 ? `\u2193 ${below}` : ""].filter(Boolean);
|
|
18993
|
-
return /* @__PURE__ */
|
|
19048
|
+
return /* @__PURE__ */ jsx19(Text15, { color: PALETTE.muted, children: parts.length === 0 ? " " : `${parts.join(" \xB7 ")} more` });
|
|
18994
19049
|
}
|
|
18995
19050
|
function WindowIndicator({ direction, count }) {
|
|
18996
|
-
return /* @__PURE__ */
|
|
19051
|
+
return /* @__PURE__ */ jsx19(Text15, { color: PALETTE.muted, children: formatWindowIndicator(direction, count) });
|
|
18997
19052
|
}
|
|
18998
19053
|
|
|
18999
19054
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx
|
|
19000
|
-
import { jsx as
|
|
19055
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
19001
19056
|
function AddedColumn(props) {
|
|
19002
19057
|
const { title, width, height, entries, cursor, focused, aiFlaggedByKey, visibleCount } = props;
|
|
19003
19058
|
const reserveAiBadge = entries.some((e) => aiFlaggedByKey?.get(e.name) === true);
|
|
19004
19059
|
const firstNonCycleIdx = entries.findIndex((e) => !e.isCycle);
|
|
19005
19060
|
const window = computeColumnWindow(entries.length, cursor, Math.max(1, visibleCount));
|
|
19006
19061
|
return /* @__PURE__ */ jsxs16(WindowedPanel, { width, height, title, focused, children: [
|
|
19007
|
-
/* @__PURE__ */
|
|
19008
|
-
entries.length === 0 ? /* @__PURE__ */
|
|
19062
|
+
/* @__PURE__ */ jsx20(WindowIndicator, { direction: "up", count: window.above }),
|
|
19063
|
+
entries.length === 0 ? /* @__PURE__ */ jsx20(Text16, { color: PALETTE.muted, children: "(none)" }) : entries.slice(window.start, window.end).map((entry, vi) => {
|
|
19009
19064
|
const i = window.start + vi;
|
|
19010
19065
|
const isSelected = i === cursor;
|
|
19011
19066
|
const isCursor = focused && isSelected;
|
|
@@ -19013,12 +19068,12 @@ function AddedColumn(props) {
|
|
|
19013
19068
|
const showSeparator = firstNonCycleIdx > 0 && i === firstNonCycleIdx;
|
|
19014
19069
|
const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
|
|
19015
19070
|
return /* @__PURE__ */ jsxs16(React10.Fragment, { children: [
|
|
19016
|
-
showSeparator && /* @__PURE__ */
|
|
19017
|
-
/* @__PURE__ */ jsxs16(
|
|
19018
|
-
isCursor ? /* @__PURE__ */
|
|
19019
|
-
reserveAiBadge && (aiFlagged ? /* @__PURE__ */
|
|
19020
|
-
entry.isCycle && /* @__PURE__ */
|
|
19021
|
-
/* @__PURE__ */
|
|
19071
|
+
showSeparator && /* @__PURE__ */ jsx20(Text16, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
19072
|
+
/* @__PURE__ */ jsxs16(Box15, { children: [
|
|
19073
|
+
isCursor ? /* @__PURE__ */ jsx20(Text16, { color: PALETTE.accent, bold: true, children: figures2.pointer }) : /* @__PURE__ */ jsx20(Text16, { children: " " }),
|
|
19074
|
+
reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx20(Text16, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx20(Text16, { children: " " })),
|
|
19075
|
+
entry.isCycle && /* @__PURE__ */ jsx20(Text16, { color: isCursor ? PALETTE.accent : PALETTE.warning, bold: true, underline: style.nameUnderline, children: " \u26A0" }),
|
|
19076
|
+
/* @__PURE__ */ jsx20(
|
|
19022
19077
|
Text16,
|
|
19023
19078
|
{
|
|
19024
19079
|
color: style.nameColor,
|
|
@@ -19032,14 +19087,14 @@ function AddedColumn(props) {
|
|
|
19032
19087
|
] })
|
|
19033
19088
|
] }, entry.name);
|
|
19034
19089
|
}),
|
|
19035
|
-
/* @__PURE__ */
|
|
19090
|
+
/* @__PURE__ */ jsx20(WindowIndicator, { direction: "down", count: window.below })
|
|
19036
19091
|
] });
|
|
19037
19092
|
}
|
|
19038
19093
|
|
|
19039
19094
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx
|
|
19040
|
-
import { Box as
|
|
19095
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
19041
19096
|
import figures3 from "figures";
|
|
19042
|
-
import { jsx as
|
|
19097
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
19043
19098
|
function cycleLabel(cycle, index) {
|
|
19044
19099
|
const parts = [];
|
|
19045
19100
|
for (let i = 0; i < cycle.edges.length; i++) {
|
|
@@ -19050,36 +19105,36 @@ function cycleLabel(cycle, index) {
|
|
|
19050
19105
|
return `Cycle ${index + 1}: ${parts.join(" \u2192 ")}`;
|
|
19051
19106
|
}
|
|
19052
19107
|
function CyclesPanel({ cycles, cursor }) {
|
|
19053
|
-
return /* @__PURE__ */ jsxs17(
|
|
19054
|
-
/* @__PURE__ */
|
|
19055
|
-
/* @__PURE__ */
|
|
19108
|
+
return /* @__PURE__ */ jsxs17(Box16, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
19109
|
+
/* @__PURE__ */ jsx21(Text17, { bold: true, color: PALETTE.warning, children: `Cycles detected (${cycles.length}):` }),
|
|
19110
|
+
/* @__PURE__ */ jsx21(Text17, { children: " " }),
|
|
19056
19111
|
cycles.map((cycle, i) => {
|
|
19057
19112
|
const isCursor = i === cursor;
|
|
19058
19113
|
return /* @__PURE__ */ jsxs17(Text17, { children: [
|
|
19059
|
-
isCursor ? /* @__PURE__ */
|
|
19060
|
-
/* @__PURE__ */
|
|
19114
|
+
isCursor ? /* @__PURE__ */ jsx21(Text17, { color: PALETTE.accent, bold: true, children: figures3.pointer }) : /* @__PURE__ */ jsx21(Text17, { children: " " }),
|
|
19115
|
+
/* @__PURE__ */ jsx21(Text17, { color: PALETTE.warning, inverse: isCursor, children: " " + cycleLabel(cycle, i) })
|
|
19061
19116
|
] }, i);
|
|
19062
19117
|
}),
|
|
19063
|
-
/* @__PURE__ */
|
|
19118
|
+
/* @__PURE__ */ jsx21(Text17, { children: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [c/Esc] close" })
|
|
19064
19119
|
] });
|
|
19065
19120
|
}
|
|
19066
19121
|
|
|
19067
19122
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx
|
|
19068
|
-
import { Box as
|
|
19069
|
-
import { jsx as
|
|
19123
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
19124
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
19070
19125
|
function RejectPrompt({ pending }) {
|
|
19071
|
-
return /* @__PURE__ */ jsxs18(
|
|
19072
|
-
/* @__PURE__ */
|
|
19073
|
-
pending.ancestors.length > 0 && /* @__PURE__ */
|
|
19074
|
-
pending.descendants.length > 0 && /* @__PURE__ */
|
|
19075
|
-
/* @__PURE__ */
|
|
19126
|
+
return /* @__PURE__ */ jsxs18(Box17, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
19127
|
+
/* @__PURE__ */ jsx22(Text18, { bold: true, color: PALETTE.warning, children: `Rejecting ${pending.target} will:` }),
|
|
19128
|
+
pending.ancestors.length > 0 && /* @__PURE__ */ jsx22(Text18, { children: `- Reject ancestors: ${pending.ancestors.join(", ")}` }),
|
|
19129
|
+
pending.descendants.length > 0 && /* @__PURE__ */ jsx22(Text18, { children: `- Deselect descendants: ${pending.descendants.join(", ")}` }),
|
|
19130
|
+
/* @__PURE__ */ jsx22(Text18, { children: "[y] confirm \xB7 [n]/[Esc] cancel" })
|
|
19076
19131
|
] });
|
|
19077
19132
|
}
|
|
19078
19133
|
|
|
19079
19134
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.tsx
|
|
19080
|
-
import { jsx as
|
|
19135
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
19081
19136
|
function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
19082
|
-
return /* @__PURE__ */
|
|
19137
|
+
return /* @__PURE__ */ jsx23(
|
|
19083
19138
|
ControlHints,
|
|
19084
19139
|
{
|
|
19085
19140
|
hints: [
|
|
@@ -19096,8 +19151,8 @@ function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
|
19096
19151
|
}
|
|
19097
19152
|
|
|
19098
19153
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx
|
|
19099
|
-
import { Box as
|
|
19100
|
-
import { jsx as
|
|
19154
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
19155
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
19101
19156
|
function CounterStrip(props) {
|
|
19102
19157
|
const { counters, totalWidth } = props;
|
|
19103
19158
|
const condensed = totalWidth < 60;
|
|
@@ -19105,32 +19160,32 @@ function CounterStrip(props) {
|
|
|
19105
19160
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
19106
19161
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
19107
19162
|
const sep = condensed ? " | " : " ";
|
|
19108
|
-
return /* @__PURE__ */
|
|
19163
|
+
return /* @__PURE__ */ jsx24(Box18, { children: /* @__PURE__ */ jsxs19(Text19, { children: [
|
|
19109
19164
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
19110
19165
|
labelGrp,
|
|
19111
19166
|
" "
|
|
19112
19167
|
] }),
|
|
19113
|
-
/* @__PURE__ */
|
|
19114
|
-
/* @__PURE__ */
|
|
19168
|
+
/* @__PURE__ */ jsx24(Text19, { bold: true, children: counters.groups }),
|
|
19169
|
+
/* @__PURE__ */ jsx24(Text19, { color: PALETTE.muted, children: sep }),
|
|
19115
19170
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
19116
19171
|
labelRej,
|
|
19117
19172
|
" "
|
|
19118
19173
|
] }),
|
|
19119
|
-
/* @__PURE__ */
|
|
19120
|
-
/* @__PURE__ */
|
|
19174
|
+
/* @__PURE__ */ jsx24(Text19, { bold: true, children: counters.rejected }),
|
|
19175
|
+
/* @__PURE__ */ jsx24(Text19, { color: PALETTE.muted, children: sep }),
|
|
19121
19176
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
19122
19177
|
labelUnd,
|
|
19123
19178
|
" "
|
|
19124
19179
|
] }),
|
|
19125
|
-
/* @__PURE__ */
|
|
19126
|
-
/* @__PURE__ */
|
|
19180
|
+
/* @__PURE__ */ jsx24(Text19, { bold: true, children: counters.undecided }),
|
|
19181
|
+
/* @__PURE__ */ jsx24(Text19, { color: PALETTE.muted, children: sep })
|
|
19127
19182
|
] }) });
|
|
19128
19183
|
}
|
|
19129
19184
|
|
|
19130
19185
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx
|
|
19131
19186
|
import figures4 from "figures";
|
|
19132
|
-
import { Box as
|
|
19133
|
-
import { jsx as
|
|
19187
|
+
import { Box as Box19, Text as Text20 } from "ink";
|
|
19188
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
19134
19189
|
var DEFAULT_MAX_ROWS = 15;
|
|
19135
19190
|
function windowStart(rowCount, highlightIndex, maxRows) {
|
|
19136
19191
|
if (rowCount <= maxRows) return 0;
|
|
@@ -19142,8 +19197,8 @@ function windowStart(rowCount, highlightIndex, maxRows) {
|
|
|
19142
19197
|
}
|
|
19143
19198
|
function defaultRenderRow(row, index, isCursor) {
|
|
19144
19199
|
return /* @__PURE__ */ jsxs20(Text20, { children: [
|
|
19145
|
-
isCursor ? /* @__PURE__ */
|
|
19146
|
-
/* @__PURE__ */
|
|
19200
|
+
isCursor ? /* @__PURE__ */ jsx25(Text20, { color: PALETTE.accent, bold: true, children: figures4.pointer }) : /* @__PURE__ */ jsx25(Text20, { children: " " }),
|
|
19201
|
+
/* @__PURE__ */ jsx25(Text20, { inverse: isCursor, children: " " + row.label })
|
|
19147
19202
|
] }, index);
|
|
19148
19203
|
}
|
|
19149
19204
|
function GotoBanner({
|
|
@@ -19163,7 +19218,7 @@ function GotoBanner({
|
|
|
19163
19218
|
const moreAbove = start;
|
|
19164
19219
|
const moreBelow = rows.length - end;
|
|
19165
19220
|
return /* @__PURE__ */ jsxs20(
|
|
19166
|
-
|
|
19221
|
+
Box19,
|
|
19167
19222
|
{
|
|
19168
19223
|
flexDirection: "column",
|
|
19169
19224
|
borderStyle: "single",
|
|
@@ -19173,14 +19228,14 @@ function GotoBanner({
|
|
|
19173
19228
|
width,
|
|
19174
19229
|
flexShrink: 0,
|
|
19175
19230
|
children: [
|
|
19176
|
-
/* @__PURE__ */
|
|
19177
|
-
moreAbove > 0 && /* @__PURE__ */
|
|
19231
|
+
/* @__PURE__ */ jsx25(Text20, { bold: true, children: title }),
|
|
19232
|
+
moreAbove > 0 && /* @__PURE__ */ jsx25(Text20, { color: PALETTE.muted, children: ` \u25B2 ${moreAbove} more` }),
|
|
19178
19233
|
visible.map((row, vi) => {
|
|
19179
19234
|
const i = start + vi;
|
|
19180
19235
|
return renderRow(row, i, i === highlightIndex);
|
|
19181
19236
|
}),
|
|
19182
|
-
moreBelow > 0 && /* @__PURE__ */
|
|
19183
|
-
footerHint !== void 0 && /* @__PURE__ */
|
|
19237
|
+
moreBelow > 0 && /* @__PURE__ */ jsx25(Text20, { color: PALETTE.muted, children: ` \u25BC ${moreBelow} more` }),
|
|
19238
|
+
footerHint !== void 0 && /* @__PURE__ */ jsx25(Text20, { color: PALETTE.muted, children: footerHint })
|
|
19184
19239
|
]
|
|
19185
19240
|
}
|
|
19186
19241
|
);
|
|
@@ -19188,7 +19243,7 @@ function GotoBanner({
|
|
|
19188
19243
|
|
|
19189
19244
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.tsx
|
|
19190
19245
|
import figures5 from "figures";
|
|
19191
|
-
import { Box as
|
|
19246
|
+
import { Box as Box20, Text as Text22 } from "ink";
|
|
19192
19247
|
|
|
19193
19248
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/graph/cycle-detection.ts
|
|
19194
19249
|
function buildGraph(components) {
|
|
@@ -19529,7 +19584,7 @@ function findSharedDeps(closures) {
|
|
|
19529
19584
|
|
|
19530
19585
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/badge.tsx
|
|
19531
19586
|
import { Text as Text21 } from "ink";
|
|
19532
|
-
import { jsx as
|
|
19587
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
19533
19588
|
function previewBadge(annotation) {
|
|
19534
19589
|
switch (annotation) {
|
|
19535
19590
|
case "new":
|
|
@@ -19548,11 +19603,11 @@ function PreviewBadge({
|
|
|
19548
19603
|
badge,
|
|
19549
19604
|
highlighted = false
|
|
19550
19605
|
}) {
|
|
19551
|
-
return badge ? /* @__PURE__ */
|
|
19606
|
+
return badge ? /* @__PURE__ */ jsx26(Text21, { color: !highlighted && badge.dim ? PALETTE.muted : badge.color, bold: badge.bold, children: badge.char }) : /* @__PURE__ */ jsx26(Text21, { children: " " });
|
|
19552
19607
|
}
|
|
19553
19608
|
|
|
19554
19609
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.tsx
|
|
19555
|
-
import { jsx as
|
|
19610
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
19556
19611
|
var GLYPH_EXPAND_COLLAPSED = "\u25B8";
|
|
19557
19612
|
var GLYPH_EXPAND_EXPANDED = "\u25BE";
|
|
19558
19613
|
var GLYPH_TREE_MID = "\u251C\u2500";
|
|
@@ -20008,11 +20063,11 @@ function GroupedSidebar(props) {
|
|
|
20008
20063
|
isOwn: rs?.isOwn ?? false,
|
|
20009
20064
|
isCursor
|
|
20010
20065
|
});
|
|
20011
|
-
return /* @__PURE__ */ jsxs21(
|
|
20012
|
-
isCursor ? /* @__PURE__ */
|
|
20013
|
-
/* @__PURE__ */
|
|
20014
|
-
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */
|
|
20015
|
-
aiFlaggedByKey !== void 0 && (aiFlagged ? /* @__PURE__ */
|
|
20066
|
+
return /* @__PURE__ */ jsxs21(Box20, { children: [
|
|
20067
|
+
isCursor ? /* @__PURE__ */ jsx27(Text22, { color: PALETTE.accent, bold: true, children: figures5.pointer }) : /* @__PURE__ */ jsx27(Text22, { children: " " }),
|
|
20068
|
+
/* @__PURE__ */ jsx27(PreviewBadge, { badge, highlighted: isSelected }),
|
|
20069
|
+
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */ jsx27(Text22, { color: !isSelected && selDim ? PALETTE.muted : selColor, bold: selBold, children: " " + selGlyph }) : /* @__PURE__ */ jsx27(Text22, { children: " " })),
|
|
20070
|
+
aiFlaggedByKey !== void 0 && (aiFlagged ? /* @__PURE__ */ jsx27(Text22, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx27(Text22, { children: " " })),
|
|
20016
20071
|
/* @__PURE__ */ jsxs21(
|
|
20017
20072
|
Text22,
|
|
20018
20073
|
{
|
|
@@ -20027,16 +20082,16 @@ function GroupedSidebar(props) {
|
|
|
20027
20082
|
]
|
|
20028
20083
|
}
|
|
20029
20084
|
),
|
|
20030
|
-
inheritanceStyle.glyph && /* @__PURE__ */
|
|
20085
|
+
inheritanceStyle.glyph && /* @__PURE__ */ jsx27(Text22, { color: inheritanceStyle.dim ? PALETTE.muted : inheritanceStyle.color, bold: inheritanceStyle.bold, children: " " + inheritanceStyle.glyph })
|
|
20031
20086
|
] }, row.key);
|
|
20032
20087
|
}),
|
|
20033
|
-
windowed && /* @__PURE__ */
|
|
20088
|
+
windowed && /* @__PURE__ */ jsx27(WindowFooter, { above: start, below: Math.max(0, allRows.length - end) })
|
|
20034
20089
|
] });
|
|
20035
20090
|
}
|
|
20036
20091
|
|
|
20037
20092
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.tsx
|
|
20038
20093
|
import React11 from "react";
|
|
20039
|
-
import { Box as
|
|
20094
|
+
import { Box as Box21, Text as Text23 } from "ink";
|
|
20040
20095
|
|
|
20041
20096
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.ts
|
|
20042
20097
|
import { useLayoutEffect, useRef as useRef5 } from "react";
|
|
@@ -20135,7 +20190,7 @@ function useTerminalSize() {
|
|
|
20135
20190
|
}
|
|
20136
20191
|
|
|
20137
20192
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.tsx
|
|
20138
|
-
import { Fragment as
|
|
20193
|
+
import { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
20139
20194
|
function HelpOverlay(props) {
|
|
20140
20195
|
const { onClose } = props;
|
|
20141
20196
|
const { columns: terminalColumns, rows: terminalRows } = useTerminalSize();
|
|
@@ -20147,7 +20202,7 @@ function HelpOverlay(props) {
|
|
|
20147
20202
|
}, props.handleInput !== false);
|
|
20148
20203
|
if (props.sections) {
|
|
20149
20204
|
return /* @__PURE__ */ jsxs22(
|
|
20150
|
-
|
|
20205
|
+
Box21,
|
|
20151
20206
|
{
|
|
20152
20207
|
flexDirection: "column",
|
|
20153
20208
|
borderStyle: "round",
|
|
@@ -20156,11 +20211,11 @@ function HelpOverlay(props) {
|
|
|
20156
20211
|
height: panelHeight,
|
|
20157
20212
|
overflowY: "hidden",
|
|
20158
20213
|
children: [
|
|
20159
|
-
/* @__PURE__ */
|
|
20214
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "\u2500".repeat(titleRule) + " Help " + "\u2500".repeat(titleRule) }),
|
|
20160
20215
|
props.sections.map((section) => /* @__PURE__ */ jsxs22(React11.Fragment, { children: [
|
|
20161
|
-
/* @__PURE__ */
|
|
20162
|
-
/* @__PURE__ */
|
|
20163
|
-
section.entries.map((entry) => /* @__PURE__ */
|
|
20216
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
20217
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: section.title }),
|
|
20218
|
+
section.entries.map((entry) => /* @__PURE__ */ jsx28(Text23, { children: entry.keys ? " " + entry.keys.padEnd(16) + " " + entry.label : " " + entry.label }, entry.keys + entry.label))
|
|
20164
20219
|
] }, section.title))
|
|
20165
20220
|
]
|
|
20166
20221
|
}
|
|
@@ -20168,7 +20223,7 @@ function HelpOverlay(props) {
|
|
|
20168
20223
|
}
|
|
20169
20224
|
const mode = props.mode;
|
|
20170
20225
|
return /* @__PURE__ */ jsxs22(
|
|
20171
|
-
|
|
20226
|
+
Box21,
|
|
20172
20227
|
{
|
|
20173
20228
|
flexDirection: "column",
|
|
20174
20229
|
borderStyle: "round",
|
|
@@ -20177,38 +20232,38 @@ function HelpOverlay(props) {
|
|
|
20177
20232
|
height: panelHeight,
|
|
20178
20233
|
overflowY: "hidden",
|
|
20179
20234
|
children: [
|
|
20180
|
-
/* @__PURE__ */
|
|
20181
|
-
/* @__PURE__ */
|
|
20182
|
-
/* @__PURE__ */
|
|
20183
|
-
/* @__PURE__ */
|
|
20184
|
-
/* @__PURE__ */
|
|
20185
|
-
/* @__PURE__ */
|
|
20186
|
-
/* @__PURE__ */
|
|
20187
|
-
mode === "review" && /* @__PURE__ */ jsxs22(
|
|
20188
|
-
/* @__PURE__ */
|
|
20189
|
-
/* @__PURE__ */
|
|
20190
|
-
/* @__PURE__ */
|
|
20191
|
-
/* @__PURE__ */
|
|
20192
|
-
/* @__PURE__ */
|
|
20193
|
-
/* @__PURE__ */
|
|
20194
|
-
/* @__PURE__ */
|
|
20195
|
-
/* @__PURE__ */
|
|
20196
|
-
/* @__PURE__ */
|
|
20197
|
-
/* @__PURE__ */
|
|
20198
|
-
/* @__PURE__ */
|
|
20199
|
-
/* @__PURE__ */
|
|
20200
|
-
/* @__PURE__ */
|
|
20235
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "\u2500".repeat(titleRule) + " Help " + "\u2500".repeat(titleRule) }),
|
|
20236
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
20237
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "Navigation" }),
|
|
20238
|
+
/* @__PURE__ */ jsx28(Text23, { children: " \u2191 / k / PgUp Scroll up" }),
|
|
20239
|
+
/* @__PURE__ */ jsx28(Text23, { children: " \u2193 / j / PgDn Scroll down" }),
|
|
20240
|
+
/* @__PURE__ */ jsx28(Text23, { children: " g / Home Jump to top" }),
|
|
20241
|
+
/* @__PURE__ */ jsx28(Text23, { children: " G / End Jump to bottom" }),
|
|
20242
|
+
mode === "review" && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
20243
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
20244
|
+
/* @__PURE__ */ jsx28(Text23, { bold: true, children: "[Review mode only]" }),
|
|
20245
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Tab Toggle sidebar/detail" }),
|
|
20246
|
+
/* @__PURE__ */ jsx28(Text23, { children: " a Accept component" }),
|
|
20247
|
+
/* @__PURE__ */ jsx28(Text23, { children: " r Reject component" }),
|
|
20248
|
+
/* @__PURE__ */ jsx28(Text23, { children: " e Edit proposal" }),
|
|
20249
|
+
/* @__PURE__ */ jsx28(Text23, { children: " s Toggle source code" }),
|
|
20250
|
+
/* @__PURE__ */ jsx28(Text23, { children: " A Approve all" }),
|
|
20251
|
+
/* @__PURE__ */ jsx28(Text23, { children: " F Open finalize dialog" }),
|
|
20252
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Ctrl+S Save draft" }),
|
|
20253
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Ctrl+Z Undo" }),
|
|
20254
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Ctrl+Y Redo" }),
|
|
20255
|
+
/* @__PURE__ */ jsx28(Text23, { children: " Esc Exit edit / close" })
|
|
20201
20256
|
] }),
|
|
20202
|
-
/* @__PURE__ */
|
|
20203
|
-
/* @__PURE__ */
|
|
20204
|
-
/* @__PURE__ */
|
|
20257
|
+
/* @__PURE__ */ jsx28(Text23, { children: " " }),
|
|
20258
|
+
/* @__PURE__ */ jsx28(Text23, { children: " h Close help" }),
|
|
20259
|
+
/* @__PURE__ */ jsx28(Text23, { children: " q Quit" })
|
|
20205
20260
|
]
|
|
20206
20261
|
}
|
|
20207
20262
|
);
|
|
20208
20263
|
}
|
|
20209
20264
|
|
|
20210
20265
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx
|
|
20211
|
-
import { Box as
|
|
20266
|
+
import { Box as Box22, Text as Text24 } from "ink";
|
|
20212
20267
|
|
|
20213
20268
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/autocomplete.ts
|
|
20214
20269
|
function longestCommonPrefix(names) {
|
|
@@ -20265,7 +20320,7 @@ function formatSearchMatchSummary(matches, total) {
|
|
|
20265
20320
|
}
|
|
20266
20321
|
|
|
20267
20322
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx
|
|
20268
|
-
import { Fragment as
|
|
20323
|
+
import { Fragment as Fragment6, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
20269
20324
|
function SearchMatchSummary({
|
|
20270
20325
|
open,
|
|
20271
20326
|
query,
|
|
@@ -20276,17 +20331,17 @@ function SearchMatchSummary({
|
|
|
20276
20331
|
marginTop
|
|
20277
20332
|
}) {
|
|
20278
20333
|
if (hidden) return null;
|
|
20279
|
-
return /* @__PURE__ */ jsxs23(
|
|
20280
|
-
open && /* @__PURE__ */ jsxs23(
|
|
20334
|
+
return /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
20335
|
+
open && /* @__PURE__ */ jsxs23(Box22, { marginTop, flexDirection: "column", children: [
|
|
20281
20336
|
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
20282
20337
|
`/${query}`,
|
|
20283
|
-
/* @__PURE__ */
|
|
20284
|
-
query && /* @__PURE__ */
|
|
20285
|
-
/* @__PURE__ */
|
|
20338
|
+
/* @__PURE__ */ jsx29(Text24, { color: PALETTE.accent, children: "\u258E" }),
|
|
20339
|
+
query && /* @__PURE__ */ jsx29(Text24, { color: PALETTE.muted, children: formatSearchMatchSummary(matches, total) }),
|
|
20340
|
+
/* @__PURE__ */ jsx29(Text24, { children: " \xB7 [Esc] leave" })
|
|
20286
20341
|
] }),
|
|
20287
|
-
autocompleteCandidates.length > 1 && /* @__PURE__ */
|
|
20342
|
+
autocompleteCandidates.length > 1 && /* @__PURE__ */ jsx29(Text24, { color: PALETTE.muted, children: ` possibilities: ${autocompleteCandidates.join(" \xB7 ").slice(0, 120)}` })
|
|
20288
20343
|
] }),
|
|
20289
|
-
!open && query && /* @__PURE__ */
|
|
20344
|
+
!open && query && /* @__PURE__ */ jsx29(Box22, { marginTop, children: /* @__PURE__ */ jsx29(Text24, { children: `/${query}${formatSearchMatchSummary(matches, total)} \xB7 [Esc] clear` }) })
|
|
20290
20345
|
] });
|
|
20291
20346
|
}
|
|
20292
20347
|
|
|
@@ -21424,7 +21479,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
21424
21479
|
}
|
|
21425
21480
|
|
|
21426
21481
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/screen.tsx
|
|
21427
|
-
import { Fragment as
|
|
21482
|
+
import { Fragment as Fragment7, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
21428
21483
|
var HELP_SECTIONS = [
|
|
21429
21484
|
{
|
|
21430
21485
|
title: "Navigation",
|
|
@@ -21464,29 +21519,29 @@ var HELP_SECTIONS = [
|
|
|
21464
21519
|
];
|
|
21465
21520
|
function ScopeGateScreen(props) {
|
|
21466
21521
|
if (props.components.length === 0) {
|
|
21467
|
-
return /* @__PURE__ */
|
|
21522
|
+
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." }) });
|
|
21468
21523
|
}
|
|
21469
|
-
return /* @__PURE__ */
|
|
21524
|
+
return /* @__PURE__ */ jsx30(ScopeGateView, { ...props });
|
|
21470
21525
|
}
|
|
21471
21526
|
function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
21472
21527
|
const gate = useScopeGate({ components, onConfirm, onQuit });
|
|
21473
21528
|
const { search, graph, columnPlan, panelLayout, counters } = gate;
|
|
21474
21529
|
if (gate.showHelp) {
|
|
21475
|
-
return /* @__PURE__ */
|
|
21530
|
+
return /* @__PURE__ */ jsx30(HelpOverlay, { sections: HELP_SECTIONS, handleInput: false, onClose: gate.closeHelp });
|
|
21476
21531
|
}
|
|
21477
|
-
return /* @__PURE__ */ jsxs24(
|
|
21478
|
-
/* @__PURE__ */
|
|
21479
|
-
/* @__PURE__ */ jsxs24(
|
|
21480
|
-
/* @__PURE__ */ jsxs24(
|
|
21481
|
-
/* @__PURE__ */
|
|
21532
|
+
return /* @__PURE__ */ jsxs24(Box23, { flexDirection: "column", children: [
|
|
21533
|
+
/* @__PURE__ */ jsx30(StepHeader, { step: "scope-gate" }),
|
|
21534
|
+
/* @__PURE__ */ jsxs24(Box23, { flexDirection: "column", paddingX: 2, children: [
|
|
21535
|
+
/* @__PURE__ */ jsxs24(Box23, { flexDirection: "row", flexWrap: "wrap", children: [
|
|
21536
|
+
/* @__PURE__ */ jsx30(CounterStrip, { counters, totalWidth: gate.totalWidth }),
|
|
21482
21537
|
gate.aiExcludedCount > 0 && /* @__PURE__ */ jsxs24(Text25, { color: PALETTE.muted, children: [
|
|
21483
21538
|
`${gate.aiExcludedCount} component${gate.aiExcludedCount === 1 ? "" : "s"} flagged by AI`,
|
|
21484
|
-
gate.aiRows.length > 0 && /* @__PURE__ */
|
|
21539
|
+
gate.aiRows.length > 0 && /* @__PURE__ */ jsx30(Text25, { color: PALETTE.accent, children: " \u2014 press [x] to see why" })
|
|
21485
21540
|
] })
|
|
21486
21541
|
] }),
|
|
21487
|
-
graph.cycles.length > 0 && /* @__PURE__ */
|
|
21488
|
-
/* @__PURE__ */ jsxs24(
|
|
21489
|
-
gate.aiRationalePanelOpen ? /* @__PURE__ */
|
|
21542
|
+
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." }) }),
|
|
21543
|
+
/* @__PURE__ */ jsxs24(Box23, { flexDirection: "row", alignItems: "stretch", children: [
|
|
21544
|
+
gate.aiRationalePanelOpen ? /* @__PURE__ */ jsx30(
|
|
21490
21545
|
GotoBanner,
|
|
21491
21546
|
{
|
|
21492
21547
|
title: `Review flags (${gate.aiExcludedCount})`,
|
|
@@ -21496,7 +21551,7 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
21496
21551
|
width: columnPlan.main,
|
|
21497
21552
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [x/Esc] close"
|
|
21498
21553
|
}
|
|
21499
|
-
) : /* @__PURE__ */
|
|
21554
|
+
) : /* @__PURE__ */ jsx30(
|
|
21500
21555
|
GroupedSidebar,
|
|
21501
21556
|
{
|
|
21502
21557
|
items: gate.groupedItems,
|
|
@@ -21524,9 +21579,9 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
21524
21579
|
graph: graph.nodes
|
|
21525
21580
|
}
|
|
21526
21581
|
),
|
|
21527
|
-
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs24(
|
|
21528
|
-
/* @__PURE__ */
|
|
21529
|
-
/* @__PURE__ */
|
|
21582
|
+
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
21583
|
+
/* @__PURE__ */ jsx30(Box23, { width: 2, flexShrink: 0 }),
|
|
21584
|
+
/* @__PURE__ */ jsx30(
|
|
21530
21585
|
AddedColumn,
|
|
21531
21586
|
{
|
|
21532
21587
|
width: columnPlan.added,
|
|
@@ -21541,9 +21596,9 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
21541
21596
|
)
|
|
21542
21597
|
] })
|
|
21543
21598
|
] }),
|
|
21544
|
-
gate.cyclesPanelOpen && /* @__PURE__ */
|
|
21545
|
-
gate.pendingRejectCascade && /* @__PURE__ */
|
|
21546
|
-
/* @__PURE__ */
|
|
21599
|
+
gate.cyclesPanelOpen && /* @__PURE__ */ jsx30(CyclesPanel, { cycles: gate.slotCycles, cursor: gate.cyclesCursor }),
|
|
21600
|
+
gate.pendingRejectCascade && /* @__PURE__ */ jsx30(RejectPrompt, { pending: gate.pendingRejectCascade }),
|
|
21601
|
+
/* @__PURE__ */ jsx30(
|
|
21547
21602
|
SearchMatchSummary,
|
|
21548
21603
|
{
|
|
21549
21604
|
open: search.searchOpen,
|
|
@@ -21554,7 +21609,7 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
21554
21609
|
marginTop: 1
|
|
21555
21610
|
}
|
|
21556
21611
|
),
|
|
21557
|
-
/* @__PURE__ */
|
|
21612
|
+
/* @__PURE__ */ jsx30(
|
|
21558
21613
|
CompactControlBar,
|
|
21559
21614
|
{
|
|
21560
21615
|
hasGroupRoots: gate.hasGroupRoots,
|
|
@@ -21664,14 +21719,14 @@ function progressRows2(progress, agent) {
|
|
|
21664
21719
|
}
|
|
21665
21720
|
|
|
21666
21721
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/screen.tsx
|
|
21667
|
-
import { jsx as
|
|
21722
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
21668
21723
|
function GenerationScreen({
|
|
21669
21724
|
progress,
|
|
21670
21725
|
agent,
|
|
21671
21726
|
acceptedCount,
|
|
21672
21727
|
hasTokens
|
|
21673
21728
|
}) {
|
|
21674
|
-
return /* @__PURE__ */
|
|
21729
|
+
return /* @__PURE__ */ jsx31(
|
|
21675
21730
|
RunningStep,
|
|
21676
21731
|
{
|
|
21677
21732
|
step: "generation",
|
|
@@ -21895,7 +21950,7 @@ function buildFlowStart(input) {
|
|
|
21895
21950
|
}
|
|
21896
21951
|
|
|
21897
21952
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
21898
|
-
import { Box as
|
|
21953
|
+
import { Box as Box43 } from "ink";
|
|
21899
21954
|
|
|
21900
21955
|
// packages/experience-design-system-types/dist/src/cdf/validate.js
|
|
21901
21956
|
import { Ajv as Ajv2 } from "ajv";
|
|
@@ -22215,7 +22270,7 @@ function skipLabel(matchedNames) {
|
|
|
22215
22270
|
}
|
|
22216
22271
|
|
|
22217
22272
|
// packages/experience-design-system-cli/src/tui/import/steps/preview-validation-error/screen.tsx
|
|
22218
|
-
import { jsx as
|
|
22273
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
22219
22274
|
function PreviewValidationErrorScreen({
|
|
22220
22275
|
errors,
|
|
22221
22276
|
missingNames,
|
|
@@ -22224,7 +22279,7 @@ function PreviewValidationErrorScreen({
|
|
|
22224
22279
|
onQuit
|
|
22225
22280
|
}) {
|
|
22226
22281
|
const matchedNames = matchedComponentNames(errors, missingNames);
|
|
22227
|
-
return /* @__PURE__ */
|
|
22282
|
+
return /* @__PURE__ */ jsx32(
|
|
22228
22283
|
GateStep,
|
|
22229
22284
|
{
|
|
22230
22285
|
intent: "error",
|
|
@@ -22260,7 +22315,7 @@ function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
|
22260
22315
|
}
|
|
22261
22316
|
|
|
22262
22317
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
22263
|
-
import { Box as
|
|
22318
|
+
import { Box as Box36, Text as Text39 } from "ink";
|
|
22264
22319
|
|
|
22265
22320
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/graph/cycle-view.ts
|
|
22266
22321
|
function computeCycleView(components) {
|
|
@@ -22499,12 +22554,12 @@ function enumerateCycleBreaks(cycle, components) {
|
|
|
22499
22554
|
}
|
|
22500
22555
|
|
|
22501
22556
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx
|
|
22502
|
-
import { Box as
|
|
22557
|
+
import { Box as Box30, Text as Text33 } from "ink";
|
|
22503
22558
|
|
|
22504
22559
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
22505
22560
|
import React12, { useEffect as useEffect11, useLayoutEffect as useLayoutEffect2, useState as useState18 } from "react";
|
|
22506
22561
|
import figures6 from "figures";
|
|
22507
|
-
import { Box as
|
|
22562
|
+
import { Box as Box24, measureElement, Text as Text26 } from "ink";
|
|
22508
22563
|
|
|
22509
22564
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/scroll-offset.ts
|
|
22510
22565
|
function computeNextScrollOffset(current, input, key, totalLines, panelHeight) {
|
|
@@ -22535,7 +22590,7 @@ function computeNextScrollOffset(current, input, key, totalLines, panelHeight) {
|
|
|
22535
22590
|
}
|
|
22536
22591
|
|
|
22537
22592
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
22538
|
-
import { Fragment as
|
|
22593
|
+
import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
22539
22594
|
function createCommonRowProps(selected, focusLevel, editingField, textCursor, valueCursor, cursorVisible, editingValue, valueText, width) {
|
|
22540
22595
|
return {
|
|
22541
22596
|
selected,
|
|
@@ -22673,14 +22728,14 @@ function serializeState(state2, originalJson) {
|
|
|
22673
22728
|
return JSON.stringify(entry, null, 2);
|
|
22674
22729
|
}
|
|
22675
22730
|
function Picker({ value, active }) {
|
|
22676
|
-
return /* @__PURE__ */ jsxs25(
|
|
22677
|
-
active && /* @__PURE__ */
|
|
22678
|
-
/* @__PURE__ */
|
|
22679
|
-
active && /* @__PURE__ */
|
|
22731
|
+
return /* @__PURE__ */ jsxs25(Box24, { children: [
|
|
22732
|
+
active && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.warning, children: "\u2039" }),
|
|
22733
|
+
/* @__PURE__ */ jsx33(Text26, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
22734
|
+
active && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.warning, children: "\u203A" })
|
|
22680
22735
|
] });
|
|
22681
22736
|
}
|
|
22682
22737
|
function Toggle({ value, active }) {
|
|
22683
|
-
return /* @__PURE__ */
|
|
22738
|
+
return /* @__PURE__ */ jsx33(Box24, { children: /* @__PURE__ */ jsx33(Text26, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
22684
22739
|
}
|
|
22685
22740
|
function InlinePropField({
|
|
22686
22741
|
label,
|
|
@@ -22689,7 +22744,7 @@ function InlinePropField({
|
|
|
22689
22744
|
flexible = false,
|
|
22690
22745
|
width
|
|
22691
22746
|
}) {
|
|
22692
|
-
return /* @__PURE__ */ jsxs25(
|
|
22747
|
+
return /* @__PURE__ */ jsxs25(Box24, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
22693
22748
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
22694
22749
|
focused ? "\u203A " : " ",
|
|
22695
22750
|
label
|
|
@@ -22703,19 +22758,19 @@ function RequiredField({
|
|
|
22703
22758
|
editingField,
|
|
22704
22759
|
activeField
|
|
22705
22760
|
}) {
|
|
22706
|
-
return /* @__PURE__ */
|
|
22761
|
+
return /* @__PURE__ */ jsx33(InlinePropField, { label: "req:", focused, children: /* @__PURE__ */ jsx33(Toggle, { value, active: editingField && activeField === "required" }) });
|
|
22707
22762
|
}
|
|
22708
22763
|
function DefaultValueRow({
|
|
22709
22764
|
display,
|
|
22710
22765
|
active,
|
|
22711
22766
|
focused
|
|
22712
22767
|
}) {
|
|
22713
|
-
return /* @__PURE__ */ jsxs25(
|
|
22768
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
22714
22769
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22715
22770
|
focused ? "\u203A " : " ",
|
|
22716
22771
|
"default:"
|
|
22717
22772
|
] }),
|
|
22718
|
-
active ? /* @__PURE__ */
|
|
22773
|
+
active ? /* @__PURE__ */ jsx33(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx33(Text26, { wrap: "wrap", children: display })
|
|
22719
22774
|
] });
|
|
22720
22775
|
}
|
|
22721
22776
|
function RowLabel({
|
|
@@ -22743,10 +22798,10 @@ function ValueInputRow({
|
|
|
22743
22798
|
valueText,
|
|
22744
22799
|
cursorVisible
|
|
22745
22800
|
}) {
|
|
22746
|
-
return /* @__PURE__ */ jsxs25(
|
|
22747
|
-
/* @__PURE__ */
|
|
22748
|
-
/* @__PURE__ */
|
|
22749
|
-
/* @__PURE__ */
|
|
22801
|
+
return /* @__PURE__ */ jsxs25(Box24, { paddingLeft: 2, children: [
|
|
22802
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
22803
|
+
/* @__PURE__ */ jsx33(Text26, { children: valueText }),
|
|
22804
|
+
/* @__PURE__ */ jsx33(Text26, { inverse: cursorVisible, children: " " })
|
|
22750
22805
|
] });
|
|
22751
22806
|
}
|
|
22752
22807
|
function EditableListItem({
|
|
@@ -22759,9 +22814,9 @@ function EditableListItem({
|
|
|
22759
22814
|
}) {
|
|
22760
22815
|
const isBeingEdited = editingValue?.mode === "edit" && editingValue.index === index;
|
|
22761
22816
|
if (isBeingEdited) {
|
|
22762
|
-
return /* @__PURE__ */
|
|
22817
|
+
return /* @__PURE__ */ jsx33(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
22763
22818
|
}
|
|
22764
|
-
return /* @__PURE__ */
|
|
22819
|
+
return /* @__PURE__ */ jsx33(Box24, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx33(Text26, { color: active ? PALETTE.accent : void 0, children: active ? `${figures6.pointer} ${value}` : ` ${value}` }) });
|
|
22765
22820
|
}
|
|
22766
22821
|
function EditableValueList({
|
|
22767
22822
|
values,
|
|
@@ -22774,9 +22829,9 @@ function EditableValueList({
|
|
|
22774
22829
|
emptyPaddingLeft,
|
|
22775
22830
|
showAddInput
|
|
22776
22831
|
}) {
|
|
22777
|
-
return /* @__PURE__ */ jsxs25(
|
|
22778
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */
|
|
22779
|
-
values.map((value, index) => /* @__PURE__ */
|
|
22832
|
+
return /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
22833
|
+
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 }) })),
|
|
22834
|
+
values.map((value, index) => /* @__PURE__ */ jsx33(
|
|
22780
22835
|
EditableListItem,
|
|
22781
22836
|
{
|
|
22782
22837
|
value,
|
|
@@ -22788,7 +22843,7 @@ function EditableValueList({
|
|
|
22788
22843
|
},
|
|
22789
22844
|
index
|
|
22790
22845
|
)),
|
|
22791
|
-
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */
|
|
22846
|
+
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx33(ValueInputRow, { mode: "add", valueText, cursorVisible })
|
|
22792
22847
|
] });
|
|
22793
22848
|
}
|
|
22794
22849
|
function DefaultSubRow({
|
|
@@ -22800,51 +22855,51 @@ function DefaultSubRow({
|
|
|
22800
22855
|
}) {
|
|
22801
22856
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22802
22857
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
22803
|
-
return /* @__PURE__ */ jsxs25(
|
|
22858
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexShrink: 0, children: [
|
|
22804
22859
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22805
22860
|
focused ? "\u203A " : " ",
|
|
22806
22861
|
"default:"
|
|
22807
22862
|
] }),
|
|
22808
|
-
/* @__PURE__ */
|
|
22863
|
+
/* @__PURE__ */ jsx33(Text26, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
|
|
22809
22864
|
] });
|
|
22810
22865
|
}
|
|
22811
22866
|
if (prop.type === "boolean") {
|
|
22812
22867
|
const display = prop.default === true ? "true" : prop.default === false ? "false" : "(unset)";
|
|
22813
|
-
return /* @__PURE__ */
|
|
22868
|
+
return /* @__PURE__ */ jsx33(DefaultValueRow, { display, active, focused });
|
|
22814
22869
|
}
|
|
22815
22870
|
if (prop.type === "enum") {
|
|
22816
22871
|
if (prop.values.length === 0) {
|
|
22817
|
-
return /* @__PURE__ */ jsxs25(
|
|
22872
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexShrink: 0, children: [
|
|
22818
22873
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22819
22874
|
focused ? "\u203A " : " ",
|
|
22820
22875
|
"default:"
|
|
22821
22876
|
] }),
|
|
22822
|
-
/* @__PURE__ */
|
|
22877
|
+
/* @__PURE__ */ jsx33(Text26, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
|
|
22823
22878
|
] });
|
|
22824
22879
|
}
|
|
22825
22880
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
22826
|
-
return /* @__PURE__ */
|
|
22881
|
+
return /* @__PURE__ */ jsx33(DefaultValueRow, { display, active, focused });
|
|
22827
22882
|
}
|
|
22828
22883
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
22829
22884
|
if (active) {
|
|
22830
|
-
return /* @__PURE__ */ jsxs25(
|
|
22885
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "row", flexShrink: 0, children: [
|
|
22831
22886
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22832
22887
|
focused ? "\u203A " : " ",
|
|
22833
22888
|
"default:"
|
|
22834
22889
|
] }),
|
|
22835
|
-
/* @__PURE__ */ jsxs25(
|
|
22836
|
-
/* @__PURE__ */
|
|
22837
|
-
/* @__PURE__ */
|
|
22838
|
-
/* @__PURE__ */
|
|
22890
|
+
/* @__PURE__ */ jsxs25(Box24, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
22891
|
+
/* @__PURE__ */ jsx33(Text26, { children: value.slice(0, textCursor) }),
|
|
22892
|
+
/* @__PURE__ */ jsx33(Text26, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
22893
|
+
/* @__PURE__ */ jsx33(Text26, { children: value.slice(textCursor + 1) })
|
|
22839
22894
|
] })
|
|
22840
22895
|
] });
|
|
22841
22896
|
}
|
|
22842
|
-
return /* @__PURE__ */ jsxs25(
|
|
22897
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexShrink: 0, children: [
|
|
22843
22898
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22844
22899
|
focused ? "\u203A " : " ",
|
|
22845
22900
|
"default:"
|
|
22846
22901
|
] }),
|
|
22847
|
-
/* @__PURE__ */
|
|
22902
|
+
/* @__PURE__ */ jsx33(Text26, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
|
|
22848
22903
|
] });
|
|
22849
22904
|
}
|
|
22850
22905
|
function DescriptionField({
|
|
@@ -22859,20 +22914,20 @@ function DescriptionField({
|
|
|
22859
22914
|
paddingLeft = 2
|
|
22860
22915
|
}) {
|
|
22861
22916
|
if (compact) {
|
|
22862
|
-
return /* @__PURE__ */ jsxs25(
|
|
22917
|
+
return /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22863
22918
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22864
22919
|
focused ? "\u203A " : " ",
|
|
22865
22920
|
label
|
|
22866
22921
|
] }),
|
|
22867
|
-
/* @__PURE__ */
|
|
22922
|
+
/* @__PURE__ */ jsx33(Text26, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
22868
22923
|
] });
|
|
22869
22924
|
}
|
|
22870
|
-
return /* @__PURE__ */ jsxs25(
|
|
22925
|
+
return /* @__PURE__ */ jsxs25(Box24, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
22871
22926
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22872
22927
|
focused ? "\u203A " : " ",
|
|
22873
22928
|
label
|
|
22874
22929
|
] }),
|
|
22875
|
-
editing ? /* @__PURE__ */
|
|
22930
|
+
editing ? /* @__PURE__ */ jsx33(EditableDescription, { cursorVisible, value, textCursor }) : /* @__PURE__ */ jsx33(Text26, { wrap: "wrap", children: value || "\u2014" })
|
|
22876
22931
|
] });
|
|
22877
22932
|
}
|
|
22878
22933
|
function EditableDescription({
|
|
@@ -22882,7 +22937,7 @@ function EditableDescription({
|
|
|
22882
22937
|
}) {
|
|
22883
22938
|
return /* @__PURE__ */ jsxs25(Text26, { wrap: "wrap", children: [
|
|
22884
22939
|
value.slice(0, textCursor),
|
|
22885
|
-
/* @__PURE__ */
|
|
22940
|
+
/* @__PURE__ */ jsx33(Text26, { inverse: cursorVisible, children: value[textCursor] ?? " " }),
|
|
22886
22941
|
value.slice(textCursor + 1)
|
|
22887
22942
|
] });
|
|
22888
22943
|
}
|
|
@@ -22903,9 +22958,9 @@ function PropRow({
|
|
|
22903
22958
|
}) {
|
|
22904
22959
|
const descFocused = activeField === "description";
|
|
22905
22960
|
const descActive = editingField && descFocused;
|
|
22906
|
-
return /* @__PURE__ */ jsxs25(
|
|
22907
|
-
/* @__PURE__ */
|
|
22908
|
-
/* @__PURE__ */
|
|
22961
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
22962
|
+
/* @__PURE__ */ jsx33(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx33(RowLabel, { name: prop.name, selected }) }),
|
|
22963
|
+
/* @__PURE__ */ jsx33(
|
|
22909
22964
|
DescriptionField,
|
|
22910
22965
|
{
|
|
22911
22966
|
value: prop.description,
|
|
@@ -22918,8 +22973,8 @@ function PropRow({
|
|
|
22918
22973
|
paddingLeft: 0
|
|
22919
22974
|
}
|
|
22920
22975
|
),
|
|
22921
|
-
/* @__PURE__ */ jsxs25(
|
|
22922
|
-
/* @__PURE__ */
|
|
22976
|
+
/* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
22977
|
+
/* @__PURE__ */ jsx33(
|
|
22923
22978
|
RequiredField,
|
|
22924
22979
|
{
|
|
22925
22980
|
value: prop.required,
|
|
@@ -22928,10 +22983,10 @@ function PropRow({
|
|
|
22928
22983
|
activeField
|
|
22929
22984
|
}
|
|
22930
22985
|
),
|
|
22931
|
-
/* @__PURE__ */
|
|
22986
|
+
/* @__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 }) })
|
|
22932
22987
|
] }),
|
|
22933
|
-
prop.type === "token" && /* @__PURE__ */
|
|
22934
|
-
prop.type === "enum" && /* @__PURE__ */ jsxs25(
|
|
22988
|
+
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" }) }),
|
|
22989
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22935
22990
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
22936
22991
|
activeField === "values" ? "\u203A " : " ",
|
|
22937
22992
|
"values:"
|
|
@@ -22942,7 +22997,7 @@ function PropRow({
|
|
|
22942
22997
|
"]"
|
|
22943
22998
|
] })
|
|
22944
22999
|
] }),
|
|
22945
|
-
/* @__PURE__ */
|
|
23000
|
+
/* @__PURE__ */ jsx33(
|
|
22946
23001
|
DefaultSubRow,
|
|
22947
23002
|
{
|
|
22948
23003
|
prop,
|
|
@@ -22952,12 +23007,12 @@ function PropRow({
|
|
|
22952
23007
|
cursorVisible
|
|
22953
23008
|
}
|
|
22954
23009
|
),
|
|
22955
|
-
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(
|
|
23010
|
+
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22956
23011
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
22957
23012
|
activeField === "allowed" ? "\u203A " : " ",
|
|
22958
23013
|
"allowed:"
|
|
22959
23014
|
] }),
|
|
22960
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */
|
|
23015
|
+
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(
|
|
22961
23016
|
Text26,
|
|
22962
23017
|
{
|
|
22963
23018
|
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
@@ -22966,17 +23021,17 @@ function PropRow({
|
|
|
22966
23021
|
}
|
|
22967
23022
|
)
|
|
22968
23023
|
] }),
|
|
22969
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */
|
|
23024
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx33(Box24, { paddingLeft: 2, children: /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: (() => {
|
|
22970
23025
|
const max = Math.max(8, width - 8);
|
|
22971
23026
|
const text = `~ ${rationale}`;
|
|
22972
23027
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22973
23028
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22974
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(
|
|
22975
|
-
/* @__PURE__ */ jsxs25(
|
|
22976
|
-
/* @__PURE__ */
|
|
22977
|
-
activeField === "values" && /* @__PURE__ */
|
|
23029
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(Box24, { paddingLeft: 2, flexDirection: "column", children: [
|
|
23030
|
+
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
23031
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "values:" }),
|
|
23032
|
+
activeField === "values" && /* @__PURE__ */ jsx33(Text26, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22978
23033
|
] }),
|
|
22979
|
-
/* @__PURE__ */
|
|
23034
|
+
/* @__PURE__ */ jsx33(
|
|
22980
23035
|
EditableValueList,
|
|
22981
23036
|
{
|
|
22982
23037
|
values: prop.values,
|
|
@@ -23006,9 +23061,9 @@ function SlotRow({
|
|
|
23006
23061
|
pickerCandidates,
|
|
23007
23062
|
pickerCursor
|
|
23008
23063
|
}) {
|
|
23009
|
-
return /* @__PURE__ */ jsxs25(
|
|
23010
|
-
/* @__PURE__ */
|
|
23011
|
-
/* @__PURE__ */
|
|
23064
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
23065
|
+
/* @__PURE__ */ jsx33(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx33(RowLabel, { name: slot.name, selected, trailing: false }) }),
|
|
23066
|
+
/* @__PURE__ */ jsx33(
|
|
23012
23067
|
DescriptionField,
|
|
23013
23068
|
{
|
|
23014
23069
|
value: slot.description,
|
|
@@ -23021,7 +23076,7 @@ function SlotRow({
|
|
|
23021
23076
|
paddingLeft: 0
|
|
23022
23077
|
}
|
|
23023
23078
|
),
|
|
23024
|
-
/* @__PURE__ */
|
|
23079
|
+
/* @__PURE__ */ jsx33(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx33(
|
|
23025
23080
|
RequiredField,
|
|
23026
23081
|
{
|
|
23027
23082
|
value: slot.required,
|
|
@@ -23030,7 +23085,7 @@ function SlotRow({
|
|
|
23030
23085
|
activeField
|
|
23031
23086
|
}
|
|
23032
23087
|
) }),
|
|
23033
|
-
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(
|
|
23088
|
+
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(Box24, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
23034
23089
|
/* @__PURE__ */ jsxs25(
|
|
23035
23090
|
Text26,
|
|
23036
23091
|
{
|
|
@@ -23042,10 +23097,10 @@ function SlotRow({
|
|
|
23042
23097
|
]
|
|
23043
23098
|
}
|
|
23044
23099
|
),
|
|
23045
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */
|
|
23100
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx33(Text26, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
23046
23101
|
] }),
|
|
23047
|
-
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(
|
|
23048
|
-
/* @__PURE__ */ jsxs25(
|
|
23102
|
+
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", children: [
|
|
23103
|
+
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
23049
23104
|
/* @__PURE__ */ jsxs25(
|
|
23050
23105
|
Text26,
|
|
23051
23106
|
{
|
|
@@ -23057,9 +23112,9 @@ function SlotRow({
|
|
|
23057
23112
|
]
|
|
23058
23113
|
}
|
|
23059
23114
|
),
|
|
23060
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */
|
|
23115
|
+
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" })
|
|
23061
23116
|
] }),
|
|
23062
|
-
/* @__PURE__ */
|
|
23117
|
+
/* @__PURE__ */ jsx33(
|
|
23063
23118
|
EditableValueList,
|
|
23064
23119
|
{
|
|
23065
23120
|
values: slot.allowedComponents,
|
|
@@ -23073,21 +23128,21 @@ function SlotRow({
|
|
|
23073
23128
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
23074
23129
|
}
|
|
23075
23130
|
),
|
|
23076
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */
|
|
23131
|
+
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)" }) : (() => {
|
|
23077
23132
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
23078
23133
|
if (filtered.length === 0) {
|
|
23079
|
-
return /* @__PURE__ */
|
|
23134
|
+
return /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
23080
23135
|
}
|
|
23081
23136
|
const cursor = pickerCursor % filtered.length;
|
|
23082
23137
|
const MAX_VISIBLE = 5;
|
|
23083
23138
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
23084
23139
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
23085
|
-
return /* @__PURE__ */ jsxs25(
|
|
23086
|
-
/* @__PURE__ */
|
|
23140
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", children: [
|
|
23141
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
23087
23142
|
slice.map((name, i) => {
|
|
23088
23143
|
const absIdx = start + i;
|
|
23089
23144
|
const isCursor = absIdx === cursor;
|
|
23090
|
-
return /* @__PURE__ */
|
|
23145
|
+
return /* @__PURE__ */ jsx33(Text26, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures6.pointer} ${name}` : ` ${name}` }, name);
|
|
23091
23146
|
})
|
|
23092
23147
|
] });
|
|
23093
23148
|
})() })
|
|
@@ -23916,18 +23971,18 @@ function FieldEditor({
|
|
|
23916
23971
|
});
|
|
23917
23972
|
const innerWidth = Math.max(1, width - 2);
|
|
23918
23973
|
if (parseErr) {
|
|
23919
|
-
return /* @__PURE__ */ jsxs25(
|
|
23920
|
-
/* @__PURE__ */
|
|
23921
|
-
/* @__PURE__ */
|
|
23922
|
-
/* @__PURE__ */
|
|
23974
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
23975
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
23976
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.error, children: parseErr }),
|
|
23977
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
23923
23978
|
] });
|
|
23924
23979
|
}
|
|
23925
23980
|
if (props.length === 0 && slots.length === 0) {
|
|
23926
|
-
return /* @__PURE__ */ jsxs25(
|
|
23927
|
-
/* @__PURE__ */
|
|
23928
|
-
/* @__PURE__ */
|
|
23929
|
-
/* @__PURE__ */
|
|
23930
|
-
/* @__PURE__ */
|
|
23981
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
23982
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
23983
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
23984
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
23985
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
23931
23986
|
] });
|
|
23932
23987
|
}
|
|
23933
23988
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -24056,12 +24111,12 @@ function FieldEditor({
|
|
|
24056
24111
|
const renderRow = (row, index) => {
|
|
24057
24112
|
const key = rowKey(row, index);
|
|
24058
24113
|
if (row.kind === "header") {
|
|
24059
|
-
return /* @__PURE__ */
|
|
24114
|
+
return /* @__PURE__ */ jsx33(Box24, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
24060
24115
|
}
|
|
24061
24116
|
if (row.kind === "component-description") {
|
|
24062
24117
|
const isSelected2 = inComponentDesc && active;
|
|
24063
24118
|
const isEditing = isSelected2 && focusLevel === "field" && editingField && activeField === "description";
|
|
24064
|
-
return /* @__PURE__ */
|
|
24119
|
+
return /* @__PURE__ */ jsx33(
|
|
24065
24120
|
DescriptionField,
|
|
24066
24121
|
{
|
|
24067
24122
|
value: editorState.componentDescription,
|
|
@@ -24092,7 +24147,7 @@ function FieldEditor({
|
|
|
24092
24147
|
valueText,
|
|
24093
24148
|
innerWidth
|
|
24094
24149
|
);
|
|
24095
|
-
return /* @__PURE__ */
|
|
24150
|
+
return /* @__PURE__ */ jsx33(
|
|
24096
24151
|
PropRow,
|
|
24097
24152
|
{
|
|
24098
24153
|
prop: p,
|
|
@@ -24119,7 +24174,7 @@ function FieldEditor({
|
|
|
24119
24174
|
valueText,
|
|
24120
24175
|
innerWidth
|
|
24121
24176
|
);
|
|
24122
|
-
return /* @__PURE__ */
|
|
24177
|
+
return /* @__PURE__ */ jsx33(
|
|
24123
24178
|
SlotRow,
|
|
24124
24179
|
{
|
|
24125
24180
|
slot: s,
|
|
@@ -24140,9 +24195,9 @@ function FieldEditor({
|
|
|
24140
24195
|
borderStyle: "single",
|
|
24141
24196
|
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.accent : PALETTE.border,
|
|
24142
24197
|
children: [
|
|
24143
|
-
hasEmptyProperties && /* @__PURE__ */
|
|
24198
|
+
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." }),
|
|
24144
24199
|
header,
|
|
24145
|
-
/* @__PURE__ */
|
|
24200
|
+
/* @__PURE__ */ jsx33(Box24, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx33(
|
|
24146
24201
|
PropRow,
|
|
24147
24202
|
{
|
|
24148
24203
|
prop: currentProp,
|
|
@@ -24158,7 +24213,7 @@ function FieldEditor({
|
|
|
24158
24213
|
rationale: metadata?.props?.[currentProp.name]?.rationale ?? null,
|
|
24159
24214
|
showRationale: showInlineRationales
|
|
24160
24215
|
}
|
|
24161
|
-
) : focusLevel === "field" && inSlots && currentSlot ? /* @__PURE__ */
|
|
24216
|
+
) : focusLevel === "field" && inSlots && currentSlot ? /* @__PURE__ */ jsx33(
|
|
24162
24217
|
SlotRow,
|
|
24163
24218
|
{
|
|
24164
24219
|
slot: currentSlot,
|
|
@@ -24177,8 +24232,8 @@ function FieldEditor({
|
|
|
24177
24232
|
) : visibleRowSlice.map((row, index) => {
|
|
24178
24233
|
const absoluteIndex = scrollStart + index;
|
|
24179
24234
|
const key = rowKey(row, absoluteIndex);
|
|
24180
|
-
return /* @__PURE__ */
|
|
24181
|
-
|
|
24235
|
+
return /* @__PURE__ */ jsx33(
|
|
24236
|
+
Box24,
|
|
24182
24237
|
{
|
|
24183
24238
|
ref: (node) => {
|
|
24184
24239
|
if (node) rowMeasureRefs.current.set(key, node);
|
|
@@ -24191,7 +24246,7 @@ function FieldEditor({
|
|
|
24191
24246
|
`visible-${key}`
|
|
24192
24247
|
);
|
|
24193
24248
|
}) }),
|
|
24194
|
-
categoryBelow && /* @__PURE__ */
|
|
24249
|
+
categoryBelow && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
24195
24250
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
24196
24251
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
24197
24252
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -24200,49 +24255,49 @@ function FieldEditor({
|
|
|
24200
24255
|
const src = metadata?.componentSource ?? null;
|
|
24201
24256
|
const headerPath = path5 ?? "<unknown source path>";
|
|
24202
24257
|
if (!start || !end2 || !src) {
|
|
24203
|
-
return /* @__PURE__ */ jsxs25(
|
|
24204
|
-
/* @__PURE__ */
|
|
24205
|
-
/* @__PURE__ */
|
|
24206
|
-
/* @__PURE__ */
|
|
24258
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
24259
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
24260
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
24261
|
+
/* @__PURE__ */ jsx33(Text26, { children: "[s] close" })
|
|
24207
24262
|
] });
|
|
24208
24263
|
}
|
|
24209
24264
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
24210
|
-
return /* @__PURE__ */ jsxs25(
|
|
24211
|
-
/* @__PURE__ */
|
|
24212
|
-
lines.map((ln, i) => /* @__PURE__ */
|
|
24213
|
-
/* @__PURE__ */
|
|
24265
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
24266
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
24267
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
24268
|
+
/* @__PURE__ */ jsx33(Text26, { children: "[s] close \xB7 [Esc] close" })
|
|
24214
24269
|
] });
|
|
24215
24270
|
})(),
|
|
24216
|
-
showHelp && /* @__PURE__ */ jsxs25(
|
|
24217
|
-
/* @__PURE__ */
|
|
24218
|
-
/* @__PURE__ */
|
|
24219
|
-
/* @__PURE__ */
|
|
24220
|
-
/* @__PURE__ */
|
|
24221
|
-
/* @__PURE__ */
|
|
24222
|
-
/* @__PURE__ */
|
|
24223
|
-
/* @__PURE__ */
|
|
24224
|
-
/* @__PURE__ */
|
|
24225
|
-
/* @__PURE__ */
|
|
24226
|
-
/* @__PURE__ */
|
|
24227
|
-
/* @__PURE__ */
|
|
24228
|
-
/* @__PURE__ */
|
|
24229
|
-
/* @__PURE__ */
|
|
24230
|
-
/* @__PURE__ */
|
|
24231
|
-
/* @__PURE__ */
|
|
24232
|
-
/* @__PURE__ */
|
|
24233
|
-
/* @__PURE__ */
|
|
24234
|
-
/* @__PURE__ */
|
|
24235
|
-
/* @__PURE__ */
|
|
24236
|
-
/* @__PURE__ */
|
|
24237
|
-
/* @__PURE__ */
|
|
24238
|
-
/* @__PURE__ */
|
|
24239
|
-
/* @__PURE__ */
|
|
24240
|
-
/* @__PURE__ */
|
|
24241
|
-
/* @__PURE__ */
|
|
24242
|
-
/* @__PURE__ */
|
|
24271
|
+
showHelp && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
24272
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
24273
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
24274
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Row navigation" }),
|
|
24275
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2191/\u2193 move between rows" }),
|
|
24276
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Enter edit fields on the current row" }),
|
|
24277
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Esc exit the panel" }),
|
|
24278
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
24279
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Field editing" }),
|
|
24280
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2191/\u2193/\u2190\u2192 cycle through fields" }),
|
|
24281
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2190/\u2192 cycle picker values \xB7 move cursor in text inputs" }),
|
|
24282
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Space/Enter toggle required" }),
|
|
24283
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Type edit description / string default" }),
|
|
24284
|
+
/* @__PURE__ */ jsx33(Text26, { children: " Esc exit field-edit back to the row" }),
|
|
24285
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
24286
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Values / allowedComponents" }),
|
|
24287
|
+
/* @__PURE__ */ jsx33(Text26, { children: " a / e / r add \xB7 edit \xB7 remove" }),
|
|
24288
|
+
/* @__PURE__ */ jsx33(Text26, { children: " \u2191\u2193 navigate the list" }),
|
|
24289
|
+
/* @__PURE__ */ jsx33(Text26, { children: " K / J reorder up \xB7 down" }),
|
|
24290
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
24291
|
+
/* @__PURE__ */ jsx33(Text26, { bold: true, children: "Panels" }),
|
|
24292
|
+
/* @__PURE__ */ jsx33(Text26, { children: " s toggle source-view for the current prop" }),
|
|
24293
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " + propRationaleKey.padEnd(16) + " toggle prop rationale panel" }),
|
|
24294
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
24295
|
+
/* @__PURE__ */ jsx33(Text26, { children: " ? toggle this overlay" }),
|
|
24296
|
+
/* @__PURE__ */ jsx33(Text26, { children: " " }),
|
|
24297
|
+
/* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
24243
24298
|
] }),
|
|
24244
|
-
validationError && /* @__PURE__ */
|
|
24245
|
-
/* @__PURE__ */
|
|
24299
|
+
validationError && /* @__PURE__ */ jsx33(Text26, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
24300
|
+
/* @__PURE__ */ jsx33(Box24, { paddingTop: 1, children: /* @__PURE__ */ jsx33(Text26, { color: PALETTE.muted, children: modeLabel }) })
|
|
24246
24301
|
]
|
|
24247
24302
|
}
|
|
24248
24303
|
);
|
|
@@ -24252,7 +24307,7 @@ function FieldEditor({
|
|
|
24252
24307
|
import { Text as Text32 } from "ink";
|
|
24253
24308
|
|
|
24254
24309
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
24255
|
-
import { Box as
|
|
24310
|
+
import { Box as Box26, Text as Text28 } from "ink";
|
|
24256
24311
|
|
|
24257
24312
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/wrap-text.ts
|
|
24258
24313
|
function appendLongWordChunks(word, width, lines) {
|
|
@@ -24287,27 +24342,27 @@ function wrapText(text, innerWidth) {
|
|
|
24287
24342
|
}
|
|
24288
24343
|
|
|
24289
24344
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx
|
|
24290
|
-
import { Box as
|
|
24291
|
-
import { jsx as
|
|
24345
|
+
import { Box as Box25, Text as Text27 } from "ink";
|
|
24346
|
+
import { jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
24292
24347
|
function RationaleLine({ line, active }) {
|
|
24293
24348
|
if (line.kind === "blank") {
|
|
24294
|
-
return /* @__PURE__ */
|
|
24349
|
+
return /* @__PURE__ */ jsx34(Box25, { children: /* @__PURE__ */ jsx34(Text27, { children: " " }) });
|
|
24295
24350
|
}
|
|
24296
24351
|
if (line.kind === "heading") {
|
|
24297
|
-
return /* @__PURE__ */
|
|
24352
|
+
return /* @__PURE__ */ jsx34(Box25, { children: /* @__PURE__ */ jsx34(Text27, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
24298
24353
|
}
|
|
24299
24354
|
if (line.kind === "label") {
|
|
24300
|
-
return /* @__PURE__ */ jsxs26(
|
|
24301
|
-
line.prefix && /* @__PURE__ */
|
|
24302
|
-
/* @__PURE__ */
|
|
24303
|
-
line.suffix && /* @__PURE__ */
|
|
24355
|
+
return /* @__PURE__ */ jsxs26(Box25, { children: [
|
|
24356
|
+
line.prefix && /* @__PURE__ */ jsx34(Text27, { children: line.prefix }),
|
|
24357
|
+
/* @__PURE__ */ jsx34(Text27, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
24358
|
+
line.suffix && /* @__PURE__ */ jsx34(Text27, { color: PALETTE.muted, children: line.suffix })
|
|
24304
24359
|
] });
|
|
24305
24360
|
}
|
|
24306
|
-
return /* @__PURE__ */
|
|
24361
|
+
return /* @__PURE__ */ jsx34(Box25, { children: /* @__PURE__ */ jsx34(Text27, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
24307
24362
|
}
|
|
24308
24363
|
|
|
24309
24364
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
24310
|
-
import { jsx as
|
|
24365
|
+
import { jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
24311
24366
|
var PLACEHOLDER = "(no rationale captured)";
|
|
24312
24367
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
24313
24368
|
const out = [];
|
|
@@ -24376,7 +24431,7 @@ function ComponentRationalePanel({
|
|
|
24376
24431
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24377
24432
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
24378
24433
|
return /* @__PURE__ */ jsxs27(
|
|
24379
|
-
|
|
24434
|
+
Box26,
|
|
24380
24435
|
{
|
|
24381
24436
|
flexDirection: "column",
|
|
24382
24437
|
width,
|
|
@@ -24384,27 +24439,27 @@ function ComponentRationalePanel({
|
|
|
24384
24439
|
borderStyle: "single",
|
|
24385
24440
|
borderColor: active ? PALETTE.text : void 0,
|
|
24386
24441
|
children: [
|
|
24387
|
-
/* @__PURE__ */
|
|
24388
|
-
visible.map((line, i) => /* @__PURE__ */
|
|
24389
|
-
/* @__PURE__ */
|
|
24442
|
+
/* @__PURE__ */ jsx35(Box26, { children: /* @__PURE__ */ jsx35(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
24443
|
+
visible.map((line, i) => /* @__PURE__ */ jsx35(RationaleLine, { line, active }, i)),
|
|
24444
|
+
/* @__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" }) })
|
|
24390
24445
|
]
|
|
24391
24446
|
}
|
|
24392
24447
|
);
|
|
24393
24448
|
}
|
|
24394
24449
|
|
|
24395
24450
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/JsonPanel.tsx
|
|
24396
|
-
import { Box as
|
|
24451
|
+
import { Box as Box28 } from "ink";
|
|
24397
24452
|
|
|
24398
24453
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/HighlightedLine.tsx
|
|
24399
24454
|
import { Text as Text29 } from "ink";
|
|
24400
|
-
import { Fragment as
|
|
24455
|
+
import { Fragment as Fragment9, jsx as jsx36 } from "react/jsx-runtime";
|
|
24401
24456
|
function HighlightedLine({ parts }) {
|
|
24402
|
-
return /* @__PURE__ */
|
|
24457
|
+
return /* @__PURE__ */ jsx36(Fragment9, { children: parts.map((part, i) => /* @__PURE__ */ jsx36(Text29, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
|
|
24403
24458
|
}
|
|
24404
24459
|
|
|
24405
24460
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
24406
|
-
import { Box as
|
|
24407
|
-
import { Fragment as
|
|
24461
|
+
import { Box as Box27, Text as Text30 } from "ink";
|
|
24462
|
+
import { Fragment as Fragment10, jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
24408
24463
|
function ScrollablePanel({
|
|
24409
24464
|
title,
|
|
24410
24465
|
width,
|
|
@@ -24417,12 +24472,12 @@ function ScrollablePanel({
|
|
|
24417
24472
|
children
|
|
24418
24473
|
}) {
|
|
24419
24474
|
const overflowed = totalLines > height;
|
|
24420
|
-
return /* @__PURE__ */ jsxs28(
|
|
24421
|
-
/* @__PURE__ */ jsxs28(
|
|
24422
|
-
/* @__PURE__ */
|
|
24423
|
-
overflowed && /* @__PURE__ */ jsxs28(
|
|
24424
|
-
/* @__PURE__ */
|
|
24425
|
-
/* @__PURE__ */
|
|
24475
|
+
return /* @__PURE__ */ jsxs28(Box27, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
24476
|
+
/* @__PURE__ */ jsxs28(Box27, { children: [
|
|
24477
|
+
/* @__PURE__ */ jsx37(Text30, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
24478
|
+
overflowed && /* @__PURE__ */ jsxs28(Fragment10, { children: [
|
|
24479
|
+
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
24480
|
+
/* @__PURE__ */ jsx37(Text30, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
24426
24481
|
] })
|
|
24427
24482
|
] }),
|
|
24428
24483
|
children
|
|
@@ -24430,7 +24485,7 @@ function ScrollablePanel({
|
|
|
24430
24485
|
}
|
|
24431
24486
|
|
|
24432
24487
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/JsonPanel.tsx
|
|
24433
|
-
import { jsx as
|
|
24488
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
24434
24489
|
function highlightJson(line) {
|
|
24435
24490
|
const parts = [];
|
|
24436
24491
|
let remaining = line;
|
|
@@ -24468,7 +24523,7 @@ function highlightJson(line) {
|
|
|
24468
24523
|
parts.push({ text: remaining[0] });
|
|
24469
24524
|
remaining = remaining.slice(1);
|
|
24470
24525
|
}
|
|
24471
|
-
return /* @__PURE__ */
|
|
24526
|
+
return /* @__PURE__ */ jsx38(HighlightedLine, { parts });
|
|
24472
24527
|
}
|
|
24473
24528
|
function truncateLine(line, maxWidth) {
|
|
24474
24529
|
if (line.length <= maxWidth) return line;
|
|
@@ -24481,7 +24536,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
24481
24536
|
const totalLines = allLines.length;
|
|
24482
24537
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24483
24538
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
24484
|
-
return /* @__PURE__ */
|
|
24539
|
+
return /* @__PURE__ */ jsx38(
|
|
24485
24540
|
ScrollablePanel,
|
|
24486
24541
|
{
|
|
24487
24542
|
title: label,
|
|
@@ -24494,14 +24549,14 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
24494
24549
|
borderColor: active ? "white" : void 0,
|
|
24495
24550
|
children: visibleLines.map((line, i) => {
|
|
24496
24551
|
const truncated = truncateLine(line, innerWidth);
|
|
24497
|
-
return /* @__PURE__ */
|
|
24552
|
+
return /* @__PURE__ */ jsx38(Box28, { children: highlightJson(truncated) }, i);
|
|
24498
24553
|
})
|
|
24499
24554
|
}
|
|
24500
24555
|
);
|
|
24501
24556
|
}
|
|
24502
24557
|
|
|
24503
24558
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationalePanel.tsx
|
|
24504
|
-
import { jsx as
|
|
24559
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
24505
24560
|
function renderRationaleLines(rows, innerWidth) {
|
|
24506
24561
|
const out = [];
|
|
24507
24562
|
rows.forEach((row, idx) => {
|
|
@@ -24534,7 +24589,7 @@ function RationalePanel({
|
|
|
24534
24589
|
const visible = allLines.slice(scrollOffset, scrollOffset + height);
|
|
24535
24590
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24536
24591
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
24537
|
-
return /* @__PURE__ */
|
|
24592
|
+
return /* @__PURE__ */ jsx39(
|
|
24538
24593
|
ScrollablePanel,
|
|
24539
24594
|
{
|
|
24540
24595
|
title: `RATIONALE \u2014 ${componentName}`,
|
|
@@ -24545,15 +24600,15 @@ function RationalePanel({
|
|
|
24545
24600
|
visibleStart,
|
|
24546
24601
|
visibleEnd,
|
|
24547
24602
|
borderColor: active ? PALETTE.text : void 0,
|
|
24548
|
-
children: visible.map((line, i) => /* @__PURE__ */
|
|
24603
|
+
children: visible.map((line, i) => /* @__PURE__ */ jsx39(RationaleLine, { line, active }, i))
|
|
24549
24604
|
}
|
|
24550
24605
|
);
|
|
24551
24606
|
}
|
|
24552
24607
|
|
|
24553
24608
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx
|
|
24554
24609
|
import figures7 from "figures";
|
|
24555
|
-
import { Box as
|
|
24556
|
-
import { jsx as
|
|
24610
|
+
import { Box as Box29, Text as Text31 } from "ink";
|
|
24611
|
+
import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
24557
24612
|
function TokenReviewPanel({
|
|
24558
24613
|
componentName,
|
|
24559
24614
|
suggestions,
|
|
@@ -24573,7 +24628,7 @@ function TokenReviewPanel({
|
|
|
24573
24628
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
24574
24629
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
24575
24630
|
return /* @__PURE__ */ jsxs29(
|
|
24576
|
-
|
|
24631
|
+
Box29,
|
|
24577
24632
|
{
|
|
24578
24633
|
flexDirection: "column",
|
|
24579
24634
|
width,
|
|
@@ -24581,15 +24636,15 @@ function TokenReviewPanel({
|
|
|
24581
24636
|
borderStyle: "single",
|
|
24582
24637
|
borderColor: active ? PALETTE.text : void 0,
|
|
24583
24638
|
children: [
|
|
24584
|
-
/* @__PURE__ */
|
|
24585
|
-
/* @__PURE__ */
|
|
24586
|
-
/* @__PURE__ */
|
|
24587
|
-
current.paths.length === 0 && /* @__PURE__ */
|
|
24639
|
+
/* @__PURE__ */ jsx40(Text31, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
24640
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
24641
|
+
/* @__PURE__ */ jsx40(Text31, { children: " " }),
|
|
24642
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
24588
24643
|
visiblePaths.map((path5, i) => {
|
|
24589
24644
|
const pathIndex = scrollStart + i;
|
|
24590
24645
|
const checked = editSelection.has(path5);
|
|
24591
24646
|
const focused = pathIndex === editCursor;
|
|
24592
|
-
return /* @__PURE__ */
|
|
24647
|
+
return /* @__PURE__ */ jsx40(Box29, { children: /* @__PURE__ */ jsx40(
|
|
24593
24648
|
Text31,
|
|
24594
24649
|
{
|
|
24595
24650
|
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
@@ -24599,15 +24654,15 @@ function TokenReviewPanel({
|
|
|
24599
24654
|
}
|
|
24600
24655
|
) }, path5);
|
|
24601
24656
|
}),
|
|
24602
|
-
/* @__PURE__ */
|
|
24603
|
-
/* @__PURE__ */
|
|
24604
|
-
/* @__PURE__ */
|
|
24657
|
+
/* @__PURE__ */ jsx40(Text31, { children: " " }),
|
|
24658
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
24659
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
24605
24660
|
]
|
|
24606
24661
|
}
|
|
24607
24662
|
);
|
|
24608
24663
|
}
|
|
24609
24664
|
return /* @__PURE__ */ jsxs29(
|
|
24610
|
-
|
|
24665
|
+
Box29,
|
|
24611
24666
|
{
|
|
24612
24667
|
flexDirection: "column",
|
|
24613
24668
|
width,
|
|
@@ -24615,25 +24670,25 @@ function TokenReviewPanel({
|
|
|
24615
24670
|
borderStyle: "single",
|
|
24616
24671
|
borderColor: active ? PALETTE.text : void 0,
|
|
24617
24672
|
children: [
|
|
24618
|
-
/* @__PURE__ */
|
|
24619
|
-
suggestions.length === 0 && /* @__PURE__ */
|
|
24673
|
+
/* @__PURE__ */ jsx40(Text31, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
24674
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
24620
24675
|
suggestions.map((s, i) => {
|
|
24621
24676
|
const focused = i === selectedRow;
|
|
24622
|
-
return /* @__PURE__ */ jsxs29(
|
|
24623
|
-
/* @__PURE__ */
|
|
24624
|
-
/* @__PURE__ */
|
|
24625
|
-
/* @__PURE__ */
|
|
24677
|
+
return /* @__PURE__ */ jsxs29(Box29, { flexDirection: "column", children: [
|
|
24678
|
+
/* @__PURE__ */ jsx40(Box29, { children: /* @__PURE__ */ jsx40(Text31, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
|
|
24679
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
24680
|
+
/* @__PURE__ */ jsx40(Text31, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
24626
24681
|
] }, s.propName);
|
|
24627
24682
|
}),
|
|
24628
|
-
/* @__PURE__ */
|
|
24629
|
-
/* @__PURE__ */
|
|
24683
|
+
/* @__PURE__ */ jsx40(Text31, { children: " " }),
|
|
24684
|
+
/* @__PURE__ */ jsx40(Text31, { children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
|
|
24630
24685
|
]
|
|
24631
24686
|
}
|
|
24632
24687
|
);
|
|
24633
24688
|
}
|
|
24634
24689
|
|
|
24635
24690
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-details-panel.tsx
|
|
24636
|
-
import { Fragment as
|
|
24691
|
+
import { Fragment as Fragment11, jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
24637
24692
|
function ReviewDetailsPanel({
|
|
24638
24693
|
selectedKey,
|
|
24639
24694
|
panelOpen,
|
|
@@ -24668,7 +24723,7 @@ function ReviewDetailsPanel({
|
|
|
24668
24723
|
rationale: s.rationale ?? ""
|
|
24669
24724
|
}))
|
|
24670
24725
|
];
|
|
24671
|
-
return /* @__PURE__ */
|
|
24726
|
+
return /* @__PURE__ */ jsx41(
|
|
24672
24727
|
RationalePanel,
|
|
24673
24728
|
{
|
|
24674
24729
|
componentName: componentRationale?.name ?? selectedKey,
|
|
@@ -24681,7 +24736,7 @@ function ReviewDetailsPanel({
|
|
|
24681
24736
|
);
|
|
24682
24737
|
}
|
|
24683
24738
|
if (panelOpen === "component-rationale") {
|
|
24684
|
-
return /* @__PURE__ */
|
|
24739
|
+
return /* @__PURE__ */ jsx41(
|
|
24685
24740
|
ComponentRationalePanel,
|
|
24686
24741
|
{
|
|
24687
24742
|
data: componentRationale ?? {
|
|
@@ -24707,13 +24762,13 @@ function ReviewDetailsPanel({
|
|
|
24707
24762
|
const sourceLineCount = Math.max(1, height - 4);
|
|
24708
24763
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
24709
24764
|
return /* @__PURE__ */ jsxs30(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
24710
|
-
/* @__PURE__ */
|
|
24711
|
-
source ? lines.map((line, index) => /* @__PURE__ */
|
|
24712
|
-
/* @__PURE__ */
|
|
24765
|
+
/* @__PURE__ */ jsx41(Text32, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
24766
|
+
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)" }),
|
|
24767
|
+
/* @__PURE__ */ jsx41(Text32, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
24713
24768
|
] });
|
|
24714
24769
|
}
|
|
24715
24770
|
if (panelOpen === "token-review") {
|
|
24716
|
-
return /* @__PURE__ */
|
|
24771
|
+
return /* @__PURE__ */ jsx41(
|
|
24717
24772
|
TokenReviewPanel,
|
|
24718
24773
|
{
|
|
24719
24774
|
componentName: selectedKey,
|
|
@@ -24729,7 +24784,7 @@ function ReviewDetailsPanel({
|
|
|
24729
24784
|
);
|
|
24730
24785
|
}
|
|
24731
24786
|
if (showJson) {
|
|
24732
|
-
return /* @__PURE__ */
|
|
24787
|
+
return /* @__PURE__ */ jsx41(
|
|
24733
24788
|
JsonPanel,
|
|
24734
24789
|
{
|
|
24735
24790
|
label: "GENERATED DEFINITION (read-only)",
|
|
@@ -24741,11 +24796,11 @@ function ReviewDetailsPanel({
|
|
|
24741
24796
|
}
|
|
24742
24797
|
);
|
|
24743
24798
|
}
|
|
24744
|
-
return /* @__PURE__ */
|
|
24799
|
+
return /* @__PURE__ */ jsx41(Fragment11, { children: editor });
|
|
24745
24800
|
}
|
|
24746
24801
|
|
|
24747
24802
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDetailsEditor.tsx
|
|
24748
|
-
import { jsx as
|
|
24803
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
24749
24804
|
import { createElement } from "react";
|
|
24750
24805
|
function toFieldEditorMetadata(reviewMetadata) {
|
|
24751
24806
|
if (!reviewMetadata) return void 0;
|
|
@@ -24779,7 +24834,7 @@ function ReviewDetailsEditor({
|
|
|
24779
24834
|
jsonScrollOffset,
|
|
24780
24835
|
currentTokenSuggestions
|
|
24781
24836
|
} = reviewEditor;
|
|
24782
|
-
return /* @__PURE__ */
|
|
24837
|
+
return /* @__PURE__ */ jsx42(
|
|
24783
24838
|
ReviewDetailsPanel,
|
|
24784
24839
|
{
|
|
24785
24840
|
selectedKey,
|
|
@@ -24819,7 +24874,7 @@ function ReviewDetailsEditor({
|
|
|
24819
24874
|
}
|
|
24820
24875
|
|
|
24821
24876
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx
|
|
24822
|
-
import { Fragment as
|
|
24877
|
+
import { Fragment as Fragment12, jsx as jsx43, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
24823
24878
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
24824
24879
|
return {
|
|
24825
24880
|
value: reviewEditor.draftValue || selectedJson,
|
|
@@ -24859,17 +24914,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
24859
24914
|
hidden
|
|
24860
24915
|
}) {
|
|
24861
24916
|
if (hidden || count === 0) return null;
|
|
24862
|
-
return /* @__PURE__ */
|
|
24917
|
+
return /* @__PURE__ */ jsx43(Text33, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
24863
24918
|
}
|
|
24864
24919
|
function ReviewNoSelection() {
|
|
24865
|
-
return /* @__PURE__ */
|
|
24920
|
+
return /* @__PURE__ */ jsx43(Box30, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx43(Text33, { color: PALETTE.muted, children: "No component selected" }) });
|
|
24866
24921
|
}
|
|
24867
24922
|
function ReviewFinalizeError({
|
|
24868
24923
|
message,
|
|
24869
24924
|
hidden
|
|
24870
24925
|
}) {
|
|
24871
24926
|
if (hidden || !message) return null;
|
|
24872
|
-
return /* @__PURE__ */
|
|
24927
|
+
return /* @__PURE__ */ jsx43(Text33, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
24873
24928
|
}
|
|
24874
24929
|
function ReviewPanelFooter({
|
|
24875
24930
|
reviewEditor,
|
|
@@ -24878,10 +24933,10 @@ function ReviewPanelFooter({
|
|
|
24878
24933
|
livePreview,
|
|
24879
24934
|
livePreviewSpinner
|
|
24880
24935
|
}) {
|
|
24881
|
-
return /* @__PURE__ */ jsxs31(
|
|
24936
|
+
return /* @__PURE__ */ jsxs31(Fragment12, { children: [
|
|
24882
24937
|
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" : ""),
|
|
24883
|
-
livePreview.status === "running" && /* @__PURE__ */
|
|
24884
|
-
livePreview.disabled && /* @__PURE__ */
|
|
24938
|
+
livePreview.status === "running" && /* @__PURE__ */ jsx43(Text33, { children: ` ${livePreviewSpinner} live preview` }),
|
|
24939
|
+
livePreview.disabled && /* @__PURE__ */ jsx43(Text33, { children: " \xB7 live preview disabled" })
|
|
24885
24940
|
] });
|
|
24886
24941
|
}
|
|
24887
24942
|
function ReviewComponentTitle({
|
|
@@ -24890,9 +24945,9 @@ function ReviewComponentTitle({
|
|
|
24890
24945
|
slotCount,
|
|
24891
24946
|
sidebarFocused
|
|
24892
24947
|
}) {
|
|
24893
|
-
return /* @__PURE__ */ jsxs31(
|
|
24894
|
-
/* @__PURE__ */
|
|
24895
|
-
/* @__PURE__ */
|
|
24948
|
+
return /* @__PURE__ */ jsxs31(Box30, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
24949
|
+
/* @__PURE__ */ jsx43(Text33, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
24950
|
+
/* @__PURE__ */ jsx43(Box30, { flexGrow: 1 }),
|
|
24896
24951
|
/* @__PURE__ */ jsxs31(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
24897
24952
|
propCount,
|
|
24898
24953
|
" prop",
|
|
@@ -24924,8 +24979,8 @@ function ReviewComponentPanel({
|
|
|
24924
24979
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
24925
24980
|
const contentHeight = Math.max(1, height - 2);
|
|
24926
24981
|
const contentWidth = Math.max(1, width - 1);
|
|
24927
|
-
return /* @__PURE__ */
|
|
24928
|
-
/* @__PURE__ */
|
|
24982
|
+
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: [
|
|
24983
|
+
/* @__PURE__ */ jsx43(Box30, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx43(
|
|
24929
24984
|
ReviewDetailsEditor,
|
|
24930
24985
|
{
|
|
24931
24986
|
selectedKey,
|
|
@@ -24938,7 +24993,7 @@ function ReviewComponentPanel({
|
|
|
24938
24993
|
jsonValue,
|
|
24939
24994
|
sidebarFocused,
|
|
24940
24995
|
fieldEditor,
|
|
24941
|
-
header: /* @__PURE__ */
|
|
24996
|
+
header: /* @__PURE__ */ jsx43(
|
|
24942
24997
|
ReviewComponentTitle,
|
|
24943
24998
|
{
|
|
24944
24999
|
selectedKey,
|
|
@@ -24949,8 +25004,8 @@ function ReviewComponentPanel({
|
|
|
24949
25004
|
)
|
|
24950
25005
|
}
|
|
24951
25006
|
) }),
|
|
24952
|
-
/* @__PURE__ */
|
|
24953
|
-
/* @__PURE__ */
|
|
25007
|
+
/* @__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 : " " }) }),
|
|
25008
|
+
/* @__PURE__ */ jsx43(Box30, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx43(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx43(
|
|
24954
25009
|
ReviewPanelFooter,
|
|
24955
25010
|
{
|
|
24956
25011
|
reviewEditor,
|
|
@@ -24964,8 +25019,8 @@ function ReviewComponentPanel({
|
|
|
24964
25019
|
}
|
|
24965
25020
|
|
|
24966
25021
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx
|
|
24967
|
-
import { Box as
|
|
24968
|
-
import { jsx as
|
|
25022
|
+
import { Box as Box31, Text as Text34 } from "ink";
|
|
25023
|
+
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
24969
25024
|
function countReviewStatuses(entries) {
|
|
24970
25025
|
return entries.reduce(
|
|
24971
25026
|
(counts, entry) => {
|
|
@@ -24978,13 +25033,13 @@ function countReviewStatuses(entries) {
|
|
|
24978
25033
|
);
|
|
24979
25034
|
}
|
|
24980
25035
|
function ReviewLoadingState() {
|
|
24981
|
-
return /* @__PURE__ */
|
|
25036
|
+
return /* @__PURE__ */ jsx44(Box31, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx44(Text34, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
24982
25037
|
}
|
|
24983
25038
|
function ReviewLoadError({ message }) {
|
|
24984
|
-
return /* @__PURE__ */ jsxs32(
|
|
24985
|
-
/* @__PURE__ */
|
|
24986
|
-
/* @__PURE__ */
|
|
24987
|
-
/* @__PURE__ */
|
|
25039
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
25040
|
+
/* @__PURE__ */ jsx44(Text34, { color: PALETTE.error, children: message }),
|
|
25041
|
+
/* @__PURE__ */ jsx44(Text34, { children: " " }),
|
|
25042
|
+
/* @__PURE__ */ jsx44(ControlHints, { hints: [{ keys: "q / Enter / Esc", label: "Quit" }] })
|
|
24988
25043
|
] });
|
|
24989
25044
|
}
|
|
24990
25045
|
|
|
@@ -25184,8 +25239,8 @@ async function runLivePreview(opts) {
|
|
|
25184
25239
|
}
|
|
25185
25240
|
|
|
25186
25241
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx
|
|
25187
|
-
import { Box as
|
|
25188
|
-
import { Fragment as
|
|
25242
|
+
import { Box as Box32, Text as Text35 } from "ink";
|
|
25243
|
+
import { Fragment as Fragment13, jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
25189
25244
|
var FINALIZE_REMOVED_WINDOW = 6;
|
|
25190
25245
|
function FinalizeDialog({
|
|
25191
25246
|
accepted,
|
|
@@ -25214,51 +25269,51 @@ function FinalizeDialog({
|
|
|
25214
25269
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
25215
25270
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
25216
25271
|
const hasMoreAbove = offset > 0;
|
|
25217
|
-
return /* @__PURE__ */
|
|
25218
|
-
/* @__PURE__ */
|
|
25219
|
-
/* @__PURE__ */
|
|
25272
|
+
return /* @__PURE__ */ jsx45(Box32, { width: "100%", paddingX: 2, children: /* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", alignItems: "flex-start", children: [
|
|
25273
|
+
/* @__PURE__ */ jsx45(Text35, { bold: true, children: "Finalize" }),
|
|
25274
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " }),
|
|
25220
25275
|
/* @__PURE__ */ jsxs33(Text35, { children: [
|
|
25221
25276
|
/* @__PURE__ */ jsxs33(Text35, { color: PALETTE.success, children: [
|
|
25222
25277
|
accepted,
|
|
25223
25278
|
" accepted"
|
|
25224
25279
|
] }),
|
|
25225
|
-
/* @__PURE__ */
|
|
25280
|
+
/* @__PURE__ */ jsx45(Text35, { children: " \xB7 " }),
|
|
25226
25281
|
/* @__PURE__ */ jsxs33(Text35, { color: PALETTE.error, children: [
|
|
25227
25282
|
rejected,
|
|
25228
25283
|
" rejected"
|
|
25229
25284
|
] }),
|
|
25230
|
-
/* @__PURE__ */
|
|
25285
|
+
/* @__PURE__ */ jsx45(Text35, { children: " \xB7 " }),
|
|
25231
25286
|
/* @__PURE__ */ jsxs33(Text35, { color: PALETTE.muted, children: [
|
|
25232
25287
|
needsReview,
|
|
25233
25288
|
" unresolved"
|
|
25234
25289
|
] })
|
|
25235
25290
|
] }),
|
|
25236
|
-
/* @__PURE__ */
|
|
25237
|
-
noneAccepted && /* @__PURE__ */ jsxs33(
|
|
25238
|
-
/* @__PURE__ */
|
|
25239
|
-
/* @__PURE__ */
|
|
25240
|
-
/* @__PURE__ */
|
|
25291
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " }),
|
|
25292
|
+
noneAccepted && /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
25293
|
+
/* @__PURE__ */ jsx45(Text35, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
25294
|
+
/* @__PURE__ */ jsx45(Text35, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
25295
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
25241
25296
|
] }),
|
|
25242
|
-
!allResolved && /* @__PURE__ */ jsxs33(
|
|
25243
|
-
/* @__PURE__ */
|
|
25244
|
-
/* @__PURE__ */
|
|
25245
|
-
/* @__PURE__ */
|
|
25297
|
+
!allResolved && /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
25298
|
+
/* @__PURE__ */ jsx45(Text35, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
25299
|
+
/* @__PURE__ */ jsx45(Text35, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
25300
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
25246
25301
|
] }),
|
|
25247
|
-
/* @__PURE__ */ jsxs33(
|
|
25248
|
-
previewStatus === "running" ? /* @__PURE__ */
|
|
25249
|
-
/* @__PURE__ */
|
|
25302
|
+
/* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", height: 2, children: [
|
|
25303
|
+
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: " " }),
|
|
25304
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
25250
25305
|
] }),
|
|
25251
|
-
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs33(
|
|
25252
|
-
/* @__PURE__ */
|
|
25253
|
-
hasMoreAbove && /* @__PURE__ */
|
|
25254
|
-
windowed.map((rc) => /* @__PURE__ */
|
|
25255
|
-
hasMoreBelow && /* @__PURE__ */
|
|
25256
|
-
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */
|
|
25257
|
-
/* @__PURE__ */
|
|
25306
|
+
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs33(Fragment13, { children: [
|
|
25307
|
+
/* @__PURE__ */ jsx45(Text35, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
25308
|
+
hasMoreAbove && /* @__PURE__ */ jsx45(Text35, { color: PALETTE.muted, children: "\u2191 more above" }),
|
|
25309
|
+
windowed.map((rc) => /* @__PURE__ */ jsx45(Text35, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
25310
|
+
hasMoreBelow && /* @__PURE__ */ jsx45(Text35, { color: PALETTE.muted, children: "\u2193 more below" }),
|
|
25311
|
+
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx45(Text35, { children: "[\u2191\u2193] scroll deletions" }),
|
|
25312
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " })
|
|
25258
25313
|
] }),
|
|
25259
|
-
/* @__PURE__ */
|
|
25260
|
-
/* @__PURE__ */
|
|
25261
|
-
/* @__PURE__ */
|
|
25314
|
+
/* @__PURE__ */ jsx45(Text35, { children: noneAccepted ? "Confirm exit with nothing accepted?" : allResolved ? "Save decisions and exit? All components resolved." : "Save decisions and exit?" }),
|
|
25315
|
+
/* @__PURE__ */ jsx45(Text35, { children: " " }),
|
|
25316
|
+
/* @__PURE__ */ jsx45(
|
|
25262
25317
|
ControlHints,
|
|
25263
25318
|
{
|
|
25264
25319
|
hints: [
|
|
@@ -25671,11 +25726,11 @@ function useReviewSurfaceState(initialFinalizeError = null) {
|
|
|
25671
25726
|
}
|
|
25672
25727
|
|
|
25673
25728
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx
|
|
25674
|
-
import { Box as
|
|
25729
|
+
import { Box as Box34, Text as Text37 } from "ink";
|
|
25675
25730
|
|
|
25676
25731
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/QuitDialog.tsx
|
|
25677
|
-
import { Box as
|
|
25678
|
-
import { Fragment as
|
|
25732
|
+
import { Box as Box33, Text as Text36 } from "ink";
|
|
25733
|
+
import { Fragment as Fragment14, jsx as jsx46, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
25679
25734
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
25680
25735
|
useImmediateInput((input, key) => {
|
|
25681
25736
|
if (input === "y" || key.return) {
|
|
@@ -25684,16 +25739,16 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
25684
25739
|
onCancel();
|
|
25685
25740
|
}
|
|
25686
25741
|
});
|
|
25687
|
-
return /* @__PURE__ */ jsxs34(
|
|
25688
|
-
/* @__PURE__ */
|
|
25689
|
-
/* @__PURE__ */
|
|
25690
|
-
hasUnsavedDrafts ? /* @__PURE__ */ jsxs34(
|
|
25691
|
-
/* @__PURE__ */
|
|
25692
|
-
/* @__PURE__ */
|
|
25693
|
-
/* @__PURE__ */
|
|
25694
|
-
] }) : /* @__PURE__ */
|
|
25695
|
-
/* @__PURE__ */
|
|
25696
|
-
/* @__PURE__ */
|
|
25742
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
25743
|
+
/* @__PURE__ */ jsx46(Text36, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
25744
|
+
/* @__PURE__ */ jsx46(Text36, { children: " " }),
|
|
25745
|
+
hasUnsavedDrafts ? /* @__PURE__ */ jsxs34(Fragment14, { children: [
|
|
25746
|
+
/* @__PURE__ */ jsx46(Text36, { children: "You have unsaved draft edits." }),
|
|
25747
|
+
/* @__PURE__ */ jsx46(Text36, { children: "Session state is preserved \u2014 you can resume" }),
|
|
25748
|
+
/* @__PURE__ */ jsx46(Text36, { children: "by running the same review command again." })
|
|
25749
|
+
] }) : /* @__PURE__ */ jsx46(Text36, { children: "Session is saved. Quit without finalizing?" }),
|
|
25750
|
+
/* @__PURE__ */ jsx46(Text36, { children: " " }),
|
|
25751
|
+
/* @__PURE__ */ jsx46(
|
|
25697
25752
|
ControlHints,
|
|
25698
25753
|
{
|
|
25699
25754
|
hints: [
|
|
@@ -25706,7 +25761,7 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
25706
25761
|
}
|
|
25707
25762
|
|
|
25708
25763
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx
|
|
25709
|
-
import { Fragment as
|
|
25764
|
+
import { Fragment as Fragment15, jsx as jsx47, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
25710
25765
|
function ReviewFinalizeDialogs({
|
|
25711
25766
|
showFinalize,
|
|
25712
25767
|
showQuit,
|
|
@@ -25720,8 +25775,8 @@ function ReviewFinalizeDialogs({
|
|
|
25720
25775
|
onQuitCancel
|
|
25721
25776
|
}) {
|
|
25722
25777
|
const { accepted, rejected, needsReview } = countReviewStatuses(components);
|
|
25723
|
-
return /* @__PURE__ */ jsxs35(
|
|
25724
|
-
showFinalize && /* @__PURE__ */
|
|
25778
|
+
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
25779
|
+
showFinalize && /* @__PURE__ */ jsx47(
|
|
25725
25780
|
FinalizeDialog,
|
|
25726
25781
|
{
|
|
25727
25782
|
accepted,
|
|
@@ -25734,7 +25789,7 @@ function ReviewFinalizeDialogs({
|
|
|
25734
25789
|
onCancel: onFinalizeCancel
|
|
25735
25790
|
}
|
|
25736
25791
|
),
|
|
25737
|
-
showQuit && /* @__PURE__ */
|
|
25792
|
+
showQuit && /* @__PURE__ */ jsx47(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
|
|
25738
25793
|
] });
|
|
25739
25794
|
}
|
|
25740
25795
|
function ReviewStepDialogs({
|
|
@@ -25744,7 +25799,7 @@ function ReviewStepDialogs({
|
|
|
25744
25799
|
onFinalize,
|
|
25745
25800
|
onQuit
|
|
25746
25801
|
}) {
|
|
25747
|
-
return /* @__PURE__ */
|
|
25802
|
+
return /* @__PURE__ */ jsx47(
|
|
25748
25803
|
ReviewFinalizeDialogs,
|
|
25749
25804
|
{
|
|
25750
25805
|
showFinalize: surfaceState.showFinalize,
|
|
@@ -25762,12 +25817,12 @@ function ReviewStepDialogs({
|
|
|
25762
25817
|
}
|
|
25763
25818
|
function ReviewReloadDialog({ open }) {
|
|
25764
25819
|
if (!open) return null;
|
|
25765
|
-
return /* @__PURE__ */ jsxs35(
|
|
25766
|
-
/* @__PURE__ */
|
|
25767
|
-
/* @__PURE__ */
|
|
25768
|
-
/* @__PURE__ */
|
|
25769
|
-
/* @__PURE__ */
|
|
25770
|
-
/* @__PURE__ */
|
|
25820
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
25821
|
+
/* @__PURE__ */ jsx47(Text37, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
25822
|
+
/* @__PURE__ */ jsx47(Text37, { children: "Unsaved in-memory changes will be lost." }),
|
|
25823
|
+
/* @__PURE__ */ jsx47(Text37, { children: " " }),
|
|
25824
|
+
/* @__PURE__ */ jsx47(Text37, { children: " [Enter] Confirm" }),
|
|
25825
|
+
/* @__PURE__ */ jsx47(Text37, { children: " [Esc] Cancel" })
|
|
25771
25826
|
] });
|
|
25772
25827
|
}
|
|
25773
25828
|
|
|
@@ -26134,8 +26189,8 @@ function useReviewPreview({
|
|
|
26134
26189
|
}
|
|
26135
26190
|
|
|
26136
26191
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx
|
|
26137
|
-
import { Box as
|
|
26138
|
-
import { jsx as
|
|
26192
|
+
import { Box as Box35, Text as Text38 } from "ink";
|
|
26193
|
+
import { jsx as jsx48, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
26139
26194
|
function LivePreviewSummary({
|
|
26140
26195
|
enabled,
|
|
26141
26196
|
previewAnnotations,
|
|
@@ -26149,24 +26204,24 @@ function LivePreviewSummary({
|
|
|
26149
26204
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
26150
26205
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
26151
26206
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
26152
|
-
if (disabled) return /* @__PURE__ */
|
|
26153
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */
|
|
26207
|
+
if (disabled) return /* @__PURE__ */ jsx48(Text38, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
26208
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx48(Text38, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
26154
26209
|
if (!hasCounts) return null;
|
|
26155
|
-
return /* @__PURE__ */ jsxs36(
|
|
26156
|
-
/* @__PURE__ */
|
|
26157
|
-
/* @__PURE__ */
|
|
26158
|
-
/* @__PURE__ */
|
|
26159
|
-
/* @__PURE__ */
|
|
26160
|
-
/* @__PURE__ */
|
|
26161
|
-
/* @__PURE__ */
|
|
26162
|
-
showRemovedListHint && removedCount > 0 && /* @__PURE__ */
|
|
26163
|
-
/* @__PURE__ */
|
|
26164
|
-
/* @__PURE__ */
|
|
26210
|
+
return /* @__PURE__ */ jsxs36(Box35, { children: [
|
|
26211
|
+
/* @__PURE__ */ jsx48(Text38, { children: "Preview: " }),
|
|
26212
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
26213
|
+
/* @__PURE__ */ jsx48(Text38, { children: " \xB7 " }),
|
|
26214
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
26215
|
+
/* @__PURE__ */ jsx48(Text38, { children: " \xB7 " }),
|
|
26216
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.muted, children: `${counts.removed} removed` }),
|
|
26217
|
+
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx48(Text38, { children: " ([d] removed list)" }),
|
|
26218
|
+
/* @__PURE__ */ jsx48(Text38, { children: " \xB7 " }),
|
|
26219
|
+
/* @__PURE__ */ jsx48(Text38, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
26165
26220
|
] });
|
|
26166
26221
|
}
|
|
26167
26222
|
|
|
26168
26223
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
26169
|
-
import { Fragment as
|
|
26224
|
+
import { Fragment as Fragment16, jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
26170
26225
|
function sortComponentsForSidebar(components, cycleParticipants) {
|
|
26171
26226
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
26172
26227
|
const tier = (c2) => {
|
|
@@ -26210,7 +26265,7 @@ function CyclePathLine({
|
|
|
26210
26265
|
return /* @__PURE__ */ jsxs37(Text39, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
26211
26266
|
prefix,
|
|
26212
26267
|
segments.map(
|
|
26213
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */
|
|
26268
|
+
(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)
|
|
26214
26269
|
)
|
|
26215
26270
|
] });
|
|
26216
26271
|
}
|
|
@@ -26222,31 +26277,31 @@ function CycleDetailPanel({
|
|
|
26222
26277
|
height
|
|
26223
26278
|
}) {
|
|
26224
26279
|
const lines = [
|
|
26225
|
-
/* @__PURE__ */
|
|
26226
|
-
/* @__PURE__ */
|
|
26227
|
-
/* @__PURE__ */
|
|
26228
|
-
/* @__PURE__ */
|
|
26280
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
26281
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
26282
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
26283
|
+
/* @__PURE__ */ jsx49(Text39, { children: " " }, "cyc-space")
|
|
26229
26284
|
];
|
|
26230
26285
|
cycles.forEach((cycle, index) => {
|
|
26231
26286
|
const nodeCount = new Set(cycle.path).size;
|
|
26232
26287
|
const isCursor = index === cursor;
|
|
26233
26288
|
lines.push(
|
|
26234
|
-
/* @__PURE__ */
|
|
26235
|
-
/* @__PURE__ */
|
|
26289
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, inverse: isCursor, children: `${isCursor ? figures8.pointer : " "} Cycle ${index + 1} (${nodeCount} component${nodeCount === 1 ? "" : "s"}):` }, `cyc-h-${index}`),
|
|
26290
|
+
/* @__PURE__ */ jsx49(CyclePathLine, { segments: formatCyclePathSegments2(cycle, 16), prefix: " " }, `cyc-p-${index}`)
|
|
26236
26291
|
);
|
|
26237
26292
|
if (cycle.suggestedBreak) {
|
|
26238
26293
|
lines.push(
|
|
26239
|
-
/* @__PURE__ */
|
|
26294
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
26240
26295
|
);
|
|
26241
26296
|
}
|
|
26242
|
-
lines.push(/* @__PURE__ */
|
|
26297
|
+
lines.push(/* @__PURE__ */ jsx49(Text39, { children: " " }, `cyc-s-${index}`));
|
|
26243
26298
|
});
|
|
26244
26299
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
26245
26300
|
const viewportHeight = Math.max(1, height - 3);
|
|
26246
26301
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
26247
26302
|
return /* @__PURE__ */ jsxs37(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
26248
26303
|
visible,
|
|
26249
|
-
/* @__PURE__ */
|
|
26304
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: footer })
|
|
26250
26305
|
] });
|
|
26251
26306
|
}
|
|
26252
26307
|
function BreakCyclePanel({
|
|
@@ -26258,13 +26313,13 @@ function BreakCyclePanel({
|
|
|
26258
26313
|
height
|
|
26259
26314
|
}) {
|
|
26260
26315
|
return /* @__PURE__ */ jsxs37(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
26261
|
-
/* @__PURE__ */
|
|
26262
|
-
cycle && /* @__PURE__ */
|
|
26263
|
-
/* @__PURE__ */
|
|
26264
|
-
/* @__PURE__ */
|
|
26265
|
-
edges.length > 0 && /* @__PURE__ */
|
|
26266
|
-
edges.map((edge, index) => /* @__PURE__ */
|
|
26267
|
-
confirming ? /* @__PURE__ */
|
|
26316
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
26317
|
+
cycle && /* @__PURE__ */ jsx49(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
26318
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
26319
|
+
/* @__PURE__ */ jsx49(Text39, { children: " " }),
|
|
26320
|
+
edges.length > 0 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.muted, children: "remove slot edge:" }),
|
|
26321
|
+
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}`)),
|
|
26322
|
+
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" })
|
|
26268
26323
|
] });
|
|
26269
26324
|
}
|
|
26270
26325
|
var HELP_SECTIONS2 = [
|
|
@@ -26370,9 +26425,9 @@ function deriveBreakingChanges(response) {
|
|
|
26370
26425
|
}
|
|
26371
26426
|
function GenerateReviewStep(props) {
|
|
26372
26427
|
if (!props.extractSessionId) {
|
|
26373
|
-
return /* @__PURE__ */
|
|
26428
|
+
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." }) });
|
|
26374
26429
|
}
|
|
26375
|
-
return /* @__PURE__ */
|
|
26430
|
+
return /* @__PURE__ */ jsx49(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
26376
26431
|
}
|
|
26377
26432
|
function GenerateReviewStepView({
|
|
26378
26433
|
extractSessionId,
|
|
@@ -27229,13 +27284,13 @@ function GenerateReviewStepView({
|
|
|
27229
27284
|
}
|
|
27230
27285
|
});
|
|
27231
27286
|
if (loading) {
|
|
27232
|
-
return /* @__PURE__ */
|
|
27287
|
+
return /* @__PURE__ */ jsx49(ReviewLoadingState, {});
|
|
27233
27288
|
}
|
|
27234
27289
|
if (loadError) {
|
|
27235
|
-
return /* @__PURE__ */
|
|
27290
|
+
return /* @__PURE__ */ jsx49(ReviewLoadError, { message: loadError });
|
|
27236
27291
|
}
|
|
27237
27292
|
if (showHelp) {
|
|
27238
|
-
return /* @__PURE__ */
|
|
27293
|
+
return /* @__PURE__ */ jsx49(HelpOverlay, { sections: HELP_SECTIONS2, handleInput: false, onClose: () => setShowHelp(false) });
|
|
27239
27294
|
}
|
|
27240
27295
|
const { selected, selectedJson, visibleJsonPanelValue } = getReviewSelectionState(
|
|
27241
27296
|
components,
|
|
@@ -27275,9 +27330,9 @@ function GenerateReviewStepView({
|
|
|
27275
27330
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
27276
27331
|
return false;
|
|
27277
27332
|
})();
|
|
27278
|
-
return /* @__PURE__ */ jsxs37(
|
|
27279
|
-
/* @__PURE__ */
|
|
27280
|
-
/* @__PURE__ */
|
|
27333
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
27334
|
+
/* @__PURE__ */ jsx49(StepHeader, { step: "review" }),
|
|
27335
|
+
/* @__PURE__ */ jsx49(
|
|
27281
27336
|
ReviewStepDialogs,
|
|
27282
27337
|
{
|
|
27283
27338
|
surfaceState: reviewSurface,
|
|
@@ -27287,15 +27342,15 @@ function GenerateReviewStepView({
|
|
|
27287
27342
|
onQuit
|
|
27288
27343
|
}
|
|
27289
27344
|
),
|
|
27290
|
-
/* @__PURE__ */
|
|
27291
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(
|
|
27292
|
-
/* @__PURE__ */
|
|
27293
|
-
!removedBannerCollapsed && /* @__PURE__ */ jsxs37(
|
|
27294
|
-
/* @__PURE__ */
|
|
27295
|
-
removedComponents.map((rc) => /* @__PURE__ */
|
|
27345
|
+
/* @__PURE__ */ jsx49(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
27346
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
27347
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
27348
|
+
!removedBannerCollapsed && /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
27349
|
+
/* @__PURE__ */ jsx49(Text39, { children: " " }),
|
|
27350
|
+
removedComponents.map((rc) => /* @__PURE__ */ jsx49(Text39, { children: removedComponentLine(rc) }, rc.id))
|
|
27296
27351
|
] })
|
|
27297
27352
|
] }),
|
|
27298
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
27353
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx49(Box36, { paddingX: 1, children: /* @__PURE__ */ jsx49(
|
|
27299
27354
|
Text39,
|
|
27300
27355
|
{
|
|
27301
27356
|
color: PALETTE.warning,
|
|
@@ -27306,14 +27361,14 @@ function GenerateReviewStepView({
|
|
|
27306
27361
|
const row = breakingRows[breakingCursor];
|
|
27307
27362
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
27308
27363
|
if (!comp) return null;
|
|
27309
|
-
return /* @__PURE__ */ jsxs37(
|
|
27310
|
-
/* @__PURE__ */
|
|
27311
|
-
comp.impact && /* @__PURE__ */
|
|
27312
|
-
comp.changes.length === 0 ? /* @__PURE__ */
|
|
27313
|
-
/* @__PURE__ */
|
|
27364
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
27365
|
+
/* @__PURE__ */ jsx49(Text39, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
27366
|
+
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"}` }),
|
|
27367
|
+
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}`)),
|
|
27368
|
+
/* @__PURE__ */ jsx49(Text39, { children: "[D/Esc] close detail" })
|
|
27314
27369
|
] });
|
|
27315
27370
|
})(),
|
|
27316
|
-
!dialogOpen && /* @__PURE__ */
|
|
27371
|
+
!dialogOpen && /* @__PURE__ */ jsx49(
|
|
27317
27372
|
LivePreviewSummary,
|
|
27318
27373
|
{
|
|
27319
27374
|
enabled: livePreview,
|
|
@@ -27332,16 +27387,16 @@ function GenerateReviewStepView({
|
|
|
27332
27387
|
const participantSet = cycleView.structural;
|
|
27333
27388
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
27334
27389
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
27335
|
-
return /* @__PURE__ */ jsxs37(
|
|
27336
|
-
/* @__PURE__ */
|
|
27337
|
-
members.length > 0 && /* @__PURE__ */
|
|
27338
|
-
ancestors.length > 0 && /* @__PURE__ */
|
|
27339
|
-
/* @__PURE__ */
|
|
27390
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
27391
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
27392
|
+
members.length > 0 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
27393
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
27394
|
+
/* @__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" })
|
|
27340
27395
|
] });
|
|
27341
27396
|
})(),
|
|
27342
|
-
/* @__PURE__ */
|
|
27343
|
-
/* @__PURE__ */
|
|
27344
|
-
!dialogOpen && breakPanel.isOpen && /* @__PURE__ */
|
|
27397
|
+
/* @__PURE__ */ jsx49(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
27398
|
+
/* @__PURE__ */ jsx49(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
|
|
27399
|
+
!dialogOpen && breakPanel.isOpen && /* @__PURE__ */ jsx49(
|
|
27345
27400
|
BreakCyclePanel,
|
|
27346
27401
|
{
|
|
27347
27402
|
cycle: cycleRows[cyclesCursor],
|
|
@@ -27352,7 +27407,7 @@ function GenerateReviewStepView({
|
|
|
27352
27407
|
height: panelHeight
|
|
27353
27408
|
}
|
|
27354
27409
|
),
|
|
27355
|
-
!dialogOpen && cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */
|
|
27410
|
+
!dialogOpen && cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsx49(
|
|
27356
27411
|
CycleDetailPanel,
|
|
27357
27412
|
{
|
|
27358
27413
|
cycles: cycleRows,
|
|
@@ -27362,8 +27417,8 @@ function GenerateReviewStepView({
|
|
|
27362
27417
|
height: panelHeight
|
|
27363
27418
|
}
|
|
27364
27419
|
),
|
|
27365
|
-
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
27366
|
-
breakingPanel.isOpen ? /* @__PURE__ */
|
|
27420
|
+
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box36, { children: [
|
|
27421
|
+
breakingPanel.isOpen ? /* @__PURE__ */ jsx49(
|
|
27367
27422
|
GotoBanner,
|
|
27368
27423
|
{
|
|
27369
27424
|
title: `Breaking changes \u2014 ${breakingRows[breakingCursor]?.componentName ?? "unknown component"}`,
|
|
@@ -27376,7 +27431,7 @@ function GenerateReviewStepView({
|
|
|
27376
27431
|
width: sidebarWidth,
|
|
27377
27432
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
|
|
27378
27433
|
}
|
|
27379
|
-
) : /* @__PURE__ */
|
|
27434
|
+
) : /* @__PURE__ */ jsx49(
|
|
27380
27435
|
GroupedSidebar,
|
|
27381
27436
|
{
|
|
27382
27437
|
items: groupedItems,
|
|
@@ -27417,7 +27472,7 @@ function GenerateReviewStepView({
|
|
|
27417
27472
|
graph: sidebarGraph
|
|
27418
27473
|
}
|
|
27419
27474
|
),
|
|
27420
|
-
selected ? /* @__PURE__ */
|
|
27475
|
+
selected ? /* @__PURE__ */ jsx49(
|
|
27421
27476
|
ReviewComponentPanel,
|
|
27422
27477
|
{
|
|
27423
27478
|
selectedKey: selected.key,
|
|
@@ -27449,12 +27504,12 @@ function GenerateReviewStepView({
|
|
|
27449
27504
|
livePreview: livePreviewHook,
|
|
27450
27505
|
livePreviewSpinner
|
|
27451
27506
|
}
|
|
27452
|
-
) : /* @__PURE__ */
|
|
27507
|
+
) : /* @__PURE__ */ jsx49(ReviewNoSelection, {})
|
|
27453
27508
|
] }),
|
|
27454
|
-
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
27455
|
-
/* @__PURE__ */
|
|
27509
|
+
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
27510
|
+
/* @__PURE__ */ jsx49(Text39, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
27456
27511
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
27457
|
-
return /* @__PURE__ */
|
|
27512
|
+
return /* @__PURE__ */ jsx49(
|
|
27458
27513
|
CyclePathLine,
|
|
27459
27514
|
{
|
|
27460
27515
|
segments: formatCyclePathSegments2(cycle),
|
|
@@ -27465,10 +27520,10 @@ function GenerateReviewStepView({
|
|
|
27465
27520
|
`cyc-banner-${idx}`
|
|
27466
27521
|
);
|
|
27467
27522
|
}),
|
|
27468
|
-
cycleRows.length > 3 && /* @__PURE__ */
|
|
27469
|
-
/* @__PURE__ */
|
|
27523
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx49(Text39, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
27524
|
+
/* @__PURE__ */ jsx49(Text39, { children: " press [c] for detail" })
|
|
27470
27525
|
] }),
|
|
27471
|
-
/* @__PURE__ */
|
|
27526
|
+
/* @__PURE__ */ jsx49(
|
|
27472
27527
|
SearchMatchSummary,
|
|
27473
27528
|
{
|
|
27474
27529
|
open: searchOpen,
|
|
@@ -27479,27 +27534,27 @@ function GenerateReviewStepView({
|
|
|
27479
27534
|
hidden: dialogOpen
|
|
27480
27535
|
}
|
|
27481
27536
|
),
|
|
27482
|
-
!dialogOpen && sidebarFocused && /* @__PURE__ */
|
|
27537
|
+
!dialogOpen && sidebarFocused && /* @__PURE__ */ jsx49(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
|
|
27483
27538
|
] });
|
|
27484
27539
|
}
|
|
27485
27540
|
|
|
27486
27541
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
|
|
27487
|
-
import { Box as
|
|
27488
|
-
import { jsx as
|
|
27542
|
+
import { Box as Box37, Text as Text40 } from "ink";
|
|
27543
|
+
import { jsx as jsx50, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
27489
27544
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
27490
27545
|
if (!generatePromptPath) return null;
|
|
27491
|
-
return /* @__PURE__ */ jsxs38(
|
|
27492
|
-
/* @__PURE__ */
|
|
27546
|
+
return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
27547
|
+
/* @__PURE__ */ jsx50(Text40, { color: PALETTE.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
27493
27548
|
generatePromptPath ? /* @__PURE__ */ jsxs38(Text40, { color: PALETTE.warning, children: [
|
|
27494
27549
|
"components: ",
|
|
27495
27550
|
generatePromptPath
|
|
27496
27551
|
] }) : null,
|
|
27497
|
-
/* @__PURE__ */
|
|
27552
|
+
/* @__PURE__ */ jsx50(Text40, { color: PALETTE.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
27498
27553
|
] });
|
|
27499
27554
|
}
|
|
27500
27555
|
|
|
27501
27556
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/DoneStep.tsx
|
|
27502
|
-
import { Box as
|
|
27557
|
+
import { Box as Box39, Text as Text42 } from "ink";
|
|
27503
27558
|
|
|
27504
27559
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/contentful-urls.ts
|
|
27505
27560
|
function normalizeHost(host) {
|
|
@@ -27515,26 +27570,26 @@ function buildPostPushUrl2({ host, spaceId, environmentId, view = "components" }
|
|
|
27515
27570
|
}
|
|
27516
27571
|
|
|
27517
27572
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/SpaceEnvironment.tsx
|
|
27518
|
-
import { Box as
|
|
27519
|
-
import { jsx as
|
|
27573
|
+
import { Box as Box38, Text as Text41 } from "ink";
|
|
27574
|
+
import { jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
27520
27575
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
27521
|
-
return /* @__PURE__ */ jsxs39(
|
|
27522
|
-
/* @__PURE__ */
|
|
27523
|
-
/* @__PURE__ */
|
|
27524
|
-
/* @__PURE__ */
|
|
27525
|
-
/* @__PURE__ */
|
|
27526
|
-
/* @__PURE__ */
|
|
27576
|
+
return /* @__PURE__ */ jsxs39(Box38, { gap: 1, marginTop: 1, children: [
|
|
27577
|
+
/* @__PURE__ */ jsx51(Text41, { color: PALETTE.muted, children: "Space:" }),
|
|
27578
|
+
/* @__PURE__ */ jsx51(Text41, { children: spaceId }),
|
|
27579
|
+
/* @__PURE__ */ jsx51(Text41, { color: PALETTE.muted, children: "/" }),
|
|
27580
|
+
/* @__PURE__ */ jsx51(Text41, { color: PALETTE.muted, children: "Environment:" }),
|
|
27581
|
+
/* @__PURE__ */ jsx51(Text41, { children: environmentId })
|
|
27527
27582
|
] });
|
|
27528
27583
|
}
|
|
27529
27584
|
|
|
27530
27585
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/DoneStep.tsx
|
|
27531
|
-
import { Fragment as
|
|
27586
|
+
import { Fragment as Fragment17, jsx as jsx52, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
27532
27587
|
var ACTIONS = ["created", "updated", "removed"];
|
|
27533
27588
|
function EntityRows({ entity, label }) {
|
|
27534
27589
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
27535
|
-
return /* @__PURE__ */ jsxs40(
|
|
27590
|
+
return /* @__PURE__ */ jsxs40(Fragment17, { children: [
|
|
27536
27591
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs40(Text42, { children: [
|
|
27537
|
-
/* @__PURE__ */
|
|
27592
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.success, children: "\u2713" }),
|
|
27538
27593
|
" ",
|
|
27539
27594
|
plural3(entity[action]),
|
|
27540
27595
|
" ",
|
|
@@ -27548,9 +27603,9 @@ function EntityRows({ entity, label }) {
|
|
|
27548
27603
|
] });
|
|
27549
27604
|
}
|
|
27550
27605
|
function LinkRow({ title, url }) {
|
|
27551
|
-
return /* @__PURE__ */ jsxs40(
|
|
27552
|
-
/* @__PURE__ */
|
|
27553
|
-
/* @__PURE__ */
|
|
27606
|
+
return /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", children: [
|
|
27607
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.muted, children: title }),
|
|
27608
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.accent, children: url })
|
|
27554
27609
|
] });
|
|
27555
27610
|
}
|
|
27556
27611
|
function DoneStep({
|
|
@@ -27574,14 +27629,14 @@ function DoneStep({
|
|
|
27574
27629
|
const totalPushed = componentTypes.created + componentTypes.updated + componentTypes.removed + designTokens.created + designTokens.updated + designTokens.removed;
|
|
27575
27630
|
const success = totalFailed === 0;
|
|
27576
27631
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
27577
|
-
return /* @__PURE__ */ jsxs40(
|
|
27578
|
-
/* @__PURE__ */
|
|
27579
|
-
/* @__PURE__ */ jsxs40(
|
|
27580
|
-
success ? /* @__PURE__ */
|
|
27581
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */
|
|
27582
|
-
/* @__PURE__ */
|
|
27583
|
-
/* @__PURE__ */
|
|
27584
|
-
summary && /* @__PURE__ */
|
|
27632
|
+
return /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", children: [
|
|
27633
|
+
/* @__PURE__ */ jsx52(StepHeader, { step: "done" }),
|
|
27634
|
+
/* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
27635
|
+
success ? /* @__PURE__ */ jsx52(Text42, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx52(Text42, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
27636
|
+
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: [
|
|
27637
|
+
/* @__PURE__ */ jsx52(EntityRows, { entity: componentTypes, label: "Component" }),
|
|
27638
|
+
/* @__PURE__ */ jsx52(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
27639
|
+
summary && /* @__PURE__ */ jsx52(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
|
|
27585
27640
|
"Push result: ",
|
|
27586
27641
|
summary.succeeded,
|
|
27587
27642
|
"/",
|
|
@@ -27594,8 +27649,8 @@ function DoneStep({
|
|
|
27594
27649
|
] })
|
|
27595
27650
|
] }) })
|
|
27596
27651
|
] }),
|
|
27597
|
-
failures.length > 0 && /* @__PURE__ */ jsxs40(
|
|
27598
|
-
/* @__PURE__ */
|
|
27652
|
+
failures.length > 0 && /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", children: [
|
|
27653
|
+
/* @__PURE__ */ jsx52(Text42, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
27599
27654
|
failures.map((failure) => /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.error, children: [
|
|
27600
27655
|
failure.entityType,
|
|
27601
27656
|
" ",
|
|
@@ -27604,11 +27659,11 @@ function DoneStep({
|
|
|
27604
27659
|
failure.message
|
|
27605
27660
|
] }, `${failure.entityType}:${failure.entityId}`))
|
|
27606
27661
|
] }),
|
|
27607
|
-
/* @__PURE__ */
|
|
27608
|
-
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(
|
|
27609
|
-
/* @__PURE__ */
|
|
27610
|
-
produced.components && /* @__PURE__ */
|
|
27611
|
-
produced.tokens && /* @__PURE__ */
|
|
27662
|
+
/* @__PURE__ */ jsx52(SpaceEnvironment, { spaceId, environmentId }),
|
|
27663
|
+
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", gap: 1, children: [
|
|
27664
|
+
/* @__PURE__ */ jsx52(Text42, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
27665
|
+
produced.components && /* @__PURE__ */ jsx52(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
27666
|
+
produced.tokens && /* @__PURE__ */ jsx52(
|
|
27612
27667
|
LinkRow,
|
|
27613
27668
|
{
|
|
27614
27669
|
title: "View your design tokens here:",
|
|
@@ -27616,14 +27671,14 @@ function DoneStep({
|
|
|
27616
27671
|
}
|
|
27617
27672
|
)
|
|
27618
27673
|
] }),
|
|
27619
|
-
/* @__PURE__ */
|
|
27674
|
+
/* @__PURE__ */ jsx52(ControlHints, { hints: [{ keys: "Enter / q", label: "Exit" }] })
|
|
27620
27675
|
] })
|
|
27621
27676
|
] });
|
|
27622
27677
|
}
|
|
27623
27678
|
|
|
27624
27679
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PathPrompt.tsx
|
|
27625
27680
|
import { useState as useState27 } from "react";
|
|
27626
|
-
import { Box as
|
|
27681
|
+
import { Box as Box40, Text as Text43 } from "ink";
|
|
27627
27682
|
import { readdirSync as readdirSync3 } from "node:fs";
|
|
27628
27683
|
import { dirname as dirname16, basename as basename6, join as join20 } from "node:path";
|
|
27629
27684
|
|
|
@@ -27657,7 +27712,7 @@ function useBlinkingCursor() {
|
|
|
27657
27712
|
}
|
|
27658
27713
|
|
|
27659
27714
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PathPrompt.tsx
|
|
27660
|
-
import { jsx as
|
|
27715
|
+
import { jsx as jsx53, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
27661
27716
|
function autocomplete(partial) {
|
|
27662
27717
|
if (!partial) return null;
|
|
27663
27718
|
const normalized = normalizePath(partial);
|
|
@@ -27714,19 +27769,19 @@ function PathPrompt({
|
|
|
27714
27769
|
const shown = input || defaultPath;
|
|
27715
27770
|
const isPlaceholder = input === "";
|
|
27716
27771
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
27717
|
-
return /* @__PURE__ */ jsxs41(
|
|
27718
|
-
/* @__PURE__ */
|
|
27719
|
-
/* @__PURE__ */ jsxs41(
|
|
27720
|
-
/* @__PURE__ */ jsxs41(
|
|
27721
|
-
/* @__PURE__ */
|
|
27772
|
+
return /* @__PURE__ */ jsxs41(Box40, { flexDirection: "column", children: [
|
|
27773
|
+
/* @__PURE__ */ jsx53(StepHeader, { step: "push" }),
|
|
27774
|
+
/* @__PURE__ */ jsxs41(Box40, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
27775
|
+
/* @__PURE__ */ jsxs41(Box40, { gap: 1, children: [
|
|
27776
|
+
/* @__PURE__ */ jsx53(Text43, { color: PALETTE.accent, children: "?" }),
|
|
27722
27777
|
/* @__PURE__ */ jsxs41(Text43, { bold: true, children: [
|
|
27723
27778
|
label,
|
|
27724
27779
|
":"
|
|
27725
27780
|
] }),
|
|
27726
|
-
/* @__PURE__ */
|
|
27727
|
-
/* @__PURE__ */
|
|
27781
|
+
/* @__PURE__ */ jsx53(Text43, { color: isPlaceholder ? PALETTE.muted : void 0, children: shown }),
|
|
27782
|
+
/* @__PURE__ */ jsx53(Text43, { children: cursor })
|
|
27728
27783
|
] }),
|
|
27729
|
-
/* @__PURE__ */
|
|
27784
|
+
/* @__PURE__ */ jsx53(
|
|
27730
27785
|
ControlHints,
|
|
27731
27786
|
{
|
|
27732
27787
|
hints: [
|
|
@@ -27741,7 +27796,7 @@ function PathPrompt({
|
|
|
27741
27796
|
}
|
|
27742
27797
|
|
|
27743
27798
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PushingStep.tsx
|
|
27744
|
-
import { Box as
|
|
27799
|
+
import { Box as Box41, Text as Text44 } from "ink";
|
|
27745
27800
|
import { ProgressBar as ProgressBar2, ThemeProvider as ThemeProvider2 } from "@inkjs/ui";
|
|
27746
27801
|
|
|
27747
27802
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/produced.ts
|
|
@@ -27759,7 +27814,7 @@ function writtenThings({ components, tokens }) {
|
|
|
27759
27814
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
27760
27815
|
import { useEffect as useEffect19, useState as useState28 } from "react";
|
|
27761
27816
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
27762
|
-
import { jsx as
|
|
27817
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
27763
27818
|
function useTimedSpinner() {
|
|
27764
27819
|
const [elapsedSeconds, setElapsedSeconds] = useState28(0);
|
|
27765
27820
|
useEffect19(() => {
|
|
@@ -27771,32 +27826,32 @@ function useTimedSpinner() {
|
|
|
27771
27826
|
const mins = Math.floor(elapsedSeconds / 60);
|
|
27772
27827
|
const secs = elapsedSeconds % 60;
|
|
27773
27828
|
return {
|
|
27774
|
-
spinner: /* @__PURE__ */
|
|
27829
|
+
spinner: /* @__PURE__ */ jsx54(Spinner2, {}),
|
|
27775
27830
|
elapsed: mins > 0 ? `${mins}m ${secs}s` : `${secs}s`
|
|
27776
27831
|
};
|
|
27777
27832
|
}
|
|
27778
27833
|
|
|
27779
27834
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PushingStep.tsx
|
|
27780
|
-
import { jsx as
|
|
27835
|
+
import { jsx as jsx55, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
27781
27836
|
function PushingStep({ progress, produced }) {
|
|
27782
27837
|
const { elapsed } = useTimedSpinner();
|
|
27783
27838
|
const operationId = progress && progress.kind === "queued" ? progress.operationId : null;
|
|
27784
27839
|
const showGlobal = progress && progress.kind === "progress";
|
|
27785
27840
|
const showCurrent = progress && progress.kind === "progress" && progress.current ? progress.current : null;
|
|
27786
|
-
return /* @__PURE__ */ jsxs42(
|
|
27787
|
-
/* @__PURE__ */
|
|
27788
|
-
/* @__PURE__ */ jsxs42(
|
|
27841
|
+
return /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", children: [
|
|
27842
|
+
/* @__PURE__ */ jsx55(StepHeader, { step: "push" }),
|
|
27843
|
+
/* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
27789
27844
|
/* @__PURE__ */ jsxs42(Text44, { children: [
|
|
27790
27845
|
"Writing ",
|
|
27791
27846
|
writtenThings(produced),
|
|
27792
27847
|
" to your Contentful space..."
|
|
27793
27848
|
] }),
|
|
27794
|
-
operationId && /* @__PURE__ */ jsxs42(
|
|
27795
|
-
/* @__PURE__ */
|
|
27796
|
-
/* @__PURE__ */
|
|
27849
|
+
operationId && /* @__PURE__ */ jsxs42(Box41, { gap: 1, children: [
|
|
27850
|
+
/* @__PURE__ */ jsx55(Text44, { color: PALETTE.muted, children: "Operation:" }),
|
|
27851
|
+
/* @__PURE__ */ jsx55(Text44, { children: operationId })
|
|
27797
27852
|
] }),
|
|
27798
|
-
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */
|
|
27799
|
-
/* @__PURE__ */
|
|
27853
|
+
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx55(Box41, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs42(Box41, { gap: 2, children: [
|
|
27854
|
+
/* @__PURE__ */ jsx55(Box41, { width: 40, children: /* @__PURE__ */ jsx55(ThemeProvider2, { theme: PROGRESS_THEME, children: /* @__PURE__ */ jsx55(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
27800
27855
|
/* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
27801
27856
|
progress.processed,
|
|
27802
27857
|
"/",
|
|
@@ -27804,11 +27859,11 @@ function PushingStep({ progress, produced }) {
|
|
|
27804
27859
|
" entities"
|
|
27805
27860
|
] })
|
|
27806
27861
|
] }) }),
|
|
27807
|
-
showCurrent && /* @__PURE__ */ jsxs42(
|
|
27808
|
-
/* @__PURE__ */
|
|
27809
|
-
/* @__PURE__ */
|
|
27862
|
+
showCurrent && /* @__PURE__ */ jsxs42(Box41, { gap: 1, children: [
|
|
27863
|
+
/* @__PURE__ */ jsx55(Text44, { color: PALETTE.muted, children: "Now processing:" }),
|
|
27864
|
+
/* @__PURE__ */ jsx55(Text44, { children: showCurrent })
|
|
27810
27865
|
] }),
|
|
27811
|
-
/* @__PURE__ */
|
|
27866
|
+
/* @__PURE__ */ jsx55(Box41, { marginTop: 1, children: /* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
27812
27867
|
"Elapsed: ",
|
|
27813
27868
|
elapsed
|
|
27814
27869
|
] }) })
|
|
@@ -27818,7 +27873,7 @@ function PushingStep({ progress, produced }) {
|
|
|
27818
27873
|
|
|
27819
27874
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
27820
27875
|
import { useEffect as useEffect20, useState as useState29, useMemo as useMemo5 } from "react";
|
|
27821
|
-
import { Box as
|
|
27876
|
+
import { Box as Box42, Text as Text45 } from "ink";
|
|
27822
27877
|
|
|
27823
27878
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/preview-diff.ts
|
|
27824
27879
|
function computeComponentDiffLines(current, proposed, changeClassification) {
|
|
@@ -27996,7 +28051,7 @@ function usePreviewConfirmationInput(breakingWithImpact, onConfirm) {
|
|
|
27996
28051
|
}
|
|
27997
28052
|
|
|
27998
28053
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
27999
|
-
import { Fragment as
|
|
28054
|
+
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
28000
28055
|
function buildPreviewSummaryLines(preview) {
|
|
28001
28056
|
const lines = [];
|
|
28002
28057
|
const { components, tokens } = preview;
|
|
@@ -28248,11 +28303,11 @@ function WizardPreviewStep({
|
|
|
28248
28303
|
return;
|
|
28249
28304
|
}
|
|
28250
28305
|
});
|
|
28251
|
-
return /* @__PURE__ */ jsxs43(
|
|
28252
|
-
/* @__PURE__ */
|
|
28253
|
-
/* @__PURE__ */ jsxs43(
|
|
28254
|
-
hasAnything ? /* @__PURE__ */ jsxs43(
|
|
28255
|
-
/* @__PURE__ */
|
|
28306
|
+
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
28307
|
+
/* @__PURE__ */ jsx56(StepHeader, { step: "push" }),
|
|
28308
|
+
/* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 2, children: [
|
|
28309
|
+
hasAnything ? /* @__PURE__ */ jsxs43(Fragment18, { children: [
|
|
28310
|
+
/* @__PURE__ */ jsx56(Text45, { children: "Here's what will happen in your space:" }),
|
|
28256
28311
|
/* @__PURE__ */ jsxs43(
|
|
28257
28312
|
WindowedPanel,
|
|
28258
28313
|
{
|
|
@@ -28261,15 +28316,15 @@ function WizardPreviewStep({
|
|
|
28261
28316
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
28262
28317
|
focused: false,
|
|
28263
28318
|
children: [
|
|
28264
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */
|
|
28265
|
-
/* @__PURE__ */
|
|
28319
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx56(Text45, { color: line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
28320
|
+
/* @__PURE__ */ jsx56(Text45, { color: PALETTE.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
28266
28321
|
]
|
|
28267
28322
|
}
|
|
28268
28323
|
)
|
|
28269
|
-
] }) : /* @__PURE__ */
|
|
28270
|
-
breakingWithImpact && /* @__PURE__ */
|
|
28271
|
-
/* @__PURE__ */
|
|
28272
|
-
/* @__PURE__ */
|
|
28324
|
+
] }) : /* @__PURE__ */ jsx56(Text45, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
28325
|
+
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." }) }),
|
|
28326
|
+
/* @__PURE__ */ jsx56(SpaceEnvironment, { spaceId, environmentId }),
|
|
28327
|
+
/* @__PURE__ */ jsx56(Box42, { marginTop: 1, children: /* @__PURE__ */ jsx56(
|
|
28273
28328
|
ControlHints,
|
|
28274
28329
|
{
|
|
28275
28330
|
hints: [
|
|
@@ -28295,7 +28350,7 @@ function buildRunTeaserLine(runId) {
|
|
|
28295
28350
|
}
|
|
28296
28351
|
|
|
28297
28352
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
28298
|
-
import { jsx as
|
|
28353
|
+
import { jsx as jsx57, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
28299
28354
|
function canEditFromPreview(cdf) {
|
|
28300
28355
|
if (!cdf) return false;
|
|
28301
28356
|
return parseCDFComponents(cdf).components.length > 0;
|
|
@@ -28312,7 +28367,7 @@ function FlowScreen({
|
|
|
28312
28367
|
const content = (() => {
|
|
28313
28368
|
switch (state2.step) {
|
|
28314
28369
|
case "final-review":
|
|
28315
|
-
return /* @__PURE__ */
|
|
28370
|
+
return /* @__PURE__ */ jsx57(
|
|
28316
28371
|
GenerateReviewStep,
|
|
28317
28372
|
{
|
|
28318
28373
|
extractSessionId: state2.extractSessionId,
|
|
@@ -28329,10 +28384,10 @@ function FlowScreen({
|
|
|
28329
28384
|
}
|
|
28330
28385
|
);
|
|
28331
28386
|
case "previewing":
|
|
28332
|
-
return /* @__PURE__ */
|
|
28387
|
+
return /* @__PURE__ */ jsx57(RunningStep, { step: "push", description: "Computing diff against your Contentful space..." });
|
|
28333
28388
|
case "preview-gate":
|
|
28334
28389
|
if (!state2.serverPreview) return null;
|
|
28335
|
-
return /* @__PURE__ */
|
|
28390
|
+
return /* @__PURE__ */ jsx57(
|
|
28336
28391
|
WizardPreviewStep,
|
|
28337
28392
|
{
|
|
28338
28393
|
preview: state2.serverPreview,
|
|
@@ -28344,9 +28399,9 @@ function FlowScreen({
|
|
|
28344
28399
|
}
|
|
28345
28400
|
);
|
|
28346
28401
|
case "pushing":
|
|
28347
|
-
return /* @__PURE__ */
|
|
28402
|
+
return /* @__PURE__ */ jsx57(PushingStep, { progress: state2.pushProgress, produced });
|
|
28348
28403
|
case "path-prompt":
|
|
28349
|
-
return /* @__PURE__ */
|
|
28404
|
+
return /* @__PURE__ */ jsx57(
|
|
28350
28405
|
PathPrompt,
|
|
28351
28406
|
{
|
|
28352
28407
|
defaultPath: state2.outDir,
|
|
@@ -28355,10 +28410,10 @@ function FlowScreen({
|
|
|
28355
28410
|
}
|
|
28356
28411
|
);
|
|
28357
28412
|
case "printing":
|
|
28358
|
-
return /* @__PURE__ */
|
|
28413
|
+
return /* @__PURE__ */ jsx57(RunningStep, { step: "push", description: "Writing output files to disk..." });
|
|
28359
28414
|
case "print-gate": {
|
|
28360
28415
|
const teaser = buildRunTeaserLine(state2.lastRunId);
|
|
28361
|
-
return /* @__PURE__ */
|
|
28416
|
+
return /* @__PURE__ */ jsx57(
|
|
28362
28417
|
GateStep,
|
|
28363
28418
|
{
|
|
28364
28419
|
step: "push",
|
|
@@ -28373,7 +28428,7 @@ function FlowScreen({
|
|
|
28373
28428
|
}
|
|
28374
28429
|
case "done": {
|
|
28375
28430
|
const totalFailed = state2.pushResult.componentTypes.failed + state2.pushResult.designTokens.failed;
|
|
28376
|
-
return /* @__PURE__ */
|
|
28431
|
+
return /* @__PURE__ */ jsx57(
|
|
28377
28432
|
DoneStep,
|
|
28378
28433
|
{
|
|
28379
28434
|
componentTypes: state2.pushResult.componentTypes,
|
|
@@ -28390,7 +28445,7 @@ function FlowScreen({
|
|
|
28390
28445
|
);
|
|
28391
28446
|
}
|
|
28392
28447
|
case "preview-validation-error":
|
|
28393
|
-
return /* @__PURE__ */
|
|
28448
|
+
return /* @__PURE__ */ jsx57(
|
|
28394
28449
|
PreviewValidationErrorScreen,
|
|
28395
28450
|
{
|
|
28396
28451
|
errors: state2.previewValidationErrors,
|
|
@@ -28401,7 +28456,7 @@ function FlowScreen({
|
|
|
28401
28456
|
}
|
|
28402
28457
|
);
|
|
28403
28458
|
case "error":
|
|
28404
|
-
return /* @__PURE__ */
|
|
28459
|
+
return /* @__PURE__ */ jsx57(
|
|
28405
28460
|
ErrorStep,
|
|
28406
28461
|
{
|
|
28407
28462
|
stepName: state2.errorStep,
|
|
@@ -28412,8 +28467,8 @@ function FlowScreen({
|
|
|
28412
28467
|
);
|
|
28413
28468
|
}
|
|
28414
28469
|
})();
|
|
28415
|
-
return /* @__PURE__ */ jsxs44(
|
|
28416
|
-
/* @__PURE__ */
|
|
28470
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", children: [
|
|
28471
|
+
/* @__PURE__ */ jsx57(CustomPromptBanner, { generatePromptPath }),
|
|
28417
28472
|
content
|
|
28418
28473
|
] });
|
|
28419
28474
|
}
|
|
@@ -29186,7 +29241,7 @@ function useFlow(start, options = {}) {
|
|
|
29186
29241
|
|
|
29187
29242
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
29188
29243
|
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
29189
|
-
import { Box as
|
|
29244
|
+
import { Box as Box44, Text as Text46, useInput as useInput10 } from "ink";
|
|
29190
29245
|
init_debug_store();
|
|
29191
29246
|
|
|
29192
29247
|
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
@@ -29247,13 +29302,13 @@ async function readHelpInfo() {
|
|
|
29247
29302
|
}
|
|
29248
29303
|
|
|
29249
29304
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
29250
|
-
import { Fragment as
|
|
29305
|
+
import { Fragment as Fragment19, jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
29251
29306
|
function Section({ title, rows }) {
|
|
29252
|
-
return /* @__PURE__ */ jsxs45(
|
|
29253
|
-
/* @__PURE__ */
|
|
29254
|
-
rows.map((row) => /* @__PURE__ */ jsxs45(
|
|
29255
|
-
/* @__PURE__ */
|
|
29256
|
-
/* @__PURE__ */
|
|
29307
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", children: [
|
|
29308
|
+
/* @__PURE__ */ jsx58(Text46, { bold: true, color: PALETTE.accent, children: title }),
|
|
29309
|
+
rows.map((row) => /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
29310
|
+
/* @__PURE__ */ jsx58(Box44, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx58(Text46, { color: PALETTE.muted, children: row.label }) }),
|
|
29311
|
+
/* @__PURE__ */ jsx58(Text46, { children: row.value })
|
|
29257
29312
|
] }, row.label))
|
|
29258
29313
|
] });
|
|
29259
29314
|
}
|
|
@@ -29267,7 +29322,7 @@ function HelpScreen({ onDone }) {
|
|
|
29267
29322
|
void finishDebugRun({ outputs: {}, status: "success", exitMethod });
|
|
29268
29323
|
onDone();
|
|
29269
29324
|
};
|
|
29270
|
-
|
|
29325
|
+
useInput10((input, key) => {
|
|
29271
29326
|
if (key.return) {
|
|
29272
29327
|
leave("saved");
|
|
29273
29328
|
return;
|
|
@@ -29277,14 +29332,14 @@ function HelpScreen({ onDone }) {
|
|
|
29277
29332
|
return;
|
|
29278
29333
|
}
|
|
29279
29334
|
});
|
|
29280
|
-
return /* @__PURE__ */ jsxs45(
|
|
29281
|
-
/* @__PURE__ */
|
|
29282
|
-
info ? /* @__PURE__ */ jsxs45(
|
|
29283
|
-
/* @__PURE__ */
|
|
29284
|
-
/* @__PURE__ */
|
|
29285
|
-
/* @__PURE__ */
|
|
29286
|
-
] }) : /* @__PURE__ */
|
|
29287
|
-
/* @__PURE__ */
|
|
29335
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
29336
|
+
/* @__PURE__ */ jsx58(Text46, { bold: true, children: "Help" }),
|
|
29337
|
+
info ? /* @__PURE__ */ jsxs45(Fragment19, { children: [
|
|
29338
|
+
/* @__PURE__ */ jsx58(Section, { title: "Where things are stored", rows: info.storage }),
|
|
29339
|
+
/* @__PURE__ */ jsx58(Section, { title: "Troubleshooting", rows: info.troubleshooting }),
|
|
29340
|
+
/* @__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." })
|
|
29341
|
+
] }) : /* @__PURE__ */ jsx58(Text46, { color: PALETTE.accent, children: "Loading..." }),
|
|
29342
|
+
/* @__PURE__ */ jsx58(
|
|
29288
29343
|
ControlHints,
|
|
29289
29344
|
{
|
|
29290
29345
|
hints: [
|
|
@@ -29298,8 +29353,8 @@ function HelpScreen({ onDone }) {
|
|
|
29298
29353
|
|
|
29299
29354
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
29300
29355
|
import { useState as useState31 } from "react";
|
|
29301
|
-
import { Box as
|
|
29302
|
-
import { jsx as
|
|
29356
|
+
import { Box as Box45, Text as Text47, useInput as useInput11 } from "ink";
|
|
29357
|
+
import { jsx as jsx59, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
29303
29358
|
function SettingsScreen({
|
|
29304
29359
|
onNavigate,
|
|
29305
29360
|
onBack
|
|
@@ -29310,7 +29365,7 @@ function SettingsScreen({
|
|
|
29310
29365
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
29311
29366
|
{ label: "Debug Mode", screen: "settings-debug-mode" }
|
|
29312
29367
|
];
|
|
29313
|
-
|
|
29368
|
+
useInput11((input, key) => {
|
|
29314
29369
|
if (key.upArrow) {
|
|
29315
29370
|
setFocusIdx((i) => (i - 1 + items.length) % items.length);
|
|
29316
29371
|
return;
|
|
@@ -29330,15 +29385,15 @@ function SettingsScreen({
|
|
|
29330
29385
|
onBack();
|
|
29331
29386
|
}
|
|
29332
29387
|
});
|
|
29333
|
-
return /* @__PURE__ */ jsxs46(
|
|
29334
|
-
/* @__PURE__ */
|
|
29335
|
-
/* @__PURE__ */
|
|
29388
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29389
|
+
/* @__PURE__ */ jsx59(Text47, { bold: true, children: "Settings" }),
|
|
29390
|
+
/* @__PURE__ */ jsx59(Text47, { color: PALETTE.muted, children: " " }),
|
|
29336
29391
|
items.map((item, i) => /* @__PURE__ */ jsxs46(Text47, { color: i === focusIdx ? PALETTE.accent : void 0, children: [
|
|
29337
29392
|
i === focusIdx ? "> " : " ",
|
|
29338
29393
|
item.label
|
|
29339
29394
|
] }, item.label)),
|
|
29340
|
-
/* @__PURE__ */
|
|
29341
|
-
/* @__PURE__ */
|
|
29395
|
+
/* @__PURE__ */ jsx59(Text47, { children: " " }),
|
|
29396
|
+
/* @__PURE__ */ jsx59(
|
|
29342
29397
|
ControlHints,
|
|
29343
29398
|
{
|
|
29344
29399
|
hints: [
|
|
@@ -29353,11 +29408,11 @@ function SettingsScreen({
|
|
|
29353
29408
|
|
|
29354
29409
|
// packages/experience-design-system-cli/src/tui/settings/configuration/ConfigurationScreen.tsx
|
|
29355
29410
|
import { useState as useState35 } from "react";
|
|
29356
|
-
import { Box as
|
|
29411
|
+
import { Box as Box49, Text as Text52, useInput as useInput14 } from "ink";
|
|
29357
29412
|
|
|
29358
29413
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
29359
29414
|
import { useEffect as useEffect24, useRef as useRef15, useState as useState33 } from "react";
|
|
29360
|
-
import { Box as
|
|
29415
|
+
import { Box as Box47, Text as Text50, useInput as useInput12 } from "ink";
|
|
29361
29416
|
init_debug_store();
|
|
29362
29417
|
|
|
29363
29418
|
// packages/experience-design-system-cli/src/tui/settings/shared/debug-trail.ts
|
|
@@ -29686,11 +29741,11 @@ async function writeAgentConfig(config) {
|
|
|
29686
29741
|
|
|
29687
29742
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
29688
29743
|
import { useEffect as useEffect23, useState as useState32 } from "react";
|
|
29689
|
-
import { Box as
|
|
29744
|
+
import { Box as Box46, Text as Text49 } from "ink";
|
|
29690
29745
|
|
|
29691
29746
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentStatusBadge.tsx
|
|
29692
29747
|
import { Text as Text48 } from "ink";
|
|
29693
|
-
import { jsx as
|
|
29748
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
29694
29749
|
var TONE_COLOR = {
|
|
29695
29750
|
ok: PALETTE.success,
|
|
29696
29751
|
bad: PALETTE.error,
|
|
@@ -29702,7 +29757,7 @@ function AgentStatusBadge({
|
|
|
29702
29757
|
binary
|
|
29703
29758
|
}) {
|
|
29704
29759
|
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name, checks, binary) : "checking"];
|
|
29705
|
-
return /* @__PURE__ */
|
|
29760
|
+
return /* @__PURE__ */ jsx60(Text48, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
29706
29761
|
}
|
|
29707
29762
|
|
|
29708
29763
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/apply-binary-overrides.ts
|
|
@@ -29724,16 +29779,16 @@ function applyBinaryOverrides(config) {
|
|
|
29724
29779
|
}
|
|
29725
29780
|
|
|
29726
29781
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
29727
|
-
import { jsx as
|
|
29782
|
+
import { jsx as jsx61, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
29728
29783
|
var fields = (name) => [
|
|
29729
29784
|
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[name]}\` from the PATH)` },
|
|
29730
29785
|
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
29731
29786
|
];
|
|
29732
29787
|
var INSPECT_DELAY_MS = 400;
|
|
29733
29788
|
function StatusHeading() {
|
|
29734
|
-
return /* @__PURE__ */ jsxs47(
|
|
29735
|
-
/* @__PURE__ */
|
|
29736
|
-
/* @__PURE__ */
|
|
29789
|
+
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
29790
|
+
/* @__PURE__ */ jsx61(Text49, { bold: true, color: PALETTE.muted, children: "STATUS" }),
|
|
29791
|
+
/* @__PURE__ */ jsx61(Text49, { color: PALETTE.muted, children: "\xB7 read only" })
|
|
29737
29792
|
] });
|
|
29738
29793
|
}
|
|
29739
29794
|
function AgentDetail({
|
|
@@ -29796,7 +29851,7 @@ function AgentDetail({
|
|
|
29796
29851
|
};
|
|
29797
29852
|
const formFields = fields(name);
|
|
29798
29853
|
const labelWidth = formLabelWidth([...formFields, action]);
|
|
29799
|
-
return /* @__PURE__ */
|
|
29854
|
+
return /* @__PURE__ */ jsx61(
|
|
29800
29855
|
FieldForm,
|
|
29801
29856
|
{
|
|
29802
29857
|
title: `Settings \u203A Configuration \u203A Agents \u203A ${AGENT_LABELS[name]}`,
|
|
@@ -29813,16 +29868,16 @@ function AgentDetail({
|
|
|
29813
29868
|
actions: [action],
|
|
29814
29869
|
notice: testing ? null : notice,
|
|
29815
29870
|
busy: saving || testing,
|
|
29816
|
-
children: /* @__PURE__ */ jsxs47(
|
|
29817
|
-
/* @__PURE__ */
|
|
29818
|
-
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */
|
|
29871
|
+
children: /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", marginTop: 1, children: [
|
|
29872
|
+
/* @__PURE__ */ jsx61(StatusHeading, {}),
|
|
29873
|
+
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))
|
|
29819
29874
|
] })
|
|
29820
29875
|
}
|
|
29821
29876
|
);
|
|
29822
29877
|
}
|
|
29823
29878
|
|
|
29824
29879
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
29825
|
-
import { Fragment as
|
|
29880
|
+
import { Fragment as Fragment20, jsx as jsx62, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
29826
29881
|
var NAME_WIDTH = 16;
|
|
29827
29882
|
var PANEL_LABEL_WIDTH = "Command".length;
|
|
29828
29883
|
function AgentsScreen({ onDone }) {
|
|
@@ -29900,7 +29955,7 @@ function AgentsScreen({ onDone }) {
|
|
|
29900
29955
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
29901
29956
|
}).finally(() => setSaving(false));
|
|
29902
29957
|
};
|
|
29903
|
-
|
|
29958
|
+
useInput12((input, key) => {
|
|
29904
29959
|
if (loadError && (key.escape || input === "q")) {
|
|
29905
29960
|
endVisit(null);
|
|
29906
29961
|
onDone();
|
|
@@ -29932,21 +29987,21 @@ function AgentsScreen({ onDone }) {
|
|
|
29932
29987
|
}
|
|
29933
29988
|
});
|
|
29934
29989
|
if (!config) {
|
|
29935
|
-
return /* @__PURE__ */ jsxs48(
|
|
29936
|
-
/* @__PURE__ */
|
|
29937
|
-
/* @__PURE__ */
|
|
29938
|
-
loadError ? /* @__PURE__ */ jsxs48(
|
|
29990
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29991
|
+
/* @__PURE__ */ jsx62(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
29992
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
29993
|
+
loadError ? /* @__PURE__ */ jsxs48(Fragment20, { children: [
|
|
29939
29994
|
/* @__PURE__ */ jsxs48(Text50, { color: PALETTE.error, children: [
|
|
29940
29995
|
"\u2717 Could not read the settings: ",
|
|
29941
29996
|
loadError
|
|
29942
29997
|
] }),
|
|
29943
|
-
/* @__PURE__ */
|
|
29944
|
-
/* @__PURE__ */
|
|
29945
|
-
] }) : /* @__PURE__ */
|
|
29998
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
29999
|
+
/* @__PURE__ */ jsx62(ControlHints, { hints: [{ keys: "Esc/q", label: "back" }] })
|
|
30000
|
+
] }) : /* @__PURE__ */ jsx62(Text50, { color: PALETTE.accent, children: "Loading..." })
|
|
29946
30001
|
] });
|
|
29947
30002
|
}
|
|
29948
30003
|
if (open) {
|
|
29949
|
-
return /* @__PURE__ */
|
|
30004
|
+
return /* @__PURE__ */ jsx62(
|
|
29950
30005
|
AgentDetail,
|
|
29951
30006
|
{
|
|
29952
30007
|
name: open,
|
|
@@ -29967,48 +30022,48 @@ function AgentsScreen({ onDone }) {
|
|
|
29967
30022
|
);
|
|
29968
30023
|
}
|
|
29969
30024
|
const focusedAgent = AGENT_NAMES[focus];
|
|
29970
|
-
return /* @__PURE__ */ jsxs48(
|
|
29971
|
-
/* @__PURE__ */
|
|
29972
|
-
/* @__PURE__ */
|
|
29973
|
-
/* @__PURE__ */
|
|
29974
|
-
/* @__PURE__ */
|
|
29975
|
-
/* @__PURE__ */ jsxs48(
|
|
29976
|
-
/* @__PURE__ */
|
|
29977
|
-
/* @__PURE__ */
|
|
29978
|
-
saving && /* @__PURE__ */
|
|
30025
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
30026
|
+
/* @__PURE__ */ jsx62(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
30027
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
30028
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
30029
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
30030
|
+
/* @__PURE__ */ jsxs48(Box47, { gap: 1, children: [
|
|
30031
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "Default agent" }),
|
|
30032
|
+
/* @__PURE__ */ jsx62(Text50, { bold: true, children: AGENT_LABELS[config.defaultAgent] }),
|
|
30033
|
+
saving && /* @__PURE__ */ jsx62(Text50, { color: PALETTE.accent, children: "\u2026 saving" })
|
|
29979
30034
|
] }),
|
|
29980
|
-
/* @__PURE__ */ jsxs48(
|
|
29981
|
-
/* @__PURE__ */
|
|
29982
|
-
/* @__PURE__ */
|
|
29983
|
-
/* @__PURE__ */
|
|
29984
|
-
/* @__PURE__ */
|
|
30035
|
+
/* @__PURE__ */ jsxs48(Box47, { marginTop: 1, gap: 1, children: [
|
|
30036
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
30037
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
30038
|
+
/* @__PURE__ */ jsx62(Box47, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
30039
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: "STATUS" })
|
|
29985
30040
|
] }),
|
|
29986
30041
|
AGENT_NAMES.map((name) => {
|
|
29987
30042
|
const isFocused = focusedAgent === name;
|
|
29988
|
-
return /* @__PURE__ */ jsxs48(
|
|
29989
|
-
/* @__PURE__ */
|
|
29990
|
-
/* @__PURE__ */
|
|
29991
|
-
/* @__PURE__ */
|
|
29992
|
-
/* @__PURE__ */
|
|
30043
|
+
return /* @__PURE__ */ jsxs48(Box47, { gap: 1, children: [
|
|
30044
|
+
/* @__PURE__ */ jsx62(Text50, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
30045
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
|
|
30046
|
+
/* @__PURE__ */ jsx62(Box47, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text50, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
|
|
30047
|
+
/* @__PURE__ */ jsx62(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
|
|
29993
30048
|
] }, name);
|
|
29994
30049
|
}),
|
|
29995
|
-
/* @__PURE__ */ jsxs48(
|
|
29996
|
-
/* @__PURE__ */
|
|
29997
|
-
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(
|
|
29998
|
-
/* @__PURE__ */
|
|
29999
|
-
/* @__PURE__ */
|
|
30050
|
+
/* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", marginTop: 1, children: [
|
|
30051
|
+
/* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
30052
|
+
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(Box47, { gap: 1, paddingLeft: 1, children: [
|
|
30053
|
+
/* @__PURE__ */ jsx62(Box47, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text50, { color: PALETTE.muted, children: row.label }) }),
|
|
30054
|
+
/* @__PURE__ */ jsx62(Text50, { color: TONE_COLOR[row.tone], children: row.value })
|
|
30000
30055
|
] }, row.label))
|
|
30001
30056
|
] }),
|
|
30002
|
-
notice && /* @__PURE__ */ jsxs48(
|
|
30003
|
-
/* @__PURE__ */
|
|
30057
|
+
notice && /* @__PURE__ */ jsxs48(Fragment20, { children: [
|
|
30058
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
30004
30059
|
/* @__PURE__ */ jsxs48(Text50, { bold: true, color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
30005
30060
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
30006
30061
|
" ",
|
|
30007
30062
|
notice.text
|
|
30008
30063
|
] })
|
|
30009
30064
|
] }),
|
|
30010
|
-
/* @__PURE__ */
|
|
30011
|
-
/* @__PURE__ */
|
|
30065
|
+
/* @__PURE__ */ jsx62(Text50, { children: " " }),
|
|
30066
|
+
/* @__PURE__ */ jsx62(
|
|
30012
30067
|
ControlHints,
|
|
30013
30068
|
{
|
|
30014
30069
|
hints: [
|
|
@@ -30024,7 +30079,7 @@ function AgentsScreen({ onDone }) {
|
|
|
30024
30079
|
|
|
30025
30080
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
30026
30081
|
import { useEffect as useEffect25, useRef as useRef16, useState as useState34 } from "react";
|
|
30027
|
-
import { Box as
|
|
30082
|
+
import { Box as Box48, Text as Text51, useInput as useInput13 } from "ink";
|
|
30028
30083
|
init_debug_store();
|
|
30029
30084
|
|
|
30030
30085
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/project-store.ts
|
|
@@ -30053,7 +30108,7 @@ async function writeCredentials(config) {
|
|
|
30053
30108
|
}
|
|
30054
30109
|
|
|
30055
30110
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
30056
|
-
import { Fragment as
|
|
30111
|
+
import { Fragment as Fragment21, jsx as jsx63, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
30057
30112
|
var FIELDS3 = [
|
|
30058
30113
|
{ key: "spaceId", label: "Space ID" },
|
|
30059
30114
|
{ key: "environmentId", label: "Environment ID" },
|
|
@@ -30126,24 +30181,24 @@ function ProjectScreen({ onDone }) {
|
|
|
30126
30181
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
30127
30182
|
});
|
|
30128
30183
|
};
|
|
30129
|
-
|
|
30184
|
+
useInput13((input, key) => {
|
|
30130
30185
|
if (!config && loadError && (key.escape || input === "q")) {
|
|
30131
30186
|
endVisit(null);
|
|
30132
30187
|
onDone();
|
|
30133
30188
|
}
|
|
30134
30189
|
});
|
|
30135
30190
|
if (!config) {
|
|
30136
|
-
return /* @__PURE__ */ jsxs49(
|
|
30137
|
-
/* @__PURE__ */
|
|
30138
|
-
/* @__PURE__ */
|
|
30139
|
-
loadError ? /* @__PURE__ */ jsxs49(
|
|
30191
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
30192
|
+
/* @__PURE__ */ jsx63(Text51, { bold: true, children: "Settings \u203A Configuration \u203A Project" }),
|
|
30193
|
+
/* @__PURE__ */ jsx63(Text51, { children: " " }),
|
|
30194
|
+
loadError ? /* @__PURE__ */ jsxs49(Fragment21, { children: [
|
|
30140
30195
|
/* @__PURE__ */ jsxs49(Text51, { color: PALETTE.error, children: [
|
|
30141
30196
|
"\u2717 Could not read the settings: ",
|
|
30142
30197
|
loadError
|
|
30143
30198
|
] }),
|
|
30144
|
-
/* @__PURE__ */
|
|
30145
|
-
/* @__PURE__ */
|
|
30146
|
-
] }) : /* @__PURE__ */
|
|
30199
|
+
/* @__PURE__ */ jsx63(Text51, { children: " " }),
|
|
30200
|
+
/* @__PURE__ */ jsx63(ControlHints, { hints: [{ keys: "Esc/q", label: "back" }] })
|
|
30201
|
+
] }) : /* @__PURE__ */ jsx63(Text51, { color: PALETTE.accent, children: "Loading..." })
|
|
30147
30202
|
] });
|
|
30148
30203
|
}
|
|
30149
30204
|
const save = () => {
|
|
@@ -30164,7 +30219,7 @@ function ProjectScreen({ onDone }) {
|
|
|
30164
30219
|
endVisit(config);
|
|
30165
30220
|
onDone();
|
|
30166
30221
|
};
|
|
30167
|
-
return /* @__PURE__ */
|
|
30222
|
+
return /* @__PURE__ */ jsx63(
|
|
30168
30223
|
FieldForm,
|
|
30169
30224
|
{
|
|
30170
30225
|
title: "Settings \u203A Configuration \u203A Project",
|
|
@@ -30186,7 +30241,7 @@ function ProjectScreen({ onDone }) {
|
|
|
30186
30241
|
}
|
|
30187
30242
|
|
|
30188
30243
|
// packages/experience-design-system-cli/src/tui/settings/configuration/ConfigurationScreen.tsx
|
|
30189
|
-
import { jsx as
|
|
30244
|
+
import { jsx as jsx64, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
30190
30245
|
var SECTIONS = [
|
|
30191
30246
|
{
|
|
30192
30247
|
id: "project",
|
|
@@ -30199,7 +30254,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
30199
30254
|
const [focus, setFocus] = useState35(0);
|
|
30200
30255
|
const [open, setOpen] = useState35(null);
|
|
30201
30256
|
const close = () => setOpen(null);
|
|
30202
|
-
|
|
30257
|
+
useInput14((input, key) => {
|
|
30203
30258
|
if (open) return;
|
|
30204
30259
|
if (key.upArrow) {
|
|
30205
30260
|
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
@@ -30215,18 +30270,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
30215
30270
|
}
|
|
30216
30271
|
if (key.escape || input === "q") onDone();
|
|
30217
30272
|
});
|
|
30218
|
-
if (open === "project") return /* @__PURE__ */
|
|
30219
|
-
if (open === "agents") return /* @__PURE__ */
|
|
30220
|
-
return /* @__PURE__ */ jsxs50(
|
|
30221
|
-
/* @__PURE__ */
|
|
30222
|
-
/* @__PURE__ */
|
|
30223
|
-
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(
|
|
30224
|
-
/* @__PURE__ */
|
|
30225
|
-
/* @__PURE__ */
|
|
30226
|
-
/* @__PURE__ */
|
|
30273
|
+
if (open === "project") return /* @__PURE__ */ jsx64(ProjectScreen, { onDone: close });
|
|
30274
|
+
if (open === "agents") return /* @__PURE__ */ jsx64(AgentsScreen, { onDone: close });
|
|
30275
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
30276
|
+
/* @__PURE__ */ jsx64(Text52, { bold: true, children: "Settings \u203A Configuration" }),
|
|
30277
|
+
/* @__PURE__ */ jsx64(Text52, { children: " " }),
|
|
30278
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(Box49, { gap: 1, children: [
|
|
30279
|
+
/* @__PURE__ */ jsx64(Text52, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
30280
|
+
/* @__PURE__ */ jsx64(Box49, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx64(Text52, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
30281
|
+
/* @__PURE__ */ jsx64(Text52, { color: PALETTE.muted, children: section.description })
|
|
30227
30282
|
] }, section.id)),
|
|
30228
|
-
/* @__PURE__ */
|
|
30229
|
-
/* @__PURE__ */
|
|
30283
|
+
/* @__PURE__ */ jsx64(Text52, { children: " " }),
|
|
30284
|
+
/* @__PURE__ */ jsx64(
|
|
30230
30285
|
ControlHints,
|
|
30231
30286
|
{
|
|
30232
30287
|
hints: [
|
|
@@ -30241,7 +30296,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
30241
30296
|
|
|
30242
30297
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
30243
30298
|
import { useEffect as useEffect26, useState as useState36 } from "react";
|
|
30244
|
-
import { Box as
|
|
30299
|
+
import { Box as Box50, Text as Text53, useInput as useInput15 } from "ink";
|
|
30245
30300
|
|
|
30246
30301
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
30247
30302
|
async function readAnalyticsSetting() {
|
|
@@ -30260,7 +30315,7 @@ async function writeAnalyticsSetting(setting) {
|
|
|
30260
30315
|
|
|
30261
30316
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
30262
30317
|
init_debug_store();
|
|
30263
|
-
import { Fragment as
|
|
30318
|
+
import { Fragment as Fragment22, jsx as jsx65, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
30264
30319
|
function OptInAnalyticsScreen({ onDone }) {
|
|
30265
30320
|
const [loading, setLoading] = useState36(true);
|
|
30266
30321
|
const [enabled, setEnabled] = useState36(true);
|
|
@@ -30276,7 +30331,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
30276
30331
|
});
|
|
30277
30332
|
});
|
|
30278
30333
|
}, []);
|
|
30279
|
-
|
|
30334
|
+
useInput15((input, key) => {
|
|
30280
30335
|
if (loading) return;
|
|
30281
30336
|
if (key.return || input === " ") {
|
|
30282
30337
|
setEnabled((current) => {
|
|
@@ -30291,21 +30346,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
30291
30346
|
onDone();
|
|
30292
30347
|
}
|
|
30293
30348
|
});
|
|
30294
|
-
return /* @__PURE__ */ jsxs51(
|
|
30295
|
-
/* @__PURE__ */
|
|
30296
|
-
/* @__PURE__ */
|
|
30297
|
-
loading ? /* @__PURE__ */
|
|
30349
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
30350
|
+
/* @__PURE__ */ jsx65(Text53, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
30351
|
+
/* @__PURE__ */ jsx65(Text53, { children: " " }),
|
|
30352
|
+
loading ? /* @__PURE__ */ jsx65(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs51(Fragment22, { children: [
|
|
30298
30353
|
/* @__PURE__ */ jsxs51(Text53, { children: [
|
|
30299
30354
|
"Share anonymous usage data:",
|
|
30300
30355
|
" ",
|
|
30301
|
-
/* @__PURE__ */
|
|
30356
|
+
/* @__PURE__ */ jsx65(Text53, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
30302
30357
|
] }),
|
|
30303
|
-
/* @__PURE__ */
|
|
30304
|
-
/* @__PURE__ */
|
|
30305
|
-
/* @__PURE__ */
|
|
30358
|
+
/* @__PURE__ */ jsx65(Text53, { children: " " }),
|
|
30359
|
+
/* @__PURE__ */ jsx65(Text53, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
30360
|
+
/* @__PURE__ */ jsx65(Text53, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
30306
30361
|
] }),
|
|
30307
|
-
/* @__PURE__ */
|
|
30308
|
-
/* @__PURE__ */
|
|
30362
|
+
/* @__PURE__ */ jsx65(Text53, { children: " " }),
|
|
30363
|
+
/* @__PURE__ */ jsx65(
|
|
30309
30364
|
ControlHints,
|
|
30310
30365
|
{
|
|
30311
30366
|
hints: [
|
|
@@ -30319,10 +30374,10 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
30319
30374
|
|
|
30320
30375
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
30321
30376
|
import { useEffect as useEffect27, useRef as useRef17, useState as useState37 } from "react";
|
|
30322
|
-
import { Box as
|
|
30377
|
+
import { Box as Box51, Text as Text54, useInput as useInput16 } from "ink";
|
|
30323
30378
|
init_debug_mode_store();
|
|
30324
30379
|
init_debug_store();
|
|
30325
|
-
import { Fragment as
|
|
30380
|
+
import { Fragment as Fragment23, jsx as jsx66, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
30326
30381
|
var ROWS = ["enabled", "retentionDays"];
|
|
30327
30382
|
var snapshotOf2 = (setting) => ({
|
|
30328
30383
|
enabled: String(setting.enabled),
|
|
@@ -30376,7 +30431,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
30376
30431
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
30377
30432
|
});
|
|
30378
30433
|
};
|
|
30379
|
-
|
|
30434
|
+
useInput16((input, key) => {
|
|
30380
30435
|
if (!setting) return;
|
|
30381
30436
|
if (key.upArrow || key.downArrow) {
|
|
30382
30437
|
setFocus((current) => ROWS[(ROWS.indexOf(current) + (key.downArrow ? 1 : ROWS.length - 1)) % ROWS.length]);
|
|
@@ -30403,24 +30458,24 @@ function DebugModeScreen({ onDone }) {
|
|
|
30403
30458
|
onDone();
|
|
30404
30459
|
}
|
|
30405
30460
|
});
|
|
30406
|
-
const marker = (row) => /* @__PURE__ */
|
|
30407
|
-
const label = (row, text) => /* @__PURE__ */
|
|
30408
|
-
return /* @__PURE__ */ jsxs52(
|
|
30409
|
-
/* @__PURE__ */
|
|
30410
|
-
/* @__PURE__ */
|
|
30411
|
-
setting ? /* @__PURE__ */ jsxs52(
|
|
30412
|
-
/* @__PURE__ */ jsxs52(
|
|
30461
|
+
const marker = (row) => /* @__PURE__ */ jsx66(Text54, { color: focus === row ? PALETTE.accent : void 0, children: focus === row ? "\u276F" : " " });
|
|
30462
|
+
const label = (row, text) => /* @__PURE__ */ jsx66(Text54, { bold: focus === row, color: focus === row ? PALETTE.accent : PALETTE.muted, children: text });
|
|
30463
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
30464
|
+
/* @__PURE__ */ jsx66(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
30465
|
+
/* @__PURE__ */ jsx66(Text54, { children: " " }),
|
|
30466
|
+
setting ? /* @__PURE__ */ jsxs52(Fragment23, { children: [
|
|
30467
|
+
/* @__PURE__ */ jsxs52(Box51, { gap: 1, children: [
|
|
30413
30468
|
marker("enabled"),
|
|
30414
30469
|
label("enabled", "Debug logging:"),
|
|
30415
|
-
/* @__PURE__ */
|
|
30470
|
+
/* @__PURE__ */ jsx66(Text54, { bold: true, color: setting.enabled ? PALETTE.success : PALETTE.muted, children: setting.enabled ? "On" : "Off" })
|
|
30416
30471
|
] }),
|
|
30417
|
-
/* @__PURE__ */ jsxs52(
|
|
30472
|
+
/* @__PURE__ */ jsxs52(Box51, { gap: 1, children: [
|
|
30418
30473
|
marker("retentionDays"),
|
|
30419
30474
|
label("retentionDays", "Delete logs after:"),
|
|
30420
30475
|
RETENTION_CHOICES.map((days) => {
|
|
30421
30476
|
const highlighted = focus === "retentionDays" && days === pending;
|
|
30422
30477
|
const saved = days === setting.retentionDays;
|
|
30423
|
-
return /* @__PURE__ */
|
|
30478
|
+
return /* @__PURE__ */ jsx66(
|
|
30424
30479
|
Text54,
|
|
30425
30480
|
{
|
|
30426
30481
|
bold: highlighted || saved,
|
|
@@ -30432,15 +30487,15 @@ function DebugModeScreen({ onDone }) {
|
|
|
30432
30487
|
);
|
|
30433
30488
|
})
|
|
30434
30489
|
] }),
|
|
30435
|
-
/* @__PURE__ */
|
|
30490
|
+
/* @__PURE__ */ jsx66(Text54, { children: " " }),
|
|
30436
30491
|
notice ? /* @__PURE__ */ jsxs52(Text54, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
30437
30492
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
30438
30493
|
" ",
|
|
30439
30494
|
notice.text
|
|
30440
|
-
] }) : /* @__PURE__ */
|
|
30441
|
-
] }) : /* @__PURE__ */
|
|
30442
|
-
/* @__PURE__ */
|
|
30443
|
-
/* @__PURE__ */
|
|
30495
|
+
] }) : /* @__PURE__ */ jsx66(Text54, { color: PALETTE.muted, children: "\u2713 marks what is saved. Older logs are deleted the next time the CLI starts." })
|
|
30496
|
+
] }) : /* @__PURE__ */ jsx66(Text54, { color: PALETTE.muted, children: "Loading\u2026" }),
|
|
30497
|
+
/* @__PURE__ */ jsx66(Text54, { children: " " }),
|
|
30498
|
+
/* @__PURE__ */ jsx66(
|
|
30444
30499
|
ControlHints,
|
|
30445
30500
|
{
|
|
30446
30501
|
hints: [
|
|
@@ -30457,7 +30512,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
30457
30512
|
}
|
|
30458
30513
|
|
|
30459
30514
|
// packages/experience-design-system-cli/app.tsx
|
|
30460
|
-
import { Fragment as
|
|
30515
|
+
import { Fragment as Fragment24, jsx as jsx67 } from "react/jsx-runtime";
|
|
30461
30516
|
function App({ importOptions, inkClear }) {
|
|
30462
30517
|
const [screen, setScreen] = useState38("start");
|
|
30463
30518
|
const [importExitCode, setImportExitCode] = useState38();
|
|
@@ -30648,9 +30703,9 @@ function App({ importOptions, inkClear }) {
|
|
|
30648
30703
|
};
|
|
30649
30704
|
switch (screen) {
|
|
30650
30705
|
case "import":
|
|
30651
|
-
if (showImportResult) return /* @__PURE__ */
|
|
30706
|
+
if (showImportResult) return /* @__PURE__ */ jsx67(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
30652
30707
|
if (flow && flowStart) {
|
|
30653
|
-
return /* @__PURE__ */
|
|
30708
|
+
return /* @__PURE__ */ jsx67(
|
|
30654
30709
|
FlowScreen,
|
|
30655
30710
|
{
|
|
30656
30711
|
state: flow.state,
|
|
@@ -30660,15 +30715,15 @@ function App({ importOptions, inkClear }) {
|
|
|
30660
30715
|
}
|
|
30661
30716
|
);
|
|
30662
30717
|
}
|
|
30663
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
30718
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx67(Fragment24, {});
|
|
30664
30719
|
if (target === void 0) {
|
|
30665
|
-
return /* @__PURE__ */
|
|
30720
|
+
return /* @__PURE__ */ jsx67(PreflightScreen, { onChoose: setTarget, onQuit: leaveImport });
|
|
30666
30721
|
}
|
|
30667
30722
|
const inputStep = currentInputStep(target, answers);
|
|
30668
30723
|
if (!extractionRun && !tokensOnlyRun && inputStep !== "credentials") {
|
|
30669
30724
|
switch (inputStep) {
|
|
30670
30725
|
case "project":
|
|
30671
|
-
return /* @__PURE__ */
|
|
30726
|
+
return /* @__PURE__ */ jsx67(
|
|
30672
30727
|
WelcomeScreen,
|
|
30673
30728
|
{
|
|
30674
30729
|
onContinue: (projectPath) => answer({ projectPath }),
|
|
@@ -30677,7 +30732,7 @@ function App({ importOptions, inkClear }) {
|
|
|
30677
30732
|
}
|
|
30678
30733
|
);
|
|
30679
30734
|
case "token-file":
|
|
30680
|
-
return /* @__PURE__ */
|
|
30735
|
+
return /* @__PURE__ */ jsx67(
|
|
30681
30736
|
TokenInputScreen,
|
|
30682
30737
|
{
|
|
30683
30738
|
initialPath: importDefaults.tokenFile,
|
|
@@ -30686,7 +30741,7 @@ function App({ importOptions, inkClear }) {
|
|
|
30686
30741
|
}
|
|
30687
30742
|
);
|
|
30688
30743
|
case "path-validation":
|
|
30689
|
-
return /* @__PURE__ */
|
|
30744
|
+
return /* @__PURE__ */ jsx67(
|
|
30690
30745
|
PathValidationScreen,
|
|
30691
30746
|
{
|
|
30692
30747
|
projectPath: answers.projectPath ?? "",
|
|
@@ -30700,9 +30755,9 @@ function App({ importOptions, inkClear }) {
|
|
|
30700
30755
|
}
|
|
30701
30756
|
if (tokensOnlyRun) {
|
|
30702
30757
|
if (tokensOnly?.status === "done" && !tokensOnly.result.ok) {
|
|
30703
|
-
return /* @__PURE__ */
|
|
30758
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: tokensOnly.result.step, message: tokensOnly.result.message, onExit: leaveImport });
|
|
30704
30759
|
}
|
|
30705
|
-
return /* @__PURE__ */
|
|
30760
|
+
return /* @__PURE__ */ jsx67(
|
|
30706
30761
|
RunningStep,
|
|
30707
30762
|
{
|
|
30708
30763
|
step: "generation",
|
|
@@ -30713,19 +30768,19 @@ function App({ importOptions, inkClear }) {
|
|
|
30713
30768
|
}
|
|
30714
30769
|
if (extractionRun) {
|
|
30715
30770
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
30716
|
-
return /* @__PURE__ */
|
|
30771
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
30717
30772
|
}
|
|
30718
30773
|
if (extraction?.status === "running") {
|
|
30719
|
-
return /* @__PURE__ */
|
|
30774
|
+
return /* @__PURE__ */ jsx67(ExtractionScreen, { progress: extraction.progress, agent: extractionRun.input.agent });
|
|
30720
30775
|
}
|
|
30721
|
-
return /* @__PURE__ */
|
|
30776
|
+
return /* @__PURE__ */ jsx67(Fragment24, {});
|
|
30722
30777
|
}
|
|
30723
30778
|
if (scopeRun && scopeFlow) {
|
|
30724
30779
|
if (scopeFlow.status === "failed") {
|
|
30725
|
-
return /* @__PURE__ */
|
|
30780
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
30726
30781
|
}
|
|
30727
30782
|
if (scopeFlow.status === "deciding") {
|
|
30728
|
-
return /* @__PURE__ */
|
|
30783
|
+
return /* @__PURE__ */ jsx67(
|
|
30729
30784
|
ScopeGateScreen,
|
|
30730
30785
|
{
|
|
30731
30786
|
components: scopeFlow.load.components,
|
|
@@ -30735,10 +30790,10 @@ function App({ importOptions, inkClear }) {
|
|
|
30735
30790
|
);
|
|
30736
30791
|
}
|
|
30737
30792
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
30738
|
-
return /* @__PURE__ */
|
|
30793
|
+
return /* @__PURE__ */ jsx67(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
30739
30794
|
}
|
|
30740
30795
|
if (generation?.status === "running") {
|
|
30741
|
-
return /* @__PURE__ */
|
|
30796
|
+
return /* @__PURE__ */ jsx67(
|
|
30742
30797
|
GenerationScreen,
|
|
30743
30798
|
{
|
|
30744
30799
|
progress: generation.progress,
|
|
@@ -30748,9 +30803,9 @@ function App({ importOptions, inkClear }) {
|
|
|
30748
30803
|
}
|
|
30749
30804
|
);
|
|
30750
30805
|
}
|
|
30751
|
-
return /* @__PURE__ */
|
|
30806
|
+
return /* @__PURE__ */ jsx67(Fragment24, {});
|
|
30752
30807
|
}
|
|
30753
|
-
return /* @__PURE__ */
|
|
30808
|
+
return /* @__PURE__ */ jsx67(
|
|
30754
30809
|
CredentialsScreen,
|
|
30755
30810
|
{
|
|
30756
30811
|
initial: importDefaults.credentials,
|
|
@@ -30760,17 +30815,17 @@ function App({ importOptions, inkClear }) {
|
|
|
30760
30815
|
}
|
|
30761
30816
|
);
|
|
30762
30817
|
case "help":
|
|
30763
|
-
return /* @__PURE__ */
|
|
30818
|
+
return /* @__PURE__ */ jsx67(HelpScreen, { onDone: goToStart });
|
|
30764
30819
|
case "settings":
|
|
30765
|
-
return /* @__PURE__ */
|
|
30820
|
+
return /* @__PURE__ */ jsx67(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
30766
30821
|
case "settings-configuration":
|
|
30767
|
-
return /* @__PURE__ */
|
|
30822
|
+
return /* @__PURE__ */ jsx67(ConfigurationScreen, { onDone: goToSettings });
|
|
30768
30823
|
case "settings-opt-in-analytics":
|
|
30769
|
-
return /* @__PURE__ */
|
|
30824
|
+
return /* @__PURE__ */ jsx67(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
30770
30825
|
case "settings-debug-mode":
|
|
30771
|
-
return /* @__PURE__ */
|
|
30826
|
+
return /* @__PURE__ */ jsx67(DebugModeScreen, { onDone: goToSettings });
|
|
30772
30827
|
case "start":
|
|
30773
|
-
return /* @__PURE__ */
|
|
30828
|
+
return /* @__PURE__ */ jsx67(HomeScreen, { onNavigate: setScreen });
|
|
30774
30829
|
}
|
|
30775
30830
|
}
|
|
30776
30831
|
async function runApp(renderApp, importOptions) {
|
|
@@ -30778,7 +30833,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
30778
30833
|
instance.clear?.();
|
|
30779
30834
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
30780
30835
|
};
|
|
30781
|
-
const instance = renderApp(/* @__PURE__ */
|
|
30836
|
+
const instance = renderApp(/* @__PURE__ */ jsx67(App, { importOptions, inkClear }));
|
|
30782
30837
|
await instance.waitUntilExit();
|
|
30783
30838
|
}
|
|
30784
30839
|
export {
|